diff options
author | Rod Whitby <rod@whitby.id.au> | 2006-01-04 12:17:11 -0500 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2006-01-04 12:17:11 -0500 |
commit | 3145d8a6cc83ee15adf18f598873e53a54cd1841 (patch) | |
tree | 9b314c3ad06350f4839fc17a2119fb18428123fe /arch/arm/mach-ixp4xx/nas100d-setup.c | |
parent | f7e8bbb8207c17afbd716e7e5fc785b78fa08571 (diff) |
[ARM] 3215/1: Iomega NAS 100d (MACH_NAS100D) machine support
Patch from Rod Whitby
This patch adds support for a new arm/ixp4xx machine - the Iomega NAS 100d network attached storage product. The NAS100D is a consumer device containing a 266MHz Intel IXP420 processor, 16MB of flash, 64MB of RAM, a 160Gb internal IDE hard disk, and 802.11b/g wireless on an Atheros mini-PCI card.
Work on porting the latest 2.6.x kernel to this device is being done by
the NSLU2-Linux project (the same team who maintains the port to the
Linksys NSLU2 device). In particular, the majority of this patch was
authored by Alessandro Zummo, based on the work done for MACH_NSLU2
support by the NSLU2-Linux core team of developers.
MACH_NAS100D (as implemented by this patch) can be enabled in jumbo
ixp4xx kernels without any affect on the other machines supported by
that kernel.
This patch applies cleanly against 2.6.15-rc7 and should be trivial to
apply to later kernel versions. It does not depend upon any other
patches.
Modified files (and number of lines inserted):
arch/arm/mach-ixp4xx/Kconfig | 8
arch/arm/mach-ixp4xx/Makefile | 1
include/asm-arm/arch-ixp4xx/hardware.h | 1
include/asm-arm/arch-ixp4xx/irqs.h | 9
include/asm-arm/arch-ixp4xx/nas100d.h | 75
arch/arm/mach-ixp4xx/nas100d-pci.c | 77
arch/arm/mach-ixp4xx/nas100d-power.c | 69
arch/arm/mach-ixp4xx/nas100d-setup.c | 133
-- Rod Whitby (NSLU2-Linux project lead)
Signed-off-by: Rod Whitby <rod@whitby.id.au>
Signed-off-by: Alessandro Zummo <a.zummo@towertech.it>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/mach-ixp4xx/nas100d-setup.c')
-rw-r--r-- | arch/arm/mach-ixp4xx/nas100d-setup.c | 133 |
1 files changed, 133 insertions, 0 deletions
diff --git a/arch/arm/mach-ixp4xx/nas100d-setup.c b/arch/arm/mach-ixp4xx/nas100d-setup.c new file mode 100644 index 000000000000..bde9648e7afc --- /dev/null +++ b/arch/arm/mach-ixp4xx/nas100d-setup.c | |||
@@ -0,0 +1,133 @@ | |||
1 | /* | ||
2 | * arch/arm/mach-ixp4xx/nas100d-setup.c | ||
3 | * | ||
4 | * NAS 100d board-setup | ||
5 | * | ||
6 | * based ixdp425-setup.c: | ||
7 | * Copyright (C) 2003-2004 MontaVista Software, Inc. | ||
8 | * | ||
9 | * Author: Alessandro Zummo <a.zummo@towertech.it> | ||
10 | * Author: Rod Whitby <rod@whitby.id.au> | ||
11 | * Maintainers: http://www.nslu2-linux.org/ | ||
12 | * | ||
13 | */ | ||
14 | |||
15 | #include <linux/kernel.h> | ||
16 | #include <linux/serial.h> | ||
17 | #include <linux/serial_8250.h> | ||
18 | |||
19 | #include <asm/mach-types.h> | ||
20 | #include <asm/mach/arch.h> | ||
21 | #include <asm/mach/flash.h> | ||
22 | |||
23 | static struct flash_platform_data nas100d_flash_data = { | ||
24 | .map_name = "cfi_probe", | ||
25 | .width = 2, | ||
26 | }; | ||
27 | |||
28 | static struct resource nas100d_flash_resource = { | ||
29 | .start = NAS100D_FLASH_BASE, | ||
30 | .end = NAS100D_FLASH_BASE + NAS100D_FLASH_SIZE, | ||
31 | .flags = IORESOURCE_MEM, | ||
32 | }; | ||
33 | |||
34 | static struct platform_device nas100d_flash = { | ||
35 | .name = "IXP4XX-Flash", | ||
36 | .id = 0, | ||
37 | .dev.platform_data = &nas100d_flash_data, | ||
38 | .num_resources = 1, | ||
39 | .resource = &nas100d_flash_resource, | ||
40 | }; | ||
41 | |||
42 | static struct ixp4xx_i2c_pins nas100d_i2c_gpio_pins = { | ||
43 | .sda_pin = NAS100D_SDA_PIN, | ||
44 | .scl_pin = NAS100D_SCL_PIN, | ||
45 | }; | ||
46 | |||
47 | static struct platform_device nas100d_i2c_controller = { | ||
48 | .name = "IXP4XX-I2C", | ||
49 | .id = 0, | ||
50 | .dev.platform_data = &nas100d_i2c_gpio_pins, | ||
51 | .num_resources = 0, | ||
52 | }; | ||
53 | |||
54 | static struct resource nas100d_uart_resources[] = { | ||
55 | { | ||
56 | .start = IXP4XX_UART1_BASE_PHYS, | ||
57 | .end = IXP4XX_UART1_BASE_PHYS + 0x0fff, | ||
58 | .flags = IORESOURCE_MEM, | ||
59 | }, | ||
60 | { | ||
61 | .start = IXP4XX_UART2_BASE_PHYS, | ||
62 | .end = IXP4XX_UART2_BASE_PHYS + 0x0fff, | ||
63 | .flags = IORESOURCE_MEM, | ||
64 | } | ||
65 | }; | ||
66 | |||
67 | static struct plat_serial8250_port nas100d_uart_data[] = { | ||
68 | { | ||
69 | .mapbase = IXP4XX_UART1_BASE_PHYS, | ||
70 | .membase = (char *)IXP4XX_UART1_BASE_VIRT + REG_OFFSET, | ||
71 | .irq = IRQ_IXP4XX_UART1, | ||
72 | .flags = UPF_BOOT_AUTOCONF, | ||
73 | .iotype = UPIO_MEM, | ||
74 | .regshift = 2, | ||
75 | .uartclk = IXP4XX_UART_XTAL, | ||
76 | }, | ||
77 | { | ||
78 | .mapbase = IXP4XX_UART2_BASE_PHYS, | ||
79 | .membase = (char *)IXP4XX_UART2_BASE_VIRT + REG_OFFSET, | ||
80 | .irq = IRQ_IXP4XX_UART2, | ||
81 | .flags = UPF_BOOT_AUTOCONF, | ||
82 | .iotype = UPIO_MEM, | ||
83 | .regshift = 2, | ||
84 | .uartclk = IXP4XX_UART_XTAL, | ||
85 | }, | ||
86 | { } | ||
87 | }; | ||
88 | |||
89 | static struct platform_device nas100d_uart = { | ||
90 | .name = "serial8250", | ||
91 | .id = PLAT8250_DEV_PLATFORM, | ||
92 | .dev.platform_data = nas100d_uart_data, | ||
93 | .num_resources = 2, | ||
94 | .resource = nas100d_uart_resources, | ||
95 | }; | ||
96 | |||
97 | static struct platform_device *nas100d_devices[] __initdata = { | ||
98 | &nas100d_i2c_controller, | ||
99 | &nas100d_flash, | ||
100 | &nas100d_uart, | ||
101 | }; | ||
102 | |||
103 | static void nas100d_power_off(void) | ||
104 | { | ||
105 | /* This causes the box to drop the power and go dead. */ | ||
106 | |||
107 | /* enable the pwr cntl gpio */ | ||
108 | gpio_line_config(NAS100D_PO_GPIO, IXP4XX_GPIO_OUT); | ||
109 | |||
110 | /* do the deed */ | ||
111 | gpio_line_set(NAS100D_PO_GPIO, IXP4XX_GPIO_HIGH); | ||
112 | } | ||
113 | |||
114 | static void __init nas100d_init(void) | ||
115 | { | ||
116 | ixp4xx_sys_init(); | ||
117 | |||
118 | pm_power_off = nas100d_power_off; | ||
119 | |||
120 | platform_add_devices(nas100d_devices, ARRAY_SIZE(nas100d_devices)); | ||
121 | } | ||
122 | |||
123 | MACHINE_START(NAS100D, "Iomega NAS 100d") | ||
124 | /* Maintainer: www.nslu2-linux.org */ | ||
125 | .phys_ram = PHYS_OFFSET, | ||
126 | .phys_io = IXP4XX_PERIPHERAL_BASE_PHYS, | ||
127 | .io_pg_offst = ((IXP4XX_PERIPHERAL_BASE_VIRT) >> 18) & 0xFFFC, | ||
128 | .boot_params = 0x00000100, | ||
129 | .map_io = ixp4xx_map_io, | ||
130 | .init_irq = ixp4xx_init_irq, | ||
131 | .timer = &ixp4xx_timer, | ||
132 | .init_machine = nas100d_init, | ||
133 | MACHINE_END | ||