BananaPi BPI-F3: Update u-boot and linux patching

Signed-off-by: Patrick Yavitz <pyavitz@gmail.com>
This commit is contained in:
Patrick Yavitz
2024-12-26 10:50:34 -05:00
committed by c0rnelius
parent 7b6fcab372
commit df9ddaf44e
91 changed files with 337 additions and 477249 deletions

View File

@@ -1,10 +1,9 @@
From faa72a12de6759e8bd14736bba16e5ac778bf96f Mon Sep 17 00:00:00 2001
From 1caeec5d9b700d2408c44df4e4ce7ac2a90412ab Mon Sep 17 00:00:00 2001
From: Banana Pi -BPI <lionwang@sinovoip.com.cn>
Date: Thu, 11 Jul 2024 07:33:58 -0400
Subject: [PATCH 1/4] MBR support
Date: Mon, 4 Nov 2024 09:59:05 -0500
Subject: [PATCH] MBR support
Signed-off-by: Banana Pi -BPI <lionwang@sinovoip.com.cn>
Signed-off-by: Patrick Yavitz <pyavitz@armbian.com>
---
board/spacemit/k1-x/k1x.c | 10 +++++++++-
common/spl/spl_mmc.c | 22 ++++++++++++++++++++--
@@ -12,10 +11,10 @@ Signed-off-by: Patrick Yavitz <pyavitz@armbian.com>
3 files changed, 30 insertions(+), 3 deletions(-)
diff --git a/board/spacemit/k1-x/k1x.c b/board/spacemit/k1-x/k1x.c
index b6f06fbb..70141121 100644
index f47d9475..460eea4f 100644
--- a/board/spacemit/k1-x/k1x.c
+++ b/board/spacemit/k1-x/k1x.c
@@ -312,6 +312,7 @@ void _load_env_from_blk(struct blk_desc *dev_desc, const char *dev_name, int dev
@@ -440,6 +440,7 @@ void _load_env_from_blk(struct blk_desc *dev_desc, const char *dev_name, int dev
char cmd[128];
struct disk_partition info;
@@ -23,7 +22,7 @@ index b6f06fbb..70141121 100644
for (part = 1; part <= MAX_SEARCH_PARTITIONS; part++) {
err = part_get_info(dev_desc, part, &info);
if (err)
@@ -321,8 +322,13 @@ void _load_env_from_blk(struct blk_desc *dev_desc, const char *dev_name, int dev
@@ -449,8 +450,13 @@ void _load_env_from_blk(struct blk_desc *dev_desc, const char *dev_name, int dev
break;
}
}
@@ -38,7 +37,7 @@ index b6f06fbb..70141121 100644
env_set("bootfs_part", simple_itoa(part));
env_set("bootfs_devname", dev_name);
@@ -332,12 +338,14 @@ void _load_env_from_blk(struct blk_desc *dev_desc, const char *dev_name, int dev
@@ -460,12 +466,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);
@@ -54,7 +53,7 @@ index b6f06fbb..70141121 100644
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 acf2b278..3109c93d 100644
index acf2b278..581958bb 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,
@@ -82,7 +81,7 @@ index acf2b278..3109c93d 100644
+ info.start = 0x500;
+ strcpy(info.name,"opensbi");
+ }
+ else
+ else
+ if (!strcmp(part_name, "uboot")){
+ info.start = 0x800;
+ strcpy(info.name,"uboot");
@@ -104,7 +103,7 @@ index acf2b278..3109c93d 100644
#endif
}
diff --git a/configs/k1_defconfig b/configs/k1_defconfig
index 568400e5..66a6729a 100644
index b23d595b..197d54cb 100644
--- a/configs/k1_defconfig
+++ b/configs/k1_defconfig
@@ -23,6 +23,7 @@ CONFIG_ARCH_RV64I=y
@@ -116,5 +115,5 @@ index 568400e5..66a6729a 100644
CONFIG_HAS_CUSTOM_SYS_INIT_SP_ADDR=y
CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0x1000000
--
2.35.3
2.39.5

View File

@@ -1,16 +1,15 @@
From 1377ac604cc13156c4af4e7cdc5d3acafcbd2db5 Mon Sep 17 00:00:00 2001
From e646c31222ba2175e7ded14507f852a1a2202e8e Mon Sep 17 00:00:00 2001
From: Banana Pi -BPI <lionwang@sinovoip.com.cn>
Date: Thu, 11 Jul 2024 07:37:18 -0400
Subject: [PATCH 2/4] change AUTOBOOT_STOP_STR to Space KEY
Subject: [PATCH] change AUTOBOOT_STOP_STR to Space KEY
Signed-off-by: Banana Pi -BPI <lionwang@sinovoip.com.cn>
Signed-off-by: Patrick Yavitz <pyavitz@armbian.com>
---
configs/k1_defconfig | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/configs/k1_defconfig b/configs/k1_defconfig
index 66a6729a..7ae44243 100644
index a3adf4b091..4ee8f69e47 100644
--- a/configs/k1_defconfig
+++ b/configs/k1_defconfig
@@ -35,9 +35,12 @@ CONFIG_SPL_LOAD_FIT_ADDRESS=0x11000000
@@ -29,5 +28,5 @@ index 66a6729a..7ae44243 100644
CONFIG_BOOTCOMMAND="bootm 0x11000000"
CONFIG_LOGLEVEL=7
--
2.35.3
2.39.2

View File

@@ -1,23 +1,25 @@
From eec3cefda7f6f5b50b7fce2f07736f79c855d93a Mon Sep 17 00:00:00 2001
From: Patrick Yavitz <pyavitz@armbian.com>
Date: Thu, 11 Jul 2024 07:43:37 -0400
Subject: [PATCH 3/4] Syslinux and script support
From 55d1b972a09de27995c29fe4eb8e3b9ade3a9ba9 Mon Sep 17 00:00:00 2001
From: Patrick Yavitz <pyavitz@gmail.com>
Date: Wed, 25 Dec 2024 18:35:46 -0500
Subject: [PATCH] Add syslinux and script support
Signed-off-by: Patrick Yavitz <pyavitz@armbian.com>
Signed-off-by: Patrick Yavitz <pyavitz@gmail.com>
---
board/spacemit/k1-x/k1-x.env | 185 ++++-------------------------------
board/spacemit/k1-x/k1x.c | 20 ++--
configs/k1_defconfig | 3 +
include/configs/k1-x.h | 23 ++---
4 files changed, 43 insertions(+), 188 deletions(-)
board/spacemit/k1-x/k1-x.env | 246 ++++-------------------------------
1 file changed, 22 insertions(+), 224 deletions(-)
diff --git a/board/spacemit/k1-x/k1-x.env b/board/spacemit/k1-x/k1-x.env
index bdb32b35..acb1ef7a 100644
index bb18f40e..acb1ef7a 100644
--- a/board/spacemit/k1-x/k1-x.env
+++ b/board/spacemit/k1-x/k1-x.env
@@ -8,169 +8,24 @@ loglevel=8
@@ -4,230 +4,28 @@ console=ttyS0,115200
init=/init
bootdelay=0
baudrate=115200
+loglevel=8
stderr=serial
stdin=serial,usbkbd
-stdin=serial,usbkbd,usbkbd1
+stdin=serial,usbkbd
stdout=serial
-workqueue.default_affinity_scope=system
-
@@ -56,11 +58,12 @@ index bdb32b35..acb1ef7a 100644
-//ethaddr=fe:fe:fe:22:22:01
-//eth1addr=fe:fe:fe:22:22:02
-
-ipaddr=10.0.92.100
-ipaddr=
-netmask=255.255.255.0
-serverip=10.0.92.134
-serverip=10.0.92.148
-gatewayip=10.0.92.1
-net_data_path=net_flash_file/net_flash_file/
-mac_mapping_file=/home/it/nfs/bianbu/mac_mapping.txt
-
-preboot=
-ramdisk_size=-
@@ -70,14 +73,24 @@ index bdb32b35..acb1ef7a 100644
-dtb_dir=
-dtb_name=k1-x_evb.dtb
-splashfile=bianbu.bmp
-grub_file=EFI/BOOT/BOOTRISCV64.EFI
-mdio_intf=
-phyaddr0=1
-phy_link_time=10000
-netdev=eth0
-
-uboot_status=IN_UBOOT
-
-// EFI system partition
-esp_name=ESP
-esp_index=5
-usb_start=true
-
-get_esp_index=env set esp_index ${bootfs_part}; \
- part number ${bootfs_devname} ${boot_devnum} ${esp_name} esp_index;
-
-// Common boot args
-set_bootargs=setenv bootargs earlycon=${earlycon} earlyprintk quiet splash console=${console} loglevel=${loglevel} clk_ignore_unused swiotlb=65536 rdinit=${init} product_name=${product_name}
-commonargs=run set_bootargs; setenv bootargs "${bootargs}" plymouth.ignore-serial-consoles plymouth.prefer-fbcon workqueue.default_affinity_scope=${workqueue.default_affinity_scope}
-commonargs=setenv bootargs earlyprintk quiet splash plymouth.ignore-serial-consoles plymouth.prefer-fbcon clk_ignore_unused swiotlb=65536 workqueue.default_affinity_scope=${workqueue.default_affinity_scope}
-
-//detect product_name from env and select dtb file to load
-dtb_env=if test -n "${product_name}"; then \
@@ -123,18 +136,42 @@ index bdb32b35..acb1ef7a 100644
- setenv dtb_addr ""; \
- fi;
-
-load_grub=echo "Loading grub..."; \
- load ${bootfs_devname} ${boot_devnum}:${esp_index} ${kernel_addr_r} ${grub_file};
-
-# bootm command for fit image, booti command for PE or compress PE image
-start_kernel=fdt addr ${kernel_addr_r}; \
- if fdt list /; then \
- bootm ${kernel_addr_r} ${ramdisk_combo} ${dtb_addr}; \
- else \
- booti ${kernel_addr_r} ${ramdisk_combo} ${dtb_addr}; \
- fi;
-
-boot_kernel=run detect_dtb; \
- run loadknl; \
- run loaddtb; \
- run loadramdisk; \
- run start_kernel;
-
-boot_grub=env set -e -bs product_name "${product_name}"; \
- env set -e -bs bootargs "${bootargs}"; \
- run usb_start;
- run load_grub; \
- bootefi ${kernel_addr_r};
-
-// Nor+ssd boot combo
-set_nor_args=setenv bootargs "${bootargs}" mtdparts=${mtdparts} root=${blk_root} rootfstype=ext4
-nor_boot=echo "Try to boot from ${bootfs_devname}${boot_devnum} ..."; \
- run commonargs; \
- run set_nor_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 #############"
- run commonargs; \
- run set_nor_root; \
- run set_nor_args; \
- run get_esp_index; \
- if test -e ${bootfs_devname} ${boot_devnum}:${esp_index} ${grub_file}; then \
- run boot_grub; \
- else \
- run boot_kernel; \
- fi; \
- echo "########### boot failed by default config, check your boot config #############"
-
-//##############################################################################
-// eMMC/SDCard boot
@@ -142,15 +179,36 @@ index bdb32b35..acb1ef7a 100644
-set_mmc_args=setenv bootargs "${bootargs}" root=${blk_root} rootwait rootfstype=${mmc_rootfstype};
-
-mmc_boot=echo "Try to boot from ${bootfs_devname}${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 #############"
- run commonargs; \
- run set_mmc_root; \
- run set_mmc_args; \
- run get_esp_index; \
- if test -e ${bootfs_devname} ${boot_devnum}:${esp_index} ${grub_file}; then \
- run boot_grub; \
- else \
- run boot_kernel; \
- fi; \
- echo "########### boot failed by default config, check your boot config #############"
-
-nfs_boot=echo "Try to boot from NFS ..."; \
- run commonargs; \
- setenv bootargs "${bootargs}" root=/dev/nfs nfsroot=${serverip}:${rootfs_path} bootfs=${serverip}:${bootfs_path} ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}::${netdev}:off noipath; \
- echo "bootargs: ${bootargs}"; \
- run detect_dtb; \
- echo "Loading kernel from NFS..."; \
- nfs ${kernel_addr_r} ${serverip}:${bootfs_path}/${knl_name}; \
- echo "Loading dtb from NFS..."; \
- nfs ${dtb_addr} ${serverip}:${bootfs_path}/${dtb_name}; \
- if test -n "${ramdisk_name}"; then \
- echo "Loading ramdisk from NFS..."; \
- nfs ${ramdisk_addr} ${serverip}:${bootfs_path}/${ramdisk_name}; \
- setenv ramdisk_size ${filesize}; \
- setenv ramdisk_combo ${ramdisk_addr}:${ramdisk_size}; \
- else \
- setenv ramdisk_combo -; \
- fi; \
- run start_kernel; \
- echo "########### boot kernel failed from NFS, check your boot config #############"
-
-// Variable "boot_device" is set during board_late_init()
-autoboot=if test ${boot_device} = nand; then \
@@ -159,6 +217,8 @@ index bdb32b35..acb1ef7a 100644
- run nor_boot; \
- elif test ${boot_device} = mmc; then \
- run mmc_boot; \
- elif test ${boot_device} = nfs; then \
- run nfs_boot; \
- fi;
-
-bootcmd=run autoboot; echo "run autoboot"
@@ -205,11 +265,26 @@ index bdb32b35..acb1ef7a 100644
+ fi;
+
+bootcmd=echo "Loading ..."; run autoboot
--
2.39.5
From 9bb50320cc81251c93a21a94fb73cf0a2feb693e Mon Sep 17 00:00:00 2001
From: Patrick Yavitz <pyavitz@gmail.com>
Date: Mon, 4 Nov 2024 10:09:19 -0500
Subject: [PATCH] Add syslinux and script support
Signed-off-by: Patrick Yavitz <pyavitz@gmail.com>
---
board/spacemit/k1-x/k1x.c | 20 ++++++++++----------
configs/k1_defconfig | 3 +++
include/configs/k1-x.h | 23 ++++++++++-------------
3 files changed, 23 insertions(+), 23 deletions(-)
diff --git a/board/spacemit/k1-x/k1x.c b/board/spacemit/k1-x/k1x.c
index 70141121..ada5f1fc 100644
index 460eea4f..7f59b332 100644
--- a/board/spacemit/k1-x/k1x.c
+++ b/board/spacemit/k1-x/k1x.c
@@ -330,8 +330,8 @@ void _load_env_from_blk(struct blk_desc *dev_desc, const char *dev_name, int dev
@@ -458,8 +458,8 @@ void _load_env_from_blk(struct blk_desc *dev_desc, const char *dev_name, int dev
#endif
}
@@ -220,7 +295,7 @@ index 70141121..ada5f1fc 100644
/*load env.txt and import to uboot*/
memset((void *)CONFIG_SPL_LOAD_FIT_ADDRESS, 0, CONFIG_ENV_SIZE);
@@ -510,7 +510,7 @@ void setenv_boot_mode(void)
@@ -662,7 +662,7 @@ void setenv_boot_mode(void)
u32 boot_mode = get_boot_mode();
switch (boot_mode) {
case BOOT_MODE_NAND:
@@ -229,7 +304,7 @@ index 70141121..ada5f1fc 100644
break;
case BOOT_MODE_NOR:
char *blk_name;
@@ -521,23 +521,23 @@ void setenv_boot_mode(void)
@@ -673,23 +673,23 @@ void setenv_boot_mode(void)
return;
}
@@ -261,7 +336,7 @@ index 70141121..ada5f1fc 100644
}
}
diff --git a/configs/k1_defconfig b/configs/k1_defconfig
index 7ae44243..5af667bf 100644
index 8db91b1e..63ac72b5 100644
--- a/configs/k1_defconfig
+++ b/configs/k1_defconfig
@@ -43,6 +43,8 @@ CONFIG_AUTOBOOT_STOP_STR=" "
@@ -273,13 +348,13 @@ index 7ae44243..5af667bf 100644
CONFIG_LOGLEVEL=7
CONFIG_SPL_LOGLEVEL=1
# CONFIG_SYS_DEVICE_NULLDEV is not set
@@ -279,3 +281,4 @@ CONFIG_PRINT_TIMESTAMP=y
# CONFIG_SPL_SHA1 is not set
@@ -288,3 +290,4 @@ CONFIG_PRINT_TIMESTAMP=y
# CONFIG_SPL_SHA256 is not set
CONFIG_ZSTD=y
# CONFIG_HEXDUMP is not set
+CONFIG_OF_LIBFDT_OVERLAY=y
diff --git a/include/configs/k1-x.h b/include/configs/k1-x.h
index f1f4be78..34ad156e 100644
index 8d27fe9d..c7f42bbc 100644
--- a/include/configs/k1-x.h
+++ b/include/configs/k1-x.h
@@ -84,11 +84,6 @@
@@ -306,7 +381,7 @@ index f1f4be78..34ad156e 100644
#include <config_distro_bootcmd.h>
#define BOOTENV_DEV_QEMU(devtypeu, devtypel, instance) \
@@ -167,11 +167,6 @@ struct boot_storage_op
@@ -167,16 +167,13 @@ struct boot_storage_op
/*if env not use for spl, please define to board/spacemit/k1-x/k1-x.env */
#define CONFIG_EXTRA_ENV_SETTINGS \
"stdout_flash=serial,vidconsole\0" \
@@ -317,11 +392,6 @@ index f1f4be78..34ad156e 100644
- "dtb_addr=" __stringify(DTB_LOAD_ADDR) "\0" \
"scriptaddr=0x2c100000\0" \
"pxefile_addr_r=0x0c200000\0" \
"ipaddr=192.168.1.15\0" \
@@ -179,9 +174,11 @@ struct boot_storage_op
"serverip=10.0.92.134\0" \
"gatewayip=192.168.1.1\0" \
"net_data_path=spacemit_flash_file/net_flash_file/\0" \
- "splashimage=" __stringify(CONFIG_FASTBOOT_BUF_ADDR) "\0" \
- "splashpos=m,m\0" \
- "splashfile=bianbu.bmp\0" \
@@ -334,5 +404,5 @@ index f1f4be78..34ad156e 100644
--
2.35.3
2.39.5

View File

@@ -1,7 +1,7 @@
From 0027fcd7dedbc6920c6222e5887df60651b22b2b Mon Sep 17 00:00:00 2001
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 4/4] efi_loader : Suppress error print message
Subject: [PATCH] efi_loader : Suppress error print message
Currently, on certain Xilinx platforms, an issue has been
identified, manifesting as follows:
@@ -38,7 +38,7 @@ Signed-off-by: Tejas Bhumkar <tejas.arvind.bhumkar@amd.com>
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/efi_loader/efi_memory.c b/lib/efi_loader/efi_memory.c
index 15c42be7..a4840ead 100644
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)
@@ -51,5 +51,5 @@ index 15c42be7..a4840ead 100644
}
/* Avoid double free */
--
2.35.3
2.39.2