aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm
diff options
context:
space:
mode:
authorRussell King <rmk@dyn-67.arm.linux.org.uk>2006-07-10 11:33:54 -0400
committerRussell King <rmk+kernel@arm.linux.org.uk>2006-07-11 16:10:42 -0400
commitdc5bc8f1e96c32f28bddf32a14ef9251fb3071d0 (patch)
treeb470bc2c690ee2d62e2aee5849d5732d6d812033 /arch/arm
parent20c4f88b7e4c2cd73bd4276417a9a0d4d22b0d66 (diff)
[ARM] Allow Versatile to be built for AB and PB
If a configuration was chosen to support both the Versatile AB and PB boards, the result would write to registers not available on the PB version of the board. Resolve this by using machine_is_xxx(). Also, for the CLCD, despite how the code looks, both the AB and PB access the same location to control the clock rate - it's just called something different between the two board versions. Invent our own name for this location and use it unconditionally. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm')
-rw-r--r--arch/arm/mach-versatile/core.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/arch/arm/mach-versatile/core.c b/arch/arm/mach-versatile/core.c
index a432539cc1bd..864377176015 100644
--- a/arch/arm/mach-versatile/core.c
+++ b/arch/arm/mach-versatile/core.c
@@ -35,6 +35,7 @@
35#include <asm/hardware/arm_timer.h> 35#include <asm/hardware/arm_timer.h>
36#include <asm/hardware/icst307.h> 36#include <asm/hardware/icst307.h>
37#include <asm/hardware/vic.h> 37#include <asm/hardware/vic.h>
38#include <asm/mach-types.h>
38 39
39#include <asm/mach/arch.h> 40#include <asm/mach/arch.h>
40#include <asm/mach/flash.h> 41#include <asm/mach/flash.h>
@@ -352,11 +353,7 @@ static const struct icst307_params versatile_oscvco_params = {
352static void versatile_oscvco_set(struct clk *clk, struct icst307_vco vco) 353static void versatile_oscvco_set(struct clk *clk, struct icst307_vco vco)
353{ 354{
354 void __iomem *sys_lock = __io_address(VERSATILE_SYS_BASE) + VERSATILE_SYS_LOCK_OFFSET; 355 void __iomem *sys_lock = __io_address(VERSATILE_SYS_BASE) + VERSATILE_SYS_LOCK_OFFSET;
355#if defined(CONFIG_ARCH_VERSATILE_PB) 356 void __iomem *sys_osc = __io_address(VERSATILE_SYS_BASE) + VERSATILE_SYS_OSCCLCD_OFFSET;
356 void __iomem *sys_osc = __io_address(VERSATILE_SYS_BASE) + VERSATILE_SYS_OSC4_OFFSET;
357#elif defined(CONFIG_MACH_VERSATILE_AB)
358 void __iomem *sys_osc = __io_address(VERSATILE_SYS_BASE) + VERSATILE_SYS_OSC1_OFFSET;
359#endif
360 u32 val; 357 u32 val;
361 358
362 val = readl(sys_osc) & ~0x7ffff; 359 val = readl(sys_osc) & ~0x7ffff;
@@ -529,7 +526,7 @@ static void versatile_clcd_disable(struct clcd_fb *fb)
529 /* 526 /*
530 * If the LCD is Sanyo 2x5 in on the IB2 board, turn the back-light off 527 * If the LCD is Sanyo 2x5 in on the IB2 board, turn the back-light off
531 */ 528 */
532 if (fb->panel == &sanyo_2_5_in) { 529 if (machine_is_versatile_ab() && fb->panel == &sanyo_2_5_in) {
533 void __iomem *versatile_ib2_ctrl = __io_address(VERSATILE_IB2_CTRL); 530 void __iomem *versatile_ib2_ctrl = __io_address(VERSATILE_IB2_CTRL);
534 unsigned long ctrl; 531 unsigned long ctrl;
535 532
@@ -578,7 +575,7 @@ static void versatile_clcd_enable(struct clcd_fb *fb)
578 /* 575 /*
579 * If the LCD is Sanyo 2x5 in on the IB2 board, turn the back-light on 576 * If the LCD is Sanyo 2x5 in on the IB2 board, turn the back-light on
580 */ 577 */
581 if (fb->panel == &sanyo_2_5_in) { 578 if (machine_is_versatile_ab() && fb->panel == &sanyo_2_5_in) {
582 void __iomem *versatile_ib2_ctrl = __io_address(VERSATILE_IB2_CTRL); 579 void __iomem *versatile_ib2_ctrl = __io_address(VERSATILE_IB2_CTRL);
583 unsigned long ctrl; 580 unsigned long ctrl;
584 581