public inbox for linux-omap@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/11] Some am3517 related patches
@ 2010-04-13  9:31 Stanley.Miao
  2010-04-13  9:31 ` [PATCH 01/11] omap: remove one of the define of INT_34XX_BENCH_MPU_EMUL Stanley.Miao
                   ` (10 more replies)
  0 siblings, 11 replies; 21+ messages in thread
From: Stanley.Miao @ 2010-04-13  9:31 UTC (permalink / raw)
  To: linux-omap; +Cc: tony

Some am3517 related patches. The detaild changelog is below:


The following changes since commit eba014745cc806d625b6a553d1af6efd14e16321:
  Tony Lindgren (1):
        Linux-omap rebuilt: Updated to -rc3

are available in the git repository at:

  . devel

Stanley.Miao (11):
      omap: remove one of the define of INT_34XX_BENCH_MPU_EMUL
      AM3517: Add platform init code for EMAC driver
      AM3517: rename the i2c boardinfo to make it more readable
      AM3517: Add platform init code for regulator driver
      AM3517: Add audio codec platform data
      AM3517: Add nand platform data for am3517evm
      AM3517: initialize i2c subsystem after mux subsystem
      OMAP: fix a gpmc nand problem
      omap: init the gpio pinmux for mmc
      omap hsmmc: fix the hsmmc driver for am3517.
      AM3517: Add mmc platform data for am3517evm

 arch/arm/mach-omap2/Makefile              |    3 +-
 arch/arm/mach-omap2/board-am3517evm.c     |  392 ++++++++++++++++++++++++++++-
 arch/arm/mach-omap2/devices.c             |    7 +
 arch/arm/mach-omap2/gpmc-nand.c           |    3 +
 arch/arm/mach-omap2/hsmmc.c               |    4 +-
 arch/arm/mach-omap2/include/mach/am35xx.h |    9 +
 arch/arm/plat-omap/include/plat/irqs.h    |    2 -
 drivers/mmc/host/omap_hsmmc.c             |   28 ++-
 8 files changed, 421 insertions(+), 27 deletions(-)


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

* [PATCH 01/11] omap: remove one of the define of INT_34XX_BENCH_MPU_EMUL
  2010-04-13  9:31 [PATCH 0/11] Some am3517 related patches Stanley.Miao
@ 2010-04-13  9:31 ` Stanley.Miao
  2010-04-13  9:31 ` [PATCH 02/11] AM3517: Add platform init code for EMAC driver Stanley.Miao
                   ` (9 subsequent siblings)
  10 siblings, 0 replies; 21+ messages in thread
From: Stanley.Miao @ 2010-04-13  9:31 UTC (permalink / raw)
  To: linux-omap; +Cc: tony

INT_34XX_BENCH_MPU_EMUL was defined twice, another is at Line 312.

Signed-off-by: Stanley.Miao <stanley.miao@windriver.com>
---
 arch/arm/plat-omap/include/plat/irqs.h |    2 --
 1 files changed, 0 insertions(+), 2 deletions(-)

diff --git a/arch/arm/plat-omap/include/plat/irqs.h b/arch/arm/plat-omap/include/plat/irqs.h
index b65088a..4017019 100644
--- a/arch/arm/plat-omap/include/plat/irqs.h
+++ b/arch/arm/plat-omap/include/plat/irqs.h
@@ -345,8 +345,6 @@
 #define INT_34XX_MMC3_IRQ	94
 #define INT_34XX_GPT12_IRQ	95
 
-#define	INT_34XX_BENCH_MPU_EMUL	3
-
 #define INT_35XX_HECC0_IRQ		24
 #define INT_35XX_HECC1_IRQ		28
 #define INT_35XX_EMAC_C0_RXTHRESH_IRQ	67
-- 
1.5.4.3


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

* [PATCH 02/11] AM3517: Add platform init code for EMAC driver
  2010-04-13  9:31 [PATCH 0/11] Some am3517 related patches Stanley.Miao
  2010-04-13  9:31 ` [PATCH 01/11] omap: remove one of the define of INT_34XX_BENCH_MPU_EMUL Stanley.Miao
@ 2010-04-13  9:31 ` Stanley.Miao
  2010-04-13  9:31 ` [PATCH 03/11] AM3517: rename the i2c boardinfo to make it more readable Stanley.Miao
                   ` (8 subsequent siblings)
  10 siblings, 0 replies; 21+ messages in thread
From: Stanley.Miao @ 2010-04-13  9:31 UTC (permalink / raw)
  To: linux-omap; +Cc: tony

Add platform init code for EMAC driver.

Signed-off-by: Stanley.Miao <stanley.miao@windriver.com>
---
 arch/arm/mach-omap2/board-am3517evm.c     |  114 +++++++++++++++++++++++++++++
 arch/arm/mach-omap2/include/mach/am35xx.h |    9 ++
 2 files changed, 123 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/board-am3517evm.c b/arch/arm/mach-omap2/board-am3517evm.c
index 6ae8805..db542b2 100644
--- a/arch/arm/mach-omap2/board-am3517evm.c
+++ b/arch/arm/mach-omap2/board-am3517evm.c
@@ -20,6 +20,7 @@
 #include <linux/init.h>
 #include <linux/platform_device.h>
 #include <linux/gpio.h>
+#include <linux/davinci_emac.h>
 #include <linux/i2c/pca953x.h>
 
 #include <mach/hardware.h>
@@ -30,6 +31,7 @@
 
 #include <plat/board.h>
 #include <plat/common.h>
+#include <plat/control.h>
 #include <plat/usb.h>
 #include <plat/display.h>
 
@@ -39,6 +41,117 @@
 #define LCD_PANEL_BKLIGHT_PWR	182
 #define LCD_PANEL_PWM		181
 
+#define AM35XX_EVM_PHY_MASK          (0xF)
+#define AM35XX_EVM_MDIO_FREQUENCY    (1000000) /*PHY bus frequency */
+
+static struct emac_platform_data am3517_evm_emac_pdata = {
+	.phy_mask       = AM35XX_EVM_PHY_MASK,
+	.mdio_max_freq  = AM35XX_EVM_MDIO_FREQUENCY,
+	.rmii_en        = 1,
+};
+
+static int __init eth_addr_setup(char *str)
+{
+	int i;
+	long res;
+
+	if (str == NULL)
+		return 0;
+	for (i = 0; i <  ETH_ALEN; i++) {
+		if (!strict_strtol(&str[i * 3], 16, &res))
+			am3517_evm_emac_pdata.mac_addr[i] = res;
+		else
+			return -EINVAL;
+	}
+	return 1;
+}
+
+/* Get MAC address from kernel boot parameter eth=AA:BB:CC:DD:EE:FF */
+__setup("eth=", eth_addr_setup);
+
+static struct resource am3517_emac_resources[] = {
+	{
+		.start  = AM35XX_IPSS_EMAC_BASE,
+		.end    = AM35XX_IPSS_EMAC_BASE + 0x3FFFF,
+		.flags  = IORESOURCE_MEM,
+	},
+	{
+		.start  = INT_35XX_EMAC_C0_RXTHRESH_IRQ,
+		.end    = INT_35XX_EMAC_C0_RXTHRESH_IRQ,
+		.flags  = IORESOURCE_IRQ,
+	},
+	{
+		.start  = INT_35XX_EMAC_C0_RX_PULSE_IRQ,
+		.end    = INT_35XX_EMAC_C0_RX_PULSE_IRQ,
+		.flags  = IORESOURCE_IRQ,
+	},
+	{
+		.start  = INT_35XX_EMAC_C0_TX_PULSE_IRQ,
+		.end    = INT_35XX_EMAC_C0_TX_PULSE_IRQ,
+		.flags  = IORESOURCE_IRQ,
+	},
+	{
+		.start  = INT_35XX_EMAC_C0_MISC_PULSE_IRQ,
+		.end    = INT_35XX_EMAC_C0_MISC_PULSE_IRQ,
+		.flags  = IORESOURCE_IRQ,
+	},
+};
+
+static struct platform_device am3517_emac_device = {
+	.name           = "davinci_emac",
+	.id             = -1,
+	.num_resources  = ARRAY_SIZE(am3517_emac_resources),
+	.resource       = am3517_emac_resources,
+};
+
+static void am3517_enable_ethernet_int(void)
+{
+	u32 regval;
+
+	regval = omap_ctrl_readl(AM35XX_CONTROL_LVL_INTR_CLEAR);
+	regval = (regval | AM35XX_CPGMAC_C0_RX_PULSE_CLR |
+			AM35XX_CPGMAC_C0_TX_PULSE_CLR |
+			AM35XX_CPGMAC_C0_MISC_PULSE_CLR |
+			AM35XX_CPGMAC_C0_RX_THRESH_CLR);
+	omap_ctrl_writel(regval, AM35XX_CONTROL_LVL_INTR_CLEAR);
+	regval = omap_ctrl_readl(AM35XX_CONTROL_LVL_INTR_CLEAR);
+}
+
+static void am3517_disable_ethernet_int(void)
+{
+	u32 regval;
+
+	regval = omap_ctrl_readl(AM35XX_CONTROL_LVL_INTR_CLEAR);
+	regval = (regval | AM35XX_CPGMAC_C0_RX_PULSE_CLR |
+			AM35XX_CPGMAC_C0_TX_PULSE_CLR);
+	omap_ctrl_writel(regval, AM35XX_CONTROL_LVL_INTR_CLEAR);
+	regval = omap_ctrl_readl(AM35XX_CONTROL_LVL_INTR_CLEAR);
+}
+
+void am3517_evm_ethernet_init(struct emac_platform_data *pdata)
+{
+	u32 regval;
+
+	pdata->ctrl_reg_offset          = AM35XX_EMAC_CNTRL_OFFSET;
+	pdata->ctrl_mod_reg_offset      = AM35XX_EMAC_CNTRL_MOD_OFFSET;
+	pdata->ctrl_ram_offset          = AM35XX_EMAC_CNTRL_RAM_OFFSET;
+	pdata->mdio_reg_offset          = AM35XX_EMAC_MDIO_OFFSET;
+	pdata->ctrl_ram_size            = AM35XX_EMAC_CNTRL_RAM_SIZE;
+	pdata->version                  = EMAC_VERSION_2;
+	pdata->hw_ram_addr              = AM35XX_EMAC_HW_RAM_ADDR;
+	pdata->interrupt_enable	        = am3517_enable_ethernet_int;
+	pdata->interrupt_disable        = am3517_disable_ethernet_int;
+	am3517_emac_device.dev.platform_data     = pdata;
+	platform_device_register(&am3517_emac_device);
+
+	regval = omap_ctrl_readl(AM35XX_CONTROL_IP_SW_RESET);
+	regval = regval & (~(AM35XX_CPGMACSS_SW_RST));
+	omap_ctrl_writel(regval, AM35XX_CONTROL_IP_SW_RESET);
+	regval = omap_ctrl_readl(AM35XX_CONTROL_IP_SW_RESET);
+
+	return ;
+ }
+
 static struct i2c_board_info __initdata am3517evm_i2c_boardinfo[] = {
 	{
 		I2C_BOARD_INFO("s35390a", 0x30),
@@ -308,6 +421,7 @@ static void __init am3517_evm_init(void)
 	/* DSS */
 	am3517_evm_display_init();
 
+	am3517_evm_ethernet_init(&am3517_evm_emac_pdata);
 	/* RTC - S35390A */
 	am3517_evm_rtc_init();
 
diff --git a/arch/arm/mach-omap2/include/mach/am35xx.h b/arch/arm/mach-omap2/include/mach/am35xx.h
index a705f94..12a85ec 100644
--- a/arch/arm/mach-omap2/include/mach/am35xx.h
+++ b/arch/arm/mach-omap2/include/mach/am35xx.h
@@ -23,4 +23,13 @@
 #define AM35XX_IPSS_HECC_BASE		0x5C050000
 #define AM35XX_IPSS_VPFE_BASE		0x5C060000
 
+#define AM35XX_EMAC_CNTRL_OFFSET        (0x10000)
+#define AM35XX_EMAC_CNTRL_MOD_OFFSET    (0x0)
+#define AM35XX_EMAC_CNTRL_RAM_OFFSET    (0x20000)
+#define AM35XX_EMAC_MDIO_OFFSET         (0x30000)
+#define AM35XX_EMAC_CNTRL_RAM_SIZE      (0x2000)
+#define AM35XX_EMAC_RAM_ADDR            (AM35XX_IPSS_EMAC_BASE + \
+						AM35XX_EMAC_CNTRL_RAM_OFFSET)
+#define AM35XX_EMAC_HW_RAM_ADDR         (0x01E20000)
+
 #endif /*  __ASM_ARCH_AM35XX_H */
-- 
1.5.4.3


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

* [PATCH 03/11] AM3517: rename the i2c boardinfo to make it more readable
  2010-04-13  9:31 [PATCH 0/11] Some am3517 related patches Stanley.Miao
  2010-04-13  9:31 ` [PATCH 01/11] omap: remove one of the define of INT_34XX_BENCH_MPU_EMUL Stanley.Miao
  2010-04-13  9:31 ` [PATCH 02/11] AM3517: Add platform init code for EMAC driver Stanley.Miao
@ 2010-04-13  9:31 ` Stanley.Miao
  2010-04-13 16:29   ` Hiremath, Vaibhav
  2010-04-13  9:31 ` [PATCH 04/11] AM3517: Add platform init code for regulator driver Stanley.Miao
                   ` (7 subsequent siblings)
  10 siblings, 1 reply; 21+ messages in thread
From: Stanley.Miao @ 2010-04-13  9:31 UTC (permalink / raw)
  To: linux-omap; +Cc: tony

There are three i3c buses on am3517, now rename these three boardinfo
structure name to am3517evm_i2c1_boardinfo, am3517evm_i2c2_boardinfo,
and am3517evm_i2c3_boardinfo, to make it more readable.

Signed-off-by: Stanley.Miao <stanley.miao@windriver.com>
---
 arch/arm/mach-omap2/board-am3517evm.c |   20 ++++++++++----------
 1 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/arch/arm/mach-omap2/board-am3517evm.c b/arch/arm/mach-omap2/board-am3517evm.c
index db542b2..5abf333 100644
--- a/arch/arm/mach-omap2/board-am3517evm.c
+++ b/arch/arm/mach-omap2/board-am3517evm.c
@@ -152,7 +152,7 @@ void am3517_evm_ethernet_init(struct emac_platform_data *pdata)
 	return ;
  }
 
-static struct i2c_board_info __initdata am3517evm_i2c_boardinfo[] = {
+static struct i2c_board_info __initdata am3517evm_i2c1_boardinfo[] = {
 	{
 		I2C_BOARD_INFO("s35390a", 0x30),
 		.type		= "s35390a",
@@ -182,7 +182,7 @@ static void __init am3517_evm_rtc_init(void)
 		gpio_free(GPIO_RTCS35390A_IRQ);
 		return;
 	}
-	am3517evm_i2c_boardinfo[0].irq = gpio_to_irq(GPIO_RTCS35390A_IRQ);
+	am3517evm_i2c1_boardinfo[0].irq = gpio_to_irq(GPIO_RTCS35390A_IRQ);
 }
 
 /*
@@ -193,7 +193,7 @@ static void __init am3517_evm_rtc_init(void)
 static struct pca953x_platform_data am3517evm_gpio_expander_info_0 = {
 	.gpio_base	= OMAP_MAX_GPIO_LINES,
 };
-static struct i2c_board_info __initdata am3517evm_tca6416_info_0[] = {
+static struct i2c_board_info __initdata am3517evm_i2c2_boardinfo[] = {
 	{
 		I2C_BOARD_INFO("tca6416", 0x21),
 		.platform_data = &am3517evm_gpio_expander_info_0,
@@ -207,7 +207,7 @@ static struct pca953x_platform_data am3517evm_ui_gpio_expander_info_1 = {
 static struct pca953x_platform_data am3517evm_ui_gpio_expander_info_2 = {
 	.gpio_base	= OMAP_MAX_GPIO_LINES + 32,
 };
-static struct i2c_board_info __initdata am3517evm_ui_tca6416_info[] = {
+static struct i2c_board_info __initdata am3517evm_i2c3_boardinfo[] = {
 	{
 		I2C_BOARD_INFO("tca6416", 0x20),
 		.platform_data = &am3517evm_ui_gpio_expander_info_1,
@@ -221,10 +221,10 @@ static struct i2c_board_info __initdata am3517evm_ui_tca6416_info[] = {
 static int __init am3517_evm_i2c_init(void)
 {
 	omap_register_i2c_bus(1, 400, NULL, 0);
-	omap_register_i2c_bus(2, 400, am3517evm_tca6416_info_0,
-			ARRAY_SIZE(am3517evm_tca6416_info_0));
-	omap_register_i2c_bus(3, 400, am3517evm_ui_tca6416_info,
-			ARRAY_SIZE(am3517evm_ui_tca6416_info));
+	omap_register_i2c_bus(2, 400, am3517evm_i2c2_boardinfo,
+			ARRAY_SIZE(am3517evm_i2c2_boardinfo));
+	omap_register_i2c_bus(3, 400, am3517evm_i2c3_boardinfo,
+			ARRAY_SIZE(am3517evm_i2c3_boardinfo));
 
 	return 0;
 }
@@ -425,8 +425,8 @@ static void __init am3517_evm_init(void)
 	/* RTC - S35390A */
 	am3517_evm_rtc_init();
 
-	i2c_register_board_info(1, am3517evm_i2c_boardinfo,
-				ARRAY_SIZE(am3517evm_i2c_boardinfo));
+	i2c_register_board_info(1, am3517evm_i2c1_boardinfo,
+				ARRAY_SIZE(am3517evm_i2c1_boardinfo));
 }
 
 static void __init am3517_evm_map_io(void)
-- 
1.5.4.3


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

* [PATCH 04/11] AM3517: Add platform init code for regulator driver
  2010-04-13  9:31 [PATCH 0/11] Some am3517 related patches Stanley.Miao
                   ` (2 preceding siblings ...)
  2010-04-13  9:31 ` [PATCH 03/11] AM3517: rename the i2c boardinfo to make it more readable Stanley.Miao
@ 2010-04-13  9:31 ` Stanley.Miao
  2010-04-13  9:31 ` [PATCH 05/11] AM3517: Add audio codec platform data Stanley.Miao
                   ` (6 subsequent siblings)
  10 siblings, 0 replies; 21+ messages in thread
