Skip to content

Commit 1029bd3

Browse files
committed
Support for NXP T1040 RDB
1 parent 4a53bd1 commit 1029bd3

File tree

12 files changed

+3984
-3335
lines changed

12 files changed

+3984
-3335
lines changed

Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,9 @@ endif
264264
ifeq ($(TARGET),nxp_t1024)
265265
MAIN_TARGET:=factory_wstage1.bin
266266
endif
267+
ifeq ($(TARGET),nxp_t1040)
268+
MAIN_TARGET:=factory_wstage1.bin
269+
endif
267270

268271
ifeq ($(TARGET),sama5d3)
269272
MAIN_TARGET:=wolfboot.bin test-app/image_v1_signed.bin

arch.mk

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -991,6 +991,27 @@ ifeq ($(TARGET),nxp_t1024)
991991
OPTIMIZATION_LEVEL=0 # using default -Os causes issues with alignment
992992
endif
993993

994+
ifeq ($(TARGET),nxp_t1040)
995+
# Power PC big endian (e5500, same core as T1024)
996+
ARCH_FLAGS=-mhard-float -mcpu=e5500
997+
CFLAGS+=$(ARCH_FLAGS)
998+
BIG_ENDIAN=1
999+
CFLAGS+=-DMMU -DWOLFBOOT_FDT -DWOLFBOOT_DUALBOOT
1000+
CFLAGS+=-pipe # use pipes instead of temp files
1001+
CFLAGS+=-feliminate-unused-debug-types
1002+
LDFLAGS+=$(ARCH_FLAGS)
1003+
LDFLAGS+=-Wl,--hash-style=both # generate both sysv and gnu symbol hash table
1004+
LDFLAGS+=-Wl,--as-needed # remove weak functions not used
1005+
OBJS+=src/boot_ppc_mp.o # support for spin table
1006+
OBJS+=src/fdt.o
1007+
OBJS+=src/pci.o
1008+
CFLAGS+=-DWOLFBOOT_USE_PCI
1009+
UPDATE_OBJS:=src/update_ram.o
1010+
1011+
SPI_TARGET=nxp
1012+
OPTIMIZATION_LEVEL=0 # using default -Os causes issues with alignment
1013+
endif
1014+
9941015
ifeq ($(TARGET),nxp_t2080)
9951016
# Power PC big endian
9961017
ARCH_FLAGS=-mhard-float -mcpu=e6500

config/examples/nxp-t1040.config

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
# NXP QorIQ T1040 (4 core)
2+
3+
ARCH=PPC
4+
TARGET=nxp_t1040
5+
SIGN?=ECC384
6+
HASH?=SHA384
7+
IMAGE_HEADER_SIZE?=512
8+
DEBUG?=0
9+
DEBUG_UART?=1
10+
VTOR?=1
11+
CORTEX_M0?=0
12+
NO_ASM?=0
13+
EXT_FLASH?=0
14+
SPI_FLASH?=0
15+
NO_XIP?=0
16+
UART_FLASH?=0
17+
ALLOW_DOWNGRADE?=0
18+
NVM_FLASH_WRITEONCE?=0
19+
WOLFBOOT_VERSION?=0
20+
NO_MPU?=0
21+
SPMATH?=0
22+
SPMATHALL?=1
23+
RAM_CODE?=0
24+
DUALBANK_SWAP?=0
25+
WOLFTPM?=0
26+
ELF?=1
27+
DEBUG_ELF=0
28+
29+
# NOR Base Address (256MB NOR at 0xE8000000 - 0xF7FFFFFF)
30+
ARCH_FLASH_OFFSET?=0xE8000000
31+
32+
# Flash Sector Size (128KB)
33+
WOLFBOOT_SECTOR_SIZE=0x20000
34+
35+
# wolfBoot start address
36+
WOLFBOOT_ORIGIN=0xF7F40000
37+
# wolfBoot partition size (custom)
38+
BOOTLOADER_PARTITION_SIZE=0xC0000
39+
40+
# Application Partition Size (15MB)
41+
WOLFBOOT_PARTITION_SIZE?=0xF00000
42+
# Location in Flash for Application Partition
43+
WOLFBOOT_PARTITION_BOOT_ADDRESS?=0xF6000000
44+
# Load Partition to RAM Address
45+
WOLFBOOT_LOAD_ADDRESS?=0x70000000
46+
47+
# Location in Flash for Update Partition
48+
WOLFBOOT_PARTITION_UPDATE_ADDRESS?=0xF6F00000
49+
50+
# Location of temporary sector used during updates
51+
WOLFBOOT_PARTITION_SWAP_ADDRESS?=0xE80F0000
52+
53+
# Stage 1 loader settings (16KB)
54+
WOLFBOOT_STAGE1_SIZE=0x4000
55+
# Location in Flash for stage 1 loader (XIP from boot ROM)
56+
WOLFBOOT_STAGE1_FLASH_ADDR=0xF7FFC000
57+
# Address in RAM to load wolfBoot (end of DDR at 2GB-1MB for 32-bit addressing)
58+
WOLFBOOT_STAGE1_LOAD_ADDR=0x7FF00000
59+
60+
# DTS (Device Tree)
61+
WOLFBOOT_DTS_BOOT_ADDRESS?=0xE8800000
62+
WOLFBOOT_DTS_UPDATE_ADDRESS?=0xE8820000
63+
# DTS Load to RAM Address
64+
WOLFBOOT_LOAD_DTS_ADDRESS?=0x7F100000
65+
66+
# Load to RAM before hash and verify
67+
CFLAGS_EXTRA+=-DWOLFBOOT_USE_RAMBOOT

