Skip to content

Commit f976a58

Browse files
committed
Fixes for NXP T2080 ports
1 parent 993b4f4 commit f976a58

6 files changed

Lines changed: 454 additions & 150 deletions

File tree

.github/workflows/test-configs.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,9 +207,24 @@ jobs:
207207

208208
nxp_t2080_test:
209209
uses: ./.github/workflows/test-build-powerpc.yml
210+
# T2080 RDB DDR register values are not yet populated (placeholders in
211+
# nxp_t2080.h), so CI must select a board with complete DDR config.
212+
nxp_t2080_test_naii_68ppc2:
213+
uses: ./.github/workflows/test-build-powerpc.yml
214+
with:
215+
arch: ppc
216+
config-file: ./config/examples/nxp-t2080.config
217+
make-args: CFLAGS_EXTRA=-DBOARD_NAII_68PPC2
218+
219+
# VPX3-152 compile test: validates board-specific code paths build cleanly.
220+
# Uses default config addresses (128MB layout); real hardware needs the
221+
# VPX3-152 address overrides uncommented in .config.
222+
nxp_t2080_vpx3152_test:
223+
uses: ./.github/workflows/test-build-powerpc.yml
210224
with:
211225
arch: ppc
212226
config-file: ./config/examples/nxp-t2080.config
227+
make-args: CFLAGS_EXTRA=-DBOARD_CW_VPX3152
213228

214229
nxp_ls1028a_test:
215230
uses: ./.github/workflows/test-build.yml

docs/Targets.md

Lines changed: 167 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -4009,16 +4009,28 @@ Flash factory_custom.bin to NOR base 0xE800_0000
40094009

40104010
## NXP QorIQ T2080 PPC
40114011

