Skip to content

Fixes for NXP T2080 ports#746

Open
dgarske wants to merge 1 commit intowolfSSL:masterfrom
dgarske:nxp_t2080_more
Open

Fixes for NXP T2080 ports#746
dgarske wants to merge 1 commit intowolfSSL:masterfrom
dgarske:nxp_t2080_more

Conversation

@dgarske
Copy link
Copy Markdown
Contributor

@dgarske dgarske commented Apr 10, 2026

Fix wolfBoot boot on CW VPX3-152 (256 MB NOR flash variant)

Summary

Fixes a series of e6500/T2080 boot issues that prevented wolfBoot from booting on
the Curtiss-Wright VPX3-152 (256 MB NOR flash at 0xF0000000, CCSRBAR relocated
to 0xEF000000). NAII 68PPC2 (128 MB flash at 0xE8000000) is unaffected.

Root Causes Fixed

  1. lis sign-extension on e6500 -- Multiple lis r,addr@h instructions in
    boot_ppc_start.S (CCSRBAR relocation, LAW setup) sign-extended addresses
    ≥ 0x80000000 to 64-bit, causing TLB misses. Replaced with LOAD_ADDR32 macro.

  2. CCSRBAR TLB1 ordering -- TLB1 Entry 1 was created with the relocated
    CCSRBAR address before the hardware register was actually relocated, breaking
    access to CCSR. Now uses CCSRBAR_DEF initially, then re-creates the TLB1
    entry after relocation completes.

  3. TLB1 multi-hit overlap (256 MB flash) -- The flash TLB Entry 2 covering
    0xF0000000-0xFFFFFFFF (256 MB) overlapped with the boot ROM TLB Entry 0 at
    the top of flash, causing an e6500 TLB multi-hit. For BOARD_CW_VPX3152:

    • Boot TLB enlarged to 16 MB (BOOKE_PAGESZ_16M) covering wolfBoot + partitions
    • Flash TLB Entry 2 setup is skipped
    • hal_flash_enable_caching / cache_disable / cache_enable are no-ops
      (boot TLB stays cache-inhibited; functional but slower)
  4. hal_mp_init invalidating boot TLB -- disable_tlb1(0) invalidated the
    boot TLB containing wolfBoot code. NAII works because its 256 KB boot TLB
    doesn't contain wolfBoot code (which is in flash TLB Entry 2). For VPX3-152
    the boot TLB IS where wolfBoot runs, so invalidating it faults the next
    instruction fetch. ENABLE_MP is now disabled for VPX3-152.

  5. Exception handler used wrong UART address -- isr_empty printed '!' to
    0xFE11C500 (the default CCSRBAR) which is invalid after relocation on
    VPX3-152. Updated to use CCSRBAR + 0x11C500.

  6. DTS address unmapped -- hal_get_dts_address() returned 0xF0040000
    which is below the 16 MB boot TLB → DSI fault. Returns NULL for VPX3-152
    until a separate flash TLB for the DTS region is added.

Verification

Tested on physical CW VPX3-152 hardware (RCW 608605-100, 1.8 GHz core, 600 MHz
platform clock, 4 GB DDR3L, 1866 MT/s). wolfBoot now successfully:

  • Initializes CCSRBAR, DDR, flash, CPC L3 cache
  • Loads boot partition signed image (ECC384 + SHA384)
  • Verifies signature
  • Copies image to RAM
  • Jumps to test app which prints "Test App: idle loop"

Used Pi4 GPIO control + Instek PST-3202 power cycling + PABS U-Boot to flash
wolfBoot via TFTP for the test cycle.

Files

  • src/boot_ppc_start.S -- LOAD_ADDR32 fixes, TLB sizing for VPX3, early UART debug helpers
  • src/boot_ppc_mp.S -- Minor cleanup
  • hal/nxp_t2080.c -- ENABLE_MP guard, cache function guards, DTS NULL for VPX3
  • hal/nxp_t2080.h -- DDR_SDRAM_MODE_3..8 individual defines, DDR dump command updates
  • docs/Targets.md -- VPX3-152 PABS testing procedure, DDR register dump commands
  • .github/workflows/test-configs.yml -- CI build coverage

@dgarske dgarske self-assigned this Apr 10, 2026
Copilot AI review requested due to automatic review settings April 10, 2026 22:36
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes multiple early-boot issues for NXP QorIQ T2080/e6500 targets to enable wolfBoot to boot successfully on the Curtiss‑Wright VPX3‑152 (256 MB NOR @ 0xF0000000, CCSRBAR relocated to 0xEF000000), while keeping NAII 68PPC2 behavior intact.

Changes:

  • Corrects high-address loads on e6500 (avoid lis sign-extension) and adjusts TLB1/CCSRBAR relocation sequencing to prevent faults.
  • Adds VPX3‑152-specific TLB sizing/mapping changes to avoid TLB multi-hit overlap with 256 MB NOR.
  • Updates T2080 HAL for VPX3‑152 constraints (disable MP, guard flash caching paths, DTS address handling) and refreshes DDR configuration constants/docs/CI coverage.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/boot_ppc_start.S e6500-safe address loading, CCSRBAR relocation/TLB ordering fixes, VPX3‑152 TLB sizing & flash mapping adjustments, early UART debug helpers
