Skip to contentSkip to conversation

feature additions and fixes for da850/omap-l138

PATCH New Prabhakar Lad 3 participants 12 messages Jun 25, 2012 – Jun 28, 2012

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

v4 cover feature additions and fixes for da850/omap-l138

From: Lad, Prabhakar <[email protected]>

This series adds MMC/SD, NAND and NOR SPL support for Logic PD's DA850/OMAP-L138 EVM. This series also fixes some issues found on the EVM during testing. The patches are sent in a series as these patches need to be applied in the order they are sent.

The V2 version of patch series has been tested by Sughosh Ganu(urwithsughosh at gmail.com) and V3 version of the patch series has been tested by Christian Riesch (christian.riesch at omicron.at) for regression.

Changes for v2:
1: Fixed comments from Tom to remove unused macro
and add comment.
2: Fixed comments from Christian to move GPIO pins
to board file and add a check to perform initializations only when CONFIG_SPL_LIBCOMMON_SUPPORT is defined.

Changes for v3:
1: Fixed comments from Christian, to define
CONFIG_SPL_MMC_LOAD config while booting from MMC.
2: Splitted patch 5(of v2), one for CONFIG_SPL_LIBCOMMON_SUPPORT
check, one to define SPI specific configs of SP only when SPI flash is used and lastly to add NAND SPL support.
3: Rearranged the patch sequence.

Changes for v4:
1: Fixed comment from Christian, to use clrbits_le32()
which was wrongly using clrbits_be32().

Lad, Prabhakar (7):
da850/omap-l138: Add MMC support for DA850/OMAP-L138
arm, davinci: perform check for initializing global data and serial
init
da850/omap-l138: Define SPI specific configs for SPL only when SPI is
used
da850/omap-l138: Add support to read u-boot image from MMC/SD da850/omap-l138: Fix NAND flash timings
da850/omap-l138: Add support for NAND SPL
da850/omap-l138: add support for direct NOR boot mode

Rajashekhara, Sudhakar (2):
da850/omap-l138: modifications for Logic PD Rev.3 AM18xx EVM da850/omap-l138: Make MMC and NOR support mutually exclusive

 arch/arm/cpu/arm926ejs/davinci/da850_pinmux.c   |   11 +++
 arch/arm/cpu/arm926ejs/davinci/spl.c            |   20 ++++--
 arch/arm/include/asm/arch-davinci/hardware.h    |    1 +
 arch/arm/include/asm/arch-davinci/pinmux_defs.h |    3 +
 board/davinci/da8xxevm/da850evm.c               |   54 ++++++++++++--
 boards.cfg                                      |    1 +
 drivers/mmc/Makefile                            |    4 +
 drivers/mmc/spl_mmc_load.c                      |   62 +++++++++++++++
 include/configs/da850evm.h                      |   93 +++++++++++++++++++++--
 include/mmc.h                                   |    2 +
 10 files changed, 231 insertions(+), 20 deletions(-)
 create mode 100644 drivers/mmc/spl_mmc_load.c
Signature · 1 line
1.7.4.1
#1 lore raw

PATCH v4 1/9 da850/omap-l138: Add MMC support for DA850/OMAP-L138

From: Lad, Prabhakar <[email protected]>

This patch adds support for MMC/SD on DA850/OMAP-L138.

---
Changes for v2:
1:Removed CONFIG_MMC_MBLOCK config which was never used. 2:Added comment while enabling MMC commands. 3:Moved GP0[11] to the board file da850evm.c

Changes for v3: None

Changes for v4: None

 arch/arm/cpu/arm926ejs/davinci/da850_pinmux.c   |   11 ++++++++
 arch/arm/include/asm/arch-davinci/hardware.h    |    1 +
 arch/arm/include/asm/arch-davinci/pinmux_defs.h |    3 ++
 board/davinci/da8xxevm/da850evm.c               |   32 +++++++++++++++++++++++
 include/configs/da850evm.h                      |   17 ++++++++++++
 5 files changed, 64 insertions(+), 0 deletions(-)
arch/arm/cpu/arm926ejs/davinci/da850_pinmux.c +11 -0
index fa07fb5..ad600b2 100644
@@ -169,3 +169,14 @@ const struct pinmux_config emifa_pins_nor[] = {
 	{ pinmux(12), 1, 6 }, /* EMA_A[1] */
 	{ pinmux(12), 1, 7 }, /* EMA_A[0] */
 };