4012-
The NXP QorIQ T2080 is a PPC e6500 based processor (four cores). Support has been tested with the NAII 68PPC2.
4012+
The NXP QorIQ T2080 is a PPC e6500 based processor (four cores). Three board
4013+
variants are supported:
4014+
4015+
| Board | Config Define | Oscillator | DDR | NOR Flash |
4016+
|-------|---------------|-----------|-----|-----------|
4017+
| T2080 RDB (default) | _(none)_ | 66.66 MHz | DDR3L SODIMM | 128 MB @ `0xE8000000` |
4018+
| Curtiss-Wright VPX3-152 | `BOARD_CW_VPX3152` | 66.667 MHz | 4 GB DDR3L | 256 MB @ `0xF0000000` |
4019+
| NAII 68PPC2 | `BOARD_NAII_68PPC2` | 100 MHz | 8 GB DDR3 | 128 MB @ `0xE8000000` |
4020+
4021+
> **Note:** The T2080 RDB DDR register values are placeholder stubs (all zeros
4022+
> with TODO comments in `hal/nxp_t2080.h`). DDR initialization will not succeed
4023+
> until you populate them from a U-Boot register dump. The NAII 68PPC2 and
4024+
> CW VPX3-152 DDR configs are populated and tested.
40134025
40144026
Example configuration: [/config/examples/nxp-t2080.config](/config/examples/nxp-t2080.config).
4015-
Stock layout is default; for NAII 68PPC2, uncomment the "# NAII 68PPC2:" lines and comment the stock lines.
4027+
See [Board Selection](#board-selection) below for per-board setup.
40164028

40174029
### Design NXP T2080 PPC
40184030

4019-
The QorIQ requires a Reset Configuration Word (RCW) to define the boot parameters, which resides at the start of the flash (0xE8000000).
4031+
The QorIQ requires a Reset Configuration Word (RCW) to define the boot parameters, which resides at the start of the flash (`0xE8000000` for 128 MB boards, `0xF0000000` for the 256 MB CW VPX3-152).
40204032

4021-
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()`.
4033+
The flash boot entry point is the last 4 bytes of the NOR flash region (`0xEFFFFFFC` for 128 MB flash, `0xFFFFFFFC` for 256 MB flash), 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()`.
40224034

40234035
#### Boot Sequence and Hardware Constraints
40244036

@@ -4041,7 +4053,7 @@ CPC SRAM is unreliable for stores on cold power-on — L1 dirty-line evictions
40414053
through CoreNet to CPC cause bus errors (silent CPU checkstop with `MSR[ME]=0`).
40424054
The fix (matching U-Boot) uses L1 locked D-cache as the initial 16KB stack:
40434055
`dcbz` allocates cache lines without bus reads, `dcbtls` locks them so they
4044-
are never evicted. The locked lines at `L1_CACHE_ADDR` (0xF8E00000) are
4056+
are never evicted. The locked lines at `L1_CACHE_ADDR` (`0xF8E00000`; `0xEE800000` on VPX3-152) are
40454057
entirely core-local. After DDR init in `hal_init()`, the stack relocates to
40464058
DDR and the CPC switches from SRAM to L3 cache mode.
40474059

@@ -4052,9 +4064,16 @@ boot, allowing L1 I-cache to cache instruction fetches while preventing
40524064
speculative prefetch to the IFC. C code switches to `MAS2_I | MAS2_G` during
40534065
flash write/erase (command mode), then `MAS2_M` for full caching afterward.
40544066

4067+
**CCSRBAR Relocation (CW VPX3-152 only)**
4068+
4069+
The default CCSRBAR at `0xFE000000` (16 MB) falls within the VPX3-152's 256 MB
4070+
flash VA range (`0xF0000000``0xFFFFFFFF`). The startup assembly relocates
4071+
CCSRBAR to `0xEF000000` (just below flash). The CPC SRAM and L1 cache addresses
4072+
are also relocated to `0xEE900000`/`0xEE800000` to avoid overlap.
4073+
40554074
**RAMFUNCTION Constraints**
40564075

4057-
The NAII 68PPC2 NOR flash (two S29GL01GS x8 in parallel, 16-bit bus) enters
4076+
The NOR flash (two S29GL01GS x8 in parallel, 16-bit bus) enters
40584077
command mode bank-wide — instruction fetches during program/erase return status
40594078
data instead of code. All flash write/erase functions are marked `RAMFUNCTION`,
40604079
placed in `.ramcode`, copied to DDR, and remapped via TLB9. Key rules:
@@ -4094,30 +4113,38 @@ machine check (exceptions instead of checkstop), debug, and recoverable
40944113
interrupt enable. Branch prediction (BUCSR) is deferred to `hal_init()` after
40954114
DDR stack relocation.
40964115

4097-
**UART Debug Checkpoints (`DEBUG_UART=1`)**
4116+
### Building wolfBoot for NXP T2080 PPC
4117+
4118+
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`).
40984119

4099-
Assembly startup emits characters to UART0 (0xFE11C500, 115200 baud):
4120+
#### Board Selection
41004121

4122+
Copy the example config and select your board:
4123+
4124+
**T2080 RDB (default):**
41014125
```
4102-
1 - CPC invalidate start A - L2 cluster enable start
4103-
2 - CPC invalidate done B - L2 cluster enabled
4104-
3 - CPC SRAM configured E - L1 cache setup
4105-
4 - SRAM LAW configured F - L1 I-cache enabled
4106-
5 - Flash TLB configured G - L1 D-cache enabled
4107-
6 - CCSRBAR TLB configured D - Stack ready (L1 locked cache)
4108-
7 - SRAM TLB configured Z - About to jump to C code
4109-
8 - CPC enabled
4126+
cp ./config/examples/nxp-t2080.config .config
41104127
```
41114128

4112-
### Building wolfBoot for NXP T2080 PPC
4129+
**Curtiss-Wright VPX3-152:**
4130+
```
4131+
cp ./config/examples/nxp-t2080.config .config
4132+
```
4133+
Then in `.config`, uncomment `CFLAGS_EXTRA+=-DBOARD_CW_VPX3152` and all lines
4134+
marked with `# CW VPX3-152` (flash offset, SRAM address, origin, partition addresses,
4135+
DTS addresses).
41134136

4114-
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`).
4137+
**NAII 68PPC2:**
4138+
```
4139+
cp ./config/examples/nxp-t2080.config .config
4140+
```
4141+
Then in `.config`, uncomment `CFLAGS_EXTRA+=-DBOARD_NAII_68PPC2`.
4142+
4143+
#### Build
41154144

4116-
The `make` creates a `factory.bin` image that can be programmed at `0xE8080000`
4117-
(For NAII 68PPC2, first edit `nxp-t2080.config` to uncomment the NAII 68PPC2 lines.)
4145+
The `make` creates a `factory.bin` image that can be programmed to the application partition address.
41184146

41194147
```
4120-
cp ./config/examples/nxp-t2080.config .config
41214148
make clean
41224149
make keytools
41234150
make
@@ -4146,19 +4173,31 @@ CROSS_COMPILE_PATH=/opt/fsl-qoriq/2.0/sysroots/ppce6500-fsl-linux/usr
41464173

41474174
### Programming NXP T2080 PPC
41484175

4149-
NOR Flash Region: `0xE8000000 - 0xEFFFFFFF` (128 MB)
4176+
NOR Flash Regions:
4177+
- **T2080 RDB / NAII 68PPC2**: `0xE8000000 - 0xEFFFFFFF` (128 MB)
4178+
- **CW VPX3-152**: `0xF0000000 - 0xFFFFFFFF` (256 MB)
41504179

4151-
Flash Layout (with files):
4180+
Flash Layout (T2080 RDB / NAII 68PPC2, 128 MB flash):
41524181

