All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 00/12] Omap3 updates for the merge window after 2.6.29
@ 2009-03-10 21:00 Tony Lindgren
  2009-03-10 21:02 ` [PATCH 01/12] ARM: OMAP3: Remove unused CONFIG_I2C2_OMAP_BEAGLE Tony Lindgren
                   ` (12 more replies)
  0 siblings, 13 replies; 49+ messages in thread
From: Tony Lindgren @ 2009-03-10 21:00 UTC (permalink / raw)
  To: linux-arm-kernel; +Cc: linux-omap

Hi all,

Here are the patches I promised last week, sorry for the delay
in posting them. I ended up leaving out the mach-omap3/board-*.c
files as they still need a bit of work.

I may post one more series after this to add few more omap3
boards if we have enough time.

Cheers,

Tony

---

Adrian Hunter (3):
      ARM: OMAP3: mmc-twl4030 allow arbitrary slot names
      ARM: OMAP3: mmc-twl4030 add cover switch
      ARM: OMAP3: mmc-twl4030 fix name buffer length

David Brownell (3):
      ARM: OMAP3: mmc-twl4030 fix for vmmc = 0
      ARM: OMAP3: mmc-twl4030 init passes device nodes back
      ARM: OMAP3: mmc-twl4030 voltage cleanup

Felipe Balbi (1):
      ARM: OMAP3: MUSB initialization for omap hw

Grazvydas Ignotas (1):
      ARM: OMAP3: mmc-twl4030 add MMC3 support

Jarkko Nikula (1):
      ARM: OMAP3: Remove unused CONFIG_I2C2_OMAP_BEAGLE

Juha Yrjola (1):
      ARM: OMAP3: Store reboot mode in scratchpad on OMAP34xx

Tony Lindgren (2):
      ARM: OMAP3: Add base address definitions and resources for OMAP 3 IS
      ARM: OMAP3: Add more GPIO mux options


 arch/arm/mach-omap2/Makefile               |    2 
 arch/arm/mach-omap2/board-2430sdp.c        |    2 
 arch/arm/mach-omap2/board-ldp.c            |    2 
 arch/arm/mach-omap2/board-omap3beagle.c    |    5 -
 arch/arm/mach-omap2/board-omap3pandora.c   |    9 +
 arch/arm/mach-omap2/board-overo.c          |    3 
 arch/arm/mach-omap2/devices.c              |  108 ++++++++++++++++
 arch/arm/mach-omap2/mmc-twl4030.c          |  186 ++++++++++++++++++++--------
 arch/arm/mach-omap2/mmc-twl4030.h          |    6 +
 arch/arm/mach-omap2/mux.c                  |   27 ++++
 arch/arm/mach-omap2/prcm.c                 |   14 ++
 arch/arm/mach-omap2/usb-musb.c             |  185 ++++++++++++++++++++++++++++
 arch/arm/plat-omap/devices.c               |    3 
 arch/arm/plat-omap/include/mach/control.h  |    9 +
 arch/arm/plat-omap/include/mach/mmc.h      |    2 
 arch/arm/plat-omap/include/mach/mux.h      |   13 ++
 arch/arm/plat-omap/include/mach/omap34xx.h |   27 ++++
 arch/arm/plat-omap/include/mach/usb.h      |    8 +
 18 files changed, 549 insertions(+), 62 deletions(-)
 create mode 100644 arch/arm/mach-omap2/usb-musb.c

-- 
Signature

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

* [PATCH 01/12] ARM: OMAP3: Remove unused CONFIG_I2C2_OMAP_BEAGLE
  2009-03-10 21:00 [PATCH 00/12] Omap3 updates for the merge window after 2.6.29 Tony Lindgren
@ 2009-03-10 21:02 ` Tony Lindgren
  2009-03-10 21:03 ` [PATCH 02/12] ARM: OMAP3: Store reboot mode in scratchpad on OMAP34xx Tony Lindgren
                   ` (11 subsequent siblings)
  12 siblings, 0 replies; 49+ messages in thread
From: Tony Lindgren @ 2009-03-10 21:02 UTC (permalink / raw)
  To: linux-arm-kernel; +Cc: linux-omap, Jarkko Nikula

From: Jarkko Nikula <jhnikula@gmail.com>

There is no CONFIG_I2C2_OMAP_BEAGLE in mainline and it is under
removal in linux-omap also so remove this dead code now.

Signed-off-by: Jarkko Nikula <jarkko.nikula@nokia.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
---
 arch/arm/mach-omap2/board-omap3beagle.c |    3 ---
 1 files changed, 0 insertions(+), 3 deletions(-)

diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c
index e39cd2c..e3c8628 100644
--- a/arch/arm/mach-omap2/board-omap3beagle.c
+++ b/arch/arm/mach-omap2/board-omap3beagle.c
@@ -175,9 +175,6 @@ static int __init omap3_beagle_i2c_init(void)
 {
 	omap_register_i2c_bus(1, 2600, beagle_i2c_boardinfo,
 			ARRAY_SIZE(beagle_i2c_boardinfo));
-#ifdef CONFIG_I2C2_OMAP_BEAGLE
-	omap_register_i2c_bus(2, 400, NULL, 0);
-#endif
 	/* Bus 3 is attached to the DVI port where devices like the pico DLP
 	 * projector don't work reliably with 400kHz */
 	omap_register_i2c_bus(3, 100, NULL, 0);


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

* [PATCH 02/12] ARM: OMAP3: Store reboot mode in scratchpad on OMAP34xx
  2009-03-10 21:00 [PATCH 00/12] Omap3 updates for the merge window after 2.6.29 Tony Lindgren
  2009-03-10 21:02 ` [PATCH 01/12] ARM: OMAP3: Remove unused CONFIG_I2C2_OMAP_BEAGLE Tony Lindgren
@ 2009-03-10 21:03 ` Tony Lindgren
  2009-03-15 15:51   ` Russell King - ARM Linux
  2009-03-24  1:11   ` Tony Lindgren
  2009-03-10 21:04 ` [PATCH 03/12] ARM: OMAP3: Add more GPIO mux options Tony Lindgren
                   ` (10 subsequent siblings)
  12 siblings, 2 replies; 49+ messages in thread
From: Tony Lindgren @ 2009-03-10 21:03 UTC (permalink / raw)
  To: linux-arm-kernel; +Cc: Juha Yrjola, Kevin Hilman, linux-omap

From: Juha Yrjola <juha.yrjola@solidboot.com>

The reboot mode can be communicated to a bootloader (or the
kernel itself) with a scratchpad register. This functionality
is especially useful, if userspace is allowed to change
the reboot mode.

Patch updated by Tony to also define the BOODMOD registers.

Signed-off-by: Juha Yrjola <juha.yrjola@solidboot.com>
Acked-by: Kevin Hilman <khilman@deeprootsystems.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
---
 arch/arm/mach-omap2/prcm.c                |   14 ++++++++++++--
 arch/arm/plat-omap/include/mach/control.h |    9 +++++++++
 2 files changed, 21 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-omap2/prcm.c b/arch/arm/mach-omap2/prcm.c
index f945156..12c0e03 100644
--- a/arch/arm/mach-omap2/prcm.c
+++ b/arch/arm/mach-omap2/prcm.c
@@ -19,6 +19,7 @@
 #include <linux/io.h>
 
 #include <mach/common.h>
+#include <mach/control.h>
 #include <mach/prcm.h>
 
 #include "clock.h"
@@ -43,9 +44,18 @@ void omap_prcm_arch_reset(char mode)
 
 	if (cpu_is_omap24xx())
 		prcm_offs = WKUP_MOD;
-	else if (cpu_is_omap34xx())
+	else if (cpu_is_omap34xx()) {
+		u32 l;
+
 		prcm_offs = OMAP3430_GR_MOD;
-	else
+		l = ('B' << 24) | ('M' << 16) | mode;
+		/* Reserve the first word in scratchpad for communicating
+		 * with the boot ROM. A pointer to a data structure
+		 * describing the boot process can be stored there,
+		 * cf. OMAP34xx TRM, Initialization / Software Booting
+		 * Configuration. */
+		omap_writel(l, OMAP343X_SCRATCHPAD + 4);
+	} else
 		WARN_ON(1);
 
 	prm_set_mod_reg_bits(OMAP_RST_DPLL3, prcm_offs, RM_RSTCTRL);
diff --git a/arch/arm/plat-omap/include/mach/control.h b/arch/arm/plat-omap/include/mach/control.h
index 269147f..1e1bcff 100644
--- a/arch/arm/plat-omap/include/mach/control.h
+++ b/arch/arm/plat-omap/include/mach/control.h
@@ -189,6 +189,15 @@
 #define OMAP2_PBIASLITEPWRDNZ0		(1 << 1)
 #define OMAP2_PBIASLITEVMODE0		(1 << 0)
 
+/* CONTROL_IVA2_BOOTMOD bits */
+#define OMAP3_IVA2_BOOTMOD_SHIFT	0
+#define OMAP3_IVA2_BOOTMOD_MASK		(0xf << 0)
+#define OMAP3_IVA2_BOOTMOD_IDLE		(0x1 << 0)
+
+#define OMAP343X_SCRATCHPAD_ROM		(OMAP343X_CTRL_BASE + 0x860)
+#define OMAP343X_SCRATCHPAD		(OMAP343X_CTRL_BASE + 0x910)
+#define OMAP343X_SCRATCHPAD_ROM_OFFSET	0x19C
+
 #ifndef __ASSEMBLY__
 #if defined(CONFIG_ARCH_OMAP2) || defined(CONFIG_ARCH_OMAP3)
 extern void __iomem *omap_ctrl_base_get(void);


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

* [PATCH 03/12] ARM: OMAP3: Add more GPIO mux options
  2009-03-10 21:00 [PATCH 00/12] Omap3 updates for the merge window after 2.6.29 Tony Lindgren
  2009-03-10 21:02 ` [PATCH 01/12] ARM: OMAP3: Remove unused CONFIG_I2C2_OMAP_BEAGLE Tony Lindgren
  2009-03-10 21:03 ` [PATCH 02/12] ARM: OMAP3: Store reboot mode in scratchpad on OMAP34xx Tony Lindgren
@ 2009-03-10 21:04 ` Tony Lindgren
  2009-03-10 21:06 ` [PATCH 04/12] ARM: OMAP3: mmc-twl4030 fix name buffer length Tony Lindgren
                   ` (9 subsequent siblings)
  12 siblings, 0 replies; 49+ messages in thread
From: Tony Lindgren @ 2009-03-10 21:04 UTC (permalink / raw)
  To: linux-arm-kernel; +Cc: linux-omap

This patch adds several new GPIO pins and updates
the pin naming comments.

The patch is based on earlier patches on linux-omap
list by Manikandan Pillai <mani.pillai@ti.com>,
Vaibhav Hiremath <hvaibhav@ti.com> and
David Brownell <dbrownell@users.sourceforge.net>.

Signed-off-by: Tony Lindgren <tony@atomide.com>
---
 arch/arm/mach-omap2/mux.c             |   27 +++++++++++++++++++++++++++
 arch/arm/plat-omap/include/mach/mux.h |   13 +++++++++++++
 2 files changed, 40 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/mux.c b/arch/arm/mach-omap2/mux.c
index dacb41f..026c4fc 100644
--- a/arch/arm/mach-omap2/mux.c
+++ b/arch/arm/mach-omap2/mux.c
@@ -453,10 +453,37 @@ MUX_CFG_34XX("AC1_3430_USB3FS_PHY_MM3_TXEN_N", 0x18a,
 
 
 /* 34XX GPIO - bidirectional, unless the name has an "_OUT" suffix.
+ * (Always specify PIN_INPUT, except for names suffixed by "_OUT".)
  * No internal pullup/pulldown without "_UP" or "_DOWN" suffix.
  */
+MUX_CFG_34XX("AF26_34XX_GPIO0", 0x1e0,
+		OMAP34XX_MUX_MODE4 | OMAP34XX_PIN_INPUT)
+MUX_CFG_34XX("AF22_34XX_GPIO9", 0xa18,
+		OMAP34XX_MUX_MODE4 | OMAP34XX_PIN_INPUT)
 MUX_CFG_34XX("AH8_34XX_GPIO29", 0x5fa,
 		OMAP34XX_MUX_MODE4 | OMAP34XX_PIN_INPUT)
+MUX_CFG_34XX("U8_34XX_GPIO54_OUT", 0x0b4,
+		OMAP34XX_MUX_MODE4 | OMAP34XX_PIN_OUTPUT)
+MUX_CFG_34XX("U8_34XX_GPIO54_DOWN", 0x0b4,
+		OMAP34XX_MUX_MODE4 | OMAP34XX_PIN_INPUT_PULLDOWN)
+MUX_CFG_34XX("L8_34XX_GPIO63", 0x0ce,
+		OMAP34XX_MUX_MODE4 | OMAP34XX_PIN_INPUT)
+MUX_CFG_34XX("G25_34XX_GPIO86_OUT", 0x0fc,
+		OMAP34XX_MUX_MODE4 | OMAP34XX_PIN_OUTPUT)
+MUX_CFG_34XX("AG4_34XX_GPIO134_OUT", 0x160,
+		OMAP34XX_MUX_MODE4 | OMAP34XX_PIN_OUTPUT)
+MUX_CFG_34XX("AE4_34XX_GPIO136_OUT", 0x164,
+		OMAP34XX_MUX_MODE4 | OMAP34XX_PIN_OUTPUT)
+MUX_CFG_34XX("AF6_34XX_GPIO140_UP", 0x16c,
+		OMAP34XX_MUX_MODE4 | OMAP34XX_PIN_INPUT_PULLUP)
+MUX_CFG_34XX("AE6_34XX_GPIO141", 0x16e,
+		OMAP34XX_MUX_MODE4 | OMAP34XX_PIN_INPUT)
+MUX_CFG_34XX("AF5_34XX_GPIO142", 0x170,
+		OMAP34XX_MUX_MODE4 | OMAP34XX_PIN_INPUT)
+MUX_CFG_34XX("AE5_34XX_GPIO143", 0x172,
+		OMAP34XX_MUX_MODE4 | OMAP34XX_PIN_INPUT)
+MUX_CFG_34XX("H19_34XX_GPIO164_OUT", 0x19c,
+		OMAP34XX_MUX_MODE4 | OMAP34XX_PIN_OUTPUT)
 MUX_CFG_34XX("J25_34XX_GPIO170", 0x1c6,
 		OMAP34XX_MUX_MODE4 | OMAP34XX_PIN_INPUT)
 };
diff --git a/arch/arm/plat-omap/include/mach/mux.h b/arch/arm/plat-omap/include/mach/mux.h
index f4362b8..f7e298a 100644
--- a/arch/arm/plat-omap/include/mach/mux.h
+++ b/arch/arm/plat-omap/include/mach/mux.h
@@ -788,7 +788,20 @@ enum omap34xx_index {
 	 *  - "_DOWN" suffix (GPIO3_DOWN) with internal pulldown
 	 *  - "_OUT" suffix (GPIO3_OUT) for output-only pins (unlike 24xx)
 	 */
+	AF26_34XX_GPIO0,
+	AF22_34XX_GPIO9,
 	AH8_34XX_GPIO29,
+	U8_34XX_GPIO54_OUT,
+	U8_34XX_GPIO54_DOWN,
+	L8_34XX_GPIO63,
+	G25_34XX_GPIO86_OUT,
+	AG4_34XX_GPIO134_OUT,
+	AE4_34XX_GPIO136_OUT,
+	AF6_34XX_GPIO140_UP,
+	AE6_34XX_GPIO141,
+	AF5_34XX_GPIO142,
+	AE5_34XX_GPIO143,
+	H19_34XX_GPIO164_OUT,
 	J25_34XX_GPIO170,
 };
 


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

* [PATCH 04/12] ARM: OMAP3: mmc-twl4030 fix name buffer length
  2009-03-10 21:00 [PATCH 00/12] Omap3 updates for the merge window after 2.6.29 Tony Lindgren
                   ` (2 preceding siblings ...)
  2009-03-10 21:04 ` [PATCH 03/12] ARM: OMAP3: Add more GPIO mux options Tony Lindgren
@ 2009-03-10 21:06 ` Tony Lindgren
  2009-03-15 16:00   ` Russell King - ARM Linux
  2009-03-10 21:07 ` [PATCH 05/12] ARM: OMAP3: mmc-twl4030 voltage cleanup Tony Lindgren
                   ` (8 subsequent siblings)
  12 siblings, 1 reply; 49+ messages in thread
From: Tony Lindgren @ 2009-03-10 21:06 UTC (permalink / raw)
  To: linux-arm-kernel; +Cc: David Brownell, linux-omap, Adrian Hunter

From: Adrian Hunter <adrian.hunter@nokia.com>

Add 1 to buffer length for null terminator.

Signed-off-by: Adrian Hunter <adrian.hunter@nokia.com>
Acked-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Tony Lindgren <tony@atomide.com>
---
 arch/arm/mach-omap2/mmc-twl4030.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/arm/mach-omap2/mmc-twl4030.c b/arch/arm/mach-omap2/mmc-twl4030.c
