[PATCH v9 0/9] bootstd: Convert rockchip and add various fixes and tweaks

This series converts rockchip boards over to use standard boot. It also fixes various problems which have come up recently, showing differences between the current implementation and the distroboot scripts.
This should get us closer to being able to turn down the scripts.
Changes in v9: - Drop patches which enable BOOTSTD_DEFAULT
Changes in v8: - Add new patch to adjust code ordering to work around compiler quirk - Add new patch to use blk uclass device numbers to set efi bootdev - Add cover letter
Changes in v7: - Don't resync after defconfig changes
Changes in v6: - Fix 'unable' typo - Add new patch to report missing labels only when asked - Add new patch to show a message sometimes if no bootflows are found - Redo patch for the new approach
Changes in v5: - Add new patch to tweak bootflow logic for device tree - Add new patch to ensure PCI is set up first when using virtio - Add new patch to support booting EFI where multiple options exist - Drop patch to relax the argument requirements for bootflow scan
Changes in v4: - Add back BOOT_TARGETS - Rebase to -next - Add new patch to use the same boot_targets for all boards
Changes in v3: - Update rk3588 boards too
Changes in v2: - Add new patch to move rockchip to standard boot
Mathew McBride (1): bootstd: Use blk uclass device numbers to set efi bootdev
Simon Glass (8): bootstd: Tweak bootflow logic for device tree virtio: Ensure PCI is set up first bootstd: Support booting EFI where multiple options exist bootstd: Report missing labels only when asked bootstd: Show a message sometimes if no bootflows are found bootstd: Adjust code ordering to work around compiler quirk rockchip: Move to standard boot rockchip: Use the same boot_targets for all boards
boot/bootdev-uclass.c | 37 +++++++++++++----- boot/bootmeth_efi.c | 49 +++++++++++++++--------- cmd/bootflow.c | 3 ++ drivers/virtio/virtio-uclass.c | 6 +++ include/bootdev.h | 2 +- include/configs/px30_common.h | 3 +- include/configs/rk3036_common.h | 4 +- include/configs/rk3066_common.h | 4 +- include/configs/rk3128_common.h | 3 +- include/configs/rk3188_common.h | 4 +- include/configs/rk322x_common.h | 4 +- include/configs/rk3288_common.h | 4 +- include/configs/rk3308_common.h | 3 +- include/configs/rk3328_common.h | 3 +- include/configs/rk3368_common.h | 6 +-- include/configs/rk3568_common.h | 5 +-- include/configs/rk3588_common.h | 5 +-- include/configs/rockchip-common.h | 62 ------------------------------- include/configs/rv1108_common.h | 2 +- test/boot/bootdev.c | 12 +++--- 20 files changed, 90 insertions(+), 131 deletions(-)

