Compare commits

..

20 Commits

Author SHA1 Message Date
Michael Scire
9377be2525 sm: fix wait list reentrancy and state on processing loop entry 2020-12-31 15:53:32 -08:00
Michael Scire
30336362f4 sm: implement accurate request deferral semantics 2020-12-31 00:29:06 -08:00
Michael Scire
24111d46a1 git subrepo push libraries
subrepo:
  subdir:   "libraries"
  merged:   "b05ba02f"
upstream:
  origin:   "https://github.com/Atmosphere-NX/Atmosphere-libs"
  branch:   "master"
  commit:   "b05ba02f"
git-subrepo:
  version:  "0.4.1"
  origin:   "???"
  commit:   "???"
2020-12-29 13:08:25 -08:00
Michael Scire
f2a6a4a6e6 fusee: fix sept enc header dependency 2020-12-29 13:07:48 -08:00
Michael Scire
6633af769e boot: fix rebuild-every-time-make-is-invoked 2020-12-29 13:01:06 -08:00
Michael Scire
131c8609c8 libmeso: explicitly blacklist ::sdmmc::, instead of relying on incorrect board tricks 2020-12-29 12:36:26 -08:00
Michael Scire
30e70e20d8 strat: fix board namespacing for nintendo::nx 2020-12-29 12:30:43 -08:00
Michael Scire
a26e8ac54f ams: resolve source dir inconsistency 2020-12-29 12:28:07 -08:00
Michael Scire
8bfda27e0e kern: remove target-firmware logic for kernel loader 2020-12-29 12:21:41 -08:00
Michael Scire
0c9cb830f7 git subrepo push libraries
subrepo:
  subdir:   "libraries"
  merged:   "be8388d6"
upstream:
  origin:   "https://github.com/Atmosphere-NX/Atmosphere-libs"
  branch:   "master"
  commit:   "be8388d6"
git-subrepo:
  version:  "0.4.1"
  origin:   "???"
  commit:   "???"
2020-12-28 17:34:31 -08:00
Michael Scire
ee1b638dde svc: we support kernel version 15.4 2020-12-28 17:33:45 -08:00
Michael Scire
9826358533 ams: update five -> aula, per CalWriterManu 2020-12-28 15:54:25 -08:00
Michael Scire
113ab8439d kern: fix KTrace buffer memory region type to match official kernel 2020-12-28 00:57:45 -08:00
ameerj
60c888126b fix typo in KServerPort::Destroy() 2020-12-25 20:23:10 -08:00
Michael Scire
d7b14f48d2 fusee: fix no-BCT.ini for fusee-secondary 2020-12-19 12:08:05 -08:00
Michael Scire
1085ccbe60 git subrepo push libraries
subrepo:
  subdir:   "libraries"
  merged:   "886dfaf6"
upstream:
  origin:   "https://github.com/Atmosphere-NX/Atmosphere-libs"
  branch:   "master"
  commit:   "886dfaf6"
git-subrepo:
  version:  "0.4.0"
  origin:   "???"
  commit:   "???"
2020-12-19 10:22:37 -08:00
Michael Scire
8b61537aa3 ams: bump version to 0.16.2 2020-12-19 10:21:15 -08:00
Michael Scire
968f50bc07 kern: refactor to use m_ for member variables 2020-12-18 13:31:01 -08:00
Michael Scire
0bf2ade76f ams: use default bct0 by default 2020-12-18 13:27:52 -08:00
Adubbz
35a6705d55 git subrepo pull troposphere/daybreak/nanovg/ 2020-12-17 17:19:54 -08:00
112 changed files with 570 additions and 363 deletions

View File

@@ -78,7 +78,7 @@ dist-no-debug: all
cp sept/sept-secondary/sept-secondary_01.enc atmosphere-$(AMSVER)/sept/sept-secondary_01.enc cp sept/sept-secondary/sept-secondary_01.enc atmosphere-$(AMSVER)/sept/sept-secondary_01.enc
cp sept/sept-secondary/sept-secondary_dev_00.enc atmosphere-$(AMSVER)/sept/sept-secondary_dev_00.enc cp sept/sept-secondary/sept-secondary_dev_00.enc atmosphere-$(AMSVER)/sept/sept-secondary_dev_00.enc
cp sept/sept-secondary/sept-secondary_dev_01.enc atmosphere-$(AMSVER)/sept/sept-secondary_dev_01.enc cp sept/sept-secondary/sept-secondary_dev_01.enc atmosphere-$(AMSVER)/sept/sept-secondary_dev_01.enc
cp config_templates/BCT.ini atmosphere-$(AMSVER)/atmosphere/config/BCT.ini cp config_templates/BCT.ini atmosphere-$(AMSVER)/atmosphere/config_templates/BCT.ini
cp config_templates/override_config.ini atmosphere-$(AMSVER)/atmosphere/config_templates/override_config.ini cp config_templates/override_config.ini atmosphere-$(AMSVER)/atmosphere/config_templates/override_config.ini
cp config_templates/system_settings.ini atmosphere-$(AMSVER)/atmosphere/config_templates/system_settings.ini cp config_templates/system_settings.ini atmosphere-$(AMSVER)/atmosphere/config_templates/system_settings.ini
cp config_templates/exosphere.ini atmosphere-$(AMSVER)/atmosphere/config_templates/exosphere.ini cp config_templates/exosphere.ini atmosphere-$(AMSVER)/atmosphere/config_templates/exosphere.ini

View File

@@ -1,4 +1,17 @@
# Changelog # Changelog
## 0.16.2
+ Atmosphère release zips no longer bundle BCT.ini, instead relying on defaults in code.
+ This means atmosphere updates should no longer overwrite any user configuration at all.
+ If you wish to modify BCT.ini config, copy the template from /config_templates/ as with other configuration.
+ `pgl` and `creport` were further updated to reflect differences in official behavior in 11.0.0.
+ An issue was fixed that caused creport to be launched multiple times on process crash.
+ This fixes the "duplicate reports" issue that sometimes plagued people.
+ A new system setting (`atmosphere!enable_am_debug_mode`) configuring am to use debug mode.
+ If you are not a developer or don't see a clear use for this, leave it configured to the default (off).
+ Reboot to payload NRO was updated to fix support with certain payloads.
+ Support was fixed for atmosphere's extension to support homebrew use of new (8.0.0+) kernel mappings.
+ In particular, when running tracing debug builds of `mesosphère`, hbloader now has access to the kernel trace buffer.
+ Several issues were fixed, and usability and stability were improved.
## 0.16.1 ## 0.16.1
+ Support was added for 11.0.1. + Support was added for 11.0.1.
+ `mesosphère` was updated to reflect the latest official kernel behavior. + `mesosphère` was updated to reflect the latest official kernel behavior.
@@ -7,7 +20,7 @@
+ `fs` logic was refactored and cleaned up to reflect some newer sysmodule behavioral and structural changes. + `fs` logic was refactored and cleaned up to reflect some newer sysmodule behavioral and structural changes.
+ `exosphère` was updated to allow dynamic control of what uart port is used for logging. + `exosphère` was updated to allow dynamic control of what uart port is used for logging.
+ This can be controlled by editing the `log_port`, `log_baud_rate`, and `log_inverted` fields in `exosphere.ini`. + This can be controlled by editing the `log_port`, `log_baud_rate`, and `log_inverted` fields in `exosphere.ini`.
+ `mesosphère` was updated to improve debugging capabilities (). + `mesosphère` was updated to improve debugging capabilities.
+ This is still a work in progress, but developers may be interested. + This is still a work in progress, but developers may be interested.
+ A bug was fixed that caused `fatal` to fatal error if the fatal process was already being debugged. + A bug was fixed that caused `fatal` to fatal error if the fatal process was already being debugged.
+ Several issues were fixed, and usability and stability were improved. + Several issues were fixed, and usability and stability were improved.

View File

@@ -120,7 +120,7 @@ $(OFILES) : $(ATMOSPHERE_LIBRARIES_DIR)/libexosphere/$(ATMOSPHERE_LIBRARY_DIR)/l
program.lz4.o: program_lz4.h program.lz4.o: program_lz4.h
program.lz4.o program_lz4.h: $(TOPDIR)/../program/program$(ATMOSPHERE_BUILD_TARGET_BINARY_SUFFIX).lz4 program_lz4.h: $(TOPDIR)/../program/program$(ATMOSPHERE_BUILD_TARGET_BINARY_SUFFIX).lz4
@echo $(notdir $<) @echo $(notdir $<)
@rm -rf tmp_program_$(ATMOSPHERE_BUILD_TARGET_IDENTIFIER) @rm -rf tmp_program_$(ATMOSPHERE_BUILD_TARGET_IDENTIFIER)
@mkdir -p tmp_program_$(ATMOSPHERE_BUILD_TARGET_IDENTIFIER) @mkdir -p tmp_program_$(ATMOSPHERE_BUILD_TARGET_IDENTIFIER)

View File

