mirror of
https://github.com/armbian/build
synced 2025-09-24 19:47:06 +07:00
BananaPi F3: Add U-Boot patches
Branch: v2022.10 Source: https://gitee.com/bianbu-linux/uboot-2022.10 Signed-off-by: Patrick Yavitz <pyavitz@armbian.com>
This commit is contained in:
@@ -0,0 +1,43 @@
|
||||
From 4e65b4371d252c546a2ed996900839e09b25a110 Mon Sep 17 00:00:00 2001
|
||||
From: Patrick Yavitz <pyavitz@armbian.com>
|
||||
Date: Fri, 14 Jun 2024 10:39:21 -0400
|
||||
Subject: [PATCH] overlay support
|
||||
|
||||
Signed-off-by: Patrick Yavitz <pyavitz@armbian.com>
|
||||
---
|
||||
configs/k1_defconfig | 1 +
|
||||
include/configs/k1-x.h | 2 ++
|
||||
2 files changed, 3 insertions(+)
|
||||
|
||||
diff --git a/configs/k1_defconfig b/configs/k1_defconfig
|
||||
index 969e38e2e7..f009ebca5c 100644
|
||||
--- a/configs/k1_defconfig
|
||||
+++ b/configs/k1_defconfig
|
||||
@@ -270,3 +270,4 @@ CONFIG_IMAGE_SPARSE_TRANSFER_BLK_NUM=0x3000
|
||||
# CONFIG_SPL_SHA1 is not set
|
||||
# CONFIG_SPL_SHA256 is not set
|
||||
CONFIG_ZSTD=y
|
||||
+CONFIG_OF_LIBFDT_OVERLAY=y
|
||||
diff --git a/include/configs/k1-x.h b/include/configs/k1-x.h
|
||||
index a18e5bf18a..6980b33c6b 100644
|
||||
--- a/include/configs/k1-x.h
|
||||
+++ b/include/configs/k1-x.h
|
||||
@@ -135,6 +135,7 @@ struct boot_storage_op
|
||||
#define KERNEL_ADDR_R __stringify(0x10000000)
|
||||
#define FDT_ADDR_R __stringify(0x1F000000)
|
||||
#define RAMDISK_ADDR_R __stringify(0x21000000)
|
||||
+#define FDTOVERLAY_ADDR_R __stringify(0x01000000)
|
||||
|
||||
#include <config_distro_bootcmd.h>
|
||||
|
||||
@@ -166,6 +167,7 @@ struct boot_storage_op
|
||||
"fdt_addr_r=" FDT_ADDR_R "\0" \
|
||||
"kernel_addr_r=" KERNEL_ADDR_R "\0" \
|
||||
"ramdisk_addr_r=" RAMDISK_ADDR_R "\0" \
|
||||
+ "fdtoverlay_addr_r=" FDTOVERLAY_ADDR_R "\0" \
|
||||
"fdtfile=spacemit/" CONFIG_DEFAULT_DEVICE_TREE ".dtb\0" \
|
||||
"scriptaddr=0x2c100000\0" \
|
||||
"pxefile_addr_r=0x0c200000\0" \
|
||||
--
|
||||
2.39.2
|
||||
|
||||
@@ -0,0 +1,119 @@
|
||||
From ab508f4ac676151ef2c555e7693d768eb5a8a832 Mon Sep 17 00:00:00 2001
|
||||
From: Banana Pi -BPI <lionwang@sinovoip.com.cn>
|
||||
Date: Sat, 29 Jun 2024 08:30:56 -0400
|
||||
Subject: [PATCH] MBR support
|
||||
|
||||
Signed-off-by: Banana Pi -BPI <lionwang@sinovoip.com.cn>
|
||||
---
|
||||
board/spacemit/k1-x/k1x.c | 10 +++++++++-
|
||||
common/spl/spl_mmc.c | 22 ++++++++++++++++++++--
|
||||
configs/k1_defconfig | 1 +
|
||||
3 files changed, 30 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/board/spacemit/k1-x/k1x.c b/board/spacemit/k1-x/k1x.c
|
||||
index 8a42f5d8a6..2c66d5ec4e 100644
|
||||
--- a/board/spacemit/k1-x/k1x.c
|
||||
+++ b/board/spacemit/k1-x/k1x.c
|
||||
@@ -310,6 +310,7 @@ void _load_env_from_blk(struct blk_desc *dev_desc, const char *dev_name, int dev
|
||||
char cmd[128];
|
||||
struct disk_partition info;
|
||||
|
||||
+ printf("BPI: :%s\n", "_load_env_from_blk");
|
||||
for (part = 1; part <= MAX_SEARCH_PARTITIONS; part++) {
|
||||
err = part_get_info(dev_desc, part, &info);
|
||||
if (err)
|
||||
@@ -319,8 +320,13 @@ void _load_env_from_blk(struct blk_desc *dev_desc, const char *dev_name, int dev
|
||||
break;
|
||||
}
|
||||
}
|
||||
- if (part > MAX_SEARCH_PARTITIONS)
|
||||
+ if (part > MAX_SEARCH_PARTITIONS) {
|
||||
+#ifdef BPI
|
||||
return;
|
||||
+#else
|
||||
+ part = 1;
|
||||
+#endif
|
||||
+ }
|
||||
|
||||
env_set("bootfs_part", simple_itoa(part));
|
||||
env_set("bootfs_devname", dev_name);
|
||||
@@ -330,12 +336,14 @@ void _load_env_from_blk(struct blk_desc *dev_desc, const char *dev_name, int dev
|
||||
sprintf(cmd, "load %s %d:%d 0x%x env_%s.txt", dev_name,
|
||||
dev, part, CONFIG_SPL_LOAD_FIT_ADDRESS, CONFIG_SYS_CONFIG_NAME);
|
||||
pr_debug("cmd:%s\n", cmd);
|
||||
+ printf("BPI: cmd:%s\n", cmd);
|
||||
if (run_command(cmd, 0))
|
||||
return;
|
||||
|
||||
memset(cmd, '\0', 128);
|
||||
sprintf(cmd, "env import -t 0x%x", CONFIG_SPL_LOAD_FIT_ADDRESS);
|
||||
pr_debug("cmd:%s\n", cmd);
|
||||
+ printf("BPI: cmd:%s\n", cmd);
|
||||
if (!run_command(cmd, 0)){
|
||||
pr_info("load env_%s.txt from bootfs successful\n", CONFIG_SYS_CONFIG_NAME);
|
||||
}
|
||||
diff --git a/common/spl/spl_mmc.c b/common/spl/spl_mmc.c
|
||||
index acf2b278e8..581958bb1e 100644
|
||||
--- a/common/spl/spl_mmc.c
|
||||
+++ b/common/spl/spl_mmc.c
|
||||
@@ -91,6 +91,7 @@ int mmc_load_image_raw_sector(struct spl_image_info *spl_image,
|
||||
|
||||
/* read image header to find the image size & load address */
|
||||
count = blk_dread(bd, sector, 1, header);
|
||||
+ printf("BPI:hdr read sector %lx, count=%lu\n", sector, count);
|
||||
debug("hdr read sector %lx, count=%lu\n", sector, count);
|
||||
if (count == 0) {
|
||||
ret = -EIO;
|
||||
@@ -222,11 +223,27 @@ static int mmc_load_image_raw_partition(struct spl_image_info *spl_image,
|
||||
}
|
||||
}
|
||||
#endif
|
||||
+ printf("BPI: partition=%d part_name[%s]\n",partition ,part_name);
|
||||
|
||||
for (int p = 1; p <= MAX_SEARCH_PARTITIONS; p++) {
|
||||
err = part_get_info(mmc_get_blk_desc(mmc), p, &info);
|
||||
- if (err)
|
||||
- continue;
|
||||
+ if (err) {
|
||||
+#ifdef BPI
|
||||
+#else
|
||||
+ if (!strcmp(part_name, "opensbi")){
|
||||
+ info.start = 0x500;
|
||||
+ strcpy(info.name,"opensbi");
|
||||
+ }
|
||||
+ else
|
||||
+ if (!strcmp(part_name, "uboot")){
|
||||
+ info.start = 0x800;
|
||||
+ strcpy(info.name,"uboot");
|
||||
+ }
|
||||
+ else
|
||||
+#endif
|
||||
+ continue;
|
||||
+ }
|
||||
+ printf("BPI: p=%d info.name=[%s] info.start[%lx]\n",p ,info.name,info.start);
|
||||
if (!strcmp(part_name, info.name)){
|
||||
if (mmc_load_image_raw_sector(spl_image, bootdev, mmc, info.start) == 0)
|
||||
return 0;
|
||||
@@ -245,6 +262,7 @@ static int mmc_load_image_raw_partition(struct spl_image_info *spl_image,
|
||||
#ifdef CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_SECTOR
|
||||
return mmc_load_image_raw_sector(spl_image, bootdev, mmc, info.start + sector);
|
||||
#else
|
||||
+ printf("BPI2: info.name=[%s] info.start[%lx]\n" ,info.name,info.start);
|
||||
return mmc_load_image_raw_sector(spl_image, bootdev, mmc, info.start);
|
||||
#endif
|
||||
}
|
||||
diff --git a/configs/k1_defconfig b/configs/k1_defconfig
|
||||
index 544b47797b..74ac106914 100644
|
||||
--- a/configs/k1_defconfig
|
||||
+++ b/configs/k1_defconfig
|
||||
@@ -23,6 +23,7 @@ CONFIG_ARCH_RV64I=y
|
||||
CONFIG_RISCV_SMODE=y
|
||||
# CONFIG_SPL_SMP is not set
|
||||
CONFIG_LOCALVERSION="spacemit"
|
||||
+CONFIG_DISTRO_DEFAULTS=y
|
||||
CONFIG_ENV_VARS_UBOOT_CONFIG=y
|
||||
CONFIG_HAS_CUSTOM_SYS_INIT_SP_ADDR=y
|
||||
CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0x1000000
|
||||
--
|
||||
2.39.2
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
From 2aa062b0567d3863d700021990de89ba6b616c8f Mon Sep 17 00:00:00 2001
|
||||
From: Banana Pi -BPI <lionwang@sinovoip.com.cn>
|
||||
Date: Wed, 15 May 2024 22:16:08 +0800
|
||||
Subject: [PATCH] change AUTOBOOT_STOP_STR to Space KEY
|
||||
|
||||
---
|
||||
configs/k1_defconfig | 7 +++++--
|
||||
1 file changed, 5 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/configs/k1_defconfig b/configs/k1_defconfig
|
||||
index f4e34a6a1..67b5b5879 100644
|
||||
--- a/configs/k1_defconfig
|
||||
+++ b/configs/k1_defconfig
|
||||
@@ -34,9 +34,12 @@ CONFIG_SPL_LOAD_FIT_ADDRESS=0x20000000
|
||||
# CONFIG_BOOTSTD is not set
|
||||
CONFIG_LEGACY_IMAGE_FORMAT=y
|
||||
CONFIG_SUPPORT_RAW_INITRD=y
|
||||
-CONFIG_BOOTDELAY=0
|
||||
+CONFIG_BOOTDELAY=1
|
||||
CONFIG_AUTOBOOT_KEYED=y
|
||||
-CONFIG_AUTOBOOT_STOP_STR="s"
|
||||
+CONFIG_AUTOBOOT_PROMPT="Autoboot in %d seconds, press <Space> to stop\n"
|
||||
+CONFIG_AUTOBOOT_DELAY_STR=""
|
||||
+CONFIG_AUTOBOOT_STOP_STR=" "
|
||||
+CONFIG_AUTOBOOT_KEYED_CTRLC=y
|
||||
CONFIG_USE_BOOTCOMMAND=y
|
||||
CONFIG_BOOTCOMMAND="bootm 0x20000000"
|
||||
CONFIG_LOGLEVEL=7
|
||||
--
|
||||
2.39.2
|
||||
|
||||
@@ -0,0 +1,257 @@
|
||||
From b46c8c5a2257102403104dd2c168b7583f087dfa Mon Sep 17 00:00:00 2001
|
||||
From: Patrick Yavitz <pyavitz@armbian.com>
|
||||
Date: Sat, 29 Jun 2024 08:42:10 -0400
|
||||
Subject: [PATCH] extlinux support
|
||||
|
||||
Signed-off-by: Patrick Yavitz <pyavitz@armbian.com>
|
||||
---
|
||||
board/spacemit/k1-x/k1-x.env | 173 +++--------------------------------
|
||||
configs/k1_defconfig | 2 +
|
||||
include/configs/k1-x.h | 13 ++-
|
||||
3 files changed, 22 insertions(+), 166 deletions(-)
|
||||
|
||||
diff --git a/board/spacemit/k1-x/k1-x.env b/board/spacemit/k1-x/k1-x.env
|
||||
index b024181959..d688d6bb8e 100644
|
||||
--- a/board/spacemit/k1-x/k1-x.env
|
||||
+++ b/board/spacemit/k1-x/k1-x.env
|
||||
@@ -1,4 +1,4 @@
|
||||
-// Common parameter
|
||||
+// Common Parameters
|
||||
earlycon=sbi
|
||||
console=ttyS0,115200
|
||||
init=/init
|
||||
@@ -9,166 +9,15 @@ stderr=serial
|
||||
stdin=serial,usbkbd
|
||||
stdout=serial
|
||||
workqueue.default_affinity_scope=system
|
||||
|
||||
-//partitions/mtdparts/mtdids would set while flashing env.bin
|
||||
-
|
||||
-// Nor flash rootfs device
|
||||
-nor_root=/dev/mtdblock6
|
||||
-nor_rootfstype=squashfs
|
||||
-
|
||||
-// eMMC/SDCard rootfs device
|
||||
-mmc_rootfstype=ext4
|
||||
-
|
||||
-// rootfs part number must less than 99
|
||||
-rootfs_part_to_ul=echo "set rootfs_part to ul"; setexpr temp_num_0 ${rootfs_part} / a;\
|
||||
- setexpr temp_num_1 ${rootfs_part} % a;\
|
||||
- setenv rootfs_part ${temp_num_0}${temp_num_1};
|
||||
-
|
||||
-// Get "rootfs" partition number in decimal, and set var "mmc_root"
|
||||
-// Variable "boot_devnum" is set during board_lat_init()
|
||||
-set_mmc_root=part number mmc ${boot_devnum} rootfs rootfs_part; \
|
||||
- setexpr rootfs_part ${rootfs_part} + 0; \
|
||||
- if test ${rootfs_part} > 9 ; then run rootfs_part_to_ul;fi; \
|
||||
- echo "get rootfs_part index:${rootfs_part}"; \
|
||||
- setenv mmc_root "/dev/mmcblk${boot_devnum}p${rootfs_part}";
|
||||
-
|
||||
-set_nvme_root=part number nvme ${boot_devnum} rootfs rootfs_part; \
|
||||
- setexpr rootfs_part ${rootfs_part} + 0; \
|
||||
- if test ${rootfs_part} > 9 ; then run rootfs_part_to_ul;fi; \
|
||||
- echo "get rootfs_part index:${rootfs_part}"; \
|
||||
- setenv nvme_root "/dev/nvme${boot_devnum}n1p${rootfs_part}";
|
||||
-
|
||||
-//override here, otherwise gen random addr and save to eeprom by uboot
|
||||
-//ethaddr=fe:fe:fe:22:22:01
|
||||
-//eth1addr=fe:fe:fe:22:22:02
|
||||
-
|
||||
-ipaddr=10.0.92.100
|
||||
-netmask=255.255.255.0
|
||||
-serverip=10.0.92.134
|
||||
-gatewayip=10.0.92.1
|
||||
-net_data_path=net_flash_file/net_flash_file/
|
||||
-
|
||||
-preboot=
|
||||
-kernel_addr_r=0x10000000
|
||||
-ramdisk_addr=0x20000000
|
||||
-ramdisk_size=-
|
||||
-ramdisk_combo=-
|
||||
-knl_name=Image.itb
|
||||
-ramdisk_name=initramfs-generic.img
|
||||
-dtb_dir=
|
||||
-dtb_name=k1-x_evb.dtb
|
||||
-dtb_addr=0x1F000000
|
||||
-splashfile=bianbu.bmp
|
||||
-mdio_intf=
|
||||
-phyaddr0=1
|
||||
-phy_link_time=10000
|
||||
-netdev=eth0
|
||||
-
|
||||
-// Common boot args
|
||||
-commonargs=setenv bootargs earlycon=${earlycon} earlyprintk console=tty1 console=${console} loglevel=${loglevel} clk_ignore_unused swiotlb=65536 rdinit=${init}
|
||||
-
|
||||
-//detect product_name from env and select dtb file to load
|
||||
-dtb_env=if test -n "${product_name}"; then \
|
||||
- if test "${product_name}" = k1_evb; then \
|
||||
- setenv dtb_name ${dtb_dir}/k1-x_evb.dtb; \
|
||||
- elif test "${product_name}" = k1_deb1; then \
|
||||
- setenv dtb_name ${dtb_dir}/k1-x_deb1.dtb; \
|
||||
- elif test "${product_name}" = k1_deb2; then \
|
||||
- setenv dtb_name ${dtb_dir}/k1-x_deb2.dtb; \
|
||||
- elif test "${product_name}" = k1_hs450; then \
|
||||
- setenv dtb_name ${dtb_dir}/k1-x_hs450.dtb; \
|
||||
- elif test "${product_name}" = k1_kx312; then \
|
||||
- setenv dtb_name ${dtb_dir}/k1-x_kx312.dtb; \
|
||||
- elif test "${product_name}" = k1_mingo; then \
|
||||
- setenv dtb_name ${dtb_dir}/k1-x_mingo.dtb; \
|
||||
- elif test "${product_name}" = k1_MINI-PC; then \
|
||||
- setenv dtb_name ${dtb_dir}/k1-x_MINI-PC.dtb; \
|
||||
- else \
|
||||
- echo "match dtb by product_name: ${dtb_dir}/${product_name}.dtb"; \
|
||||
- setenv dtb_name ${dtb_dir}/${product_name}.dtb; \
|
||||
- fi; \
|
||||
- fi;
|
||||
-
|
||||
-detect_dtb=echo "product_name: ${product_name}"; run dtb_env; echo "select ${dtb_name} to load";
|
||||
-
|
||||
-loadknl=echo "Loading kernel..."; \
|
||||
- load ${bootfs_devname} ${boot_devnum}:${bootfs_part} ${kernel_addr_r} ${knl_name};
|
||||
-
|
||||
-loadramdisk=echo "Loading ramdisk ..."; \
|
||||
- if load ${bootfs_devname} ${boot_devnum}:${bootfs_part} ${ramdisk_addr} ${ramdisk_name}; then \
|
||||
- size ${bootfs_devname} ${boot_devnum}:${bootfs_part} ${ramdisk_name}; \
|
||||
- setenv ramdisk_size ${filesize}; \
|
||||
- setenv ramdisk_combo ${ramdisk_addr}:${ramdisk_size}; \
|
||||
- else \
|
||||
- echo "load ramdisk from bootfs fail, use built-in ramdisk"; \
|
||||
- setenv ramdisk_addr -; \
|
||||
- fi;
|
||||
-
|
||||
-loaddtb=echo "Loading dtb..."; \
|
||||
- if load ${bootfs_devname} ${boot_devnum}:${bootfs_part} ${dtb_addr} ${dtb_name}; then \
|
||||
- else \
|
||||
- echo "load dtb from bootfs fail, use built-in dtb"; \
|
||||
- setenv dtb_addr ""; \
|
||||
- fi;
|
||||
-
|
||||
-// Nor+ssd boot combo
|
||||
-set_nor_args=setenv bootargs ${bootargs} mtdparts=${mtdparts} root=${nvme_root} rootfstype=ext4
|
||||
-nor_boot=echo "Try to boot from NVMe ..."; \
|
||||
- run commonargs; \
|
||||
- run set_nvme_root; \
|
||||
- run set_nor_args; \
|
||||
- run detect_dtb; \
|
||||
- run loadknl; \
|
||||
- run loaddtb; \
|
||||
- run loadramdisk; \
|
||||
- bootm ${kernel_addr_r} ${ramdisk_combo} ${dtb_addr}; \
|
||||
- echo "########### boot kernel failed by default config, check your boot config #############"
|
||||
-
|
||||
-//##############################################################################
|
||||
-// eMMC/SDCard boot
|
||||
-//##############################################################################
|
||||
-set_mmc_args=setenv bootargs "${bootargs}" root=${mmc_root} rootwait rootfstype=${mmc_rootfstype};
|
||||
-
|
||||
-mmc_boot=echo "Try to boot from MMC${boot_devnum} ..."; \
|
||||
- run commonargs; \
|
||||
- run set_mmc_root; \
|
||||
- run set_mmc_args; \
|
||||
- run detect_dtb; \
|
||||
- run loadknl; \
|
||||
- run loaddtb; \
|
||||
- run loadramdisk; \
|
||||
- bootm ${kernel_addr_r} ${ramdisk_combo} ${dtb_addr}; \
|
||||
- echo "########### boot kernel failed by default config, check your boot config #############"
|
||||
-
|
||||
-// Variable "boot_device" is set during board_late_init()
|
||||
-autoboot=if test ${boot_device} = nand; then \
|
||||
- run nand_boot; \
|
||||
- elif test ${boot_device} = nor; then \
|
||||
- run nor_boot; \
|
||||
- elif test ${boot_device} = mmc; then \
|
||||
- run mmc_boot; \
|
||||
- fi;
|
||||
+// Extlinux
|
||||
+autoboot=if test -e ${boot_device} ${boot_devnum}:${bootfs_part} /extlinux/extlinux.conf; then \
|
||||
+ sysboot ${boot_device} ${boot_devnum}:${bootfs_part} any 0x2000000 /extlinux/extlinux.conf; \
|
||||
+ elif test -e ${boot_device} ${boot_devnum}:${bootfs_part} /boot/extlinux/extlinux.conf; then \
|
||||
+ sysboot ${boot_device} ${boot_devnum}:${bootfs_part} any 0x2000000 /boot/extlinux/extlinux.conf; \
|
||||
+ elif test -e nvme ${devnum}:${partition} /extlinux/extlinux.conf; then \
|
||||
+ sysboot nvme ${devnum}:${partition} any 0x2000000 /extlinux/extlinux.conf; \
|
||||
+ elif test -e nvme ${devnum}:${partition} /boot/extlinux/extlinux.conf; then \
|
||||
+ sysboot nvme ${devnum}:${partition} any 0x2000000 /boot/extlinux/extlinux.conf; \
|
||||
+ fi;
|
||||
|
||||
bootcmd=run autoboot; echo "run autoboot"
|
||||
-
|
||||
-// Boot menu definitions
|
||||
-boot_default=echo "Current Boot Device: ${boot_device}"
|
||||
-flash_default=echo "Returning to Boot Menu..."
|
||||
-flash_from_usb=echo "recovery from usb...... "; \
|
||||
- flash_image usb;
|
||||
-flash_from_mmc=echo "recovery from mmc...... " \
|
||||
- flash_image mmc;
|
||||
-flash_from_net=echo "recovery from net...... " \
|
||||
- flash_image net;
|
||||
-
|
||||
-bootmenu_delay=5
|
||||
-bootmenu_0="-------- Boot Options --------"=run boot_default
|
||||
-bootmenu_1="Boot from Nor"=run nor_boot
|
||||
-bootmenu_2="Boot from Nand"=run nand_boot
|
||||
-bootmenu_3="Boot from MMC"=run mmc_boot
|
||||
-bootmenu_4="Autoboot"=run autoboot
|
||||
-bootmenu_5="Show current Boot Device"=run boot_default
|
||||
-bootmenu_6="-------- Flash Options --------"=run flash_default
|
||||
-bootmenu_7="recovery from usb"=run flash_from_usb
|
||||
-bootmenu_8="recovery from mmc"=run flash_from_mmc
|
||||
-bootmenu_9="recovery from net"=run flash_from_net
|
||||
-
|
||||
diff --git a/configs/k1_defconfig b/configs/k1_defconfig
|
||||
index ac09a48a2a..717fd2e833 100644
|
||||
--- a/configs/k1_defconfig
|
||||
+++ b/configs/k1_defconfig
|
||||
@@ -42,6 +42,8 @@ CONFIG_AUTOBOOT_STOP_STR=" "
|
||||
CONFIG_AUTOBOOT_KEYED_CTRLC=y
|
||||
CONFIG_USE_BOOTCOMMAND=y
|
||||
CONFIG_BOOTCOMMAND="bootm 0x11000000"
|
||||
+CONFIG_USE_PREBOOT=y
|
||||
+CONFIG_PREBOOT="usb start; nvme scan; nvme part"
|
||||
CONFIG_LOGLEVEL=7
|
||||
CONFIG_SPL_LOGLEVEL=1
|
||||
# CONFIG_SYS_DEVICE_NULLDEV is not set
|
||||
diff --git a/include/configs/k1-x.h b/include/configs/k1-x.h
|
||||
index 1098880f02..d9b20c6b4d 100644
|
||||
--- a/include/configs/k1-x.h
|
||||
+++ b/include/configs/k1-x.h
|
||||
@@ -86,7 +86,7 @@
|
||||
|
||||
// #define RAMDISK_LOAD_ADDR (CONFIG_FASTBOOT_BUF_ADDR + CONFIG_FASTBOOT_BUF_SIZE)
|
||||
// #define DTB_LOAD_ADDR (CONFIG_FASTBOOT_BUF_ADDR + CONFIG_FASTBOOT_BUF_SIZE * 2)
|
||||
-#define RAMDISK_LOAD_ADDR 0x21000000
|
||||
+//#define RAMDISK_LOAD_ADDR 0x21000000
|
||||
#define DTB_LOAD_ADDR 0x31000000
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
@@ -135,10 +135,13 @@ struct boot_storage_op
|
||||
#define BOOTFS_NAME ("bootfs")
|
||||
|
||||
/* Environment options */
|
||||
-
|
||||
#define BOOT_TARGET_DEVICES(func) \
|
||||
func(QEMU, qemu, na)
|
||||
|
||||
+#define KERNEL_ADDR_R __stringify(0x10000000)
|
||||
+#define FDT_ADDR_R __stringify(0x1F000000)
|
||||
+#define RAMDISK_ADDR_R __stringify(0x21000000)
|
||||
+
|
||||
#include <config_distro_bootcmd.h>
|
||||
|
||||
#define BOOTENV_DEV_QEMU(devtypeu, devtypel, instance) \
|
||||
@@ -166,8 +169,10 @@ struct boot_storage_op
|
||||
"stdout_flash=serial,vidconsole\0" \
|
||||
"kernel_comp_addr_r=" __stringify(CONFIG_SYS_LOAD_ADDR) "\0" \
|
||||
"kernel_comp_size=" __stringify(CONFIG_FASTBOOT_BUF_SIZE) "\0" \
|
||||
- "kernel_addr_r=" __stringify(CONFIG_FASTBOOT_BUF_ADDR) "\0" \
|
||||
- "ramdisk_addr=" __stringify(RAMDISK_LOAD_ADDR) "\0" \
|
||||
+ "fdt_addr_r=" FDT_ADDR_R "\0" \
|
||||
+ "kernel_addr_r=" KERNEL_ADDR_R "\0" \
|
||||
+ "ramdisk_addr_r=" RAMDISK_ADDR_R "\0" \
|
||||
+ "fdtfile=spacemit/" CONFIG_DEFAULT_DEVICE_TREE ".dtb\0" \
|
||||
"dtb_addr=" __stringify(DTB_LOAD_ADDR) "\0" \
|
||||
"scriptaddr=0x2c100000\0" \
|
||||
"pxefile_addr_r=0x0c200000\0" \
|
||||
--
|
||||
2.39.2
|
||||
|
||||
@@ -0,0 +1,55 @@
|
||||
From 60013790aa6b8ba65fdb7546f715314d00591f81 Mon Sep 17 00:00:00 2001
|
||||
From: Tejas Bhumkar <tejas.arvind.bhumkar@amd.com>
|
||||
Date: Fri, 7 Jun 2024 06:32:58 -0400
|
||||
Subject: [PATCH] efi_loader : Suppress error print message
|
||||
|
||||
Currently, on certain Xilinx platforms, an issue has been
|
||||
identified, manifesting as follows:
|
||||
|
||||
Starting kernel ...
|
||||
|
||||
efi_free_pool: illegal free 0x0000000077830040
|
||||
efi_free_pool: illegal free 0x000000007782d040
|
||||
efi_free_pool: illegal free 0x000000007782c040
|
||||
|
||||
The issue arises when the ramdisk image is relocated, placing
|
||||
it within the previously allocated EFI memory region( as EFI
|
||||
is established quite early in U-Boot). Consequently, when
|
||||
attempting to release memory in the EFI memory region during
|
||||
the handover process to the kernel,we encounter memory violations.
|
||||
|
||||
Highlighting that EFI remains active primarily during the
|
||||
booting of an EFI application, and the lmb persists while
|
||||
configuring images for the boot process. Since we aren't
|
||||
utilizing the EFI memory region during the boot process,
|
||||
there is no adverse impact even in the event of a violation.
|
||||
|
||||
Currently, there is an ongoing discussion regarding the handling
|
||||
strategies of three memory allocators: malloc, lmb, and EFI. This
|
||||
discussion is documented in the email chain
|
||||
titled "Proposal: U-Boot memory management."
|
||||
|
||||
Therefore, it is advisable to suppress the print message during
|
||||
the boot process for now.
|
||||
|
||||
Signed-off-by: Tejas Bhumkar <tejas.arvind.bhumkar@amd.com>
|
||||
---
|
||||
lib/efi_loader/efi_memory.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/lib/efi_loader/efi_memory.c b/lib/efi_loader/efi_memory.c
|
||||
index e048a545e4..7fea2f79c8 100644
|
||||
--- a/lib/efi_loader/efi_memory.c
|
||||
+++ b/lib/efi_loader/efi_memory.c
|
||||
@@ -660,7 +660,7 @@ efi_status_t efi_free_pool(void *buffer)
|
||||
/* Check that this memory was allocated by efi_allocate_pool() */
|
||||
if (((uintptr_t)alloc & EFI_PAGE_MASK) ||
|
||||
alloc->checksum != checksum(alloc)) {
|
||||
- printf("%s: illegal free 0x%p\n", __func__, buffer);
|
||||
+ debug("%s: illegal free 0x%p\n", __func__, buffer);
|
||||
return EFI_INVALID_PARAMETER;
|
||||
}
|
||||
/* Avoid double free */
|
||||
--
|
||||
2.39.2
|
||||
|
||||
Reference in New Issue
Block a user