SpacemiT: Adapt U-Boot patches and rewrite U-Boot patches

Adapt patches to Bianbu Linux U-Boot v1.0.5, then rewrite them.
Also move boot delay to board config like other boards, instead of patched-in.
This commit is contained in:
ColorfulRhino 2024-06-30 22:48:15 +02:00 committed by Igor
parent 308eba5d31
commit 71e2ff0727
6 changed files with 59 additions and 62 deletions

View File

@ -4,6 +4,7 @@ BOARDFAMILY="spacemit"
BOARD_MAINTAINER=""
KERNEL_TARGET="legacy,current"
BOOT_FDT_FILE="spacemit/k1-bananapi-f3.dtb"
BOOTDELAY=1
SRC_EXTLINUX="yes"
SRC_CMDLINE="earlycon=sbi console=tty1 console=ttyS0,115200 clk_ignore_unused swiotlb=65536"
PACKAGE_LIST_BOARD="rfkill bluetooth bluez bluez-tools"

View File

@ -1,7 +1,7 @@
From 4e65b4371d252c546a2ed996900839e09b25a110 Mon Sep 17 00:00:00 2001
From 0000000000000000000000000000000000000000 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
Subject: overlay support
Signed-off-by: Patrick Yavitz <pyavitz@armbian.com>
---
@ -10,19 +10,19 @@ Signed-off-by: Patrick Yavitz <pyavitz@armbian.com>
2 files changed, 3 insertions(+)
diff --git a/configs/k1_defconfig b/configs/k1_defconfig
index 969e38e2e7..f009ebca5c 100644
index 111111111111..222222222222 100644
--- a/configs/k1_defconfig
+++ b/configs/k1_defconfig
@@ -270,3 +270,4 @@ CONFIG_IMAGE_SPARSE_TRANSFER_BLK_NUM=0x3000
@@ -272,3 +272,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
index 111111111111..222222222222 100644
--- a/include/configs/k1-x.h
+++ b/include/configs/k1-x.h
@@ -135,6 +135,7 @@ struct boot_storage_op
@@ -141,6 +141,7 @@ struct boot_storage_op
#define KERNEL_ADDR_R __stringify(0x10000000)
#define FDT_ADDR_R __stringify(0x1F000000)
#define RAMDISK_ADDR_R __stringify(0x21000000)
@ -30,14 +30,14 @@ index a18e5bf18a..6980b33c6b 100644
#include <config_distro_bootcmd.h>
@@ -166,6 +167,7 @@ struct boot_storage_op
@@ -172,6 +173,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" \
"dtb_addr=" __stringify(DTB_LOAD_ADDR) "\0" \
"scriptaddr=0x2c100000\0" \
"pxefile_addr_r=0x0c200000\0" \
--
2.39.2
Armbian

View File

@ -1,17 +1,17 @@
From ab508f4ac676151ef2c555e7693d768eb5a8a832 Mon Sep 17 00:00:00 2001
From 0000000000000000000000000000000000000000 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
Subject: 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 ++++++++++++++++++++--
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
index 111111111111..222222222222 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
@ -53,7 +53,7 @@ index 8a42f5d8a6..2c66d5ec4e 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 acf2b278e8..581958bb1e 100644
index 111111111111..222222222222 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,
@ -103,7 +103,7 @@ index acf2b278e8..581958bb1e 100644
#endif
}
diff --git a/configs/k1_defconfig b/configs/k1_defconfig
index 544b47797b..74ac106914 100644
index 111111111111..222222222222 100644
--- a/configs/k1_defconfig
+++ b/configs/k1_defconfig
@@ -23,6 +23,7 @@ CONFIG_ARCH_RV64I=y
@ -115,5 +115,5 @@ index 544b47797b..74ac106914 100644
CONFIG_HAS_CUSTOM_SYS_INIT_SP_ADDR=y
CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0x1000000
--
2.39.2
Armbian

View File

@ -1,31 +1,28 @@
From 2aa062b0567d3863d700021990de89ba6b616c8f Mon Sep 17 00:00:00 2001
From 0000000000000000000000000000000000000000 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
Subject: change AUTOBOOT_STOP_STR to Space KEY
---
configs/k1_defconfig | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
configs/k1_defconfig | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/configs/k1_defconfig b/configs/k1_defconfig
index f4e34a6a1..67b5b5879 100644
index 111111111111..222222222222 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
@@ -36,7 +36,10 @@ CONFIG_LEGACY_IMAGE_FORMAT=y
CONFIG_SUPPORT_RAW_INITRD=y
-CONFIG_BOOTDELAY=0
+CONFIG_BOOTDELAY=1
CONFIG_BOOTDELAY=0
CONFIG_AUTOBOOT_KEYED=y
-CONFIG_AUTOBOOT_STOP_STR="s"
+CONFIG_AUTOBOOT_PROMPT="Autoboot in %d seconds, press <Space> to stop\n"
+CONFIG_AUTOBOOT_PROMPT="Auto-boot 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_BOOTCOMMAND="bootm 0x11000000"
CONFIG_LOGLEVEL=7
--
2.39.2
Armbian

View File

