Atmosphere/fusee/fusee-secondary/src
Tomasz Moń 206c10f333 Rework sdmmc clocking configuration
Use 204 MHz as host clock in SDR104 mode instead of 136 MHz.
Due to this, also change the frequency init divider so the
initialization frequency is below 400 kHz.
This makes the clocks for SDMMC1 in all modes to match the TRM table.

Make it clear in the code that HS200/HS400 modes in fact use PLLP_OUT0
and not PLLC4_OUT2_LJ like the comment suggest. In fact selecting the
PLLC4_OUT2_LJ as clock source results in freeze after switching to
HS200/HS400 mode. This is most likely related to the PLLC4 not being
enabled, but it should be checked later.

Set the HS200/HS400 divider to 3, as this is what the code really did
set prior to this change - so this commit does not change that.

Configure Legacy 12 MHz clock to run at 12 MHz using the SW default
configuration (as per TRM) for the SDMMC legacy timer.

Introduce initial version of sdmmc_host_clock_delay() in order to use it
in places where the wait is host clock dependent. The way it is
implemented now does not change the sleep that was used instead.
2018-06-12 17:20:15 +02:00
..
display Fix strncpy bugs in fusée, etc. 2018-05-15 01:18:05 +02:00
hwinit Fix CCPLEX bringup and halt the BPMP once it's done booting. (#118) 2018-06-02 17:24:02 -07:00
lib Fix diskio.c, etc. 2018-05-15 23:54:33 +02:00
apb_misc.h Make sdmmc autocalibration follow TRM procedure 2018-06-05 19:07:14 +02:00
bct.h [stage2] Add bct.h 2018-05-10 21:54:58 +02:00
car.h Rework sdmmc clocking configuration 2018-06-12 17:20:15 +02:00
chainloader.c Refactor stage1's and stage2's main.c files 2018-05-08 16:51:43 +02:00
chainloader.h Refactor stage1's and stage2's main.c files 2018-05-08 16:51:43 +02:00
console.c Pass screen status and mmc struct from stage1 to 2 2018-06-04 19:17:23 +02:00
console.h Pass screen status and mmc struct from stage1 to 2 2018-06-04 19:17:23 +02:00
device_partition.c [stage2] Fix some FS bugs 2018-05-17 19:53:42 +02:00
device_partition.h [stage2] Fix some FS bugs 2018-05-17 19:53:42 +02:00
exception_handlers_asm.s Refactor fusee's makefile 2018-05-27 00:59:02 +02:00
exception_handlers.c Stage2: Add exception handlers 2018-05-21 03:50:53 +02:00
exception_handlers.h Stage2: Add exception handlers 2018-05-21 03:50:53 +02:00
exocfg.h Fusee Stage2: skeleton more of the nxboot process 2018-04-10 16:37:58 -06:00
flow.h Restore incorrectly deleted files 2018-04-10 15:56:45 -06:00
fs_dev.c Don't overflow devoptabs, etc. 2018-05-17 01:53:32 +02:00
fs_dev.h Don't overflow devoptabs, etc. 2018-05-17 01:53:32 +02:00
fs_utils.c Make loadlist empty when booting Horizon, more nxboot.c code 2018-05-14 21:17:06 +02:00
fs_utils.h Make loadlist empty when booting Horizon, more nxboot.c code 2018-05-14 21:17:06 +02:00
fuse.c Change fusee folder naming 2018-04-07 21:45:57 -06:00
fuse.h Change fusee folder naming 2018-04-07 21:45:57 -06:00
gpio.c [stage2] Remove printk, introduce UTF-8 console stdio 2018-05-05 23:56:18 +02:00
gpio.h Merge SD stuff into fusee-secondary. Switch diskio to single-sector reads temporarily 2018-05-04 11:47:05 -06:00
gpt.c Remove stray debug printf in gpt.c 2018-05-15 22:10:45 +02:00
gpt.h Redesign fs_dev, raw_dev, introducing device_partition and switch_fs. 2018-05-13 19:53:55 +02:00
hwinit.h Write all the needed pk1 code and a large part of the nxboot function 2018-05-14 02:40:35 +02:00
init.c stage2: fix init malloc size for stage2_args_t 2018-05-08 23:24:27 -04:00
kernel_patches.c fusee: Add kernel hash for 4.x 2018-06-03 16:59:21 +02:00
kernel_patches.h Fusee: Separate kernel patching into its own file. 2018-06-02 16:06:31 -06:00
key_derivation.c Refactor nxboot package2 reading, work around sdmmc issue, other changes 2018-05-17 23:18:33 +02:00
key_derivation.h Fusee: Change package2 loading logic (untested) 2018-05-17 15:56:02 +02:00
kip.h Change the allocation logic in stratosphere.c 2018-05-08 18:46:54 +02:00
loader.c Introduce fatal_error 2018-05-20 16:18:48 +02:00
loader.h Make loadlist empty when booting Horizon, more nxboot.c code 2018-05-14 21:17:06 +02:00
main.c Fix logic bug in stage2's main function 2018-06-05 16:18:02 +02:00
masterkey.c Refactor nxboot package2 reading, work around sdmmc issue, other changes 2018-05-17 23:18:33 +02:00
masterkey.h Refactor nxboot package2 reading, work around sdmmc issue, other changes 2018-05-17 23:18:33 +02:00
nxboot.c Fix CCPLEX bringup and halt the BPMP once it's done booting. (#118) 2018-06-02 17:24:02 -07:00
nxboot.h Make loadlist empty when booting Horizon, more nxboot.c code 2018-05-14 21:17:06 +02:00
package1.c Fix latest commit 2018-05-17 02:07:11 +02:00
package1.h Fix package1_read_and_parse_boot0 2018-05-16 01:46:08 +02:00
package2.c package2 verification and ini1 merging fixes (#125) 2018-06-04 14:04:44 -07:00
package2.h Fusee: Change package2 loading logic (untested) 2018-05-17 15:56:02 +02:00
pad_control.h Remove packed when not needed 2018-05-20 22:57:25 +02:00
panic_color.h Change fusee folder naming 2018-04-07 21:45:57 -06:00
panic.c Fusee use CAR reboot for fatal errors 2018-05-20 23:52:09 +02:00
panic.h Add custom panic driver 2018-05-20 14:11:46 +02:00
pinmux.h Remove packed when not needed 2018-05-20 22:57:25 +02:00
pmc.h Add custom panic driver 2018-05-20 14:11:46 +02:00
preprocessor.h Change fusee folder naming 2018-04-07 21:45:57 -06:00
raw_dev.c Fix out-of-bounds partition r/w bugs in raw_dev.c 2018-05-17 14:39:16 +02:00
raw_dev.h Don't overflow devoptabs, etc. 2018-05-17 01:53:32 +02:00
sdmmc.c Rework sdmmc clocking configuration 2018-06-12 17:20:15 +02:00
sdmmc.h Rework sdmmc clocking configuration 2018-06-12 17:20:15 +02:00
se.c Fusee: Fix se_calculate_sha256 2018-05-21 13:07:46 -06:00
se.h Use uintX_t for the SE & copy bugfixed SE struct definition 2018-05-21 19:05:00 +02:00
splash_screen_default.c Instead of passing FatFS structs around, unmount; other changes 2018-05-05 17:33:49 +02:00
splash_screen.c Introduce fatal_error 2018-05-20 16:18:48 +02:00
splash_screen.h Instead of passing FatFS structs around, unmount; other changes 2018-05-05 17:33:49 +02:00
stage2.h Pass screen status and mmc struct from stage1 to 2 2018-06-04 19:17:23 +02:00
start.s Fix bug in crt0 2018-05-08 14:56:17 +02:00
stratosphere.c package2 verification and ini1 merging fixes (#125) 2018-06-04 14:04:44 -07:00
stratosphere.h Write more code for stratosphere_get_ini1, make it and its caller take target_firmware 2018-05-15 16:09:06 +02:00
supplies.c Apply sdmmc stage1 changes to stage2 2018-05-10 21:36:26 +02:00
supplies.h Apply sdmmc stage1 changes to stage2 2018-05-10 21:36:26 +02:00
switch_fs.c Pass screen status and mmc struct from stage1 to 2 2018-06-04 19:17:23 +02:00
switch_fs.h Pass screen status and mmc struct from stage1 to 2 2018-06-04 19:17:23 +02:00
timers.h Merge SD stuff into fusee-secondary. Switch diskio to single-sector reads temporarily 2018-05-04 11:47:05 -06:00
utils.c Fusee use CAR reboot for fatal errors 2018-05-20 23:52:09 +02:00
utils.h Fusee use CAR reboot for fatal errors 2018-05-20 23:52:09 +02:00