From 435c5da00b9610f9664c5d6f38dfdafce419ef4a Mon Sep 17 00:00:00 2001 From: Michael-Luke Jones Date: Wed, 23 May 2007 22:38:45 +0100 Subject: [ARM] 4405/1: NSLU2, DSM-G600 frequency fixup code This patch is required as the frequency fixup in nslu2_init does not run sufficiently early in the boot sequence to take effect. In addition the dsmg600 setup code behaviour has been improved such that a 'fixup' routine is avoided. Signed-off-by: Michael-Luke Jones Signed-off-by: Russell King --- arch/arm/mach-ixp4xx/nslu2-setup.c | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'arch/arm/mach-ixp4xx/nslu2-setup.c') diff --git a/arch/arm/mach-ixp4xx/nslu2-setup.c b/arch/arm/mach-ixp4xx/nslu2-setup.c index 162c266e5f8f..1aa45a2e6d62 100644 --- a/arch/arm/mach-ixp4xx/nslu2-setup.c +++ b/arch/arm/mach-ixp4xx/nslu2-setup.c @@ -22,6 +22,7 @@ #include #include #include +#include static struct flash_platform_data nslu2_flash_data = { .map_name = "cfi_probe", @@ -157,10 +158,21 @@ static void nslu2_power_off(void) gpio_line_set(NSLU2_PO_GPIO, IXP4XX_GPIO_HIGH); } -static void __init nslu2_init(void) +static void __init nslu2_timer_init(void) { - ixp4xx_timer_freq = NSLU2_FREQ; + /* The xtal on this machine is non-standard. */ + ixp4xx_timer_freq = NSLU2_FREQ; + + /* Call standard timer_init function. */ + ixp4xx_timer_init(); +} +static struct sys_timer nslu2_timer = { + .init = nslu2_timer_init, +}; + +static void __init nslu2_init(void) +{ ixp4xx_sys_init(); nslu2_flash_resource.start = IXP4XX_EXP_BUS_BASE(0); @@ -185,6 +197,6 @@ MACHINE_START(NSLU2, "Linksys NSLU2") .boot_params = 0x00000100, .map_io = ixp4xx_map_io, .init_irq = ixp4xx_init_irq, - .timer = &ixp4xx_timer, + .timer = &nslu2_timer, .init_machine = nslu2_init, MACHINE_END -- cgit v1.2.3-59-g8ed1b From cc50a0df51e4f2a7982ade338b3d74825ca67e08 Mon Sep 17 00:00:00 2001 From: Michael-Luke Jones Date: Wed, 23 May 2007 22:41:53 +0100 Subject: [ARM] 4406/1: Trivial NSLU2 / NAS-100D header & setup code cleanup This trivial patch updates the nslu2 and nas-100d headers to remove pointless GPIO defines, and updates nslu2-setup.c accordingly. In addition minor style cleanups to some comments are included. Signed-off-by: Michael-Luke Jones Signed-off-by: Russell King --- arch/arm/mach-ixp4xx/nas100d-setup.c | 3 ++- arch/arm/mach-ixp4xx/nslu2-setup.c | 19 ++++++++------- include/asm-arm/arch-ixp4xx/nas100d.h | 28 +++------------------ include/asm-arm/arch-ixp4xx/nslu2.h | 46 +++++++++-------------------------- 4 files changed, 28 insertions(+), 68 deletions(-) (limited to 'arch/arm/mach-ixp4xx/nslu2-setup.c') diff --git a/arch/arm/mach-ixp4xx/nas100d-setup.c b/arch/arm/mach-ixp4xx/nas100d-setup.c index 9a31444d9214..78a17413ceca 100644 --- a/arch/arm/mach-ixp4xx/nas100d-setup.c +++ b/arch/arm/mach-ixp4xx/nas100d-setup.c @@ -155,7 +155,8 @@ static void __init nas100d_init(void) pm_power_off = nas100d_power_off; - /* This is only useful on a modified machine, but it is valuable + /* + * This is only useful on a modified machine, but it is valuable * to have it first in order to see debug messages, and so that * it does *not* get removed if platform_add_devices fails! */ diff --git a/arch/arm/mach-ixp4xx/nslu2-setup.c b/arch/arm/mach-ixp4xx/nslu2-setup.c index 1aa45a2e6d62..9bf8ccbcaccf 100644 --- a/arch/arm/mach-ixp4xx/nslu2-setup.c +++ b/arch/arm/mach-ixp4xx/nslu2-setup.c @@ -50,26 +50,26 @@ static struct ixp4xx_i2c_pins nslu2_i2c_gpio_pins = { static struct resource nslu2_led_resources[] = { { .name = "ready", /* green led */ - .start = NSLU2_LED_GRN, - .end = NSLU2_LED_GRN, + .start = NSLU2_LED_GRN_GPIO, + .end = NSLU2_LED_GRN_GPIO, .flags = IXP4XX_GPIO_HIGH, }, { .name = "status", /* red led */ - .start = NSLU2_LED_RED, - .end = NSLU2_LED_RED, + .start = NSLU2_LED_RED_GPIO, + .end = NSLU2_LED_RED_GPIO, .flags = IXP4XX_GPIO_HIGH, }, { .name = "disk-1", - .start = NSLU2_LED_DISK1, - .end = NSLU2_LED_DISK1, + .start = NSLU2_LED_DISK1_GPIO, + .end = NSLU2_LED_DISK1_GPIO, .flags = IXP4XX_GPIO_LOW, }, { .name = "disk-2", - .start = NSLU2_LED_DISK2, - .end = NSLU2_LED_DISK2, + .start = NSLU2_LED_DISK2_GPIO, + .end = NSLU2_LED_DISK2_GPIO, .flags = IXP4XX_GPIO_LOW, }, }; @@ -181,7 +181,8 @@ static void __init nslu2_init(void) pm_power_off = nslu2_power_off; - /* This is only useful on a modified machine, but it is valuable + /* + * This is only useful on a modified machine, but it is valuable * to have it first in order to see debug messages, and so that * it does *not* get removed if platform_add_devices fails! */ diff --git a/include/asm-arm/arch-ixp4xx/nas100d.h b/include/asm-arm/arch-ixp4xx/nas100d.h index 84467a5190d0..131e0a1d0df3 100644 --- a/include/asm-arm/arch-ixp4xx/nas100d.h +++ b/include/asm-arm/arch-ixp4xx/nas100d.h @@ -10,7 +10,7 @@ * based on ixdp425.h: * Copyright 2004 (c) MontaVista, Software, Inc. * - * This file is licensed under the terms of the GNU General Public + * This file is licensed under the terms of the GNU General Public * License version 2. This program is licensed "as is" without any * warranty of any kind, whether express or implied. */ @@ -36,31 +36,11 @@ #define NAS100D_PCI_INTD_PIN 8 #define NAS100D_PCI_INTE_PIN 7 -/* GPIO */ - -#define NAS100D_GPIO0 0 -#define NAS100D_GPIO1 1 -#define NAS100D_GPIO2 2 -#define NAS100D_GPIO3 3 -#define NAS100D_GPIO4 4 -#define NAS100D_GPIO5 5 -#define NAS100D_GPIO6 6 -#define NAS100D_GPIO7 7 -#define NAS100D_GPIO8 8 -#define NAS100D_GPIO9 9 -#define NAS100D_GPIO10 10 -#define NAS100D_GPIO11 11 -#define NAS100D_GPIO12 12 -#define NAS100D_GPIO13 13 -#define NAS100D_GPIO14 14 -#define NAS100D_GPIO15 15 - - /* Buttons */ -#define NAS100D_PB_GPIO NAS100D_GPIO14 -#define NAS100D_RB_GPIO NAS100D_GPIO4 -#define NAS100D_PO_GPIO NAS100D_GPIO12 /* power off */ +#define NAS100D_PB_GPIO 14 +#define NAS100D_RB_GPIO 4 +#define NAS100D_PO_GPIO 12 /* power off */ #define NAS100D_PB_IRQ IRQ_IXP4XX_GPIO14 #define NAS100D_RB_IRQ IRQ_IXP4XX_GPIO4 diff --git a/include/asm-arm/arch-ixp4xx/nslu2.h b/include/asm-arm/arch-ixp4xx/nslu2.h index 6b437f7c9955..850fdc5b45da 100644 --- a/include/asm-arm/arch-ixp4xx/nslu2.h +++ b/include/asm-arm/arch-ixp4xx/nslu2.h @@ -9,7 +9,7 @@ * based on ixdp425.h: * Copyright 2004 (c) MontaVista, Software, Inc. * - * This file is licensed under the terms of the GNU General Public + * This file is licensed under the terms of the GNU General Public * License version 2. This program is licensed "as is" without any * warranty of any kind, whether express or implied. */ @@ -34,36 +34,14 @@ #define NSLU2_PCI_INTC_PIN 9 #define NSLU2_PCI_INTD_PIN 8 - /* NSLU2 Timer */ #define NSLU2_FREQ 66000000 -#define NSLU2_CLOCK_TICK_RATE (((NSLU2_FREQ / HZ & ~IXP4XX_OST_RELOAD_MASK) + 1) * HZ) -#define NSLU2_CLOCK_TICKS_PER_USEC ((NSLU2_CLOCK_TICK_RATE + USEC_PER_SEC/2) / USEC_PER_SEC) - -/* GPIO */ - -#define NSLU2_GPIO0 0 -#define NSLU2_GPIO1 1 -#define NSLU2_GPIO2 2 -#define NSLU2_GPIO3 3 -#define NSLU2_GPIO4 4 -#define NSLU2_GPIO5 5 -#define NSLU2_GPIO6 6 -#define NSLU2_GPIO7 7 -#define NSLU2_GPIO8 8 -#define NSLU2_GPIO9 9 -#define NSLU2_GPIO10 10 -#define NSLU2_GPIO11 11 -#define NSLU2_GPIO12 12 -#define NSLU2_GPIO13 13 -#define NSLU2_GPIO14 14 -#define NSLU2_GPIO15 15 /* Buttons */ -#define NSLU2_PB_GPIO NSLU2_GPIO5 -#define NSLU2_PO_GPIO NSLU2_GPIO8 /* power off */ -#define NSLU2_RB_GPIO NSLU2_GPIO12 +#define NSLU2_PB_GPIO 5 +#define NSLU2_PO_GPIO 8 /* power off */ +#define NSLU2_RB_GPIO 12 #define NSLU2_PB_IRQ IRQ_IXP4XX_GPIO5 #define NSLU2_RB_IRQ IRQ_IXP4XX_GPIO12 @@ -79,16 +57,16 @@ /* LEDs */ -#define NSLU2_LED_RED NSLU2_GPIO0 -#define NSLU2_LED_GRN NSLU2_GPIO1 +#define NSLU2_LED_RED_GPIO 0 +#define NSLU2_LED_GRN_GPIO 1 -#define NSLU2_LED_RED_BM (1L << NSLU2_LED_RED) -#define NSLU2_LED_GRN_BM (1L << NSLU2_LED_GRN) +#define NSLU2_LED_RED_BM (1L << NSLU2_LED_RED_GPIO) +#define NSLU2_LED_GRN_BM (1L << NSLU2_LED_GRN_GPIO) -#define NSLU2_LED_DISK1 NSLU2_GPIO3 -#define NSLU2_LED_DISK2 NSLU2_GPIO2 +#define NSLU2_LED_DISK1_GPIO 3 +#define NSLU2_LED_DISK2_GPIO 2 -#define NSLU2_LED_DISK1_BM (1L << NSLU2_GPIO2) -#define NSLU2_LED_DISK2_BM (1L << NSLU2_GPIO3) +#define NSLU2_LED_DISK1_BM (1L << NSLU2_LED_DISK1_GPIO) +#define NSLU2_LED_DISK2_BM (1L << NSLU2_LED_DISK2_GPIO) -- cgit v1.2.3-59-g8ed1b