[U-Boot] [UBOOT][PATCH 0/5] 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(-)

These add a qspi boot config for dra7 board.
Signed-off-by: Sourav Poddar sourav.poddar@ti.com --- boards.cfg | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/boards.cfg b/boards.cfg index 69c8936..d6d5bb3 100644 --- a/boards.cfg +++ b/boards.cfg @@ -356,6 +356,8 @@ Active arm armv7 omap4 ti panda Active arm armv7 omap4 ti sdp4430 omap4_sdp4430 - Sricharan R r.sricharan@ti.com Active arm armv7 omap5 ti dra7xx dra7xx_evm dra7xx_evm:CONS_INDEX=1 Lokesh Vutla lokeshvutla@ti.com Active arm armv7 omap5 ti dra7xx dra7xx_evm_uart3 dra7xx_evm:CONS_INDEX=3,SPL_YMODEM_SUPPORT Lokesh Vutla lokeshvutla@ti.com +Active arm armv7 omap5 ti dra7xx dra7xx_evm_qspiboot dra7xx_evm:CONS_INDEX=1,QSPI_BOOT + Sourav Poddar sourav.poddar@ti.com Active arm armv7 omap5 ti omap5_uevm omap5_uevm - - Active arm armv7 rmobile atmark-techno armadillo-800eva armadillo-800eva - Nobuhiro Iwamatsu nobuhiro.iwamatsu.yj@renesas.com Active arm armv7 rmobile kmc kzm9g kzm9g - Nobuhiro Iwamatsu nobuhiro.iwamatsu.yj@renesas.com:Tetsuyuki Kobayashi koba@kmckk.co.jp

Add support to enable boot from qspi in qspi4 pin mode.
Signed-off-by: Sourav Poddar sourav.poddar@ti.com --- arch/arm/include/asm/arch-omap5/spl.h | 4 ++++ 1 file changed, 4 insertions(+)
diff --git a/arch/arm/include/asm/arch-omap5/spl.h b/arch/arm/include/asm/arch-omap5/spl.h index f707998..77eb943 100644 --- a/arch/arm/include/asm/arch-omap5/spl.h +++ b/arch/arm/include/asm/arch-omap5/spl.h @@ -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

Add MTD partition info for qspi on dra7 evm
Signed-off-by: Sourav Poddar sourav.poddar@ti.com --- include/configs/dra7xx_evm.h | 46 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+)
diff --git a/include/configs/dra7xx_evm.h b/include/configs/dra7xx_evm.h index 291c538..68496dc 100644 --- a/include/configs/dra7xx_evm.h +++ b/include/configs/dra7xx_evm.h @@ -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

On Wed, Apr 02, 2014 at 04:06:11PM +0530, Sourav Poddar wrote:
Add MTD partition info for qspi on dra7 evm
Signed-off-by: Sourav Poddar sourav.poddar@ti.com
[snip]
+/*
- 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.
+#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!

On Wed, Apr 2, 2014 at 4:06 PM, Sourav Poddar sourav.poddar@ti.com wrote:
Add MTD partition info for qspi on dra7 evm
Signed-off-by: Sourav Poddar sourav.poddar@ti.com
include/configs/dra7xx_evm.h | 46 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+)
diff --git a/include/configs/dra7xx_evm.h b/include/configs/dra7xx_evm.h index 291c538..68496dc 100644 --- a/include/configs/dra7xx_evm.h +++ b/include/configs/dra7xx_evm.h @@ -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
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!

On Thursday 03 April 2014 11:59 AM, Jagan Teki wrote:
On Wed, Apr 2, 2014 at 4:06 PM, Sourav Poddarsourav.poddar@ti.com wrote:
Add MTD partition info for qspi on dra7 evm
Signed-off-by: Sourav Poddarsourav.poddar@ti.com
include/configs/dra7xx_evm.h | 46 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+)
diff --git a/include/configs/dra7xx_evm.h b/include/configs/dra7xx_evm.h index 291c538..68496dc 100644 --- a/include/configs/dra7xx_evm.h +++ b/include/configs/dra7xx_evm.h @@ -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
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!
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?

Change uboot offset in accordance with the partition formed.
Signed-off-by: Sourav Poddar sourav.poddar@ti.com --- include/configs/dra7xx_evm.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/configs/dra7xx_evm.h b/include/configs/dra7xx_evm.h index 68496dc..cd2f8d9 100644 --- a/include/configs/dra7xx_evm.h +++ b/include/configs/dra7xx_evm.h @@ -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

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 sourav.poddar@ti.com Tested-by: Yebio Mesfin ymesfin@ti.com --- drivers/spi/ti_qspi.c | 3 +++ 1 file changed, 3 insertions(+)
diff --git a/drivers/spi/ti_qspi.c b/drivers/spi/ti_qspi.c index dfa5d0c..c5d2245 100644 --- a/drivers/spi/ti_qspi.c +++ b/drivers/spi/ti_qspi.c @@ -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;

Hi Sourav,
On Wednesday 02 April 2014 04:06 PM, Sourav Poddar wrote:
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 sourav.poddar@ti.com Tested-by: Yebio Mesfin ymesfin@ti.com
drivers/spi/ti_qspi.c | 3 +++ 1 file changed, 3 insertions(+)
diff --git a/drivers/spi/ti_qspi.c b/drivers/spi/ti_qspi.c index dfa5d0c..c5d2245 100644 --- a/drivers/spi/ti_qspi.c +++ b/drivers/spi/ti_qspi.c @@ -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.

On Thursday 03 April 2014 11:30 AM, Jagan Teki wrote:
Hi Sourav,
On Wednesday 02 April 2014 04:06 PM, Sourav Poddar wrote:
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 sourav.poddar@ti.com Tested-by: Yebio Mesfin ymesfin@ti.com
drivers/spi/ti_qspi.c | 3 +++ 1 file changed, 3 insertions(+)
diff --git a/drivers/spi/ti_qspi.c b/drivers/spi/ti_qspi.c index dfa5d0c..c5d2245 100644 --- a/drivers/spi/ti_qspi.c +++ b/drivers/spi/ti_qspi.c @@ -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.
I tried the status poll way, but erase is inconsistent, might be some board timing constraints. 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.

Hi Sourav,
On Thu, Apr 3, 2014 at 11:46 AM, Sourav Poddar sourav.poddar@ti.com wrote:
On Thursday 03 April 2014 11:30 AM, Jagan Teki wrote:
Hi Sourav,
On Wednesday 02 April 2014 04:06 PM, Sourav Poddar wrote:
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 sourav.poddar@ti.com Tested-by: Yebio Mesfin ymesfin@ti.com
drivers/spi/ti_qspi.c | 3 +++ 1 file changed, 3 insertions(+)
diff --git a/drivers/spi/ti_qspi.c b/drivers/spi/ti_qspi.c index dfa5d0c..c5d2245 100644 --- a/drivers/spi/ti_qspi.c +++ b/drivers/spi/ti_qspi.c @@ -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.
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!
participants (4)
-
Jagan Teki
-
Jagan Teki
-
Sourav Poddar
-
Tom Rini