* [PATCH 0/6] bootstd: sunxi: Migrate to standard boot
@ 2024-08-07 20:50 Simon Glass
2024-08-07 20:50 ` [PATCH 1/6] sunxi: Drop BOOTCMD_SUNXI_COMPAT Simon Glass
` (6 more replies)
0 siblings, 7 replies; 12+ messages in thread
From: Simon Glass @ 2024-08-07 20:50 UTC (permalink / raw)
To: U-Boot Mailing List
Cc: Tom Rini, Jagan Teki, Andre Przywara, Simon Glass,
AKASHI Takahiro, Alper Nebi Yasak, Andrew Davis, Andy Shevchenko,
Bin Meng, Bryan Brattlof, Caleb Connolly, Csókás Bence,
Eddie James, Hans de Goede, Heinrich Schuchardt, Ilias Apalodimas,
Janne Grunau, Jernej Skrabec, Jesse Taube, Joe Hershberger,
Julien Masson, Leon M. Busch-George, Maksim Kiselev, Marek Vasut,
Marek Vasut, Mattijs Korpershoek, Michael Walle, Michal Simek,
Mikhail Kalashnikov, Peter Robinson, Rasmus Villemoes,
Rayagonda Kokatanur, Sam Edwards, Samuel Holland, Stefan Roese,
Sumit Garg, Venkatesh Yadav Abbarapu
This series attempts to migrate all sunxi boards to use standard boot,
along with a text environment.
Simon Glass (6):
sunxi: Drop BOOTCMD_SUNXI_COMPAT
sunxi: Add a bootmeth for FEL
sunxi: Move to bootstd
sunxi: Drop old distro boot variables
env: Provide a work-around for unquoting fdtfile
sunxi: Move to text environment
Makefile | 1 +
arch/arm/Kconfig | 2 +-
arch/arm/include/asm/arch-sunxi/clock_sun4i.h | 10 -
arch/arm/mach-sunxi/Kconfig | 12 -
arch/arm/mach-sunxi/dram_sun4i.c | 4 -
board/sunxi/sunxi.env | 138 ++++++++++
boot/Kconfig | 14 ++
boot/Makefile | 1 +
boot/bootmeth_fel.c | 81 ++++++
configs/icnova-a20-swac_defconfig | 1 -
doc/usage/environment.rst | 12 +
include/configs/sunxi-common.h | 238 ------------------
12 files changed, 248 insertions(+), 266 deletions(-)
create mode 100644 board/sunxi/sunxi.env
create mode 100644 boot/bootmeth_fel.c
--
2.34.1
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH 1/6] sunxi: Drop BOOTCMD_SUNXI_COMPAT
2024-08-07 20:50 [PATCH 0/6] bootstd: sunxi: Migrate to standard boot Simon Glass
@ 2024-08-07 20:50 ` Simon Glass
2024-08-07 20:50 ` [PATCH 2/6] sunxi: Add a bootmeth for FEL Simon Glass
` (5 subsequent siblings)
6 siblings, 0 replies; 12+ messages in thread
From: Simon Glass @ 2024-08-07 20:50 UTC (permalink / raw)
To: U-Boot Mailing List
Cc: Tom Rini, Jagan Teki, Andre Przywara, Simon Glass, Jernej Skrabec,
Maksim Kiselev, Michael Walle, Mikhail Kalashnikov, Sam Edwards,
Samuel Holland, Stefan Roese
This dates from 2015 and talks about 'old' 3.x kernels. Perhaps we can
drop this functionality now?
Signed-off-by: Simon Glass <sjg@chromium.org>
---
arch/arm/include/asm/arch-sunxi/clock_sun4i.h | 10 ----------
arch/arm/mach-sunxi/Kconfig | 12 ------------
arch/arm/mach-sunxi/dram_sun4i.c | 4 ----
configs/icnova-a20-swac_defconfig | 1 -
include/configs/sunxi-common.h | 17 -----------------
5 files changed, 44 deletions(-)
diff --git a/arch/arm/include/asm/arch-sunxi/clock_sun4i.h b/arch/arm/include/asm/arch-sunxi/clock_sun4i.h
index 2cec91cb20e..c0a438dee53 100644
--- a/arch/arm/include/asm/arch-sunxi/clock_sun4i.h
+++ b/arch/arm/include/asm/arch-sunxi/clock_sun4i.h
@@ -142,17 +142,7 @@ struct sunxi_ccm_reg {
#define CCM_PLL1_CFG_FACTOR_M_SHIFT 0
#define PLL1_CFG_DEFAULT 0xa1005000
-
-#if defined CONFIG_OLD_SUNXI_KERNEL_COMPAT && defined CONFIG_MACH_SUN5I
-/*
- * Older linux-sunxi-3.4 kernels override our PLL6 setting with 300 MHz,
- * halving the mbus frequency, so set it to 300 MHz ourselves and base the
- * mbus divider on that.
- */
-#define PLL6_CFG_DEFAULT 0xa1009900
-#else
#define PLL6_CFG_DEFAULT 0xa1009911
-#endif
/* nand clock */
#define NAND_CLK_SRC_OSC24 0
diff --git a/arch/arm/mach-sunxi/Kconfig b/arch/arm/mach-sunxi/Kconfig
index 17666814c52..67c141ced80 100644
--- a/arch/arm/mach-sunxi/Kconfig
+++ b/arch/arm/mach-sunxi/Kconfig
@@ -294,7 +294,6 @@ config MACH_SUN6I
select SUNXI_GEN_SUN6I
select SUPPORT_SPL
select SYS_I2C_SUN6I_P2WI
- select ARMV7_BOOT_SEC_DEFAULT if OLD_SUNXI_KERNEL_COMPAT
config MACH_SUN7I
bool "sun7i (Allwinner A20)"
@@ -306,7 +305,6 @@ config MACH_SUN7I
select DRAM_SUN4I
select SUNXI_GEN_SUN4I
select SUPPORT_SPL
- select ARMV7_BOOT_SEC_DEFAULT if OLD_SUNXI_KERNEL_COMPAT
imply SPL_SYS_I2C_LEGACY
imply SYS_I2C_LEGACY
@@ -321,7 +319,6 @@ config MACH_SUN8I_A23
select SUNXI_GEN_SUN6I
select SUPPORT_SPL
select SYS_I2C_SUN8I_RSB
- select ARMV7_BOOT_SEC_DEFAULT if OLD_SUNXI_KERNEL_COMPAT
config MACH_SUN8I_A33
bool "sun8i (Allwinner A33)"
@@ -334,7 +331,6 @@ config MACH_SUN8I_A33
select SUNXI_GEN_SUN6I
select SUPPORT_SPL
select SYS_I2C_SUN8I_RSB
- select ARMV7_BOOT_SEC_DEFAULT if OLD_SUNXI_KERNEL_COMPAT
config MACH_SUN8I_A83T
bool "sun8i (Allwinner A83T)"
@@ -354,7 +350,6 @@ config MACH_SUN8I_H3
select CPU_V7_HAS_VIRT
select ARCH_SUPPORT_PSCI
select MACH_SUNXI_H3_H5
- select ARMV7_BOOT_SEC_DEFAULT if OLD_SUNXI_KERNEL_COMPAT
config MACH_SUN8I_R40
bool "sun8i (Allwinner R40)"
@@ -392,7 +387,6 @@ config MACH_SUN8I_V3S
select SUNXI_DRAM_DW
select SUNXI_DRAM_DW_16BIT
select SUPPORT_SPL
- select ARMV7_BOOT_SEC_DEFAULT if OLD_SUNXI_KERNEL_COMPAT
config MACH_SUN9I
bool "sun9i (Allwinner A80)"
@@ -746,12 +740,6 @@ config UART0_PORT_F
at the same time, the system can be only booted in the FEL mode.
Only enable this if you really know what you are doing.
-config OLD_SUNXI_KERNEL_COMPAT
- bool "Enable workarounds for booting old kernels"
- ---help---
- Set this to enable various workarounds for old kernels, this results in
- sub-optimal settings for newer kernels, only enable if needed.
-
config MMC1_PINS_PH
bool "Pins for mmc1 are on Port H"
depends on MACH_SUN4I || MACH_SUN7I || MACH_SUN8I_R40
diff --git a/arch/arm/mach-sunxi/dram_sun4i.c b/arch/arm/mach-sunxi/dram_sun4i.c
index 2cce381c9df..dfdb32111b4 100644
--- a/arch/arm/mach-sunxi/dram_sun4i.c
+++ b/arch/arm/mach-sunxi/dram_sun4i.c
@@ -249,10 +249,6 @@ static void mctl_setup_dram_clock(u32 clk, u32 mbus_clk)
reg_val &= ~CCM_PLL5_CTRL_K_MASK; /* set K to 0 (x1) */
reg_val &= ~CCM_PLL5_CTRL_N_MASK; /* set N to 0 (x0) */
reg_val &= ~CCM_PLL5_CTRL_P_MASK; /* set P to 0 (x1) */
-#ifdef CONFIG_OLD_SUNXI_KERNEL_COMPAT
- /* Old kernels are hardcoded to P=1 (divide by 2) */
- reg_val |= CCM_PLL5_CTRL_P(1);
-#endif
if (clk >= 540 && clk < 552) {
/* dram = 540MHz */
reg_val |= CCM_PLL5_CTRL_M(CCM_PLL5_CTRL_M_X(2));
diff --git a/configs/icnova-a20-swac_defconfig b/configs/icnova-a20-swac_defconfig
index 30c28f70857..b942fab2bc7 100644
--- a/configs/icnova-a20-swac_defconfig
+++ b/configs/icnova-a20-swac_defconfig
@@ -8,7 +8,6 @@ CONFIG_DEFAULT_DEVICE_TREE="sun7i-a20-icnova-swac"
CONFIG_SPL=y
CONFIG_MACH_SUN7I=y
CONFIG_DRAM_CLK=384
-CONFIG_OLD_SUNXI_KERNEL_COMPAT=y
CONFIG_USB0_VBUS_PIN="PG11"
CONFIG_USB0_VBUS_DET="PH7"
CONFIG_USB1_VBUS_PIN="PG10"
diff --git a/include/configs/sunxi-common.h b/include/configs/sunxi-common.h
index b29a25d5617..6ae6ef1b19c 100644
--- a/include/configs/sunxi-common.h
+++ b/include/configs/sunxi-common.h
@@ -226,22 +226,6 @@
BOOT_TARGET_DEVICES_PXE(func) \
BOOT_TARGET_DEVICES_DHCP(func)
-#ifdef CONFIG_OLD_SUNXI_KERNEL_COMPAT
-#define BOOTCMD_SUNXI_COMPAT \
- "bootcmd_sunxi_compat=" \
- "setenv root /dev/mmcblk0p3 rootwait; " \
- "if ext2load mmc 0 0x44000000 uEnv.txt; then " \
- "echo Loaded environment from uEnv.txt; " \
- "env import -t 0x44000000 ${filesize}; " \
- "fi; " \
- "setenv bootargs console=${console} root=${root} ${extraargs}; " \
- "ext2load mmc 0 0x43000000 script.bin && " \
- "ext2load mmc 0 0x48000000 uImage && " \
- "bootm 0x48000000\0"
-#else
-#define BOOTCMD_SUNXI_COMPAT
-#endif
-
#include <config_distro_bootcmd.h>
#ifdef CONFIG_USB_KEYBOARD
@@ -296,7 +280,6 @@
"uuid_gpt_esp=" UUID_GPT_ESP "\0" \
"uuid_gpt_system=" UUID_GPT_SYSTEM "\0" \
"partitions=" PARTS_DEFAULT "\0" \
- BOOTCMD_SUNXI_COMPAT \
BOOTENV
#endif /* _SUNXI_COMMON_CONFIG_H */
--
2.34.1
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH 2/6] sunxi: Add a bootmeth for FEL
2024-08-07 20:50 [PATCH 0/6] bootstd: sunxi: Migrate to standard boot Simon Glass
2024-08-07 20:50 ` [PATCH 1/6] sunxi: Drop BOOTCMD_SUNXI_COMPAT Simon Glass
@ 2024-08-07 20:50 ` Simon Glass
2024-08-13 12:32 ` Mattijs Korpershoek
2024-08-07 20:50 ` [PATCH 3/6] sunxi: Move to bootstd Simon Glass
` (4 subsequent siblings)
6 siblings, 1 reply; 12+ messages in thread
From: Simon Glass @ 2024-08-07 20:50 UTC (permalink / raw)
To: U-Boot Mailing List
Cc: Tom Rini, Jagan Teki, Andre Przywara, Simon Glass,
AKASHI Takahiro, Eddie James, Heinrich Schuchardt,
Ilias Apalodimas, Julien Masson, Mattijs Korpershoek
Add support for booting from a script loaded over FEL. This mirrors the
bootcmd_fel provided by distro boot.
Signed-off-by: Simon Glass <sjg@chromium.org>
---
boot/Kconfig | 14 ++++++++
boot/Makefile | 1 +
boot/bootmeth_fel.c | 81 +++++++++++++++++++++++++++++++++++++++++++++
3 files changed, 96 insertions(+)
create mode 100644 boot/bootmeth_fel.c
diff --git a/boot/Kconfig b/boot/Kconfig
index 940389d4882..77f6382ab2a 100644
--- a/boot/Kconfig
+++ b/boot/Kconfig
@@ -585,6 +585,20 @@ config BOOTMETH_EFI_BOOTMGR
the EFI binary to be launched is determined. To set the EFI variables
use the eficonfig command.
+config BOOTMETH_FEL
+ bool "Bootdev support for Sunxi FEL"
+ depends on ARCH_SUNXI
+ default y
+ help
+ Enables support for booting over USB on a Sunxi device. This uses
+ the FEL protocol and obtains the script address from the
+ 'fel_scriptaddr' environment variable.
+
+ This method is only available if booting from FEL, i.e. the
+ 'fel_booted' environment variable is set.
+
+ See https://linux-sunxi.org/FEL/Protocol for more information.
+
config BOOTMETH_QFW
bool "Boot method using QEMU parameters"
depends on QFW
diff --git a/boot/Makefile b/boot/Makefile
index dff6f99081a..4a23fcdbfad 100644
--- a/boot/Makefile
+++ b/boot/Makefile
@@ -30,6 +30,7 @@ obj-$(CONFIG_$(SPL_TPL_)BOOTMETH_EXTLINUX) += bootmeth_extlinux.o
obj-$(CONFIG_$(SPL_TPL_)BOOTMETH_EXTLINUX_PXE) += bootmeth_pxe.o
obj-$(CONFIG_$(SPL_TPL_)BOOTMETH_EFILOADER) += bootmeth_efi.o
obj-$(CONFIG_$(SPL_TPL_)BOOTMETH_CROS) += bootm.o bootm_os.o bootmeth_cros.o
+obj-$(CONFIG_$(SPL_TPL_)BOOTMETH_FEL) += bootmeth_fel.o
obj-$(CONFIG_$(SPL_TPL_)BOOTMETH_QFW) += bootmeth_qfw.o
obj-$(CONFIG_$(SPL_TPL_)BOOTMETH_SANDBOX) += bootmeth_sandbox.o
obj-$(CONFIG_$(SPL_TPL_)BOOTMETH_SCRIPT) += bootmeth_script.o
diff --git a/boot/bootmeth_fel.c b/boot/bootmeth_fel.c
new file mode 100644
index 00000000000..ccca68c1cd6
--- /dev/null
+++ b/boot/bootmeth_fel.c
@@ -0,0 +1,81 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Bootmethod for sunxi FEL loading
+ *
+ * Copyright 2024 Google LLC
+ * Written by Simon Glass <sjg@chromium.org>
+ */
+
+#define LOG_CATEGORY UCLASS_BOOTSTD
+
+#include <bootdev.h>
+#include <bootflow.h>
+#include <bootmeth.h>
+#include <command.h>
+#include <dm.h>
+#include <env.h>
+
+static int fel_check(struct udevice *dev, struct bootflow_iter *iter)
+{
+ return 0;
+}
+
+static int fel_read_bootflow(struct udevice *dev, struct bootflow *bflow)
+{
+ if (!env_get("fel_booted") || !env_get("fel_scriptaddr"))
+ return -ENOENT;
+
+ bflow->state = BOOTFLOWST_READY;
+
+ return 0;
+}
+
+static int fel_read_file(struct udevice *dev, struct bootflow *bflow,
+ const char *file_path, ulong addr, ulong *sizep)
+{
+ return -ENOSYS;
+}
+
+static int fel_boot(struct udevice *dev, struct bootflow *bflow)
+{
+ ulong addr;
+ int ret;
+
+ addr = env_get_hex("fel_scriptaddr", 0);
+ ret = cmd_source_script(addr, NULL, NULL);
+ if (ret)
+ return log_msg_ret("boot", ret);
+
+ return 0;
+}
+
+static int fel_bootmeth_bind(struct udevice *dev)
+{
+ struct bootmeth_uc_plat *plat = dev_get_uclass_plat(dev);
+
+ plat->desc = IS_ENABLED(CONFIG_BOOTSTD_FULL) ?
+ "Sunxi FEL boot over USB" : "FEL";
+ plat->flags = BOOTMETHF_GLOBAL;
+
+ return 0;
+}
+
+static struct bootmeth_ops fel_bootmeth_ops = {
+ .check = fel_check,
+ .read_bootflow = fel_read_bootflow,
+ .read_file = fel_read_file,
+ .boot = fel_boot,
+};
+
+static const struct udevice_id fel_bootmeth_ids[] = {
+ { .compatible = "u-boot,fel-bootmeth" },
+ { }
+};
+
+U_BOOT_DRIVER(bootmeth_fel) = {
+ .name = "bootmeth_fel",
+ .id = UCLASS_BOOTMETH,
+ .of_match = fel_bootmeth_ids,
+ .ops = &fel_bootmeth_ops,
+ .bind = fel_bootmeth_bind,
+};
--
2.34.1
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH 3/6] sunxi: Move to bootstd
2024-08-07 20:50 [PATCH 0/6] bootstd: sunxi: Migrate to standard boot Simon Glass
2024-08-07 20:50 ` [PATCH 1/6] sunxi: Drop BOOTCMD_SUNXI_COMPAT Simon Glass
2024-08-07 20:50 ` [PATCH 2/6] sunxi: Add a bootmeth for FEL Simon Glass
@ 2024-08-07 20:50 ` Simon Glass
2024-08-07 20:50 ` [PATCH 4/6] sunxi: Drop old distro boot variables Simon Glass
` (3 subsequent siblings)
6 siblings, 0 replies; 12+ messages in thread
From: Simon Glass @ 2024-08-07 20:50 UTC (permalink / raw)
To: U-Boot Mailing List
Cc: Tom Rini, Jagan Teki, Andre Przywara, Simon Glass,
Alper Nebi Yasak, Andrew Davis, Caleb Connolly,
Csókás Bence, Marek Vasut, Michal Simek, Peter Robinson,
Rayagonda Kokatanur, Sumit Garg, Venkatesh Yadav Abbarapu
Drop support for distroboot and move to using bootstd instead.
Signed-off-by: Simon Glass <sjg@chromium.org>
---
arch/arm/Kconfig | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index ba0359fed5a..5fb14cb23c0 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -1179,7 +1179,7 @@ config ARCH_SUNXI
imply CMD_DM
imply CMD_GPT
imply CMD_UBI if MTD_RAW_NAND
- imply DISTRO_DEFAULTS
+ imply BOOTSTD_DEFAULTS
imply DM_REGULATOR
imply DM_REGULATOR_FIXED
imply FAT_WRITE
--
2.34.1
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH 4/6] sunxi: Drop old distro boot variables
2024-08-07 20:50 [PATCH 0/6] bootstd: sunxi: Migrate to standard boot Simon Glass
` (2 preceding siblings ...)
2024-08-07 20:50 ` [PATCH 3/6] sunxi: Move to bootstd Simon Glass
@ 2024-08-07 20:50 ` Simon Glass
2024-08-07 20:50 ` [PATCH 5/6] env: Provide a work-around for unquoting fdtfile Simon Glass
` (2 subsequent siblings)
6 siblings, 0 replies; 12+ messages in thread
From: Simon Glass @ 2024-08-07 20:50 UTC (permalink / raw)
To: U-Boot Mailing List; +Cc: Tom Rini, Jagan Teki, Andre Przywara, Simon Glass
These are not needed as bootstd handles the boot now. Drop them.
Signed-off-by: Simon Glass <sjg@chromium.org>
---
include/configs/sunxi-common.h | 75 +---------------------------------
1 file changed, 1 insertion(+), 74 deletions(-)
diff --git a/include/configs/sunxi-common.h b/include/configs/sunxi-common.h
index 6ae6ef1b19c..ac868ebe1d4 100644
--- a/include/configs/sunxi-common.h
+++ b/include/configs/sunxi-common.h
@@ -156,78 +156,6 @@
"fdt ram " FDT_ADDR_R " 0x100000;" \
"ramdisk ram " RAMDISK_ADDR_R " 0x4000000\0"
-/****************************************************************************
- * definitions for the distro boot system *
- ****************************************************************************/
-#ifdef CONFIG_MMC
-#if CONFIG_MMC_SUNXI_SLOT_EXTRA != -1
-#define BOOTENV_DEV_MMC_AUTO(devtypeu, devtypel, instance) \
- BOOTENV_DEV_MMC(MMC, mmc, 0) \
- BOOTENV_DEV_MMC(MMC, mmc, 1) \
- "bootcmd_mmc_auto=" \
- "if test ${mmc_bootdev} -eq 1; then " \
- "run bootcmd_mmc1; " \
- "run bootcmd_mmc0; " \
- "elif test ${mmc_bootdev} -eq 0; then " \
- "run bootcmd_mmc0; " \
- "run bootcmd_mmc1; " \
- "fi\0"
-
-#define BOOTENV_DEV_NAME_MMC_AUTO(devtypeu, devtypel, instance) \
- "mmc_auto "
-
-#define BOOT_TARGET_DEVICES_MMC(func) func(MMC_AUTO, mmc_auto, na)
-#else
-#define BOOT_TARGET_DEVICES_MMC(func) func(MMC, mmc, 0)
-#endif
-#else
-#define BOOT_TARGET_DEVICES_MMC(func)
-#endif
-
-#ifdef CONFIG_AHCI
-#define BOOT_TARGET_DEVICES_SCSI(func) func(SCSI, scsi, 0)
-#else
-#define BOOT_TARGET_DEVICES_SCSI(func)
-#endif
-
-#ifdef CONFIG_USB_STORAGE
-#define BOOT_TARGET_DEVICES_USB(func) func(USB, usb, 0)
-#else
-#define BOOT_TARGET_DEVICES_USB(func)
-#endif
-
-#ifdef CONFIG_CMD_PXE
-#define BOOT_TARGET_DEVICES_PXE(func) func(PXE, pxe, na)
-#else
-#define BOOT_TARGET_DEVICES_PXE(func)
-#endif
-
-#ifdef CONFIG_CMD_DHCP
-#define BOOT_TARGET_DEVICES_DHCP(func) func(DHCP, dhcp, na)
-#else
-#define BOOT_TARGET_DEVICES_DHCP(func)
-#endif
-
-/* FEL boot support, auto-execute boot.scr if a script address was provided */
-#define BOOTENV_DEV_FEL(devtypeu, devtypel, instance) \
- "bootcmd_fel=" \
- "if test -n ${fel_booted} && test -n ${fel_scriptaddr}; then " \
- "echo '(FEL boot)'; " \
- "source ${fel_scriptaddr}; " \
- "fi\0"
-#define BOOTENV_DEV_NAME_FEL(devtypeu, devtypel, instance) \
- "fel "
-
-#define BOOT_TARGET_DEVICES(func) \
- func(FEL, fel, na) \
- BOOT_TARGET_DEVICES_MMC(func) \
- BOOT_TARGET_DEVICES_SCSI(func) \
- BOOT_TARGET_DEVICES_USB(func) \
- BOOT_TARGET_DEVICES_PXE(func) \
- BOOT_TARGET_DEVICES_DHCP(func)
-
-#include <config_distro_bootcmd.h>
-
#ifdef CONFIG_USB_KEYBOARD
#define CONSOLE_STDIN_SETTINGS \
"stdin=serial,usbkbd\0"
@@ -279,7 +207,6 @@
"console=ttyS0,115200\0" \
"uuid_gpt_esp=" UUID_GPT_ESP "\0" \
"uuid_gpt_system=" UUID_GPT_SYSTEM "\0" \
- "partitions=" PARTS_DEFAULT "\0" \
- BOOTENV
+ "partitions=" PARTS_DEFAULT "\0"
#endif /* _SUNXI_COMMON_CONFIG_H */
--
2.34.1
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH 5/6] env: Provide a work-around for unquoting fdtfile
2024-08-07 20:50 [PATCH 0/6] bootstd: sunxi: Migrate to standard boot Simon Glass
` (3 preceding siblings ...)
2024-08-07 20:50 ` [PATCH 4/6] sunxi: Drop old distro boot variables Simon Glass
@ 2024-08-07 20:50 ` Simon Glass
2024-08-07 20:50 ` [PATCH 6/6] sunxi: Move to text environment Simon Glass
2024-08-12 15:59 ` [PATCH 0/6] bootstd: sunxi: Migrate to standard boot Andre Przywara
6 siblings, 0 replies; 12+ messages in thread
From: Simon Glass @ 2024-08-07 20:50 UTC (permalink / raw)
To: U-Boot Mailing List
Cc: Tom Rini, Jagan Teki, Andre Przywara, Simon Glass, Andrew Davis,
Andy Shevchenko, Bin Meng, Bryan Brattlof, Caleb Connolly,
Heinrich Schuchardt, Janne Grunau, Jesse Taube, Joe Hershberger,
Leon M. Busch-George, Marek Vasut, Mattijs Korpershoek,
Michal Simek, Rasmus Villemoes, Sumit Garg
Some boards use a CONFIG option to specify the value of this variable.
This is normally handled by efi_get_distro_fdt_name() but in the case
of sunxi this does not work, since 'soc' is sunxi, but the files are
in the allwinner directory.
Provide a work-around for this particular case.
Signed-off-by: Simon Glass <sjg@chromium.org>
---
Makefile | 1 +
doc/usage/environment.rst | 12 ++++++++++++
2 files changed, 13 insertions(+)
diff --git a/Makefile b/Makefile
index 2861b4d1402..8ea3308160f 100644
--- a/Makefile
+++ b/Makefile
@@ -1842,6 +1842,7 @@ quiet_cmd_gen_envp = ENVP $@
$(CPP) -P $(CFLAGS) -x assembler-with-cpp -undef \
-D__ASSEMBLY__ \
-D__UBOOT_CONFIG__ \
+ -DDEFAULT_DEVICE_TREE=$(subst ",,$(CONFIG_DEFAULT_DEVICE_TREE)) \
-I . -I include -I $(srctree)/include \
-include linux/kconfig.h -include include/config.h \
-I$(srctree)/arch/$(ARCH)/include \
diff --git a/doc/usage/environment.rst b/doc/usage/environment.rst
index cc33d3ec0f2..eaebf61742a 100644
--- a/doc/usage/environment.rst
+++ b/doc/usage/environment.rst
@@ -87,6 +87,18 @@ settings. For example::
#include <env/ti/mmc.env>
+Quotes are not supressed, for example::
+
+ fdtfile=CONFIG_DEFAULT_DEVICE_TREE.dtb
+ # produces: fdtfile="sun7i-a20-pcduino3.dtb"
+
+For this particular issue you can use DEFAULT_DEVICE_TREE instead::
+
+ fdtfile=DEFAULT_DEVICE_TREE.dtb
+ # produces: fdtfile=sun7i-a20-pcduino3.dtb
+
+There is no general way to remove quotes.
+
If CONFIG_ENV_SOURCE_FILE is empty and the default filename is not present, then
the old-style C environment is used instead. See below.
--
2.34.1
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH 6/6] sunxi: Move to text environment
2024-08-07 20:50 [PATCH 0/6] bootstd: sunxi: Migrate to standard boot Simon Glass
` (4 preceding siblings ...)
2024-08-07 20:50 ` [PATCH 5/6] env: Provide a work-around for unquoting fdtfile Simon Glass
@ 2024-08-07 20:50 ` Simon Glass
2024-08-12 15:59 ` [PATCH 0/6] bootstd: sunxi: Migrate to standard boot Andre Przywara
6 siblings, 0 replies; 12+ messages in thread
From: Simon Glass @ 2024-08-07 20:50 UTC (permalink / raw)
To: U-Boot Mailing List
Cc: Tom Rini, Jagan Teki, Andre Przywara, Simon Glass, Hans de Goede
Convert these boards to use a text environment.
For the boards check, the only differences are extra spaces after the
semicolons in 'dfu_alt_info_ram' and 'partitions', both of which are
permitted.
Signed-off-by: Simon Glass <sjg@chromium.org>
---
board/sunxi/sunxi.env | 138 ++++++++++++++++++++++++++++++
include/configs/sunxi-common.h | 148 ---------------------------------
2 files changed, 138 insertions(+), 148 deletions(-)
create mode 100644 board/sunxi/sunxi.env
diff --git a/board/sunxi/sunxi.env b/board/sunxi/sunxi.env
new file mode 100644
index 00000000000..9be21bee086
--- /dev/null
+++ b/board/sunxi/sunxi.env
@@ -0,0 +1,138 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Common sunxi environment
+ *
+ * Copyright 2024 Google LLC
+ * Written by Simon Glass <sjg@chromium.org>
+ /
+
+/****************************************************************************
+ * environment variables holding default load addresses *
+ ****************************************************************************/
+/*
+ * We cannot use expressions here, because expressions won't be evaluated in
+ * autoconf.mk.
+ */
+#ifdef CONFIG_ARM64
+/*
+ * Boards seem to come with at least 512MB of DRAM.
+ * The kernel should go at 512K, which is the default text offset (that will
+ * be adjusted at runtime if needed).
+ * There is no compression for arm64 kernels (yet), so leave some space
+ * for really big kernels, say 256MB for now.
+ * Scripts, PXE and DTBs should go afterwards, leaving the rest for the initrd.
+ */
+#define BOOTM_SIZE 0xa000000
+#define KERNEL_ADDR_R SDRAM_OFFSET(0080000)
+#define KERNEL_COMP_ADDR_R SDRAM_OFFSET(4000000)
+#define KERNEL_COMP_SIZE 0xb000000
+#define FDT_ADDR_R SDRAM_OFFSET(FA00000)
+#define SCRIPT_ADDR_R SDRAM_OFFSET(FC00000)
+#define PXEFILE_ADDR_R SDRAM_OFFSET(FD00000)
+#define FDTOVERLAY_ADDR_R SDRAM_OFFSET(FE00000)
+#define RAMDISK_ADDR_R SDRAM_OFFSET(FF00000)
+
+#elif (CONFIG_SUNXI_MINIMUM_DRAM_MB >= 256)
+/*
+ * 160M RAM (256M minimum minus 64MB heap + 32MB for u-boot, stack, fb, etc.
+ * 32M uncompressed kernel, 16M compressed kernel, 1M fdt,
+ * 1M script, 1M pxe, 1M dt overlay and the ramdisk at the end.
+ */
+#define BOOTM_SIZE 0xa000000
+#define KERNEL_ADDR_R SDRAM_OFFSET(2000000)
+#define FDT_ADDR_R SDRAM_OFFSET(3000000)
+#define SCRIPT_ADDR_R SDRAM_OFFSET(3100000)
+#define PXEFILE_ADDR_R SDRAM_OFFSET(3200000)
+#define FDTOVERLAY_ADDR_R SDRAM_OFFSET(3300000)
+#define RAMDISK_ADDR_R SDRAM_OFFSET(3400000)
+
+#elif (CONFIG_SUNXI_MINIMUM_DRAM_MB >= 64)
+/*
+ * 64M RAM minus 2MB heap + 16MB for u-boot, stack, fb, etc.
+ * 16M uncompressed kernel, 8M compressed kernel, 1M fdt,
+ * 1M script, 1M pxe, 1M dt overlay and the ramdisk at the end.
+ */
+#define BOOTM_SIZE 0x2e00000
+#define KERNEL_ADDR_R SDRAM_OFFSET(1000000)
+#define FDT_ADDR_R SDRAM_OFFSET(1800000)
+#define SCRIPT_ADDR_R SDRAM_OFFSET(1900000)
+#define PXEFILE_ADDR_R SDRAM_OFFSET(1A00000)
+#define FDTOVERLAY_ADDR_R SDRAM_OFFSET(1B00000)
+#define RAMDISK_ADDR_R SDRAM_OFFSET(1C00000)
+
+#elif (CONFIG_SUNXI_MINIMUM_DRAM_MB >= 32)
+/*
+ * 32M RAM minus 2.5MB for u-boot, heap, stack, etc.
+ * 16M uncompressed kernel, 7M compressed kernel, 128K fdt, 64K script,
+ * 128K DT overlay, 128K PXE and the ramdisk in the rest (max. 5MB)
+ */
+#define BOOTM_SIZE 0x1700000
+#define KERNEL_ADDR_R SDRAM_OFFSET(1000000)
+#define FDT_ADDR_R SDRAM_OFFSET(1d50000)
+#define SCRIPT_ADDR_R SDRAM_OFFSET(1d40000)
+#define PXEFILE_ADDR_R SDRAM_OFFSET(1d00000)
+#define FDTOVERLAY_ADDR_R SDRAM_OFFSET(1d20000)
+#define RAMDISK_ADDR_R SDRAM_OFFSET(1800000)
+
+#else
+#error Need at least 32MB of DRAM. Please adjust load addresses.
+#endif
+
+#define UUID_GPT_ESP ""
+
+#ifdef CONFIG_ARM64
+#define UUID_GPT_SYSTEM b921b045-1df0-41c3-af44-4c6f280d3fae
+#else
+#define UUID_GPT_SYSTEM 69dad710-2ce4-4e3c-b16c-21a1d49abed3
+#endif
+
+stdin=serial
+#ifdef CONFIG_USB_KEYBOARD
+stdin+=,usbkbd
+#endif
+
+stdout=serial
+stderr=serial
+#ifdef CONFIG_VIDEO
+stdout+=,vidconsole
+stderr+=,vidconsole
+#endif
+
+bootm_size=BOOTM_SIZE
+kernel_addr_r=KERNEL_ADDR_R
+fdt_addr_r=FDT_ADDR_R
+scriptaddr=SCRIPT_ADDR_R
+pxefile_addr_r=PXEFILE_ADDR_R
+fdtoverlay_addr_r=FDTOVERLAY_ADDR_R
+ramdisk_addr_r=RAMDISK_ADDR_R
+
+#ifdef CONFIG_ARM64
+kernel_comp_addr_r=KERNEL_COMP_ADDR_R
+kernel_comp_size=KERNEL_COMP_SIZE
+#endif
+
+dfu_alt_info_ram=
+ kernel ram KERNEL_ADDR_R 0x1000000;
+ fdt ram FDT_ADDR_R 0x100000;
+ ramdisk ram RAMDISK_ADDR_R 0x4000000
+
+#ifdef CONFIG_ARM64
+fdtfile=allwinner/DEFAULT_DEVICE_TREE.dtb
+#else
+fdtfile=DEFAULT_DEVICE_TREE.dtb
+#endif
+
+console=ttyS0,115200
+
+uuid_gpt_esp=c12a7328-f81f-11d2-ba4b-00a0c93ec93b
+#ifdef CONFIG_ARM64
+uuid_gpt_system=b921b045-1df0-41c3-af44-4c6f280d3fae
+#else
+uuid_gpt_system=69dad710-2ce4-4e3c-b16c-21a1d49abed3
+#endif
+
+partitions=
+ name=loader1,start=8k,size=32k,uuid=${uuid_gpt_loader1};
+ name=loader2,size=984k,uuid=${uuid_gpt_loader2};
+ name=esp,size=128M,bootable,uuid=${uuid_gpt_esp};
+ name=system,size=-,uuid=${uuid_gpt_system};
diff --git a/include/configs/sunxi-common.h b/include/configs/sunxi-common.h
index ac868ebe1d4..ceea26494ad 100644
--- a/include/configs/sunxi-common.h
+++ b/include/configs/sunxi-common.h
@@ -61,152 +61,4 @@
#define PHYS_SDRAM_0 CFG_SYS_SDRAM_BASE
#define PHYS_SDRAM_0_SIZE 0x80000000 /* 2 GiB */
-/****************************************************************************
- * environment variables holding default load addresses *
- ****************************************************************************/
-/*
- * We cannot use expressions here, because expressions won't be evaluated in
- * autoconf.mk.
- */
-#ifdef CONFIG_ARM64
-/*
- * Boards seem to come with at least 512MB of DRAM.
- * The kernel should go at 512K, which is the default text offset (that will
- * be adjusted at runtime if needed).
- * There is no compression for arm64 kernels (yet), so leave some space
- * for really big kernels, say 256MB for now.
- * Scripts, PXE and DTBs should go afterwards, leaving the rest for the initrd.
- */
-#define BOOTM_SIZE __stringify(0xa000000)
-#define KERNEL_ADDR_R __stringify(SDRAM_OFFSET(0080000))
-#define KERNEL_COMP_ADDR_R __stringify(SDRAM_OFFSET(4000000))
-#define KERNEL_COMP_SIZE __stringify(0xb000000)
-#define FDT_ADDR_R __stringify(SDRAM_OFFSET(FA00000))
-#define SCRIPT_ADDR_R __stringify(SDRAM_OFFSET(FC00000))
-#define PXEFILE_ADDR_R __stringify(SDRAM_OFFSET(FD00000))
-#define FDTOVERLAY_ADDR_R __stringify(SDRAM_OFFSET(FE00000))
-#define RAMDISK_ADDR_R __stringify(SDRAM_OFFSET(FF00000))
-
-#elif (CONFIG_SUNXI_MINIMUM_DRAM_MB >= 256)
-/*
- * 160M RAM (256M minimum minus 64MB heap + 32MB for u-boot, stack, fb, etc.
- * 32M uncompressed kernel, 16M compressed kernel, 1M fdt,
- * 1M script, 1M pxe, 1M dt overlay and the ramdisk at the end.
- */
-#define BOOTM_SIZE __stringify(0xa000000)
-#define KERNEL_ADDR_R __stringify(SDRAM_OFFSET(2000000))
-#define FDT_ADDR_R __stringify(SDRAM_OFFSET(3000000))
-#define SCRIPT_ADDR_R __stringify(SDRAM_OFFSET(3100000))
-#define PXEFILE_ADDR_R __stringify(SDRAM_OFFSET(3200000))
-#define FDTOVERLAY_ADDR_R __stringify(SDRAM_OFFSET(3300000))
-#define RAMDISK_ADDR_R __stringify(SDRAM_OFFSET(3400000))
-
-#elif (CONFIG_SUNXI_MINIMUM_DRAM_MB >= 64)
-/*
- * 64M RAM minus 2MB heap + 16MB for u-boot, stack, fb, etc.
- * 16M uncompressed kernel, 8M compressed kernel, 1M fdt,
- * 1M script, 1M pxe, 1M dt overlay and the ramdisk at the end.
- */
-#define BOOTM_SIZE __stringify(0x2e00000)
-#define KERNEL_ADDR_R __stringify(SDRAM_OFFSET(1000000))
-#define FDT_ADDR_R __stringify(SDRAM_OFFSET(1800000))
-#define SCRIPT_ADDR_R __stringify(SDRAM_OFFSET(1900000))
-#define PXEFILE_ADDR_R __stringify(SDRAM_OFFSET(1A00000))
-#define FDTOVERLAY_ADDR_R __stringify(SDRAM_OFFSET(1B00000))
-#define RAMDISK_ADDR_R __stringify(SDRAM_OFFSET(1C00000))
-
-#elif (CONFIG_SUNXI_MINIMUM_DRAM_MB >= 32)
-/*
- * 32M RAM minus 2.5MB for u-boot, heap, stack, etc.
- * 16M uncompressed kernel, 7M compressed kernel, 128K fdt, 64K script,
- * 128K DT overlay, 128K PXE and the ramdisk in the rest (max. 5MB)
- */
-#define BOOTM_SIZE __stringify(0x1700000)
-#define KERNEL_ADDR_R __stringify(SDRAM_OFFSET(1000000))
-#define FDT_ADDR_R __stringify(SDRAM_OFFSET(1d50000))
-#define SCRIPT_ADDR_R __stringify(SDRAM_OFFSET(1d40000))
-#define PXEFILE_ADDR_R __stringify(SDRAM_OFFSET(1d00000))
-#define FDTOVERLAY_ADDR_R __stringify(SDRAM_OFFSET(1d20000))
-#define RAMDISK_ADDR_R __stringify(SDRAM_OFFSET(1800000))
-
-#else
-#error Need at least 32MB of DRAM. Please adjust load addresses.
-#endif
-
-#define MEM_LAYOUT_ENV_SETTINGS \
- "bootm_size=" BOOTM_SIZE "\0" \
- "kernel_addr_r=" KERNEL_ADDR_R "\0" \
- "fdt_addr_r=" FDT_ADDR_R "\0" \
- "scriptaddr=" SCRIPT_ADDR_R "\0" \
- "pxefile_addr_r=" PXEFILE_ADDR_R "\0" \
- "fdtoverlay_addr_r=" FDTOVERLAY_ADDR_R "\0" \
- "ramdisk_addr_r=" RAMDISK_ADDR_R "\0"
-
-#ifdef CONFIG_ARM64
-#define MEM_LAYOUT_ENV_EXTRA_SETTINGS \
- "kernel_comp_addr_r=" KERNEL_COMP_ADDR_R "\0" \
- "kernel_comp_size=" KERNEL_COMP_SIZE "\0"
-#else
-#define MEM_LAYOUT_ENV_EXTRA_SETTINGS ""
-#endif
-
-#define DFU_ALT_INFO_RAM \
- "dfu_alt_info_ram=" \
- "kernel ram " KERNEL_ADDR_R " 0x1000000;" \
- "fdt ram " FDT_ADDR_R " 0x100000;" \
- "ramdisk ram " RAMDISK_ADDR_R " 0x4000000\0"
-
-#ifdef CONFIG_USB_KEYBOARD
-#define CONSOLE_STDIN_SETTINGS \
- "stdin=serial,usbkbd\0"
-#else
-#define CONSOLE_STDIN_SETTINGS \
- "stdin=serial\0"
-#endif
-
-#ifdef CONFIG_VIDEO
-#define CONSOLE_STDOUT_SETTINGS \
- "stdout=serial,vidconsole\0" \
- "stderr=serial,vidconsole\0"
-#else
-#define CONSOLE_STDOUT_SETTINGS \
- "stdout=serial\0" \
- "stderr=serial\0"
-#endif
-
-#define PARTS_DEFAULT \
- "name=loader1,start=8k,size=32k,uuid=${uuid_gpt_loader1};" \
- "name=loader2,size=984k,uuid=${uuid_gpt_loader2};" \
- "name=esp,size=128M,bootable,uuid=${uuid_gpt_esp};" \
- "name=system,size=-,uuid=${uuid_gpt_system};"
-
-#define UUID_GPT_ESP "c12a7328-f81f-11d2-ba4b-00a0c93ec93b"
-
-#ifdef CONFIG_ARM64
-#define UUID_GPT_SYSTEM "b921b045-1df0-41c3-af44-4c6f280d3fae"
-#else
-#define UUID_GPT_SYSTEM "69dad710-2ce4-4e3c-b16c-21a1d49abed3"
-#endif
-
-#define CONSOLE_ENV_SETTINGS \
- CONSOLE_STDIN_SETTINGS \
- CONSOLE_STDOUT_SETTINGS
-
-#ifdef CONFIG_ARM64
-#define FDTFILE "allwinner/" CONFIG_DEFAULT_DEVICE_TREE ".dtb"
-#else
-#define FDTFILE CONFIG_DEFAULT_DEVICE_TREE ".dtb"
-#endif
-
-#define CFG_EXTRA_ENV_SETTINGS \
- CONSOLE_ENV_SETTINGS \
- MEM_LAYOUT_ENV_SETTINGS \
- MEM_LAYOUT_ENV_EXTRA_SETTINGS \
- DFU_ALT_INFO_RAM \
- "fdtfile=" FDTFILE "\0" \
- "console=ttyS0,115200\0" \
- "uuid_gpt_esp=" UUID_GPT_ESP "\0" \
- "uuid_gpt_system=" UUID_GPT_SYSTEM "\0" \
- "partitions=" PARTS_DEFAULT "\0"
-
#endif /* _SUNXI_COMMON_CONFIG_H */
--
2.34.1
^ permalink raw reply related [flat|nested] 12+ messages in thread
* Re: [PATCH 0/6] bootstd: sunxi: Migrate to standard boot
2024-08-07 20:50 [PATCH 0/6] bootstd: sunxi: Migrate to standard boot Simon Glass
` (5 preceding siblings ...)
2024-08-07 20:50 ` [PATCH 6/6] sunxi: Move to text environment Simon Glass
@ 2024-08-12 15:59 ` Andre Przywara
2024-08-13 12:17 ` Simon Glass
6 siblings, 1 reply; 12+ messages in thread
From: Andre Przywara @ 2024-08-12 15:59 UTC (permalink / raw)
To: Simon Glass
Cc: U-Boot Mailing List, Tom Rini, Jagan Teki, AKASHI Takahiro,
Alper Nebi Yasak, Andrew Davis, Andy Shevchenko, Bin Meng,
Bryan Brattlof, Caleb Connolly, Csókás Bence,
Eddie James, Hans de Goede, Heinrich Schuchardt, Ilias Apalodimas,
Janne Grunau, Jernej Skrabec, Jesse Taube, Joe Hershberger,
Julien Masson, Leon M. Busch-George, Maksim Kiselev, Marek Vasut,
Marek Vasut, Mattijs Korpershoek, Michael Walle, Michal Simek,
Mikhail Kalashnikov, Peter Robinson, Rasmus Villemoes,
Rayagonda Kokatanur, Sam Edwards, Samuel Holland, Stefan Roese,
Sumit Garg, Venkatesh Yadav Abbarapu
On Wed, 7 Aug 2024 14:50:26 -0600
Simon Glass <sjg@chromium.org> wrote:
Hey Simon,
> This series attempts to migrate all sunxi boards to use standard boot,
> along with a text environment.
Ah, many thanks for that! I figured that we need a bootmeth for FEL, but
never got around to have a closer look.
On a coarse glance, this looks roughly OK, and doing a super quick boot
test on one board, it seems to still work(TM), though the priority of the
FEL boot is not right?
And I guess ditching the old kernel support might be a bit controversial.
I think this is about the vendor kernels, which some people still rely on?
I will have a closer look this week and give you a review, just wanted to
acknowledge the series and thank you for your efforts.
Cheers,
Andre
> Simon Glass (6):
> sunxi: Drop BOOTCMD_SUNXI_COMPAT
> sunxi: Add a bootmeth for FEL
> sunxi: Move to bootstd
> sunxi: Drop old distro boot variables
> env: Provide a work-around for unquoting fdtfile
> sunxi: Move to text environment
>
> Makefile | 1 +
> arch/arm/Kconfig | 2 +-
> arch/arm/include/asm/arch-sunxi/clock_sun4i.h | 10 -
> arch/arm/mach-sunxi/Kconfig | 12 -
> arch/arm/mach-sunxi/dram_sun4i.c | 4 -
> board/sunxi/sunxi.env | 138 ++++++++++
> boot/Kconfig | 14 ++
> boot/Makefile | 1 +
> boot/bootmeth_fel.c | 81 ++++++
> configs/icnova-a20-swac_defconfig | 1 -
> doc/usage/environment.rst | 12 +
> include/configs/sunxi-common.h | 238 ------------------
> 12 files changed, 248 insertions(+), 266 deletions(-)
> create mode 100644 board/sunxi/sunxi.env
> create mode 100644 boot/bootmeth_fel.c
>
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 0/6] bootstd: sunxi: Migrate to standard boot
2024-08-12 15:59 ` [PATCH 0/6] bootstd: sunxi: Migrate to standard boot Andre Przywara
@ 2024-08-13 12:17 ` Simon Glass
2024-08-13 12:35 ` Andre Przywara
0 siblings, 1 reply; 12+ messages in thread
From: Simon Glass @ 2024-08-13 12:17 UTC (permalink / raw)
To: Andre Przywara
Cc: U-Boot Mailing List, Tom Rini, Jagan Teki, AKASHI Takahiro,
Alper Nebi Yasak, Andrew Davis, Andy Shevchenko, Bin Meng,
Bryan Brattlof, Caleb Connolly, Csókás Bence,
Eddie James, Hans de Goede, Heinrich Schuchardt, Ilias Apalodimas,
Janne Grunau, Jernej Skrabec, Jesse Taube, Joe Hershberger,
Julien Masson, Leon M. Busch-George, Maksim Kiselev, Marek Vasut,
Marek Vasut, Mattijs Korpershoek, Michael Walle, Michal Simek,
Mikhail Kalashnikov, Peter Robinson, Rasmus Villemoes,
Rayagonda Kokatanur, Sam Edwards, Samuel Holland, Stefan Roese,
Sumit Garg, Venkatesh Yadav Abbarapu
Hi Andre,
On Mon, 12 Aug 2024 at 10:00, Andre Przywara <andre.przywara@arm.com> wrote:
>
> On Wed, 7 Aug 2024 14:50:26 -0600
> Simon Glass <sjg@chromium.org> wrote:
>
> Hey Simon,
>
> > This series attempts to migrate all sunxi boards to use standard boot,
> > along with a text environment.
>
> Ah, many thanks for that! I figured that we need a bootmeth for FEL, but
> never got around to have a closer look.
> On a coarse glance, this looks roughly OK, and doing a super quick boot
> test on one board, it seems to still work(TM), though the priority of the
> FEL boot is not right?
Does it need to be the top priority, perhaps?
> And I guess ditching the old kernel support might be a bit controversial.
> I think this is about the vendor kernels, which some people still rely on?
OK, perhaps it is. It might be a little tricky to handle it, but I
suspect another bootmeth might be enough.
>
> I will have a closer look this week and give you a review, just wanted to
> acknowledge the series and thank you for your efforts.
OK thank you.
Regards,
Simon
>
> Cheers,
> Andre
>
> > Simon Glass (6):
> > sunxi: Drop BOOTCMD_SUNXI_COMPAT
> > sunxi: Add a bootmeth for FEL
> > sunxi: Move to bootstd
> > sunxi: Drop old distro boot variables
> > env: Provide a work-around for unquoting fdtfile
> > sunxi: Move to text environment
> >
> > Makefile | 1 +
> > arch/arm/Kconfig | 2 +-
> > arch/arm/include/asm/arch-sunxi/clock_sun4i.h | 10 -
> > arch/arm/mach-sunxi/Kconfig | 12 -
> > arch/arm/mach-sunxi/dram_sun4i.c | 4 -
> > board/sunxi/sunxi.env | 138 ++++++++++
> > boot/Kconfig | 14 ++
> > boot/Makefile | 1 +
> > boot/bootmeth_fel.c | 81 ++++++
> > configs/icnova-a20-swac_defconfig | 1 -
> > doc/usage/environment.rst | 12 +
> > include/configs/sunxi-common.h | 238 ------------------
> > 12 files changed, 248 insertions(+), 266 deletions(-)
> > create mode 100644 board/sunxi/sunxi.env
> > create mode 100644 boot/bootmeth_fel.c
> >
>
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 2/6] sunxi: Add a bootmeth for FEL
2024-08-07 20:50 ` [PATCH 2/6] sunxi: Add a bootmeth for FEL Simon Glass
@ 2024-08-13 12:32 ` Mattijs Korpershoek
0 siblings, 0 replies; 12+ messages in thread
From: Mattijs Korpershoek @ 2024-08-13 12:32 UTC (permalink / raw)
To: Simon Glass, U-Boot Mailing List
Cc: Tom Rini, Jagan Teki, Andre Przywara, Simon Glass,
AKASHI Takahiro, Eddie James, Heinrich Schuchardt,
Ilias Apalodimas, Julien Masson
Hi Simon,
Thank you for the patch.
On mer., août 07, 2024 at 14:50, Simon Glass <sjg@chromium.org> wrote:
> Add support for booting from a script loaded over FEL. This mirrors the
> bootcmd_fel provided by distro boot.
>
> Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
> ---
>
> boot/Kconfig | 14 ++++++++
> boot/Makefile | 1 +
> boot/bootmeth_fel.c | 81 +++++++++++++++++++++++++++++++++++++++++++++
> 3 files changed, 96 insertions(+)
> create mode 100644 boot/bootmeth_fel.c
>
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 0/6] bootstd: sunxi: Migrate to standard boot
2024-08-13 12:17 ` Simon Glass
@ 2024-08-13 12:35 ` Andre Przywara
2024-08-23 20:47 ` Simon Glass
0 siblings, 1 reply; 12+ messages in thread
From: Andre Przywara @ 2024-08-13 12:35 UTC (permalink / raw)
To: Simon Glass
Cc: U-Boot Mailing List, Tom Rini, Jagan Teki, AKASHI Takahiro,
Alper Nebi Yasak, Andrew Davis, Andy Shevchenko, Bin Meng,
Bryan Brattlof, Caleb Connolly, Csókás Bence,
Eddie James, Hans de Goede, Heinrich Schuchardt, Ilias Apalodimas,
Janne Grunau, Jernej Skrabec, Jesse Taube, Joe Hershberger,
Julien Masson, Leon M. Busch-George, Maksim Kiselev, Marek Vasut,
Marek Vasut, Mattijs Korpershoek, Michael Walle, Michal Simek,
Mikhail Kalashnikov, Peter Robinson, Rasmus Villemoes,
Rayagonda Kokatanur, Sam Edwards, Samuel Holland, Stefan Roese,
Sumit Garg, Venkatesh Yadav Abbarapu
On Tue, 13 Aug 2024 06:17:17 -0600
Simon Glass <sjg@chromium.org> wrote:
Hi Simon,
I had a bit deeper look yesterday.
> Hi Andre,
>
> On Mon, 12 Aug 2024 at 10:00, Andre Przywara <andre.przywara@arm.com> wrote:
> >
> > On Wed, 7 Aug 2024 14:50:26 -0600
> > Simon Glass <sjg@chromium.org> wrote:
> >
> > Hey Simon,
> >
> > > This series attempts to migrate all sunxi boards to use standard boot,
> > > along with a text environment.
> >
> > Ah, many thanks for that! I figured that we need a bootmeth for FEL, but
> > never got around to have a closer look.
> > On a coarse glance, this looks roughly OK, and doing a super quick boot
> > test on one board, it seems to still work(TM), though the priority of the
> > FEL boot is not right?
>
> Does it need to be the top priority, perhaps?
Yes, please. It should only trigger when you a) do FEL booting and b)
upload a boot script via FEL, in which case you surely want to execute
that before anything else. From what I see the global EFI bootmeth is first
in the list, but I couldn't find an easy way to fix this in the source
file. Would that go through a platform specific bootmeths env variable?
> > And I guess ditching the old kernel support might be a bit controversial.
> > I think this is about the vendor kernels, which some people still rely on?
>
> OK, perhaps it is. It might be a little tricky to handle it, but I
> suspect another bootmeth might be enough.
Well, I had a look, and it looks like CONFIG_OLD_SUNXI_KERNEL_COMPAT
covers multiple things:
- it sets up some clocks slightly differently
- it enters the kernel (stays?) in secure mode
- it provides a custom boot script
I think the latter can be replaced quite easily with something custom, and
I guess it's the only one biting you? So I am OK with that going, but I
think we should keep the first two features (and thus the Kconfig symbol).
Another thing I discovered: we lose USB support with patch 3/6. The reason
is that USB support is enabled by having DISTRO_DEFAULTS. Just replacing
that with BOOTSTD_DEFAULTS didn't work, though, I get a (ridiculous) splat
about a circular Kconfig dependency. My hunch is that's something else not
right in Kconfig, but I need to have a closer look.
Cheers,
Andre
>
> >
> > I will have a closer look this week and give you a review, just wanted to
> > acknowledge the series and thank you for your efforts.
>
> OK thank you.
>
> Regards,
> Simon
>
>
> >
> > Cheers,
> > Andre
> >
> > > Simon Glass (6):
> > > sunxi: Drop BOOTCMD_SUNXI_COMPAT
> > > sunxi: Add a bootmeth for FEL
> > > sunxi: Move to bootstd
> > > sunxi: Drop old distro boot variables
> > > env: Provide a work-around for unquoting fdtfile
> > > sunxi: Move to text environment
> > >
> > > Makefile | 1 +
> > > arch/arm/Kconfig | 2 +-
> > > arch/arm/include/asm/arch-sunxi/clock_sun4i.h | 10 -
> > > arch/arm/mach-sunxi/Kconfig | 12 -
> > > arch/arm/mach-sunxi/dram_sun4i.c | 4 -
> > > board/sunxi/sunxi.env | 138 ++++++++++
> > > boot/Kconfig | 14 ++
> > > boot/Makefile | 1 +
> > > boot/bootmeth_fel.c | 81 ++++++
> > > configs/icnova-a20-swac_defconfig | 1 -
> > > doc/usage/environment.rst | 12 +
> > > include/configs/sunxi-common.h | 238 ------------------
> > > 12 files changed, 248 insertions(+), 266 deletions(-)
> > > create mode 100644 board/sunxi/sunxi.env
> > > create mode 100644 boot/bootmeth_fel.c
> > >
> >
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 0/6] bootstd: sunxi: Migrate to standard boot
2024-08-13 12:35 ` Andre Przywara
@ 2024-08-23 20:47 ` Simon Glass
0 siblings, 0 replies; 12+ messages in thread
From: Simon Glass @ 2024-08-23 20:47 UTC (permalink / raw)
To: Andre Przywara
Cc: U-Boot Mailing List, Tom Rini, Jagan Teki, AKASHI Takahiro,
Alper Nebi Yasak, Andrew Davis, Andy Shevchenko, Bin Meng,
Bryan Brattlof, Caleb Connolly, Csókás Bence,
Eddie James, Hans de Goede, Heinrich Schuchardt, Ilias Apalodimas,
Janne Grunau, Jernej Skrabec, Jesse Taube, Joe Hershberger,
Julien Masson, Leon M. Busch-George, Maksim Kiselev, Marek Vasut,
Marek Vasut, Mattijs Korpershoek, Michael Walle, Michal Simek,
Mikhail Kalashnikov, Peter Robinson, Rasmus Villemoes,
Rayagonda Kokatanur, Sam Edwards, Samuel Holland, Stefan Roese,
Sumit Garg, Venkatesh Yadav Abbarapu
Hi Andre,
On Tue, 13 Aug 2024 at 06:35, Andre Przywara <andre.przywara@arm.com> wrote:
>
> On Tue, 13 Aug 2024 06:17:17 -0600
> Simon Glass <sjg@chromium.org> wrote:
>
> Hi Simon,
>
> I had a bit deeper look yesterday.
Thanks for digging into this.
>
> > Hi Andre,
> >
> > On Mon, 12 Aug 2024 at 10:00, Andre Przywara <andre.przywara@arm.com> wrote:
> > >
> > > On Wed, 7 Aug 2024 14:50:26 -0600
> > > Simon Glass <sjg@chromium.org> wrote:
> > >
> > > Hey Simon,
> > >
> > > > This series attempts to migrate all sunxi boards to use standard boot,
> > > > along with a text environment.
> > >
> > > Ah, many thanks for that! I figured that we need a bootmeth for FEL, but
> > > never got around to have a closer look.
> > > On a coarse glance, this looks roughly OK, and doing a super quick boot
> > > test on one board, it seems to still work(TM), though the priority of the
> > > FEL boot is not right?
> >
> > Does it need to be the top priority, perhaps?
>
> Yes, please. It should only trigger when you a) do FEL booting and b)
> upload a boot script via FEL, in which case you surely want to execute
> that before anything else. From what I see the global EFI bootmeth is first
> in the list, but I couldn't find an easy way to fix this in the source
> file. Would that go through a platform specific bootmeths env variable?
We can just rename the bootmeth to be before the EFI mgr one.
>
> > > And I guess ditching the old kernel support might be a bit controversial.
> > > I think this is about the vendor kernels, which some people still rely on?
> >
> > OK, perhaps it is. It might be a little tricky to handle it, but I
> > suspect another bootmeth might be enough.
>
> Well, I had a look, and it looks like CONFIG_OLD_SUNXI_KERNEL_COMPAT
> covers multiple things:
> - it sets up some clocks slightly differently
> - it enters the kernel (stays?) in secure mode
> - it provides a custom boot script
>
> I think the latter can be replaced quite easily with something custom, and
> I guess it's the only one biting you? So I am OK with that going, but I
> think we should keep the first two features (and thus the Kconfig symbol).
Yes the script is the only issue and actually it doesn't affect
standard boot. So I can just convert it. I was just hoping to remove
some old code!
>
>
> Another thing I discovered: we lose USB support with patch 3/6. The reason
> is that USB support is enabled by having DISTRO_DEFAULTS. Just replacing
> that with BOOTSTD_DEFAULTS didn't work, though, I get a (ridiculous) splat
> about a circular Kconfig dependency. My hunch is that's something else not
> right in Kconfig, but I need to have a closer look.
Oh yes that is nasty. The problem goes back to BLK being selected by
various things, while BOOTSTD depends on it. I eventually found a
solution so will include that in v2.
Regards,
Simon
^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2024-08-23 21:57 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-07 20:50 [PATCH 0/6] bootstd: sunxi: Migrate to standard boot Simon Glass
2024-08-07 20:50 ` [PATCH 1/6] sunxi: Drop BOOTCMD_SUNXI_COMPAT Simon Glass
2024-08-07 20:50 ` [PATCH 2/6] sunxi: Add a bootmeth for FEL Simon Glass
2024-08-13 12:32 ` Mattijs Korpershoek
2024-08-07 20:50 ` [PATCH 3/6] sunxi: Move to bootstd Simon Glass
2024-08-07 20:50 ` [PATCH 4/6] sunxi: Drop old distro boot variables Simon Glass
2024-08-07 20:50 ` [PATCH 5/6] env: Provide a work-around for unquoting fdtfile Simon Glass
2024-08-07 20:50 ` [PATCH 6/6] sunxi: Move to text environment Simon Glass
2024-08-12 15:59 ` [PATCH 0/6] bootstd: sunxi: Migrate to standard boot Andre Przywara
2024-08-13 12:17 ` Simon Glass
2024-08-13 12:35 ` Andre Przywara
2024-08-23 20:47 ` Simon Glass
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.