@ -1,17 +1,17 @@
From b46c8c5a2257102403104dd2c168b7583f087dfa Mon Sep 17 00:00:00 2001
From 0000000000000000000000000000000000000000 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
Subject: extlinux support
Signed-off-by: Patrick Yavitz <pyavitz@armbian.com>
---
board/spacemit/k1-x/k1-x.env | 173 +++--------------------------------
board/spacemit/k1-x/k1-x.env | 173 +---------
configs/k1_defconfig | 2 +
include/configs/k1-x.h | 13 ++-
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
index 111111111111..222222222222 100644
--- a/board/spacemit/k1-x/k1-x.env
+++ b/board/spacemit/k1-x/k1-x.env
@@ -1,4 +1,4 @@
@ -20,8 +20,7 @@ index b024181959..d688d6bb8e 100644
earlycon=sbi
console=ttyS0,115200
init=/init
@@ -9,166 +9,15 @@ stderr=serial
stdin=serial,usbkbd
@@ -10,166 +10,15 @@ stdin=serial,usbkbd
stdout=serial
workqueue.default_affinity_scope=system
@ -39,19 +38,22 @@ index b024181959..d688d6bb8e 100644
- 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"
-// Get "rootfs" partition number in decimal, and set var "blk_root"
-// Variable "boot_devnum" is set during board_lat_init()
-set_mmc_root=part number mmc ${boot_devnum} rootfs rootfs_part; \
-set_rootfs_env=if test "${bootfs_devname}" = mmc; then \
- setenv blk_root "/dev/mmcblk${boot_devnum}p${rootfs_part}"; \
- elif test "${bootfs_devname}" = nvme; then \
- setenv blk_root "/dev/nvme${boot_devnum}n1p${rootfs_part}"; \
- else echo "not define rootfs part at this blk device, add to env"; \
- fi;
-get_rootfs_env=part number ${bootfs_devname} ${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}";
- echo "get rootfs_part index:${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}";
-set_mmc_root=run get_rootfs_env; run set_rootfs_env;
-
-set_nor_root=run get_rootfs_env; run set_rootfs_env;
-
-//override here, otherwise gen random addr and save to eeprom by uboot
-//ethaddr=fe:fe:fe:22:22:01
@ -64,15 +66,12 @@ index b024181959..d688d6bb8e 100644
-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
@ -80,7 +79,7 @@ index b024181959..d688d6bb8e 100644
-netdev=eth0
-
-// Common boot args
-commonargs=setenv bootargs earlycon=${earlycon} earlyprintk console=tty1 console=${console} loglevel=${loglevel} clk_ignore_unused swiotlb=65536 rdinit=${init}
-commonargs=setenv bootargs earlycon=${earlycon} earlyprintk console=tty1 console=${console} loglevel=${loglevel} clk_ignore_unused swiotlb=65536 rdinit=${init} 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 \
@ -127,10 +126,10 @@ index b024181959..d688d6bb8e 100644
- 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 ..."; \
-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_nvme_root; \
- run set_nor_root; \
- run set_nor_args; \
- run detect_dtb; \
- run loadknl; \
@ -142,9 +141,9 @@ index b024181959..d688d6bb8e 100644
-//##############################################################################
-// eMMC/SDCard boot
-//##############################################################################
-set_mmc_args=setenv bootargs "${bootargs}" root=${mmc_root} rootwait rootfstype=${mmc_rootfstype};
-set_mmc_args=setenv bootargs "${bootargs}" root=${blk_root} rootwait rootfstype=${mmc_rootfstype};
-
-mmc_boot=echo "Try to boot from MMC${boot_devnum} ..."; \
-mmc_boot=echo "Try to boot from ${bootfs_devname}${boot_devnum} ..."; \
- run commonargs; \
- run set_mmc_root; \
- run set_mmc_args; \
@ -199,7 +198,7 @@ index b024181959..d688d6bb8e 100644
-bootmenu_9="recovery from net"=run flash_from_net
-
diff --git a/configs/k1_defconfig b/configs/k1_defconfig
index ac09a48a2a..717fd2e833 100644
index 111111111111..222222222222 100644
--- a/configs/k1_defconfig
+++ b/configs/k1_defconfig
@@ -42,6 +42,8 @@ CONFIG_AUTOBOOT_STOP_STR=" "
@ -212,7 +211,7 @@ index ac09a48a2a..717fd2e833 100644
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
index 111111111111..222222222222 100644
--- a/include/configs/k1-x.h
+++ b/include/configs/k1-x.h
@@ -86,7 +86,7 @@
@ -253,5 +252,5 @@ index 1098880f02..d9b20c6b4d 100644
"scriptaddr=0x2c100000\0" \
"pxefile_addr_r=0x0c200000\0" \
--
2.39.2
Armbian

View File

@ -1,7 +1,7 @@
From 60013790aa6b8ba65fdb7546f715314d00591f81 Mon Sep 17 00:00:00 2001
From 0000000000000000000000000000000000000000 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
Subject: 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 e048a545e4..7fea2f79c8 100644
index 111111111111..222222222222 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 e048a545e4..7fea2f79c8 100644
}
/* Avoid double free */
--
2.39.2
Armbian