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/serial.h>
18 #include <linux/serial_8250.h>
20 #include <asm/mach-types.h>
21 #include <asm/mach/arch.h>
22 #include <asm/mach/flash.h>
24 static struct flash_platform_data nslu2_flash_data = {
25 .map_name = "cfi_probe",
29 static struct resource nslu2_flash_resource = {
30 .flags = IORESOURCE_MEM,
33 static struct platform_device nslu2_flash = {
34 .name = "IXP4XX-Flash",
36 .dev.platform_data = &nslu2_flash_data,
38 .resource = &nslu2_flash_resource,
41 static struct ixp4xx_i2c_pins nslu2_i2c_gpio_pins = {
42 .sda_pin = NSLU2_SDA_PIN,
43 .scl_pin = NSLU2_SCL_PIN,
46 static struct platform_device nslu2_i2c_controller = {
49 .dev.platform_data = &nslu2_i2c_gpio_pins,
53 static struct platform_device nslu2_beeper = {
54 .name = "ixp4xx-beeper",
55 .id = NSLU2_GPIO_BUZZ,
59 static struct resource nslu2_uart_resources[] = {
61 .start = IXP4XX_UART1_BASE_PHYS,
62 .end = IXP4XX_UART1_BASE_PHYS + 0x0fff,
63 .flags = IORESOURCE_MEM,
66 .start = IXP4XX_UART2_BASE_PHYS,
67 .end = IXP4XX_UART2_BASE_PHYS + 0x0fff,
68 .flags = IORESOURCE_MEM,
72 static struct plat_serial8250_port nslu2_uart_data[] = {
74 .mapbase = IXP4XX_UART1_BASE_PHYS,
75 .membase = (char *)IXP4XX_UART1_BASE_VIRT + REG_OFFSET,
76 .irq = IRQ_IXP4XX_UART1,
77 .flags = UPF_BOOT_AUTOCONF,
80 .uartclk = IXP4XX_UART_XTAL,
83 .mapbase = IXP4XX_UART2_BASE_PHYS,
84 .membase = (char *)IXP4XX_UART2_BASE_VIRT + REG_OFFSET,
85 .irq = IRQ_IXP4XX_UART2,
86 .flags = UPF_BOOT_AUTOCONF,
89 .uartclk = IXP4XX_UART_XTAL,
94 static struct platform_device nslu2_uart = {
96 .id = PLAT8250_DEV_PLATFORM,
97 .dev.platform_data = nslu2_uart_data,
99 .resource = nslu2_uart_resources,
102 static struct platform_device *nslu2_devices[] __initdata = {
103 &nslu2_i2c_controller,
109 static void nslu2_power_off(void)
111 /* This causes the box to drop the power and go dead. */
113 /* enable the pwr cntl gpio */
114 gpio_line_config(NSLU2_PO_GPIO, IXP4XX_GPIO_OUT);
117 gpio_line_set(NSLU2_PO_GPIO, IXP4XX_GPIO_HIGH);
120 static void __init nslu2_init(void)
124 nslu2_flash_resource.start = IXP4XX_EXP_BUS_BASE(0);
125 nslu2_flash_resource.end =
126 IXP4XX_EXP_BUS_BASE(0) + ixp4xx_exp_bus_size - 1;
128 pm_power_off = nslu2_power_off;
130 platform_add_devices(nslu2_devices, ARRAY_SIZE(nslu2_devices));
133 MACHINE_START(NSLU2, "Linksys NSLU2")
134 /* Maintainer: www.nslu2-linux.org */
135 .phys_io = IXP4XX_PERIPHERAL_BASE_PHYS,
136 .io_pg_offst = ((IXP4XX_PERIPHERAL_BASE_VIRT) >> 18) & 0xFFFC,
137 .boot_params = 0x00000100,
138 .map_io = ixp4xx_map_io,
139 .init_irq = ixp4xx_init_irq,
140 .timer = &ixp4xx_timer,
141 .init_machine = nslu2_init,