public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH v1 2/2] ti814x_evm: enable support for NAND
@ 2013-09-16  9:51 Gupta, Pekon
  2013-09-19 18:09 ` Tom Rini
  0 siblings, 1 reply; 5+ messages in thread
From: Gupta, Pekon @ 2013-09-16  9:51 UTC (permalink / raw)
  To: u-boot

> On Tue, Aug 06, 2013 at 01:45:08PM +0530, Pekon Gupta wrote:
> 
> > ti814x_evm has on-board socket for using Micron (MT29Fxx) family of
> > NAND devices to GPMC interface. This patch
> > - adds NAND related pin-mux configuration for same
> > - adds #defines for NAND partitions to TI814x configs
> > - enables support for NAND in TI814x configs
[snip]
> 
> > @@ -186,6 +193,14 @@
> >  #define CONFIG_SYS_U_BOOT_MAX_SIZE_SECTORS      0x200 /* 256 KB */
> >  #define CONFIG_SYS_MMC_SD_FAT_BOOT_PARTITION    1
> >  #define CONFIG_SPL_FAT_LOAD_PAYLOAD_NAME        "u-boot.img"
> > +
> > +#ifdef CONFIG_SPL_OS_BOOT
> > +/* nand */
> > +#define CONFIG_CMD_SPL_NAND_OFS			0x000000 /*
> end of u-boot */
> > +#define CONFIG_SYS_NAND_SPL_KERNEL_OFFS		0x280000
> > +#define CONFIG_CMD_SPL_WRITE_SIZE		0x1000
> > +#endif
> 
> Since you aren't adding the SD/MMC defines as well, nor setting
> SPL_OS_BOOT, lets drop these.
> 
Sorry but dint get your feedback.
Following are used in SPL boot for loading env and kernel in falcon mode.
Referring: $UBOOT/common/spl/spl_nand.c
- CONFIG_SYS_NAND_SPL_KERNEL_OFFS
- CONFIG_CMD_SPL_WRITE_SIZE 
- CONFIG_CMD_SPL_NAND_OFS
May be I put them in wrong place in include/configs/ti814x.h but these
are required for NAND SPL boot. Please confirm ?

> > @@ -242,5 +283,32 @@
> >  #define CONFIG_PHY_ADDR			1
> >  #define CONFIG_PHY_ET1011C
> >  #define CONFIG_PHY_ET1011C_TX_CLK_FIX
> > +#define CONFIG_NAND
> > +/* NAND support */
> > +#ifdef CONFIG_NAND
> > +#define CONFIG_MTD_NAND_OMAP_BCH
> > +#define CONFIG_CMD_NAND
> > +#define CONFIG_CMD_MTDPARTS
> > +#define MTDIDS_DEFAULT			"nand0=omap2-nand.0"
> > +#define MTDPARTS_DEFAULT		"mtdparts=omap2-
> nand.0:128k(SPL)," \
> > +					"128k(u-boot-spl)," \
> > +					"2M(u-boot-main)," \
> > +					"128k(u-boot-env),4M(kernel),-
> (rootfs)"
> 
> Lets get the partition tables right, we've still got 4 locations where
> ROM checks for something, so lets use those for SPL, then U-Boot, then
> U-Boot Env (redundant as well, please), and a block saved off for device
> tree/SPL OS "args" support, then kernel, rootfs.
> 
I think TI814x ROM use different NAND layout than AM33xx devices.
I used following NAND layout given in link below as reference:
http://processors.wiki.ti.com/index.php/TI81XX_PSP_UBOOT_User_Guide#EVM_Switch_Settings
These devices belong to omap3 family, but now are merged with am33xx.

> > +#define CONFIG_NAND_OMAP_GPMC
> > +#define GPMC_NAND_ECC_LP_x16_LAYOUT	1
> > +#define NAND_BASE			(0x08000000)
> 
> Don't need NAND_BASE.
Ok thanks.

- Also removing GPMC_NAND_ECC_LP_x16_LAYOUT  as predefined
  nand_ecclayouts in omap_gpmc.h are not used anymore.
- Trying to remove dependency on CONFIG_NAND_OMAP_GPMC as
  except legacy devices all new platform support ELM based ECC schemes.

> 
> > +#define CONFIG_SYS_NAND_BASE	(0x08000000)	/* physical
> address */
> > +		/* to access nand at> */
> > +		/* CS0 */
> > +#define CONFIG_SYS_MAX_NAND_DEVICE	1	
> > +/* Max  number of NAND	   devices */
> > +#define CONFIG_SYS_NAND_BOOT
> > +#if !defined(CONFIG_SPI_BOOT)
> > +#undef CONFIG_ENV_IS_NOWHERE
> > +#define CONFIG_ENV_IS_IN_NAND
> > +#define CONFIG_ENV_OFFSET		0x260000 /* environment
> starts here */
> > +#define CONFIG_SYS_ENV_SECT_SIZE	(128 << 10)	/* 128 KiB */
> > +#endif
> > +#endif
> 
> And we don't support SPI boot or anything here, so lets just always do
> env on NAND until we have support for other things as well.  Thanks!
> 
Ok. yes I'll remove them..

with regards, pekon

^ permalink raw reply	[flat|nested] 5+ messages in thread
* [U-Boot] [PATCH v1 1/2] am33xx: enable GPMC clocks for TI814x
@ 2013-08-06  9:40 Pekon Gupta
  2013-08-06  9:40 ` [U-Boot] [PATCH v1 2/2] ti814x_evm: enable support for NAND Pekon Gupta
  0 siblings, 1 reply; 5+ messages in thread
