All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot]  [PATCH] da830: add MMC support
@ 2013-05-24  2:46 Vishwanathrao
  2013-05-24 16:01 ` Tom Rini
  0 siblings, 1 reply; 7+ messages in thread
From: Vishwanathrao @ 2013-05-24  2:46 UTC (permalink / raw)
  To: u-boot

Add MMC support for da830 boards in order to perform
mmc operations(read,write and erase).

Signed-off-by: Vishwanathrao Badarkhe, Manish <manishv.b@ti.com>
---
:100644 100644 c45c94b... bf014ae... M	board/davinci/da8xxevm/da830evm.c
:100644 100644 198892b... 28995a0... M	include/configs/da830evm.h
 board/davinci/da8xxevm/da830evm.c |   48 +++++++++++++++++++++++++++++++++++++
 include/configs/da830evm.h        |   24 +++++++++++++++++-
 2 files changed, 70 insertions(+), 2 deletions(-)

diff --git a/board/davinci/da8xxevm/da830evm.c b/board/davinci/da8xxevm/da830evm.c
index c45c94b..bf014ae 100644
--- a/board/davinci/da8xxevm/da830evm.c
+++ b/board/davinci/da8xxevm/da830evm.c
@@ -44,6 +44,11 @@
 #include <asm/arch/nand_defs.h>
 #include <asm/arch/davinci_misc.h>
 
+#ifdef CONFIG_DAVINCI_MMC
+#include <mmc.h>
+#include <asm/arch/sdmmc_defs.h>
+#endif
+
 DECLARE_GLOBAL_DATA_PTR;
 
 /* SPI0 pin muxer settings */
@@ -153,6 +158,23 @@ static const struct pinmux_config usb_pins[] = {
 	{ pinmux(9), 1, 1 }
 };
 
+#ifdef CONFIG_DAVINCI_MMC
+/* MMC0 pin muxer settings */
+const struct pinmux_config mmc0_pins[] = {
+	{ pinmux(15), 2, 7 },	/* MMCSD0_CLK */
+	{ pinmux(16), 2, 0 },	/* MMCSD0_CMD */
+	{ pinmux(13), 2, 6 },	/* MMCSD0_DAT_0 */
+	{ pinmux(13), 2, 7 },	/* MMCSD0_DAT_1 */
+	{ pinmux(14), 2, 0 },	/* MMCSD0_DAT_2 */
+	{ pinmux(14), 2, 1 },	/* MMCSD0_DAT_3 */
+	{ pinmux(14), 2, 2 },	/* MMCSD0_DAT_4 */
+	{ pinmux(14), 2, 3 },	/* MMCSD0_DAT_5 */
+	{ pinmux(14), 2, 4 },	/* MMCSD0_DAT_6 */
+	{ pinmux(14), 2, 5 },	/* MMCSD0_DAT_7 */
+	/* DA830 supports 8-bit mode */
+};
+#endif
+
 static const struct pinmux_resource pinmuxes[] = {
 #ifdef CONFIG_SPI_FLASH
 	PINMUX_ITEM(spi0_pins),
@@ -169,6 +191,9 @@ static const struct pinmux_resource pinmuxes[] = {
 #if defined(CONFIG_DRIVER_TI_EMAC)
 	PINMUX_ITEM(emac_pins),
 #endif
+#ifdef CONFIG_DAVINCI_MMC
+	PINMUX_ITEM(mmc0_pins),
+#endif
 };
 
 static const struct lpsc_resource lpsc[] = {
@@ -177,8 +202,31 @@ static 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
+
 };
 
+#ifdef CONFIG_DAVINCI_MMC
+static struct davinci_mmc mmc_sd0 = {
+	.reg_base = (struct davinci_mmc_regs *)DAVINCI_MMC_SD0_BASE,
+	.host_caps = MMC_MODE_8BIT,
+	.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);
+
+	printf("%x\n", mmc_sd0.input_clk);
+
+	/* Add slot-0 to mmc subsystem */
+	return davinci_mmc_init(bis, &mmc_sd0);
+}
+#endif
+
 int board_init(void)
 {
 #ifndef CONFIG_USE_IRQ
diff --git a/include/configs/da830evm.h b/include/configs/da830evm.h
index 198892b..28995a0 100644
--- a/include/configs/da830evm.h
+++ b/include/configs/da830evm.h
@@ -226,6 +226,28 @@
 #define CONFIG_CMD_SAVEENV
 #endif
 
+/* SD/MMC configuration */
+#ifndef CONFIG_USE_NAND
+#define CONFIG_MMC
+#define CONFIG_DAVINCI_MMC_SD1
+#define CONFIG_GENERIC_MMC
+#define CONFIG_DAVINCI_MMC
+#endif
+
+/*
+ * Enable MMC commands only when
+ * MMC support is present
+ */
+#if defined(CONFIG_MMC) || defined(CONFIG_USB_DA8XX)
+#define CONFIG_DOS_PARTITION	/* include support for FAT/storage */
+#define CONFIG_CMD_FAT		/* include support for FAT cmd */
+#endif
+
+#ifdef CONFIG_MMC
+#define CONFIG_CMD_MMC
+#define CONFIG_CMD_EXT2
+#endif
+
 #if !defined(CONFIG_USE_NAND) && \
 	!defined(CONFIG_USE_NOR) && \
 	!defined(CONFIG_USE_SPIFLASH)
@@ -244,8 +266,6 @@
 
 #define CONFIG_USB_STORAGE	/* MSC class support */
 #define CONFIG_CMD_STORAGE	/* inclue support for usb-storage cmd */
-#define CONFIG_CMD_FAT		/* inclue support for FAT/storage */
-#define CONFIG_DOS_PARTITION	/* inclue support for FAT/storage */
 
 #ifdef CONFIG_USB_KEYBOARD	/* HID class support */
 #define CONFIG_SYS_USB_EVENT_POLL
-- 
1.7.4.1

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

* [U-Boot] [PATCH] da830: add MMC support
  2013-05-24  2:46 [U-Boot] [PATCH] da830: add MMC support Vishwanathrao
@ 2013-05-24 16:01 ` Tom Rini
  2013-05-27  3:33   ` Vishwanathrao
  0 siblings, 1 reply; 7+ messages in thread
From: Tom Rini @ 2013-05-24 16:01 UTC (permalink / raw)
  To: u-boot

On Fri, May 24, 2013 at 08:16:14AM +0530, Vishwanathrao Badarkhe, Manish wrote:

> Add MMC support for da830 boards in order to perform
> mmc operations(read,write and erase).
> 
> Signed-off-by: Vishwanathrao Badarkhe, Manish <manishv.b@ti.com>

Has anything changed between patch postings?  Thanks.

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20130524/3c1fecf4/attachment.pgp>

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

* [U-Boot] [PATCH] da830: add MMC support
  2013-05-24 16:01 ` Tom Rini
