m1n1/src
Hector Martin 58090bb58c dart: Fix L2 table allocation & half-fix carnage from stage1
We were assuming L2 tables were always allocated consecutively at low
IOVAs. 14.5 broke this, causing all kinds of explosions.

The new code looks for the first unused L2 PT, and also checks whether
the first 2 entries are aliased to latter entries (which is what the old
code caused). If so, it clears them and reallocates them. This doesn't
undo the PT wipe from stage1 though, so downstream code has to redo any
missing mappings...

Signed-off-by: Hector Martin <marcan@marcan.st>
2024-05-17 01:54:30 +09:00
..
dcp dcp: Pass the die number for dptx' connectTo method 2023-11-27 13:33:08 +09:00
dlmalloc Fix warnings when building/linking with clang/llvm 2021-11-08 13:53:04 +09:00
libfdt Spelling fixes 2023-12-13 16:50:42 +09:00
math math: Add powf() 2023-06-27 18:35:00 +09:00
minilzlib Spelling fixes 2023-12-13 16:50:42 +09:00
tinf tinf, minzllib: support unknown input sizes 2021-02-06 16:44:10 +09:00
adt.c Fix build with -DDEBUG 2023-11-14 18:58:16 +09:00
adt.h kboot: Use adt_segment_ranges struct instead of open-coding 2023-10-05 14:21:13 +09:00
afk.c everything: Use calloc instead of malloc almost everywhere 2023-11-02 18:12:33 +09:00
afk.h dcp/afk: Retry harder to init afk endpoints/services 2023-10-13 16:33:09 +09:00
aic.c Update to clang-format 17 2024-04-09 12:57:55 +09:00
aic.h aic: Add support for multi-die AIC2 as seen on the M1 Ultra 2022-04-19 21:29:30 +09:00
aic_regs.h aic: Add support for multi-die AIC2 as seen on the M1 Ultra 2022-04-19 21:29:30 +09:00
arm_cpu_regs.h hv: Implement ECV on M2 and later chips 2023-04-18 23:37:18 +09:00
asc.c everything: Use calloc instead of malloc almost everywhere 2023-11-02 18:12:33 +09:00
asc.h nvme: Add nvme_ensure_shutdown() 2023-04-12 00:40:06 +09:00
chainload.c chainload: Properly reserve memory for everything up to bootargs 2022-03-16 01:56:57 +09:00
chainload.h chainload: Add new m1n1-side chainloader (raw images only) 2022-03-09 20:55:34 +09:00
chainload_asm.S chainload: Add new m1n1-side chainloader (raw images only) 2022-03-09 20:55:34 +09:00
chickens.c More support for M3 chips 2023-12-03 17:37:20 +09:00
chickens.h startup: Implement setting CPU chicken bits for Icestorm 2021-01-25 19:11:54 +09:00
chickens_avalanche.c More support for M3 chips 2023-12-03 17:37:20 +09:00
chickens_blizzard.c cpu_regs,apple_regs.json: More registers 2023-05-05 04:46:11 +09:00
chickens_everest.c More support for M3 chips 2023-12-03 17:37:20 +09:00
chickens_firestorm.c Spelling fixes 2023-12-13 16:50:42 +09:00
chickens_icestorm.c cpu_regs: Add more chicken bit names 2022-07-17 03:17:13 +09:00
chickens_sawtooth.c More support for M3 chips 2023-12-03 17:37:20 +09:00
clk.c clk: Add missing '\n' in printf message 2023-11-14 18:57:15 +09:00
clk.h clk: Initialize MCA clock muxes 2022-03-08 00:02:06 +09:00
cpu_regs.h More support for M3 chips 2023-12-03 17:37:20 +09:00
cpufreq.c cpufreq: Fix t6022 clusters 2023-10-08 19:14:33 +09:00
cpufreq.h cpufreq: Fix m1n1 stage 1 bugs 2023-04-18 21:55:12 +09:00
dapf.c dapf: Also (try to) init dart-isp0 2023-10-05 14:19:31 +09:00
dapf.h dapf: Support reg indexing + add ISP 2023-10-05 14:13:45 +09:00
dart.c dart: Fix L2 table allocation & half-fix carnage from stage1 2024-05-17 01:54:30 +09:00
dart.h dart: Use "vm-base" as start when installing L2 tables 2023-02-02 09:50:33 +09:00
dcp.c display: Use dcpext0 for HDMI out on t8112/t6020/t6021 2023-11-27 13:33:08 +09:00
dcp.h display: Use dcpext0 for HDMI out on t8112/t6020/t6021 2023-11-27 13:33:08 +09:00
dcp_iboot.c everything: Use calloc instead of malloc almost everywhere 2023-11-02 18:12:33 +09:00
dcp_iboot.h display: Use dcp iboot SetSurface instead of SwapLayer 2023-10-05 12:33:35 +09:00
devicetree.c devicetree: Add dt utils for "ranges" based address translation 2022-10-23 17:21:26 +09:00
devicetree.h devicetree: Add dt utils for "ranges" based address translation 2022-10-23 17:21:26 +09:00
display.c display: Fix pmgr device id for t6022 dcpext4 2023-12-16 17:17:37 +09:00
display.h display: Use dcpext0 for HDMI out on t8112/t6020/t6021 2023-11-27 13:33:08 +09:00
exception.c Support boot CPU not being 0. 2023-12-03 17:23:13 +09:00
exception.h exception: Make space in the stack for full exception context 2021-09-21 20:29:19 +09:00
exception_asm.S exception: Make space in the stack for full exception context 2021-09-21 20:29:19 +09:00
fb.c display,fb: Clear framebuffer early in the Sonoma stage2 fixup path 2023-11-02 18:12:33 +09:00
fb.h display,fb: Clear framebuffer early in the Sonoma stage2 fixup path 2023-11-02 18:12:33 +09:00
firmware.c firmware: Add 13.6.2 and 14.1.1 firmware versions 2023-11-15 12:13:00 +09:00
firmware.h firmware: Add 13.6.2 and 14.1.1 firmware versions 2023-11-15 12:13:00 +09:00
gxf.c gxf, smp: Allocate stacks dynamically 2021-12-17 21:46:55 +09:00
gxf.h gxf: Per-CPU gxf stack 2021-09-15 23:24:37 +09:00
gxf_asm.S gxf, smp: Allocate stacks dynamically 2021-12-17 21:46:55 +09:00
heapblock.c heapblock: Remove payload_end logic for heap start 2021-12-17 22:26:54 +09:00
heapblock.h Add heapblock and dlmalloc for managing memory 2021-01-29 16:25:15 +09:00
hv.c Support boot CPU not being 0. 2023-12-03 17:23:13 +09:00
hv.h hv: Make breadcrumbs per-CPU and introduce panic handler 2023-06-03 12:47:39 +09:00
hv_aic.c aic: Add support for multi-die AIC2 as seen on the M1 Ultra 2022-04-19 21:29:30 +09:00
hv_asm.S exception: Clean up FIQ state on secondary startup 2022-08-29 17:02:40 +09:00
hv_exc.c hv_exc: Remove PMC0 CNT enable shadowing from fast sysreg path 2023-05-22 00:27:08 +09:00
hv_virtio.c everything: Use calloc instead of malloc almost everywhere 2023-11-02 18:12:33 +09:00
hv_vm.c Fix build with -DDEBUG 2023-11-14 18:58:16 +09:00
hv_vuart.c iodev: usb: replace secondary usb iodevs with single vuart iodev 2021-11-12 23:48:32 +09:00
hv_wdt.c Support boot CPU not being 0. 2023-12-03 17:23:13 +09:00
i2c.c everything: Use calloc instead of malloc almost everywhere 2023-11-02 18:12:33 +09:00
i2c.h i2c: Make error paths wait for bus in i2c_smbus_read 2021-10-10 23:49:51 +09:00
iodev.c Support boot CPU not being 0. 2023-12-03 17:23:13 +09:00
iodev.h iodev, uartproxy: Fix write interleaving causing corruption 2022-08-29 17:02:40 +09:00
iova.c everything: Use calloc instead of malloc almost everywhere 2023-11-02 18:12:33 +09:00
iova.h dcp: Free iovad_dcp including dart L2 tables on shutdown 2022-05-30 23:01:01 +09:00
isp.c isp: Declare 13.6.2 firmware as 13.5 compatible on t600x/t602x 2023-11-15 12:13:00 +09:00
isp.h isp, kboot: Misc changes for t8112 2023-10-05 14:21:13 +09:00
kboot.c sio: Rework sio init for dual die SoCs 2024-04-29 16:46:20 +09:00
kboot.h kboot: Replace kboot_set_bootargs with kboot_set_chosen 2022-03-09 20:55:34 +09:00
kboot_gpu.c kboot_gpu: Declare GPU firmware 13.6.2 as 13.5 compatible 2023-11-15 12:13:00 +09:00
keyboard_types.h kboot: Pass keyboard layout ID & country code in HID device 2023-03-19 18:14:44 +09:00
main.c More support for M3 chips 2023-12-03 17:37:20 +09:00
mcc.c More support for M3 chips 2023-12-03 17:37:20 +09:00
mcc.h kboot: Move MCC cache enable to kboot 2023-09-05 23:33:19 +09:00
memory.c Spelling fixes 2023-12-13 16:50:42 +09:00
memory.h memory: Add GRE and nGRE mappings for experiments 2022-06-19 21:53:06 +09:00
memory_asm.S MMU: add cache operations by set/way 2021-01-28 23:20:15 +09:00
nvme.c Spelling fixes 2023-12-13 16:50:42 +09:00
nvme.h nvme: bring up controller and implement nvme_read 2022-01-26 15:38:40 +09:00
payload.c Support boot CPU not being 0. 2023-12-03 17:23:13 +09:00
payload.h Rework kboot/chainload flow to shut down before calling the next stage 2021-04-17 18:12:59 +09:00
pcie.c pcie: T602X APCIE-GE support 2023-08-07 21:05:25 +09:00
pcie.h pcie: Add a pcie_shutdown() function and call it on hv init 2021-05-28 00:03:11 +09:00
pmgr.c pmgr: Expose pmgr_set_mode 2023-10-05 14:19:31 +09:00
pmgr.h pmgr: Expose pmgr_set_mode 2023-10-05 14:19:31 +09:00
proxy.c proxy: Add EL0 SMP ops 2024-04-09 09:20:40 +09:00
proxy.h proxy: Add EL0 SMP ops 2024-04-09 09:20:40 +09:00
ringbuffer.c everything: Use calloc instead of malloc almost everywhere 2023-11-02 18:12:33 +09:00
ringbuffer.h ringbuffer: add a simple ringbuffer data structure 2021-04-15 18:39:33 +09:00
rtkit.c Spelling fixes 2023-12-13 16:50:42 +09:00
rtkit.h rtkit: Support usage with SRAM 2023-10-05 12:33:35 +09:00
sart.c everything: Use calloc instead of malloc almost everywhere 2023-11-02 18:12:33 +09:00
sart.h sart: Add SART support 2022-01-16 18:53:29 +09:00
sep.c sep: add simple SEP TRNG API 2022-03-19 02:33:54 +09:00
sep.h sep: add simple SEP TRNG API 2022-03-19 02:33:54 +09:00
sio.c sio: Rework sio init for dual die SoCs 2024-04-29 16:46:20 +09:00
sio.h sio: Rework sio init for dual die SoCs 2024-04-29 16:46:20 +09:00
smc.c smc: fix smc_init() definition 2023-10-08 16:09:18 +09:00
smc.h smc: Add minimal smc client 2023-10-05 12:33:35 +09:00
smp.c Support boot CPU not being 0. 2023-12-03 17:23:13 +09:00
smp.h Support boot CPU not being 0. 2023-12-03 17:23:13 +09:00
soc.h More support for M3 chips 2023-12-03 17:37:20 +09:00
start.S Configure early debug features by SoC type 2021-11-01 13:36:42 +09:00
startup.c Support boot CPU not being 0. 2023-12-03 17:23:13 +09:00
string.c string: Add atol 2022-03-27 17:23:50 +09:00
tps6598x.c Spelling fixes 2023-12-13 16:50:42 +09:00
tps6598x.h usb: disable tps6598x interrupts 2021-06-18 14:26:54 +09:00
tunables.c tunables: add tunables_apply_local_addr 2021-04-08 20:32:12 +09:00
tunables.h tunables_static: New module to set up static tunables 2022-09-27 06:04:41 +09:00
tunables_static.c tunables_static: improve sequence iter 2023-03-28 17:19:45 +09:00
types.h cpu_regs: Make fields usable from assembler 2023-04-19 02:37:02 +09:00
uart.c iodev: Protect iodevs with spinlocks 2021-11-04 03:53:39 +09:00
uart.h Remove hardcoded UART/WDT addresses 2021-11-01 11:27:29 +09:00
uart_regs.h uart: Add more UART reg defines and use them 2021-08-23 17:00:53 +09:00
uartproxy.c iodev, uartproxy: Fix write interleaving causing corruption 2022-08-29 17:02:40 +09:00
uartproxy.h exception: Make space in the stack for full exception context 2021-09-21 20:29:19 +09:00
usb.c Fix condition for SPMI HPM 2023-12-17 19:09:06 +09:00
usb.h Revert "usb: Add usb_idx_from_address() to find a dev by its MMIO addr" 2021-11-23 23:36:14 +09:00
usb_dwc3.c everything: Use calloc instead of malloc almost everywhere 2023-11-02 18:12:33 +09:00
usb_dwc3.h iodev: Make iodev_can_read() return the queued byte count 2021-08-23 17:00:14 +09:00
usb_dwc3_regs.h Update to clang-format 17 2024-04-09 12:57:55 +09:00
usb_types.h usb_dwc3: Populate serial number with the actual serial number 2023-04-18 22:07:21 +09:00
utils.c display: Factor out top of memory allocation 2023-08-17 19:49:43 +09:00
utils.h Update to clang-format 17 2024-04-09 12:57:55 +09:00
utils_asm.S utils: Add cpu_sleep() function 2023-04-19 03:21:58 +09:00
vsprintf.c Add a space between '//' and '#' to satisfy clang-format 15 2023-02-02 09:51:08 +09:00
vsprintf.h Initial commit 2021-01-15 04:03:35 +09:00
wdt.c Remove hardcoded UART/WDT addresses 2021-11-01 11:27:29 +09:00
wdt.h Remove hardcoded UART/WDT addresses 2021-11-01 11:27:29 +09:00
xnuboot.h Import UART proxy 2021-01-15 04:04:12 +09:00