Index: linux-2.6.19/arch/arm/mach-ixp4xx/Kconfig =================================================================== --- linux-2.6.19.orig/arch/arm/mach-ixp4xx/Kconfig +++ linux-2.6.19/arch/arm/mach-ixp4xx/Kconfig @@ -106,6 +106,14 @@ config ARCH_IXDP4XX depends on ARCH_IXDP425 || MACH_IXDP465 default y +config MACH_FSG + bool + prompt "Freecom FSG-3" + help + Say 'Y' here if you want your kernel to support Freecom's + FSG-3 device. For more information on this + platform see http://www.openfsg.com/ + # # Certain registers and IRQs are only enabled if supporting IXP465 CPUs # Index: linux-2.6.19/arch/arm/mach-ixp4xx/Makefile =================================================================== --- linux-2.6.19.orig/arch/arm/mach-ixp4xx/Makefile +++ linux-2.6.19/arch/arm/mach-ixp4xx/Makefile @@ -13,6 +13,7 @@ obj-pci-$(CONFIG_MACH_GTWX5715) += gtwx obj-pci-$(CONFIG_MACH_NSLU2) += nslu2-pci.o obj-pci-$(CONFIG_MACH_NAS100D) += nas100d-pci.o obj-pci-$(CONFIG_MACH_DSMG600) += dsmg600-pci.o +obj-pci-$(CONFIG_MACH_FSG) += fsg-pci.o obj-y += common.o @@ -24,5 +25,6 @@ obj-$(CONFIG_MACH_GTWX5715) += gtwx5715- obj-$(CONFIG_MACH_NSLU2) += nslu2-setup.o nslu2-power.o obj-$(CONFIG_MACH_NAS100D) += nas100d-setup.o nas100d-power.o obj-$(CONFIG_MACH_DSMG600) += dsmg600-setup.o dsmg600-power.o +obj-$(CONFIG_MACH_FSG) += fsg-setup.o obj-$(CONFIG_PCI) += $(obj-pci-$(CONFIG_PCI)) common-pci.o Index: linux-2.6.19/arch/arm/mach-ixp4xx/fsg-pci.c =================================================================== --- /dev/null +++ linux-2.6.19/arch/arm/mach-ixp4xx/fsg-pci.c @@ -0,0 +1,66 @@ +/* + * arch/arch/mach-ixp4xx/fsg-pci.c + * + * PCI setup routines for Freecom FSG-3 Platform + * + * Based on ixdpg425-pci.c by + * Copyright (C) 2004 MontaVista Softwrae, Inc. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + */ + +#include +#include +#include +#include + +#include +#include +#include + +#include + +extern void ixp4xx_pci_preinit(void); +extern int ixp4xx_setup(int nr, struct pci_sys_data *sys); +extern struct pci_bus *ixp4xx_scan_bus(int nr, struct pci_sys_data *sys); + +void __init fsg_pci_preinit(void) +{ + set_irq_type(IRQ_IXP4XX_GPIO6, IRQT_LOW); + set_irq_type(IRQ_IXP4XX_GPIO7, IRQT_LOW); + set_irq_type(IRQ_IXP4XX_GPIO5, IRQT_LOW); + + ixp4xx_pci_preinit(); +} + +static int __init fsg_map_irq(struct pci_dev *dev, u8 slot, u8 pin) +{ + if (slot == 14) + return IRQ_IXP4XX_GPIO6; + else if (slot == 13) + return IRQ_IXP4XX_GPIO7; + else if (slot == 12) + return IRQ_IXP4XX_GPIO5; + else return -1; +} + +struct hw_pci fsg_pci __initdata = { + .nr_controllers = 1, + .preinit = fsg_pci_preinit, + .swizzle = pci_std_swizzle, + .setup = ixp4xx_setup, + .scan = ixp4xx_scan_bus, + .map_irq = fsg_map_irq, +}; + +int __init fsg_pci_init(void) +{ + if (machine_is_fsg()) + pci_common_init(&fsg_pci); + return 0; +} + +subsys_initcall(fsg_pci_init); Index: linux-2.6.19/arch/arm/mach-ixp4xx/fsg-setup.c =================================================================== --- /dev/null +++ linux-2.6.19/arch/arm/mach-ixp4xx/fsg-setup.c @@ -0,0 +1,209 @@ +/* + * arch/arm/mach-ixp4xx/fsg-setup.c + * + * Based on coyote-setup.c by + * Copyright (C) 2003-2005 MontaVista Software, Inc. + * + */ + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + + + + +#ifdef CONFIG_LEDS_CLASS +#include +#endif + +static struct flash_platform_data fsg_flash_data = { + .map_name = "cfi_probe", + .width = 2, +}; + +static struct resource fsg_flash_resource = { + .flags = IORESOURCE_MEM, +}; + +static struct platform_device fsg_flash = { + .name = "IXP4XX-Flash", + .id = 0, + .dev = { + .platform_data = &fsg_flash_data, + }, + .num_resources = 1, + .resource = &fsg_flash_resource, +}; + +static struct ixp4xx_i2c_pins fsg_i2c_gpio_pins = { + .sda_pin = 12, + .scl_pin = 13, +}; + +static struct platform_device fsg_i2c_controller = { + .name = "IXP4XX-I2C", + .id = 0, + .dev.platform_data = &fsg_i2c_gpio_pins, + .num_resources = 0, +}; + +static struct resource fsg_uart_resource = { + .start = IXP4XX_UART2_BASE_PHYS, + .end = IXP4XX_UART2_BASE_PHYS + 0x0fff, + .flags = IORESOURCE_MEM, +}; + +static struct plat_serial8250_port fsg_uart_data[] = { + { + .mapbase = IXP4XX_UART2_BASE_PHYS, + .membase = (char *)IXP4XX_UART2_BASE_VIRT + REG_OFFSET, + .irq = IRQ_IXP4XX_UART2, + .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST, + .iotype = UPIO_MEM, + .regshift = 2, + .uartclk = IXP4XX_UART_XTAL, + }, + { }, +}; + +static struct platform_device fsg_uart = { + .name = "serial8250", + .id = PLAT8250_DEV_PLATFORM, + .dev = { + .platform_data = fsg_uart_data, + }, + .num_resources = 1, + .resource = &fsg_uart_resource, +}; + +/* MACs */ +static struct resource res_mac0 = { + .start = IXP4XX_EthB_BASE_PHYS, + .end = IXP4XX_EthB_BASE_PHYS + 0x1ff, + .flags = IORESOURCE_MEM, +}; + +static struct resource res_mac1 = { + .start = IXP4XX_EthC_BASE_PHYS, + .end = IXP4XX_EthC_BASE_PHYS + 0x1ff, + .flags = IORESOURCE_MEM, +}; + +static struct mac_plat_info plat_mac0 = { + .npe_id = 1, + .phy_id = 5, + .eth_id = 0, + .rxq_id = 27, + .txq_id = 24, + .rxdoneq_id = 4, +}; + +static struct mac_plat_info plat_mac1 = { + .npe_id = 2, + .phy_id = 4, + .eth_id = 1, + .rxq_id = 28, + .txq_id = 25, + .rxdoneq_id = 5, +}; + +static struct platform_device mac0 = { + .name = "ixp4xx_mac", + .id = 0, + .dev.platform_data = &plat_mac0, + .num_resources = 1, + .resource = &res_mac0, +}; + +static struct platform_device mac1 = { + .name = "ixp4xx_mac", + .id = 1, + .dev.platform_data = &plat_mac1, + .num_resources = 1, + .resource = &res_mac1, +}; + +static struct platform_device *fsg_devices[] __initdata = { + &fsg_i2c_controller, + &fsg_flash, + &fsg_uart, + &mac0, + &mac1, +}; + +#ifdef CONFIG_LEDS_CLASS +static struct resource fsg_led_resources[] = { + { + .name = "15h", + .start = 15, + .end = 15, + .flags = IXP4XX_GPIO_HIGH, + }, +}; + +static struct platform_device fsg_leds = { + .name = "IXP4XX-GPIO-LED", + .id = -1, + .num_resources = ARRAY_SIZE(fsg_led_resources), + .resource = fsg_led_resources, +}; +#endif + + + + + +static void __init fsg_init(void) +{ + ixp4xx_sys_init(); + + +#ifdef CONFIG_LEDS_CLASS + /* We don't care if this fails. */ + (void)platform_device_register(&fsg_leds); +#endif + + fsg_flash_resource.start = IXP4XX_EXP_BUS_BASE(0); + fsg_flash_resource.end = IXP4XX_EXP_BUS_BASE(0) + SZ_32M - 1; + + *IXP4XX_EXP_CS0 |= IXP4XX_FLASH_WRITABLE; + *IXP4XX_EXP_CS1 = *IXP4XX_EXP_CS0; + + if (machine_is_fsg()) { + fsg_uart_data[0].membase = + (char*)(IXP4XX_UART1_BASE_VIRT + REG_OFFSET); + fsg_uart_data[0].mapbase = IXP4XX_UART1_BASE_PHYS; + fsg_uart_data[0].irq = IRQ_IXP4XX_UART1; + } + + platform_add_devices(fsg_devices, ARRAY_SIZE(fsg_devices)); +} + +MACHINE_START(FSG, "Freecom FSG-3") + .phys_io = IXP4XX_PERIPHERAL_BASE_PHYS, + .io_pg_offst = ((IXP4XX_PERIPHERAL_BASE_VIRT) >> 18) & 0xfffc, + .map_io = ixp4xx_map_io, + .init_irq = ixp4xx_init_irq, + .timer = &ixp4xx_timer, + .boot_params = 0x0100, + .init_machine = fsg_init, +MACHINE_END + Index: linux-2.6.19/include/asm-arm/arch-ixp4xx/fsg.h =================================================================== --- /dev/null +++ linux-2.6.19/include/asm-arm/arch-ixp4xx/fsg.h @@ -0,0 +1,32 @@ +/* + * include/asm-arm/arch-ixp4xx/fsg.h + * + * Freecom FSG-3 platform specific definitions + * + * Based on coyote.h by + * Copyright 2004 (c) MontaVista, Software, Inc. + * + * This file is licensed under the terms of the GNU General Public + * License version 2. This program is licensed "as is" without any + * warranty of any kind, whether express or implied. + */ + +#ifndef __ASM_ARCH_HARDWARE_H__ +#error "Do not include this directly, instead #include " +#endif + +/* PCI controller GPIO to IRQ pin mappings */ + +#define FSG_PCI_SLOT0_PIN 6 +#define FSG_PCI_SLOT1_PIN 7 + +#define FSG_PCI_SLOT0_DEVID 14 +#define FSG_PCI_SLOT1_DEVID 15 + +#define FSG_IDE_BASE_PHYS IXP4XX_EXP_BUS_BASE(3) +#define FSG_IDE_BASE_VIRT 0xFFFE1000 +#define FSG_IDE_REGION_SIZE 0x1000 + +#define FSG_IDE_DATA_PORT 0xFFFE10E0 +#define FSG_IDE_CTRL_PORT 0xFFFE10FC +#define FSG_IDE_ERROR_PORT 0xFFFE10E2 Index: linux-2.6.19/include/asm-arm/arch-ixp4xx/hardware.h =================================================================== --- linux-2.6.19.orig/include/asm-arm/arch-ixp4xx/hardware.h +++ linux-2.6.19/include/asm-arm/arch-ixp4xx/hardware.h @@ -48,5 +48,6 @@ extern unsigned int processor_id; #include "nslu2.h" #include "nas100d.h" #include "dsmg600.h" +#include "fsg.h" #endif /* _ASM_ARCH_HARDWARE_H */ Index: linux-2.6.19/include/asm-arm/arch-ixp4xx/irqs.h =================================================================== --- linux-2.6.19.orig/include/asm-arm/arch-ixp4xx/irqs.h +++ linux-2.6.19/include/asm-arm/arch-ixp4xx/irqs.h @@ -128,4 +128,12 @@ #define IRQ_DSMG600_PCI_INTE IRQ_IXP4XX_GPIO7 #define IRQ_DSMG600_PCI_INTF IRQ_IXP4XX_GPIO6 +/* + * Freecom FSG-3 Board IRQs + */ + +#define IRQ_FSG_PCI_SLOT0 IRQ_IXP4XX_GPIO6 +#define IRQ_FSG_PCI_SLOT1 IRQ_IXP4XX_GPIO7 +#define IRQ_FSG_IDE IRQ_IXP4XX_GPIO5 + #endif