[U-Boot] [PATCH v2 1/5] arm: socfpga: Enable ubi and ubifs support

When QSPI and NAND is enabled, the ubi and ubifs support will be enabled too.
Signed-off-by: Chin Liang See clsee@altera.com Cc: Dinh Nguyen dinguyen@opensource.altera.com Cc: Dinh Nguyen dinh.linux@gmail.com Cc: Pavel Machek pavel@denx.de Cc: Marek Vasut marex@denx.de Cc: Stefan Roese sr@denx.de --- Changes for v2 - move CONFIG_SPI_FLASH_USE_4K_SECTORS to Kconfig --- include/configs/socfpga_common.h | 8 ++++++++ 1 file changed, 8 insertions(+)
diff --git a/include/configs/socfpga_common.h b/include/configs/socfpga_common.h index f7c0eb5..dfc3ed5 100644 --- a/include/configs/socfpga_common.h +++ b/include/configs/socfpga_common.h @@ -300,6 +300,14 @@ unsigned int cm_get_qspi_controller_clk_hz(void); "-@1536k(UBI)\0" #endif
+/* UBI and UBIFS support */ +#if defined(CONFIG_CMD_SF) || defined(CONFIG_CMD_NAND) +#define CONFIG_CMD_UBI +#define CONFIG_CMD_UBIFS +#define CONFIG_RBTREE +#define CONFIG_LZO +#endif + /* * SPL *

Undefine CONFIG_SPI_FLASH_USE_4K_SECTORS for UBI and UBIFS support on serial NOR flash
Signed-off-by: Chin Liang See clsee@altera.com Cc: Dinh Nguyen dinguyen@opensource.altera.com Cc: Dinh Nguyen dinh.linux@gmail.com Cc: Pavel Machek pavel@denx.de Cc: Marek Vasut marex@denx.de Cc: Stefan Roese sr@denx.de --- Changes for v2 - move CONFIG_SPI_FLASH_USE_4K_SECTORS to Kconfig --- configs/socfpga_cyclone5_defconfig | 1 + 1 file changed, 1 insertion(+)
diff --git a/configs/socfpga_cyclone5_defconfig b/configs/socfpga_cyclone5_defconfig index 864358c..4216b55 100644 --- a/configs/socfpga_cyclone5_defconfig +++ b/configs/socfpga_cyclone5_defconfig @@ -23,3 +23,4 @@ CONFIG_DESIGNWARE_SPI=y CONFIG_DM_MMC=y CONFIG_USB=y CONFIG_DM_USB=y +CONFIG_SPI_FLASH_USE_4K_SECTORS=n

On Tuesday, December 22, 2015 at 01:59:46 AM, Chin Liang See wrote:
Undefine CONFIG_SPI_FLASH_USE_4K_SECTORS for UBI and UBIFS support on serial NOR flash
Signed-off-by: Chin Liang See clsee@altera.com Cc: Dinh Nguyen dinguyen@opensource.altera.com Cc: Dinh Nguyen dinh.linux@gmail.com Cc: Pavel Machek pavel@denx.de Cc: Marek Vasut marex@denx.de Cc: Stefan Roese sr@denx.de
Changes for v2
- move CONFIG_SPI_FLASH_USE_4K_SECTORS to Kconfig
configs/socfpga_cyclone5_defconfig | 1 + 1 file changed, 1 insertion(+)
diff --git a/configs/socfpga_cyclone5_defconfig b/configs/socfpga_cyclone5_defconfig index 864358c..4216b55 100644 --- a/configs/socfpga_cyclone5_defconfig +++ b/configs/socfpga_cyclone5_defconfig @@ -23,3 +23,4 @@ CONFIG_DESIGNWARE_SPI=y CONFIG_DM_MMC=y CONFIG_USB=y CONFIG_DM_USB=y +CONFIG_SPI_FLASH_USE_4K_SECTORS=n
And for arriaV ... ? And sockit ? ;-)
Best regards, Marek Vasut