From: Stanley.Miao @ 2010-04-13  9:31 UTC (permalink / raw)
  To: linux-omap; +Cc: tony

Add platform init code for regulator driver.

Signed-off-by: Stanley.Miao <stanley.miao@windriver.com>
---
 arch/arm/mach-omap2/board-am3517evm.c |  122 +++++++++++++++++++++++++++++++++
 1 files changed, 122 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/board-am3517evm.c b/arch/arm/mach-omap2/board-am3517evm.c
index 5abf333..2d7fd08 100644
--- a/arch/arm/mach-omap2/board-am3517evm.c
+++ b/arch/arm/mach-omap2/board-am3517evm.c
@@ -22,6 +22,7 @@
 #include <linux/gpio.h>
 #include <linux/davinci_emac.h>
 #include <linux/i2c/pca953x.h>
+#include <linux/regulator/machine.h>
 
 #include <mach/hardware.h>
 #include <mach/am35xx.h>
@@ -159,6 +160,122 @@ static struct i2c_board_info __initdata am3517evm_i2c1_boardinfo[] = {
 	},
 };
 
+/* TPS65023 specific initialization */
+/* VDCDC1 -> VDD_CORE */
+static struct regulator_consumer_supply am3517_evm_vdcdc1_supplies[] = {
+	{
+		.supply = "vdd_core",
+	},
+};
+
+/* VDCDC2 -> VDDSHV */
+static struct regulator_consumer_supply am3517_evm_vdcdc2_supplies[] = {
+	{
+		.supply = "vddshv",
+	},
+};
+
+/* VDCDC2 |-> VDDS
+	   |-> VDDS_SRAM_CORE_BG
+	   |-> VDDS_SRAM_MPU */
+static struct regulator_consumer_supply am3517_evm_vdcdc3_supplies[] = {
+	{
+		.supply = "vdds",
+	},
+	{
+		.supply = "vdds_sram_core_bg",
+	},
+	{
+		.supply = "vdds_sram_mpu",
+	},
+};
+
+/* LDO1 |-> VDDA1P8V_USBPHY
+	 |-> VDDA_DAC */
+static struct regulator_consumer_supply am3517_evm_ldo1_supplies[] = {
+	{
+		.supply = "vdda1p8v_usbphy",
+	},
+	{
+		.supply = "vdda_dac",
+	},
+};
+
+/* LDO2 -> VDDA3P3V_USBPHY */
+static struct regulator_consumer_supply am3517_evm_ldo2_supplies[] = {
+	{
+		.supply = "vdda3p3v_usbphy",
+	},
+};
+
+static struct regulator_init_data am3517_evm_regulator_data[] = {
+	/* DCDC1 */
+	{
+		.constraints = {
+			.min_uV = 1200000,
+			.max_uV = 1200000,
+			.valid_modes_mask = REGULATOR_MODE_NORMAL,
+			.valid_ops_mask = REGULATOR_CHANGE_STATUS,
+			.always_on = true,
+			.apply_uV = false,
+		},
+		.num_consumer_supplies = ARRAY_SIZE(am3517_evm_vdcdc1_supplies),
+		.consumer_supplies = am3517_evm_vdcdc1_supplies,
+	},
+	/* DCDC2 */
+	{
+		.constraints = {
+			.min_uV = 3300000,
+			.max_uV = 3300000,
+			.valid_modes_mask = REGULATOR_MODE_NORMAL,
+			.valid_ops_mask = REGULATOR_CHANGE_STATUS,
+			.always_on = true,
+			.apply_uV = false,
+		},
+		.num_consumer_supplies = ARRAY_SIZE(am3517_evm_vdcdc2_supplies),
+		.consumer_supplies = am3517_evm_vdcdc2_supplies,
+	},
+	/* DCDC3 */
+	{
+		.constraints = {
+			.min_uV = 1800000,
+			.max_uV = 1800000,
+			.valid_modes_mask = REGULATOR_MODE_NORMAL,
+			.valid_ops_mask = REGULATOR_CHANGE_STATUS,
+			.always_on = true,
+			.apply_uV = false,
+		},
+		.num_consumer_supplies = ARRAY_SIZE(am3517_evm_vdcdc3_supplies),
+		.consumer_supplies = am3517_evm_vdcdc3_supplies,
+	},
+	/* LDO1 */
+	{
+		.constraints = {
+			.min_uV = 1800000,
+			.max_uV = 1800000,
+			.valid_modes_mask = REGULATOR_MODE_NORMAL,
+			.valid_ops_mask = REGULATOR_CHANGE_STATUS,
+			.always_on = false,
+			.apply_uV = false,
+		},
+		.num_consumer_supplies = ARRAY_SIZE(am3517_evm_ldo1_supplies),
+		.consumer_supplies = am3517_evm_ldo1_supplies,
+	},
+	/* LDO2 */
+	{
+		.constraints = {
+			.min_uV = 3300000,
+			.max_uV = 3300000,
+			.valid_modes_mask = REGULATOR_MODE_NORMAL,
+			.valid_ops_mask = REGULATOR_CHANGE_STATUS,
+			.always_on = false,
+			.apply_uV = false,
+		},
+		.num_consumer_supplies = ARRAY_SIZE(am3517_evm_ldo2_supplies),
+		.consumer_supplies = am3517_evm_ldo2_supplies,
+	},
+};
+
 /*
  * RTC - S35390A
  */
