You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Example configuration: [/config/examples/nxp-t2080.config](/config/examples/nxp-t2080.config).
3069
+
Stock layout is default; for NAII 68PPC2, uncomment the "# NAII 68PPC2:" lines and comment the stock lines.
3071
3070
3072
3071
### Design NXP T2080 PPC
3073
3072
3074
3073
The QorIQ requires a Reset Configuration Word (RCW) to define the boot parameters, which resides at the start of the flash (0xE8000000).
3075
3074
3076
3075
The flash boot entry point is `0xEFFFFFFC`, which is an offset jump to wolfBoot initialization boot code. Initially the PowerPC core enables only a 4KB region to execute from. The initialization code (`src/boot_ppc_start.S`) sets the required CCSR and TLB for memory addressing and jumps to wolfBoot `main()`.
3077
3076
3077
+
#### Boot Sequence and Cache Architecture
3078
+
3079
+
The T2080 e6500 boot sequence has several hardware-specific constraints that
3080
+
differ from other QorIQ parts. Understanding the cache hierarchy and memory
3081
+
path is critical for reliable cold power-on boot.
3082
+
3083
+
**Memory Hierarchy (Core to External):**
3084
+
3085
+
```
3086
+
CPU Core → L1 Cache (32KB I + 32KB D) → L2 Cluster Cache (256KB per cluster)
3087
+
→ CoreNet Fabric → CPC (2MB, configurable as SRAM or L3 cache)
3088
+
→ DDR Controller → DDR SDRAM
3089
+
→ IFC Controller → NOR Flash
3090
+
```
3091
+
3092
+
**Cold Boot Initial Stack: L1 Locked Data Cache**
3093
+
3094
+
On cold power cycle, the CoreNet Platform Cache (CPC) configured as SRAM is
3095
+
unreliable for store operations. The CPC SRAM is accessed through the CoreNet
3096
+
interconnect fabric: `Core → L1 → L2 → CoreNet → CPC`. When the L1 data
3097
+
cache evicts dirty cache lines to CPC SRAM during cold power-on, the CoreNet
3098
+
bus transaction generates a bus error resulting in a machine check exception.
3099
+
With `MSR[ME]=0` (the default at reset), this causes a CPU checkstop (silent
3100
+
hang). This was confirmed by inserting a `sync` instruction after stack
3101
+
stores — the `sync` forces the L1 store buffer to drain through CoreNet to
3102
+
CPC SRAM, and the hang moved to the `sync` instruction, proving the bus error.
3103
+
3104
+
The `stwu` (store word with update) instructions used to build the initial
3105
+
stack frame appeared to work because the stores remained in the L1 data cache
3106
+
write buffer and were never committed to CPC SRAM. The hang manifested later
3107
+
when L1 cache pressure caused eviction of the stack cache lines to CPC SRAM.
3108
+
3109
+
**Solution:** Use L1 locked data cache as the initial 16KB stack (matching the
3110
+
U-Boot approach). The `dcbz` instruction allocates a cache line and fills it
3111
+
with zeros without generating a bus read (the data is CPU-generated). The
3112
+
`dcbtls` instruction locks the cache line so it is never evicted. With
3113
+
`WIMGE=0` (cacheable, non-coherent) in the TLB entry, `dcbz` does not
3114
+
generate any CoreNet coherency transaction. The locked cache lines are
3115
+
entirely core-local — no external bus access occurs.
3116
+
3117
+
The implementation in `boot_ppc_start.S`:
3118
+
3119
+
1. L1 I-cache and D-cache are enabled (`icache_enable`, `dcache_enable`)
3120
+
2. Four 4KB TLB0 entries are created for `L1_CACHE_ADDR` (0xF8E00000), a
3121
+
virtual address with no backing physical memory
3122
+
3. A `dcbz` + `dcbtls` loop allocates and locks 256 cache lines
3123
+
(16KB = half of the 32KB L1 D-cache) at that address
3124
+
4. On e6500, `dcbtls 2` (L2 lock) is issued before `dcbtls 0` (L1 lock)
3125
+
to lock in both cache levels
3126
+
5. The stack pointer is set to `L1_CACHE_ADDR + 0x4000 - 64` (top of the
3127
+
16KB locked region minus the ABI-required initial frame)
3128
+
6. All `stwu` stores to build the stack frame hit L1 locked cache —
3129
+
no CoreNet, no CPC SRAM, no bus error
3130
+
3131
+
The CPC SRAM hardware (LAW, TLB, CPC enable) is still configured during early
3132
+
assembly, but is not used for the stack. After DDR is initialized in C code
3133
+
(`hal_init()`), the stack is relocated to DDR, and the CPC is reconfigured
3134
+
from SRAM mode to full L3 cache mode.
3135
+
3136
+
Configuration in `hal/nxp_ppc.h`:
3137
+
3138
+
```c
3139
+
#defineL1_CACHE_ADDR (0xF8E00000UL) /* L1 locked dcache, no backing memory */
3140
+
#define L2SRAM_ADDR (0xF8F00000UL) /* CPC as SRAM (deferred to C code) */
7 - SRAM TLB configured Z - About to jump to C code
3203
+
8 - CPC enabled
3204
+
```
3205
+
3078
3206
RM 4.3.3 Boot Space Translation
3079
3207
3080
3208
"When each core comes out of reset, its MMU has one 4 KB page defined at 0x0_FFFF_Fnnn. Each core begins execution with the instruction at effective address 0x0_FFFF_FFFC. To get this instruction, the core's first instruction fetch is a burst read of boot code from effective address 0x0_FFFF_FFC0."
@@ -3084,9 +3212,10 @@ RM 4.3.3 Boot Space Translation
3084
3212
By default wolfBoot will use `powerpc-linux-gnu-` cross-compiler prefix. These tools can be installed with the Debian package `gcc-powerpc-linux-gnu` (`sudo apt install gcc-powerpc-linux-gnu`).
3085
3213
3086
3214
The `make` creates a `factory.bin` image that can be programmed at `0xE8080000`
3215
+
(For NAII 68PPC2, first edit `nxp-t2080.config` to uncomment the NAII 68PPC2 lines.)
0 commit comments