2 * arch/arm/mach-ixp4xx/nas100d-setup.c
6 * based ixdp425-setup.c:
7 * Copyright (C) 2003-2004 MontaVista Software, Inc.
9 * Author: Alessandro Zummo <a.zummo@towertech.it>
10 * Author: Rod Whitby <rod@whitby.id.au>
11 * Maintainers: http://www.nslu2-linux.org/
15 #include <linux/kernel.h>
16 #include <linux/serial.h>
17 #include <linux/serial_8250.h>
19 #include <asm/mach-types.h>
20 #include <asm/mach/arch.h>
21 #include <asm/mach/flash.h>
23 static struct flash_platform_data nas100d_flash_data = {
24 .map_name = "cfi_probe",
28 static struct resource nas100d_flash_resource = {
29 .flags = IORESOURCE_MEM,
32 static struct platform_device nas100d_flash = {
33 .name = "IXP4XX-Flash",
35 .dev.platform_data = &nas100d_flash_data,
37 .resource = &nas100d_flash_resource,
40 static struct ixp4xx_i2c_pins nas100d_i2c_gpio_pins = {
41 .sda_pin = NAS100D_SDA_PIN,
42 .scl_pin = NAS100D_SCL_PIN,
45 static struct platform_device nas100d_i2c_controller = {
48 .dev.platform_data = &nas100d_i2c_gpio_pins,
52 static struct resource nas100d_uart_resources[] = {
54 .start = IXP4XX_UART1_BASE_PHYS,
55 .end = IXP4XX_UART1_BASE_PHYS + 0x0fff,
56 .flags = IORESOURCE_MEM,
59 .start = IXP4XX_UART2_BASE_PHYS,
60 .end = IXP4XX_UART2_BASE_PHYS + 0x0fff,
61 .flags = IORESOURCE_MEM,
65 static struct plat_serial8250_port nas100d_uart_data[] = {
67 .mapbase = IXP4XX_UART1_BASE_PHYS,
68 .membase = (char *)IXP4XX_UART1_BASE_VIRT + REG_OFFSET,
69 .irq = IRQ_IXP4XX_UART1,
70 .flags = UPF_BOOT_AUTOCONF,
73 .uartclk = IXP4XX_UART_XTAL,
76 .mapbase = IXP4XX_UART2_BASE_PHYS,
77 .membase = (char *)IXP4XX_UART2_BASE_VIRT + REG_OFFSET,
78 .irq = IRQ_IXP4XX_UART2,
79 .flags = UPF_BOOT_AUTOCONF,
82 .uartclk = IXP4XX_UART_XTAL,
87 static struct platform_device nas100d_uart = {
89 .id = PLAT8250_DEV_PLATFORM,
90 .dev.platform_data = nas100d_uart_data,
92 .resource = nas100d_uart_resources,
95 static struct platform_device *nas100d_devices[] __initdata = {
96 &nas100d_i2c_controller,
101 static void nas100d_power_off(void)
103 /* This causes the box to drop the power and go dead. */
105 /* enable the pwr cntl gpio */
106 gpio_line_config(NAS100D_PO_GPIO, IXP4XX_GPIO_OUT);
109 gpio_line_set(NAS100D_PO_GPIO, IXP4XX_GPIO_HIGH);
112 static void __init nas100d_init(void)
116 /* gpio 14 and 15 are _not_ clocks */
117 *IXP4XX_GPIO_GPCLKR = 0;
119 nas100d_flash_resource.start = IXP4XX_EXP_BUS_BASE(0);
120 nas100d_flash_resource.end =
121 IXP4XX_EXP_BUS_BASE(0) + ixp4xx_exp_bus_size - 1;
123 pm_power_off = nas100d_power_off;
125 platform_add_devices(nas100d_devices, ARRAY_SIZE(nas100d_devices));
128 MACHINE_START(NAS100D, "Iomega NAS 100d")
129 /* Maintainer: www.nslu2-linux.org */
130 .phys_io = IXP4XX_PERIPHERAL_BASE_PHYS,
131 .io_pg_offst = ((IXP4XX_PERIPHERAL_BASE_VIRT) >> 18) & 0xFFFC,
132 .boot_params = 0x00000100,
133 .map_io = ixp4xx_map_io,
134 .init_irq = ixp4xx_init_irq,
135 .timer = &ixp4xx_timer,
136 .init_machine = nas100d_init,