@@ -216,6 +333,11 @@ static struct i2c_board_info __initdata am3517evm_i2c3_boardinfo[] = {
 		I2C_BOARD_INFO("tca6416", 0x21),
 		.platform_data = &am3517evm_ui_gpio_expander_info_2,
 	},
+	{
+		I2C_BOARD_INFO("tps65023", 0x48),
+		.flags = I2C_CLIENT_WAKE,
+		.platform_data = &am3517_evm_regulator_data[0],
+	},
 };
 
 static int __init am3517_evm_i2c_init(void)
-- 
1.5.4.3


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

* [PATCH 05/11] AM3517: Add audio codec platform data
  2010-04-13  9:31 [PATCH 0/11] Some am3517 related patches Stanley.Miao
                   ` (3 preceding siblings ...)
  2010-04-13  9:31 ` [PATCH 04/11] AM3517: Add platform init code for regulator driver Stanley.Miao
@ 2010-04-13  9:31 ` Stanley.Miao
  2010-04-13  9:31 ` [PATCH 06/11] AM3517: Add nand platform data for am3517evm Stanley.Miao
                   ` (5 subsequent siblings)
  10 siblings, 0 replies; 21+ messages in thread
From: Stanley.Miao @ 2010-04-13  9:31 UTC (permalink / raw)
  To: linux-omap; +Cc: tony

Codec tlv320aic23 is on the second i2c bus. Add the tlv320aic23 info in
i2c2 board_info.

Signed-off-by: Stanley.Miao <stanley.miao@windriver.com>
---
 arch/arm/mach-omap2/board-am3517evm.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/board-am3517evm.c b/arch/arm/mach-omap2/board-am3517evm.c
index 2d7fd08..879c13f 100644
--- a/arch/arm/mach-omap2/board-am3517evm.c
+++ b/arch/arm/mach-omap2/board-am3517evm.c
@@ -312,6 +312,9 @@ static struct pca953x_platform_data am3517evm_gpio_expander_info_0 = {
 };
 static struct i2c_board_info __initdata am3517evm_i2c2_boardinfo[] = {
 	{
+		I2C_BOARD_INFO("tlv320aic23", 0x1A),
+	},
+	{
 		I2C_BOARD_INFO("tca6416", 0x21),
 		.platform_data = &am3517evm_gpio_expander_info_0,
 	},
-- 
1.5.4.3


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

* [PATCH 06/11] AM3517: Add nand platform data for am3517evm
  2010-04-13  9:31 [PATCH 0/11] Some am3517 related patches Stanley.Miao
                   ` (4 preceding siblings ...)
  2010-04-13  9:31 ` [PATCH 05/11] AM3517: Add audio codec platform data Stanley.Miao
@ 2010-04-13  9:31 ` Stanley.Miao
  2010-04-13  9:31 ` [PATCH 07/11] AM3517: initialize i2c subsystem after mux subsystem Stanley.Miao
                   ` (4 subsequent siblings)
  10 siblings, 0 replies; 21+ messages in thread
From: Stanley.Miao @ 2010-04-13  9:31 UTC (permalink / raw)
  To: linux-omap; +Cc: tony

Add nand flash init code for am3517evm.

Signed-off-by: Stanley.Miao <stanley.miao@windriver.com>
---
 arch/arm/mach-omap2/board-am3517evm.c |   84 +++++++++++++++++++++++++++++++++
 1 files changed, 84 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/board-am3517evm.c b/arch/arm/mach-omap2/board-am3517evm.c
index 879c13f..a76ff11 100644
--- a/arch/arm/mach-omap2/board-am3517evm.c
+++ b/arch/arm/mach-omap2/board-am3517evm.c
@@ -23,6 +23,9 @@
 #include <linux/davinci_emac.h>
 #include <linux/i2c/pca953x.h>
 #include <linux/regulator/machine.h>
+#include <linux/mtd/mtd.h>
+#include <linux/mtd/partitions.h>
+#include <linux/mtd/nand.h>
 
 #include <mach/hardware.h>
 #include <mach/am35xx.h>
@@ -35,6 +38,8 @@
 #include <plat/control.h>
 #include <plat/usb.h>
 #include <plat/display.h>
+#include <plat/nand.h>
+#include <plat/gpmc.h>
 
 #include "mux.h"
 
@@ -42,6 +47,84 @@
 #define LCD_PANEL_BKLIGHT_PWR	182
 #define LCD_PANEL_PWM		181
 
+#define GPMC_CS0_BASE  0x60
+#define GPMC_CS_SIZE   0x30
+
+#define NAND_BLOCK_SIZE        SZ_128K
+
+static struct mtd_partition am3517evm_nand_partitions[] = {
+	/* All the partition sizes are listed in terms of NAND block size */
+	{
+		.name           = "xloader",
+		.offset         = 0,
+		.size           = 4 * (SZ_128K),
+		.mask_flags     = MTD_WRITEABLE
+	},
+	{
+		.name           = "uboot",
+		.offset         = MTDPART_OFS_APPEND,
+		.size           = 14 * (SZ_128K),
+		.mask_flags     = MTD_WRITEABLE
+	},
+	{
+		.name           = "uboot-params",
+		.offset         = MTDPART_OFS_APPEND,
+		.size           = 2 * (SZ_128K)
+	},
+	{
+		.name           = "linux-kernel",
+		.offset         = MTDPART_OFS_APPEND,
+		.size           = 40 * (SZ_128K)
+	},
+	{
+		.name           = "rootfs",
+		.size           = MTDPART_SIZ_FULL,
+		.offset         = MTDPART_OFS_APPEND,
+	},
+};
+
+static struct omap_nand_platform_data am3517evm_nand_data = {
+	.parts          = am3517evm_nand_partitions,
+	.nr_parts       = ARRAY_SIZE(am3517evm_nand_partitions),
+	.nand_setup     = NULL,
+	.dma_channel    = -1,           /* disable DMA in OMAP NAND driver */
+	.devsize        = 1,
+	.dev_ready      = NULL,
+};
+
+void __init am3517evm_flash_init(void)
+{
+	u8 cs = 0;
+	u8 nandcs = GPMC_CS_NUM + 1;
+	u32 gpmc_base_add = OMAP34XX_GPMC_VIRT;
+
+	while (cs < GPMC_CS_NUM) {
+		u32 ret = 0;
+		ret = gpmc_cs_read_reg(cs, GPMC_CS_CONFIG1);
+
+		if ((ret & 0xC00) == 0x800) {
+			/* Found it!! */
+			if (nandcs > GPMC_CS_NUM)
+				nandcs = cs;
+		}
+		cs++;
+	}
+	if (nandcs > GPMC_CS_NUM) {
+		printk(KERN_INFO "NAND: Unable to find configuration "
+				" in GPMC\n ");
+		return;
+	}
+
+	if (nandcs < GPMC_CS_NUM) {
+		am3517evm_nand_data.cs   = nandcs;
+		am3517evm_nand_data.gpmc_cs_baseaddr = (void *)(gpmc_base_add +
+				GPMC_CS0_BASE + nandcs*GPMC_CS_SIZE);
+		am3517evm_nand_data.gpmc_baseaddr   = (void *) (gpmc_base_add);
+		gpmc_nand_init(&am3517evm_nand_data);
+	}
+}
+
+
 #define AM35XX_EVM_PHY_MASK          (0xF)
 #define AM35XX_EVM_MDIO_FREQUENCY    (1000000) /*PHY bus frequency */
 
@@ -539,6 +622,7 @@ static void __init am3517_evm_init(void)
 				ARRAY_SIZE(am3517_evm_devices));
 
 	omap_serial_init();
+	am3517evm_flash_init();
 
 	/* Configure GPIO for EHCI port */
 	omap_mux_init_gpio(57, OMAP_PIN_OUTPUT);
-- 
1.5.4.3


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

* [PATCH 07/11] AM3517: initialize i2c subsystem after mux subsystem
  2010-04-13  9:31 [PATCH 0/11] Some am3517 related patches Stanley.Miao
                   ` (5 preceding siblings ...)
  2010-04-13  9:31 ` [PATCH 06/11] AM3517: Add nand platform data for am3517evm Stanley.Miao
@ 2010-04-13  9:31 ` Stanley.Miao
  2010-04-13  9:31 ` [PATCH 08/11] OMAP: fix a gpmc nand problem Stanley.Miao
                   ` (3 subsequent siblings)
  10 siblings, 0 replies; 21+ messages in thread
From: Stanley.Miao @ 2010-04-13  9:31 UTC (permalink / raw)
  To: linux-omap; +Cc: tony

The initialize of i2c subsystem will set pinmux, so it should be done
after the initialize of mux subsystem initialization.

Signed-off-by: Stanley.Miao <stanley.miao@windriver.com>
---
 arch/arm/mach-omap2/board-am3517evm.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-omap2/board-am3517evm.c b/arch/arm/mach-omap2/board-am3517evm.c
index a76ff11..6a82ac3 100644
--- a/arch/arm/mach-omap2/board-am3517evm.c
+++ b/arch/arm/mach-omap2/board-am3517evm.c
@@ -615,9 +615,9 @@ static struct omap_board_mux board_mux[] __initdata = {
 
 static void __init am3517_evm_init(void)
 {
-	am3517_evm_i2c_init();
-
 	omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);
+
+	am3517_evm_i2c_init();
 	platform_add_devices(am3517_evm_devices,
 				ARRAY_SIZE(am3517_evm_devices));
 
-- 
1.5.4.3


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

* [PATCH 08/11] OMAP: fix a gpmc nand problem
  2010-04-13  9:31 [PATCH 0/11] Some am3517 related patches Stanley.Miao
                   ` (6 preceding siblings ...)
  2010-04-13  9:31 ` [PATCH 07/11] AM3517: initialize i2c subsystem after mux subsystem Stanley.Miao
@ 2010-04-13  9:31 ` Stanley.Miao
  2010-04-13  9:34 ` [PATCH 09/11] omap: init the gpio pinmux for mmc Stanley.Miao
                   ` (2 subsequent siblings)
  10 siblings, 0 replies; 21+ messages in thread
From: Stanley.Miao @ 2010-04-13  9:31 UTC (permalink / raw)
  To: linux-omap; +Cc: tony

If gpmc_t isn't given, we don't need to set timing for gpmc, or it will cause
a Oops.

Signed-off-by: Stanley.Miao <stanley.miao@windriver.com>
---
 arch/arm/mach-omap2/gpmc-nand.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/gpmc-nand.c b/arch/arm/mach-omap2/gpmc-nand.c
index 64d74f0..e57fb29 100644
--- a/arch/arm/mach-omap2/gpmc-nand.c
+++ b/arch/arm/mach-omap2/gpmc-nand.c
@@ -39,6 +39,9 @@ static int omap2_nand_gpmc_retime(void)
 	struct gpmc_timings t;
 	int err;
 
+	if (!gpmc_nand_data->gpmc_t)
+		return 0;
+
 	memset(&t, 0, sizeof(t));
 	t.sync_clk = gpmc_round_ns_to_ticks(gpmc_nand_data->gpmc_t->sync_clk);
 	t.cs_on = gpmc_round_ns_to_ticks(gpmc_nand_data->gpmc_t->cs_on);
-- 
1.5.4.3


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

