From 3c7ed46bab05553fbe4262fb9d4354803ed4f1da Mon Sep 17 00:00:00 2001 From: Robert Nelson Date: Mon, 14 Aug 2023 22:18:00 -0500 Subject: [PATCH] u-boot: backport: kernel_addr_r and friends Signed-off-by: Robert Nelson --- .gitlab-ci.yml | 4 +- 03_build_u-boot.sh | 1 + patches/u-boot/microchip_mpfs_icicle.h | 81 ++++++++++++++++++++++++++ 3 files changed, 84 insertions(+), 2 deletions(-) create mode 100644 patches/u-boot/microchip_mpfs_icicle.h diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 22bbdca..5d6948a 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -24,8 +24,8 @@ build: - ./03_build_u-boot.sh - ./04_build_linux.sh - ./05_generate_payload.bin.sh - - sudo ./06_generate_debian_console_root.sh - - sudo ./07_create_sdcard_img.sh + - ./06_generate_debian_console_root.sh + - ./07_create_sdcard_img.sh - tree -s ./deploy/ - cp ./deploy/images/sdcard.img ./ artifacts: diff --git a/03_build_u-boot.sh b/03_build_u-boot.sh index 683e403..cbbec7b 100755 --- a/03_build_u-boot.sh +++ b/03_build_u-boot.sh @@ -9,6 +9,7 @@ make -C u-boot ARCH=riscv CROSS_COMPILE=${CC} distclean cd ./u-boot/ #patch -p1 < ../patches/u-boot/0001-Use-MMUART0-for-stdout.patch #exit 2 +cp -v ../patches/u-boot/microchip_mpfs_icicle.h include/configs/microchip_mpfs_icicle.h cp -v ../patches/u-boot/microchip-mpfs-icicle-kit.dts arch/riscv/dts/ cp -v ../patches/u-boot/microchip_mpfs_icicle_defconfig .config cd ../ diff --git a/patches/u-boot/microchip_mpfs_icicle.h b/patches/u-boot/microchip_mpfs_icicle.h new file mode 100644 index 0000000..4885a85 --- /dev/null +++ b/patches/u-boot/microchip_mpfs_icicle.h @@ -0,0 +1,81 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +/* + * Copyright (C) 2019 Microchip Technology Inc. + * Padmarao Begari + */ + +#ifndef __CONFIG_H +#define __CONFIG_H + +#include + +#define CONFIG_SYS_SDRAM_BASE 0x80000000 +#define CONFIG_SYS_INIT_SP_ADDR (CONFIG_SYS_SDRAM_BASE + SZ_2M) + +#define CONFIG_SYS_BOOTM_LEN SZ_64M + +#define CONFIG_STANDALONE_LOAD_ADDR 0x80200000 + +/* Environment options */ + +#if defined(CONFIG_CMD_DHCP) +#define BOOT_TARGET_DEVICES_DHCP(func) func(DHCP, dhcp, na) +#else +#define BOOT_TARGET_DEVICES_DHCP(func) +#endif + +#if defined(CONFIG_CMD_MTD) +# define BOOT_TARGET_DEVICES_QSPI(func) func(QSPI, qspi, na) +#else +# define BOOT_TARGET_DEVICES_QSPI(func) +#endif + +#if defined(CONFIG_CMD_MMC) +#define BOOT_TARGET_DEVICES_MMC(func) func(MMC, mmc, 0) +#else +#define BOOT_TARGET_DEVICES_MMC(func) +#endif + +#define BOOTENV_DEV_QSPI(devtypeu, devtypel, instance) \ + "bootcmd_qspi=echo Trying to boot from QSPI...; "\ + "setenv scriptname boot.scr.uimg; " \ + "if mtd list; then setenv mtd_present true; " \ + "mtd read env ${scriptaddr} 0; " \ + "source ${scriptaddr}; setenv mtd_present; " \ + "fi\0 " + +#define BOOTENV_DEV_NAME_QSPI(devtypeu, devtypel, instance) \ + "qspi " + +#define BOOT_TARGET_DEVICES(func) \ + BOOT_TARGET_DEVICES_QSPI(func)\ + BOOT_TARGET_DEVICES_MMC(func)\ + BOOT_TARGET_DEVICES_DHCP(func) + +#define BOOTENV_DESIGN_OVERLAYS \ + "design_overlays=" \ + "if test -n ${no_of_overlays}; then " \ + "setenv inc 1; " \ + "setenv idx 0; " \ + "fdt resize ${dtbo_size}; " \ + "while test $idx -ne ${no_of_overlays}; do " \ + "setenv dtbo_name dtbo_image${idx}; " \ + "setenv fdt_cmd \"fdt apply $\"$dtbo_name; " \ + "run fdt_cmd; " \ + "setexpr idx $inc + $idx; " \ + "done; " \ + "fi;\0 " \ + +#include + +#define CONFIG_EXTRA_ENV_SETTINGS \ + "bootm_size=0x10000000\0" \ + "kernel_addr_r=0x84000000\0" \ + "fdt_addr_r=0x88000000\0" \ + "scriptaddr=0x88100000\0" \ + "pxefile_addr_r=0x88200000\0" \ + "ramdisk_addr_r=0x88300000\0" \ + BOOTENV_DESIGN_OVERLAYS \ + BOOTENV \ + +#endif /* __CONFIG_H */