diff options
Diffstat (limited to 'arch/arm/mach-ixp23xx')
22 files changed, 2326 insertions, 0 deletions
diff --git a/arch/arm/mach-ixp23xx/Kconfig b/arch/arm/mach-ixp23xx/Kconfig new file mode 100644 index 00000000000..982670ec386 --- /dev/null +++ b/arch/arm/mach-ixp23xx/Kconfig | |||
| @@ -0,0 +1,25 @@ | |||
| 1 | if ARCH_IXP23XX | ||
| 2 | |||
| 3 | config ARCH_SUPPORTS_BIG_ENDIAN | ||
| 4 | bool | ||
| 5 | default y | ||
| 6 | |||
| 7 | menu "Intel IXP23xx Implementation Options" | ||
| 8 | |||
| 9 | comment "IXP23xx Platforms" | ||
| 10 | |||
| 11 | config MACH_ESPRESSO | ||
| 12 | bool "Support IP Fabrics Double Espresso platform" | ||
| 13 | help | ||
| 14 | |||
| 15 | config MACH_IXDP2351 | ||
| 16 | bool "Support Intel IXDP2351 platform" | ||
| 17 | help | ||
| 18 | |||
| 19 | config MACH_ROADRUNNER | ||
| 20 | bool "Support ADI RoadRunner platform" | ||
| 21 | help | ||
| 22 | |||
| 23 | endmenu | ||
| 24 | |||
| 25 | endif | ||
diff --git a/arch/arm/mach-ixp23xx/Makefile b/arch/arm/mach-ixp23xx/Makefile new file mode 100644 index 00000000000..288b371b6d0 --- /dev/null +++ b/arch/arm/mach-ixp23xx/Makefile | |||
| @@ -0,0 +1,11 @@ | |||
| 1 | # | ||
| 2 | # Makefile for the linux kernel. | ||
| 3 | # | ||
| 4 | obj-y := core.o pci.o | ||
| 5 | obj-m := | ||
| 6 | obj-n := | ||
| 7 | obj- := | ||
| 8 | |||
| 9 | obj-$(CONFIG_MACH_ESPRESSO) += espresso.o | ||
| 10 | obj-$(CONFIG_MACH_IXDP2351) += ixdp2351.o | ||
| 11 | obj-$(CONFIG_MACH_ROADRUNNER) += roadrunner.o | ||
diff --git a/arch/arm/mach-ixp23xx/Makefile.boot b/arch/arm/mach-ixp23xx/Makefile.boot new file mode 100644 index 00000000000..d5561ad15ba --- /dev/null +++ b/arch/arm/mach-ixp23xx/Makefile.boot | |||
| @@ -0,0 +1,2 @@ | |||
| 1 | zreladdr-y := 0x00008000 | ||
| 2 | params_phys-y := 0x00000100 | ||
diff --git a/arch/arm/mach-ixp23xx/core.c b/arch/arm/mach-ixp23xx/core.c new file mode 100644 index 00000000000..a1bee33d183 --- /dev/null +++ b/arch/arm/mach-ixp23xx/core.c | |||
| @@ -0,0 +1,446 @@ | |||
| 1 | /* | ||
| 2 | * arch/arm/mach-ixp23xx/core.c | ||
| 3 | * | ||
| 4 | * Core routines for IXP23xx chips | ||
| 5 | * | ||
| 6 | * Author: Deepak Saxena <dsaxena@plexity.net> | ||
| 7 | * | ||
| 8 | * Copyright 2005 (c) MontaVista Software, Inc. | ||
| 9 | * | ||
| 10 | * Based on 2.4 code Copyright 2004 (c) Intel Corporation | ||
| 11 | * | ||
| 12 | * This file is licensed under the terms of the GNU General Public | ||
| 13 | * License version 2. This program is licensed "as is" without any | ||
| 14 | * warranty of any kind, whether express or implied. | ||
| 15 | */ | ||
| 16 | |||
| 17 | #include <linux/kernel.h> | ||
| 18 | #include <linux/init.h> | ||
| 19 | #include <linux/spinlock.h> | ||
| 20 | #include <linux/sched.h> | ||
| 21 | #include <linux/interrupt.h> | ||
| 22 | #include <linux/serial.h> | ||
| 23 | #include <linux/tty.h> | ||
| 24 | #include <linux/bitops.h> | ||
| 25 | #include <linux/serial_8250.h> | ||
| 26 | #include <linux/serial_core.h> | ||
| 27 | #include <linux/device.h> | ||
| 28 | #include <linux/mm.h> | ||
| 29 | #include <linux/time.h> | ||
| 30 | #include <linux/timex.h> | ||
| 31 | |||
| 32 | #include <asm/types.h> | ||
| 33 | #include <asm/setup.h> | ||
| 34 | #include <asm/memory.h> | ||
| 35 | #include <mach/hardware.h> | ||
| 36 | #include <asm/irq.h> | ||
| 37 | #include <asm/system.h> | ||
| 38 | #include <asm/tlbflush.h> | ||
| 39 | #include <asm/pgtable.h> | ||
| 40 | |||
| 41 | #include <asm/mach/map.h> | ||
| 42 | #include <asm/mach/time.h> | ||
| 43 | #include <asm/mach/irq.h> | ||
| 44 | #include <asm/mach/arch.h> | ||
| 45 | |||
| 46 | |||
| 47 | /************************************************************************* | ||
| 48 | * Chip specific mappings shared by all IXP23xx systems | ||
| 49 | *************************************************************************/ | ||
| 50 | static struct map_desc ixp23xx_io_desc[] __initdata = { | ||
| 51 | { /* XSI-CPP CSRs */ | ||
| 52 | .virtual = IXP23XX_XSI2CPP_CSR_VIRT, | ||
| 53 | .pfn = __phys_to_pfn(IXP23XX_XSI2CPP_CSR_PHYS), | ||
| 54 | .length = IXP23XX_XSI2CPP_CSR_SIZE, | ||
| 55 | .type = MT_DEVICE, | ||
| 56 | }, { /* Expansion Bus Config */ | ||
| 57 | .virtual = IXP23XX_EXP_CFG_VIRT, | ||
| 58 | .pfn = __phys_to_pfn(IXP23XX_EXP_CFG_PHYS), | ||
| 59 | .length = IXP23XX_EXP_CFG_SIZE, | ||
| 60 | .type = MT_DEVICE, | ||
| 61 | }, { /* UART, Interrupt ctrl, GPIO, timers, NPEs, MACS,.... */ | ||
| 62 | .virtual = IXP23XX_PERIPHERAL_VIRT, | ||
| 63 | .pfn = __phys_to_pfn(IXP23XX_PERIPHERAL_PHYS), | ||
| 64 | .length = IXP23XX_PERIPHERAL_SIZE, | ||
| 65 | .type = MT_DEVICE, | ||
| 66 | }, { /* CAP CSRs */ | ||
| 67 | .virtual = IXP23XX_CAP_CSR_VIRT, | ||
| 68 | .pfn = __phys_to_pfn(IXP23XX_CAP_CSR_PHYS), | ||
| 69 | .length = IXP23XX_CAP_CSR_SIZE, | ||
| 70 | .type = MT_DEVICE, | ||
| 71 | }, { /* MSF CSRs */ | ||
| 72 | .virtual = IXP23XX_MSF_CSR_VIRT, | ||
| 73 | .pfn = __phys_to_pfn(IXP23XX_MSF_CSR_PHYS), | ||
| 74 | .length = IXP23XX_MSF_CSR_SIZE, | ||
| 75 | .type = MT_DEVICE, | ||
| 76 | }, { /* PCI I/O Space */ | ||
| 77 | .virtual = IXP23XX_PCI_IO_VIRT, | ||
| 78 | .pfn = __phys_to_pfn(IXP23XX_PCI_IO_PHYS), | ||
| 79 | .length = IXP23XX_PCI_IO_SIZE, | ||
| 80 | .type = MT_DEVICE, | ||
| 81 | }, { /* PCI Config Space */ | ||
| 82 | .virtual = IXP23XX_PCI_CFG_VIRT, | ||
| 83 | .pfn = __phys_to_pfn(IXP23XX_PCI_CFG_PHYS), | ||
| 84 | .length = IXP23XX_PCI_CFG_SIZE, | ||
| 85 | .type = MT_DEVICE, | ||
| 86 | }, { /* PCI local CFG CSRs */ | ||
| 87 | .virtual = IXP23XX_PCI_CREG_VIRT, | ||
| 88 | .pfn = __phys_to_pfn(IXP23XX_PCI_CREG_PHYS), | ||
| 89 | .length = IXP23XX_PCI_CREG_SIZE, | ||
| 90 | .type = MT_DEVICE, | ||
| 91 | }, { /* PCI MEM Space */ | ||
| 92 | .virtual = IXP23XX_PCI_MEM_VIRT, | ||
| 93 | .pfn = __phys_to_pfn(IXP23XX_PCI_MEM_PHYS), | ||
| 94 | .length = IXP23XX_PCI_MEM_SIZE, | ||
| 95 | .type = MT_DEVICE, | ||
| 96 | } | ||
| 97 | }; | ||
| 98 | |||
| 99 | void __init ixp23xx_map_io(void) | ||
| 100 | { | ||
| 101 | iotable_init(ixp23xx_io_desc, ARRAY_SIZE(ixp23xx_io_desc)); | ||
| 102 | } | ||
| 103 | |||
| 104 | |||
| 105 | /*************************************************************************** | ||
| 106 | * IXP23xx Interrupt Handling | ||
| 107 | ***************************************************************************/ | ||
| 108 | enum ixp23xx_irq_type { | ||
| 109 | IXP23XX_IRQ_LEVEL, IXP23XX_IRQ_EDGE | ||
| 110 | }; | ||
| 111 | |||
| 112 | static void ixp23xx_config_irq(unsigned int, enum ixp23xx_irq_type); | ||
| 113 | |||
| 114 | static int ixp23xx_irq_set_type(struct irq_data *d, unsigned int type) | ||
| 115 | { | ||
| 116 | int line = d->irq - IRQ_IXP23XX_GPIO6 + 6; | ||
| 117 | u32 int_style; | ||
| 118 | enum ixp23xx_irq_type irq_type; | ||
| 119 | volatile u32 *int_reg; | ||
| 120 | |||
| 121 | /* | ||
| 122 | * Only GPIOs 6-15 are wired to interrupts on IXP23xx | ||
| 123 | */ | ||
| 124 | if (line < 6 || line > 15) | ||
| 125 | return -EINVAL; | ||
| 126 | |||
| 127 | switch (type) { | ||
| 128 | case IRQ_TYPE_EDGE_BOTH: | ||
| 129 | int_style = IXP23XX_GPIO_STYLE_TRANSITIONAL; | ||
| 130 | irq_type = IXP23XX_IRQ_EDGE; | ||
| 131 | break; | ||
| 132 | case IRQ_TYPE_EDGE_RISING: | ||
| 133 | int_style = IXP23XX_GPIO_STYLE_RISING_EDGE; | ||
| 134 | irq_type = IXP23XX_IRQ_EDGE; | ||
| 135 | break; | ||
| 136 | case IRQ_TYPE_EDGE_FALLING: | ||
| 137 | int_style = IXP23XX_GPIO_STYLE_FALLING_EDGE; | ||
| 138 | irq_type = IXP23XX_IRQ_EDGE; | ||
| 139 | break; | ||
| 140 | case IRQ_TYPE_LEVEL_HIGH: | ||
| 141 | int_style = IXP23XX_GPIO_STYLE_ACTIVE_HIGH; | ||
| 142 | irq_type = IXP23XX_IRQ_LEVEL; | ||
| 143 | |||