On Tue, 2015-12-22 at 02:15 +0100, Marek Vasut wrote:
On Tuesday, December 22, 2015 at 01:59:46 AM, Chin Liang See wrote:
Undefine CONFIG_SPI_FLASH_USE_4K_SECTORS for UBI and UBIFS support on serial NOR flash
Signed-off-by: Chin Liang See clsee@altera.com Cc: Dinh Nguyen dinguyen@opensource.altera.com Cc: Dinh Nguyen dinh.linux@gmail.com Cc: Pavel Machek pavel@denx.de Cc: Marek Vasut marex@denx.de Cc: Stefan Roese sr@denx.de
Changes for v2
- move CONFIG_SPI_FLASH_USE_4K_SECTORS to Kconfig
configs/socfpga_cyclone5_defconfig | 1 + 1 file changed, 1 insertion(+)
diff --git a/configs/socfpga_cyclone5_defconfig b/configs/socfpga_cyclone5_defconfig index 864358c..4216b55 100644 --- a/configs/socfpga_cyclone5_defconfig +++ b/configs/socfpga_cyclone5_defconfig @@ -23,3 +23,4 @@ CONFIG_DESIGNWARE_SPI=y CONFIG_DM_MMC=y CONFIG_USB=y CONFIG_DM_USB=y +CONFIG_SPI_FLASH_USE_4K_SECTORS=n
And for arriaV ... ? And sockit ? ;-)
haha too obsess testing on CV board :) Let me include them into these series.
Thanks Chin Liang
Best regards, Marek Vasut

On Tuesday, December 22, 2015 at 02:55:05 AM, Chin Liang See wrote:
On Tue, 2015-12-22 at 02:15 +0100, Marek Vasut wrote:
On Tuesday, December 22, 2015 at 01:59:46 AM, Chin Liang See wrote:
Undefine CONFIG_SPI_FLASH_USE_4K_SECTORS for UBI and UBIFS support on serial NOR flash
Signed-off-by: Chin Liang See clsee@altera.com Cc: Dinh Nguyen dinguyen@opensource.altera.com Cc: Dinh Nguyen dinh.linux@gmail.com Cc: Pavel Machek pavel@denx.de Cc: Marek Vasut marex@denx.de Cc: Stefan Roese sr@denx.de
Changes for v2
- move CONFIG_SPI_FLASH_USE_4K_SECTORS to Kconfig
configs/socfpga_cyclone5_defconfig | 1 + 1 file changed, 1 insertion(+)
diff --git a/configs/socfpga_cyclone5_defconfig b/configs/socfpga_cyclone5_defconfig index 864358c..4216b55 100644 --- a/configs/socfpga_cyclone5_defconfig +++ b/configs/socfpga_cyclone5_defconfig @@ -23,3 +23,4 @@ CONFIG_DESIGNWARE_SPI=y
CONFIG_DM_MMC=y CONFIG_USB=y CONFIG_DM_USB=y
+CONFIG_SPI_FLASH_USE_4K_SECTORS=n
And for arriaV ... ? And sockit ? ;-)
haha too obsess testing on CV board :) Let me include them into these series.
These should be the only three boards which use QSPI NOR.
SoCrates, MCV and DE0 do not have QSPI NOR. SR1500 I believe also doesn't have one.
Best regards, Marek Vasut

On Tue, 2015-12-22 at 03:09 +0100, Marek Vasut wrote:
On Tuesday, December 22, 2015 at 02:55:05 AM, Chin Liang See wrote:
On Tue, 2015-12-22 at 02:15 +0100, Marek Vasut wrote:
On Tuesday, December 22, 2015 at 01:59:46 AM, Chin Liang See wrote:
Undefine CONFIG_SPI_FLASH_USE_4K_SECTORS for UBI and UBIFS support on serial NOR flash
Signed-off-by: Chin Liang See clsee@altera.com Cc: Dinh Nguyen dinguyen@opensource.altera.com Cc: Dinh Nguyen dinh.linux@gmail.com Cc: Pavel Machek pavel@denx.de Cc: Marek Vasut marex@denx.de Cc: Stefan Roese sr@denx.de
Changes for v2
- move CONFIG_SPI_FLASH_USE_4K_SECTORS to Kconfig
configs/socfpga_cyclone5_defconfig | 1 + 1 file changed, 1 insertion(+)
diff --git a/configs/socfpga_cyclone5_defconfig b/configs/socfpga_cyclone5_defconfig index 864358c..4216b55 100644 --- a/configs/socfpga_cyclone5_defconfig +++ b/configs/socfpga_cyclone5_defconfig @@ -23,3 +23,4 @@ CONFIG_DESIGNWARE_SPI=y
CONFIG_DM_MMC=y CONFIG_USB=y CONFIG_DM_USB=y
+CONFIG_SPI_FLASH_USE_4K_SECTORS=n
And for arriaV ... ? And sockit ? ;-)
haha too obsess testing on CV board :) Let me include them into these series.
These should be the only three boards which use QSPI NOR.
SoCrates, MCV and DE0 do not have QSPI NOR. SR1500 I believe also doesn't have one.
Nice, dun need to scratch my head :)
Thanks Chin Liang
Best regards, Marek Vasut