@ 2013-05-27  3:33   ` Vishwanathrao
  2013-05-27  6:08     ` [U-Boot] i2c loop command TigerLiu at viatech.com.cn
  2013-05-28 14:38     ` [U-Boot] [PATCH] da830: add MMC support Tom Rini
  0 siblings, 2 replies; 7+ messages in thread
From: Vishwanathrao @ 2013-05-27  3:33 UTC (permalink / raw)
  To: u-boot

Hi Tom

On Fri, May 24, 2013 at 21:31:56, Rini, Tom wrote:
> On Fri, May 24, 2013 at 08:16:14AM +0530, Vishwanathrao Badarkhe, Manish wrote:
> 
> > Add MMC support for da830 boards in order to perform mmc 
> > operations(read,write and erase).
> > 
> > Signed-off-by: Vishwanathrao Badarkhe, Manish <manishv.b@ti.com>
> 
> Has anything changed between patch postings?  Thanks.

Nothing has changed between postings. I resent same patch because during 
first posting of this patch I got message as below:

[U-Boot] [PATCH] da830: add MMC support
Is being held until the list moderator can review it for approval.

Apologize, If you got two versions of same patch. Please ignore first
version and consider this patch for review.

> 
> --
> Tom
> 


Regards,
Manish

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

* [U-Boot]  i2c loop command
  2013-05-27  3:33   ` Vishwanathrao
@ 2013-05-27  6:08     ` TigerLiu at viatech.com.cn
  2013-05-27  7:58       ` Heiko Schocher
  2013-05-28 14:38     ` [U-Boot] [PATCH] da830: add MMC support Tom Rini
  1 sibling, 1 reply; 7+ messages in thread
From: TigerLiu at viatech.com.cn @ 2013-05-27  6:08 UTC (permalink / raw)
  To: u-boot

Hi, experts:
There is an iloop command in older version uboot.
Current uboot also included "i2c loop" cmd.
It's an infinite loop on i2c_read.

So, when to use this command?
Just for debugging I2C read function?

Best wishes,

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

* [U-Boot] i2c loop command
  2013-05-27  6:08     ` [U-Boot] i2c loop command TigerLiu at viatech.com.cn