* [PATCH 09/11] omap: init the gpio pinmux for mmc
  2010-04-13  9:31 [PATCH 0/11] Some am3517 related patches Stanley.Miao
                   ` (7 preceding siblings ...)
  2010-04-13  9:31 ` [PATCH 08/11] OMAP: fix a gpmc nand problem Stanley.Miao
@ 2010-04-13  9:34 ` Stanley.Miao
  2010-04-13  9:34 ` [PATCH 10/11] omap hsmmc: fix the hsmmc driver for am3517 Stanley.Miao
  2010-04-13  9:34 ` [PATCH 11/11] AM3517: Add mmc platform data for am3517evm Stanley.Miao
  10 siblings, 0 replies; 21+ messages in thread
From: Stanley.Miao @ 2010-04-13  9:34 UTC (permalink / raw)
  To: linux-omap; +Cc: tony, madhu.cr

There is two gpio for mmc use, one is for card detecting, another is
used for checking write protect. Intialize its pinmux in case the bootloader
doesn't set it.

Signed-off-by: Stanley.Miao <stanley.miao@windriver.com>
---
 arch/arm/mach-omap2/devices.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/devices.c b/arch/arm/mach-omap2/devices.c
index 23e4d77..df9c62a 100644
--- a/arch/arm/mach-omap2/devices.c
+++ b/arch/arm/mach-omap2/devices.c
@@ -591,6 +591,13 @@ static inline void omap_hsmmc_reset(void) {}
 static inline void omap2_mmc_mux(struct omap_mmc_platform_data *mmc_controller,
 			int controller_nr)
 {
+	if (mmc_controller->slots[0].switch_pin > 0)
+		omap_mux_init_gpio(mmc_controller->slots[0].switch_pin,
+					OMAP_PIN_INPUT_PULLUP);
+	if (mmc_controller->slots[0].gpio_wp > 0)
+		omap_mux_init_gpio(mmc_controller->slots[0].gpio_wp,
+					OMAP_PIN_INPUT_PULLUP);
+
 	if (cpu_is_omap2420() && controller_nr == 0) {
 		omap_cfg_reg(H18_24XX_MMC_CMD);
 		omap_cfg_reg(H15_24XX_MMC_CLKI);
-- 
1.5.4.3


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

* [PATCH 10/11] omap hsmmc: fix the hsmmc driver for am3517.
  2010-04-13  9:31 [PATCH 0/11] Some am3517 related patches Stanley.Miao
                   ` (8 preceding siblings ...)
  2010-04-13  9:34 ` [PATCH 09/11] omap: init the gpio pinmux for mmc Stanley.Miao
@ 2010-04-13  9:34 ` Stanley.Miao
  2010-04-13 13:03   ` Adrian Hunter
  2010-04-13  9:34 ` [PATCH 11/11] AM3517: Add mmc platform data for am3517evm Stanley.Miao
  10 siblings, 1 reply; 21+ messages in thread
From: Stanley.Miao @ 2010-04-13  9:34 UTC (permalink / raw)
  To: linux-omap; +Cc: tony, madhu.cr

am3517 don't have the register OMAP343X_CONTROL_PBIAS_LITE and the regulators
like "vmmc", so we don't need set "set_power" function for it.

Signed-off-by: Stanley.Miao <stanley.miao@windriver.com>
---
 arch/arm/mach-omap2/hsmmc.c   |    4 +++-
 drivers/mmc/host/omap_hsmmc.c |   28 +++++++++++++++++-----------
 2 files changed, 20 insertions(+), 12 deletions(-)

diff --git a/arch/arm/mach-omap2/hsmmc.c b/arch/arm/mach-omap2/hsmmc.c
index 9ad2295..a6e6c86 100644
--- a/arch/arm/mach-omap2/hsmmc.c
+++ b/arch/arm/mach-omap2/hsmmc.c
@@ -150,7 +150,7 @@ void __init omap2_hsmmc_init(struct omap2_hsmmc_info *controllers)
 	if (cpu_is_omap2430()) {
 		control_pbias_offset = OMAP243X_CONTROL_PBIAS_LITE;
 		control_devconf1_offset = OMAP243X_CONTROL_DEVCONF1;
-	} else {
+	} else if (!cpu_is_omap3517() && !cpu_is_omap3505()) {
 		control_pbias_offset = OMAP343X_CONTROL_PBIAS_LITE;
 		control_devconf1_offset = OMAP343X_CONTROL_DEVCONF1;
 	}
@@ -216,6 +216,7 @@ void __init omap2_hsmmc_init(struct omap2_hsmmc_info *controllers)
 		 */
 		mmc->slots[0].ocr_mask = c->ocr_mask;
 
+#ifndef CONFIG_MACH_OMAP3517EVM
 		switch (c->mmc) {
 		case 1:
 			/* on-chip level shifting via PBIAS0/PBIAS1 */
@@ -244,6 +245,7 @@ void __init omap2_hsmmc_init(struct omap2_hsmmc_info *controllers)
 			kfree(mmc);
 			continue;
 		}
+#endif
 		hsmmc_data[c->mmc - 1] = mmc;
 	}
 
diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
index 83f0aff..f3c64a2 100644
--- a/drivers/mmc/host/omap_hsmmc.c
+++ b/drivers/mmc/host/omap_hsmmc.c
@@ -236,7 +236,7 @@ static int omap_hsmmc_resume_cdirq(struct device *dev, int slot)
 
 #endif
 
-#ifdef CONFIG_REGULATOR
+#if defined(CONFIG_REGULATOR) && !defined(CONFIG_MACH_OMAP3517EVM)
 
 static int omap_hsmmc_1_set_power(struct device *dev, int slot, int power_on,
 				  int vdd)
@@ -1086,12 +1086,15 @@ static int omap_hsmmc_switch_opcond(struct omap_hsmmc_host *host, int vdd)
 		clk_disable(host->dbclk);
 
 	/* Turn the power off */
-	ret = mmc_slot(host).set_power(host->dev, host->slot_id, 0, 0);
+	if (mmc_slot(host).set_power) {
+		ret = mmc_slot(host).set_power(host->dev, host->slot_id, 0, 0);
+
+		/* Turn the power ON with given VDD 1.8 or 3.0v */
+		if (!ret)
+			ret = mmc_slot(host).set_power(host->dev,
+					host->slot_id, 1, vdd);
+	}
 
-	/* Turn the power ON with given VDD 1.8 or 3.0v */
-	if (!ret)
-		ret = mmc_slot(host).set_power(host->dev, host->slot_id, 1,
-					       vdd);
 	clk_enable(host->iclk);
 	clk_enable(host->fclk);
 	if (host->got_dbclk)
