]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
powerpc/mpc85xx: socrates: add MTD partitioning support
authorHeiko Schocher <hs@denx.de>
Tue, 24 Jan 2023 17:06:53 +0000 (18:06 +0100)
committerTom Rini <trini@konsulko.com>
Mon, 6 Feb 2023 18:04:53 +0000 (13:04 -0500)
setup MTD partitioning through mtdparts variable
and set it to:

mtdparts=fe0000000.nor:13312k(system1),13312k(system2),5120k(data),128k(env),128k(env-red),768k(u-boot)

and pass this to linux per kernel commandline.

Signed-off-by: Heiko Schocher <hs@denx.de>
configs/socrates_defconfig
include/configs/socrates.h

index 03e84c3e7e55dff8ffdbfe16b64517d6b25319d1..17c12aed7d926d12a535fa3c235c639c49104ac0 100644 (file)
@@ -53,6 +53,9 @@ CONFIG_CMD_PING=y
 CONFIG_CMD_SNTP=y
 # CONFIG_CMD_HASH is not set
 CONFIG_CMD_EXT2=y
+CONFIG_CMD_MTDPARTS=y
+CONFIG_MTDIDS_DEFAULT="nor0=fe000000.nor_flash,nand0=socrates_nand"
+CONFIG_MTDPARTS_DEFAULT="mtdparts=fe000000.nor_flash:13312k(system1),13312k(system2),5120k(data),128k(env),128k(env-red),768k(u-boot);socrates_nand:256M(ubi-data1),-(ubi-data2)"
 # CONFIG_CMD_IRQ is not set
 CONFIG_OF_CONTROL=y
 CONFIG_ENV_IS_IN_FLASH=y
@@ -78,9 +81,11 @@ CONFIG_DM_I2C=y
 CONFIG_SYS_I2C_FSL=y
 # CONFIG_MMC is not set
 CONFIG_MTD=y
+CONFIG_DM_MTD=y
 CONFIG_MTD_NOR_FLASH=y
 CONFIG_FLASH_CFI_DRIVER=y
 CONFIG_FLASH_SHOW_PROGRESS=0
+CONFIG_FLASH_CFI_MTD=y
 CONFIG_SYS_FLASH_CFI=y
 CONFIG_SYS_FLASH_QUIET_TEST=y
 CONFIG_SYS_MAX_FLASH_SECT=256
index 2b35be83ec651eeaa7ee1b5a62ad10b9112f7581..67ff370e05c953f6158f1391d81d9e3797f587a5 100644 (file)
  */
 #define CFG_SYS_BOOTMAPSZ      (8 << 20)       /* Initial Memory map for Linux */
 
+#define SOCRATES_ENV_MTD \
+       "mtdids=" CONFIG_MTDIDS_DEFAULT "\0" \
+       "mtdparts=" CONFIG_MTDPARTS_DEFAULT "\0" \
+       "addmtd=setenv bootargs ${bootargs} ${mtdparts}\0"
 
 #define        CFG_EXTRA_ENV_SETTINGS                                  \
        "netdev=eth0\0"                                                 \
        "bootfile=/home/tftp/syscon3/uImage\0"                          \
        "fdt_file=/home/tftp/syscon3/socrates.dtb\0"                    \
        "initrd_file=/home/tftp/syscon3/uinitrd.gz\0"                   \
-       "uboot_addr=FFF60000\0"                                         \
+       "uboot_addr=FFF40000\0"                                         \
        "kernel_addr=FE000000\0"                                        \
        "fdt_addr=FE1E0000\0"                                           \
        "ramdisk_addr=FE200000\0"                                       \
        "addip=setenv bootargs $bootargs "                              \
                "ip=$ipaddr:$serverip:$gatewayip:$netmask"              \
                ":$hostname:$netdev:off panic=1\0"                      \
-       "boot_nor=run ramargs addcons;"                                 \
+       "boot_nor=run ramargs addcons addmtd;"                          \
                "bootm ${kernel_addr} ${ramdisk_addr} ${fdt_addr}\0"    \
        "net_nfs=tftp ${kernel_addr_r} ${bootfile}; "                   \
                "tftp ${fdt_addr_r} ${fdt_file}; "                      \
-               "run nfsargs addip addcons;"                            \
+               "run nfsargs addip addcons addmtd;"                     \
                "bootm ${kernel_addr_r} - ${fdt_addr_r}\0"              \
        "update_uboot=tftp 100000 ${uboot_file};"                       \
-               "protect off fff60000 ffffffff;"                        \
-               "era fff60000 ffffffff;"                                \
-               "cp.b 100000 fff60000 ${filesize};"                     \
+               "protect off ${uboot_addr} ffffffff;"                   \
+               "era ${uboot_addr}  ffffffff;"                          \
+               "cp.b 100000 ${uboot_addr}  ${filesize};"               \
                "setenv filesize;saveenv\0"                             \
        "update_kernel=tftp 100000 ${bootfile};"                        \
                "era fe000000 fe1dffff;"                                \
        "boot_usb=run load_usb usbargs addcons;"                        \
                "bootm ${kernel_addr_r} - ${fdt_addr};"                 \
                "bootm ${kernel_addr} ${ramdisk_addr} ${fdt_addr}\0"    \
+       SOCRATES_ENV_MTD \
        ""
 
 /* pass open firmware flat tree */