diff options
| author | Tom Rini <[email protected]> | 2021-09-27 11:09:23 -0400 |
|---|---|---|
| committer | Tom Rini <[email protected]> | 2021-09-27 11:09:23 -0400 |
| commit | 1d1f98c8eed7bb4792300e655c2cb70136928f74 (patch) | |
| tree | d08df140d52bd1298fa0e81ce908e2e09a880e5d /common | |
| parent | e908d20fcbd847e17345591fc171b59d9a156516 (diff) | |
| parent | 933bf2644591281ed96f9d5771cbb35fe95bcb00 (diff) | |
Merge tag 'dm-pull-next-27sep21' of https://source.denx.de/u-boot/custodians/u-boot-dm into next
Various of-platdata improvements, including CONFIG_OF_REAL
Diffstat (limited to 'common')
| -rw-r--r-- | common/autoboot.c | 8 | ||||
| -rw-r--r-- | common/board_r.c | 4 | ||||
| -rw-r--r-- | common/cli.c | 7 | ||||
| -rw-r--r-- | common/spl/spl.c | 2 | ||||
| -rw-r--r-- | common/spl/spl_spi.c | 12 |
5 files changed, 15 insertions, 18 deletions
diff --git a/common/autoboot.c b/common/autoboot.c index 5bb2e190895..6251c683108 100644 --- a/common/autoboot.c +++ b/common/autoboot.c @@ -24,6 +24,7 @@ #include <u-boot/sha256.h> #include <bootcount.h> #include <crypt.h> +#include <dm/ofnode.h> DECLARE_GLOBAL_DATA_PTR; @@ -424,12 +425,12 @@ static void process_fdt_options(const void *blob) ulong addr; /* Add an env variable to point to a kernel payload, if available */ - addr = fdtdec_get_config_int(gd->fdt_blob, "kernel-offset", 0); + addr = ofnode_conf_read_int("kernel-offset", 0); if (addr) env_set_addr("kernaddr", (void *)(CONFIG_SYS_TEXT_BASE + addr)); /* Add an env variable to point to a root disk, if available */ - addr = fdtdec_get_config_int(gd->fdt_blob, "rootdisk-offset", 0); + addr = ofnode_conf_read_int("rootdisk-offset", 0); if (addr) env_set_addr("rootaddr", (void *)(CONFIG_SYS_TEXT_BASE + addr)); #endif /* CONFIG_SYS_TEXT_BASE */ @@ -446,8 +447,7 @@ const char *bootdelay_process(void) bootdelay = s ? (int)simple_strtol(s, NULL, 10) : CONFIG_BOOTDELAY; if (IS_ENABLED(CONFIG_OF_CONTROL)) - bootdelay = fdtdec_get_config_int(gd->fdt_blob, "bootdelay", - bootdelay); + bootdelay = ofnode_conf_read_int("bootdelay", bootdelay); debug("### main_loop entered: bootdelay=%d\n\n", bootdelay); diff --git a/common/board_r.c b/common/board_r.c index 0cbe5f7f3d7..31a59c585a8 100644 --- a/common/board_r.c +++ b/common/board_r.c @@ -67,6 +67,7 @@ #endif #include <asm/sections.h> #include <dm/root.h> +#include <dm/ofnode.h> #include <linux/compiler.h> #include <linux/err.h> #include <efi_loader.h> @@ -448,8 +449,7 @@ static int initr_pvblock(void) static int should_load_env(void) { if (IS_ENABLED(CONFIG_OF_CONTROL)) - return fdtdec_get_config_int(gd->fdt_blob, - "load-environment", 1); + return ofnode_conf_read_int("load-environment", 1); if (IS_ENABLED(CONFIG_DELAY_ENVIRONMENT)) return 0; diff --git a/common/cli.c b/common/cli.c index 048eacb9ef9..d86046a728b 100644 --- a/common/cli.c +++ b/common/cli.c @@ -19,8 +19,7 @@ #include <hang.h> #include <malloc.h> #include <asm/global_data.h> - -DECLARE_GLOBAL_DATA_PTR; +#include <dm/ofnode.h> #ifdef CONFIG_CMDLINE /* @@ -157,7 +156,7 @@ int do_run(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) bool cli_process_fdt(const char **cmdp) { /* Allow the fdt to override the boot command */ - char *env = fdtdec_get_config_string(gd->fdt_blob, "bootcmd"); + const char *env = ofnode_conf_read_str("bootcmd"); if (env) *cmdp = env; /* @@ -165,7 +164,7 @@ bool cli_process_fdt(const char **cmdp) * Always use 'env' in this case, since bootsecure requres that the * bootcmd was specified in the FDT too. */ - return fdtdec_get_config_int(gd->fdt_blob, "bootsecure", 0) != 0; + return ofnode_conf_read_int("bootsecure", 0); } /* diff --git a/common/spl/spl.c b/common/spl/spl.c index 31516e1eeda..ed94d5146cc 100644 --- a/common/spl/spl.c +++ b/common/spl/spl.c @@ -489,7 +489,7 @@ static int spl_common_init(bool setup_malloc) return ret; } #endif - if (CONFIG_IS_ENABLED(OF_CONTROL) && !CONFIG_IS_ENABLED(OF_PLATDATA)) { + if (CONFIG_IS_ENABLED(OF_REAL)) { ret = fdtdec_setup(); if (ret) { debug("fdtdec_setup() returned error %d\n", ret); diff --git a/common/spl/spl_spi.c b/common/spl/spl_spi.c index 9884e7c1850..46ee4058e76 100644 --- a/common/spl/spl_spi.c +++ b/common/spl/spl_spi.c @@ -16,8 +16,7 @@ #include <errno.h> #include <spl.h> #include <asm/global_data.h> - -DECLARE_GLOBAL_DATA_PTR; +#include <dm/ofnode.h> #ifdef CONFIG_SPL_OS_BOOT /* @@ -103,11 +102,10 @@ static int spl_spi_load_image(struct spl_image_info *spl_image, header = spl_get_load_buffer(-sizeof(*header), sizeof(*header)); -#if CONFIG_IS_ENABLED(OF_CONTROL) && !CONFIG_IS_ENABLED(OF_PLATDATA) - payload_offs = fdtdec_get_config_int(gd->fdt_blob, - "u-boot,spl-payload-offset", - payload_offs); -#endif + if (CONFIG_IS_ENABLED(OF_REAL)) { + payload_offs = ofnode_conf_read_int("u-boot,spl-payload-offset", + payload_offs); + } #ifdef CONFIG_SPL_OS_BOOT if (spl_start_uboot() || spi_load_image_os(spl_image, flash, header)) |
