diff options
author | Olof Johansson <olof@lixom.net> | 2012-09-07 20:17:07 -0700 |
---|---|---|
committer | Olof Johansson <olof@lixom.net> | 2012-09-07 20:17:07 -0700 |
commit | a4d3621e0d3ecf191961dc9214e4a378a7186780 (patch) | |
tree | f45bcda4cd1430cc2657b9763175075f52ac730d /arch/arm/mach-ks8695 | |
parent | 78a0bc3de149fd162ff3ae4bd264531ef9ad565f (diff) | |
parent | a7b8575423e0aa80e8bbc388036bc7d460b43bb4 (diff) | |
download | blackbird-op-linux-a4d3621e0d3ecf191961dc9214e4a378a7186780.tar.gz blackbird-op-linux-a4d3621e0d3ecf191961dc9214e4a378a7186780.zip |
Merge branch 'ks8695/boards' into next/boards
* ks8695/boards:
ARM: ks8695: add board support for the OpenGear boards based on the KS8695
ARM: ks8695: add board support for the SnapGear boards based on the KS8695
Diffstat (limited to 'arch/arm/mach-ks8695')
-rw-r--r-- | arch/arm/mach-ks8695/Kconfig | 61 | ||||
-rw-r--r-- | arch/arm/mach-ks8695/Makefile | 8 | ||||
-rw-r--r-- | arch/arm/mach-ks8695/board-og.c | 199 | ||||
-rw-r--r-- | arch/arm/mach-ks8695/board-sg.c | 121 |
4 files changed, 389 insertions, 0 deletions
diff --git a/arch/arm/mach-ks8695/Kconfig b/arch/arm/mach-ks8695/Kconfig index f5c39a8c2b00..a545976bdbd6 100644 --- a/arch/arm/mach-ks8695/Kconfig +++ b/arch/arm/mach-ks8695/Kconfig @@ -21,6 +21,67 @@ config MACH_ACS5K say 'Y' here if you want your kernel to run on the Brivo Systems LLC, ACS-5000 Master board. +config MACH_LITE300 + bool "SecureComputing SG300" + help + Say 'Y' here if you want your kernel to support the + SecureComputing / SnapGear SG300 VPN Internet Router. + See http://www.securecomputing.com for more details. + +config MACH_SG310 + bool "McAfee SG310" + help + Say 'Y' here if you want your kernel to support the + McAfee / SnapGear SG310 VPN Internet Router. + See http://www.mcafee.com for more details. + +config MACH_SE4200 + bool "SecureComputing SE4200" + help + Say 'Y' here if you want your kernel to support the + SecureComputing / SnapGear SE4200 Secure Wireless VPN + Internet Router. + See http://www.securecomputing.com for more details. + +config MACH_CM4002 + bool "OpenGear CM4002" + help + Say 'Y' here if you want your kernel to support the OpenGear + CM4002 Secure Access Server. See http://www.opengear.com for + more details. + +config MACH_CM4008 + bool "OpenGear CM4008" + select MIGHT_HAVE_PCI + help + Say 'Y' here if you want your kernel to support the OpenGear + CM4008 Console Server. See http://www.opengear.com for more + details. + +config MACH_CM41xx + bool "OpenGear CM41xx" + select MIGHT_HAVE_PCI + help + Say 'Y' here if you want your kernel to support the OpenGear + CM4016 or CM4048 Console Servers. See http://www.opengear.com for + more details. + +config MACH_IM4004 + bool "OpenGear IM4004" + select MIGHT_HAVE_PCI + help + Say 'Y' here if you want your kernel to support the OpenGear + IM4004 Secure Access Server. See http://www.opengear.com for + more details. + +config MACH_IM42xx + bool "OpenGear IM42xx" + select MIGHT_HAVE_PCI + help + Say 'Y' here if you want your kernel to support the OpenGear + IM4216 or IM4248 Console Servers. See http://www.opengear.com for + more details. + endmenu endif diff --git a/arch/arm/mach-ks8695/Makefile b/arch/arm/mach-ks8695/Makefile index 853efd9133c6..50980e6b1c1f 100644 --- a/arch/arm/mach-ks8695/Makefile +++ b/arch/arm/mach-ks8695/Makefile @@ -18,3 +18,11 @@ obj-$(CONFIG_LEDS) += leds.o obj-$(CONFIG_MACH_KS8695) += board-micrel.o obj-$(CONFIG_MACH_DSM320) += board-dsm320.o obj-$(CONFIG_MACH_ACS5K) += board-acs5k.o +obj-$(CONFIG_MACH_LITE300) += board-sg.o +obj-$(CONFIG_MACH_SG310) += board-sg.o +obj-$(CONFIG_MACH_SE4200) += board-sg.o +obj-$(CONFIG_MACH_CM4002) += board-og.o +obj-$(CONFIG_MACH_CM4008) += board-og.o +obj-$(CONFIG_MACH_CM41xx) += board-og.o +obj-$(CONFIG_MACH_IM4004) += board-og.o +obj-$(CONFIG_MACH_IM42xx) += board-og.o diff --git a/arch/arm/mach-ks8695/board-og.c b/arch/arm/mach-ks8695/board-og.c new file mode 100644 index 000000000000..1623ba461e47 --- /dev/null +++ b/arch/arm/mach-ks8695/board-og.c @@ -0,0 +1,199 @@ +/* + * board-og.c -- support for the OpenGear KS8695 based boards. + * + * 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 <linux/kernel.h> +#include <linux/types.h> +#include <linux/interrupt.h> +#include <linux/init.h> +#include <linux/delay.h> +#include <linux/platform_device.h> +#include <linux/serial_8250.h> +#include <linux/gpio.h> +#include <linux/irq.h> +#include <asm/mach-types.h> +#include <asm/mach/arch.h> +#include <asm/mach/map.h> +#include <mach/devices.h> +#include <mach/regs-gpio.h> +#include <mach/gpio-ks8695.h> +#include "generic.h" + +static int og_pci_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) +{ + if (machine_is_im4004() && (slot == 8)) + return KS8695_IRQ_EXTERN1; + return KS8695_IRQ_EXTERN0; +} + +static struct ks8695_pci_cfg __initdata og_pci = { + .mode = KS8695_MODE_PCI, + .map_irq = og_pci_map_irq, +}; + +static void __init og_register_pci(void) +{ + /* Initialize the GPIO lines for interrupt mode */ + ks8695_gpio_interrupt(KS8695_GPIO_0, IRQ_TYPE_LEVEL_LOW); + + /* Cardbus Slot */ + if (machine_is_im4004()) + ks8695_gpio_interrupt(KS8695_GPIO_1, IRQ_TYPE_LEVEL_LOW); + + ks8695_init_pci(&og_pci); +} + +/* + * The PCI bus reset is driven by a dedicated GPIO line. Toggle it here + * and bring the PCI bus out of reset. + */ +static void __init og_pci_bus_reset(void) +{ + unsigned int rstline = 1; + + /* Some boards use a different GPIO as the PCI reset line */ + if (machine_is_im4004()) + rstline = 2; + else if (machine_is_im42xx()) + rstline = 0; + + gpio_request(rstline, "PCI reset"); + gpio_direction_output(rstline, 0); + + /* Drive a reset on the PCI reset line */ + gpio_set_value(rstline, 1); + gpio_set_value(rstline, 0); + mdelay(100); + gpio_set_value(rstline, 1); + mdelay(100); +} + +/* + * Direct connect serial ports (non-PCI that is). + */ +#define S8250_PHYS 0x03800000 +#define S8250_VIRT 0xf4000000 +#define S8250_SIZE 0x00100000 + +static struct __initdata map_desc og_io_desc[] = { + { + .virtual = S8250_VIRT, + .pfn = __phys_to_pfn(S8250_PHYS), + .length = S8250_SIZE, + .type = MT_DEVICE, + } +}; + +static struct resource og_uart_resources[] = { + { + .start = S8250_VIRT, + .end = S8250_VIRT + S8250_SIZE, + .flags = IORESOURCE_MEM + }, +}; + +static struct plat_serial8250_port og_uart_data[] = { + { + .mapbase = S8250_VIRT, + .membase = (char *) S8250_VIRT, + .irq = 3, + .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST, + .iotype = UPIO_MEM, + .regshift = 2, + .uartclk = 115200 * 16, + }, + { }, +}; + +static struct platform_device og_uart = { + .name = "serial8250", + .id = 0, + .dev.platform_data = og_uart_data, + .num_resources = 1, + .resource = og_uart_resources +}; + +static struct platform_device *og_devices[] __initdata = { + &og_uart +}; + +static void __init og_init(void) +{ + ks8695_register_gpios(); + + if (machine_is_cm4002()) { + ks8695_gpio_interrupt(KS8695_GPIO_1, IRQ_TYPE_LEVEL_HIGH); + iotable_init(og_io_desc, ARRAY_SIZE(og_io_desc)); + platform_add_devices(og_devices, ARRAY_SIZE(og_devices)); + } else { + og_pci_bus_reset(); + og_register_pci(); + } + + ks8695_add_device_lan(); + ks8695_add_device_wan(); +} + +#ifdef CONFIG_MACH_CM4002 +MACHINE_START(CM4002, "OpenGear/CM4002") + /* OpenGear Inc. */ + .atag_offset = 0x100, + .map_io = ks8695_map_io, + .init_irq = ks8695_init_irq, + .init_machine = og_init, + .timer = &ks8695_timer, + .restart = ks8695_restart, +MACHINE_END +#endif + +#ifdef CONFIG_MACH_CM4008 +MACHINE_START(CM4008, "OpenGear/CM4008") + /* OpenGear Inc. */ + .atag_offset = 0x100, + .map_io = ks8695_map_io, + .init_irq = ks8695_init_irq, + .init_machine = og_init, + .timer = &ks8695_timer, + .restart = ks8695_restart, +MACHINE_END +#endif + +#ifdef CONFIG_MACH_CM41xx +MACHINE_START(CM41XX, "OpenGear/CM41xx") + /* OpenGear Inc. */ + .atag_offset = 0x100, + .map_io = ks8695_map_io, + .init_irq = ks8695_init_irq, + .init_machine = og_init, + .timer = &ks8695_timer, + .restart = ks8695_restart, +MACHINE_END +#endif + +#ifdef CONFIG_MACH_IM4004 +MACHINE_START(IM4004, "OpenGear/IM4004") + /* OpenGear Inc. */ + .atag_offset = 0x100, + .map_io = ks8695_map_io, + .init_irq = ks8695_init_irq, + .init_machine = og_init, + .timer = &ks8695_timer, + .restart = ks8695_restart, +MACHINE_END +#endif + +#ifdef CONFIG_MACH_IM42xx +MACHINE_START(IM42XX, "OpenGear/IM42xx") + /* OpenGear Inc. */ + .atag_offset = 0x100, + .map_io = ks8695_map_io, + .init_irq = ks8695_init_irq, + .init_machine = og_init, + .timer = &ks8695_timer, + .restart = ks8695_restart, +MACHINE_END +#endif diff --git a/arch/arm/mach-ks8695/board-sg.c b/arch/arm/mach-ks8695/board-sg.c new file mode 100644 index 000000000000..f35b98b5bf37 --- /dev/null +++ b/arch/arm/mach-ks8695/board-sg.c @@ -0,0 +1,121 @@ +/* + * board-sg.c -- support for the SnapGear KS8695 based boards + * + * 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 <linux/kernel.h> +#include <linux/types.h> +#include <linux/init.h> +#include <linux/platform_device.h> +#include <linux/mtd/mtd.h> +#include <linux/mtd/map.h> +#include <linux/mtd/physmap.h> +#include <linux/mtd/partitions.h> +#include <asm/mach-types.h> +#include <asm/mach/arch.h> +#include <mach/devices.h> +#include "generic.h" + +/* + * The SG310 machine type is fitted with a conventional 8MB Strataflash + * device. Define its partitioning. + */ +#define FL_BASE 0x02000000 +#define FL_SIZE SZ_8M + +static struct mtd_partition sg_mtd_partitions[] = { + [0] = { + .name = "SnapGear Boot Loader", + .size = SZ_128K, + }, + [1] = { + .name = "SnapGear non-volatile configuration", + .size = SZ_512K, + .offset = SZ_256K, + }, + [2] = { + .name = "SnapGear image", + .offset = SZ_512K + SZ_256K, + }, + [3] = { + .name = "SnapGear StrataFlash", + }, + [4] = { + .name = "SnapGear Boot Tags", + .size = SZ_128K, + .offset = SZ_128K, + }, +}; + +static struct physmap_flash_data sg_mtd_pdata = { + .width = 1, + .nr_parts = ARRAY_SIZE(sg_mtd_partitions), + .parts = sg_mtd_partitions, +}; + + +static struct resource sg_mtd_resource[] = { + [0] = { + .start = FL_BASE, + .end = FL_BASE + FL_SIZE - 1, + .flags = IORESOURCE_MEM, + }, +}; + +static struct platform_device sg_mtd_device = { + .name = "physmap-flash", + .id = 0, + .num_resources = ARRAY_SIZE(sg_mtd_resource), + .resource = sg_mtd_resource, + .dev = { + .platform_data = &sg_mtd_pdata, + }, +}; + +static void __init sg_init(void) +{ + ks8695_add_device_lan(); + ks8695_add_device_wan(); + + if (machine_is_sg310()) + platform_device_register(&sg_mtd_device); +} + +#ifdef CONFIG_MACH_LITE300 +MACHINE_START(LITE300, "SecureComputing/SG300") + /* SnapGear */ + .atag_offset = 0x100, + .map_io = ks8695_map_io, + .init_irq = ks8695_init_irq, + .init_machine = sg_init, + .timer = &ks8695_timer, + .restart = ks8695_restart, +MACHINE_END +#endif + +#ifdef CONFIG_MACH_SG310 +MACHINE_START(SG310, "McAfee/SG310") + /* SnapGear */ + .atag_offset = 0x100, + .map_io = ks8695_map_io, + .init_irq = ks8695_init_irq, + .init_machine = sg_init, + .timer = &ks8695_timer, + .restart = ks8695_restart, +MACHINE_END +#endif + +#ifdef CONFIG_MACH_SE4200 +MACHINE_START(SE4200, "SecureComputing/SE4200") + /* SnapGear */ + .atag_offset = 0x100, + .map_io = ks8695_map_io, + .init_irq = ks8695_init_irq, + .init_machine = sg_init, + .timer = &ks8695_timer, + .restart = ks8695_restart, +MACHINE_END +#endif |