Skip to content

Commit 6ca5cb9

Browse files
dgarskedanielinux
authored andcommitted
Feedback from customer with actual hardware
1 parent 96828c1 commit 6ca5cb9

4 files changed

Lines changed: 39 additions & 12 deletions

File tree

Makefile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ SECURE_LDFLAGS:=
1818
LD_START_GROUP:=-Wl,--start-group
1919
LD_END_GROUP:=-Wl,--end-group
2020
LSCRIPT_IN:=hal/$(TARGET).ld
21+
L2SRAM_ADDR?=0xF8F00000
2122
V?=0
2223
DEBUG?=0
2324
DEBUG_UART?=0
@@ -527,7 +528,8 @@ $(LSCRIPT): $(LSCRIPT_IN) FORCE
527528
sed -e "s/@BOOTLOADER_START@/$(BOOTLOADER_START)/g" | \
528529
sed -e "s/@IMAGE_HEADER_SIZE@/$(IMAGE_HEADER_SIZE)/g" | \
529530
sed -e "s/@FSP_S_LOAD_BASE@/$(FSP_S_LOAD_BASE)/g" | \
530-
sed -e "s/@WOLFBOOT_L2LIM_SIZE@/$(WOLFBOOT_L2LIM_SIZE)/g" \
531+
sed -e "s/@WOLFBOOT_L2LIM_SIZE@/$(WOLFBOOT_L2LIM_SIZE)/g" | \
532+
sed -e "s/@L2SRAM_ADDR@/$(L2SRAM_ADDR)/g" \
531533
> $@
532534

533535
hex: wolfboot.hex

config/examples/nxp-t2080.config

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,11 @@ OPTIMIZATION_LEVEL?=1
4141
ARCH_FLASH_OFFSET?=0xEFFE0000
4242
#ARCH_FLASH_OFFSET?=0xFFFE0000 # CW VPX3-152
4343

44+
# CPC SRAM address (must match L2SRAM_ADDR in nxp_ppc.h)
45+
# CW VPX3-152: relocated to 0xEE900000 to avoid 256MB flash TLB overlap
46+
L2SRAM_ADDR?=0xF8F00000
47+
#L2SRAM_ADDR?=0xEE900000 # CW VPX3-152
48+
4449
# Flash Sector Size
4550
WOLFBOOT_SECTOR_SIZE?=0x10000
4651

hal/nxp_ppc.h

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -118,13 +118,18 @@
118118
* CPC SRAM (via CoreNet) is unreliable on cold power cycle —
119119
* store buffer drains cause bus errors. L1 locked cache is
120120
* core-local and works reliably from first instruction.
121-
* Address chosen below CPC SRAM range, no backing memory needed. */
121+
* Address chosen below CPC SRAM range, no backing memory needed.
122+
*
123+
* VPX3-152: default addresses (0xF8E/F8F) fall within 256MB flash
124+
* VA range (0xF0000000-0xFFFFFFFF), causing TLB overlap on e6500.
125+
* Relocated below CCSRBAR (0xEF000000) to avoid conflict. */
126+
#ifdef BOARD_CW_VPX3152
127+
#define L1_CACHE_ADDR (0xEE800000UL)
128+
#define L2SRAM_ADDR (0xEE900000UL) /* CPC as SRAM (1MB) */
129+
#else
122130
#define L1_CACHE_ADDR (0xF8E00000UL)
123-
124-
/* T2080 CPC SRAM config - 1MB for ECC P384 stack requirements.
125-
* CPC hardware is configured in early ASM but NOT used for stack.
126-
* CPC SRAM becomes usable after cache hierarchy is initialized in C. */
127131
#define L2SRAM_ADDR (0xF8F00000UL) /* CPC as SRAM (1MB) */
132+
#endif
128133
#define L2SRAM_SIZE (1024UL * 1024UL)
129134

130135
#define INITIAL_SRAM_ADDR L2SRAM_ADDR
@@ -137,6 +142,14 @@
137142

138143
#define ENABLE_INTERRUPTS
139144

145+
#ifdef BOARD_CW_VPX3152
146+
/* Relocate CCSRBAR: default 0xFE000000 (16MB) falls within 256MB flash
147+
* VA range 0xF0000000-0xFFFFFFFF. Move to 0xEF000000 (just below flash).
148+
* The existing relocation code in boot_ppc_start.S handles the hardware
149+
* CCSRBAR register write when CCSRBAR_DEF != CCSRBAR_PHYS. */
150+
#define CCSRBAR 0xEF000000UL
151+
#endif
152+
140153
#define ENABLE_DDR
141154
#ifndef DDR_SIZE
142155
#ifdef BOARD_CW_VPX3152

hal/nxp_t2080.ld

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,27 @@ OUTPUT_ARCH( "powerpc" )
22

33
ENTRY( _reset )
44

5-
/* On initial start, only a limited space(4k) is accessible.
6-
* Code here bootstraps to enable access to other needed address spaces */
7-
BOOTSTRAP_TLB = 0xEFFFF000;
5+
/* On initial start, only a limited space (4K) is accessible.
6+
* Code here bootstraps to enable access to other needed address spaces.
7+
* Boot code must be at the top of flash (last 4KB of bootloader partition).
8+
* Computed from FLASH region so it adapts to any board flash layout:
9+
* T2080 RDB (128MB @ 0xE8000000): 0xEFFFF000 / 0xEFFFFFFC
10+
* CW VPX3-152 (256MB @ 0xF0000000): 0xFFFFF000 / 0xFFFFFFFC */
11+
BOOTSTRAP_TLB = ORIGIN(FLASH) + LENGTH(FLASH) - 0x1000;
812

913
/* Entry point where RCW directs code to execute from */
10-
BOOTSTRAP_ENTRY = 0xEFFFFFFC;
14+
BOOTSTRAP_ENTRY = ORIGIN(FLASH) + LENGTH(FLASH) - 0x4;
1115

1216
MEMORY
1317
{
1418
FLASH (rx) : ORIGIN = @WOLFBOOT_ORIGIN@, LENGTH = @BOOTLOADER_PARTITION_SIZE@
1519

1620
/* CPC as SRAM - 1MB (T2080 supports up to 2MB, using 1MB for P384 stack)
17-
* Layout: .ramcode at bottom, stack grows down from top */
18-
RAM (rwx) : ORIGIN = 0xF8F00000, LENGTH = 0x100000
21+
* Layout: .ramcode at bottom, stack grows down from top
22+
* Address must match L2SRAM_ADDR in nxp_ppc.h:
23+
* T2080 RDB: 0xF8F00000
24+
* CW VPX3-152: 0xEE900000 (relocated to avoid 256MB flash VA overlap) */
25+
RAM (rwx) : ORIGIN = @L2SRAM_ADDR@, LENGTH = 0x100000
1926

2027
/* DDR - 2GB */
2128
DRAM (rwx) : ORIGIN = 0x00000000, LENGTH = 0x7FFFFFFF

0 commit comments

Comments
 (0)