[PATCH] configs: xilinx: Enable configs required for ubifs

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[PATCH] configs: xilinx: Enable configs required for ubifs

Michal Simek-3
From: Ashok Reddy Soma <[hidden email]>

Enable required configs for using ubifs in uboot.

UBIFS testing procedure from u-boot:
Let's say we have two partitions in dt as below and want to format
partition1 "images" with ubifs.

        partition@0 {
                label = "boot";
                reg = <0x0 0x1000000>;
        };

        partition@1 {
                label = "images";
                reg = <0x1000000 0x7000000>;
        };

We will format the partition from linux and copy some files and access
from uboot later.
First thing, in linux config disable CONFIG_MTD_SPI_NOR_USE_4K_SECTORS.
this is required as ubifs expects min LEB size as 15*1024 bytes.

Use below commands in linux to format "images" partition with ubifs.

ubiformat /dev/mtd1
ubiattach /dev/ubi_ctrl -m 1
ubimkvol /dev/ubi0 -N images -m
mount -t ubifs ubi0:images /mnt

We can copy files to /mnt and unmount it.

To access this ubifs partition from uboot, run below commands.
(Don't forget to probe device before, e.g. sf probe 0 0 0)

setenv mtdids "nor0=nor0"
setenv mtdparts "mtdparts=nor0:16m(boot),112m(images)"
ubi part images
ubifsmount ubi0:images

make sure we match "mtdparts" to whatever is given in dt w.r.t partition
sizes.

"mtdparts" command will list the mtd partitions in u-boot.

Once ubifs is mounted, we can use "ubifsls" to list the files in that
partition and use "ubifsload <addr> <filename>" to load files from ubifs
partition to DDR.

Reading information about mtd layout from DT is not supported.

Signed-off-by: Ashok Reddy Soma <[hidden email]>
Signed-off-by: Michal Simek <[hidden email]>
---

 configs/xilinx_versal_virt_defconfig | 4 ++++
 configs/xilinx_zynqmp_virt_defconfig | 1 +
 2 files changed, 5 insertions(+)

diff --git a/configs/xilinx_versal_virt_defconfig b/configs/xilinx_versal_virt_defconfig
index 4c463f48eed5..f9edc727176f 100644
--- a/configs/xilinx_versal_virt_defconfig
+++ b/configs/xilinx_versal_virt_defconfig
@@ -25,12 +25,15 @@ CONFIG_CMD_DM=y
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
+CONFIG_CMD_MTD=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_TFTPPUT=y
 CONFIG_CMD_CACHE=y
 CONFIG_CMD_TIME=y
 CONFIG_CMD_TIMER=y
 CONFIG_CMD_EXT4_WRITE=y
+CONFIG_CMD_MTDPARTS=y
+CONFIG_CMD_UBI=y
 CONFIG_OF_BOARD=y
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_NET_RANDOM_ETHADDR=y
@@ -64,6 +67,7 @@ CONFIG_SPI_FLASH_STMICRO=y
 CONFIG_SPI_FLASH_SST=y
 CONFIG_SPI_FLASH_WINBOND=y
 # CONFIG_SPI_FLASH_USE_4K_SECTORS is not set
+CONFIG_SPI_FLASH_MTD=y
 CONFIG_PHY_MARVELL=y
 CONFIG_PHY_NATSEMI=y
 CONFIG_PHY_REALTEK=y
diff --git a/configs/xilinx_zynqmp_virt_defconfig b/configs/xilinx_zynqmp_virt_defconfig
index a0984c804534..00a53f36e47b 100644
--- a/configs/xilinx_zynqmp_virt_defconfig
+++ b/configs/xilinx_zynqmp_virt_defconfig
@@ -107,6 +107,7 @@ CONFIG_SPI_FLASH_STMICRO=y
 CONFIG_SPI_FLASH_SST=y
 CONFIG_SPI_FLASH_WINBOND=y
 # CONFIG_SPI_FLASH_USE_4K_SECTORS is not set
+CONFIG_SPI_FLASH_MTD=y
 CONFIG_PHY_MARVELL=y
 CONFIG_PHY_MICREL=y
 CONFIG_PHY_MICREL_KSZ90X1=y
--
2.28.0

Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] configs: xilinx: Enable configs required for ubifs

Michal Simek-4
čt 27. 8. 2020 v 14:03 odesílatel Michal Simek <[hidden email]> napsal:

>
> From: Ashok Reddy Soma <[hidden email]>
>
> Enable required configs for using ubifs in uboot.
>
> UBIFS testing procedure from u-boot:
> Let's say we have two partitions in dt as below and want to format
> partition1 "images" with ubifs.
>
>         partition@0 {
>                 label = "boot";
>                 reg = <0x0 0x1000000>;
>         };
>
>         partition@1 {
>                 label = "images";
>                 reg = <0x1000000 0x7000000>;
>         };
>
> We will format the partition from linux and copy some files and access
> from uboot later.
> First thing, in linux config disable CONFIG_MTD_SPI_NOR_USE_4K_SECTORS.
> this is required as ubifs expects min LEB size as 15*1024 bytes.
>
> Use below commands in linux to format "images" partition with ubifs.
>
> ubiformat /dev/mtd1
> ubiattach /dev/ubi_ctrl -m 1
> ubimkvol /dev/ubi0 -N images -m
> mount -t ubifs ubi0:images /mnt
>
> We can copy files to /mnt and unmount it.
>
> To access this ubifs partition from uboot, run below commands.
> (Don't forget to probe device before, e.g. sf probe 0 0 0)
>
> setenv mtdids "nor0=nor0"
> setenv mtdparts "mtdparts=nor0:16m(boot),112m(images)"
> ubi part images
> ubifsmount ubi0:images
>
> make sure we match "mtdparts" to whatever is given in dt w.r.t partition
> sizes.
>
> "mtdparts" command will list the mtd partitions in u-boot.
>
> Once ubifs is mounted, we can use "ubifsls" to list the files in that
> partition and use "ubifsload <addr> <filename>" to load files from ubifs
> partition to DDR.
>
> Reading information about mtd layout from DT is not supported.
>
> Signed-off-by: Ashok Reddy Soma <[hidden email]>
> Signed-off-by: Michal Simek <[hidden email]>
> ---
>
>  configs/xilinx_versal_virt_defconfig | 4 ++++
>  configs/xilinx_zynqmp_virt_defconfig | 1 +
>  2 files changed, 5 insertions(+)
>
> diff --git a/configs/xilinx_versal_virt_defconfig b/configs/xilinx_versal_virt_defconfig
> index 4c463f48eed5..f9edc727176f 100644
> --- a/configs/xilinx_versal_virt_defconfig
> +++ b/configs/xilinx_versal_virt_defconfig
> @@ -25,12 +25,15 @@ CONFIG_CMD_DM=y
>  CONFIG_CMD_GPIO=y
>  CONFIG_CMD_I2C=y
>  CONFIG_CMD_MMC=y
> +CONFIG_CMD_MTD=y
>  CONFIG_CMD_USB=y
>  CONFIG_CMD_TFTPPUT=y
>  CONFIG_CMD_CACHE=y
>  CONFIG_CMD_TIME=y
>  CONFIG_CMD_TIMER=y
>  CONFIG_CMD_EXT4_WRITE=y
> +CONFIG_CMD_MTDPARTS=y
> +CONFIG_CMD_UBI=y
>  CONFIG_OF_BOARD=y
>  CONFIG_SYS_RELOC_GD_ENV_ADDR=y
>  CONFIG_NET_RANDOM_ETHADDR=y
> @@ -64,6 +67,7 @@ CONFIG_SPI_FLASH_STMICRO=y
>  CONFIG_SPI_FLASH_SST=y
>  CONFIG_SPI_FLASH_WINBOND=y
>  # CONFIG_SPI_FLASH_USE_4K_SECTORS is not set
> +CONFIG_SPI_FLASH_MTD=y
>  CONFIG_PHY_MARVELL=y
>  CONFIG_PHY_NATSEMI=y
>  CONFIG_PHY_REALTEK=y
> diff --git a/configs/xilinx_zynqmp_virt_defconfig b/configs/xilinx_zynqmp_virt_defconfig
> index a0984c804534..00a53f36e47b 100644
> --- a/configs/xilinx_zynqmp_virt_defconfig
> +++ b/configs/xilinx_zynqmp_virt_defconfig
> @@ -107,6 +107,7 @@ CONFIG_SPI_FLASH_STMICRO=y
>  CONFIG_SPI_FLASH_SST=y
>  CONFIG_SPI_FLASH_WINBOND=y
>  # CONFIG_SPI_FLASH_USE_4K_SECTORS is not set
> +CONFIG_SPI_FLASH_MTD=y
>  CONFIG_PHY_MARVELL=y
>  CONFIG_PHY_MICREL=y
>  CONFIG_PHY_MICREL_KSZ90X1=y
> --
> 2.28.0
>

Applied.
M

--
Michal Simek, Ing. (M.Eng), OpenPGP -> KeyID: FE3D1F91
w: www.monstr.eu p: +42-0-721842854
Maintainer of Linux kernel - Xilinx Microblaze
Maintainer of Linux kernel - Xilinx Zynq ARM and ZynqMP ARM64 SoCs
U-Boot custodian - Xilinx Microblaze/Zynq/ZynqMP/Versal SoCs