Commit 435c5da0 authored by Michael-Luke Jones's avatar Michael-Luke Jones Committed by Russell King

[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: default avatarMichael-Luke Jones <mlj28@cam.ac.uk>
Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
parent e87a8e85
...@@ -283,7 +283,7 @@ static struct irqaction ixp4xx_timer_irq = { ...@@ -283,7 +283,7 @@ static struct irqaction ixp4xx_timer_irq = {
.handler = ixp4xx_timer_interrupt, .handler = ixp4xx_timer_interrupt,
}; };
static void __init ixp4xx_timer_init(void) void __init ixp4xx_timer_init(void)
{ {
/* Reset/disable counter */ /* Reset/disable counter */
*IXP4XX_OSRT1 = 0; *IXP4XX_OSRT1 = 0;
......
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
#include <asm/mach-types.h> #include <asm/mach-types.h>
#include <asm/mach/arch.h> #include <asm/mach/arch.h>
#include <asm/mach/flash.h> #include <asm/mach/flash.h>
#include <asm/mach/time.h>
static struct flash_platform_data dsmg600_flash_data = { static struct flash_platform_data dsmg600_flash_data = {
.map_name = "cfi_probe", .map_name = "cfi_probe",
...@@ -128,6 +129,19 @@ static void dsmg600_power_off(void) ...@@ -128,6 +129,19 @@ static void dsmg600_power_off(void)
gpio_line_set(DSMG600_PO_GPIO, IXP4XX_GPIO_HIGH); gpio_line_set(DSMG600_PO_GPIO, IXP4XX_GPIO_HIGH);
} }
static void __init dsmg600_timer_init(void)
{
/* The xtal on this machine is non-standard. */
ixp4xx_timer_freq = DSMG600_FREQ;
/* Call standard timer_init function. */
ixp4xx_timer_init();
}
static struct sys_timer dsmg600_timer = {
.init = dsmg600_timer_init,
};
static void __init dsmg600_init(void) static void __init dsmg600_init(void)
{ {
ixp4xx_sys_init(); ixp4xx_sys_init();
...@@ -155,21 +169,13 @@ static void __init dsmg600_init(void) ...@@ -155,21 +169,13 @@ static void __init dsmg600_init(void)
#endif #endif
} }
static void __init dsmg600_fixup(struct machine_desc *desc,
struct tag *tags, char **cmdline, struct meminfo *mi)
{
/* The xtal on this machine is non-standard. */
ixp4xx_timer_freq = DSMG600_FREQ;
}
MACHINE_START(DSMG600, "D-Link DSM-G600 RevA") MACHINE_START(DSMG600, "D-Link DSM-G600 RevA")
/* Maintainer: www.nslu2-linux.org */ /* Maintainer: www.nslu2-linux.org */
.phys_io = IXP4XX_PERIPHERAL_BASE_PHYS, .phys_io = IXP4XX_PERIPHERAL_BASE_PHYS,
.io_pg_offst = ((IXP4XX_PERIPHERAL_BASE_VIRT) >> 18) & 0xFFFC, .io_pg_offst = ((IXP4XX_PERIPHERAL_BASE_VIRT) >> 18) & 0xFFFC,
.boot_params = 0x00000100, .boot_params = 0x00000100,
.fixup = dsmg600_fixup,
.map_io = ixp4xx_map_io, .map_io = ixp4xx_map_io,
.init_irq = ixp4xx_init_irq, .init_irq = ixp4xx_init_irq,
.timer = &ixp4xx_timer, .timer = &dsmg600_timer,
.init_machine = dsmg600_init, .init_machine = dsmg600_init,
MACHINE_END MACHINE_END
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
#include <asm/mach-types.h> #include <asm/mach-types.h>
#include <asm/mach/arch.h> #include <asm/mach/arch.h>
#include <asm/mach/flash.h> #include <asm/mach/flash.h>
#include <asm/mach/time.h>
static struct flash_platform_data nslu2_flash_data = { static struct flash_platform_data nslu2_flash_data = {
.map_name = "cfi_probe", .map_name = "cfi_probe",
...@@ -157,10 +158,21 @@ static void nslu2_power_off(void) ...@@ -157,10 +158,21 @@ static void nslu2_power_off(void)
gpio_line_set(NSLU2_PO_GPIO, IXP4XX_GPIO_HIGH); 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(); ixp4xx_sys_init();
nslu2_flash_resource.start = IXP4XX_EXP_BUS_BASE(0); nslu2_flash_resource.start = IXP4XX_EXP_BUS_BASE(0);
...@@ -185,6 +197,6 @@ MACHINE_START(NSLU2, "Linksys NSLU2") ...@@ -185,6 +197,6 @@ MACHINE_START(NSLU2, "Linksys NSLU2")
.boot_params = 0x00000100, .boot_params = 0x00000100,
.map_io = ixp4xx_map_io, .map_io = ixp4xx_map_io,
.init_irq = ixp4xx_init_irq, .init_irq = ixp4xx_init_irq,
.timer = &ixp4xx_timer, .timer = &nslu2_timer,
.init_machine = nslu2_init, .init_machine = nslu2_init,
MACHINE_END MACHINE_END
...@@ -113,6 +113,7 @@ extern unsigned long ixp4xx_timer_freq; ...@@ -113,6 +113,7 @@ extern unsigned long ixp4xx_timer_freq;
extern void ixp4xx_map_io(void); extern void ixp4xx_map_io(void);
extern void ixp4xx_init_irq(void); extern void ixp4xx_init_irq(void);
extern void ixp4xx_sys_init(void); extern void ixp4xx_sys_init(void);
extern void ixp4xx_timer_init(void);
extern struct sys_timer ixp4xx_timer; extern struct sys_timer ixp4xx_timer;
extern void ixp4xx_pci_preinit(void); extern void ixp4xx_pci_preinit(void);
struct pci_sys_data; struct pci_sys_data;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment