@@ -917,24 +917,18 @@ cache_sram_init_loop:
917917 bdnz cache_sram_init_loop
918918#elif defined(L2SRAM_ADDR)
919919cache_sram_init:
920- /* Zero CPC SRAM to initialize ECC/parity for all cache lines.
921- * Uses stdu (8-byte double-word stores with update) like the reference
922- * T2080 implementation. dcbz cannot be used here because it generates
923- * a coherent "allocate-and-zero" CoreNet transaction that CPC SRAM
924- * does not support on cold power cycle. stdu generates normal store
925- * transactions that work correctly through L1→L2→CPC SRAM.
926- * CPCPE (ECC) is disabled in SRAM mode, so line fills of uninitialized
927- * data do not trigger parity errors. After zeroing, all SRAM is clean
928- * and safe for stack use. */
929- uart_putc_debug 'H' /* checkpoint H: zeroing CPC SRAM */
930- LOAD_ADDR32(r2, L2SRAM_ADDR - 8 ) /* stdu pre-decrements by 8 */
931- lis r3, (L2SRAM_SIZE >> 3 )@h /* count = size / 8 (doublewords) */
932- ori r3, r3, (L2SRAM_SIZE >> 3 )@l
933- mtctr r3
934- li r3, 0
935- 1: stdu r3, 8 (r2)
936- bdnz 1b
937- uart_putc_debug 'C' /* checkpoint C: SRAM zeroed */
920+ /* CPC SRAM: skip bulk zeroing.
921+ * dcbz, stdu, and stw loops ALL hang on cold power cycle when doing
922+ * bulk sequential writes to CPC SRAM. The CPC SRAM is accessed via
923+ * CoreNet fabric, and cache line fills/allocations through this path
924+ * are unreliable before L1/L2 caches are fully operational.
925+ * Individual stw stores (used by setup_stack stwu below) work fine.
926+ * U-Boot avoids this entirely by using L1 dcache locking for initial
927+ * stack and deferring CPC SRAM init to C code.
928+ * TODO: Zero CPC SRAM from C code after DDR/cache init, or switch
929+ * to L1 locked cache for initial stack (matching U-Boot approach). */
930+ uart_putc_debug 'H'
931+ uart_putc_debug 'C'
938932#endif /* L1_CACHE_ADDR */
939933
940934setup_stack:
0 commit comments