@@ -1478,13 +1481,15 @@ static void omap_hsmmc_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
 	if (ios->power_mode != host->power_mode) {
 		switch (ios->power_mode) {
 		case MMC_POWER_OFF:
-			mmc_slot(host).set_power(host->dev, host->slot_id,
-						 0, 0);
+			if (mmc_slot(host).set_power)
+				mmc_slot(host).set_power(host->dev,
+						host->slot_id, 0, 0);
 			host->vdd = 0;
 			break;
 		case MMC_POWER_UP:
-			mmc_slot(host).set_power(host->dev, host->slot_id,
-						 1, ios->vdd);
+			if (mmc_slot(host).set_power)
+				mmc_slot(host).set_power(host->dev,
+						host->slot_id, 1, ios->vdd);
 			host->vdd = ios->vdd;
 			break;
 		case MMC_POWER_ON:
@@ -1714,7 +1719,8 @@ static int omap_hsmmc_sleep_to_off(struct omap_hsmmc_host *host)
 		return 0;
 	}
 
-	mmc_slot(host).set_power(host->dev, host->slot_id, 0, 0);
+	if (mmc_slot(host).set_power)
+		mmc_slot(host).set_power(host->dev, host->slot_id, 0, 0);
 	host->vdd = 0;
 	host->power_mode = MMC_POWER_OFF;
 
-- 
1.5.4.3


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

* [PATCH 11/11] AM3517: Add mmc platform data for am3517evm
  2010-04-13  9:31 [PATCH 0/11] Some am3517 related patches Stanley.Miao
                   ` (9 preceding siblings ...)
  2010-04-13  9:34 ` [PATCH 10/11] omap hsmmc: fix the hsmmc driver for am3517 Stanley.Miao
@ 2010-04-13  9:34 ` Stanley.Miao
  2010-04-13 13:08   ` Adrian Hunter
  2010-04-13 16:18   ` Hiremath, Vaibhav
  10 siblings, 2 replies; 21+ messages in thread
From: Stanley.Miao @ 2010-04-13  9:34 UTC (permalink / raw)
  To: linux-omap; +Cc: tony, madhu.cr

Add mmc platform data. Besides, the mmc slot on UI board has a pin conflict
with LCD, so add macros to resolve it.

Signed-off-by: Stanley.Miao <stanley.miao@windriver.com>
---
 arch/arm/mach-omap2/Makefile          |    3 +-
 arch/arm/mach-omap2/board-am3517evm.c |   45 +++++++++++++++++++++++++++++++++
 2 files changed, 47 insertions(+), 1 deletions(-)

diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
index 4b9fc57..e94afdd 100644
--- a/arch/arm/mach-omap2/Makefile
+++ b/arch/arm/mach-omap2/Makefile
@@ -142,7 +142,8 @@ obj-$(CONFIG_MACH_OMAP3_TOUCHBOOK)	+= board-omap3touchbook.o \
 					   hsmmc.o
 obj-$(CONFIG_MACH_OMAP_4430SDP)		+= board-4430sdp.o
 
-obj-$(CONFIG_MACH_OMAP3517EVM)		+= board-am3517evm.o
+obj-$(CONFIG_MACH_OMAP3517EVM)		+= board-am3517evm.o \
+					   hsmmc.o
 
 # Platform specific device init code
 obj-y					+= usb-musb.o
diff --git a/arch/arm/mach-omap2/board-am3517evm.c b/arch/arm/mach-omap2/board-am3517evm.c
index 6a82ac3..8054994 100644
--- a/arch/arm/mach-omap2/board-am3517evm.c
+++ b/arch/arm/mach-omap2/board-am3517evm.c
@@ -26,6 +26,7 @@
 #include <linux/mtd/mtd.h>
 #include <linux/mtd/partitions.h>
 #include <linux/mtd/nand.h>
+#include <linux/mmc/host.h>
 
 #include <mach/hardware.h>
 #include <mach/am35xx.h>
@@ -40,7 +41,9 @@
 #include <plat/display.h>
 #include <plat/nand.h>
 #include <plat/gpmc.h>
+#include <plat/mmc.h>
 
+#include "hsmmc.h"
 #include "mux.h"
 
 #define LCD_PANEL_PWR		176
@@ -440,6 +443,8 @@ static int __init am3517_evm_i2c_init(void)
 static int lcd_enabled;
 static int dvi_enabled;
 
+#if defined(CONFIG_PANEL_SHARP_LQ043T1DG01) || \
+	                defined(CONFIG_PANEL_SHARP_LQ043T1DG01_MODULE)
 static void __init am3517_evm_display_init(void)
 {
 	int r;
@@ -501,6 +506,20 @@ static void am3517_evm_panel_disable_lcd(struct omap_dss_device *dssdev)
 	gpio_set_value(LCD_PANEL_PWR, 0);
 	lcd_enabled = 0;
 }
+#else
+static inline void __init am3517_evm_display_init(void)
+{
+}
+
+static inline int am3517_evm_panel_enable_lcd(struct omap_dss_device *dssdev)
+{
+	return 0;
+}
+
+static inline void am3517_evm_panel_disable_lcd(struct omap_dss_device *dssdev)
+{
+}
+#endif
 
 static struct omap_dss_device am3517_evm_lcd_device = {
 	.type			= OMAP_DISPLAY_TYPE_DPI,
@@ -613,6 +632,30 @@ static struct omap_board_mux board_mux[] __initdata = {
 #define board_mux	NULL
 #endif
 
+static struct omap2_hsmmc_info mmc[] = {
+	{
+		.mmc            = 1,
+		.wires          = 4,
+		.gpio_cd        = 127,
+		.gpio_wp        = 126,
+		.ocr_mask       = MMC_VDD_165_195 |
+				MMC_VDD_26_27 | MMC_VDD_27_28 |
+				MMC_VDD_29_30 |
+				MMC_VDD_30_31 | MMC_VDD_31_32,
+	},
+#if !defined(CONFIG_PANEL_SHARP_LQ043T1DG01) && \
+	                !defined(CONFIG_PANEL_SHARP_LQ043T1DG01_MODULE)
+	{
+		.mmc            = 2,
+		.wires          = 4,
+		.gpio_cd        = 175,
+		.gpio_wp        = 176,
+		.ocr_mask       = MMC_VDD_165_195,
+	},
+#endif
+	{}      /* Terminator */
+};
+
 static void __init am3517_evm_init(void)
 {
 	omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);
@@ -636,6 +679,8 @@ static void __init am3517_evm_init(void)
 
 	i2c_register_board_info(1, am3517evm_i2c1_boardinfo,
 				ARRAY_SIZE(am3517evm_i2c1_boardinfo));
+	/* MMC init function */
+	omap2_hsmmc_init(mmc);
 }
 
 static void __init am3517_evm_map_io(void)
-- 
1.5.4.3


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

* Re: [PATCH 10/11] omap hsmmc: fix the hsmmc driver for am3517.
  2010-04-13  9:34 ` [PATCH 10/11] omap hsmmc: fix the hsmmc driver for am3517 Stanley.Miao
@ 2010-04-13 13:03   ` Adrian Hunter
  2010-04-13 13:06     ` Adrian Hunter
  2010-04-14  3:34     ` stanley.miao
  0 siblings, 2 replies; 21+ messages in thread
From: Adrian Hunter @ 2010-04-13 13:03 UTC (permalink / raw)
  To: Stanley.Miao
  Cc: linux-omap@vger.kernel.org, tony@atomide.com, madhu.cr@ti.com

Stanley.Miao wrote:
> am3517 don't have the register OMAP343X_CONTROL_PBIAS_LITE and the regulators
> like "vmmc", so we don't need set "set_power" function for it.

It would be better to leave omap_hsmmc alone and either:
	- define fixed voltage regulators
	- or make a noop set_power function

How is the power supplied?

With regard to pbias the change should be:


diff --git a/arch/arm/mach-omap2/hsmmc.c b/arch/arm/mach-omap2/hsmmc.c
index 9ad2295..595b24a 100644
--- a/arch/arm/mach-omap2/hsmmc.c
+++ b/arch/arm/mach-omap2/hsmmc.c
@@ -150,7 +150,7 @@ void __init omap2_hsmmc_init(struct omap2_hsmmc_info *controllers)
 	if (cpu_is_omap2430()) {
 		control_pbias_offset = OMAP243X_CONTROL_PBIAS_LITE;
 		control_devconf1_offset = OMAP243X_CONTROL_DEVCONF1;
-	} else {
+	} else if (!cpu_is_omap3517() && !cpu_is_omap3505()) {
 		control_pbias_offset = OMAP343X_CONTROL_PBIAS_LITE;
 		control_devconf1_offset = OMAP343X_CONTROL_DEVCONF1;
 	}
@@ -216,12 +216,24 @@ void __init omap2_hsmmc_init(struct omap2_hsmmc_info *controllers)
 		 */
 		mmc->slots[0].ocr_mask = c->ocr_mask;
 
+		if (!cpu_is_omap3517() && !cpu_is_omap3505()) {
+			switch (c->mmc) {
+			case 1:
+				/* on-chip level shifting via PBIAS0/PBIAS1 */
+				mmc->slots[0].before_set_reg = hsmmc1_before_set_reg;
+				mmc->slots[0].after_set_reg = hsmmc1_after_set_reg;
+				break;
+			case 2:
+			case 3:
+				/* off-chip level shifting, or none */
+				mmc->slots[0].before_set_reg = hsmmc23_before_set_reg;
+				mmc->slots[0].after_set_reg = NULL;
+				break;
+			}
+		}
+
 		switch (c->mmc) {
 		case 1:
-			/* on-chip level shifting via PBIAS0/PBIAS1 */
-			mmc->slots[0].before_set_reg = hsmmc1_before_set_reg;
-			mmc->slots[0].after_set_reg = hsmmc1_after_set_reg;
-
 			/* Omap3630 HSMMC1 supports only 4-bit */
 			if (cpu_is_omap3630() && c->wires > 4) {
 				c->wires = 4;
@@ -235,9 +247,6 @@ void __init omap2_hsmmc_init(struct omap2_hsmmc_info *controllers)
 				c->wires = 4;
 			/* FALLTHROUGH */
 		case 3:
-			/* off-chip level shifting, or none */
-			mmc->slots[0].before_set_reg = hsmmc23_before_set_reg;
-			mmc->slots[0].after_set_reg = NULL;
 			break;
 		default:
 			pr_err("MMC%d configuration not supported!\n", c->mmc);



> 
> Signed-off-by: Stanley.Miao <stanley.miao@windriver.com>
> ---
>  arch/arm/mach-omap2/hsmmc.c   |    4 +++-
>  drivers/mmc/host/omap_hsmmc.c |   28 +++++++++++++++++-----------
>  2 files changed, 20 insertions(+), 12 deletions(-)
> 
> diff --git a/arch/arm/mach-omap2/hsmmc.c b/arch/arm/mach-omap2/hsmmc.c
> index 9ad2295..a6e6c86 100644
> --- a/arch/arm/mach-omap2/hsmmc.c
> +++ b/arch/arm/mach-omap2/hsmmc.c
> @@ -150,7 +150,7 @@ void __init omap2_hsmmc_init(struct omap2_hsmmc_info *controllers)
>  	if (cpu_is_omap2430()) {
>  		control_pbias_offset = OMAP243X_CONTROL_PBIAS_LITE;
>  		control_devconf1_offset = OMAP243X_CONTROL_DEVCONF1;
> -	} else {
> +	} else if (!cpu_is_omap3517() && !cpu_is_omap3505()) {
>  		control_pbias_offset = OMAP343X_CONTROL_PBIAS_LITE;
>  		control_devconf1_offset = OMAP343X_CONTROL_DEVCONF1;
>  	}
> @@ -216,6 +216,7 @@ void __init omap2_hsmmc_init(struct omap2_hsmmc_info *controllers)
>  		 */
>  		mmc->slots[0].ocr_mask = c->ocr_mask;
>  
> +#ifndef CONFIG_MACH_OMAP3517EVM

ifdef CONFIG_MACH_OMAP3517EVM




>  		switch (c->mmc) {
>  		case 1:
>  			/* on-chip level shifting via PBIAS0/PBIAS1 */
> @@ -244,6 +245,7 @@ void __init omap2_hsmmc_init(struct omap2_hsmmc_info *controllers)
>  			kfree(mmc);
>  			continue;
>  		}
> +#endif
>  		hsmmc_data[c->mmc - 1] = mmc;
>  	}
>  
> diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
> index 83f0aff..f3c64a2 100644
> --- a/drivers/mmc/host/omap_hsmmc.c
> +++ b/drivers/mmc/host/omap_hsmmc.c
> @@ -236,7 +236,7 @@ static int omap_hsmmc_resume_cdirq(struct device *dev, int slot)
>  
>  #endif
>  
> -#ifdef CONFIG_REGULATOR
> +#if defined(CONFIG_REGULATOR) && !defined(CONFIG_MACH_OMAP3517EVM)
>  
>  static int omap_hsmmc_1_set_power(struct device *dev, int slot, int power_on,
>  				  int vdd)
> @@ -1086,12 +1086,15 @@ static int omap_hsmmc_switch_opcond(struct omap_hsmmc_host *host, int vdd)
>  		clk_disable(host->dbclk);
>  
>  	/* Turn the power off */
> -	ret = mmc_slot(host).set_power(host->dev, host->slot_id, 0, 0);
> +	if (mmc_slot(host).set_power) {
> +		ret = mmc_slot(host).set_power(host->dev, host->slot_id, 0, 0);
> +
> +		/* Turn the power ON with given VDD 1.8 or 3.0v */
> +		if (!ret)
> +			ret = mmc_slot(host).set_power(host->dev,
> +					host->slot_id, 1, vdd);
> +	}
>  
> -	/* Turn the power ON with given VDD 1.8 or 3.0v */
> -	if (!ret)
> -		ret = mmc_slot(host).set_power(host->dev, host->slot_id, 1,
> -					       vdd);
>  	clk_enable(host->iclk);
>  	clk_enable(host->fclk);
>  	if (host->got_dbclk)
> @@ -1478,13 +1481,15 @@ static void omap_hsmmc_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
>  	if (ios->power_mode != host->power_mode) {
>  		switch (ios->power_mode) {
>  		case MMC_POWER_OFF:
> -			mmc_slot(host).set_power(host->dev, host->slot_id,
> -						 0, 0);
> +			if (mmc_slot(host).set_power)
> +				mmc_slot(host).set_power(host->dev,
> +						host->slot_id, 0, 0);
>  			host->vdd = 0;
>  			break;
>  		case MMC_POWER_UP:
> -			mmc_slot(host).set_power(host->dev, host->slot_id,
> -						 1, ios->vdd);
> +			if (mmc_slot(host).set_power)
> +				mmc_slot(host).set_power(host->dev,
> +						host->slot_id, 1, ios->vdd);
>  			host->vdd = ios->vdd;
>  			break;
>  		case MMC_POWER_ON:
> @@ -1714,7 +1719,8 @@ static int omap_hsmmc_sleep_to_off(struct omap_hsmmc_host *host)
>  		return 0;
>  	}
>  
> -	mmc_slot(host).set_power(host->dev, host->slot_id, 0, 0);
> +	if (mmc_slot(host).set_power)
> +		mmc_slot(host).set_power(host->dev, host->slot_id, 0, 0);
>  	host->vdd = 0;
>  	host->power_mode = MMC_POWER_OFF;
>  


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

* Re: [PATCH 10/11] omap hsmmc: fix the hsmmc driver for am3517.
  2010-04-13 13:03   ` Adrian Hunter
@ 2010-04-13 13:06     ` Adrian Hunter
  2010-04-14  3:34     ` stanley.miao
  1 sibling, 0 replies; 21+ messages in thread
From: Adrian Hunter @ 2010-04-13 13:06 UTC (permalink / raw)
  To: Stanley.Miao
  Cc: linux-omap@vger.kernel.org, tony@atomide.com, madhu.cr@ti.com

Adrian Hunter wrote:
> Stanley.Miao wrote:
>> am3517 don't have the register OMAP343X_CONTROL_PBIAS_LITE and the regulators
>> like "vmmc", so we don't need set "set_power" function for it.

<snip>

>> @@ -216,6 +216,7 @@ void __init omap2_hsmmc_init(struct omap2_hsmmc_info *controllers)
>>  		 */
>>  		mmc->slots[0].ocr_mask = c->ocr_mask;
>>  
>> +#ifndef CONFIG_MACH_OMAP3517EVM
> 
> ifdef CONFIG_MACH_OMAP3517EVM
> 
> 
> 
> 

That "ifdef CONFIG_MACH_OMAP3517EVM" was an accident, sorry.  Please ignore.



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

* Re: [PATCH 11/11] AM3517: Add mmc platform data for am3517evm
  2010-04-13  9:34 ` [PATCH 11/11] AM3517: Add mmc platform data for am3517evm Stanley.Miao
@ 2010-04-13 13:08   ` Adrian Hunter
  2010-04-14  7:14     ` stanley.miao
  2010-04-13 16:18   ` Hiremath, Vaibhav
  1 sibling, 1 reply; 21+ messages in thread
From: Adrian Hunter @ 2010-04-13 13:08 UTC (permalink / raw)
  To: Stanley.Miao
  Cc: linux-omap@vger.kernel.org, tony@atomide.com, madhu.cr@ti.com

Stanley.Miao wrote:
> Add mmc platform data. Besides, the mmc slot on UI board has a pin conflict
> with LCD, so add macros to resolve it.
> 
> Signed-off-by: Stanley.Miao <stanley.miao@windriver.com>
> ---
>  arch/arm/mach-omap2/Makefile          |    3 +-
>  arch/arm/mach-omap2/board-am3517evm.c |   45 +++++++++++++++++++++++++++++++++
>  2 files changed, 47 insertions(+), 1 deletions(-)
> 
> diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
> index 4b9fc57..e94afdd 100644
> --- a/arch/arm/mach-omap2/Makefile
> +++ b/arch/arm/mach-omap2/Makefile
> @@ -142,7 +142,8 @@ obj-$(CONFIG_MACH_OMAP3_TOUCHBOOK)	+= board-omap3touchbook.o \
>  					   hsmmc.o
>  obj-$(CONFIG_MACH_OMAP_4430SDP)		+= board-4430sdp.o
>  
> -obj-$(CONFIG_MACH_OMAP3517EVM)		+= board-am3517evm.o
> +obj-$(CONFIG_MACH_OMAP3517EVM)		+= board-am3517evm.o \
> +					   hsmmc.o
>  
>  # Platform specific device init code
>  obj-y					+= usb-musb.o
> diff --git a/arch/arm/mach-omap2/board-am3517evm.c b/arch/arm/mach-omap2/board-am3517evm.c
> index 6a82ac3..8054994 100644
> --- a/arch/arm/mach-omap2/board-am3517evm.c
> +++ b/arch/arm/mach-omap2/board-am3517evm.c
> @@ -26,6 +26,7 @@
>  #include <linux/mtd/mtd.h>
>  #include <linux/mtd/partitions.h>
>  #include <linux/mtd/nand.h>
> +#include <linux/mmc/host.h>
>  
>  #include <mach/hardware.h>
>  #include <mach/am35xx.h>
> @@ -40,7 +41,9 @@
>  #include <plat/display.h>
>  #include <plat/nand.h>
>  #include <plat/gpmc.h>
> +#include <plat/mmc.h>
>  
> +#include "hsmmc.h"
>  #include "mux.h"
>  
>  #define LCD_PANEL_PWR		176
> @@ -440,6 +443,8 @@ static int __init am3517_evm_i2c_init(void)
>  static int lcd_enabled;
>  static int dvi_enabled;
>  
> +#if defined(CONFIG_PANEL_SHARP_LQ043T1DG01) || \
> +	                defined(CONFIG_PANEL_SHARP_LQ043T1DG01_MODULE)
>  static void __init am3517_evm_display_init(void)
>  {
>  	int r;
> @@ -501,6 +506,20 @@ static void am3517_evm_panel_disable_lcd(struct omap_dss_device *dssdev)
>  	gpio_set_value(LCD_PANEL_PWR, 0);
>  	lcd_enabled = 0;
>  }
> +#else
> +static inline void __init am3517_evm_display_init(void)
> +{
> +}
> +
> +static inline int am3517_evm_panel_enable_lcd(struct omap_dss_device *dssdev)
> +{
> +	return 0;
> +}
> +
> +static inline void am3517_evm_panel_disable_lcd(struct omap_dss_device *dssdev)
> +{
> +}
> +#endif
>  
>  static struct omap_dss_device am3517_evm_lcd_device = {
>  	.type			= OMAP_DISPLAY_TYPE_DPI,
> @@ -613,6 +632,30 @@ static struct omap_board_mux board_mux[] __initdata = {
>  #define board_mux	NULL
>  #endif
>  
> +static struct omap2_hsmmc_info mmc[] = {
> +	{
> +		.mmc            = 1,
> +		.wires          = 4,
> +		.gpio_cd        = 127,
> +		.gpio_wp        = 126,
> +		.ocr_mask       = MMC_VDD_165_195 |
> +				MMC_VDD_26_27 | MMC_VDD_27_28 |
> +				MMC_VDD_29_30 |
> +				MMC_VDD_30_31 | MMC_VDD_31_32,

How can you support 1.8V and 3V cards without controlling power
to the card?

> +	},
> +#if !defined(CONFIG_PANEL_SHARP_LQ043T1DG01) && \
> +	                !defined(CONFIG_PANEL_SHARP_LQ043T1DG01_MODULE)
> +	{
> +		.mmc            = 2,
> +		.wires          = 4,
> +		.gpio_cd        = 175,
> +		.gpio_wp        = 176,
> +		.ocr_mask       = MMC_VDD_165_195,
> +	},
> +#endif
> +	{}      /* Terminator */
> +};
> +
>  static void __init am3517_evm_init(void)
>  {
>  	omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);
> @@ -636,6 +679,8 @@ static void __init am3517_evm_init(void)
>  
>  	i2c_register_board_info(1, am3517evm_i2c1_boardinfo,
>  				ARRAY_SIZE(am3517evm_i2c1_boardinfo));
> +	/* MMC init function */
> +	omap2_hsmmc_init(mmc);
>  }
>  
>  static void __init am3517_evm_map_io(void)


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

* RE: [PATCH 11/11] AM3517: Add mmc platform data for am3517evm
  2010-04-13  9:34 ` [PATCH 11/11] AM3517: Add mmc platform data for am3517evm Stanley.Miao
  2010-04-13 13:08   ` Adrian Hunter
@ 2010-04-13 16:18   ` Hiremath, Vaibhav
  2010-04-14  2:36     ` stanley.miao
  1 sibling, 1 reply; 21+ messages in thread
From: Hiremath, Vaibhav @ 2010-04-13 16:18 UTC (permalink / raw)
  To: Stanley.Miao, linux-omap@vger.kernel.org
  Cc: tony@atomide.com, Chikkature Rajashekar, Madhusudhan

> -----Original Message-----
> From: linux-omap-owner@vger.kernel.org [mailto:linux-omap-
> owner@vger.kernel.org] On Behalf Of Stanley.Miao
> Sent: Tuesday, April 13, 2010 3:05 PM
> To: linux-omap@vger.kernel.org
> Cc: tony@atomide.com; Chikkature Rajashekar, Madhusudhan
> Subject: [PATCH 11/11] AM3517: Add mmc platform data for am3517evm
> 
> Add mmc platform data. Besides, the mmc slot on UI board has a pin conflict
> with LCD, so add macros to resolve it.
> 
[Hiremath, Vaibhav] I am not sure whether your statement is right here. As far I know he conflicts is between UI card USB and Base-board LCD panel.

There is no conflict between MMC2 (which is on UI card) with LCD interface. I may be wrong here, can you please point me to the docs/schematics where you got this info.

Thanks,
Vaibhav

> Signed-off-by: Stanley.Miao <stanley.miao@windriver.com>
> ---
>  arch/arm/mach-omap2/Makefile          |    3 +-
>  arch/arm/mach-omap2/board-am3517evm.c |   45
> +++++++++++++++++++++++++++++++++
>  2 files changed, 47 insertions(+), 1 deletions(-)
> 
> diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
> index 4b9fc57..e94afdd 100644
> --- a/arch/arm/mach-omap2/Makefile
> +++ b/arch/arm/mach-omap2/Makefile
> @@ -142,7 +142,8 @@ obj-$(CONFIG_MACH_OMAP3_TOUCHBOOK)	+= board-
> omap3touchbook.o \
>  					   hsmmc.o
>  obj-$(CONFIG_MACH_OMAP_4430SDP)		+= board-4430sdp.o
> 
> -obj-$(CONFIG_MACH_OMAP3517EVM)		+= board-am3517evm.o
> +obj-$(CONFIG_MACH_OMAP3517EVM)		+= board-am3517evm.o \
> +					   hsmmc.o
> 
>  # Platform specific device init code
>  obj-y					+= usb-musb.o
> diff --git a/arch/arm/mach-omap2/board-am3517evm.c b/arch/arm/mach-
> omap2/board-am3517evm.c
> index 6a82ac3..8054994 100644
> --- a/arch/arm/mach-omap2/board-am3517evm.c
> +++ b/arch/arm/mach-omap2/board-am3517evm.c
> @@ -26,6 +26,7 @@
>  #include <linux/mtd/mtd.h>
>  #include <linux/mtd/partitions.h>
>  #include <linux/mtd/nand.h>
> +#include <linux/mmc/host.h>
> 
>  #include <mach/hardware.h>
>  #include <mach/am35xx.h>
> @@ -40,7 +41,9 @@
>  #include <plat/display.h>
>  #include <plat/nand.h>
>  #include <plat/gpmc.h>
> +#include <plat/mmc.h>
> 
> +#include "hsmmc.h"
>  #include "mux.h"
> 
>  #define LCD_PANEL_PWR		176
> @@ -440,6 +443,8 @@ static int __init am3517_evm_i2c_init(void)
>  static int lcd_enabled;
>  static int dvi_enabled;
> 
> +#if defined(CONFIG_PANEL_SHARP_LQ043T1DG01) || \
> +	                defined(CONFIG_PANEL_SHARP_LQ043T1DG01_MODULE)
>  static void __init am3517_evm_display_init(void)
>  {
>  	int r;
> @@ -501,6 +506,20 @@ static void am3517_evm_panel_disable_lcd(struct
> omap_dss_device *dssdev)
>  	gpio_set_value(LCD_PANEL_PWR, 0);
>  	lcd_enabled = 0;
>  }
> +#else
> +static inline void __init am3517_evm_display_init(void)
> +{
> +}
> +
> +static inline int am3517_evm_panel_enable_lcd(struct omap_dss_device
> *dssdev)
> +{
> +	return 0;
> +}
> +
> +static inline void am3517_evm_panel_disable_lcd(struct omap_dss_device
> *dssdev)
> +{
> +}
> +#endif
> 
>  static struct omap_dss_device am3517_evm_lcd_device = {
>  	.type			= OMAP_DISPLAY_TYPE_DPI,
> @@ -613,6 +632,30 @@ static struct omap_board_mux board_mux[] __initdata = {
>  #define board_mux	NULL
>  #endif
> 
> +static struct omap2_hsmmc_info mmc[] = {
> +	{
> +		.mmc            = 1,
> +		.wires          = 4,
> +		.gpio_cd        = 127,
> +		.gpio_wp        = 126,
> +		.ocr_mask       = MMC_VDD_165_195 |
> +				MMC_VDD_26_27 | MMC_VDD_27_28 |
> +				MMC_VDD_29_30 |
> +				MMC_VDD_30_31 | MMC_VDD_31_32,
> +	},
> +#if !defined(CONFIG_PANEL_SHARP_LQ043T1DG01) && \
> +	                !defined(CONFIG_PANEL_SHARP_LQ043T1DG01_MODULE)
> +	{
> +		.mmc            = 2,
> +		.wires          = 4,
> +		.gpio_cd        = 175,
> +		.gpio_wp        = 176,
> +		.ocr_mask       = MMC_VDD_165_195,
> +	},
> +#endif
> +	{}      /* Terminator */
> +};
> +
>  static void __init am3517_evm_init(void)
>  {
>  	omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);
> @@ -636,6 +679,8 @@ static void __init am3517_evm_init(void)
> 
>  	i2c_register_board_info(1, am3517evm_i2c1_boardinfo,
>  				ARRAY_SIZE(am3517evm_i2c1_boardinfo));
> +	/* MMC init function */
> +	omap2_hsmmc_init(mmc);
>  }
> 
>  static void __init am3517_evm_map_io(void)
> --
> 1.5.4.3
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-omap" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* RE: [PATCH 03/11] AM3517: rename the i2c boardinfo to make it more readable
  2010-04-13  9:31 ` [PATCH 03/11] AM3517: rename the i2c boardinfo to make it more readable Stanley.Miao
@ 2010-04-13 16:29   ` Hiremath, Vaibhav
  2010-04-14  2:44     ` stanley.miao
  0 siblings, 1 reply; 21+ messages in thread
From: Hiremath, Vaibhav @ 2010-04-13 16:29 UTC (permalink / raw)
  To: Stanley.Miao, linux-omap@vger.kernel.org; +Cc: tony@atomide.com


> -----Original Message-----
> From: linux-omap-owner@vger.kernel.org [mailto:linux-omap-
> owner@vger.kernel.org] On Behalf Of Stanley.Miao
> Sent: Tuesday, April 13, 2010 3:02 PM
> To: linux-omap@vger.kernel.org
> Cc: tony@atomide.com
> Subject: [PATCH 03/11] AM3517: rename the i2c boardinfo to make it more
> readable
> 
> There are three i3c buses on am3517, 
[Hiremath, Vaibhav] Please correct the typo here.

> now rename these three boardinfo
> structure name to am3517evm_i2c1_boardinfo, am3517evm_i2c2_boardinfo,
> and am3517evm_i2c3_boardinfo, to make it more readable.
> 
> Signed-off-by: Stanley.Miao <stanley.miao@windriver.com>
> ---
>  arch/arm/mach-omap2/board-am3517evm.c |   20 ++++++++++----------
>  1 files changed, 10 insertions(+), 10 deletions(-)
> 
> diff --git a/arch/arm/mach-omap2/board-am3517evm.c b/arch/arm/mach-
> omap2/board-am3517evm.c
> index db542b2..5abf333 100644
> --- a/arch/arm/mach-omap2/board-am3517evm.c
> +++ b/arch/arm/mach-omap2/board-am3517evm.c
> @@ -152,7 +152,7 @@ void am3517_evm_ethernet_init(struct emac_platform_data
> *pdata)
>  	return ;
>   }
> 
> -static struct i2c_board_info __initdata am3517evm_i2c_boardinfo[] = {
> +static struct i2c_board_info __initdata am3517evm_i2c1_boardinfo[] = {
>  	{
>  		I2C_BOARD_INFO("s35390a", 0x30),
>  		.type		= "s35390a",
> @@ -182,7 +182,7 @@ static void __init am3517_evm_rtc_init(void)
>  		gpio_free(GPIO_RTCS35390A_IRQ);
>  		return;
>  	}
> -	am3517evm_i2c_boardinfo[0].irq = gpio_to_irq(GPIO_RTCS35390A_IRQ);
> +	am3517evm_i2c1_boardinfo[0].irq = gpio_to_irq(GPIO_RTCS35390A_IRQ);
>  }
> 
>  /*
> @@ -193,7 +193,7 @@ static void __init am3517_evm_rtc_init(void)
>  static struct pca953x_platform_data am3517evm_gpio_expander_info_0 = {
>  	.gpio_base	= OMAP_MAX_GPIO_LINES,
>  };
> -static struct i2c_board_info __initdata am3517evm_tca6416_info_0[] = {
> +static struct i2c_board_info __initdata am3517evm_i2c2_boardinfo[] = {
>  	{
>  		I2C_BOARD_INFO("tca6416", 0x21),
>  		.platform_data = &am3517evm_gpio_expander_info_0,
> @@ -207,7 +207,7 @@ static struct pca953x_platform_data
> am3517evm_ui_gpio_expander_info_1 = {
>  static struct pca953x_platform_data am3517evm_ui_gpio_expander_info_2 = {
>  	.gpio_base	= OMAP_MAX_GPIO_LINES + 32,
>  };
> -static struct i2c_board_info __initdata am3517evm_ui_tca6416_info[] = {
> +static struct i2c_board_info __initdata am3517evm_i2c3_boardinfo[] = {
>  	{
>  		I2C_BOARD_INFO("tca6416", 0x20),
>  		.platform_data = &am3517evm_ui_gpio_expander_info_1,
> @@ -221,10 +221,10 @@ static struct i2c_board_info __initdata
> am3517evm_ui_tca6416_info[] = {
>  static int __init am3517_evm_i2c_init(void)
>  {
>  	omap_register_i2c_bus(1, 400, NULL, 0);
> -	omap_register_i2c_bus(2, 400, am3517evm_tca6416_info_0,
> -			ARRAY_SIZE(am3517evm_tca6416_info_0));
> -	omap_register_i2c_bus(3, 400, am3517evm_ui_tca6416_info,
> -			ARRAY_SIZE(am3517evm_ui_tca6416_info));
> +	omap_register_i2c_bus(2, 400, am3517evm_i2c2_boardinfo,
> +			ARRAY_SIZE(am3517evm_i2c2_boardinfo));
> +	omap_register_i2c_bus(3, 400, am3517evm_i2c3_boardinfo,
> +			ARRAY_SIZE(am3517evm_i2c3_boardinfo));
> 
>  	return 0;
>  }
> @@ -425,8 +425,8 @@ static void __init am3517_evm_init(void)
>  	/* RTC - S35390A */
>  	am3517_evm_rtc_init();
> 
> -	i2c_register_board_info(1, am3517evm_i2c_boardinfo,
> -				ARRAY_SIZE(am3517evm_i2c_boardinfo));
> +	i2c_register_board_info(1, am3517evm_i2c1_boardinfo,
> +				ARRAY_SIZE(am3517evm_i2c1_boardinfo));
>  }
[Hiremath, Vaibhav] personally I like the idea of specifying explicitly the I2C instance here which you did, I have seen other board files using slave device name while defining the I2C board info. I am not sure about whether we have any standard thing to follow here. 

Let's take opinion from other folks here; if they are ok with this approach then I think we can merge this patch.

Thanks,
Vaibhav

> 
>  static void __init am3517_evm_map_io(void)
> --
> 1.5.4.3
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-omap" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH 11/11] AM3517: Add mmc platform data for am3517evm
  2010-04-13 16:18   ` Hiremath, Vaibhav
@ 2010-04-14  2:36     ` stanley.miao
  0 siblings, 0 replies; 21+ messages in thread
From: stanley.miao @ 2010-04-14  2:36 UTC (permalink / raw)
  To: Hiremath, Vaibhav
  Cc: linux-omap@vger.kernel.org, tony@atomide.com,
	Chikkature Rajashekar, Madhusudhan

Hiremath, Vaibhav wrote:
>> -----Original Message-----
>> From: linux-omap-owner@vger.kernel.org [mailto:linux-omap-
>> owner@vger.kernel.org] On Behalf Of Stanley.Miao
>> Sent: Tuesday, April 13, 2010 3:05 PM
>> To: linux-omap@vger.kernel.org
>> Cc: tony@atomide.com; Chikkature Rajashekar, Madhusudhan
>> Subject: [PATCH 11/11] AM3517: Add mmc platform data for am3517evm
>>
>> Add mmc platform data. Besides, the mmc slot on UI board has a pin conflict
>> with LCD, so add macros to resolve it.
>>
>>     
> [Hiremath, Vaibhav] I am not sure whether your statement is right here. As far I know he conflicts is between UI card USB and Base-board LCD panel.
>
> There is no conflict between MMC2 (which is on UI card) with LCD interface. I may be wrong here, can you please point me to the docs/schematics where you got this info.
>   

Both MMC2_WP and LCD_PANEL_PWR_MFP connected to the pin uP_SPI1_SCSn2.
You can found it in schematics.

Stanley.



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

* Re: [PATCH 03/11] AM3517: rename the i2c boardinfo to make it more readable
  2010-04-13 16:29   ` Hiremath, Vaibhav
@ 2010-04-14  2:44     ` stanley.miao
  0 siblings, 0 replies; 21+ messages in thread
From: stanley.miao @ 2010-04-14  2:44 UTC (permalink / raw)
  To: Hiremath, Vaibhav; +Cc: linux-omap@vger.kernel.org, tony@atomide.com

Hiremath, Vaibhav wrote:
>> -----Original Message-----
>> From: linux-omap-owner@vger.kernel.org [mailto:linux-omap-
>> owner@vger.kernel.org] On Behalf Of Stanley.Miao
>> Sent: Tuesday, April 13, 2010 3:02 PM
>> To: linux-omap@vger.kernel.org
>> Cc: tony@atomide.com
>> Subject: [PATCH 03/11] AM3517: rename the i2c boardinfo to make it more
>> readable
>>
>> There are three i3c buses on am3517, 
>>     
> [Hiremath, Vaibhav] Please correct the typo here.
>   

I will correct it in V2.
Thanks.

>   
>> now rename these three boardinfo
>> structure name to am3517evm_i2c1_boardinfo, am3517evm_i2c2_boardinfo,
>> and am3517evm_i2c3_boardinfo, to make it more readable.
>>
>> <snip>
>>  }
>> @@ -425,8 +425,8 @@ static void __init am3517_evm_init(void)
>>  	/* RTC - S35390A */
>>  	am3517_evm_rtc_init();
>>
>> -	i2c_register_board_info(1, am3517evm_i2c_boardinfo,
>> -				ARRAY_SIZE(am3517evm_i2c_boardinfo));
>> +	i2c_register_board_info(1, am3517evm_i2c1_boardinfo,
>> +				ARRAY_SIZE(am3517evm_i2c1_boardinfo));
>>  }
>>     
> [Hiremath, Vaibhav] personally I like the idea of specifying explicitly the I2C instance here which you did, I have seen other board files using slave device name while defining the I2C board info. I am not sure about whether we have any standard thing to follow here. 
>
> Let's take opinion from other folks here; if they are ok with this approach then I think we can merge this patch.
>   

There are many slave devices on each i2c bus.
I2C1: S35390, TPS65023, TSC2004, four INA219.
I2C2: TCA6416PW, two TLV320AIC23
I2C3: two TCA6416PW, TLV320AIC23, TVP5146.

So we can't name the i2c board files with the slave device names

Stanley.

> Thanks,
> Vaibhav
>
>   
>>  static void __init am3517_evm_map_io(void)
>> --
>> 1.5.4.3
>>
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-omap" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>>     
>
>   


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

* Re: [PATCH 10/11] omap hsmmc: fix the hsmmc driver for am3517.
  2010-04-13 13:03   ` Adrian Hunter
  2010-04-13 13:06     ` Adrian Hunter
@ 2010-04-14  3:34     ` stanley.miao
  1 sibling, 0 replies; 21+ messages in thread
From: stanley.miao @ 2010-04-14  3:34 UTC (permalink / raw)
  To: Adrian Hunter
  Cc: linux-omap@vger.kernel.org, tony@atomide.com, madhu.cr@ti.com

Adrian Hunter wrote:
> Stanley.Miao wrote:
>> am3517 don't have the register OMAP343X_CONTROL_PBIAS_LITE and the 
>> regulators
>> like "vmmc", so we don't need set "set_power" function for it.
>
> It would be better to leave omap_hsmmc alone and either:
>     - define fixed voltage regulators
>     - or make a noop set_power function

There are no voltage regulator for mmc, I will make a noop set_power 
function.
>
> How is the power supplied?

I didn't found it in TRM.  The pin vmmc was removed, no pin was added.

>
> With regard to pbias the change should be:

I will accept the below change.

Thanks for the review.

Stanley.

>
>
> diff --git a/arch/arm/mach-omap2/hsmmc.c b/arch/arm/mach-omap2/hsmmc.c
> index 9ad2295..595b24a 100644
> --- a/arch/arm/mach-omap2/hsmmc.c
> +++ b/arch/arm/mach-omap2/hsmmc.c
> @@ -150,7 +150,7 @@ void __init omap2_hsmmc_init(struct 
> omap2_hsmmc_info *controllers)
>     if (cpu_is_omap2430()) {
>         control_pbias_offset = OMAP243X_CONTROL_PBIAS_LITE;
>         control_devconf1_offset = OMAP243X_CONTROL_DEVCONF1;
> -    } else {
> +    } else if (!cpu_is_omap3517() && !cpu_is_omap3505()) {
>         control_pbias_offset = OMAP343X_CONTROL_PBIAS_LITE;
>         control_devconf1_offset = OMAP343X_CONTROL_DEVCONF1;
>     }
> @@ -216,12 +216,24 @@ void __init omap2_hsmmc_init(struct 
> omap2_hsmmc_info *controllers)
>          */
>         mmc->slots[0].ocr_mask = c->ocr_mask;
>
> +        if (!cpu_is_omap3517() && !cpu_is_omap3505()) {
> +            switch (c->mmc) {
> +            case 1:
> +                /* on-chip level shifting via PBIAS0/PBIAS1 */
> +                mmc->slots[0].before_set_reg = hsmmc1_before_set_reg;
> +                mmc->slots[0].after_set_reg = hsmmc1_after_set_reg;
> +                break;
> +            case 2:
> +            case 3:
> +                /* off-chip level shifting, or none */
> +                mmc->slots[0].before_set_reg = hsmmc23_before_set_reg;
> +                mmc->slots[0].after_set_reg = NULL;
> +                break;
> +            }
> +        }
> +
>         switch (c->mmc) {
>         case 1:
> -            /* on-chip level shifting via PBIAS0/PBIAS1 */
> -            mmc->slots[0].before_set_reg = hsmmc1_before_set_reg;
> -            mmc->slots[0].after_set_reg = hsmmc1_after_set_reg;
> -
>             /* Omap3630 HSMMC1 supports only 4-bit */
>             if (cpu_is_omap3630() && c->wires > 4) {
>                 c->wires = 4;
> @@ -235,9 +247,6 @@ void __init omap2_hsmmc_init(struct 
> omap2_hsmmc_info *controllers)
>                 c->wires = 4;
>             /* FALLTHROUGH */
>         case 3:
> -            /* off-chip level shifting, or none */
> -            mmc->slots[0].before_set_reg = hsmmc23_before_set_reg;
> -            mmc->slots[0].after_set_reg = NULL;
>             break;
>         default:
>             pr_err("MMC%d configuration not supported!\n", c->mmc);
>
>
>
>>
>> Signed-off-by: Stanley.Miao <stanley.miao@windriver.com>
>> ---
>>  arch/arm/mach-omap2/hsmmc.c   |    4 +++-
>>  drivers/mmc/host/omap_hsmmc.c |   28 +++++++++++++++++-----------
>>  2 files changed, 20 insertions(+), 12 deletions(-)
>>
>> diff --git a/arch/arm/mach-omap2/hsmmc.c b/arch/arm/mach-omap2/hsmmc.c
>> index 9ad2295..a6e6c86 100644
>> --- a/arch/arm/mach-omap2/hsmmc.c
>> +++ b/arch/arm/mach-omap2/hsmmc.c
>> @@ -150,7 +150,7 @@ void __init omap2_hsmmc_init(struct 
>> omap2_hsmmc_info *controllers)
>>      if (cpu_is_omap2430()) {
>>          control_pbias_offset = OMAP243X_CONTROL_PBIAS_LITE;
>>          control_devconf1_offset = OMAP243X_CONTROL_DEVCONF1;
>> -    } else {
>> +    } else if (!cpu_is_omap3517() && !cpu_is_omap3505()) {
>>          control_pbias_offset = OMAP343X_CONTROL_PBIAS_LITE;
>>          control_devconf1_offset = OMAP343X_CONTROL_DEVCONF1;
>>      }
>> @@ -216,6 +216,7 @@ void __init omap2_hsmmc_init(struct 
>> omap2_hsmmc_info *controllers)
>>           */
>>          mmc->slots[0].ocr_mask = c->ocr_mask;
>>  
>> +#ifndef CONFIG_MACH_OMAP3517EVM
>
> ifdef CONFIG_MACH_OMAP3517EVM
>
>
>
>
>>          switch (c->mmc) {
>>          case 1:
>>              /* on-chip level shifting via PBIAS0/PBIAS1 */
>> @@ -244,6 +245,7 @@ void __init omap2_hsmmc_init(struct 
>> omap2_hsmmc_info *controllers)
>>              kfree(mmc);
>>              continue;
>>          }
>> +#endif
>>          hsmmc_data[c->mmc - 1] = mmc;
>>      }
>>  
>> diff --git a/drivers/mmc/host/omap_hsmmc.c 
>> b/drivers/mmc/host/omap_hsmmc.c
>> index 83f0aff..f3c64a2 100644
>> --- a/drivers/mmc/host/omap_hsmmc.c
>> +++ b/drivers/mmc/host/omap_hsmmc.c
>> @@ -236,7 +236,7 @@ static int omap_hsmmc_resume_cdirq(struct device 
>> *dev, int slot)
>>  
>>  #endif
>>  
>> -#ifdef CONFIG_REGULATOR
>> +#if defined(CONFIG_REGULATOR) && !defined(CONFIG_MACH_OMAP3517EVM)
>>  
>>  static int omap_hsmmc_1_set_power(struct device *dev, int slot, int 
>> power_on,
>>                    int vdd)
>> @@ -1086,12 +1086,15 @@ static int omap_hsmmc_switch_opcond(struct 
>> omap_hsmmc_host *host, int vdd)
>>          clk_disable(host->dbclk);
>>  
>>      /* Turn the power off */
>> -    ret = mmc_slot(host).set_power(host->dev, host->slot_id, 0, 0);
>> +    if (mmc_slot(host).set_power) {
>> +        ret = mmc_slot(host).set_power(host->dev, host->slot_id, 0, 0);
>> +
>> +        /* Turn the power ON with given VDD 1.8 or 3.0v */
>> +        if (!ret)
>> +            ret = mmc_slot(host).set_power(host->dev,
>> +                    host->slot_id, 1, vdd);
>> +    }
>>  
>> -    /* Turn the power ON with given VDD 1.8 or 3.0v */
>> -    if (!ret)
>> -        ret = mmc_slot(host).set_power(host->dev, host->slot_id, 1,
>> -                           vdd);
>>      clk_enable(host->iclk);
>>      clk_enable(host->fclk);
>>      if (host->got_dbclk)
>> @@ -1478,13 +1481,15 @@ static void omap_hsmmc_set_ios(struct 
>> mmc_host *mmc, struct mmc_ios *ios)
>>      if (ios->power_mode != host->power_mode) {
>>          switch (ios->power_mode) {
>>          case MMC_POWER_OFF:
>> -            mmc_slot(host).set_power(host->dev, host->slot_id,
>> -                         0, 0);
>> +            if (mmc_slot(host).set_power)
>> +                mmc_slot(host).set_power(host->dev,
>> +                        host->slot_id, 0, 0);
>>              host->vdd = 0;
>>              break;
>>          case MMC_POWER_UP:
>> -            mmc_slot(host).set_power(host->dev, host->slot_id,
>> -                         1, ios->vdd);
>> +            if (mmc_slot(host).set_power)
>> +                mmc_slot(host).set_power(host->dev,
>> +                        host->slot_id, 1, ios->vdd);
>>              host->vdd = ios->vdd;
>>              break;
>>          case MMC_POWER_ON:
>> @@ -1714,7 +1719,8 @@ static int omap_hsmmc_sleep_to_off(struct 
>> omap_hsmmc_host *host)
>>          return 0;
>>      }
>>  
>> -    mmc_slot(host).set_power(host->dev, host->slot_id, 0, 0);
>> +    if (mmc_slot(host).set_power)
>> +        mmc_slot(host).set_power(host->dev, host->slot_id, 0, 0);
>>      host->vdd = 0;
>>      host->power_mode = MMC_POWER_OFF;
>>  
>
>


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

* Re: [PATCH 11/11] AM3517: Add mmc platform data for am3517evm
  2010-04-13 13:08   ` Adrian Hunter
@ 2010-04-14  7:14     ` stanley.miao
  0 siblings, 0 replies; 21+ messages in thread
From: stanley.miao @ 2010-04-14  7:14 UTC (permalink / raw)
  To: Adrian Hunter
  Cc: linux-omap@vger.kernel.org, tony@atomide.com, madhu.cr@ti.com

Adrian Hunter wrote:
> Stanley.Miao wrote:
>> Add mmc platform data. Besides, the mmc slot on UI board has a pin 
>> conflict
>> with LCD, so add macros to resolve it.
>>
>> <snip>
>>  
>> +static struct omap2_hsmmc_info mmc[] = {
>> +    {
>> +        .mmc            = 1,
>> +        .wires          = 4,
>> +        .gpio_cd        = 127,
>> +        .gpio_wp        = 126,
>> +        .ocr_mask       = MMC_VDD_165_195 |
>> +                MMC_VDD_26_27 | MMC_VDD_27_28 |
>> +                MMC_VDD_29_30 |
>> +                MMC_VDD_30_31 | MMC_VDD_31_32,
>
> How can you support 1.8V and 3V cards without controlling power
> to the card?

Just modify the MMCHS_HCTL register.
I don't have a 1.8V card, so I didn't test the 1.8V mode. I just wrote 
it according to TRM.

Stanley.



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

end of thread, other threads:[~2010-04-14  7:05 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-04-13  9:31 [PATCH 0/11] Some am3517 related patches Stanley.Miao
2010-04-13  9:31 ` [PATCH 01/11] omap: remove one of the define of INT_34XX_BENCH_MPU_EMUL Stanley.Miao
2010-04-13  9:31 ` [PATCH 02/11] AM3517: Add platform init code for EMAC driver Stanley.Miao
2010-04-13  9:31 ` [PATCH 03/11] AM3517: rename the i2c boardinfo to make it more readable Stanley.Miao
2010-04-13 16:29   ` Hiremath, Vaibhav
2010-04-14  2:44     ` stanley.miao
2010-04-13  9:31 ` [PATCH 04/11] AM3517: Add platform init code for regulator driver Stanley.Miao
2010-04-13  9:31 ` [PATCH 05/11] AM3517: Add audio codec platform data Stanley.Miao
2010-04-13  9:31 ` [PATCH 06/11] AM3517: Add nand platform data for am3517evm Stanley.Miao
2010-04-13  9:31 ` [PATCH 07/11] AM3517: initialize i2c subsystem after mux subsystem Stanley.Miao
2010-04-13  9:31 ` [PATCH 08/11] OMAP: fix a gpmc nand problem Stanley.Miao
2010-04-13  9:34 ` [PATCH 09/11] omap: init the gpio pinmux for mmc Stanley.Miao
2010-04-13  9:34 ` [PATCH 10/11] omap hsmmc: fix the hsmmc driver for am3517 Stanley.Miao
2010-04-13 13:03   ` Adrian Hunter
2010-04-13 13:06     ` Adrian Hunter
2010-04-14  3:34     ` stanley.miao
2010-04-13  9:34 ` [PATCH 11/11] AM3517: Add mmc platform data for am3517evm Stanley.Miao
2010-04-13 13:08   ` Adrian Hunter
2010-04-14  7:14     ` stanley.miao
2010-04-13 16:18   ` Hiremath, Vaibhav
2010-04-14  2:36     ` stanley.miao

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox