feature additions and fixes for da850/omap-l138
Subsystems (2)
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.
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 | 13 ++++ arch/arm/cpu/arm926ejs/davinci/spl.c | 25 +++++-- arch/arm/include/asm/arch-davinci/hardware.h | 1 + arch/arm/include/asm/arch-davinci/pinmux_defs.h | 3 + board/davinci/da8xxevm/da850evm.c | 50 ++++++++++++-- drivers/mmc/Makefile | 4 + drivers/mmc/spl_mmc_load.c | 62 ++++++++++++++++ include/configs/da850evm.h | 87 +++++++++++++++++++++-- include/mmc.h | 2 + 9 files changed, 229 insertions(+), 18 deletions(-) create mode 100644 drivers/mmc/spl_mmc_load.c
Signature · 1 line
1.7.4.1
PATCH 1/7 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.
--- arch/arm/cpu/arm926ejs/davinci/da850_pinmux.c | 13 ++++++++++ arch/arm/include/asm/arch-davinci/hardware.h | 1 + arch/arm/include/asm/arch-davinci/pinmux_defs.h | 3 ++ board/davinci/da8xxevm/da850evm.c | 28 +++++++++++++++++++++++ include/configs/da850evm.h | 14 +++++++++++ 5 files changed, 59 insertions(+), 0 deletions(-)
arch/arm/cpu/arm926ejs/davinci/da850_pinmux.c +13 -0
@@ -169,3 +169,16 @@ 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[] = { +/* GP0[11] is required for SD to work on Rev 3 EVMs */ + {pinmux (0 ),8 ,4 },/* GP0[11] */ + {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
@@ -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
@@ -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[7 ]; +#endif
board/davinci/da8xxevm/da850evm.c +28 -0
@@ -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,6 +209,23 @@ 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 */
@@ -236,6 +258,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 +271,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 +14 -0
@@ -313,6 +313,20 @@#undef CONFIG_CMD_ENV#endif +/* SD/MMC */ +#define CONFIG_MMC +#define CONFIG_DAVINCI_MMC_SD1 +#define CONFIG_MMC_MBLOCK +#define CONFIG_GENERIC_MMC +#define CONFIG_DAVINCI_MMC + +#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
PATCH 1/7 da850/omap-l138: Add MMC support for DA850/OMAP-L138
Quoted 3 lines · Prabhakar Lad
From: Lad, Prabhakar <[email protected]>
This patch adds support for MMC/SD on DA850/OMAP-L138.
[snip]
include/configs/da850evm.h line 319
Quoted 4 lines
include/configs/da850evm.h +4
-0+/* SD/MMC */ +#define CONFIG_MMC +#define CONFIG_DAVINCI_MMC_SD1 +#define CONFIG_MMC_MBLOCK
CONFIG_MMC_MBLOCK isn't used anywhere in code, remove it please.
include/configs/da850evm.h line 328
Quoted 9 lines
include/configs/da850evm.h +9
-0+#define CONFIG_GENERIC_MMC +#define CONFIG_DAVINCI_MMC + +#ifdef CONFIG_MMC +#define CONFIG_DOS_PARTITION +#define CONFIG_CMD_EXT2 +#define CONFIG_CMD_FAT +#define CONFIG_CMD_MMC +#endif
I'm not a fan of #define FOO, then checking right away for #ifdef FOO. Just add a comment about these only been needed when you have MMC support so it's clear to folks working from this as a template for their custom board they can remove it.
Signature · 1 line
Tom
Lad
PATCH 1/7 da850/omap-l138: Add MMC support for DA850/OMAP-L138
Hi Tom,
Quoted 4 lines · Tom
Quoted 2 lines · Prabhakar Lad
From: Lad, Prabhakar <[email protected]>
Quoted 8 lines
Quoted 1 line
This patch adds support for MMC/SD on DA850/OMAP-L138.
[snip]
include/configs/da850evm.h line 319
Quoted 4 lines
include/configs/da850evm.h +4
-0+/* SD/MMC */ +#define CONFIG_MMC +#define CONFIG_DAVINCI_MMC_SD1 +#define CONFIG_MMC_MBLOCK
CONFIG_MMC_MBLOCKisn't used anywhere in code, remove it please.
Ok.
Quoted 13 lines
include/configs/da850evm.h line 328
Quoted 10 lines
include/configs/da850evm.h +9
-0+#define CONFIG_GENERIC_MMC +#define CONFIG_DAVINCI_MMC + +#ifdef CONFIG_MMC +#define CONFIG_DOS_PARTITION +#define CONFIG_CMD_EXT2 +#define CONFIG_CMD_FAT +#define CONFIG_CMD_MMC +#endif I'm not a fan of #define FOO, then checking right away for #ifdef FOO.
Just add a comment about these only been needed when you have MMC support so it's clear to folks working from this as a template for their custom board they can remove it.
Ok I'll add a comment over here.
Thx,
--Prabhakar Lad
Quoted 4 lines
--
Tom
PATCH 1/7 da850/omap-l138: Add MMC support for DA850/OMAP-L138
In reply to Prabhakar LadHi,
Quoted 23 lines · Prabhakar Lad
From: Lad, Prabhakar <[email protected]>
This patch adds support for MMC/SD on DA850/OMAP-L138.
Signed-off-by Lad, Prabhakar <[email protected]>Signed-off-by Rajashekhara, Sudhakar <[email protected]>Signed-off-by Hadli, Manjunath <[email protected]>---
?arch/arm/cpu/arm926ejs/davinci/da850_pinmux.c ? | ? 13 ++++++++++ ?arch/arm/include/asm/arch-davinci/hardware.h ? ?| ? ?1 + ?arch/arm/include/asm/arch-davinci/pinmux_defs.h | ? ?3 ++ ?board/davinci/da8xxevm/da850evm.c ? ? ? ? ? ? ? | ? 28 +++++++++++++++++++++++ ?include/configs/da850evm.h ? ? ? ? ? ? ? ? ? ? ?| ? 14 +++++++++++?5 files changed, 59 insertions(+), 0 deletions(-)
arch/arm/cpu/arm926ejs/davinci/da850_pinmux.c +0
-0@@ -169,3 +169,16 @@ const struct pinmux_config emifa_pins_nor[] = {? ? ? ?{ pinmux(12), 1, 6 }, /* EMA_A[1] */
? ? ? ?{ pinmux(12), 1, 7 }, /* EMA_A[0] */
?};
arch/arm/cpu/arm926ejs/davinci/da850_pinmux.c const struct pinmux_config emifa_pins_nor[] = {
Quoted 5 lines
arch/arm/cpu/arm926ejs/davinci/da850_pinmux.c +5
-0+ +/* MMC0 pin muxer settings */ +const struct pinmux_config mmc0_pins[] = { + ? ? ? /* GP0[11] is required for SD to work on Rev 3 EVMs */ + ? ? ? { pinmux(0), ?8, 4 }, ? /* GP0[11] */
Please move GP0[11] to the board specific file, e.g., add it to static const struct pinmux_config gpio_pins[] in board/davinci/da8xxevm/da850evm.c. Other boards might use other (or no) GPIOs for this purpose...
Quoted 120 lines
+ ? ? ? { 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/cpu/arm926ejs/davinci/da850_pinmux.c +1
-0+};arch/arm/include/asm/arch-davinci/hardware.h +0
-0@@ -446,6 +446,7 @@ struct davinci_pllc_regs { ?#define DAVINCI_SPI1_CLKID ?(cpu_is_da830() ? 2 : ASYNC3)?/* Clock IDs */
?enumdavinci_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@@ -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[7 ]; +?#endif
board/davinci/da8xxevm/da850evm.c +0
-0@@ -36,6 +36,11 @@?#include <
asm/errno.h>
?#include <hwconfig.h>board/davinci/da8xxevm/da850evm.c +5
-0+#ifdef CONFIG_DAVINCI_MMC +#include <mmc.h> +#include <asm/arch/sdmmc_defs.h> +#endif +?DECLARE_GLOBAL_DATA_PTR;
?#ifdef
CONFIG_DRIVER_TI_EMACboard/davinci/da8xxevm/da850evm.c +17
-0@@ -204,6 +209,23 @@ 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 */board/davinci/da8xxevm/da850evm.c +0
-0@@ -236,6 +258,9 @@ const struct pinmux_resource pinmuxes[] = { ? ? ? ?PINMUX_ITEM(emifa_pins_nor),?#endif
? ? ? ?PINMUX_ITEM(gpio_pins),board/davinci/da8xxevm/da850evm.c +3
-0+#ifdef CONFIG_DAVINCI_MMC + ? ? ? PINMUX_ITEM(mmc0_pins), +#endif ?};
?const int
pinmuxes_size=ARRAY_SIZE(pinmuxes);board/davinci/da8xxevm/da850evm.c +0
-0@@ -246,6 +271,9 @@ const struct lpsc_resource lpsc[] = {? ? ? ?{
DAVINCI_LPSC_EMAC}, ?/* image download */ ? ? ? ?{DAVINCI_LPSC_UART2}, /* console */ ? ? ? ?{DAVINCI_LPSC_GPIO},board/davinci/da8xxevm/da850evm.c +3
-0+#ifdef CONFIG_DAVINCI_MMC + ? ? ? { DAVINCI_LPSC_MMC_SD }, +#endif?};
?const int
lpsc_size=ARRAY_SIZE(lpsc);include/configs/da850evm.h +0
-0@@ -313,6 +313,20 @@?#undef
CONFIG_CMD_ENV
?#endifinclude/configs/da850evm.h +14
-0+/* SD/MMC */ +#define CONFIG_MMC +#define CONFIG_DAVINCI_MMC_SD1 +#define CONFIG_MMC_MBLOCK +#define CONFIG_GENERIC_MMC +#define CONFIG_DAVINCI_MMC + +#ifdef CONFIG_MMC +#define CONFIG_DOS_PARTITION +#define CONFIG_CMD_EXT2 +#define CONFIG_CMD_FAT +#define CONFIG_CMD_MMC +#endif +?/* defines for SPL */
?#defineCONFIG_SPL
?#defineCONFIG_SPL_SPI_SUPPORT
--
1.7.4.1
Quoted 4 lines
_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot
Regards, Christian
Lad
PATCH 1/7 da850/omap-l138: Add MMC support for DA850/OMAP-L138
Hi Christian,
Quoted 28 lines · Christian Riesch
Hi,
Quoted 25 lines · Prabhakar Lad
From: Lad, Prabhakar <[email protected]>
This patch adds support for MMC/SD on DA850/OMAP-L138.
Signed-off-by Lad, Prabhakar <[email protected]>Signed-off-by Rajashekhara, Sudhakar <[email protected]>Signed-off-by Hadli, Manjunath <[email protected]>---
?arch/arm/cpu/arm926ejs/davinci/da850_pinmux.c ? | ? 13 ++++++++++ ?arch/arm/include/asm/arch-davinci/hardware.h ? ?| ? ?1 + ?arch/arm/include/asm/arch-davinci/pinmux_defs.h | ? ?3 ++ ?board/davinci/da8xxevm/da850evm.c ? ? ? ? ? ? ? | ? 28 +++++++++++++++++++++++ ?include/configs/da850evm.h ? ? ? ? ? ? ? ? ? ? ?| ? 14 +++++++++++?5 files changed, 59 insertions(+), 0 deletions(-)
arch/arm/cpu/arm926ejs/davinci/da850_pinmux.c +0
-0@@ -169,3 +169,16 @@ const struct pinmux_config emifa_pins_nor[] = {? ? ? ?{ pinmux(12), 1, 6 }, /* EMA_A[1] */
? ? ? ?{ pinmux(12), 1, 7 }, /* EMA_A[0] */
?};arch/arm/cpu/arm926ejs/davinci/da850_pinmux.c +2
-0+ +/* MMC0 pin muxer settings */
Quoted 8 lines
Quoted 3 lines
+const struct
pinmux_configmmc0_pins[] = {
+ ? ? ? /* GP0[11] is required for SD to work on Rev 3 EVMs */
+ ? ? ? { pinmux(0), ?8, 4 }, ? /* GP0[11] */Please move GP0[11] to the board specific file, e.g., add it to static const struct
pinmux_configgpio_pins[] inboard/davinci/da8xxevm/da850evm.c. Other boards might use other (or no) GPIOs for this purpose...
Ok.
Thx,
--Prabhakar Lad
Quoted 128 lines
Quoted 121 lines
+ ? ? ? { 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/cpu/arm926ejs/davinci/da850_pinmux.c +1
-0+};arch/arm/include/asm/arch-davinci/hardware.h +0
-0@@ -446,6 +446,7 @@ struct davinci_pllc_regs { ?#define DAVINCI_SPI1_CLKID ?(cpu_is_da830() ? 2 : ASYNC3)?/* Clock IDs */
?enumdavinci_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@@ -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[7 ]; +?#endif
board/davinci/da8xxevm/da850evm.c +0
-0@@ -36,6 +36,11 @@?#include <
asm/errno.h>
?#include <hwconfig.h>board/davinci/da8xxevm/da850evm.c +5
-0+#ifdef CONFIG_DAVINCI_MMC +#include <mmc.h> +#include <asm/arch/sdmmc_defs.h> +#endif +?DECLARE_GLOBAL_DATA_PTR;
?#ifdef
CONFIG_DRIVER_TI_EMACboard/davinci/da8xxevm/da850evm.c +17
-0@@ -204,6 +209,23 @@ 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 */board/davinci/da8xxevm/da850evm.c +0
-0@@ -236,6 +258,9 @@ const struct pinmux_resource pinmuxes[] = { ? ? ? ?PINMUX_ITEM(emifa_pins_nor),?#endif
? ? ? ?PINMUX_ITEM(gpio_pins),board/davinci/da8xxevm/da850evm.c +3
-0+#ifdef CONFIG_DAVINCI_MMC + ? ? ? PINMUX_ITEM(mmc0_pins), +#endif ?};
?const int
pinmuxes_size=ARRAY_SIZE(pinmuxes);board/davinci/da8xxevm/da850evm.c +0
-0@@ -246,6 +271,9 @@ const struct lpsc_resource lpsc[] = {? ? ? ?{
DAVINCI_LPSC_EMAC}, ?/* image download */ ? ? ? ?{DAVINCI_LPSC_UART2}, /* console */ ? ? ? ?{DAVINCI_LPSC_GPIO},board/davinci/da8xxevm/da850evm.c +3
-0+#ifdef CONFIG_DAVINCI_MMC + ? ? ? { DAVINCI_LPSC_MMC_SD }, +#endif?};
?const int
lpsc_size=ARRAY_SIZE(lpsc);include/configs/da850evm.h +0
-0@@ -313,6 +313,20 @@?#undef
CONFIG_CMD_ENV
?#endifinclude/configs/da850evm.h +14
-0+/* SD/MMC */ +#define CONFIG_MMC +#define CONFIG_DAVINCI_MMC_SD1 +#define CONFIG_MMC_MBLOCK +#define CONFIG_GENERIC_MMC +#define CONFIG_DAVINCI_MMC + +#ifdef CONFIG_MMC +#define CONFIG_DOS_PARTITION +#define CONFIG_CMD_EXT2 +#define CONFIG_CMD_FAT +#define CONFIG_CMD_MMC +#endif +?/* defines for SPL */
?#defineCONFIG_SPL
?#defineCONFIG_SPL_SPI_SUPPORT
--
1.7.4.1Quoted 4 lines
_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
http://lists.denx.de/mailman/listinfo/u-bootRegards, Christian
PATCH 2/7 da850/omap-l138: modifications for Logic PD Rev.3 AM18xx EVM
In reply to Prabhakar LadFrom: 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.
--- board/davinci/da8xxevm/da850evm.c | 12 +++++++++++- 1 files changed, 11 insertions(+), 1 deletions(-)
board/davinci/da8xxevm/da850evm.c +11 -1
@@ -331,7 +331,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
@@ -382,6 +382,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 */
Signature · 1 line
1.7.4.1
PATCH 3/7 da850/omap-l138: Add support to read u-boot image from MMC/SD
In reply to Prabhakar LadFrom: 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 the CONFIG_SPL_MMC_LOAD macro in the DA850/OMAP-L138 configuration file to enable this feature.
--- 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
arch/arm/cpu/arm926ejs/davinci/spl.c +11 -1
@@ -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 */ }
drivers/mmc/Makefile +4 -0
@@ -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
drivers/mmc/spl_mmc_load.c new file +62 -0
62 lines not on this page · raw message
include/configs/da850evm.h +8 -0
@@ -320,6 +320,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 +#ifdef CONFIG_MMC #define CONFIG_DOS_PARTITION #define CONFIG_CMD_EXT2
include/mmc.h +2 -0
@@ -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
PATCH 4/7 da850/omap-l138: Make MMC and NOR support mutually exclusive
In reply to Prabhakar LadFrom: 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.
--- include/configs/da850evm.h | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)
include/configs/da850evm.h +2 -0
@@ -314,11 +314,13 @@#endif /* SD/MMC */ +#ifndef CONFIG_USE_NOR #define CONFIG_MMC #define CONFIG_DAVINCI_MMC_SD1 #define CONFIG_MMC_MBLOCK #define CONFIG_GENERIC_MMC #define CONFIG_DAVINCI_MMC +#endif /* Load U-Boot Image From MMC */ #ifdef CONFIG_SPL_MMC_LOAD
Signature · 1 line
1.7.4.1
PATCH 5/7 da850/omap-l138: Fix NAND flash timings
In reply to Prabhakar LadFrom: 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.
--- board/davinci/da8xxevm/da850evm.c | 10 +++++----- 1 files changed, 5 insertions(+), 5 deletions(-)
board/davinci/da8xxevm/da850evm.c +5 -5
@@ -344,11 +344,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
PATCH 6/7 da850/omap-l138: Add support for NAND SPL
In reply to Prabhakar LadFrom: Lad, Prabhakar <[email protected]>
This patch adds support for NAND SPL on DA850/OMAP-L138.
--- arch/arm/cpu/arm926ejs/davinci/spl.c | 13 ++++++----- include/configs/da850evm.h | 39 +++++++++++++++++++++++++++++---- 2 files changed, 41 insertions(+), 11 deletions(-)
arch/arm/cpu/arm926ejs/davinci/spl.c +7 -6
@@ -79,12 +79,6 @@ 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 mem_malloc_init (CONFIG_SYS_TEXT_BASE -CONFIG_SYS_MALLOC_LEN ,CONFIG_SYS_MALLOC_LEN );
@@ -95,6 +89,13 @@ void board_init_r(gd_t *id, ulong dummy)serial_init ();/* serial communications setup */ gd->have_console =1 ; +#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 ();
include/configs/da850evm.h +34 -5
@@ -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 /*
@@ -337,13 +363,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
@@ -351,11 +382,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 */
Signature · 1 line
1.7.4.1
PATCH 6/7 da850/omap-l138: Add support for NAND SPL
Hi,
Quoted 30 lines · Prabhakar Lad
From: Lad, Prabhakar <[email protected]>
This patch adds support for NAND SPL on DA850/OMAP-L138.
Signed-off-by Lad, Prabhakar <[email protected]>Signed-off-by Rajashekhara, Sudhakar <[email protected]>Signed-off-by Hadli, Manjunath <[email protected]>---
?arch/arm/cpu/arm926ejs/davinci/spl.c | ? 13 ++++++----- ?include/configs/da850evm.h ? ? ? ? ? | ? 39 +++++++++++++++++++++++++++++---- ?2 files changed, 41 insertions(+), 11 deletions(-)arch/arm/cpu/arm926ejs/davinci/spl.c +0
-6@@ -79,12 +79,6 @@ 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 ? ? ? ?mem_malloc_init(CONFIG_SYS_TEXT_BASE - CONFIG_SYS_MALLOC_LEN, ? ? ? ? ? ? ? ? ? ? ? ?CONFIG_SYS_MALLOC_LEN);@@ -95,6 +89,13 @@ void board_init_r(gd_t *id, ulong dummy)
Quoted 3 lines
? ? ? ?serial_init(); ? ? ? ? ?/* serial communications setup */ ? ? ? ?gd->have_console = 1;
This breaks the build for the cam_enc_4xx board and the hawkboard.
You may do this initializations only if CONFIG_SPL_LIBCOMMON_SUPPORT is defined. Please test your patchset with ./MAKEALL -s davinci
Regards, Christian
Quoted 10 lines
arch/arm/cpu/arm926ejs/davinci/spl.c +7
-0+#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");
?#ifdefCONFIG_SPL_MMC_LOAD
? ? ? ?spl_mmc_load();
[...]
Lad
PATCH 6/7 da850/omap-l138: Add support for NAND SPL
Hi Christian,
Quoted 39 lines · Christian Riesch
Hi,
Quoted 30 lines · Prabhakar Lad
From: Lad, Prabhakar <[email protected]>
This patch adds support for NAND SPL on DA850/OMAP-L138.
Signed-off-by Lad, Prabhakar <[email protected]>Signed-off-by Rajashekhara, Sudhakar <[email protected]>Signed-off-by Hadli, Manjunath <[email protected]>---
?arch/arm/cpu/arm926ejs/davinci/spl.c | ? 13 ++++++----- ?include/configs/da850evm.h ? ? ? ? ? | ? 39 +++++++++++++++++++++++++++++---- ?2 files changed, 41 insertions(+), 11 deletions(-)arch/arm/cpu/arm926ejs/davinci/spl.c +0
-6@@ -79,12 +79,6 @@ 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 ? ? ? ?mem_malloc_init(CONFIG_SYS_TEXT_BASE - CONFIG_SYS_MALLOC_LEN, ? ? ? ? ? ? ? ? ? ? ? ?CONFIG_SYS_MALLOC_LEN);@@ -95,6 +89,13 @@ void board_init_r(gd_t *id, ulong dummy)Quoted 3 lines
? ? ? ?serial_init(); ? ? ? ? ?/* serial communications setup */ ? ? ? ?gd->have_console = 1;
This breaks the build for the
cam_enc_4xxboard and the hawkboard.
Quoted 3 lines
You may do this initializations only if
CONFIG_SPL_LIBCOMMON_SUPPORTis defined. Please test your patchset with ./MAKEALL -s davinci
Ok I'll fix this.
Thx,
--Prabhakar Lad
Quoted 15 lines
Regards, Christian
Quoted 10 lines
arch/arm/cpu/arm926ejs/davinci/spl.c +7
-0+#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");
?#ifdefCONFIG_SPL_MMC_LOAD
? ? ? ?spl_mmc_load();[...]
PATCH 7/7 da850/omap-l138: add support for direct NOR boot mode
In reply to Prabhakar LadFrom: Lad, Prabhakar <[email protected]>
This patch adds support for direct NOR boot mode on da850/omap-l138.
Define the CONFIG_DIRECT_NOR_BOOT macro along with CONFIG_USE_NOR in the DA850/OMAP-L138 configuration file to enable this feature.
--- include/configs/da850evm.h | 26 +++++++++++++++++++++++++- 1 files changed, 25 insertions(+), 1 deletions(-)
include/configs/da850evm.h +25 -1
@@ -24,6 +24,13 @@#define __CONFIG_H/* +* Define this when NOR U-Boot is loaded directly from flash as it +* must perform all the low level initialization itself. +* +#define CONFIG_DIRECT_NOR_BOOT +*/ + +/* * Board */ #define CONFIG_DRIVER_TI_EMAC
@@ -43,10 +50,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 */
@@ -373,6 +389,7 @@#define CONFIG_SYS_SPI_U_BOOT_SIZE 0x30000#endif +#ifndef CONFIG_USE_NOR /* defines for SPL */ #define CONFIG_SPL #define CONFIG_SPL_SERIAL_SUPPORT
@@ -382,9 +399,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 */
Signature · 1 line
1.7.4.1
PATCH 7/7 da850/omap-l138: add support for direct NOR boot mode
Quoted 8 lines · Prabhakar Lad
From: Lad, Prabhakar <[email protected]>
This patch adds support for direct NOR boot mode on da850/omap-l138.
Define the
CONFIG_DIRECT_NOR_BOOTmacro along withCONFIG_USE_NORin the DA850/OMAP-L138 configuration file to enable this feature.
We should be using boards.cfg to add additional build targets that will toggle CONFIG_DIRECT_NOR_BOOT and other cases where we can't have SW that works in conflicting cases.
Signature · 1 line
Tom
Lad
PATCH 7/7 da850/omap-l138: add support for direct NOR boot mode
Hi Tom,
Quoted 9 lines · Tom
Quoted 6 lines · Prabhakar Lad
From: Lad, Prabhakar <[email protected]>
This patch adds support for direct NOR boot mode on da850/omap-l138.
Define the
CONFIG_DIRECT_NOR_BOOTmacro along withCONFIG_USE_NORin the DA850/OMAP-L138 configuration file to enable this feature.We should be using boards.cfg to add additional build targets that will toggle
CONFIG_DIRECT_NOR_BOOTand other cases where we can't have SW that works in conflicting cases.
Ok I'll add a new entry in boards.cfg.
Thx,
--Prabhakar Lad
Quoted 4 lines
--
Tom