All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH v2 0/7] feature additions and fixes for da850/omap-l138
@ 2012-06-07  9:55 Prabhakar Lad
  2012-06-07  9:55 ` [U-Boot] [PATCH v2 1/7] da850/omap-l138: Add MMC support for DA850/OMAP-L138 Prabhakar Lad
                   ` (7 more replies)
  0 siblings, 8 replies; 13+ messages in thread
From: Prabhakar Lad @ 2012-06-07  9:55 UTC (permalink / raw)
  To: u-boot

From: Lad, Prabhakar <prabhakar.lad@ti.com>

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.

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.

Lad, Prabhakar (5):
  da850/omap-l138: Add MMC support for DA850/OMAP-L138
  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            |   27 +++++--
 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                      |   86 +++++++++++++++++++++--
 include/mmc.h                                   |    2 +
 10 files changed, 233 insertions(+), 18 deletions(-)
 create mode 100644 drivers/mmc/spl_mmc_load.c

-- 
1.7.4.1

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

* [U-Boot] [PATCH v2 1/7] da850/omap-l138: Add MMC support for DA850/OMAP-L138
  2012-06-07  9:55 [U-Boot] [PATCH v2 0/7] feature additions and fixes for da850/omap-l138 Prabhakar Lad
@ 2012-06-07  9:55 ` Prabhakar Lad
  2012-06-07  9:55 ` [U-Boot] [PATCH v2 2/7] da850/omap-l138: modifications for Logic PD Rev.3 AM18xx EVM Prabhakar Lad
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 13+ messages in thread
From: Prabhakar Lad @ 2012-06-07  9:55 UTC (permalink / raw)
  To: u-boot

From: Lad, Prabhakar <prabhakar.lad@ti.com>

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

Signed-off-by: Lad, Prabhakar <prabhakar.lad@ti.com>
Signed-off-by: Rajashekhara, Sudhakar <sudhakar.raj@ti.com>
Signed-off-by: Hadli, Manjunath <manjunath.hadli@ti.com>
---
 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

 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(-)

diff --git a/arch/arm/cpu/arm926ejs/davinci/da850_pinmux.c b/arch/arm/cpu/arm926ejs/davinci/da850_pinmux.c
index fa07fb5..ad600b2 100644
--- a/arch/arm/cpu/arm926ejs/davinci/da850_pinmux.c
+++ b/arch/arm/cpu/arm926ejs/davinci/da850_pinmux.c
@@ -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 */
+};
diff --git a/arch/arm/include/asm/arch-davinci/hardware.h b/arch/arm/include/asm/arch-davinci/hardware.h
index b145c6e..f6b7a2c 100644
--- a/arch/arm/include/asm/arch-davinci/hardware.h
+++ b/arch/arm/include/asm/arch-davinci/hardware.h
@@ -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,
diff --git a/arch/arm/include/asm/arch-davinci/pinmux_defs.h b/arch/arm/include/asm/arch-davinci/pinmux_defs.h
index 07aceaa..0db1e40 100644
--- a/arch/arm/include/asm/arch-davinci/pinmux_defs.h
+++ b/arch/arm/include/asm/arch-davinci/pinmux_defs.h
@@ -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
diff --git a/board/davinci/da8xxevm/da850evm.c b/board/davinci/da8xxevm/da850evm.c
index 004d5ad..88337ff 100644
--- a/board/davinci/da8xxevm/da850evm.c
+++ b/board/davinci/da8xxevm/da850evm.c
@@ -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);
diff --git a/include/configs/da850evm.h b/include/configs/da850evm.h
index 989472b..8b4fea1 100644
--- a/include/configs/da850evm.h
+++ b/include/configs/da850evm.h
@@ -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
-- 
1.7.4.1

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