On 22.12.2015 03:09, Marek Vasut wrote:
On Tuesday, December 22, 2015 at 02:55:05 AM, Chin Liang See wrote:
On Tue, 2015-12-22 at 02:15 +0100, Marek Vasut wrote:
On Tuesday, December 22, 2015 at 01:59:46 AM, Chin Liang See wrote:
Undefine CONFIG_SPI_FLASH_USE_4K_SECTORS for UBI and UBIFS support on serial NOR flash
Signed-off-by: Chin Liang See clsee@altera.com Cc: Dinh Nguyen dinguyen@opensource.altera.com Cc: Dinh Nguyen dinh.linux@gmail.com Cc: Pavel Machek pavel@denx.de Cc: Marek Vasut marex@denx.de Cc: Stefan Roese sr@denx.de
Changes for v2
- move CONFIG_SPI_FLASH_USE_4K_SECTORS to Kconfig
configs/socfpga_cyclone5_defconfig | 1 + 1 file changed, 1 insertion(+)
diff --git a/configs/socfpga_cyclone5_defconfig b/configs/socfpga_cyclone5_defconfig index 864358c..4216b55 100644 --- a/configs/socfpga_cyclone5_defconfig +++ b/configs/socfpga_cyclone5_defconfig @@ -23,3 +23,4 @@ CONFIG_DESIGNWARE_SPI=y
CONFIG_DM_MMC=y CONFIG_USB=y CONFIG_DM_USB=y
+CONFIG_SPI_FLASH_USE_4K_SECTORS=n
And for arriaV ... ? And sockit ? ;-)
haha too obsess testing on CV board :) Let me include them into these series.
These should be the only three boards which use QSPI NOR.
SoCrates, MCV and DE0 do not have QSPI NOR. SR1500 I believe also doesn't have one.
SR1500 does have QSPI NOR. Its the boot device.
Thanks, Stefan

On Tue, 2015-12-22 at 07:07 +0100, Stefan Roese wrote:
On 22.12.2015 03:09, Marek Vasut wrote:
On Tuesday, December 22, 2015 at 02:55:05 AM, Chin Liang See wrote:
On Tue, 2015-12-22 at 02:15 +0100, Marek Vasut wrote:
On Tuesday, December 22, 2015 at 01:59:46 AM, Chin Liang See wrote:
[..]
diff --git a/configs/socfpga_cyclone5_defconfig b/configs/socfpga_cyclone5_defconfig index 864358c..4216b55 100644 --- a/configs/socfpga_cyclone5_defconfig +++ b/configs/socfpga_cyclone5_defconfig @@ -23,3 +23,4 @@ CONFIG_DESIGNWARE_SPI=y
CONFIG_DM_MMC=y CONFIG_USB=y CONFIG_DM_USB=y
+CONFIG_SPI_FLASH_USE_4K_SECTORS=n
And for arriaV ... ? And sockit ? ;-)
haha too obsess testing on CV board :) Let me include them into these series.
These should be the only three boards which use QSPI NOR.
SoCrates, MCV and DE0 do not have QSPI NOR. SR1500 I believe also doesn't have one.
SR1500 does have QSPI NOR. Its the boot device.
Just in time as going to create v3 now :)
Thanks Chin Liang
Thanks,
Stefan