From: Pekon Gupta @ 2013-08-06  9:40 UTC (permalink / raw)
  To: u-boot

GPMC registers need to be pre-initialized for NAND and NOR probe.
So this patch brings out GPMC H/W engine from IDLE state.

Signed-off-by: Pekon Gupta <pekon@ti.com>
---
 arch/arm/cpu/armv7/am33xx/clock_ti814x.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/arch/arm/cpu/armv7/am33xx/clock_ti814x.c b/arch/arm/cpu/armv7/am33xx/clock_ti814x.c
index 658772b..149590e 100644
--- a/arch/arm/cpu/armv7/am33xx/clock_ti814x.c
+++ b/arch/arm/cpu/armv7/am33xx/clock_ti814x.c
@@ -269,6 +269,11 @@ static void enable_per_clocks(void)
 	while (readl(&cmalwon->uart0clkctrl) != PRCM_MOD_EN)
 		;
 
+	/* GPMC */
+	writel(PRCM_MOD_EN, &cmalwon->gpmcclkctrl);
+	while (readl(&cmalwon->gpmcclkctrl) != PRCM_MOD_EN)
+		;
+
 	/* HSMMC1 */
 	writel(PRCM_MOD_EN, &cmalwon->mmchs1clkctrl);
 	while (readl(&cmalwon->mmchs1clkctrl) != PRCM_MOD_EN)
-- 
1.8.1

^ permalink raw reply related	[flat|nested] 5+ messages in thread
* [U-Boot] [PATCH v1 1/2] am33xx: enable GPMC clocks for TI814x
@ 2013-08-06  8:15 Pekon Gupta
  2013-08-06  8:15 ` [U-Boot] [PATCH v1 2/2] ti814x_evm: enable support for NAND Pekon Gupta
  0 siblings, 1 reply; 5+ messages in thread
From: Pekon Gupta @ 2013-08-06  8:15 UTC (permalink / raw)
  To: u-boot

GPMC registers need to be pre-initialized for NAND and NOR probe.
So this patch brings out GPMC H/W engine from IDLE state.

Signed-off-by: Pekon Gupta <pekon@ti.com>
---
 arch/arm/cpu/armv7/am33xx/clock_ti814x.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/arch/arm/cpu/armv7/am33xx/clock_ti814x.c b/arch/arm/cpu/armv7/am33xx/clock_ti814x.c
index 658772b..149590e 100644
--- a/arch/arm/cpu/armv7/am33xx/clock_ti814x.c
+++ b/arch/arm/cpu/armv7/am33xx/clock_ti814x.c
@@ -269,6 +269,11 @@ static void enable_per_clocks(void)
 	while (readl(&cmalwon->uart0clkctrl) != PRCM_MOD_EN)
 		;
 
+	/* GPMC */
+	writel(PRCM_MOD_EN, &cmalwon->gpmcclkctrl);
+	while (readl(&cmalwon->gpmcclkctrl) != PRCM_MOD_EN)
+		;
+
 	/* HSMMC1 */
 	writel(PRCM_MOD_EN, &cmalwon->mmchs1clkctrl);
 	while (readl(&cmalwon->mmchs1clkctrl) != PRCM_MOD_EN)
-- 
1.8.1

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2013-09-19 18:09 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-16  9:51 [U-Boot] [PATCH v1 2/2] ti814x_evm: enable support for NAND Gupta, Pekon
2013-09-19 18:09 ` Tom Rini
  -- strict thread matches above, loose matches on Subject: below --
2013-08-06  9:40 [U-Boot] [PATCH v1 1/2] am33xx: enable GPMC clocks for TI814x Pekon Gupta
2013-08-06  9:40 ` [U-Boot] [PATCH v1 2/2] ti814x_evm: enable support for NAND Pekon Gupta
2013-08-06  8:15 [U-Boot] [PATCH v1 1/2] am33xx: enable GPMC clocks for TI814x Pekon Gupta
2013-08-06  8:15 ` [U-Boot] [PATCH v1 2/2] ti814x_evm: enable support for NAND Pekon Gupta
2013-08-28 15:03   ` Tom Rini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox