diff options
Diffstat (limited to 'common')
-rw-r--r-- | common/Kconfig | 1 | ||||
-rw-r--r-- | common/Makefile | 1 | ||||
-rw-r--r-- | common/fdt_support.c | 31 |
3 files changed, 24 insertions, 9 deletions
diff --git a/common/Kconfig b/common/Kconfig index 1a1951f874e..c759952b80b 100644 --- a/common/Kconfig +++ b/common/Kconfig @@ -247,6 +247,7 @@ config USE_PREBOOT config PREBOOT string "preboot default value" depends on USE_PREBOOT + default "" help This is the default of "preboot" environment variable. diff --git a/common/Makefile b/common/Makefile index 8c92feb3999..c7e41ef3073 100644 --- a/common/Makefile +++ b/common/Makefile @@ -124,6 +124,7 @@ endif obj-y += cli.o obj-$(CONFIG_FSL_DDR_INTERACTIVE) += cli_simple.o cli_readline.o +obj-$(CONFIG_STM32MP1_DDR_INTERACTIVE) += cli_simple.o cli_readline.o obj-$(CONFIG_DFU_OVER_USB) += dfu.o obj-y += command.o obj-$(CONFIG_$(SPL_TPL_)LOG) += log.o diff --git a/common/fdt_support.c b/common/fdt_support.c index 4e7cf6ebe98..f31e9b0cc5a 100644 --- a/common/fdt_support.c +++ b/common/fdt_support.c @@ -722,11 +722,6 @@ int fdt_increase_size(void *fdt, int add_len) #include <jffs2/load_kernel.h> #include <mtd_node.h> -struct reg_cell { - unsigned int r0; - unsigned int r1; -}; - static int fdt_del_subnodes(const void *blob, int parent_offset) { int off, ndepth; @@ -785,9 +780,9 @@ int fdt_node_set_part_info(void *blob, int parent_offset, { struct list_head *pentry; struct part_info *part; - struct reg_cell cell; int off, ndepth = 0; int part_num, ret; + int sizecell; char buf[64]; ret = fdt_del_partitions(blob, parent_offset); @@ -795,6 +790,13 @@ int fdt_node_set_part_info(void *blob, int parent_offset, return ret; /* + * Check if size/address is 1 or 2 cells. + * We assume #address-cells and #size-cells have same value. + */ + sizecell = fdt_getprop_u32_default_node(blob, parent_offset, + 0, "#size-cells", 1); + + /* * Check if it is nand {}; subnode, adjust * the offset in this case */ @@ -842,10 +844,21 @@ add_ro: goto err_prop; } - cell.r0 = cpu_to_fdt32(part->offset); - cell.r1 = cpu_to_fdt32(part->size); add_reg: - ret = fdt_setprop(blob, newoff, "reg", &cell, sizeof(cell)); + if (sizecell == 2) { + ret = fdt_setprop_u64(blob, newoff, + "reg", part->offset); + if (!ret) + ret = fdt_appendprop_u64(blob, newoff, + "reg", part->size); + } else { + ret = fdt_setprop_u32(blob, newoff, + "reg", part->offset); + if (!ret) + ret = fdt_appendprop_u32(blob, newoff, + "reg", part->size); + } + if (ret == -FDT_ERR_NOSPACE) { ret = fdt_increase_size(blob, 512); if (!ret) |