Skip to content

Commit a07f378

Browse files
dgarskedanielinux
authored andcommitted
More fixes for aarch64 platforms.
1 parent d6ca1e1 commit a07f378

File tree

4 files changed

+16
-8
lines changed

4 files changed

+16
-8
lines changed

hal/nxp_ls1028a.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* ls1028a.c
1+
/* nxp_ls1028a.c
22
*
33
* Copyright (C) 2024 wolfSSL Inc.
44
*
@@ -25,6 +25,8 @@
2525
#include "image.h"
2626
#include "printf.h"
2727

28+
#ifdef TARGET_nxp_ls1028a
29+
2830
#ifndef ARCH_AARCH64
2931
# error "wolfBoot ls1028a HAL: wrong architecture selected. Please compile with ARCH=AARCH64."
3032
#endif
@@ -877,3 +879,5 @@ void hal_init(void)
877879
wolfBoot_printf("MMU init done\n");
878880
#endif
879881
}
882+
883+
#endif /* TARGET_nxp_ls1028a */

hal/nxp_ls1028a.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,8 @@
158158
#define MMUTCB_COUNT (64)
159159
#define MMUTCB_BASE(_n) (MMUTCB0_BASE + ((_n) % MMUTCB_COUNT) * MMUTCB_STRIDE)
160160
#define GICD_BASE (0x06000000ul) /* GIC-500 GICD */
161+
#define GICR_BASE (0x06100000ul)
162+
#define GICC_BASE (0x01402000ul)
161163
#define GITS_BASE (0x06020000ul) /* GIC-500 GITS Control */
162164
#define GITST_BASE (0x06030000ul) /* GIC-500 GITS Translation */
163165
#define CPU0RD_BASE (0x06040000ul) /* CPU0 control, Locality Perif Int*/

src/boot_aarch64.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ void boot_entry_C(void)
5252
/* Copy data section from flash to RAM if necessary */
5353
src = (unsigned int*)&_stored_data;
5454
dst = (unsigned int*)&_start_data;
55-
if(src!=dst) {
55+
if (src != dst) {
5656
while (dst < (unsigned int *)&_end_data) {
5757
*dst = *src;
5858
dst++;

src/boot_aarch64_start.S

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -65,13 +65,17 @@
6565

6666

6767
/* GICv2 Register Offsets */
68+
#ifndef GICD_BASE
6869
#define GICD_BASE 0xF9010000
70+
#endif
6971
#define GICD_CTLR 0x0000
7072
#define GICD_TYPER 0x0004
7173
#define GICD_SGIR 0x0F00
7274
#define GICD_IGROUPRn 0x0080
7375

76+
#ifndef GICC_BASE
7477
#define GICC_BASE 0xF9020000
78+
#endif
7579
#define GICC_PMR 0x0004
7680

7781
.equ TZPCDECPROT0_SET_BASE, 0x02200804
@@ -120,7 +124,7 @@ _vector_table:
120124

121125
8: mov sp, x1 // set stack pointer
122126

123-
#ifdef CPU_A72
127+
#ifdef CORTEX_A72
124128
bl init_A72
125129
#endif
126130
bl boot_entry_C // boot_entry_C never returns
@@ -154,6 +158,7 @@ gicv2_init_secure:
154158
ret
155159

156160

161+
#ifdef CORTEX_A72
157162
.global invalidate_ivac
158163
invalidate_ivac:
159164
ldr x0, =_OCRAM_ADDRESS
@@ -208,7 +213,6 @@ switch_el3_to_el2:
208213
.global cortex_a72_erratta
209214
cortex_a72_erratta:
210215

211-
212216
/* Initalization code for NXP LS1028a (A72) */
213217
.global init_A72
214218
init_A72:
@@ -280,7 +284,6 @@ init_stack:
280284
bl invalidate_ivac
281285
b boot_entry_C
282286

283-
#ifdef TARGET_nxp_ls1028a
284287
.global mmu_enable
285288
mmu_enable:
286289
tlbi alle3 /* Invalidate table entries */
@@ -318,7 +321,6 @@ mmu_enable:
318321
dsb sy
319322
isb
320323
ret
321-
#endif
322324

323325
/* Exception Vector Table EL3 */
324326
.balign 0x800
@@ -390,7 +392,6 @@ PUT_64BIT_WORD \attr_hi, ((\PA) & 0xc0000000) | \attr_lo | 0x1
390392
PUT_64BIT_WORD \attr_hi, ((\PA) & 0xffe00000) | \attr_lo | 0x1
391393
.endm
392394

393-
#ifdef TARGET_nxp_ls1028a
394395
/* Note: In EL3/2 has direct physical to virutal mapping */
395396
.align 12
396397
.global ttb0_base
@@ -407,4 +408,5 @@ level1_pagetable:
407408
BLOCK_2MB (ADDR << 20), 0, 0x74c
408409
.set ADDR, ADDR + 2
409410
.endr
410-
#endif
411+
412+
#endif /* CORTEX_A72 */

0 commit comments

Comments
 (0)