41534182
| Description | File | Address |
41544183
| ----------- | ---- | ------- |
4155-
| Reset Configuration Word (RCW) | `68PPC2_RCW_v0p7.bin` | `0xE8000000` |
4184+
| Reset Configuration Word (RCW) | _(board-specific)_ | `0xE8000000` |
41564185
| Frame Manager Microcode | `fsl_fman_ucode_t2080_r1.0.bin` | `0xE8020000` |
41574186
| Signed Application | `test-app/image_v1_signed.bin` | `0xE8080000` |
4158-
| wolfBoot | `wolfboot.bin` | `0xEFF40000` |
4159-
| Boot Entry Point (with offset jump to init code) | | `0xEFFFFFFC` |
4187+
| wolfBoot | `wolfboot.bin` | `0xEFFE0000` |
4188+
| Boot Entry Point (offset jump to init code) | | `0xEFFFFFFC` |
41604189

4161-
Or program the `factory.bin` to `0xE8080000`
4190+
Flash Layout (CW VPX3-152, 256 MB flash):
4191+
4192+
| Description | File | Address |
4193+
| ----------- | ---- | ------- |
4194+
| Reset Configuration Word (RCW) | _(board-specific)_ | `0xF0000000` |
4195+
| Frame Manager Microcode | `fsl_fman_ucode_t2080_r1.0.bin` | `0xF0020000` |
4196+
| Signed Application | `test-app/image_v1_signed.bin` | `0xF0080000` |
4197+
| wolfBoot | `wolfboot.bin` | `0xFFFE0000` |
4198+
| Boot Entry Point (offset jump to init code) | | `0xFFFFFFFC` |
4199+
4200+
Or program the `factory.bin` to the application partition address.
41624201

41634202
Example Boot Debug Output (with `DEBUG_UART=1`):
41644203

@@ -4197,11 +4236,11 @@ See these TRACE32 demo script files:
41974236
```
41984237
DO flash_cfi.cmm
41994238
4200-
FLASH.ReProgram 0xEFF40000--0xEFFFFFFF /Erase
4201-
Data.LOAD.binary wolfboot.bin 0xEFF40000
4239+
FLASH.ReProgram 0xEFFE0000--0xEFFFFFFF /Erase
4240+
Data.LOAD.binary wolfboot.bin 0xEFFE0000
42024241
FLASH.ReProgram.off
42034242
4204-
Data.LOAD.binary wolfboot.bin 0xEFF40000 /Verify
4243+
Data.LOAD.binary wolfboot.bin 0xEFFE0000 /Verify
42054244
```
42064245

