dra7: Add partition table entry and qspi boot config
Subsystems (2)
cover dra7: Add partition table entry and qspi boot config
The following patch series aims at
1. adding a seperate defconfig for qspi on dra7.
2. Also populate the qspi partition table for dra7 evm boards.
3. cleanup and fixes around qspi4 pin mode and bulk erase respectively.
Tested on J6 evm(PG1.1) with the following sysconfig boot settings. sysconfig[5:0] = 100111.
Here is the log till uboot prompt:
---------------------------------
U-Boot SPL 2014.04-rc3-00005-ge97693a (Apr 02 2014 - 15:35:24) DRA752 ES1.1
U-Boot 2014.04-rc3-00005-ge97693a (Apr 02 2014 - 15:35:24)
CPU : DRA752 ES1.1 Board: DRA7xx I2C: ready DRAM: 1.5 GiB MMC: OMAP SD/MMC: 0, OMAP SD/MMC: 1 SCSI: SF: Detected S25FL256S_64K with page size 256 Bytes, erase size 64 KiB, total 32 MiB, mapped at 5c000000
*** Warning - bad CRC, using default environment
SATA link 0 timeout.
AHCI 0001.0300 32 slots 1 ports 3 Gbps 0x1 impl SATA mode
flags: 64bit ncq stag pm led clo only pmp pio slum part ccc apst scanning bus for devices...
Found 0 device(s).
Net: <ethaddr> not set. Validating first E-fuse MAC
cpsw
Warning: Your board does not use generic board. Please read doc/README.generic-board and take action. Boards not upgraded by the late 2014 may break or be removed.
Hit any key to stop autoboot: 0
Sourav Poddar (5):
board.cfg: am43xx: Add QSPI boot config.
qspi: add support for qspi4 device
configs: dra7-evm: Add mtd parts info for qspi.
configs: dra7-evm: change uboot offset
spi: ti_qspi: Add delay for successful bulk erase.
arch/arm/include/asm/arch-omap5/spl.h | 4 +++ boards.cfg | 2 ++ drivers/spi/ti_qspi.c | 3 +++ include/configs/dra7xx_evm.h | 48 ++++++++++++++++++++++++++++++++- 4 files changed, 56 insertions(+), 1 deletion(-)
Signature · 1 line
1.7.9.5
PATCH 1/5 board.cfg: dra7: Add QSPI boot config.
These add a qspi boot config for dra7 board.
--- boards.cfg | 2 ++ 1 file changed, 2 insertions(+)
boards.cfg +2 -0
@@ -356,6 +356,8 @@ Active arm armv7 omap4 ti panda Active arm armv7 omap4 ti sdp4430 omap4_sdp4430 - Sricharan R <[email protected]> Active arm armv7 omap5 ti dra7xx dra7xx_evm dra7xx_evm:CONS_INDEX=1 Lokesh Vutla <[email protected]> Active arm armv7 omap5 ti dra7xx dra7xx_evm_uart3 dra7xx_evm:CONS_INDEX=3,SPL_YMODEM_SUPPORT Lokesh Vutla <[email protected]> +Active arm armv7 omap5 ti dra7xx dra7xx_evm_qspiboot dra7xx_evm:CONS_INDEX=1,QSPI_BOOT + Sourav Poddar <[email protected]> Active arm armv7 omap5 ti omap5_uevm omap5_uevm - - Active arm armv7 rmobile atmark-techno armadillo-800eva armadillo-800eva - Nobuhiro Iwamatsu <[email protected]> Active arm armv7 rmobile kmc kzm9g kzm9g - Nobuhiro Iwamatsu <[email protected]>:Tetsuyuki Kobayashi <[email protected]>
Signature · 1 line
1.7.9.5
PATCH 2/5 qspi: add support for qspi4 device
In reply to Sourav PoddarAdd support to enable boot from qspi in qspi4 pin mode.
--- arch/arm/include/asm/arch-omap5/spl.h | 4 ++++ 1 file changed, 4 insertions(+)
arch/arm/include/asm/arch-omap5/spl.h +4 -0
@@ -16,7 +16,11 @@#define BOOT_DEVICE_MMC2 6#define BOOT_DEVICE_MMC2_2 7#define BOOT_DEVICE_SATA 9 +#ifdef CONFIG_QSPI_BOOT +#define BOOT_DEVICE_SPI 11 +#else #define BOOT_DEVICE_SPI 10 +#endif #define BOOT_DEVICE_UART 0x43#define MMC_BOOT_DEVICES_START BOOT_DEVICE_MMC1
Signature · 1 line
1.7.9.5
PATCH 3/5 configs: dra7-evm: Add mtd parts info for qspi.
In reply to Sourav PoddarAdd MTD partition info for qspi on dra7 evm
--- include/configs/dra7xx_evm.h | 46 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+)
include/configs/dra7xx_evm.h +46 -0
@@ -75,6 +75,52 @@#define CONFIG_SF_DEFAULT_SPEED 48000000#define CONFIG_DEFAULT_SPI_MODE SPI_MODE_3 +/* +* Default to using SPI for environment, etc. +* 0x000000 - 0x010000 : QSPI.SPL (64KiB) +* 0x010000 - 0x020000 : QSPI.SPL.backup1 (64KiB) +* 0x020000 - 0x030000 : QSPI.SPL.backup2 (64KiB) +* 0x030000 - 0x040000 : QSPI.SPL.backup3 (64KiB) +* 0x040000 - 0x140000 : QSPI.u-boot (1MiB) +* 0x140000 - 0x150000 : QSPI.u-boot-spl-os (64KiB) +* 0x150000 - 0x160000 : QSPI.u-boot-env (64KiB) +* 0x160000 - 0x170000 : QSPI.u-boot-env.backup1 (64KiB) +* 0x170000 - 0x970000 : QSPI.kernel (8MiB) +* 0x970000 - 0x2000000 : USERLAND +*/ +#if defined(CONFIG_QSPI_BOOT ) +#undef CONFIG_ENV_IS_IN_MMC +#define CONFIG_ENV_IS_IN_SPI_FLASH +#define CONFIG_SYS_REDUNDAND_ENVIRONMENT +#define CONFIG_ENV_SPI_MAX_HZ CONFIG_SF_DEFAULT_SPEED +#undef CONFIG_SPL_MAX_SIZE +#define CONFIG_SPL_MAX_SIZE (64 << 10)/* 64 KiB */ +#define CONFIG_ENV_SECT_SIZE (64 << 10)/* 64 KB sectors */ +#undef CONFIG_ENV_OFFSET +#define CONFIG_ENV_OFFSET 0x150000 +#undef CONFIG_ENV_OFFSET_REDUND +#define CONFIG_ENV_OFFSET_REDUND 0x160000 + +#ifdef MTDIDS_DEFAULT +#undef MTDIDS_DEFAULT +#endif +#define MTDIDS_DEFAULT "nor0=m25p80-flash.0" + +#ifdef MTDPARTS_DEFAULT +#undef MTDPARTS_DEFAULT +#endif +#define MTDPARTS_DEFAULT "mtdparts=qspi.0:64k(SPL)," \ + "64k(QSPI.SPL.backup1)," \ + "64k(QSPI.SPL.backup2)," \ + "64k(QSPI.SPL.backup3)," \ + "1m(QSPI.u-boot)," \ + "64k(QSPI.u-boot-spl-os)," \ + "64k(QSPI.u-boot-env)," \ + "64k(QSPI.u-boot-env.backup1)," \ + "8m(QSPI.kernel)," \ + "-(QSPI.rootfs)" +#endif +/* SPI SPL */ #define CONFIG_SPL_SPI_SUPPORT #define CONFIG_SPL_SPI_LOAD
Signature · 1 line
1.7.9.5
PATCH 3/5 configs: dra7-evm: Add mtd parts info for qspi.
Quoted 3 lines · Sourav Poddar
Add MTD partition info for qspi on dra7 evm
Signed-off-by Sourav Poddar <[email protected]>
[snip]
Quoted 8 lines
+/*
+ * Default to using SPI for environment, etc.
+ *0x000000-0x010000: QSPI.SPL (64KiB)
+ *0x010000-0x020000: QSPI.SPL.backup1 (64KiB)
+ *0x020000-0x030000: QSPI.SPL.backup2 (64KiB)
+ *0x030000-0x040000: QSPI.SPL.backup3 (64KiB)
+ *0x040000-0x140000: QSPI.u-boot (1MiB)
+ *0x140000-0x150000: QSPI.u-boot-spl-os (64KiB)
This is too small, I found out when adding falcon mode support for this board. We need to bump this to 512KiB and then re-adjust what follows.
include/configs/dra7xx_evm.h line 92
Quoted 2 lines
include/configs/dra7xx_evm.h +2
-0+#if defined(CONFIG_QSPI_BOOT ) +#undef CONFIG_ENV_IS_IN_MMC
... This needs adjusting too, we should only be setting CONFIG_ENV_IS_IN_MMC on !QSPI_BOOT, up in the MMC area.
And related, we need to fix ti_omap5_common.h to not set CONFIG_ENV_SIZE because right now it's setting 128KiB and our redundant location never would have valid data.
I'll pick this all up in a v2 and address it, along with a few other things. Thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20140402/0619d8bc/attachment.pgp>
PATCH 3/5 configs: dra7-evm: Add mtd parts info for qspi.
In reply to Sourav PoddarQuoted 54 lines · Sourav Poddar
Add MTD partition info for qspi on dra7 evm
Signed-off-by Sourav Poddar <[email protected]>--- include/configs/dra7xx_evm.h | 46 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+)include/configs/dra7xx_evm.h +39
-0@@ -75,6 +75,52 @@#define CONFIG_SF_DEFAULT_SPEED 48000000#define CONFIG_DEFAULT_SPI_MODE SPI_MODE_3 +/* +* Default to using SPI for environment, etc. +* 0x000000 - 0x010000 : QSPI.SPL (64KiB) +* 0x010000 - 0x020000 : QSPI.SPL.backup1 (64KiB) +* 0x020000 - 0x030000 : QSPI.SPL.backup2 (64KiB) +* 0x030000 - 0x040000 : QSPI.SPL.backup3 (64KiB) +* 0x040000 - 0x140000 : QSPI.u-boot (1MiB) +* 0x140000 - 0x150000 : QSPI.u-boot-spl-os (64KiB) +* 0x150000 - 0x160000 : QSPI.u-boot-env (64KiB) +* 0x160000 - 0x170000 : QSPI.u-boot-env.backup1 (64KiB) +* 0x170000 - 0x970000 : QSPI.kernel (8MiB) +* 0x970000 - 0x2000000 : USERLAND +*/ +#if defined(CONFIG_QSPI_BOOT ) +#undef CONFIG_ENV_IS_IN_MMC +#define CONFIG_ENV_IS_IN_SPI_FLASH +#define CONFIG_SYS_REDUNDAND_ENVIRONMENT +#define CONFIG_ENV_SPI_MAX_HZ CONFIG_SF_DEFAULT_SPEED +#undef CONFIG_SPL_MAX_SIZE +#define CONFIG_SPL_MAX_SIZE (64 << 10)/* 64 KiB */ +#define CONFIG_ENV_SECT_SIZE (64 << 10)/* 64 KB sectors */ +#undef CONFIG_ENV_OFFSET +#define CONFIG_ENV_OFFSET 0x150000 +#undef CONFIG_ENV_OFFSET_REDUND +#define CONFIG_ENV_OFFSET_REDUND 0x160000 + +#ifdef MTDIDS_DEFAULT +#undef MTDIDS_DEFAULT +#endif +#define MTDIDS_DEFAULT "nor0=m25p80-flash.0" + +#ifdef MTDPARTS_DEFAULT +#undef MTDPARTS_DEFAULT +#endif +#define MTDPARTS_DEFAULT "mtdparts=qspi.0:64k(SPL)," \ + "64k(QSPI.SPL.backup1)," \ + "64k(QSPI.SPL.backup2)," \ + "64k(QSPI.SPL.backup3)," \ + "1m(QSPI.u-boot)," \
include/configs/dra7xx_evm.h line 126
Quoted 10 lines
include/configs/dra7xx_evm.h +7
-0+"64k(QSPI.u-boot-spl-os)," \ +"64k(QSPI.u-boot-env)," \ +"64k(QSPI.u-boot-env.backup1)," \ +"8m(QSPI.kernel)," \ + "-(QSPI.rootfs)" +#endif +/* SPI SPL */ #define CONFIG_SPL_SPI_SUPPORT #define CONFIG_SPL_SPI_LOAD
Can you add log file for this qspi mtd tests on your next version patches. Good to have this as we didn't mtd partitioning on qspi yet.
thanks!
Signature · 1 line
Jagan.
PATCH 3/5 configs: dra7-evm: Add mtd parts info for qspi.
Quoted 68 lines · Jagan Teki
Quoted 54 lines · Sourav Poddar
Add MTD partition info for qspi on dra7 evm
Signed-off-by Sourav Poddar<[email protected]>--- include/configs/dra7xx_evm.h | 46 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+)include/configs/dra7xx_evm.h +39
-0@@ -75,6 +75,52 @@#define CONFIG_SF_DEFAULT_SPEED 48000000#define CONFIG_DEFAULT_SPI_MODE SPI_MODE_3 +/* +* Default to using SPI for environment, etc. +* 0x000000 - 0x010000 : QSPI.SPL (64KiB) +* 0x010000 - 0x020000 : QSPI.SPL.backup1 (64KiB) +* 0x020000 - 0x030000 : QSPI.SPL.backup2 (64KiB) +* 0x030000 - 0x040000 : QSPI.SPL.backup3 (64KiB) +* 0x040000 - 0x140000 : QSPI.u-boot (1MiB) +* 0x140000 - 0x150000 : QSPI.u-boot-spl-os (64KiB) +* 0x150000 - 0x160000 : QSPI.u-boot-env (64KiB) +* 0x160000 - 0x170000 : QSPI.u-boot-env.backup1 (64KiB) +* 0x170000 - 0x970000 : QSPI.kernel (8MiB) +* 0x970000 - 0x2000000 : USERLAND +*/ +#if defined(CONFIG_QSPI_BOOT ) +#undef CONFIG_ENV_IS_IN_MMC +#define CONFIG_ENV_IS_IN_SPI_FLASH +#define CONFIG_SYS_REDUNDAND_ENVIRONMENT +#define CONFIG_ENV_SPI_MAX_HZ CONFIG_SF_DEFAULT_SPEED +#undef CONFIG_SPL_MAX_SIZE +#define CONFIG_SPL_MAX_SIZE (64<< 10)/* 64 KiB */ +#define CONFIG_ENV_SECT_SIZE (64<< 10)/* 64 KB sectors */ +#undef CONFIG_ENV_OFFSET +#define CONFIG_ENV_OFFSET 0x150000 +#undef CONFIG_ENV_OFFSET_REDUND +#define CONFIG_ENV_OFFSET_REDUND 0x160000 + +#ifdef MTDIDS_DEFAULT +#undef MTDIDS_DEFAULT +#endif +#define MTDIDS_DEFAULT "nor0=m25p80-flash.0" + +#ifdef MTDPARTS_DEFAULT +#undef MTDPARTS_DEFAULT +#endif +#define MTDPARTS_DEFAULT "mtdparts=qspi.0:64k(SPL)," \ + "64k(QSPI.SPL.backup1)," \ + "64k(QSPI.SPL.backup2)," \ + "64k(QSPI.SPL.backup3)," \ + "1m(QSPI.u-boot)," \include/configs/dra7xx_evm.h line 126
Quoted 10 lines
include/configs/dra7xx_evm.h +7
-0+"64k(QSPI.u-boot-spl-os)," \ +"64k(QSPI.u-boot-env)," \ +"64k(QSPI.u-boot-env.backup1)," \ +"8m(QSPI.kernel)," \ + "-(QSPI.rootfs)" +#endif +/* SPI SPL */ #define CONFIG_SPL_SPI_SUPPORT #define CONFIG_SPL_SPI_LOAD Can you add log file for this qspi mtd tests on your next version patches. Good to have this as we didn't mtd partitioning on qspi yet.
Quoted 1 line
thanks!
Tom is planning to send the next version with few other cleanups. Once, he does that, I will add a log file on top of that for my testing?
PATCH 4/5 configs: dra7-evm: change uboot offset
In reply to Sourav PoddarChange uboot offset in accordance with the partition formed.
--- include/configs/dra7xx_evm.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
include/configs/dra7xx_evm.h +1 -1
@@ -127,7 +127,7 @@#define CONFIG_SPL_SPI_FLASH_SUPPORT #define CONFIG_SPL_SPI_BUS 0#define CONFIG_SPL_SPI_CS 0 -#define CONFIG_SYS_SPI_U_BOOT_OFFS 0x20000 +#define CONFIG_SYS_SPI_U_BOOT_OFFS 0x40000#define CONFIG_SUPPORT_EMMC_BOOT
Signature · 1 line
1.7.9.5
PATCH 5/5 spi: ti_qspi: Add delay for successful bulk erase.
In reply to Sourav PoddarBulk erase is not happening properly on dra7 due to erase timing constraints, add a delay so that erase timing constraints are properly met.
--- drivers/spi/ti_qspi.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/spi/ti_qspi.c +3 -0
@@ -314,6 +314,9 @@ int spi_xfer(struct spi_slave *slave, unsigned int bitlen, const void *dout, qslave->cmd |=QSPI_RD_SNGL ;debug ("rx cmd %08x dc %08x\n" , qslave->cmd, qslave->dc); +#ifdef CONFIG_DRA7XX +udelay (500 ); +#endif writel (qslave->cmd, &qslave->base->cmd); status =readl (&qslave->base->status); timeout =QSPI_TIMEOUT ;
Signature · 1 line
1.7.9.5
PATCH 5/5 spi: ti_qspi: Add delay for successful bulk erase.
Hi Sourav,
Quoted 14 lines · Sourav Poddar
Bulk erase is not happening properly on dra7 due to erase timing constraints, add a delay so that erase timing constraints are properly met.
Signed-off-by Sourav Poddar <[email protected]>Tested-by Yebio Mesfin <[email protected]>--- drivers/spi/ti_qspi.c | 3 +++ 1 file changed, 3 insertions(+)drivers/spi/ti_qspi.c +0
-0
drivers/spi/ti_qspi.c int spi_xfer(struct spi_slave *slave, unsigned int bitlen, const void *dout, · line 319
Quoted 6 lines
drivers/spi/ti_qspi.c +3
-0@@ -314,6 +314,9 @@ int spi_xfer(struct spi_slave *slave, unsigned int bitlen, const void *dout, qslave->cmd |=QSPI_RD_SNGL ;debug ("rx cmd %08x dc %08x\n" , qslave->cmd, qslave->dc); +#ifdef CONFIG_DRA7XX +udelay (500 ); +#endif
I myself not conveyed these delays on spi_xfer() (looks odd to me), we already have AM43XX delay on code, can't it be possible to manage through status poll?
thanks!
--
Jagan.
This email and any attachments are intended for the sole use of the named recipient(s) and contain(s) confidential information that may be proprietary, privileged or copyrighted under applicable law. If you are not the intended recipient, do not read, copy, or forward this email message or any attachments. Delete this email message and any attachments immediately.
PATCH 5/5 spi: ti_qspi: Add delay for successful bulk erase.
Quoted 13 lines · Jagan Teki
Hi Sourav,
Quoted 10 lines · Sourav Poddar
Bulk erase is not happening properly on dra7 due to erase timing constraints,
add a delay so that erase timing constraints are properly met.Signed-off-by Sourav Poddar <[email protected]>Tested-by Yebio Mesfin <[email protected]>--- drivers/spi/ti_qspi.c | 3 +++ 1 file changed, 3 insertions(+)
Quoted 16 lines
drivers/spi/ti_qspi.c int spi_xfer(struct spi_slave *slave, unsigned · line 320
Quoted 12 lines
drivers/spi/ti_qspi.c +3
-0@@ -314,6 +314,9 @@ int spi_xfer(struct spi_slave *slave, unsigned int bitlen, const void *dout, qslave->cmd |= QSPI_RD_SNGL;debug ("rx cmd %08x dc %08x\n" , qslave->cmd, qslave->dc); +#ifdef CONFIG_DRA7XX +udelay (500 ); +#endif I myself not conveyed these delays on
spi_xfer()(looks odd to me), we already have AM43XX delay on code, can't it be possible to manage through status poll?
I know, its little out of place but with status poll way, erase is inconsistent, might be some board timing constraints. Hence, I am force to add this delay for dra board.
Quoted 15 lines
I tried the status poll way, but erase is inconsistent, might be some board timing constraints.
thanks!Signature · 9 lines
Jagan. This email and any attachments are intended for the sole use of the named recipient(s) and contain(s) confidential information that may be proprietary, privileged or copyrighted under applicable law. If you are not the intended recipient, do not read, copy, or forward this email message or any attachments. Delete this email message and any attachments immediately.
PATCH 5/5 spi: ti_qspi: Add delay for successful bulk erase.
Hi Sourav,
Quoted 34 lines · Sourav Poddar
Quoted 24 lines · Jagan Teki
Hi Sourav,
Quoted 20 lines · Sourav Poddar
Bulk erase is not happening properly on dra7 due to erase timing constraints,
add a delay so that erase timing constraints are properly met.Signed-off-by Sourav Poddar <[email protected]>Tested-by Yebio Mesfin <[email protected]>--- drivers/spi/ti_qspi.c | 3 +++ 1 file changed, 3 insertions(+)drivers/spi/ti_qspi.c +0
-0@@ -314,6 +314,9 @@ int spi_xfer(struct spi_slave *slave, unsigned int bitlen, const void *dout, qslave->cmd |=QSPI_RD_SNGL ;debug ("rx cmd %08x dc %08x\n" , qslave->cmd, qslave->dc);Quoted 8 lines
drivers/spi/ti_qspi.c int spi_xfer(struct spi_slave *slave, unsigned int bitlen, const void *dout, · line 319
Quoted 3 lines
drivers/spi/ti_qspi.c +3
-0+#ifdef CONFIG_DRA7XX +udelay (500 ); +#endif I myself not conveyed these delays on
spi_xfer()(looks odd to me), we already have AM43XX delay on code, can't it be possible to manage through status poll?
Quoted 6 lines
I know, its little out of place but with status poll way, erase is inconsistent, might be some board timing constraints. Hence, I am force to add this delay for dra board.
Quoted 2 lines
I tried the status poll way, but erase is inconsistent, might be some board timing constraints.
Understand your point as board timings have some unknown constraints for causing these
delays, but it's not good to hack qspi driver instead of some other place(board init parts, hw fix).
I expect a delay fix patch for your previous AM43XX delay.
May be we could think over it here, it's not good to expose the driver with delays on ML
instead of private/local tree.
Hope you understand my point.
thanks!
Signature · 1 line
Jagan.