* [U-Boot] [PATCH v2 2/7] da850/omap-l138: modifications for Logic PD Rev.3 AM18xx EVM
  2012-06-07  9:55 [U-Boot] [PATCH v2 0/7] feature additions and fixes for da850/omap-l138 Prabhakar Lad
  2012-06-07  9:55 ` [U-Boot] [PATCH v2 1/7] da850/omap-l138: Add MMC support for DA850/OMAP-L138 Prabhakar Lad
@ 2012-06-07  9:55 ` Prabhakar Lad
  2012-06-07  9:55 ` [U-Boot] [PATCH v2 3/7] da850/omap-l138: Add support to read u-boot image from MMC/SD Prabhakar Lad
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 13+ messages in thread
From: Prabhakar Lad @ 2012-06-07  9:55 UTC (permalink / raw)
  To: u-boot

From: Rajashekhara, Sudhakar <sudhakar.raj@ti.com>

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.

Signed-off-by: Rajashekhara, Sudhakar <sudhakar.raj@ti.com>
Signed-off-by: Lad, Prabhakar <prabhakar.lad@ti.com>
Signed-off-by: Hadli, Manjunath <manjunath.hadli@ti.com>
---
 board/davinci/da8xxevm/da850evm.c |   12 +++++++++++-
 1 files changed, 11 insertions(+), 1 deletions(-)

diff --git a/board/davinci/da8xxevm/da850evm.c b/board/davinci/da8xxevm/da850evm.c
index 88337ff..0d75b84 100644
--- a/board/davinci/da8xxevm/da850evm.c
+++ b/board/davinci/da8xxevm/da850evm.c
@@ -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_be32((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 */
-- 
1.7.4.1

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

* [U-Boot] [PATCH v2 3/7] da850/omap-l138: Add support to read u-boot image from MMC/SD
  2012-06-07  9:55 [U-Boot] [PATCH v2 0/7] feature additions and fixes for da850/omap-l138 Prabhakar Lad
  2012-06-07  9:55 ` [U-Boot] [PATCH v2 1/7] da850/omap-l138: Add MMC support for DA850/OMAP-L138 Prabhakar Lad
  2012-06-07  9:55 ` [U-Boot] [PATCH v2 2/7] da850/omap-l138: modifications for Logic PD Rev.3 AM18xx EVM Prabhakar Lad
@ 2012-06-07  9:55 ` Prabhakar Lad
  2012-06-18 19:39   ` Christian Riesch
  2012-06-07  9:55 ` [U-Boot] [PATCH v2 4/7] da850/omap-l138: Make MMC and NOR support mutually exclusive Prabhakar Lad
                   ` (4 subsequent siblings)
  7 siblings, 1 reply; 13+ messages in thread
From: Prabhakar Lad @ 2012-06-07  9:55 UTC (permalink / raw)
  To: u-boot

From: Lad, Prabhakar <prabhakar.lad@ti.com>

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 the CONFIG_SPL_MMC_LOAD macro in the DA850/OMAP-L138
configuration file to enable this feature.

Signed-off-by: Lad, Prabhakar <prabhakar.lad@ti.com>
Signed-off-by: Rajashekhara, Sudhakar <sudhakar.raj@ti.com>
Signed-off-by: Hadli, Manjunath <manjunath.hadli@ti.com>
---
 arch/arm/cpu/arm926ejs/davinci/spl.c |   12 ++++++-
 drivers/mmc/Makefile                 |    4 ++
 drivers/mmc/spl_mmc_load.c           |   62 ++++++++++++++++++++++++++++++++++
 include/configs/da850evm.h           |    8 ++++
 include/mmc.h                        |    2 +
 5 files changed, 87 insertions(+), 1 deletions(-)
 create mode 100644 drivers/mmc/spl_mmc_load.c

diff --git a/arch/arm/cpu/arm926ejs/davinci/spl.c b/arch/arm/cpu/arm926ejs/davinci/spl.c
index 74632e5..be397ce 100644
--- a/arch/arm/cpu/arm926ejs/davinci/spl.c
+++ b/arch/arm/cpu/arm926ejs/davinci/spl.c
@@ -28,6 +28,11 @@
 #include <ns16550.h>
 #include <malloc.h>
 #include <spi_flash.h>
+#include <mmc.h>
+#include <fat.h>
+#include <version.h>
+#include <asm/arch/davinci_misc.h>
+#include <asm/arch/pinmux_defs.h>
 
 #ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
 
@@ -91,6 +96,11 @@ void board_init_r(gd_t *id, ulong dummy)
 	gd->have_console = 1;
 
 	puts("SPI boot...\n");
+#ifdef CONFIG_SPL_MMC_LOAD
+	spl_mmc_load();
+#else
 	spi_boot();
-#endif
+#endif /* CONFIG_SPL_MMC_LOAD */
+
+#endif /* CONFIG_SPL_SPI_LOAD */
 }
diff --git a/drivers/mmc/Makefile b/drivers/mmc/Makefile
index c245352..bf4b7d5 100644
--- a/drivers/mmc/Makefile
+++ b/drivers/mmc/Makefile
@@ -25,6 +25,10 @@ include $(TOPDIR)/config.mk
 
 LIB	:= $(obj)libmmc.o
 
+ifdef CONFIG_SPL_MMC_LOAD
+COBJS-$(CONFIG_SPL_SPI_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
diff --git a/drivers/mmc/spl_mmc_load.c b/drivers/mmc/spl_mmc_load.c
new file mode 100644
index 0000000..347dcfe
--- /dev/null
+++ b/drivers/mmc/spl_mmc_load.c
@@ -0,0 +1,62 @@
+/*
+ * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com/
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#include <common.h>
+#include <mmc.h>
+
+DECLARE_GLOBAL_DATA_PTR;
+
+static void mmc_load_image(struct mmc *mmc)
+{
+	s32 err;
+	void (*uboot)(void) __noreturn;
+
+	err = mmc->block_dev.block_read(0, CONFIG_SYS_MMC_U_BOOT_OFFS,
+			CONFIG_SYS_SPI_U_BOOT_SIZE/512,
+			(u32 *)CONFIG_SYS_TEXT_BASE);
+
+	if (err <= 0) {
+		printf("spl: error reading image %s, err - %d\n",
+			"u-boot.img", err);
+		hang();
+	}
+	uboot = (void *) CONFIG_SYS_TEXT_BASE;
+	(*uboot)();
+}
+
+void spl_mmc_load(void)
+{
+	struct mmc *mmc;
+	int err;
+	void (mmc_load_image)(struct mmc *mmc) __noreturn;
+
+	mmc_initialize(gd->bd);
+	mmc = find_mmc_device(0);
+	if (!mmc) {
+		puts("spl: mmc device not found!!\n");
+		hang();
+	} else {
+		puts("spl: mmc device found\n");
+	}
+	err = mmc_init(mmc);
+	if (err) {
+		printf("spl: mmc init failed: err - %d\n", err);
+		hang();
+	}
+	mmc_load_image(mmc);
+}
diff --git a/include/configs/da850evm.h b/include/configs/da850evm.h
index 8b4fea1..3bc83d3 100644
--- a/include/configs/da850evm.h
+++ b/include/configs/da850evm.h
@@ -319,6 +319,14 @@
 #define CONFIG_GENERIC_MMC
 #define CONFIG_DAVINCI_MMC
 
+/* 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
+#endif
+
 /*
  * Enable MMC commands only when
  * MMC support is present
diff --git a/include/mmc.h b/include/mmc.h
index f52df70..282b54d 100644
--- a/include/mmc.h
+++ b/include/mmc.h
@@ -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)
-- 
1.7.4.1

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

* [U-Boot] [PATCH v2 4/7] da850/omap-l138: Make MMC and NOR support mutually exclusive
  2012-06-07  9:55 [U-Boot] [PATCH v2 0/7] feature additions and fixes for da850/omap-l138 Prabhakar Lad
                   ` (2 preceding siblings ...)
  2012-06-07  9:55 ` [U-Boot] [PATCH v2 3/7] da850/omap-l138: Add support to read u-boot image from MMC/SD Prabhakar Lad
@ 2012-06-07  9:55 ` Prabhakar Lad
  2012-06-07  9:55 ` [U-Boot] [PATCH v2 5/7] da850/omap-l138: Fix NAND flash timings Prabhakar Lad
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 13+ messages in thread
From: Prabhakar Lad @ 2012-06-07  9:55 UTC (permalink / raw)
  To: u-boot

From: Rajashekhara, Sudhakar <sudhakar.raj@ti.com>

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.

Signed-off-by: Rajashekhara, Sudhakar <sudhakar.raj@ti.com>
Signed-off-by: Lad, Prabhakar <prabhakar.lad@ti.com>
Signed-off-by: Hadli, Manjunath <manjunath.hadli@ti.com>
---
 include/configs/da850evm.h |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/include/configs/da850evm.h b/include/configs/da850evm.h
index 3bc83d3..8236c90 100644
--- a/include/configs/da850evm.h
+++ b/include/configs/da850evm.h
@@ -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
 
 /* Load U-Boot Image From MMC */
 #ifdef CONFIG_SPL_MMC_LOAD
-- 
1.7.4.1

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

* [U-Boot] [PATCH v2 5/7] da850/omap-l138: Fix NAND flash timings
  2012-06-07  9:55 [U-Boot] [PATCH v2 0/7] feature additions and fixes for da850/omap-l138 Prabhakar Lad
                   ` (3 preceding siblings ...)
  2012-06-07  9:55 ` [U-Boot] [PATCH v2 4/7] da850/omap-l138: Make MMC and NOR support mutually exclusive Prabhakar Lad
@ 2012-06-07  9:55 ` Prabhakar Lad
  2012-06-07  9:55 ` [U-Boot] [PATCH v2 6/7] da850/omap-l138: Add support for NAND SPL Prabhakar Lad
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 13+ messages in thread
From: Prabhakar Lad @ 2012-06-07  9:55 UTC (permalink / raw)
  To: u-boot

From: Lad, Prabhakar <prabhakar.lad@ti.com>

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.

Signed-off-by: Lad, Prabhakar <prabhakar.lad@ti.com>
Signed-off-by: Rajashekhara, Sudhakar <sudhakar.raj@ti.com>
Signed-off-by: Hadli, Manjunath <manjunath.hadli@ti.com>
---
 board/davinci/da8xxevm/da850evm.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/board/davinci/da8xxevm/da850evm.c b/board/davinci/da8xxevm/da850evm.c
index 0d75b84..1c0f75d 100644
--- a/board/davinci/da8xxevm/da850evm.c
+++ b/board/davinci/da8xxevm/da850evm.c
@@ -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),
-- 
1.7.4.1

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

* [U-Boot] [PATCH v2 6/7] da850/omap-l138: Add support for NAND SPL
  2012-06-07  9:55 [U-Boot] [PATCH v2 0/7] feature additions and fixes for da850/omap-l138 Prabhakar Lad
                   ` (4 preceding siblings ...)
  2012-06-07  9:55 ` [U-Boot] [PATCH v2 5/7] da850/omap-l138: Fix NAND flash timings Prabhakar Lad
@ 2012-06-07  9:55 ` Prabhakar Lad
  2012-06-07  9:55 ` [U-Boot] [PATCH v2 7/7] da850/omap-l138: add support for direct NOR boot mode Prabhakar Lad
  2012-06-13 10:29 ` [U-Boot] [PATCH v2 0/7] feature additions and fixes for da850/omap-l138 Sughosh Ganu
  7 siblings, 0 replies; 13+ messages in thread