42074246
Note: To disable the flash protection bits use:
@@ -4219,7 +4258,11 @@ Data.Set 0xE8000000 %W 0x9090
42194258
Data.Set 0xE8000000 %W 0x0000
42204259
```
42214260

4222-
#### Flash Programming with CodeWarrior TAP
4261+
#### Flash Programming with CodeWarrior TAP (Experimental)
4262+
4263+
> **Note:** CodeWarrior TAP debugging has not been validated for this target.
4264+
> Lauterbach TRACE32 is the recommended debug probe. The following steps are
4265+
> provided for reference only.
42234266
42244267
In CodeWarrior use the `Flash Programmer` tool (see under Commander View -> Miscellaneous)
42254268
* Connection: "CodeWarrior TAP Connection"
@@ -4231,13 +4274,97 @@ In CodeWarrior use the `Flash Programmer` tool (see under Commander View -> Misc
42314274

42324275
```
42334276
tftp 1000000 wolfboot.bin
4234-
protect off eff40000 +C0000
4235-
erase eff40000 +C0000
4236-
cp.b 1000000 eff40000 C0000
4237-
protect on eff40000 +C0000
4238-
cmp.b 1000000 eff40000 C0000
4277+
protect off effe0000 +20000
4278+
erase effe0000 +20000
4279+
cp.b 1000000 effe0000 20000
4280+
protect on effe0000 +20000
4281+
cmp.b 1000000 effe0000 20000
42394282
```
42404283

4284+
#### CW VPX3-152 PABS Recovery and Testing
4285+
4286+
The CW VPX3-152 has a Permanent Alternate Boot Site (PABS) — a second U-Boot on a
4287+
separate flash device. When jumper JB1 (ALT-BOOT) is installed and the board is reset,
4288+
it boots from PABS U-Boot (prompt: `VPX3-152 PABS=>`), which can reprogram the main
4289+
NOR flash via TFTP. This is used for wolfBoot development and testing.
4290+
4291+
Reference: CW VPX3-152 Firmware User's Manual (838400 rev 6), Section 6.
4292+
4293+
**Prerequisites:**
4294+
- JB1: Controlled by Pi4 GPIO 16 relay (or physical jumper)
4295+
- JB5: Must be removed (NOR write protect disabled)
4296+
- NVMRO: Must be grounded
4297+
- Serial: COM1 at 115200 N81 (P2 connector)
4298+
- Ethernet: GE02 (FM1@DTSEC1) on P1 connector
4299+
4300+
**Entering PABS mode:**
4301+
1. Install JB1 jumper (or assert GPIO 16 high)
4302+
2. Reset the board
4303+
3. Board boots to `VPX3-152 PABS=>` prompt
4304+
4305+
**Network setup in PABS U-Boot:**
4306+
```
4307+
setenv serverip 10.0.4.24
4308+
setenv ipaddr 10.0.4.152
4309+
setenv gatewayip 10.0.4.1
4310+
setenv netmask 255.255.255.0
4311+
```
4312+
4313+
**Flash wolfBoot from PABS:**
4314+
```
4315+
tftp 0x1000000 wolfboot.bin
4316+
protect off 0xFFFE0000 0xFFFFFFFF
4317+
erase 0xFFFE0000 0xFFFFFFFF
4318+
cp.b 0x1000000 0xFFFE0000 $filesize
4319+
cmp.b 0x1000000 0xFFFE0000 $filesize
4320+
```
4321+
4322+
**Flash signed application from PABS:**
4323+
```
4324+
tftp 0x1000000 image_v1_signed.bin
4325+
protect off 0xFFEE0000 0xFFFDFFFF
4326+
erase 0xFFEE0000 0xFFFDFFFF
4327+
cp.b 0x1000000 0xFFEE0000 $filesize
4328+
cmp.b 0x1000000 0xFFEE0000 $filesize
4329+
```
4330+
4331+
**Boot wolfBoot:** Remove JB1 jumper (or deassert GPIO 16), reset the board.
4332+
4333+
**Restore original CW U-Boot (from PABS):**
4334+
```
4335+
fwupd 608603-100_rev-
4336+
```
4337+
4338+
**DDR Register Verification:**
4339+
4340+
The CW VPX3-152 DDR register values in `hal/nxp_t2080.h` were obtained from a
4341+
U-Boot register dump. To verify or update these values, boot into PABS or main
4342+
U-Boot and run the following `md.l` commands. Use CCSRBAR `0xEF000000` (CW U-Boot
4343+
relocates CCSRBAR) or `0xFE000000` (default, check with `bdinfo`):
4344+
4345+
```
4346+
# CS Bounds and Config (DDR_BASE + 0x000, 0x080, 0x0C0)
4347+
md.l 0xef008000 4; md.l 0xef008080 4; md.l 0xef0080c0 4
4348+
# Timing (DDR_BASE + 0x100, 0x160)
4349+
md.l 0xef008100 4; md.l 0xef008160 3
4350+
# Config/Mode/Clock (DDR_BASE + 0x110, 0x130)
4351+
md.l 0xef008110 8; md.l 0xef008130 1
4352+
# ZQ/Write Leveling (DDR_BASE + 0x170, 0x190)
4353+
md.l 0xef008170 3; md.l 0xef008190 2
4354+
# RCW/Mode3-8 (DDR_BASE + 0x180, 0x200)
4355+
md.l 0xef008180 2; md.l 0xef008200 6
4356+
# Control Driver (DDR_BASE + 0xB28)
4357+
md.l 0xef008b28 2
4358+
# Error registers (DDR_BASE + 0xE40, 0xE58)
4359+
md.l 0xef008e40 3; md.l 0xef008e58 1
4360+
```
4361+
4362+
**Automated test script:** `tools/scripts/nxp_t2080/cw_vpx3152_pabs_test.sh`
4363+
4364+
Uses Pi4 GPIO control (GPIO 16 = PABS/JB1, GPIO 19 = Reset) and UART monitoring
4365+
to automate the full flash-and-verify cycle. See script for usage and options
4366+
including `--dump-ddr` mode.
4367+
42414368
### Debugging NXP T2080 PPC
42424369

42434370
#### Lauterbach
@@ -4265,9 +4392,11 @@ sYmbol.SourcePATH.SetBaseDir ~/wolfBoot
42654392
Data.LOAD.Elf wolfboot.elf /NoCODE /StripPART "/home/username/wolfBoot/"
42664393
```
42674394

4268-
#### CodeWarrior TAP
4395+
#### CodeWarrior TAP (Experimental)
42694396

4270-
This is an example for debugging the T2080 with CodeWarrior TAP, however we were not successful using it. The Lauterbach is what we ended up using to debug.
4397+
> **Note:** CodeWarrior TAP debugging has not been validated for this target.
4398+
> Lauterbach TRACE32 is the recommended debug probe. The following steps are
4399+
> provided for reference only.
42714400
42724401
Start GDB Proxy:
42734402

0 commit comments

Comments
 (0)