@@ -111,7 +111,7 @@ namespace ams::secmon::fatal {
} }
} }
void EnableBacklightForVendor2050ForHardwareTypeFive(int brightness) { void EnableBacklightForVendor2050ForAula(int brightness) {
/* Enable FRAME_END_INT */ /* Enable FRAME_END_INT */
reg::Write(g_disp1_regs + sizeof(u32) * DC_CMD_INT_ENABLE, 2); reg::Write(g_disp1_regs + sizeof(u32) * DC_CMD_INT_ENABLE, 2);
@@ -270,7 +270,7 @@ namespace ams::secmon::fatal {
reg::ClearBits(g_apb_misc_regs + PINMUX_AUX_LCD_BL_EN, reg::EncodeMask(PINMUX_REG_BITS_MASK(AUX_TRISTATE))); reg::ClearBits(g_apb_misc_regs + PINMUX_AUX_LCD_BL_EN, reg::EncodeMask(PINMUX_REG_BITS_MASK(AUX_TRISTATE)));
reg::ClearBits(g_apb_misc_regs + PINMUX_AUX_LCD_RST, reg::EncodeMask(PINMUX_REG_BITS_MASK(AUX_TRISTATE))); reg::ClearBits(g_apb_misc_regs + PINMUX_AUX_LCD_RST, reg::EncodeMask(PINMUX_REG_BITS_MASK(AUX_TRISTATE)));
if (fuse::GetHardwareType() == fuse::HardwareType_Five) { if (fuse::GetHardwareType() == fuse::HardwareType_Aula) {
/* Configure LCD backlight. */ /* Configure LCD backlight. */
reg::SetBits(g_gpio_regs + GPIO_PORT6_CNF_1, 0x4); reg::SetBits(g_gpio_regs + GPIO_PORT6_CNF_1, 0x4);
reg::SetBits(g_gpio_regs + GPIO_PORT6_OE_1, 0x4); reg::SetBits(g_gpio_regs + GPIO_PORT6_OE_1, 0x4);
@@ -384,7 +384,7 @@ namespace ams::secmon::fatal {
reg::ClearBits(g_apb_misc_regs + PINMUX_AUX_LCD_BL_EN, reg::EncodeMask(PINMUX_REG_BITS_MASK(AUX_TRISTATE))); reg::ClearBits(g_apb_misc_regs + PINMUX_AUX_LCD_BL_EN, reg::EncodeMask(PINMUX_REG_BITS_MASK(AUX_TRISTATE)));
reg::ClearBits(g_apb_misc_regs + PINMUX_AUX_LCD_RST, reg::EncodeMask(PINMUX_REG_BITS_MASK(AUX_TRISTATE))); reg::ClearBits(g_apb_misc_regs + PINMUX_AUX_LCD_RST, reg::EncodeMask(PINMUX_REG_BITS_MASK(AUX_TRISTATE)));
if (hw_type == fuse::HardwareType_Five) { if (hw_type == fuse::HardwareType_Aula) {
/* Configure LCD backlight. */ /* Configure LCD backlight. */
reg::SetBits(g_gpio_regs + GPIO_PORT6_CNF_1, 0x4); reg::SetBits(g_gpio_regs + GPIO_PORT6_CNF_1, 0x4);
reg::SetBits(g_gpio_regs + GPIO_PORT6_OE_1, 0x4); reg::SetBits(g_gpio_regs + GPIO_PORT6_OE_1, 0x4);
@@ -429,7 +429,7 @@ namespace ams::secmon::fatal {
reg::SetBits(g_gpio_regs + GPIO_PORT6_OUT_1, 0x4); reg::SetBits(g_gpio_regs + GPIO_PORT6_OUT_1, 0x4);
util::WaitMicroSeconds(60'000ul); util::WaitMicroSeconds(60'000ul);
if (hw_type == fuse::HardwareType_Five) { if (hw_type == fuse::HardwareType_Aula) {
reg::Write(g_dsi_regs + sizeof(u32) * DSI_BTA_TIMING, 0x40103); reg::Write(g_dsi_regs + sizeof(u32) * DSI_BTA_TIMING, 0x40103);
} else { } else {
reg::Write(g_dsi_regs + sizeof(u32) * DSI_BTA_TIMING, 0x50204); reg::Write(g_dsi_regs + sizeof(u32) * DSI_BTA_TIMING, 0x50204);
@@ -593,7 +593,7 @@ namespace ams::secmon::fatal {
/* Enable backlight. */ /* Enable backlight. */
constexpr auto DisplayBrightness = 100; constexpr auto DisplayBrightness = 100;
if (GetLcdVendor() == 0x2050) { if (GetLcdVendor() == 0x2050) {
EnableBacklightForVendor2050ForHardwareTypeFive(DisplayBrightness); EnableBacklightForVendor2050ForAula(DisplayBrightness);
} else { } else {
EnableBacklightForGeneric(DisplayBrightness); EnableBacklightForGeneric(DisplayBrightness);
} }

View File

@@ -409,8 +409,8 @@ namespace ams::secmon {
reg0 |= reg::Encode(SLAVE_SECURITY_REG_BITS_ENUM(0, CEC, ENABLE)); reg0 |= reg::Encode(SLAVE_SECURITY_REG_BITS_ENUM(0, CEC, ENABLE));
} }
/* Icosa, Iowa, and Five all set I2C4 to be secure. */ /* Icosa, Iowa, and Aula all set I2C4 to be secure. */
if (hw_type == fuse::HardwareType_Icosa && hw_type == fuse::HardwareType_Iowa && hw_type == fuse::HardwareType_Five) { if (hw_type == fuse::HardwareType_Icosa && hw_type == fuse::HardwareType_Iowa && hw_type == fuse::HardwareType_Aula) {
reg1 |= reg::Encode(SLAVE_SECURITY_REG_BITS_ENUM(1, I2C4, ENABLE)); reg1 |= reg::Encode(SLAVE_SECURITY_REG_BITS_ENUM(1, I2C4, ENABLE));
} }

View File

@@ -47,7 +47,7 @@ namespace ams::secmon::smc {
[fuse::DramId_IcosaSamsung4GB] = pkg1::MemorySize_4GB, [fuse::DramId_IcosaSamsung4GB] = pkg1::MemorySize_4GB,
[fuse::DramId_IcosaHynix4GB] = pkg1::MemorySize_4GB, [fuse::DramId_IcosaHynix4GB] = pkg1::MemorySize_4GB,
[fuse::DramId_IcosaMicron4GB] = pkg1::MemorySize_4GB, [fuse::DramId_IcosaMicron4GB] = pkg1::MemorySize_4GB,
[fuse::DramId_FiveHynix1y4GB] = pkg1::MemorySize_4GB, [fuse::DramId_AulaHynix1y4GB] = pkg1::MemorySize_4GB,
[fuse::DramId_IcosaSamsung6GB] = pkg1::MemorySize_6GB, [fuse::DramId_IcosaSamsung6GB] = pkg1::MemorySize_6GB,
[fuse::DramId_CopperHynix4GB] = pkg1::MemorySize_4GB, [fuse::DramId_CopperHynix4GB] = pkg1::MemorySize_4GB,
[fuse::DramId_CopperMicron4GB] = pkg1::MemorySize_4GB, [fuse::DramId_CopperMicron4GB] = pkg1::MemorySize_4GB,
@@ -66,13 +66,13 @@ namespace ams::secmon::smc {
[fuse::DramId_HoagSamsung1y4GBX] = pkg1::MemorySize_4GB, [fuse::DramId_HoagSamsung1y4GBX] = pkg1::MemorySize_4GB,
[fuse::DramId_IowaSamsung1y4GBY] = pkg1::MemorySize_4GB, [fuse::DramId_IowaSamsung1y4GBY] = pkg1::MemorySize_4GB,
[fuse::DramId_IowaSamsung1y8GBY] = pkg1::MemorySize_8GB, [fuse::DramId_IowaSamsung1y8GBY] = pkg1::MemorySize_8GB,
[fuse::DramId_FiveSamsung1y4GB] = pkg1::MemorySize_4GB, [fuse::DramId_AulaSamsung1y4GB] = pkg1::MemorySize_4GB,
[fuse::DramId_HoagSamsung1y8GBX] = pkg1::MemorySize_8GB, [fuse::DramId_HoagSamsung1y8GBX] = pkg1::MemorySize_8GB,
[fuse::DramId_FiveSamsung1y4GBX] = pkg1::MemorySize_4GB, [fuse::DramId_AulaSamsung1y4GBX] = pkg1::MemorySize_4GB,
[fuse::DramId_IowaMicron1y4GB] = pkg1::MemorySize_4GB, [fuse::DramId_IowaMicron1y4GB] = pkg1::MemorySize_4GB,
[fuse::DramId_HoagMicron1y4GB] = pkg1::MemorySize_4GB, [fuse::DramId_HoagMicron1y4GB] = pkg1::MemorySize_4GB,
[fuse::DramId_FiveMicron1y4GB] = pkg1::MemorySize_4GB, [fuse::DramId_AulaMicron1y4GB] = pkg1::MemorySize_4GB,
[fuse::DramId_FiveSamsung1y8GBX] = pkg1::MemorySize_8GB, [fuse::DramId_AulaSamsung1y8GBX] = pkg1::MemorySize_8GB,
}; };
constexpr const pkg1::MemoryMode MemoryModes[] = { constexpr const pkg1::MemoryMode MemoryModes[] = {

View File

@@ -37,24 +37,25 @@ static char g_bct0_buffer[BCTO_MAX_SIZE];
#define CONFIG_LOG_LEVEL_KEY "log_level" #define CONFIG_LOG_LEVEL_KEY "log_level"
#define DEFAULT_BCT0 \ static const char *get_default_bct0(void) {
"BCT0\n"\ return "BCT0\n"
"[stage1]\n"\ "[stage1]\n"
"stage2_path = atmosphere/fusee-secondary.bin\n"\ "stage2_path = atmosphere/fusee-secondary.bin\n"
"stage2_mtc_path = atmosphere/fusee-mtc.bin\n"\ "stage2_mtc_path = atmosphere/fusee-mtc.bin\n"
"stage2_addr = 0xF0000000\n"\ "stage2_addr = 0xF0000000\n"
"stage2_entrypoint = 0xF0000000\n"\ "stage2_entrypoint = 0xF0000000\n"
"[exosphere]\n"\ "\n"
"debugmode = 1\n"\ "[stratosphere]\n"
"debugmode_user = 0\n"\ "\n";
"disable_user_exception_handlers = 0\n"\ }
"[stratosphere]\n"
static const char *load_config(void) { static const char *load_config(void) {
if (!read_from_file(g_bct0_buffer, BCTO_MAX_SIZE, "atmosphere/config/BCT.ini")) { if (!read_from_file(g_bct0_buffer, BCTO_MAX_SIZE, "atmosphere/config/BCT.ini")) {
print(SCREEN_LOG_LEVEL_DEBUG, "Failed to read BCT0 from SD!\n"); print(SCREEN_LOG_LEVEL_DEBUG, "Failed to read BCT0 from SD!\n");
print(SCREEN_LOG_LEVEL_DEBUG, "Using default BCT0!\n"); print(SCREEN_LOG_LEVEL_DEBUG, "Using default BCT0!\n");
memcpy(g_bct0_buffer, DEFAULT_BCT0, sizeof(DEFAULT_BCT0));
const char * const default_bct0 = get_default_bct0();
memcpy(g_bct0_buffer, default_bct0, strlen(default_bct0));
} }
if (memcmp(g_bct0_buffer, "BCT0", 4) != 0) { if (memcmp(g_bct0_buffer, "BCT0", 4) != 0) {

View File

@@ -217,7 +217,7 @@ sept_primary.bin.o sept_primary_bin.h: sept-primary.bin
@echo $(notdir $<) @echo $(notdir $<)
@$(_bin2o) @$(_bin2o)
sept_secondary_00.enc.o sept_secondary_00.h: sept-secondary_00.enc sept_secondary_00.enc.o sept_secondary_00_enc.h: sept-secondary_00.enc
#--------------------------------------------------------------------------------- #---------------------------------------------------------------------------------
@echo $(notdir $<) @echo $(notdir $<)
@$(_bin2o) @$(_bin2o)

View File

@@ -70,6 +70,18 @@ static void exit_callback(int rc) {
} }
} }
static const char *get_default_bct0(void) {
return "BCT0\n"
"[stage1]\n"
"stage2_path = atmosphere/fusee-secondary.bin\n"
"stage2_mtc_path = atmosphere/fusee-mtc.bin\n"
"stage2_addr = 0xF0000000\n"
"stage2_entrypoint = 0xF0000000\n"
"\n"
"[stratosphere]\n"
"\n";
}
/* Allow for main(int argc, void **argv) signature. */ /* Allow for main(int argc, void **argv) signature. */
#pragma GCC diagnostic ignored "-Wmain" #pragma GCC diagnostic ignored "-Wmain"
@@ -102,7 +114,8 @@ int main(int argc, void **argv) {
if (strcmp(g_stage2_args->bct0, "") == 0) { if (strcmp(g_stage2_args->bct0, "") == 0) {
uint32_t bct_tmp_buf[sizeof(g_stage2_args->bct0) / sizeof(uint32_t)] = {0}; uint32_t bct_tmp_buf[sizeof(g_stage2_args->bct0) / sizeof(uint32_t)] = {0};
if (!read_from_file(bct_tmp_buf, sizeof(bct_tmp_buf) - 1, "atmosphere/config/BCT.ini")) { if (!read_from_file(bct_tmp_buf, sizeof(bct_tmp_buf) - 1, "atmosphere/config/BCT.ini")) {
fatal_error("Failed to read BCT0 from SD!\n"); const char * const default_bct0 = get_default_bct0();
memcpy(bct_tmp_buf, default_bct0, strlen(default_bct0));
} }
memcpy(g_stage2_args->bct0, bct_tmp_buf, sizeof(bct_tmp_buf)); memcpy(g_stage2_args->bct0, bct_tmp_buf, sizeof(bct_tmp_buf));
} }

View File

@@ -6,7 +6,7 @@
[subrepo] [subrepo]
remote = https://github.com/Atmosphere-NX/Atmosphere-libs remote = https://github.com/Atmosphere-NX/Atmosphere-libs
branch = master branch = master
commit = 59b4e75021fbaf3fcf4c0e8dd2c07e309e1869d1 commit = b05ba02f044beb03b3e228a660c0c28d0b1efe0d
parent = 569e1bc650f8d995b1392772a5b53fd0a05bbf3f parent = f2a6a4a6e60bfe0dea11ba3a0ff56c95a5871a6c
method = merge method = merge
cmdver = 0.4.1 cmdver = 0.4.1

View File

@@ -108,15 +108,17 @@ BUILD := build
DATA := data DATA := data
INCLUDES := include INCLUDES := include
GENERAL_SOURCE_DIRS=$1 $(foreach d,$(filter-out $1/arch $1/board $1/os $1/cpu $1,$(wildcard $1/*)),$(if $(wildcard $d/.),$(call DIR_WILDCARD,$d) $d,)) GENERAL_SOURCE_DIRS=$1 $(foreach d,$(filter-out $1/arch $1/board $1/os $1/cpu $1,$(wildcard $1/*)),$(if $(wildcard $d/.),$(filter-out $d,$(call GENERAL_SOURCE_DIRS,$d)) $d,))
SPECIFIC_SOURCE_DIRS=$(if $(wildcard $1/$2/$3/.*),$1/$2/$3 $(call DIR_WILDCARD,$1/$2/$3),$(if $(wildcard $1/$2/generic/.*), $1/$2/generic $(call DIR_WILDCARD,$1/$2/generic),)) SPECIFIC_SOURCE_DIRS=$(if $(wildcard $1/$2/$3/.*),$1/$2/$3 $(call DIR_WILDCARD,$1/$2/$3),$(if $(wildcard $1/$2/generic/.*), $1/$2/generic $(call DIR_WILDCARD,$1/$2/generic),))
UNFILTERED_SOURCE_DIRS=$1 $(foreach d,$(wildcard $1/*),$(if $(wildcard $d/.),$(call DIR_WILDCARD,$d) $d,)) UNFILTERED_SOURCE_DIRS=$1 $(foreach d,$(wildcard $1/*),$(if $(wildcard $d/.),$(call DIR_WILDCARD,$d) $d,))
ALL_SOURCE_DIRS=$(call GENERAL_SOURCE_DIRS,$1) \ ALL_SOURCE_DIRS=$(foreach d,$(call GENERAL_SOURCE_DIRS,$1), \
$(call SPECIFIC_SOURCE_DIRS,$1,arch,$(ATMOSPHERE_ARCH_DIR)) \ $d \
$(call SPECIFIC_SOURCE_DIRS,$1,board,$(ATMOSPHERE_BOARD_DIR)) \ $(call SPECIFIC_SOURCE_DIRS,$d,arch,$(ATMOSPHERE_ARCH_DIR)) \
$(call SPECIFIC_SOURCE_DIRS,$1,os,$(ATMOSPHERE_OS_DIR)) \ $(call SPECIFIC_SOURCE_DIRS,$d,board,$(ATMOSPHERE_BOARD_DIR)) \
$(call SPECIFIC_SOURCE_DIRS,$1,cpu,$(ATMOSPHERE_ARCH_DIR)/$(ATMOSPHERE_CPU_DIR)) $(call SPECIFIC_SOURCE_DIRS,$d,os,$(ATMOSPHERE_OS_DIR)) \
$(call SPECIFIC_SOURCE_DIRS,$d,cpu,$(ATMOSPHERE_ARCH_DIR)/$(ATMOSPHERE_CPU_DIR)) \
)
SOURCES ?= $(call ALL_SOURCE_DIRS,source) SOURCES ?= $(call ALL_SOURCE_DIRS,source)

View File

@@ -26,7 +26,7 @@ namespace ams::fuse {
HardwareType_Hoag = 2, HardwareType_Hoag = 2,
HardwareType_Iowa = 3, HardwareType_Iowa = 3,
HardwareType_Calcio = 4, HardwareType_Calcio = 4,
HardwareType_Five = 5, HardwareType_Aula = 5,
HardwareType_Undefined = 0xF, HardwareType_Undefined = 0xF,
}; };
@@ -51,7 +51,7 @@ namespace ams::fuse {
DramId_IcosaSamsung4GB = 0, DramId_IcosaSamsung4GB = 0,
DramId_IcosaHynix4GB = 1, DramId_IcosaHynix4GB = 1,
DramId_IcosaMicron4GB = 2, DramId_IcosaMicron4GB = 2,
DramId_FiveHynix1y4GB = 3, DramId_AulaHynix1y4GB = 3,
DramId_IcosaSamsung6GB = 4, DramId_IcosaSamsung6GB = 4,
DramId_CopperHynix4GB = 5, DramId_CopperHynix4GB = 5,
DramId_CopperMicron4GB = 6, DramId_CopperMicron4GB = 6,
@@ -70,13 +70,13 @@ namespace ams::fuse {
DramId_HoagSamsung1y4GBX = 19, DramId_HoagSamsung1y4GBX = 19,
DramId_IowaSamsung1y4GBY = 20, DramId_IowaSamsung1y4GBY = 20,
DramId_IowaSamsung1y8GBY = 21, DramId_IowaSamsung1y8GBY = 21,
DramId_FiveSamsung1y4GB = 22, DramId_AulaSamsung1y4GB = 22,
DramId_HoagSamsung1y8GBX = 23, DramId_HoagSamsung1y8GBX = 23,
DramId_FiveSamsung1y4GBX = 24, DramId_AulaSamsung1y4GBX = 24,
DramId_IowaMicron1y4GB = 25, DramId_IowaMicron1y4GB = 25,
DramId_HoagMicron1y4GB = 26, DramId_HoagMicron1y4GB = 26,
DramId_FiveMicron1y4GB = 27, DramId_AulaMicron1y4GB = 27,
DramId_FiveSamsung1y8GBX = 28, DramId_AulaSamsung1y8GBX = 28,
DramId_Count, DramId_Count,
}; };

View File

@@ -316,7 +316,7 @@ namespace ams::fuse {
case 0x02: return (true /* TODO: GetSocType() == SocType_Mariko */) ? HardwareType_Calcio : HardwareType_Copper; case 0x02: return (true /* TODO: GetSocType() == SocType_Mariko */) ? HardwareType_Calcio : HardwareType_Copper;
case 0x04: return HardwareType_Iowa; case 0x04: return HardwareType_Iowa;
case 0x08: return HardwareType_Hoag; case 0x08: return HardwareType_Hoag;
case 0x10: return HardwareType_Five; case 0x10: return HardwareType_Aula;
default: return HardwareType_Undefined; default: return HardwareType_Undefined;
} }
} }
@@ -371,7 +371,7 @@ namespace ams::fuse {
case HardwareType_Iowa: case HardwareType_Iowa:
case HardwareType_Hoag: case HardwareType_Hoag:
case HardwareType_Calcio: case HardwareType_Calcio:
case HardwareType_Five: case HardwareType_Aula:
return SocType_Mariko; return SocType_Mariko;
default: default:
return SocType_Undefined; return SocType_Undefined;

View File

@@ -16,7 +16,7 @@ CFLAGS := $(ATMOSPHERE_CFLAGS) $(SETTINGS) $(DEFINES) $(INCLUDE)
CXXFLAGS := $(CFLAGS) $(ATMOSPHERE_CXXFLAGS) -fno-use-cxa-atexit -flto CXXFLAGS := $(CFLAGS) $(ATMOSPHERE_CXXFLAGS) -fno-use-cxa-atexit -flto
ASFLAGS := $(ATMOSPHERE_ASFLAGS) $(SETTINGS) $(DEFINES) $(INCLUDE) ASFLAGS := $(ATMOSPHERE_ASFLAGS) $(SETTINGS) $(DEFINES) $(INCLUDE)
SOURCES += $(call ALL_SOURCE_DIRS,../libvapours/source) SOURCES += $(foreach v,$(call ALL_SOURCE_DIRS,../libvapours/source),$(if $(findstring ../libvapours/source/sdmmc,$v),,$v))
LIBS := LIBS :=

View File

@@ -690,12 +690,7 @@ namespace ams::kern::arch::arm64::init {
} }
ALWAYS_INLINE void InitializeFromState(uintptr_t state_val) { ALWAYS_INLINE void InitializeFromState(uintptr_t state_val) {
if (kern::GetTargetFirmware() >= ams::TargetFirmware_10_0_0) { m_state = *reinterpret_cast<State *>(state_val);
m_state = *reinterpret_cast<State *>(state_val);
} else {
m_state.next_address = state_val;
m_state.free_bitmap = 0;
}
} }
ALWAYS_INLINE void GetFinalState(State *out) { ALWAYS_INLINE void GetFinalState(State *out) {

View File

@@ -184,14 +184,13 @@ namespace ams::kern {
constexpr inline const auto KMemoryRegionType_DramReservedEarly = KMemoryRegionType_DramReservedBase.DeriveAttribute(KMemoryRegionAttr_NoUserMap); constexpr inline const auto KMemoryRegionType_DramReservedEarly = KMemoryRegionType_DramReservedBase.DeriveAttribute(KMemoryRegionAttr_NoUserMap);
static_assert(KMemoryRegionType_DramReservedEarly.GetValue() == (0x16 | KMemoryRegionAttr_NoUserMap)); static_assert(KMemoryRegionType_DramReservedEarly.GetValue() == (0x16 | KMemoryRegionAttr_NoUserMap));
/* UNUSED: DeriveSparse(0, 3, 0); */ constexpr inline const auto KMemoryRegionType_KernelTraceBuffer = KMemoryRegionType_DramReservedBase.DeriveSparse(0, 3, 0).SetAttribute(KMemoryRegionAttr_LinearMapped).SetAttribute(KMemoryRegionAttr_UserReadOnly);
constexpr inline const auto KMemoryRegionType_OnMemoryBootImage = KMemoryRegionType_DramReservedBase.DeriveSparse(0, 3, 1); constexpr inline const auto KMemoryRegionType_OnMemoryBootImage = KMemoryRegionType_DramReservedBase.DeriveSparse(0, 3, 1);
constexpr inline const auto KMemoryRegionType_DTB = KMemoryRegionType_DramReservedBase.DeriveSparse(0, 3, 2); constexpr inline const auto KMemoryRegionType_DTB = KMemoryRegionType_DramReservedBase.DeriveSparse(0, 3, 2);
static_assert(KMemoryRegionType_KernelTraceBuffer.GetValue() == (0xD6 | KMemoryRegionAttr_LinearMapped | KMemoryRegionAttr_UserReadOnly));
static_assert(KMemoryRegionType_OnMemoryBootImage.GetValue() == 0x156); static_assert(KMemoryRegionType_OnMemoryBootImage.GetValue() == 0x156);
static_assert(KMemoryRegionType_DTB.GetValue() == 0x256); static_assert(KMemoryRegionType_DTB.GetValue() == 0x256);
constexpr inline const auto KMemoryRegionType_KernelTraceBuffer = KMemoryRegionType_DramHeapBase.DeriveTransition(1, 3).SetAttribute(KMemoryRegionAttr_UserReadOnly);
static_assert(KMemoryRegionType_KernelTraceBuffer.GetValue() == (0xA6 | KMemoryRegionAttr_LinearMapped | KMemoryRegionAttr_UserReadOnly));
constexpr inline const auto KMemoryRegionType_DramPoolPartition = KMemoryRegionType_DramHeapBase.DeriveAttribute(KMemoryRegionAttr_NoUserMap); constexpr inline const auto KMemoryRegionType_DramPoolPartition = KMemoryRegionType_DramHeapBase.DeriveAttribute(KMemoryRegionAttr_NoUserMap);
static_assert(KMemoryRegionType_DramPoolPartition.GetValue() == (0x26 | KMemoryRegionAttr_LinearMapped | KMemoryRegionAttr_NoUserMap)); static_assert(KMemoryRegionType_DramPoolPartition.GetValue() == (0x26 | KMemoryRegionAttr_LinearMapped | KMemoryRegionAttr_NoUserMap));

View File

@@ -100,6 +100,13 @@ namespace ams::kern {
/* Insert blocks into the tree. */ /* Insert blocks into the tree. */
MESOSPHERE_INIT_ABORT_UNLESS(KMemoryLayout::GetPhysicalMemoryRegionTree().Insert(GetInteger(physical_memory_base_address), intended_memory_size, KMemoryRegionType_Dram)); MESOSPHERE_INIT_ABORT_UNLESS(KMemoryLayout::GetPhysicalMemoryRegionTree().Insert(GetInteger(physical_memory_base_address), intended_memory_size, KMemoryRegionType_Dram));
MESOSPHERE_INIT_ABORT_UNLESS(KMemoryLayout::GetPhysicalMemoryRegionTree().Insert(GetInteger(physical_memory_base_address), ReservedEarlyDramSize, KMemoryRegionType_DramReservedEarly)); MESOSPHERE_INIT_ABORT_UNLESS(KMemoryLayout::GetPhysicalMemoryRegionTree().Insert(GetInteger(physical_memory_base_address), ReservedEarlyDramSize, KMemoryRegionType_DramReservedEarly));
/* Insert the KTrace block at the end of Dram, if KTrace is enabled. */
static_assert(!IsKTraceEnabled || KTraceBufferSize > 0);
if constexpr (IsKTraceEnabled) {
const KPhysicalAddress ktrace_buffer_phys_addr = physical_memory_base_address + intended_memory_size - KTraceBufferSize;
MESOSPHERE_INIT_ABORT_UNLESS(KMemoryLayout::GetPhysicalMemoryRegionTree().Insert(GetInteger(ktrace_buffer_phys_addr), KTraceBufferSize, KMemoryRegionType_KernelTraceBuffer));
}
} }
void SetupPoolPartitionMemoryRegions() { void SetupPoolPartitionMemoryRegions() {

View File

@@ -77,7 +77,7 @@ namespace ams::kern {
void KServerPort::Destroy() { void KServerPort::Destroy() {
/* Note with our parent that we're closed. */ /* Note with our parent that we're closed. */
m_parent->OnClientClosed(); m_parent->OnServerClosed();
/* Perform necessary cleanup of our session lists. */ /* Perform necessary cleanup of our session lists. */
this->CleanupSessions(); this->CleanupSessions();

View File

@@ -18,7 +18,7 @@
#include <stratosphere/gpio/gpio_types.hpp> #include <stratosphere/gpio/gpio_types.hpp>
#include <stratosphere/gpio/driver/gpio_i_gpio_driver.hpp> #include <stratosphere/gpio/driver/gpio_i_gpio_driver.hpp>
namespace ams::gpio::driver::board::nintendo_nx { namespace ams::gpio::driver::board::nintendo::nx {
void Initialize(bool enable_interrupt_handlers); void Initialize(bool enable_interrupt_handlers);

View File

@@ -22,11 +22,11 @@
#if defined(ATMOSPHERE_BOARD_NINTENDO_NX) #if defined(ATMOSPHERE_BOARD_NINTENDO_NX)
#include <stratosphere/gpio/driver/board/nintendo_nx/gpio_driver_api.hpp> #include <stratosphere/gpio/driver/board/nintendo/nx/gpio_driver_api.hpp>
namespace ams::gpio::driver::board { namespace ams::gpio::driver::board {
using namespace ams::gpio::driver::board::nintendo_nx; using namespace ams::gpio::driver::board::nintendo::nx;
} }

View File

@@ -17,7 +17,7 @@
#include <vapours.hpp> #include <vapours.hpp>
#include <stratosphere/i2c/i2c_types.hpp> #include <stratosphere/i2c/i2c_types.hpp>
namespace ams::i2c::driver::board::nintendo_nx { namespace ams::i2c::driver::board::nintendo::nx {
void Initialize(); void Initialize();

View File

@@ -21,11 +21,11 @@
#if defined(ATMOSPHERE_BOARD_NINTENDO_NX) #if defined(ATMOSPHERE_BOARD_NINTENDO_NX)
#include <stratosphere/i2c/driver/board/nintendo_nx/i2c_driver_api.hpp> #include <stratosphere/i2c/driver/board/nintendo/nx/i2c_driver_api.hpp>
namespace ams::i2c::driver::board { namespace ams::i2c::driver::board {
using namespace ams::i2c::driver::board::nintendo_nx; using namespace ams::i2c::driver::board::nintendo::nx;
} }

View File

@@ -17,7 +17,7 @@
#include <vapours.hpp> #include <vapours.hpp>
#include <stratosphere/pwm/pwm_types.hpp> #include <stratosphere/pwm/pwm_types.hpp>
namespace ams::pwm::driver::board::nintendo_nx { namespace ams::pwm::driver::board::nintendo::nx {
void Initialize(); void Initialize();

View File

@@ -20,11 +20,11 @@
#if defined(ATMOSPHERE_BOARD_NINTENDO_NX) #if defined(ATMOSPHERE_BOARD_NINTENDO_NX)
#include <stratosphere/pwm/driver/board/nintendo_nx/pwm_driver_api.hpp> #include <stratosphere/pwm/driver/board/nintendo/nx/pwm_driver_api.hpp>
namespace ams::pwm::driver::board { namespace ams::pwm::driver::board {
using namespace ams::pwm::driver::board::nintendo_nx; using namespace ams::pwm::driver::board::nintendo::nx;
} }

View File

@@ -128,10 +128,6 @@ namespace ams::sf::hipc {
os::Mutex waitlist_mutex; os::Mutex waitlist_mutex;
os::WaitableManagerType waitlist; os::WaitableManagerType waitlist;
os::Mutex deferred_session_mutex;
using DeferredSessionList = typename util::IntrusiveListMemberTraits<&ServerSession::deferred_list_node>::ListType;
DeferredSessionList deferred_session_list;
private: private:
virtual void RegisterSessionToWaitList(ServerSession *session) override final; virtual void RegisterSessionToWaitList(ServerSession *session) override final;
void RegisterToWaitList(os::WaitableHolderType *holder); void RegisterToWaitList(os::WaitableHolderType *holder);
@@ -143,8 +139,6 @@ namespace ams::sf::hipc {
Result ProcessForMitmServer(os::WaitableHolderType *holder); Result ProcessForMitmServer(os::WaitableHolderType *holder);
Result ProcessForSession(os::WaitableHolderType *holder); Result ProcessForSession(os::WaitableHolderType *holder);
void ProcessDeferredSessions();
template<typename Interface, auto MakeShared> template<typename Interface, auto MakeShared>
void RegisterServerImpl(Handle port_handle, sm::ServiceName service_name, bool managed, cmif::ServiceObjectHolder &&static_holder) { void RegisterServerImpl(Handle port_handle, sm::ServiceName service_name, bool managed, cmif::ServiceObjectHolder &&static_holder) {
/* Allocate server memory. */ /* Allocate server memory. */
@@ -176,7 +170,7 @@ namespace ams::sf::hipc {
ServerManagerBase(DomainEntryStorage *entry_storage, size_t entry_count) : ServerManagerBase(DomainEntryStorage *entry_storage, size_t entry_count) :
ServerDomainSessionManager(entry_storage, entry_count), ServerDomainSessionManager(entry_storage, entry_count),
request_stop_event(os::EventClearMode_ManualClear), notify_event(os::EventClearMode_ManualClear), request_stop_event(os::EventClearMode_ManualClear), notify_event(os::EventClearMode_ManualClear),
waitable_selection_mutex(false), waitlist_mutex(false), deferred_session_mutex(false) waitable_selection_mutex(false), waitlist_mutex(false)
{ {
/* Link waitables. */ /* Link waitables. */
os::InitializeWaitableManager(std::addressof(this->waitable_manager)); os::InitializeWaitableManager(std::addressof(this->waitable_manager));

View File

@@ -45,7 +45,6 @@ namespace ams::sf::hipc {
NON_COPYABLE(ServerSession); NON_COPYABLE(ServerSession);
NON_MOVEABLE(ServerSession); NON_MOVEABLE(ServerSession);
private: private:
util::IntrusiveListNode deferred_list_node;
cmif::ServiceObjectHolder srv_obj_holder; cmif::ServiceObjectHolder srv_obj_holder;
cmif::PointerAndSize pointer_buffer; cmif::PointerAndSize pointer_buffer;
cmif::PointerAndSize saved_message; cmif::PointerAndSize saved_message;

View File

@@ -106,12 +106,12 @@ namespace ams::spl {
} }
enum class HardwareType { enum class HardwareType {
Icosa = 0, Icosa = 0,
Copper = 1, Copper = 1,
Hoag = 2, Hoag = 2,
Iowa = 3, Iowa = 3,
Calcio = 4, Calcio = 4,
_Five_ = 5, Aula = 5,
}; };
enum SocType { enum SocType {

View File

@@ -18,11 +18,11 @@
#include "impl/gpio_initial_config.hpp" #include "impl/gpio_initial_config.hpp"
#include "impl/gpio_tegra_pad.hpp" #include "impl/gpio_tegra_pad.hpp"
namespace ams::gpio::driver::board::nintendo_nx { namespace ams::gpio::driver::board::nintendo::nx {
namespace { namespace {
ams::gpio::driver::board::nintendo_nx::impl::DriverImpl *g_driver_impl = nullptr; ams::gpio::driver::board::nintendo::nx::impl::DriverImpl *g_driver_impl = nullptr;
} }
@@ -38,7 +38,7 @@ namespace ams::gpio::driver::board::nintendo_nx {
AMS_ABORT_UNLESS(driver_storage != nullptr); AMS_ABORT_UNLESS(driver_storage != nullptr);
/* Construct the new driver. */ /* Construct the new driver. */
g_driver_impl = new (driver_storage) ams::gpio::driver::board::nintendo_nx::impl::DriverImpl(impl::GpioRegistersPhysicalAddress, impl::GpioRegistersSize); g_driver_impl = new (driver_storage) ams::gpio::driver::board::nintendo::nx::impl::DriverImpl(impl::GpioRegistersPhysicalAddress, impl::GpioRegistersSize);
/* Register the driver. */ /* Register the driver. */
gpio::driver::RegisterDriver(g_driver_impl); gpio::driver::RegisterDriver(g_driver_impl);

View File

@@ -17,7 +17,7 @@
#include "gpio_driver_impl.hpp" #include "gpio_driver_impl.hpp"
#include "gpio_register_accessor.hpp" #include "gpio_register_accessor.hpp"
namespace ams::gpio::driver::board::nintendo_nx::impl { namespace ams::gpio::driver::board::nintendo::nx::impl {
void InterruptEventHandler::Initialize(DriverImpl *drv, os::InterruptName intr, int ctlr) { void InterruptEventHandler::Initialize(DriverImpl *drv, os::InterruptName intr, int ctlr) {
/* Set fields. */ /* Set fields. */

View File

@@ -20,7 +20,7 @@
#include "gpio_register_accessor.hpp" #include "gpio_register_accessor.hpp"
#include "gpio_suspend_handler.hpp" #include "gpio_suspend_handler.hpp"
namespace ams::gpio::driver::board::nintendo_nx::impl { namespace ams::gpio::driver::board::nintendo::nx::impl {
class DriverImpl; class DriverImpl;
@@ -43,7 +43,7 @@ namespace ams::gpio::driver::board::nintendo_nx::impl {
class DriverImpl : public ::ams::gpio::driver::IGpioDriver { class DriverImpl : public ::ams::gpio::driver::IGpioDriver {
NON_COPYABLE(DriverImpl); NON_COPYABLE(DriverImpl);
NON_MOVEABLE(DriverImpl); NON_MOVEABLE(DriverImpl);
AMS_DDSF_CASTABLE_TRAITS(ams::gpio::driver::board::nintendo_nx::impl::DriverImpl, ::ams::gpio::driver::IGpioDriver); AMS_DDSF_CASTABLE_TRAITS(ams::gpio::driver::board::nintendo::nx::impl::DriverImpl, ::ams::gpio::driver::IGpioDriver);
friend class InterruptEventHandler; friend class InterruptEventHandler;
private: private:
dd::PhysicalAddress gpio_physical_address; dd::PhysicalAddress gpio_physical_address;

View File

@@ -18,7 +18,7 @@
#include "gpio_initial_config.hpp" #include "gpio_initial_config.hpp"
#include "gpio_wake_pin_config.hpp" #include "gpio_wake_pin_config.hpp"
namespace ams::gpio::driver::board::nintendo_nx::impl { namespace ams::gpio::driver::board::nintendo::nx::impl {
namespace { namespace {
@@ -36,14 +36,14 @@ namespace ams::gpio::driver::board::nintendo_nx::impl {
#include "gpio_initial_wake_pin_config_hoag.inc" #include "gpio_initial_wake_pin_config_hoag.inc"
#include "gpio_initial_wake_pin_config_iowa.inc" #include "gpio_initial_wake_pin_config_iowa.inc"
#include "gpio_initial_wake_pin_config_calcio.inc" #include "gpio_initial_wake_pin_config_calcio.inc"
#include "gpio_initial_wake_pin_config_five.inc" #include "gpio_initial_wake_pin_config_aula.inc"
#include "gpio_initial_config_icosa.inc" #include "gpio_initial_config_icosa.inc"
/* #include "gpio_initial_config_copper.inc" */ /* #include "gpio_initial_config_copper.inc" */
#include "gpio_initial_config_hoag.inc" #include "gpio_initial_config_hoag.inc"
#include "gpio_initial_config_iowa.inc" #include "gpio_initial_config_iowa.inc"
#include "gpio_initial_config_calcio.inc" #include "gpio_initial_config_calcio.inc"
#include "gpio_initial_config_five.inc" #include "gpio_initial_config_aula.inc"
} }
@@ -70,9 +70,9 @@ namespace ams::gpio::driver::board::nintendo_nx::impl {
configs = InitialGpioConfigsCalcio; configs = InitialGpioConfigsCalcio;
num_configs = NumInitialGpioConfigsCalcio; num_configs = NumInitialGpioConfigsCalcio;
break; break;
case spl::HardwareType::_Five_: case spl::HardwareType::Aula:
configs = InitialGpioConfigsFive; configs = InitialGpioConfigsAula;
num_configs = NumInitialGpioConfigsFive; num_configs = NumInitialGpioConfigsAula;
break; break;
case spl::HardwareType::Copper: case spl::HardwareType::Copper:
AMS_UNREACHABLE_DEFAULT_CASE(); AMS_UNREACHABLE_DEFAULT_CASE();
@@ -151,9 +151,9 @@ namespace ams::gpio::driver::board::nintendo_nx::impl {
configs = InitialWakePinConfigsCalcio; configs = InitialWakePinConfigsCalcio;
num_configs = NumInitialWakePinConfigsCalcio; num_configs = NumInitialWakePinConfigsCalcio;
break; break;
case spl::HardwareType::_Five_: case spl::HardwareType::Aula:
configs = InitialWakePinConfigsFive; configs = InitialWakePinConfigsAula;
num_configs = NumInitialWakePinConfigsFive; num_configs = NumInitialWakePinConfigsAula;
break; break;
case spl::HardwareType::Copper: case spl::HardwareType::Copper:
AMS_UNREACHABLE_DEFAULT_CASE(); AMS_UNREACHABLE_DEFAULT_CASE();

View File

@@ -16,7 +16,7 @@
#pragma once #pragma once
#include <stratosphere.hpp> #include <stratosphere.hpp>
namespace ams::gpio::driver::board::nintendo_nx::impl { namespace ams::gpio::driver::board::nintendo::nx::impl {
struct GpioInitialConfig { struct GpioInitialConfig {
DeviceCode device_code; DeviceCode device_code;

View File

@@ -16,7 +16,7 @@
/* NOTE: This file is auto-generated by gpio_pad_gen.py, do not edit manually. */ /* NOTE: This file is auto-generated by gpio_pad_gen.py, do not edit manually. */
constexpr inline const GpioInitialConfig InitialGpioConfigsFive[] = { constexpr inline const GpioInitialConfig InitialGpioConfigsAula[] = {
{ DeviceCode_GameCardReset, Direction_Output, GpioValue_Low }, { DeviceCode_GameCardReset, Direction_Output, GpioValue_Low },
{ DeviceCode_CodecAlert, Direction_Input, GpioValue_Low }, { DeviceCode_CodecAlert, Direction_Input, GpioValue_Low },
{ DeviceCode_Debug0, Direction_Output, GpioValue_Low }, { DeviceCode_Debug0, Direction_Output, GpioValue_Low },
@@ -67,4 +67,4 @@ constexpr inline const GpioInitialConfig InitialGpioConfigsFive[] = {
{ DeviceCode_ExtconChgS, Direction_Output, GpioValue_Low }, { DeviceCode_ExtconChgS, Direction_Output, GpioValue_Low },
}; };
constexpr inline size_t NumInitialGpioConfigsFive = util::size(InitialGpioConfigsFive); constexpr inline size_t NumInitialGpioConfigsAula = util::size(InitialGpioConfigsAula);

View File

@@ -16,7 +16,7 @@
/* NOTE: This file is auto-generated by wake_pin_gen.py, do not edit manually. */ /* NOTE: This file is auto-generated by wake_pin_gen.py, do not edit manually. */
constexpr inline const WakePinConfig InitialWakePinConfigsFive[] = { constexpr inline const WakePinConfig InitialWakePinConfigsAula[] = {
{ ams::wec::WakeEvent_PexWakeN, false, ams::wec::WakeEventLevel_Auto }, { ams::wec::WakeEvent_PexWakeN, false, ams::wec::WakeEventLevel_Auto },
{ ams::wec::WakeEvent_GpioPortA6, false, ams::wec::WakeEventLevel_Auto }, { ams::wec::WakeEvent_GpioPortA6, false, ams::wec::WakeEventLevel_Auto },
{ ams::wec::WakeEvent_QspiCsN, false, ams::wec::WakeEventLevel_Auto }, { ams::wec::WakeEvent_QspiCsN, false, ams::wec::WakeEventLevel_Auto },
@@ -77,4 +77,4 @@ constexpr inline const WakePinConfig InitialWakePinConfigsFive[] = {
{ ams::wec::WakeEvent_MotionInt, false, ams::wec::WakeEventLevel_Auto }, { ams::wec::WakeEvent_MotionInt, false, ams::wec::WakeEventLevel_Auto },
}; };
constexpr inline size_t NumInitialWakePinConfigsFive = util::size(InitialWakePinConfigsFive); constexpr inline size_t NumInitialWakePinConfigsAula = util::size(InitialWakePinConfigsAula);

View File

@@ -18,7 +18,7 @@
#include "gpio_tegra_pad.hpp" #include "gpio_tegra_pad.hpp"
namespace ams::gpio::driver::board::nintendo_nx::impl { namespace ams::gpio::driver::board::nintendo::nx::impl {
constexpr inline dd::PhysicalAddress GpioRegistersPhysicalAddress = 0x6000D000; constexpr inline dd::PhysicalAddress GpioRegistersPhysicalAddress = 0x6000D000;
constexpr inline size_t GpioRegistersSize = 4_KB; constexpr inline size_t GpioRegistersSize = 4_KB;

View File

@@ -16,7 +16,7 @@
#include <stratosphere.hpp> #include <stratosphere.hpp>
#include "gpio_suspend_handler.hpp" #include "gpio_suspend_handler.hpp"
namespace ams::gpio::driver::board::nintendo_nx::impl { namespace ams::gpio::driver::board::nintendo::nx::impl {
void SuspendHandler::Initialize(uintptr_t gpio_vaddr) { void SuspendHandler::Initialize(uintptr_t gpio_vaddr) {
/* Set our gpio virtual address. */ /* Set our gpio virtual address. */

View File

@@ -18,7 +18,7 @@
#include "gpio_tegra_pad.hpp" #include "gpio_tegra_pad.hpp"
namespace ams::gpio::driver::board::nintendo_nx::impl { namespace ams::gpio::driver::board::nintendo::nx::impl {
class SuspendHandler { class SuspendHandler {
NON_COPYABLE(SuspendHandler); NON_COPYABLE(SuspendHandler);

View File

@@ -16,7 +16,7 @@
#pragma once #pragma once
#include <stratosphere.hpp> #include <stratosphere.hpp>
namespace ams::gpio::driver::board::nintendo_nx::impl { namespace ams::gpio::driver::board::nintendo::nx::impl {
enum GpioPadPort { enum GpioPadPort {
GpioPadPort_A = 0, GpioPadPort_A = 0,
@@ -347,7 +347,7 @@ namespace ams::gpio::driver::board::nintendo_nx::impl {
}; };
class TegraPad : public ::ams::gpio::driver::Pad { class TegraPad : public ::ams::gpio::driver::Pad {
AMS_DDSF_CASTABLE_TRAITS(ams::gpio::driver::board::nintendo_nx::impl::TegraPad, ::ams::gpio::driver::Pad); AMS_DDSF_CASTABLE_TRAITS(ams::gpio::driver::board::nintendo::nx::impl::TegraPad, ::ams::gpio::driver::Pad);
private: private:
using Base = ::ams::gpio::driver::Pad; using Base = ::ams::gpio::driver::Pad;
private: private:

View File

@@ -16,7 +16,7 @@
#pragma once #pragma once
#include <stratosphere.hpp> #include <stratosphere.hpp>
namespace ams::gpio::driver::board::nintendo_nx::impl { namespace ams::gpio::driver::board::nintendo::nx::impl {
struct WakePinConfig { struct WakePinConfig {
wec::WakeEvent wake_event; wec::WakeEvent wake_event;

View File

@@ -17,7 +17,7 @@
#include "impl/i2c_bus_manager.hpp" #include "impl/i2c_bus_manager.hpp"
#include "impl/i2c_device_property_manager.hpp" #include "impl/i2c_device_property_manager.hpp"
namespace ams::i2c::driver::board::nintendo_nx { namespace ams::i2c::driver::board::nintendo::nx {
namespace { namespace {

View File

@@ -16,7 +16,7 @@
#include <stratosphere.hpp> #include <stratosphere.hpp>
#include "i2c_bus_accessor.hpp" #include "i2c_bus_accessor.hpp"
namespace ams::i2c::driver::board::nintendo_nx::impl { namespace ams::i2c::driver::board::nintendo::nx::impl {
namespace { namespace {

View File

@@ -17,12 +17,12 @@
#include <stratosphere.hpp> #include <stratosphere.hpp>
#include "i2c_i2c_registers.hpp" #include "i2c_i2c_registers.hpp"
namespace ams::i2c::driver::board::nintendo_nx::impl { namespace ams::i2c::driver::board::nintendo::nx::impl {
class I2cBusAccessor : public ::ams::i2c::driver::II2cDriver { class I2cBusAccessor : public ::ams::i2c::driver::II2cDriver {
NON_COPYABLE(I2cBusAccessor); NON_COPYABLE(I2cBusAccessor);
NON_MOVEABLE(I2cBusAccessor); NON_MOVEABLE(I2cBusAccessor);
AMS_DDSF_CASTABLE_TRAITS(ams::i2c::driver::board::nintendo_nx::impl::I2cBusAccessor, ::ams::i2c::driver::II2cDriver); AMS_DDSF_CASTABLE_TRAITS(ams::i2c::driver::board::nintendo::nx::impl::I2cBusAccessor, ::ams::i2c::driver::II2cDriver);
private: private:
enum class State { enum class State {
NotInitialized = 0, NotInitialized = 0,

View File

@@ -18,7 +18,7 @@
#include "i2c_bus_accessor.hpp" #include "i2c_bus_accessor.hpp"
#include "i2c_i_allocator.hpp" #include "i2c_i_allocator.hpp"
namespace ams::i2c::driver::board::nintendo_nx::impl { namespace ams::i2c::driver::board::nintendo::nx::impl {
class I2cBusAccessorManager : public IAllocator<I2cBusAccessor::BusAccessorList> { class I2cBusAccessorManager : public IAllocator<I2cBusAccessor::BusAccessorList> {
/* ... */ /* ... */

View File

@@ -17,7 +17,7 @@
#include <stratosphere.hpp> #include <stratosphere.hpp>
#include "i2c_i_allocator.hpp" #include "i2c_i_allocator.hpp"
namespace ams::i2c::driver::board::nintendo_nx::impl { namespace ams::i2c::driver::board::nintendo::nx::impl {
class I2cDevicePropertyManager : public IAllocator<I2cDeviceProperty::DevicePropertyList> { class I2cDevicePropertyManager : public IAllocator<I2cDeviceProperty::DevicePropertyList> {
/* ... */ /* ... */

View File

@@ -16,7 +16,7 @@
#pragma once #pragma once
#include <stratosphere.hpp> #include <stratosphere.hpp>
namespace ams::i2c::driver::board::nintendo_nx::impl { namespace ams::i2c::driver::board::nintendo::nx::impl {
struct I2cRegisters { struct I2cRegisters {
volatile u32 cnfg; volatile u32 cnfg;

View File

@@ -16,7 +16,7 @@
#pragma once #pragma once
#include <stratosphere.hpp> #include <stratosphere.hpp>
namespace ams::i2c::driver::board::nintendo_nx::impl { namespace ams::i2c::driver::board::nintendo::nx::impl {
template<typename ListType> template<typename ListType>
class IAllocator { class IAllocator {

View File

@@ -18,7 +18,7 @@
#include "pinmux_board_driver_api.hpp" #include "pinmux_board_driver_api.hpp"
#include "pinmux_platform_pads.hpp" #include "pinmux_platform_pads.hpp"
namespace ams::pinmux::driver::board::nintendo_nx { namespace ams::pinmux::driver::board::nintendo::nx {
namespace { namespace {
@@ -28,7 +28,7 @@ namespace ams::pinmux::driver::board::nintendo_nx {
#include "pinmux_initial_pad_config_hoag.inc" #include "pinmux_initial_pad_config_hoag.inc"
#include "pinmux_initial_pad_config_iowa.inc" #include "pinmux_initial_pad_config_iowa.inc"
#include "pinmux_initial_pad_config_calcio.inc" #include "pinmux_initial_pad_config_calcio.inc"
#include "pinmux_initial_pad_config_five.inc" #include "pinmux_initial_pad_config_aula.inc"
#include "pinmux_initial_drive_pad_config.inc" #include "pinmux_initial_drive_pad_config.inc"
#include "pinmux_initial_drive_pad_config_hoag.inc" #include "pinmux_initial_drive_pad_config_hoag.inc"
@@ -73,9 +73,9 @@ namespace ams::pinmux::driver::board::nintendo_nx {
num_configs = NumPinmuxPadConfigsCalcio; num_configs = NumPinmuxPadConfigsCalcio;
is_mariko = true; is_mariko = true;
break; break;
case spl::HardwareType::_Five_: case spl::HardwareType::Aula:
configs = PinmuxPadConfigsFive; configs = PinmuxPadConfigsAula;
num_configs = NumPinmuxPadConfigsFive; num_configs = NumPinmuxPadConfigsAula;
is_mariko = true; is_mariko = true;
break; break;
AMS_UNREACHABLE_DEFAULT_CASE(); AMS_UNREACHABLE_DEFAULT_CASE();
@@ -121,7 +121,7 @@ namespace ams::pinmux::driver::board::nintendo_nx {
configs = PinmuxDrivePadConfigs; configs = PinmuxDrivePadConfigs;
num_configs = NumPinmuxDrivePadConfigs; num_configs = NumPinmuxDrivePadConfigs;
break; break;
case spl::HardwareType::_Five_: case spl::HardwareType::Aula:
configs = PinmuxDrivePadConfigs; configs = PinmuxDrivePadConfigs;
num_configs = NumPinmuxDrivePadConfigs; num_configs = NumPinmuxDrivePadConfigs;
break; break;

View File

@@ -16,7 +16,7 @@
#pragma once #pragma once
#include <stratosphere.hpp> #include <stratosphere.hpp>
namespace ams::pinmux::driver::board::nintendo_nx { namespace ams::pinmux::driver::board::nintendo::nx {
bool IsInitialized(); bool IsInitialized();

View File

@@ -16,7 +16,7 @@
/* NOTE: This file is auto-generated by pinmux_initial_config.py, do not edit manually. */ /* NOTE: This file is auto-generated by pinmux_initial_config.py, do not edit manually. */
constexpr inline const PinmuxPadConfig PinmuxPadConfigsFive[] = { constexpr inline const PinmuxPadConfig PinmuxPadConfigsAula[] = {
{ PinmuxPadIndex_AudMclk, 0x00000000, 0x0000007F }, { PinmuxPadIndex_AudMclk, 0x00000000, 0x0000007F },
{ PinmuxPadIndex_Dap1Din, 0x00000028, 0x0000007F }, { PinmuxPadIndex_Dap1Din, 0x00000028, 0x0000007F },
{ PinmuxPadIndex_Dap1Dout, 0x00000000, 0x0000007F }, { PinmuxPadIndex_Dap1Dout, 0x00000000, 0x0000007F },
@@ -193,4 +193,4 @@ constexpr inline const PinmuxPadConfig PinmuxPadConfigsFive[] = {
{ PinmuxPadIndex_HdmiCec, 0x00000005, 0x00000007 }, { PinmuxPadIndex_HdmiCec, 0x00000005, 0x00000007 },
}; };
constexpr inline const size_t NumPinmuxPadConfigsFive = util::size(PinmuxPadConfigsFive); constexpr inline const size_t NumPinmuxPadConfigsAula = util::size(PinmuxPadConfigsAula);

View File

@@ -18,7 +18,7 @@
#include "pinmux_board_driver_api.hpp" #include "pinmux_board_driver_api.hpp"
#include "pinmux_platform_pads.hpp" #include "pinmux_platform_pads.hpp"
namespace ams::pinmux::driver::board::nintendo_nx { namespace ams::pinmux::driver::board::nintendo::nx {
namespace { namespace {

View File

@@ -16,7 +16,7 @@
#pragma once #pragma once
#include <stratosphere.hpp> #include <stratosphere.hpp>
namespace ams::pinmux::driver::board::nintendo_nx { namespace ams::pinmux::driver::board::nintendo::nx {
struct PinmuxPadConfig { struct PinmuxPadConfig {
u32 index; u32 index;

View File

@@ -18,9 +18,9 @@
#if defined(ATMOSPHERE_BOARD_NINTENDO_NX) #if defined(ATMOSPHERE_BOARD_NINTENDO_NX)
#include "board/nintendo_nx/pinmux_board_driver_api.hpp" #include "board/nintendo/nx/pinmux_board_driver_api.hpp"
namespace ams::pinmux::driver::board { namespace ams::pinmux::driver::board {
using namespace ams::pinmux::driver::board::nintendo_nx; using namespace ams::pinmux::driver::board::nintendo::nx;
} }
#else #else

View File

@@ -63,8 +63,8 @@ namespace ams::powctl::driver::impl {
} else if (battery_version == 1) { } else if (battery_version == 1) {
return ChargeParametersForBatteryVersion1; return ChargeParametersForBatteryVersion1;
} else { } else {
if (spl::GetHardwareType() == spl::HardwareType::_Five_) { if (spl::GetHardwareType() == spl::HardwareType::Aula) {
return ChargeParametersForBatteryVersion0ForFive; return ChargeParametersForBatteryVersion0ForAula;
} else { } else {
return ChargeParametersForBatteryVersion0; return ChargeParametersForBatteryVersion0;
} }

View File

@@ -51,7 +51,7 @@ constexpr inline const ChargeParametersRule ChargeParametersRulesForBatteryVersi
{ BatteryTemperatureLevel::TooHigh, 4080, Max, Min, Max, Min, Max, AcceptablePowerStates, util::size(AcceptablePowerStates), false, false, 4320, 1664, 0, 0 }, { BatteryTemperatureLevel::TooHigh, 4080, Max, Min, Max, Min, Max, AcceptablePowerStates, util::size(AcceptablePowerStates), false, false, 4320, 1664, 0, 0 },
}; };
constexpr inline const ChargeParametersRule ChargeParametersRulesForBatteryVersion0ForFive[] = { constexpr inline const ChargeParametersRule ChargeParametersRulesForBatteryVersion0ForAula[] = {
{ BatteryTemperatureLevel::TooLow, Min, Max, Min, Max, Min, Max, AcceptablePowerStates, util::size(AcceptablePowerStates), false, false, 4208, 768, 0, 0 }, { BatteryTemperatureLevel::TooLow, Min, Max, Min, Max, Min, Max, AcceptablePowerStates, util::size(AcceptablePowerStates), false, false, 4208, 768, 0, 0 },
{ BatteryTemperatureLevel::Low, Min, Max, Min, Max, Min, Max, AcceptablePowerStates, util::size(AcceptablePowerStates), false, true, 4208, 768, 0, 0 }, { BatteryTemperatureLevel::Low, Min, Max, Min, Max, Min, Max, AcceptablePowerStates, util::size(AcceptablePowerStates), false, true, 4208, 768, 0, 0 },
{ BatteryTemperatureLevel::Medium, Min, Max, Min, 4001, 2049, Max, AcceptablePowerStatesForNotAwakeCharge, util::size(AcceptablePowerStatesForNotAwakeCharge), true, true, 4000, 3072, 40, 112 }, { BatteryTemperatureLevel::Medium, Min, Max, Min, 4001, 2049, Max, AcceptablePowerStatesForNotAwakeCharge, util::size(AcceptablePowerStatesForNotAwakeCharge), true, true, 4000, 3072, 40, 112 },
@@ -74,6 +74,6 @@ constexpr inline const ChargeParameters ChargeParametersForBatteryVersion2 = {
1, 19, 48, 59, 1664, 4320, UnknownXTableForBatteryVersion2, util::size(UnknownXTableForBatteryVersion2), 95.0, 100.4, ChargeParametersRulesForBatteryVersion2, util::size(ChargeParametersRulesForBatteryVersion2) 1, 19, 48, 59, 1664, 4320, UnknownXTableForBatteryVersion2, util::size(UnknownXTableForBatteryVersion2), 95.0, 100.4, ChargeParametersRulesForBatteryVersion2, util::size(ChargeParametersRulesForBatteryVersion2)
}; };
constexpr inline const ChargeParameters ChargeParametersForBatteryVersion0ForFive = { constexpr inline const ChargeParameters ChargeParametersForBatteryVersion0ForAula = {
4, 17, 51, 60, 512, 4208, nullptr, 0, 95.0, 99.0, ChargeParametersRulesForBatteryVersion0ForFive, util::size(ChargeParametersRulesForBatteryVersion0ForFive) 4, 17, 51, 60, 512, 4208, nullptr, 0, 95.0, 99.0, ChargeParametersRulesForBatteryVersion0ForAula, util::size(ChargeParametersRulesForBatteryVersion0ForAula)
}; };

View File

@@ -14,12 +14,12 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#include <stratosphere.hpp> #include <stratosphere.hpp>
#include "../../powctl_device_management.hpp" #include "../../../powctl_device_management.hpp"
#include "powctl_retry_helper.hpp" #include "powctl_retry_helper.hpp"
#include "powctl_battery_driver.hpp" #include "powctl_battery_driver.hpp"
#include "powctl_max17050_driver.hpp" #include "powctl_max17050_driver.hpp"
namespace ams::powctl::impl::board::nintendo_nx { namespace ams::powctl::impl::board::nintendo::nx {
namespace { namespace {

View File

@@ -15,15 +15,15 @@
*/ */
#pragma once #pragma once
#include <stratosphere.hpp> #include <stratosphere.hpp>
#include "../../powctl_i_power_control_driver.hpp" #include "../../../powctl_i_power_control_driver.hpp"
#include "powctl_interrupt_event_handler.hpp" #include "powctl_interrupt_event_handler.hpp"
namespace ams::powctl::impl::board::nintendo_nx { namespace ams::powctl::impl::board::nintendo::nx {
class BatteryDevice : public powctl::impl::IDevice { class BatteryDevice : public powctl::impl::IDevice {
NON_COPYABLE(BatteryDevice); NON_COPYABLE(BatteryDevice);
NON_MOVEABLE(BatteryDevice); NON_MOVEABLE(BatteryDevice);
AMS_DDSF_CASTABLE_TRAITS(ams::powctl::impl::board::nintendo_nx::BatteryDevice, ::ams::powctl::impl::IDevice); AMS_DDSF_CASTABLE_TRAITS(ams::powctl::impl::board::nintendo::nx::BatteryDevice, ::ams::powctl::impl::IDevice);
private: private:
bool use_event_handler; bool use_event_handler;
std::optional<BatteryInterruptEventHandler> event_handler; std::optional<BatteryInterruptEventHandler> event_handler;
@@ -43,7 +43,7 @@ namespace ams::powctl::impl::board::nintendo_nx {
class BatteryDriver : public IPowerControlDriver { class BatteryDriver : public IPowerControlDriver {
NON_COPYABLE(BatteryDriver); NON_COPYABLE(BatteryDriver);
NON_MOVEABLE(BatteryDriver); NON_MOVEABLE(BatteryDriver);
AMS_DDSF_CASTABLE_TRAITS(ams::powctl::impl::board::nintendo_nx::BatteryDriver, ::ams::powctl::impl::IPowerControlDriver); AMS_DDSF_CASTABLE_TRAITS(ams::powctl::impl::board::nintendo::nx::BatteryDriver, ::ams::powctl::impl::IPowerControlDriver);
public: public:
BatteryDriver(bool ev) : IPowerControlDriver(ev) { /* ... */ } BatteryDriver(bool ev) : IPowerControlDriver(ev) { /* ... */ }

View File

@@ -14,12 +14,12 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#include <stratosphere.hpp> #include <stratosphere.hpp>
#include "../../powctl_device_management.hpp" #include "../../../powctl_device_management.hpp"
#include "powctl_board_impl.hpp" #include "powctl_board_impl.hpp"
#include "powctl_battery_driver.hpp" #include "powctl_battery_driver.hpp"
#include "powctl_charger_driver.hpp" #include "powctl_charger_driver.hpp"
namespace ams::powctl::impl::board::nintendo_nx { namespace ams::powctl::impl::board::nintendo::nx {
namespace { namespace {

View File

@@ -18,7 +18,7 @@
#include "powctl_interrupt_event_handler.hpp" #include "powctl_interrupt_event_handler.hpp"
namespace ams::powctl::impl::board::nintendo_nx { namespace ams::powctl::impl::board::nintendo::nx {
void Initialize(bool use_event_handlers); void Initialize(bool use_event_handlers);
void Finalize(); void Finalize();

View File

@@ -16,7 +16,7 @@
#include <stratosphere.hpp> #include <stratosphere.hpp>
#include "powctl_bq24193_driver.hpp" #include "powctl_bq24193_driver.hpp"
namespace ams::powctl::impl::board::nintendo_nx { namespace ams::powctl::impl::board::nintendo::nx {
namespace bq24193 { namespace bq24193 {

View File

@@ -16,7 +16,7 @@
#pragma once #pragma once
#include <stratosphere.hpp> #include <stratosphere.hpp>
namespace ams::powctl::impl::board::nintendo_nx { namespace ams::powctl::impl::board::nintendo::nx {
namespace bq24193 { namespace bq24193 {

View File

@@ -14,12 +14,12 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#include <stratosphere.hpp> #include <stratosphere.hpp>
#include "../../powctl_device_management.hpp" #include "../../../powctl_device_management.hpp"
#include "powctl_retry_helper.hpp" #include "powctl_retry_helper.hpp"
#include "powctl_charger_driver.hpp" #include "powctl_charger_driver.hpp"
#include "powctl_bq24193_driver.hpp" #include "powctl_bq24193_driver.hpp"
namespace ams::powctl::impl::board::nintendo_nx { namespace ams::powctl::impl::board::nintendo::nx {
namespace { namespace {

View File

@@ -15,15 +15,15 @@
*/ */
#pragma once #pragma once
#include <stratosphere.hpp> #include <stratosphere.hpp>
#include "../../powctl_i_power_control_driver.hpp" #include "../../../powctl_i_power_control_driver.hpp"
#include "powctl_interrupt_event_handler.hpp" #include "powctl_interrupt_event_handler.hpp"
namespace ams::powctl::impl::board::nintendo_nx { namespace ams::powctl::impl::board::nintendo::nx {
class ChargerDevice : public powctl::impl::IDevice { class ChargerDevice : public powctl::impl::IDevice {
NON_COPYABLE(ChargerDevice); NON_COPYABLE(ChargerDevice);
NON_MOVEABLE(ChargerDevice); NON_MOVEABLE(ChargerDevice);
AMS_DDSF_CASTABLE_TRAITS(ams::powctl::impl::board::nintendo_nx::ChargerDevice, ::ams::powctl::impl::IDevice); AMS_DDSF_CASTABLE_TRAITS(ams::powctl::impl::board::nintendo::nx::ChargerDevice, ::ams::powctl::impl::IDevice);
private: private:
gpio::GpioPadSession gpio_pad_session; gpio::GpioPadSession gpio_pad_session;
bool watchdog_timer_enabled; bool watchdog_timer_enabled;
@@ -54,7 +54,7 @@ namespace ams::powctl::impl::board::nintendo_nx {
class ChargerDriver : public IPowerControlDriver { class ChargerDriver : public IPowerControlDriver {
NON_COPYABLE(ChargerDriver); NON_COPYABLE(ChargerDriver);
NON_MOVEABLE(ChargerDriver); NON_MOVEABLE(ChargerDriver);
AMS_DDSF_CASTABLE_TRAITS(ams::powctl::impl::board::nintendo_nx::ChargerDriver, ::ams::powctl::impl::IPowerControlDriver); AMS_DDSF_CASTABLE_TRAITS(ams::powctl::impl::board::nintendo::nx::ChargerDriver, ::ams::powctl::impl::IPowerControlDriver);
public: public:
ChargerDriver(bool ev) : IPowerControlDriver(ev) { /* ... */ } ChargerDriver(bool ev) : IPowerControlDriver(ev) { /* ... */ }

View File

@@ -16,7 +16,7 @@
#include <stratosphere.hpp> #include <stratosphere.hpp>
#include "powctl_interrupt_event_handler.hpp" #include "powctl_interrupt_event_handler.hpp"
namespace ams::powctl::impl::board::nintendo_nx { namespace ams::powctl::impl::board::nintendo::nx {
void ChargerInterruptEventHandler::SignalEvent(IDevice *device) { void ChargerInterruptEventHandler::SignalEvent(IDevice *device) {
/* TODO */ /* TODO */

View File

@@ -15,9 +15,9 @@
*/ */
#pragma once #pragma once
#include <stratosphere.hpp> #include <stratosphere.hpp>
#include "../../powctl_i_power_control_driver.hpp" #include "../../../powctl_i_power_control_driver.hpp"
namespace ams::powctl::impl::board::nintendo_nx { namespace ams::powctl::impl::board::nintendo::nx {
template<typename Derived> template<typename Derived>
class InterruptEventHandler : public ddsf::IEventHandler { class InterruptEventHandler : public ddsf::IEventHandler {

View File

@@ -20,7 +20,7 @@
#include <arm_neon.h> #include <arm_neon.h>
#endif #endif
namespace ams::powctl::impl::board::nintendo_nx { namespace ams::powctl::impl::board::nintendo::nx {
namespace max17050 { namespace max17050 {

View File

@@ -16,7 +16,7 @@
#pragma once #pragma once
#include <stratosphere.hpp> #include <stratosphere.hpp>
namespace ams::powctl::impl::board::nintendo_nx { namespace ams::powctl::impl::board::nintendo::nx {
namespace max17050 { namespace max17050 {

View File

@@ -19,10 +19,10 @@
#if defined(ATMOSPHERE_BOARD_NINTENDO_NX) #if defined(ATMOSPHERE_BOARD_NINTENDO_NX)
#include "board/nintendo_nx/powctl_board_impl.hpp" #include "board/nintendo/nx/powctl_board_impl.hpp"
namespace ams::powctl::impl::board { namespace ams::powctl::impl::board {
using namespace ams::powctl::impl::board::nintendo_nx; using namespace ams::powctl::impl::board::nintendo::nx;
} }
#else #else

View File

@@ -17,7 +17,7 @@
#include "pwm_impl_pwm_driver_api.hpp" #include "pwm_impl_pwm_driver_api.hpp"
#include "pwm_pwm_driver_impl.hpp" #include "pwm_pwm_driver_impl.hpp"
namespace ams::pwm::driver::board::nintendo_nx::impl { namespace ams::pwm::driver::board::nintendo::nx::impl {
namespace { namespace {

View File

@@ -16,7 +16,7 @@
#pragma once #pragma once
#include <stratosphere.hpp> #include <stratosphere.hpp>
namespace ams::pwm::driver::board::nintendo_nx::impl { namespace ams::pwm::driver::board::nintendo::nx::impl {
struct ChannelDefinition { struct ChannelDefinition {
DeviceCode device_code; DeviceCode device_code;

View File

@@ -16,7 +16,7 @@
#include <stratosphere.hpp> #include <stratosphere.hpp>
#include "pwm_pwm_driver_impl.hpp" #include "pwm_pwm_driver_impl.hpp"
namespace ams::pwm::driver::board::nintendo_nx::impl { namespace ams::pwm::driver::board::nintendo::nx::impl {
namespace { namespace {

View File

@@ -17,12 +17,12 @@
#include <stratosphere.hpp> #include <stratosphere.hpp>
#include "pwm_impl_pwm_driver_api.hpp" #include "pwm_impl_pwm_driver_api.hpp"
namespace ams::pwm::driver::board::nintendo_nx::impl { namespace ams::pwm::driver::board::nintendo::nx::impl {
class PwmDeviceImpl : public ::ams::pwm::driver::IPwmDevice { class PwmDeviceImpl : public ::ams::pwm::driver::IPwmDevice {
NON_COPYABLE(PwmDeviceImpl); NON_COPYABLE(PwmDeviceImpl);
NON_MOVEABLE(PwmDeviceImpl); NON_MOVEABLE(PwmDeviceImpl);
AMS_DDSF_CASTABLE_TRAITS(ams::pwm::driver::board::nintendo_nx::impl::PwmDeviceImpl, ::ams::pwm::driver::IPwmDevice); AMS_DDSF_CASTABLE_TRAITS(ams::pwm::driver::board::nintendo::nx::impl::PwmDeviceImpl, ::ams::pwm::driver::IPwmDevice);
private: private:
os::SdkMutex suspend_mutex; os::SdkMutex suspend_mutex;
u32 suspend_value; u32 suspend_value;
@@ -39,7 +39,7 @@ namespace ams::pwm::driver::board::nintendo_nx::impl {
class PwmDriverImpl : public ::ams::pwm::driver::IPwmDriver { class PwmDriverImpl : public ::ams::pwm::driver::IPwmDriver {
NON_COPYABLE(PwmDriverImpl); NON_COPYABLE(PwmDriverImpl);
NON_MOVEABLE(PwmDriverImpl); NON_MOVEABLE(PwmDriverImpl);
AMS_DDSF_CASTABLE_TRAITS(ams::pwm::driver::board::nintendo_nx::impl::PwmDriverImpl, ::ams::pwm::driver::IPwmDriver); AMS_DDSF_CASTABLE_TRAITS(ams::pwm::driver::board::nintendo::nx::impl::PwmDriverImpl, ::ams::pwm::driver::IPwmDriver);
private: private:
dd::PhysicalAddress registers_phys_addr; dd::PhysicalAddress registers_phys_addr;
size_t registers_size; size_t registers_size;

View File

@@ -16,7 +16,7 @@
#include <stratosphere.hpp> #include <stratosphere.hpp>
#include "impl/pwm_impl_pwm_driver_api.hpp" #include "impl/pwm_impl_pwm_driver_api.hpp"
namespace ams::pwm::driver::board::nintendo_nx { namespace ams::pwm::driver::board::nintendo::nx {
void Initialize() { void Initialize() {
R_ABORT_UNLESS(impl::InitializePwmDriver()); R_ABORT_UNLESS(impl::InitializePwmDriver());

View File

@@ -147,62 +147,14 @@ namespace ams::sf::hipc {
return ResultSuccess(); return ResultSuccess();
} }
void ServerManagerBase::ProcessDeferredSessions() {
/* Iterate over the list of deferred sessions, and see if we can't do anything. */
std::scoped_lock lk(this->deferred_session_mutex);
/* Undeferring a request may undefer another request. We'll continue looping until everything is stable. */
bool needs_undefer_all = true;
while (needs_undefer_all) {
needs_undefer_all = false;
auto it = this->deferred_session_list.begin();
while (it != this->deferred_session_list.end()) {
ServerSession *session = static_cast<ServerSession *>(&*it);
R_TRY_CATCH(this->ProcessForSession(session)) {
R_CATCH(sf::ResultRequestDeferred) {
/* Session is still deferred, so let's continue. */
it++;
continue;
}
R_CATCH(sf::impl::ResultRequestInvalidated) {
/* Session is no longer deferred! */
it = this->deferred_session_list.erase(it);
needs_undefer_all = true;
continue;
}
} R_END_TRY_CATCH_WITH_ABORT_UNLESS;
/* We succeeded! Remove from deferred list. */
it = this->deferred_session_list.erase(it);
needs_undefer_all = true;
}
}
}
Result ServerManagerBase::Process(os::WaitableHolderType *holder) { Result ServerManagerBase::Process(os::WaitableHolderType *holder) {
switch (static_cast<UserDataTag>(os::GetWaitableHolderUserData(holder))) { switch (static_cast<UserDataTag>(os::GetWaitableHolderUserData(holder))) {
case UserDataTag::Server: case UserDataTag::Server:
return this->ProcessForServer(holder); return this->ProcessForServer(holder);
break;
case UserDataTag::MitmServer: case UserDataTag::MitmServer:
return this->ProcessForMitmServer(holder); return this->ProcessForMitmServer(holder);
break;
case UserDataTag::Session: case UserDataTag::Session:
/* Try to process for session. */ return this->ProcessForSession(holder);
R_TRY_CATCH(this->ProcessForSession(holder)) {
R_CATCH(sf::ResultRequestDeferred) {
/* The session was deferred, so push it onto the deferred session list. */
std::scoped_lock lk(this->deferred_session_mutex);
this->deferred_session_list.push_back(*static_cast<ServerSession *>(holder));
return ResultSuccess();
}
} R_END_TRY_CATCH;
/* We successfully invoked a command...so let's see if anything can be undeferred. */
this->ProcessDeferredSessions();
return ResultSuccess();
break;
AMS_UNREACHABLE_DEFAULT_CASE(); AMS_UNREACHABLE_DEFAULT_CASE();
} }
} }

View File

@@ -254,7 +254,7 @@ namespace ams::spl {
return SocType_Erista; return SocType_Erista;
case HardwareType::Hoag: case HardwareType::Hoag:
case HardwareType::Iowa: case HardwareType::Iowa:
case HardwareType::_Five_: case HardwareType::Aula:
return SocType_Mariko; return SocType_Mariko;
AMS_UNREACHABLE_DEFAULT_CASE(); AMS_UNREACHABLE_DEFAULT_CASE();
} }

View File

@@ -464,7 +464,7 @@ namespace ams::updater {
case spl::HardwareType::Hoag: case spl::HardwareType::Hoag:
case spl::HardwareType::Iowa: case spl::HardwareType::Iowa:
case spl::HardwareType::Calcio: case spl::HardwareType::Calcio:
case spl::HardwareType::_Five_: case spl::HardwareType::Aula:
return BootImageUpdateType::Mariko; return BootImageUpdateType::Mariko;
AMS_UNREACHABLE_DEFAULT_CASE(); AMS_UNREACHABLE_DEFAULT_CASE();
} }

View File

@@ -17,7 +17,7 @@
#define ATMOSPHERE_RELEASE_VERSION_MAJOR 0 #define ATMOSPHERE_RELEASE_VERSION_MAJOR 0
#define ATMOSPHERE_RELEASE_VERSION_MINOR 16 #define ATMOSPHERE_RELEASE_VERSION_MINOR 16
#define ATMOSPHERE_RELEASE_VERSION_MICRO 1 #define ATMOSPHERE_RELEASE_VERSION_MICRO 2
#define ATMOSPHERE_RELEASE_VERSION ATMOSPHERE_RELEASE_VERSION_MAJOR, ATMOSPHERE_RELEASE_VERSION_MINOR, ATMOSPHERE_RELEASE_VERSION_MICRO #define ATMOSPHERE_RELEASE_VERSION ATMOSPHERE_RELEASE_VERSION_MAJOR, ATMOSPHERE_RELEASE_VERSION_MINOR, ATMOSPHERE_RELEASE_VERSION_MICRO

View File

@@ -57,7 +57,7 @@ namespace ams::svc {
/* This is the highest SVC version supported by Atmosphere, to be updated on new kernel releases. */ /* This is the highest SVC version supported by Atmosphere, to be updated on new kernel releases. */
/* NOTE: Official kernel versions have SVC major = SDK major + 4, SVC minor = SDK minor. */ /* NOTE: Official kernel versions have SVC major = SDK major + 4, SVC minor = SDK minor. */
constexpr inline u32 SupportedKernelMajorVersion = ConvertToSvcMajorVersion(10); constexpr inline u32 SupportedKernelMajorVersion = ConvertToSvcMajorVersion(11);
constexpr inline u32 SupportedKernelMinorVersion = ConvertToSvcMinorVersion( 4); constexpr inline u32 SupportedKernelMinorVersion = ConvertToSvcMinorVersion( 4);
constexpr inline u32 SupportedKernelVersion = EncodeKernelVersion(SupportedKernelMajorVersion, SupportedKernelMinorVersion); constexpr inline u32 SupportedKernelVersion = EncodeKernelVersion(SupportedKernelMajorVersion, SupportedKernelMinorVersion);

View File

@@ -300,14 +300,6 @@ namespace ams::kern::init {
/* Insert a physical region for the kernel page table heap region */ /* Insert a physical region for the kernel page table heap region */
MESOSPHERE_INIT_ABORT_UNLESS(KMemoryLayout::GetPhysicalMemoryRegionTree().Insert(GetInteger(slab_end_phys_addr), page_table_heap_size, KMemoryRegionType_DramKernelPtHeap)); MESOSPHERE_INIT_ABORT_UNLESS(KMemoryLayout::GetPhysicalMemoryRegionTree().Insert(GetInteger(slab_end_phys_addr), page_table_heap_size, KMemoryRegionType_DramKernelPtHeap));
/* Insert a physical region for the kernel trace buffer. */
static_assert(!IsKTraceEnabled || KTraceBufferSize > 0);
if constexpr (IsKTraceEnabled) {
const auto dram_extents = KMemoryLayout::GetMainMemoryPhysicalExtents();
const KPhysicalAddress ktrace_buffer_phys_addr = dram_extents.GetEndAddress() - KTraceBufferSize;
MESOSPHERE_INIT_ABORT_UNLESS(KMemoryLayout::GetPhysicalMemoryRegionTree().Insert(GetInteger(ktrace_buffer_phys_addr), KTraceBufferSize, KMemoryRegionType_KernelTraceBuffer));
}
/* All DRAM regions that we haven't tagged by this point will be mapped under the linear mapping. Tag them. */ /* All DRAM regions that we haven't tagged by this point will be mapped under the linear mapping. Tag them. */
for (auto &region : KMemoryLayout::GetPhysicalMemoryRegionTree()) { for (auto &region : KMemoryLayout::GetPhysicalMemoryRegionTree()) {
if (region.GetType() == KMemoryRegionType_Dram) { if (region.GetType() == KMemoryRegionType_Dram) {

View File

@@ -0,0 +1,25 @@
/*
* Copyright (c) 2018-2020 Atmosphère-NX
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
*
* This program is distributed in the hope it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <mesosphere.hpp>
#include "../../../kern_init_loader_board_setup.hpp"
namespace ams::kern::init::loader {
void PerformBoardSpecificSetup() {
/* ... */
}
}

Some files were not shown because too many files have changed in this diff Show More