2 * arch/arm/mach-ixp4xx/nslu2-setup.c
6 * based ixdp425-setup.c:
7 * Copyright (C) 2003-2004 MontaVista Software, Inc.
9 * Author: Mark Rakes <mrakes at mac.com>
10 * Maintainers: http://www.nslu2-linux.org/
12 * Fixed missing init_time in MACHINE_START kas11 10/22/04
13 * Changed to conform to new style __init ixdp425 kas11 10/22/04
16 #include <linux/kernel.h>
17 #include <linux/init.h>
18 #include <linux/device.h>
19 #include <linux/serial.h>
20 #include <linux/tty.h>
21 #include <linux/serial_8250.h>
23 #include <asm/types.h>
24 #include <asm/setup.h>
25 #include <asm/memory.h>
26 #include <asm/hardware.h>
27 #include <asm/mach-types.h>
29 #include <asm/mach/arch.h>
30 #include <asm/mach/flash.h>
32 void __init nslu2_map_io(void)
37 static struct flash_platform_data nslu2_flash_data = {
38 .map_name = "cfi_probe",
42 static struct resource nslu2_flash_resource = {
43 .start = NSLU2_FLASH_BASE,
44 .end = NSLU2_FLASH_BASE + NSLU2_FLASH_SIZE,
45 .flags = IORESOURCE_MEM,
48 static struct platform_device nslu2_flash = {
49 .name = "IXP4XX-Flash",
52 .platform_data = &nslu2_flash_data,
55 .resource = &nslu2_flash_resource,
58 static struct ixp4xx_i2c_pins nslu2_i2c_gpio_pins = {
59 .sda_pin = NSLU2_SDA_PIN,
60 .scl_pin = NSLU2_SCL_PIN,
63 static struct platform_device nslu2_i2c_controller = {
67 .platform_data = &nslu2_i2c_gpio_pins,
72 static struct resource nslu2_uart_resources[] = {
74 .start = IXP4XX_UART1_BASE_PHYS,
75 .end = IXP4XX_UART1_BASE_PHYS + 0x0fff,
76 .flags = IORESOURCE_MEM
79 .start = IXP4XX_UART2_BASE_PHYS,
80 .end = IXP4XX_UART2_BASE_PHYS + 0x0fff,
81 .flags = IORESOURCE_MEM
85 static struct plat_serial8250_port nslu2_uart_data[] = {
87 .mapbase = IXP4XX_UART1_BASE_PHYS,
88 .membase = (char *)IXP4XX_UART1_BASE_VIRT + REG_OFFSET,
89 .irq = IRQ_IXP4XX_UART1,
90 .flags = UPF_BOOT_AUTOCONF,
93 .uartclk = IXP4XX_UART_XTAL,
96 .mapbase = IXP4XX_UART2_BASE_PHYS,
97 .membase = (char *)IXP4XX_UART2_BASE_VIRT + REG_OFFSET,
98 .irq = IRQ_IXP4XX_UART2,
99 .flags = UPF_BOOT_AUTOCONF,
102 .uartclk = IXP4XX_UART_XTAL,
106 static struct platform_device nslu2_uart = {
107 .name = "serial8250",
109 .dev.platform_data = nslu2_uart_data,
111 .resource = nslu2_uart_resources
114 static struct platform_device *nslu2_devices[] __initdata = {
115 &nslu2_i2c_controller,
120 static void n2_power_off(void)
122 /* This causes the box to drop the power and go dead. */
123 #define GPIO_PO_BM 0x0100 //b0000 0001 0000 0000
124 *IXP4XX_GPIO_GPOER &= ~GPIO_PO_BM; // enable the pwr cntl gpio
125 *IXP4XX_GPIO_GPOUTR |= GPIO_PO_BM; // do the deed
128 static void __init nslu2_init(void)
132 pm_power_off = n2_power_off;
133 platform_add_devices(nslu2_devices, ARRAY_SIZE(nslu2_devices));
136 MACHINE_START(NSLU2, "Linksys NSLU2")
137 MAINTAINER("www.nslu2-linux.org")
138 BOOT_MEM(PHYS_OFFSET, IXP4XX_PERIPHERAL_BASE_PHYS,
139 IXP4XX_PERIPHERAL_BASE_VIRT)
141 INITIRQ(ixp4xx_init_irq) //FIXME: all irq are off here
142 .timer = &ixp4xx_timer,
143 // INITTIME(ixp4xx_init_time) //this was missing in 2.6.7 code ...soft reboot needed?
145 INIT_MACHINE(nslu2_init)