diff options
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/dts/armada-388-clearfog-u-boot.dtsi | 4 | ||||
-rw-r--r-- | arch/arm/mach-mvebu/dram.c | 10 | ||||
-rw-r--r-- | arch/sandbox/config.mk | 28 | ||||
-rw-r--r-- | arch/sandbox/cpu/os.c | 4 | ||||
-rw-r--r-- | arch/sandbox/lib/crt0_sandbox_efi.S | 32 | ||||
-rw-r--r-- | arch/sandbox/lib/reloc_sandbox_efi.c | 32 |
6 files changed, 98 insertions, 12 deletions
diff --git a/arch/arm/dts/armada-388-clearfog-u-boot.dtsi b/arch/arm/dts/armada-388-clearfog-u-boot.dtsi index cf6c08881b..38e4f3d99a 100644 --- a/arch/arm/dts/armada-388-clearfog-u-boot.dtsi +++ b/arch/arm/dts/armada-388-clearfog-u-boot.dtsi @@ -12,6 +12,10 @@ u-boot,dm-spl; }; +&gpio0 { + u-boot,dm-spl; +}; + &ahci0 { u-boot,dm-spl; }; diff --git a/arch/arm/mach-mvebu/dram.c b/arch/arm/mach-mvebu/dram.c index fa8c799a46..ba8ebc6288 100644 --- a/arch/arm/mach-mvebu/dram.c +++ b/arch/arm/mach-mvebu/dram.c @@ -281,16 +281,6 @@ int dram_init(void) size = MVEBU_SDRAM_SIZE_MAX; } - for (; i < CONFIG_NR_DRAM_BANKS; i++) { - /* If above loop terminated prematurely, we need to set - * remaining banks' start address & size as 0. Otherwise other - * u-boot functions and Linux kernel gets wrong values which - * could result in crash */ - gd->bd->bi_dram[i].start = 0; - gd->bd->bi_dram[i].size = 0; - } - - if (ecc_enabled()) dram_ecc_scrubbing(); diff --git a/arch/sandbox/config.mk b/arch/sandbox/config.mk index 05fbbd7bcc..a225c9cbfa 100644 --- a/arch/sandbox/config.mk +++ b/arch/sandbox/config.mk @@ -27,3 +27,31 @@ cmd_u-boot-spl = (cd $(obj) && $(CC) -o $(SPL_BIN) -Wl,-T u-boot-spl.lds \ $(PLATFORM_LIBS) -Wl,-Map -Wl,u-boot-spl.map -Wl,--gc-sections) CONFIG_ARCH_DEVICE_TREE := sandbox + +ifeq ($(HOST_ARCH),$(HOST_ARCH_X86_64)) +EFI_LDS := ${SRCDIR}/../../../arch/x86/lib/elf_x86_64_efi.lds +EFI_TARGET := --target=efi-app-x86_64 +else ifeq ($(HOST_ARCH),$(HOST_ARCH_X86)) +EFI_LDS := ${SRCDIR}/../../../arch/x86/lib/elf_ia32_efi.lds +EFI_TARGET := --target=efi-app-ia32 +else ifeq ($(HOST_ARCH),$(HOST_ARCH_AARCH64)) +EFI_LDS := ${SRCDIR}/../../../arch/arm/lib/elf_aarch64_efi.lds +OBJCOPYFLAGS += -j .text -j .secure_text -j .secure_data -j .rodata -j .data \ + -j .u_boot_list -j .rela.dyn -j .got -j .got.plt \ + -j .binman_sym_table -j .text_rest \ + -j .efi_runtime -j .efi_runtime_rel +else ifeq ($(HOST_ARCH),$(HOST_ARCH_ARM)) +EFI_LDS := ${SRCDIR}/../../../arch/arm/lib/elf_arm_efi.lds +OBJCOPYFLAGS += -j .text -j .secure_text -j .secure_data -j .rodata -j .hash \ + -j .data -j .got -j .got.plt -j .u_boot_list -j .rel.dyn \ + -j .binman_sym_table -j .text_rest \ + -j .efi_runtime -j .efi_runtime_rel +else ifeq ($(HOST_ARCH),$(HOST_ARCH_RISCV32)) +EFI_LDS := ${SRCDIR}/../../../arch/riscv/lib/elf_riscv32_efi.lds +else ifeq ($(HOST_ARCH),$(HOST_ARCH_RISCV64)) +EFI_LDS := ${SRCDIR}/../../../arch/riscv/lib/elf_riscv64_efi.lds +endif +EFI_CRT0 := crt0_sandbox_efi.o +EFI_RELOC := reloc_sandbox_efi.o +AFLAGS_crt0_sandbox_efi.o += -DHOST_ARCH="$(HOST_ARCH)" +CFLAGS_reloc_sandbox_efi.o += -DHOST_ARCH="$(HOST_ARCH)" diff --git a/arch/sandbox/cpu/os.c b/arch/sandbox/cpu/os.c index 47dfb476d3..79094fb7f3 100644 --- a/arch/sandbox/cpu/os.c +++ b/arch/sandbox/cpu/os.c @@ -816,10 +816,10 @@ void *os_find_text_base(void) char *end = memchr(line, '-', len); if (end) { - unsigned long long addr; + uintptr_t addr; *end = '\0'; - if (sscanf(line, "%llx", &addr) == 1) + if (sscanf(line, "%zx", &addr) == 1) base = (void *)addr; } } diff --git a/arch/sandbox/lib/crt0_sandbox_efi.S b/arch/sandbox/lib/crt0_sandbox_efi.S new file mode 100644 index 0000000000..88537345dd --- /dev/null +++ b/arch/sandbox/lib/crt0_sandbox_efi.S @@ -0,0 +1,32 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +/* + * PE/COFF header for EFI applications + * + * Copyright (c) 2019 Heinrich Schuchardt + */ + +#include <host_arch.h> + +#if HOST_ARCH == HOST_ARCH_X86_64 +#include "../../../arch/x86/lib/crt0_x86_64_efi.S" +#endif + +#if HOST_ARCH == HOST_ARCH_X86 +#include "../../../arch/x86/lib/crt0_ia32_efi.S" +#endif + +#if HOST_ARCH == HOST_ARCH_AARCH64 +#include "../../../arch/arm/lib/crt0_aarch64_efi.S" +#endif + +#if HOST_ARCH == HOST_ARCH_ARM +#include "../../../arch/arm/lib/crt0_arm_efi.S" +#endif + +#if HOST_ARCH == HOST_ARCH_RISCV32 +#include "../../../arch/riscv/lib/crt0_riscv_efi.S" +#endif + +#if HOST_ARCH == HOST_ARCH_RISCV64 +#include "../../../arch/riscv/lib/crt0_riscv_efi.S" +#endif diff --git a/arch/sandbox/lib/reloc_sandbox_efi.c b/arch/sandbox/lib/reloc_sandbox_efi.c new file mode 100644 index 0000000000..a21e6757c5 --- /dev/null +++ b/arch/sandbox/lib/reloc_sandbox_efi.c @@ -0,0 +1,32 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * position independent shared object relocator + * + * Copyright (c) 2019 Heinrich Schuchardt + */ + +#include <host_arch.h> + +#if HOST_ARCH == HOST_ARCH_X86_64 +#include "../../../arch/x86/lib/reloc_x86_64_efi.c" +#endif + +#if HOST_ARCH == HOST_ARCH_X86 +#include "../../../arch/x86/lib/reloc_ia32_efi.c" +#endif + +#if HOST_ARCH == HOST_ARCH_AARCH64 +#include "../../../arch/arm/lib/reloc_aarch64_efi.c" +#endif + +#if HOST_ARCH == HOST_ARCH_ARM +#include "../../../arch/arm/lib/reloc_arm_efi.c" +#endif + +#if HOST_ARCH == HOST_ARCH_RISCV32 +#include "../../../arch/riscv/lib/reloc_riscv_efi.c" +#endif + +#if HOST_ARCH == HOST_ARCH_RISCV64 +#include "../../../arch/riscv/lib/reloc_riscv_efi.c" +#endif |