@ 2013-05-27  7:58       ` Heiko Schocher
  0 siblings, 0 replies; 7+ messages in thread
From: Heiko Schocher @ 2013-05-27  7:58 UTC (permalink / raw)
  To: u-boot

Hello,

Am 27.05.2013 08:08, schrieb TigerLiu at viatech.com.cn:
> Hi, experts:
> There is an iloop command in older version uboot.
> Current uboot also included "i2c loop" cmd.

Yes.

> It's an infinite loop on i2c_read.

Yes!

> So, when to use this command?
> Just for debugging I2C read function?

If you want to read in a loop from an i2c chip addr ... It is in the
first place for debugging purposes.

bye,
Heiko
-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany

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

* [U-Boot] [PATCH] da830: add MMC support
  2013-05-27  3:33   ` Vishwanathrao
  2013-05-27  6:08     ` [U-Boot] i2c loop command TigerLiu at viatech.com.cn
@ 2013-05-28 14:38     ` Tom Rini
  1 sibling, 0 replies; 7+ messages in thread
From: Tom Rini @ 2013-05-28 14:38 UTC (permalink / raw)
  To: u-boot

On Mon, May 27, 2013 at 03:33:58AM +0000, Vishwanathrao Badarkhe, Manish wrote:
> Hi Tom
> 
> On Fri, May 24, 2013 at 21:31:56, Rini, Tom wrote:
> > On Fri, May 24, 2013 at 08:16:14AM +0530, Vishwanathrao Badarkhe, Manish wrote:
> > 
> > > Add MMC support for da830 boards in order to perform mmc 
> > > operations(read,write and erase).
> > > 
> > > Signed-off-by: Vishwanathrao Badarkhe, Manish <manishv.b@ti.com>
> > 
> > Has anything changed between patch postings?  Thanks.
> 
> Nothing has changed between postings. I resent same patch because during 
> first posting of this patch I got message as below:
> 
> [U-Boot] [PATCH] da830: add MMC support
> Is being held until the list moderator can review it for approval.
> 
> Apologize, If you got two versions of same patch. Please ignore first
> version and consider this patch for review.

OK, thanks.  The first copy was approved by the moderators :)  I should
pick this up for the TI tree soon.

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20130528/7e008f9b/attachment.pgp>

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

* [U-Boot]  [PATCH] da830: add MMC support
@ 2013-05-22 13:38 Vishwanathrao
  0 siblings, 0 replies; 7+ messages in thread
From: Vishwanathrao @ 2013-05-22 13:38 UTC (permalink / raw)
  To: u-boot

Add MMC support for da830 boards in order to perform
mmc operations(read,write and erase).

Signed-off-by: Vishwanathrao Badarkhe, Manish <manishv.b@ti.com>
---
:100644 100644 c45c94b... bf014ae... M	board/davinci/da8xxevm/da830evm.c
:100644 100644 198892b... 28995a0... M	include/configs/da830evm.h
 board/davinci/da8xxevm/da830evm.c |   48 +++++++++++++++++++++++++++++++++++++
 include/configs/da830evm.h        |   24 +++++++++++++++++-
 2 files changed, 70 insertions(+), 2 deletions(-)

diff --git a/board/davinci/da8xxevm/da830evm.c b/board/davinci/da8xxevm/da830evm.c
index c45c94b..bf014ae 100644
--- a/board/davinci/da8xxevm/da830evm.c
+++ b/board/davinci/da8xxevm/da830evm.c
@@ -44,6 +44,11 @@
 #include <asm/arch/nand_defs.h>
 #include <asm/arch/davinci_misc.h>
 
+#ifdef CONFIG_DAVINCI_MMC
+#include <mmc.h>
+#include <asm/arch/sdmmc_defs.h>
+#endif
+
 DECLARE_GLOBAL_DATA_PTR;
 
 /* SPI0 pin muxer settings */
@@ -153,6 +158,23 @@ static const struct pinmux_config usb_pins[] = {
 	{ pinmux(9), 1, 1 }
 };
 