src/boot_ppc_mp.S Comment/clarity cleanup in MP boot assembly
hal/nxp_t2080.c VPX3‑152 MP disable guard, flash caching guards, flash bounds checks, DTS NULL for VPX3‑152, minor synchronization improvements
hal/nxp_t2080.h Updates DDR parameterization and expands MODE3–8 defines; populates additional RDB register values
docs/Targets.md Expanded T2080 target documentation: board matrix, VPX3‑152 specifics, programming/recovery notes
.github/workflows/test-configs.yml Adds board-specific build jobs for T2080 variants in CI
Comments suppressed due to low confidence (1)

hal/nxp_t2080.c:400

  • hal_flash_enable_caching() is a no-op for BOARD_CW_VPX3152, but the DEBUG_UART log still prints "Flash: caching enabled" unconditionally. This makes UART logs misleading when debugging VPX3-152 boot/flash performance. Gate the log behind the same #ifndef BOARD_CW_VPX3152, or print an alternate message indicating caching is skipped/uncached on this board.
#ifndef BOARD_CW_VPX3152
    /* Rewrite flash TLB entry with cacheable attributes.
     * MAS2_M = memory coherent, enables caching */
    set_tlb(1, 2,
        FLASH_BASE_ADDR, FLASH_BASE_ADDR, FLASH_BASE_PHYS_HIGH,
        MAS3_SX | MAS3_SW | MAS3_SR, MAS2_M, 0,
        FLASH_TLB_PAGESZ, 1);

    /* Invalidate L1 I-cache so new TLB attributes take effect */
    invalidate_icache();
#endif

#ifdef DEBUG_UART
    wolfBoot_printf("Flash: caching enabled (L1+L2+CPC)\n");
#endif

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +4021 to +4024
> **Note:** The T2080 RDB DDR register values are placeholder stubs (all zeros
> with TODO comments in `hal/nxp_t2080.h`). DDR initialization will not succeed
> until you populate them from a U-Boot register dump. The NAII 68PPC2 and
> CW VPX3-152 DDR configs are populated and tested.
Copy link

Copilot AI Apr 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This note says the T2080 RDB DDR register values are "placeholder stubs (all zeros)" and DDR init will not succeed, but hal/nxp_t2080.h now defines non-zero RDB DDR register values from a U-Boot dump. Please update or remove this note to reflect the current state (e.g., "values are from a dump but not fully validated" if that's the intent).

Suggested change
> **Note:** The T2080 RDB DDR register values are placeholder stubs (all zeros
> with TODO comments in `hal/nxp_t2080.h`). DDR initialization will not succeed
> until you populate them from a U-Boot register dump. The NAII 68PPC2 and
> CW VPX3-152 DDR configs are populated and tested.
> **Note:** The T2080 RDB DDR register values in `hal/nxp_t2080.h` are
> populated from a U-Boot register dump rather than left as zero-value
> placeholders, but they may not be fully validated on hardware. The NAII
> 68PPC2 and CW VPX3-152 DDR configs are populated and tested.

Copilot uses AI. Check for mistakes.
Comment on lines +4362 to +4366
**Automated test script:** `tools/scripts/nxp_t2080/cw_vpx3152_pabs_test.sh`

Uses Pi4 GPIO control (GPIO 16 = PABS/JB1, GPIO 19 = Reset) and UART monitoring
to automate the full flash-and-verify cycle. See script for usage and options
including `--dump-ddr` mode.
Copy link

Copilot AI Apr 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The documentation references tools/scripts/nxp_t2080/cw_vpx3152_pabs_test.sh, but that script is not present in tools/scripts/nxp_t2080/ in this PR. Either add the script to the repository or remove/adjust the reference so readers don't hit a dead link.

Suggested change
**Automated test script:** `tools/scripts/nxp_t2080/cw_vpx3152_pabs_test.sh`
Uses Pi4 GPIO control (GPIO 16 = PABS/JB1, GPIO 19 = Reset) and UART monitoring
to automate the full flash-and-verify cycle. See script for usage and options
including `--dump-ddr` mode.
**Automated test setup:**
A test setup can use Pi4 GPIO control (GPIO 16 = PABS/JB1, GPIO 19 = Reset)
and UART monitoring to automate the full flash-and-verify cycle, including a
DDR dump mode for collecting debug information.

Copilot uses AI. Check for mistakes.
Comment on lines +210 to +211
# T2080 RDB DDR register values are not yet populated (placeholders in
# nxp_t2080.h), so CI must select a board with complete DDR config.
Copy link

Copilot AI Apr 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nxp_t2080_test calls the reusable workflow test-build-powerpc.yml but no longer supplies required arch and config-file inputs. Since those inputs are marked required: true in the reusable workflow, this job will fail to run. Add the missing with: block (or remove this job if it's meant to be replaced by the board-specific ones below) and update the adjacent comment about RDB DDR placeholders if it's no longer accurate.

Suggested change
# T2080 RDB DDR register values are not yet populated (placeholders in
# nxp_t2080.h), so CI must select a board with complete DDR config.
with:
arch: ppc
config-file: ./config/examples/nxp-t2080.config
# Additional T2080 board-specific compile tests for alternate board macros.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants