Commit graph

459 commits

Author SHA1 Message Date
TuxSH
6c50723209 Fix tsec.c (thanks @rajkosto @tslater2006), fixes #106 2018-05-15 23:59:20 +02:00
TuxSH
9a86ffec68 Fix diskio.c, etc. 2018-05-15 23:54:33 +02:00
TuxSH
42fd4f73cf Remove stray debug printf in gpt.c 2018-05-15 22:10:45 +02:00
TuxSH
60dbc7c9d7 ┬┴┬┴┤( ͡° ͜ʖ‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌├┬┴┬┴ 2018-05-15 21:08:57 +02:00
Luke Street
f5ab896343 [stage2] Invert a few checks 2018-05-15 14:40:18 -04:00
TuxSH
62ebf20e25 Fix typo in nxboot.c 2018-05-15 20:24:37 +02:00
TuxSH
1288f54965 Finish writing stratosphere_get_ini1 2018-05-15 19:50:20 +02:00
TuxSH
3c0436b98f Write more code for stratosphere_get_ini1, make it and its caller take target_firmware 2018-05-15 16:09:06 +02:00
TuxSH
4e1a368b43 Write more of stratosphere_get_ini1 2018-05-15 12:38:07 +02:00
TuxSH
af2de57fdc Embed exosphere, thermosphere, loader, pm, sm into fusee-secondary
Still needs boot and boot2 to be built as proper KIPs
2018-05-15 02:45:31 +02:00
TuxSH
d9c2a54464 Make a top-level make build everything in order 2018-05-15 01:30:56 +02:00
TuxSH
172a2b679c Fix strncpy bugs in fusée, etc. 2018-05-15 01:18:05 +02:00
TuxSH
15bba0ba0c Make loadlist empty when booting Horizon, more nxboot.c code 2018-05-14 21:17:06 +02:00
TuxSH
c2b22a6bf2 Write all the needed pk1 code and a large part of the nxboot function 2018-05-14 02:40:35 +02:00
TuxSH
17f4a17d17 [stage2] Add debug printf in main.c 2018-05-14 00:06:48 +02:00
TuxSH
bc7369b5d1 [stage2] Add dump_to_file 2018-05-14 00:03:05 +02:00
TuxSH
8df624a10d Rename sd_utils to fs_utils, etc 2018-05-13 23:49:50 +02:00
TuxSH
a3792d94dc [stage2] Support sector sizes up to 4K in FatFs.
Note: SD cards always have a sector size of 512 bytes.
2018-05-13 20:51:57 +02:00
TuxSH
9f53aa13d1 [stage2] Implement disk_status 2018-05-13 20:32:38 +02:00
TuxSH
4f50d412f5 Redesign fs_dev, raw_dev, introducing device_partition and switch_fs.
In theory, one could mount an encrypted FAT partition itself coming from a disk image, etc.
2018-05-13 19:53:55 +02:00
TuxSH
396a646fa3 [stage2] Add console_get_framebuffer 2018-05-12 21:39:29 +02:00
TuxSH
9dce3b05ba [stage1] refactor diskio.c 2018-05-12 12:37:41 +02:00
TuxSH
00f08321c7 [stage2] Accomodate raw_mmc_dev to latest sdmmc driver changes 2018-05-12 12:23:07 +02:00
TuxSH
75169790ff stage1 -> stage2 again 2018-05-12 11:00:36 +02:00
TuxSH
50047dffaa [stage1] unstub multiple sector-r/w code 2018-05-12 10:52:04 +02:00
Kate J. Temkin
9f86c75ea4 fusee: undo a silly mistake in longer-than-8K operations 2018-05-11 21:36:46 -07:00
TuxSH
f6f8065417 We actually need the pk1 key 2018-05-11 23:57:48 +02:00
TuxSH
4ada3b6195
Merge pull request #93 from encounter/fix/stage2-args
Fix stage2_args_t mismatch
2018-05-11 23:38:25 +02:00
TuxSH
6e43a71b5b Fix misconception in latest commit 2018-05-11 23:12:22 +02:00
TuxSH
3ac3183c85 [stage2] Refactor key_derivation type and function declarations 2018-05-11 23:01:13 +02:00
TuxSH
eb8573093d Move sd init into diskio.c, write code for latest commit 2018-05-11 22:24:40 +02:00
Kate J. Temkin
2b871397c2 fusee: allow sdmmc_read / sdmmc_write of more data than fits in the bounce buffer 2018-05-11 11:28:13 -07:00
TuxSH
f8cf7adad7 Add code to register rawnand, boot0, and bcpkg2 2018-05-10 23:48:41 +02:00
TuxSH
a790760de3 raw_mmc_dev: fields should be u64 2018-05-10 23:23:14 +02:00
TuxSH
4168a33dd1 [stage2] Implement package1_parse_boot0 2018-05-10 22:53:46 +02:00
TuxSH
1dd073d8d2 [stage2] Add bct.h 2018-05-10 21:54:58 +02:00
TuxSH
ac9939b7a1 Apply sdmmc stage1 changes to stage2 2018-05-10 21:36:26 +02:00
Kate J. Temkin
402b69c549 fusee: actually obey the SD spec when switching voltage 2018-05-10 07:10:37 -07:00
TuxSH
5b5aa38486 [stage2] Add GPT parsing code (tested on PC) 2018-05-10 15:16:44 +02:00
Kate J. Temkin
437344fd25 fusee: support low-voltage SDMMC mode 2018-05-10 06:05:28 -07:00
Kate J. Temkin
b20a04ede5 fusee: use full bus width and faster initial clock speed 2018-05-10 06:05:28 -07:00
TuxSH
20c225c829 [stage2] raw_mmc_dev.c: fix various bugs 2018-05-10 00:36:13 +02:00
TuxSH
3e68441040 [stage2] Make console.c manage the display, enable it only when needed 2018-05-09 22:20:14 +02:00
TuxSH
4217d7feef [stage2] Unstub rawmmcdev_write 2018-05-09 20:52:21 +02:00
TuxSH
ff2472385f [sdmmc] sdmmc_handle_cpu_transfer: handle unaligned buffers 2018-05-09 20:46:16 +02:00
TuxSH
b9b13e215f Fix struct tegra_sdmmc definition
Definition errors were cancelling each other (for the most part)
2018-05-09 19:33:54 +02:00
TuxSH
3206583db3 [sdmmc] Fix const-correctness issue 2018-05-09 19:11:16 +02:00
TuxSH
7ad818ed93 Use latest sdmmc driver in stage2 2018-05-09 18:01:51 +02:00
TuxSH
694289de0b Add raw_mmc_dev (untested!) 2018-05-09 17:51:13 +02:00
TuxSH
04f9920cc3 Rename g_devices to g_fsdev_devices 2018-05-09 17:26:30 +02:00
TuxSH
3fae01b08f Rewrite condition in fsdev_seek 2018-05-09 17:10:35 +02:00
TuxSH
bf94bf48d2 Refine error in fsdev_mount_device 2018-05-09 14:16:33 +02:00
TuxSH
b2c82c75d0 Make stdout line-buffered 2018-05-09 11:49:10 +02:00
TuxSH
7560abbfbd Fix FindDevice and RemoveDevice calls in fs_dev.c 2018-05-09 11:36:49 +02:00
Luke Street
290fb356a1 stage2: fix init malloc size for stage2_args_t 2018-05-08 23:24:27 -04:00
Luke Street
6dbd8d0aae Fix stage2_args_t mismatch 2018-05-08 23:08:54 -04:00
TuxSH
3682a56062 O_RDONLY is 0 2018-05-09 00:53:13 +02:00
TuxSH
77faa00a57 Rewrite package2.c 2018-05-09 00:19:51 +02:00
TuxSH
7df879d346 Change the allocation logic in stratosphere.c 2018-05-08 18:46:54 +02:00
TuxSH
70bb496388 Refactor stage1's and stage2's main.c files 2018-05-08 16:51:43 +02:00
TuxSH
50498e3b20 Don't deinit the display yet, for now 2018-05-08 15:44:48 +02:00
TuxSH
d43255d484 Fix bug in crt0 2018-05-08 14:56:17 +02:00
TuxSH
461e886244 Make di.c accept arbitrary FB addresses, fix flickering issues 2018-05-08 13:45:37 +02:00
TuxSH
170cd2d8c4 [stage2] Forgot to change that, too 2018-05-08 13:45:37 +02:00
TuxSH
d390ead56f Fix faulty IRAM check in check_32bit_address_range_in_program 2018-05-08 13:45:37 +02:00
TuxSH
880f49cfa5 Fix inverted condition issue in check_32bit_address_range_loadable 2018-05-08 13:45:37 +02:00
TuxSH
1fd098e074 [stage1] Fix DEFAULT_BCT0_FOR_DEBUG 2018-05-08 13:45:37 +02:00
TuxSH
e8306361f0 Rewrote crt0, init, and chainloading code
start.s, init.c, linker.ld and linker.specs are meant
to be re-used by user applications, should they remove the defines
from init.c and the .chainloader* sections from the linker script
2018-05-08 13:45:37 +02:00
TuxSH
699ddfc043 Simplify fsdev_set_default_device 2018-05-08 13:44:47 +02:00
TuxSH
5084f09081 Fix warning/error, etc. in fs_dev.c 2018-05-07 23:05:53 +02:00
TuxSH
25db9fcc4a Fix fsdev_set_default_device bug 2018-05-07 14:25:01 +02:00
TuxSH
7695b5bdbd [stage2] Fix the ordering of rules in linker script 2018-05-07 10:53:41 +02:00
Kate J. Temkin
8d071ca7c9 fusee: fix boot partition selection 2018-05-06 22:47:36 -06:00
Kate J. Temkin
f5ed029cdb fusee: fix regression in card detection 2018-05-06 22:32:52 -06:00
Kate J. Temkin
5065a04451 fusee-secondary: don't create 3GiB output files :) 2018-05-06 21:49:42 -06:00
TuxSH
75dfcd07a9 Add chainloader (stage2) (need to edit more files) 2018-05-07 01:02:23 +02:00
TuxSH
2c07b5a2fb Rework fs_dev mount code 2018-05-06 18:41:40 +02:00
TuxSH
a29e800661 Revert "Fix mount code in fs_dev.c"
This reverts commit 306555e522.
2018-05-06 18:14:08 +02:00
TuxSH
8b418732ad Upgrade FatFs to R0.13b 2018-05-06 18:00:22 +02:00
TuxSH
4265dc7b65 Don't pass the mmc struct around 2018-05-06 17:22:12 +02:00
TuxSH
68eec056a9 Fix const-correctness issue in sdmmc.h 2018-05-06 15:22:35 +02:00
TuxSH
1aa6b92bc4 Normalize drivers between stage1 and 2 2018-05-06 15:02:13 +02:00
TuxSH
306555e522 Fix mount code in fs_dev.c 2018-05-06 13:03:45 +02:00
TuxSH
8f5a5acb06 Fix the g_bct0 overflow issue, malloc now works
The linker chose the unused symbol from loader.c.
2018-05-06 11:46:48 +02:00
TuxSH
6e5d4b8fc9 Fix bss overflow error 2018-05-06 00:45:30 +02:00
TuxSH
8648cac77b [stage2] Remove printk, introduce UTF-8 console stdio 2018-05-05 23:56:18 +02:00
TuxSH
ddea5484b6 [stage1] support utf8 in fatfs 2018-05-05 22:05:11 +02:00
TuxSH
30b9873ab3 Use the bloated string formatting functions from newlib 2018-05-05 18:35:00 +02:00
TuxSH
67b76cc8f1 Instead of passing FatFS structs around, unmount; other changes 2018-05-05 17:33:49 +02:00
TuxSH
0fca6c2296 [stage2] Add fatfs devoptab wrapper, change ffconf accordingly 2018-05-05 16:30:25 +02:00
Kate J. Temkin
8eb8de0e94 fusee: fix an obvious sdmmc error (oops) 2018-05-05 03:29:01 -06:00
Kate J. Temkin
bceb00ad8d fusee: sdmmc: clean up and prepare for better SD/MMC/version separations 2018-05-04 18:48:20 -06:00
Kate J. Temkin
2e362d93da fusee: add support for SDMMC write operations 2018-05-04 17:16:19 -06:00
Michael Scire
553cd236f2 Fusee: fix typo 2018-05-04 16:38:10 -06:00
Michael Scire
9487924973 Fusee: Add #define requirement for pragmatic reasons. 2018-05-04 16:35:33 -06:00
Kate J. Temkin
711f85305b fusee: enable sdmmc loglevel control 2018-05-04 16:15:51 -06:00
Kate J. Temkin
932a5bd645 fusee: fix multiple-block SDMMC transfers 2018-05-04 16:15:18 -06:00
TuxSH
e5fff14689 Move fatfs around 2018-05-05 00:11:22 +02:00
TuxSH
0d344e45af Initialize heap, increase stack size 2018-05-04 23:56:01 +02:00
TuxSH
dc3099781d Change defaut BCT0 for debug 2018-05-04 21:52:38 +02:00
Michael Scire
4199be2460 Merge SD stuff into fusee-secondary. Switch diskio to single-sector reads temporarily 2018-05-04 11:47:05 -06:00
Michael Scire
299b020ecc Push minimally working FATFS. 2018-05-04 11:21:15 -06:00
Kate J. Temkin
010ba9248c fusee: make SDMMC debug printing more manageable 2018-05-04 03:38:41 -06:00
Kate J. Temkin
0120b9ce52 fusee: get uSD working, fix bad no_iopower, and abstract card differences 2018-05-04 03:24:27 -06:00
Kate J. Temkin
99f749ef82 fusee: fix SD pinmuxing / signal integrity issues 2018-05-04 03:24:27 -06:00
Kate J. Temkin
5b3be77f0e fusee: fix drive strength and avoid a pad wear-condition 2018-05-04 03:24:27 -06:00
Kate J. Temkin
fc97c3f773 fusee: merge in most of the microSD card (not fully working) 2018-05-04 03:24:27 -06:00
Kate J. Temkin
608d59c229 fusee: implement partition support; needs some tweeks 2018-05-04 03:24:27 -06:00
Kate J. Temkin
01e3761d4c fusee: sdmmc: use v3 compatibility mode for it's simpler DMA
we may want to change this at some point to get 64-bit addressing?
2018-05-04 03:24:27 -06:00
Kate J. Temkin
ef1923ebab fusee: sdmmc: support CPU reads in addition to (broken?) DMA 2018-05-04 03:24:27 -06:00
Kate J. Temkin
21c177804e fusee: sdmmc: handle DMA page boundaries 2018-05-04 03:24:27 -06:00
Kate J. Temkin
534c50fba5 sdmmc: mostly working for eMMC, now 2018-05-04 03:24:27 -06:00
Kate J. Temkin
eb48e06331 fusee: get non-data SDMMC commands fully working on eMMC 2018-05-04 03:24:27 -06:00
Kate J. Temkin
dbb65428e8 fusee: further flesh out sdmmc implementation 2018-05-04 03:24:27 -06:00
Kate J. Temkin
2e3af0c474 fusee: fix issue with SDMMC psuedo-interrupts 2018-05-04 03:24:27 -06:00
Kate J. Temkin
fbe159e4d3 fusee: add missing file 2018-05-04 03:24:27 -06:00
Kate J. Temkin
06bf132022 skeleton SDMMC 2018-05-04 03:24:27 -06:00
Max K
0807aaea2b Fix small issues in the stage2 loader (#78)
* stage2 loader: Fix loadlist parsing breaking out of the loop too early

* stage2 loader: Use bct0 from the loader context
2018-05-03 13:08:30 -07:00
Michael Scire
ea609e68d3 Change read_sd_file semantics to return size read. 2018-04-26 04:47:22 -06:00
Rajko Stojadinovic
4e1c12a659 Fusee: Fix BisPartition enum to correctly identify partitions.
* BisPartition_t was missing SAFE, meaning User and System were using wrong key_source

* Normalize tabs to spaces

* Merge User and System BisPartition_t because they are the same key anyway

* Remove extra newline
2018-04-25 09:47:39 -07:00
Kate J. Temkin
b5d3ce04e8 fusee: fix missing volatiles in memory utils 2018-04-20 19:12:20 -06:00
Kate J. Temkin
60c0df032d fusee: update header names for starting cpu0 2018-04-20 04:10:44 -06:00
Michael Scire
5742571153 Fusee: Fix overflow condition in SD KIP merging 2018-04-12 02:47:27 -06:00
Michael Scire
75b29e777b Fusee: Update INI1 size after patching 2018-04-11 22:32:45 -06:00
Michael Scire
375a0b3fa8 Fusee: Actually write SD path in stratosphere_merge_inis 2018-04-11 22:10:02 -06:00
Michael Scire
0674c4b64f Stratosphere: Add support for custom KIPs/INI in Fusee 2018-04-11 21:56:11 -06:00
Michael Scire
e5a0cb1abe Fusee Stage 2: Flesh out Package2 patching (implement decryption, fixing of metadata) 2018-04-11 20:29:35 -06:00
Michael Scire
a0d2642bb1 Skeleton out framework for patching package2. 2018-04-11 18:19:01 -06:00
Michael Scire
3c24bfdb79 Fusee Stage2: skeleton more of the nxboot process 2018-04-10 16:37:58 -06:00
Michael Scire
9fadec60c5 Add skeleton architecture for displaying custom splash screen 2018-04-10 16:09:00 -06:00
Michael Scire
87605563d2 Restore incorrectly deleted files 2018-04-10 15:56:45 -06:00
Michael Scire
d6806517c8 Fusee Stage 2: Make references to external (stage 1) memory internal. 2018-04-09 15:44:59 -06:00
Michael Scire
a05bf5b4ce Fusee stage 2: Fix up loader (no stage 3!). Skeleton chainload behavior. 2018-04-09 15:34:23 -06:00
Michael Scire
b85567dff3 Remove stage3 refs from Makefile 2018-04-09 15:16:51 -06:00
Michael Scire
92ef68e84a Turns out we actually don't need a third stage for Fusee 2018-04-09 15:12:54 -06:00
Michael Scire
953c02dfba Update argument passing, add video resume 2018-04-08 13:51:44 -06:00
Michael Scire
82552b5a89 Implement much of the core Stage2 loader logic for Fusee 2018-04-08 05:51:57 -06:00
Michael Scire
c9909b34db Use argc/argv in Stage 2 2018-04-08 05:13:15 -06:00
Michael Scire
39bf3cb800 Add display/printk to fusee stage2 2018-04-08 05:06:47 -06:00
Michael Scire
c758b1188a Fix start.s in stage2 of Fusee for argc/argv 2018-04-08 05:06:04 -06:00
Michael Scire
353019a269 Add debugging prints, enable backlight for stage1 2018-04-07 23:04:30 -06:00
Michael Scire
33f76545df Implement all core Stage 1 logic for Fusee 2018-04-07 22:51:24 -06:00
Michael Scire
18f1274587 Change fusee folder naming 2018-04-07 21:45:57 -06:00
Michael Scire
2c7d6dc9b7 Sketch out more of fusee 2018-04-07 15:43:54 -06:00
hexkyz
b310824dac SDMMC: Adding register definitions and draft files 2018-04-04 22:31:05 +01:00
Kate J. Temkin
a73ef0eab1 fusee: fix critical rendering bug 2018-04-03 05:16:13 -06:00
Kate J. Temkin
9766cabdef fusee: jeez, srsly, kate, include all the files when you commit 2018-04-03 04:49:02 -06:00
Kate J. Temkin
0c13e5a2c1 fusee: commit a straggler for flicker removal 2018-04-03 04:15:48 -06:00
Kate J. Temkin
3f40a89316 fusee: don't flicker as we turn the display on
Defers backlight init until the framebuffer's fully set up.
2018-04-03 03:56:50 -06:00
Michael Scire
2d8812ac6e Implement BIS Key derivation. 2018-03-31 15:40:23 -06:00
Michael Scire
19178d6176 Fix XTS implementation, now verified working on HW. 2018-03-31 15:40:23 -06:00
Michael Scire
edf9e2f5c7 Prevent compiler optimization of SE LL writes 2018-03-29 13:46:10 -06:00
Michael Scire
6ed9123c24 Implement NX Key Derivation. 2018-03-29 13:14:58 -06:00
Kate J. Temkin
57853602df fusee: add basic print-to-display console / printk 2018-03-27 05:28:28 -06:00
Michael Scire
9ab7d66524 Implement SE XTS driver code for fusee 2018-03-25 18:50:56 -06:00
Michael Scire
53cf46d20f Clean up Fusee's SE API, removing unneeded functionality 2018-03-25 17:16:17 -06:00
TuxSH
c6ee1bffb7 Display PoC 2018-03-15 23:12:38 +01:00
TuxSH
b48e71ab82 Import hwinit (with small changes) and exosphère drivers 2018-03-15 16:14:41 +01:00
TuxSH
171c82ea9e Add build system for fusee 2018-03-14 21:14:02 +01:00