On Tue 2015-12-22 08:59:46, Chin Liang See wrote:
Undefine CONFIG_SPI_FLASH_USE_4K_SECTORS for UBI and UBIFS support on serial NOR flash
Signed-off-by: Chin Liang See clsee@altera.com Cc: Dinh Nguyen dinguyen@opensource.altera.com Cc: Dinh Nguyen dinh.linux@gmail.com Cc: Pavel Machek pavel@denx.de Cc: Marek Vasut marex@denx.de Cc: Stefan Roese sr@denx.de
Changes for v2
- move CONFIG_SPI_FLASH_USE_4K_SECTORS to Kconfig
configs/socfpga_cyclone5_defconfig | 1 + 1 file changed, 1 insertion(+)
diff --git a/configs/socfpga_cyclone5_defconfig b/configs/socfpga_cyclone5_defconfig index 864358c..4216b55 100644 --- a/configs/socfpga_cyclone5_defconfig +++ b/configs/socfpga_cyclone5_defconfig @@ -23,3 +23,4 @@ CONFIG_DESIGNWARE_SPI=y CONFIG_DM_MMC=y CONFIG_USB=y CONFIG_DM_USB=y +CONFIG_SPI_FLASH_USE_4K_SECTORS=n
Actually, do we usually specify =n in config files? It seems to be so rare it is an error.
Normally, we have something like "# CONFIG_SYS_MALLOC_F is not set" in config files.
Pavel

On Wed, 2015-12-23 at 19:13 +0100, Pavel Machek wrote:
On Tue 2015-12-22 08:59:46, Chin Liang See wrote:
Undefine CONFIG_SPI_FLASH_USE_4K_SECTORS for UBI and UBIFS support on serial NOR flash
Signed-off-by: Chin Liang See clsee@altera.com Cc: Dinh Nguyen dinguyen@opensource.altera.com Cc: Dinh Nguyen dinh.linux@gmail.com Cc: Pavel Machek pavel@denx.de Cc: Marek Vasut marex@denx.de Cc: Stefan Roese sr@denx.de
Changes for v2
- move CONFIG_SPI_FLASH_USE_4K_SECTORS to Kconfig
configs/socfpga_cyclone5_defconfig | 1 + 1 file changed, 1 insertion(+)
diff --git a/configs/socfpga_cyclone5_defconfig b/configs/socfpga_cyclone5_defconfig index 864358c..4216b55 100644 --- a/configs/socfpga_cyclone5_defconfig +++ b/configs/socfpga_cyclone5_defconfig @@ -23,3 +23,4 @@ CONFIG_DESIGNWARE_SPI=y CONFIG_DM_MMC=y CONFIG_USB=y CONFIG_DM_USB=y +CONFIG_SPI_FLASH_USE_4K_SECTORS=n
Actually, do we usually specify =n in config files? It seems to be so rare it is an error.
Normally, we have something like "# CONFIG_SYS_MALLOC_F is not set" in config files.
yah, this was fixed by Marek.
Thanks Chin Liang
Pavel

Enabling ubiload command to load kernel image and device tree from mtd part labeled "UBI". ubiload command will search the file from directory /boot.
Signed-off-by: Chin Liang See clsee@altera.com Cc: Dinh Nguyen dinguyen@opensource.altera.com Cc: Dinh Nguyen dinh.linux@gmail.com Cc: Pavel Machek pavel@denx.de Cc: Marek Vasut marex@denx.de Cc: Stefan Roese sr@denx.de --- Changes for v2 - use && instead of ; for ubiload - update commit message --- include/configs/socfpga_cyclone5_socdk.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/include/configs/socfpga_cyclone5_socdk.h b/include/configs/socfpga_cyclone5_socdk.h index 3c2e2ae..72a3cef 100644 --- a/include/configs/socfpga_cyclone5_socdk.h +++ b/include/configs/socfpga_cyclone5_socdk.h @@ -74,7 +74,10 @@ "qspirootfstype=jffs2\0" \ "qspiboot=setenv bootargs " CONFIG_BOOTARGS \ " root=${qspiroot} rw rootfstype=${qspirootfstype};"\ - "bootm ${loadaddr} - ${fdt_addr}\0" + "bootm ${loadaddr} - ${fdt_addr}\0" \ + "ubiload=ubi part UBI && ubifsmount ubi0 && " \ + "ubifsload ${loadaddr} /boot/${bootimage} && " \ + "ubifsload ${fdt_addr} /boot/${fdtimage}\0"
/* The rest of the configuration is shared */ #include <configs/socfpga_common.h>

