add support for the glan tank

svn path=/dists/sid/linux-2.6/; revision=7131
This commit is contained in:
Martin Michlmayr 2006-08-11 17:16:34 +00:00
parent a16f343666
commit 130544207f
4 changed files with 305 additions and 3 deletions

View File

@ -96,6 +96,7 @@ CONFIG_ARCH_IOP3XX=y
#
# CONFIG_ARCH_IQ80321 is not set
CONFIG_MACH_N2100=y
CONFIG_MACH_GLANTANK=y
CONFIG_ARCH_IQ31244=y
# CONFIG_ARCH_IQ80331 is not set
# CONFIG_MACH_IQ80332 is not set

7
debian/changelog vendored
View File

@ -10,9 +10,10 @@ linux-2.6 (2.6.17-6) UNRELEASED; urgency=low
* mips/mipsel: Use gcc-4.1.
* arm/ixp4xx: Update config based on the NSLU2 config.
* arm/s3c2410: Unset CONFIG_DEBUG_INFO.
* arm: xscale: don't mis-report 80219 as an iop32x
* arm: Add an MTD map for IOP3xx boards
* arm: Add support for the Thecus N2100.
* arm/iop32x: xscale: don't mis-report 80219 as an iop32x
* arm/iop32x: Add an MTD map for IOP3xx boards
* arm/iop32x: Add support for the Thecus N2100.
* arm/iop32x: Add support for the GLAN Tank.
* arm/iop32x: Add a flavour for IOP32x based machines.
[ Bastian Blank ]

299
debian/patches/arm-iop-glantank.patch vendored Normal file
View File

