* ARM: LPC32xx: Misc arch updates and fixes
@ 2010-07-29 16:04 wellsk40 at gmail.com
2010-07-29 16:04 ` [PATCH 1/7] ARM: LPC32xx: Fix naming convention issues with some defines wellsk40 at gmail.com
` (6 more replies)
0 siblings, 7 replies; 8+ messages in thread
From: wellsk40 at gmail.com @ 2010-07-29 16:04 UTC (permalink / raw)
To: linux-arm-kernel
This patch series fixes several small issues with the LPC32xx Linux
support:
LPC definition fixes
Remove un-needed code from IRQ ack handler
Fix GPIO 3 IN bit mask
Change AMBA pre and post clock init for AMBA registration
Add a workaround for LCD register access prior to clock enable
Remove un-needed local MMC clock enable code
Fix up I2S device ID name for clock registration
The LPC32xx will thrown an ARM exception if an attempt is made to access a
peripheral register set without the clocks enabled. Patch 5 (workaround for
LCD register access) is needed to work around an issue with the LCD driver.
During the AMBA PL11x driver init, an access is made to the peripheral
registers while the clock is disabled. This workaround prevents an exception
during init.
The series can be pulled from:
git://git.lpclinux.com/linux-2.6-lpc wells/lpc32xx-arch_up1
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH 1/7] ARM: LPC32xx: Fix naming convention issues with some defines
2010-07-29 16:04 ARM: LPC32xx: Misc arch updates and fixes wellsk40 at gmail.com
@ 2010-07-29 16:04 ` wellsk40 at gmail.com
2010-07-29 16:04 ` [PATCH 2/7] ARM: LPC32xx: Remove un-needed wakeup code from IRQ ack handler wellsk40 at gmail.com
` (5 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: wellsk40 at gmail.com @ 2010-07-29 16:04 UTC (permalink / raw)
To: linux-arm-kernel
From: Kevin Wells <wellsk40@gmail.com>
Some platform defines were prefixed with LCP instead of LPC.
This has been corrected.
Signed-off-by: Kevin Wells <wellsk40@gmail.com>
---
arch/arm/mach-lpc32xx/include/mach/platform.h | 48 ++++++++++++------------
arch/arm/mach-lpc32xx/timer.c | 46 ++++++++++++------------
2 files changed, 47 insertions(+), 47 deletions(-)
diff --git a/arch/arm/mach-lpc32xx/include/mach/platform.h b/arch/arm/mach-lpc32xx/include/mach/platform.h
index 14ea8d1..85f9aff 100644
--- a/arch/arm/mach-lpc32xx/include/mach/platform.h
+++ b/arch/arm/mach-lpc32xx/include/mach/platform.h
@@ -591,42 +591,42 @@
/*
* Timer/counter register offsets
*/
-#define LCP32XX_TIMER_IR(x) io_p2v((x) + 0x00)
-#define LCP32XX_TIMER_TCR(x) io_p2v((x) + 0x04)
-#define LCP32XX_TIMER_TC(x) io_p2v((x) + 0x08)
-#define LCP32XX_TIMER_PR(x) io_p2v((x) + 0x0C)
-#define LCP32XX_TIMER_PC(x) io_p2v((x) + 0x10)
-#define LCP32XX_TIMER_MCR(x) io_p2v((x) + 0x14)
-#define LCP32XX_TIMER_MR0(x) io_p2v((x) + 0x18)
-#define LCP32XX_TIMER_MR1(x) io_p2v((x) + 0x1C)
-#define LCP32XX_TIMER_MR2(x) io_p2v((x) + 0x20)
-#define LCP32XX_TIMER_MR3(x) io_p2v((x) + 0x24)
-#define LCP32XX_TIMER_CCR(x) io_p2v((x) + 0x28)
-#define LCP32XX_TIMER_CR0(x) io_p2v((x) + 0x2C)
-#define LCP32XX_TIMER_CR1(x) io_p2v((x) + 0x30)
-#define LCP32XX_TIMER_CR2(x) io_p2v((x) + 0x34)
-#define LCP32XX_TIMER_CR3(x) io_p2v((x) + 0x38)
-#define LCP32XX_TIMER_EMR(x) io_p2v((x) + 0x3C)
-#define LCP32XX_TIMER_CTCR(x) io_p2v((x) + 0x70)
+#define LPC32XX_TIMER_IR(x) io_p2v((x) + 0x00)
+#define LPC32XX_TIMER_TCR(x) io_p2v((x) + 0x04)
+#define LPC32XX_TIMER_TC(x) io_p2v((x) + 0x08)
+#define LPC32XX_TIMER_PR(x) io_p2v((x) + 0x0C)
+#define LPC32XX_TIMER_PC(x) io_p2v((x) + 0x10)
+#define LPC32XX_TIMER_MCR(x) io_p2v((x) + 0x14)
+#define LPC32XX_TIMER_MR0(x) io_p2v((x) + 0x18)
+#define LPC32XX_TIMER_MR1(x) io_p2v((x) + 0x1C)
+#define LPC32XX_TIMER_MR2(x) io_p2v((x) + 0x20)
+#define LPC32XX_TIMER_MR3(x) io_p2v((x) + 0x24)
+#define LPC32XX_TIMER_CCR(x) io_p2v((x) + 0x28)
+#define LPC32XX_TIMER_CR0(x) io_p2v((x) + 0x2C)
+#define LPC32XX_TIMER_CR1(x) io_p2v((x) + 0x30)
+#define LPC32XX_TIMER_CR2(x) io_p2v((x) + 0x34)
+#define LPC32XX_TIMER_CR3(x) io_p2v((x) + 0x38)
+#define LPC32XX_TIMER_EMR(x) io_p2v((x) + 0x3C)
+#define LPC32XX_TIMER_CTCR(x) io_p2v((x) + 0x70)
/*
* ir register definitions
*/
-#define LCP32XX_TIMER_CNTR_MTCH_BIT(n) (1 << ((n) & 0x3))
-#define LCP32XX_TIMER_CNTR_CAPT_BIT(n) (1 << (4 + ((n) & 0x3)))
+#define LPC32XX_TIMER_CNTR_MTCH_BIT(n) (1 << ((n) & 0x3))
+#define LPC32XX_TIMER_CNTR_CAPT_BIT(n) (1 << (4 + ((n) & 0x3)))
/*
* tcr register definitions
*/
-#define LCP32XX_TIMER_CNTR_TCR_EN 0x1
-#define LCP32XX_TIMER_CNTR_TCR_RESET 0x2
+#define LPC32XX_TIMER_CNTR_TCR_EN 0x1
+#define LPC32XX_TIMER_CNTR_TCR_RESET 0x2
/*
* mcr register definitions
*/
-#define LCP32XX_TIMER_CNTR_MCR_MTCH(n) (0x1 << ((n) * 3))
-#define LCP32XX_TIMER_CNTR_MCR_RESET(n) (0x1 << (((n) * 3) + 1))
-#define LCP32XX_TIMER_CNTR_MCR_STOP(n) (0x1 << (((n) * 3) + 2))
+#define LPC32XX_TIMER_CNTR_MCR_MTCH(n) (0x1 << ((n) * 3))
+#define LPC32XX_TIMER_CNTR_MCR_RESET(n) (0x1 << (((n) * 3) + 1))
+#define LPC32XX_TIMER_CNTR_MCR_STOP(n) (0x1 << (((n) * 3) + 2))
/*
* Standard UART register offsets
diff --git a/arch/arm/mach-lpc32xx/timer.c b/arch/arm/mach-lpc32xx/timer.c
index 630dd4a..791100b 100644
--- a/arch/arm/mach-lpc32xx/timer.c
+++ b/arch/arm/mach-lpc32xx/timer.c
@@ -33,7 +33,7 @@
static cycle_t lpc32xx_clksrc_read(struct clocksource *cs)
{
- return (cycle_t)__raw_readl(LCP32XX_TIMER_TC(LPC32XX_TIMER1_BASE));
+ return (cycle_t)__raw_readl(LPC32XX_TIMER_TC(LPC32XX_TIMER1_BASE));
}
static struct clocksource lpc32xx_clksrc = {
@@ -48,11 +48,11 @@ static struct clocksource lpc32xx_clksrc = {
static int lpc32xx_clkevt_next_event(unsigned long delta,
struct clock_event_device *dev)
{
- __raw_writel(LCP32XX_TIMER_CNTR_TCR_RESET,
- LCP32XX_TIMER_TCR(LPC32XX_TIMER0_BASE));
- __raw_writel(delta, LCP32XX_TIMER_PR(LPC32XX_TIMER0_BASE));
- __raw_writel(LCP32XX_TIMER_CNTR_TCR_EN,
- LCP32XX_TIMER_TCR(LPC32XX_TIMER0_BASE));
+ __raw_writel(LPC32XX_TIMER_CNTR_TCR_RESET,
+ LPC32XX_TIMER_TCR(LPC32XX_TIMER0_BASE));
+ __raw_writel(delta, LPC32XX_TIMER_PR(LPC32XX_TIMER0_BASE));
+ __raw_writel(LPC32XX_TIMER_CNTR_TCR_EN,
+ LPC32XX_TIMER_TCR(LPC32XX_TIMER0_BASE));
return 0;
}
@@ -72,7 +72,7 @@ static void lpc32xx_clkevt_mode(enum clock_event_mode mode,
* disable the timer to wait for the first call to
* set_next_event().
*/
- __raw_writel(0, LCP32XX_TIMER_TCR(LPC32XX_TIMER0_BASE));
+ __raw_writel(0, LPC32XX_TIMER_TCR(LPC32XX_TIMER0_BASE));
break;
case CLOCK_EVT_MODE_UNUSED:
@@ -95,8 +95,8 @@ static irqreturn_t lpc32xx_timer_interrupt(int irq, void *dev_id)
struct clock_event_device *evt = &lpc32xx_clkevt;
/* Clear match */
- __raw_writel(LCP32XX_TIMER_CNTR_MTCH_BIT(0),
- LCP32XX_TIMER_IR(LPC32XX_TIMER0_BASE));
+ __raw_writel(LPC32XX_TIMER_CNTR_MTCH_BIT(0),
+ LPC32XX_TIMER_IR(LPC32XX_TIMER0_BASE));
evt->event_handler(evt);
@@ -142,14 +142,14 @@ static void __init lpc32xx_timer_init(void)
clkrate = clkrate / clk_get_pclk_div();
/* Initial timer setup */
- __raw_writel(0, LCP32XX_TIMER_TCR(LPC32XX_TIMER0_BASE));
- __raw_writel(LCP32XX_TIMER_CNTR_MTCH_BIT(0),
- LCP32XX_TIMER_IR(LPC32XX_TIMER0_BASE));
- __raw_writel(1, LCP32XX_TIMER_MR0(LPC32XX_TIMER0_BASE));
- __raw_writel(LCP32XX_TIMER_CNTR_MCR_MTCH(0) |
- LCP32XX_TIMER_CNTR_MCR_STOP(0) |
- LCP32XX_TIMER_CNTR_MCR_RESET(0),
- LCP32XX_TIMER_MCR(LPC32XX_TIMER0_BASE));
+ __raw_writel(0, LPC32XX_TIMER_TCR(LPC32XX_TIMER0_BASE));
+ __raw_writel(LPC32XX_TIMER_CNTR_MTCH_BIT(0),
+ LPC32XX_TIMER_IR(LPC32XX_TIMER0_BASE));
+ __raw_writel(1, LPC32XX_TIMER_MR0(LPC32XX_TIMER0_BASE));
+ __raw_writel(LPC32XX_TIMER_CNTR_MCR_MTCH(0) |
+ LPC32XX_TIMER_CNTR_MCR_STOP(0) |
+ LPC32XX_TIMER_CNTR_MCR_RESET(0),
+ LPC32XX_TIMER_MCR(LPC32XX_TIMER0_BASE));
/* Setup tick interrupt */
setup_irq(IRQ_LPC32XX_TIMER0, &lpc32xx_timer_irq);
@@ -165,12 +165,12 @@ static void __init lpc32xx_timer_init(void)
clockevents_register_device(&lpc32xx_clkevt);
/* Use timer1 as clock source. */
- __raw_writel(LCP32XX_TIMER_CNTR_TCR_RESET,
- LCP32XX_TIMER_TCR(LPC32XX_TIMER1_BASE));
- __raw_writel(0, LCP32XX_TIMER_PR(LPC32XX_TIMER1_BASE));
- __raw_writel(0, LCP32XX_TIMER_MCR(LPC32XX_TIMER1_BASE));
- __raw_writel(LCP32XX_TIMER_CNTR_TCR_EN,
- LCP32XX_TIMER_TCR(LPC32XX_TIMER1_BASE));
+ __raw_writel(LPC32XX_TIMER_CNTR_TCR_RESET,
+ LPC32XX_TIMER_TCR(LPC32XX_TIMER1_BASE));
+ __raw_writel(0, LPC32XX_TIMER_PR(LPC32XX_TIMER1_BASE));
+ __raw_writel(0, LPC32XX_TIMER_MCR(LPC32XX_TIMER1_BASE));
+ __raw_writel(LPC32XX_TIMER_CNTR_TCR_EN,
+ LPC32XX_TIMER_TCR(LPC32XX_TIMER1_BASE));
lpc32xx_clksrc.mult = clocksource_hz2mult(clkrate,
lpc32xx_clksrc.shift);
clocksource_register(&lpc32xx_clksrc);
--
1.7.1.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH 2/7] ARM: LPC32xx: Remove un-needed wakeup code from IRQ ack handler
2010-07-29 16:04 ARM: LPC32xx: Misc arch updates and fixes wellsk40 at gmail.com
2010-07-29 16:04 ` [PATCH 1/7] ARM: LPC32xx: Fix naming convention issues with some defines wellsk40 at gmail.com
@ 2010-07-29 16:04 ` wellsk40 at gmail.com
2010-07-29 16:04 ` [PATCH 3/7] ARM: LPC32xx: Fix gpiolib bit mask macro wellsk40 at gmail.com
` (4 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: wellsk40 at gmail.com @ 2010-07-29 16:04 UTC (permalink / raw)
To: linux-arm-kernel
From: Kevin Wells <wellsk40@gmail.com>
Code was intended for clearing platform wakeup events and just
added extra overhead in the ack handler.
Signed-off-by: Kevin Wells <wellsk40@gmail.com>
---
arch/arm/mach-lpc32xx/irq.c | 5 -----
1 files changed, 0 insertions(+), 5 deletions(-)
diff --git a/arch/arm/mach-lpc32xx/irq.c b/arch/arm/mach-lpc32xx/irq.c
index bd0df26..d539d42 100644
--- a/arch/arm/mach-lpc32xx/irq.c
+++ b/arch/arm/mach-lpc32xx/irq.c
@@ -218,11 +218,6 @@ static void lpc32xx_ack_irq(unsigned int irq)
get_controller(irq, &ctrl, &mask);
__raw_writel(mask, LPC32XX_INTC_RAW_STAT(ctrl));
-
- /* Also need to clear pending wake event */
- if (lpc32xx_events[irq].mask != 0)
- __raw_writel(lpc32xx_events[irq].mask,
- lpc32xx_events[irq].event_group->rawstat_reg);
}
static void __lpc32xx_set_irq_type(unsigned int irq, int use_high_level,
--
1.7.1.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH 3/7] ARM: LPC32xx: Fix gpiolib bit mask macro
2010-07-29 16:04 ARM: LPC32xx: Misc arch updates and fixes wellsk40 at gmail.com
2010-07-29 16:04 ` [PATCH 1/7] ARM: LPC32xx: Fix naming convention issues with some defines wellsk40 at gmail.com
2010-07-29 16:04 ` [PATCH 2/7] ARM: LPC32xx: Remove un-needed wakeup code from IRQ ack handler wellsk40 at gmail.com
@ 2010-07-29 16:04 ` wellsk40 at gmail.com
2010-07-29 16:04 ` [PATCH 4/7] ARM: LPC32xx: Change clocking for AMBA device registration wellsk40 at gmail.com
` (3 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: wellsk40 at gmail.com @ 2010-07-29 16:04 UTC (permalink / raw)
To: linux-arm-kernel
From: Kevin Wells <wellsk40@gmail.com>
The GPIO bank 3 input mask macro was missing a critical mask that
would cause it to return invalid pin states.
Signed-off-by: Kevin Wells <wellsk40@gmail.com>
---
arch/arm/mach-lpc32xx/gpiolib.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/arch/arm/mach-lpc32xx/gpiolib.c b/arch/arm/mach-lpc32xx/gpiolib.c
index 69061ea..073bc9b 100644
--- a/arch/arm/mach-lpc32xx/gpiolib.c
+++ b/arch/arm/mach-lpc32xx/gpiolib.c
@@ -59,7 +59,7 @@
#define GPO3_PIN_TO_BIT(x) (1 << (x))
#define GPIO012_PIN_IN_SEL(x, y) (((x) >> (y)) & 1)
#define GPIO3_PIN_IN_SHIFT(x) ((x) == 5 ? 24 : 10 + (x))
-#define GPIO3_PIN_IN_SEL(x, y) ((x) >> GPIO3_PIN_IN_SHIFT(y))
+#define GPIO3_PIN_IN_SEL(x, y) (((x) >> GPIO3_PIN_IN_SHIFT(y)) & 1)
#define GPIO3_PIN5_IN_SEL(x) (((x) >> 24) & 1)
#define GPI3_PIN_IN_SEL(x, y) (((x) >> (y)) & 1)
--
1.7.1.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH 4/7] ARM: LPC32xx: Change clocking for AMBA device registration
2010-07-29 16:04 ARM: LPC32xx: Misc arch updates and fixes wellsk40 at gmail.com
` (2 preceding siblings ...)
2010-07-29 16:04 ` [PATCH 3/7] ARM: LPC32xx: Fix gpiolib bit mask macro wellsk40 at gmail.com
@ 2010-07-29 16:04 ` wellsk40 at gmail.com
2010-07-29 16:04 ` [PATCH 5/7] ARM: LPC32xx: Add workaround the AMBA LCD clocking wellsk40 at gmail.com
` (2 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: wellsk40 at gmail.com @ 2010-07-29 16:04 UTC (permalink / raw)
To: linux-arm-kernel
From: Kevin Wells <wellsk40@gmail.com>
The LCP32xx will throw an exception if a peripheral block is accessed
when not being clocked. For AMBA registration where the AMBA
peripheral ID is read from the register block, temporarily enable the
clocks during registration and disable them once complete. The
original logic left the clocks on.
Signed-off-by: Kevin Wells <wellsk40@gmail.com>
---
arch/arm/mach-lpc32xx/clock.c | 25 +++++++++++++++++++++++++
arch/arm/mach-lpc32xx/clock.h | 3 +++
arch/arm/mach-lpc32xx/phy3250.c | 21 ++++-----------------
3 files changed, 32 insertions(+), 17 deletions(-)
diff --git a/arch/arm/mach-lpc32xx/clock.c b/arch/arm/mach-lpc32xx/clock.c
index 32d6379..5c3ac73 100644
--- a/arch/arm/mach-lpc32xx/clock.c
+++ b/arch/arm/mach-lpc32xx/clock.c
@@ -1042,6 +1042,31 @@ struct clk *clk_get_parent(struct clk *clk)
}
EXPORT_SYMBOL(clk_get_parent);
+/*
+ * These are the clocks for cells registered as primecell drivers
+ * on the AMBA bus. These must be on during AMBA device registration
+ * since the bus probe will attempt to read magic configuration
+ * registers for these devices. If they are deactivated these probes
+ * will fail.
+ */
+void lpc32xx_clock_primecells(void)
+{
+ clk_enable(&clk_mmc);
+ clk_enable(&clk_lcd);
+ clk_enable(&clk_ssp0);
+ clk_enable(&clk_ssp1);
+}
+EXPORT_SYMBOL(lpc32xx_clock_primecells);
+
+void lpc32xx_unclock_primecells(void)
+{
+ clk_disable(&clk_mmc);
+ clk_disable(&clk_lcd);
+ clk_disable(&clk_ssp0);
+ clk_disable(&clk_ssp1);
+}
+EXPORT_SYMBOL(lpc32xx_unclock_primecells);
+
#define _REGISTER_CLOCK(d, n, c) \
{ \
.dev_id = (d), \
diff --git a/arch/arm/mach-lpc32xx/clock.h b/arch/arm/mach-lpc32xx/clock.h
index c0a8434..f326752 100644
--- a/arch/arm/mach-lpc32xx/clock.h
+++ b/arch/arm/mach-lpc32xx/clock.h
@@ -35,4 +35,7 @@ struct clk {
u32 enable_mask;
};
+void lpc32xx_clock_primecells(void);
+void lpc32xx_unclock_primecells(void);
+
#endif
diff --git a/arch/arm/mach-lpc32xx/phy3250.c b/arch/arm/mach-lpc32xx/phy3250.c
index bc9a42d..50346c9 100644
--- a/arch/arm/mach-lpc32xx/phy3250.c
+++ b/arch/arm/mach-lpc32xx/phy3250.c
@@ -38,6 +38,7 @@
#include <mach/hardware.h>
#include <mach/platform.h>
#include "common.h"
+#include "clock.h"
/*
* Mapped GPIOLIB GPIOs
@@ -340,28 +341,14 @@ static void __init phy3250_board_init(void)
lpc32xx_serial_init();
- /*
- * AMBA peripheral clocks need to be enabled prior to AMBA device
- * detection or a data fault will occur, so enable the clocks
- * here. However, we don't want to enable them if the peripheral
- * isn't included in the image
- */
-#ifdef CONFIG_FB_ARMCLCD
- tmp = __raw_readl(LPC32XX_CLKPWR_LCDCLK_CTRL);
- __raw_writel((tmp | LPC32XX_CLKPWR_LCDCTRL_CLK_EN),
- LPC32XX_CLKPWR_LCDCLK_CTRL);
-#endif
-#ifdef CONFIG_SPI_PL022
- tmp = __raw_readl(LPC32XX_CLKPWR_SSP_CLK_CTRL);
- __raw_writel((tmp | LPC32XX_CLKPWR_SSPCTRL_SSPCLK0_EN),
- LPC32XX_CLKPWR_SSP_CLK_CTRL);
-#endif
-
platform_add_devices(phy3250_devs, ARRAY_SIZE(phy3250_devs));
+
+ lpc32xx_clock_primecells();
for (i = 0; i < ARRAY_SIZE(amba_devs); i++) {
struct amba_device *d = amba_devs[i];
amba_device_register(d, &iomem_resource);
}
+ lpc32xx_unclock_primecells();
/* Test clock needed for UDA1380 initial init */
__raw_writel(LPC32XX_CLKPWR_TESTCLK2_SEL_MOSC |
--
1.7.1.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH 5/7] ARM: LPC32xx: Add workaround the AMBA LCD clocking
2010-07-29 16:04 ARM: LPC32xx: Misc arch updates and fixes wellsk40 at gmail.com
` (3 preceding siblings ...)
2010-07-29 16:04 ` [PATCH 4/7] ARM: LPC32xx: Change clocking for AMBA device registration wellsk40 at gmail.com
@ 2010-07-29 16:04 ` wellsk40 at gmail.com
2010-07-29 16:04 ` [PATCH 6/7] ARM: LPC32xx: Remove MMC peripheral clock enable/disable code wellsk40 at gmail.com
2010-07-29 16:04 ` [PATCH 7/7] ARM: LPC32xx: Replace 'tbd's from audio clock names with NULL wellsk40 at gmail.com
6 siblings, 0 replies; 8+ messages in thread
From: wellsk40 at gmail.com @ 2010-07-29 16:04 UTC (permalink / raw)
To: linux-arm-kernel
From: Kevin Wells <wellsk40@gmail.com>
The AMBA LCD driver attempts to access peripheral registers prior to
enabling the clock for the peripheral. This workaround will get
around that issue by making sure the LCD clock is enabled for the
first peripheral register accesses.
Signed-off-by: Kevin Wells <wellsk40@gmail.com>
---
arch/arm/mach-lpc32xx/phy3250.c | 13 +++++++++++++
1 files changed, 13 insertions(+), 0 deletions(-)
diff --git a/arch/arm/mach-lpc32xx/phy3250.c b/arch/arm/mach-lpc32xx/phy3250.c
index 50346c9..9283cab 100644
--- a/arch/arm/mach-lpc32xx/phy3250.c
+++ b/arch/arm/mach-lpc32xx/phy3250.c
@@ -350,6 +350,19 @@ static void __init phy3250_board_init(void)
}
lpc32xx_unclock_primecells();
+#ifdef CONFIG_FB_ARMCLCD
+ /*
+ * The AMBA PL11x driver attempts to disable the LCD and then
+ * access some peripheral registers while the clock is disabled.
+ * This workaround won't fix the unbalanced clock enable and
+ * disable, but will prevent the ARM core from throwing an
+ * exception when that happens.
+ */
+ tmp = __raw_readl(LPC32XX_CLKPWR_LCDCLK_CTRL);
+ __raw_writel((tmp | LPC32XX_CLKPWR_LCDCTRL_CLK_EN),
+ LPC32XX_CLKPWR_LCDCLK_CTRL);
+#endif
+
/* Test clock needed for UDA1380 initial init */
__raw_writel(LPC32XX_CLKPWR_TESTCLK2_SEL_MOSC |
LPC32XX_CLKPWR_TESTCLK_TESTCLK2_EN,
--
1.7.1.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH 6/7] ARM: LPC32xx: Remove MMC peripheral clock enable/disable code
2010-07-29 16:04 ARM: LPC32xx: Misc arch updates and fixes wellsk40 at gmail.com
` (4 preceding siblings ...)
2010-07-29 16:04 ` [PATCH 5/7] ARM: LPC32xx: Add workaround the AMBA LCD clocking wellsk40 at gmail.com
@ 2010-07-29 16:04 ` wellsk40 at gmail.com
2010-07-29 16:04 ` [PATCH 7/7] ARM: LPC32xx: Replace 'tbd's from audio clock names with NULL wellsk40 at gmail.com
6 siblings, 0 replies; 8+ messages in thread
From: wellsk40 at gmail.com @ 2010-07-29 16:04 UTC (permalink / raw)
To: linux-arm-kernel
From: Kevin Wells <wellsk40@gmail.com>
The MMC clock rate set and get functions had extra code to force
the high level peripheral clock to enable prior to register
accesses. This isn't needed.
Signed-off-by: Kevin Wells <wellsk40@gmail.com>
---
arch/arm/mach-lpc32xx/clock.c | 14 ++------------
1 files changed, 2 insertions(+), 12 deletions(-)
diff --git a/arch/arm/mach-lpc32xx/clock.c b/arch/arm/mach-lpc32xx/clock.c
index 5c3ac73..e562d1b 100644
--- a/arch/arm/mach-lpc32xx/clock.c
+++ b/arch/arm/mach-lpc32xx/clock.c
@@ -738,14 +738,9 @@ static int mmc_onoff_enable(struct clk *clk, int enable)
static unsigned long mmc_get_rate(struct clk *clk)
{
- u32 div, rate, oldclk;
+ u32 div, rate;
- /* 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);
div = __raw_readl(LPC32XX_CLKPWR_MS_CTRL);
- __raw_writel(oldclk, LPC32XX_CLKPWR_MS_CTRL);
/* Get the parent clock rate */
rate = clk->parent->get_rate(clk->parent);
@@ -778,7 +773,7 @@ static unsigned long mmc_round_rate(struct clk *clk, unsigned long rate)
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);
@@ -786,16 +781,11 @@ static int mmc_set_rate(struct clk *clk, unsigned long rate)
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);
__raw_writel(tmp, LPC32XX_CLKPWR_MS_CTRL);
- __raw_writel(oldclk, LPC32XX_CLKPWR_MS_CTRL);
-
return 0;
}
--
1.7.1.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH 7/7] ARM: LPC32xx: Replace 'tbd's from audio clock names with NULL
2010-07-29 16:04 ARM: LPC32xx: Misc arch updates and fixes wellsk40 at gmail.com
` (5 preceding siblings ...)
2010-07-29 16:04 ` [PATCH 6/7] ARM: LPC32xx: Remove MMC peripheral clock enable/disable code wellsk40 at gmail.com
@ 2010-07-29 16:04 ` wellsk40 at gmail.com
6 siblings, 0 replies; 8+ messages in thread
From: wellsk40 at gmail.com @ 2010-07-29 16:04 UTC (permalink / raw)
To: linux-arm-kernel
From: Kevin Wells <wellsk40@gmail.com>
Signed-off-by: Kevin Wells <wellsk40@gmail.com>
---
arch/arm/mach-lpc32xx/clock.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/arm/mach-lpc32xx/clock.c b/arch/arm/mach-lpc32xx/clock.c
index e562d1b..043a5de 100644
--- a/arch/arm/mach-lpc32xx/clock.c
+++ b/arch/arm/mach-lpc32xx/clock.c
@@ -1091,8 +1091,8 @@ static struct clk_lookup lookups[] = {
_REGISTER_CLOCK("dev:ssp1", NULL, clk_ssp1)
_REGISTER_CLOCK("lpc32xx_keys.0", NULL, clk_kscan)
_REGISTER_CLOCK("lpc32xx-nand.0", "nand_ck", clk_nand)
- _REGISTER_CLOCK("tbd", "i2s0_ck", clk_i2s0)
- _REGISTER_CLOCK("tbd", "i2s1_ck", clk_i2s1)
+ _REGISTER_CLOCK(NULL, "i2s0_ck", clk_i2s0)
+ _REGISTER_CLOCK(NULL, "i2s1_ck", clk_i2s1)
_REGISTER_CLOCK("lpc32xx-ts", NULL, clk_tsc)
_REGISTER_CLOCK("dev:mmc0", "MCLK", clk_mmc)
_REGISTER_CLOCK("lpc-net.0", NULL, clk_net)
--
1.7.1.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
end of thread, other threads:[~2010-07-29 16:04 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-07-29 16:04 ARM: LPC32xx: Misc arch updates and fixes wellsk40 at gmail.com
2010-07-29 16:04 ` [PATCH 1/7] ARM: LPC32xx: Fix naming convention issues with some defines wellsk40 at gmail.com
2010-07-29 16:04 ` [PATCH 2/7] ARM: LPC32xx: Remove un-needed wakeup code from IRQ ack handler wellsk40 at gmail.com
2010-07-29 16:04 ` [PATCH 3/7] ARM: LPC32xx: Fix gpiolib bit mask macro wellsk40 at gmail.com
2010-07-29 16:04 ` [PATCH 4/7] ARM: LPC32xx: Change clocking for AMBA device registration wellsk40 at gmail.com
2010-07-29 16:04 ` [PATCH 5/7] ARM: LPC32xx: Add workaround the AMBA LCD clocking wellsk40 at gmail.com
2010-07-29 16:04 ` [PATCH 6/7] ARM: LPC32xx: Remove MMC peripheral clock enable/disable code wellsk40 at gmail.com
2010-07-29 16:04 ` [PATCH 7/7] ARM: LPC32xx: Replace 'tbd's from audio clock names with NULL wellsk40 at gmail.com
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).