diff options
| author | Rod Whitby <rod@whitby.id.au> | 2008-04-01 05:53:23 -0400 |
|---|---|---|
| committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2008-04-04 05:03:59 -0400 |
| commit | 7e36e2f5355ab87f8946041d044b34cda01e2077 (patch) | |
| tree | 634798504df6b50a1001b0ea439d3d0987c46319 | |
| parent | 05dda977f2574c3341abef9b74c27d2b362e1e3a (diff) | |
[ARM] 4874/2: ixp4xx: Add support for the Freecom FSG-3 board
The Freecom-FSG3 is a small network-attached-storage device with the
following feature set:
* Intel IXP422
* 4MB Flash (ixp4xx flash driver)
* 64MB RAM
* 4 USB 2.0 host ports (ehci and ohci drivers)
* 1 WAN (eth1) and 3 LAN (eth0) ethernet ports
* Supported by the open source ixp4xx ethernet driver
* Via VT6421 disk controller (libata and sata-via drivers)
* Internal hard disk (PATA supported, SATA not yet supported)
* External SATA port (not yet supported)
* ISL1208 RTC chip
* Winbond 83782 temp sensor and fan controller
* MiniPCI slot
The ixp4xx_defconfig is also updated to support this device (the
leds-fsg driver is to be submitted separately via the leds tree after
this initial support is merged, as it depends on header gpio defines).
Signed-off-by: Rod Whitby <rod@whitby.id.au>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
| -rw-r--r-- | arch/arm/configs/ixp4xx_defconfig | 9 | ||||
| -rw-r--r-- | arch/arm/mach-ixp4xx/Kconfig | 9 | ||||
| -rw-r--r-- | arch/arm/mach-ixp4xx/Makefile | 2 | ||||
| -rw-r--r-- | arch/arm/mach-ixp4xx/fsg-pci.c | 71 | ||||
| -rw-r--r-- | arch/arm/mach-ixp4xx/fsg-setup.c | 276 | ||||
| -rw-r--r-- | include/asm-arm/arch-ixp4xx/fsg.h | 50 | ||||
| -rw-r--r-- | include/asm-arm/arch-ixp4xx/hardware.h | 1 | ||||
| -rw-r--r-- | include/asm-arm/arch-ixp4xx/irqs.h | 7 |
8 files changed, 421 insertions, 4 deletions
diff --git a/arch/arm/configs/ixp4xx_defconfig b/arch/arm/configs/ixp4xx_defconfig index efa0485d2f7e..fc14932e3abd 100644 --- a/arch/arm/configs/ixp4xx_defconfig +++ b/arch/arm/configs/ixp4xx_defconfig | |||
| @@ -165,6 +165,7 @@ CONFIG_ARCH_PRPMC1100=y | |||
| 165 | CONFIG_MACH_NAS100D=y | 165 | CONFIG_MACH_NAS100D=y |
| 166 | CONFIG_MACH_DSMG600=y | 166 | CONFIG_MACH_DSMG600=y |
| 167 | CONFIG_ARCH_IXDP4XX=y | 167 | CONFIG_ARCH_IXDP4XX=y |
| 168 | CONFIG_MACH_FSG=y | ||
| 168 | CONFIG_CPU_IXP46X=y | 169 | CONFIG_CPU_IXP46X=y |
| 169 | CONFIG_CPU_IXP43X=y | 170 | CONFIG_CPU_IXP43X=y |
| 170 | CONFIG_MACH_GTWX5715=y | 171 | CONFIG_MACH_GTWX5715=y |
| @@ -770,7 +771,7 @@ CONFIG_ATA=y | |||
| 770 | # CONFIG_SATA_SIL24 is not set | 771 | # CONFIG_SATA_SIL24 is not set |
| 771 | # CONFIG_SATA_SIS is not set | 772 | # CONFIG_SATA_SIS is not set |
| 772 | # CONFIG_SATA_ULI is not set | 773 | # CONFIG_SATA_ULI is not set |
| 773 | # CONFIG_SATA_VIA is not set | 774 | CONFIG_SATA_VIA=y |
| 774 | # CONFIG_SATA_VITESSE is not set | 775 | # CONFIG_SATA_VITESSE is not set |
| 775 | # CONFIG_SATA_INIC162X is not set | 776 | # CONFIG_SATA_INIC162X is not set |
| 776 | # CONFIG_PATA_ALI is not set | 777 | # CONFIG_PATA_ALI is not set |
| @@ -1143,7 +1144,7 @@ CONFIG_HWMON=y | |||
| 1143 | # CONFIG_SENSORS_VIA686A is not set | 1144 | # CONFIG_SENSORS_VIA686A is not set |
| 1144 | # CONFIG_SENSORS_VT1211 is not set | 1145 | # CONFIG_SENSORS_VT1211 is not set |
| 1145 | # CONFIG_SENSORS_VT8231 is not set | 1146 | # CONFIG_SENSORS_VT8231 is not set |
| 1146 | # CONFIG_SENSORS_W83781D is not set | 1147 | CONFIG_SENSORS_W83781D=y |
| 1147 | # CONFIG_SENSORS_W83791D is not set | 1148 | # CONFIG_SENSORS_W83791D is not set |
| 1148 | # CONFIG_SENSORS_W83792D is not set | 1149 | # CONFIG_SENSORS_W83792D is not set |
| 1149 | # CONFIG_SENSORS_W83793 is not set | 1150 | # CONFIG_SENSORS_W83793 is not set |
| @@ -1334,8 +1335,8 @@ CONFIG_LEDS_CLASS=y | |||
| 1334 | # | 1335 | # |
| 1335 | # LED drivers | 1336 | # LED drivers |
| 1336 | # | 1337 | # |
| 1337 | # CONFIG_LEDS_IXP4XX is not set | ||
| 1338 | CONFIG_LEDS_GPIO=y | 1338 | CONFIG_LEDS_GPIO=y |
| 1339 | CONFIG_LEDS_FSG=y | ||
| 1339 | 1340 | ||
| 1340 | # | 1341 | # |
| 1341 | # LED Triggers | 1342 | # LED Triggers |
| @@ -1367,7 +1368,7 @@ CONFIG_RTC_INTF_DEV=y | |||
| 1367 | # CONFIG_RTC_DRV_DS1672 is not set | 1368 | # CONFIG_RTC_DRV_DS1672 is not set |
| 1368 | # CONFIG_RTC_DRV_MAX6900 is not set | 1369 | # CONFIG_RTC_DRV_MAX6900 is not set |
| 1369 | # CONFIG_RTC_DRV_RS5C372 is not set | 1370 | # CONFIG_RTC_DRV_RS5C372 is not set |
| 1370 | # CONFIG_RTC_DRV_ISL1208 is not set | 1371 | CONFIG_RTC_DRV_ISL1208=y |
| 1371 | CONFIG_RTC_DRV_X1205=y | 1372 | CONFIG_RTC_DRV_X1205=y |
| 1372 | CONFIG_RTC_DRV_PCF8563=y | 1373 | CONFIG_RTC_DRV_PCF8563=y |
| 1373 | # CONFIG_RTC_DRV_PCF8583 is not set | 1374 | # CONFIG_RTC_DRV_PCF8583 is not set |
diff --git a/arch/arm/mach-ixp4xx/Kconfig b/arch/arm/mach-ixp4xx/Kconfig index e774447c0592..db8b5fe06c0d 100644 --- a/arch/arm/mach-ixp4xx/Kconfig +++ b/arch/arm/mach-ixp4xx/Kconfig | |||
| @@ -125,6 +125,15 @@ config ARCH_IXDP4XX | |||
| 125 | depends on ARCH_IXDP425 || MACH_IXDP465 || MACH_KIXRP435 | 125 | depends on ARCH_IXDP425 || MACH_IXDP465 || MACH_KIXRP435 |
| 126 | default y | 126 | default y |
| 127 | 127 | ||
| 128 | config MACH_FSG | ||
| 129 | bool | ||
| 130 | prompt "Freecom FSG-3" | ||
| 131 | select PCI | ||
| 132 | help | ||
| 133 | Say 'Y' here if you want your kernel to support Freecom's | ||
| 134 | FSG-3 device. For more information on this platform, | ||
| 135 | see http://www.nslu2-linux.org/wiki/FSG3/HomePage | ||
| 136 | |||
| 128 | # | 137 | # |
| 129 | # Certain registers and IRQs are only enabled if supporting IXP465 CPUs | 138 | # Certain registers and IRQs are only enabled if supporting IXP465 CPUs |
| 130 | # | 139 | # |
diff --git a/arch/arm/mach-ixp4xx/Makefile b/arch/arm/mach-ixp4xx/Makefile index c1956882c48b..2e6bbf927a74 100644 --- a/arch/arm/mach-ixp4xx/Makefile +++ b/arch/arm/mach-ixp4xx/Makefile | |||
| @@ -15,6 +15,7 @@ obj-pci-$(CONFIG_MACH_NAS100D) += nas100d-pci.o | |||
| 15 | obj-pci-$(CONFIG_MACH_DSMG600) += dsmg600-pci.o | 15 | obj-pci-$(CONFIG_MACH_DSMG600) += dsmg600-pci.o |
| 16 | obj-pci-$(CONFIG_MACH_GATEWAY7001) += gateway7001-pci.o | 16 | obj-pci-$(CONFIG_MACH_GATEWAY7001) += gateway7001-pci.o |
| 17 | obj-pci-$(CONFIG_MACH_WG302V2) += wg302v2-pci.o | 17 | obj-pci-$(CONFIG_MACH_WG302V2) += wg302v2-pci.o |
| 18 | obj-pci-$(CONFIG_MACH_FSG) += fsg-pci.o | ||
| 18 | 19 | ||
| 19 | obj-y += common.o | 20 | obj-y += common.o |
| 20 | 21 | ||
| @@ -28,6 +29,7 @@ obj-$(CONFIG_MACH_NAS100D) += nas100d-setup.o | |||
| 28 | obj-$(CONFIG_MACH_DSMG600) += dsmg600-setup.o | 29 | obj-$(CONFIG_MACH_DSMG600) += dsmg600-setup.o |
| 29 | obj-$(CONFIG_MACH_GATEWAY7001) += gateway7001-setup.o | 30 | obj-$(CONFIG_MACH_GATEWAY7001) += gateway7001-setup.o |
| 30 | obj-$(CONFIG_MACH_WG302V2) += wg302v2-setup.o | 31 | obj-$(CONFIG_MACH_WG302V2) += wg302v2-setup.o |
| 32 | obj-$(CONFIG_MACH_FSG) += fsg-setup.o | ||
| 31 | 33 | ||
| 32 | obj-$(CONFIG_PCI) += $(obj-pci-$(CONFIG_PCI)) common-pci.o | 34 | obj-$(CONFIG_PCI) += $(obj-pci-$(CONFIG_PCI)) common-pci.o |
| 33 | obj-$(CONFIG_IXP4XX_QMGR) += ixp4xx_qmgr.o | 35 | obj-$(CONFIG_IXP4XX_QMGR) += ixp4xx_qmgr.o |
diff --git a/arch/arm/mach-ixp4xx/fsg-pci.c b/arch/arm/mach-ixp4xx/fsg-pci.c new file mode 100644 index 000000000000..f19f3f6feda1 --- /dev/null +++ b/arch/arm/mach-ixp4xx/fsg-pci.c | |||
| @@ -0,0 +1,71 @@ | |||
| 1 | /* | ||
| 2 | * arch/arch/mach-ixp4xx/fsg-pci.c | ||
| 3 | * | ||
| 4 | * FSG board-level PCI initialization | ||
| 5 | * | ||
| 6 | * Author: Rod Whitby <rod@whitby.id.au> | ||
| 7 | * Maintainer: http://www.nslu2-linux.org/ | ||
| 8 | * | ||
| 9 | * based on ixdp425-pci.c: | ||
| 10 | * Copyright (C) 2002 Intel Corporation. | ||
| 11 | * Copyright (C) 2003-2004 MontaVista Software, Inc. | ||
| 12 | * | ||
| 13 | * This program is free software; you can redistribute it and/or modify | ||
| 14 | * it under the terms of the GNU General Public License version 2 as | ||
| 15 | * published by the Free Software Foundation. | ||
| 16 | * | ||
| 17 | */ | ||
| 18 | |||
| 19 | #include <linux/pci.h> | ||
| 20 | #include <linux/init.h> | ||
| 21 | #include <linux/irq.h> | ||
| 22 | |||
| 23 | #include <asm/mach/pci.h> | ||
| 24 | #include <asm/mach-types.h> | ||
| 25 | |||
| 26 | void __init fsg_pci_preinit(void) | ||
| 27 | { | ||
| 28 | set_irq_type(IRQ_FSG_PCI_INTA, IRQT_LOW); | ||
| 29 | set_irq_type(IRQ_FSG_PCI_INTB, IRQT_LOW); | ||
| 30 | set_irq_type(IRQ_FSG_PCI_INTC, IRQT_LOW); | ||
| 31 | |||
| 32 | ixp4xx_pci_preinit(); | ||
| 33 | } | ||
| 34 | |||
| 35 | static int __init fsg_map_irq(struct pci_dev *dev, u8 slot, u8 pin) | ||
| 36 | { | ||
| 37 | static int pci_irq_table[FSG_PCI_IRQ_LINES] = { | ||
| 38 | IRQ_FSG_PCI_INTC, | ||
| 39 | IRQ_FSG_PCI_INTB, | ||
| 40 | IRQ_FSG_PCI_INTA, | ||
| 41 | }; | ||
| 42 | |||
| 43 | int irq = -1; | ||
| 44 | slot = slot - 11; | ||
| 45 | |||
| 46 | if (slot >= 1 && slot <= FSG_PCI_MAX_DEV && | ||
| 47 | pin >= 1 && pin <= FSG_PCI_IRQ_LINES) | ||
| 48 | irq = pci_irq_table[(slot - 1)]; | ||
| 49 | printk(KERN_INFO "%s: Mapped slot %d pin %d to IRQ %d\n", | ||
| 50 | __func__, slot, pin, irq); | ||
| 51 | |||
| 52 | return irq; | ||
| 53 | } | ||
| 54 | |||
| 55 | struct hw_pci fsg_pci __initdata = { | ||
| 56 | .nr_controllers = 1, | ||
| 57 | .preinit = fsg_pci_preinit, | ||
| 58 | .swizzle = pci_std_swizzle, | ||
| 59 | .setup = ixp4xx_setup, | ||
| 60 | .scan = ixp4xx_scan_bus, | ||
| 61 | .map_irq = fsg_map_irq, | ||
| 62 | }; | ||
| 63 | |||
| 64 | int __init fsg_pci_init(void) | ||
| 65 | { | ||
| 66 | if (machine_is_fsg()) | ||
| 67 | pci_common_init(&fsg_pci); | ||
| 68 | return 0; | ||
| 69 | } | ||
| 70 | |||
| 71 | subsys_initcall(fsg_pci_init); | ||
diff --git a/arch/arm/mach-ixp4xx/fsg-setup.c b/arch/arm/mach-ixp4xx/fsg-setup.c new file mode 100644 index 000000000000..0db3a909ae61 --- /dev/null +++ b/arch/arm/mach-ixp4xx/fsg-setup.c | |||
| @@ -0,0 +1,276 @@ | |||
| 1 | /* | ||
| 2 | * arch/arm/mach-ixp4xx/fsg-setup.c | ||
| 3 | * | ||
| 4 | * FSG board-setup | ||
| 5 | * | ||
| 6 | * Copyright (C) 2008 Rod Whitby <rod@whitby.id.au> | ||
| 7 | * | ||
| 8 | * based on ixdp425-setup.c: | ||
| 9 | * Copyright (C) 2003-2004 MontaVista Software, Inc. | ||
| 10 | * based on nslu2-power.c | ||
| 11 | * Copyright (C) 2005 Tower Technologies | ||
| 12 | * | ||
| 13 | * Author: Rod Whitby <rod@whitby.id.au> | ||
| 14 | * Maintainers: http://www.nslu2-linux.org/ | ||
| 15 | * | ||
| 16 | */ | ||
| 17 | |||
| 18 | #include <linux/if_ether.h> | ||
| 19 | #include <linux/irq.h> | ||
| 20 | #include <linux/serial.h> | ||
| 21 | #include <linux/serial_8250.h> | ||
| 22 | #include <linux/leds.h> | ||
| 23 | #include <linux/reboot.h> | ||
| 24 | #include <linux/i2c.h> | ||
| 25 | #include <linux/i2c-gpio.h> | ||
| 26 | |||
| 27 | #include <asm/mach-types.h> | ||
| 28 | #include <asm/mach/arch.h> | ||
| 29 | #include <asm/mach/flash.h> | ||
| 30 | #include <asm/io.h> | ||
| 31 | #include <asm/gpio.h> | ||
| 32 | |||
| 33 | static struct flash_platform_data fsg_flash_data = { | ||
| 34 | .map_name = "cfi_probe", | ||
| 35 | .width = 2, | ||
| 36 | }; | ||
| 37 | |||
| 38 | static struct resource fsg_flash_resource = { | ||
| 39 | .flags = IORESOURCE_MEM, | ||
| 40 | }; | ||
| 41 | |||
| 42 | static struct platform_device fsg_flash = { | ||
| 43 | .name = "IXP4XX-Flash", | ||
| 44 | .id = 0, | ||
| 45 | .dev = { | ||
| 46 | .platform_data = &fsg_flash_data, | ||
| 47 | }, | ||
| 48 | .num_resources = 1, | ||
| 49 | .resource = &fsg_flash_resource, | ||
| 50 | }; | ||
| 51 | |||
| 52 | static struct i2c_gpio_platform_data fsg_i2c_gpio_data = { | ||
| 53 | .sda_pin = FSG_SDA_PIN, | ||
| 54 | .scl_pin = FSG_SCL_PIN, | ||
| 55 | }; | ||
| 56 | |||
| 57 | static struct platform_device fsg_i2c_gpio = { | ||
| 58 | .name = "i2c-gpio", | ||
| 59 | .id = 0, | ||
| 60 | .dev = { | ||
| 61 | .platform_data = &fsg_i2c_gpio_data, | ||
| 62 | }, | ||
| 63 | }; | ||
| 64 | |||
| 65 | static struct i2c_board_info __initdata fsg_i2c_board_info [] = { | ||
| 66 | { | ||
| 67 | I2C_BOARD_INFO("rtc-isl1208", 0x6f), | ||
| 68 | }, | ||
| 69 | }; | ||
| 70 | |||
| 71 | static struct resource fsg_uart_resources[] = { | ||
| 72 | { | ||
| 73 | .start = IXP4XX_UART1_BASE_PHYS, | ||
| 74 | .end = IXP4XX_UART1_BASE_PHYS + 0x0fff, | ||
| 75 | .flags = IORESOURCE_MEM, | ||
| 76 | }, | ||
| 77 | { | ||
| 78 | .start = IXP4XX_UART2_BASE_PHYS, | ||
| 79 | .end = IXP4XX_UART2_BASE_PHYS + 0x0fff, | ||
| 80 | .flags = IORESOURCE_MEM, | ||
| 81 | } | ||
| 82 | }; | ||
| 83 | |||
| 84 | static struct plat_serial8250_port fsg_uart_data[] = { | ||
| 85 | { | ||
| 86 | .mapbase = IXP4XX_UART1_BASE_PHYS, | ||
| 87 | .membase = (char *)IXP4XX_UART1_BASE_VIRT + REG_OFFSET, | ||
| 88 | .irq = IRQ_IXP4XX_UART1, | ||
| 89 | .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST, | ||
| 90 | .iotype = UPIO_MEM, | ||
| 91 | .regshift = 2, | ||
| 92 | .uartclk = IXP4XX_UART_XTAL, | ||
| 93 | }, | ||
| 94 | { | ||
| 95 | .mapbase = IXP4XX_UART2_BASE_PHYS, | ||
| 96 | .membase = (char *)IXP4XX_UART2_BASE_VIRT + REG_OFFSET, | ||
| 97 | .irq = IRQ_IXP4XX_UART2, | ||
| 98 | .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST, | ||
| 99 | .iotype = UPIO_MEM, | ||
| 100 | .regshift = 2, | ||
| 101 | .uartclk = IXP4XX_UART_XTAL, | ||
| 102 | }, | ||
| 103 | { } | ||
| 104 | }; | ||
| 105 | |||
| 106 | static struct platform_device fsg_uart = { | ||
| 107 | .name = "serial8250", | ||
| 108 | .id = PLAT8250_DEV_PLATFORM, | ||
| 109 | .dev = { | ||
| 110 | .platform_data = fsg_uart_data, | ||
| 111 | }, | ||
| 112 | .num_resources = ARRAY_SIZE(fsg_uart_resources), | ||
| 113 | .resource = fsg_uart_resources, | ||
| 114 | }; | ||
| 115 | |||
| 116 | static struct platform_device fsg_leds = { | ||
| 117 | .name = "fsg-led", | ||
| 118 | .id = -1, | ||
| 119 | }; | ||
| 120 | |||
| 121 | /* Built-in 10/100 Ethernet MAC interfaces */ | ||
| 122 | static struct eth_plat_info fsg_plat_eth[] = { | ||
| 123 | { | ||
| 124 | .phy = 5, | ||
| 125 | .rxq = 3, | ||
| 126 | .txreadyq = 20, | ||
| 127 | }, { | ||
| 128 | .phy = 4, | ||
| 129 | .rxq = 4, | ||
| 130 | .txreadyq = 21, | ||
| 131 | } | ||
| 132 | }; | ||
| 133 | |||
| 134 | static struct platform_device fsg_eth[] = { | ||
| 135 | { | ||
| 136 | .name = "ixp4xx_eth", | ||
| 137 | .id = IXP4XX_ETH_NPEB, | ||
| 138 | .dev = { | ||
| 139 | .platform_data = fsg_plat_eth, | ||
| 140 | }, | ||
| 141 | }, { | ||
| 142 | .name = "ixp4xx_eth", | ||
| 143 | .id = IXP4XX_ETH_NPEC, | ||
| 144 | .dev = { | ||
| 145 | .platform_data = fsg_plat_eth + 1, | ||
| 146 | }, | ||
| 147 | } | ||
| 148 | }; | ||
| 149 | |||
| 150 | static struct platform_device *fsg_devices[] __initdata = { | ||
| 151 | &fsg_i2c_gpio, | ||
| 152 | &fsg_flash, | ||
| 153 | &fsg_leds, | ||
| 154 | &fsg_eth[0], | ||
| 155 | &fsg_eth[1], | ||
| 156 | }; | ||
| 157 | |||
| 158 | static irqreturn_t fsg_power_handler(int irq, void *dev_id) | ||
| 159 | { | ||
| 160 | /* Signal init to do the ctrlaltdel action, this will bypass init if | ||
| 161 | * it hasn't started and do a kernel_restart. | ||
| 162 | */ | ||
| 163 | ctrl_alt_del(); | ||
| 164 | |||
| 165 | return IRQ_HANDLED; | ||
| 166 | } | ||
| 167 | |||
| 168 | static irqreturn_t fsg_reset_handler(int irq, void *dev_id) | ||
| 169 | { | ||
| 170 | /* This is the paper-clip reset which does an emergency reboot. */ | ||
| 171 | printk(KERN_INFO "Restarting system.\n"); | ||
| 172 | machine_restart(NULL); | ||
| 173 | |||
| 174 | /* This should never be reached. */ | ||
| 175 | return IRQ_HANDLED; | ||
| 176 | } | ||
| 177 | |||
| 178 | static void __init fsg_init(void) | ||
| 179 | { | ||
| 180 | DECLARE_MAC_BUF(mac_buf); | ||
| 181 | uint8_t __iomem *f; | ||
| 182 | int i; | ||
| 183 | |||
| 184 | ixp4xx_sys_init(); | ||
| 185 | |||
| 186 | fsg_flash_resource.start = IXP4XX_EXP_BUS_BASE(0); | ||
| 187 | fsg_flash_resource.end = | ||
| 188 | IXP4XX_EXP_BUS_BASE(0) + ixp4xx_exp_bus_size - 1; | ||
| 189 | |||
| 190 | *IXP4XX_EXP_CS0 |= IXP4XX_FLASH_WRITABLE; | ||
| 191 | *IXP4XX_EXP_CS1 = *IXP4XX_EXP_CS0; | ||
| 192 | |||
| 193 | /* Configure CS2 for operation, 8bit and writable */ | ||
| 194 | *IXP4XX_EXP_CS2 = 0xbfff0002; | ||
| 195 | |||
| 196 | i2c_register_board_info(0, fsg_i2c_board_info, | ||
| 197 | ARRAY_SIZE(fsg_i2c_board_info)); | ||
| 198 | |||
| 199 | /* This is only useful on a modified machine, but it is valuable | ||
| 200 | * to have it first in order to see debug messages, and so that | ||
| 201 | * it does *not* get removed if platform_add_devices fails! | ||
| 202 | */ | ||
| 203 | (void)platform_device_register(&fsg_uart); | ||
| 204 | |||
| 205 | platform_add_devices(fsg_devices, ARRAY_SIZE(fsg_devices)); | ||
| 206 | |||
| 207 | if (request_irq(gpio_to_irq(FSG_RB_GPIO), &fsg_reset_handler, | ||
| 208 | IRQF_DISABLED | IRQF_TRIGGER_LOW, | ||
| 209 | "FSG reset button", NULL) < 0) { | ||
| 210 | |||
| 211 | printk(KERN_DEBUG "Reset Button IRQ %d not available\n", | ||
| 212 | gpio_to_irq(FSG_RB_GPIO)); | ||
| 213 | } | ||
| 214 | |||
| 215 | if (request_irq(gpio_to_irq(FSG_SB_GPIO), &fsg_power_handler, | ||
| 216 | IRQF_DISABLED | IRQF_TRIGGER_LOW, | ||
| 217 | "FSG power button", NULL) < 0) { | ||
| 218 | |||
| 219 | printk(KERN_DEBUG "Power Button IRQ %d not available\n", | ||
| 220 | gpio_to_irq(FSG_SB_GPIO)); | ||
| 221 | } | ||
| 222 | |||
| 223 | /* | ||
| 224 | * Map in a portion of the flash and read the MAC addresses. | ||
| 225 | * Since it is stored in BE in the flash itself, we need to | ||
| 226 | * byteswap it if we're in LE mode. | ||
| 227 | */ | ||
| 228 | f = ioremap(IXP4XX_EXP_BUS_BASE(0), 0x400000); | ||
| 229 | if (f) { | ||
| 230 | #ifdef __ARMEB__ | ||
| 231 | for (i = 0; i < 6; i++) { | ||
| 232 | fsg_plat_eth[0].hwaddr[i] = readb(f + 0x3C0422 + i); | ||
| 233 | fsg_plat_eth[1].hwaddr[i] = readb(f + 0x3C043B + i); | ||
| 234 | } | ||
| 235 | #else | ||
| 236 | |||
| 237 | /* | ||
| 238 | Endian-swapped reads from unaligned addresses are | ||
| 239 | required to extract the two MACs from the big-endian | ||
| 240 | Redboot config area in flash. | ||
| 241 | */ | ||
| 242 | |||
| 243 | fsg_plat_eth[0].hwaddr[0] = readb(f + 0x3C0421); | ||
| 244 | fsg_plat_eth[0].hwaddr[1] = readb(f + 0x3C0420); | ||
| 245 | fsg_plat_eth[0].hwaddr[2] = readb(f + 0x3C0427); | ||
| 246 | fsg_plat_eth[0].hwaddr[3] = readb(f + 0x3C0426); | ||
| 247 | fsg_plat_eth[0].hwaddr[4] = readb(f + 0x3C0425); | ||
| 248 | fsg_plat_eth[0].hwaddr[5] = readb(f + 0x3C0424); | ||
| 249 | |||
| 250 | fsg_plat_eth[1].hwaddr[0] = readb(f + 0x3C0439); | ||
| 251 | fsg_plat_eth[1].hwaddr[1] = readb(f + 0x3C043F); | ||
| 252 | fsg_plat_eth[1].hwaddr[2] = readb(f + 0x3C043E); | ||
| 253 | fsg_plat_eth[1].hwaddr[3] = readb(f + 0x3C043D); | ||
| 254 | fsg_plat_eth[1].hwaddr[4] = readb(f + 0x3C043C); | ||
| 255 | fsg_plat_eth[1].hwaddr[5] = readb(f + 0x3C0443); | ||
| 256 | #endif | ||
| 257 | iounmap(f); | ||
| 258 | } | ||
| 259 | printk(KERN_INFO "FSG: Using MAC address %s for port 0\n", | ||
| 260 | print_mac(mac_buf, fsg_plat_eth[0].hwaddr)); | ||
| 261 | printk(KERN_INFO "FSG: Using MAC address %s for port 1\n", | ||
| 262 | print_mac(mac_buf, fsg_plat_eth[1].hwaddr)); | ||
| 263 | |||
| 264 | } | ||
| 265 | |||
| 266 | MACHINE_START(FSG, "Freecom FSG-3") | ||
| 267 | /* Maintainer: www.nslu2-linux.org */ | ||
| 268 | .phys_io = IXP4XX_PERIPHERAL_BASE_PHYS, | ||
| 269 | .io_pg_offst = ((IXP4XX_PERIPHERAL_BASE_VIRT) >> 18) & 0xfffc, | ||
| 270 | .map_io = ixp4xx_map_io, | ||
| 271 | .init_irq = ixp4xx_init_irq, | ||
| 272 | .timer = &ixp4xx_timer, | ||
| 273 | .boot_params = 0x0100, | ||
| 274 | .init_machine = fsg_init, | ||
| 275 | MACHINE_END | ||
| 276 | |||
diff --git a/include/asm-arm/arch-ixp4xx/fsg.h b/include/asm-arm/arch-ixp4xx/fsg.h new file mode 100644 index 000000000000..c0100cc7981c --- /dev/null +++ b/include/asm-arm/arch-ixp4xx/fsg.h | |||
| @@ -0,0 +1,50 @@ | |||
| 1 | /* | ||
| 2 | * include/asm-arm/arch-ixp4xx/fsg.h | ||
| 3 | * | ||
| 4 | * Freecom FSG-3 platform specific definitions | ||
| 5 | * | ||
| 6 | * Author: Rod Whitby <rod@whitby.id.au> | ||
| 7 | * Author: Tomasz Chmielewski <mangoo@wpkg.org> | ||
| 8 | * Maintainers: http://www.nslu2-linux.org | ||
| 9 | * | ||
| 10 | * Based on coyote.h by | ||
| 11 | * Copyright 2004 (c) MontaVista, Software, Inc. | ||
| 12 | * | ||
| 13 | * This file is licensed under the terms of the GNU General Public | ||
| 14 | * License version 2. This program is licensed "as is" without any | ||
| 15 | * warranty of any kind, whether express or implied. | ||
| 16 | */ | ||
| 17 | |||
| 18 | #ifndef __ASM_ARCH_HARDWARE_H__ | ||
| 19 | #error "Do not include this directly, instead #include <asm/hardware.h>" | ||
| 20 | #endif | ||
| 21 | |||
| 22 | #define FSG_SDA_PIN 12 | ||
| 23 | #define FSG_SCL_PIN 13 | ||
| 24 | |||
| 25 | /* | ||
| 26 | * FSG PCI IRQs | ||
| 27 | */ | ||
| 28 | #define FSG_PCI_MAX_DEV 3 | ||
| 29 | #define FSG_PCI_IRQ_LINES 3 | ||
| 30 | |||
| 31 | |||
| 32 | /* PCI controller GPIO to IRQ pin mappings */ | ||
| 33 | #define FSG_PCI_INTA_PIN 6 | ||
| 34 | #define FSG_PCI_INTB_PIN 7 | ||
| 35 | #define FSG_PCI_INTC_PIN 5 | ||
| 36 | |||
| 37 | /* Buttons */ | ||
| 38 | |||
| 39 | #define FSG_SB_GPIO 4 /* sync button */ | ||
| 40 | #define FSG_RB_GPIO 9 /* reset button */ | ||
| 41 | #define FSG_UB_GPIO 10 /* usb button */ | ||
| 42 | |||
| 43 | /* LEDs */ | ||
| 44 | |||
| 45 | #define FSG_LED_WLAN_BIT 0 | ||
| 46 | #define FSG_LED_WAN_BIT 1 | ||
| 47 | #define FSG_LED_SATA_BIT 2 | ||
| 48 | #define FSG_LED_USB_BIT 4 | ||
| 49 | #define FSG_LED_RING_BIT 5 | ||
| 50 | #define FSG_LED_SYNC_BIT 7 | ||
diff --git a/include/asm-arm/arch-ixp4xx/hardware.h b/include/asm-arm/arch-ixp4xx/hardware.h index 73e8dc36f6a4..fa723a627854 100644 --- a/include/asm-arm/arch-ixp4xx/hardware.h +++ b/include/asm-arm/arch-ixp4xx/hardware.h | |||
| @@ -45,5 +45,6 @@ | |||
| 45 | #include "nslu2.h" | 45 | #include "nslu2.h" |
| 46 | #include "nas100d.h" | 46 | #include "nas100d.h" |
| 47 | #include "dsmg600.h" | 47 | #include "dsmg600.h" |
| 48 | #include "fsg.h" | ||
| 48 | 49 | ||
| 49 | #endif /* _ASM_ARCH_HARDWARE_H */ | 50 | #endif /* _ASM_ARCH_HARDWARE_H */ |
diff --git a/include/asm-arm/arch-ixp4xx/irqs.h b/include/asm-arm/arch-ixp4xx/irqs.h index 11801605047b..674af4a84147 100644 --- a/include/asm-arm/arch-ixp4xx/irqs.h +++ b/include/asm-arm/arch-ixp4xx/irqs.h | |||
| @@ -128,4 +128,11 @@ | |||
| 128 | #define IRQ_DSMG600_PCI_INTE IRQ_IXP4XX_GPIO7 | 128 | #define IRQ_DSMG600_PCI_INTE IRQ_IXP4XX_GPIO7 |
| 129 | #define IRQ_DSMG600_PCI_INTF IRQ_IXP4XX_GPIO6 | 129 | #define IRQ_DSMG600_PCI_INTF IRQ_IXP4XX_GPIO6 |
| 130 | 130 | ||
| 131 | /* | ||
| 132 | * Freecom FSG-3 Board IRQs | ||
| 133 | */ | ||
| 134 | #define IRQ_FSG_PCI_INTA IRQ_IXP4XX_GPIO6 | ||
| 135 | #define IRQ_FSG_PCI_INTB IRQ_IXP4XX_GPIO7 | ||
| 136 | #define IRQ_FSG_PCI_INTC IRQ_IXP4XX_GPIO5 | ||
| 137 | |||
| 131 | #endif | 138 | #endif |