We should only store the FDT filename if we were able to determine one. Adjust the logic for this.
This corrects the case where no FDT is needed to boot, such as with EFI using ACPI.
Signed-off-by: Simon Glass sjg@chromium.org ---
(no changes since v6)
Changes in v6: - Fix 'unable' typo
Changes in v5: - Add new patch to tweak bootflow logic for device tree
boot/bootmeth_efi.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-)
diff --git a/boot/bootmeth_efi.c b/boot/bootmeth_efi.c index 6a97ac02ff5c..d7e042cf01ee 100644 --- a/boot/bootmeth_efi.c +++ b/boot/bootmeth_efi.c @@ -235,21 +235,21 @@ static int distro_efi_read_bootflow_file(struct udevice *dev,
/* try the various available names */ ret = -ENOENT; - for (seq = 0; ret; seq++) { + *fname = '\0'; + for (seq = 0; ret == -ENOENT; seq++) { ret = distro_efi_get_fdt_name(fname, sizeof(fname), seq); - if (ret == -EALREADY) { + if (ret == -EALREADY) bflow->flags = BOOTFLOWF_USE_PRIOR_FDT; - break; - } - if (ret) - return log_msg_ret("nam", ret); - ret = bootmeth_common_read_file(dev, bflow, fname, fdt_addr, - &size); + if (!ret) + ret = bootmeth_common_read_file(dev, bflow, fname, + fdt_addr, &size); }
- bflow->fdt_fname = strdup(fname); - if (!bflow->fdt_fname) - return log_msg_ret("fil", -ENOMEM); + if (*fname) { + bflow->fdt_fname = strdup(fname); + if (!bflow->fdt_fname) + return log_msg_ret("fil", -ENOMEM); + }
if (!ret) { bflow->fdt_size = size;

Sometimes virtio may rely on PCI, or at least that is what the distro_bootcmd script suggests. Add this in.
Signed-off-by: Simon Glass sjg@chromium.org ---
(no changes since v5)
Changes in v5: - Add new patch to ensure PCI is set up first when using virtio
drivers/virtio/virtio-uclass.c | 6 ++++++ 1 file changed, 6 insertions(+)
diff --git a/drivers/virtio/virtio-uclass.c b/drivers/virtio/virtio-uclass.c index de9bc90359ca..918cc15b019f 100644 --- a/drivers/virtio/virtio-uclass.c +++ b/drivers/virtio/virtio-uclass.c @@ -373,6 +373,12 @@ static int virtio_bootdev_hunt(struct bootdev_hunter *info, bool show) { int ret;
+ if (IS_ENABLED(CONFIG_PCI)) { + ret = uclass_probe_all(UCLASS_PCI); + if (ret && ret != -ENOENT) + return log_msg_ret("pci", ret); + } + ret = uclass_probe_all(UCLASS_VIRTIO); if (ret && ret != -ENOENT) return log_msg_ret("vir", ret);

The current EFI implementation has a strange quirk where it watches loaded files and uses the last-loaded file to determine the device that is being booted from.
This is confusing with bootstd, where multiple options may exist. Even loading a device tree will cause it to go wrong. There is no API for passing this information, since the only entry into booting an EFI image is the 'bootefi' command.
To work around this, call efi_set_bootdev() for EFI images, if possible, just before booting.
Signed-off-by: Simon Glass sjg@chromium.org ---
(no changes since v5)
Changes in v5: - Add new patch to support booting EFI where multiple options exist
boot/bootmeth_efi.c | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-)
diff --git a/boot/bootmeth_efi.c b/boot/bootmeth_efi.c index d7e042cf01ee..d8bc7fafd127 100644 --- a/boot/bootmeth_efi.c +++ b/boot/bootmeth_efi.c @@ -94,7 +94,7 @@ static int get_efi_pxe_vci(char *str, int max_len) return 0; }
-static int efiload_read_file(struct blk_desc *desc, struct bootflow *bflow) +static void set_efi_bootdev(struct blk_desc *desc, struct bootflow *bflow) { const struct udevice *media_dev; int size = bflow->size; @@ -102,11 +102,6 @@ static int efiload_read_file(struct blk_desc *desc, struct bootflow *bflow) char devnum_str[9]; char dirname[200]; char *last_slash; - int ret; - - ret = bootmeth_alloc_file(bflow, 0x2000000, 0x10000); - if (ret) - return log_msg_ret("read", ret);
/* * This is a horrible hack to tell EFI about this boot device. Once we @@ -117,7 +112,8 @@ static int efiload_read_file(struct blk_desc *desc, struct bootflow *bflow) * this can go away. */ media_dev = dev_get_parent(bflow->dev); - snprintf(devnum_str, sizeof(devnum_str), "%x", dev_seq(media_dev)); + snprintf(devnum_str, sizeof(devnum_str), "%x:%x", dev_seq(media_dev), + bflow->part);
strlcpy(dirname, bflow->fname, sizeof(dirname)); last_slash = strrchr(dirname, '/'); @@ -130,6 +126,15 @@ static int efiload_read_file(struct blk_desc *desc, struct bootflow *bflow) dev_name = device_get_uclass_id(media_dev) == UCLASS_MASS_STORAGE ? "usb" : dev_get_uclass_name(media_dev); efi_set_bootdev(dev_name, devnum_str, bflow->fname, bflow->buf, size); +} + +static int efiload_read_file(struct blk_desc *desc, struct bootflow *bflow) +{ + int ret; + + ret = bootmeth_alloc_file(bflow, 0x2000000, 0x10000); + if (ret) + return log_msg_ret("read", ret);
return 0; } @@ -373,6 +378,13 @@ int distro_efi_boot(struct udevice *dev, struct bootflow *bflow)
/* A non-zero buffer indicates the kernel is there */ if (bflow->buf) { + /* Set the EFI bootdev again, since reading an FDT loses it! */ + if (bflow->blk) { + struct blk_desc *desc = dev_get_uclass_plat(bflow->blk); + + set_efi_bootdev(desc, bflow); + } + kernel = (ulong)map_to_sysmem(bflow->buf);
/*

Use the -l flag to indicate whether to report missing uclasses.
Also try to be more helpful when no devices are found. For example, when we see something 'scsi0' requested and nothing was found, this indicates that there are no SCSI devices, so show a suitable message.
Move messages out of the low-level functions so that silent operation is possible.
This means they are never reported unless BOOTSTD_FULL is enabled, since the -l flag cannot otherwise be set.
Suggested-by: Tom Rini trini@konsulko.com
Signed-off-by: Simon Glass sjg@chromium.org ---
(no changes since v6)
Changes in v6: - Add new patch to report missing labels only when asked
boot/bootdev-uclass.c | 32 +++++++++++++++++++++++++------- include/bootdev.h | 2 +- test/boot/bootdev.c | 12 +++++------- 3 files changed, 31 insertions(+), 15 deletions(-)
diff --git a/boot/bootdev-uclass.c b/boot/bootdev-uclass.c index d34b7e37cf79..91087981d213 100644 --- a/boot/bootdev-uclass.c +++ b/boot/bootdev-uclass.c @@ -364,7 +364,8 @@ int bootdev_unbind_dev(struct udevice *parent) * @seqp: Returns the sequence number, or -1 if none * @method_flagsp: If non-NULL, returns any flags implied by the label * (enum bootflow_meth_flags_t), 0 if none - * Returns: sequence number on success, else -ve error code + * Returns: sequence number on success, -EPFNOSUPPORT is the uclass is not + * known, other -ve error code on other error */ static int label_to_uclass(const char *label, int *seqp, int *method_flagsp) { @@ -394,8 +395,7 @@ static int label_to_uclass(const char *label, int *seqp, int *method_flagsp) id = UCLASS_ETH; method_flags |= BOOTFLOW_METHF_DHCP_ONLY; } else { - log_warning("Unknown uclass '%s' in label\n", label); - return -EINVAL; + return -EPFNOSUPPORT; } } if (id == UCLASS_USB) @@ -458,7 +458,6 @@ int bootdev_find_by_label(const char *label, struct udevice **devp, } log_debug("- no device in %s\n", media->name); } - log_warning("Unknown seq %d for label '%s'\n", seq, label);
return -ENOENT; } @@ -577,9 +576,28 @@ int bootdev_next_label(struct bootflow_iter *iter, struct udevice **devp,
log_debug("next\n"); for (dev = NULL; !dev && iter->labels[++iter->cur_label];) { - log_debug("Scanning: %s\n", iter->labels[iter->cur_label]); - bootdev_hunt_and_find_by_label(iter->labels[iter->cur_label], - &dev, method_flagsp); + const char *label = iter->labels[iter->cur_label]; + int ret; + + log_debug("Scanning: %s\n", label); + ret = bootdev_hunt_and_find_by_label(label, &dev, + method_flagsp); + if (iter->flags & BOOTFLOWIF_SHOW) { + if (ret == -EPFNOSUPPORT) { + log_warning("Unknown uclass '%s' in label\n", + label); + } else if (ret == -ENOENT) { + /* + * looking for, e.g. 'scsi0' should find + * something if SCSI is present + */ + if (!trailing_strtol(label)) { + log_warning("No bootdevs for '%s'\n", + label); + } + } + } + }
if (!dev) diff --git a/include/bootdev.h b/include/bootdev.h index b92ff4d4f154..e72ef3650f7c 100644 --- a/include/bootdev.h +++ b/include/bootdev.h @@ -258,7 +258,7 @@ int bootdev_find_by_label(const char *label, struct udevice **devp, * @devp: returns the device found, on success * @method_flagsp: If non-NULL, returns any flags implied by the label * (enum bootflow_meth_flags_t), 0 if none. Unset if function fails - * Return: 0 if OK, -EINVAL if the uclass is not supported by this board, + * Return: 0 if OK, -EPFNOSUPPORT if the uclass is not supported by this board, * -ENOENT if there is no device with that number */ int bootdev_find_by_any(const char *name, struct udevice **devp, diff --git a/test/boot/bootdev.c b/test/boot/bootdev.c index 4fe9fd722084..0899c78c2c4a 100644 --- a/test/boot/bootdev.c +++ b/test/boot/bootdev.c @@ -124,7 +124,8 @@ static int bootdev_test_labels(struct unit_test_state *uts) mflags);
/* Check invalid uclass */ - ut_asserteq(-EINVAL, bootdev_find_by_label("fred0", &dev, &mflags)); + ut_asserteq(-EPFNOSUPPORT, + bootdev_find_by_label("fred0", &dev, &mflags));
/* Check unknown sequence number */ ut_asserteq(-ENOENT, bootdev_find_by_label("mmc6", &dev, &mflags)); @@ -179,9 +180,8 @@ static int bootdev_test_any(struct unit_test_state *uts)
/* Check invalid uclass */ mflags = 123; - ut_asserteq(-EINVAL, bootdev_find_by_any("fred0", &dev, &mflags)); - ut_assert_nextline("Unknown uclass 'fred0' in label"); - ut_assert_nextline("Cannot find bootdev 'fred0' (err=-22)"); + ut_asserteq(-EPFNOSUPPORT, bootdev_find_by_any("fred0", &dev, &mflags)); + ut_assert_nextline("Cannot find bootdev 'fred0' (err=-96)"); ut_asserteq(123, mflags); ut_assert_console_end();
@@ -512,9 +512,8 @@ static int bootdev_test_hunt_label(struct unit_test_state *uts) old = (void *)&mflags; /* arbitrary pointer to check against dev */ dev = old; mflags = 123; - ut_asserteq(-EINVAL, + ut_asserteq(-EPFNOSUPPORT, bootdev_hunt_and_find_by_label("fred", &dev, &mflags)); - ut_assert_nextline("Unknown uclass 'fred' in label"); ut_asserteq_ptr(old, dev); ut_asserteq(123, mflags); ut_assert_console_end(); @@ -525,7 +524,6 @@ static int bootdev_test_hunt_label(struct unit_test_state *uts) bootdev_hunt_and_find_by_label("mmc4", &dev, &mflags)); ut_asserteq_ptr(old, dev); ut_asserteq(123, mflags); - ut_assert_nextline("Unknown seq 4 for label 'mmc4'"); ut_assert_console_end();
ut_assertok(bootstd_test_check_mmc_hunter(uts));

Enable some messages that might provide hints, but only for CMD_BOOTFLOW_FULL since otherwise the -l flag is not available.
Signed-off-by: Simon Glass sjg@chromium.org Suggested-by: Tom Rini trini@konsulko.com ---
(no changes since v6)
Changes in v6: - Add new patch to show a message sometimes if no bootflows are found
cmd/bootflow.c | 3 +++ 1 file changed, 3 insertions(+)
diff --git a/cmd/bootflow.c b/cmd/bootflow.c index 42f6e14a4370..aa06999e3db3 100644 --- a/cmd/bootflow.c +++ b/cmd/bootflow.c @@ -181,6 +181,9 @@ static int do_bootflow_scan(struct cmd_tbl *cmdtp, int flag, int argc, if (list) show_footer(i, num_valid);
+ if (IS_ENABLED(CONFIG_CMD_BOOTFLOW_FULL) && !num_valid && !list) + printf("No bootflows found; try again with -l\n"); + return 0; }

At present when debugging is off, bootdev_find_in_blk() sometimes fails to find a valid bootflow, e.g. with virtio. Accessing the 'blk' variable later in the function seems to correct it.
Move the 'ret' check before the debug statement and set the block device again aftewards, to work around this.
Signed-off-by: Simon Glass sjg@chromium.org ---
(no changes since v8)
Changes in v8: - Add new patch to adjust code ordering to work around compiler quirk
boot/bootdev-uclass.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/boot/bootdev-uclass.c b/boot/bootdev-uclass.c index 91087981d213..57d294464764 100644 --- a/boot/bootdev-uclass.c +++ b/boot/bootdev-uclass.c @@ -174,6 +174,8 @@ int bootdev_find_in_blk(struct udevice *dev, struct udevice *blk, } else { ret = fs_set_blk_dev_with_part(desc, bflow->part); bflow->state = BOOTFLOWST_PART; + if (ret) + return log_msg_ret("fs", ret);
/* Use an #ifdef due to info.sys_ind */ #ifdef CONFIG_DOS_PARTITION @@ -181,8 +183,7 @@ int bootdev_find_in_blk(struct udevice *dev, struct udevice *blk, blk->name, bflow->part, info.sys_ind, ret ? -1 : fs_get_type()); #endif - if (ret) - return log_msg_ret("fs", ret); + bflow->blk = blk; bflow->state = BOOTFLOWST_FS; }

From: Mathew McBride matt@traverse.com.au
When loading a file from a block device, efiload_read_file was using the seq_num of the device (e.g "35" of virtio_blk#35) instead of the block device id (e.g what you get from running the corresponding device scan command, like "virtio 0")
This cause EFI booting from these devices to fail as an invalid device number is passed to blk_get_device_part_str:
Scanning bootdev 'virtio-blk#35.bootdev': distro_efi_read_bootflow_file start (efi,fname=<NULL>) distro_efi_read_bootflow_file start (efi,fname=<NULL>) setting bootdev virtio, 35, efi/boot/bootaa64.efi, 00000000beef9a40, 170800 efi_dp_from_name calling blk_get_device_part_str dev=virtio devnr=35 path=efi/boot/bootaa64.efi blk_get_device_part_str (virtio,35) blk_get_device_by_str (virtio, 35) ** Bad device specification virtio 35 ** Using default device tree: dtb/qemu-arm.dtb No device tree available 0 efi ready virtio 1 virtio-blk#35.bootdev.par efi/boot/bootaa64.efi ** Booting bootflow 'virtio-blk#35.bootdev.part_1' with efi blk_get_device_part_str (virtio,0:1) blk_get_device_by_str (virtio, 0) No UEFI binary known at beef9a40 (image buf=00000000beef9a40,addr=0000000000000000) Boot failed (err=-22)
Signed-off-by: Mathew McBride matt@traverse.com.au Signed-off-by: Simon Glass sjg@chromium.org ---
(no changes since v8)
Changes in v8: - Add new patch to use blk uclass device numbers to set efi bootdev
boot/bootmeth_efi.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/boot/bootmeth_efi.c b/boot/bootmeth_efi.c index d8bc7fafd127..6f70f2229b9b 100644 --- a/boot/bootmeth_efi.c +++ b/boot/bootmeth_efi.c @@ -112,7 +112,8 @@ static void set_efi_bootdev(struct blk_desc *desc, struct bootflow *bflow) * this can go away. */ media_dev = dev_get_parent(bflow->dev); - snprintf(devnum_str, sizeof(devnum_str), "%x:%x", dev_seq(media_dev), + snprintf(devnum_str, sizeof(devnum_str), "%x:%x", + desc ? desc->devnum : dev_seq(media_dev), bflow->part);
strlcpy(dirname, bflow->fname, sizeof(dirname));

Drop the distro-boot scripts and use standard boot instead.
Signed-off-by: Simon Glass sjg@chromium.org ---
(no changes since v4)
Changes in v4: - Add back BOOT_TARGETS
Changes in v3: - Update rk3588 boards too
Changes in v2: - Add new patch to move rockchip to standard boot
include/configs/px30_common.h | 3 +- include/configs/rk3036_common.h | 4 +-- include/configs/rk3066_common.h | 4 +-- include/configs/rk3128_common.h | 3 +- include/configs/rk3188_common.h | 4 +-- include/configs/rk322x_common.h | 4 +-- include/configs/rk3288_common.h | 4 +-- include/configs/rk3308_common.h | 3 +- include/configs/rk3328_common.h | 3 +- include/configs/rk3368_common.h | 6 ++-- include/configs/rk3568_common.h | 5 ++- include/configs/rk3588_common.h | 5 ++- include/configs/rockchip-common.h | 58 ------------------------------- include/configs/rv1108_common.h | 2 +- 14 files changed, 16 insertions(+), 92 deletions(-)
diff --git a/include/configs/px30_common.h b/include/configs/px30_common.h index 8df481b09788..6fbd2679f099 100644 --- a/include/configs/px30_common.h +++ b/include/configs/px30_common.h @@ -24,12 +24,11 @@ "kernel_addr_c=0x03e80000\0" \ "ramdisk_addr_r=0x0a200000\0"
-#include <config_distro_bootcmd.h> #define CFG_EXTRA_ENV_SETTINGS \ ENV_MEM_LAYOUT_SETTINGS \ "fdtfile=" CONFIG_DEFAULT_FDT_FILE "\0" \ "partitions=" PARTS_DEFAULT \ ROCKCHIP_DEVICE_SETTINGS \ - BOOTENV + "boot_targets=" BOOT_TARGETS "\0"
#endif diff --git a/include/configs/rk3036_common.h b/include/configs/rk3036_common.h index ea6073f29446..c2abd14e114b 100644 --- a/include/configs/rk3036_common.h +++ b/include/configs/rk3036_common.h @@ -21,8 +21,6 @@ "kernel_addr_r=0x62000000\0" \ "ramdisk_addr_r=0x64000000\0"
-#include <config_distro_bootcmd.h> - /* Linux fails to load the fdt if it's loaded above 512M on a evb-rk3036 board, * so limit the fdt reallocation to that */ #define CFG_EXTRA_ENV_SETTINGS \ @@ -30,6 +28,6 @@ "fdt_high=0x7fffffff\0" \ "partitions=" PARTS_DEFAULT \ ENV_MEM_LAYOUT_SETTINGS \ - BOOTENV + "boot_targets=" BOOT_TARGETS "\0"
#endif diff --git a/include/configs/rk3066_common.h b/include/configs/rk3066_common.h index 1a6d3678df3e..d70c8f77d487 100644 --- a/include/configs/rk3066_common.h +++ b/include/configs/rk3066_common.h @@ -22,14 +22,12 @@ "kernel_addr_r=0x62000000\0" \ "ramdisk_addr_r=0x64000000\0"
-#include <config_distro_bootcmd.h> - #define CFG_EXTRA_ENV_SETTINGS \ "fdt_high=0x6fffffff\0" \ "initrd_high=0x6fffffff\0" \ "partitions=" PARTS_DEFAULT \ ENV_MEM_LAYOUT_SETTINGS \ ROCKCHIP_DEVICE_SETTINGS \ - BOOTENV + "boot_targets=" BOOT_TARGETS "\0"
#endif diff --git a/include/configs/rk3128_common.h b/include/configs/rk3128_common.h index 8736b14d1015..d8269b0ec96f 100644 --- a/include/configs/rk3128_common.h +++ b/include/configs/rk3128_common.h @@ -22,11 +22,10 @@ "kernel_addr_r=0x62000000\0" \ "ramdisk_addr_r=0x64000000\0"
-#include <config_distro_bootcmd.h> #define CFG_EXTRA_ENV_SETTINGS \ ENV_MEM_LAYOUT_SETTINGS \ "fdt_file=" CONFIG_DEFAULT_FDT_FILE "\0" \ "partitions=" PARTS_DEFAULT \ - BOOTENV + "boot_targets=" BOOT_TARGETS "\0"
#endif diff --git a/include/configs/rk3188_common.h b/include/configs/rk3188_common.h index fcb274565e9e..a8cee1e44d4d 100644 --- a/include/configs/rk3188_common.h +++ b/include/configs/rk3188_common.h @@ -21,8 +21,6 @@ "kernel_addr_r=0x62000000\0" \ "ramdisk_addr_r=0x64000000\0"
-#include <config_distro_bootcmd.h> - /* Linux fails to load the fdt if it's loaded above 256M on a Rock board, * so limit the fdt reallocation to that */ #define CFG_EXTRA_ENV_SETTINGS \ @@ -32,6 +30,6 @@ "partitions=" PARTS_DEFAULT \ ENV_MEM_LAYOUT_SETTINGS \ ROCKCHIP_DEVICE_SETTINGS \ - BOOTENV + "boot_targets=" BOOT_TARGETS "\0"
#endif diff --git a/include/configs/rk322x_common.h b/include/configs/rk322x_common.h index 39a40f4e2d10..15f77df3e17e 100644 --- a/include/configs/rk322x_common.h +++ b/include/configs/rk322x_common.h @@ -22,8 +22,6 @@ "kernel_addr_r=0x62000000\0" \ "ramdisk_addr_r=0x64000000\0"
-#include <config_distro_bootcmd.h> - /* Linux fails to load the fdt if it's loaded above 512M on a evb-rk3036 board, * so limit the fdt reallocation to that */ #define CFG_EXTRA_ENV_SETTINGS \ @@ -31,6 +29,6 @@ "fdt_high=0x7fffffff\0" \ "partitions=" PARTS_DEFAULT \ ENV_MEM_LAYOUT_SETTINGS \ - BOOTENV + "boot_targets=" BOOT_TARGETS "\0"
#endif diff --git a/include/configs/rk3288_common.h b/include/configs/rk3288_common.h index 71d2426d72a4..3063076a97af 100644 --- a/include/configs/rk3288_common.h +++ b/include/configs/rk3288_common.h @@ -23,8 +23,6 @@ "kernel_addr_r=0x02000000\0" \ "ramdisk_addr_r=0x04000000\0"
-#include <config_distro_bootcmd.h> - /* Linux fails to load the fdt if it's loaded above 256M on a Rock 2 board, so * limit the fdt reallocation to that */ #define CFG_EXTRA_ENV_SETTINGS \ @@ -34,6 +32,6 @@ "partitions=" PARTS_DEFAULT \ ENV_MEM_LAYOUT_SETTINGS \ ROCKCHIP_DEVICE_SETTINGS \ - BOOTENV + "boot_targets=" BOOT_TARGETS "\0"
#endif diff --git a/include/configs/rk3308_common.h b/include/configs/rk3308_common.h index ba9ee112e2df..7d55fcd975c6 100644 --- a/include/configs/rk3308_common.h +++ b/include/configs/rk3308_common.h @@ -20,11 +20,10 @@ "kernel_addr_r=0x00680000\0" \ "ramdisk_addr_r=0x04000000\0"
-#include <config_distro_bootcmd.h> #define CFG_EXTRA_ENV_SETTINGS \ ENV_MEM_LAYOUT_SETTINGS \ "partitions=" PARTS_DEFAULT \ ROCKCHIP_DEVICE_SETTINGS \ - BOOTENV + "boot_targets=" BOOT_TARGETS "\0"
#endif diff --git a/include/configs/rk3328_common.h b/include/configs/rk3328_common.h index e565ccff8979..e920ec7e5ddb 100644 --- a/include/configs/rk3328_common.h +++ b/include/configs/rk3328_common.h @@ -22,11 +22,10 @@ "kernel_comp_addr_r=0x08000000\0" \ "kernel_comp_size=0x2000000\0"
-#include <config_distro_bootcmd.h> #define CFG_EXTRA_ENV_SETTINGS \ ENV_MEM_LAYOUT_SETTINGS \ "fdtfile=" CONFIG_DEFAULT_FDT_FILE "\0" \ "partitions=" PARTS_DEFAULT \ - BOOTENV + "boot_targets=" BOOT_TARGETS "\0"
#endif diff --git a/include/configs/rk3368_common.h b/include/configs/rk3368_common.h index 9aa256b59592..ccb5369b9018 100644 --- a/include/configs/rk3368_common.h +++ b/include/configs/rk3368_common.h @@ -23,11 +23,9 @@ "kernel_addr_r=0x280000\0" \ "ramdisk_addr_r=0x5bf0000\0"
-#include <config_distro_bootcmd.h> - #define CFG_EXTRA_ENV_SETTINGS \ "fdtfile=" CONFIG_DEFAULT_DEVICE_TREE ".dtb\0" \ - ENV_MEM_LAYOUT_SETTINGS \ - BOOTENV + ENV_MEM_LAYOUT_SETTINGS \ + "boot_targets=" BOOT_TARGETS "\0"
#endif diff --git a/include/configs/rk3568_common.h b/include/configs/rk3568_common.h index a5e1dde50888..366ccc97db75 100644 --- a/include/configs/rk3568_common.h +++ b/include/configs/rk3568_common.h @@ -22,12 +22,11 @@ "kernel_addr_r=0x02080000\0" \ "ramdisk_addr_r=0x0a200000\0"
-#include <config_distro_bootcmd.h> #define CFG_EXTRA_ENV_SETTINGS \ ENV_MEM_LAYOUT_SETTINGS \ "fdtfile=" CONFIG_DEFAULT_FDT_FILE "\0" \ "partitions=" PARTS_DEFAULT \ - ROCKCHIP_DEVICE_SETTINGS \ - BOOTENV + ROCKCHIP_DEVICE_SETTINGS \ + "boot_targets=" BOOT_TARGETS "\0"
#endif diff --git a/include/configs/rk3588_common.h b/include/configs/rk3588_common.h index abd20139aaf3..1cc16fe15206 100644 --- a/include/configs/rk3588_common.h +++ b/include/configs/rk3588_common.h @@ -21,12 +21,11 @@ "kernel_addr_r=0x02080000\0" \ "ramdisk_addr_r=0x0a200000\0"
-#include <config_distro_bootcmd.h> #define CFG_EXTRA_ENV_SETTINGS \ "fdtfile=" CONFIG_DEFAULT_FDT_FILE "\0" \ "partitions=" PARTS_DEFAULT \ ENV_MEM_LAYOUT_SETTINGS \ - ROCKCHIP_DEVICE_SETTINGS \ - BOOTENV + ROCKCHIP_DEVICE_SETTINGS \ + "boot_targets=" BOOT_TARGETS "\0"
#endif /* __CONFIG_RK3588_COMMON_H */ diff --git a/include/configs/rockchip-common.h b/include/configs/rockchip-common.h index 18544d75acc6..e9f4072b7e78 100644 --- a/include/configs/rockchip-common.h +++ b/include/configs/rockchip-common.h @@ -13,67 +13,9 @@
#ifndef CONFIG_SPL_BUILD
-/* First try to boot from SD (index 1), then eMMC (index 0) */ -#if IS_ENABLED(CONFIG_CMD_MMC) - #define BOOT_TARGET_MMC(func) \ - func(MMC, mmc, 1) \ - func(MMC, mmc, 0) -#else - #define BOOT_TARGET_MMC(func) -#endif - -#if IS_ENABLED(CONFIG_CMD_NVME) - #define BOOT_TARGET_NVME(func) func(NVME, nvme, 0) -#else - #define BOOT_TARGET_NVME(func) -#endif - -#if IS_ENABLED(CONFIG_CMD_SCSI) - #define BOOT_TARGET_SCSI(func) func(SCSI, scsi, 0) -#else - #define BOOT_TARGET_SCSI(func) -#endif - -#if IS_ENABLED(CONFIG_CMD_USB) - #define BOOT_TARGET_USB(func) func(USB, usb, 0) -#else - #define BOOT_TARGET_USB(func) -#endif - -#if CONFIG_IS_ENABLED(CMD_PXE) - #define BOOT_TARGET_PXE(func) func(PXE, pxe, na) -#else - #define BOOT_TARGET_PXE(func) -#endif - -#if CONFIG_IS_ENABLED(CMD_DHCP) - #define BOOT_TARGET_DHCP(func) func(DHCP, dhcp, na) -#else - #define BOOT_TARGET_DHCP(func) -#endif - -#if IS_ENABLED(CONFIG_CMD_SF) - #define BOOT_TARGET_SF(func) func(SF, sf, 0) -#else - #define BOOT_TARGET_SF(func) -#endif - #ifdef CONFIG_ROCKCHIP_RK3399 -#define BOOT_TARGET_DEVICES(func) \ - BOOT_TARGET_MMC(func) \ - BOOT_TARGET_NVME(func) \ - BOOT_TARGET_SCSI(func) \ - BOOT_TARGET_USB(func) \ - BOOT_TARGET_PXE(func) \ - BOOT_TARGET_DHCP(func) \ - BOOT_TARGET_SF(func) #define BOOT_TARGETS "mmc1 mmc0 nvme scsi usb pxe dhcp spi" #else -#define BOOT_TARGET_DEVICES(func) \ - BOOT_TARGET_MMC(func) \ - BOOT_TARGET_USB(func) \ - BOOT_TARGET_PXE(func) \ - BOOT_TARGET_DHCP(func) #define BOOT_TARGETS "mmc1 mmc0 usb pxe dhcp" #endif
diff --git a/include/configs/rv1108_common.h b/include/configs/rv1108_common.h index 050d37bff0b5..3bf70a0e0ae2 100644 --- a/include/configs/rv1108_common.h +++ b/include/configs/rv1108_common.h @@ -28,6 +28,6 @@ ENV_MEM_LAYOUT_SETTINGS \ "fdtfile=" CONFIG_DEFAULT_FDT_FILE "\0" \ "partitions=" PARTS_DEFAULT \ - BOOTENV + "boot_targets=" BOOT_TARGETS "\0"
#endif

Hi Simon,
On 2023-04-08 22:44, Simon Glass wrote:
Drop the distro-boot scripts and use standard boot instead.
With the "Drop patches which enable BOOTSTD_DEFAULT" in v9 we must imply BOOTSTD_DEFAULTS or we run into the following on anything rk not rk3399.
## Error: "distro_bootcmd" not defined
Something like this was needed to get my devices booting using bootflow:
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -1956,8 +1956,7 @@ config ARCH_ROCKCHIP imply ADC imply CMD_DM imply DEBUG_UART_BOARD_INIT - imply DISTRO_DEFAULTS if !ROCKCHIP_RK3399 - imply BOOTSTD_DEFAULTS if !DISTRO_DEFAULTS + imply BOOTSTD_DEFAULTS imply FAT_WRITE imply SARADC_ROCKCHIP imply SPL_SYSRESET
With above fixed,
Tested-by: Jonas Karlman jonas@kwiboo.se
using basic distro boot on following devices: - RK3288: TinkerBoard R2.0 - RK3328: Rock64 - RK3399: Rock Pi 4B+ - RK3568: Rock 3A - RK3588: Rock 5B
Regards, Jonas
Signed-off-by: Simon Glass sjg@chromium.org
(no changes since v4)
Changes in v4:
- Add back BOOT_TARGETS
Changes in v3:
- Update rk3588 boards too
Changes in v2:
- Add new patch to move rockchip to standard boot
include/configs/px30_common.h | 3 +- include/configs/rk3036_common.h | 4 +-- include/configs/rk3066_common.h | 4 +-- include/configs/rk3128_common.h | 3 +- include/configs/rk3188_common.h | 4 +-- include/configs/rk322x_common.h | 4 +-- include/configs/rk3288_common.h | 4 +-- include/configs/rk3308_common.h | 3 +- include/configs/rk3328_common.h | 3 +- include/configs/rk3368_common.h | 6 ++-- include/configs/rk3568_common.h | 5 ++- include/configs/rk3588_common.h | 5 ++- include/configs/rockchip-common.h | 58 ------------------------------- include/configs/rv1108_common.h | 2 +- 14 files changed, 16 insertions(+), 92 deletions(-)
diff --git a/include/configs/px30_common.h b/include/configs/px30_common.h index 8df481b09788..6fbd2679f099 100644 --- a/include/configs/px30_common.h +++ b/include/configs/px30_common.h @@ -24,12 +24,11 @@ "kernel_addr_c=0x03e80000\0" \ "ramdisk_addr_r=0x0a200000\0"
-#include <config_distro_bootcmd.h> #define CFG_EXTRA_ENV_SETTINGS \ ENV_MEM_LAYOUT_SETTINGS \ "fdtfile=" CONFIG_DEFAULT_FDT_FILE "\0" \ "partitions=" PARTS_DEFAULT \ ROCKCHIP_DEVICE_SETTINGS \
- BOOTENV
- "boot_targets=" BOOT_TARGETS "\0"
#endif diff --git a/include/configs/rk3036_common.h b/include/configs/rk3036_common.h index ea6073f29446..c2abd14e114b 100644 --- a/include/configs/rk3036_common.h +++ b/include/configs/rk3036_common.h @@ -21,8 +21,6 @@ "kernel_addr_r=0x62000000\0" \ "ramdisk_addr_r=0x64000000\0"
-#include <config_distro_bootcmd.h>
/* Linux fails to load the fdt if it's loaded above 512M on a evb-rk3036 board,
- so limit the fdt reallocation to that */
#define CFG_EXTRA_ENV_SETTINGS \ @@ -30,6 +28,6 @@ "fdt_high=0x7fffffff\0" \ "partitions=" PARTS_DEFAULT \ ENV_MEM_LAYOUT_SETTINGS \
- BOOTENV
- "boot_targets=" BOOT_TARGETS "\0"
#endif diff --git a/include/configs/rk3066_common.h b/include/configs/rk3066_common.h index 1a6d3678df3e..d70c8f77d487 100644 --- a/include/configs/rk3066_common.h +++ b/include/configs/rk3066_common.h @@ -22,14 +22,12 @@ "kernel_addr_r=0x62000000\0" \ "ramdisk_addr_r=0x64000000\0"
-#include <config_distro_bootcmd.h>
#define CFG_EXTRA_ENV_SETTINGS \ "fdt_high=0x6fffffff\0" \ "initrd_high=0x6fffffff\0" \ "partitions=" PARTS_DEFAULT \ ENV_MEM_LAYOUT_SETTINGS \ ROCKCHIP_DEVICE_SETTINGS \
- BOOTENV
- "boot_targets=" BOOT_TARGETS "\0"
#endif diff --git a/include/configs/rk3128_common.h b/include/configs/rk3128_common.h index 8736b14d1015..d8269b0ec96f 100644 --- a/include/configs/rk3128_common.h +++ b/include/configs/rk3128_common.h @@ -22,11 +22,10 @@ "kernel_addr_r=0x62000000\0" \ "ramdisk_addr_r=0x64000000\0"
-#include <config_distro_bootcmd.h> #define CFG_EXTRA_ENV_SETTINGS \ ENV_MEM_LAYOUT_SETTINGS \ "fdt_file=" CONFIG_DEFAULT_FDT_FILE "\0" \ "partitions=" PARTS_DEFAULT \
- BOOTENV
- "boot_targets=" BOOT_TARGETS "\0"
#endif diff --git a/include/configs/rk3188_common.h b/include/configs/rk3188_common.h index fcb274565e9e..a8cee1e44d4d 100644 --- a/include/configs/rk3188_common.h +++ b/include/configs/rk3188_common.h @@ -21,8 +21,6 @@ "kernel_addr_r=0x62000000\0" \ "ramdisk_addr_r=0x64000000\0"
-#include <config_distro_bootcmd.h>
/* Linux fails to load the fdt if it's loaded above 256M on a Rock board,
- so limit the fdt reallocation to that */
#define CFG_EXTRA_ENV_SETTINGS \ @@ -32,6 +30,6 @@ "partitions=" PARTS_DEFAULT \ ENV_MEM_LAYOUT_SETTINGS \ ROCKCHIP_DEVICE_SETTINGS \
- BOOTENV
- "boot_targets=" BOOT_TARGETS "\0"
#endif diff --git a/include/configs/rk322x_common.h b/include/configs/rk322x_common.h index 39a40f4e2d10..15f77df3e17e 100644 --- a/include/configs/rk322x_common.h +++ b/include/configs/rk322x_common.h @@ -22,8 +22,6 @@ "kernel_addr_r=0x62000000\0" \ "ramdisk_addr_r=0x64000000\0"
-#include <config_distro_bootcmd.h>
/* Linux fails to load the fdt if it's loaded above 512M on a evb-rk3036 board,
- so limit the fdt reallocation to that */
#define CFG_EXTRA_ENV_SETTINGS \ @@ -31,6 +29,6 @@ "fdt_high=0x7fffffff\0" \ "partitions=" PARTS_DEFAULT \ ENV_MEM_LAYOUT_SETTINGS \
- BOOTENV
- "boot_targets=" BOOT_TARGETS "\0"
#endif diff --git a/include/configs/rk3288_common.h b/include/configs/rk3288_common.h index 71d2426d72a4..3063076a97af 100644 --- a/include/configs/rk3288_common.h +++ b/include/configs/rk3288_common.h @@ -23,8 +23,6 @@ "kernel_addr_r=0x02000000\0" \ "ramdisk_addr_r=0x04000000\0"
-#include <config_distro_bootcmd.h>
/* Linux fails to load the fdt if it's loaded above 256M on a Rock 2 board, so
- limit the fdt reallocation to that */
#define CFG_EXTRA_ENV_SETTINGS \ @@ -34,6 +32,6 @@ "partitions=" PARTS_DEFAULT \ ENV_MEM_LAYOUT_SETTINGS \ ROCKCHIP_DEVICE_SETTINGS \
- BOOTENV
- "boot_targets=" BOOT_TARGETS "\0"
#endif diff --git a/include/configs/rk3308_common.h b/include/configs/rk3308_common.h index ba9ee112e2df..7d55fcd975c6 100644 --- a/include/configs/rk3308_common.h +++ b/include/configs/rk3308_common.h @@ -20,11 +20,10 @@ "kernel_addr_r=0x00680000\0" \ "ramdisk_addr_r=0x04000000\0"
-#include <config_distro_bootcmd.h> #define CFG_EXTRA_ENV_SETTINGS \ ENV_MEM_LAYOUT_SETTINGS \ "partitions=" PARTS_DEFAULT \ ROCKCHIP_DEVICE_SETTINGS \
- BOOTENV
- "boot_targets=" BOOT_TARGETS "\0"
#endif diff --git a/include/configs/rk3328_common.h b/include/configs/rk3328_common.h index e565ccff8979..e920ec7e5ddb 100644 --- a/include/configs/rk3328_common.h +++ b/include/configs/rk3328_common.h @@ -22,11 +22,10 @@ "kernel_comp_addr_r=0x08000000\0" \ "kernel_comp_size=0x2000000\0"
-#include <config_distro_bootcmd.h> #define CFG_EXTRA_ENV_SETTINGS \ ENV_MEM_LAYOUT_SETTINGS \ "fdtfile=" CONFIG_DEFAULT_FDT_FILE "\0" \ "partitions=" PARTS_DEFAULT \
- BOOTENV
- "boot_targets=" BOOT_TARGETS "\0"
#endif diff --git a/include/configs/rk3368_common.h b/include/configs/rk3368_common.h index 9aa256b59592..ccb5369b9018 100644 --- a/include/configs/rk3368_common.h +++ b/include/configs/rk3368_common.h @@ -23,11 +23,9 @@ "kernel_addr_r=0x280000\0" \ "ramdisk_addr_r=0x5bf0000\0"
-#include <config_distro_bootcmd.h>
#define CFG_EXTRA_ENV_SETTINGS \ "fdtfile=" CONFIG_DEFAULT_DEVICE_TREE ".dtb\0" \
- ENV_MEM_LAYOUT_SETTINGS \
- BOOTENV
- ENV_MEM_LAYOUT_SETTINGS \
- "boot_targets=" BOOT_TARGETS "\0"
#endif diff --git a/include/configs/rk3568_common.h b/include/configs/rk3568_common.h index a5e1dde50888..366ccc97db75 100644 --- a/include/configs/rk3568_common.h +++ b/include/configs/rk3568_common.h @@ -22,12 +22,11 @@ "kernel_addr_r=0x02080000\0" \ "ramdisk_addr_r=0x0a200000\0"
-#include <config_distro_bootcmd.h> #define CFG_EXTRA_ENV_SETTINGS \ ENV_MEM_LAYOUT_SETTINGS \ "fdtfile=" CONFIG_DEFAULT_FDT_FILE "\0" \ "partitions=" PARTS_DEFAULT \
- ROCKCHIP_DEVICE_SETTINGS \
- BOOTENV
- ROCKCHIP_DEVICE_SETTINGS \
- "boot_targets=" BOOT_TARGETS "\0"
#endif diff --git a/include/configs/rk3588_common.h b/include/configs/rk3588_common.h index abd20139aaf3..1cc16fe15206 100644 --- a/include/configs/rk3588_common.h +++ b/include/configs/rk3588_common.h @@ -21,12 +21,11 @@ "kernel_addr_r=0x02080000\0" \ "ramdisk_addr_r=0x0a200000\0"
-#include <config_distro_bootcmd.h> #define CFG_EXTRA_ENV_SETTINGS \ "fdtfile=" CONFIG_DEFAULT_FDT_FILE "\0" \ "partitions=" PARTS_DEFAULT \ ENV_MEM_LAYOUT_SETTINGS \
- ROCKCHIP_DEVICE_SETTINGS \
- BOOTENV
- ROCKCHIP_DEVICE_SETTINGS \
- "boot_targets=" BOOT_TARGETS "\0"
#endif /* __CONFIG_RK3588_COMMON_H */ diff --git a/include/configs/rockchip-common.h b/include/configs/rockchip-common.h index 18544d75acc6..e9f4072b7e78 100644 --- a/include/configs/rockchip-common.h +++ b/include/configs/rockchip-common.h @@ -13,67 +13,9 @@
#ifndef CONFIG_SPL_BUILD
-/* First try to boot from SD (index 1), then eMMC (index 0) */ -#if IS_ENABLED(CONFIG_CMD_MMC)
- #define BOOT_TARGET_MMC(func) \
func(MMC, mmc, 1) \
func(MMC, mmc, 0)
-#else
- #define BOOT_TARGET_MMC(func)
-#endif
-#if IS_ENABLED(CONFIG_CMD_NVME)
- #define BOOT_TARGET_NVME(func) func(NVME, nvme, 0)
-#else
- #define BOOT_TARGET_NVME(func)
-#endif
-#if IS_ENABLED(CONFIG_CMD_SCSI)
- #define BOOT_TARGET_SCSI(func) func(SCSI, scsi, 0)
-#else
- #define BOOT_TARGET_SCSI(func)
-#endif
-#if IS_ENABLED(CONFIG_CMD_USB)
- #define BOOT_TARGET_USB(func) func(USB, usb, 0)
-#else
- #define BOOT_TARGET_USB(func)
-#endif
-#if CONFIG_IS_ENABLED(CMD_PXE)
- #define BOOT_TARGET_PXE(func) func(PXE, pxe, na)
-#else
- #define BOOT_TARGET_PXE(func)
-#endif
-#if CONFIG_IS_ENABLED(CMD_DHCP)
- #define BOOT_TARGET_DHCP(func) func(DHCP, dhcp, na)
-#else
- #define BOOT_TARGET_DHCP(func)
-#endif
-#if IS_ENABLED(CONFIG_CMD_SF)
- #define BOOT_TARGET_SF(func) func(SF, sf, 0)
-#else
- #define BOOT_TARGET_SF(func)
-#endif
#ifdef CONFIG_ROCKCHIP_RK3399 -#define BOOT_TARGET_DEVICES(func) \
- BOOT_TARGET_MMC(func) \
- BOOT_TARGET_NVME(func) \
- BOOT_TARGET_SCSI(func) \
- BOOT_TARGET_USB(func) \
- BOOT_TARGET_PXE(func) \
- BOOT_TARGET_DHCP(func) \
- BOOT_TARGET_SF(func)
#define BOOT_TARGETS "mmc1 mmc0 nvme scsi usb pxe dhcp spi" #else -#define BOOT_TARGET_DEVICES(func) \
- BOOT_TARGET_MMC(func) \
- BOOT_TARGET_USB(func) \
- BOOT_TARGET_PXE(func) \
- BOOT_TARGET_DHCP(func)
#define BOOT_TARGETS "mmc1 mmc0 usb pxe dhcp" #endif
diff --git a/include/configs/rv1108_common.h b/include/configs/rv1108_common.h index 050d37bff0b5..3bf70a0e0ae2 100644 --- a/include/configs/rv1108_common.h +++ b/include/configs/rv1108_common.h @@ -28,6 +28,6 @@ ENV_MEM_LAYOUT_SETTINGS \ "fdtfile=" CONFIG_DEFAULT_FDT_FILE "\0" \ "partitions=" PARTS_DEFAULT \
- BOOTENV
- "boot_targets=" BOOT_TARGETS "\0"
#endif

On Sun, Apr 23, 2023 at 10:46:27PM +0000, Jonas Karlman wrote:
Hi Simon,
On 2023-04-08 22:44, Simon Glass wrote:
Drop the distro-boot scripts and use standard boot instead.
With the "Drop patches which enable BOOTSTD_DEFAULT" in v9 we must imply BOOTSTD_DEFAULTS or we run into the following on anything rk not rk3399.
## Error: "distro_bootcmd" not defined
Something like this was needed to get my devices booting using bootflow:
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -1956,8 +1956,7 @@ config ARCH_ROCKCHIP imply ADC imply CMD_DM imply DEBUG_UART_BOARD_INIT
imply DISTRO_DEFAULTS if !ROCKCHIP_RK3399
imply BOOTSTD_DEFAULTS if !DISTRO_DEFAULTS
imply BOOTSTD_DEFAULTS imply FAT_WRITE imply SARADC_ROCKCHIP imply SPL_SYSRESET
With above fixed,
Tested-by: Jonas Karlman jonas@kwiboo.se
using basic distro boot on following devices:
- RK3288: TinkerBoard R2.0
- RK3328: Rock64
- RK3399: Rock Pi 4B+
- RK3568: Rock 3A
- RK3588: Rock 5B
Yup, that indeed is missing. Can you please fold that in somewhere and re-spin Simon? And perhaps a u-boot-initial-env loop on all the rockchip platforms to make sure the environment is right, in the end? Thanks.

Hi Tom,
On Mon, 24 Apr 2023 at 11:35, Tom Rini trini@konsulko.com wrote:
On Sun, Apr 23, 2023 at 10:46:27PM +0000, Jonas Karlman wrote:
Hi Simon,
On 2023-04-08 22:44, Simon Glass wrote:
Drop the distro-boot scripts and use standard boot instead.
With the "Drop patches which enable BOOTSTD_DEFAULT" in v9 we must imply BOOTSTD_DEFAULTS or we run into the following on anything rk not rk3399.
## Error: "distro_bootcmd" not defined
Something like this was needed to get my devices booting using bootflow:
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -1956,8 +1956,7 @@ config ARCH_ROCKCHIP imply ADC imply CMD_DM imply DEBUG_UART_BOARD_INIT
imply DISTRO_DEFAULTS if !ROCKCHIP_RK3399
imply BOOTSTD_DEFAULTS if !DISTRO_DEFAULTS
imply BOOTSTD_DEFAULTS imply FAT_WRITE imply SARADC_ROCKCHIP imply SPL_SYSRESET
With above fixed,
Tested-by: Jonas Karlman jonas@kwiboo.se
using basic distro boot on following devices:
- RK3288: TinkerBoard R2.0
- RK3328: Rock64
- RK3399: Rock Pi 4B+
- RK3568: Rock 3A
- RK3588: Rock 5B
Yup, that indeed is missing. Can you please fold that in somewhere and re-spin Simon? And perhaps a u-boot-initial-env loop on all the rockchip platforms to make sure the environment is right, in the end? Thanks.
Thank you for testing, Jonas,
I'll add that fix and send v10. With that only evb-rv1108 has a bootcmd that isn't 'bootflow scan', since it has a custom command.
Regards, Simon

It doesn't really matter if we mention things which are not present. For example, if 'nvme' is included but the board does not support it, it just continues with the next item in the list.
It is simpler to use the same target list for all boards, so drop the different one for rk3399.
Signed-off-by: Simon Glass sjg@chromium.org ---
Changes in v9: - Drop patches which enable BOOTSTD_DEFAULT
Changes in v8: - Add cover letter
Changes in v7: - Don't resync after defconfig changes
Changes in v6: - Redo patch for the new approach
Changes in v5: - Drop patch to relax the argument requirements for bootflow scan
Changes in v4: - Rebase to -next - Add new patch to use the same boot_targets for all boards
include/configs/rockchip-common.h | 4 ---- 1 file changed, 4 deletions(-)
diff --git a/include/configs/rockchip-common.h b/include/configs/rockchip-common.h index e9f4072b7e78..9121bba37384 100644 --- a/include/configs/rockchip-common.h +++ b/include/configs/rockchip-common.h @@ -13,11 +13,7 @@
#ifndef CONFIG_SPL_BUILD
-#ifdef CONFIG_ROCKCHIP_RK3399 #define BOOT_TARGETS "mmc1 mmc0 nvme scsi usb pxe dhcp spi" -#else -#define BOOT_TARGETS "mmc1 mmc0 usb pxe dhcp" -#endif
#ifdef CONFIG_ARM64 #define ROOT_UUID "B921B045-1DF0-41C3-AF44-4C6F280D3FAE;\0"
participants (3)
-
Jonas Karlman
-
Simon Glass
-
Tom Rini