From: Prabhakar Lad @ 2012-06-07  9:55 UTC (permalink / raw)
  To: u-boot

From: Lad, Prabhakar <prabhakar.lad@ti.com>

This patch adds support for NAND SPL on DA850/OMAP-L138.

Signed-off-by: Lad, Prabhakar <prabhakar.lad@ti.com>
Signed-off-by: Rajashekhara, Sudhakar <sudhakar.raj@ti.com>
Signed-off-by: Hadli, Manjunath <manjunath.hadli@ti.com>
---
 Changes for v2:
 1:Added a check to perform initializations of serial
   console only if CONFIG_SPL_LIBCOMMON_SUPPORT is defined.

 arch/arm/cpu/arm926ejs/davinci/spl.c |   15 +++++++-----
 include/configs/da850evm.h           |   39 +++++++++++++++++++++++++++++----
 2 files changed, 43 insertions(+), 11 deletions(-)

diff --git a/arch/arm/cpu/arm926ejs/davinci/spl.c b/arch/arm/cpu/arm926ejs/davinci/spl.c
index be397ce..c7f2bfa 100644
--- a/arch/arm/cpu/arm926ejs/davinci/spl.c
+++ b/arch/arm/cpu/arm926ejs/davinci/spl.c
@@ -79,12 +79,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);
 
@@ -94,7 +89,15 @@ void board_init_r(gd_t *id, ulong dummy)
 	gd->baudrate = CONFIG_BAUDRATE;
 	serial_init();          /* serial communications setup */
 	gd->have_console = 1;
+#endif
 
+#ifdef CONFIG_SPL_NAND_LOAD
+	puts("Nand boot...\n");
+	nand_init();
+	puts("Nand Initalized...\n");
+	nand_boot();
+#endif
+#ifdef CONFIG_SPL_SPI_LOAD
 	puts("SPI boot...\n");
 #ifdef CONFIG_SPL_MMC_LOAD
 	spl_mmc_load();
diff --git a/include/configs/da850evm.h b/include/configs/da850evm.h
index 8236c90..c0b9077 100644
--- a/include/configs/da850evm.h
+++ b/include/configs/da850evm.h
@@ -183,6 +183,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
 
 /*
@@ -340,13 +366,18 @@
 #define CONFIG_CMD_MMC
 #endif
 
-/* defines for SPL */
-#define CONFIG_SPL
+#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
+
+/* defines for SPL */
+#define CONFIG_SPL
 #define CONFIG_SPL_SERIAL_SUPPORT
 #define CONFIG_SPL_LIBCOMMON_SUPPORT
 #define CONFIG_SPL_LIBGENERIC_SUPPORT
@@ -354,11 +385,9 @@
 #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
 #define CONFIG_SYS_INIT_SP_ADDR		(CONFIG_SYS_SDRAM_BASE + 0x1000 - /* Fix this */ \
 					GENERATED_GBL_DATA_SIZE)
+
 #endif /* __CONFIG_H */
-- 
1.7.4.1

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

* [U-Boot] [PATCH v2 7/7] da850/omap-l138: add support for direct NOR boot mode
  2012-06-07  9:55 [U-Boot] [PATCH v2 0/7] feature additions and fixes for da850/omap-l138 Prabhakar Lad
                   ` (5 preceding siblings ...)
  2012-06-07  9:55 ` [U-Boot] [PATCH v2 6/7] da850/omap-l138: Add support for NAND SPL Prabhakar Lad
@ 2012-06-07  9:55 ` Prabhakar Lad
  2012-06-13 10:29 ` [U-Boot] [PATCH v2 0/7] feature additions and fixes for da850/omap-l138 Sughosh Ganu
  7 siblings, 0 replies; 13+ messages in thread
From: Prabhakar Lad @ 2012-06-07  9:55 UTC (permalink / raw)
  To: u-boot

From: Lad, Prabhakar <prabhakar.lad@ti.com>

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.

Signed-off-by: Lad, Prabhakar <prabhakar.lad@ti.com>
Signed-off-by: Rajashekhara, Sudhakar <sudhakar.raj@ti.com>
Signed-off-by: Hadli, Manjunath <manjunath.hadli@ti.com>
---
 Changes for v2:
 1: Added entry in boards.cfg to build target for
    direct NOR boot mode.

 boards.cfg                 |    1 +
 include/configs/da850evm.h |   22 +++++++++++++++++++++-
 2 files changed, 22 insertions(+), 1 deletions(-)

diff --git a/boards.cfg b/boards.cfg
index 0dee43f..2685b73 100644
--- a/boards.cfg
+++ b/boards.cfg
@@ -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
diff --git a/include/configs/da850evm.h b/include/configs/da850evm.h
index c0b9077..ff631d5 100644
--- a/include/configs/da850evm.h
+++ b/include/configs/da850evm.h
@@ -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
  */
@@ -376,6 +388,7 @@
 #define CONFIG_SYS_SPI_U_BOOT_SIZE	0x30000
 #endif
 
+#ifndef CONFIG_DIRECT_NOR_BOOT
 /* defines for SPL */
 #define CONFIG_SPL
 #define CONFIG_SPL_SERIAL_SUPPORT
@@ -385,9 +398,16 @@
 #define CONFIG_SPL_STACK	0x8001ff00
 #define CONFIG_SPL_TEXT_BASE	0x80000000
 #define CONFIG_SPL_MAX_SIZE	32768
+#endif
+
 /* 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 */
-- 
1.7.4.1

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

* [U-Boot] [PATCH v2 0/7] feature additions and fixes for da850/omap-l138
  2012-06-07  9:55 [U-Boot] [PATCH v2 0/7] feature additions and fixes for da850/omap-l138 Prabhakar Lad
                   ` (6 preceding siblings ...)
  2012-06-07  9:55 ` [U-Boot] [PATCH v2 7/7] da850/omap-l138: add support for direct NOR boot mode Prabhakar Lad