Enabling qspiload command which will load the kernel image and dtb from UBIFS within MTD partition labeled UBI.
Signed-off-by: Chin Liang See clsee@altera.com Cc: Dinh Nguyen dinguyen@opensource.altera.com Cc: Dinh Nguyen dinh.linux@gmail.com Cc: Pavel Machek pavel@denx.de Cc: Marek Vasut marex@denx.de Cc: Stefan Roese sr@denx.de --- Changes for v2 - use && instead ; for qspiload --- include/configs/socfpga_cyclone5_socdk.h | 1 + 1 file changed, 1 insertion(+)
diff --git a/include/configs/socfpga_cyclone5_socdk.h b/include/configs/socfpga_cyclone5_socdk.h index 72a3cef..0ed7f42 100644 --- a/include/configs/socfpga_cyclone5_socdk.h +++ b/include/configs/socfpga_cyclone5_socdk.h @@ -70,6 +70,7 @@ "mmcload=mmc rescan;" \ "load mmc 0:1 ${loadaddr} ${bootimage};" \ "load mmc 0:1 ${fdt_addr} ${fdtimage}\0" \ + "qspiload=sf probe && mtdparts default && run ubiload\0" \ "qspiroot=/dev/mtdblock0\0" \ "qspirootfstype=jffs2\0" \ "qspiboot=setenv bootargs " CONFIG_BOOTARGS \

Update the qspiboot console command to use UBIFS instead of old jffs2 file system.
Signed-off-by: Chin Liang See clsee@altera.com Cc: Dinh Nguyen dinguyen@opensource.altera.com Cc: Dinh Nguyen dinh.linux@gmail.com Cc: Pavel Machek pavel@denx.de Cc: Marek Vasut marex@denx.de Cc: Stefan Roese sr@denx.de --- Changes for v2 - part of series --- include/configs/socfpga_cyclone5_socdk.h | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/include/configs/socfpga_cyclone5_socdk.h b/include/configs/socfpga_cyclone5_socdk.h index 0ed7f42..c4c4ecb 100644 --- a/include/configs/socfpga_cyclone5_socdk.h +++ b/include/configs/socfpga_cyclone5_socdk.h @@ -71,11 +71,9 @@ "load mmc 0:1 ${loadaddr} ${bootimage};" \ "load mmc 0:1 ${fdt_addr} ${fdtimage}\0" \ "qspiload=sf probe && mtdparts default && run ubiload\0" \ - "qspiroot=/dev/mtdblock0\0" \ - "qspirootfstype=jffs2\0" \ "qspiboot=setenv bootargs " CONFIG_BOOTARGS \ - " root=${qspiroot} rw rootfstype=${qspirootfstype};"\ - "bootm ${loadaddr} - ${fdt_addr}\0" \ + " ubi.mtd=1,64 root=ubi0:rootfs rw rootfstype=ubifs;"\ + "bootz ${loadaddr} - ${fdt_addr}\0" \ "ubiload=ubi part UBI && ubifsmount ubi0 && " \ "ubifsload ${loadaddr} /boot/${bootimage} && " \ "ubifsload ${fdt_addr} /boot/${fdtimage}\0"

On Tuesday, December 22, 2015 at 01:59:45 AM, Chin Liang See wrote:
When QSPI and NAND is enabled, the ubi and ubifs support will be enabled too.
Signed-off-by: Chin Liang See clsee@altera.com Cc: Dinh Nguyen dinguyen@opensource.altera.com Cc: Dinh Nguyen dinh.linux@gmail.com Cc: Pavel Machek pavel@denx.de Cc: Marek Vasut marex@denx.de Cc: Stefan Roese sr@denx.de
Changes for v2
- move CONFIG_SPI_FLASH_USE_4K_SECTORS to Kconfig
All but 2/5 looks good :)
Best regards, Marek Vasut
participants (4)
-
Chin Liang See
-
Marek Vasut
-
Pavel Machek
-
Stefan Roese