diff options
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/configs/iop32x_defconfig | 119 | ||||
-rw-r--r-- | arch/arm/mach-iop32x/Kconfig | 6 | ||||
-rw-r--r-- | arch/arm/mach-iop32x/Makefile | 1 | ||||
-rw-r--r-- | arch/arm/mach-iop32x/irq.c | 3 | ||||
-rw-r--r-- | arch/arm/mach-iop32x/n2100.c | 251 |
5 files changed, 377 insertions, 3 deletions
diff --git a/arch/arm/configs/iop32x_defconfig b/arch/arm/configs/iop32x_defconfig index af7ead33c6dd..af3b40c0508a 100644 --- a/arch/arm/configs/iop32x_defconfig +++ b/arch/arm/configs/iop32x_defconfig | |||
@@ -128,6 +128,7 @@ CONFIG_ARCH_IOP32X=y | |||
128 | # | 128 | # |
129 | CONFIG_ARCH_IQ80321=y | 129 | CONFIG_ARCH_IQ80321=y |
130 | CONFIG_ARCH_IQ31244=y | 130 | CONFIG_ARCH_IQ31244=y |
131 | CONFIG_MACH_N2100=y | ||
131 | CONFIG_PLAT_IOP=y | 132 | CONFIG_PLAT_IOP=y |
132 | 133 | ||
133 | # | 134 | # |
@@ -601,7 +602,8 @@ CONFIG_E1000_NAPI=y | |||
601 | # CONFIG_NS83820 is not set | 602 | # CONFIG_NS83820 is not set |
602 | # CONFIG_HAMACHI is not set | 603 | # CONFIG_HAMACHI is not set |
603 | # CONFIG_YELLOWFIN is not set | 604 | # CONFIG_YELLOWFIN is not set |
604 | # CONFIG_R8169 is not set | 605 | CONFIG_R8169=y |
606 | # CONFIG_R8169_NAPI is not set | ||
605 | # CONFIG_SIS190 is not set | 607 | # CONFIG_SIS190 is not set |
606 | # CONFIG_SKGE is not set | 608 | # CONFIG_SKGE is not set |
607 | # CONFIG_SKY2 is not set | 609 | # CONFIG_SKY2 is not set |
@@ -897,13 +899,126 @@ CONFIG_DUMMY_CONSOLE=y | |||
897 | CONFIG_USB_ARCH_HAS_HCD=y | 899 | CONFIG_USB_ARCH_HAS_HCD=y |
898 | CONFIG_USB_ARCH_HAS_OHCI=y | 900 | CONFIG_USB_ARCH_HAS_OHCI=y |
899 | CONFIG_USB_ARCH_HAS_EHCI=y | 901 | CONFIG_USB_ARCH_HAS_EHCI=y |
900 | # CONFIG_USB is not set | 902 | CONFIG_USB=y |
903 | # CONFIG_USB_DEBUG is not set | ||
904 | |||
905 | # | ||
906 | # Miscellaneous USB options | ||
907 | # | ||
908 | # CONFIG_USB_DEVICEFS is not set | ||
909 | # CONFIG_USB_BANDWIDTH is not set | ||
910 | # CONFIG_USB_DYNAMIC_MINORS is not set | ||
911 | # CONFIG_USB_OTG is not set | ||
912 | |||
913 | # | ||
914 | # USB Host Controller Drivers | ||
915 | # | ||
916 | CONFIG_USB_EHCI_HCD=y | ||
917 | CONFIG_USB_EHCI_SPLIT_ISO=y | ||
918 | CONFIG_USB_EHCI_ROOT_HUB_TT=y | ||
919 | CONFIG_USB_EHCI_TT_NEWSCHED=y | ||
920 | # CONFIG_USB_ISP116X_HCD is not set | ||
921 | # CONFIG_USB_OHCI_HCD is not set | ||
922 | CONFIG_USB_UHCI_HCD=y | ||
923 | # CONFIG_USB_SL811_HCD is not set | ||
924 | |||
925 | # | ||
926 | # USB Device Class drivers | ||
927 | # | ||
928 | # CONFIG_USB_ACM is not set | ||
929 | # CONFIG_USB_PRINTER is not set | ||
901 | 930 | ||
902 | # | 931 | # |
903 | # NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' | 932 | # NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' |
904 | # | 933 | # |
905 | 934 | ||
906 | # | 935 | # |
936 | # may also be needed; see USB_STORAGE Help for more information | ||
937 | # | ||
938 | CONFIG_USB_STORAGE=y | ||
939 | # CONFIG_USB_STORAGE_DEBUG is not set | ||
940 | # CONFIG_USB_STORAGE_DATAFAB is not set | ||
941 | # CONFIG_USB_STORAGE_FREECOM is not set | ||
942 | # CONFIG_USB_STORAGE_DPCM is not set | ||
943 | # CONFIG_USB_STORAGE_USBAT is not set | ||
944 | # CONFIG_USB_STORAGE_SDDR09 is not set | ||
945 | # CONFIG_USB_STORAGE_SDDR55 is not set | ||
946 | # CONFIG_USB_STORAGE_JUMPSHOT is not set | ||
947 | # CONFIG_USB_STORAGE_ALAUDA is not set | ||
948 | # CONFIG_USB_LIBUSUAL is not set | ||
949 | |||
950 | # | ||
951 | # USB Input Devices | ||
952 | # | ||
953 | # CONFIG_USB_HID is not set | ||
954 | |||
955 | # | ||
956 | # USB HID Boot Protocol drivers | ||
957 | # | ||
958 | # CONFIG_USB_KBD is not set | ||
959 | # CONFIG_USB_MOUSE is not set | ||
960 | # CONFIG_USB_AIPTEK is not set | ||
961 | # CONFIG_USB_WACOM is not set | ||
962 | # CONFIG_USB_ACECAD is not set | ||
963 | # CONFIG_USB_KBTAB is not set | ||
964 | # CONFIG_USB_POWERMATE is not set | ||
965 | # CONFIG_USB_TOUCHSCREEN is not set | ||
966 | # CONFIG_USB_YEALINK is not set | ||
967 | # CONFIG_USB_XPAD is not set | ||
968 | # CONFIG_USB_ATI_REMOTE is not set | ||
969 | # CONFIG_USB_ATI_REMOTE2 is not set | ||
970 | # CONFIG_USB_KEYSPAN_REMOTE is not set | ||
971 | # CONFIG_USB_APPLETOUCH is not set | ||
972 | |||
973 | # | ||
974 | # USB Imaging devices | ||
975 | # | ||
976 | # CONFIG_USB_MDC800 is not set | ||
977 | # CONFIG_USB_MICROTEK is not set | ||
978 | |||
979 | # | ||
980 | # USB Network Adapters | ||
981 | # | ||
982 | # CONFIG_USB_CATC is not set | ||
983 | # CONFIG_USB_KAWETH is not set | ||
984 | # CONFIG_USB_PEGASUS is not set | ||
985 | # CONFIG_USB_RTL8150 is not set | ||
986 | # CONFIG_USB_USBNET is not set | ||
987 | CONFIG_USB_MON=y | ||
988 | |||
989 | # | ||
990 | # USB port drivers | ||
991 | # | ||
992 | |||
993 | # | ||
994 | # USB Serial Converter support | ||
995 | # | ||
996 | # CONFIG_USB_SERIAL is not set | ||
997 | |||
998 | # | ||
999 | # USB Miscellaneous drivers | ||
1000 | # | ||
1001 | # CONFIG_USB_EMI62 is not set | ||
1002 | # CONFIG_USB_EMI26 is not set | ||
1003 | # CONFIG_USB_AUERSWALD is not set | ||
1004 | # CONFIG_USB_RIO500 is not set | ||
1005 | # CONFIG_USB_LEGOTOWER is not set | ||
1006 | # CONFIG_USB_LCD is not set | ||
1007 | # CONFIG_USB_LED is not set | ||
1008 | # CONFIG_USB_CYPRESS_CY7C63 is not set | ||
1009 | # CONFIG_USB_CYTHERM is not set | ||
1010 | # CONFIG_USB_PHIDGETKIT is not set | ||
1011 | # CONFIG_USB_PHIDGETSERVO is not set | ||
1012 | # CONFIG_USB_IDMOUSE is not set | ||
1013 | # CONFIG_USB_APPLEDISPLAY is not set | ||
1014 | # CONFIG_USB_SISUSBVGA is not set | ||
1015 | # CONFIG_USB_LD is not set | ||
1016 | |||
1017 | # | ||
1018 | # USB DSL modem support | ||
1019 | # | ||
1020 | |||
1021 | # | ||
907 | # USB Gadget Support | 1022 | # USB Gadget Support |
908 | # | 1023 | # |
909 | # CONFIG_USB_GADGET is not set | 1024 | # CONFIG_USB_GADGET is not set |
diff --git a/arch/arm/mach-iop32x/Kconfig b/arch/arm/mach-iop32x/Kconfig index d7abfaa525c3..0a397a4a6ac9 100644 --- a/arch/arm/mach-iop32x/Kconfig +++ b/arch/arm/mach-iop32x/Kconfig | |||
@@ -17,6 +17,12 @@ config ARCH_IQ31244 | |||
17 | evaluation kit for the Intel 80219 processor (a IOP321 variant) | 17 | evaluation kit for the Intel 80219 processor (a IOP321 variant) |
18 | or the IQ31244 evaluation kit for the IOP321 processor. | 18 | or the IQ31244 evaluation kit for the IOP321 processor. |
19 | 19 | ||
20 | config MACH_N2100 | ||
21 | bool "Enable support for the Thecus n2100" | ||
22 | help | ||
23 | Say Y here if you want to run your kernel on the Thecus n2100 | ||
24 | NAS appliance. | ||
25 | |||
20 | endmenu | 26 | endmenu |
21 | 27 | ||
22 | endif | 28 | endif |
diff --git a/arch/arm/mach-iop32x/Makefile b/arch/arm/mach-iop32x/Makefile index af1747ae392d..9c62470cd4f5 100644 --- a/arch/arm/mach-iop32x/Makefile +++ b/arch/arm/mach-iop32x/Makefile | |||
@@ -9,3 +9,4 @@ obj- := | |||
9 | 9 | ||
10 | obj-$(CONFIG_ARCH_IQ80321) += iq80321.o | 10 | obj-$(CONFIG_ARCH_IQ80321) += iq80321.o |
11 | obj-$(CONFIG_ARCH_IQ31244) += iq31244.o | 11 | obj-$(CONFIG_ARCH_IQ31244) += iq31244.o |
12 | obj-$(CONFIG_MACH_N2100) += n2100.o | ||
diff --git a/arch/arm/mach-iop32x/irq.c b/arch/arm/mach-iop32x/irq.c index 21294be5a369..17fb94e6e29f 100644 --- a/arch/arm/mach-iop32x/irq.c +++ b/arch/arm/mach-iop32x/irq.c | |||
@@ -63,7 +63,8 @@ void __init iop32x_init_irq(void) | |||
63 | intctl_write(0); | 63 | intctl_write(0); |
64 | intstr_write(0); | 64 | intstr_write(0); |
65 | if (machine_is_iq80321() || | 65 | if (machine_is_iq80321() || |
66 | machine_is_iq31244()) | 66 | machine_is_iq31244() || |
67 | machine_is_n2100()) | ||
67 | *IOP3XX_PCIIRSR = 0x0f; | 68 | *IOP3XX_PCIIRSR = 0x0f; |
68 | 69 | ||
69 | for (i = 0; i < NR_IRQS; i++) { | 70 | for (i = 0; i < NR_IRQS; i++) { |
diff --git a/arch/arm/mach-iop32x/n2100.c b/arch/arm/mach-iop32x/n2100.c new file mode 100644 index 000000000000..a2c94a47b2b2 --- /dev/null +++ b/arch/arm/mach-iop32x/n2100.c | |||
@@ -0,0 +1,251 @@ | |||
1 | /* | ||
2 | * arch/arm/mach-iop32x/n2100.c | ||
3 | * | ||
4 | * Board support code for the Thecus N2100 platform. | ||
5 | * | ||
6 | * Author: Rory Bolt <rorybolt@pacbell.net> | ||
7 | * Copyright (C) 2002 Rory Bolt | ||
8 | * Copyright 2003 (c) MontaVista, Software, Inc. | ||
9 | * Copyright (C) 2004 Intel Corp. | ||
10 | * | ||
11 | * This program is free software; you can redistribute it and/or modify it | ||
12 | * under the terms of the GNU General Public License as published by the | ||
13 | * Free Software Foundation; either version 2 of the License, or (at your | ||
14 | * option) any later version. | ||
15 | */ | ||
16 | |||
17 | #include <linux/mm.h> | ||
18 | #include <linux/init.h> | ||
19 | #include <linux/delay.h> | ||
20 | #include <linux/kernel.h> | ||
21 | #include <linux/pci.h> | ||
22 | #include <linux/pm.h> | ||
23 | #include <linux/string.h> | ||
24 | #include <linux/slab.h> | ||
25 | #include <linux/serial_core.h> | ||
26 | #include <linux/serial_8250.h> | ||
27 | #include <linux/mtd/physmap.h> | ||
28 | #include <linux/platform_device.h> | ||
29 | #include <linux/reboot.h> | ||
30 | #include <asm/hardware.h> | ||
31 | #include <asm/io.h> | ||
32 | #include <asm/irq.h> | ||
33 | #include <asm/mach/arch.h> | ||
34 | #include <asm/mach/map.h> | ||
35 | #include <asm/mach/pci.h> | ||
36 | #include <asm/mach/time.h> | ||
37 | #include <asm/mach-types.h> | ||
38 | #include <asm/page.h> | ||
39 | #include <asm/pgtable.h> | ||
40 | |||
41 | /* | ||
42 | * N2100 timer tick configuration. | ||
43 | */ | ||
44 | static void __init n2100_timer_init(void) | ||
45 | { | ||
46 | /* 33.000 MHz crystal. */ | ||
47 | iop3xx_init_time(198000000); | ||
48 | } | ||
49 | |||
50 | static struct sys_timer n2100_timer = { | ||
51 | .init = n2100_timer_init, | ||
52 | .offset = iop3xx_gettimeoffset, | ||
53 | }; | ||
54 | |||
55 | |||
56 | /* | ||
57 | * N2100 I/O. | ||
58 | */ | ||
59 | static struct map_desc n2100_io_desc[] __initdata = { | ||
60 | { /* on-board devices */ | ||
61 | .virtual = N2100_UART, | ||
62 | .pfn = __phys_to_pfn(N2100_UART), | ||
63 | .length = 0x00100000, | ||
64 | .type = MT_DEVICE | ||
65 | }, | ||
66 | }; | ||
67 | |||
68 | void __init n2100_map_io(void) | ||
69 | { | ||
70 | iop3xx_map_io(); | ||
71 | iotable_init(n2100_io_desc, ARRAY_SIZE(n2100_io_desc)); | ||
72 | } | ||
73 | |||
74 | |||
75 | /* | ||
76 | * N2100 PCI. | ||
77 | */ | ||
78 | static inline int __init | ||
79 | n2100_pci_map_irq(struct pci_dev *dev, u8 slot, u8 pin) | ||
80 | { | ||
81 | int irq; | ||
82 | |||
83 | if (PCI_SLOT(dev->devfn) == 1) { | ||
84 | /* RTL8110SB #1 */ | ||
85 | irq = IRQ_IOP32X_XINT0; | ||
86 | } else if (PCI_SLOT(dev->devfn) == 2) { | ||
87 | /* RTL8110SB #2 */ | ||
88 | irq = IRQ_IOP32X_XINT1; | ||
89 | } else if (PCI_SLOT(dev->devfn) == 3) { | ||
90 | /* Sil3512 */ | ||
91 | irq = IRQ_IOP32X_XINT2; | ||
92 | } else if (PCI_SLOT(dev->devfn) == 4 && pin == 1) { | ||
93 | /* VT6212 INTA */ | ||
94 | irq = IRQ_IOP32X_XINT1; | ||
95 | } else if (PCI_SLOT(dev->devfn) == 4 && pin == 2) { | ||
96 | /* VT6212 INTB */ | ||
97 | irq = IRQ_IOP32X_XINT0; | ||
98 | } else if (PCI_SLOT(dev->devfn) == 4 && pin == 3) { | ||
99 | /* VT6212 INTC */ | ||
100 | irq = IRQ_IOP32X_XINT2; | ||
101 | } else if (PCI_SLOT(dev->devfn) == 5) { | ||
102 | /* Mini-PCI slot */ | ||
103 | irq = IRQ_IOP32X_XINT3; | ||
104 | } else { | ||
105 | printk(KERN_ERR "n2100_pci_map_irq() called for unknown " | ||
106 | "device PCI:%d:%d:%d\n", dev->bus->number, | ||
107 | PCI_SLOT(dev->devfn), PCI_FUNC(dev->devfn)); | ||
108 | irq = -1; | ||
109 | } | ||
110 | |||
111 | return irq; | ||
112 | } | ||
113 | |||
114 | static struct hw_pci n2100_pci __initdata = { | ||
115 | .swizzle = pci_std_swizzle, | ||
116 | .nr_controllers = 1, | ||
117 | .setup = iop3xx_pci_setup, | ||
118 | .preinit = iop3xx_pci_preinit, | ||
119 | .scan = iop3xx_pci_scan_bus, | ||
120 | .map_irq = n2100_pci_map_irq, | ||
121 | }; | ||
122 | |||
123 | static int __init n2100_pci_init(void) | ||
124 | { | ||
125 | if (machine_is_n2100()) | ||
126 | pci_common_init(&n2100_pci); | ||
127 | |||
128 | return 0; | ||
129 | } | ||
130 | |||
131 | subsys_initcall(n2100_pci_init); | ||
132 | |||
133 | |||
134 | /* | ||
135 | * N2100 machine initialisation. | ||
136 | */ | ||
137 | static struct physmap_flash_data n2100_flash_data = { | ||
138 | .width = 2, | ||
139 | }; | ||
140 | |||
141 | static struct resource n2100_flash_resource = { | ||
142 | .start = 0xf0000000, | ||
143 | .end = 0xf0ffffff, | ||
144 | .flags = IORESOURCE_MEM, | ||
145 | }; | ||
146 | |||
147 | static struct platform_device n2100_flash_device = { | ||
148 | .name = "physmap-flash", | ||
149 | .id = 0, | ||
150 | .dev = { | ||
151 | .platform_data = &n2100_flash_data, | ||
152 | }, | ||
153 | .num_resources = 1, | ||
154 | .resource = &n2100_flash_resource, | ||
155 | }; | ||
156 | |||
157 | |||
158 | static struct plat_serial8250_port n2100_serial_port[] = { | ||
159 | { | ||
160 | .mapbase = N2100_UART, | ||
161 | .membase = (char *)N2100_UART, | ||
162 | .irq = 0, | ||
163 | .flags = UPF_SKIP_TEST, | ||
164 | .iotype = UPIO_MEM, | ||
165 | .regshift = 0, | ||
166 | .uartclk = 1843200, | ||
167 | }, | ||
168 | { }, | ||
169 | }; | ||
170 | |||
171 | static struct resource n2100_uart_resource = { | ||
172 | .start = N2100_UART, | ||
173 | .end = N2100_UART + 7, | ||
174 | .flags = IORESOURCE_MEM, | ||
175 | }; | ||
176 | |||
177 | static struct platform_device n2100_serial_device = { | ||
178 | .name = "serial8250", | ||
179 | .id = PLAT8250_DEV_PLATFORM, | ||
180 | .dev = { | ||
181 | .platform_data = n2100_serial_port, | ||
182 | }, | ||
183 | .num_resources = 1, | ||
184 | .resource = &n2100_uart_resource, | ||
185 | }; | ||
186 | |||
187 | |||
188 | /* | ||
189 | * Pull PCA9532 GPIO #8 low to power off the machine. | ||
190 | */ | ||
191 | static void n2100_power_off(void) | ||
192 | { | ||
193 | local_irq_disable(); | ||
194 | |||
195 | /* Start condition, I2C address of PCA9532, write transaction. */ | ||
196 | *IOP3XX_IDBR0 = 0xc0; | ||
197 | *IOP3XX_ICR0 = 0xe9; | ||
198 | mdelay(1); | ||
199 | |||
200 | /* Write address 0x08. */ | ||
201 | *IOP3XX_IDBR0 = 0x08; | ||
202 | *IOP3XX_ICR0 = 0xe8; | ||
203 | mdelay(1); | ||
204 | |||
205 | /* Write data 0x01, stop condition. */ | ||
206 | *IOP3XX_IDBR0 = 0x01; | ||
207 | *IOP3XX_ICR0 = 0xea; | ||
208 | |||
209 | while (1) | ||
210 | ; | ||
211 | } | ||
212 | |||
213 | |||
214 | static struct timer_list power_button_poll_timer; | ||
215 | |||
216 | static void power_button_poll(unsigned long dummy) | ||
217 | { | ||
218 | if (gpio_line_get(N2100_POWER_BUTTON) == 0) { | ||
219 | ctrl_alt_del(); | ||
220 | return; | ||
221 | } | ||
222 | |||
223 | power_button_poll_timer.expires = jiffies + (HZ / 10); | ||
224 | add_timer(&power_button_poll_timer); | ||
225 | } | ||
226 | |||
227 | |||
228 | static void __init n2100_init_machine(void) | ||
229 | { | ||
230 | platform_device_register(&iop3xx_i2c0_device); | ||
231 | platform_device_register(&n2100_flash_device); | ||
232 | platform_device_register(&n2100_serial_device); | ||
233 | |||
234 | pm_power_off = n2100_power_off; | ||
235 | |||
236 | init_timer(&power_button_poll_timer); | ||
237 | power_button_poll_timer.function = power_button_poll; | ||
238 | power_button_poll_timer.expires = jiffies + (HZ / 10); | ||
239 | add_timer(&power_button_poll_timer); | ||
240 | } | ||
241 | |||
242 | MACHINE_START(N2100, "Thecus N2100") | ||
243 | /* Maintainer: Lennert Buytenhek <buytenh@wantstofly.org> */ | ||
244 | .phys_io = N2100_UART, | ||
245 | .io_pg_offst = ((N2100_UART) >> 18) & 0xfffc, | ||
246 | .boot_params = 0xa0000100, | ||
247 | .map_io = n2100_map_io, | ||
248 | .init_irq = iop32x_init_irq, | ||
249 | .timer = &n2100_timer, | ||
250 | .init_machine = n2100_init_machine, | ||
251 | MACHINE_END | ||