+
+/* MMC0 pin muxer settings */
+const struct pinmux_config mmc0_pins[] = {
+	{ pinmux(10), 2, 0 },	/* MMCSD0_CLK */
+	{ pinmux(10), 2, 1 },	/* MMCSD0_CMD */
+	{ pinmux(10), 2, 2 },	/* MMCSD0_DAT_0 */
+	{ pinmux(10), 2, 3 },	/* MMCSD0_DAT_1 */
+	{ pinmux(10), 2, 4 },	/* MMCSD0_DAT_2 */
+	{ pinmux(10), 2, 5 },	/* MMCSD0_DAT_3 */
+	/* DA850 supports only 4-bit mode, remaining pins are not configured */
+};
arch/arm/include/asm/arch-davinci/hardware.h +1 -0
index b145c6e..f6b7a2c 100644
@@ -446,6 +446,7 @@ struct davinci_pllc_regs {
 #define DAVINCI_SPI1_CLKID  (cpu_is_da830() ? 2 : ASYNC3)
 /* Clock IDs */
 enum davinci_clk_ids {
+	DAVINCI_MMCSD_CLKID = 2,
 	DAVINCI_SPI0_CLKID = 2,
 	DAVINCI_UART2_CLKID = 2,
 	DAVINCI_MMC_CLKID = 2,
arch/arm/include/asm/arch-davinci/pinmux_defs.h +3 -0
index 07aceaa..0db1e40 100644
@@ -48,4 +48,7 @@ extern const struct pinmux_config emifa_pins_cs4[1];
 extern const struct pinmux_config emifa_pins_nand[12];
 extern const struct pinmux_config emifa_pins_nor[43];
 
+/* MMC pin muxer settings */
+extern const struct pinmux_config mmc0_pins[6];
+
 #endif
board/davinci/da8xxevm/da850evm.c +32 -0
index 004d5ad..88337ff 100644
@@ -36,6 +36,11 @@
 #include <asm/errno.h>
 #include <hwconfig.h>
 
+#ifdef CONFIG_DAVINCI_MMC
+#include <mmc.h>
+#include <asm/arch/sdmmc_defs.h>
+#endif
+
 DECLARE_GLOBAL_DATA_PTR;
 
 #ifdef CONFIG_DRIVER_TI_EMAC
@@ -204,11 +209,32 @@ int misc_init_r(void)
 	return 0;
 }
 
+#ifdef CONFIG_DAVINCI_MMC
+static struct davinci_mmc mmc_sd0 = {
+	.reg_base = (struct davinci_mmc_regs *)DAVINCI_MMC_SD0_BASE,
+	.host_caps = MMC_MODE_4BIT,     /* DA850 supports only 4-bit SD/MMC */
+	.voltages = MMC_VDD_32_33 | MMC_VDD_33_34,
+	.version = MMC_CTLR_VERSION_2,
+};
+
+int board_mmc_init(bd_t *bis)
+{
+	mmc_sd0.input_clk = clk_get(DAVINCI_MMCSD_CLKID);
+
+	/* Add slot-0 to mmc subsystem */
+	return davinci_mmc_init(bis, &mmc_sd0);
+}
+#endif
+
 static const struct pinmux_config gpio_pins[] = {
 #ifdef CONFIG_USE_NOR
 	/* GP0[11] is required for NOR to work on Rev 3 EVMs */
 	{ pinmux(0), 8, 4 },	/* GP0[11] */
 #endif
+#ifdef CONFIG_DAVINCI_MMC
+	/* GP0[11] is required for SD to work on Rev 3 EVMs */
+	{ pinmux(0),  8, 4 },	/* GP0[11] */
+#endif
 };
 
 const struct pinmux_resource pinmuxes[] = {
@@ -236,6 +262,9 @@ const struct pinmux_resource pinmuxes[] = {
 	PINMUX_ITEM(emifa_pins_nor),
 #endif
 	PINMUX_ITEM(gpio_pins),
+#ifdef CONFIG_DAVINCI_MMC
+	PINMUX_ITEM(mmc0_pins),
+#endif
 };
 
 const int pinmuxes_size = ARRAY_SIZE(pinmuxes);
@@ -246,6 +275,9 @@ const struct lpsc_resource lpsc[] = {
 	{ DAVINCI_LPSC_EMAC },	/* image download */
 	{ DAVINCI_LPSC_UART2 },	/* console */
 	{ DAVINCI_LPSC_GPIO },
+#ifdef CONFIG_DAVINCI_MMC
+	{ DAVINCI_LPSC_MMC_SD },
+#endif
 };
 
 const int lpsc_size = ARRAY_SIZE(lpsc);
include/configs/da850evm.h +17 -0
index 989472b..8b4fea1 100644
@@ -313,6 +313,23 @@
 #undef CONFIG_CMD_ENV
 #endif
 
+/* SD/MMC configuration */
+#define CONFIG_MMC
+#define CONFIG_DAVINCI_MMC_SD1
+#define CONFIG_GENERIC_MMC
+#define CONFIG_DAVINCI_MMC
+
+/*
+ * Enable MMC commands only when
+ * MMC support is present
+ */
+#ifdef CONFIG_MMC
+#define CONFIG_DOS_PARTITION
+#define CONFIG_CMD_EXT2
+#define CONFIG_CMD_FAT
+#define CONFIG_CMD_MMC
+#endif
+
 /* defines for SPL */
 #define CONFIG_SPL
 #define CONFIG_SPL_SPI_SUPPORT
Signature · 1 line
1.7.4.1
#2 lore raw

PATCH v4 2/9 da850/omap-l138: modifications for Logic PD Rev.3 AM18xx EVM

In reply to Prabhakar Lad

From: Rajashekhara, Sudhakar <[email protected]>

AHCLKR/UART1_RTS/GP0[11] pin needs to be configured for MMC and NOR to work on DA850/OMAP-L138 Rev.3 EVM. When GP0[11] is low, the SD0 interface will not work, but NOR flash will. When GP0[11] is high, SD0 will work but NOR flash will not.

---
Changes for v2: None

Changes for v3: None

Changes for v4:
1: Used clrbits_le32() instead of clrbits_be32()

 board/davinci/da8xxevm/da850evm.c |   12 +++++++++++-
 1 files changed, 11 insertions(+), 1 deletions(-)
board/davinci/da8xxevm/da850evm.c +11 -1
index 88337ff..152a524 100644
@@ -335,7 +335,7 @@ int board_early_init_f(void)
 
 int board_init(void)
 {
-#ifdef CONFIG_USE_NOR
+#if defined(CONFIG_USE_NOR) || defined(CONFIG_DAVINCI_MMC)
 	u32 val;
 #endif
 
@@ -386,6 +386,16 @@ int board_init(void)
 	writel(val, GPIO_BANK0_REG_CLR_ADDR);
 #endif
 
+#ifdef CONFIG_DAVINCI_MMC
+	/* Set the GPIO direction as output */
+	clrbits_le32((u32 *)GPIO_BANK0_REG_DIR_ADDR, (0x01 << 11));
+
+	/* Set the output as high */
+	val = readl(GPIO_BANK0_REG_SET_ADDR);
+	val |= (0x01 << 11);
+	writel(val, GPIO_BANK0_REG_SET_ADDR);
+#endif
+
 #ifdef CONFIG_DRIVER_TI_EMAC
 	davinci_emac_mii_mode_sel(HAS_RMII);
 #endif /* CONFIG_DRIVER_TI_EMAC */
Signature · 1 line
1.7.4.1
#3 lore raw

PATCH v4 3/9 da850/omap-l138: Make MMC and NOR support mutually exclusive

In reply to Prabhakar Lad

From: Rajashekhara, Sudhakar <[email protected]>

On Logic PD Rev.3 DA850/OMAP-L138 EVM, NOR and MMC/SD cannot work together. This patch enables the MMC/SD support only when NOR support is disabled. NOR Flash identification works even without this patch, but erase and write will have issues.

---
Changes for v2: None

Changes for v3:
1: Moved patch up the sequence

Changes for v4: None

 include/configs/da850evm.h |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
include/configs/da850evm.h +2 -0
index 8b4fea1..4546e0f 100644
@@ -314,10 +314,12 @@
 #endif
 
 /* SD/MMC configuration */
+#ifndef CONFIG_USE_NOR
 #define CONFIG_MMC
 #define CONFIG_DAVINCI_MMC_SD1
 #define CONFIG_GENERIC_MMC
 #define CONFIG_DAVINCI_MMC
+#endif
 
 /*
  * Enable MMC commands only when
Signature · 1 line
1.7.4.1
#4 lore raw

PATCH v4 4/9 arm, davinci: perform check for initializing global data and serial init

In reply to Prabhakar Lad

From: Lad, Prabhakar <[email protected]>

initialize baudrate, flags, data and serial initialization, only when CONFIG_SPL_LIBCOMMON_SUPPORT is defined.

---
Changes for v2: None

Changes for v3:
1: Created new patch by splitting patch 6 of v2, to make
it more readable.

Changes for v4:
1: corrected spelling mistake in commit message.

 arch/arm/cpu/arm926ejs/davinci/spl.c |   15 +++++++++------
 1 files changed, 9 insertions(+), 6 deletions(-)
arch/arm/cpu/arm926ejs/davinci/spl.c +9 -6
index 74632e5..7d9b289 100644
@@ -74,12 +74,7 @@ void board_init_f(ulong dummy)
 
 void board_init_r(gd_t *id, ulong dummy)
 {
-#ifdef CONFIG_SPL_NAND_LOAD
-	nand_init();
-	puts("Nand boot...\n");
-	nand_boot();
-#endif
-#ifdef CONFIG_SPL_SPI_LOAD
+#ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
 	mem_malloc_init(CONFIG_SYS_TEXT_BASE - CONFIG_SYS_MALLOC_LEN,
 			CONFIG_SYS_MALLOC_LEN);
 
@@ -90,6 +85,14 @@ void board_init_r(gd_t *id, ulong dummy)
 	serial_init();          /* serial communications setup */
 	gd->have_console = 1;
 
+#endif
+
+#ifdef CONFIG_SPL_NAND_LOAD
+	nand_init();
+	puts("Nand boot...\n");
+	nand_boot();
+#endif
+#ifdef CONFIG_SPL_SPI_LOAD
 	puts("SPI boot...\n");
 	spi_boot();
 #endif
Signature · 1 line
1.7.4.1
#5 lore raw

PATCH v4 5/9 da850/omap-l138: Define SPI specific configs for SPL only when SPI is used

In reply to Prabhakar Lad

From: Lad, Prabhakar <[email protected]>

define SPI specific configs for SPL only when CONFIG_USE_SPIFLASH config is defined

---
Changes for v2: None

Changes for v3:
1: Created a new patch by splitting patch 6 of v2
for better readability.

Changes for v4: None

 include/configs/da850evm.h |   17 ++++++++++-------
 1 files changed, 10 insertions(+), 7 deletions(-)
include/configs/da850evm.h +10 -7
index 4546e0f..4e5f160 100644
@@ -155,6 +155,16 @@
 #define CONFIG_SF_DEFAULT_SPEED		30000000
 #define CONFIG_ENV_SPI_MAX_HZ	CONFIG_SF_DEFAULT_SPEED
 
+#ifdef CONFIG_USE_SPIFLASH
+#define CONFIG_SPL_SPI_SUPPORT
+#define CONFIG_SPL_SPI_FLASH_SUPPORT
+#define CONFIG_SPL_SPI_LOAD
+#define CONFIG_SPL_SPI_BUS 0
+#define CONFIG_SPL_SPI_CS 0
+#define CONFIG_SYS_SPI_U_BOOT_OFFS	0x8000
+#define CONFIG_SYS_SPI_U_BOOT_SIZE	0x30000
+#endif
+
 /*
  * I2C Configuration
  */
@@ -334,11 +344,6 @@
 
 /* defines for SPL */
 #define CONFIG_SPL
-#define CONFIG_SPL_SPI_SUPPORT
-#define CONFIG_SPL_SPI_FLASH_SUPPORT
-#define CONFIG_SPL_SPI_LOAD
-#define CONFIG_SPL_SPI_BUS 0
-#define CONFIG_SPL_SPI_CS 0
 #define CONFIG_SPL_SERIAL_SUPPORT
 #define CONFIG_SPL_LIBCOMMON_SUPPORT
 #define CONFIG_SPL_LIBGENERIC_SUPPORT
@@ -346,8 +351,6 @@
 #define CONFIG_SPL_STACK	0x8001ff00
 #define CONFIG_SPL_TEXT_BASE	0x80000000
 #define CONFIG_SPL_MAX_SIZE	32768
-#define CONFIG_SYS_SPI_U_BOOT_OFFS	0x8000
-#define CONFIG_SYS_SPI_U_BOOT_SIZE	0x30000
 
 /* additions for new relocation code, must added to all boards */
 #define CONFIG_SYS_SDRAM_BASE		0xc0000000
Signature · 1 line
1.7.4.1
#6 lore raw

PATCH v4 6/9 da850/omap-l138: Add support to read u-boot image from MMC/SD

In reply to Prabhakar Lad

From: Lad, Prabhakar <[email protected]>

DA850/OMAP-L138 does not support strict MMC/SD boot mode. SPL will be in SPI flash and U-Boot image will be in MMC/SD card. SPL will do the low level initialization and then loads the u-boot image from MMC/SD card.

Define CONFIG_SPL_MMC_LOAD macro in the DA850/OMAP-L138 configuration file to enable this feature.

---
Changes for v2: None

Changes for v3:
1: Moved the patch down the series to make it readable. 2: Fixed comment from Christian to have CONFIG_SPL_MMC_LOAD
config only while loading from MMC.
3: Changed print statement while loading from MMC.

Changes for v4:
1: Replaced CONFIG_SYS_SPI_U_BOOT_SIZE with CONFIG_SYS_MMC_U_BOOT_SIZE
in spl_mmc_load.c and correspondingly in da850evm.h

 arch/arm/cpu/arm926ejs/davinci/spl.c |    5 +++
 drivers/mmc/Makefile                 |    4 ++
 drivers/mmc/spl_mmc_load.c           |   62 ++++++++++++++++++++++++++++++++++
 include/configs/da850evm.h           |   11 ++++++
 include/mmc.h                        |    2 +
 5 files changed, 84 insertions(+), 0 deletions(-)
 create mode 100644 drivers/mmc/spl_mmc_load.c
arch/arm/cpu/arm926ejs/davinci/spl.c +5 -0
index 7d9b289..03c85c8 100644
@@ -28,6 +28,7 @@
 #include <ns16550.h>
 #include <malloc.h>
 #include <spi_flash.h>
+#include <mmc.h>
 
 #ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
 
@@ -96,4 +97,8 @@ void board_init_r(gd_t *id, ulong dummy)
 	puts("SPI boot...\n");
 	spi_boot();
 #endif
+#ifdef CONFIG_SPL_MMC_LOAD
+	puts("MMC boot...\n");
+	spl_mmc_load();
+#endif
 }
drivers/mmc/Makefile +4 -0
index 8c9aeb8..74be275 100644
@@ -25,6 +25,10 @@ include $(TOPDIR)/config.mk
 
 LIB	:= $(obj)libmmc.o
 
+ifdef CONFIG_SPL_MMC_LOAD
+COBJS-$(CONFIG_SPL_MMC_LOAD)	+= spl_mmc_load.o
+endif
+
 COBJS-$(CONFIG_BFIN_SDH) += bfin_sdh.o
 COBJS-$(CONFIG_DAVINCI_MMC) += davinci_mmc.o
 COBJS-$(CONFIG_FSL_ESDHC) += fsl_esdhc.o
drivers/mmc/spl_mmc_load.c new file +62 -0

62 lines not on this page · raw message

include/configs/da850evm.h +11 -0
index 4e5f160..0ba55c6 100644
@@ -352,6 +352,17 @@
 #define CONFIG_SPL_TEXT_BASE	0x80000000
 #define CONFIG_SPL_MAX_SIZE	32768
 
+
+/* Load U-Boot Image From MMC */
+#ifdef CONFIG_SPL_MMC_LOAD
+#define CONFIG_SPL_MMC_SUPPORT
+#define CONFIG_SPL_FAT_SUPPORT
+#define CONFIG_SPL_LIBDISK_SUPPORT
+#define CONFIG_SYS_MMC_U_BOOT_OFFS	0x75
+#define CONFIG_SYS_MMC_U_BOOT_SIZE	0x30000
+#undef CONFIG_SPL_SPI_LOAD
+#endif
+
 /* additions for new relocation code, must added to all boards */
 #define CONFIG_SYS_SDRAM_BASE		0xc0000000
 #define CONFIG_SYS_INIT_SP_ADDR		(CONFIG_SYS_SDRAM_BASE + 0x1000 - /* Fix this */ \
include/mmc.h +2 -0
index f52df70..282b54d 100644
@@ -27,6 +27,7 @@
 #define _MMC_H_
 
 #include <linux/list.h>
+#include <linux/compiler.h>
 
 #define SD_VERSION_SD	0x20000
 #define SD_VERSION_2	(SD_VERSION_SD | 0x20)
@@ -320,6 +321,7 @@ int get_mmc_num(void);
 int board_mmc_getcd(struct mmc *mmc);
 int mmc_switch_part(int dev_num, unsigned int part_num);
 int mmc_getcd(struct mmc *mmc);
+void spl_mmc_load(void) __noreturn;
 
 #ifdef CONFIG_GENERIC_MMC
 #define mmc_host_is_spi(mmc)	((mmc)->host_caps & MMC_MODE_SPI)
Signature · 1 line
1.7.4.1
#7 lore raw

PATCH v4 7/9 da850/omap-l138: Fix NAND flash timings

In reply to Prabhakar Lad

From: Lad, Prabhakar <[email protected]>

Though Commit id a3f88293ddd13facd734769c1664d35ab4ed681f (da850evm:
setup the NAND flash timings) has configured the AEMIF timings, they are not exactly in sync with the timings used in Linux. Linux is configuring the timing register as 0x08222204, where as currently it configured to 0x00100084 in U-Boot. This issue was found out when support for NAND SPL is added in U-Boot. Without this patch U-Boot does not come up with SPL.

---
Changes for v3:
1: Patch number changed due to patch 6 split up
of previous version.

Changes for v4: None

 board/davinci/da8xxevm/da850evm.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)
board/davinci/da8xxevm/da850evm.c +5 -5
index 152a524..0c7aabb 100644
@@ -348,11 +348,11 @@ int board_init(void)
 	 * NAND CS setup - cycle counts based on da850evm NAND timings in the
 	 * Linux kernel @ 25MHz EMIFA
 	 */
-	writel((DAVINCI_ABCR_WSETUP(0) |
-		DAVINCI_ABCR_WSTROBE(1) |
-		DAVINCI_ABCR_WHOLD(0) |
-		DAVINCI_ABCR_RSETUP(0) |
-		DAVINCI_ABCR_RSTROBE(1) |
+	writel((DAVINCI_ABCR_WSETUP(2) |
+		DAVINCI_ABCR_WSTROBE(2) |
+		DAVINCI_ABCR_WHOLD(1) |
+		DAVINCI_ABCR_RSETUP(1) |
+		DAVINCI_ABCR_RSTROBE(4) |
 		DAVINCI_ABCR_RHOLD(0) |
 		DAVINCI_ABCR_TA(1) |
 		DAVINCI_ABCR_ASIZE_8BIT),
Signature · 1 line
1.7.4.1
#8 lore raw

PATCH v4 8/9 da850/omap-l138: Add support for NAND SPL

In reply to Prabhakar Lad

From: Lad, Prabhakar <[email protected]>

This patch adds configuration required for NAND SP on DA850/OMAP-L138.

---
Changes for v3:
1: Broke down the patch from v2 to make it better
for readability.
2: Patch number changed from previous version
due to patch 6 split up.

Changes for v4: None

 include/configs/da850evm.h |   26 ++++++++++++++++++++++++++
 1 files changed, 26 insertions(+), 0 deletions(-)
include/configs/da850evm.h +26 -0
index 0ba55c6..71c921f 100644
@@ -193,6 +193,32 @@
 #define CONFIG_SYS_ALE_MASK		0x8
 #undef CONFIG_SYS_NAND_HW_ECC
 #define CONFIG_SYS_MAX_NAND_DEVICE	1 /* Max number of NAND devices */
+#define CONFIG_SYS_NAND_HW_ECC_OOBFIRST
+#define CONFIG_SYS_NAND_5_ADDR_CYCLE
+#define CONFIG_SYS_NAND_PAGE_SIZE	(2 << 10)
+#define CONFIG_SYS_NAND_BLOCK_SIZE	(128 << 10)
+#define CONFIG_SYS_NAND_U_BOOT_OFFS	0x28000
+#define CONFIG_SYS_NAND_U_BOOT_SIZE	0x60000
+#define CONFIG_SYS_NAND_U_BOOT_DST	0xc1080000
+#define CONFIG_SYS_NAND_U_BOOT_START	CONFIG_SYS_NAND_U_BOOT_DST
+#define CONFIG_SYS_NAND_U_BOOT_RELOC_SP	(CONFIG_SYS_NAND_U_BOOT_DST - \
+					CONFIG_SYS_NAND_U_BOOT_SIZE - \
+					CONFIG_SYS_MALLOC_LEN -       \
+					GENERATED_GBL_DATA_SIZE)
+#define CONFIG_SYS_NAND_ECCPOS		{				\
+				24, 25, 26, 27, 28, \
+				29, 30, 31, 32, 33, 34, 35, 36, 37, 38, \
+				39, 40, 41, 42, 43, 44, 45, 46, 47, 48, \
+				49, 50, 51, 52, 53, 54, 55, 56, 57, 58, \
+				59, 60, 61, 62, 63 }
+#define CONFIG_SYS_NAND_PAGE_COUNT	64
+#define CONFIG_SYS_NAND_BAD_BLOCK_POS	0
+#define CONFIG_SYS_NAND_ECCSIZE		512
+#define CONFIG_SYS_NAND_ECCBYTES	10
+#define CONFIG_SYS_NAND_OOBSIZE		64
+#define CONFIG_SPL_NAND_SUPPORT
+#define CONFIG_SPL_NAND_SIMPLE
+#define CONFIG_SPL_NAND_LOAD
 #endif
 
 /*
Signature · 1 line
1.7.4.1
#9 lore raw

PATCH v4 9/9 da850/omap-l138: add support for direct NOR boot mode

In reply to Prabhakar Lad

From: Lad, Prabhakar <[email protected]>

This patch adds support for direct NOR boot mode on da850/omap-l138. Added da850evm_direct_nor entry in boards.cfg to allow to build targets.

---
Changes for v2:
1: Added entry in boards.cfg to build target for
direct NOR boot mode.

Changes for v3:
1: Patch number changed due to patch split up of
patch 6 of v2.

Changes for v4: None

 boards.cfg                 |    1 +
 include/configs/da850evm.h |   22 ++++++++++++++++++++--
 2 files changed, 21 insertions(+), 2 deletions(-)
boards.cfg +1 -0
index e983b05..5ff78bd 100644
@@ -122,6 +122,7 @@ cam_enc_4xx                  arm         arm926ejs   cam_enc_4xx         ait
 da830evm                     arm         arm926ejs   da8xxevm            davinci        davinci
 da850_am18xxevm              arm         arm926ejs   da8xxevm            davinci        davinci     da850evm:DA850_AM18X_EVM,MAC_ADDR_IN_EEPROM,SYS_I2C_EEPROM_ADDR_LEN=2,SYS_I2C_EEPROM_ADDR=0x50
 da850evm                     arm         arm926ejs   da8xxevm            davinci        davinci     da850evm:MAC_ADDR_IN_SPIFLASH
+da850evm_direct_nor          arm         arm926ejs   da8xxevm            davinci        davinci     da850evm:MAC_ADDR_IN_SPIFLASH,USE_NOR,DIRECT_NOR_BOOT
 davinci_dm355evm             arm         arm926ejs   dm355evm            davinci        davinci
 davinci_dm355leopard         arm         arm926ejs   dm355leopard        davinci        davinci
 davinci_dm365evm             arm         arm926ejs   dm365evm            davinci        davinci
include/configs/da850evm.h +20 -2
index 71c921f..4bb47f7 100644
@@ -27,7 +27,10 @@
  * Board
  */
 #define CONFIG_DRIVER_TI_EMAC
+/* check if direct NOR boot config is used */
+#ifndef CONFIG_DIRECT_NOR_BOOT
 #define CONFIG_USE_SPIFLASH
+#endif
 
 
 /*
@@ -43,10 +46,19 @@
 #define CONFIG_SYS_TIMERBASE		DAVINCI_TIMER0_BASE
 #define CONFIG_SYS_HZ_CLOCK		clk_get(DAVINCI_AUXCLK_CLKID)
 #define CONFIG_SYS_HZ			1000
-#define CONFIG_SYS_TEXT_BASE		0xc1080000
 #define CONFIG_SYS_DA850_PLL_INIT
 #define CONFIG_SYS_DA850_DDR_INIT
 
+#ifdef CONFIG_DIRECT_NOR_BOOT
+#define CONFIG_ARCH_CPU_INIT
+#define CONFIG_DA8XX_GPIO
+#define CONFIG_SYS_TEXT_BASE		0x60000000
+#define CONFIG_SYS_DV_NOR_BOOT_CFG	(0x11)
+#define CONFIG_DA850_LOWLEVEL
+#else
+#define CONFIG_SYS_TEXT_BASE		0xc1080000
+#endif
+
 /*
  * Memory Info
  */
@@ -368,6 +380,7 @@
 #define CONFIG_CMD_MMC
 #endif
 
+#ifndef CONFIG_DIRECT_NOR_BOOT
 /* defines for SPL */
 #define CONFIG_SPL
 #define CONFIG_SPL_SERIAL_SUPPORT
@@ -377,7 +390,7 @@
 #define CONFIG_SPL_STACK	0x8001ff00
 #define CONFIG_SPL_TEXT_BASE	0x80000000
 #define CONFIG_SPL_MAX_SIZE	32768
-
+#endif
 
 /* Load U-Boot Image From MMC */
 #ifdef CONFIG_SPL_MMC_LOAD
@@ -391,6 +404,11 @@
 
 /* additions for new relocation code, must added to all boards */
 #define CONFIG_SYS_SDRAM_BASE		0xc0000000
+
+#ifdef CONFIG_DIRECT_NOR_BOOT
+#define CONFIG_SYS_INIT_SP_ADDR		0x8001ff00
+#else
 #define CONFIG_SYS_INIT_SP_ADDR		(CONFIG_SYS_SDRAM_BASE + 0x1000 - /* Fix this */ \
 					GENERATED_GBL_DATA_SIZE)
+#endif /* CONFIG_DIRECT_NOR_BOOT */
 #endif /* __CONFIG_H */
Signature · 1 line
1.7.4.1
#10 lore raw

v4 cover feature additions and fixes for da850/omap-l138

In reply to Prabhakar Lad

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Quoted 17 lines · Prabhakar Lad

From: Lad, Prabhakar <[email protected]>

This series adds MMC/SD, NAND and NOR SPL support for Logic PD's DA850/OMAP-L138 EVM. This series also fixes some issues found on the EVM during testing. The patches are sent in a series as these patches need to be applied in the order they are sent.

The V2 version of patch series has been tested by Sughosh Ganu(urwithsughosh at gmail.com) and V3 version of the patch series has been tested by Christian Riesch (christian.riesch at omicron.at) for regression.

Changes for v2: 1: Fixed comments from Tom to remove unused macro and add comment. 2: Fixed comments from Christian to move GPIO pins to board file and add a check to perform initializations only when CONFIG_SPL_LIBCOMMON_SUPPORT is defined.

Quoted 8 lines

Changes for v3: 1: Fixed comments from Christian, to define CONFIG_SPL_MMC_LOAD config while booting from MMC. 2: Splitted patch 5(of v2), one for CONFIG_SPL_LIBCOMMON_SUPPORT check, one to
define SPI specific configs of SP only when SPI flash is used and lastly to add NAND SPL support. 3: Rearranged the patch sequence.

Changes for v4: 1: Fixed comment from Christian, to use clrbits_le32() which was wrongly using clrbits_be32().

Under the assumption that Christian will be providing acks soon when he can test the patches, I've staged this to my local u-boot-ti/next and confirmed everything is still bisect'able. Thanks for working through the iterations on this series!

- --
Tom
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQIcBAEBAgAGBQJP6JYDAAoJENk4IS6UOR1WugIQAJFsG5E13p7clt8ltKHxJKIQ a2JAgj1co8Tmv3nT7tVfOEEU/UxJ0mPjVTrhUWEKwUBVu0tBF8qtQgURcJbeRNlC kAQmfzf03kpfIeWLQaInnD9NJOHIk7blKOTzaLuXnruG76PDUSJxQszWHp6EIGsM CzUOpAlLze/8Z4l3JQ4j0ebpfaLZ4dLR6YNb12w7lKhNsXl99RMaUb1bvZn6O5pg NAfJ3+uvrjbnXAMQhBcG/4FhtpdaRzyOruh76qrJMB/YG9cFtF9FE8DWv11VZym+ xDmETylHYep5RkGmVlJSFthsUuKFm2oB0z0nnDQMIzOVK4if9F4to46ewku1MhmT M/aei2L4kIRpaeH1T42J1cx4HNWDO8e8Rf0921yFFcArFWmCgG56ruqRDjaIoeaD WgPFsho7w4yDnkt973QumhxnW0w/dymvQ7rd8FNDGBQOnKeglsUILABgqVooSJ50 z27rvJcGvrah5yfy1yRBwPllHBbe0F8zbsbgmGPHAFNxM0crn9I5uWQYVs3HBdRt en9aWYbE15Ec3/S08Rr2nRJFYYUrcUeMSpeePvhKiOKMPvSRE3B9R6dVerbms4mj 8b2SwCrrOuYakUtrt/QsZEPhwp1YwvZjqYFhvTeMCy0Rixw3Cu9GmUo5q1N9J748 B8Z1SQsl0oCr3pPphgyX
=S4k8
-----END PGP SIGNATURE-----

#11 lore raw

v4 cover feature additions and fixes for da850/omap-l138

Hi Tom, hi Prabhakar,

Quoted 27 lines · Tom Rini

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Quoted 23 lines · Prabhakar Lad

From: Lad, Prabhakar <[email protected]>

This series adds MMC/SD, NAND and NOR SPL support for Logic PD's DA850/OMAP-L138 EVM. This series also fixes some issues found on the EVM during testing. The patches are sent in a series as these patches need to be applied in the order they are sent.

The V2 version of patch series has been tested by Sughosh Ganu(urwithsughosh at gmail.com) and V3 version of the patch series has been tested by Christian Riesch (christian.riesch at omicron.at) for regression.

Changes for v2: 1: Fixed comments from Tom to remove unused macro and add comment. 2: Fixed comments from Christian to move GPIO pins to board file and add a check to perform initializations only when CONFIG_SPL_LIBCOMMON_SUPPORT is defined.

Changes for v3: 1: Fixed comments from Christian, to define CONFIG_SPL_MMC_LOAD config while booting from MMC. 2: Splitted patch 5(of v2), one for CONFIG_SPL_LIBCOMMON_SUPPORT check, one to ?define SPI specific configs of SP only when SPI flash is used and ?lastly to add NAND SPL support. 3: Rearranged the patch sequence.

Quoted 7 lines
Quoted 2 lines

Changes for v4: 1: Fixed comment from Christian, to use clrbits_le32() which was wrongly using clrbits_be32().

Under the assumption that Christian will be providing acks soon when he can test the patches, I've staged this to my local u-boot-ti/next and confirmed everything is still bisect'able. ?Thanks for working through the iterations on this series!

I tested v4 of the patchset on the AM1808 experimenter's kit (da850evm configuration, make u-boot.ais, booting from SPI flash with SPL) and on the calimain board. I found no regression due to this patchset.

Regards, Christian