index 437f520..909f57c 100644
--- a/arch/arm/mach-omap2/mmc-twl4030.c
+++ b/arch/arm/mach-omap2/mmc-twl4030.c
@@ -59,7 +59,7 @@ static struct twl_mmc_controller {
 	struct omap_mmc_platform_data	*mmc;
 	u8		twl_vmmc_dev_grp;
 	u8		twl_mmc_dedicated;
-	char		name[HSMMC_NAME_LEN];
+	char		name[HSMMC_NAME_LEN + 1];
 } hsmmc[] = {
 	{
 		.twl_vmmc_dev_grp		= VMMC1_DEV_GRP,


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

* [PATCH 05/12] ARM: OMAP3: mmc-twl4030 voltage cleanup
  2009-03-10 21:00 [PATCH 00/12] Omap3 updates for the merge window after 2.6.29 Tony Lindgren
                   ` (3 preceding siblings ...)
  2009-03-10 21:06 ` [PATCH 04/12] ARM: OMAP3: mmc-twl4030 fix name buffer length Tony Lindgren
@ 2009-03-10 21:07 ` Tony Lindgren
  2009-03-10 21:08 ` [PATCH 06/12] ARM: OMAP3: mmc-twl4030 init passes device nodes back Tony Lindgren
                   ` (7 subsequent siblings)
  12 siblings, 0 replies; 49+ messages in thread
From: Tony Lindgren @ 2009-03-10 21:07 UTC (permalink / raw)
  To: linux-arm-kernel; +Cc: David Brownell, linux-omap

From: David Brownell <dbrownell@users.sourceforge.net>

Correct twl4030 MMC power switching:  fix voltage ranges reported
for each slot, and handle them fully.

 Lies corrected:
  - MMC-1 doesn't support the 2.6-2.7 Volt range
  - MMC-2 can't normally support anything except 1.8V
 Omissions corrected
  - MMC-1 *does* handle the 2.8-2.9 Volt range
  - MMC-2 can handle 2.5-3.2 Volt cards, given a transceiver

Add transciever support for MMC-2; enable it for Overo and Pandora.
(Depends on something else to have set up pinmuxing for control
signals instead of as MMC2_DAT4..7 pins.)

Also shrink twl4030_hsmmc_info a smidgeon ... padding is all gone.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Tony Lindgren <tony@atomide.com>
---
 arch/arm/mach-omap2/board-omap3pandora.c |    1 
 arch/arm/mach-omap2/board-overo.c        |    1 
 arch/arm/mach-omap2/mmc-twl4030.c        |  127 +++++++++++++++++++-----------
 arch/arm/mach-omap2/mmc-twl4030.h        |    3 -
 4 files changed, 84 insertions(+), 48 deletions(-)

diff --git a/arch/arm/mach-omap2/board-omap3pandora.c b/arch/arm/mach-omap2/board-omap3pandora.c
index b319610..7a46a65 100644
--- a/arch/arm/mach-omap2/board-omap3pandora.c
+++ b/arch/arm/mach-omap2/board-omap3pandora.c
@@ -53,6 +53,7 @@ static struct twl4030_hsmmc_info omap3pandora_mmc[] = {
 		.gpio_cd	= -EINVAL,
 		.gpio_wp	= 127,
 		.ext_clock	= 1,
+		.transceiver	= true,
 	},
 	{}	/* Terminator */
 };
diff --git a/arch/arm/mach-omap2/board-overo.c b/arch/arm/mach-omap2/board-overo.c
index 82b3dc5..61f8e23 100644
--- a/arch/arm/mach-omap2/board-overo.c
+++ b/arch/arm/mach-omap2/board-overo.c
@@ -209,6 +209,7 @@ static struct twl4030_hsmmc_info mmc[] __initdata = {
 		.wires		= 4,
 		.gpio_cd	= -EINVAL,
 		.gpio_wp	= -EINVAL,
+		.transceiver	= true,
 	},
 	{}	/* Terminator */
 };
diff --git a/arch/arm/mach-omap2/mmc-twl4030.c b/arch/arm/mach-omap2/mmc-twl4030.c
index 909f57c..42ac13f 100644
--- a/arch/arm/mach-omap2/mmc-twl4030.c
+++ b/arch/arm/mach-omap2/mmc-twl4030.c
@@ -44,6 +44,7 @@
 #define VMMC2_315V		0x0c
 #define VMMC2_300V		0x0b
 #define VMMC2_285V		0x0a
+#define VMMC2_280V		0x09
 #define VMMC2_260V		0x08
 #define VMMC2_185V		0x06
 #define VMMC2_DEDICATED		0x2E
@@ -166,56 +167,73 @@ static int twl_mmc_resume(struct device *dev, int slot)
 /*
  * Sets the MMC voltage in twl4030
  */
+
+#define MMC1_OCR	(MMC_VDD_165_195 \
+		|MMC_VDD_28_29|MMC_VDD_29_30|MMC_VDD_30_31|MMC_VDD_31_32)
+#define MMC2_OCR	(MMC_VDD_165_195 \
+		|MMC_VDD_25_26|MMC_VDD_26_27|MMC_VDD_27_28 \
+		|MMC_VDD_28_29|MMC_VDD_29_30|MMC_VDD_30_31|MMC_VDD_31_32)
+
 static int twl_mmc_set_voltage(struct twl_mmc_controller *c, int vdd)
 {
 	int ret;
 	u8 vmmc, dev_grp_val;
 
-	switch (1 << vdd) {
-	case MMC_VDD_35_36:
-	case MMC_VDD_34_35:
-	case MMC_VDD_33_34:
-	case MMC_VDD_32_33:
-	case MMC_VDD_31_32:
-	case MMC_VDD_30_31:
-		if (c->twl_vmmc_dev_grp == VMMC1_DEV_GRP)
-			vmmc = VMMC1_315V;
-		else
-			vmmc = VMMC2_315V;
-		break;
-	case MMC_VDD_29_30:
-		if (c->twl_vmmc_dev_grp == VMMC1_DEV_GRP)
-			vmmc = VMMC1_315V;
-		else
-			vmmc = VMMC2_300V;
-		break;
-	case MMC_VDD_27_28:
-	case MMC_VDD_26_27:
-		if (c->twl_vmmc_dev_grp == VMMC1_DEV_GRP)
-			vmmc = VMMC1_285V;
-		else
-			vmmc = VMMC2_285V;
-		break;
-	case MMC_VDD_25_26:
-	case MMC_VDD_24_25:
-	case MMC_VDD_23_24:
-	case MMC_VDD_22_23:
-	case MMC_VDD_21_22:
-	case MMC_VDD_20_21:
-		if (c->twl_vmmc_dev_grp == VMMC1_DEV_GRP)
-			vmmc = VMMC1_285V;
-		else
-			vmmc = VMMC2_260V;
-		break;
-	case MMC_VDD_165_195:
-		if (c->twl_vmmc_dev_grp == VMMC1_DEV_GRP)
+	if (c->twl_vmmc_dev_grp == VMMC1_DEV_GRP) {
+		/* VMMC1:  max 220 mA.  And for 8-bit mode,
+		 * VSIM:  max 50 mA
+		 */
+		switch (1 << vdd) {
+		case MMC_VDD_165_195:
 			vmmc = VMMC1_185V;
-		else
+			/* and VSIM_180V */
+			break;
+		case MMC_VDD_28_29:
+			vmmc = VMMC1_285V;
+			/* and VSIM_280V */
+			break;
+		case MMC_VDD_29_30:
+		case MMC_VDD_30_31:
+			vmmc = VMMC1_300V;
+			/* and VSIM_300V */
+			break;
+		case MMC_VDD_31_32:
+			vmmc = VMMC1_315V;
+			/* error if VSIM needed */
+			break;
+		default:
+			vmmc = 0;
+			break;
+		}
+	} else if (c->twl_vmmc_dev_grp == VMMC2_DEV_GRP) {
+		/* VMMC2:  max 100 mA */
+		switch (1 << vdd) {
+		case MMC_VDD_165_195:
 			vmmc = VMMC2_185V;
-		break;
-	default:
-		vmmc = 0;
-		break;
+			break;
+		case MMC_VDD_25_26:
+		case MMC_VDD_26_27:
+			vmmc = VMMC2_260V;
+			break;
+		case MMC_VDD_27_28:
+			vmmc = VMMC2_280V;
+			break;
+		case MMC_VDD_28_29:
+			vmmc = VMMC2_285V;
+			break;
+		case MMC_VDD_29_30:
+		case MMC_VDD_30_31:
+			vmmc = VMMC2_300V;
+			break;
+		case MMC_VDD_31_32:
+			vmmc = VMMC2_315V;
+			break;
+		default:
+			vmmc = 0;
+			break;
+		}
+	} else {
+		return 0;
 	}
 
 	if (vmmc)
@@ -242,6 +260,14 @@ static int twl_mmc1_set_power(struct device *dev, int slot, int power_on,
 	struct twl_mmc_controller *c = &hsmmc[0];
 	struct omap_mmc_platform_data *mmc = dev->platform_data;
 
+	/*
+	 * Assume we power both OMAP VMMC1 (for CMD, CLK, DAT0..3) and the
+	 * card using the same TWL VMMC1 supply (hsmmc[0]); OMAP has both
+	 * 1.8V and 3.0V modes, controlled by the PBIAS register.
+	 *
+	 * In 8-bit modes, OMAP VMMC1A (for DAT4..7) needs a supply, which
+	 * is most naturally TWL VSIM; those pins also use PBIAS.
+	 */
 	if (power_on) {
 		if (cpu_is_omap2430()) {
 			reg = omap_ctrl_readl(OMAP243X_CONTROL_DEVCONF1);
@@ -298,6 +324,12 @@ static int twl_mmc2_set_power(struct device *dev, int slot, int power_on, int vd
 	struct twl_mmc_controller *c = &hsmmc[1];
 	struct omap_mmc_platform_data *mmc = dev->platform_data;
 
+	/*
+	 * Assume TWL VMMC2 (hsmmc[1]) is used only to power the card ... OMAP
+	 * VDDS is used to power the pins, optionally with a transceiver to
+	 * support cards using voltages other than VDDS (1.8V nominal).  When a
+	 * transceiver is used, DAT3..7 are muxed as transceiver control pins.
+	 */
 	if (power_on) {
 		if (mmc->slots[0].internal_clock) {
 			u32 reg;
@@ -352,10 +384,6 @@ void __init twl4030_mmc_init(struct twl4030_hsmmc_info *controllers)
 		sprintf(twl->name, "mmc%islot%i", c->mmc, 1);
 		mmc->slots[0].name = twl->name;
 		mmc->nr_slots = 1;
-		mmc->slots[0].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;
 		mmc->slots[0].wires = c->wires;
 		mmc->slots[0].internal_clock = !c->ext_clock;
 		mmc->dma_mask = 0xffffffff;
@@ -391,9 +419,14 @@ void __init twl4030_mmc_init(struct twl4030_hsmmc_info *controllers)
 		switch (c->mmc) {
 		case 1:
 			mmc->slots[0].set_power = twl_mmc1_set_power;
+			mmc->slots[0].ocr_mask = MMC1_OCR;
 			break;
 		case 2:
 			mmc->slots[0].set_power = twl_mmc2_set_power;
+			if (c->transceiver)
+				mmc->slots[0].ocr_mask = MMC2_OCR;
+			else
+				mmc->slots[0].ocr_mask = MMC_VDD_165_195;
 			break;
 		default:
 			pr_err("MMC%d configuration not supported!\n", c->mmc);
diff --git a/arch/arm/mach-omap2/mmc-twl4030.h b/arch/arm/mach-omap2/mmc-twl4030.h
index e1c8076..380dde7 100644
--- a/arch/arm/mach-omap2/mmc-twl4030.h
+++ b/arch/arm/mach-omap2/mmc-twl4030.h
@@ -9,9 +9,10 @@
 struct twl4030_hsmmc_info {
 	u8	mmc;		/* controller 1/2/3 */
 	u8	wires;		/* 1/4/8 wires */
+	bool	transceiver;	/* MMC-2 option */
+	bool	ext_clock;	/* use external pin for input clock */
 	int	gpio_cd;	/* or -EINVAL */
 	int	gpio_wp;	/* or -EINVAL */
-	int	ext_clock:1;	/* use external pin for input clock */
 };
 
 #if	defined(CONFIG_TWL4030_CORE) && \


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

* [PATCH 06/12] ARM: OMAP3: mmc-twl4030 init passes device nodes back
  2009-03-10 21:00 [PATCH 00/12] Omap3 updates for the merge window after 2.6.29 Tony Lindgren
                   ` (4 preceding siblings ...)
  2009-03-10 21:07 ` [PATCH 05/12] ARM: OMAP3: mmc-twl4030 voltage cleanup Tony Lindgren
@ 2009-03-10 21:08 ` Tony Lindgren
  2009-03-15 16:02   ` Russell King - ARM Linux
  2009-03-10 21:10 ` [PATCH 07/12] ARM: OMAP3: mmc-twl4030 add MMC3 support Tony Lindgren
                   ` (6 subsequent siblings)
  12 siblings, 1 reply; 49+ messages in thread
From: Tony Lindgren @ 2009-03-10 21:08 UTC (permalink / raw)
  To: linux-arm-kernel; +Cc: David Brownell, linux-omap

From: David Brownell <dbrownell@users.sourceforge.net>

When setting up HSMMC devices, pass pass the device nodes back so
board code can linking them to their power supply regulators.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Tony Lindgren <tony@atomide.com>
---
 arch/arm/mach-omap2/mmc-twl4030.c     |   10 ++++++++++
 arch/arm/mach-omap2/mmc-twl4030.h     |    1 +
 arch/arm/plat-omap/devices.c          |    3 +++
 arch/arm/plat-omap/include/mach/mmc.h |    2 ++
 4 files changed, 16 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/mmc-twl4030.c b/arch/arm/mach-omap2/mmc-twl4030.c
index 42ac13f..6399874 100644
--- a/arch/arm/mach-omap2/mmc-twl4030.c
+++ b/arch/arm/mach-omap2/mmc-twl4030.c
@@ -17,6 +17,7 @@
 #include <linux/delay.h>
 #include <linux/gpio.h>
 #include <linux/i2c/twl4030.h>
+#include <linux/regulator/machine.h>
 
 #include <mach/hardware.h>
 #include <mach/control.h>
@@ -436,6 +437,15 @@ void __init twl4030_mmc_init(struct twl4030_hsmmc_info *controllers)
 	}
 
 	omap2_init_mmc(hsmmc_data, OMAP34XX_NR_MMC);
+
+	/* pass the device nodes back to board setup code */
+	for (c = controllers; c->mmc; c++) {
+		struct omap_mmc_platform_data *mmc = hsmmc_data[c->mmc - 1];
+
+		if (!c->mmc || c->mmc > nr_hsmmc)
+			continue;
+		c->dev = mmc->dev;
+	}
 }
 
 #endif
diff --git a/arch/arm/mach-omap2/mmc-twl4030.h b/arch/arm/mach-omap2/mmc-twl4030.h
index 380dde7..21d3572 100644
--- a/arch/arm/mach-omap2/mmc-twl4030.h
+++ b/arch/arm/mach-omap2/mmc-twl4030.h
@@ -13,6 +13,7 @@ struct twl4030_hsmmc_info {
 	bool	ext_clock;	/* use external pin for input clock */
 	int	gpio_cd;	/* or -EINVAL */
 	int	gpio_wp;	/* or -EINVAL */
+	struct device *dev;	/* returned: pointer to mmc adapter */
 };
 
 #if	defined(CONFIG_TWL4030_CORE) && \
diff --git a/arch/arm/plat-omap/devices.c b/arch/arm/plat-omap/devices.c
index 208dbb1..87fb7ff 100644
--- a/arch/arm/plat-omap/devices.c
+++ b/arch/arm/plat-omap/devices.c
@@ -228,6 +228,9 @@ int __init omap_mmc_add(const char *name, int id, unsigned long base,
 	ret = platform_device_add(pdev);
 	if (ret)
 		goto fail;
+
+	/* return device handle to board setup code */
+	data->dev = &pdev->dev;
 	return 0;
 
 fail:
diff --git a/arch/arm/plat-omap/include/mach/mmc.h b/arch/arm/plat-omap/include/mach/mmc.h
index 73a9e15..4435bd4 100644
--- a/arch/arm/plat-omap/include/mach/mmc.h
+++ b/arch/arm/plat-omap/include/mach/mmc.h
@@ -37,6 +37,8 @@
 #define OMAP_MMC_MAX_SLOTS	2
 
 struct omap_mmc_platform_data {
+	/* back-link to device */
+	struct device *dev;
 
 	/* number of slots per controller */
 	unsigned nr_slots:2;


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

* [PATCH 07/12] ARM: OMAP3: mmc-twl4030 add MMC3 support
  2009-03-10 21:00 [PATCH 00/12] Omap3 updates for the merge window after 2.6.29 Tony Lindgren
                   ` (5 preceding siblings ...)
  2009-03-10 21:08 ` [PATCH 06/12] ARM: OMAP3: mmc-twl4030 init passes device nodes back Tony Lindgren
@ 2009-03-10 21:10 ` Tony Lindgren
  2009-03-15 16:04   ` Russell King - ARM Linux
  2009-03-10 21:11 ` [PATCH 08/12] ARM: OMAP3: mmc-twl4030 fix for vmmc = 0 Tony Lindgren
                   ` (5 subsequent siblings)
  12 siblings, 1 reply; 49+ messages in thread
From: Tony Lindgren @ 2009-03-10 21:10 UTC (permalink / raw)
  To: linux-arm-kernel; +Cc: linux-omap, Grazvydas Ignotas

From: Grazvydas Ignotas <notasas@gmail.com>

Device connected to MMC3 is assumed to be self-powered, so
set_power() function is empty. It can't be omited because
host driver requires it. Array size for hsmmc[] is specified
because hsmmc[2].name is needed for MMC3 name.

Also fix a leak which happens if invalid controller id
is passed.

Signed-off-by: Grazvydas Ignotas <notasas@gmail.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
---
 arch/arm/mach-omap2/board-omap3pandora.c |    6 ++++++
 arch/arm/mach-omap2/mmc-twl4030.c        |   19 +++++++++++++++++--
 2 files changed, 23 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-omap2/board-omap3pandora.c b/arch/arm/mach-omap2/board-omap3pandora.c
index 7a46a65..6e17180 100644
--- a/arch/arm/mach-omap2/board-omap3pandora.c
+++ b/arch/arm/mach-omap2/board-omap3pandora.c
@@ -55,6 +55,12 @@ static struct twl4030_hsmmc_info omap3pandora_mmc[] = {
 		.ext_clock	= 1,
 		.transceiver	= true,
 	},
+	{
+		.mmc		= 3,
+		.wires		= 4,
+		.gpio_cd	= -EINVAL,
+		.gpio_wp	= -EINVAL,
+	},
 	{}	/* Terminator */
 };
 
diff --git a/arch/arm/mach-omap2/mmc-twl4030.c b/arch/arm/mach-omap2/mmc-twl4030.c
index 6399874..042035c 100644
--- a/arch/arm/mach-omap2/mmc-twl4030.c
+++ b/arch/arm/mach-omap2/mmc-twl4030.c
@@ -62,7 +62,7 @@ static struct twl_mmc_controller {
 	u8		twl_vmmc_dev_grp;
 	u8		twl_mmc_dedicated;
 	char		name[HSMMC_NAME_LEN + 1];
-} hsmmc[] = {
+} hsmmc[OMAP34XX_NR_MMC] = {
 	{
 		.twl_vmmc_dev_grp		= VMMC1_DEV_GRP,
 		.twl_mmc_dedicated		= VMMC1_DEDICATED,
@@ -347,6 +347,16 @@ static int twl_mmc2_set_power(struct device *dev, int slot, int power_on, int vd
 	return ret;
 }
 
+static int twl_mmc3_set_power(struct device *dev, int slot, int power_on,
+		int vdd)
+{
+	/*
+	 * Assume MMC3 has self-powered device connected, for example on-board
+	 * chip with external power source.
+	 */
+	return 0;
+}
+
 static struct omap_mmc_platform_data *hsmmc_data[OMAP34XX_NR_MMC] __initdata;
 
 void __init twl4030_mmc_init(struct twl4030_hsmmc_info *controllers)
@@ -414,7 +424,7 @@ void __init twl4030_mmc_init(struct twl4030_hsmmc_info *controllers)
 
 		/* NOTE:  we assume OMAP's MMC1 and MMC2 use
 		 * the TWL4030's VMMC1 and VMMC2, respectively;
-		 * and that OMAP's MMC3 isn't used.
+		 * and that MMC3 device has it's own power source.
 		 */
 
 		switch (c->mmc) {
@@ -429,8 +439,13 @@ void __init twl4030_mmc_init(struct twl4030_hsmmc_info *controllers)
 			else
 				mmc->slots[0].ocr_mask = MMC_VDD_165_195;
 			break;
+		case 3:
+			mmc->slots[0].set_power = twl_mmc3_set_power;
+			mmc->slots[0].ocr_mask = MMC_VDD_165_195;
+			break;
 		default:
 			pr_err("MMC%d configuration not supported!\n", c->mmc);
+			kfree(mmc);
 			continue;
 		}
 		hsmmc_data[c->mmc - 1] = mmc;


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

* [PATCH 08/12] ARM: OMAP3: mmc-twl4030 fix for vmmc = 0
  2009-03-10 21:00 [PATCH 00/12] Omap3 updates for the merge window after 2.6.29 Tony Lindgren
                   ` (6 preceding siblings ...)
  2009-03-10 21:10 ` [PATCH 07/12] ARM: OMAP3: mmc-twl4030 add MMC3 support Tony Lindgren
@ 2009-03-10 21:11 ` Tony Lindgren
  2009-03-10 21:12 ` [PATCH 09/12] ARM: OMAP3: mmc-twl4030 add cover switch Tony Lindgren
                   ` (4 subsequent siblings)
  12 siblings, 0 replies; 49+ messages in thread
From: Tony Lindgren @ 2009-03-10 21:11 UTC (permalink / raw)
  To: linux-arm-kernel; +Cc: David Brownell, linux-omap

From: David Brownell <dbrownell@users.sourceforge.net>

Resolve longstanding issue noted by Adrian Hunter:  confusion
between settting VSEL=0 (which is 1.8V on MMC1) and poweroff.

Also, leave VSEL alone if we're just powering the regulator off.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Tony Lindgren <tony@atomide.com>
---
 arch/arm/mach-omap2/mmc-twl4030.c |   18 ++++++++++--------
 1 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/arch/arm/mach-omap2/mmc-twl4030.c b/arch/arm/mach-omap2/mmc-twl4030.c
index 042035c..2becaf3 100644
--- a/arch/arm/mach-omap2/mmc-twl4030.c
+++ b/arch/arm/mach-omap2/mmc-twl4030.c
@@ -178,7 +178,10 @@ static int twl_mmc_resume(struct device *dev, int slot)
 static int twl_mmc_set_voltage(struct twl_mmc_controller *c, int vdd)
 {
 	int ret;
-	u8 vmmc, dev_grp_val;
+	u8 vmmc = 0, dev_grp_val;
+
+	if (!vdd)
+		goto doit;
 
 	if (c->twl_vmmc_dev_grp == VMMC1_DEV_GRP) {
 		/* VMMC1:  max 220 mA.  And for 8-bit mode,
@@ -203,8 +206,7 @@ static int twl_mmc_set_voltage(struct twl_mmc_controller *c, int vdd)
 			/* error if VSIM needed */
 			break;
 		default:
-			vmmc = 0;
-			break;
+			return -EINVAL;
 		}
 	} else if (c->twl_vmmc_dev_grp == VMMC2_DEV_GRP) {
 		/* VMMC2:  max 100 mA */
@@ -230,21 +232,21 @@ static int twl_mmc_set_voltage(struct twl_mmc_controller *c, int vdd)
 			vmmc = VMMC2_315V;
 			break;
 		default:
-			vmmc = 0;
-			break;
+			return -EINVAL;
 		}
 	} else {
-		return 0;
+		return -EINVAL;
 	}
 
-	if (vmmc)
+doit:
+	if (vdd)
 		dev_grp_val = VMMC_DEV_GRP_P1;	/* Power up */
 	else
 		dev_grp_val = LDO_CLR;		/* Power down */
 
 	ret = twl4030_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER,
 					dev_grp_val, c->twl_vmmc_dev_grp);
-	if (ret)
+	if (ret || !vdd)
 		return ret;
 
 	ret = twl4030_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER,


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

* [PATCH 09/12] ARM: OMAP3: mmc-twl4030 add cover switch
  2009-03-10 21:00 [PATCH 00/12] Omap3 updates for the merge window after 2.6.29 Tony Lindgren
                   ` (7 preceding siblings ...)
  2009-03-10 21:11 ` [PATCH 08/12] ARM: OMAP3: mmc-twl4030 fix for vmmc = 0 Tony Lindgren
@ 2009-03-10 21:12 ` Tony Lindgren
  2009-03-10 21:13 ` [PATCH 10/12] ARM: OMAP3: mmc-twl4030 allow arbitrary slot names Tony Lindgren
                   ` (3 subsequent siblings)
  12 siblings, 0 replies; 49+ messages in thread
From: Tony Lindgren @ 2009-03-10 21:12 UTC (permalink / raw)
  To: linux-arm-kernel; +Cc: David Brownell, linux-omap, Adrian Hunter

From: Adrian Hunter <adrian.hunter@nokia.com>

Allow a cover switch to be used to cause a rescan of the
MMC slot.

Signed-off-by: Adrian Hunter <adrian.hunter@nokia.com>
Acked-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Tony Lindgren <tony@atomide.com>
---
 arch/arm/mach-omap2/mmc-twl4030.c |   13 ++++++++++++-
 arch/arm/mach-omap2/mmc-twl4030.h |    1 +
 2 files changed, 13 insertions(+), 1 deletions(-)

diff --git a/arch/arm/mach-omap2/mmc-twl4030.c b/arch/arm/mach-omap2/mmc-twl4030.c
index 2becaf3..9f53d22 100644
--- a/arch/arm/mach-omap2/mmc-twl4030.c
+++ b/arch/arm/mach-omap2/mmc-twl4030.c
@@ -100,6 +100,14 @@ static int twl_mmc_get_ro(struct device *dev, int slot)
 	return gpio_get_value_cansleep(mmc->slots[0].gpio_wp);
 }
 
+static int twl_mmc_get_cover_state(struct device *dev, int slot)
+{
+	struct omap_mmc_platform_data *mmc = dev->platform_data;
+
+	/* NOTE: assumes card detect signal is active-low */
+	return !gpio_get_value_cansleep(mmc->slots[0].switch_pin);
+}
+
 /*
  * MMC Slot Initialization.
  */
@@ -410,7 +418,10 @@ void __init twl4030_mmc_init(struct twl4030_hsmmc_info *controllers)
 
 			mmc->slots[0].switch_pin = c->gpio_cd;
 			mmc->slots[0].card_detect_irq = gpio_to_irq(c->gpio_cd);
-			mmc->slots[0].card_detect = twl_mmc_card_detect;
+			if (c->cover_only)
+				mmc->slots[0].get_cover_state = twl_mmc_get_cover_state;
+			else
+				mmc->slots[0].card_detect = twl_mmc_card_detect;
 		} else
 			mmc->slots[0].switch_pin = -EINVAL;
 
diff --git a/arch/arm/mach-omap2/mmc-twl4030.h b/arch/arm/mach-omap2/mmc-twl4030.h
index 21d3572..0aa1686 100644
--- a/arch/arm/mach-omap2/mmc-twl4030.h
+++ b/arch/arm/mach-omap2/mmc-twl4030.h
@@ -11,6 +11,7 @@ struct twl4030_hsmmc_info {
 	u8	wires;		/* 1/4/8 wires */
 	bool	transceiver;	/* MMC-2 option */
 	bool	ext_clock;	/* use external pin for input clock */
+	bool	cover_only;	/* No card detect - just cover switch */
 	int	gpio_cd;	/* or -EINVAL */
 	int	gpio_wp;	/* or -EINVAL */
 	struct device *dev;	/* returned: pointer to mmc adapter */


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

* [PATCH 10/12] ARM: OMAP3: mmc-twl4030 allow arbitrary slot names
  2009-03-10 21:00 [PATCH 00/12] Omap3 updates for the merge window after 2.6.29 Tony Lindgren
                   ` (8 preceding siblings ...)
  2009-03-10 21:12 ` [PATCH 09/12] ARM: OMAP3: mmc-twl4030 add cover switch Tony Lindgren
@ 2009-03-10 21:13 ` Tony Lindgren
  2009-03-15 16:08   ` Russell King - ARM Linux
  2009-03-10 21:15 ` [PATCH 11/12] ARM: OMAP3: Add base address definitions and resources for OMAP 3 IS Tony Lindgren
                   ` (2 subsequent siblings)
  12 siblings, 1 reply; 49+ messages in thread
From: Tony Lindgren @ 2009-03-10 21:13 UTC (permalink / raw)
  To: linux-arm-kernel; +Cc: David Brownell, linux-omap, Adrian Hunter

From: Adrian Hunter <adrian.hunter@nokia.com>

Signed-off-by: Adrian Hunter <adrian.hunter@nokia.com>
Acked-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Tony Lindgren <tony@atomide.com>
---
 arch/arm/mach-omap2/mmc-twl4030.c |    5 ++++-
 arch/arm/mach-omap2/mmc-twl4030.h |    1 +
 2 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/arch/arm/mach-omap2/mmc-twl4030.c b/arch/arm/mach-omap2/mmc-twl4030.c
index 9f53d22..9831b2b 100644
--- a/arch/arm/mach-omap2/mmc-twl4030.c
+++ b/arch/arm/mach-omap2/mmc-twl4030.c
@@ -402,7 +402,10 @@ void __init twl4030_mmc_init(struct twl4030_hsmmc_info *controllers)
 			return;
 		}
 
-		sprintf(twl->name, "mmc%islot%i", c->mmc, 1);
+		if (c->name)
+			strncpy(twl->name, c->name, HSMMC_NAME_LEN);
+		else
+			sprintf(twl->name, "mmc%islot%i", c->mmc, 1);
 		mmc->slots[0].name = twl->name;
 		mmc->nr_slots = 1;
 		mmc->slots[0].wires = c->wires;
diff --git a/arch/arm/mach-omap2/mmc-twl4030.h b/arch/arm/mach-omap2/mmc-twl4030.h
index 0aa1686..ea59e86 100644
--- a/arch/arm/mach-omap2/mmc-twl4030.h
+++ b/arch/arm/mach-omap2/mmc-twl4030.h
@@ -14,6 +14,7 @@ struct twl4030_hsmmc_info {
 	bool	cover_only;	/* No card detect - just cover switch */
 	int	gpio_cd;	/* or -EINVAL */
 	int	gpio_wp;	/* or -EINVAL */
+	char	*name;		/* or NULL for default */
 	struct device *dev;	/* returned: pointer to mmc adapter */
 };
 


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

* [PATCH 11/12] ARM: OMAP3: Add base address definitions and resources for OMAP 3 IS
  2009-03-10 21:00 [PATCH 00/12] Omap3 updates for the merge window after 2.6.29 Tony Lindgren
                   ` (9 preceding siblings ...)
  2009-03-10 21:13 ` [PATCH 10/12] ARM: OMAP3: mmc-twl4030 allow arbitrary slot names Tony Lindgren
@ 2009-03-10 21:15 ` Tony Lindgren
  2009-03-24  1:37   ` [PATCH 11/12] ARM: OMAP3: Add base address definitions and resources for OMAP 3 IS, v2 Tony Lindgren
  2009-03-10 21:16 ` [PATCH 12/12] ARM: OMAP3: MUSB initialization for omap hw Tony Lindgren
  2009-03-24  2:51 ` [PATCH 00/12] Omap3 updates for the merge window after 2.6.29 Tony Lindgren
  12 siblings, 1 reply; 49+ messages in thread
From: Tony Lindgren @ 2009-03-10 21:15 UTC (permalink / raw)
  To: linux-arm-kernel; +Cc: linux-omap, Sakari Ailus

This replaces earlier patch from Sergio Aguirre titled "[REVIEW PATCH 03/14]
OMAP34XX: CAM: Resources fixes".

Signed-off-by: Sakari Ailus <sakari.ailus@maxwell.research.nokia.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
---
 arch/arm/mach-omap2/devices.c              |  108 ++++++++++++++++++++++++++++
 arch/arm/plat-omap/include/mach/omap34xx.h |   27 +++++++
 2 files changed, 135 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/devices.c b/arch/arm/mach-omap2/devices.c
index ce03fa7..bf84305 100644
--- a/arch/arm/mach-omap2/devices.c
+++ b/arch/arm/mach-omap2/devices.c
@@ -28,6 +28,113 @@
 #include <mach/eac.h>
 #include <mach/mmc.h>
 
+#if defined(CONFIG_VIDEO_OMAP2) || defined(CONFIG_VIDEO_OMAP2_MODULE)
+
+static struct resource cam_resources[] = {
+	{
+		.start		= OMAP24XX_CAMERA_BASE,
+		.end		= OMAP24XX_CAMERA_BASE + 0xfff,
+		.flags		= IORESOURCE_MEM,
+	},
+	{
+		.start		= INT_24XX_CAM_IRQ,
+		.flags		= IORESOURCE_IRQ,
+	}
+};
+
+static struct platform_device omap_cam_device = {
+	.name		= "omap24xxcam",
+	.id		= -1,
+	.num_resources	= ARRAY_SIZE(cam_resources),
+	.resource	= cam_resources,
+};
+
+static inline void omap_init_camera(void)
+{
+	platform_device_register(&omap_cam_device);
+}
+
+#elif defined(CONFIG_VIDEO_OMAP3) || defined(CONFIG_VIDEO_OMAP3_MODULE)
+
+static struct resource omap3isp_resources[] = {
+	{
+		.start		= OMAP3430_ISP_BASE,
+		.end		= OMAP3430_ISP_END,
+		.flags		= IORESOURCE_MEM,
+	},
+	{
+		.start		= OMAP3430_ISP_CBUFF_BASE,
+		.end		= OMAP3430_ISP_CBUFF_END,
+		.flags		= IORESOURCE_MEM,
+	},
+	{
+		.start		= OMAP3430_ISP_CCP2_BASE,
+		.end		= OMAP3430_ISP_CCP2_END,
+		.flags		= IORESOURCE_MEM,
+	},
+	{
+		.start		= OMAP3430_ISP_CCDC_BASE,
+		.end		= OMAP3430_ISP_CCDC_END,
+		.flags		= IORESOURCE_MEM,
+	},
+	{
+		.start		= OMAP3430_ISP_HIST_BASE,
+		.end		= OMAP3430_ISP_HIST_END,
+		.flags		= IORESOURCE_MEM,
+	},
+	{
+		.start		= OMAP3430_ISP_H3A_BASE,
+		.end		= OMAP3430_ISP_H3A_END,
+		.flags		= IORESOURCE_MEM,
+	},
+	{
+		.start		= OMAP3430_ISP_PREV_BASE,
+		.end		= OMAP3430_ISP_PREV_END,
+		.flags		= IORESOURCE_MEM,
+	},
+	{
+		.start		= OMAP3430_ISP_RESZ_BASE,
+		.end		= OMAP3430_ISP_RESZ_END,
+		.flags		= IORESOURCE_MEM,
+	},
+	{
+		.start		= OMAP3430_ISP_SBL_BASE,
+		.end		= OMAP3430_ISP_SBL_END,
+		.flags		= IORESOURCE_MEM,
+	},
+	{
+		.start		= OMAP3430_ISP_CSI2A_BASE,
+		.end		= OMAP3430_ISP_CSI2A_END,
+		.flags		= IORESOURCE_MEM,
+	},
+	{
+		.start		= OMAP3430_ISP_CSI2PHY_BASE,
+		.end		= OMAP3430_ISP_CSI2PHY_END,
+		.flags		= IORESOURCE_MEM,
+	},
+	{
+		.start		= INT_34XX_CAM_IRQ,
+		.flags		= IORESOURCE_IRQ,
+	}
+};
+
+static struct platform_device omap3isp_device = {
+	.name		= "omap3isp",
+	.id		= -1,
+	.num_resources	= ARRAY_SIZE(omap3isp_resources),
+	.resource	= omap3isp_resources,
+};
+
+static inline void omap_init_camera(void)
+{
+	platform_device_register(&omap3isp_device);
+}
+#else
+static inline void omap_init_camera(void)
+{
+}
+#endif
+
 #if defined(CONFIG_OMAP_DSP) || defined(CONFIG_OMAP_DSP_MODULE)
 #define OMAP2_MBOX_BASE		IO_ADDRESS(OMAP24XX_MAILBOX_BASE)
 
@@ -506,6 +613,7 @@ static int __init omap2_init_devices(void)
 	 * in alphabetical order so they're easier to sort through.
 	 */
 	omap_hsmmc_reset();
+	omap_init_camera();
 	omap_init_mbox();
 	omap_init_mcspi();
 	omap_hdq_init();
diff --git a/arch/arm/plat-omap/include/mach/omap34xx.h b/arch/arm/plat-omap/include/mach/omap34xx.h
index 8e0479f..e50c98f 100644
--- a/arch/arm/plat-omap/include/mach/omap34xx.h
+++ b/arch/arm/plat-omap/include/mach/omap34xx.h
@@ -49,6 +49,33 @@
 #define OMAP343X_CTRL_BASE	OMAP343X_SCM_BASE
 
 #define OMAP34XX_IC_BASE	0x48200000
+
+#define OMAP3430_ISP_BASE		(L4_34XX_BASE + 0xBC000)
+#define OMAP3430_ISP_CBUFF_BASE		(OMAP3430_ISP_BASE + 0x0100)
+#define OMAP3430_ISP_CCP2_BASE		(OMAP3430_ISP_BASE + 0x0400)
+#define OMAP3430_ISP_CCDC_BASE		(OMAP3430_ISP_BASE + 0x0600)
+#define OMAP3430_ISP_HIST_BASE		(OMAP3430_ISP_BASE + 0x0A00)
+#define OMAP3430_ISP_H3A_BASE		(OMAP3430_ISP_BASE + 0x0C00)
+#define OMAP3430_ISP_PREV_BASE		(OMAP3430_ISP_BASE + 0x0E00)
+#define OMAP3430_ISP_RESZ_BASE		(OMAP3430_ISP_BASE + 0x1000)
+#define OMAP3430_ISP_SBL_BASE		(OMAP3430_ISP_BASE + 0x1200)
+#define OMAP3430_ISP_MMU_BASE		(OMAP3430_ISP_BASE + 0x1400)
+#define OMAP3430_ISP_CSI2A_BASE		(OMAP3430_ISP_BASE + 0x1800)
+#define OMAP3430_ISP_CSI2PHY_BASE	(OMAP3430_ISP_BASE + 0x1970)
+
+#define OMAP3430_ISP_END		(OMAP3430_ISP_BASE         + 0x06F)
+#define OMAP3430_ISP_CBUFF_END		(OMAP3430_ISP_CBUFF_BASE   + 0x077)
+#define OMAP3430_ISP_CCP2_END		(OMAP3430_ISP_CCP2_BASE    + 0x1EF)
+#define OMAP3430_ISP_CCDC_END		(OMAP3430_ISP_CCDC_BASE    + 0x0A7)
+#define OMAP3430_ISP_HIST_END		(OMAP3430_ISP_HIST_BASE    + 0x047)
+#define OMAP3430_ISP_H3A_END		(OMAP3430_ISP_H3A_BASE     + 0x05F)
+#define OMAP3430_ISP_PREV_END		(OMAP3430_ISP_PREV_BASE    + 0x09F)
+#define OMAP3430_ISP_RESZ_END		(OMAP3430_ISP_RESZ_BASE    + 0x0AB)
+#define OMAP3430_ISP_SBL_END		(OMAP3430_ISP_SBL_BASE     + 0x0FB)
+#define OMAP3430_ISP_MMU_END		(OMAP3430_ISP_MMU_BASE     + 0x06F)
+#define OMAP3430_ISP_CSI2A_END		(OMAP3430_ISP_CSI2A_BASE   + 0x16F)
+#define OMAP3430_ISP_CSI2PHY_END	(OMAP3430_ISP_CSI2PHY_BASE + 0x007)
+
 #define OMAP34XX_IVA_INTC_BASE	0x40000000
 #define OMAP34XX_HSUSB_OTG_BASE	(L4_34XX_BASE + 0xAB000)
 #define OMAP34XX_HSUSB_HOST_BASE	(L4_34XX_BASE + 0x64000)


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

* [PATCH 12/12] ARM: OMAP3: MUSB initialization for omap hw
  2009-03-10 21:00 [PATCH 00/12] Omap3 updates for the merge window after 2.6.29 Tony Lindgren
                   ` (10 preceding siblings ...)
  2009-03-10 21:15 ` [PATCH 11/12] ARM: OMAP3: Add base address definitions and resources for OMAP 3 IS Tony Lindgren
@ 2009-03-10 21:16 ` Tony Lindgren
  2009-03-15 16:14   ` Russell King - ARM Linux
  2009-03-24  2:51 ` [PATCH 00/12] Omap3 updates for the merge window after 2.6.29 Tony Lindgren
  12 siblings, 1 reply; 49+ messages in thread
From: Tony Lindgren @ 2009-03-10 21:16 UTC (permalink / raw)
  To: linux-arm-kernel; +Cc: Ajay Kumar Gupta, Felipe Balbi, linux-omap

From: Felipe Balbi <felipe.balbi@nokia.com>

Create a generic board-file for initializing usb
on omap2430 and omap3 boards.

Patch modified by Tony to build the module based on
CONFIG_USB_MUSB_SOC. Also merged in a patch adding
the nop xceiv from Ajay Kumar Gupta <ajay.gupta@ti.com>.

Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
---
 arch/arm/mach-omap2/Makefile             |    2 
 arch/arm/mach-omap2/board-2430sdp.c      |    2 
 arch/arm/mach-omap2/board-ldp.c          |    2 
 arch/arm/mach-omap2/board-omap3beagle.c  |    2 
 arch/arm/mach-omap2/board-omap3pandora.c |    2 
 arch/arm/mach-omap2/board-overo.c        |    2 
 arch/arm/mach-omap2/usb-musb.c           |  185 ++++++++++++++++++++++++++++++
 arch/arm/plat-omap/include/mach/usb.h    |    8 +
 8 files changed, 205 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/mach-omap2/usb-musb.c

diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
index bbd12bc..53403a0 100644
--- a/arch/arm/mach-omap2/Makefile
+++ b/arch/arm/mach-omap2/Makefile
@@ -39,3 +39,5 @@ obj-$(CONFIG_MACH_OVERO)		+= board-overo.o \
 obj-$(CONFIG_MACH_OMAP3_PANDORA)	+= board-omap3pandora.o \
 					   mmc-twl4030.o
 
+# Platform specific device init code
+obj-$(CONFIG_USB_MUSB_SOC)		+= usb-musb.o
diff --git a/arch/arm/mach-omap2/board-2430sdp.c b/arch/arm/mach-omap2/board-2430sdp.c
index 83fa372..9619e25 100644
--- a/arch/arm/mach-omap2/board-2430sdp.c
+++ b/arch/arm/mach-omap2/board-2430sdp.c
@@ -35,6 +35,7 @@
 #include <mach/board.h>
 #include <mach/common.h>
 #include <mach/gpmc.h>
+#include <mach/usb.h>
 
 #include "mmc-twl4030.h"
 
@@ -251,6 +252,7 @@ static void __init omap_2430sdp_init(void)
 	omap_board_config_size = ARRAY_SIZE(sdp2430_config);
 	omap_serial_init();
 	twl4030_mmc_init(mmc);
+	usb_musb_init();
 }
 
 static void __init omap_2430sdp_map_io(void)
diff --git a/arch/arm/mach-omap2/board-ldp.c b/arch/arm/mach-omap2/board-ldp.c
index f6a1345..b7dbc6c 100644
--- a/arch/arm/mach-omap2/board-ldp.c
+++ b/arch/arm/mach-omap2/board-ldp.c
@@ -38,6 +38,7 @@
 #include <asm/io.h>
 #include <asm/delay.h>
 #include <mach/control.h>
+#include <mach/usb.h>
 
 #include "mmc-twl4030.h"
 
@@ -162,6 +163,7 @@ static void __init omap_ldp_init(void)
 	omap_board_config_size = ARRAY_SIZE(ldp_config);
 	omap_serial_init();
 	twl4030_mmc_init(mmc);
+	usb_musb_init();
 }
 
 static void __init omap_ldp_map_io(void)
diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c
index e3c8628..2f3d821 100644
--- a/arch/arm/mach-omap2/board-omap3beagle.c
+++ b/arch/arm/mach-omap2/board-omap3beagle.c
@@ -41,6 +41,7 @@
 #include <mach/gpmc.h>
 #include <mach/nand.h>
 #include <mach/mux.h>
+#include <mach/usb.h>
 
 #include "mmc-twl4030.h"
 
@@ -313,6 +314,7 @@ static void __init omap3_beagle_init(void)
 	/* REVISIT leave DVI powered down until it's needed ... */
 	gpio_direction_output(170, true);
 
+	usb_musb_init();
 	omap3beagle_flash_init();
 }
 
diff --git a/arch/arm/mach-omap2/board-omap3pandora.c b/arch/arm/mach-omap2/board-omap3pandora.c
index 6e17180..16e2128 100644
--- a/arch/arm/mach-omap2/board-omap3pandora.c
+++ b/arch/arm/mach-omap2/board-omap3pandora.c
@@ -34,6 +34,7 @@
 #include <mach/gpio.h>
 #include <mach/hardware.h>
 #include <mach/mcspi.h>
+#include <mach/usb.h>
 
 #include "mmc-twl4030.h"
 
@@ -200,6 +201,7 @@ static void __init omap3pandora_init(void)
 	spi_register_board_info(omap3pandora_spi_board_info,
 			ARRAY_SIZE(omap3pandora_spi_board_info));
 	omap3pandora_ads7846_init();
+	usb_musb_init();
 }
 
 static void __init omap3pandora_map_io(void)
diff --git a/arch/arm/mach-omap2/board-overo.c b/arch/arm/mach-omap2/board-overo.c
index 61f8e23..d785aa8 100644
--- a/arch/arm/mach-omap2/board-overo.c
+++ b/arch/arm/mach-omap2/board-overo.c
@@ -44,6 +44,7 @@
 #include <mach/gpmc.h>
 #include <mach/hardware.h>
 #include <mach/nand.h>
+#include <mach/usb.h>
 
 #include "mmc-twl4030.h"
 
@@ -223,6 +224,7 @@ static void __init overo_init(void)
 	omap_serial_init();
 	twl4030_mmc_init(mmc);
 	overo_flash_init();
+	usb_musb_init();
 
 	if ((gpio_request(OVERO_GPIO_W2W_NRESET,
 			  "OVERO_GPIO_W2W_NRESET") == 0) &&
diff --git a/arch/arm/mach-omap2/usb-musb.c b/arch/arm/mach-omap2/usb-musb.c
new file mode 100644
index 0000000..927c2d9
--- /dev/null
+++ b/arch/arm/mach-omap2/usb-musb.c
@@ -0,0 +1,185 @@
+/*
+ * linux/arch/arm/mach-omap2/usb-musb.c
+ *
+ * This file will contain the board specific details for the
+ * MENTOR USB OTG controller on OMAP3430
+ *
+ * Copyright (C) 2007-2008 Texas Instruments
+ * Copyright (C) 2008 Nokia Corporation
+ * Author: Vikram Pandita
+ *
+ * Generalization by:
+ * Felipe Balbi <felipe.balbi@nokia.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#include <linux/types.h>
+#include <linux/errno.h>
+#include <linux/delay.h>
+#include <linux/platform_device.h>
+#include <linux/clk.h>
+#include <linux/dma-mapping.h>
+#include <linux/io.h>
+
+#include <linux/usb/musb.h>
+
+#include <mach/hardware.h>
+#include <mach/irqs.h>
+#include <mach/pm.h>
+#include <mach/mux.h>
+#include <mach/usb.h>
+
+static struct resource musb_resources[] = {
+	[0] = { /* start and end set dynamically */
+		.flags	= IORESOURCE_MEM,
+	},
+	[1] = {	/* general IRQ */
+		.start	= INT_243X_HS_USB_MC,
+		.flags	= IORESOURCE_IRQ,
+	},
+	[2] = {	/* DMA IRQ */
+		.start	= INT_243X_HS_USB_DMA,
+		.flags	= IORESOURCE_IRQ,
+	},
+};
+
+static int clk_on;
+
+static int musb_set_clock(struct clk *clk, int state)
+{
+	if (state) {
+		if (clk_on > 0)
+			return -ENODEV;
+
+		clk_enable(clk);
+		clk_on = 1;
+	} else {
+		if (clk_on == 0)
+			return -ENODEV;
+
+		clk_disable(clk);
+		clk_on = 0;
+	}
+
+	return 0;
+}
+
+static struct musb_hdrc_eps_bits musb_eps[] = {
+	{	"ep1_tx", 10,	},
+	{	"ep1_rx", 10,	},
+	{	"ep2_tx", 9,	},
+	{	"ep2_rx", 9,	},
+	{	"ep3_tx", 3,	},
+	{	"ep3_rx", 3,	},
+	{	"ep4_tx", 3,	},
+	{	"ep4_rx", 3,	},
+	{	"ep5_tx", 3,	},
+	{	"ep5_rx", 3,	},
+	{	"ep6_tx", 3,	},
+	{	"ep6_rx", 3,	},
+	{	"ep7_tx", 3,	},
+	{	"ep7_rx", 3,	},
+	{	"ep8_tx", 2,	},
+	{	"ep8_rx", 2,	},
+	{	"ep9_tx", 2,	},
+	{	"ep9_rx", 2,	},
+	{	"ep10_tx", 2,	},
+	{	"ep10_rx", 2,	},
+	{	"ep11_tx", 2,	},
+	{	"ep11_rx", 2,	},
+	{	"ep12_tx", 2,	},
+	{	"ep12_rx", 2,	},
+	{	"ep13_tx", 2,	},
+	{	"ep13_rx", 2,	},
+	{	"ep14_tx", 2,	},
+	{	"ep14_rx", 2,	},
+	{	"ep15_tx", 2,	},
+	{	"ep15_rx", 2,	},
+};
+
+static struct musb_hdrc_config musb_config = {
+	.multipoint	= 1,
+	.dyn_fifo	= 1,
+	.soft_con	= 1,
+	.dma		= 1,
+	.num_eps	= 16,
+	.dma_channels	= 7,
+	.dma_req_chan	= (1 << 0) | (1 << 1) | (1 << 2) | (1 << 3),
+	.ram_bits	= 12,
+	.eps_bits	= musb_eps,
+};
+
+static struct musb_hdrc_platform_data musb_plat = {
+#ifdef CONFIG_USB_MUSB_OTG
+	.mode		= MUSB_OTG,
+#elif defined(CONFIG_USB_MUSB_HDRC_HCD)
+	.mode		= MUSB_HOST,
+#elif defined(CONFIG_USB_GADGET_MUSB_HDRC)
+	.mode		= MUSB_PERIPHERAL,
+#endif
+	/* .clock is set dynamically */
+	.set_clock	= musb_set_clock,
+	.config		= &musb_config,
+
+	/* REVISIT charge pump on TWL4030 can supply up to
+	 * 100 mA ... but this value is board-specific, like
+	 * "mode", and should be passed to usb_musb_init().
+	 */
+	.power		= 50,			/* up to 100 mA */
+};
+
+static u64 musb_dmamask = DMA_32BIT_MASK;
+
+static struct platform_device musb_device = {
+	.name		= "musb_hdrc",
+	.id		= -1,
+	.dev = {
+		.dma_mask		= &musb_dmamask,
+		.coherent_dma_mask	= DMA_32BIT_MASK,
+		.platform_data		= &musb_plat,
+	},
+	.num_resources	= ARRAY_SIZE(musb_resources),
+	.resource	= musb_resources,
+};
+
+#ifdef CONFIG_NOP_USB_XCEIV
+static u64 nop_xceiv_dmamask = DMA_32BIT_MASK;
+
+static struct platform_device nop_xceiv_device = {
+	.name		= "nop_usb_xceiv",
+	.id		= -1,
+	.dev = {
+		.dma_mask		= &nop_xceiv_dmamask,
+		.coherent_dma_mask	= DMA_32BIT_MASK,
+		.platform_data		= NULL,
+	},
+};
+#endif
+
+void __init usb_musb_init(void)
+{
+	if (cpu_is_omap243x()) {
+		musb_resources[0].start = OMAP243X_HS_BASE;
+		musb_plat.clock = "usbhs_ick";
+	} else {
+		musb_resources[0].start = OMAP34XX_HSUSB_OTG_BASE;
+		musb_plat.clock = "hsotgusb_ick";
+	}
+
+	musb_resources[0].end = musb_resources[0].start + SZ_8K - 1;
+
+#ifdef CONFIG_NOP_USB_XCEIV
+	if (platform_device_register(&nop_xceiv_device) < 0) {
+		printk(KERN_ERR "Unable to register NOP-XCEIV device\n");
+		return;
+	}
+#endif
+
+	if (platform_device_register(&musb_device) < 0) {
+		printk(KERN_ERR "Unable to register HS-USB (MUSB) device\n");
+		return;
+	}
+}
diff --git a/arch/arm/plat-omap/include/mach/usb.h b/arch/arm/plat-omap/include/mach/usb.h
index e033e51..69f0cee 100644
--- a/arch/arm/plat-omap/include/mach/usb.h
+++ b/arch/arm/plat-omap/include/mach/usb.h
@@ -27,6 +27,14 @@
 #define UDC_BASE			OMAP2_UDC_BASE
 #define OMAP_OHCI_BASE			OMAP2_OHCI_BASE
 
+#ifdef CONFIG_USB_MUSB_SOC
+extern void usb_musb_init(void);
+#else
+static inline void usb_musb_init(void)
+{
+}
+#endif
+
 #endif
 
 void omap_usb_init(struct omap_usb_config *pdata);


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

* Re: [PATCH 02/12] ARM: OMAP3: Store reboot mode in scratchpad on OMAP34xx
  2009-03-10 21:03 ` [PATCH 02/12] ARM: OMAP3: Store reboot mode in scratchpad on OMAP34xx Tony Lindgren
@ 2009-03-15 15:51   ` Russell King - ARM Linux
  2009-03-16 16:07     ` Juha Yrjola
  2009-03-24  1:11   ` Tony Lindgren
  1 sibling, 1 reply; 49+ messages in thread
From: Russell King - ARM Linux @ 2009-03-15 15:51 UTC (permalink / raw)
  To: Tony Lindgren; +Cc: linux-arm-kernel, Juha Yrjola, Kevin Hilman, linux-omap

On Tue, Mar 10, 2009 at 02:03:33PM -0700, Tony Lindgren wrote:
> From: Juha Yrjola <juha.yrjola@solidboot.com>
> 
> The reboot mode can be communicated to a bootloader (or the
> kernel itself) with a scratchpad register. This functionality
> is especially useful, if userspace is allowed to change
> the reboot mode.

The reason for this being...

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

* Re: [PATCH 04/12] ARM: OMAP3: mmc-twl4030 fix name buffer length
  2009-03-10 21:06 ` [PATCH 04/12] ARM: OMAP3: mmc-twl4030 fix name buffer length Tony Lindgren
@ 2009-03-15 16:00   ` Russell King - ARM Linux
  2009-03-16 10:04     ` Adrian Hunter
  0 siblings, 1 reply; 49+ messages in thread
From: Russell King - ARM Linux @ 2009-03-15 16:00 UTC (permalink / raw)
  To: Tony Lindgren; +Cc: linux-arm-kernel, David Brownell, linux-omap, Adrian Hunter

On Tue, Mar 10, 2009 at 02:06:08PM -0700, Tony Lindgren wrote:
> From: Adrian Hunter <adrian.hunter@nokia.com>
> 
> Add 1 to buffer length for null terminator.

Yes, and:

                sprintf(twl->name, "mmc%islot%i", c->mmc, 1);

should be snprintf to ensure that it can't overflow the buffer.

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

* Re: [PATCH 06/12] ARM: OMAP3: mmc-twl4030 init passes device nodes back
  2009-03-10 21:08 ` [PATCH 06/12] ARM: OMAP3: mmc-twl4030 init passes device nodes back Tony Lindgren
@ 2009-03-15 16:02   ` Russell King - ARM Linux
  2009-03-16 17:44     ` Tony Lindgren
  0 siblings, 1 reply; 49+ messages in thread
From: Russell King - ARM Linux @ 2009-03-15 16:02 UTC (permalink / raw)
  To: Tony Lindgren; +Cc: linux-arm-kernel, David Brownell, linux-omap

On Tue, Mar 10, 2009 at 02:08:43PM -0700, Tony Lindgren wrote:
> From: David Brownell <dbrownell@users.sourceforge.net>
> 
> When setting up HSMMC devices, pass pass the device nodes back so

Double pass?

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

* Re: [PATCH 07/12] ARM: OMAP3: mmc-twl4030 add MMC3 support
  2009-03-10 21:10 ` [PATCH 07/12] ARM: OMAP3: mmc-twl4030 add MMC3 support Tony Lindgren
@ 2009-03-15 16:04   ` Russell King - ARM Linux
  2009-03-15 17:27     ` Grazvydas Ignotas
  0 siblings, 1 reply; 49+ messages in thread
From: Russell King - ARM Linux @ 2009-03-15 16:04 UTC (permalink / raw)
  To: Tony Lindgren; +Cc: linux-arm-kernel, linux-omap, Grazvydas Ignotas

On Tue, Mar 10, 2009 at 02:10:00PM -0700, Tony Lindgren wrote:
> ... Array size for hsmmc[] is specified
> because hsmmc[2].name is needed for MMC3 name.

I see nothing in this patch which requires that.

> diff --git a/arch/arm/mach-omap2/mmc-twl4030.c b/arch/arm/mach-omap2/mmc-twl4030.c
> index 6399874..042035c 100644
> --- a/arch/arm/mach-omap2/mmc-twl4030.c
> +++ b/arch/arm/mach-omap2/mmc-twl4030.c
> @@ -62,7 +62,7 @@ static struct twl_mmc_controller {
>  	u8		twl_vmmc_dev_grp;
>  	u8		twl_mmc_dedicated;
>  	char		name[HSMMC_NAME_LEN + 1];
> -} hsmmc[] = {
> +} hsmmc[OMAP34XX_NR_MMC] = {

so this change looks like it can be omitted.

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

* Re: [PATCH 10/12] ARM: OMAP3: mmc-twl4030 allow arbitrary slot names
  2009-03-10 21:13 ` [PATCH 10/12] ARM: OMAP3: mmc-twl4030 allow arbitrary slot names Tony Lindgren
@ 2009-03-15 16:08   ` Russell King - ARM Linux
  2009-03-16 10:04     ` Adrian Hunter
  2009-03-16 10:05     ` Adrian Hunter
  0 siblings, 2 replies; 49+ messages in thread
From: Russell King - ARM Linux @ 2009-03-15 16:08 UTC (permalink / raw)
  To: Tony Lindgren; +Cc: linux-arm-kernel, David Brownell, linux-omap, Adrian Hunter

On Tue, Mar 10, 2009 at 02:13:52PM -0700, Tony Lindgren wrote:
> From: Adrian Hunter <adrian.hunter@nokia.com>
> 
> Signed-off-by: Adrian Hunter <adrian.hunter@nokia.com>
> Acked-by: David Brownell <dbrownell@users.sourceforge.net>
> Signed-off-by: Tony Lindgren <tony@atomide.com>
> ---
>  arch/arm/mach-omap2/mmc-twl4030.c |    5 ++++-
>  arch/arm/mach-omap2/mmc-twl4030.h |    1 +
>  2 files changed, 5 insertions(+), 1 deletions(-)
> 
> diff --git a/arch/arm/mach-omap2/mmc-twl4030.c b/arch/arm/mach-omap2/mmc-twl4030.c
> index 9f53d22..9831b2b 100644
> --- a/arch/arm/mach-omap2/mmc-twl4030.c
> +++ b/arch/arm/mach-omap2/mmc-twl4030.c
> @@ -402,7 +402,10 @@ void __init twl4030_mmc_init(struct twl4030_hsmmc_info *controllers)
>  			return;
>  		}
>  
> -		sprintf(twl->name, "mmc%islot%i", c->mmc, 1);
> +		if (c->name)
> +			strncpy(twl->name, c->name, HSMMC_NAME_LEN);

Bug.  strncpy can result in a non-null terminated string, and it just so
happens that twl->name has been declared as being HSMMC_NAME_LEN+1 in size.

That's rather unsafe.  Using strlcpy() and sizeof(twl->name) instead will
ensure that no matter what happens to the size of the array declaration,
the code remains correct.

> diff --git a/arch/arm/mach-omap2/mmc-twl4030.h b/arch/arm/mach-omap2/mmc-twl4030.h
> index 0aa1686..ea59e86 100644
> --- a/arch/arm/mach-omap2/mmc-twl4030.h
> +++ b/arch/arm/mach-omap2/mmc-twl4030.h
> @@ -14,6 +14,7 @@ struct twl4030_hsmmc_info {
>  	bool	cover_only;	/* No card detect - just cover switch */
>  	int	gpio_cd;	/* or -EINVAL */
>  	int	gpio_wp;	/* or -EINVAL */
> +	char	*name;		/* or NULL for default */

const?

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

* Re: [PATCH 12/12] ARM: OMAP3: MUSB initialization for omap hw
  2009-03-10 21:16 ` [PATCH 12/12] ARM: OMAP3: MUSB initialization for omap hw Tony Lindgren
@ 2009-03-15 16:14   ` Russell King - ARM Linux
  2009-03-15 18:46     ` David Brownell
  2009-03-16 22:37     ` [PATCH 12/12] ARM: OMAP3: MUSB initialization for omap hw, v2 Tony Lindgren
  0 siblings, 2 replies; 49+ messages in thread
From: Russell King - ARM Linux @ 2009-03-15 16:14 UTC (permalink / raw)
  To: Tony Lindgren
  Cc: linux-arm-kernel, Ajay Kumar Gupta, Felipe Balbi, linux-omap

On Tue, Mar 10, 2009 at 02:16:28PM -0700, Tony Lindgren wrote:
> Patch modified by Tony to build the module based on
> CONFIG_USB_MUSB_SOC.

I don't see this.

> +# Platform specific device init code
> +obj-$(CONFIG_USB_MUSB_SOC)		+= usb-musb.o

So, if this can be a module, the file itself doesn't export any symbols
and doesn't have any module_init or module_exit functions.  So, if this
gets built as a module, it isn't useful.

> +void __init usb_musb_init(void)
> +{
> +	if (cpu_is_omap243x()) {
> +		musb_resources[0].start = OMAP243X_HS_BASE;
> +		musb_plat.clock = "usbhs_ick";

kill kill kill.

> +	} else {
> +		musb_resources[0].start = OMAP34XX_HSUSB_OTG_BASE;
> +		musb_plat.clock = "hsotgusb_ick";

kill kill kill.

clkdev removes the need for this sort of crap.

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

* Re: [PATCH 07/12] ARM: OMAP3: mmc-twl4030 add MMC3 support
  2009-03-15 16:04   ` Russell King - ARM Linux
@ 2009-03-15 17:27     ` Grazvydas Ignotas
  2009-03-15 17:40       ` Russell King - ARM Linux
  0 siblings, 1 reply; 49+ messages in thread
From: Grazvydas Ignotas @ 2009-03-15 17:27 UTC (permalink / raw)
  To: Russell King - ARM Linux; +Cc: Tony Lindgren, linux-arm-kernel, linux-omap

On Sun, Mar 15, 2009 at 6:04 PM, Russell King - ARM Linux
<linux@arm.linux.org.uk> wrote:
> On Tue, Mar 10, 2009 at 02:10:00PM -0700, Tony Lindgren wrote:
>> ... Array size for hsmmc[] is specified
>> because hsmmc[2].name is needed for MMC3 name.
>
> I see nothing in this patch which requires that.

Right, but there is already some code in twl4030_mmc_init() of mmc-twl4030.c:

  struct twl_mmc_controller *twl = hsmmc + c->mmc - 1;
<snip>
  sprintf(twl->name, "mmc%islot%i", c->mmc, 1);

.. which basically writes to hsmmc[2].name for MMC3.

>> diff --git a/arch/arm/mach-omap2/mmc-twl4030.c b/arch/arm/mach-omap2/mmc-twl4030.c
>> index 6399874..042035c 100644
>> --- a/arch/arm/mach-omap2/mmc-twl4030.c
>> +++ b/arch/arm/mach-omap2/mmc-twl4030.c
>> @@ -62,7 +62,7 @@ static struct twl_mmc_controller {
>>       u8              twl_vmmc_dev_grp;
>>       u8              twl_mmc_dedicated;
>>       char            name[HSMMC_NAME_LEN + 1];
>> -} hsmmc[] = {
>> +} hsmmc[OMAP34XX_NR_MMC] = {
>
> so this change looks like it can be omitted.

No, that would bring some painful memory corruption issues.
--
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] 49+ messages in thread

* Re: [PATCH 07/12] ARM: OMAP3: mmc-twl4030 add MMC3 support
  2009-03-15 17:27     ` Grazvydas Ignotas
@ 2009-03-15 17:40       ` Russell King - ARM Linux
  2009-03-16 17:56         ` [PATCH 07/12] ARM: OMAP3: mmc-twl4030 add MMC3 support, v2 Tony Lindgren
  0 siblings, 1 reply; 49+ messages in thread
From: Russell King - ARM Linux @ 2009-03-15 17:40 UTC (permalink / raw)
  To: Grazvydas Ignotas; +Cc: Tony Lindgren, linux-arm-kernel, linux-omap

On Sun, Mar 15, 2009 at 07:27:32PM +0200, Grazvydas Ignotas wrote:
> On Sun, Mar 15, 2009 at 6:04 PM, Russell King - ARM Linux
> <linux@arm.linux.org.uk> wrote:
> > On Tue, Mar 10, 2009 at 02:10:00PM -0700, Tony Lindgren wrote:
> >> ... Array size for hsmmc[] is specified
> >> because hsmmc[2].name is needed for MMC3 name.
> >
> > I see nothing in this patch which requires that.
> 
> Right, but there is already some code in twl4030_mmc_init() of mmc-twl4030.c:
> 
>   struct twl_mmc_controller *twl = hsmmc + c->mmc - 1;
> <snip>
>   sprintf(twl->name, "mmc%islot%i", c->mmc, 1);
> 
> .. which basically writes to hsmmc[2].name for MMC3.

So, it's nothing really to do with hsmmc[2].name being required, it's
more a case of needing to have the 3rd MMC interface included.  The
comment in the commit is *really* misleading.

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

* Re: [PATCH 12/12] ARM: OMAP3: MUSB initialization for omap hw
  2009-03-15 16:14   ` Russell King - ARM Linux
@ 2009-03-15 18:46     ` David Brownell
  2009-03-16 22:42       ` [PATCH] ARM: OMAP: Add name for musb clocks Tony Lindgren
  2009-03-16 22:37     ` [PATCH 12/12] ARM: OMAP3: MUSB initialization for omap hw, v2 Tony Lindgren
  1 sibling, 1 reply; 49+ messages in thread
From: David Brownell @ 2009-03-15 18:46 UTC (permalink / raw)
  To: Russell King - ARM Linux
  Cc: Tony Lindgren, linux-arm-kernel, Ajay Kumar Gupta, Felipe Balbi,
	linux-omap

On Sunday 15 March 2009, Russell King - ARM Linux wrote:
> clkdev removes the need for this sort of crap.

And once it, or its equivalent, works on all the platforms
supportihg the musb_hdrc driver, then the driver can switch.



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

* Re: [PATCH 10/12] ARM: OMAP3: mmc-twl4030 allow arbitrary slot names
  2009-03-15 16:08   ` Russell King - ARM Linux
@ 2009-03-16 10:04     ` Adrian Hunter
  2009-03-16 10:05     ` Adrian Hunter
  1 sibling, 0 replies; 49+ messages in thread
From: Adrian Hunter @ 2009-03-16 10:04 UTC (permalink / raw)
  To: Russell King - ARM Linux
  Cc: Tony Lindgren, linux-arm-kernel, David Brownell, linux-omap

Russell King - ARM Linux wrote:
> On Tue, Mar 10, 2009 at 02:13:52PM -0700, Tony Lindgren wrote:
>> From: Adrian Hunter <adrian.hunter@nokia.com>
>>
>> Signed-off-by: Adrian Hunter <adrian.hunter@nokia.com>
>> Acked-by: David Brownell <dbrownell@users.sourceforge.net>
>> Signed-off-by: Tony Lindgren <tony@atomide.com>
>> ---
>>  arch/arm/mach-omap2/mmc-twl4030.c |    5 ++++-
>>  arch/arm/mach-omap2/mmc-twl4030.h |    1 +
>>  2 files changed, 5 insertions(+), 1 deletions(-)
>>
>> diff --git a/arch/arm/mach-omap2/mmc-twl4030.c b/arch/arm/mach-omap2/mmc-twl4030.c
>> index 9f53d22..9831b2b 100644
>> --- a/arch/arm/mach-omap2/mmc-twl4030.c
>> +++ b/arch/arm/mach-omap2/mmc-twl4030.c
>> @@ -402,7 +402,10 @@ void __init twl4030_mmc_init(struct twl4030_hsmmc_info *controllers)
>>  			return;
>>  		}
>>  
>> -		sprintf(twl->name, "mmc%islot%i", c->mmc, 1);
>> +		if (c->name)
>> +			strncpy(twl->name, c->name, HSMMC_NAME_LEN);
> 
> Bug.  strncpy can result in a non-null terminated string, and it just so
> happens that twl->name has been declared as being HSMMC_NAME_LEN+1 in size.
> 

Well to be pedantic, it is not actually a "bug".  twl->name is zero-filled so HSMMC_NAME_LEN+1
guarantees that it is null terminated.

> That's rather unsafe.  Using strlcpy() and sizeof(twl->name) instead will
> ensure that no matter what happens to the size of the array declaration,
> the code remains correct.

Unless the programmer decides to make twl->name a pointer to allocated memory
- then sizeof(twl->name) is no good.  You could use ARRAY_SIZE(twl->name) which
(for gcc) includes a check that twl->name is an array.

> 
>> diff --git a/arch/arm/mach-omap2/mmc-twl4030.h b/arch/arm/mach-omap2/mmc-twl4030.h
>> index 0aa1686..ea59e86 100644
>> --- a/arch/arm/mach-omap2/mmc-twl4030.h
>> +++ b/arch/arm/mach-omap2/mmc-twl4030.h
>> @@ -14,6 +14,7 @@ struct twl4030_hsmmc_info {
>>  	bool	cover_only;	/* No card detect - just cover switch */
>>  	int	gpio_cd;	/* or -EINVAL */
>>  	int	gpio_wp;	/* or -EINVAL */
>> +	char	*name;		/* or NULL for default */
> 
> const?
> 

OK


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

* Re: [PATCH 04/12] ARM: OMAP3: mmc-twl4030 fix name buffer length
  2009-03-15 16:00   ` Russell King - ARM Linux
@ 2009-03-16 10:04     ` Adrian Hunter
  2009-03-16 10:14       ` Russell King - ARM Linux
  0 siblings, 1 reply; 49+ messages in thread
From: Adrian Hunter @ 2009-03-16 10:04 UTC (permalink / raw)
  To: Russell King - ARM Linux
  Cc: Tony Lindgren, linux-arm-kernel, David Brownell, linux-omap

Russell King - ARM Linux wrote:
> On Tue, Mar 10, 2009 at 02:06:08PM -0700, Tony Lindgren wrote:
>> From: Adrian Hunter <adrian.hunter@nokia.com>
>>
>> Add 1 to buffer length for null terminator.
> 
> Yes, and:
> 
>                 sprintf(twl->name, "mmc%islot%i", c->mmc, 1);
> 
> should be snprintf to ensure that it can't overflow the buffer.
> 

There are only 3 controllers and everyone numbers them 1, 2 and 3.

The change is the other patch.


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

* Re: [PATCH 10/12] ARM: OMAP3: mmc-twl4030 allow arbitrary slot names
  2009-03-15 16:08   ` Russell King - ARM Linux
  2009-03-16 10:04     ` Adrian Hunter
@ 2009-03-16 10:05     ` Adrian Hunter
  2009-03-16 10:16       ` Russell King - ARM Linux
  1 sibling, 1 reply; 49+ messages in thread
From: Adrian Hunter @ 2009-03-16 10:05 UTC (permalink / raw)
  To: Russell King - ARM Linux
  Cc: Tony Lindgren, linux-arm-kernel, David Brownell, linux-omap

>From 9b04f19a7e88f8877176c25845c38676ee3127c1 Mon Sep 17 00:00:00 2001
From: Adrian Hunter <adrian.hunter@nokia.com>
Date: Tue, 10 Mar 2009 22:13:52 +0100
Subject: [PATCH] ARM: OMAP3: mmc-twl4030 allow arbitrary slot names

Signed-off-by: Adrian Hunter <adrian.hunter@nokia.com>
---
 arch/arm/mach-omap2/mmc-twl4030.c |    6 +++++-
 arch/arm/mach-omap2/mmc-twl4030.h |    1 +
 2 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/arch/arm/mach-omap2/mmc-twl4030.c b/arch/arm/mach-omap2/mmc-twl4030.c
index a612a02..88b4bed 100644
--- a/arch/arm/mach-omap2/mmc-twl4030.c
+++ b/arch/arm/mach-omap2/mmc-twl4030.c
@@ -328,7 +328,11 @@ void __init twl4030_mmc_init(struct twl4030_hsmmc_info *controllers)
 			return;
 		}
 
-		sprintf(twl->name, "mmc%islot%i", c->mmc, 1);
+		if (c->name)
+			strlcpy(twl->name, c->name, ARRAY_SIZE(twl->name));
+		else
+			snprintf(twl->name, ARRAY_SIZE(twl->name),
+				 "mmc%islot%i", c->mmc, 1);
 		mmc->slots[0].name = twl->name;
 		mmc->nr_slots = 1;
 		mmc->slots[0].wires = c->wires;
diff --git a/arch/arm/mach-omap2/mmc-twl4030.h b/arch/arm/mach-omap2/mmc-twl4030.h
index 36e95a6..aa2d99b 100644
--- a/arch/arm/mach-omap2/mmc-twl4030.h
+++ b/arch/arm/mach-omap2/mmc-twl4030.h
@@ -14,6 +14,7 @@ struct twl4030_hsmmc_info {
 	bool	cover_only;	/* No card detect - just cover switch */
 	int	gpio_cd;	/* or -EINVAL */
 	int	gpio_wp;	/* or -EINVAL */
+	const char *name;	/* or NULL for default */
 	struct device *dev;	/* returned: pointer to mmc adapter */
 	int	ocr_mask;	/* temporary HACK */
 };
-- 
1.5.6.3

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

* Re: [PATCH 04/12] ARM: OMAP3: mmc-twl4030 fix name buffer length
  2009-03-16 10:04     ` Adrian Hunter
@ 2009-03-16 10:14       ` Russell King - ARM Linux
  2009-03-16 17:42         ` Tony Lindgren
  0 siblings, 1 reply; 49+ messages in thread
From: Russell King - ARM Linux @ 2009-03-16 10:14 UTC (permalink / raw)
  To: Adrian Hunter; +Cc: Tony Lindgren, linux-arm-kernel, David Brownell, linux-omap

On Mon, Mar 16, 2009 at 12:04:39PM +0200, Adrian Hunter wrote:
> Russell King - ARM Linux wrote:
>> On Tue, Mar 10, 2009 at 02:06:08PM -0700, Tony Lindgren wrote:
>>> From: Adrian Hunter <adrian.hunter@nokia.com>
>>>
>>> Add 1 to buffer length for null terminator.
>>
>> Yes, and:
>>
>>                 sprintf(twl->name, "mmc%islot%i", c->mmc, 1);
>>
>> should be snprintf to ensure that it can't overflow the buffer.
>>
>
> There are only 3 controllers and everyone numbers them 1, 2 and 3.

So?  You've already had a buffer overflow, so it's clearly time that this
code got fixed properly.

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

* Re: [PATCH 10/12] ARM: OMAP3: mmc-twl4030 allow arbitrary slot names
  2009-03-16 10:05     ` Adrian Hunter
@ 2009-03-16 10:16       ` Russell King - ARM Linux
  2009-03-16 18:01         ` Tony Lindgren
  0 siblings, 1 reply; 49+ messages in thread
From: Russell King - ARM Linux @ 2009-03-16 10:16 UTC (permalink / raw)
  To: Adrian Hunter; +Cc: Tony Lindgren, linux-arm-kernel, David Brownell, linux-omap

On Mon, Mar 16, 2009 at 12:05:07PM +0200, Adrian Hunter wrote:
>> From 9b04f19a7e88f8877176c25845c38676ee3127c1 Mon Sep 17 00:00:00 2001
> From: Adrian Hunter <adrian.hunter@nokia.com>
> Date: Tue, 10 Mar 2009 22:13:52 +0100
> Subject: [PATCH] ARM: OMAP3: mmc-twl4030 allow arbitrary slot names
>
> Signed-off-by: Adrian Hunter <adrian.hunter@nokia.com>
> ---
> arch/arm/mach-omap2/mmc-twl4030.c |    6 +++++-
> arch/arm/mach-omap2/mmc-twl4030.h |    1 +
> 2 files changed, 6 insertions(+), 1 deletions(-)
>
> diff --git a/arch/arm/mach-omap2/mmc-twl4030.c b/arch/arm/mach-omap2/mmc-twl4030.c
> index a612a02..88b4bed 100644
> --- a/arch/arm/mach-omap2/mmc-twl4030.c
> +++ b/arch/arm/mach-omap2/mmc-twl4030.c
> @@ -328,7 +328,11 @@ void __init twl4030_mmc_init(struct twl4030_hsmmc_info *controllers)
> 			return;
> 		}
>
> -		sprintf(twl->name, "mmc%islot%i", c->mmc, 1);
> +		if (c->name)
> +			strlcpy(twl->name, c->name, ARRAY_SIZE(twl->name));
> +		else
> +			snprintf(twl->name, ARRAY_SIZE(twl->name),
> +				 "mmc%islot%i", c->mmc, 1);

Good, except now we have a confusion over which patch does what...

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

* Re: [PATCH 02/12] ARM: OMAP3: Store reboot mode in scratchpad on OMAP34xx
  2009-03-15 15:51   ` Russell King - ARM Linux
@ 2009-03-16 16:07     ` Juha Yrjola
  2009-03-16 17:10       ` Russell King - ARM Linux
  0 siblings, 1 reply; 49+ messages in thread
From: Juha Yrjola @ 2009-03-16 16:07 UTC (permalink / raw)
  To: Russell King - ARM Linux
  Cc: Tony Lindgren, linux-arm-kernel, Kevin Hilman, linux-omap

Russell King - ARM Linux wrote:

>> The reboot mode can be communicated to a bootloader (or the
>> kernel itself) with a scratchpad register. This functionality
>> is especially useful, if userspace is allowed to change
>> the reboot mode.
> 
> The reason for this being...

If my other patch [1] is applied, we are able to let user space tell the 
bootloader which mode to boot to.

On the Nokia Linux mobile devices, flashing is done mostly by the 
bootloader. If a USB host is connected at bootup, we enter a USB loop 
with a certain timeout. The timeout is disabled when the first flashing 
command arrives. This is no problem for Linux, but some unluckier 
operating systems are not able to even load their drivers quickly enough.

Hence, we need a way to let the bootloader know when to safely disable 
the timeout (when the user explicitly wants to perform flashing, that is).

Cheers,
Juha

[1] http://article.gmane.org/gmane.linux.ports.arm.kernel/53837

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

* Re: [PATCH 02/12] ARM: OMAP3: Store reboot mode in scratchpad on OMAP34xx
  2009-03-16 16:07     ` Juha Yrjola
@ 2009-03-16 17:10       ` Russell King - ARM Linux
  2009-03-16 17:40         ` Juha Yrjola
  0 siblings, 1 reply; 49+ messages in thread
From: Russell King - ARM Linux @ 2009-03-16 17:10 UTC (permalink / raw)
  To: Juha Yrjola; +Cc: Tony Lindgren, linux-arm-kernel, Kevin Hilman, linux-omap

On Mon, Mar 16, 2009 at 06:07:07PM +0200, Juha Yrjola wrote:
> Russell King - ARM Linux wrote:
>>> The reboot mode can be communicated to a bootloader (or the
>>> kernel itself) with a scratchpad register. This functionality
>>> is especially useful, if userspace is allowed to change
>>> the reboot mode.
>>
>> The reason for this being...
>
> If my other patch [1] is applied, we are able to let user space tell the  
> bootloader which mode to boot to.
>
> On the Nokia Linux mobile devices, flashing is done mostly by the  
> bootloader. If a USB host is connected at bootup, we enter a USB loop  
> with a certain timeout. The timeout is disabled when the first flashing  
> command arrives. This is no problem for Linux, but some unluckier  
> operating systems are not able to even load their drivers quickly enough.
>
> Hence, we need a way to let the bootloader know when to safely disable  
> the timeout (when the user explicitly wants to perform flashing, that 
> is).

Right.  You are aware that there is already a mechanism for doing this
in the generic kernel (obviously not)?

sys_reboot() with LINUX_REBOOT_CMD_RESTART2 takes a string in addition
to the standard parameters.  This string is passed into machine_restart()
which we currently ignore.  If LINUX_REBOOT_CMD_RESTART is used, this
string is NULL.

We could change machine_restart() to pass this parameter through to
arm_pm_restart() and ultimately down to arch_reset().

That said, I don't see a version of reboot() which will pass a string
to the reboot() sysctl... there must be one around for the feature to
be present.

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

* Re: [PATCH 02/12] ARM: OMAP3: Store reboot mode in scratchpad on OMAP34xx
  2009-03-16 17:10       ` Russell King - ARM Linux
@ 2009-03-16 17:40         ` Juha Yrjola
  2009-03-16 22:21           ` Russell King - ARM Linux
  0 siblings, 1 reply; 49+ messages in thread
From: Juha Yrjola @ 2009-03-16 17:40 UTC (permalink / raw)
  To: Russell King - ARM Linux
  Cc: Tony Lindgren, linux-arm-kernel, Kevin Hilman, linux-omap

Russell King - ARM Linux wrote:

> Right.  You are aware that there is already a mechanism for doing this
> in the generic kernel (obviously not)?

I am. Unfortunately, glibc fails to support this mechanism, as you say. 
I didn't want to start making such intrusive changes for our trivial need.

> sys_reboot() with LINUX_REBOOT_CMD_RESTART2 takes a string in addition
> to the standard parameters.  This string is passed into machine_restart()
> which we currently ignore.  If LINUX_REBOOT_CMD_RESTART is used, this
> string is NULL.
> 
> We could change machine_restart() to pass this parameter through to
> arm_pm_restart() and ultimately down to arch_reset().

Sure. With RESTART2, I could've even used the reboot notifier chain with 
an OMAP3-specific driver to store the string.

Are you suggesting to get rid of reboot_mode altogether? If not, could 
we still have the sysfs mechanism? A one-character reboot_mode would be 
plenty enough for us.

Cheers,
Juha

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

* Re: [PATCH 04/12] ARM: OMAP3: mmc-twl4030 fix name buffer length
  2009-03-16 10:14       ` Russell King - ARM Linux
@ 2009-03-16 17:42         ` Tony Lindgren
  2009-03-16 22:22           ` Russell King - ARM Linux
  0 siblings, 1 reply; 49+ messages in thread
From: Tony Lindgren @ 2009-03-16 17:42 UTC (permalink / raw)
  To: Russell King - ARM Linux
  Cc: Adrian Hunter, linux-arm-kernel, David Brownell, linux-omap

[-- Attachment #1: Type: text/plain, Size: 758 bytes --]

* Russell King - ARM Linux <linux@arm.linux.org.uk> [090316 03:14]:
> On Mon, Mar 16, 2009 at 12:04:39PM +0200, Adrian Hunter wrote:
> > Russell King - ARM Linux wrote:
> >> On Tue, Mar 10, 2009 at 02:06:08PM -0700, Tony Lindgren wrote:
> >>> From: Adrian Hunter <adrian.hunter@nokia.com>
> >>>
> >>> Add 1 to buffer length for null terminator.
> >>
> >> Yes, and:
> >>
> >>                 sprintf(twl->name, "mmc%islot%i", c->mmc, 1);
> >>
> >> should be snprintf to ensure that it can't overflow the buffer.
> >>
> >
> > There are only 3 controllers and everyone numbers them 1, 2 and 3.
> 
> So?  You've already had a buffer overflow, so it's clearly time that this
> code got fixed properly.

Here's this one updated to also include the snprintf.

Tony

[-- Attachment #2: hsmmc-name-buf-len-v2.patch --]
[-- Type: text/x-diff, Size: 1243 bytes --]

>From 42a81558d840eb69204edb39169227547831dd1b Mon Sep 17 00:00:00 2001
From: Adrian Hunter <adrian.hunter@nokia.com>
Date: Mon, 16 Mar 2009 10:32:33 -0700
Subject: [PATCH] ARM: OMAP3: mmc-twl4030 fix name buffer length, v2

Add 1 to buffer length for null terminator and use snprintf.

Signed-off-by: Adrian Hunter <adrian.hunter@nokia.com>
Acked-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Tony Lindgren <tony@atomide.com>

diff --git a/arch/arm/mach-omap2/mmc-twl4030.c b/arch/arm/mach-omap2/mmc-twl4030.c
index 437f520..84cac87 100644
--- a/arch/arm/mach-omap2/mmc-twl4030.c
+++ b/arch/arm/mach-omap2/mmc-twl4030.c
@@ -59,7 +59,7 @@ static struct twl_mmc_controller {
 	struct omap_mmc_platform_data	*mmc;
 	u8		twl_vmmc_dev_grp;
 	u8		twl_mmc_dedicated;
-	char		name[HSMMC_NAME_LEN];
+	char		name[HSMMC_NAME_LEN + 1];
 } hsmmc[] = {
 	{
 		.twl_vmmc_dev_grp		= VMMC1_DEV_GRP,
@@ -349,7 +349,8 @@ void __init twl4030_mmc_init(struct twl4030_hsmmc_info *controllers)
 			return;
 		}
 
-		sprintf(twl->name, "mmc%islot%i", c->mmc, 1);
+		snprintf(twl->name, ARRAY_SIZE(twl->name), "mmc%islot%i",
+				c->mmc, 1);
 		mmc->slots[0].name = twl->name;
 		mmc->nr_slots = 1;
 		mmc->slots[0].ocr_mask = MMC_VDD_165_195 |

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

* Re: [PATCH 06/12] ARM: OMAP3: mmc-twl4030 init passes device nodes back
  2009-03-15 16:02   ` Russell King - ARM Linux
@ 2009-03-16 17:44     ` Tony Lindgren
  2009-03-16 22:22       ` Russell King - ARM Linux
  0 siblings, 1 reply; 49+ messages in thread
From: Tony Lindgren @ 2009-03-16 17:44 UTC (permalink / raw)
  To: Russell King - ARM Linux; +Cc: linux-arm-kernel, David Brownell, linux-omap

[-- Attachment #1: Type: text/plain, Size: 333 bytes --]

* Russell King - ARM Linux <linux@arm.linux.org.uk> [090315 09:02]:
> On Tue, Mar 10, 2009 at 02:08:43PM -0700, Tony Lindgren wrote:
> > From: David Brownell <dbrownell@users.sourceforge.net>
> > 
> > When setting up HSMMC devices, pass pass the device nodes back so
> 
> Double pass?

Here's this one updated to fix the typo.

Tony

[-- Attachment #2: hsmmc-pass-device-nodes-v2.patch --]
[-- Type: text/x-diff, Size: 2555 bytes --]

>From 587cf51b738e653751516809c161d5e325342023 Mon Sep 17 00:00:00 2001
From: David Brownell <dbrownell@users.sourceforge.net>
Date: Mon, 16 Mar 2009 10:40:39 -0700
Subject: [PATCH] ARM: OMAP3: mmc-twl4030 init passes device nodes back, v2

When setting up HSMMC devices, pass the device nodes back so
board code can linking them to their power supply regulators.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Tony Lindgren <tony@atomide.com>

diff --git a/arch/arm/mach-omap2/mmc-twl4030.c b/arch/arm/mach-omap2/mmc-twl4030.c
index df1539e..c67078d 100644
--- a/arch/arm/mach-omap2/mmc-twl4030.c
+++ b/arch/arm/mach-omap2/mmc-twl4030.c
@@ -17,6 +17,7 @@
 #include <linux/delay.h>
 #include <linux/gpio.h>
 #include <linux/i2c/twl4030.h>
+#include <linux/regulator/machine.h>
 
 #include <mach/hardware.h>
 #include <mach/control.h>
@@ -437,6 +438,15 @@ void __init twl4030_mmc_init(struct twl4030_hsmmc_info *controllers)
 	}
 
 	omap2_init_mmc(hsmmc_data, OMAP34XX_NR_MMC);
+
+	/* pass the device nodes back to board setup code */
+	for (c = controllers; c->mmc; c++) {
+		struct omap_mmc_platform_data *mmc = hsmmc_data[c->mmc - 1];
+
+		if (!c->mmc || c->mmc > nr_hsmmc)
+			continue;
+		c->dev = mmc->dev;
+	}
 }
 
 #endif
diff --git a/arch/arm/mach-omap2/mmc-twl4030.h b/arch/arm/mach-omap2/mmc-twl4030.h
index 380dde7..21d3572 100644
--- a/arch/arm/mach-omap2/mmc-twl4030.h
+++ b/arch/arm/mach-omap2/mmc-twl4030.h
@@ -13,6 +13,7 @@ struct twl4030_hsmmc_info {
 	bool	ext_clock;	/* use external pin for input clock */
 	int	gpio_cd;	/* or -EINVAL */
 	int	gpio_wp;	/* or -EINVAL */
+	struct device *dev;	/* returned: pointer to mmc adapter */
 };
 
 #if	defined(CONFIG_TWL4030_CORE) && \
diff --git a/arch/arm/plat-omap/devices.c b/arch/arm/plat-omap/devices.c
index 208dbb1..87fb7ff 100644
--- a/arch/arm/plat-omap/devices.c
+++ b/arch/arm/plat-omap/devices.c
@@ -228,6 +228,9 @@ int __init omap_mmc_add(const char *name, int id, unsigned long base,
 	ret = platform_device_add(pdev);
 	if (ret)
 		goto fail;
+
+	/* return device handle to board setup code */
+	data->dev = &pdev->dev;
 	return 0;
 
 fail:
diff --git a/arch/arm/plat-omap/include/mach/mmc.h b/arch/arm/plat-omap/include/mach/mmc.h
index 73a9e15..4435bd4 100644
--- a/arch/arm/plat-omap/include/mach/mmc.h
+++ b/arch/arm/plat-omap/include/mach/mmc.h
@@ -37,6 +37,8 @@
 #define OMAP_MMC_MAX_SLOTS	2
 
 struct omap_mmc_platform_data {
+	/* back-link to device */
+	struct device *dev;
 
 	/* number of slots per controller */
 	unsigned nr_slots:2;

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

* Re: [PATCH 07/12] ARM: OMAP3: mmc-twl4030 add MMC3 support, v2
  2009-03-15 17:40       ` Russell King - ARM Linux
@ 2009-03-16 17:56         ` Tony Lindgren
  0 siblings, 0 replies; 49+ messages in thread
From: Tony Lindgren @ 2009-03-16 17:56 UTC (permalink / raw)
  To: Russell King - ARM Linux; +Cc: Grazvydas Ignotas, linux-arm-kernel, linux-omap

[-- Attachment #1: Type: text/plain, Size: 984 bytes --]

* Russell King - ARM Linux <linux@arm.linux.org.uk> [090315 10:40]:
> On Sun, Mar 15, 2009 at 07:27:32PM +0200, Grazvydas Ignotas wrote:
> > On Sun, Mar 15, 2009 at 6:04 PM, Russell King - ARM Linux
> > <linux@arm.linux.org.uk> wrote:
> > > On Tue, Mar 10, 2009 at 02:10:00PM -0700, Tony Lindgren wrote:
> > >> ... Array size for hsmmc[] is specified
> > >> because hsmmc[2].name is needed for MMC3 name.
> > >
> > > I see nothing in this patch which requires that.
> > 
> > Right, but there is already some code in twl4030_mmc_init() of mmc-twl4030.c:
> > 
> >   struct twl_mmc_controller *twl = hsmmc + c->mmc - 1;
> > <snip>
> >   sprintf(twl->name, "mmc%islot%i", c->mmc, 1);
> > 
> > .. which basically writes to hsmmc[2].name for MMC3.
> 
> So, it's nothing really to do with hsmmc[2].name being required, it's
> more a case of needing to have the 3rd MMC interface included.  The
> comment in the commit is *really* misleading.

Here's this one updated for the comments.

Tony

[-- Attachment #2: hsmmc-add-mmc3-v2.patch --]
[-- Type: text/x-diff, Size: 2777 bytes --]

>From 9c51c8f60fe2e33989f2c87ff9829a7eea89240e Mon Sep 17 00:00:00 2001
From: Grazvydas Ignotas <notasas@gmail.com>
Date: Mon, 16 Mar 2009 10:43:06 -0700
Subject: [PATCH] ARM: OMAP3: mmc-twl4030 add MMC3 support, v2

Device connected to MMC3 is assumed to be self-powered, so
set_power() function is empty. It can't be omited because
host driver requires it.

Array size for hsmmc[] is specified to allocate to allocate
an instance for the third MMC controller.

Also fix a leak which happens if invalid controller id
is passed.

Signed-off-by: Grazvydas Ignotas <notasas@gmail.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>

diff --git a/arch/arm/mach-omap2/board-omap3pandora.c b/arch/arm/mach-omap2/board-omap3pandora.c
index 7a46a65..6e17180 100644
--- a/arch/arm/mach-omap2/board-omap3pandora.c
+++ b/arch/arm/mach-omap2/board-omap3pandora.c
@@ -55,6 +55,12 @@ static struct twl4030_hsmmc_info omap3pandora_mmc[] = {
 		.ext_clock	= 1,
 		.transceiver	= true,
 	},
+	{
+		.mmc		= 3,
+		.wires		= 4,
+		.gpio_cd	= -EINVAL,
+		.gpio_wp	= -EINVAL,
+	},
 	{}	/* Terminator */
 };
 
diff --git a/arch/arm/mach-omap2/mmc-twl4030.c b/arch/arm/mach-omap2/mmc-twl4030.c
index c67078d..d9fad8d 100644
--- a/arch/arm/mach-omap2/mmc-twl4030.c
+++ b/arch/arm/mach-omap2/mmc-twl4030.c
@@ -62,7 +62,7 @@ static struct twl_mmc_controller {
 	u8		twl_vmmc_dev_grp;
 	u8		twl_mmc_dedicated;
 	char		name[HSMMC_NAME_LEN + 1];
-} hsmmc[] = {
+} hsmmc[OMAP34XX_NR_MMC] = {
 	{
 		.twl_vmmc_dev_grp		= VMMC1_DEV_GRP,
 		.twl_mmc_dedicated		= VMMC1_DEDICATED,
@@ -347,6 +347,16 @@ static int twl_mmc2_set_power(struct device *dev, int slot, int power_on, int vd
 	return ret;
 }
 
+static int twl_mmc3_set_power(struct device *dev, int slot, int power_on,
+		int vdd)
+{
+	/*
+	 * Assume MMC3 has self-powered device connected, for example on-board
+	 * chip with external power source.
+	 */
+	return 0;
+}
+
 static struct omap_mmc_platform_data *hsmmc_data[OMAP34XX_NR_MMC] __initdata;
 
 void __init twl4030_mmc_init(struct twl4030_hsmmc_info *controllers)
@@ -415,7 +425,7 @@ void __init twl4030_mmc_init(struct twl4030_hsmmc_info *controllers)
 
 		/* NOTE:  we assume OMAP's MMC1 and MMC2 use
 		 * the TWL4030's VMMC1 and VMMC2, respectively;
-		 * and that OMAP's MMC3 isn't used.
+		 * and that MMC3 device has it's own power source.
 		 */
 
 		switch (c->mmc) {
@@ -430,8 +440,13 @@ void __init twl4030_mmc_init(struct twl4030_hsmmc_info *controllers)
 			else
 				mmc->slots[0].ocr_mask = MMC_VDD_165_195;
 			break;
+		case 3:
+			mmc->slots[0].set_power = twl_mmc3_set_power;
+			mmc->slots[0].ocr_mask = MMC_VDD_165_195;
+			break;
 		default:
 			pr_err("MMC%d configuration not supported!\n", c->mmc);
+			kfree(mmc);
 			continue;
 		}
 		hsmmc_data[c->mmc - 1] = mmc;

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

* Re: [PATCH 10/12] ARM: OMAP3: mmc-twl4030 allow arbitrary slot names
  2009-03-16 10:16       ` Russell King - ARM Linux
@ 2009-03-16 18:01         ` Tony Lindgren
  0 siblings, 0 replies; 49+ messages in thread
From: Tony Lindgren @ 2009-03-16 18:01 UTC (permalink / raw)
  To: Russell King - ARM Linux
  Cc: Adrian Hunter, linux-arm-kernel, David Brownell, linux-omap

[-- Attachment #1: Type: text/plain, Size: 1331 bytes --]

* Russell King - ARM Linux <linux@arm.linux.org.uk> [090316 03:17]:
> On Mon, Mar 16, 2009 at 12:05:07PM +0200, Adrian Hunter wrote:
> >> From 9b04f19a7e88f8877176c25845c38676ee3127c1 Mon Sep 17 00:00:00 2001
> > From: Adrian Hunter <adrian.hunter@nokia.com>
> > Date: Tue, 10 Mar 2009 22:13:52 +0100
> > Subject: [PATCH] ARM: OMAP3: mmc-twl4030 allow arbitrary slot names
> >
> > Signed-off-by: Adrian Hunter <adrian.hunter@nokia.com>
> > ---
> > arch/arm/mach-omap2/mmc-twl4030.c |    6 +++++-
> > arch/arm/mach-omap2/mmc-twl4030.h |    1 +
> > 2 files changed, 6 insertions(+), 1 deletions(-)
> >
> > diff --git a/arch/arm/mach-omap2/mmc-twl4030.c b/arch/arm/mach-omap2/mmc-twl4030.c
> > index a612a02..88b4bed 100644
> > --- a/arch/arm/mach-omap2/mmc-twl4030.c
> > +++ b/arch/arm/mach-omap2/mmc-twl4030.c
> > @@ -328,7 +328,11 @@ void __init twl4030_mmc_init(struct twl4030_hsmmc_info *controllers)
> > 			return;
> > 		}
> >
> > -		sprintf(twl->name, "mmc%islot%i", c->mmc, 1);
> > +		if (c->name)
> > +			strlcpy(twl->name, c->name, ARRAY_SIZE(twl->name));
> > +		else
> > +			snprintf(twl->name, ARRAY_SIZE(twl->name),
> > +				 "mmc%islot%i", c->mmc, 1);
> 
> Good, except now we have a confusion over which patch does what...

Here's this one updated to apply with snprintf moved to the earlier
patch in the series.

Tony

[-- Attachment #2: hsmmc-slot-names-v3.patch --]
[-- Type: text/x-diff, Size: 1487 bytes --]

>From 10e3a1012fce568e4be375102bf7af33543cb072 Mon Sep 17 00:00:00 2001
From: Adrian Hunter <adrian.hunter@nokia.com>
Date: Mon, 16 Mar 2009 10:57:32 -0700
Subject: [PATCH] ARM: OMAP3: mmc-twl4030 allow arbitrary slot names, v3

Signed-off-by: Adrian Hunter <adrian.hunter@nokia.com>
Acked-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Tony Lindgren <tony@atomide.com>

diff --git a/arch/arm/mach-omap2/mmc-twl4030.c b/arch/arm/mach-omap2/mmc-twl4030.c
index e2b2aeb..dc40b3e 100644
--- a/arch/arm/mach-omap2/mmc-twl4030.c
+++ b/arch/arm/mach-omap2/mmc-twl4030.c
@@ -402,8 +402,11 @@ void __init twl4030_mmc_init(struct twl4030_hsmmc_info *controllers)
 			return;
 		}
 
-		snprintf(twl->name, ARRAY_SIZE(twl->name), "mmc%islot%i",
-				c->mmc, 1);
+		if (c->name)
+			strncpy(twl->name, c->name, HSMMC_NAME_LEN);
+		else
+			snprintf(twl->name, ARRAY_SIZE(twl->name),
+				"mmc%islot%i", c->mmc, 1);
 		mmc->slots[0].name = twl->name;
 		mmc->nr_slots = 1;
 		mmc->slots[0].wires = c->wires;
diff --git a/arch/arm/mach-omap2/mmc-twl4030.h b/arch/arm/mach-omap2/mmc-twl4030.h
index 0aa1686..ea59e86 100644
--- a/arch/arm/mach-omap2/mmc-twl4030.h
+++ b/arch/arm/mach-omap2/mmc-twl4030.h
@@ -14,6 +14,7 @@ struct twl4030_hsmmc_info {
 	bool	cover_only;	/* No card detect - just cover switch */
 	int	gpio_cd;	/* or -EINVAL */
 	int	gpio_wp;	/* or -EINVAL */
+	char	*name;		/* or NULL for default */
 	struct device *dev;	/* returned: pointer to mmc adapter */
 };
 

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

* Re: [PATCH 02/12] ARM: OMAP3: Store reboot mode in scratchpad on OMAP34xx
  2009-03-16 17:40         ` Juha Yrjola
@ 2009-03-16 22:21           ` Russell King - ARM Linux
  2009-03-18 18:28             ` Tony Lindgren
  0 siblings, 1 reply; 49+ messages in thread
From: Russell King - ARM Linux @ 2009-03-16 22:21 UTC (permalink / raw)
  To: Juha Yrjola; +Cc: Tony Lindgren, linux-arm-kernel, Kevin Hilman, linux-omap

On Mon, Mar 16, 2009 at 07:40:24PM +0200, Juha Yrjola wrote:
> Russell King - ARM Linux wrote:
>
>> Right.  You are aware that there is already a mechanism for doing this
>> in the generic kernel (obviously not)?
>
> I am. Unfortunately, glibc fails to support this mechanism, as you say.  
> I didn't want to start making such intrusive changes for our trivial 
> need.

Yes, glibc sucks with that - they hide the Linux reboot syscall.
Luckily, it is accessible via the syscall() interface:

#include <linux/reboot.h>

int sys_reboot(const char *cmd)
{
	return syscall(SYS_reboot, LINUX_REBOOT_MAGIC1, LINUX_REBOOT_MAGIC2C,
			LINUX_REBOOT_CMD_RESTART2, cmd);
}

>> sys_reboot() with LINUX_REBOOT_CMD_RESTART2 takes a string in addition
>> to the standard parameters.  This string is passed into machine_restart()
>> which we currently ignore.  If LINUX_REBOOT_CMD_RESTART is used, this
>> string is NULL.
>>
>> We could change machine_restart() to pass this parameter through to
>> arm_pm_restart() and ultimately down to arch_reset().
>
> Sure. With RESTART2, I could've even used the reboot notifier chain with  
> an OMAP3-specific driver to store the string.

The notifier chain is called in any case.

> Are you suggesting to get rid of reboot_mode altogether? If not, could  
> we still have the sysfs mechanism? A one-character reboot_mode would be  
> plenty enough for us.

No, reboot mode tells _how_ to perform the reboot - whether that be
by hardware reset, gpio reset or a soft call via the reset address.
It's not supposed to tell the boot loader what to do.

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

* Re: [PATCH 04/12] ARM: OMAP3: mmc-twl4030 fix name buffer length
  2009-03-16 17:42         ` Tony Lindgren
@ 2009-03-16 22:22           ` Russell King - ARM Linux
  0 siblings, 0 replies; 49+ messages in thread
From: Russell King - ARM Linux @ 2009-03-16 22:22 UTC (permalink / raw)
  To: Tony Lindgren; +Cc: Adrian Hunter, linux-arm-kernel, David Brownell, linux-omap

On Mon, Mar 16, 2009 at 10:42:56AM -0700, Tony Lindgren wrote:
> * Russell King - ARM Linux <linux@arm.linux.org.uk> [090316 03:14]:
> > On Mon, Mar 16, 2009 at 12:04:39PM +0200, Adrian Hunter wrote:
> > > Russell King - ARM Linux wrote:
> > >> On Tue, Mar 10, 2009 at 02:06:08PM -0700, Tony Lindgren wrote:
> > >>> From: Adrian Hunter <adrian.hunter@nokia.com>
> > >>>
> > >>> Add 1 to buffer length for null terminator.
> > >>
> > >> Yes, and:
> > >>
> > >>                 sprintf(twl->name, "mmc%islot%i", c->mmc, 1);
> > >>
> > >> should be snprintf to ensure that it can't overflow the buffer.
> > >>
> > >
> > > There are only 3 controllers and everyone numbers them 1, 2 and 3.
> > 
> > So?  You've already had a buffer overflow, so it's clearly time that this
> > code got fixed properly.
> 
> Here's this one updated to also include the snprintf.

Ok.

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

* Re: [PATCH 06/12] ARM: OMAP3: mmc-twl4030 init passes device nodes back
  2009-03-16 17:44     ` Tony Lindgren
@ 2009-03-16 22:22       ` Russell King - ARM Linux
  0 siblings, 0 replies; 49+ messages in thread
From: Russell King - ARM Linux @ 2009-03-16 22:22 UTC (permalink / raw)
  To: Tony Lindgren; +Cc: linux-arm-kernel, David Brownell, linux-omap

On Mon, Mar 16, 2009 at 10:44:15AM -0700, Tony Lindgren wrote:
> * Russell King - ARM Linux <linux@arm.linux.org.uk> [090315 09:02]:
> > On Tue, Mar 10, 2009 at 02:08:43PM -0700, Tony Lindgren wrote:
> > > From: David Brownell <dbrownell@users.sourceforge.net>
> > > 
> > > When setting up HSMMC devices, pass pass the device nodes back so
> > 
> > Double pass?
> 
> Here's this one updated to fix the typo.

Ok.

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

* Re: [PATCH 12/12] ARM: OMAP3: MUSB initialization for omap hw, v2
  2009-03-15 16:14   ` Russell King - ARM Linux
  2009-03-15 18:46     ` David Brownell
@ 2009-03-16 22:37     ` Tony Lindgren
  1 sibling, 0 replies; 49+ messages in thread
From: Tony Lindgren @ 2009-03-16 22:37 UTC (permalink / raw)
  To: Russell King - ARM Linux
  Cc: linux-arm-kernel, Ajay Kumar Gupta, Felipe Balbi, linux-omap

[-- Attachment #1: Type: text/plain, Size: 1241 bytes --]

* Russell King - ARM Linux <linux@arm.linux.org.uk> [090315 09:14]:
> On Tue, Mar 10, 2009 at 02:16:28PM -0700, Tony Lindgren wrote:
> > Patch modified by Tony to build the module based on
> > CONFIG_USB_MUSB_SOC.
> 
> I don't see this.
> 
> > +# Platform specific device init code
> > +obj-$(CONFIG_USB_MUSB_SOC)		+= usb-musb.o
> 
> So, if this can be a module, the file itself doesn't export any symbols
> and doesn't have any module_init or module_exit functions.  So, if this
> gets built as a module, it isn't useful.

Good point. I've updated the Makefile, it's not intended to be compiled
as a module as it's initialized from the low-level board init code only
for the systems that have the musb wired up.

> > +void __init usb_musb_init(void)
> > +{
> > +	if (cpu_is_omap243x()) {
> > +		musb_resources[0].start = OMAP243X_HS_BASE;
> > +		musb_plat.clock = "usbhs_ick";
> 
> kill kill kill.
> 
> > +	} else {
> > +		musb_resources[0].start = OMAP34XX_HSUSB_OTG_BASE;
> > +		musb_plat.clock = "hsotgusb_ick";
> 
> kill kill kill.

Heh!
 
> clkdev removes the need for this sort of crap.

Here's the future proof version. Will post another patch against your
omap-clks3 branch to set the names for musb clocks in clock[23]4xx.c.

Tony

[-- Attachment #2: musb-init-v2.patch --]
[-- Type: text/x-diff, Size: 8939 bytes --]

>From 18936e335f62f252fa584ee9a22f99ebc34cd4c5 Mon Sep 17 00:00:00 2001
From: Felipe Balbi <felipe.balbi@nokia.com>
Date: Mon, 16 Mar 2009 11:01:50 -0700
Subject: [PATCH] ARM: OMAP3: MUSB initialization for omap hw, v2

Create a generic board-file for initializing usb
on omap2430 and omap3 boards.

Patch modified by Tony to build the module based on
CONFIG_USB_MUSB_SOC. Also merged in a patch adding
the nop xceiv from Ajay Kumar Gupta <ajay.gupta@ti.com>.

Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>

diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
index bbd12bc..29f6ca9 100644
--- a/arch/arm/mach-omap2/Makefile
+++ b/arch/arm/mach-omap2/Makefile
@@ -39,3 +39,7 @@ obj-$(CONFIG_MACH_OVERO)		+= board-overo.o \
 obj-$(CONFIG_MACH_OMAP3_PANDORA)	+= board-omap3pandora.o \
 					   mmc-twl4030.o
 
+# Platform specific device init code
+ifeq ($(CONFIG_USB_MUSB_SOC),y)
+obj-y					+= usb-musb.o
+endif
diff --git a/arch/arm/mach-omap2/board-2430sdp.c b/arch/arm/mach-omap2/board-2430sdp.c
index 83fa372..9619e25 100644
--- a/arch/arm/mach-omap2/board-2430sdp.c
+++ b/arch/arm/mach-omap2/board-2430sdp.c
@@ -35,6 +35,7 @@
 #include <mach/board.h>
 #include <mach/common.h>
 #include <mach/gpmc.h>
+#include <mach/usb.h>
 
 #include "mmc-twl4030.h"
 
@@ -251,6 +252,7 @@ static void __init omap_2430sdp_init(void)
 	omap_board_config_size = ARRAY_SIZE(sdp2430_config);
 	omap_serial_init();
 	twl4030_mmc_init(mmc);
+	usb_musb_init();
 }
 
 static void __init omap_2430sdp_map_io(void)
diff --git a/arch/arm/mach-omap2/board-ldp.c b/arch/arm/mach-omap2/board-ldp.c
index 6031e17..1b54c20 100644
--- a/arch/arm/mach-omap2/board-ldp.c
+++ b/arch/arm/mach-omap2/board-ldp.c
@@ -38,6 +38,7 @@
 #include <asm/io.h>
 #include <asm/delay.h>
 #include <mach/control.h>
+#include <mach/usb.h>
 
 #include "mmc-twl4030.h"
 
@@ -162,6 +163,7 @@ static void __init omap_ldp_init(void)
 	omap_board_config_size = ARRAY_SIZE(ldp_config);
 	omap_serial_init();
 	twl4030_mmc_init(mmc);
+	usb_musb_init();
 }
 
 static void __init omap_ldp_map_io(void)
diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c
index e3c8628..2f3d821 100644
--- a/arch/arm/mach-omap2/board-omap3beagle.c
+++ b/arch/arm/mach-omap2/board-omap3beagle.c
@@ -41,6 +41,7 @@
 #include <mach/gpmc.h>
 #include <mach/nand.h>
 #include <mach/mux.h>
+#include <mach/usb.h>
 
 #include "mmc-twl4030.h"
 
@@ -313,6 +314,7 @@ static void __init omap3_beagle_init(void)
 	/* REVISIT leave DVI powered down until it's needed ... */
 	gpio_direction_output(170, true);
 
+	usb_musb_init();
 	omap3beagle_flash_init();
 }
 
diff --git a/arch/arm/mach-omap2/board-omap3pandora.c b/arch/arm/mach-omap2/board-omap3pandora.c
index 6e17180..16e2128 100644
--- a/arch/arm/mach-omap2/board-omap3pandora.c
+++ b/arch/arm/mach-omap2/board-omap3pandora.c
@@ -34,6 +34,7 @@
 #include <mach/gpio.h>
 #include <mach/hardware.h>
 #include <mach/mcspi.h>
+#include <mach/usb.h>
 
 #include "mmc-twl4030.h"
 
@@ -200,6 +201,7 @@ static void __init omap3pandora_init(void)
 	spi_register_board_info(omap3pandora_spi_board_info,
 			ARRAY_SIZE(omap3pandora_spi_board_info));
 	omap3pandora_ads7846_init();
+	usb_musb_init();
 }
 
 static void __init omap3pandora_map_io(void)
diff --git a/arch/arm/mach-omap2/board-overo.c b/arch/arm/mach-omap2/board-overo.c
index 61f8e23..d785aa8 100644
--- a/arch/arm/mach-omap2/board-overo.c
+++ b/arch/arm/mach-omap2/board-overo.c
@@ -44,6 +44,7 @@
 #include <mach/gpmc.h>
 #include <mach/hardware.h>
 #include <mach/nand.h>
+#include <mach/usb.h>
 
 #include "mmc-twl4030.h"
 
@@ -223,6 +224,7 @@ static void __init overo_init(void)
 	omap_serial_init();
 	twl4030_mmc_init(mmc);
 	overo_flash_init();
+	usb_musb_init();
 
 	if ((gpio_request(OVERO_GPIO_W2W_NRESET,
 			  "OVERO_GPIO_W2W_NRESET") == 0) &&
diff --git a/arch/arm/mach-omap2/usb-musb.c b/arch/arm/mach-omap2/usb-musb.c
new file mode 100644
index 0000000..fc74e91
--- /dev/null
+++ b/arch/arm/mach-omap2/usb-musb.c
@@ -0,0 +1,187 @@
+/*
+ * linux/arch/arm/mach-omap2/usb-musb.c
+ *
+ * This file will contain the board specific details for the
+ * MENTOR USB OTG controller on OMAP3430
+ *
+ * Copyright (C) 2007-2008 Texas Instruments
+ * Copyright (C) 2008 Nokia Corporation
+ * Author: Vikram Pandita
+ *
+ * Generalization by:
+ * Felipe Balbi <felipe.balbi@nokia.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#include <linux/types.h>
+#include <linux/errno.h>
+#include <linux/delay.h>
+#include <linux/platform_device.h>
+#include <linux/clk.h>
+#include <linux/dma-mapping.h>
+#include <linux/io.h>
+
+#include <linux/usb/musb.h>
+
+#include <mach/hardware.h>
+#include <mach/irqs.h>
+#include <mach/pm.h>
+#include <mach/mux.h>
+#include <mach/usb.h>
+
+static struct resource musb_resources[] = {
+	[0] = { /* start and end set dynamically */
+		.flags	= IORESOURCE_MEM,
+	},
+	[1] = {	/* general IRQ */
+		.start	= INT_243X_HS_USB_MC,
+		.flags	= IORESOURCE_IRQ,
+	},
+	[2] = {	/* DMA IRQ */
+		.start	= INT_243X_HS_USB_DMA,
+		.flags	= IORESOURCE_IRQ,
+	},
+};
+
+static int clk_on;
+
+static int musb_set_clock(struct clk *clk, int state)
+{
+	if (state) {
+		if (clk_on > 0)
+			return -ENODEV;
+
+		clk_enable(clk);
+		clk_on = 1;
+	} else {
+		if (clk_on == 0)
+			return -ENODEV;
+
+		clk_disable(clk);
+		clk_on = 0;
+	}
+
+	return 0;
+}
+
+static struct musb_hdrc_eps_bits musb_eps[] = {
+	{	"ep1_tx", 10,	},
+	{	"ep1_rx", 10,	},
+	{	"ep2_tx", 9,	},
+	{	"ep2_rx", 9,	},
+	{	"ep3_tx", 3,	},
+	{	"ep3_rx", 3,	},
+	{	"ep4_tx", 3,	},
+	{	"ep4_rx", 3,	},
+	{	"ep5_tx", 3,	},
+	{	"ep5_rx", 3,	},
+	{	"ep6_tx", 3,	},
+	{	"ep6_rx", 3,	},
+	{	"ep7_tx", 3,	},
+	{	"ep7_rx", 3,	},
+	{	"ep8_tx", 2,	},
+	{	"ep8_rx", 2,	},
+	{	"ep9_tx", 2,	},
+	{	"ep9_rx", 2,	},
+	{	"ep10_tx", 2,	},
+	{	"ep10_rx", 2,	},
+	{	"ep11_tx", 2,	},
+	{	"ep11_rx", 2,	},
+	{	"ep12_tx", 2,	},
+	{	"ep12_rx", 2,	},
+	{	"ep13_tx", 2,	},
+	{	"ep13_rx", 2,	},
+	{	"ep14_tx", 2,	},
+	{	"ep14_rx", 2,	},
+	{	"ep15_tx", 2,	},
+	{	"ep15_rx", 2,	},
+};
+
+static struct musb_hdrc_config musb_config = {
+	.multipoint	= 1,
+	.dyn_fifo	= 1,
+	.soft_con	= 1,
+	.dma		= 1,
+	.num_eps	= 16,
+	.dma_channels	= 7,
+	.dma_req_chan	= (1 << 0) | (1 << 1) | (1 << 2) | (1 << 3),
+	.ram_bits	= 12,
+	.eps_bits	= musb_eps,
+};
+
+static struct musb_hdrc_platform_data musb_plat = {
+#ifdef CONFIG_USB_MUSB_OTG
+	.mode		= MUSB_OTG,
+#elif defined(CONFIG_USB_MUSB_HDRC_HCD)
+	.mode		= MUSB_HOST,
+#elif defined(CONFIG_USB_GADGET_MUSB_HDRC)
+	.mode		= MUSB_PERIPHERAL,
+#endif
+	/* .clock is set dynamically */
+	.set_clock	= musb_set_clock,
+	.config		= &musb_config,
+
+	/* REVISIT charge pump on TWL4030 can supply up to
+	 * 100 mA ... but this value is board-specific, like
+	 * "mode", and should be passed to usb_musb_init().
+	 */
+	.power		= 50,			/* up to 100 mA */
+};
+
+static u64 musb_dmamask = DMA_32BIT_MASK;
+
+static struct platform_device musb_device = {
+	.name		= "musb_hdrc",
+	.id		= -1,
+	.dev = {
+		.dma_mask		= &musb_dmamask,
+		.coherent_dma_mask	= DMA_32BIT_MASK,
+		.platform_data		= &musb_plat,
+	},
+	.num_resources	= ARRAY_SIZE(musb_resources),
+	.resource	= musb_resources,
+};
+
+#ifdef CONFIG_NOP_USB_XCEIV
+static u64 nop_xceiv_dmamask = DMA_32BIT_MASK;
+
+static struct platform_device nop_xceiv_device = {
+	.name		= "nop_usb_xceiv",
+	.id		= -1,
+	.dev = {
+		.dma_mask		= &nop_xceiv_dmamask,
+		.coherent_dma_mask	= DMA_32BIT_MASK,
+		.platform_data		= NULL,
+	},
+};
+#endif
+
+void __init usb_musb_init(void)
+{
+	if (cpu_is_omap243x())
+		musb_resources[0].start = OMAP243X_HS_BASE;
+	else
+		musb_resources[0].start = OMAP34XX_HSUSB_OTG_BASE;
+	musb_resources[0].end = musb_resources[0].start + SZ_8K - 1;
+
+	/*
+	 * REVISIT: This line can be removed once all the platforms using
+	 * musb_core.c have been converted to use use clkdev.
+	 */
+	musb_plat.clock = "ick";
+
+#ifdef CONFIG_NOP_USB_XCEIV
+	if (platform_device_register(&nop_xceiv_device) < 0) {
+		printk(KERN_ERR "Unable to register NOP-XCEIV device\n");
+		return;
+	}
+#endif
+
+	if (platform_device_register(&musb_device) < 0) {
+		printk(KERN_ERR "Unable to register HS-USB (MUSB) device\n");
+		return;
+	}
+}
diff --git a/arch/arm/plat-omap/include/mach/usb.h b/arch/arm/plat-omap/include/mach/usb.h
index e033e51..69f0cee 100644
--- a/arch/arm/plat-omap/include/mach/usb.h
+++ b/arch/arm/plat-omap/include/mach/usb.h
@@ -27,6 +27,14 @@
 #define UDC_BASE			OMAP2_UDC_BASE
 #define OMAP_OHCI_BASE			OMAP2_OHCI_BASE
 
+#ifdef CONFIG_USB_MUSB_SOC
+extern void usb_musb_init(void);
+#else
+static inline void usb_musb_init(void)
+{
+}
+#endif
+
 #endif
 
 void omap_usb_init(struct omap_usb_config *pdata);

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

* [PATCH] ARM: OMAP: Add name for musb clocks
  2009-03-15 18:46     ` David Brownell
@ 2009-03-16 22:42       ` Tony Lindgren
  2009-05-12 17:40         ` [APPLIED] " Tony Lindgren
  0 siblings, 1 reply; 49+ messages in thread
From: Tony Lindgren @ 2009-03-16 22:42 UTC (permalink / raw)
  To: Russell King
  Cc: David Brownell, linux-arm-kernel, Ajay Kumar Gupta, Felipe Balbi,
	linux-omap

[-- Attachment #1: Type: text/plain, Size: 610 bytes --]

* David Brownell <david-b@pacbell.net> [090315 11:46]:
> On Sunday 15 March 2009, Russell King - ARM Linux wrote:
> > clkdev removes the need for this sort of crap.
> 
> And once it, or its equivalent, works on all the platforms
> supportihg the musb_hdrc driver, then the driver can switch.

Yeah, I added a REVISIT comment to remove the "ick" name in the
low-level init code once all the musb platforms use clkdev.

Russell, here's a patch you might want to merge into your omap-clks3
branch for musb.

Also tested musb on omap-clks3 + omap-upstream + omap3-upstream +
omap3-boards patches. 

Regards,

Tony

[-- Attachment #2: omap-clks3-musb.patch --]
[-- Type: text/x-diff, Size: 1785 bytes --]

>From 8fb4be02dd5fdbcf71708d7cb5d42751aee42190 Mon Sep 17 00:00:00 2001
From: Tony Lindgren <tony@atomide.com>
Date: Mon, 16 Mar 2009 15:28:41 -0700
Subject: [PATCH] ARM: OMAP: Add name for musb clocks

This allows musb_core.c to register clock with name "ick".

Once all the platforms using the musb driver have been converted
to use clockdev, the clock name does not need to be passed
from the low-level init code.

Signed-off-by: Tony Lindgren <tony@atomide.com>

diff --git a/arch/arm/mach-omap2/clock24xx.c b/arch/arm/mach-omap2/clock24xx.c
index 1e839c5..f58ad06 100644
--- a/arch/arm/mach-omap2/clock24xx.c
+++ b/arch/arm/mach-omap2/clock24xx.c
@@ -205,7 +205,7 @@ static struct omap_clk omap24xx_clks[] = {
 	CLK(NULL,	"aes_ick",	&aes_ick,	CK_243X | CK_242X),
 	CLK(NULL,	"pka_ick",	&pka_ick,	CK_243X | CK_242X),
 	CLK(NULL,	"usb_fck",	&usb_fck,	CK_243X | CK_242X),
-	CLK(NULL,	"usbhs_ick",	&usbhs_ick,	CK_243X),
+	CLK("musb_hdrc",	"ick",	&usbhs_ick,	CK_243X),
 	CLK("mmci-omap-hs.0", "ick",	&mmchs1_ick,	CK_243X),
 	CLK("mmci-omap-hs.0", "fck",	&mmchs1_fck,	CK_243X),
 	CLK("mmci-omap-hs.1", "ick",	&mmchs2_ick,	CK_243X),
diff --git a/arch/arm/mach-omap2/clock34xx.c b/arch/arm/mach-omap2/clock34xx.c
index 0a14dca..a057539 100644
--- a/arch/arm/mach-omap2/clock34xx.c
+++ b/arch/arm/mach-omap2/clock34xx.c
@@ -157,7 +157,7 @@ static struct omap_clk omap34xx_clks[] = {
 	CLK(NULL,	"ssi_ssr_fck",	&ssi_ssr_fck,	CK_343X),
 	CLK(NULL,	"ssi_sst_fck",	&ssi_sst_fck,	CK_343X),
 	CLK(NULL,	"core_l3_ick",	&core_l3_ick,	CK_343X),
-	CLK(NULL,	"hsotgusb_ick",	&hsotgusb_ick,	CK_343X),
+	CLK("musb_hdrc",	"ick",	&hsotgusb_ick,	CK_343X),
 	CLK(NULL,	"sdrc_ick",	&sdrc_ick,	CK_343X),
 	CLK(NULL,	"gpmc_fck",	&gpmc_fck,	CK_343X),
 	CLK(NULL,	"security_l3_ick", &security_l3_ick, CK_343X),

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

* Re: [PATCH 02/12] ARM: OMAP3: Store reboot mode in scratchpad on OMAP34xx
  2009-03-16 22:21           ` Russell King - ARM Linux
@ 2009-03-18 18:28             ` Tony Lindgren
  2009-03-18 19:26               ` Russell King - ARM Linux
  0 siblings, 1 reply; 49+ messages in thread
From: Tony Lindgren @ 2009-03-18 18:28 UTC (permalink / raw)
  To: Russell King - ARM Linux
  Cc: Juha Yrjola, linux-arm-kernel, Kevin Hilman, linux-omap

* Russell King - ARM Linux <linux@arm.linux.org.uk> [090316 15:22]:
> On Mon, Mar 16, 2009 at 07:40:24PM +0200, Juha Yrjola wrote:
> > Russell King - ARM Linux wrote:
> >
> >> Right.  You are aware that there is already a mechanism for doing this
> >> in the generic kernel (obviously not)?
> >
> > I am. Unfortunately, glibc fails to support this mechanism, as you say.  
> > I didn't want to start making such intrusive changes for our trivial 
> > need.
> 
> Yes, glibc sucks with that - they hide the Linux reboot syscall.
> Luckily, it is accessible via the syscall() interface:
> 
> #include <linux/reboot.h>
> 
> int sys_reboot(const char *cmd)
> {
> 	return syscall(SYS_reboot, LINUX_REBOOT_MAGIC1, LINUX_REBOOT_MAGIC2C,
> 			LINUX_REBOOT_CMD_RESTART2, cmd);
> }
> 
> >> sys_reboot() with LINUX_REBOOT_CMD_RESTART2 takes a string in addition
> >> to the standard parameters.  This string is passed into machine_restart()
> >> which we currently ignore.  If LINUX_REBOOT_CMD_RESTART is used, this
> >> string is NULL.
> >>
> >> We could change machine_restart() to pass this parameter through to
> >> arm_pm_restart() and ultimately down to arch_reset().
> >
> > Sure. With RESTART2, I could've even used the reboot notifier chain with  
> > an OMAP3-specific driver to store the string.
> 
> The notifier chain is called in any case.
> 
> > Are you suggesting to get rid of reboot_mode altogether? If not, could  
> > we still have the sysfs mechanism? A one-character reboot_mode would be  
> > plenty enough for us.
> 
> No, reboot mode tells _how_ to perform the reboot - whether that be
> by hardware reset, gpio reset or a soft call via the reset address.
> It's not supposed to tell the boot loader what to do.

So if the reboot mode can't be used for this.. Should we change Juha's
sysfs interface patch to store something else like bootloader_mode?

I guess we cannot use kexec for this either?

Tony


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

* Re: [PATCH 02/12] ARM: OMAP3: Store reboot mode in scratchpad on OMAP34xx
  2009-03-18 18:28             ` Tony Lindgren
@ 2009-03-18 19:26               ` Russell King - ARM Linux
  2009-03-18 20:10                 ` Tony Lindgren
  0 siblings, 1 reply; 49+ messages in thread
From: Russell King - ARM Linux @ 2009-03-18 19:26 UTC (permalink / raw)
  To: Tony Lindgren; +Cc: Juha Yrjola, linux-arm-kernel, Kevin Hilman, linux-omap

On Wed, Mar 18, 2009 at 11:28:06AM -0700, Tony Lindgren wrote:
> * Russell King - ARM Linux <linux@arm.linux.org.uk> [090316 15:22]:
> > On Mon, Mar 16, 2009 at 07:40:24PM +0200, Juha Yrjola wrote:
> > > Russell King - ARM Linux wrote:
> > >
> > >> Right.  You are aware that there is already a mechanism for doing this
> > >> in the generic kernel (obviously not)?
> > >
> > > I am. Unfortunately, glibc fails to support this mechanism, as you say.  
> > > I didn't want to start making such intrusive changes for our trivial 
> > > need.
> > 
> > Yes, glibc sucks with that - they hide the Linux reboot syscall.
> > Luckily, it is accessible via the syscall() interface:
> > 
> > #include <linux/reboot.h>
> > 
> > int sys_reboot(const char *cmd)
> > {
> > 	return syscall(SYS_reboot, LINUX_REBOOT_MAGIC1, LINUX_REBOOT_MAGIC2C,
> > 			LINUX_REBOOT_CMD_RESTART2, cmd);
> > }
> > 
> > >> sys_reboot() with LINUX_REBOOT_CMD_RESTART2 takes a string in addition
> > >> to the standard parameters.  This string is passed into machine_restart()
> > >> which we currently ignore.  If LINUX_REBOOT_CMD_RESTART is used, this
> > >> string is NULL.
> > >>
> > >> We could change machine_restart() to pass this parameter through to
> > >> arm_pm_restart() and ultimately down to arch_reset().
> > >
> > > Sure. With RESTART2, I could've even used the reboot notifier chain with  
> > > an OMAP3-specific driver to store the string.
> > 
> > The notifier chain is called in any case.
> > 
> > > Are you suggesting to get rid of reboot_mode altogether? If not, could  
> > > we still have the sysfs mechanism? A one-character reboot_mode would be  
> > > plenty enough for us.
> > 
> > No, reboot mode tells _how_ to perform the reboot - whether that be
> > by hardware reset, gpio reset or a soft call via the reset address.
> > It's not supposed to tell the boot loader what to do.
> 
> So if the reboot mode can't be used for this.. Should we change Juha's
> sysfs interface patch to store something else like bootloader_mode?
> 
> I guess we cannot use kexec for this either?

Why not use the mechanism that's already there as I've already pointed
out?

Yes, glibc might be fscked in the head over the reboot() prototype but
that's easy to work-around as I've demonstrated.

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

* Re: [PATCH 02/12] ARM: OMAP3: Store reboot mode in scratchpad on OMAP34xx
  2009-03-18 19:26               ` Russell King - ARM Linux
@ 2009-03-18 20:10                 ` Tony Lindgren
  2009-03-18 20:15                   ` Tony Lindgren
  2009-03-19  0:08                   ` Russell King - ARM Linux
  0 siblings, 2 replies; 49+ messages in thread
From: Tony Lindgren @ 2009-03-18 20:10 UTC (permalink / raw)
  To: Russell King - ARM Linux
  Cc: Juha Yrjola, linux-arm-kernel, Kevin Hilman, linux-omap

* Russell King - ARM Linux <linux@arm.linux.org.uk> [090318 12:26]:
> On Wed, Mar 18, 2009 at 11:28:06AM -0700, Tony Lindgren wrote:
> > * Russell King - ARM Linux <linux@arm.linux.org.uk> [090316 15:22]:
> > > On Mon, Mar 16, 2009 at 07:40:24PM +0200, Juha Yrjola wrote:
> > > > Russell King - ARM Linux wrote:
> > > >
> > > >> Right.  You are aware that there is already a mechanism for doing this
> > > >> in the generic kernel (obviously not)?
> > > >
> > > > I am. Unfortunately, glibc fails to support this mechanism, as you say.  
> > > > I didn't want to start making such intrusive changes for our trivial 
> > > > need.
> > > 
> > > Yes, glibc sucks with that - they hide the Linux reboot syscall.
> > > Luckily, it is accessible via the syscall() interface:
> > > 
> > > #include <linux/reboot.h>
> > > 
> > > int sys_reboot(const char *cmd)
> > > {
> > > 	return syscall(SYS_reboot, LINUX_REBOOT_MAGIC1, LINUX_REBOOT_MAGIC2C,
> > > 			LINUX_REBOOT_CMD_RESTART2, cmd);
> > > }
> > > 
> > > >> sys_reboot() with LINUX_REBOOT_CMD_RESTART2 takes a string in addition
> > > >> to the standard parameters.  This string is passed into machine_restart()
> > > >> which we currently ignore.  If LINUX_REBOOT_CMD_RESTART is used, this
> > > >> string is NULL.
> > > >>
> > > >> We could change machine_restart() to pass this parameter through to
> > > >> arm_pm_restart() and ultimately down to arch_reset().
> > > >
> > > > Sure. With RESTART2, I could've even used the reboot notifier chain with  
> > > > an OMAP3-specific driver to store the string.
> > > 
> > > The notifier chain is called in any case.
> > > 
> > > > Are you suggesting to get rid of reboot_mode altogether? If not, could  
> > > > we still have the sysfs mechanism? A one-character reboot_mode would be  
> > > > plenty enough for us.
> > > 
> > > No, reboot mode tells _how_ to perform the reboot - whether that be
> > > by hardware reset, gpio reset or a soft call via the reset address.
> > > It's not supposed to tell the boot loader what to do.
> > 
> > So if the reboot mode can't be used for this.. Should we change Juha's
> > sysfs interface patch to store something else like bootloader_mode?
> > 
> > I guess we cannot use kexec for this either?
> 
> Why not use the mechanism that's already there as I've already pointed
> out?

Sorry I misunderstood, I thought you did not want to use reboot_mode
for this at all..

To recap, so we change machine_restart() like you described above, and then
this patch is still valid, except to update the description.

Juha, does that sound OK to you?

> Yes, glibc might be fscked in the head over the reboot() prototype but
> that's easy to work-around as I've demonstrated.

Yeah sounds good to me.

Tony

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

* Re: [PATCH 02/12] ARM: OMAP3: Store reboot mode in scratchpad on OMAP34xx
  2009-03-18 20:10                 ` Tony Lindgren
@ 2009-03-18 20:15                   ` Tony Lindgren
  2009-03-19  0:08                   ` Russell King - ARM Linux
  1 sibling, 0 replies; 49+ messages in thread
From: Tony Lindgren @ 2009-03-18 20:15 UTC (permalink / raw)
  To: Russell King - ARM Linux
  Cc: Juha Yrjola, linux-arm-kernel, Kevin Hilman, linux-omap

* Tony Lindgren <tony@atomide.com> [090318 13:09]:
> * Russell King - ARM Linux <linux@arm.linux.org.uk> [090318 12:26]:
> > On Wed, Mar 18, 2009 at 11:28:06AM -0700, Tony Lindgren wrote:
> > > * Russell King - ARM Linux <linux@arm.linux.org.uk> [090316 15:22]:
> > > > On Mon, Mar 16, 2009 at 07:40:24PM +0200, Juha Yrjola wrote:
> > > > > Russell King - ARM Linux wrote:
> > > > >
> > > > >> Right.  You are aware that there is already a mechanism for doing this
> > > > >> in the generic kernel (obviously not)?
> > > > >
> > > > > I am. Unfortunately, glibc fails to support this mechanism, as you say.  
> > > > > I didn't want to start making such intrusive changes for our trivial 
> > > > > need.
> > > > 
> > > > Yes, glibc sucks with that - they hide the Linux reboot syscall.
> > > > Luckily, it is accessible via the syscall() interface:
> > > > 
> > > > #include <linux/reboot.h>
> > > > 
> > > > int sys_reboot(const char *cmd)
> > > > {
> > > > 	return syscall(SYS_reboot, LINUX_REBOOT_MAGIC1, LINUX_REBOOT_MAGIC2C,
> > > > 			LINUX_REBOOT_CMD_RESTART2, cmd);
> > > > }
> > > > 
> > > > >> sys_reboot() with LINUX_REBOOT_CMD_RESTART2 takes a string in addition
> > > > >> to the standard parameters.  This string is passed into machine_restart()
> > > > >> which we currently ignore.  If LINUX_REBOOT_CMD_RESTART is used, this
> > > > >> string is NULL.
> > > > >>
> > > > >> We could change machine_restart() to pass this parameter through to
> > > > >> arm_pm_restart() and ultimately down to arch_reset().
> > > > >
> > > > > Sure. With RESTART2, I could've even used the reboot notifier chain with  
> > > > > an OMAP3-specific driver to store the string.
> > > > 
> > > > The notifier chain is called in any case.
> > > > 
> > > > > Are you suggesting to get rid of reboot_mode altogether? If not, could  
> > > > > we still have the sysfs mechanism? A one-character reboot_mode would be  
> > > > > plenty enough for us.
> > > > 
> > > > No, reboot mode tells _how_ to perform the reboot - whether that be
> > > > by hardware reset, gpio reset or a soft call via the reset address.
> > > > It's not supposed to tell the boot loader what to do.
> > > 
> > > So if the reboot mode can't be used for this.. Should we change Juha's
> > > sysfs interface patch to store something else like bootloader_mode?
> > > 
> > > I guess we cannot use kexec for this either?
> > 
> > Why not use the mechanism that's already there as I've already pointed
> > out?
> 
> Sorry I misunderstood, I thought you did not want to use reboot_mode
> for this at all..
> 
> To recap, so we change machine_restart() like you described above, and then
> this patch is still valid, except to update the description.

Hmm, after reading it one more time..

Russell you want to pass char *cmd in addition to reboot_mode, right?
And Juha's patch needs to be updated to use the cmd instead of reboot_mode?
 
> Juha, does that sound OK to you?
> 
> > Yes, glibc might be fscked in the head over the reboot() prototype but
> > that's easy to work-around as I've demonstrated.
> 
> Yeah sounds good to me.
> 
> Tony

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

* Re: [PATCH 02/12] ARM: OMAP3: Store reboot mode in scratchpad on OMAP34xx
  2009-03-18 20:10                 ` Tony Lindgren
  2009-03-18 20:15                   ` Tony Lindgren
@ 2009-03-19  0:08                   ` Russell King - ARM Linux
  2009-03-19 15:56                     ` Tony Lindgren
  1 sibling, 1 reply; 49+ messages in thread
From: Russell King - ARM Linux @ 2009-03-19  0:08 UTC (permalink / raw)
  To: Tony Lindgren; +Cc: Juha Yrjola, linux-arm-kernel, Kevin Hilman, linux-omap

On Wed, Mar 18, 2009 at 01:10:04PM -0700, Tony Lindgren wrote:
> * Russell King - ARM Linux <linux@arm.linux.org.uk> [090318 12:26]:
> > On Wed, Mar 18, 2009 at 11:28:06AM -0700, Tony Lindgren wrote:
> > > * Russell King - ARM Linux <linux@arm.linux.org.uk> [090316 15:22]:
> > > > On Mon, Mar 16, 2009 at 07:40:24PM +0200, Juha Yrjola wrote:
> > > > > Russell King - ARM Linux wrote:
> > > > >
> > > > >> Right.  You are aware that there is already a mechanism for doing this
> > > > >> in the generic kernel (obviously not)?
> > > > >
> > > > > I am. Unfortunately, glibc fails to support this mechanism, as you say.  
> > > > > I didn't want to start making such intrusive changes for our trivial 
> > > > > need.
> > > > 
> > > > Yes, glibc sucks with that - they hide the Linux reboot syscall.
> > > > Luckily, it is accessible via the syscall() interface:
> > > > 
> > > > #include <linux/reboot.h>
> > > > 
> > > > int sys_reboot(const char *cmd)
> > > > {
> > > > 	return syscall(SYS_reboot, LINUX_REBOOT_MAGIC1, LINUX_REBOOT_MAGIC2C,
> > > > 			LINUX_REBOOT_CMD_RESTART2, cmd);
> > > > }
> > > > 
> > > > >> sys_reboot() with LINUX_REBOOT_CMD_RESTART2 takes a string in addition
> > > > >> to the standard parameters.  This string is passed into machine_restart()
> > > > >> which we currently ignore.  If LINUX_REBOOT_CMD_RESTART is used, this
> > > > >> string is NULL.
> > > > >>
> > > > >> We could change machine_restart() to pass this parameter through to
> > > > >> arm_pm_restart() and ultimately down to arch_reset().
> > > > >
> > > > > Sure. With RESTART2, I could've even used the reboot notifier chain with  
> > > > > an OMAP3-specific driver to store the string.
> > > > 
> > > > The notifier chain is called in any case.
> > > > 
> > > > > Are you suggesting to get rid of reboot_mode altogether? If not, could  
> > > > > we still have the sysfs mechanism? A one-character reboot_mode would be  
> > > > > plenty enough for us.
> > > > 
> > > > No, reboot mode tells _how_ to perform the reboot - whether that be
> > > > by hardware reset, gpio reset or a soft call via the reset address.
> > > > It's not supposed to tell the boot loader what to do.
> > > 
> > > So if the reboot mode can't be used for this.. Should we change Juha's
> > > sysfs interface patch to store something else like bootloader_mode?
> > > 
> > > I guess we cannot use kexec for this either?
> > 
> > Why not use the mechanism that's already there as I've already pointed
> > out?
> 
> Sorry I misunderstood, I thought you did not want to use reboot_mode
> for this at all..

I don't want to use reboot_mode for this.  machine_restart() and the
reboot syscall has a way of passing a string to the platform specific
code, and I'm suggesting that if you want the boot loader to do some
magic, that's the way to do it.  Use the 'cmd' argument provided to
arch_reset() by the patch below - this will either be NULL if the
standard reboot call is used, or a string if the alternative version
is used.

> To recap, so we change machine_restart() like you described above, and then
> this patch is still valid, except to update the description.

No, you've still got the wrong end of the stick.

 arch/arm/include/asm/system.h                     |    4 ++--
 arch/arm/kernel/process.c                         |   10 +++++-----
 arch/arm/mach-aaec2000/include/mach/system.h      |    2 +-
 arch/arm/mach-at91/include/mach/system.h          |    2 +-
 arch/arm/mach-clps711x/include/mach/system.h      |    2 +-
 arch/arm/mach-davinci/include/mach/system.h       |    2 +-
 arch/arm/mach-ebsa110/include/mach/system.h       |    2 +-
 arch/arm/mach-ep93xx/include/mach/system.h        |    2 +-
 arch/arm/mach-footbridge/include/mach/system.h    |    2 +-
 arch/arm/mach-h720x/include/mach/system.h         |    2 +-
 arch/arm/mach-imx/include/mach/system.h           |    2 +-
 arch/arm/mach-integrator/include/mach/system.h    |    2 +-
 arch/arm/mach-iop13xx/include/mach/system.h       |    2 +-
 arch/arm/mach-iop32x/include/mach/system.h        |    2 +-
 arch/arm/mach-iop33x/include/mach/system.h        |    2 +-
 arch/arm/mach-ixp2000/include/mach/system.h       |    2 +-
 arch/arm/mach-ixp23xx/include/mach/system.h       |    2 +-
 arch/arm/mach-ixp4xx/include/mach/system.h        |    2 +-
 arch/arm/mach-kirkwood/include/mach/system.h      |    2 +-
 arch/arm/mach-ks8695/include/mach/system.h        |    2 +-
 arch/arm/mach-l7200/include/mach/system.h         |    2 +-
 arch/arm/mach-lh7a40x/include/mach/system.h       |    2 +-
 arch/arm/mach-loki/include/mach/system.h          |    2 +-
 arch/arm/mach-msm/include/mach/system.h           |    2 +-
 arch/arm/mach-mv78xx0/include/mach/system.h       |    2 +-
 arch/arm/mach-mx2/system.c                        |    2 +-
 arch/arm/mach-netx/include/mach/system.h          |    2 +-
 arch/arm/mach-ns9xxx/include/mach/system.h        |    2 +-
 arch/arm/mach-orion5x/include/mach/system.h       |    2 +-
 arch/arm/mach-orion5x/lsmini-setup.c              |    2 +-
 arch/arm/mach-pnx4008/include/mach/system.h       |    2 +-
 arch/arm/mach-pxa/corgi.c                         |    6 +++---
 arch/arm/mach-pxa/include/mach/system.h           |    2 +-
 arch/arm/mach-pxa/mioa701.c                       |    6 +++---
 arch/arm/mach-pxa/poodle.c                        |    6 +++---
 arch/arm/mach-pxa/reset.c                         |    2 +-
 arch/arm/mach-pxa/spitz.c                         |    4 ++--
 arch/arm/mach-pxa/tosa.c                          |    4 ++--
 arch/arm/mach-realview/include/mach/system.h      |    2 +-
 arch/arm/mach-rpc/include/mach/system.h           |    2 +-
 arch/arm/mach-s3c2410/include/mach/system-reset.h |    2 +-
 arch/arm/mach-s3c6400/include/mach/system.h       |    2 +-
 arch/arm/mach-sa1100/include/mach/system.h        |    2 +-
 arch/arm/mach-shark/core.c                        |    2 +-
 arch/arm/mach-shark/include/mach/system.h         |    2 +-
 arch/arm/mach-versatile/include/mach/system.h     |    2 +-
 arch/arm/mach-w90x900/include/mach/system.h       |    2 +-
 arch/arm/plat-mxc/include/mach/system.h           |    2 +-
 arch/arm/plat-omap/include/mach/system.h          |    2 +-
 arch/arm/plat-s3c24xx/cpu.c                       |    6 +++---
 50 files changed, 65 insertions(+), 65 deletions(-)

diff --git a/arch/arm/include/asm/system.h b/arch/arm/include/asm/system.h
index 811be55..0a0d49a 100644
--- a/arch/arm/include/asm/system.h
+++ b/arch/arm/include/asm/system.h
@@ -97,8 +97,8 @@ extern void __show_regs(struct pt_regs *);
 extern int cpu_architecture(void);
 extern void cpu_init(void);
 
-void arm_machine_restart(char mode);
-extern void (*arm_pm_restart)(char str);
+void arm_machine_restart(char mode, const char *cmd);
+extern void (*arm_pm_restart)(char str, const char *cmd);
 
 #define UDBG_UNDEFINED	(1 << 0)
 #define UDBG_SYSCALL	(1 << 1)
diff --git a/arch/arm/kernel/process.c b/arch/arm/kernel/process.c
index af377c7..2de14e2 100644
--- a/arch/arm/kernel/process.c
+++ b/arch/arm/kernel/process.c
@@ -83,7 +83,7 @@ static int __init hlt_setup(char *__unused)
 __setup("nohlt", nohlt_setup);
 __setup("hlt", hlt_setup);
 
-void arm_machine_restart(char mode)
+void arm_machine_restart(char mode, const char *cmd)
 {
 	/*
 	 * Clean and disable cache, and turn off interrupts
@@ -100,7 +100,7 @@ void arm_machine_restart(char mode)
 	/*
 	 * Now call the architecture specific reboot code.
 	 */
-	arch_reset(mode);
+	arch_reset(mode, cmd);
 
 	/*
 	 * Whoops - the architecture was unable to reboot.
@@ -120,7 +120,7 @@ EXPORT_SYMBOL(pm_idle);
 void (*pm_power_off)(void);
 EXPORT_SYMBOL(pm_power_off);
 
-void (*arm_pm_restart)(char str) = arm_machine_restart;
+void (*arm_pm_restart)(char str, const char *cmd) = arm_machine_restart;
 EXPORT_SYMBOL_GPL(arm_pm_restart);
 
 
@@ -195,9 +195,9 @@ void machine_power_off(void)
 		pm_power_off();
 }
 
-void machine_restart(char * __unused)
+void machine_restart(char *cmd)
 {
-	arm_pm_restart(reboot_mode);
+	arm_pm_restart(reboot_mode, cmd);
 }
 
 void __show_regs(struct pt_regs *regs)
diff --git a/arch/arm/mach-aaec2000/include/mach/system.h b/arch/arm/mach-aaec2000/include/mach/system.h
index 8f4115d..fe08ca1 100644
--- a/arch/arm/mach-aaec2000/include/mach/system.h
+++ b/arch/arm/mach-aaec2000/include/mach/system.h
@@ -16,7 +16,7 @@ static inline void arch_idle(void)
 	cpu_do_idle();
 }
 
-static inline void arch_reset(char mode)
+static inline void arch_reset(char mode, const char *cmd)
 {
 	cpu_reset(0);
 }
diff --git a/arch/arm/mach-at91/include/mach/system.h b/arch/arm/mach-at91/include/mach/system.h
index e712658..5268af3 100644
--- a/arch/arm/mach-at91/include/mach/system.h
+++ b/arch/arm/mach-at91/include/mach/system.h
@@ -43,7 +43,7 @@ static inline void arch_idle(void)
 
 void (*at91_arch_reset)(void);
 
-static inline void arch_reset(char mode)
+static inline void arch_reset(char mode, const char *cmd)
 {
 	/* call the CPU-specific reset function */
 	if (at91_arch_reset)
diff --git a/arch/arm/mach-clps711x/include/mach/system.h b/arch/arm/mach-clps711x/include/mach/system.h
index 24e9615..f916cd7 100644
--- a/arch/arm/mach-clps711x/include/mach/system.h
+++ b/arch/arm/mach-clps711x/include/mach/system.h
@@ -32,7 +32,7 @@ static inline void arch_idle(void)
 	mov	r0, r0");
 }
 
-static inline void arch_reset(char mode)
+static inline void arch_reset(char mode, const char *cmd)
 {
 	cpu_reset(0);
 }
diff --git a/arch/arm/mach-davinci/include/mach/system.h b/arch/arm/mach-davinci/include/mach/system.h
index 17ca41d..b7e7036 100644
--- a/arch/arm/mach-davinci/include/mach/system.h
+++ b/arch/arm/mach-davinci/include/mach/system.h
@@ -21,7 +21,7 @@ static void arch_idle(void)
 	cpu_do_idle();
 }
 
-static void arch_reset(char mode)
+static void arch_reset(char mode, const char *cmd)
 {
 	davinci_watchdog_reset();
 }
diff --git a/arch/arm/mach-ebsa110/include/mach/system.h b/arch/arm/mach-ebsa110/include/mach/system.h
index 350a028..9a26245 100644
--- a/arch/arm/mach-ebsa110/include/mach/system.h
+++ b/arch/arm/mach-ebsa110/include/mach/system.h
@@ -34,6 +34,6 @@ static inline void arch_idle(void)
 	asm volatile ("mcr p15, 0, ip, c15, c1, 2" : : : "cc");
 }
 
-#define arch_reset(mode)	cpu_reset(0x80000000)
+#define arch_reset(mode, cmd)	cpu_reset(0x80000000)
 
 #endif
diff --git a/arch/arm/mach-ep93xx/include/mach/system.h b/arch/arm/mach-ep93xx/include/mach/system.h
index 67789d0..ed8f35e 100644
--- a/arch/arm/mach-ep93xx/include/mach/system.h
+++ b/arch/arm/mach-ep93xx/include/mach/system.h
@@ -9,7 +9,7 @@ static inline void arch_idle(void)
 	cpu_do_idle();
 }
 
-static inline void arch_reset(char mode)
+static inline void arch_reset(char mode, const char *cmd)
 {
 	u32 devicecfg;
 
diff --git a/arch/arm/mach-footbridge/include/mach/system.h b/arch/arm/mach-footbridge/include/mach/system.h
index 2db7f36..0b29315 100644
--- a/arch/arm/mach-footbridge/include/mach/system.h
+++ b/arch/arm/mach-footbridge/include/mach/system.h
@@ -18,7 +18,7 @@ static inline void arch_idle(void)
 	cpu_do_idle();
 }
 
-static inline void arch_reset(char mode)
+static inline void arch_reset(char mode, const char *cmd)
 {
 	if (mode == 's') {
 		/*
diff --git a/arch/arm/mach-h720x/include/mach/system.h b/arch/arm/mach-h720x/include/mach/system.h
index e4a7c76..a708d24 100644
--- a/arch/arm/mach-h720x/include/mach/system.h
+++ b/arch/arm/mach-h720x/include/mach/system.h
@@ -25,7 +25,7 @@ static void arch_idle(void)
 }
 
 
-static __inline__ void arch_reset(char mode)
+static __inline__ void arch_reset(char mode, const char *cmd)
 {
 	CPU_REG (PMU_BASE, PMU_STAT) |= PMU_WARMRESET;
 }
diff --git a/arch/arm/mach-imx/include/mach/system.h b/arch/arm/mach-imx/include/mach/system.h
index adee7e5..46d4ca9 100644
--- a/arch/arm/mach-imx/include/mach/system.h
+++ b/arch/arm/mach-imx/include/mach/system.h
@@ -32,7 +32,7 @@ arch_idle(void)
 }
 
 static inline void
-arch_reset(char mode)
+arch_reset(char mode, const char *cmd)
 {
 	cpu_reset(0);
 }
diff --git a/arch/arm/mach-integrator/include/mach/system.h b/arch/arm/mach-integrator/include/mach/system.h
index c485345..e1551b8 100644
--- a/arch/arm/mach-integrator/include/mach/system.h
+++ b/arch/arm/mach-integrator/include/mach/system.h
@@ -32,7 +32,7 @@ static inline void arch_idle(void)
 	cpu_do_idle();
 }
 
-static inline void arch_reset(char mode)
+static inline void arch_reset(char mode, const char *cmd)
 {
 	/*
 	 * To reset, we hit the on-board reset register
diff --git a/arch/arm/mach-iop13xx/include/mach/system.h b/arch/arm/mach-iop13xx/include/mach/system.h
index c7127f4..d0c66ef 100644
--- a/arch/arm/mach-iop13xx/include/mach/system.h
+++ b/arch/arm/mach-iop13xx/include/mach/system.h
@@ -13,7 +13,7 @@ static inline void arch_idle(void)
 	cpu_do_idle();
 }
 
-static inline void arch_reset(char mode)
+static inline void arch_reset(char mode, const char *cmd)
 {
 	/*
 	 * Reset the internal bus (warning both cores are reset)
diff --git a/arch/arm/mach-iop32x/include/mach/system.h b/arch/arm/mach-iop32x/include/mach/system.h
index 32d9e5b..a4b808f 100644
--- a/arch/arm/mach-iop32x/include/mach/system.h
+++ b/arch/arm/mach-iop32x/include/mach/system.h
@@ -16,7 +16,7 @@ static inline void arch_idle(void)
 	cpu_do_idle();
 }
 
-static inline void arch_reset(char mode)
+static inline void arch_reset(char mode, const char *cmd)
 {
 	local_irq_disable();
 
diff --git a/arch/arm/mach-iop33x/include/mach/system.h b/arch/arm/mach-iop33x/include/mach/system.h
index 0cb3ad8..f192a34 100644
--- a/arch/arm/mach-iop33x/include/mach/system.h
+++ b/arch/arm/mach-iop33x/include/mach/system.h
@@ -14,7 +14,7 @@ static inline void arch_idle(void)
 	cpu_do_idle();
 }
 
-static inline void arch_reset(char mode)
+static inline void arch_reset(char mode, const char *cmd)
 {
 	*IOP3XX_PCSR = 0x30;
 
diff --git a/arch/arm/mach-ixp2000/include/mach/system.h b/arch/arm/mach-ixp2000/include/mach/system.h
index 2e9c68f..de37099 100644
--- a/arch/arm/mach-ixp2000/include/mach/system.h
+++ b/arch/arm/mach-ixp2000/include/mach/system.h
@@ -17,7 +17,7 @@ static inline void arch_idle(void)
 	cpu_do_idle();
 }
 
-static inline void arch_reset(char mode)
+static inline void arch_reset(char mode, const char *cmd)
 {
 	local_irq_disable();
 
diff --git a/arch/arm/mach-ixp23xx/include/mach/system.h b/arch/arm/mach-ixp23xx/include/mach/system.h
index d57c3fc..8920ff2 100644
--- a/arch/arm/mach-ixp23xx/include/mach/system.h
+++ b/arch/arm/mach-ixp23xx/include/mach/system.h
@@ -19,7 +19,7 @@ static inline void arch_idle(void)
 #endif
 }
 
-static inline void arch_reset(char mode)
+static inline void arch_reset(char mode, const char *cmd)
 {
 	/* First try machine specific support */
 	if (machine_is_ixdp2351()) {
diff --git a/arch/arm/mach-ixp4xx/include/mach/system.h b/arch/arm/mach-ixp4xx/include/mach/system.h
index 92a7e8d..d2aa26f 100644
--- a/arch/arm/mach-ixp4xx/include/mach/system.h
+++ b/arch/arm/mach-ixp4xx/include/mach/system.h
@@ -20,7 +20,7 @@ static inline void arch_idle(void)
 }
 
 
-static inline void arch_reset(char mode)
+static inline void arch_reset(char mode, const char *cmd)
 {
 	if ( 1 && mode == 's') {
 		/* Jump into ROM at address 0 */
diff --git a/arch/arm/mach-kirkwood/include/mach/system.h b/arch/arm/mach-kirkwood/include/mach/system.h
index 8510f6c..23a1914 100644
--- a/arch/arm/mach-kirkwood/include/mach/system.h
+++ b/arch/arm/mach-kirkwood/include/mach/system.h
@@ -17,7 +17,7 @@ static inline void arch_idle(void)
 	cpu_do_idle();
 }
 
-static inline void arch_reset(char mode)
+static inline void arch_reset(char mode, const char *cmd)
 {
 	/*
 	 * Enable soft reset to assert RSTOUTn.
diff --git a/arch/arm/mach-ks8695/include/mach/system.h b/arch/arm/mach-ks8695/include/mach/system.h
index 5a9b032..fb1dda9 100644
--- a/arch/arm/mach-ks8695/include/mach/system.h
+++ b/arch/arm/mach-ks8695/include/mach/system.h
@@ -27,7 +27,7 @@ static void arch_idle(void)
 
 }
 
-static void arch_reset(char mode)
+static void arch_reset(char mode, const char *cmd)
 {
 	unsigned int reg;
 
diff --git a/arch/arm/mach-l7200/include/mach/system.h b/arch/arm/mach-l7200/include/mach/system.h
index 5272abe..e0dd3b6 100644
--- a/arch/arm/mach-l7200/include/mach/system.h
+++ b/arch/arm/mach-l7200/include/mach/system.h
@@ -19,7 +19,7 @@ static inline void arch_idle(void)
 	*(unsigned long *)(IO_BASE + 0x50004) = 1;	/* idle mode */
 }
 
-static inline void arch_reset(char mode)
+static inline void arch_reset(char mode, const char *cmd)
 {
 	if (mode == 's') {
 		cpu_reset(0);
diff --git a/arch/arm/mach-lh7a40x/include/mach/system.h b/arch/arm/mach-lh7a40x/include/mach/system.h
index fa46bb1..45a56d3 100644
--- a/arch/arm/mach-lh7a40x/include/mach/system.h
+++ b/arch/arm/mach-lh7a40x/include/mach/system.h
@@ -13,7 +13,7 @@ static inline void arch_idle(void)
 	cpu_do_idle ();
 }
 
-static inline void arch_reset(char mode)
+static inline void arch_reset(char mode, const char *cmd)
 {
 	cpu_reset (0);
 }
diff --git a/arch/arm/mach-loki/include/mach/system.h b/arch/arm/mach-loki/include/mach/system.h
index 8db1147..c1de36f 100644
--- a/arch/arm/mach-loki/include/mach/system.h
+++ b/arch/arm/mach-loki/include/mach/system.h
@@ -17,7 +17,7 @@ static inline void arch_idle(void)
 	cpu_do_idle();
 }
 
-static inline void arch_reset(char mode)
+static inline void arch_reset(char mode, const char *cmd)
 {
 	/*
 	 * Enable soft reset to assert RSTOUTn.
diff --git a/arch/arm/mach-msm/include/mach/system.h b/arch/arm/mach-msm/include/mach/system.h
index f05ad2e..574ccc4 100644
--- a/arch/arm/mach-msm/include/mach/system.h
+++ b/arch/arm/mach-msm/include/mach/system.h
@@ -17,7 +17,7 @@
 
 void arch_idle(void);
 
-static inline void arch_reset(char mode)
+static inline void arch_reset(char mode, const char *cmd)
 {
 	for (;;) ;  /* depends on IPC w/ other core */
 }
diff --git a/arch/arm/mach-mv78xx0/include/mach/system.h b/arch/arm/mach-mv78xx0/include/mach/system.h
index 7d51794..1d6350b 100644
--- a/arch/arm/mach-mv78xx0/include/mach/system.h
+++ b/arch/arm/mach-mv78xx0/include/mach/system.h
@@ -17,7 +17,7 @@ static inline void arch_idle(void)
 	cpu_do_idle();
 }
 
-static inline void arch_reset(char mode)
+static inline void arch_reset(char mode, const char *cmd)
 {
 	/*
 	 * Enable soft reset to assert RSTOUTn.
diff --git a/arch/arm/mach-mx2/system.c b/arch/arm/mach-mx2/system.c
index 7b82697..92c79d4 100644
--- a/arch/arm/mach-mx2/system.c
+++ b/arch/arm/mach-mx2/system.c
@@ -46,7 +46,7 @@ void arch_idle(void)
 /*
  * Reset the system. It is called by machine_restart().
  */
-void arch_reset(char mode)
+void arch_reset(char mode, const char *cmd)
 {
 	struct clk *clk;
 
diff --git a/arch/arm/mach-netx/include/mach/system.h b/arch/arm/mach-netx/include/mach/system.h
index 6c1023b..dc7b4bc 100644
--- a/arch/arm/mach-netx/include/mach/system.h
+++ b/arch/arm/mach-netx/include/mach/system.h
@@ -28,7 +28,7 @@ static inline void arch_idle(void)
 	cpu_do_idle();
 }
 
-static inline void arch_reset(char mode)
+static inline void arch_reset(char mode, const char *cmd)
 {
 	writel(NETX_SYSTEM_RES_CR_FIRMW_RES_EN | NETX_SYSTEM_RES_CR_FIRMW_RES,
 	       NETX_SYSTEM_RES_CR);
diff --git a/arch/arm/mach-ns9xxx/include/mach/system.h b/arch/arm/mach-ns9xxx/include/mach/system.h
index e2068c5..1561588 100644
--- a/arch/arm/mach-ns9xxx/include/mach/system.h
+++ b/arch/arm/mach-ns9xxx/include/mach/system.h
@@ -20,7 +20,7 @@ static inline void arch_idle(void)
 	cpu_do_idle();
 }
 
-static inline void arch_reset(char mode)
+static inline void arch_reset(char mode, const char *cmd)
 {
 #ifdef CONFIG_PROCESSOR_NS9360
 	if (processor_is_ns9360())
diff --git a/arch/arm/mach-orion5x/include/mach/system.h b/arch/arm/mach-orion5x/include/mach/system.h
index 08e4307..9b8db1d 100644
--- a/arch/arm/mach-orion5x/include/mach/system.h
+++ b/arch/arm/mach-orion5x/include/mach/system.h
@@ -19,7 +19,7 @@ static inline void arch_idle(void)
 	cpu_do_idle();
 }
 
-static inline void arch_reset(char mode)
+static inline void arch_reset(char mode, const char *cmd)
 {
 	/*
 	 * Enable and issue soft reset
diff --git a/arch/arm/mach-orion5x/lsmini-setup.c b/arch/arm/mach-orion5x/lsmini-setup.c
index e0c43b8..c9bf6b8 100644
--- a/arch/arm/mach-orion5x/lsmini-setup.c
+++ b/arch/arm/mach-orion5x/lsmini-setup.c
@@ -186,7 +186,7 @@ static struct mv_sata_platform_data lsmini_sata_data = {
 
 static void lsmini_power_off(void)
 {
-	arch_reset(0);
+	arch_reset(0, NULL);
 }
 
 
diff --git a/arch/arm/mach-pnx4008/include/mach/system.h b/arch/arm/mach-pnx4008/include/mach/system.h
index e12e7ab..5dda2bb 100644
--- a/arch/arm/mach-pnx4008/include/mach/system.h
+++ b/arch/arm/mach-pnx4008/include/mach/system.h
@@ -30,7 +30,7 @@ static void arch_idle(void)
 	cpu_do_idle();
 }
 
-static inline void arch_reset(char mode)
+static inline void arch_reset(char mode, const char *cmd)
 {
 	cpu_reset(0);
 }
diff --git a/arch/arm/mach-pxa/corgi.c b/arch/arm/mach-pxa/corgi.c
index 3b89e50..cdf21dd 100644
--- a/arch/arm/mach-pxa/corgi.c
+++ b/arch/arm/mach-pxa/corgi.c
@@ -635,16 +635,16 @@ static void corgi_poweroff(void)
 		/* Green LED off tells the bootloader to halt */
 		gpio_set_value(CORGI_GPIO_LED_GREEN, 0);
 
-	arm_machine_restart('h');
+	arm_machine_restart('h', NULL);
 }
 
-static void corgi_restart(char mode)
+static void corgi_restart(char mode, const char *cmd)
 {
 	if (!machine_is_corgi())
 		/* Green LED on tells the bootloader to reboot */
 		gpio_set_value(CORGI_GPIO_LED_GREEN, 1);
 
-	arm_machine_restart('h');
+	arm_machine_restart('h', cmd);
 }
 
 static void __init corgi_init(void)
diff --git a/arch/arm/mach-pxa/include/mach/system.h b/arch/arm/mach-pxa/include/mach/system.h
index 0a587c4..d1fce8b 100644
--- a/arch/arm/mach-pxa/include/mach/system.h
+++ b/arch/arm/mach-pxa/include/mach/system.h
@@ -20,4 +20,4 @@ static inline void arch_idle(void)
 }
 
 
-void arch_reset(char mode);
+void arch_reset(char mode, const char *cmd);
diff --git a/arch/arm/mach-pxa/mioa701.c b/arch/arm/mach-pxa/mioa701.c
index 0257727..97c93a7 100644
--- a/arch/arm/mach-pxa/mioa701.c
+++ b/arch/arm/mach-pxa/mioa701.c
@@ -788,13 +788,13 @@ static void mioa701_machine_exit(void);
 static void mioa701_poweroff(void)
 {
 	mioa701_machine_exit();
-	arm_machine_restart('s');
+	arm_machine_restart('s', NULL);
 }
 
-static void mioa701_restart(char c)
+static void mioa701_restart(char c, const char *cmd)
 {
 	mioa701_machine_exit();
-	arm_machine_restart('s');
+	arm_machine_restart('s', cmd);
 }
 
 struct gpio_ress global_gpios[] = {
diff --git a/arch/arm/mach-pxa/poodle.c b/arch/arm/mach-pxa/poodle.c
index 572ddec..036bbde 100644
--- a/arch/arm/mach-pxa/poodle.c
+++ b/arch/arm/mach-pxa/poodle.c
@@ -501,12 +501,12 @@ static struct platform_device *devices[] __initdata = {
 
 static void poodle_poweroff(void)
 {
-	arm_machine_restart('h');
+	arm_machine_restart('h', NULL);
 }
 
-static void poodle_restart(char mode)
+static void poodle_restart(char mode, const char *cmd)
 {
-	arm_machine_restart('h');
+	arm_machine_restart('h', cmd);
 }
 
 static void __init poodle_init(void)
diff --git a/arch/arm/mach-pxa/reset.c b/arch/arm/mach-pxa/reset.c
index 867c95c..df29d45 100644
--- a/arch/arm/mach-pxa/reset.c
+++ b/arch/arm/mach-pxa/reset.c
@@ -81,7 +81,7 @@ static void do_hw_reset(void)
 	OSMR3 = OSCR + 368640;	/* ... in 100 ms */
 }
 
-void arch_reset(char mode)
+void arch_reset(char mode, const char *cmd)
 {
 	clear_reset_status(RESET_STATUS_ALL);
 
diff --git a/arch/arm/mach-pxa/spitz.c b/arch/arm/mach-pxa/spitz.c
index f697c49..7a0a430 100644
--- a/arch/arm/mach-pxa/spitz.c
+++ b/arch/arm/mach-pxa/spitz.c
@@ -701,10 +701,10 @@ static struct platform_device *devices[] __initdata = {
 
 static void spitz_poweroff(void)
 {
-	arm_machine_restart('g');
+	arm_machine_restart('g', NULL);
 }
 
-static void spitz_restart(char mode)
+static void spitz_restart(char mode, const char *cmd)
 {
 	/* Bootloader magic for a reboot */
 	if((MSC0 & 0xffff0000) == 0x7ff00000)
diff --git a/arch/arm/mach-pxa/tosa.c b/arch/arm/mach-pxa/tosa.c
index 66b1380..4f6f502 100644
--- a/arch/arm/mach-pxa/tosa.c
+++ b/arch/arm/mach-pxa/tosa.c
@@ -876,10 +876,10 @@ static struct platform_device *devices[] __initdata = {
 
 static void tosa_poweroff(void)
 {
-	arm_machine_restart('g');
+	arm_machine_restart('g', NULL);
 }
 
-static void tosa_restart(char mode)
+static void tosa_restart(char mode, const char *cmd)
 {
 	/* Bootloader magic for a reboot */
 	if((MSC0 & 0xffff0000) == 0x7ff00000)
diff --git a/arch/arm/mach-realview/include/mach/system.h b/arch/arm/mach-realview/include/mach/system.h
index a2f61c7..1a15a44 100644
--- a/arch/arm/mach-realview/include/mach/system.h
+++ b/arch/arm/mach-realview/include/mach/system.h
@@ -34,7 +34,7 @@ static inline void arch_idle(void)
 	cpu_do_idle();
 }
 
-static inline void arch_reset(char mode)
+static inline void arch_reset(char mode, const char *cmd)
 {
 	void __iomem *hdr_ctrl = __io_address(REALVIEW_SYS_BASE) + REALVIEW_SYS_RESETCTL_OFFSET;
 	unsigned int val;
diff --git a/arch/arm/mach-rpc/include/mach/system.h b/arch/arm/mach-rpc/include/mach/system.h
index bd7268b..45c7b93 100644
--- a/arch/arm/mach-rpc/include/mach/system.h
+++ b/arch/arm/mach-rpc/include/mach/system.h
@@ -16,7 +16,7 @@ static inline void arch_idle(void)
 	cpu_do_idle();
 }
 
-static inline void arch_reset(char mode)
+static inline void arch_reset(char mode, const char *cmd)
 {
 	iomd_writeb(0, IOMD_ROMCR0);
 
diff --git a/arch/arm/mach-s3c2410/include/mach/system-reset.h b/arch/arm/mach-s3c2410/include/mach/system-reset.h
index 7613d0a..b8687f7 100644
--- a/arch/arm/mach-s3c2410/include/mach/system-reset.h
+++ b/arch/arm/mach-s3c2410/include/mach/system-reset.h
@@ -22,7 +22,7 @@
 extern void (*s3c24xx_reset_hook)(void);
 
 static void
-arch_reset(char mode)
+arch_reset(char mode, const char *cmd)
 {
 	struct clk *wdtclk;
 
diff --git a/arch/arm/mach-s3c6400/include/mach/system.h b/arch/arm/mach-s3c6400/include/mach/system.h
index 652bbc4..090cfd9 100644
--- a/arch/arm/mach-s3c6400/include/mach/system.h
+++ b/arch/arm/mach-s3c6400/include/mach/system.h
@@ -16,7 +16,7 @@ static void arch_idle(void)
 	/* nothing here yet */
 }
 
-static void arch_reset(char mode)
+static void arch_reset(char mode, const char *cmd)
 {
 	/* nothing here yet */
 }
diff --git a/arch/arm/mach-sa1100/include/mach/system.h b/arch/arm/mach-sa1100/include/mach/system.h
index 63755ca..942b153 100644
--- a/arch/arm/mach-sa1100/include/mach/system.h
+++ b/arch/arm/mach-sa1100/include/mach/system.h
@@ -10,7 +10,7 @@ static inline void arch_idle(void)
 	cpu_do_idle();
 }
 
-static inline void arch_reset(char mode)
+static inline void arch_reset(char mode, const char *cmd)
 {
 	if (mode == 's') {
 		/* Jump into ROM at address 0 */
diff --git a/arch/arm/mach-shark/core.c b/arch/arm/mach-shark/core.c
index 4f3a265..358d875 100644
--- a/arch/arm/mach-shark/core.c
+++ b/arch/arm/mach-shark/core.c
@@ -26,7 +26,7 @@
 #define ROMCARD_SIZE            0x08000000
 #define ROMCARD_START           0x10000000
 
-void arch_reset(char mode)
+void arch_reset(char mode, const char *cmd)
 {
         short temp;
         local_irq_disable();
diff --git a/arch/arm/mach-shark/include/mach/system.h b/arch/arm/mach-shark/include/mach/system.h
index 0752ca2..21c373b 100644
--- a/arch/arm/mach-shark/include/mach/system.h
+++ b/arch/arm/mach-shark/include/mach/system.h
@@ -7,7 +7,7 @@
 #define __ASM_ARCH_SYSTEM_H
 
 /* Found in arch/mach-shark/core.c */
-extern void arch_reset(char mode);
+extern void arch_reset(char mode, const char *cmd);
 
 static inline void arch_idle(void)
 {
diff --git a/arch/arm/mach-versatile/include/mach/system.h b/arch/arm/mach-versatile/include/mach/system.h
index c59e610..8ffc12a 100644
--- a/arch/arm/mach-versatile/include/mach/system.h
+++ b/arch/arm/mach-versatile/include/mach/system.h
@@ -34,7 +34,7 @@ static inline void arch_idle(void)
 	cpu_do_idle();
 }
 
-static inline void arch_reset(char mode)
+static inline void arch_reset(char mode, const char *cmd)
 {
 	u32 val;
 
diff --git a/arch/arm/mach-w90x900/include/mach/system.h b/arch/arm/mach-w90x900/include/mach/system.h
index 93753f9..9406400 100644
--- a/arch/arm/mach-w90x900/include/mach/system.h
+++ b/arch/arm/mach-w90x900/include/mach/system.h
@@ -21,7 +21,7 @@ static void arch_idle(void)
 {
 }
 
-static void arch_reset(char mode)
+static void arch_reset(char mode, const char *cmd)
 {
 	cpu_reset(0);
 }
diff --git a/arch/arm/plat-mxc/include/mach/system.h b/arch/arm/plat-mxc/include/mach/system.h
index bbfc374..cd03eba 100644
--- a/arch/arm/plat-mxc/include/mach/system.h
+++ b/arch/arm/plat-mxc/include/mach/system.h
@@ -26,7 +26,7 @@ static inline void arch_idle(void)
 	cpu_do_idle();
 }
 
-static inline void arch_reset(char mode)
+static inline void arch_reset(char mode, const char *cmd)
 {
 	cpu_reset(0);
 }
diff --git a/arch/arm/plat-omap/include/mach/system.h b/arch/arm/plat-omap/include/mach/system.h
index 06923f2..145e402 100644
--- a/arch/arm/plat-omap/include/mach/system.h
+++ b/arch/arm/plat-omap/include/mach/system.h
@@ -38,7 +38,7 @@ static inline void omap1_arch_reset(char mode)
 		omap_writew(1, ARM_RSTCT1);
 }
 
-static inline void arch_reset(char mode)
+static inline void arch_reset(char mode, const char *cmd)
 {
 	if (!cpu_class_is_omap2())
 		omap1_arch_reset(mode);
diff --git a/arch/arm/plat-s3c24xx/cpu.c b/arch/arm/plat-s3c24xx/cpu.c
index 542062f..1932b7e 100644
--- a/arch/arm/plat-s3c24xx/cpu.c
+++ b/arch/arm/plat-s3c24xx/cpu.c
@@ -182,7 +182,7 @@ static unsigned long s3c24xx_read_idcode_v4(void)
  * with the caches enabled. It seems at least the S3C2440 has a problem
  * resetting if there is bus activity interrupted by the reset.
  */
-static void s3c24xx_pm_restart(char mode)
+static void s3c24xx_pm_restart(char mode, const char *cmd)
 {
 	if (mode != 's') {
 		unsigned long flags;
@@ -191,12 +191,12 @@ static void s3c24xx_pm_restart(char mode)
 		__cpuc_flush_kern_all();
 		__cpuc_flush_user_all();
 
-		arch_reset(mode);
+		arch_reset(mode, cmd);
 		local_irq_restore(flags);
 	}
 
 	/* fallback, or unhandled */
-	arm_machine_restart(mode);
+	arm_machine_restart(mode, cmd);
 }
 
 void __init s3c24xx_init_io(struct map_desc *mach_desc, int size)

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

* Re: [PATCH 02/12] ARM: OMAP3: Store reboot mode in scratchpad on OMAP34xx
  2009-03-19  0:08                   ` Russell King - ARM Linux
@ 2009-03-19 15:56                     ` Tony Lindgren
  0 siblings, 0 replies; 49+ messages in thread
From: Tony Lindgren @ 2009-03-19 15:56 UTC (permalink / raw)
  To: Russell King - ARM Linux
  Cc: Juha Yrjola, linux-arm-kernel, Kevin Hilman, linux-omap

* Russell King - ARM Linux <linux@arm.linux.org.uk> [090318 17:08]:
> On Wed, Mar 18, 2009 at 01:10:04PM -0700, Tony Lindgren wrote:
> > * Russell King - ARM Linux <linux@arm.linux.org.uk> [090318 12:26]:
> > > On Wed, Mar 18, 2009 at 11:28:06AM -0700, Tony Lindgren wrote:
> > > > * Russell King - ARM Linux <linux@arm.linux.org.uk> [090316 15:22]:
> > > > > On Mon, Mar 16, 2009 at 07:40:24PM +0200, Juha Yrjola wrote:
> > > > > > Russell King - ARM Linux wrote:
> > > > > >
> > > > > >> Right.  You are aware that there is already a mechanism for doing this
> > > > > >> in the generic kernel (obviously not)?
> > > > > >
> > > > > > I am. Unfortunately, glibc fails to support this mechanism, as you say.  
> > > > > > I didn't want to start making such intrusive changes for our trivial 
> > > > > > need.
> > > > > 
> > > > > Yes, glibc sucks with that - they hide the Linux reboot syscall.
> > > > > Luckily, it is accessible via the syscall() interface:
> > > > > 
> > > > > #include <linux/reboot.h>
> > > > > 
> > > > > int sys_reboot(const char *cmd)
> > > > > {
> > > > > 	return syscall(SYS_reboot, LINUX_REBOOT_MAGIC1, LINUX_REBOOT_MAGIC2C,
> > > > > 			LINUX_REBOOT_CMD_RESTART2, cmd);
> > > > > }
> > > > > 
> > > > > >> sys_reboot() with LINUX_REBOOT_CMD_RESTART2 takes a string in addition
> > > > > >> to the standard parameters.  This string is passed into machine_restart()
> > > > > >> which we currently ignore.  If LINUX_REBOOT_CMD_RESTART is used, this
> > > > > >> string is NULL.
> > > > > >>
> > > > > >> We could change machine_restart() to pass this parameter through to
> > > > > >> arm_pm_restart() and ultimately down to arch_reset().
> > > > > >
> > > > > > Sure. With RESTART2, I could've even used the reboot notifier chain with  
> > > > > > an OMAP3-specific driver to store the string.
> > > > > 
> > > > > The notifier chain is called in any case.
> > > > > 
> > > > > > Are you suggesting to get rid of reboot_mode altogether? If not, could  
> > > > > > we still have the sysfs mechanism? A one-character reboot_mode would be  
> > > > > > plenty enough for us.
> > > > > 
> > > > > No, reboot mode tells _how_ to perform the reboot - whether that be
> > > > > by hardware reset, gpio reset or a soft call via the reset address.
> > > > > It's not supposed to tell the boot loader what to do.
> > > > 
> > > > So if the reboot mode can't be used for this.. Should we change Juha's
> > > > sysfs interface patch to store something else like bootloader_mode?
> > > > 
> > > > I guess we cannot use kexec for this either?
> > > 
> > > Why not use the mechanism that's already there as I've already pointed
> > > out?
> > 
> > Sorry I misunderstood, I thought you did not want to use reboot_mode
> > for this at all..
> 
> I don't want to use reboot_mode for this.  machine_restart() and the
> reboot syscall has a way of passing a string to the platform specific
> code, and I'm suggesting that if you want the boot loader to do some
> magic, that's the way to do it.  Use the 'cmd' argument provided to
> arch_reset() by the patch below - this will either be NULL if the
> standard reboot call is used, or a string if the alternative version
> is used.
> 
> > To recap, so we change machine_restart() like you described above, and then
> > this patch is still valid, except to update the description.
> 
> No, you've still got the wrong end of the stick.

<snip>

> diff --git a/arch/arm/include/asm/system.h b/arch/arm/include/asm/system.h
> index 811be55..0a0d49a 100644
> --- a/arch/arm/include/asm/system.h
> +++ b/arch/arm/include/asm/system.h
> @@ -97,8 +97,8 @@ extern void __show_regs(struct pt_regs *);
>  extern int cpu_architecture(void);
>  extern void cpu_init(void);
>  
> -void arm_machine_restart(char mode);
> -extern void (*arm_pm_restart)(char str);
> +void arm_machine_restart(char mode, const char *cmd);
> +extern void (*arm_pm_restart)(char str, const char *cmd);
>  
>  #define UDBG_UNDEFINED	(1 << 0)
>  #define UDBG_SYSCALL	(1 << 1)
> diff --git a/arch/arm/kernel/process.c b/arch/arm/kernel/process.c
> index af377c7..2de14e2 100644
> --- a/arch/arm/kernel/process.c
> +++ b/arch/arm/kernel/process.c
> @@ -83,7 +83,7 @@ static int __init hlt_setup(char *__unused)
>  __setup("nohlt", nohlt_setup);
>  __setup("hlt", hlt_setup);
>  
> -void arm_machine_restart(char mode)
> +void arm_machine_restart(char mode, const char *cmd)
>  {
>  	/*
>  	 * Clean and disable cache, and turn off interrupts
> @@ -100,7 +100,7 @@ void arm_machine_restart(char mode)
>  	/*
>  	 * Now call the architecture specific reboot code.
>  	 */
> -	arch_reset(mode);
> +	arch_reset(mode, cmd);
>  
>  	/*
>  	 * Whoops - the architecture was unable to reboot.
> @@ -120,7 +120,7 @@ EXPORT_SYMBOL(pm_idle);
>  void (*pm_power_off)(void);
>  EXPORT_SYMBOL(pm_power_off);
>  
> -void (*arm_pm_restart)(char str) = arm_machine_restart;
> +void (*arm_pm_restart)(char str, const char *cmd) = arm_machine_restart;
>  EXPORT_SYMBOL_GPL(arm_pm_restart);
>  
>  
> @@ -195,9 +195,9 @@ void machine_power_off(void)
>  		pm_power_off();
>  }
>  
> -void machine_restart(char * __unused)
> +void machine_restart(char *cmd)
>  {
> -	arm_pm_restart(reboot_mode);
> +	arm_pm_restart(reboot_mode, cmd);
>  }
>  
>  void __show_regs(struct pt_regs *regs)

<snip>

Got it now, looks good to me.

Acked-by: Tony Lindgren <tony@atomide.com>

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

* Re: [PATCH 02/12] ARM: OMAP3: Store reboot mode in scratchpad on OMAP34xx
  2009-03-10 21:03 ` [PATCH 02/12] ARM: OMAP3: Store reboot mode in scratchpad on OMAP34xx Tony Lindgren
  2009-03-15 15:51   ` Russell King - ARM Linux
@ 2009-03-24  1:11   ` Tony Lindgren
  1 sibling, 0 replies; 49+ messages in thread
From: Tony Lindgren @ 2009-03-24  1:11 UTC (permalink / raw)
  To: linux-arm-kernel; +Cc: Juha Yrjola, Kevin Hilman, linux-omap

* Tony Lindgren <tony@atomide.com> [090310 14:04]:
> From: Juha Yrjola <juha.yrjola@solidboot.com>
> 
> The reboot mode can be communicated to a bootloader (or the
> kernel itself) with a scratchpad register. This functionality
> is especially useful, if userspace is allowed to change
> the reboot mode.
> 
> Patch updated by Tony to also define the BOODMOD registers.

Dropping this from my upstream queue for now, it sounds like
we can apply it as a fix after it's been updated to use cmd
instead of mode.

Tony

 
> Signed-off-by: Juha Yrjola <juha.yrjola@solidboot.com>
> Acked-by: Kevin Hilman <khilman@deeprootsystems.com>
> Signed-off-by: Tony Lindgren <tony@atomide.com>
> ---
>  arch/arm/mach-omap2/prcm.c                |   14 ++++++++++++--
>  arch/arm/plat-omap/include/mach/control.h |    9 +++++++++
>  2 files changed, 21 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/arm/mach-omap2/prcm.c b/arch/arm/mach-omap2/prcm.c
> index f945156..12c0e03 100644
> --- a/arch/arm/mach-omap2/prcm.c
> +++ b/arch/arm/mach-omap2/prcm.c
> @@ -19,6 +19,7 @@
>  #include <linux/io.h>
>  
>  #include <mach/common.h>
> +#include <mach/control.h>
>  #include <mach/prcm.h>
>  
>  #include "clock.h"
> @@ -43,9 +44,18 @@ void omap_prcm_arch_reset(char mode)
>  
>  	if (cpu_is_omap24xx())
>  		prcm_offs = WKUP_MOD;
> -	else if (cpu_is_omap34xx())
> +	else if (cpu_is_omap34xx()) {
> +		u32 l;
> +
>  		prcm_offs = OMAP3430_GR_MOD;
> -	else
> +		l = ('B' << 24) | ('M' << 16) | mode;
> +		/* Reserve the first word in scratchpad for communicating
> +		 * with the boot ROM. A pointer to a data structure
> +		 * describing the boot process can be stored there,
> +		 * cf. OMAP34xx TRM, Initialization / Software Booting
> +		 * Configuration. */
> +		omap_writel(l, OMAP343X_SCRATCHPAD + 4);
> +	} else
>  		WARN_ON(1);
>  
>  	prm_set_mod_reg_bits(OMAP_RST_DPLL3, prcm_offs, RM_RSTCTRL);
> diff --git a/arch/arm/plat-omap/include/mach/control.h b/arch/arm/plat-omap/include/mach/control.h
> index 269147f..1e1bcff 100644
> --- a/arch/arm/plat-omap/include/mach/control.h
> +++ b/arch/arm/plat-omap/include/mach/control.h
> @@ -189,6 +189,15 @@
>  #define OMAP2_PBIASLITEPWRDNZ0		(1 << 1)
>  #define OMAP2_PBIASLITEVMODE0		(1 << 0)
>  
> +/* CONTROL_IVA2_BOOTMOD bits */
> +#define OMAP3_IVA2_BOOTMOD_SHIFT	0
> +#define OMAP3_IVA2_BOOTMOD_MASK		(0xf << 0)
> +#define OMAP3_IVA2_BOOTMOD_IDLE		(0x1 << 0)
> +
> +#define OMAP343X_SCRATCHPAD_ROM		(OMAP343X_CTRL_BASE + 0x860)
> +#define OMAP343X_SCRATCHPAD		(OMAP343X_CTRL_BASE + 0x910)
> +#define OMAP343X_SCRATCHPAD_ROM_OFFSET	0x19C
> +
>  #ifndef __ASSEMBLY__
>  #if defined(CONFIG_ARCH_OMAP2) || defined(CONFIG_ARCH_OMAP3)
>  extern void __iomem *omap_ctrl_base_get(void);
> 
> --
> 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] 49+ messages in thread

* Re: [PATCH 11/12] ARM: OMAP3: Add base address definitions and resources for OMAP 3 IS, v2
  2009-03-10 21:15 ` [PATCH 11/12] ARM: OMAP3: Add base address definitions and resources for OMAP 3 IS Tony Lindgren
@ 2009-03-24  1:37   ` Tony Lindgren
  0 siblings, 0 replies; 49+ messages in thread
From: Tony Lindgren @ 2009-03-24  1:37 UTC (permalink / raw)
  To: linux-arm-kernel; +Cc: linux-omap, Sakari Ailus

[-- Attachment #1: Type: text/plain, Size: 246 bytes --]

* Tony Lindgren <tony@atomide.com> [090310 14:15]:
> This replaces earlier patch from Sergio Aguirre titled "[REVIEW PATCH 03/14]
> OMAP34XX: CAM: Resources fixes".

Here's this one updated to apply on top of Hiroshi's mbox updates
series.

Tony

[-- Attachment #2: camera-isp-resources-v2.patch --]
[-- Type: text/x-diff, Size: 5408 bytes --]

>From 85262ef9917eea14d5aaa37996e3f9205eee9e3d Mon Sep 17 00:00:00 2001
From: Tony Lindgren <tony@atomide.com>
Date: Mon, 23 Mar 2009 18:23:49 -0700
Subject: [PATCH] ARM: OMAP3: Add base address definitions and resources for OMAP 3 IS, v2

This replaces earlier patch from Sergio Aguirre titled "[REVIEW PATCH 03/14]
OMAP34XX: CAM: Resources fixes".

Signed-off-by: Sakari Ailus <sakari.ailus@maxwell.research.nokia.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>

diff --git a/arch/arm/mach-omap2/devices.c b/arch/arm/mach-omap2/devices.c
index 14537ff..7b2af1b 100644
--- a/arch/arm/mach-omap2/devices.c
+++ b/arch/arm/mach-omap2/devices.c
@@ -28,6 +28,113 @@
 #include <mach/eac.h>
 #include <mach/mmc.h>
 
+#if defined(CONFIG_VIDEO_OMAP2) || defined(CONFIG_VIDEO_OMAP2_MODULE)
+
+static struct resource cam_resources[] = {
+	{
+		.start		= OMAP24XX_CAMERA_BASE,
+		.end		= OMAP24XX_CAMERA_BASE + 0xfff,
+		.flags		= IORESOURCE_MEM,
+	},
+	{
+		.start		= INT_24XX_CAM_IRQ,
+		.flags		= IORESOURCE_IRQ,
+	}
+};
+
+static struct platform_device omap_cam_device = {
+	.name		= "omap24xxcam",
+	.id		= -1,
+	.num_resources	= ARRAY_SIZE(cam_resources),
+	.resource	= cam_resources,
+};
+
+static inline void omap_init_camera(void)
+{
+	platform_device_register(&omap_cam_device);
+}
+
+#elif defined(CONFIG_VIDEO_OMAP3) || defined(CONFIG_VIDEO_OMAP3_MODULE)
+
+static struct resource omap3isp_resources[] = {
+	{
+		.start		= OMAP3430_ISP_BASE,
+		.end		= OMAP3430_ISP_END,
+		.flags		= IORESOURCE_MEM,
+	},
+	{
+		.start		= OMAP3430_ISP_CBUFF_BASE,
+		.end		= OMAP3430_ISP_CBUFF_END,
+		.flags		= IORESOURCE_MEM,
+	},
+	{
+		.start		= OMAP3430_ISP_CCP2_BASE,
+		.end		= OMAP3430_ISP_CCP2_END,
+		.flags		= IORESOURCE_MEM,
+	},
+	{
+		.start		= OMAP3430_ISP_CCDC_BASE,
+		.end		= OMAP3430_ISP_CCDC_END,
+		.flags		= IORESOURCE_MEM,
+	},
+	{
+		.start		= OMAP3430_ISP_HIST_BASE,
+		.end		= OMAP3430_ISP_HIST_END,
+		.flags		= IORESOURCE_MEM,
+	},
+	{
+		.start		= OMAP3430_ISP_H3A_BASE,
+		.end		= OMAP3430_ISP_H3A_END,
+		.flags		= IORESOURCE_MEM,
+	},
+	{
+		.start		= OMAP3430_ISP_PREV_BASE,
+		.end		= OMAP3430_ISP_PREV_END,
+		.flags		= IORESOURCE_MEM,
+	},
+	{
+		.start		= OMAP3430_ISP_RESZ_BASE,
+		.end		= OMAP3430_ISP_RESZ_END,
+		.flags		= IORESOURCE_MEM,
+	},
+	{
+		.start		= OMAP3430_ISP_SBL_BASE,
+		.end		= OMAP3430_ISP_SBL_END,
+		.flags		= IORESOURCE_MEM,
+	},
+	{
+		.start		= OMAP3430_ISP_CSI2A_BASE,
+		.end		= OMAP3430_ISP_CSI2A_END,
+		.flags		= IORESOURCE_MEM,
+	},
+	{
+		.start		= OMAP3430_ISP_CSI2PHY_BASE,
+		.end		= OMAP3430_ISP_CSI2PHY_END,
+		.flags		= IORESOURCE_MEM,
+	},
+	{
+		.start		= INT_34XX_CAM_IRQ,
+		.flags		= IORESOURCE_IRQ,
+	}
+};
+
+static struct platform_device omap3isp_device = {
+	.name		= "omap3isp",
+	.id		= -1,
+	.num_resources	= ARRAY_SIZE(omap3isp_resources),
+	.resource	= omap3isp_resources,
+};
+
+static inline void omap_init_camera(void)
+{
+	platform_device_register(&omap3isp_device);
+}
+#else
+static inline void omap_init_camera(void)
+{
+}
+#endif
+
 #if defined(CONFIG_OMAP_MBOX_FWK) || defined(CONFIG_OMAP_MBOX_FWK_MODULE)
 
 #define MBOX_REG_SIZE	0x120
@@ -527,6 +634,7 @@ static int __init omap2_init_devices(void)
 	 * in alphabetical order so they're easier to sort through.
 	 */
 	omap_hsmmc_reset();
+	omap_init_camera();
 	omap_init_mbox();
 	omap_init_mcspi();
 	omap_hdq_init();
diff --git a/arch/arm/plat-omap/include/mach/omap34xx.h b/arch/arm/plat-omap/include/mach/omap34xx.h
index 89173f1..1b1c35d 100644
--- a/arch/arm/plat-omap/include/mach/omap34xx.h
+++ b/arch/arm/plat-omap/include/mach/omap34xx.h
@@ -49,6 +49,33 @@
 #define OMAP343X_CTRL_BASE	OMAP343X_SCM_BASE
 
 #define OMAP34XX_IC_BASE	0x48200000
+
+#define OMAP3430_ISP_BASE		(L4_34XX_BASE + 0xBC000)
+#define OMAP3430_ISP_CBUFF_BASE		(OMAP3430_ISP_BASE + 0x0100)
+#define OMAP3430_ISP_CCP2_BASE		(OMAP3430_ISP_BASE + 0x0400)
+#define OMAP3430_ISP_CCDC_BASE		(OMAP3430_ISP_BASE + 0x0600)
+#define OMAP3430_ISP_HIST_BASE		(OMAP3430_ISP_BASE + 0x0A00)
+#define OMAP3430_ISP_H3A_BASE		(OMAP3430_ISP_BASE + 0x0C00)
+#define OMAP3430_ISP_PREV_BASE		(OMAP3430_ISP_BASE + 0x0E00)
+#define OMAP3430_ISP_RESZ_BASE		(OMAP3430_ISP_BASE + 0x1000)
+#define OMAP3430_ISP_SBL_BASE		(OMAP3430_ISP_BASE + 0x1200)
+#define OMAP3430_ISP_MMU_BASE		(OMAP3430_ISP_BASE + 0x1400)
+#define OMAP3430_ISP_CSI2A_BASE		(OMAP3430_ISP_BASE + 0x1800)
+#define OMAP3430_ISP_CSI2PHY_BASE	(OMAP3430_ISP_BASE + 0x1970)
+
+#define OMAP3430_ISP_END		(OMAP3430_ISP_BASE         + 0x06F)
+#define OMAP3430_ISP_CBUFF_END		(OMAP3430_ISP_CBUFF_BASE   + 0x077)
+#define OMAP3430_ISP_CCP2_END		(OMAP3430_ISP_CCP2_BASE    + 0x1EF)
+#define OMAP3430_ISP_CCDC_END		(OMAP3430_ISP_CCDC_BASE    + 0x0A7)
+#define OMAP3430_ISP_HIST_END		(OMAP3430_ISP_HIST_BASE    + 0x047)
+#define OMAP3430_ISP_H3A_END		(OMAP3430_ISP_H3A_BASE     + 0x05F)
+#define OMAP3430_ISP_PREV_END		(OMAP3430_ISP_PREV_BASE    + 0x09F)
+#define OMAP3430_ISP_RESZ_END		(OMAP3430_ISP_RESZ_BASE    + 0x0AB)
+#define OMAP3430_ISP_SBL_END		(OMAP3430_ISP_SBL_BASE     + 0x0FB)
+#define OMAP3430_ISP_MMU_END		(OMAP3430_ISP_MMU_BASE     + 0x06F)
+#define OMAP3430_ISP_CSI2A_END		(OMAP3430_ISP_CSI2A_BASE   + 0x16F)
+#define OMAP3430_ISP_CSI2PHY_END	(OMAP3430_ISP_CSI2PHY_BASE + 0x007)
+
 #define OMAP34XX_IVA_INTC_BASE	0x40000000
 #define OMAP34XX_HSUSB_OTG_BASE	(L4_34XX_BASE + 0xAB000)
 #define OMAP34XX_HSUSB_HOST_BASE	(L4_34XX_BASE + 0x64000)

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

* Re: [PATCH 00/12] Omap3 updates for the merge window after 2.6.29
  2009-03-10 21:00 [PATCH 00/12] Omap3 updates for the merge window after 2.6.29 Tony Lindgren
                   ` (11 preceding siblings ...)
  2009-03-10 21:16 ` [PATCH 12/12] ARM: OMAP3: MUSB initialization for omap hw Tony Lindgren
@ 2009-03-24  2:51 ` Tony Lindgren
  12 siblings, 0 replies; 49+ messages in thread
From: Tony Lindgren @ 2009-03-24  2:51 UTC (permalink / raw)
  To: linux-arm-kernel; +Cc: linux-omap

* Tony Lindgren <tony@atomide.com> [090310 14:01]:
> Hi all,
> 
> Here are the patches I promised last week, sorry for the delay
> in posting them. I ended up leaving out the mach-omap3/board-*.c
> files as they still need a bit of work.
> 
> I may post one more series after this to add few more omap3
> boards if we have enough time.

I've added this series to my for-next branch. That is except for
the "ARM: OMAP3: Store reboot mode in scratchpad on OMAP34xx" patch
that needs to be updated.
 
> Cheers,
> 
> Tony
> 
> ---
> 
> Adrian Hunter (3):
>       ARM: OMAP3: mmc-twl4030 allow arbitrary slot names
>       ARM: OMAP3: mmc-twl4030 add cover switch
>       ARM: OMAP3: mmc-twl4030 fix name buffer length
> 
> David Brownell (3):
>       ARM: OMAP3: mmc-twl4030 fix for vmmc = 0
>       ARM: OMAP3: mmc-twl4030 init passes device nodes back
>       ARM: OMAP3: mmc-twl4030 voltage cleanup
> 
> Felipe Balbi (1):
>       ARM: OMAP3: MUSB initialization for omap hw
> 
> Grazvydas Ignotas (1):
>       ARM: OMAP3: mmc-twl4030 add MMC3 support
> 
> Jarkko Nikula (1):
>       ARM: OMAP3: Remove unused CONFIG_I2C2_OMAP_BEAGLE
> 
> Juha Yrjola (1):
>       ARM: OMAP3: Store reboot mode in scratchpad on OMAP34xx
> 
> Tony Lindgren (2):
>       ARM: OMAP3: Add base address definitions and resources for OMAP 3 IS
>       ARM: OMAP3: Add more GPIO mux options
> 
> 
>  arch/arm/mach-omap2/Makefile               |    2 
>  arch/arm/mach-omap2/board-2430sdp.c        |    2 
>  arch/arm/mach-omap2/board-ldp.c            |    2 
>  arch/arm/mach-omap2/board-omap3beagle.c    |    5 -
>  arch/arm/mach-omap2/board-omap3pandora.c   |    9 +
>  arch/arm/mach-omap2/board-overo.c          |    3 
>  arch/arm/mach-omap2/devices.c              |  108 ++++++++++++++++
>  arch/arm/mach-omap2/mmc-twl4030.c          |  186 ++++++++++++++++++++--------
>  arch/arm/mach-omap2/mmc-twl4030.h          |    6 +
>  arch/arm/mach-omap2/mux.c                  |   27 ++++
>  arch/arm/mach-omap2/prcm.c                 |   14 ++
>  arch/arm/mach-omap2/usb-musb.c             |  185 ++++++++++++++++++++++++++++
>  arch/arm/plat-omap/devices.c               |    3 
>  arch/arm/plat-omap/include/mach/control.h  |    9 +
>  arch/arm/plat-omap/include/mach/mmc.h      |    2 
>  arch/arm/plat-omap/include/mach/mux.h      |   13 ++
>  arch/arm/plat-omap/include/mach/omap34xx.h |   27 ++++
>  arch/arm/plat-omap/include/mach/usb.h      |    8 +
>  18 files changed, 549 insertions(+), 62 deletions(-)
>  create mode 100644 arch/arm/mach-omap2/usb-musb.c
> 
> -- 
> Signature
> --
> 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] 49+ messages in thread

* [APPLIED] [PATCH] ARM: OMAP: Add name for musb clocks
  2009-03-16 22:42       ` [PATCH] ARM: OMAP: Add name for musb clocks Tony Lindgren
@ 2009-05-12 17:40         ` Tony Lindgren
  0 siblings, 0 replies; 49+ messages in thread
From: Tony Lindgren @ 2009-05-12 17:40 UTC (permalink / raw)
  To: linux-omap

This patch has been applied to the linux-omap
by youw fwiendly patch wobot.

Initial commit ID (Likely to change): 7c8bb23f02911def7e5196fbd39f5c16d09dc635

PatchWorks
http://patchwork.kernel.org/patch/12500/

Git (Likely to change, and takes a while to get mirrored)
http://git.kernel.org/?p=linux/kernel/git/tmlind/linux-omap-2.6.git;a=commit;h=7c8bb23f02911def7e5196fbd39f5c16d09dc635



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

end of thread, other threads:[~2009-05-12 17:40 UTC | newest]

Thread overview: 49+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-03-10 21:00 [PATCH 00/12] Omap3 updates for the merge window after 2.6.29 Tony Lindgren
2009-03-10 21:02 ` [PATCH 01/12] ARM: OMAP3: Remove unused CONFIG_I2C2_OMAP_BEAGLE Tony Lindgren
2009-03-10 21:03 ` [PATCH 02/12] ARM: OMAP3: Store reboot mode in scratchpad on OMAP34xx Tony Lindgren
2009-03-15 15:51   ` Russell King - ARM Linux
2009-03-16 16:07     ` Juha Yrjola
2009-03-16 17:10       ` Russell King - ARM Linux
2009-03-16 17:40         ` Juha Yrjola
2009-03-16 22:21           ` Russell King - ARM Linux
2009-03-18 18:28             ` Tony Lindgren
2009-03-18 19:26               ` Russell King - ARM Linux
2009-03-18 20:10                 ` Tony Lindgren
2009-03-18 20:15                   ` Tony Lindgren
2009-03-19  0:08                   ` Russell King - ARM Linux
2009-03-19 15:56                     ` Tony Lindgren
2009-03-24  1:11   ` Tony Lindgren
2009-03-10 21:04 ` [PATCH 03/12] ARM: OMAP3: Add more GPIO mux options Tony Lindgren
2009-03-10 21:06 ` [PATCH 04/12] ARM: OMAP3: mmc-twl4030 fix name buffer length Tony Lindgren
2009-03-15 16:00   ` Russell King - ARM Linux
2009-03-16 10:04     ` Adrian Hunter
2009-03-16 10:14       ` Russell King - ARM Linux
2009-03-16 17:42         ` Tony Lindgren
2009-03-16 22:22           ` Russell King - ARM Linux
2009-03-10 21:07 ` [PATCH 05/12] ARM: OMAP3: mmc-twl4030 voltage cleanup Tony Lindgren
2009-03-10 21:08 ` [PATCH 06/12] ARM: OMAP3: mmc-twl4030 init passes device nodes back Tony Lindgren
2009-03-15 16:02   ` Russell King - ARM Linux
2009-03-16 17:44     ` Tony Lindgren
2009-03-16 22:22       ` Russell King - ARM Linux
2009-03-10 21:10 ` [PATCH 07/12] ARM: OMAP3: mmc-twl4030 add MMC3 support Tony Lindgren
2009-03-15 16:04   ` Russell King - ARM Linux
2009-03-15 17:27     ` Grazvydas Ignotas
2009-03-15 17:40       ` Russell King - ARM Linux
2009-03-16 17:56         ` [PATCH 07/12] ARM: OMAP3: mmc-twl4030 add MMC3 support, v2 Tony Lindgren
2009-03-10 21:11 ` [PATCH 08/12] ARM: OMAP3: mmc-twl4030 fix for vmmc = 0 Tony Lindgren
2009-03-10 21:12 ` [PATCH 09/12] ARM: OMAP3: mmc-twl4030 add cover switch Tony Lindgren
2009-03-10 21:13 ` [PATCH 10/12] ARM: OMAP3: mmc-twl4030 allow arbitrary slot names Tony Lindgren
2009-03-15 16:08   ` Russell King - ARM Linux
2009-03-16 10:04     ` Adrian Hunter
2009-03-16 10:05     ` Adrian Hunter
2009-03-16 10:16       ` Russell King - ARM Linux
2009-03-16 18:01         ` Tony Lindgren
2009-03-10 21:15 ` [PATCH 11/12] ARM: OMAP3: Add base address definitions and resources for OMAP 3 IS Tony Lindgren
2009-03-24  1:37   ` [PATCH 11/12] ARM: OMAP3: Add base address definitions and resources for OMAP 3 IS, v2 Tony Lindgren
2009-03-10 21:16 ` [PATCH 12/12] ARM: OMAP3: MUSB initialization for omap hw Tony Lindgren
2009-03-15 16:14   ` Russell King - ARM Linux
2009-03-15 18:46     ` David Brownell
2009-03-16 22:42       ` [PATCH] ARM: OMAP: Add name for musb clocks Tony Lindgren
2009-05-12 17:40         ` [APPLIED] " Tony Lindgren
2009-03-16 22:37     ` [PATCH 12/12] ARM: OMAP3: MUSB initialization for omap hw, v2 Tony Lindgren
2009-03-24  2:51 ` [PATCH 00/12] Omap3 updates for the merge window after 2.6.29 Tony Lindgren

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.