1 diff -uprN linux-2.6.23.orig/arch/arm/mach-ixp4xx/fsg-pci.c linux-2.6.23/arch/arm/mach-ixp4xx/fsg-pci.c
2 --- linux-2.6.23.orig/arch/arm/mach-ixp4xx/fsg-pci.c 1969-12-31 18:00:00.000000000 -0600
3 +++ linux-2.6.23/arch/arm/mach-ixp4xx/fsg-pci.c 2007-10-11 00:55:34.000000000 -0500
6 + * arch/arch/mach-ixp4xx/fsg-pci.c
8 + * FSG board-level PCI initialization
10 + * Author: Rod Whitby <rod@whitby.id.au>
11 + * Maintainer: http://www.nslu2-linux.org/
13 + * based on ixdp425-pci.c:
14 + * Copyright (C) 2002 Intel Corporation.
15 + * Copyright (C) 2003-2004 MontaVista Software, Inc.
17 + * This program is free software; you can redistribute it and/or modify
18 + * it under the terms of the GNU General Public License version 2 as
19 + * published by the Free Software Foundation.
23 +#include <linux/pci.h>
24 +#include <linux/init.h>
25 +#include <linux/irq.h>
27 +#include <asm/mach/pci.h>
28 +#include <asm/mach-types.h>
30 +void __init fsg_pci_preinit(void)
32 + set_irq_type(IRQ_FSG_PCI_INTA, IRQT_LOW);
33 + set_irq_type(IRQ_FSG_PCI_INTB, IRQT_LOW);
34 + set_irq_type(IRQ_FSG_PCI_INTC, IRQT_LOW);
36 + ixp4xx_pci_preinit();
39 +static int __init fsg_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
41 + static int pci_irq_table[FSG_PCI_IRQ_LINES] = {
50 + if (slot >= 1 && slot <= FSG_PCI_MAX_DEV &&
51 + pin >= 1 && pin <= FSG_PCI_IRQ_LINES) {
52 + irq = pci_irq_table[(slot - 1)];
54 + printk("%s: Mapped slot %d pin %d to IRQ %d\n", __FUNCTION__,slot, pin, irq);
59 +struct hw_pci fsg_pci __initdata = {
60 + .nr_controllers = 1,
61 + .preinit = fsg_pci_preinit,
62 + .swizzle = pci_std_swizzle,
63 + .setup = ixp4xx_setup,
64 + .scan = ixp4xx_scan_bus,
65 + .map_irq = fsg_map_irq,
68 +int __init fsg_pci_init(void)
70 + if (machine_is_fsg())
71 + pci_common_init(&fsg_pci);
75 +subsys_initcall(fsg_pci_init);
76 diff -uprN linux-2.6.23.orig/arch/arm/mach-ixp4xx/fsg-setup.c linux-2.6.23/arch/arm/mach-ixp4xx/fsg-setup.c
77 --- linux-2.6.23.orig/arch/arm/mach-ixp4xx/fsg-setup.c 1969-12-31 18:00:00.000000000 -0600
78 +++ linux-2.6.23/arch/arm/mach-ixp4xx/fsg-setup.c 2007-10-11 00:55:34.000000000 -0500
81 + * arch/arm/mach-ixp4xx/fsg-setup.c
85 + * based ixdp425-setup.c:
86 + * Copyright (C) 2003-2004 MontaVista Software, Inc.
88 + * Author: Rod Whitby <rod@whitby.id.au>
89 + * Maintainers: http://www.nslu2-linux.org/
93 +#include <linux/kernel.h>
94 +#include <linux/serial.h>
95 +#include <linux/serial_8250.h>
96 +#include <linux/leds.h>
97 +#include <linux/i2c-gpio.h>
99 +#include <asm/mach-types.h>
100 +#include <asm/mach/arch.h>
101 +#include <asm/mach/flash.h>
103 +static struct flash_platform_data fsg_flash_data = {
104 + .map_name = "cfi_probe",
108 +static struct resource fsg_flash_resource = {
109 + .flags = IORESOURCE_MEM,
112 +static struct platform_device fsg_flash = {
113 + .name = "IXP4XX-Flash",
115 + .dev.platform_data = &fsg_flash_data,
116 + .num_resources = 1,
117 + .resource = &fsg_flash_resource,
120 +static struct i2c_gpio_platform_data fsg_i2c_gpio_data = {
121 + .sda_pin = FSG_SDA_PIN,
122 + .scl_pin = FSG_SCL_PIN,
125 +static struct platform_device fsg_i2c_gpio = {
126 + .name = "i2c-gpio",
129 + .platform_data = &fsg_i2c_gpio_data,
133 +#ifdef CONFIG_LEDS_CLASS
134 +static struct resource fsg_led_resources[] = {
137 + .start = FSG_LED_RING_GPIO,
138 + .end = FSG_LED_RING_GPIO,
139 + .flags = IXP4XX_GPIO_HIGH,
143 + .start = FSG_LED_SYNC_GPIO,
144 + .end = FSG_LED_SYNC_GPIO,
145 + .flags = IXP4XX_GPIO_HIGH,
149 + .start = FSG_LED_USB_GPIO,
150 + .end = FSG_LED_USB_GPIO,
151 + .flags = IXP4XX_GPIO_HIGH,
155 + .start = FSG_LED_SATA_GPIO,
156 + .end = FSG_LED_SATA_GPIO,
157 + .flags = IXP4XX_GPIO_HIGH,
161 + .start = FSG_LED_WAN_GPIO,
162 + .end = FSG_LED_WAN_GPIO,
163 + .flags = IXP4XX_GPIO_HIGH,
167 + .start = FSG_LED_WLAN_GPIO,
168 + .end = FSG_LED_WLAN_GPIO,
169 + .flags = IXP4XX_GPIO_HIGH,
173 +static struct platform_device fsg_leds = {
174 + .name = "IXP4XX-GPIO-LED",
176 + .num_resources = ARRAY_SIZE(fsg_led_resources),
177 + .resource = fsg_led_resources,
181 +static struct resource fsg_uart_resources[] = {
183 + .start = IXP4XX_UART1_BASE_PHYS,
184 + .end = IXP4XX_UART1_BASE_PHYS + 0x0fff,
185 + .flags = IORESOURCE_MEM,
188 + .start = IXP4XX_UART2_BASE_PHYS,
189 + .end = IXP4XX_UART2_BASE_PHYS + 0x0fff,
190 + .flags = IORESOURCE_MEM,
194 +static struct plat_serial8250_port fsg_uart_data[] = {
196 + .mapbase = IXP4XX_UART1_BASE_PHYS,
197 + .membase = (char *)IXP4XX_UART1_BASE_VIRT + REG_OFFSET,
198 + .irq = IRQ_IXP4XX_UART1,
199 + .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
200 + .iotype = UPIO_MEM,
202 + .uartclk = IXP4XX_UART_XTAL,
205 + .mapbase = IXP4XX_UART2_BASE_PHYS,
206 + .membase = (char *)IXP4XX_UART2_BASE_VIRT + REG_OFFSET,
207 + .irq = IRQ_IXP4XX_UART2,
208 + .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
209 + .iotype = UPIO_MEM,
211 + .uartclk = IXP4XX_UART_XTAL,
216 +static struct platform_device fsg_uart = {
217 + .name = "serial8250",
218 + .id = PLAT8250_DEV_PLATFORM,
219 + .dev.platform_data = fsg_uart_data,
220 + .num_resources = ARRAY_SIZE(fsg_uart_resources),
221 + .resource = fsg_uart_resources,
224 +static struct platform_device *fsg_devices[] __initdata = {
227 +#ifdef CONFIG_LEDS_IXP4XX
232 +static void __init fsg_init(void)
236 + fsg_flash_resource.start = IXP4XX_EXP_BUS_BASE(0);
237 + fsg_flash_resource.end =
238 + IXP4XX_EXP_BUS_BASE(0) + ixp4xx_exp_bus_size - 1;
240 + *IXP4XX_EXP_CS0 |= IXP4XX_FLASH_WRITABLE;
241 + *IXP4XX_EXP_CS1 = *IXP4XX_EXP_CS0;
243 + /* Configure CS2 for operation, 8bit and writable */
244 + *IXP4XX_EXP_CS2 = 0xbfff0002;
246 + /* This is only useful on a modified machine, but it is valuable
247 + * to have it first in order to see debug messages, and so that
248 + * it does *not* get removed if platform_add_devices fails!
250 + (void)platform_device_register(&fsg_uart);
252 + platform_add_devices(fsg_devices, ARRAY_SIZE(fsg_devices));
255 +MACHINE_START(FSG, "Freecom FSG-3")
256 + /* Maintainer: www.nslu2-linux.org */
257 + .phys_io = IXP4XX_PERIPHERAL_BASE_PHYS,
258 + .io_pg_offst = ((IXP4XX_PERIPHERAL_BASE_VIRT) >> 18) & 0xfffc,
259 + .map_io = ixp4xx_map_io,
260 + .init_irq = ixp4xx_init_irq,
261 + .timer = &ixp4xx_timer,
262 + .boot_params = 0x0100,
263 + .init_machine = fsg_init,
266 diff -uprN linux-2.6.23.orig/arch/arm/mach-ixp4xx/Kconfig linux-2.6.23/arch/arm/mach-ixp4xx/Kconfig
267 --- linux-2.6.23.orig/arch/arm/mach-ixp4xx/Kconfig 2007-10-09 15:31:38.000000000 -0500
268 +++ linux-2.6.23/arch/arm/mach-ixp4xx/Kconfig 2007-10-11 00:55:34.000000000 -0500
269 @@ -125,6 +125,15 @@ config ARCH_IXDP4XX
270 depends on ARCH_IXDP425 || MACH_IXDP465 || MACH_KIXRP435
275 + prompt "Freecom FSG-3"
278 + Say 'Y' here if you want your kernel to support Freecom's
279 + FSG-3 device. For more information on this platform
280 + see http://www.nslu2-linux.org/wiki/FSG3/HomePage
283 # Certain registers and IRQs are only enabled if supporting IXP465 CPUs
285 diff -uprN linux-2.6.23.orig/arch/arm/mach-ixp4xx/Makefile linux-2.6.23/arch/arm/mach-ixp4xx/Makefile
286 --- linux-2.6.23.orig/arch/arm/mach-ixp4xx/Makefile 2007-10-09 15:31:38.000000000 -0500
287 +++ linux-2.6.23/arch/arm/mach-ixp4xx/Makefile 2007-10-11 00:55:34.000000000 -0500
288 @@ -15,6 +15,7 @@ obj-pci-$(CONFIG_MACH_NAS100D) += nas10
289 obj-pci-$(CONFIG_MACH_DSMG600) += dsmg600-pci.o
290 obj-pci-$(CONFIG_MACH_GATEWAY7001) += gateway7001-pci.o
291 obj-pci-$(CONFIG_MACH_WG302V2) += wg302v2-pci.o
292 +obj-pci-$(CONFIG_MACH_FSG) += fsg-pci.o
296 @@ -28,5 +29,6 @@ obj-$(CONFIG_MACH_NAS100D) += nas100d-se
297 obj-$(CONFIG_MACH_DSMG600) += dsmg600-setup.o dsmg600-power.o
298 obj-$(CONFIG_MACH_GATEWAY7001) += gateway7001-setup.o
299 obj-$(CONFIG_MACH_WG302V2) += wg302v2-setup.o
300 +obj-$(CONFIG_MACH_FSG) += fsg-setup.o
302 obj-$(CONFIG_PCI) += $(obj-pci-$(CONFIG_PCI)) common-pci.o
303 diff -uprN linux-2.6.23.orig/include/asm-arm/arch-ixp4xx/fsg.h linux-2.6.23/include/asm-arm/arch-ixp4xx/fsg.h
304 --- linux-2.6.23.orig/include/asm-arm/arch-ixp4xx/fsg.h 1969-12-31 18:00:00.000000000 -0600
305 +++ linux-2.6.23/include/asm-arm/arch-ixp4xx/fsg.h 2007-10-11 00:55:34.000000000 -0500
308 + * include/asm-arm/arch-ixp4xx/fsg.h
310 + * Freecom FSG-3 platform specific definitions
312 + * Author: Rod Whitby <rod@whitby.id.au>
313 + * Author: Tomasz Chmielewski <mangoo@wpkg.org>
314 + * Maintainers: http://www.nslu2-linux.org
316 + * Based on coyote.h by
317 + * Copyright 2004 (c) MontaVista, Software, Inc.
319 + * This file is licensed under the terms of the GNU General Public
320 + * License version 2. This program is licensed "as is" without any
321 + * warranty of any kind, whether express or implied.
324 +#ifndef __ASM_ARCH_HARDWARE_H__
325 +#error "Do not include this directly, instead #include <asm/hardware.h>"
328 +#define FSG_SDA_PIN 12
329 +#define FSG_SCL_PIN 13
334 +#define FSG_PCI_MAX_DEV 3
335 +#define FSG_PCI_IRQ_LINES 3
338 +/* PCI controller GPIO to IRQ pin mappings */
339 +#define FSG_PCI_INTA_PIN 6
340 +#define FSG_PCI_INTB_PIN 7
341 +#define FSG_PCI_INTC_PIN 5
345 +#define FSG_SB_GPIO 4
346 +#define FSG_RB_GPIO 9
347 +#define FSG_UB_GPIO 10
349 +#define FSG_SB_IRQ IRQ_IXP4XX_GPIO4
350 +#define FSG_RB_IRQ IRQ_IXP4XX_GPIO9
351 +#define FSG_UB_IRQ IRQ_IXP4XX_GPIO10
353 +#define FSG_SB_BM (1L << FSG_SB_GPIO)
354 +#define FSG_RB_BM (1L << FSG_RB_GPIO)
355 +#define FSG_UB_BM (1L << FSG_UB_GPIO)
359 +#define FSG_LED_RING_GPIO 0
360 +#define FSG_LED_SYNC_GPIO 1
361 +#define FSG_LED_USB_GPIO 2
362 +#define FSG_LED_SATA_GPIO 3
363 +#define FSG_LED_WAN_GPIO 4
364 +#define FSG_LED_WLAN_GPIO 5
367 +#define FSG_PCI_SLOT0_PIN 6
368 +#define FSG_PCI_SLOT1_PIN 7
370 +#define FSG_PCI_SLOT0_DEVID 14
371 +#define FSG_PCI_SLOT1_DEVID 15
373 +#define FSG_IDE_BASE_PHYS IXP4XX_EXP_BUS_BASE(3)
374 +#define FSG_IDE_BASE_VIRT 0xFFFE1000
375 +#define FSG_IDE_REGION_SIZE 0x1000
377 +#define FSG_IDE_DATA_PORT 0xFFFE10E0
378 +#define FSG_IDE_CTRL_PORT 0xFFFE10FC
379 +#define FSG_IDE_ERROR_PORT 0xFFFE10E2
381 diff -uprN linux-2.6.23.orig/include/asm-arm/arch-ixp4xx/hardware.h linux-2.6.23/include/asm-arm/arch-ixp4xx/hardware.h
382 --- linux-2.6.23.orig/include/asm-arm/arch-ixp4xx/hardware.h 2007-10-09 15:31:38.000000000 -0500
383 +++ linux-2.6.23/include/asm-arm/arch-ixp4xx/hardware.h 2007-10-11 00:55:34.000000000 -0500
390 #endif /* _ASM_ARCH_HARDWARE_H */
391 diff -uprN linux-2.6.23.orig/include/asm-arm/arch-ixp4xx/irqs.h linux-2.6.23/include/asm-arm/arch-ixp4xx/irqs.h
392 --- linux-2.6.23.orig/include/asm-arm/arch-ixp4xx/irqs.h 2007-10-09 15:31:38.000000000 -0500
393 +++ linux-2.6.23/include/asm-arm/arch-ixp4xx/irqs.h 2007-10-11 00:55:34.000000000 -0500
395 #define IRQ_DSMG600_PCI_INTE IRQ_IXP4XX_GPIO7
396 #define IRQ_DSMG600_PCI_INTF IRQ_IXP4XX_GPIO6
399 + * Freecom FSG-3 Board IRQs
401 +#define IRQ_FSG_PCI_INTA IRQ_IXP4XX_GPIO6
402 +#define IRQ_FSG_PCI_INTB IRQ_IXP4XX_GPIO7
403 +#define IRQ_FSG_PCI_INTC IRQ_IXP4XX_GPIO5
406 +#define IRQ_FSG_PCI_SLOT0 IRQ_IXP4XX_GPIO6
407 +#define IRQ_FSG_PCI_SLOT1 IRQ_IXP4XX_GPIO7
408 +#define IRQ_FSG_IDE IRQ_IXP4XX_GPIO5