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>
18 #include <linux/leds.h>
19 #include <linux/i2c.h>
20 #include <linux/i2c-gpio.h>
22 #include <asm/mach-types.h>
23 #include <asm/mach/arch.h>
24 #include <asm/mach/flash.h>
26 static struct flash_platform_data nas100d_flash_data = {
27 .map_name = "cfi_probe",
31 static struct resource nas100d_flash_resource = {
32 .flags = IORESOURCE_MEM,
35 static struct platform_device nas100d_flash = {
36 .name = "IXP4XX-Flash",
38 .dev.platform_data = &nas100d_flash_data,
40 .resource = &nas100d_flash_resource,
43 static struct i2c_board_info __initdata nas100d_i2c_board_info [] = {
45 I2C_BOARD_INFO("rtc-pcf8563", 0x51),
49 static struct gpio_led nas100d_led_pins[] = {
51 .name = "wlan", /* green led */
52 .gpio = NAS100D_LED_WLAN_GPIO,
56 .name = "power", /* blue power led (off=flashing) */
57 .gpio = NAS100D_LED_PWR_GPIO,
61 .name = "disk", /* yellow led */
62 .gpio = NAS100D_LED_DISK_GPIO,
67 static struct gpio_led_platform_data nas100d_led_data = {
68 .num_leds = ARRAY_SIZE(nas100d_led_pins),
69 .leds = nas100d_led_pins,
72 static struct platform_device nas100d_leds = {
75 .dev.platform_data = &nas100d_led_data,
78 static struct i2c_gpio_platform_data nas100d_i2c_gpio_data = {
79 .sda_pin = NAS100D_SDA_PIN,
80 .scl_pin = NAS100D_SCL_PIN,
83 static struct platform_device nas100d_i2c_gpio = {
87 .platform_data = &nas100d_i2c_gpio_data,
91 static struct resource nas100d_uart_resources[] = {
93 .start = IXP4XX_UART1_BASE_PHYS,
94 .end = IXP4XX_UART1_BASE_PHYS + 0x0fff,
95 .flags = IORESOURCE_MEM,
98 .start = IXP4XX_UART2_BASE_PHYS,
99 .end = IXP4XX_UART2_BASE_PHYS + 0x0fff,
100 .flags = IORESOURCE_MEM,
104 static struct plat_serial8250_port nas100d_uart_data[] = {
106 .mapbase = IXP4XX_UART1_BASE_PHYS,
107 .membase = (char *)IXP4XX_UART1_BASE_VIRT + REG_OFFSET,
108 .irq = IRQ_IXP4XX_UART1,
109 .flags = UPF_BOOT_AUTOCONF,
112 .uartclk = IXP4XX_UART_XTAL,
115 .mapbase = IXP4XX_UART2_BASE_PHYS,
116 .membase = (char *)IXP4XX_UART2_BASE_VIRT + REG_OFFSET,
117 .irq = IRQ_IXP4XX_UART2,
118 .flags = UPF_BOOT_AUTOCONF,
121 .uartclk = IXP4XX_UART_XTAL,
126 static struct platform_device nas100d_uart = {
127 .name = "serial8250",
128 .id = PLAT8250_DEV_PLATFORM,
129 .dev.platform_data = nas100d_uart_data,
131 .resource = nas100d_uart_resources,
134 static struct platform_device *nas100d_devices[] __initdata = {
140 static void nas100d_power_off(void)
142 /* This causes the box to drop the power and go dead. */
144 /* enable the pwr cntl gpio */
145 gpio_line_config(NAS100D_PO_GPIO, IXP4XX_GPIO_OUT);
148 gpio_line_set(NAS100D_PO_GPIO, IXP4XX_GPIO_HIGH);
151 static void __init nas100d_init(void)
155 /* gpio 14 and 15 are _not_ clocks */
156 *IXP4XX_GPIO_GPCLKR = 0;
158 nas100d_flash_resource.start = IXP4XX_EXP_BUS_BASE(0);
159 nas100d_flash_resource.end =
160 IXP4XX_EXP_BUS_BASE(0) + ixp4xx_exp_bus_size - 1;
162 pm_power_off = nas100d_power_off;
164 i2c_register_board_info(0, nas100d_i2c_board_info,
165 ARRAY_SIZE(nas100d_i2c_board_info));
168 * This is only useful on a modified machine, but it is valuable
169 * to have it first in order to see debug messages, and so that
170 * it does *not* get removed if platform_add_devices fails!
172 (void)platform_device_register(&nas100d_uart);
174 platform_add_devices(nas100d_devices, ARRAY_SIZE(nas100d_devices));
177 MACHINE_START(NAS100D, "Iomega NAS 100d")
178 /* Maintainer: www.nslu2-linux.org */
179 .phys_io = IXP4XX_PERIPHERAL_BASE_PHYS,
180 .io_pg_offst = ((IXP4XX_PERIPHERAL_BASE_VIRT) >> 18) & 0xFFFC,
181 .boot_params = 0x00000100,
182 .map_io = ixp4xx_map_io,
183 .init_irq = ixp4xx_init_irq,
184 .timer = &ixp4xx_timer,
185 .init_machine = nas100d_init,