@ 2012-06-13 10:29 ` Sughosh Ganu
  7 siblings, 0 replies; 13+ messages in thread
From: Sughosh Ganu @ 2012-06-13 10:29 UTC (permalink / raw)
  To: u-boot

On Thu Jun 07, 2012 at 03:25:27PM +0530, Prabhakar Lad wrote:
> From: Lad, Prabhakar <prabhakar.lad@ti.com>
> 
> 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.
> 
> 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.
> 
> Lad, Prabhakar (5):
>   da850/omap-l138: Add MMC support for DA850/OMAP-L138
>   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            |   27 +++++--
>  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                      |   86 +++++++++++++++++++++--
>  include/mmc.h                                   |    2 +
>  10 files changed, 233 insertions(+), 18 deletions(-)
>  create mode 100644 drivers/mmc/spl_mmc_load.c

 Tested on hawkboard. Boots up fine.

 Tested-by: Sughosh Ganu <urwithsughosh@gmail.com>

-sughosh

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

* [U-Boot] [PATCH v2 3/7] da850/omap-l138: Add support to read u-boot image from MMC/SD
  2012-06-07  9:55 ` [U-Boot] [PATCH v2 3/7] da850/omap-l138: Add support to read u-boot image from MMC/SD Prabhakar Lad
@ 2012-06-18 19:39   ` Christian Riesch
  2012-06-19  5:06     ` Lad, Prabhakar
  0 siblings, 1 reply; 13+ messages in thread
From: Christian Riesch @ 2012-06-18 19:39 UTC (permalink / raw)
  To: u-boot

Hi,
Sorry for the delay, had a lot of other work to do :-/

On Thursday, June 7, 2012, Prabhakar Lad wrote:

> From: Lad, Prabhakar <prabhakar.lad@ti.com <javascript:;>>
>
> 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 the CONFIG_SPL_MMC_LOAD macro in the DA850/OMAP-L138
> configuration file to enable this feature.
>
> Signed-off-by: Lad, Prabhakar <prabhakar.lad@ti.com <javascript:;>>
> Signed-off-by: Rajashekhara, Sudhakar <sudhakar.raj@ti.com <javascript:;>>
> Signed-off-by: Hadli, Manjunath <manjunath.hadli@ti.com <javascript:;>>
> ---
>  arch/arm/cpu/arm926ejs/davinci/spl.c |   12 ++++++-
>  drivers/mmc/Makefile                 |    4 ++
>  drivers/mmc/spl_mmc_load.c           |   62
> ++++++++++++++++++++++++++++++++++
>  include/configs/da850evm.h           |    8 ++++
>  include/mmc.h                        |    2 +
>  5 files changed, 87 insertions(+), 1 deletions(-)
>  create mode 100644 drivers/mmc/spl_mmc_load.c
>
> diff --git a/arch/arm/cpu/arm926ejs/davinci/spl.c
> b/arch/arm/cpu/arm926ejs/davinci/spl.c
> index 74632e5..be397ce 100644
> --- a/arch/arm/cpu/arm926ejs/davinci/spl.c
> +++ b/arch/arm/cpu/arm926ejs/davinci/spl.c
> @@ -28,6 +28,11 @@
>  #include <ns16550.h>
>  #include <malloc.h>
>  #include <spi_flash.h>
> +#include <mmc.h>
> +#include <fat.h>
> +#include <version.h>
> +#include <asm/arch/davinci_misc.h>
> +#include <asm/arch/pinmux_defs.h>
>
>  #ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
>
> @@ -91,6 +96,11 @@ void board_init_r(gd_t *id, ulong dummy)
>        gd->have_console = 1;
>
>        puts("SPI boot...\n");
> +#ifdef CONFIG_SPL_MMC_LOAD
> +       spl_mmc_load();
> +#else
>        spi_boot();
> -#endif


Hmm, now the code prints "SPI boot" and then it boots from MMC, right?
Please output correct messages.


> +#endif /* CONFIG_SPL_MMC_LOAD */
> +
> +#endif /* CONFIG_SPL_SPI_LOAD */


So, CONFIG_SPL_SPI_LOAD must be defined to boot from MMC?? Ths does not
make sense to me.

Regards, Christian

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

* [U-Boot] [PATCH v2 3/7] da850/omap-l138: Add support to read u-boot image from MMC/SD
  2012-06-18 19:39   ` Christian Riesch
@ 2012-06-19  5:06     ` Lad, Prabhakar
  2012-06-20  9:20       ` Christian Riesch
  0 siblings, 1 reply; 13+ messages in thread
From: Lad, Prabhakar @ 2012-06-19  5:06 UTC (permalink / raw)
  To: u-boot

Hi Christian,

On Tue, Jun 19, 2012 at 01:09:08, Christian Riesch wrote:
> Hi,
> Sorry for the delay, had a lot of other work to do :-/
> 
> On Thursday, June 7, 2012, Prabhakar Lad wrote:
> 
> 
> 	From: Lad, Prabhakar <prabhakar.lad@ti.com <javascript:;> >
> 	
> 	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 the CONFIG_SPL_MMC_LOAD macro in the DA850/OMAP-L138
> 	configuration file to enable this feature.
> 	
> 	Signed-off-by: Lad, Prabhakar <prabhakar.lad@ti.com <javascript:;> >
> 	Signed-off-by: Rajashekhara, Sudhakar <sudhakar.raj@ti.com <javascript:;> >
> 	Signed-off-by: Hadli, Manjunath <manjunath.hadli@ti.com <javascript:;> >
> 	---
> 	 arch/arm/cpu/arm926ejs/davinci/spl.c |   12 ++++++-
> 	 drivers/mmc/Makefile                 |    4 ++
> 	 drivers/mmc/spl_mmc_load.c           |   62
> ++++++++++++++++++++++++++++++++++
> 	 include/configs/da850evm.h           |    8 ++++
> 	 include/mmc.h                        |    2 +
> 	 5 files changed, 87 insertions(+), 1 deletions(-)
> 	 create mode 100644 drivers/mmc/spl_mmc_load.c
> 	
> 	diff --git a/arch/arm/cpu/arm926ejs/davinci/spl.c
> b/arch/arm/cpu/arm926ejs/davinci/spl.c
> 	index 74632e5..be397ce 100644
> 	--- a/arch/arm/cpu/arm926ejs/davinci/spl.c
> 	+++ b/arch/arm/cpu/arm926ejs/davinci/spl.c
> 	@@ -28,6 +28,11 @@
> 	 #include <ns16550.h>
> 	 #include <malloc.h>
> 	 #include <spi_flash.h>
> 	+#include <mmc.h>
> 	+#include <fat.h>
> 	+#include <version.h>
> 	+#include <asm/arch/davinci_misc.h>
> 	+#include <asm/arch/pinmux_defs.h>
> 	
> 	 #ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
> 	
> 	@@ -91,6 +96,11 @@ void board_init_r(gd_t *id, ulong dummy)
> 	       gd->have_console = 1;
> 	
> 	       puts("SPI boot...\n");
> 	+#ifdef CONFIG_SPL_MMC_LOAD
> 	+       spl_mmc_load();
> 	+#else
> 	       spi_boot();
> 	-#endif
> 
> 
> Hmm, now the code prints "SPI boot" and then it boots from MMC, right?
> Please output correct messages.
>  
  The board is booted up in SPI boot mode only, ie the SPL is loaded from 
  SPI flash itself and finally when low level initialization is completed
  The SPL loads the U-boot image in MMC/SD card when CONFIG_SPL_MMC_LOAD
  Config is defined. If CONFIG_SPL_MMC_LOAD is not defined by default the
  SPL loads the U-boot image from SPI flash itself.

> 
> 	+#endif /* CONFIG_SPL_MMC_LOAD */
> 	+
> 	+#endif /* CONFIG_SPL_SPI_LOAD */
> 
> 
> So, CONFIG_SPL_SPI_LOAD must be defined to boot from MMC?? Ths does not make sense to me.
 
 No not to boot from MMC, its indicating to SPL which is flashed in 
 SPI flash to load the U-boot image(u-boot.bin) from MMC.

Thx,
--Prabhakar Lad

>  
> Regards, Christian
> 

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

* [U-Boot] [PATCH v2 3/7] da850/omap-l138: Add support to read u-boot image from MMC/SD
  2012-06-19  5:06     ` Lad, Prabhakar
@ 2012-06-20  9:20       ` Christian Riesch
  2012-06-20 10:31         ` Lad, Prabhakar
  0 siblings, 1 reply; 13+ messages in thread
From: Christian Riesch @ 2012-06-20  9:20 UTC (permalink / raw)
  To: u-boot

Hi Prabhakar,

On Tue, Jun 19, 2012 at 7:06 AM, Lad, Prabhakar <prabhakar.lad@ti.com> wrote:
> Hi Christian,
>
> On Tue, Jun 19, 2012 at 01:09:08, Christian Riesch wrote:
>> Hi,
>> Sorry for the delay, had a lot of other work to do :-/
>>
>> On Thursday, June 7, 2012, Prabhakar Lad wrote:
>>
>>
>> ? ? ? From: Lad, Prabhakar <prabhakar.lad@ti.com <javascript:;> >
>>
>> ? ? ? 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 the CONFIG_SPL_MMC_LOAD macro in the DA850/OMAP-L138
>> ? ? ? configuration file to enable this feature.
>>
>> ? ? ? Signed-off-by: Lad, Prabhakar <prabhakar.lad@ti.com <javascript:;> >
>> ? ? ? Signed-off-by: Rajashekhara, Sudhakar <sudhakar.raj@ti.com <javascript:;> >
>> ? ? ? Signed-off-by: Hadli, Manjunath <manjunath.hadli@ti.com <javascript:;> >
>> ? ? ? ---
>> ? ? ? ?arch/arm/cpu/arm926ejs/davinci/spl.c | ? 12 ++++++-
>> ? ? ? ?drivers/mmc/Makefile ? ? ? ? ? ? ? ? | ? ?4 ++
>> ? ? ? ?drivers/mmc/spl_mmc_load.c ? ? ? ? ? | ? 62
>> ++++++++++++++++++++++++++++++++++
>> ? ? ? ?include/configs/da850evm.h ? ? ? ? ? | ? ?8 ++++
>> ? ? ? ?include/mmc.h ? ? ? ? ? ? ? ? ? ? ? ?| ? ?2 +
>> ? ? ? ?5 files changed, 87 insertions(+), 1 deletions(-)
>> ? ? ? ?create mode 100644 drivers/mmc/spl_mmc_load.c
>>
>> ? ? ? diff --git a/arch/arm/cpu/arm926ejs/davinci/spl.c
>> b/arch/arm/cpu/arm926ejs/davinci/spl.c
>> ? ? ? index 74632e5..be397ce 100644
>> ? ? ? --- a/arch/arm/cpu/arm926ejs/davinci/spl.c
>> ? ? ? +++ b/arch/arm/cpu/arm926ejs/davinci/spl.c
>> ? ? ? @@ -28,6 +28,11 @@
>> ? ? ? ?#include <ns16550.h>
>> ? ? ? ?#include <malloc.h>
>> ? ? ? ?#include <spi_flash.h>
>> ? ? ? +#include <mmc.h>
>> ? ? ? +#include <fat.h>
>> ? ? ? +#include <version.h>
>> ? ? ? +#include <asm/arch/davinci_misc.h>
>> ? ? ? +#include <asm/arch/pinmux_defs.h>
>>
>> ? ? ? ?#ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
>>
>> ? ? ? @@ -91,6 +96,11 @@ void board_init_r(gd_t *id, ulong dummy)
>> ? ? ? ? ? ? ?gd->have_console = 1;
>>
>> ? ? ? ? ? ? ?puts("SPI boot...\n");
>> ? ? ? +#ifdef CONFIG_SPL_MMC_LOAD
>> ? ? ? + ? ? ? spl_mmc_load();
>> ? ? ? +#else
>> ? ? ? ? ? ? ?spi_boot();
>> ? ? ? -#endif
>>
>>
>> Hmm, now the code prints "SPI boot" and then it boots from MMC, right?
>> Please output correct messages.
>>
> ?The board is booted up in SPI boot mode only, ie the SPL is loaded from
> ?SPI flash itself and finally when low level initialization is completed
> ?The SPL loads the U-boot image in MMC/SD card when CONFIG_SPL_MMC_LOAD
> ?Config is defined. If CONFIG_SPL_MMC_LOAD is not defined by default the
> ?SPL loads the U-boot image from SPI flash itself.

Yes, but your code prints "SPI boot" for both cases, doesn't it?

>>
>> ? ? ? +#endif /* CONFIG_SPL_MMC_LOAD */
>> ? ? ? +
>> ? ? ? +#endif /* CONFIG_SPL_SPI_LOAD */
>>
>>
>> So, CONFIG_SPL_SPI_LOAD must be defined to boot from MMC?? Ths does not make sense to me.
>
> ?No not to boot from MMC, its indicating to SPL which is flashed in
> ?SPI flash to load the U-boot image(u-boot.bin) from MMC.

Yes, but your code requires both CONFIG_SPL_MMC_LOAD and
CONFIG_SPL_SPI_LOAD to be defined to load u-boot from MMC, right? This
is confusing.

Of course SPL itself is loaded from SPI flash in both cases, but this
does not matter here, since the SPL has already loaded to the internal
SRAM of the SoC by the ROM bootloader of the chip. The SPL could have
been loaded from some other kind of memory (or UART) as well and would
not know the difference.

Regards, Christian

>
> Thx,
> --Prabhakar Lad
>
>>
>> Regards, Christian
>>
>
> _______________________________________________
> U-Boot mailing list
> U-Boot at lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot

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

* [U-Boot] [PATCH v2 3/7] da850/omap-l138: Add support to read u-boot image from MMC/SD
  2012-06-20  9:20       ` Christian Riesch
@ 2012-06-20 10:31         ` Lad, Prabhakar
  0 siblings, 0 replies; 13+ messages in thread
From: Lad, Prabhakar @ 2012-06-20 10:31 UTC (permalink / raw)
  To: u-boot

Hi Christian,

On Wed, Jun 20, 2012 at 14:50:41, Christian Riesch wrote:
> Hi Prabhakar,
> 
> On Tue, Jun 19, 2012 at 7:06 AM, Lad, Prabhakar <prabhakar.lad@ti.com> wrote:
> > Hi Christian,
> >
> > On Tue, Jun 19, 2012 at 01:09:08, Christian Riesch wrote:
> >> Hi,
> >> Sorry for the delay, had a lot of other work to do :-/
> >>
> >> On Thursday, June 7, 2012, Prabhakar Lad wrote:
> >>
> >>
> >> ? ? ? From: Lad, Prabhakar <prabhakar.lad@ti.com <javascript:;> >
> >>
> >> ? ? ? 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 the CONFIG_SPL_MMC_LOAD macro in the DA850/OMAP-L138
> >> ? ? ? configuration file to enable this feature.
> >>
> >> ? ? ? Signed-off-by: Lad, Prabhakar <prabhakar.lad@ti.com <javascript:;> >
> >> ? ? ? Signed-off-by: Rajashekhara, Sudhakar <sudhakar.raj@ti.com <javascript:;> >
> >> ? ? ? Signed-off-by: Hadli, Manjunath <manjunath.hadli@ti.com <javascript:;> >
> >> ? ? ? ---
> >> ? ? ? ?arch/arm/cpu/arm926ejs/davinci/spl.c | ? 12 ++++++-
> >> ? ? ? ?drivers/mmc/Makefile ? ? ? ? ? ? ? ? | ? ?4 ++
> >> ? ? ? ?drivers/mmc/spl_mmc_load.c ? ? ? ? ? | ? 62
> >> ++++++++++++++++++++++++++++++++++
> >> ? ? ? ?include/configs/da850evm.h ? ? ? ? ? | ? ?8 ++++
> >> ? ? ? ?include/mmc.h ? ? ? ? ? ? ? ? ? ? ? ?| ? ?2 +
> >> ? ? ? ?5 files changed, 87 insertions(+), 1 deletions(-)
> >> ? ? ? ?create mode 100644 drivers/mmc/spl_mmc_load.c
> >>
> >> ? ? ? diff --git a/arch/arm/cpu/arm926ejs/davinci/spl.c
> >> b/arch/arm/cpu/arm926ejs/davinci/spl.c
> >> ? ? ? index 74632e5..be397ce 100644
> >> ? ? ? --- a/arch/arm/cpu/arm926ejs/davinci/spl.c
> >> ? ? ? +++ b/arch/arm/cpu/arm926ejs/davinci/spl.c
> >> ? ? ? @@ -28,6 +28,11 @@
> >> ? ? ? ?#include <ns16550.h>
> >> ? ? ? ?#include <malloc.h>
> >> ? ? ? ?#include <spi_flash.h>
> >> ? ? ? +#include <mmc.h>
> >> ? ? ? +#include <fat.h>
> >> ? ? ? +#include <version.h>
> >> ? ? ? +#include <asm/arch/davinci_misc.h>
> >> ? ? ? +#include <asm/arch/pinmux_defs.h>
> >>
> >> ? ? ? ?#ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
> >>
> >> ? ? ? @@ -91,6 +96,11 @@ void board_init_r(gd_t *id, ulong dummy)
> >> ? ? ? ? ? ? ?gd->have_console = 1;
> >>
> >> ? ? ? ? ? ? ?puts("SPI boot...\n");
> >> ? ? ? +#ifdef CONFIG_SPL_MMC_LOAD
> >> ? ? ? + ? ? ? spl_mmc_load();
> >> ? ? ? +#else
> >> ? ? ? ? ? ? ?spi_boot();
> >> ? ? ? -#endif
> >>
> >>
> >> Hmm, now the code prints "SPI boot" and then it boots from MMC, right?
> >> Please output correct messages.
> >>
     Ok
   
> > ?The board is booted up in SPI boot mode only, ie the SPL is loaded from
> > ?SPI flash itself and finally when low level initialization is completed
> > ?The SPL loads the U-boot image in MMC/SD card when CONFIG_SPL_MMC_LOAD
> > ?Config is defined. If CONFIG_SPL_MMC_LOAD is not defined by default the
> > ?SPL loads the U-boot image from SPI flash itself.
> 
> Yes, but your code prints "SPI boot" for both cases, doesn't it?
> 
> >>
> >> ? ? ? +#endif /* CONFIG_SPL_MMC_LOAD */
> >> ? ? ? +
> >> ? ? ? +#endif /* CONFIG_SPL_SPI_LOAD */
> >>
> >>
> >> So, CONFIG_SPL_SPI_LOAD must be defined to boot from MMC?? Ths does not make sense to me.
> >
> > ?No not to boot from MMC, its indicating to SPL which is flashed in
> > ?SPI flash to load the U-boot image(u-boot.bin) from MMC.
> 
> Yes, but your code requires both CONFIG_SPL_MMC_LOAD and
> CONFIG_SPL_SPI_LOAD to be defined to load u-boot from MMC, right? This
> is confusing.
> 
> Of course SPL itself is loaded from SPI flash in both cases, but this
> does not matter here, since the SPL has already loaded to the internal
> SRAM of the SoC by the ROM bootloader of the chip. The SPL could have
> been loaded from some other kind of memory (or UART) as well and would
> not know the difference.

Ok I'll use CONFIG_SPL_MMC_LOAD while loading from MMC. I'll incorporate
These  changes for v3.

Thx,
--Prabhakar Lad

> 
> Regards, Christian
> 
> >
> > Thx,
> > --Prabhakar Lad
> >
> >>
> >> Regards, Christian
> >>
> >
> > _______________________________________________
> > U-Boot mailing list
> > U-Boot at lists.denx.de
> > http://lists.denx.de/mailman/listinfo/u-boot
> 

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

end of thread, other threads:[~2012-06-20 10:31 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-06-07  9:55 [U-Boot] [PATCH v2 0/7] feature additions and fixes for da850/omap-l138 Prabhakar Lad
2012-06-07  9:55 ` [U-Boot] [PATCH v2 1/7] da850/omap-l138: Add MMC support for DA850/OMAP-L138 Prabhakar Lad
2012-06-07  9:55 ` [U-Boot] [PATCH v2 2/7] da850/omap-l138: modifications for Logic PD Rev.3 AM18xx EVM Prabhakar Lad
2012-06-07  9:55 ` [U-Boot] [PATCH v2 3/7] da850/omap-l138: Add support to read u-boot image from MMC/SD Prabhakar Lad
2012-06-18 19:39   ` Christian Riesch
2012-06-19  5:06     ` Lad, Prabhakar
2012-06-20  9:20       ` Christian Riesch
2012-06-20 10:31         ` Lad, Prabhakar
2012-06-07  9:55 ` [U-Boot] [PATCH v2 4/7] da850/omap-l138: Make MMC and NOR support mutually exclusive Prabhakar Lad
2012-06-07  9:55 ` [U-Boot] [PATCH v2 5/7] da850/omap-l138: Fix NAND flash timings Prabhakar Lad
2012-06-07  9:55 ` [U-Boot] [PATCH v2 6/7] da850/omap-l138: Add support for NAND SPL Prabhakar Lad
2012-06-07  9:55 ` [U-Boot] [PATCH v2 7/7] da850/omap-l138: add support for direct NOR boot mode Prabhakar Lad
2012-06-13 10:29 ` [U-Boot] [PATCH v2 0/7] feature additions and fixes for da850/omap-l138 Sughosh Ganu

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.