diff options
Diffstat (limited to 'arch/arm/mach-mv78xx0')
-rw-r--r-- | arch/arm/mach-mv78xx0/common.c | 1 | ||||
-rw-r--r-- | arch/arm/mach-mv78xx0/include/mach/dma.h | 1 | ||||
-rw-r--r-- | arch/arm/mach-mv78xx0/include/mach/gpio.h | 40 | ||||
-rw-r--r-- | arch/arm/mach-mv78xx0/include/mach/irqs.h | 4 | ||||
-rw-r--r-- | arch/arm/mach-mv78xx0/include/mach/memory.h | 4 | ||||
-rw-r--r-- | arch/arm/mach-mv78xx0/include/mach/mv78xx0.h | 3 | ||||
-rw-r--r-- | arch/arm/mach-mv78xx0/irq.c | 29 |
7 files changed, 71 insertions, 11 deletions
diff --git a/arch/arm/mach-mv78xx0/common.c b/arch/arm/mach-mv78xx0/common.c index 238a2f8c2d52..b0e4e0d8f506 100644 --- a/arch/arm/mach-mv78xx0/common.c +++ b/arch/arm/mach-mv78xx0/common.c | |||
@@ -167,6 +167,7 @@ void __init mv78xx0_map_io(void) | |||
167 | ****************************************************************************/ | 167 | ****************************************************************************/ |
168 | static struct orion_ehci_data mv78xx0_ehci_data = { | 168 | static struct orion_ehci_data mv78xx0_ehci_data = { |
169 | .dram = &mv78xx0_mbus_dram_info, | 169 | .dram = &mv78xx0_mbus_dram_info, |
170 | .phy_version = EHCI_PHY_NA, | ||
170 | }; | 171 | }; |
171 | 172 | ||
172 | static u64 ehci_dmamask = 0xffffffffUL; | 173 | static u64 ehci_dmamask = 0xffffffffUL; |
diff --git a/arch/arm/mach-mv78xx0/include/mach/dma.h b/arch/arm/mach-mv78xx0/include/mach/dma.h deleted file mode 100644 index 40a8c178f10d..000000000000 --- a/arch/arm/mach-mv78xx0/include/mach/dma.h +++ /dev/null | |||
@@ -1 +0,0 @@ | |||
1 | /* empty */ | ||
diff --git a/arch/arm/mach-mv78xx0/include/mach/gpio.h b/arch/arm/mach-mv78xx0/include/mach/gpio.h new file mode 100644 index 000000000000..d9d1535ea100 --- /dev/null +++ b/arch/arm/mach-mv78xx0/include/mach/gpio.h | |||
@@ -0,0 +1,40 @@ | |||
1 | /* | ||
2 | * arch/asm-arm/mach-mv78xx0/include/mach/gpio.h | ||
3 | * | ||
4 | * This file is licensed under the terms of the GNU General Public | ||
5 | * License version 2. This program is licensed "as is" without any | ||
6 | * warranty of any kind, whether express or implied. | ||
7 | */ | ||
8 | |||
9 | #ifndef __ASM_ARCH_GPIO_H | ||
10 | #define __ASM_ARCH_GPIO_H | ||
11 | |||
12 | #include <mach/irqs.h> | ||
13 | #include <plat/gpio.h> | ||
14 | #include <asm-generic/gpio.h> /* cansleep wrappers */ | ||
15 | |||
16 | extern int mv78xx0_core_index(void); | ||
17 | |||
18 | #define GPIO_MAX 32 | ||
19 | #define GPIO_OUT(pin) (DEV_BUS_VIRT_BASE + 0x0100) | ||
20 | #define GPIO_IO_CONF(pin) (DEV_BUS_VIRT_BASE + 0x0104) | ||
21 | #define GPIO_BLINK_EN(pin) (DEV_BUS_VIRT_BASE + 0x0108) | ||
22 | #define GPIO_IN_POL(pin) (DEV_BUS_VIRT_BASE + 0x010c) | ||
23 | #define GPIO_DATA_IN(pin) (DEV_BUS_VIRT_BASE + 0x0110) | ||
24 | #define GPIO_EDGE_CAUSE(pin) (DEV_BUS_VIRT_BASE + 0x0114) | ||
25 | #define GPIO_MASK_OFF (mv78xx0_core_index() ? 0x18 : 0) | ||
26 | #define GPIO_EDGE_MASK(pin) (DEV_BUS_VIRT_BASE + 0x0118 + GPIO_MASK_OFF) | ||
27 | #define GPIO_LEVEL_MASK(pin) (DEV_BUS_VIRT_BASE + 0x011c + GPIO_MASK_OFF) | ||
28 | |||
29 | static inline int gpio_to_irq(int pin) | ||
30 | { | ||
31 | return pin + IRQ_MV78XX0_GPIO_START; | ||
32 | } | ||
33 | |||
34 | static inline int irq_to_gpio(int irq) | ||
35 | { | ||
36 | return irq - IRQ_MV78XX0_GPIO_START; | ||
37 | } | ||
38 | |||
39 | |||
40 | #endif | ||
diff --git a/arch/arm/mach-mv78xx0/include/mach/irqs.h b/arch/arm/mach-mv78xx0/include/mach/irqs.h index bebc330281ec..fa1d422196c2 100644 --- a/arch/arm/mach-mv78xx0/include/mach/irqs.h +++ b/arch/arm/mach-mv78xx0/include/mach/irqs.h | |||
@@ -11,8 +11,6 @@ | |||
11 | #ifndef __ASM_ARCH_IRQS_H | 11 | #ifndef __ASM_ARCH_IRQS_H |
12 | #define __ASM_ARCH_IRQS_H | 12 | #define __ASM_ARCH_IRQS_H |
13 | 13 | ||
14 | #include "mv78xx0.h" /* need GPIO_MAX */ | ||
15 | |||
16 | /* | 14 | /* |
17 | * MV78xx0 Low Interrupt Controller | 15 | * MV78xx0 Low Interrupt Controller |
18 | */ | 16 | */ |
@@ -88,7 +86,7 @@ | |||
88 | * MV78XX0 General Purpose Pins | 86 | * MV78XX0 General Purpose Pins |
89 | */ | 87 | */ |
90 | #define IRQ_MV78XX0_GPIO_START 96 | 88 | #define IRQ_MV78XX0_GPIO_START 96 |
91 | #define NR_GPIO_IRQS GPIO_MAX | 89 | #define NR_GPIO_IRQS 32 |
92 | 90 | ||
93 | #define NR_IRQS (IRQ_MV78XX0_GPIO_START + NR_GPIO_IRQS) | 91 | #define NR_IRQS (IRQ_MV78XX0_GPIO_START + NR_GPIO_IRQS) |
94 | 92 | ||
diff --git a/arch/arm/mach-mv78xx0/include/mach/memory.h b/arch/arm/mach-mv78xx0/include/mach/memory.h index 9e47a140ff7a..e663042d307f 100644 --- a/arch/arm/mach-mv78xx0/include/mach/memory.h +++ b/arch/arm/mach-mv78xx0/include/mach/memory.h | |||
@@ -7,8 +7,4 @@ | |||
7 | 7 | ||
8 | #define PHYS_OFFSET UL(0x00000000) | 8 | #define PHYS_OFFSET UL(0x00000000) |
9 | 9 | ||
10 | #define __virt_to_bus(x) __virt_to_phys(x) | ||
11 | #define __bus_to_virt(x) __phys_to_virt(x) | ||
12 | |||
13 | |||
14 | #endif | 10 | #endif |
diff --git a/arch/arm/mach-mv78xx0/include/mach/mv78xx0.h b/arch/arm/mach-mv78xx0/include/mach/mv78xx0.h index ee9c5593ee92..e930ea5330a2 100644 --- a/arch/arm/mach-mv78xx0/include/mach/mv78xx0.h +++ b/arch/arm/mach-mv78xx0/include/mach/mv78xx0.h | |||
@@ -122,7 +122,4 @@ | |||
122 | #define SATA_PHYS_BASE (MV78XX0_REGS_PHYS_BASE | 0xa0000) | 122 | #define SATA_PHYS_BASE (MV78XX0_REGS_PHYS_BASE | 0xa0000) |
123 | 123 | ||
124 | 124 | ||
125 | #define GPIO_MAX 32 | ||
126 | |||
127 | |||
128 | #endif | 125 | #endif |
diff --git a/arch/arm/mach-mv78xx0/irq.c b/arch/arm/mach-mv78xx0/irq.c index 503e5d195ae5..e273418797b4 100644 --- a/arch/arm/mach-mv78xx0/irq.c +++ b/arch/arm/mach-mv78xx0/irq.c | |||
@@ -11,13 +11,42 @@ | |||
11 | #include <linux/kernel.h> | 11 | #include <linux/kernel.h> |
12 | #include <linux/init.h> | 12 | #include <linux/init.h> |
13 | #include <linux/pci.h> | 13 | #include <linux/pci.h> |
14 | #include <linux/irq.h> | ||
15 | #include <asm/gpio.h> | ||
14 | #include <mach/mv78xx0.h> | 16 | #include <mach/mv78xx0.h> |
15 | #include <plat/irq.h> | 17 | #include <plat/irq.h> |
16 | #include "common.h" | 18 | #include "common.h" |
17 | 19 | ||
20 | static void gpio_irq_handler(unsigned int irq, struct irq_desc *desc) | ||
21 | { | ||
22 | BUG_ON(irq < IRQ_MV78XX0_GPIO_0_7 || irq > IRQ_MV78XX0_GPIO_24_31); | ||
23 | |||
24 | orion_gpio_irq_handler((irq - IRQ_MV78XX0_GPIO_0_7) << 3); | ||
25 | } | ||
26 | |||
18 | void __init mv78xx0_init_irq(void) | 27 | void __init mv78xx0_init_irq(void) |
19 | { | 28 | { |
29 | int i; | ||
30 | |||
20 | orion_irq_init(0, (void __iomem *)(IRQ_VIRT_BASE + IRQ_MASK_LOW_OFF)); | 31 | orion_irq_init(0, (void __iomem *)(IRQ_VIRT_BASE + IRQ_MASK_LOW_OFF)); |
21 | orion_irq_init(32, (void __iomem *)(IRQ_VIRT_BASE + IRQ_MASK_HIGH_OFF)); | 32 | orion_irq_init(32, (void __iomem *)(IRQ_VIRT_BASE + IRQ_MASK_HIGH_OFF)); |
22 | orion_irq_init(64, (void __iomem *)(IRQ_VIRT_BASE + IRQ_MASK_ERR_OFF)); | 33 | orion_irq_init(64, (void __iomem *)(IRQ_VIRT_BASE + IRQ_MASK_ERR_OFF)); |
34 | |||
35 | /* | ||
36 | * Mask and clear GPIO IRQ interrupts. | ||
37 | */ | ||
38 | writel(0, GPIO_LEVEL_MASK(0)); | ||
39 | writel(0, GPIO_EDGE_MASK(0)); | ||
40 | writel(0, GPIO_EDGE_CAUSE(0)); | ||
41 | |||
42 | for (i = IRQ_MV78XX0_GPIO_START; i < NR_IRQS; i++) { | ||
43 | set_irq_chip(i, &orion_gpio_irq_level_chip); | ||
44 | set_irq_handler(i, handle_level_irq); | ||
45 | irq_desc[i].status |= IRQ_LEVEL; | ||
46 | set_irq_flags(i, IRQF_VALID); | ||
47 | } | ||
48 | set_irq_chained_handler(IRQ_MV78XX0_GPIO_0_7, gpio_irq_handler); | ||
49 | set_irq_chained_handler(IRQ_MV78XX0_GPIO_8_15, gpio_irq_handler); | ||
50 | set_irq_chained_handler(IRQ_MV78XX0_GPIO_16_23, gpio_irq_handler); | ||
51 | set_irq_chained_handler(IRQ_MV78XX0_GPIO_24_31, gpio_irq_handler); | ||
23 | } | 52 | } |