@ -0,0 +1,299 @@
diff -urN a/arch/arm/mach-iop3xx/Kconfig b/arch/arm/mach-iop3xx/Kconfig
--- a/arch/arm/mach-iop3xx/Kconfig 2006-08-11 16:23:02.024248000 +0000
+++ b/arch/arm/mach-iop3xx/Kconfig 2006-08-11 16:30:53.873736750 +0000
@@ -17,6 +17,13 @@
Say Y here if you want to run your kernel on the Thecus n2100
NAS appliance.
+config MACH_GLANTANK
+ bool "Enable support for the GLAN Tank"
+ help
+ Say Y here if you want to run your kernel on the GLAN Tank
+ NAS appliance or machines from IO-Data's HDL-Gxxx, HDL-GWxxx
+ and HDL-GZxxx series.
+
config ARCH_IQ31244
bool "Enable support for IQ31244"
select ARCH_IOP321
diff -urN a/arch/arm/mach-iop3xx/Makefile b/arch/arm/mach-iop3xx/Makefile
--- a/arch/arm/mach-iop3xx/Makefile 2006-08-11 16:23:02.024248000 +0000
+++ b/arch/arm/mach-iop3xx/Makefile 2006-08-11 16:31:02.574280500 +0000
@@ -24,3 +24,5 @@
obj-$(CONFIG_MACH_N2100) += n2100.o
+obj-$(CONFIG_MACH_GLANTANK) += glantank.o
+
diff -urN a/arch/arm/mach-iop3xx/glantank.c b/arch/arm/mach-iop3xx/glantank.c
--- a/arch/arm/mach-iop3xx/glantank.c 1970-01-01 00:00:00.000000000 +0000
+++ b/arch/arm/mach-iop3xx/glantank.c 2006-08-11 17:06:45.236188500 +0000
@@ -0,0 +1,203 @@
+/*
+ * arch/arm/mach-iop32x/glantank.c
+ *
+ * Board support code for the GLAN Tank.
+ *
+ * Copyright (C) 2006 Martin Michlmayr <tbm@cyrius.com>
+ * Copyright (C) 2006 Lennert Buytenhek <buytenh@wantstofly.org>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ */
+
+#include <linux/mm.h>
+#include <linux/init.h>
+#include <linux/delay.h>
+#include <linux/kernel.h>
+#include <linux/pci.h>
+#include <linux/pm.h>
+#include <linux/string.h>
+#include <linux/slab.h>
+#include <linux/serial_core.h>
+#include <linux/serial_8250.h>
+#include <linux/platform_device.h>
+#include <asm/hardware.h>
+#include <asm/io.h>
+#include <asm/irq.h>
+#include <asm/mach/arch.h>
+#include <asm/mach/map.h>
+#include <asm/mach/pci.h>
+#include <asm/mach/time.h>
+#include <asm/mach-types.h>
+#include <asm/page.h>
+
+#define INTA IRQ_IQ80321_INTA
+#define INTB IRQ_IQ80321_INTB
+#define INTC IRQ_IQ80321_INTC
+#define INTD IRQ_IQ80321_INTD
+
+/*
+ * GLAN Tank timer tick configuration.
+ */
+static void __init glantank_timer_init(void)
+{
+ /* 33.333 MHz crystal. */
+ iop3xx_init_time(200000000);
+}
+
+static struct sys_timer glantank_timer = {
+ .init = glantank_timer_init,
+ .offset = iop3xx_gettimeoffset,
+};
+
+/*
+ * GLAN Tank I/O.
+ */
+static struct map_desc glantank_io_desc[] __initdata = {
+ { /* on-board devices */
+ .virtual = GLANTANK_UART,
+ .pfn = __phys_to_pfn(GLANTANK_UART),
+ .length = 0x00100000,
+ .type = MT_DEVICE
+ },
+};
+
+void __init glantank_map_io(void)
+{
+ iop321_map_io();
+ iotable_init(glantank_io_desc, ARRAY_SIZE(glantank_io_desc));
+}
+
+
+/*
+ * GLAN Tank PCI.
+ */
+static inline int __init
+glantank_map_irq(struct pci_dev *dev, u8 idsel, u8 pin)
+{
+ static int pci_irq_table[][4] = {
+ /*
+ * PCI IDSEL/INTPIN->INTLINE
+ * A B C D
+ */
+ {INTD, INTD, INTD, INTD}, /* UART (8250) */
+ {INTA, INTA, INTA, INTA}, /* Ethernet (E1000) */
+ {INTB, INTB, INTB, INTB}, /* IDE (AEC6280R) */
+ {INTC, INTC, INTC, INTC}, /* USB (NEC) */
+ };
+
+ BUG_ON(pin < 1 || pin > 4);
+
+ return pci_irq_table[idsel%4][pin-1];
+}
+
+static int glantank_setup(int nr, struct pci_sys_data *sys)
+{
+ struct resource *res;
+
+ if(nr != 0)
+ return 0;
+
+ res = kzalloc(sizeof(struct resource) * 2, GFP_KERNEL);
+ if (!res)
+ panic("PCI: unable to alloc resources");
+
+ res[0].start = IOP321_PCI_LOWER_IO_VA;
+ res[0].end = IOP321_PCI_UPPER_IO_VA;
+ res[0].name = "GLAN Tank PCI I/O Space";
+ res[0].flags = IORESOURCE_IO;
+ request_resource(&ioport_resource, &res[0]);
+
+ res[1].start = IOP321_PCI_LOWER_MEM_PA;
+ res[1].end = IOP321_PCI_UPPER_MEM_PA;
+ res[1].name = "GLAN Tank PCI Memory Space";
+ res[1].flags = IORESOURCE_MEM;
+ request_resource(&iomem_resource, &res[1]);
+
+ sys->mem_offset = IOP321_PCI_MEM_OFFSET;
+ sys->io_offset = IOP321_PCI_IO_OFFSET;
+
+ sys->resource[0] = &res[0];
+ sys->resource[1] = &res[1];
+ sys->resource[2] = NULL;
+
+ return 1;
+}
+
+static void glantank_preinit(void)
+{
+ iop321_init();
+}
+
+static struct hw_pci glantank_pci __initdata = {
+ .swizzle = pci_std_swizzle,
+ .nr_controllers = 1,
+ .setup = glantank_setup,
+ .scan = iop321_scan_bus,
+ .preinit = glantank_preinit,
+ .map_irq = glantank_map_irq
+};
+
+static int __init glantank_pci_init(void)
+{
+ if (machine_is_glantank())
+ pci_common_init(&glantank_pci);
+
+ return 0;
+}
+
+subsys_initcall(glantank_pci_init);
+
+
+/*
+ * GLAN Tank machine initialization.
+ */
+static struct plat_serial8250_port glantank_serial_port[] = {
+ {
+ .mapbase = GLANTANK_UART,
+ .membase = (char *)GLANTANK_UART,
+ .irq = IRQ_GLANTANK_UART,
+ .flags = UPF_SKIP_TEST,
+ .iotype = UPIO_MEM,
+ .regshift = 0,
+ .uartclk = 1843200,
+ },
+ { },
+};
+
+static struct resource glantank_uart_resource = {
+ .start = GLANTANK_UART,
+ .end = GLANTANK_UART + 7,
+ .flags = IORESOURCE_MEM,
+};
+
+static struct platform_device glantank_serial_device = {
+ .name = "serial8250",
+ .id = PLAT8250_DEV_PLATFORM,
+ .dev = {
+ .platform_data = glantank_serial_port,
+ },
+ .num_resources = 1,
+ .resource = &glantank_uart_resource,
+};
+
+static void __init glantank_init_machine(void)
+{
+ iop32x_init();
+ platform_device_register(&glantank_serial_device);
+}
+
+MACHINE_START(GLANTANK, "GLAN Tank")
+ /* Maintainer: Martin Michlmayr <tbm@cyrius.com> */
+ .phys_io = GLANTANK_UART,
+ .io_pg_offst = ((GLANTANK_UART) >> 18) & 0xfffc,
+ .boot_params = 0xa0000100,
+ .map_io = glantank_map_io,
+ .init_irq = iop321_init_irq,
+ .timer = &glantank_timer,
+ .init_machine = glantank_init_machine,
+MACHINE_END
+
diff -urN a/arch/arm/mach-iop3xx/iop321-irq.c b/arch/arm/mach-iop3xx/iop321-irq.c
--- a/arch/arm/mach-iop3xx/iop321-irq.c 2006-08-11 16:23:02.024248000 +0000
+++ b/arch/arm/mach-iop3xx/iop321-irq.c 2006-08-11 16:30:21.151691750 +0000
@@ -83,6 +83,7 @@
intstr_write(0); // treat all as IRQ
if(machine_is_iq80321() ||
machine_is_iq31244() ||
+ machine_is_glantank() ||
machine_is_n2100()) // all interrupts are inputs to chip
*IOP321_PCIIRSR = 0x0f;
diff -urN a/arch/arm/mach-iop3xx/iop321-setup.c b/arch/arm/mach-iop3xx/iop321-setup.c
--- a/arch/arm/mach-iop3xx/iop321-setup.c 2006-08-11 16:23:02.024248000 +0000
+++ b/arch/arm/mach-iop3xx/iop321-setup.c 2006-08-11 17:08:00.472890500 +0000
@@ -132,7 +132,8 @@
void __init iop321_map_io(void)
{
iotable_init(iop321_std_desc, ARRAY_SIZE(iop321_std_desc));
- early_serial_setup(&iop321_serial_ports[0]);
+ if (!machine_is_glantank())
+ early_serial_setup(&iop321_serial_ports[0]);
}
#ifdef CONFIG_ARCH_IQ80321
diff -urN a/arch/arm/tools/mach-types b/arch/arm/tools/mach-types
--- a/arch/arm/tools/mach-types 2006-08-11 16:23:02.128254500 +0000
+++ b/arch/arm/tools/mach-types 2006-08-11 16:44:26.796541250 +0000
@@ -1040,4 +1040,5 @@
ai2410 MACH_AI2410 AI2410 1027
ixp465 MACH_IXP465 IXP465 1028
balloon3 MACH_BALLOON3 BALLOON3 1029
+glantank MACH_GLANTANK GLANTANK 1100
n2100 MACH_N2100 N2100 1101
diff -urN a/include/asm-arm/arch-iop3xx/glantank.h b/include/asm-arm/arch-iop3xx/glantank.h
--- a/include/asm-arm/arch-iop3xx/glantank.h 1970-01-01 00:00:00.000000000 +0000
+++ b/include/asm-arm/arch-iop3xx/glantank.h 2006-08-11 16:28:08.259386500 +0000
@@ -0,0 +1,19 @@
+/*
+ * include/asm/arch-iop32x/glantank.h
+ *
+ * GLAN Tank board registers
+ *
+ */
+
+#ifndef _GLANTANK_H_
+#define _GLANTANK_H_
+
+#define GLANTANK_FLASHBASE 0xf0000000
+#define GLANTANK_FLASHSIZE 0x00080000
+#define GLANTANK_FLASHWIDTH 2
+
+#define GLANTANK_UART 0xfe800000 /* UART #1 */
+#define IRQ_GLANTANK_UART IRQ_IOP321_XINT3
+
+#endif
+
diff -urN a/include/asm-arm/arch-iop3xx/hardware.h b/include/asm-arm/arch-iop3xx/hardware.h
--- a/include/asm-arm/arch-iop3xx/hardware.h 2006-08-11 16:23:07.888614500 +0000
+++ b/include/asm-arm/arch-iop3xx/hardware.h 2006-08-11 16:28:53.390207000 +0000
@@ -54,5 +54,6 @@
#include "iq80331.h"
#include "iq80332.h"
#include "n2100.h"
+#include "glantank.h"
#endif /* _ASM_ARCH_HARDWARE_H */

View File

@ -5,3 +5,4 @@
+ arm-iop-generic-backport.patch
+ arm-iop-mtd-maps.patch
+ arm-iop-n2100.patch
+ arm-iop-glantank.patch