Skip to content

Commit 58a54d1

Browse files
committed
Enable MPFS250 build test
1 parent 04a342c commit 58a54d1

File tree

9 files changed

+27
-68
lines changed

9 files changed

+27
-68
lines changed

.github/workflows/test-build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ jobs:
7575

7676
- name: Install cross compilers
7777
run: |
78-
sudo apt-get install -y gcc-arm-none-eabi gcc-aarch64-linux-gnu gcc-powerpc-linux-gnu gnu-efi
78+
sudo apt-get install -y gcc-arm-none-eabi gcc-aarch64-linux-gnu gcc-powerpc-linux-gnu gnu-efi gcc-riscv64-unknown-elf
7979
8080
- name: make clean
8181
run: |

.github/workflows/test-configs.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -207,12 +207,12 @@ jobs:
207207
arch: arm
208208
config-file: ./config/examples/mcxw-tz.config
209209

210-
# TODO: polarfire_mpfs250.config requires PolarFire SoC SDK
211-
#polarfire_mpfs250_test:
212-
# uses: ./.github/workflows/test-build-mcux-sdk.yml
213-
# with:
214-
# arch: riscv64
215-
# config-file: ./config/examples/polarfire_mpfs250.config
210+
microchip_mpfs250_test:
211+
uses: ./.github/workflows/test-build.yml
212+
with:
213+
arch: riscv64
214+
config-file: ./config/examples/polarfire_mpfs250.config
215+
216216
raspi3_test:
217217
uses: ./.github/workflows/test-build.yml
218218
with:

arch.mk

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -561,9 +561,8 @@ endif
561561
ifeq ($(ARCH),RISCV64)
562562
CROSS_COMPILE?=riscv64-unknown-elf-
563563
CFLAGS+=-DMMU -DWOLFBOOT_DUALBOOT
564-
#UPDATE_OBJS:=src/update_ram.o
565-
UPDATE_OBJS:=src/update_disk.o
566564
CFLAGS+=-DWOLFBOOT_UPDATE_DISK
565+
UPDATE_OBJS:=src/update_disk.o
567566
OBJS += src/gpt.o
568567
ARCH_FLAGS=-march=rv64imafdc -mabi=lp64d -mcmodel=medany
569568
CFLAGS+=-fno-builtin-printf -DUSE_M_TIME -g -nostartfiles -DARCH_RISCV64
@@ -575,8 +574,8 @@ ifeq ($(ARCH),RISCV64)
575574
LDFLAGS+=-Wl,--gc-sections
576575

577576
OBJS+=src/boot_riscv64_start.o src/boot_riscv64.o src/vector_riscv64.o
578-
ARCH_FLASH_OFFSET=0x20220000
579577

578+
CFLAGS+=-DWOLFBOOT_FDT
580579
OBJS+=src/fdt.o
581580

582581
ifeq ($(SPMATH),1)
@@ -849,7 +848,7 @@ ifeq ($(TARGET),nxp_t1024)
849848
ARCH_FLAGS=-mhard-float -mcpu=e5500
850849
CFLAGS+=$(ARCH_FLAGS)
851850
BIG_ENDIAN=1
852-
CFLAGS+=-DMMU -DWOLFBOOT_DUALBOOT
851+
CFLAGS+=-DMMU -DWOLFBOOT_FDT -DWOLFBOOT_DUALBOOT
853852
CFLAGS+=-pipe # use pipes instead of temp files
854853
CFLAGS+=-feliminate-unused-debug-types
855854
LDFLAGS+=$(ARCH_FLAGS)
@@ -870,7 +869,7 @@ ifeq ($(TARGET),nxp_t2080)
870869
ARCH_FLAGS=-mhard-float -mcpu=e6500
871870
CFLAGS+=$(ARCH_FLAGS)
872871
BIG_ENDIAN=1
873-
CFLAGS+=-DMMU -DWOLFBOOT_DUALBOOT
872+
CFLAGS+=-DMMU -DWOLFBOOT_FDT -DWOLFBOOT_DUALBOOT
874873
CFLAGS+=-pipe # use pipes instead of temp files
875874
CFLAGS+=-feliminate-unused-debug-types
876875
LDFLAGS+=$(ARCH_FLAGS)
@@ -1377,7 +1376,7 @@ BOOT_IMG?=test-app/image.bin
13771376

13781377
## Update mechanism
13791378
ifeq ($(ARCH),AARCH64)
1380-
CFLAGS+=-DMMU -DWOLFBOOT_DUALBOOT
1379+
CFLAGS+=-DMMU -DWOLFBOOT_FDT -DWOLFBOOT_DUALBOOT
13811380
OBJS+=src/fdt.o
13821381
UPDATE_OBJS:=src/update_ram.o
13831382
else

config/examples/raspi3-encrypted.config

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ WOLFBOOT_PARTITION_SWAP_ADDRESS=0xFFFFFFFF
1616
WOLFBOOT_PARTITION_SIZE=0x1000000
1717
WOLFBOOT_SECTOR_SIZE=0x400
1818
EXT_FLASH=0
19-
MMU=1
2019
ENCRYPT=1
2120
NO_XIP=1
2221
ENCRYPT_WITH_AES256=1

hal/x86_fsp_qemu_loader.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,6 @@
2727
#ifdef __WOLFBOOT
2828
#include <printf.h>
2929

30-
31-
static void panic(void);
32-
3330
void hal_init(void)
3431
{
3532
}
@@ -88,7 +85,7 @@ void *hal_get_dts_update_address(void)
8885
return 0;
8986
}
9087

