]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
xilinx: zynq: add FDT_FIXUP_PARTITIONS support
authorJames Hilliard <james.hilliard1@gmail.com>
Sun, 31 Mar 2024 23:28:59 +0000 (17:28 -0600)
committerMichal Simek <michal.simek@amd.com>
Wed, 3 Apr 2024 13:28:11 +0000 (15:28 +0200)
There are situations where we may want to let U-Boot modify the FDT
nand partitions for the kernel, such as when supporting multiple
sizes of NAND chips.

Signed-off-by: James Hilliard <james.hilliard1@gmail.com>
Link: https://lore.kernel.org/r/20240331232859.727769-1-james.hilliard1@gmail.com
Signed-off-by: Michal Simek <michal.simek@amd.com>
board/xilinx/common/board.c

index 17291a9d3b940c36aa0623a04976eec16e487812..f5117012d62c9ffe7c7337a365e45fa12bd56790 100644 (file)
@@ -12,6 +12,7 @@
 #include <env.h>
 #include <image.h>
 #include <init.h>
+#include <jffs2/load_kernel.h>
 #include <lmb.h>
 #include <log.h>
 #include <asm/global_data.h>
@@ -20,6 +21,7 @@
 #include <i2c.h>
 #include <linux/sizes.h>
 #include <malloc.h>
+#include <mtd_node.h>
 #include "board.h"
 #include <dm.h>
 #include <i2c_eeprom.h>
@@ -701,6 +703,13 @@ int ft_board_setup(void *blob, struct bd_info *bd)
        u8 buf[MAX_RAND_SIZE];
        int nodeoffset, ret;
 
+       static const struct node_info nodes[] = {
+               { "arm,pl353-nand-r2p1", MTD_DEV_TYPE_NAND, },
+       };
+
+       if (IS_ENABLED(CONFIG_FDT_FIXUP_PARTITIONS) && IS_ENABLED(CONFIG_NAND_ZYNQ))
+               fdt_fixup_mtdparts(blob, nodes, ARRAY_SIZE(nodes));
+
        if (uclass_get_device(UCLASS_RNG, 0, &dev) || !dev) {
                debug("No RNG device\n");
                return 0;