Skip to contentSkip to conversation

am33xx: enable GPMC clocks for TI814x

PATCH New Pekon Gupta 2 participants 3 messages Aug 6, 2013 – Aug 28, 2013 Arm (32-bit)

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 am33xx: enable GPMC clocks for TI814x

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

---
 arch/arm/cpu/armv7/am33xx/clock_ti814x.c | 5 +++++
 1 file changed, 5 insertions(+)
arch/arm/cpu/armv7/am33xx/clock_ti814x.c +5 -0
index 658772b..149590e 100644
@@ -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)
Signature · 1 line
1.8.1
#1 lore raw

PATCH 2/2 ti814x_evm: enable support for NAND

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
-

---
 board/ti/ti814x/evm.c        |  4 +++
 board/ti/ti814x/evm.h        |  1 +
 board/ti/ti814x/mux.c        | 59 +++++++++++++++++++++++++++++++++++++
 include/configs/ti814x_evm.h | 70 +++++++++++++++++++++++++++++++++++++++++++-
 4 files changed, 133 insertions(+), 1 deletion(-)
board/ti/ti814x/evm.c +4 -0
index 17fba5a..165cdf4 100644
@@ -140,6 +140,9 @@ void s_init(void)
 	/* Set Ethernet pins */
 	enable_enet_pin_mux();
 
+	/* Set NAND pins */
+	enable_nand_pin_mux();
+
 	/* Enable UART */
 	uart_enable();
 
@@ -162,6 +165,7 @@ void s_init(void)
 int board_init(void)
 {
 	gd->bd->bi_boot_params = PHYS_DRAM_1 + 0x100;
+	gpmc_init();
 	return 0;
 }
 
board/ti/ti814x/evm.h +1 -0
index 6aebec6..113ccc0 100644
@@ -4,5 +4,6 @@
 void enable_uart0_pin_mux(void);
 void enable_mmc1_pin_mux(void);
 void enable_enet_pin_mux(void);
+void enable_nand_pin_mux(void);
 
 #endif /* _EVM_H */
board/ti/ti814x/mux.c +59 -0

68 lines not on this page · raw message

include/configs/ti814x_evm.h +69 -1

105 lines not on this page · raw message

Signature · 1 line
1.8.1
#2 lore raw

PATCH 2/2 ti814x_evm: enable support for NAND

Quoted 5 lines · Pekon Gupta

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]

Quoted 9 lines
include/configs/ti814x_evm.h +1 -0
@@ -56,6 +55,7 @@
 	"fdtfile=\0" \
 	"console=ttyO0,115200n8\0" \
 	"optargs=\0" \
+	"dfu_alt_info_nand=" DFU_ALT_INFO_NAND "\0" \
 	"mmcdev=0\0" \
 	"mmcroot=/dev/mmcblk0p2 ro\0" \
 	"mmcrootfstype=ext4 rootwait\0" \

include/configs/ti814x_evm.h line 143

Quoted 10 lines
include/configs/ti814x_evm.h +7 -0
@@ -134,6 +134,13 @@
 #define CONFIG_DOS_PARTITION
 #define CONFIG_CMD_FAT
 #define CONFIG_CMD_EXT2
+#define CONFIG_DFU_NAND
+#define DFU_ALT_INFO_NAND \
+	"u-boot-spl part 0 1;" \
+	"u-boot-main part 0 2;" \
+	"env variables part 0 3;" \
+	"kernel part 0 4;" \
+	"rootfs part 0 5"

You're not bringing in USB here, so drop these.

include/configs/ti814x_evm.h line 202

Quoted 11 lines
include/configs/ti814x_evm.h +7 -0
@@ -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.

Quoted 5 lines
include/configs/ti814x_evm.h +1 -0
@@ -242,5 +283,32 @@
 #define CONFIG_PHY_ADDR			1
 #define CONFIG_PHY_ET1011C
 #define CONFIG_PHY_ET1011C_TX_CLK_FIX
+#define CONFIG_NAND

include/configs/ti814x_evm.h line 296

Quoted 10 lines
include/configs/ti814x_evm.h +10 -0
+/* 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.

include/configs/ti814x_evm.h line 299

Quoted 3 lines
include/configs/ti814x_evm.h +3 -0
+#define CONFIG_NAND_OMAP_GPMC
+#define GPMC_NAND_ECC_LP_x16_LAYOUT	1
+#define NAND_BASE			(0x08000000)

Don't need NAND_BASE.

include/configs/ti814x_evm.h line 312

Quoted 13 lines
include/configs/ti814x_evm.h +13 -0
+#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!

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/20130828/74818dd9/attachment.pgp>