Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[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>

authored by

Russell King and committed by
Russell King
dc5bc8f1 20c4f88b

+6 -7
+4 -7
arch/arm/mach-versatile/core.c
··· 35 35 #include <asm/hardware/arm_timer.h> 36 36 #include <asm/hardware/icst307.h> 37 37 #include <asm/hardware/vic.h> 38 + #include <asm/mach-types.h> 38 39 39 40 #include <asm/mach/arch.h> 40 41 #include <asm/mach/flash.h> ··· 353 352 static void versatile_oscvco_set(struct clk *clk, struct icst307_vco vco) 354 353 { 355 354 void __iomem *sys_lock = __io_address(VERSATILE_SYS_BASE) + VERSATILE_SYS_LOCK_OFFSET; 356 - #if defined(CONFIG_ARCH_VERSATILE_PB) 357 - void __iomem *sys_osc = __io_address(VERSATILE_SYS_BASE) + VERSATILE_SYS_OSC4_OFFSET; 358 - #elif defined(CONFIG_MACH_VERSATILE_AB) 359 - void __iomem *sys_osc = __io_address(VERSATILE_SYS_BASE) + VERSATILE_SYS_OSC1_OFFSET; 360 - #endif 355 + void __iomem *sys_osc = __io_address(VERSATILE_SYS_BASE) + VERSATILE_SYS_OSCCLCD_OFFSET; 361 356 u32 val; 362 357 363 358 val = readl(sys_osc) & ~0x7ffff; ··· 526 529 /* 527 530 * If the LCD is Sanyo 2x5 in on the IB2 board, turn the back-light off 528 531 */ 529 - if (fb->panel == &sanyo_2_5_in) { 532 + if (machine_is_versatile_ab() && fb->panel == &sanyo_2_5_in) { 530 533 void __iomem *versatile_ib2_ctrl = __io_address(VERSATILE_IB2_CTRL); 531 534 unsigned long ctrl; 532 535 ··· 575 578 /* 576 579 * If the LCD is Sanyo 2x5 in on the IB2 board, turn the back-light on 577 580 */ 578 - if (fb->panel == &sanyo_2_5_in) { 581 + if (machine_is_versatile_ab() && fb->panel == &sanyo_2_5_in) { 579 582 void __iomem *versatile_ib2_ctrl = __io_address(VERSATILE_IB2_CTRL); 580 583 unsigned long ctrl; 581 584
+2
include/asm-arm/arch-versatile/platform.h
··· 65 65 #define VERSATILE_SYS_OSC1_OFFSET 0x1C 66 66 #endif 67 67 68 + #define VERSATILE_SYS_OSCCLCD_OFFSET 0x1c 69 + 68 70 #define VERSATILE_SYS_LOCK_OFFSET 0x20 69 71 #define VERSATILE_SYS_100HZ_OFFSET 0x24 70 72 #define VERSATILE_SYS_CFGDATA1_OFFSET 0x28