All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/8] ARM: LPC32xx specific updates for next, second set
@ 2012-06-27 22:26 ` Roland Stigge
  0 siblings, 0 replies; 18+ messages in thread
From: Roland Stigge @ 2012-06-27 22:26 UTC (permalink / raw)
  To: arm, linux-arm-kernel, linux-kernel, kevin.wells, srinivas.bakki,
	aletes.xgr
  Cc: Roland Stigge

This is the second round of patches for mach-lpc32xx, for v3.6. It builds upon
the first round of 22 patches and includes clock updates that separate out
initialization from the board specific init to clock.c.

Further, a defconfig update for LPC32xx, dts file update and mmc bugfix is
included.

Signed-off-by: Roland Stigge <stigge@antcom.de>

--

You can also pull from

  git://git.antcom.de/linux-2.6.git lpc32xx-next2

Roland Stigge (6):
 ARM: LPC32xx: Init MMC via clock
 ARM: LPC32xx: Add further bits to MMC init
 ARM: LPC32xx: Remove wrong re-initialization of MMC clock register
 ARM: LPC32xx: Update DTS file for EA3250 board
 ARM: LPC32xx: Defconfig update
 ARM: LPC32xx: Remove USB and I2C init from phy3250.c
Alexandre Pereira da Silva (2):
 ARM: LPC32xx: Cleanup USB clock init
 ARM: LPC32xx: Remove unused gpios

 arch/arm/boot/dts/ea3250.dts                  |   17 ++++
 arch/arm/configs/lpc32xx_defconfig            |    2 
 arch/arm/mach-lpc32xx/clock.c                 |   90 ++++++++++++++++++++++----
 arch/arm/mach-lpc32xx/include/mach/platform.h |   14 ++++
 arch/arm/mach-lpc32xx/phy3250.c               |   20 -----
 5 files changed, 112 insertions(+), 31 deletions(-)

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

* [PATCH 0/8] ARM: LPC32xx specific updates for next, second set
@ 2012-06-27 22:26 ` Roland Stigge
  0 siblings, 0 replies; 18+ messages in thread
From: Roland Stigge @ 2012-06-27 22:26 UTC (permalink / raw)
  To: linux-arm-kernel

This is the second round of patches for mach-lpc32xx, for v3.6. It builds upon
the first round of 22 patches and includes clock updates that separate out
initialization from the board specific init to clock.c.

Further, a defconfig update for LPC32xx, dts file update and mmc bugfix is
included.

Signed-off-by: Roland Stigge <stigge@antcom.de>

--

You can also pull from

  git://git.antcom.de/linux-2.6.git lpc32xx-next2

Roland Stigge (6):
 ARM: LPC32xx: Init MMC via clock
 ARM: LPC32xx: Add further bits to MMC init
 ARM: LPC32xx: Remove wrong re-initialization of MMC clock register
 ARM: LPC32xx: Update DTS file for EA3250 board
 ARM: LPC32xx: Defconfig update
 ARM: LPC32xx: Remove USB and I2C init from phy3250.c
Alexandre Pereira da Silva (2):
 ARM: LPC32xx: Cleanup USB clock init
 ARM: LPC32xx: Remove unused gpios

 arch/arm/boot/dts/ea3250.dts                  |   17 ++++
 arch/arm/configs/lpc32xx_defconfig            |    2 
 arch/arm/mach-lpc32xx/clock.c                 |   90 ++++++++++++++++++++++----
 arch/arm/mach-lpc32xx/include/mach/platform.h |   14 ++++
 arch/arm/mach-lpc32xx/phy3250.c               |   20 -----
 5 files changed, 112 insertions(+), 31 deletions(-)

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

* [PATCH 1/8] ARM: LPC32xx: Init MMC via clock
  2012-06-27 22:26 ` Roland Stigge
@ 2012-06-27 22:26   ` Roland Stigge
  -1 siblings, 0 replies; 18+ messages in thread
From: Roland Stigge @ 2012-06-27 22:26 UTC (permalink / raw)
  To: arm, linux-arm-kernel, linux-kernel, kevin.wells, srinivas.bakki,
	aletes.xgr
  Cc: Roland Stigge

This patch moves MMC/SD controller initialization from the board specific file
phy3250.c to clock.c.

Signed-off-by: Roland Stigge <stigge@antcom.de>
Acked-by: Alexandre Pereira da Silva <aletes.xgr@gmail.com>

---
 arch/arm/mach-lpc32xx/clock.c   |    6 ++++--
 arch/arm/mach-lpc32xx/phy3250.c |    5 -----
 2 files changed, 4 insertions(+), 7 deletions(-)

--- linux-2.6.orig/arch/arm/mach-lpc32xx/clock.c
+++ linux-2.6/arch/arm/mach-lpc32xx/clock.c
@@ -812,11 +812,13 @@ static int mmc_onoff_enable(struct clk *
 	u32 tmp;
 
 	tmp = __raw_readl(LPC32XX_CLKPWR_MS_CTRL) &
-		~LPC32XX_CLKPWR_MSCARD_SDCARD_EN;
+		~(LPC32XX_CLKPWR_MSCARD_SDCARD_EN |
+		  LPC32XX_CLKPWR_MSCARD_MSDIO_PU_EN);
 
 	/* If rate is 0, disable clock */
 	if (enable != 0)
-		tmp |= LPC32XX_CLKPWR_MSCARD_SDCARD_EN;
+		tmp |= LPC32XX_CLKPWR_MSCARD_SDCARD_EN |
+			LPC32XX_CLKPWR_MSCARD_MSDIO_PU_EN;
 
 	__raw_writel(tmp, LPC32XX_CLKPWR_MS_CTRL);
 
--- linux-2.6.orig/arch/arm/mach-lpc32xx/phy3250.c
+++ linux-2.6/arch/arm/mach-lpc32xx/phy3250.c
@@ -262,11 +262,6 @@ static void __init lpc3250_machine_init(
 
 	lpc32xx_serial_init();
 
-	tmp = __raw_readl(LPC32XX_CLKPWR_MS_CTRL);
-	tmp |= LPC32XX_CLKPWR_MSCARD_SDCARD_EN |
-		LPC32XX_CLKPWR_MSCARD_MSDIO_PU_EN;
-	__raw_writel(tmp, LPC32XX_CLKPWR_MS_CTRL);
-
 	/* Test clock needed for UDA1380 initial init */
 	__raw_writel(LPC32XX_CLKPWR_TESTCLK2_SEL_MOSC |
 		LPC32XX_CLKPWR_TESTCLK_TESTCLK2_EN,

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

* [PATCH 1/8] ARM: LPC32xx: Init MMC via clock
@ 2012-06-27 22:26   ` Roland Stigge
  0 siblings, 0 replies; 18+ messages in thread
From: Roland Stigge @ 2012-06-27 22:26 UTC (permalink / raw)
  To: linux-arm-kernel

This patch moves MMC/SD controller initialization from the board specific file
phy3250.c to clock.c.

Signed-off-by: Roland Stigge <stigge@antcom.de>
Acked-by: Alexandre Pereira da Silva <aletes.xgr@gmail.com>

---
 arch/arm/mach-lpc32xx/clock.c   |    6 ++++--
 arch/arm/mach-lpc32xx/phy3250.c |    5 -----
 2 files changed, 4 insertions(+), 7 deletions(-)

--- linux-2.6.orig/arch/arm/mach-lpc32xx/clock.c
+++ linux-2.6/arch/arm/mach-lpc32xx/clock.c
@@ -812,11 +812,13 @@ static int mmc_onoff_enable(struct clk *
 	u32 tmp;
 
 	tmp = __raw_readl(LPC32XX_CLKPWR_MS_CTRL) &
-		~LPC32XX_CLKPWR_MSCARD_SDCARD_EN;
+		~(LPC32XX_CLKPWR_MSCARD_SDCARD_EN |
+		  LPC32XX_CLKPWR_MSCARD_MSDIO_PU_EN);
 
 	/* If rate is 0, disable clock */
 	if (enable != 0)
-		tmp |= LPC32XX_CLKPWR_MSCARD_SDCARD_EN;
+		tmp |= LPC32XX_CLKPWR_MSCARD_SDCARD_EN |
+			LPC32XX_CLKPWR_MSCARD_MSDIO_PU_EN;
 
 	__raw_writel(tmp, LPC32XX_CLKPWR_MS_CTRL);
 
--- linux-2.6.orig/arch/arm/mach-lpc32xx/phy3250.c
+++ linux-2.6/arch/arm/mach-lpc32xx/phy3250.c
@@ -262,11 +262,6 @@ static void __init lpc3250_machine_init(
 
 	lpc32xx_serial_init();
 
-	tmp = __raw_readl(LPC32XX_CLKPWR_MS_CTRL);
-	tmp |= LPC32XX_CLKPWR_MSCARD_SDCARD_EN |
-		LPC32XX_CLKPWR_MSCARD_MSDIO_PU_EN;
-	__raw_writel(tmp, LPC32XX_CLKPWR_MS_CTRL);
-
 	/* Test clock needed for UDA1380 initial init */
 	__raw_writel(LPC32XX_CLKPWR_TESTCLK2_SEL_MOSC |
 		LPC32XX_CLKPWR_TESTCLK_TESTCLK2_EN,

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

* [PATCH 2/8] ARM: LPC32xx: Add further bits to MMC init
  2012-06-27 22:26 ` Roland Stigge
@ 2012-06-27 22:26   ` Roland Stigge
  -1 siblings, 0 replies; 18+ messages in thread
From: Roland Stigge @ 2012-06-27 22:26 UTC (permalink / raw)
  To: arm, linux-arm-kernel, linux-kernel, kevin.wells, srinivas.bakki,
	aletes.xgr
  Cc: Roland Stigge

This patch makes sure certain MMC bits are cleared as they should for
initialization.

Signed-off-by: Roland Stigge <stigge@antcom.de>
Acked-by: Alexandre Pereira da Silva <aletes.xgr@gmail.com>

---
 arch/arm/mach-lpc32xx/clock.c |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

--- linux-2.6.orig/arch/arm/mach-lpc32xx/clock.c
+++ linux-2.6/arch/arm/mach-lpc32xx/clock.c
@@ -813,7 +813,11 @@ static int mmc_onoff_enable(struct clk *
 
 	tmp = __raw_readl(LPC32XX_CLKPWR_MS_CTRL) &
 		~(LPC32XX_CLKPWR_MSCARD_SDCARD_EN |
-		  LPC32XX_CLKPWR_MSCARD_MSDIO_PU_EN);
+		  LPC32XX_CLKPWR_MSCARD_MSDIO_PU_EN |
+		  LPC32XX_CLKPWR_MSCARD_MSDIO_PIN_DIS |
+		  LPC32XX_CLKPWR_MSCARD_MSDIO0_DIS |
+		  LPC32XX_CLKPWR_MSCARD_MSDIO1_DIS |
+		  LPC32XX_CLKPWR_MSCARD_MSDIO23_DIS);
 
 	/* If rate is 0, disable clock */
 	if (enable != 0)

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

* [PATCH 2/8] ARM: LPC32xx: Add further bits to MMC init
@ 2012-06-27 22:26   ` Roland Stigge
  0 siblings, 0 replies; 18+ messages in thread
From: Roland Stigge @ 2012-06-27 22:26 UTC (permalink / raw)
  To: linux-arm-kernel

This patch makes sure certain MMC bits are cleared as they should for
initialization.

Signed-off-by: Roland Stigge <stigge@antcom.de>
Acked-by: Alexandre Pereira da Silva <aletes.xgr@gmail.com>

---
 arch/arm/mach-lpc32xx/clock.c |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

--- linux-2.6.orig/arch/arm/mach-lpc32xx/clock.c
+++ linux-2.6/arch/arm/mach-lpc32xx/clock.c
@@ -813,7 +813,11 @@ static int mmc_onoff_enable(struct clk *
 
 	tmp = __raw_readl(LPC32XX_CLKPWR_MS_CTRL) &
 		~(LPC32XX_CLKPWR_MSCARD_SDCARD_EN |
-		  LPC32XX_CLKPWR_MSCARD_MSDIO_PU_EN);
+		  LPC32XX_CLKPWR_MSCARD_MSDIO_PU_EN |
+		  LPC32XX_CLKPWR_MSCARD_MSDIO_PIN_DIS |
+		  LPC32XX_CLKPWR_MSCARD_MSDIO0_DIS |
+		  LPC32XX_CLKPWR_MSCARD_MSDIO1_DIS |
+		  LPC32XX_CLKPWR_MSCARD_MSDIO23_DIS);
 
 	/* If rate is 0, disable clock */
 	if (enable != 0)

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

* [PATCH 3/8] ARM: LPC32xx: Remove wrong re-initialization of MMC clock register
  2012-06-27 22:26 ` Roland Stigge
@ 2012-06-27 22:26   ` Roland Stigge
  -1 siblings, 0 replies; 18+ messages in thread
From: Roland Stigge @ 2012-06-27 22:26 UTC (permalink / raw)
  To: arm, linux-arm-kernel, linux-kernel, kevin.wells, srinivas.bakki,
	aletes.xgr
  Cc: Roland Stigge

This patch fixes a bug, (wrongfully) resetting the value of
LPC32XX_CLKPWR_MS_CTRL back to its initial contents (after careful setup). This
was discovered only with a board/bootloader combination (EA3250) where the
contents of the respective register wasn't already at the correct value on
Linux boot.

Signed-off-by: Roland Stigge <stigge@antcom.de>
Acked-by: Alexandre Pereira da Silva <aletes.xgr@gmail.com>

---
 arch/arm/mach-lpc32xx/clock.c |   10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

--- linux-2.6.orig/arch/arm/mach-lpc32xx/clock.c
+++ linux-2.6/arch/arm/mach-lpc32xx/clock.c
@@ -871,7 +871,7 @@ static unsigned long mmc_round_rate(stru
 
 static int mmc_set_rate(struct clk *clk, unsigned long rate)
 {
-	u32 oldclk, tmp;
+	u32 tmp;
 	unsigned long prate, div, crate = mmc_round_rate(clk, rate);
 
 	prate = clk->parent->get_rate(clk->parent);
@@ -879,16 +879,12 @@ static int mmc_set_rate(struct clk *clk,
 	div = prate / crate;
 
 	/* The MMC clock must be on when accessing an MMC register */
-	oldclk = __raw_readl(LPC32XX_CLKPWR_MS_CTRL);
-	__raw_writel(oldclk | LPC32XX_CLKPWR_MSCARD_SDCARD_EN,
-		LPC32XX_CLKPWR_MS_CTRL);
 	tmp = __raw_readl(LPC32XX_CLKPWR_MS_CTRL) &
 		~LPC32XX_CLKPWR_MSCARD_SDCARD_DIV(0xf);
-	tmp |= LPC32XX_CLKPWR_MSCARD_SDCARD_DIV(div);
+	tmp |= LPC32XX_CLKPWR_MSCARD_SDCARD_DIV(div) |
+		LPC32XX_CLKPWR_MSCARD_SDCARD_EN;
 	__raw_writel(tmp, LPC32XX_CLKPWR_MS_CTRL);
 
-	__raw_writel(oldclk, LPC32XX_CLKPWR_MS_CTRL);
-
 	return 0;
 }
 

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

* [PATCH 3/8] ARM: LPC32xx: Remove wrong re-initialization of MMC clock register
@ 2012-06-27 22:26   ` Roland Stigge
  0 siblings, 0 replies; 18+ messages in thread
From: Roland Stigge @ 2012-06-27 22:26 UTC (permalink / raw)
  To: linux-arm-kernel

This patch fixes a bug, (wrongfully) resetting the value of
LPC32XX_CLKPWR_MS_CTRL back to its initial contents (after careful setup). This
was discovered only with a board/bootloader combination (EA3250) where the
contents of the respective register wasn't already at the correct value on
Linux boot.

Signed-off-by: Roland Stigge <stigge@antcom.de>
Acked-by: Alexandre Pereira da Silva <aletes.xgr@gmail.com>

---
 arch/arm/mach-lpc32xx/clock.c |   10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

--- linux-2.6.orig/arch/arm/mach-lpc32xx/clock.c
+++ linux-2.6/arch/arm/mach-lpc32xx/clock.c
@@ -871,7 +871,7 @@ static unsigned long mmc_round_rate(stru
 
 static int mmc_set_rate(struct clk *clk, unsigned long rate)
 {
-	u32 oldclk, tmp;
+	u32 tmp;
 	unsigned long prate, div, crate = mmc_round_rate(clk, rate);
 
 	prate = clk->parent->get_rate(clk->parent);
@@ -879,16 +879,12 @@ static int mmc_set_rate(struct clk *clk,
 	div = prate / crate;
 
 	/* The MMC clock must be on when accessing an MMC register */
-	oldclk = __raw_readl(LPC32XX_CLKPWR_MS_CTRL);
-	__raw_writel(oldclk | LPC32XX_CLKPWR_MSCARD_SDCARD_EN,
-		LPC32XX_CLKPWR_MS_CTRL);
 	tmp = __raw_readl(LPC32XX_CLKPWR_MS_CTRL) &
 		~LPC32XX_CLKPWR_MSCARD_SDCARD_DIV(0xf);
-	tmp |= LPC32XX_CLKPWR_MSCARD_SDCARD_DIV(div);
+	tmp |= LPC32XX_CLKPWR_MSCARD_SDCARD_DIV(div) |
+		LPC32XX_CLKPWR_MSCARD_SDCARD_EN;
 	__raw_writel(tmp, LPC32XX_CLKPWR_MS_CTRL);
 
-	__raw_writel(oldclk, LPC32XX_CLKPWR_MS_CTRL);
-
 	return 0;
 }
 

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

* [PATCH 4/8] ARM: LPC32xx: Update DTS file for EA3250 board
  2012-06-27 22:26 ` Roland Stigge
@ 2012-06-27 22:26   ` Roland Stigge
  -1 siblings, 0 replies; 18+ messages in thread
From: Roland Stigge @ 2012-06-27 22:26 UTC (permalink / raw)
  To: arm, linux-arm-kernel, linux-kernel, kevin.wells, srinivas.bakki,
	aletes.xgr
  Cc: Roland Stigge

This DTS file update adds:
* 3-channel ADC (for AD-IN on AD2, or 3-axis-accelerometer)
* Interrupt key

Signed-off-by: Roland Stigge <stigge@antcom.de>
Acked-by: Alexandre Pereira da Silva <aletes.xgr@gmail.com>

---
 arch/arm/boot/dts/ea3250.dts |   17 +++++++++++++++++
 1 file changed, 17 insertions(+)

--- linux-2.6.orig/arch/arm/boot/dts/ea3250.dts
+++ linux-2.6/arch/arm/boot/dts/ea3250.dts
@@ -152,6 +152,23 @@
 			uart1: serial@40014000 {
 				status = "okay";
 			};
+
+			/* 3-axis accelerometer X,Y,Z (or AD-IN instead of Z) */
+			adc@40048000 {
+				status = "okay";
+			};
+		};
+	};
+
+	gpio_keys {
+		compatible = "gpio-keys";
+		#address-cells = <1>;
+		#size-cells = <0>;
+		autorepeat;
+		button@21 {
+			label = "GPIO Key UP";
+			linux,code = <103>;
+			gpios = <&gpio 4 1 0>; /* GPI_P3 1 */
 		};
 	};
 };

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

* [PATCH 4/8] ARM: LPC32xx: Update DTS file for EA3250 board
@ 2012-06-27 22:26   ` Roland Stigge
  0 siblings, 0 replies; 18+ messages in thread
From: Roland Stigge @ 2012-06-27 22:26 UTC (permalink / raw)
  To: linux-arm-kernel

This DTS file update adds:
* 3-channel ADC (for AD-IN on AD2, or 3-axis-accelerometer)
* Interrupt key

Signed-off-by: Roland Stigge <stigge@antcom.de>
Acked-by: Alexandre Pereira da Silva <aletes.xgr@gmail.com>

---
 arch/arm/boot/dts/ea3250.dts |   17 +++++++++++++++++
 1 file changed, 17 insertions(+)

--- linux-2.6.orig/arch/arm/boot/dts/ea3250.dts
+++ linux-2.6/arch/arm/boot/dts/ea3250.dts
@@ -152,6 +152,23 @@
 			uart1: serial at 40014000 {
 				status = "okay";
 			};
+
+			/* 3-axis accelerometer X,Y,Z (or AD-IN instead of Z) */
+			adc at 40048000 {
+				status = "okay";
+			};
+		};
+	};
+
+	gpio_keys {
+		compatible = "gpio-keys";
+		#address-cells = <1>;
+		#size-cells = <0>;
+		autorepeat;
+		button at 21 {
+			label = "GPIO Key UP";
+			linux,code = <103>;
+			gpios = <&gpio 4 1 0>; /* GPI_P3 1 */
 		};
 	};
 };

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

* [PATCH 5/8] ARM: LPC32xx: Defconfig update
  2012-06-27 22:26 ` Roland Stigge
@ 2012-06-27 22:26   ` Roland Stigge
  -1 siblings, 0 replies; 18+ messages in thread
From: Roland Stigge @ 2012-06-27 22:26 UTC (permalink / raw)
  To: arm, linux-arm-kernel, linux-kernel, kevin.wells, srinivas.bakki,
	aletes.xgr
  Cc: Roland Stigge

This defconfig update for LPC32xx adds interrupt and polled gpio keyboard
drivers.

Signed-off-by: Roland Stigge <stigge@antcom.de>
Acked-by: Alexandre Pereira da Silva <aletes.xgr@gmail.com>

---
 arch/arm/configs/lpc32xx_defconfig |    2 ++
 1 file changed, 2 insertions(+)

--- linux-2.6.orig/arch/arm/configs/lpc32xx_defconfig
+++ linux-2.6/arch/arm/configs/lpc32xx_defconfig
@@ -18,6 +18,7 @@ CONFIG_MODULE_UNLOAD=y
 # CONFIG_BLK_DEV_BSG is not set
 CONFIG_PARTITION_ADVANCED=y
 CONFIG_ARCH_LPC32XX=y
+CONFIG_KEYBOARD_GPIO_POLLED=y
 CONFIG_PREEMPT=y
 CONFIG_AEABI=y
 CONFIG_ZBOOT_ROM_TEXT=0x0
@@ -89,6 +90,7 @@ CONFIG_INPUT_MOUSEDEV_SCREEN_X=240
 CONFIG_INPUT_MOUSEDEV_SCREEN_Y=320
 CONFIG_INPUT_EVDEV=y
 # CONFIG_KEYBOARD_ATKBD is not set
+CONFIG_KEYBOARD_GPIO=y
 CONFIG_KEYBOARD_LPC32XX=y
 # CONFIG_INPUT_MOUSE is not set
 CONFIG_INPUT_TOUCHSCREEN=y

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

* [PATCH 5/8] ARM: LPC32xx: Defconfig update
@ 2012-06-27 22:26   ` Roland Stigge
  0 siblings, 0 replies; 18+ messages in thread
From: Roland Stigge @ 2012-06-27 22:26 UTC (permalink / raw)
  To: linux-arm-kernel

This defconfig update for LPC32xx adds interrupt and polled gpio keyboard
drivers.

Signed-off-by: Roland Stigge <stigge@antcom.de>
Acked-by: Alexandre Pereira da Silva <aletes.xgr@gmail.com>

---
 arch/arm/configs/lpc32xx_defconfig |    2 ++
 1 file changed, 2 insertions(+)

--- linux-2.6.orig/arch/arm/configs/lpc32xx_defconfig
+++ linux-2.6/arch/arm/configs/lpc32xx_defconfig
@@ -18,6 +18,7 @@ CONFIG_MODULE_UNLOAD=y
 # CONFIG_BLK_DEV_BSG is not set
 CONFIG_PARTITION_ADVANCED=y
 CONFIG_ARCH_LPC32XX=y
+CONFIG_KEYBOARD_GPIO_POLLED=y
 CONFIG_PREEMPT=y
 CONFIG_AEABI=y
 CONFIG_ZBOOT_ROM_TEXT=0x0
@@ -89,6 +90,7 @@ CONFIG_INPUT_MOUSEDEV_SCREEN_X=240
 CONFIG_INPUT_MOUSEDEV_SCREEN_Y=320
 CONFIG_INPUT_EVDEV=y
 # CONFIG_KEYBOARD_ATKBD is not set
+CONFIG_KEYBOARD_GPIO=y
 CONFIG_KEYBOARD_LPC32XX=y
 # CONFIG_INPUT_MOUSE is not set
 CONFIG_INPUT_TOUCHSCREEN=y

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

* [PATCH 6/8] ARM: LPC32xx: Cleanup USB clock init
  2012-06-27 22:26 ` Roland Stigge
@ 2012-06-27 22:26   ` Roland Stigge
  -1 siblings, 0 replies; 18+ messages in thread
From: Roland Stigge @ 2012-06-27 22:26 UTC (permalink / raw)
  To: arm, linux-arm-kernel, linux-kernel, kevin.wells, srinivas.bakki,
	aletes.xgr
  Cc: Roland Stigge

From: Alexandre Pereira da Silva <aletes.xgr@gmail.com>

Move most of usb clock initialization from lpc32xx_udc and ohci-nxp to
clock.c. Also adds ohci clocks and otg clocks.

Signed-off-by: Alexandre Pereira da Silva <aletes.xgr@gmail.com>
Signed-off-by: Roland Stigge <stigge@antcom.de>
---
 arch/arm/mach-lpc32xx/clock.c                 |   68 +++++++++++++++++++++++++-
 arch/arm/mach-lpc32xx/include/mach/platform.h |   14 +++++
 2 files changed, 81 insertions(+), 1 deletion(-)

--- linux-2.6.orig/arch/arm/mach-lpc32xx/clock.c
+++ linux-2.6/arch/arm/mach-lpc32xx/clock.c
@@ -739,14 +739,77 @@ static struct clk clk_rtc = {
 	.get_rate	= local_return_parent_rate,
 };
 
+static int local_usb_enable(struct clk *clk, int enable)
+{
+	u32 tmp;
+
+	if (enable) {
+		/* Set up I2C pull levels */
+		tmp = __raw_readl(LPC32XX_CLKPWR_I2C_CLK_CTRL);
+		tmp |= LPC32XX_CLKPWR_I2CCLK_USBI2CHI_DRIVE;
+		__raw_writel(tmp, LPC32XX_CLKPWR_I2C_CLK_CTRL);
+	}
+
+	return local_onoff_enable(clk, enable);
+}
+
 static struct clk clk_usbd = {
 	.parent		= &clk_usbpll,
-	.enable		= local_onoff_enable,
+	.enable		= local_usb_enable,
 	.enable_reg	= LPC32XX_CLKPWR_USB_CTRL,
 	.enable_mask	= LPC32XX_CLKPWR_USBCTRL_HCLK_EN,
 	.get_rate	= local_return_parent_rate,
 };
 
+#define OTG_ALWAYS_MASK		(LPC32XX_USB_OTG_OTG_CLOCK_ON | \
+				 LPC32XX_USB_OTG_I2C_CLOCK_ON)
+
+static int local_usb_otg_enable(struct clk *clk, int enable)
+{
+	int to = 1000;
+
+	if (enable) {
+		__raw_writel(clk->enable_mask, clk->enable_reg);
+
+		while (((__raw_readl(LPC32XX_USB_OTG_CLK_STAT) &
+			clk->enable_mask) != clk->enable_mask) && (to > 0))
+			to--;
+	} else {
+		__raw_writel(OTG_ALWAYS_MASK, clk->enable_reg);
+
+		while (((__raw_readl(LPC32XX_USB_OTG_CLK_STAT) &
+			OTG_ALWAYS_MASK) != OTG_ALWAYS_MASK) && (to > 0))
+			to--;
+	}
+
+	if (to)
+		return 0;
+	else
+		return -1;
+}
+
+static struct clk clk_usb_otg_dev = {
+	.parent		= &clk_usbpll,
+	.enable		= local_usb_otg_enable,
+	.enable_reg	= LPC32XX_USB_OTG_CLK_CTRL,
+	.enable_mask	= LPC32XX_USB_OTG_AHB_M_CLOCK_ON |
+			  LPC32XX_USB_OTG_OTG_CLOCK_ON |
+			  LPC32XX_USB_OTG_DEV_CLOCK_ON |
+			  LPC32XX_USB_OTG_I2C_CLOCK_ON,
+	.get_rate	= local_return_parent_rate,
+};
+
+static struct clk clk_usb_otg_host = {
+	.parent		= &clk_usbpll,
+	.enable		= local_usb_otg_enable,
+	.enable_reg	= LPC32XX_USB_OTG_CLK_CTRL,
+	.enable_mask	= LPC32XX_USB_OTG_AHB_M_CLOCK_ON |
+			  LPC32XX_USB_OTG_OTG_CLOCK_ON |
+			  LPC32XX_USB_OTG_HOST_CLOCK_ON |
+			  LPC32XX_USB_OTG_I2C_CLOCK_ON,
+	.get_rate	= local_return_parent_rate,
+};
+
 static int tsc_onoff_enable(struct clk *clk, int enable)
 {
 	u32 tmp;
@@ -1145,6 +1208,9 @@ static struct clk_lookup lookups[] = {
 	CLKDEV_INIT("31060000.ethernet", NULL, &clk_net),
 	CLKDEV_INIT("dev:clcd", NULL, &clk_lcd),
 	CLKDEV_INIT("31020000.usbd", "ck_usbd", &clk_usbd),
+	CLKDEV_INIT("31020000.ohci", "ck_usbd", &clk_usbd),
+	CLKDEV_INIT("31020000.usbd", "ck_usb_otg", &clk_usb_otg_dev),
+	CLKDEV_INIT("31020000.ohci", "ck_usb_otg", &clk_usb_otg_host),
 	CLKDEV_INIT("lpc32xx_rtc", NULL, &clk_rtc),
 };
 
--- linux-2.6.orig/arch/arm/mach-lpc32xx/include/mach/platform.h
+++ linux-2.6/arch/arm/mach-lpc32xx/include/mach/platform.h
@@ -694,4 +694,18 @@
 #define LPC32XX_GPIO_P2_MUX_CLR			_GPREG(0x02C)
 #define LPC32XX_GPIO_P2_MUX_STATE		_GPREG(0x030)
 
+/*
+ * USB Otg Registers
+ */
+#define _OTGREG(x)			io_p2v(LPC32XX_USB_OTG_BASE + (x))
+#define LPC32XX_USB_OTG_CLK_CTRL	_OTGREG(0xFF4)
+#define LPC32XX_USB_OTG_CLK_STAT	_OTGREG(0xFF8)
+
+/* USB OTG CLK CTRL bit defines */
+#define LPC32XX_USB_OTG_AHB_M_CLOCK_ON	_BIT(4)
+#define LPC32XX_USB_OTG_OTG_CLOCK_ON	_BIT(3)
+#define LPC32XX_USB_OTG_I2C_CLOCK_ON	_BIT(2)
+#define LPC32XX_USB_OTG_DEV_CLOCK_ON	_BIT(1)
+#define LPC32XX_USB_OTG_HOST_CLOCK_ON	_BIT(0)
+
 #endif

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

* [PATCH 6/8] ARM: LPC32xx: Cleanup USB clock init
@ 2012-06-27 22:26   ` Roland Stigge
  0 siblings, 0 replies; 18+ messages in thread
From: Roland Stigge @ 2012-06-27 22:26 UTC (permalink / raw)
  To: linux-arm-kernel

From: Alexandre Pereira da Silva <aletes.xgr@gmail.com>

Move most of usb clock initialization from lpc32xx_udc and ohci-nxp to
clock.c. Also adds ohci clocks and otg clocks.

Signed-off-by: Alexandre Pereira da Silva <aletes.xgr@gmail.com>
Signed-off-by: Roland Stigge <stigge@antcom.de>
---
 arch/arm/mach-lpc32xx/clock.c                 |   68 +++++++++++++++++++++++++-
 arch/arm/mach-lpc32xx/include/mach/platform.h |   14 +++++
 2 files changed, 81 insertions(+), 1 deletion(-)

--- linux-2.6.orig/arch/arm/mach-lpc32xx/clock.c
+++ linux-2.6/arch/arm/mach-lpc32xx/clock.c
@@ -739,14 +739,77 @@ static struct clk clk_rtc = {
 	.get_rate	= local_return_parent_rate,
 };
 
+static int local_usb_enable(struct clk *clk, int enable)
+{
+	u32 tmp;
+
+	if (enable) {
+		/* Set up I2C pull levels */
+		tmp = __raw_readl(LPC32XX_CLKPWR_I2C_CLK_CTRL);
+		tmp |= LPC32XX_CLKPWR_I2CCLK_USBI2CHI_DRIVE;
+		__raw_writel(tmp, LPC32XX_CLKPWR_I2C_CLK_CTRL);
+	}
+
+	return local_onoff_enable(clk, enable);
+}
+
 static struct clk clk_usbd = {
 	.parent		= &clk_usbpll,
-	.enable		= local_onoff_enable,
+	.enable		= local_usb_enable,
 	.enable_reg	= LPC32XX_CLKPWR_USB_CTRL,
 	.enable_mask	= LPC32XX_CLKPWR_USBCTRL_HCLK_EN,
 	.get_rate	= local_return_parent_rate,
 };
 
+#define OTG_ALWAYS_MASK		(LPC32XX_USB_OTG_OTG_CLOCK_ON | \
+				 LPC32XX_USB_OTG_I2C_CLOCK_ON)
+
+static int local_usb_otg_enable(struct clk *clk, int enable)
+{
+	int to = 1000;
+
+	if (enable) {
+		__raw_writel(clk->enable_mask, clk->enable_reg);
+
+		while (((__raw_readl(LPC32XX_USB_OTG_CLK_STAT) &
+			clk->enable_mask) != clk->enable_mask) && (to > 0))
+			to--;
+	} else {
+		__raw_writel(OTG_ALWAYS_MASK, clk->enable_reg);
+
+		while (((__raw_readl(LPC32XX_USB_OTG_CLK_STAT) &
+			OTG_ALWAYS_MASK) != OTG_ALWAYS_MASK) && (to > 0))
+			to--;
+	}
+
+	if (to)
+		return 0;
+	else
+		return -1;
+}
+
+static struct clk clk_usb_otg_dev = {
+	.parent		= &clk_usbpll,
+	.enable		= local_usb_otg_enable,
+	.enable_reg	= LPC32XX_USB_OTG_CLK_CTRL,
+	.enable_mask	= LPC32XX_USB_OTG_AHB_M_CLOCK_ON |
+			  LPC32XX_USB_OTG_OTG_CLOCK_ON |
+			  LPC32XX_USB_OTG_DEV_CLOCK_ON |
+			  LPC32XX_USB_OTG_I2C_CLOCK_ON,
+	.get_rate	= local_return_parent_rate,
+};
+
+static struct clk clk_usb_otg_host = {
+	.parent		= &clk_usbpll,
+	.enable		= local_usb_otg_enable,
+	.enable_reg	= LPC32XX_USB_OTG_CLK_CTRL,
+	.enable_mask	= LPC32XX_USB_OTG_AHB_M_CLOCK_ON |
+			  LPC32XX_USB_OTG_OTG_CLOCK_ON |
+			  LPC32XX_USB_OTG_HOST_CLOCK_ON |
+			  LPC32XX_USB_OTG_I2C_CLOCK_ON,
+	.get_rate	= local_return_parent_rate,
+};
+
 static int tsc_onoff_enable(struct clk *clk, int enable)
 {
 	u32 tmp;
@@ -1145,6 +1208,9 @@ static struct clk_lookup lookups[] = {
 	CLKDEV_INIT("31060000.ethernet", NULL, &clk_net),
 	CLKDEV_INIT("dev:clcd", NULL, &clk_lcd),
 	CLKDEV_INIT("31020000.usbd", "ck_usbd", &clk_usbd),
+	CLKDEV_INIT("31020000.ohci", "ck_usbd", &clk_usbd),
+	CLKDEV_INIT("31020000.usbd", "ck_usb_otg", &clk_usb_otg_dev),
+	CLKDEV_INIT("31020000.ohci", "ck_usb_otg", &clk_usb_otg_host),
 	CLKDEV_INIT("lpc32xx_rtc", NULL, &clk_rtc),
 };
 
--- linux-2.6.orig/arch/arm/mach-lpc32xx/include/mach/platform.h
+++ linux-2.6/arch/arm/mach-lpc32xx/include/mach/platform.h
@@ -694,4 +694,18 @@
 #define LPC32XX_GPIO_P2_MUX_CLR			_GPREG(0x02C)
 #define LPC32XX_GPIO_P2_MUX_STATE		_GPREG(0x030)
 
+/*
+ * USB Otg Registers
+ */
+#define _OTGREG(x)			io_p2v(LPC32XX_USB_OTG_BASE + (x))
+#define LPC32XX_USB_OTG_CLK_CTRL	_OTGREG(0xFF4)
+#define LPC32XX_USB_OTG_CLK_STAT	_OTGREG(0xFF8)
+
+/* USB OTG CLK CTRL bit defines */
+#define LPC32XX_USB_OTG_AHB_M_CLOCK_ON	_BIT(4)
+#define LPC32XX_USB_OTG_OTG_CLOCK_ON	_BIT(3)
+#define LPC32XX_USB_OTG_I2C_CLOCK_ON	_BIT(2)
+#define LPC32XX_USB_OTG_DEV_CLOCK_ON	_BIT(1)
+#define LPC32XX_USB_OTG_HOST_CLOCK_ON	_BIT(0)
+
 #endif

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

* [PATCH 7/8] ARM: LPC32xx: Remove USB and I2C init from phy3250.c
  2012-06-27 22:26 ` Roland Stigge
@ 2012-06-27 22:26   ` Roland Stigge
  -1 siblings, 0 replies; 18+ messages in thread
From: Roland Stigge @ 2012-06-27 22:26 UTC (permalink / raw)
  To: arm, linux-arm-kernel, linux-kernel, kevin.wells, srinivas.bakki,
	aletes.xgr
  Cc: Roland Stigge

USB and I2C initialization can be removed safely from the board specific
phy3250.c, now that initialization moved to the generalized clock.c.

Signed-off-by: Roland Stigge <stigge@antcom.de>
Tested-by: Alexandre Pereira da Silva <aletes.xgr@gmail.com>

---
 arch/arm/mach-lpc32xx/phy3250.c |   12 ------------
 1 file changed, 12 deletions(-)

--- linux-2.6.orig/arch/arm/mach-lpc32xx/phy3250.c
+++ linux-2.6/arch/arm/mach-lpc32xx/phy3250.c
@@ -248,18 +248,6 @@ static void __init lpc3250_machine_init(
 	tmp |= LPC32XX_CLKPWR_LCDCTRL_LCDTYPE_TFT16;
 	__raw_writel(tmp, LPC32XX_CLKPWR_LCDCLK_CTRL);
 
-	/* Set up USB power */
-	tmp = __raw_readl(LPC32XX_CLKPWR_USB_CTRL);
-	tmp |= LPC32XX_CLKPWR_USBCTRL_HCLK_EN |
-		LPC32XX_CLKPWR_USBCTRL_USBI2C_EN;
-	__raw_writel(tmp, LPC32XX_CLKPWR_USB_CTRL);
-
-	/* Set up I2C pull levels */
-	tmp = __raw_readl(LPC32XX_CLKPWR_I2C_CLK_CTRL);
-	tmp |= LPC32XX_CLKPWR_I2CCLK_USBI2CHI_DRIVE |
-		LPC32XX_CLKPWR_I2CCLK_I2C2HI_DRIVE;
-	__raw_writel(tmp, LPC32XX_CLKPWR_I2C_CLK_CTRL);
-
 	lpc32xx_serial_init();
 
 	/* Test clock needed for UDA1380 initial init */

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

* [PATCH 7/8] ARM: LPC32xx: Remove USB and I2C init from phy3250.c
@ 2012-06-27 22:26   ` Roland Stigge
  0 siblings, 0 replies; 18+ messages in thread
From: Roland Stigge @ 2012-06-27 22:26 UTC (permalink / raw)
  To: linux-arm-kernel

USB and I2C initialization can be removed safely from the board specific
phy3250.c, now that initialization moved to the generalized clock.c.

Signed-off-by: Roland Stigge <stigge@antcom.de>
Tested-by: Alexandre Pereira da Silva <aletes.xgr@gmail.com>

---
 arch/arm/mach-lpc32xx/phy3250.c |   12 ------------
 1 file changed, 12 deletions(-)

--- linux-2.6.orig/arch/arm/mach-lpc32xx/phy3250.c
+++ linux-2.6/arch/arm/mach-lpc32xx/phy3250.c
@@ -248,18 +248,6 @@ static void __init lpc3250_machine_init(
 	tmp |= LPC32XX_CLKPWR_LCDCTRL_LCDTYPE_TFT16;
 	__raw_writel(tmp, LPC32XX_CLKPWR_LCDCLK_CTRL);
 
-	/* Set up USB power */
-	tmp = __raw_readl(LPC32XX_CLKPWR_USB_CTRL);
-	tmp |= LPC32XX_CLKPWR_USBCTRL_HCLK_EN |
-		LPC32XX_CLKPWR_USBCTRL_USBI2C_EN;
-	__raw_writel(tmp, LPC32XX_CLKPWR_USB_CTRL);
-
-	/* Set up I2C pull levels */
-	tmp = __raw_readl(LPC32XX_CLKPWR_I2C_CLK_CTRL);
-	tmp |= LPC32XX_CLKPWR_I2CCLK_USBI2CHI_DRIVE |
-		LPC32XX_CLKPWR_I2CCLK_I2C2HI_DRIVE;
-	__raw_writel(tmp, LPC32XX_CLKPWR_I2C_CLK_CTRL);
-
 	lpc32xx_serial_init();
 
 	/* Test clock needed for UDA1380 initial init */

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

* [PATCH 8/8] ARM: LPC32xx: Remove unused gpios
  2012-06-27 22:26 ` Roland Stigge
@ 2012-06-27 22:26   ` Roland Stigge
  -1 siblings, 0 replies; 18+ messages in thread
From: Roland Stigge @ 2012-06-27 22:26 UTC (permalink / raw)
  To: arm, linux-arm-kernel, linux-kernel, kevin.wells, srinivas.bakki,
	aletes.xgr
  Cc: Roland Stigge

From: Alexandre Pereira da Silva <aletes.xgr@gmail.com>

Remove SPI0_CS, MMC_CD and MMC_WP gpios as they moved to devicetree.

Signed-off-by: Alexandre Pereira da Silva <aletes.xgr@gmail.com>
Signed-off-by: Roland Stigge <stigge@antcom.de>
---
 arch/arm/mach-lpc32xx/phy3250.c |    3 ---
 1 file changed, 3 deletions(-)

--- linux-2.6.orig/arch/arm/mach-lpc32xx/phy3250.c
+++ linux-2.6/arch/arm/mach-lpc32xx/phy3250.c
@@ -51,12 +51,9 @@
 /*
  * Mapped GPIOLIB GPIOs
  */
-#define SPI0_CS_GPIO		LPC32XX_GPIO(LPC32XX_GPIO_P3_GRP, 5)
 #define LCD_POWER_GPIO		LPC32XX_GPIO(LPC32XX_GPO_P3_GRP, 0)
 #define BKL_POWER_GPIO		LPC32XX_GPIO(LPC32XX_GPO_P3_GRP, 4)
 #define MMC_PWR_ENABLE_GPIO	LPC32XX_GPIO(LPC32XX_GPO_P3_GRP, 5)
-#define MMC_CD_GPIO		LPC32XX_GPIO(LPC32XX_GPIO_P3_GRP, 1)
-#define MMC_WP_GPIO		LPC32XX_GPIO(LPC32XX_GPIO_P3_GRP, 0)
 
 /*
  * AMBA LCD controller

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

* [PATCH 8/8] ARM: LPC32xx: Remove unused gpios
@ 2012-06-27 22:26   ` Roland Stigge
  0 siblings, 0 replies; 18+ messages in thread
From: Roland Stigge @ 2012-06-27 22:26 UTC (permalink / raw)
  To: linux-arm-kernel

From: Alexandre Pereira da Silva <aletes.xgr@gmail.com>

Remove SPI0_CS, MMC_CD and MMC_WP gpios as they moved to devicetree.

Signed-off-by: Alexandre Pereira da Silva <aletes.xgr@gmail.com>
Signed-off-by: Roland Stigge <stigge@antcom.de>
---
 arch/arm/mach-lpc32xx/phy3250.c |    3 ---
 1 file changed, 3 deletions(-)

--- linux-2.6.orig/arch/arm/mach-lpc32xx/phy3250.c
+++ linux-2.6/arch/arm/mach-lpc32xx/phy3250.c
@@ -51,12 +51,9 @@
 /*
  * Mapped GPIOLIB GPIOs
  */
-#define SPI0_CS_GPIO		LPC32XX_GPIO(LPC32XX_GPIO_P3_GRP, 5)
 #define LCD_POWER_GPIO		LPC32XX_GPIO(LPC32XX_GPO_P3_GRP, 0)
 #define BKL_POWER_GPIO		LPC32XX_GPIO(LPC32XX_GPO_P3_GRP, 4)
 #define MMC_PWR_ENABLE_GPIO	LPC32XX_GPIO(LPC32XX_GPO_P3_GRP, 5)
-#define MMC_CD_GPIO		LPC32XX_GPIO(LPC32XX_GPIO_P3_GRP, 1)
-#define MMC_WP_GPIO		LPC32XX_GPIO(LPC32XX_GPIO_P3_GRP, 0)
 
 /*
  * AMBA LCD controller

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

end of thread, other threads:[~2012-06-27 22:28 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-06-27 22:26 [PATCH 0/8] ARM: LPC32xx specific updates for next, second set Roland Stigge
2012-06-27 22:26 ` Roland Stigge
2012-06-27 22:26 ` [PATCH 1/8] ARM: LPC32xx: Init MMC via clock Roland Stigge
2012-06-27 22:26   ` Roland Stigge
2012-06-27 22:26 ` [PATCH 2/8] ARM: LPC32xx: Add further bits to MMC init Roland Stigge
2012-06-27 22:26   ` Roland Stigge
2012-06-27 22:26 ` [PATCH 3/8] ARM: LPC32xx: Remove wrong re-initialization of MMC clock register Roland Stigge
2012-06-27 22:26   ` Roland Stigge
2012-06-27 22:26 ` [PATCH 4/8] ARM: LPC32xx: Update DTS file for EA3250 board Roland Stigge
2012-06-27 22:26   ` Roland Stigge
2012-06-27 22:26 ` [PATCH 5/8] ARM: LPC32xx: Defconfig update Roland Stigge
2012-06-27 22:26   ` Roland Stigge
2012-06-27 22:26 ` [PATCH 6/8] ARM: LPC32xx: Cleanup USB clock init Roland Stigge
2012-06-27 22:26   ` Roland Stigge
2012-06-27 22:26 ` [PATCH 7/8] ARM: LPC32xx: Remove USB and I2C init from phy3250.c Roland Stigge
2012-06-27 22:26   ` Roland Stigge
2012-06-27 22:26 ` [PATCH 8/8] ARM: LPC32xx: Remove unused gpios Roland Stigge
2012-06-27 22:26   ` Roland Stigge

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.