+#ifdef CONFIG_DAVINCI_MMC
+/* MMC0 pin muxer settings */
+const struct pinmux_config mmc0_pins[] = {
+	{ pinmux(15), 2, 7 },	/* MMCSD0_CLK */
+	{ pinmux(16), 2, 0 },	/* MMCSD0_CMD */
+	{ pinmux(13), 2, 6 },	/* MMCSD0_DAT_0 */
+	{ pinmux(13), 2, 7 },	/* MMCSD0_DAT_1 */
+	{ pinmux(14), 2, 0 },	/* MMCSD0_DAT_2 */
+	{ pinmux(14), 2, 1 },	/* MMCSD0_DAT_3 */
+	{ pinmux(14), 2, 2 },	/* MMCSD0_DAT_4 */
+	{ pinmux(14), 2, 3 },	/* MMCSD0_DAT_5 */
+	{ pinmux(14), 2, 4 },	/* MMCSD0_DAT_6 */
+	{ pinmux(14), 2, 5 },	/* MMCSD0_DAT_7 */
+	/* DA830 supports 8-bit mode */
+};
+#endif
+
 static const struct pinmux_resource pinmuxes[] = {
 #ifdef CONFIG_SPI_FLASH
 	PINMUX_ITEM(spi0_pins),
@@ -169,6 +191,9 @@ static const struct pinmux_resource pinmuxes[] = {
 #if defined(CONFIG_DRIVER_TI_EMAC)
 	PINMUX_ITEM(emac_pins),
 #endif
+#ifdef CONFIG_DAVINCI_MMC
+	PINMUX_ITEM(mmc0_pins),
+#endif
 };
 
 static const struct lpsc_resource lpsc[] = {
@@ -177,8 +202,31 @@ static 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
+
 };
 
+#ifdef CONFIG_DAVINCI_MMC
+static struct davinci_mmc mmc_sd0 = {
+	.reg_base = (struct davinci_mmc_regs *)DAVINCI_MMC_SD0_BASE,
+	.host_caps = MMC_MODE_8BIT,
+	.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);
+
+	printf("%x\n", mmc_sd0.input_clk);
+
+	/* Add slot-0 to mmc subsystem */
+	return davinci_mmc_init(bis, &mmc_sd0);
+}
+#endif
+
 int board_init(void)
 {
 #ifndef CONFIG_USE_IRQ
diff --git a/include/configs/da830evm.h b/include/configs/da830evm.h
index 198892b..28995a0 100644
--- a/include/configs/da830evm.h
+++ b/include/configs/da830evm.h
@@ -226,6 +226,28 @@
 #define CONFIG_CMD_SAVEENV
 #endif
 
+/* SD/MMC configuration */
+#ifndef CONFIG_USE_NAND
+#define CONFIG_MMC
+#define CONFIG_DAVINCI_MMC_SD1
+#define CONFIG_GENERIC_MMC
+#define CONFIG_DAVINCI_MMC
+#endif
+
+/*
+ * Enable MMC commands only when
+ * MMC support is present
+ */
+#if defined(CONFIG_MMC) || defined(CONFIG_USB_DA8XX)
+#define CONFIG_DOS_PARTITION	/* include support for FAT/storage */
+#define CONFIG_CMD_FAT		/* include support for FAT cmd */
+#endif
+
+#ifdef CONFIG_MMC
+#define CONFIG_CMD_MMC
+#define CONFIG_CMD_EXT2
+#endif
+
 #if !defined(CONFIG_USE_NAND) && \
 	!defined(CONFIG_USE_NOR) && \
 	!defined(CONFIG_USE_SPIFLASH)
@@ -244,8 +266,6 @@
 
 #define CONFIG_USB_STORAGE	/* MSC class support */
 #define CONFIG_CMD_STORAGE	/* inclue support for usb-storage cmd */
-#define CONFIG_CMD_FAT		/* inclue support for FAT/storage */
-#define CONFIG_DOS_PARTITION	/* inclue support for FAT/storage */
 
 #ifdef CONFIG_USB_KEYBOARD	/* HID class support */
 #define CONFIG_SYS_USB_EVENT_POLL
-- 
1.7.4.1

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

end of thread, other threads:[~2013-05-28 14:38 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-05-24  2:46 [U-Boot] [PATCH] da830: add MMC support Vishwanathrao
2013-05-24 16:01 ` Tom Rini
2013-05-27  3:33   ` Vishwanathrao
2013-05-27  6:08     ` [U-Boot] i2c loop command TigerLiu at viatech.com.cn
2013-05-27  7:58       ` Heiko Schocher
2013-05-28 14:38     ` [U-Boot] [PATCH] da830: add MMC support Tom Rini
  -- strict thread matches above, loose matches on Subject: below --
2013-05-22 13:38 Vishwanathrao

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.