docs/Targets.md

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3260,6 +3260,91 @@ If getting errors with keystore then you can reset things using `make distclean`
32603260
Flash factory_custom.bin to NOR base 0xEC00_0000
32613261

32623262

3263+
## NXP QorIQ T1040 PPC
3264+
3265+
The NXP QorIQ T1040 is a four core 64-bit PPC e5500 based processor at 1400MHz. Each core has 256KB L2 cache.
3266+
3267+
Board: T1040D4RDB
3268+
Board rev: 0x01
3269+
CPLD ver: 0x04
3270+
3271+
T1040E, Version: 1.1, (0x8528_0011)
3272+
e5500, Version: 2.1, (0x8024_1021)
3273+
3274+
Reset Configuration Word (RCW):
3275+
00000000: 0c18000e 0e000000 00000000 00000000
3276+
00000010: 66000002 40000002 ec027000 01000000
3277+
00000020: 00000000 00000000 00000000 00030810
3278+
00000030: 00000000 0342580f 00000000 00000000
3279+
3280+
Flash is NOR on IFC CS0 (0x0_E800_0000) 256MB.
3281+
3282+
Default NOR Flash Memory Layout (256MB) (128KB block, 1K page)
3283+
3284+
| Description | Address | Size |
3285+
| ----------------- | ---------- | -------------------- |
3286+
| RCW | 0xE8000000 | 0x00020000 (128 KB) |
3287+
| Free | 0xE8020000 | 0x000D0000 (832 KB) |
3288+
| Swap Sector | 0xE80F0000 | 0x00010000 ( 64 KB) |
3289+
| Free | 0xE8100000 | 0x00700000 ( 7 MB) |
3290+
| FDT (Primary) | 0xE8800000 | 0x00020000 (128 KB) |
3291+
| FDT (Update) | 0xE8820000 | 0x00020000 (128 KB) |
3292+
| Free | 0xE8840000 | 0x0D7C0000 (~200 MB) |
3293+
| Application (OS) | 0xF6000000 | 0x00F00000 ( 15 MB) |
3294+
| Update (OS) | 0xF6F00000 | 0x00F00000 ( 15 MB) |
3295+
| QUICC | 0xF7E00000 | 0x00100000 ( 1 MB) |
3296+
| DPAA (FMAN) | 0xF7F00000 | 0x00020000 (128 KB) |
3297+
| wolfBoot | 0xF7F40000 | 0x000BC000 (752 KB) |
3298+
| wolfBoot Stage 1 | 0xF7FFC000 | 0x00004000 ( 16 KB) |
3299+
3300+
QE: uploading microcode 'Microcode for T1040 r1.0' version 0.0.1
3301+
3302+
DDR4 8GB
3303+
3304+
### Building wolfBoot for NXP T1040 PPC
3305+
3306+
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`).
3307+
3308+
The `make` creates a `factory_stage1.bin` image that can be programmed at `0xE8000000`
3309+
3310+
```
3311+
cp ./config/examples/nxp-t1040.config .config
3312+
make clean
3313+
make keytools
3314+
make
3315+
```
3316+
3317+
Or each `make` component can be manually built using:
3318+
3319+
```
3320+
make stage1
3321+
make wolfboot.elf
3322+
make test-app/image_v1_signed.bin
3323+
```
3324+
3325+
If getting errors with keystore then you can reset things using `make distclean`.
3326+
3327+
### Signing Custom application
3328+
3329+
```
3330+
./tools/keytools/sign --ecc384 --sha384 custom.elf wolfboot_signing_private_key.der 1
3331+
```
3332+
3333+
### Assembly of custom firmware image
3334+
3335+
```
3336+
./tools/bin-assemble/bin-assemble factory_custom.bin \
3337+
0xE8000000 RCW.bin \
3338+
0xE8020000 custom.dtb \
3339+
0xF6000000 custom_v1_signed.bin \
3340+
0xF7E00000 iram_Type_A_T1040_r1.0.bin \
3341+
0xF7F00000 fsl_fman_ucode_t1040.bin \
3342+
0xF7F40000 wolfboot.bin \
3343+
0xF7FFC000 stage1/loader_stage1.bin
3344+
```
3345+
3346+
Flash factory_custom.bin to NOR base 0xE800_0000
3347+
32633348

32643349
## NXP QorIQ T2080 PPC
32653350

hal/nxp_ppc.h

Lines changed: 40 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,45 @@
100100

101101
#define USE_LONG_JUMP
102102

103+
#elif defined(TARGET_nxp_t1040)
104+
/* NXP T1040 */
105+
#define CORE_E5500
106+
#define CPU_NUMCORES 4
107+
#define CORES_PER_CLUSTER 1
108+
#define LAW_MAX_ENTRIES 16
109+
110+
#define CCSRBAR_DEF (0xFE000000) /* T1040RM 4.4.1 default base */
111+
#define CCSRBAR_SIZE BOOKE_PAGESZ_16M
112+
113+
#define INITIAL_SRAM_ADDR 0xFDFC0000
114+
#define INITIAL_SRAM_LAW_SZ LAW_SIZE_256KB
115+
#define INITIAL_SRAM_LAW_TRGT LAW_TRGT_PSRAM
116+
#define INITIAL_SRAM_BOOKE_SZ BOOKE_PAGESZ_256K
117+
118+
#define ENABLE_L1_CACHE
119+
#define ENABLE_INTERRUPTS
120+
121+
#ifdef BUILD_LOADER_STAGE1
122+
#define ENABLE_L2_CACHE
123+
#else
124+
/* relocate to 64-bit 0xF_ */
125+
#define CCSRBAR_PHYS_HIGH 0xFULL
126+
#define CCSRBAR_PHYS (CCSRBAR_PHYS_HIGH + CCSRBAR_DEF)
127+
#endif
128+
129+
#define ENABLE_DDR
130+
#ifndef DDR_SIZE
131+
#define DDR_SIZE (8192ULL * 1024ULL * 1024ULL) /* 8GB */
132+
#endif
133+
134+
/* 256MB NOR: 0xE8000000 - 0xF7FFFFFF */
135+
#define FLASH_BASE_ADDR 0xE8000000UL
136+
#define FLASH_BASE_PHYS_HIGH 0xFULL
137+
#define FLASH_LAW_SIZE LAW_SIZE_256MB
138+
#define FLASH_TLB_PAGESZ BOOKE_PAGESZ_256M
139+
140+
#define USE_LONG_JUMP
141+
103142
#elif defined(TARGET_nxp_t2080)
104143
/* NXP T2080 */
105144
#define CORE_E6500
@@ -176,7 +215,7 @@
176215

177216
#define USE_LONG_JUMP
178217
#else
179-
#error Please define TARGET (nxp_t2080, nxp_t1024, or nxp_p1021)
218+
#error Please define TARGET (nxp_t2080, nxp_t1040, nxp_t1024, or nxp_p1021)
180219
#endif
181220

182221

0 commit comments

Comments
 (0)