91-
static void panic(void)
88+
void panic(void)
9289
{
9390
while(1) {}
9491
}

src/string.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
#endif
2828

2929
#include <stddef.h>
30-
#ifndef TARGET_library
30+
#if !defined(TARGET_library) && !defined(ARCH_RISCV64)
3131
#include <string.h>
3232
#else
3333
size_t strlen(const char *s); /* forward declaration */

src/update_disk.c

Lines changed: 11 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@
4343
#include "printf.h"
4444
#include "wolfboot/wolfboot.h"
4545
#include "disk.h"
46+
#ifdef WOLFBOOT_ELF
47+
#include "elf.h"
48+
#endif
4649

4750
#include <stdint.h>
4851
#include <string.h>
@@ -53,10 +56,7 @@
5356
#include "x86/ahci.h"
5457
#include "x86/ata.h"
5558
#include "pci.h"
56-
57-
#ifdef WOLFBOOT_TGL
5859
#include "x86/tgl_fsp.h"
59-
#endif
6060

6161
#ifdef TARGET_kontron_vx3060_s2
6262
#define BOOT_PART_A 5
@@ -117,7 +117,6 @@ void RAMFUNCTION wolfBoot_start(void)
117117
#ifdef WOLFBOOT_FSP
118118
struct stage2_parameter *stage2_params;
119119
uint32_t sata_bar;
120-
121120
ret = x86_fsp_tgl_init_sata(&sata_bar);
122121
if (ret != 0)
123122
wolfBoot_panic();
@@ -265,14 +264,7 @@ void RAMFUNCTION wolfBoot_start(void)
265264

266265
load_address = (uint32_t*)os_image.fw_base;
267266

268-
#ifdef WOLFBOOT_ELF
269-
/* Load elf */
270-
if (elf_load_image_mmu((uint8_t*)load_address, (uintptr_t*)&load_address, NULL) != 0){
271-
wolfBoot_printf("Invalid elf, falling back to raw binary\n");
272-
}
273-
#endif
274-
275-
#ifdef MMU
267+
#ifdef WOLFBOOT_FDT
276268
/* Is this a Flattened uImage Tree (FIT) image (FDT format) */
277269
if (wolfBoot_get_dts_size(load_address) > 0) {
278270
void* fit = (void*)load_address;
@@ -296,42 +288,14 @@ void RAMFUNCTION wolfBoot_start(void)
296288
}
297289
}
298290
}
299-
else {
300-
/* Load DTS to RAM */
301-
#ifdef EXT_FLASH
302-
if (PART_IS_EXT(&os_image) &&
303-
wolfBoot_open_image(&os_image, PART_DTS_BOOT) >= 0) {
304-
dts_addr = (uint8_t*)WOLFBOOT_LOAD_DTS_ADDRESS;
305-
dts_size = (uint32_t)os_image.fw_size;
306-
307-
wolfBoot_printf("Loading DTS (size %lu) to RAM at %08lx\n",
308-
(long unsigned int)dts_size, (long unsigned int)dts_addr);
309-
ext_flash_check_read((uintptr_t)os_image.fw_base,
310-
(uint8_t*)dts_addr, dts_size);
311-
}
312-
else
313-
#endif /* EXT_FLASH */
314-
{
315-
dts_addr = hal_get_dts_address();
316-
if (dts_addr) {
317-
ret = wolfBoot_get_dts_size(dts_addr);
318-
if (ret < 0) {
319-
wolfBoot_printf("Failed parsing DTB to load\n");
320-
/* Allow failure, continue booting */
321-
}
322-
else {
323-
/* relocate DTS to RAM */
324-
uint8_t* dts_dst = (uint8_t*)WOLFBOOT_LOAD_DTS_ADDRESS;
325-
dts_size = (uint32_t)ret;
326-
wolfBoot_printf("Loading DTB (size %d) from %p to RAM at %p\n",
327-
dts_size, dts_addr, (void*)WOLFBOOT_LOAD_DTS_ADDRESS);
328-
memcpy(dts_dst, dts_addr, dts_size);
329-
dts_addr = dts_dst;
330-
}
331-
}
332-
}
291+
#endif
292+
293+
#ifdef WOLFBOOT_ELF
294+
/* Load elf */
295+
if (elf_load_image_mmu((uint8_t*)load_address, (uintptr_t*)&load_address, NULL) != 0){
296+
wolfBoot_printf("Invalid elf, falling back to raw binary\n");
333297
}
334-
#endif /* MMU */
298+
#endif
335299

336300
wolfBoot_printf("Booting at %08lx\r\n", load_address);
337301

tools/elf-parser/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
CC=gcc
66
CFLAGS=-Wall -g -ggdb
7-
CFLAGS+=-I../../include -DWOLFBOOT_ELF -DELF_PARSER -DPRINTF_ENABLED -DMMU -DARCH_FLASH_OFFSET=0
7+
CFLAGS+=-I../../include -DWOLFBOOT_ELF -DELF_PARSER -DPRINTF_ENABLED -DARCH_FLASH_OFFSET=0
88
EXE=elf-parser
99

1010
LIBS=

tools/fdt-parser/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
CC=gcc
66
CFLAGS=-Wall -g -ggdb
7-
CFLAGS+=-I../../include -DMMU -DPRINTF_ENABLED
7+
CFLAGS+=-I../../include -DPRINTF_ENABLED
88
EXE=fdt-parser
99

1010
LIBS=

0 commit comments

Comments
 (0)