]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
Merge branch 'imx/cleanup-for-3.6' of git://git.linaro.org/people/shawnguo/linux...
authorArnd Bergmann <arnd@arndb.de>
Fri, 6 Jul 2012 19:07:48 +0000 (21:07 +0200)
committerArnd Bergmann <arnd@arndb.de>
Fri, 6 Jul 2012 19:07:48 +0000 (21:07 +0200)
From Shawn Guo <shawn.guo@linaro.org>:

* 'imx/cleanup-for-3.6' of git://git.linaro.org/people/shawnguo/linux-2.6:
  ARM: imx6q: remove unneeded clkdev lookups

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
122 files changed:
Documentation/devicetree/bindings/arm/atmel-aic.txt
arch/arm/boot/dts/at91sam9260.dtsi
arch/arm/boot/dts/at91sam9263.dtsi
arch/arm/boot/dts/at91sam9g45.dtsi
arch/arm/boot/dts/at91sam9n12.dtsi
arch/arm/boot/dts/at91sam9x5.dtsi
arch/arm/kernel/irq.c
arch/arm/mach-at91/Kconfig
arch/arm/mach-at91/at91rm9200.c
arch/arm/mach-at91/at91rm9200_devices.c
arch/arm/mach-at91/at91sam9260.c
arch/arm/mach-at91/at91sam9260_devices.c
arch/arm/mach-at91/at91sam9261.c
arch/arm/mach-at91/at91sam9261_devices.c
arch/arm/mach-at91/at91sam9263.c
arch/arm/mach-at91/at91sam9263_devices.c
arch/arm/mach-at91/at91sam926x_time.c
arch/arm/mach-at91/at91sam9g45.c
arch/arm/mach-at91/at91sam9g45_devices.c
arch/arm/mach-at91/at91sam9rl.c
arch/arm/mach-at91/at91sam9rl_devices.c
arch/arm/mach-at91/at91sam9x5.c
arch/arm/mach-at91/at91x40.c
arch/arm/mach-at91/board-1arm.c
arch/arm/mach-at91/board-afeb-9260v1.c
arch/arm/mach-at91/board-cam60.c
arch/arm/mach-at91/board-carmeva.c
arch/arm/mach-at91/board-cpu9krea.c
arch/arm/mach-at91/board-cpuat91.c
arch/arm/mach-at91/board-csb337.c
arch/arm/mach-at91/board-csb637.c
arch/arm/mach-at91/board-dt.c
arch/arm/mach-at91/board-eb01.c
arch/arm/mach-at91/board-eb9200.c
arch/arm/mach-at91/board-ecbat91.c
arch/arm/mach-at91/board-eco920.c
arch/arm/mach-at91/board-flexibity.c
arch/arm/mach-at91/board-foxg20.c
arch/arm/mach-at91/board-gsia18s.c
arch/arm/mach-at91/board-kafa.c
arch/arm/mach-at91/board-kb9202.c
arch/arm/mach-at91/board-neocore926.c
arch/arm/mach-at91/board-pcontrol-g20.c
arch/arm/mach-at91/board-picotux200.c
arch/arm/mach-at91/board-qil-a9260.c
arch/arm/mach-at91/board-rm9200dk.c
arch/arm/mach-at91/board-rm9200ek.c
arch/arm/mach-at91/board-rsi-ews.c
arch/arm/mach-at91/board-sam9-l9260.c
arch/arm/mach-at91/board-sam9260ek.c
arch/arm/mach-at91/board-sam9261ek.c
arch/arm/mach-at91/board-sam9263ek.c
arch/arm/mach-at91/board-sam9g20ek.c
arch/arm/mach-at91/board-sam9m10g45ek.c
arch/arm/mach-at91/board-sam9rlek.c
arch/arm/mach-at91/board-snapper9260.c
arch/arm/mach-at91/board-stamp9g20.c
arch/arm/mach-at91/board-usb-a926x.c
arch/arm/mach-at91/board-yl-9200.c
arch/arm/mach-at91/generic.h
arch/arm/mach-at91/gpio.c
arch/arm/mach-at91/include/mach/at91_aic.h
arch/arm/mach-at91/include/mach/at91_spi.h [deleted file]
arch/arm/mach-at91/include/mach/at91_ssc.h [deleted file]
arch/arm/mach-at91/include/mach/entry-macro.S [deleted file]
arch/arm/mach-at91/include/mach/irqs.h [deleted file]
arch/arm/mach-at91/irq.c
arch/arm/mach-at91/pm.c
arch/arm/mach-omap1/board-ams-delta.c
arch/arm/mach-omap1/board-generic.c
arch/arm/mach-omap1/board-h2.c
arch/arm/mach-omap1/board-h3.c
arch/arm/mach-omap1/board-htcherald.c
arch/arm/mach-omap1/board-innovator.c
arch/arm/mach-omap1/board-nokia770.c
arch/arm/mach-omap1/board-osk.c
arch/arm/mach-omap1/board-palmte.c
arch/arm/mach-omap1/board-palmtt.c
arch/arm/mach-omap1/board-palmz71.c
arch/arm/mach-omap1/board-sx1.c
arch/arm/mach-omap1/board-voiceblue.c
arch/arm/mach-omap1/clock_data.c
arch/arm/mach-omap1/include/mach/usb.h [new file with mode: 0644]
arch/arm/mach-omap1/usb.c
arch/arm/mach-omap2/Kconfig
arch/arm/mach-omap2/Makefile
arch/arm/mach-omap2/board-2430sdp.c
arch/arm/mach-omap2/board-apollon.c
arch/arm/mach-omap2/board-h4.c
arch/arm/mach-omap2/clock2420_data.c
arch/arm/mach-omap2/clock2430_data.c
arch/arm/mach-omap2/clock3xxx_data.c
arch/arm/mach-omap2/clockdomain.h
arch/arm/mach-omap2/clockdomains2420_data.c
arch/arm/mach-omap2/clockdomains2430_data.c
arch/arm/mach-omap2/clockdomains3xxx_data.c
arch/arm/mach-omap2/clockdomains44xx_data.c
arch/arm/mach-omap2/clockdomains_common_data.c [deleted file]
arch/arm/mach-omap2/control.c
arch/arm/mach-omap2/control.h
arch/arm/mach-omap2/dsp.c
arch/arm/mach-omap2/include/mach/ctrl_module_core_44xx.h
arch/arm/mach-omap2/omap_hwmod.c
arch/arm/mach-omap2/omap_hwmod_2420_data.c
arch/arm/mach-omap2/omap_hwmod_2430_data.c
arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
arch/arm/mach-omap2/omap_hwmod_44xx_data.c
arch/arm/mach-omap2/usb-fs.c [deleted file]
arch/arm/plat-omap/Makefile
arch/arm/plat-omap/dma.c
arch/arm/plat-omap/include/plat/board.h
arch/arm/plat-omap/include/plat/clock.h
arch/arm/plat-omap/include/plat/dsp.h
arch/arm/plat-omap/include/plat/omap_hwmod.h
arch/arm/plat-omap/include/plat/usb.h
arch/arm/plat-omap/usb.c [deleted file]
drivers/rtc/rtc-at91rm9200.c
drivers/usb/gadget/Kconfig
drivers/usb/gadget/omap_udc.c
drivers/usb/host/Kconfig
drivers/usb/host/ohci-omap.c
drivers/usb/otg/isp1301_omap.c

index aabca4f83402198c50893724a2d3dbcfb3d221d4..19078bf5cca82b22e5aba7882d592242d924fd48 100644 (file)
@@ -4,7 +4,7 @@ Required properties:
 - compatible: Should be "atmel,<chip>-aic"
 - interrupt-controller: Identifies the node as an interrupt controller.
 - interrupt-parent: For single AIC system, it is an empty property.
-- #interrupt-cells: The number of cells to define the interrupts. It sould be 2.
+- #interrupt-cells: The number of cells to define the interrupts. It sould be 3.
   The first cell is the IRQ number (aka "Peripheral IDentifier" on datasheet).
   The second cell is used to specify flags:
     bits[3:0] trigger type and level flags:
@@ -14,7 +14,10 @@ Required properties:
       8 = active low level-sensitive.
       Valid combinations are 1, 2, 3, 4, 8.
       Default flag for internal sources should be set to 4 (active high).
+  The third cell is used to specify the irq priority from 0 (lowest) to 7
+  (highest).
 - reg: Should contain AIC registers location and length
+- atmel,external-irqs: u32 array of external irqs.
 
 Examples:
        /*
@@ -24,7 +27,7 @@ Examples:
                compatible = "atmel,at91rm9200-aic";
                interrupt-controller;
                interrupt-parent;
-               #interrupt-cells = <2>;
+               #interrupt-cells = <3>;
                reg = <0xfffff000 0x200>;
        };
 
@@ -34,5 +37,5 @@ Examples:
        dma: dma-controller@ffffec00 {
                compatible = "atmel,at91sam9g45-dma";
                reg = <0xffffec00 0x200>;
-               interrupts = <21 4>;
+               interrupts = <21 4 5>;
        };
index f449efc9825fd711d485b57318adf02b47e01f3e..66389c1c6f6297e50c8ae3b944d7311dcbb26b6c 100644 (file)
                        ranges;
 
                        aic: interrupt-controller@fffff000 {
-                               #interrupt-cells = <2>;
+                               #interrupt-cells = <3>;
                                compatible = "atmel,at91rm9200-aic";
                                interrupt-controller;
                                reg = <0xfffff000 0x200>;
+                               atmel,external-irqs = <29 30 31>;
                        };
 
                        ramc0: ramc@ffffea00 {
                        pit: timer@fffffd30 {
                                compatible = "atmel,at91sam9260-pit";
                                reg = <0xfffffd30 0xf>;
-                               interrupts = <1 4>;
+                               interrupts = <1 4 7>;
                        };
 
                        tcb0: timer@fffa0000 {
                                compatible = "atmel,at91rm9200-tcb";
                                reg = <0xfffa0000 0x100>;
-                               interrupts = <17 4 18 4 19 4>;
+                               interrupts = <17 4 0 18 4 0 19 4 0>;
                        };
 
                        tcb1: timer@fffdc000 {
                                compatible = "atmel,at91rm9200-tcb";
                                reg = <0xfffdc000 0x100>;
-                               interrupts = <26 4 27 4 28 4>;
+                               interrupts = <26 4 0 27 4 0 28 4 0>;
                        };
 
                        pioA: gpio@fffff400 {
                                compatible = "atmel,at91rm9200-gpio";
                                reg = <0xfffff400 0x100>;
-                               interrupts = <2 4>;
+                               interrupts = <2 4 1>;
                                #gpio-cells = <2>;
                                gpio-controller;
                                interrupt-controller;
                        pioB: gpio@fffff600 {
                                compatible = "atmel,at91rm9200-gpio";
                                reg = <0xfffff600 0x100>;
-                               interrupts = <3 4>;
+                               interrupts = <3 4 1>;
                                #gpio-cells = <2>;
                                gpio-controller;
                                interrupt-controller;
                        pioC: gpio@fffff800 {
                                compatible = "atmel,at91rm9200-gpio";
                                reg = <0xfffff800 0x100>;
-                               interrupts = <4 4>;
+                               interrupts = <4 4 1>;
                                #gpio-cells = <2>;
                                gpio-controller;
                                interrupt-controller;
                        dbgu: serial@fffff200 {
                                compatible = "atmel,at91sam9260-usart";
                                reg = <0xfffff200 0x200>;
-                               interrupts = <1 4>;
+                               interrupts = <1 4 7>;
                                status = "disabled";
                        };
 
                        usart0: serial@fffb0000 {
                                compatible = "atmel,at91sam9260-usart";
                                reg = <0xfffb0000 0x200>;
-                               interrupts = <6 4>;
+                               interrupts = <6 4 5>;
                                atmel,use-dma-rx;
                                atmel,use-dma-tx;
                                status = "disabled";
                        usart1: serial@fffb4000 {
                                compatible = "atmel,at91sam9260-usart";
                                reg = <0xfffb4000 0x200>;
-                               interrupts = <7 4>;
+                               interrupts = <7 4 5>;
                                atmel,use-dma-rx;
                                atmel,use-dma-tx;
                                status = "disabled";
                        usart2: serial@fffb8000 {
                                compatible = "atmel,at91sam9260-usart";
                                reg = <0xfffb8000 0x200>;
-                               interrupts = <8 4>;
+                               interrupts = <8 4 5>;
                                atmel,use-dma-rx;
                                atmel,use-dma-tx;
                                status = "disabled";
                        usart3: serial@fffd0000 {
                                compatible = "atmel,at91sam9260-usart";
                                reg = <0xfffd0000 0x200>;
-                               interrupts = <23 4>;
+                               interrupts = <23 4 5>;
                                atmel,use-dma-rx;
                                atmel,use-dma-tx;
                                status = "disabled";
                        usart4: serial@fffd4000 {
                                compatible = "atmel,at91sam9260-usart";
                                reg = <0xfffd4000 0x200>;
-                               interrupts = <24 4>;
+                               interrupts = <24 4 5>;
                                atmel,use-dma-rx;
                                atmel,use-dma-tx;
                                status = "disabled";
                        usart5: serial@fffd8000 {
                                compatible = "atmel,at91sam9260-usart";
                                reg = <0xfffd8000 0x200>;
-                               interrupts = <25 4>;
+                               interrupts = <25 4 5>;
                                atmel,use-dma-rx;
                                atmel,use-dma-tx;
                                status = "disabled";
                        macb0: ethernet@fffc4000 {
                                compatible = "cdns,at32ap7000-macb", "cdns,macb";
                                reg = <0xfffc4000 0x100>;
-                               interrupts = <21 4>;
+                               interrupts = <21 4 3>;
                                status = "disabled";
                        };
 
                        usb1: gadget@fffa4000 {
                                compatible = "atmel,at91rm9200-udc";
                                reg = <0xfffa4000 0x4000>;
-                               interrupts = <10 4>;
+                               interrupts = <10 4 2>;
                                status = "disabled";
                        };
 
                        adc0: adc@fffe0000 {
                                compatible = "atmel,at91sam9260-adc";
                                reg = <0xfffe0000 0x100>;
-                               interrupts = <5 4>;
+                               interrupts = <5 4 0>;
                                atmel,adc-use-external-triggers;
                                atmel,adc-channels-used = <0xf>;
                                atmel,adc-vref = <3300>;
                usb0: ohci@00500000 {
                        compatible = "atmel,at91rm9200-ohci", "usb-ohci";
                        reg = <0x00500000 0x100000>;
-                       interrupts = <20 4>;
+                       interrupts = <20 4 2>;
                        status = "disabled";
                };
        };
index 0209913a65a2001dafea2bacda1ce741fa227872..b460d6ce9eb592da5191871b40b2d3433156bcef 100644 (file)
                        ranges;
 
                        aic: interrupt-controller@fffff000 {
-                               #interrupt-cells = <2>;
+                               #interrupt-cells = <3>;
                                compatible = "atmel,at91rm9200-aic";
                                interrupt-controller;
                                reg = <0xfffff000 0x200>;
+                               atmel,external-irqs = <30 31>;
                        };
 
                        pmc: pmc@fffffc00 {
                        pit: timer@fffffd30 {
                                compatible = "atmel,at91sam9260-pit";
                                reg = <0xfffffd30 0xf>;
-                               interrupts = <1 4>;
+                               interrupts = <1 4 7>;
                        };
 
                        tcb0: timer@fff7c000 {
                                compatible = "atmel,at91rm9200-tcb";
                                reg = <0xfff7c000 0x100>;
-                               interrupts = <19 4>;
+                               interrupts = <19 4 0>;
                        };
 
                        rstc@fffffd00 {
@@ -90,7 +91,7 @@
                        pioA: gpio@fffff200 {
                                compatible = "atmel,at91rm9200-gpio";
                                reg = <0xfffff200 0x100>;
-                               interrupts = <2 4>;
+                               interrupts = <2 4 1>;
                                #gpio-cells = <2>;
                                gpio-controller;
                                interrupt-controller;
                        pioB: gpio@fffff400 {
                                compatible = "atmel,at91rm9200-gpio";
                                reg = <0xfffff400 0x100>;
-                               interrupts = <3 4>;
+                               interrupts = <3 4 1>;
                                #gpio-cells = <2>;
                                gpio-controller;
                                interrupt-controller;
                        pioC: gpio@fffff600 {
                                compatible = "atmel,at91rm9200-gpio";
                                reg = <0xfffff600 0x100>;
-                               interrupts = <4 4>;
+                               interrupts = <4 4 1>;
                                #gpio-cells = <2>;
                                gpio-controller;
                                interrupt-controller;
                        pioD: gpio@fffff800 {
                                compatible = "atmel,at91rm9200-gpio";
                                reg = <0xfffff800 0x100>;
-                               interrupts = <4 4>;
+                               interrupts = <4 4 1>;
                                #gpio-cells = <2>;
                                gpio-controller;
                                interrupt-controller;
                        pioE: gpio@fffffa00 {
                                compatible = "atmel,at91rm9200-gpio";
                                reg = <0xfffffa00 0x100>;
-                               interrupts = <4 4>;
+                               interrupts = <4 4 1>;
                                #gpio-cells = <2>;
                                gpio-controller;
                                interrupt-controller;
                        dbgu: serial@ffffee00 {
                                compatible = "atmel,at91sam9260-usart";
                                reg = <0xffffee00 0x200>;
-                               interrupts = <1 4>;
+                               interrupts = <1 4 7>;
                                status = "disabled";
                        };
 
                        usart0: serial@fff8c000 {
                                compatible = "atmel,at91sam9260-usart";
                                reg = <0xfff8c000 0x200>;
-                               interrupts = <7 4>;
+                               interrupts = <7 4 5>;
                                atmel,use-dma-rx;
                                atmel,use-dma-tx;
                                status = "disabled";
                        usart1: serial@fff90000 {
                                compatible = "atmel,at91sam9260-usart";
                                reg = <0xfff90000 0x200>;
-                               interrupts = <8 4>;
+                               interrupts = <8 4 5>;
                                atmel,use-dma-rx;
                                atmel,use-dma-tx;
                                status = "disabled";
                        usart2: serial@fff94000 {
                                compatible = "atmel,at91sam9260-usart";
                                reg = <0xfff94000 0x200>;
-                               interrupts = <9 4>;
+                               interrupts = <9 4 5>;
                                atmel,use-dma-rx;
                                atmel,use-dma-tx;
                                status = "disabled";
                        macb0: ethernet@fffbc000 {
                                compatible = "cdns,at32ap7000-macb", "cdns,macb";
                                reg = <0xfffbc000 0x100>;
-                               interrupts = <21 4>;
+                               interrupts = <21 4 3>;
                                status = "disabled";
                        };
 
                        usb1: gadget@fff78000 {
                                compatible = "atmel,at91rm9200-udc";
                                reg = <0xfff78000 0x4000>;
-                               interrupts = <24 4>;
+                               interrupts = <24 4 2>;
                                status = "disabled";
                        };
                };
                usb0: ohci@00a00000 {
                        compatible = "atmel,at91rm9200-ohci", "usb-ohci";
                        reg = <0x00a00000 0x100000>;
-                       interrupts = <29 4>;
+                       interrupts = <29 4 2>;
                        status = "disabled";
                };
        };
index 7dbccaf199f7e0844bdeb3ee8cf789d8543f0a6f..bafa8806fc17293e3bddc28aff5b4829f677c178 100644 (file)
                        ranges;
 
                        aic: interrupt-controller@fffff000 {
-                               #interrupt-cells = <2>;
+                               #interrupt-cells = <3>;
                                compatible = "atmel,at91rm9200-aic";
                                interrupt-controller;
                                reg = <0xfffff000 0x200>;
+                               atmel,external-irqs = <31>;
                        };
 
                        ramc0: ramc@ffffe400 {
@@ -78,7 +79,7 @@
                        pit: timer@fffffd30 {
                                compatible = "atmel,at91sam9260-pit";
                                reg = <0xfffffd30 0xf>;
-                               interrupts = <1 4>;
+                               interrupts = <1 4 7>;
                        };
 
 
                        tcb0: timer@fff7c000 {
                                compatible = "atmel,at91rm9200-tcb";
                                reg = <0xfff7c000 0x100>;
-                               interrupts = <18 4>;
+                               interrupts = <18 4 0>;
                        };
 
                        tcb1: timer@fffd4000 {
                                compatible = "atmel,at91rm9200-tcb";
                                reg = <0xfffd4000 0x100>;
-                               interrupts = <18 4>;
+                               interrupts = <18 4 0>;
                        };
 
                        dma: dma-controller@ffffec00 {
                                compatible = "atmel,at91sam9g45-dma";
                                reg = <0xffffec00 0x200>;
-                               interrupts = <21 4>;
+                               interrupts = <21 4 0>;
                        };
 
                        pioA: gpio@fffff200 {
                                compatible = "atmel,at91rm9200-gpio";
                                reg = <0xfffff200 0x100>;
-                               interrupts = <2 4>;
+                               interrupts = <2 4 1>;
                                #gpio-cells = <2>;
                                gpio-controller;
                                interrupt-controller;
                        pioB: gpio@fffff400 {
                                compatible = "atmel,at91rm9200-gpio";
                                reg = <0xfffff400 0x100>;
-                               interrupts = <3 4>;
+                               interrupts = <3 4 1>;
                                #gpio-cells = <2>;
                                gpio-controller;
                                interrupt-controller;
                        pioC: gpio@fffff600 {
                                compatible = "atmel,at91rm9200-gpio";
                                reg = <0xfffff600 0x100>;
-                               interrupts = <4 4>;
+                               interrupts = <4 4 1>;
                                #gpio-cells = <2>;
                                gpio-controller;
                                interrupt-controller;
                        pioD: gpio@fffff800 {
                                compatible = "atmel,at91rm9200-gpio";
                                reg = <0xfffff800 0x100>;
-                               interrupts = <5 4>;
+                               interrupts = <5 4 1>;
                                #gpio-cells = <2>;
                                gpio-controller;
                                interrupt-controller;
                        pioE: gpio@fffffa00 {
                                compatible = "atmel,at91rm9200-gpio";
                                reg = <0xfffffa00 0x100>;
-                               interrupts = <5 4>;
+                               interrupts = <5 4 1>;
                                #gpio-cells = <2>;
                                gpio-controller;
                                interrupt-controller;
                        dbgu: serial@ffffee00 {
                                compatible = "atmel,at91sam9260-usart";
                                reg = <0xffffee00 0x200>;
-                               interrupts = <1 4>;
+                               interrupts = <1 4 7>;
                                status = "disabled";
                        };
 
                        usart0: serial@fff8c000 {
                                compatible = "atmel,at91sam9260-usart";
                                reg = <0xfff8c000 0x200>;
-                               interrupts = <7 4>;
+                               interrupts = <7 4 5>;
                                atmel,use-dma-rx;
                                atmel,use-dma-tx;
                                status = "disabled";
                        usart1: serial@fff90000 {
                                compatible = "atmel,at91sam9260-usart";
                                reg = <0xfff90000 0x200>;
-                               interrupts = <8 4>;
+                               interrupts = <8 4 5>;
                                atmel,use-dma-rx;
                                atmel,use-dma-tx;
                                status = "disabled";
                        usart2: serial@fff94000 {
                                compatible = "atmel,at91sam9260-usart";
                                reg = <0xfff94000 0x200>;
-                               interrupts = <9 4>;
+                               interrupts = <9 4 5>;
                                atmel,use-dma-rx;
                                atmel,use-dma-tx;
                                status = "disabled";
                        usart3: serial@fff98000 {
                                compatible = "atmel,at91sam9260-usart";
                                reg = <0xfff98000 0x200>;
-                               interrupts = <10 4>;
+                               interrupts = <10 4 5>;
                                atmel,use-dma-rx;
                                atmel,use-dma-tx;
                                status = "disabled";
                        macb0: ethernet@fffbc000 {
                                compatible = "cdns,at32ap7000-macb", "cdns,macb";
                                reg = <0xfffbc000 0x100>;
-                               interrupts = <25 4>;
+                               interrupts = <25 4 3>;
                                status = "disabled";
                        };
 
                        adc0: adc@fffb0000 {
                                compatible = "atmel,at91sam9260-adc";
                                reg = <0xfffb0000 0x100>;
-                               interrupts = <20 4>;
+                               interrupts = <20 4 0>;
                                atmel,adc-use-external-triggers;
                                atmel,adc-channels-used = <0xff>;
                                atmel,adc-vref = <3300>;
                usb0: ohci@00700000 {
                        compatible = "atmel,at91rm9200-ohci", "usb-ohci";
                        reg = <0x00700000 0x100000>;
-                       interrupts = <22 4>;
+                       interrupts = <22 4 2>;
                        status = "disabled";
                };
 
                usb1: ehci@00800000 {
                        compatible = "atmel,at91sam9g45-ehci", "usb-ehci";
                        reg = <0x00800000 0x100000>;
-                       interrupts = <22 4>;
+                       interrupts = <22 4 2>;
                        status = "disabled";
                };
        };
index cb84de791b5ab9906e66e9664fcc80b4ae314b6e..bfac0dfc332c7d10bc3fe2f87458ec728c48b885 100644 (file)
@@ -50,7 +50,7 @@
                        ranges;
 
                        aic: interrupt-controller@fffff000 {
-                               #interrupt-cells = <2>;
+                               #interrupt-cells = <3>;
                                compatible = "atmel,at91rm9200-aic";
                                interrupt-controller;
                                reg = <0xfffff000 0x200>;
@@ -74,7 +74,7 @@
                        pit: timer@fffffe30 {
                                compatible = "atmel,at91sam9260-pit";
                                reg = <0xfffffe30 0xf>;
-                               interrupts = <1 4>;
+                               interrupts = <1 4 7>;
                        };
 
                        shdwc@fffffe10 {
                        tcb0: timer@f8008000 {
                                compatible = "atmel,at91sam9x5-tcb";
                                reg = <0xf8008000 0x100>;
-                               interrupts = <17 4>;
+                               interrupts = <17 4 0>;
                        };
 
                        tcb1: timer@f800c000 {
                                compatible = "atmel,at91sam9x5-tcb";
                                reg = <0xf800c000 0x100>;
-                               interrupts = <17 4>;
+                               interrupts = <17 4 0>;
                        };
 
                        dma: dma-controller@ffffec00 {
                                compatible = "atmel,at91sam9g45-dma";
                                reg = <0xffffec00 0x200>;
-                               interrupts = <20 4>;
+                               interrupts = <20 4 0>;
                        };
 
                        pioA: gpio@fffff400 {
                                compatible = "atmel,at91sam9x5-gpio", "atmel,at91rm9200-gpio";
                                reg = <0xfffff400 0x100>;
-                               interrupts = <2 4>;
+                               interrupts = <2 4 1>;
                                #gpio-cells = <2>;
                                gpio-controller;
                                interrupt-controller;
                        pioB: gpio@fffff600 {
                                compatible = "atmel,at91sam9x5-gpio", "atmel,at91rm9200-gpio";
                                reg = <0xfffff600 0x100>;
-                               interrupts = <2 4>;
+                               interrupts = <2 4 1>;
                                #gpio-cells = <2>;
                                gpio-controller;
                                interrupt-controller;
                        pioC: gpio@fffff800 {
                                compatible = "atmel,at91sam9x5-gpio", "atmel,at91rm9200-gpio";
                                reg = <0xfffff800 0x100>;
-                               interrupts = <3 4>;
+                               interrupts = <3 4 1>;
                                #gpio-cells = <2>;
                                gpio-controller;
                                interrupt-controller;
                        pioD: gpio@fffffa00 {
                                compatible = "atmel,at91sam9x5-gpio", "atmel,at91rm9200-gpio";
                                reg = <0xfffffa00 0x100>;
-                               interrupts = <3 4>;
+                               interrupts = <3 4 1>;
                                #gpio-cells = <2>;
                                gpio-controller;
                                interrupt-controller;
                        dbgu: serial@fffff200 {
                                compatible = "atmel,at91sam9260-usart";
                                reg = <0xfffff200 0x200>;
-                               interrupts = <1 4>;
+                               interrupts = <1 4 7>;
                                status = "disabled";
                        };
 
                        usart0: serial@f801c000 {
                                compatible = "atmel,at91sam9260-usart";
                                reg = <0xf801c000 0x4000>;
-                               interrupts = <5 4>;
+                               interrupts = <5 4 5>;
                                atmel,use-dma-rx;
                                atmel,use-dma-tx;
                                status = "disabled";
                        usart1: serial@f8020000 {
                                compatible = "atmel,at91sam9260-usart";
                                reg = <0xf8020000 0x4000>;
-                               interrupts = <6 4>;
+                               interrupts = <6 4 5>;
                                atmel,use-dma-rx;
                                atmel,use-dma-tx;
                                status = "disabled";
                        usart2: serial@f8024000 {
                                compatible = "atmel,at91sam9260-usart";
                                reg = <0xf8024000 0x4000>;
-                               interrupts = <7 4>;
+                               interrupts = <7 4 5>;
                                atmel,use-dma-rx;
                                atmel,use-dma-tx;
                                status = "disabled";
                        usart3: serial@f8028000 {
                                compatible = "atmel,at91sam9260-usart";
                                reg = <0xf8028000 0x4000>;
-                               interrupts = <8 4>;
+                               interrupts = <8 4 5>;
                                atmel,use-dma-rx;
                                atmel,use-dma-tx;
                                status = "disabled";
                usb0: ohci@00500000 {
                        compatible = "atmel,at91rm9200-ohci", "usb-ohci";
                        reg = <0x00500000 0x00100000>;
-                       interrupts = <22 4>;
+                       interrupts = <22 4 2>;
                        status = "disabled";
                };
        };
index 6b3ef4339ae7030eff85882a89f04d29ea346c21..4a18c393b1360f490c9796f3c598d349338ed2f5 100644 (file)
                        ranges;
 
                        aic: interrupt-controller@fffff000 {
-                               #interrupt-cells = <2>;
+                               #interrupt-cells = <3>;
                                compatible = "atmel,at91rm9200-aic";
                                interrupt-controller;
                                reg = <0xfffff000 0x200>;
+                               atmel,external-irqs = <31>;
                        };
 
                        ramc0: ramc@ffffe800 {
                        pit: timer@fffffe30 {
                                compatible = "atmel,at91sam9260-pit";
                                reg = <0xfffffe30 0xf>;
-                               interrupts = <1 4>;
+                               interrupts = <1 4 7>;
                        };
 
                        tcb0: timer@f8008000 {
                                compatible = "atmel,at91sam9x5-tcb";
                                reg = <0xf8008000 0x100>;
-                               interrupts = <17 4>;
+                               interrupts = <17 4 0>;
                        };
 
                        tcb1: timer@f800c000 {
                                compatible = "atmel,at91sam9x5-tcb";
                                reg = <0xf800c000 0x100>;
-                               interrupts = <17 4>;
+                               interrupts = <17 4 0>;
                        };
 
                        dma0: dma-controller@ffffec00 {
                                compatible = "atmel,at91sam9g45-dma";
                                reg = <0xffffec00 0x200>;
-                               interrupts = <20 4>;
+                               interrupts = <20 4 0>;
                        };
 
                        dma1: dma-controller@ffffee00 {
                                compatible = "atmel,at91sam9g45-dma";
                                reg = <0xffffee00 0x200>;
-                               interrupts = <21 4>;
+                               interrupts = <21 4 0>;
                        };
 
                        pioA: gpio@fffff400 {
                                compatible = "atmel,at91sam9x5-gpio", "atmel,at91rm9200-gpio";
                                reg = <0xfffff400 0x100>;
-                               interrupts = <2 4>;
+                               interrupts = <2 4 1>;
                                #gpio-cells = <2>;
                                gpio-controller;
                                interrupt-controller;
                        pioB: gpio@fffff600 {
                                compatible = "atmel,at91sam9x5-gpio", "atmel,at91rm9200-gpio";
                                reg = <0xfffff600 0x100>;
-                               interrupts = <2 4>;
+                               interrupts = <2 4 1>;
                                #gpio-cells = <2>;
                                gpio-controller;
                                interrupt-controller;
                        pioC: gpio@fffff800 {
                                compatible = "atmel,at91sam9x5-gpio", "atmel,at91rm9200-gpio";
                                reg = <0xfffff800 0x100>;
-                               interrupts = <3 4>;
+                               interrupts = <3 4 1>;
                                #gpio-cells = <2>;
                                gpio-controller;
                                interrupt-controller;
                        pioD: gpio@fffffa00 {
                                compatible = "atmel,at91sam9x5-gpio", "atmel,at91rm9200-gpio";
                                reg = <0xfffffa00 0x100>;
-                               interrupts = <3 4>;
+                               interrupts = <3 4 1>;
                                #gpio-cells = <2>;
                                gpio-controller;
                                interrupt-controller;
                        dbgu: serial@fffff200 {
                                compatible = "atmel,at91sam9260-usart";
                                reg = <0xfffff200 0x200>;
-                               interrupts = <1 4>;
+                               interrupts = <1 4 7>;
                                status = "disabled";
                        };
 
                        usart0: serial@f801c000 {
                                compatible = "atmel,at91sam9260-usart";
                                reg = <0xf801c000 0x200>;
-                               interrupts = <5 4>;
+                               interrupts = <5 4 5>;
                                atmel,use-dma-rx;
                                atmel,use-dma-tx;
                                status = "disabled";
                        usart1: serial@f8020000 {
                                compatible = "atmel,at91sam9260-usart";
                                reg = <0xf8020000 0x200>;
-                               interrupts = <6 4>;
+                               interrupts = <6 4 5>;
                                atmel,use-dma-rx;
                                atmel,use-dma-tx;
                                status = "disabled";
                        usart2: serial@f8024000 {
                                compatible = "atmel,at91sam9260-usart";
                                reg = <0xf8024000 0x200>;
-                               interrupts = <7 4>;
+                               interrupts = <7 4 5>;
                                atmel,use-dma-rx;
                                atmel,use-dma-tx;
                                status = "disabled";
                        macb0: ethernet@f802c000 {
                                compatible = "cdns,at32ap7000-macb", "cdns,macb";
                                reg = <0xf802c000 0x100>;
-                               interrupts = <24 4>;
+                               interrupts = <24 4 3>;
                                status = "disabled";
                        };
 
                        macb1: ethernet@f8030000 {
                                compatible = "cdns,at32ap7000-macb", "cdns,macb";
                                reg = <0xf8030000 0x100>;
-                               interrupts = <27 4>;
+                               interrupts = <27 4 3>;
                                status = "disabled";
                        };
 
                        adc0: adc@f804c000 {
                                compatible = "atmel,at91sam9260-adc";
                                reg = <0xf804c000 0x100>;
-                               interrupts = <19 4>;
+                               interrupts = <19 4 0>;
                                atmel,adc-use-external;
                                atmel,adc-channels-used = <0xffff>;
                                atmel,adc-vref = <3300>;
                usb0: ohci@00600000 {
                        compatible = "atmel,at91rm9200-ohci", "usb-ohci";
                        reg = <0x00600000 0x100000>;
-                       interrupts = <22 4>;
+                       interrupts = <22 4 2>;
                        status = "disabled";
                };
 
                usb1: ehci@00700000 {
                        compatible = "atmel,at91sam9g45-ehci", "usb-ehci";
                        reg = <0x00700000 0x100000>;
-                       interrupts = <22 4>;
+                       interrupts = <22 4 2>;
                        status = "disabled";
                };
        };
index 8349d4e97e2b8b9b7bb5672b2cf974c2cdb74fd0..16cedb42c0c39c0169008e45488b279cd9b32821 100644 (file)
 #include <asm/mach/irq.h>
 #include <asm/mach/time.h>
 
-/*
- * No architecture-specific irq_finish function defined in arm/arch/irqs.h.
- */
-#ifndef irq_finish
-#define irq_finish(irq) do { } while (0)
-#endif
-
 unsigned long irq_err_count;
 
 int arch_show_interrupts(struct seq_file *p, int prec)
@@ -85,9 +78,6 @@ void handle_IRQ(unsigned int irq, struct pt_regs *regs)
                generic_handle_irq(irq);
        }
 
-       /* AT91 specific workaround */
-       irq_finish(irq);
-
        irq_exit();
        set_irq_regs(old_regs);
 }
index 19505c0a3f018225dcdc4935e089024e8d03d670..c8050b14e615ef0df3adbee08598b7aaf30a60ff 100644 (file)
@@ -29,12 +29,16 @@ comment "Atmel AT91 Processor"
 config SOC_AT91SAM9
        bool
        select CPU_ARM926T
+       select MULTI_IRQ_HANDLER
+       select SPARSE_IRQ
        select AT91_SAM9_TIME
        select AT91_SAM9_SMC
 
 config SOC_AT91RM9200
        bool "AT91RM9200"
        select CPU_ARM920T
+       select MULTI_IRQ_HANDLER
+       select SPARSE_IRQ
        select GENERIC_CLOCKEVENTS
        select HAVE_AT91_DBGU0
 
@@ -140,6 +144,8 @@ config ARCH_AT91SAM9G45
 config ARCH_AT91X40
        bool "AT91x40"
        depends on !MMU
+       select MULTI_IRQ_HANDLER
+       select SPARSE_IRQ
        select ARCH_USES_GETTIMEOFFSET
 
 endchoice
index 26917687fc30fd6b981181b79d8d338719d95305..6f50c6722276dcc73f8607b51132bfe40dd077b9 100644 (file)
@@ -17,6 +17,7 @@
 #include <asm/mach/map.h>
 #include <asm/system_misc.h>
 #include <mach/at91rm9200.h>
+#include <mach/at91_aic.h>
 #include <mach/at91_pmc.h>
 #include <mach/at91_st.h>
 #include <mach/cpu.h>
index e6b7d0533dd75dad4f6cee4f3458a2a6ddda6581..01fb7325fecce0ef9a015835ff846655b3b4af11 100644 (file)
@@ -41,8 +41,8 @@ static struct resource usbh_resources[] = {
                .flags  = IORESOURCE_MEM,
        },
        [1] = {
-               .start  = AT91RM9200_ID_UHP,
-               .end    = AT91RM9200_ID_UHP,
+               .start  = NR_IRQS_LEGACY + AT91RM9200_ID_UHP,
+               .end    = NR_IRQS_LEGACY + AT91RM9200_ID_UHP,
                .flags  = IORESOURCE_IRQ,
        },
 };
@@ -94,8 +94,8 @@ static struct resource udc_resources[] = {
                .flags  = IORESOURCE_MEM,
        },
        [1] = {
-               .start  = AT91RM9200_ID_UDP,
-               .end    = AT91RM9200_ID_UDP,
+               .start  = NR_IRQS_LEGACY + AT91RM9200_ID_UDP,
+               .end    = NR_IRQS_LEGACY + AT91RM9200_ID_UDP,
                .flags  = IORESOURCE_IRQ,
        },
 };
@@ -145,8 +145,8 @@ static struct resource eth_resources[] = {
                .flags  = IORESOURCE_MEM,
        },
        [1] = {
-               .start  = AT91RM9200_ID_EMAC,
-               .end    = AT91RM9200_ID_EMAC,
+               .start  = NR_IRQS_LEGACY + AT91RM9200_ID_EMAC,
+               .end    = NR_IRQS_LEGACY + AT91RM9200_ID_EMAC,
                .flags  = IORESOURCE_IRQ,
        },
 };
@@ -305,8 +305,8 @@ static struct resource mmc_resources[] = {
                .flags  = IORESOURCE_MEM,
        },
        [1] = {
-               .start  = AT91RM9200_ID_MCI,
-               .end    = AT91RM9200_ID_MCI,
+               .start  = NR_IRQS_LEGACY + AT91RM9200_ID_MCI,
+               .end    = NR_IRQS_LEGACY + AT91RM9200_ID_MCI,
                .flags  = IORESOURCE_IRQ,
        },
 };
@@ -488,8 +488,8 @@ static struct resource twi_resources[] = {
                .flags  = IORESOURCE_MEM,
        },
        [1] = {
-               .start  = AT91RM9200_ID_TWI,
-               .end    = AT91RM9200_ID_TWI,
+               .start  = NR_IRQS_LEGACY + AT91RM9200_ID_TWI,
+               .end    = NR_IRQS_LEGACY + AT91RM9200_ID_TWI,
                .flags  = IORESOURCE_IRQ,
        },
 };
@@ -532,8 +532,8 @@ static struct resource spi_resources[] = {
                .flags  = IORESOURCE_MEM,
        },
        [1] = {
-               .start  = AT91RM9200_ID_SPI,
-               .end    = AT91RM9200_ID_SPI,
+               .start  = NR_IRQS_LEGACY + AT91RM9200_ID_SPI,
+               .end    = NR_IRQS_LEGACY + AT91RM9200_ID_SPI,
                .flags  = IORESOURCE_IRQ,
        },
 };
@@ -598,18 +598,18 @@ static struct resource tcb0_resources[] = {
                .flags  = IORESOURCE_MEM,
        },
        [1] = {
-               .start  = AT91RM9200_ID_TC0,
-               .end    = AT91RM9200_ID_TC0,
+               .start  = NR_IRQS_LEGACY + AT91RM9200_ID_TC0,
+               .end    = NR_IRQS_LEGACY + AT91RM9200_ID_TC0,
                .flags  = IORESOURCE_IRQ,
        },
        [2] = {
-               .start  = AT91RM9200_ID_TC1,
-               .end    = AT91RM9200_ID_TC1,
+               .start  = NR_IRQS_LEGACY + AT91RM9200_ID_TC1,
+               .end    = NR_IRQS_LEGACY + AT91RM9200_ID_TC1,
                .flags  = IORESOURCE_IRQ,
        },
        [3] = {
-               .start  = AT91RM9200_ID_TC2,
-               .end    = AT91RM9200_ID_TC2,
+               .start  = NR_IRQS_LEGACY + AT91RM9200_ID_TC2,
+               .end    = NR_IRQS_LEGACY + AT91RM9200_ID_TC2,
                .flags  = IORESOURCE_IRQ,
        },
 };
@@ -628,18 +628,18 @@ static struct resource tcb1_resources[] = {
                .flags  = IORESOURCE_MEM,
        },
        [1] = {
-               .start  = AT91RM9200_ID_TC3,
-               .end    = AT91RM9200_ID_TC3,
+               .start  = NR_IRQS_LEGACY + AT91RM9200_ID_TC3,
+               .end    = NR_IRQS_LEGACY + AT91RM9200_ID_TC3,
                .flags  = IORESOURCE_IRQ,
        },
        [2] = {
-               .start  = AT91RM9200_ID_TC4,
-               .end    = AT91RM9200_ID_TC4,
+               .start  = NR_IRQS_LEGACY + AT91RM9200_ID_TC4,
+               .end    = NR_IRQS_LEGACY + AT91RM9200_ID_TC4,
                .flags  = IORESOURCE_IRQ,
        },
        [3] = {
-               .start  = AT91RM9200_ID_TC5,
-               .end    = AT91RM9200_ID_TC5,
+               .start  = NR_IRQS_LEGACY + AT91RM9200_ID_TC5,
+               .end    = NR_IRQS_LEGACY + AT91RM9200_ID_TC5,
                .flags  = IORESOURCE_IRQ,
        },
 };
@@ -673,8 +673,8 @@ static struct resource rtc_resources[] = {
                .flags  = IORESOURCE_MEM,
        },
        [1] = {
-               .start  = AT91_ID_SYS,
-               .end    = AT91_ID_SYS,
+               .start  = NR_IRQS_LEGACY + AT91_ID_SYS,
+               .end    = NR_IRQS_LEGACY + AT91_ID_SYS,
                .flags  = IORESOURCE_IRQ,
        },
 };
@@ -729,8 +729,8 @@ static struct resource ssc0_resources[] = {
                .flags  = IORESOURCE_MEM,
        },
        [1] = {
-               .start  = AT91RM9200_ID_SSC0,
-               .end    = AT91RM9200_ID_SSC0,
+               .start  = NR_IRQS_LEGACY + AT91RM9200_ID_SSC0,
+               .end    = NR_IRQS_LEGACY + AT91RM9200_ID_SSC0,
                .flags  = IORESOURCE_IRQ,
        },
 };
@@ -771,8 +771,8 @@ static struct resource ssc1_resources[] = {
                .flags  = IORESOURCE_MEM,
        },
        [1] = {
-               .start  = AT91RM9200_ID_SSC1,
-               .end    = AT91RM9200_ID_SSC1,
+               .start  = NR_IRQS_LEGACY + AT91RM9200_ID_SSC1,
+               .end    = NR_IRQS_LEGACY + AT91RM9200_ID_SSC1,
                .flags  = IORESOURCE_IRQ,
        },
 };
@@ -813,8 +813,8 @@ static struct resource ssc2_resources[] = {
                .flags  = IORESOURCE_MEM,
        },
        [1] = {
-               .start  = AT91RM9200_ID_SSC2,
-               .end    = AT91RM9200_ID_SSC2,
+               .start  = NR_IRQS_LEGACY + AT91RM9200_ID_SSC2,
+               .end    = NR_IRQS_LEGACY + AT91RM9200_ID_SSC2,
                .flags  = IORESOURCE_IRQ,
        },
 };
@@ -897,8 +897,8 @@ static struct resource dbgu_resources[] = {
                .flags  = IORESOURCE_MEM,
        },
        [1] = {
-               .start  = AT91_ID_SYS,
-               .end    = AT91_ID_SYS,
+               .start  = NR_IRQS_LEGACY + AT91_ID_SYS,
+               .end    = NR_IRQS_LEGACY + AT91_ID_SYS,
                .flags  = IORESOURCE_IRQ,
        },
 };
@@ -935,8 +935,8 @@ static struct resource uart0_resources[] = {
                .flags  = IORESOURCE_MEM,
        },
        [1] = {
-               .start  = AT91RM9200_ID_US0,
-               .end    = AT91RM9200_ID_US0,
+               .start  = NR_IRQS_LEGACY + AT91RM9200_ID_US0,
+               .end    = NR_IRQS_LEGACY + AT91RM9200_ID_US0,
                .flags  = IORESOURCE_IRQ,
        },
 };
@@ -984,8 +984,8 @@ static struct resource uart1_resources[] = {
                .flags  = IORESOURCE_MEM,
        },
        [1] = {
-               .start  = AT91RM9200_ID_US1,
-               .end    = AT91RM9200_ID_US1,
+               .start  = NR_IRQS_LEGACY + AT91RM9200_ID_US1,
+               .end    = NR_IRQS_LEGACY + AT91RM9200_ID_US1,
                .flags  = IORESOURCE_IRQ,
        },
 };
@@ -1035,8 +1035,8 @@ static struct resource uart2_resources[] = {
                .flags  = IORESOURCE_MEM,
        },
        [1] = {
-               .start  = AT91RM9200_ID_US2,
-               .end    = AT91RM9200_ID_US2,
+               .start  = NR_IRQS_LEGACY + AT91RM9200_ID_US2,
+               .end    = NR_IRQS_LEGACY + AT91RM9200_ID_US2,
                .flags  = IORESOURCE_IRQ,
        },
 };
@@ -1078,8 +1078,8 @@ static struct resource uart3_resources[] = {
                .flags  = IORESOURCE_MEM,
        },
        [1] = {
-               .start  = AT91RM9200_ID_US3,
-               .end    = AT91RM9200_ID_US3,
+               .start  = NR_IRQS_LEGACY + AT91RM9200_ID_US3,
+               .end    = NR_IRQS_LEGACY + AT91RM9200_ID_US3,
                .flags  = IORESOURCE_IRQ,
        },
 };
index 2b1e438ed87869320362678421486dc0caa058fd..30c7f26a4668c34e3739955a782ef3ec2befb978 100644 (file)
@@ -20,6 +20,7 @@
 #include <mach/cpu.h>
 #include <mach/at91_dbgu.h>
 #include <mach/at91sam9260.h>
+#include <mach/at91_aic.h>
 #include <mach/at91_pmc.h>
 #include <mach/at91_rstc.h>
 
index 0ded951f785af1f31c7cba305f191a5f137ea096..7b9c2ba396edb854cfd78ddef676250a751e60bc 100644 (file)
@@ -45,8 +45,8 @@ static struct resource usbh_resources[] = {
                .flags  = IORESOURCE_MEM,
        },
        [1] = {
-               .start  = AT91SAM9260_ID_UHP,
-               .end    = AT91SAM9260_ID_UHP,
+               .start  = NR_IRQS_LEGACY + AT91SAM9260_ID_UHP,
+               .end    = NR_IRQS_LEGACY + AT91SAM9260_ID_UHP,
                .flags  = IORESOURCE_IRQ,
        },
 };
@@ -98,8 +98,8 @@ static struct resource udc_resources[] = {
                .flags  = IORESOURCE_MEM,
        },
        [1] = {
-               .start  = AT91SAM9260_ID_UDP,
-               .end    = AT91SAM9260_ID_UDP,
+               .start  = NR_IRQS_LEGACY + AT91SAM9260_ID_UDP,
+               .end    = NR_IRQS_LEGACY + AT91SAM9260_ID_UDP,
                .flags  = IORESOURCE_IRQ,
        },
 };
@@ -149,8 +149,8 @@ static struct resource eth_resources[] = {
                .flags  = IORESOURCE_MEM,
        },
        [1] = {
-               .start  = AT91SAM9260_ID_EMAC,
-               .end    = AT91SAM9260_ID_EMAC,
+               .start  = NR_IRQS_LEGACY + AT91SAM9260_ID_EMAC,
+               .end    = NR_IRQS_LEGACY + AT91SAM9260_ID_EMAC,
                .flags  = IORESOURCE_IRQ,
        },
 };
@@ -223,8 +223,8 @@ static struct resource mmc_resources[] = {
                .flags  = IORESOURCE_MEM,
        },
        [1] = {
-               .start  = AT91SAM9260_ID_MCI,
-               .end    = AT91SAM9260_ID_MCI,
+               .start  = NR_IRQS_LEGACY + AT91SAM9260_ID_MCI,
+               .end    = NR_IRQS_LEGACY + AT91SAM9260_ID_MCI,
                .flags  = IORESOURCE_IRQ,
        },
 };
@@ -305,8 +305,8 @@ static struct resource mmc_resources[] = {
                .flags  = IORESOURCE_MEM,
        },
        [1] = {
-               .start  = AT91SAM9260_ID_MCI,
-               .end    = AT91SAM9260_ID_MCI,
+               .start  = NR_IRQS_LEGACY + AT91SAM9260_ID_MCI,
+               .end    = NR_IRQS_LEGACY + AT91SAM9260_ID_MCI,
                .flags  = IORESOURCE_IRQ,
        },
 };
@@ -496,8 +496,8 @@ static struct resource twi_resources[] = {
                .flags  = IORESOURCE_MEM,
        },
        [1] = {
-               .start  = AT91SAM9260_ID_TWI,
-               .end    = AT91SAM9260_ID_TWI,
+               .start  = NR_IRQS_LEGACY + AT91SAM9260_ID_TWI,
+               .end    = NR_IRQS_LEGACY + AT91SAM9260_ID_TWI,
                .flags  = IORESOURCE_IRQ,
        },
 };
@@ -540,8 +540,8 @@ static struct resource spi0_resources[] = {
                .flags  = IORESOURCE_MEM,
        },
        [1] = {
-               .start  = AT91SAM9260_ID_SPI0,
-               .end    = AT91SAM9260_ID_SPI0,
+               .start  = NR_IRQS_LEGACY + AT91SAM9260_ID_SPI0,
+               .end    = NR_IRQS_LEGACY + AT91SAM9260_ID_SPI0,
                .flags  = IORESOURCE_IRQ,
        },
 };
@@ -566,8 +566,8 @@ static struct resource spi1_resources[] = {
                .flags  = IORESOURCE_MEM,
        },
        [1] = {
-               .start  = AT91SAM9260_ID_SPI1,
-               .end    = AT91SAM9260_ID_SPI1,
+               .start  = NR_IRQS_LEGACY + AT91SAM9260_ID_SPI1,
+               .end    = NR_IRQS_LEGACY + AT91SAM9260_ID_SPI1,
                .flags  = IORESOURCE_IRQ,
        },
 };
@@ -652,18 +652,18 @@ static struct resource tcb0_resources[] = {
                .flags  = IORESOURCE_MEM,
        },
        [1] = {
-               .start  = AT91SAM9260_ID_TC0,
-               .end    = AT91SAM9260_ID_TC0,
+               .start  = NR_IRQS_LEGACY + AT91SAM9260_ID_TC0,
+               .end    = NR_IRQS_LEGACY + AT91SAM9260_ID_TC0,
                .flags  = IORESOURCE_IRQ,
        },
        [2] = {
-               .start  = AT91SAM9260_ID_TC1,
-               .end    = AT91SAM9260_ID_TC1,
+               .start  = NR_IRQS_LEGACY + AT91SAM9260_ID_TC1,
+               .end    = NR_IRQS_LEGACY + AT91SAM9260_ID_TC1,
                .flags  = IORESOURCE_IRQ,
        },
        [3] = {
-               .start  = AT91SAM9260_ID_TC2,
-               .end    = AT91SAM9260_ID_TC2,
+               .start  = NR_IRQS_LEGACY + AT91SAM9260_ID_TC2,
+               .end    = NR_IRQS_LEGACY + AT91SAM9260_ID_TC2,
                .flags  = IORESOURCE_IRQ,
        },
 };
@@ -682,18 +682,18 @@ static struct resource tcb1_resources[] = {
                .flags  = IORESOURCE_MEM,
        },
        [1] = {
-               .start  = AT91SAM9260_ID_TC3,
-               .end    = AT91SAM9260_ID_TC3,
+               .start  = NR_IRQS_LEGACY + AT91SAM9260_ID_TC3,
+               .end    = NR_IRQS_LEGACY + AT91SAM9260_ID_TC3,
                .flags  = IORESOURCE_IRQ,
        },
        [2] = {
-               .start  = AT91SAM9260_ID_TC4,
-               .end    = AT91SAM9260_ID_TC4,
+               .start  = NR_IRQS_LEGACY + AT91SAM9260_ID_TC4,
+               .end    = NR_IRQS_LEGACY + AT91SAM9260_ID_TC4,
                .flags  = IORESOURCE_IRQ,
        },
        [3] = {
-               .start  = AT91SAM9260_ID_TC5,
-               .end    = AT91SAM9260_ID_TC5,
+               .start  = NR_IRQS_LEGACY + AT91SAM9260_ID_TC5,
+               .end    = NR_IRQS_LEGACY + AT91SAM9260_ID_TC5,
                .flags  = IORESOURCE_IRQ,
        },
 };
@@ -807,8 +807,8 @@ static struct resource ssc_resources[] = {
                .flags  = IORESOURCE_MEM,
        },
        [1] = {
-               .start  = AT91SAM9260_ID_SSC,
-               .end    = AT91SAM9260_ID_SSC,
+               .start  = NR_IRQS_LEGACY + AT91SAM9260_ID_SSC,
+               .end    = NR_IRQS_LEGACY + AT91SAM9260_ID_SSC,
                .flags  = IORESOURCE_IRQ,
        },
 };
@@ -882,8 +882,8 @@ static struct resource dbgu_resources[] = {
                .flags  = IORESOURCE_MEM,
        },
        [1] = {
-               .start  = AT91_ID_SYS,
-               .end    = AT91_ID_SYS,
+               .start  = NR_IRQS_LEGACY + AT91_ID_SYS,
+               .end    = NR_IRQS_LEGACY + AT91_ID_SYS,
                .flags  = IORESOURCE_IRQ,
        },
 };
@@ -920,8 +920,8 @@ static struct resource uart0_resources[] = {
                .flags  = IORESOURCE_MEM,
        },
        [1] = {
-               .start  = AT91SAM9260_ID_US0,
-               .end    = AT91SAM9260_ID_US0,
+               .start  = NR_IRQS_LEGACY + AT91SAM9260_ID_US0,
+               .end    = NR_IRQS_LEGACY + AT91SAM9260_ID_US0,
                .flags  = IORESOURCE_IRQ,
        },
 };
@@ -971,8 +971,8 @@ static struct resource uart1_resources[] = {
                .flags  = IORESOURCE_MEM,
        },
        [1] = {
-               .start  = AT91SAM9260_ID_US1,
-               .end    = AT91SAM9260_ID_US1,
+               .start  = NR_IRQS_LEGACY + AT91SAM9260_ID_US1,
+               .end    = NR_IRQS_LEGACY + AT91SAM9260_ID_US1,
                .flags  = IORESOURCE_IRQ,
        },
 };
@@ -1014,8 +1014,8 @@ static struct resource uart2_resources[] = {
                .flags  = IORESOURCE_MEM,
        },
        [1] = {
-               .start  = AT91SAM9260_ID_US2,
-               .end    = AT91SAM9260_ID_US2,
+               .start  = NR_IRQS_LEGACY + AT91SAM9260_ID_US2,
+               .end    = NR_IRQS_LEGACY + AT91SAM9260_ID_US2,
                .flags  = IORESOURCE_IRQ,
        },
 };
@@ -1057,8 +1057,8 @@ static struct resource uart3_resources[] = {
                .flags  = IORESOURCE_MEM,
        },
        [1] = {
-               .start  = AT91SAM9260_ID_US3,
-               .end    = AT91SAM9260_ID_US3,
+               .start  = NR_IRQS_LEGACY + AT91SAM9260_ID_US3,
+               .end    = NR_IRQS_LEGACY + AT91SAM9260_ID_US3,
                .flags  = IORESOURCE_IRQ,
        },
 };
@@ -1100,8 +1100,8 @@ static struct resource uart4_resources[] = {
                .flags  = IORESOURCE_MEM,
        },
        [1] = {
-               .start  = AT91SAM9260_ID_US4,
-               .end    = AT91SAM9260_ID_US4,
+               .start  = NR_IRQS_LEGACY + AT91SAM9260_ID_US4,
+               .end    = NR_IRQS_LEGACY + AT91SAM9260_ID_US4,
                .flags  = IORESOURCE_IRQ,
        },
 };
@@ -1138,8 +1138,8 @@ static struct resource uart5_resources[] = {
                .flags  = IORESOURCE_MEM,
        },
        [1] = {
-               .start  = AT91SAM9260_ID_US5,
-               .end    = AT91SAM9260_ID_US5,
+               .start  = NR_IRQS_LEGACY + AT91SAM9260_ID_US5,
+               .end    = NR_IRQS_LEGACY + AT91SAM9260_ID_US5,
                .flags  = IORESOURCE_IRQ,
        },
 };
@@ -1357,8 +1357,8 @@ static struct resource adc_resources[] = {
                .flags  = IORESOURCE_MEM,
        },
        [1] = {
-               .start  = AT91SAM9260_ID_ADC,
-               .end    = AT91SAM9260_ID_ADC,
+               .start  = NR_IRQS_LEGACY + AT91SAM9260_ID_ADC,
+               .end    = NR_IRQS_LEGACY + AT91SAM9260_ID_ADC,
                .flags  = IORESOURCE_IRQ,
        },
 };
index c77d503d09d1c2546a8e73a5ddccb246acb4ddcb..f40762c5fedee898fb836b24556f50499ee2858e 100644 (file)
@@ -19,6 +19,7 @@
 #include <asm/system_misc.h>
 #include <mach/cpu.h>
 #include <mach/at91sam9261.h>
+#include <mach/at91_aic.h>
 #include <mach/at91_pmc.h>
 #include <mach/at91_rstc.h>
 
index 9295e90b08ff523fa93817ca9121eb15d9d5a2bb..8df5c1bdff92f1d1194fa9d64da61e2aa9bc2598 100644 (file)
@@ -45,8 +45,8 @@ static struct resource usbh_resources[] = {
                .flags  = IORESOURCE_MEM,
        },
        [1] = {
-               .start  = AT91SAM9261_ID_UHP,
-               .end    = AT91SAM9261_ID_UHP,
+               .start  = NR_IRQS_LEGACY + AT91SAM9261_ID_UHP,
+               .end    = NR_IRQS_LEGACY + AT91SAM9261_ID_UHP,
                .flags  = IORESOURCE_IRQ,
        },
 };
@@ -98,8 +98,8 @@ static struct resource udc_resources[] = {
                .flags  = IORESOURCE_MEM,
        },
        [1] = {
-               .start  = AT91SAM9261_ID_UDP,
-               .end    = AT91SAM9261_ID_UDP,
+               .start  = NR_IRQS_LEGACY + AT91SAM9261_ID_UDP,
+               .end    = NR_IRQS_LEGACY + AT91SAM9261_ID_UDP,
                .flags  = IORESOURCE_IRQ,
        },
 };
@@ -148,8 +148,8 @@ static struct resource mmc_resources[] = {
                .flags  = IORESOURCE_MEM,
        },
        [1] = {
-               .start  = AT91SAM9261_ID_MCI,
-               .end    = AT91SAM9261_ID_MCI,
+               .start  = NR_IRQS_LEGACY + AT91SAM9261_ID_MCI,
+               .end    = NR_IRQS_LEGACY + AT91SAM9261_ID_MCI,
                .flags  = IORESOURCE_IRQ,
        },
 };
@@ -310,8 +310,8 @@ static struct resource twi_resources[] = {
                .flags  = IORESOURCE_MEM,
        },
        [1] = {
-               .start  = AT91SAM9261_ID_TWI,
-               .end    = AT91SAM9261_ID_TWI,
+               .start  = NR_IRQS_LEGACY + AT91SAM9261_ID_TWI,
+               .end    = NR_IRQS_LEGACY + AT91SAM9261_ID_TWI,
                .flags  = IORESOURCE_IRQ,
        },
 };
@@ -354,8 +354,8 @@ static struct resource spi0_resources[] = {
                .flags  = IORESOURCE_MEM,
        },
        [1] = {
-               .start  = AT91SAM9261_ID_SPI0,
-               .end    = AT91SAM9261_ID_SPI0,
+               .start  = NR_IRQS_LEGACY + AT91SAM9261_ID_SPI0,
+               .end    = NR_IRQS_LEGACY + AT91SAM9261_ID_SPI0,
                .flags  = IORESOURCE_IRQ,
        },
 };
@@ -380,8 +380,8 @@ static struct resource spi1_resources[] = {
                .flags  = IORESOURCE_MEM,
        },
        [1] = {
-               .start  = AT91SAM9261_ID_SPI1,
-               .end    = AT91SAM9261_ID_SPI1,
+               .start  = NR_IRQS_LEGACY + AT91SAM9261_ID_SPI1,
+               .end    = NR_IRQS_LEGACY + AT91SAM9261_ID_SPI1,
                .flags  = IORESOURCE_IRQ,
        },
 };
@@ -468,8 +468,8 @@ static struct resource lcdc_resources[] = {
                .flags  = IORESOURCE_MEM,
        },
        [1] = {
-               .start  = AT91SAM9261_ID_LCDC,
-               .end    = AT91SAM9261_ID_LCDC,
+               .start  = NR_IRQS_LEGACY + AT91SAM9261_ID_LCDC,
+               .end    = NR_IRQS_LEGACY + AT91SAM9261_ID_LCDC,
                .flags  = IORESOURCE_IRQ,
        },
 #if defined(CONFIG_FB_INTSRAM)
@@ -566,18 +566,18 @@ static struct resource tcb_resources[] = {
                .flags  = IORESOURCE_MEM,
        },
        [1] = {
-               .start  = AT91SAM9261_ID_TC0,
-               .end    = AT91SAM9261_ID_TC0,
+               .start  = NR_IRQS_LEGACY + AT91SAM9261_ID_TC0,
+               .end    = NR_IRQS_LEGACY + AT91SAM9261_ID_TC0,
                .flags  = IORESOURCE_IRQ,
        },
        [2] = {
-               .start  = AT91SAM9261_ID_TC1,
-               .end    = AT91SAM9261_ID_TC1,
+               .start  = NR_IRQS_LEGACY + AT91SAM9261_ID_TC1,
+               .end    = NR_IRQS_LEGACY + AT91SAM9261_ID_TC1,
                .flags  = IORESOURCE_IRQ,
        },
        [3] = {
-               .start  = AT91SAM9261_ID_TC2,
-               .end    = AT91SAM9261_ID_TC2,
+               .start  = NR_IRQS_LEGACY + AT91SAM9261_ID_TC2,
+               .end    = NR_IRQS_LEGACY + AT91SAM9261_ID_TC2,
                .flags  = IORESOURCE_IRQ,
        },
 };
@@ -689,8 +689,8 @@ static struct resource ssc0_resources[] = {
                .flags  = IORESOURCE_MEM,
        },
        [1] = {
-               .start  = AT91SAM9261_ID_SSC0,
-               .end    = AT91SAM9261_ID_SSC0,
+               .start  = NR_IRQS_LEGACY + AT91SAM9261_ID_SSC0,
+               .end    = NR_IRQS_LEGACY + AT91SAM9261_ID_SSC0,
                .flags  = IORESOURCE_IRQ,
        },
 };
@@ -731,8 +731,8 @@ static struct resource ssc1_resources[] = {
                .flags  = IORESOURCE_MEM,
        },
        [1] = {
-               .start  = AT91SAM9261_ID_SSC1,
-               .end    = AT91SAM9261_ID_SSC1,
+               .start  = NR_IRQS_LEGACY + AT91SAM9261_ID_SSC1,
+               .end    = NR_IRQS_LEGACY + AT91SAM9261_ID_SSC1,
                .flags  = IORESOURCE_IRQ,
        },
 };
@@ -773,8 +773,8 @@ static struct resource ssc2_resources[] = {
                .flags  = IORESOURCE_MEM,
        },
        [1] = {
-               .start  = AT91SAM9261_ID_SSC2,
-               .end    = AT91SAM9261_ID_SSC2,
+               .start  = NR_IRQS_LEGACY + AT91SAM9261_ID_SSC2,
+               .end    = NR_IRQS_LEGACY + AT91SAM9261_ID_SSC2,
                .flags  = IORESOURCE_IRQ,
        },
 };
@@ -857,8 +857,8 @@ static struct resource dbgu_resources[] = {
                .flags  = IORESOURCE_MEM,
        },
        [1] = {
-               .start  = AT91_ID_SYS,
-               .end    = AT91_ID_SYS,
+               .start  = NR_IRQS_LEGACY + AT91_ID_SYS,
+               .end    = NR_IRQS_LEGACY + AT91_ID_SYS,
                .flags  = IORESOURCE_IRQ,
        },
 };
@@ -895,8 +895,8 @@ static struct resource uart0_resources[] = {
                .flags  = IORESOURCE_MEM,
        },
        [1] = {
-               .start  = AT91SAM9261_ID_US0,
-               .end    = AT91SAM9261_ID_US0,
+               .start  = NR_IRQS_LEGACY + AT91SAM9261_ID_US0,
+               .end    = NR_IRQS_LEGACY + AT91SAM9261_ID_US0,
                .flags  = IORESOURCE_IRQ,
        },
 };
@@ -938,8 +938,8 @@ static struct resource uart1_resources[] = {
                .flags  = IORESOURCE_MEM,
        },
        [1] = {
-               .start  = AT91SAM9261_ID_US1,
-               .end    = AT91SAM9261_ID_US1,
+               .start  = NR_IRQS_LEGACY + AT91SAM9261_ID_US1,
+               .end    = NR_IRQS_LEGACY + AT91SAM9261_ID_US1,
                .flags  = IORESOURCE_IRQ,
        },
 };
@@ -981,8 +981,8 @@ static struct resource uart2_resources[] = {
                .flags  = IORESOURCE_MEM,
        },
        [1] = {
-               .start  = AT91SAM9261_ID_US2,
-               .end    = AT91SAM9261_ID_US2,
+               .start  = NR_IRQS_LEGACY + AT91SAM9261_ID_US2,
+               .end    = NR_IRQS_LEGACY + AT91SAM9261_ID_US2,
                .flags  = IORESOURCE_IRQ,
        },
 };
index ed91c7e9f7c20312ccc9f25564187c84f8e118af..84b38105231e91a52df082f3828f2042c1178201 100644 (file)
@@ -18,6 +18,7 @@
 #include <asm/mach/map.h>
 #include <asm/system_misc.h>
 #include <mach/at91sam9263.h>
+#include <mach/at91_aic.h>
 #include <mach/at91_pmc.h>
 #include <mach/at91_rstc.h>
 
index 175e0009eaa9b886a90694dcf5cb1d880e2e38ad..eb6bbf86fb9f597cc7424a52b459bb04ecff2326 100644 (file)
@@ -44,8 +44,8 @@ static struct resource usbh_resources[] = {
                .flags  = IORESOURCE_MEM,
        },
        [1] = {
-               .start  = AT91SAM9263_ID_UHP,
-               .end    = AT91SAM9263_ID_UHP,
+               .start  = NR_IRQS_LEGACY + AT91SAM9263_ID_UHP,
+               .end    = NR_IRQS_LEGACY + AT91SAM9263_ID_UHP,
                .flags  = IORESOURCE_IRQ,
        },
 };
@@ -104,8 +104,8 @@ static struct resource udc_resources[] = {
                .flags  = IORESOURCE_MEM,
        },
        [1] = {
-               .start  = AT91SAM9263_ID_UDP,
-               .end    = AT91SAM9263_ID_UDP,
+               .start  = NR_IRQS_LEGACY + AT91SAM9263_ID_UDP,
+               .end    = NR_IRQS_LEGACY + AT91SAM9263_ID_UDP,
                .flags  = IORESOURCE_IRQ,
        },
 };
@@ -155,8 +155,8 @@ static struct resource eth_resources[] = {
                .flags  = IORESOURCE_MEM,
        },
        [1] = {
-               .start  = AT91SAM9263_ID_EMAC,
-               .end    = AT91SAM9263_ID_EMAC,
+               .start  = NR_IRQS_LEGACY + AT91SAM9263_ID_EMAC,
+               .end    = NR_IRQS_LEGACY + AT91SAM9263_ID_EMAC,
                .flags  = IORESOURCE_IRQ,
        },
 };
@@ -229,8 +229,8 @@ static struct resource mmc0_resources[] = {
                .flags  = IORESOURCE_MEM,
        },
        [1] = {
-               .start  = AT91SAM9263_ID_MCI0,
-               .end    = AT91SAM9263_ID_MCI0,
+               .start  = NR_IRQS_LEGACY + AT91SAM9263_ID_MCI0,
+               .end    = NR_IRQS_LEGACY + AT91SAM9263_ID_MCI0,
                .flags  = IORESOURCE_IRQ,
        },
 };
@@ -254,8 +254,8 @@ static struct resource mmc1_resources[] = {
                .flags  = IORESOURCE_MEM,
        },
        [1] = {
-               .start  = AT91SAM9263_ID_MCI1,
-               .end    = AT91SAM9263_ID_MCI1,
+               .start  = NR_IRQS_LEGACY + AT91SAM9263_ID_MCI1,
+               .end    = NR_IRQS_LEGACY + AT91SAM9263_ID_MCI1,
                .flags  = IORESOURCE_IRQ,
        },
 };
@@ -567,8 +567,8 @@ static struct resource twi_resources[] = {
                .flags  = IORESOURCE_MEM,
        },
        [1] = {
-               .start  = AT91SAM9263_ID_TWI,
-               .end    = AT91SAM9263_ID_TWI,
+               .start  = NR_IRQS_LEGACY + AT91SAM9263_ID_TWI,
+               .end    = NR_IRQS_LEGACY + AT91SAM9263_ID_TWI,
                .flags  = IORESOURCE_IRQ,
        },
 };
@@ -611,8 +611,8 @@ static struct resource spi0_resources[] = {
                .flags  = IORESOURCE_MEM,
        },
        [1] = {
-               .start  = AT91SAM9263_ID_SPI0,
-               .end    = AT91SAM9263_ID_SPI0,
+               .start  = NR_IRQS_LEGACY + AT91SAM9263_ID_SPI0,
+               .end    = NR_IRQS_LEGACY + AT91SAM9263_ID_SPI0,
                .flags  = IORESOURCE_IRQ,
        },
 };
@@ -637,8 +637,8 @@ static struct resource spi1_resources[] = {
                .flags  = IORESOURCE_MEM,
        },
        [1] = {
-               .start  = AT91SAM9263_ID_SPI1,
-               .end    = AT91SAM9263_ID_SPI1,
+               .start  = NR_IRQS_LEGACY + AT91SAM9263_ID_SPI1,
+               .end    = NR_IRQS_LEGACY + AT91SAM9263_ID_SPI1,
                .flags  = IORESOURCE_IRQ,
        },
 };
@@ -725,8 +725,8 @@ static struct resource ac97_resources[] = {
                .flags  = IORESOURCE_MEM,
        },
        [1] = {
-               .start  = AT91SAM9263_ID_AC97C,
-               .end    = AT91SAM9263_ID_AC97C,
+               .start  = NR_IRQS_LEGACY + AT91SAM9263_ID_AC97C,
+               .end    = NR_IRQS_LEGACY + AT91SAM9263_ID_AC97C,
                .flags  = IORESOURCE_IRQ,
        },
 };
@@ -776,8 +776,8 @@ static struct resource can_resources[] = {
                .flags  = IORESOURCE_MEM,
        },
        [1] = {
-               .start  = AT91SAM9263_ID_CAN,
-               .end    = AT91SAM9263_ID_CAN,
+               .start  = NR_IRQS_LEGACY + AT91SAM9263_ID_CAN,
+               .end    = NR_IRQS_LEGACY + AT91SAM9263_ID_CAN,
                .flags  = IORESOURCE_IRQ,
        },
 };
@@ -816,8 +816,8 @@ static struct resource lcdc_resources[] = {
                .flags  = IORESOURCE_MEM,
        },
        [1] = {
-               .start  = AT91SAM9263_ID_LCDC,
-               .end    = AT91SAM9263_ID_LCDC,
+               .start  = NR_IRQS_LEGACY + AT91SAM9263_ID_LCDC,
+               .end    = NR_IRQS_LEGACY + AT91SAM9263_ID_LCDC,
                .flags  = IORESOURCE_IRQ,
        },
 };
@@ -883,8 +883,8 @@ struct resource isi_resources[] = {
                .flags  = IORESOURCE_MEM,
        },
        [1] = {
-               .start  = AT91SAM9263_ID_ISI,
-               .end    = AT91SAM9263_ID_ISI,
+               .start  = NR_IRQS_LEGACY + AT91SAM9263_ID_ISI,
+               .end    = NR_IRQS_LEGACY + AT91SAM9263_ID_ISI,
                .flags  = IORESOURCE_IRQ,
        },
 };
@@ -940,8 +940,8 @@ static struct resource tcb_resources[] = {
                .flags  = IORESOURCE_MEM,
        },
        [1] = {
-               .start  = AT91SAM9263_ID_TCB,
-               .end    = AT91SAM9263_ID_TCB,
+               .start  = NR_IRQS_LEGACY + AT91SAM9263_ID_TCB,
+               .end    = NR_IRQS_LEGACY + AT91SAM9263_ID_TCB,
                .flags  = IORESOURCE_IRQ,
        },
 };
@@ -1108,8 +1108,8 @@ static struct resource pwm_resources[] = {
                .flags  = IORESOURCE_MEM,
        },
        [1] = {
-               .start  = AT91SAM9263_ID_PWMC,
-               .end    = AT91SAM9263_ID_PWMC,
+               .start  = NR_IRQS_LEGACY + AT91SAM9263_ID_PWMC,
+               .end    = NR_IRQS_LEGACY + AT91SAM9263_ID_PWMC,
                .flags  = IORESOURCE_IRQ,
        },
 };
@@ -1161,8 +1161,8 @@ static struct resource ssc0_resources[] = {
                .flags  = IORESOURCE_MEM,
        },
        [1] = {
-               .start  = AT91SAM9263_ID_SSC0,
-               .end    = AT91SAM9263_ID_SSC0,
+               .start  = NR_IRQS_LEGACY + AT91SAM9263_ID_SSC0,
+               .end    = NR_IRQS_LEGACY + AT91SAM9263_ID_SSC0,
                .flags  = IORESOURCE_IRQ,
        },
 };
@@ -1203,8 +1203,8 @@ static struct resource ssc1_resources[] = {
                .flags  = IORESOURCE_MEM,
        },
        [1] = {
-               .start  = AT91SAM9263_ID_SSC1,
-               .end    = AT91SAM9263_ID_SSC1,
+               .start  = NR_IRQS_LEGACY + AT91SAM9263_ID_SSC1,
+               .end    = NR_IRQS_LEGACY + AT91SAM9263_ID_SSC1,
                .flags  = IORESOURCE_IRQ,
        },
 };
@@ -1284,8 +1284,8 @@ static struct resource dbgu_resources[] = {
                .flags  = IORESOURCE_MEM,
        },
        [1] = {
-               .start  = AT91_ID_SYS,
-               .end    = AT91_ID_SYS,
+               .start  = NR_IRQS_LEGACY + AT91_ID_SYS,
+               .end    = NR_IRQS_LEGACY + AT91_ID_SYS,
                .flags  = IORESOURCE_IRQ,
        },
 };
@@ -1322,8 +1322,8 @@ static struct resource uart0_resources[] = {
                .flags  = IORESOURCE_MEM,
        },
        [1] = {
-               .start  = AT91SAM9263_ID_US0,
-               .end    = AT91SAM9263_ID_US0,
+               .start  = NR_IRQS_LEGACY + AT91SAM9263_ID_US0,
+               .end    = NR_IRQS_LEGACY + AT91SAM9263_ID_US0,
                .flags  = IORESOURCE_IRQ,
        },
 };
@@ -1365,8 +1365,8 @@ static struct resource uart1_resources[] = {
                .flags  = IORESOURCE_MEM,
        },
        [1] = {
-               .start  = AT91SAM9263_ID_US1,
-               .end    = AT91SAM9263_ID_US1,
+               .start  = NR_IRQS_LEGACY + AT91SAM9263_ID_US1,
+               .end    = NR_IRQS_LEGACY + AT91SAM9263_ID_US1,
                .flags  = IORESOURCE_IRQ,
        },
 };
@@ -1408,8 +1408,8 @@ static struct resource uart2_resources[] = {
                .flags  = IORESOURCE_MEM,
        },
        [1] = {
-               .start  = AT91SAM9263_ID_US2,
-               .end    = AT91SAM9263_ID_US2,
+               .start  = NR_IRQS_LEGACY + AT91SAM9263_ID_US2,
+               .end    = NR_IRQS_LEGACY + AT91SAM9263_ID_US2,
                .flags  = IORESOURCE_IRQ,
        },
 };
index a94758b42737a3d33a3cdce0bee439103ea8f7ab..ffc0957d7623ebe91319ab6a5810c0642ab328df 100644 (file)
@@ -137,7 +137,7 @@ static struct irqaction at91sam926x_pit_irq = {
        .name           = "at91_tick",
        .flags          = IRQF_SHARED | IRQF_DISABLED | IRQF_TIMER | IRQF_IRQPOLL,
        .handler        = at91sam926x_pit_interrupt,
-       .irq            = AT91_ID_SYS,
+       .irq            = NR_IRQS_LEGACY + AT91_ID_SYS,
 };
 
 static void at91sam926x_pit_reset(void)
index 4792682d52b9962df1d227a3deb4370244260476..977127368a7dbd10d3785d4383840be2b72f840d 100644 (file)
@@ -18,6 +18,7 @@
 #include <asm/mach/map.h>
 #include <asm/system_misc.h>
 #include <mach/at91sam9g45.h>
+#include <mach/at91_aic.h>
 #include <mach/at91_pmc.h>
 #include <mach/cpu.h>
 
index 933fc9afe7d091db78f5484d4ca331a50cb50716..40fb79df2de0b0ebb19c2d4eb4258490d9839cc9 100644 (file)
@@ -53,8 +53,8 @@ static struct resource hdmac_resources[] = {
                .flags  = IORESOURCE_MEM,
        },
        [1] = {
-               .start  = AT91SAM9G45_ID_DMA,
-               .end    = AT91SAM9G45_ID_DMA,
+               .start  = NR_IRQS_LEGACY + AT91SAM9G45_ID_DMA,
+               .end    = NR_IRQS_LEGACY + AT91SAM9G45_ID_DMA,
                .flags  = IORESOURCE_IRQ,
        },
 };
@@ -94,8 +94,8 @@ static struct resource usbh_ohci_resources[] = {
                .flags  = IORESOURCE_MEM,
        },
        [1] = {
-               .start  = AT91SAM9G45_ID_UHPHS,
-               .end    = AT91SAM9G45_ID_UHPHS,
+               .start  = NR_IRQS_LEGACY + AT91SAM9G45_ID_UHPHS,
+               .end    = NR_IRQS_LEGACY + AT91SAM9G45_ID_UHPHS,
                .flags  = IORESOURCE_IRQ,
        },
 };
@@ -156,8 +156,8 @@ static struct resource usbh_ehci_resources[] = {
                .flags  = IORESOURCE_MEM,
        },
        [1] = {
-               .start  = AT91SAM9G45_ID_UHPHS,
-               .end    = AT91SAM9G45_ID_UHPHS,
+               .start  = NR_IRQS_LEGACY + AT91SAM9G45_ID_UHPHS,
+               .end    = NR_IRQS_LEGACY + AT91SAM9G45_ID_UHPHS,
                .flags  = IORESOURCE_IRQ,
        },
 };
@@ -213,8 +213,8 @@ static struct resource usba_udc_resources[] = {
                .flags  = IORESOURCE_MEM,
        },
        [2] = {
-               .start  = AT91SAM9G45_ID_UDPHS,
-               .end    = AT91SAM9G45_ID_UDPHS,
+               .start  = NR_IRQS_LEGACY + AT91SAM9G45_ID_UDPHS,
+               .end    = NR_IRQS_LEGACY + AT91SAM9G45_ID_UDPHS,
                .flags  = IORESOURCE_IRQ,
        },
 };
@@ -296,8 +296,8 @@ static struct resource eth_resources[] = {
                .flags  = IORESOURCE_MEM,
        },
        [1] = {
-               .start  = AT91SAM9G45_ID_EMAC,
-               .end    = AT91SAM9G45_ID_EMAC,
+               .start  = NR_IRQS_LEGACY + AT91SAM9G45_ID_EMAC,
+               .end    = NR_IRQS_LEGACY + AT91SAM9G45_ID_EMAC,
                .flags  = IORESOURCE_IRQ,
        },
 };
@@ -370,8 +370,8 @@ static struct resource mmc0_resources[] = {
                .flags  = IORESOURCE_MEM,
        },
        [1] = {
-               .start  = AT91SAM9G45_ID_MCI0,
-               .end    = AT91SAM9G45_ID_MCI0,
+               .start  = NR_IRQS_LEGACY + AT91SAM9G45_ID_MCI0,
+               .end    = NR_IRQS_LEGACY + AT91SAM9G45_ID_MCI0,
                .flags  = IORESOURCE_IRQ,
        },
 };
@@ -395,8 +395,8 @@ static struct resource mmc1_resources[] = {
                .flags  = IORESOURCE_MEM,
        },
        [1] = {
-               .start  = AT91SAM9G45_ID_MCI1,
-               .end    = AT91SAM9G45_ID_MCI1,
+               .start  = NR_IRQS_LEGACY + AT91SAM9G45_ID_MCI1,
+               .end    = NR_IRQS_LEGACY + AT91SAM9G45_ID_MCI1,
                .flags  = IORESOURCE_IRQ,
        },
 };
@@ -645,8 +645,8 @@ static struct resource twi0_resources[] = {
                .flags  = IORESOURCE_MEM,
        },
        [1] = {
-               .start  = AT91SAM9G45_ID_TWI0,
-               .end    = AT91SAM9G45_ID_TWI0,
+               .start  = NR_IRQS_LEGACY + AT91SAM9G45_ID_TWI0,
+               .end    = NR_IRQS_LEGACY + AT91SAM9G45_ID_TWI0,
                .flags  = IORESOURCE_IRQ,
        },
 };
@@ -665,8 +665,8 @@ static struct resource twi1_resources[] = {
                .flags  = IORESOURCE_MEM,
        },
        [1] = {
-               .start  = AT91SAM9G45_ID_TWI1,
-               .end    = AT91SAM9G45_ID_TWI1,
+               .start  = NR_IRQS_LEGACY + AT91SAM9G45_ID_TWI1,
+               .end    = NR_IRQS_LEGACY + AT91SAM9G45_ID_TWI1,
                .flags  = IORESOURCE_IRQ,
        },
 };
@@ -720,8 +720,8 @@ static struct resource spi0_resources[] = {
                .flags  = IORESOURCE_MEM,
        },
        [1] = {
-               .start  = AT91SAM9G45_ID_SPI0,
-               .end    = AT91SAM9G45_ID_SPI0,
+               .start  = NR_IRQS_LEGACY + AT91SAM9G45_ID_SPI0,
+               .end    = NR_IRQS_LEGACY + AT91SAM9G45_ID_SPI0,
                .flags  = IORESOURCE_IRQ,
        },
 };
@@ -746,8 +746,8 @@ static struct resource spi1_resources[] = {
                .flags  = IORESOURCE_MEM,
        },
        [1] = {
-               .start  = AT91SAM9G45_ID_SPI1,
-               .end    = AT91SAM9G45_ID_SPI1,
+               .start  = NR_IRQS_LEGACY + AT91SAM9G45_ID_SPI1,
+               .end    = NR_IRQS_LEGACY + AT91SAM9G45_ID_SPI1,
                .flags  = IORESOURCE_IRQ,
        },
 };
@@ -834,8 +834,8 @@ static struct resource ac97_resources[] = {
                .flags  = IORESOURCE_MEM,
        },
        [1] = {
-               .start  = AT91SAM9G45_ID_AC97C,
-               .end    = AT91SAM9G45_ID_AC97C,
+               .start  = NR_IRQS_LEGACY + AT91SAM9G45_ID_AC97C,
+               .end    = NR_IRQS_LEGACY + AT91SAM9G45_ID_AC97C,
                .flags  = IORESOURCE_IRQ,
        },
 };
@@ -887,8 +887,8 @@ struct resource isi_resources[] = {
                .flags  = IORESOURCE_MEM,
        },
        [1] = {
-               .start  = AT91SAM9G45_ID_ISI,
-               .end    = AT91SAM9G45_ID_ISI,
+               .start  = NR_IRQS_LEGACY + AT91SAM9G45_ID_ISI,
+               .end    = NR_IRQS_LEGACY + AT91SAM9G45_ID_ISI,
                .flags  = IORESOURCE_IRQ,
        },
 };
@@ -979,8 +979,8 @@ static struct resource lcdc_resources[] = {
                .flags  = IORESOURCE_MEM,
        },
        [1] = {
-               .start  = AT91SAM9G45_ID_LCDC,
-               .end    = AT91SAM9G45_ID_LCDC,
+               .start  = NR_IRQS_LEGACY + AT91SAM9G45_ID_LCDC,
+               .end    = NR_IRQS_LEGACY + AT91SAM9G45_ID_LCDC,
                .flags  = IORESOURCE_IRQ,
        },
 };
@@ -1054,8 +1054,8 @@ static struct resource tcb0_resources[] = {
                .flags  = IORESOURCE_MEM,
        },
        [1] = {
-               .start  = AT91SAM9G45_ID_TCB,
-               .end    = AT91SAM9G45_ID_TCB,
+               .start  = NR_IRQS_LEGACY + AT91SAM9G45_ID_TCB,
+               .end    = NR_IRQS_LEGACY + AT91SAM9G45_ID_TCB,
                .flags  = IORESOURCE_IRQ,
        },
 };
@@ -1075,8 +1075,8 @@ static struct resource tcb1_resources[] = {
                .flags  = IORESOURCE_MEM,
        },
        [1] = {
-               .start  = AT91SAM9G45_ID_TCB,
-               .end    = AT91SAM9G45_ID_TCB,
+               .start  = NR_IRQS_LEGACY + AT91SAM9G45_ID_TCB,
+               .end    = NR_IRQS_LEGACY + AT91SAM9G45_ID_TCB,
                .flags  = IORESOURCE_IRQ,
        },
 };
@@ -1110,8 +1110,8 @@ static struct resource rtc_resources[] = {
                .flags  = IORESOURCE_MEM,
        },
        [1] = {
-               .start  = AT91_ID_SYS,
-               .end    = AT91_ID_SYS,
+               .start  = NR_IRQS_LEGACY + AT91_ID_SYS,
+               .end    = NR_IRQS_LEGACY + AT91_ID_SYS,
                .flags  = IORESOURCE_IRQ,
        },
 };
@@ -1147,8 +1147,8 @@ static struct resource tsadcc_resources[] = {
                .flags  = IORESOURCE_MEM,
        },
        [1] = {
-               .start  = AT91SAM9G45_ID_TSC,
-               .end    = AT91SAM9G45_ID_TSC,
+               .start  = NR_IRQS_LEGACY + AT91SAM9G45_ID_TSC,
+               .end    = NR_IRQS_LEGACY + AT91SAM9G45_ID_TSC,
                .flags  = IORESOURCE_IRQ,
        }
 };
@@ -1197,8 +1197,8 @@ static struct resource adc_resources[] = {
                .flags  = IORESOURCE_MEM,
        },
        [1] = {
-               .start  = AT91SAM9G45_ID_TSC,
-               .end    = AT91SAM9G45_ID_TSC,
+               .start  = NR_IRQS_LEGACY + AT91SAM9G45_ID_TSC,
+               .end    = NR_IRQS_LEGACY + AT91SAM9G45_ID_TSC,
                .flags  = IORESOURCE_IRQ,
        }
 };
@@ -1400,8 +1400,8 @@ static struct resource pwm_resources[] = {
                .flags  = IORESOURCE_MEM,
        },
        [1] = {
-               .start  = AT91SAM9G45_ID_PWMC,
-               .end    = AT91SAM9G45_ID_PWMC,
+               .start  = NR_IRQS_LEGACY + AT91SAM9G45_ID_PWMC,
+               .end    = NR_IRQS_LEGACY + AT91SAM9G45_ID_PWMC,
                .flags  = IORESOURCE_IRQ,
        },
 };
@@ -1453,8 +1453,8 @@ static struct resource ssc0_resources[] = {
                .flags  = IORESOURCE_MEM,
        },
        [1] = {
-               .start  = AT91SAM9G45_ID_SSC0,
-               .end    = AT91SAM9G45_ID_SSC0,
+               .start  = NR_IRQS_LEGACY + AT91SAM9G45_ID_SSC0,
+               .end    = NR_IRQS_LEGACY + AT91SAM9G45_ID_SSC0,
                .flags  = IORESOURCE_IRQ,
        },
 };
@@ -1495,8 +1495,8 @@ static struct resource ssc1_resources[] = {
                .flags  = IORESOURCE_MEM,
        },
        [1] = {
-               .start  = AT91SAM9G45_ID_SSC1,
-               .end    = AT91SAM9G45_ID_SSC1,
+               .start  = NR_IRQS_LEGACY + AT91SAM9G45_ID_SSC1,
+               .end    = NR_IRQS_LEGACY + AT91SAM9G45_ID_SSC1,
                .flags  = IORESOURCE_IRQ,
        },
 };
@@ -1575,8 +1575,8 @@ static struct resource dbgu_resources[] = {
                .flags  = IORESOURCE_MEM,
        },
        [1] = {
-               .start  = AT91_ID_SYS,
-               .end    = AT91_ID_SYS,
+               .start  = NR_IRQS_LEGACY + AT91_ID_SYS,
+               .end    = NR_IRQS_LEGACY + AT91_ID_SYS,
                .flags  = IORESOURCE_IRQ,
        },
 };
@@ -1613,8 +1613,8 @@ static struct resource uart0_resources[] = {
                .flags  = IORESOURCE_MEM,
        },
        [1] = {
-               .start  = AT91SAM9G45_ID_US0,
-               .end    = AT91SAM9G45_ID_US0,
+               .start  = NR_IRQS_LEGACY + AT91SAM9G45_ID_US0,
+               .end    = NR_IRQS_LEGACY + AT91SAM9G45_ID_US0,
                .flags  = IORESOURCE_IRQ,
        },
 };
@@ -1656,8 +1656,8 @@ static struct resource uart1_resources[] = {
                .flags  = IORESOURCE_MEM,
        },
        [1] = {
-               .start  = AT91SAM9G45_ID_US1,
-               .end    = AT91SAM9G45_ID_US1,
+               .start  = NR_IRQS_LEGACY + AT91SAM9G45_ID_US1,
+               .end    = NR_IRQS_LEGACY + AT91SAM9G45_ID_US1,
                .flags  = IORESOURCE_IRQ,
        },
 };
@@ -1699,8 +1699,8 @@ static struct resource uart2_resources[] = {
                .flags  = IORESOURCE_MEM,
        },
        [1] = {
-               .start  = AT91SAM9G45_ID_US2,
-               .end    = AT91SAM9G45_ID_US2,
+               .start  = NR_IRQS_LEGACY + AT91SAM9G45_ID_US2,
+               .end    = NR_IRQS_LEGACY + AT91SAM9G45_ID_US2,
                .flags  = IORESOURCE_IRQ,
        },
 };
@@ -1742,8 +1742,8 @@ static struct resource uart3_resources[] = {
                .flags  = IORESOURCE_MEM,
        },
        [1] = {
-               .start  = AT91SAM9G45_ID_US3,
-               .end    = AT91SAM9G45_ID_US3,
+               .start  = NR_IRQS_LEGACY + AT91SAM9G45_ID_US3,
+               .end    = NR_IRQS_LEGACY + AT91SAM9G45_ID_US3,
                .flags  = IORESOURCE_IRQ,
        },
 };
index e420085a57effa34a373b3aeeaca91185f248109..72ce50a50de5a278e21535422c1572bb95837a36 100644 (file)
@@ -19,6 +19,7 @@
 #include <mach/cpu.h>
 #include <mach/at91_dbgu.h>
 #include <mach/at91sam9rl.h>
+#include <mach/at91_aic.h>
 #include <mach/at91_pmc.h>
 #include <mach/at91_rstc.h>
 
index 9c0b1481a9a70c5d3ac6ebfc199c5d2e77ba1f46..f09fff932172ffec238c10714331d7c8970a53e1 100644 (file)
@@ -41,8 +41,8 @@ static struct resource hdmac_resources[] = {
                .flags  = IORESOURCE_MEM,
        },
        [2] = {
-               .start  = AT91SAM9RL_ID_DMA,
-               .end    = AT91SAM9RL_ID_DMA,
+               .start  = NR_IRQS_LEGACY + AT91SAM9RL_ID_DMA,
+               .end    = NR_IRQS_LEGACY + AT91SAM9RL_ID_DMA,
                .flags  = IORESOURCE_IRQ,
        },
 };
@@ -84,8 +84,8 @@ static struct resource usba_udc_resources[] = {
                .flags  = IORESOURCE_MEM,
        },
        [2] = {
-               .start  = AT91SAM9RL_ID_UDPHS,
-               .end    = AT91SAM9RL_ID_UDPHS,
+               .start  = NR_IRQS_LEGACY + AT91SAM9RL_ID_UDPHS,
+               .end    = NR_IRQS_LEGACY + AT91SAM9RL_ID_UDPHS,
                .flags  = IORESOURCE_IRQ,
        },
 };
@@ -172,8 +172,8 @@ static struct resource mmc_resources[] = {
                .flags  = IORESOURCE_MEM,
        },
        [1] = {
-               .start  = AT91SAM9RL_ID_MCI,
-               .end    = AT91SAM9RL_ID_MCI,
+               .start  = NR_IRQS_LEGACY + AT91SAM9RL_ID_MCI,
+               .end    = NR_IRQS_LEGACY + AT91SAM9RL_ID_MCI,
                .flags  = IORESOURCE_IRQ,
        },
 };
@@ -339,8 +339,8 @@ static struct resource twi_resources[] = {
                .flags  = IORESOURCE_MEM,
        },
        [1] = {
-               .start  = AT91SAM9RL_ID_TWI0,
-               .end    = AT91SAM9RL_ID_TWI0,
+               .start  = NR_IRQS_LEGACY + AT91SAM9RL_ID_TWI0,
+               .end    = NR_IRQS_LEGACY + AT91SAM9RL_ID_TWI0,
                .flags  = IORESOURCE_IRQ,
        },
 };
@@ -383,8 +383,8 @@ static struct resource spi_resources[] = {
                .flags  = IORESOURCE_MEM,
        },
        [1] = {
-               .start  = AT91SAM9RL_ID_SPI,
-               .end    = AT91SAM9RL_ID_SPI,
+               .start  = NR_IRQS_LEGACY + AT91SAM9RL_ID_SPI,
+               .end    = NR_IRQS_LEGACY + AT91SAM9RL_ID_SPI,
                .flags  = IORESOURCE_IRQ,
        },
 };
@@ -452,8 +452,8 @@ static struct resource ac97_resources[] = {
                .flags  = IORESOURCE_MEM,
        },
        [1] = {
-               .start  = AT91SAM9RL_ID_AC97C,
-               .end    = AT91SAM9RL_ID_AC97C,
+               .start  = NR_IRQS_LEGACY + AT91SAM9RL_ID_AC97C,
+               .end    = NR_IRQS_LEGACY + AT91SAM9RL_ID_AC97C,
                .flags  = IORESOURCE_IRQ,
        },
 };
@@ -507,8 +507,8 @@ static struct resource lcdc_resources[] = {
                .flags  = IORESOURCE_MEM,
        },
        [1] = {
-               .start  = AT91SAM9RL_ID_LCDC,
-               .end    = AT91SAM9RL_ID_LCDC,
+               .start  = NR_IRQS_LEGACY + AT91SAM9RL_ID_LCDC,
+               .end    = NR_IRQS_LEGACY + AT91SAM9RL_ID_LCDC,
                .flags  = IORESOURCE_IRQ,
        },
 };
@@ -574,18 +574,18 @@ static struct resource tcb_resources[] = {
                .flags  = IORESOURCE_MEM,
        },
        [1] = {
-               .start  = AT91SAM9RL_ID_TC0,
-               .end    = AT91SAM9RL_ID_TC0,
+               .start  = NR_IRQS_LEGACY + AT91SAM9RL_ID_TC0,
+               .end    = NR_IRQS_LEGACY + AT91SAM9RL_ID_TC0,
                .flags  = IORESOURCE_IRQ,
        },
        [2] = {
-               .start  = AT91SAM9RL_ID_TC1,
-               .end    = AT91SAM9RL_ID_TC1,
+               .start  = NR_IRQS_LEGACY + AT91SAM9RL_ID_TC1,
+               .end    = NR_IRQS_LEGACY + AT91SAM9RL_ID_TC1,
                .flags  = IORESOURCE_IRQ,
        },
        [3] = {
-               .start  = AT91SAM9RL_ID_TC2,
-               .end    = AT91SAM9RL_ID_TC2,
+               .start  = NR_IRQS_LEGACY + AT91SAM9RL_ID_TC2,
+               .end    = NR_IRQS_LEGACY + AT91SAM9RL_ID_TC2,
                .flags  = IORESOURCE_IRQ,
        },
 };
@@ -621,8 +621,8 @@ static struct resource tsadcc_resources[] = {
                .flags  = IORESOURCE_MEM,
        },
        [1] = {
-               .start  = AT91SAM9RL_ID_TSC,
-               .end    = AT91SAM9RL_ID_TSC,
+               .start  = NR_IRQS_LEGACY + AT91SAM9RL_ID_TSC,
+               .end    = NR_IRQS_LEGACY + AT91SAM9RL_ID_TSC,
                .flags  = IORESOURCE_IRQ,
        }
 };
@@ -768,8 +768,8 @@ static struct resource pwm_resources[] = {
                .flags  = IORESOURCE_MEM,
        },
        [1] = {
-               .start  = AT91SAM9RL_ID_PWMC,
-               .end    = AT91SAM9RL_ID_PWMC,
+               .start  = NR_IRQS_LEGACY + AT91SAM9RL_ID_PWMC,
+               .end    = NR_IRQS_LEGACY + AT91SAM9RL_ID_PWMC,
                .flags  = IORESOURCE_IRQ,
        },
 };
@@ -821,8 +821,8 @@ static struct resource ssc0_resources[] = {
                .flags  = IORESOURCE_MEM,
        },
        [1] = {
-               .start  = AT91SAM9RL_ID_SSC0,
-               .end    = AT91SAM9RL_ID_SSC0,
+               .start  = NR_IRQS_LEGACY + AT91SAM9RL_ID_SSC0,
+               .end    = NR_IRQS_LEGACY + AT91SAM9RL_ID_SSC0,
                .flags  = IORESOURCE_IRQ,
        },
 };
@@ -863,8 +863,8 @@ static struct resource ssc1_resources[] = {
                .flags  = IORESOURCE_MEM,
        },
        [1] = {
-               .start  = AT91SAM9RL_ID_SSC1,
-               .end    = AT91SAM9RL_ID_SSC1,
+               .start  = NR_IRQS_LEGACY + AT91SAM9RL_ID_SSC1,
+               .end    = NR_IRQS_LEGACY + AT91SAM9RL_ID_SSC1,
                .flags  = IORESOURCE_IRQ,
        },
 };
@@ -943,8 +943,8 @@ static struct resource dbgu_resources[] = {
                .flags  = IORESOURCE_MEM,
        },
        [1] = {
-               .start  = AT91_ID_SYS,
-               .end    = AT91_ID_SYS,
+               .start  = NR_IRQS_LEGACY + AT91_ID_SYS,
+               .end    = NR_IRQS_LEGACY + AT91_ID_SYS,
                .flags  = IORESOURCE_IRQ,
        },
 };
@@ -981,8 +981,8 @@ static struct resource uart0_resources[] = {
                .flags  = IORESOURCE_MEM,
        },
        [1] = {
-               .start  = AT91SAM9RL_ID_US0,
-               .end    = AT91SAM9RL_ID_US0,
+               .start  = NR_IRQS_LEGACY + AT91SAM9RL_ID_US0,
+               .end    = NR_IRQS_LEGACY + AT91SAM9RL_ID_US0,
                .flags  = IORESOURCE_IRQ,
        },
 };
@@ -1032,8 +1032,8 @@ static struct resource uart1_resources[] = {
                .flags  = IORESOURCE_MEM,
        },
        [1] = {
-               .start  = AT91SAM9RL_ID_US1,
-               .end    = AT91SAM9RL_ID_US1,
+               .start  = NR_IRQS_LEGACY + AT91SAM9RL_ID_US1,
+               .end    = NR_IRQS_LEGACY + AT91SAM9RL_ID_US1,
                .flags  = IORESOURCE_IRQ,
        },
 };
@@ -1075,8 +1075,8 @@ static struct resource uart2_resources[] = {
                .flags  = IORESOURCE_MEM,
        },
        [1] = {
-               .start  = AT91SAM9RL_ID_US2,
-               .end    = AT91SAM9RL_ID_US2,
+               .start  = NR_IRQS_LEGACY + AT91SAM9RL_ID_US2,
+               .end    = NR_IRQS_LEGACY + AT91SAM9RL_ID_US2,
                .flags  = IORESOURCE_IRQ,
        },
 };
@@ -1118,8 +1118,8 @@ static struct resource uart3_resources[] = {
                .flags  = IORESOURCE_MEM,
        },
        [1] = {
-               .start  = AT91SAM9RL_ID_US3,
-               .end    = AT91SAM9RL_ID_US3,
+               .start  = NR_IRQS_LEGACY + AT91SAM9RL_ID_US3,
+               .end    = NR_IRQS_LEGACY + AT91SAM9RL_ID_US3,
                .flags  = IORESOURCE_IRQ,
        },
 };
index 1b144b4d3ce19da1ef7a580d2bbde299100eaa5f..477cf9d06672c7259cca0dab641bcb099de8e6b5 100644 (file)
@@ -312,8 +312,6 @@ static void __init at91sam9x5_map_io(void)
 
 void __init at91sam9x5_initialize(void)
 {
-       at91_extern_irq = (1 << AT91SAM9X5_ID_IRQ0);
-
        /* Register GPIO subsystem (using DT) */
        at91_gpio_init(NULL, 0);
 }
@@ -321,47 +319,9 @@ void __init at91sam9x5_initialize(void)
 /* --------------------------------------------------------------------
  *  Interrupt initialization
  * -------------------------------------------------------------------- */
-/*
- * The default interrupt priority levels (0 = lowest, 7 = highest).
- */
-static unsigned int at91sam9x5_default_irq_priority[NR_AIC_IRQS] __initdata = {
-       7,      /* Advanced Interrupt Controller (FIQ) */
-       7,      /* System Peripherals */
-       1,      /* Parallel IO Controller A and B */
-       1,      /* Parallel IO Controller C and D */
-       4,      /* Soft Modem */
-       5,      /* USART 0 */
-       5,      /* USART 1 */
-       5,      /* USART 2 */
-       5,      /* USART 3 */
-       6,      /* Two-Wire Interface 0 */
-       6,      /* Two-Wire Interface 1 */
-       6,      /* Two-Wire Interface 2 */
-       0,      /* Multimedia Card Interface 0 */
-       5,      /* Serial Peripheral Interface 0 */
-       5,      /* Serial Peripheral Interface 1 */
-       5,      /* UART 0 */
-       5,      /* UART 1 */
-       0,      /* Timer Counter 0, 1, 2, 3, 4 and 5 */
-       0,      /* Pulse Width Modulation Controller */
-       0,      /* ADC Controller */
-       0,      /* DMA Controller 0 */
-       0,      /* DMA Controller 1 */
-       2,      /* USB Host High Speed port */
-       2,      /* USB Device High speed port */
-       3,      /* Ethernet MAC 0 */
-       3,      /* LDC Controller or Image Sensor Interface */
-       0,      /* Multimedia Card Interface 1 */
-       3,      /* Ethernet MAC 1 */
-       4,      /* Synchronous Serial Interface */
-       4,      /* CAN Controller 0 */
-       4,      /* CAN Controller 1 */
-       0,      /* Advanced Interrupt Controller (IRQ0) */
-};
 
 struct at91_init_soc __initdata at91sam9x5_soc = {
        .map_io = at91sam9x5_map_io,
-       .default_irq_priority = at91sam9x5_default_irq_priority,
        .register_clocks = at91sam9x5_register_clocks,
        .init = at91sam9x5_initialize,
 };
index d62fe090d814c4860403984e470d2f6ad919a79f..46090e642d8eb00b7fe93e05b70c9ea62dc9c8c3 100644 (file)
 #include <linux/kernel.h>
 #include <linux/init.h>
 #include <linux/irq.h>
+#include <linux/io.h>
 #include <asm/proc-fns.h>
 #include <asm/system_misc.h>
 #include <asm/mach/arch.h>
 #include <mach/at91x40.h>
+#include <mach/at91_aic.h>
 #include <mach/at91_st.h>
 #include <mach/timex.h>
 #include "generic.h"
index 271f994314a469807f2d328f4c75418534d699dc..22d8856094f19a0b0c7512edc135de7425db4501 100644 (file)
@@ -36,6 +36,7 @@
 
 #include <mach/board.h>
 #include <mach/cpu.h>
+#include <mach/at91_aic.h>
 
 #include "generic.h"
 
@@ -91,6 +92,7 @@ MACHINE_START(ONEARM, "Ajeco 1ARM single board computer")
        /* Maintainer: Lennert Buytenhek <buytenh@wantstofly.org> */
        .timer          = &at91rm9200_timer,
        .map_io         = at91_map_io,
+       .handle_irq     = at91_aic_handle_irq,
        .init_early     = onearm_init_early,
        .init_irq       = at91_init_irq_default,
        .init_machine   = onearm_board_init,
index b7d8aa7b81e64baa60d6ea772a74a52c471d5228..de7be193181795cb210e5865df30e6fb8babb0d8 100644 (file)
@@ -44,6 +44,7 @@
 #include <asm/mach/irq.h>
 
 #include <mach/board.h>
+#include <mach/at91_aic.h>
 
 #include "generic.h"
 
@@ -212,6 +213,7 @@ MACHINE_START(AFEB9260, "Custom afeb9260 board")
        /* Maintainer: Sergey Lapin <slapin@ossfans.org> */
        .timer          = &at91sam926x_timer,
        .map_io         = at91_map_io,
+       .handle_irq     = at91_aic_handle_irq,
        .init_early     = afeb9260_init_early,
        .init_irq       = at91_init_irq_default,
        .init_machine   = afeb9260_board_init,
index 29d3ef0a50fb9901ed71d6c27f7dd6de819950e8..477e708497bcfc47e4a225d189d767b07561d210 100644 (file)
@@ -39,6 +39,7 @@
 #include <asm/mach/irq.h>
 
 #include <mach/board.h>
+#include <mach/at91_aic.h>
 #include <mach/at91sam9_smc.h>
 
 #include "sam9_smc.h"
@@ -188,6 +189,7 @@ MACHINE_START(CAM60, "KwikByte CAM60")
        /* Maintainer: KwikByte */
        .timer          = &at91sam926x_timer,
        .map_io         = at91_map_io,
+       .handle_irq     = at91_aic_handle_irq,
        .init_early     = cam60_init_early,
        .init_irq       = at91_init_irq_default,
        .init_machine   = cam60_board_init,
index 44328a6d46095027b75f903a11b7ec611c9043f5..a5b002f32a6162e98e6ae5335fcdbec2eb911332 100644 (file)
@@ -36,6 +36,7 @@
 
 #include <mach/hardware.h>
 #include <mach/board.h>
+#include <mach/at91_aic.h>
 
 #include "generic.h"
 
@@ -158,6 +159,7 @@ MACHINE_START(CARMEVA, "Carmeva")
        /* Maintainer: Conitec Datasystems */
        .timer          = &at91rm9200_timer,
        .map_io         = at91_map_io,
+       .handle_irq     = at91_aic_handle_irq,
        .init_early     = carmeva_init_early,
        .init_irq       = at91_init_irq_default,
        .init_machine   = carmeva_board_init,
index 69951ec7dbf310dd5a4d800c90d9ae5dcc6adcff..ecbc13b594de05ed2877d27eab08b91db16cf475 100644 (file)
@@ -41,6 +41,7 @@
 
 #include <mach/hardware.h>
 #include <mach/board.h>
+#include <mach/at91_aic.h>
 #include <mach/at91sam9_smc.h>
 #include <mach/at91sam9260_matrix.h>
 #include <mach/at91_matrix.h>
@@ -376,6 +377,7 @@ MACHINE_START(CPUAT9G20, "Eukrea CPU9G20")
        /* Maintainer: Eric Benard - EUKREA Electromatique */
        .timer          = &at91sam926x_timer,
        .map_io         = at91_map_io,
+       .handle_irq     = at91_aic_handle_irq,
        .init_early     = cpu9krea_init_early,
        .init_irq       = at91_init_irq_default,
        .init_machine   = cpu9krea_board_init,
index 895cf2dba612fe3a6c1ec0212ce7d1c45ff127cb..2e6d043c82f202e352b426e0ac699a74b15fbdcd 100644 (file)
@@ -37,6 +37,7 @@
 #include <asm/mach/irq.h>
 
 #include <mach/board.h>
+#include <mach/at91_aic.h>
 #include <mach/at91rm9200_mc.h>
 #include <mach/at91_ramc.h>
 #include <mach/cpu.h>
@@ -178,6 +179,7 @@ MACHINE_START(CPUAT91, "Eukrea")
        /* Maintainer: Eric Benard - EUKREA Electromatique */
        .timer          = &at91rm9200_timer,
        .map_io         = at91_map_io,
+       .handle_irq     = at91_aic_handle_irq,
        .init_early     = cpuat91_init_early,
        .init_irq       = at91_init_irq_default,
        .init_machine   = cpuat91_board_init,
index cd813361cd26be2d61a49de0f536f3be0ac1059d..462bc319cbc589b2bc86d80c4ebcce642ac7bc33 100644 (file)
@@ -39,6 +39,7 @@
 
 #include <mach/hardware.h>
 #include <mach/board.h>
+#include <mach/at91_aic.h>
 
 #include "generic.h"
 
@@ -252,6 +253,7 @@ MACHINE_START(CSB337, "Cogent CSB337")
        /* Maintainer: Bill Gatliff */
        .timer          = &at91rm9200_timer,
        .map_io         = at91_map_io,
+       .handle_irq     = at91_aic_handle_irq,
        .init_early     = csb337_init_early,
        .init_irq       = at91_init_irq_default,
        .init_machine   = csb337_board_init,
index 7c8b05a57d7f5f9460e436f338b23668fe7ec577..872871ab11605e37dd35df90a85a7a8f8cb762c7 100644 (file)
@@ -36,6 +36,7 @@
 
 #include <mach/hardware.h>
 #include <mach/board.h>
+#include <mach/at91_aic.h>
 
 #include "generic.h"
 
@@ -133,6 +134,7 @@ MACHINE_START(CSB637, "Cogent CSB637")
        /* Maintainer: Bill Gatliff */
        .timer          = &at91rm9200_timer,
        .map_io         = at91_map_io,
+       .handle_irq     = at91_aic_handle_irq,
        .init_early     = csb637_init_early,
        .init_irq       = at91_init_irq_default,
        .init_machine   = csb637_board_init,
index a1fce05aa7a5f7b64e8889f348934d3f75e5ee8a..e8f45c4e0ea8f01affd71c486d50ea1f42228e4c 100644 (file)
@@ -16,6 +16,7 @@
 #include <linux/of_platform.h>
 
 #include <mach/board.h>
+#include <mach/at91_aic.h>
 
 #include <asm/setup.h>
 #include <asm/irq.h>
@@ -53,6 +54,7 @@ DT_MACHINE_START(at91sam_dt, "Atmel AT91SAM (Device Tree)")
        /* Maintainer: Atmel */
        .timer          = &at91sam926x_timer,
        .map_io         = at91_map_io,
+       .handle_irq     = at91_aic_handle_irq,
        .init_early     = at91_dt_initialize,
        .init_irq       = at91_dt_init_irq,
        .init_machine   = at91_dt_device_init,
index d2023f27c65254f83113588a105d221ccfabf705..01f66e99ece73a875b3aa97b79c1af0ca54da58d 100644 (file)
@@ -28,6 +28,7 @@
 #include <asm/mach/arch.h>
 #include <asm/mach/map.h>
 #include <mach/board.h>
+#include <mach/at91_aic.h>
 #include "generic.h"
 
 static void __init at91eb01_init_irq(void)
@@ -43,6 +44,7 @@ static void __init at91eb01_init_early(void)
 MACHINE_START(AT91EB01, "Atmel AT91 EB01")
        /* Maintainer: Greg Ungerer <gerg@snapgear.com> */
        .timer          = &at91x40_timer,
+       .handle_irq     = at91_aic_handle_irq,
        .init_early     = at91eb01_init_early,
        .init_irq       = at91eb01_init_irq,
 MACHINE_END
index bd10172979891c1aab6b139496b068500eedc30b..d1e1f3fc0a47a06d912eddc622048b0663c8be8d 100644 (file)
@@ -36,6 +36,7 @@
 #include <asm/mach/irq.h>
 
 #include <mach/board.h>
+#include <mach/at91_aic.h>
 
 #include "generic.h"
 
@@ -118,6 +119,7 @@ static void __init eb9200_board_init(void)
 MACHINE_START(ATEB9200, "Embest ATEB9200")
        .timer          = &at91rm9200_timer,
        .map_io         = at91_map_io,
+       .handle_irq     = at91_aic_handle_irq,
        .init_early     = eb9200_init_early,
        .init_irq       = at91_init_irq_default,
        .init_machine   = eb9200_board_init,
index 89cc3726a9ce1f3b57f5c589b5d495d1a6c5d4db..9c24cb25707c61dae73275d31c4c669af20528cd 100644 (file)
@@ -39,6 +39,7 @@
 
 #include <mach/board.h>
 #include <mach/cpu.h>
+#include <mach/at91_aic.h>
 
 #include "generic.h"
 
@@ -170,6 +171,7 @@ MACHINE_START(ECBAT91, "emQbit's ECB_AT91")
        /* Maintainer: emQbit.com */
        .timer          = &at91rm9200_timer,
        .map_io         = at91_map_io,
+       .handle_irq     = at91_aic_handle_irq,
        .init_early     = ecb_at91init_early,
        .init_irq       = at91_init_irq_default,
        .init_machine   = ecb_at91board_init,
index 558546cf63f492bf46d5b290b389e019f428244a..82bdfde3405f52d0ef1fd34507b12bd4bfe56466 100644 (file)
@@ -25,6 +25,7 @@
 #include <asm/mach/map.h>
 
 #include <mach/board.h>
+#include <mach/at91_aic.h>
 #include <mach/at91rm9200_mc.h>
 #include <mach/at91_ramc.h>
 #include <mach/cpu.h>
@@ -132,6 +133,7 @@ MACHINE_START(ECO920, "eco920")
        /* Maintainer: Sascha Hauer */
        .timer          = &at91rm9200_timer,
        .map_io         = at91_map_io,
+       .handle_irq     = at91_aic_handle_irq,
        .init_early     = eco920_init_early,
        .init_irq       = at91_init_irq_default,
        .init_machine   = eco920_board_init,
index 47658f78105db41fad698b7d438444f60c8f6cbf..6cc83a87d77cf9422e958f9526720842de343cb9 100644 (file)
@@ -34,6 +34,7 @@
 
 #include <mach/hardware.h>
 #include <mach/board.h>
+#include <mach/at91_aic.h>
 
 #include "generic.h"
 
@@ -160,6 +161,7 @@ MACHINE_START(FLEXIBITY, "Flexibity Connect")
        /* Maintainer: Maxim Osipov */
        .timer          = &at91sam926x_timer,
        .map_io         = at91_map_io,
+       .handle_irq     = at91_aic_handle_irq,
        .init_early     = flexibity_init_early,
        .init_irq       = at91_init_irq_default,
        .init_machine   = flexibity_board_init,
index 33411e6ecb1f1747f7431721003e4b722218bf57..69ab1247ef81263fb430de41d5c025263de5cb9e 100644 (file)
@@ -42,6 +42,7 @@
 #include <asm/mach/irq.h>
 
 #include <mach/board.h>
+#include <mach/at91_aic.h>
 #include <mach/at91sam9_smc.h>
 
 #include "sam9_smc.h"
@@ -262,6 +263,7 @@ MACHINE_START(ACMENETUSFOXG20, "Acme Systems srl FOX Board G20")
        /* Maintainer: Sergio Tanzilli */
        .timer          = &at91sam926x_timer,
        .map_io         = at91_map_io,
+       .handle_irq     = at91_aic_handle_irq,
        .init_early     = foxg20_init_early,
        .init_irq       = at91_init_irq_default,
        .init_machine   = foxg20_board_init,
index 3e0dfa643a86e1714ad627638667a9df713375a7..a9d5e78118c5475a763bfb310a22b588d2c9ddc8 100644 (file)
@@ -31,6 +31,7 @@
 #include <asm/mach/arch.h>
 
 #include <mach/board.h>
+#include <mach/at91_aic.h>
 #include <mach/at91sam9_smc.h>
 #include <mach/gsia18s.h>
 #include <mach/stamp9g20.h>
@@ -575,6 +576,7 @@ static void __init gsia18s_board_init(void)
 MACHINE_START(GSIA18S, "GS_IA18_S")
        .timer          = &at91sam926x_timer,
        .map_io         = at91_map_io,
+       .handle_irq     = at91_aic_handle_irq,
        .init_early     = gsia18s_init_early,
        .init_irq       = at91_init_irq_default,
        .init_machine   = gsia18s_board_init,
index f260657f32bcf5881b3d2aa98fa9d442f992a4df..64c1dbf88a07bfe602f9c8c29071bff1ba5db774 100644 (file)
@@ -35,6 +35,7 @@
 #include <asm/mach/irq.h>
 
 #include <mach/board.h>
+#include <mach/at91_aic.h>
 #include <mach/cpu.h>
 
 #include "generic.h"
@@ -93,6 +94,7 @@ MACHINE_START(KAFA, "Sperry-Sun KAFA")
        /* Maintainer: Sergei Sharonov */
        .timer          = &at91rm9200_timer,
        .map_io         = at91_map_io,
+       .handle_irq     = at91_aic_handle_irq,
        .init_early     = kafa_init_early,
        .init_irq       = at91_init_irq_default,
        .init_machine   = kafa_board_init,
index ba39db5482b955617689e7f65adb39e245915738..5d96cb85175f9a6bce00c7b30ce12fa5d46b5821 100644 (file)
@@ -37,6 +37,7 @@
 
 #include <mach/board.h>
 #include <mach/cpu.h>
+#include <mach/at91_aic.h>
 #include <mach/at91rm9200_mc.h>
 #include <mach/at91_ramc.h>
 
@@ -133,6 +134,7 @@ MACHINE_START(KB9200, "KB920x")
        /* Maintainer: KwikByte, Inc. */
        .timer          = &at91rm9200_timer,
        .map_io         = at91_map_io,
+       .handle_irq     = at91_aic_handle_irq,
        .init_early     = kb9202_init_early,
        .init_irq       = at91_init_irq_default,
        .init_machine   = kb9202_board_init,
index d2f4cc1617669e9d92729c47dde9d6c1bc84a0cf..18103c5d993ce24c148887d5bfc60331f4cb556d 100644 (file)
@@ -45,6 +45,7 @@
 
 #include <mach/hardware.h>
 #include <mach/board.h>
+#include <mach/at91_aic.h>
 #include <mach/at91sam9_smc.h>
 
 #include "sam9_smc.h"
@@ -378,6 +379,7 @@ MACHINE_START(NEOCORE926, "ADENEO NEOCORE 926")
        /* Maintainer: ADENEO */
        .timer          = &at91sam926x_timer,
        .map_io         = at91_map_io,
+       .handle_irq     = at91_aic_handle_irq,
        .init_early     = neocore926_init_early,
        .init_irq       = at91_init_irq_default,
        .init_machine   = neocore926_board_init,
index 7fe6383424213a173a9f5553077f3c468aff8945..9ca3e32c54cbb3b52acc0224625c5c83b8cecad3 100644 (file)
@@ -30,6 +30,7 @@
 #include <asm/mach/arch.h>
 
 #include <mach/board.h>
+#include <mach/at91_aic.h>
 #include <mach/at91sam9_smc.h>
 #include <mach/stamp9g20.h>
 
@@ -218,6 +219,7 @@ MACHINE_START(PCONTROL_G20, "PControl G20")
        /* Maintainer: pgsellmann@portner-elektronik.at */
        .timer          = &at91sam926x_timer,
        .map_io         = at91_map_io,
+       .handle_irq     = at91_aic_handle_irq,
        .init_early     = pcontrol_g20_init_early,
        .init_irq       = at91_init_irq_default,
        .init_machine   = pcontrol_g20_board_init,
index b45c0a5d5ca7649c745d4718a329d0ee65fbdf20..127065504508c8fd5bffd4f00d778339fe497788 100644 (file)
@@ -38,6 +38,7 @@
 #include <asm/mach/irq.h>
 
 #include <mach/board.h>
+#include <mach/at91_aic.h>
 #include <mach/at91rm9200_mc.h>
 #include <mach/at91_ramc.h>
 
@@ -120,6 +121,7 @@ MACHINE_START(PICOTUX2XX, "picotux 200")
        /* Maintainer: Kleinhenz Elektronik GmbH */
        .timer          = &at91rm9200_timer,
        .map_io         = at91_map_io,
+       .handle_irq     = at91_aic_handle_irq,
        .init_early     = picotux200_init_early,
        .init_irq       = at91_init_irq_default,
        .init_machine   = picotux200_board_init,
index 0c61bf0d272c3b02215da56a7cfbdf7c2ce6a0fd..bf351e285422684cc71644e090ea428c766c556b 100644 (file)
@@ -41,6 +41,7 @@
 
 #include <mach/hardware.h>
 #include <mach/board.h>
+#include <mach/at91_aic.h>
 #include <mach/at91sam9_smc.h>
 #include <mach/at91_shdwc.h>
 
@@ -258,6 +259,7 @@ MACHINE_START(QIL_A9260, "CALAO QIL_A9260")
        /* Maintainer: calao-systems */
        .timer          = &at91sam926x_timer,
        .map_io         = at91_map_io,
+       .handle_irq     = at91_aic_handle_irq,
        .init_early     = ek_init_early,
        .init_irq       = at91_init_irq_default,
        .init_machine   = ek_board_init,
index afd7a4713766cec538c1736daf0895f691d6ebf3..cc2bf9796073bcb096883059c7cced4153287a91 100644 (file)
@@ -40,6 +40,7 @@
 
 #include <mach/hardware.h>
 #include <mach/board.h>
+#include <mach/at91_aic.h>
 #include <mach/at91rm9200_mc.h>
 #include <mach/at91_ramc.h>
 
@@ -223,6 +224,7 @@ MACHINE_START(AT91RM9200DK, "Atmel AT91RM9200-DK")
        /* Maintainer: SAN People/Atmel */
        .timer          = &at91rm9200_timer,
        .map_io         = at91_map_io,
+       .handle_irq     = at91_aic_handle_irq,
        .init_early     = dk_init_early,
        .init_irq       = at91_init_irq_default,
        .init_machine   = dk_board_init,
index 2b15b8adec4ccb9c671fab7e2423a59f2860ad89..62e19e64c9d3f52dc0d5ca8e2470dfe9cfc1918e 100644 (file)
@@ -40,6 +40,7 @@
 
 #include <mach/hardware.h>
 #include <mach/board.h>
+#include <mach/at91_aic.h>
 #include <mach/at91rm9200_mc.h>
 #include <mach/at91_ramc.h>
 
@@ -190,6 +191,7 @@ MACHINE_START(AT91RM9200EK, "Atmel AT91RM9200-EK")
        /* Maintainer: SAN People/Atmel */
        .timer          = &at91rm9200_timer,
        .map_io         = at91_map_io,
+       .handle_irq     = at91_aic_handle_irq,
        .init_early     = ek_init_early,
        .init_irq       = at91_init_irq_default,
        .init_machine   = ek_board_init,
index 24ab9be7510fbe5f6cdd3296be794fd7affa8cdc..c3b43aefdb7597d2f71dc5e8e40e054019b891f6 100644 (file)
@@ -26,6 +26,7 @@
 
 #include <mach/hardware.h>
 #include <mach/board.h>
+#include <mach/at91_aic.h>
 
 #include <linux/gpio.h>
 
@@ -225,6 +226,7 @@ MACHINE_START(RSI_EWS, "RSI EWS")
        /* Maintainer: Josef Holzmayr <holzmayr@rsi-elektrotechnik.de> */
        .timer          = &at91rm9200_timer,
        .map_io         = at91_map_io,
+       .handle_irq     = at91_aic_handle_irq,
        .init_early     = rsi_ews_init_early,
        .init_irq       = at91_init_irq_default,
        .init_machine   = rsi_ews_board_init,
index cdd21f2595d2220de8fc828f636d240e0d0b1476..7bf6da70d7d56bbe735156f5c72add8a5441338b 100644 (file)
@@ -38,6 +38,7 @@
 #include <asm/mach/irq.h>
 
 #include <mach/board.h>
+#include <mach/at91_aic.h>
 #include <mach/at91sam9_smc.h>
 
 #include "sam9_smc.h"
@@ -202,6 +203,7 @@ MACHINE_START(SAM9_L9260, "Olimex SAM9-L9260")
        /* Maintainer: Olimex */
        .timer          = &at91sam926x_timer,
        .map_io         = at91_map_io,
+       .handle_irq     = at91_aic_handle_irq,
        .init_early     = ek_init_early,
        .init_irq       = at91_init_irq_default,
        .init_machine   = ek_board_init,
index 7b3c3913551a53ccc7a08eef94b5a18b7bba428b..889c1bf71eb596d2efd28fc76d086f2d87a42b9d 100644 (file)
@@ -42,6 +42,7 @@
 
 #include <mach/hardware.h>
 #include <mach/board.h>
+#include <mach/at91_aic.h>
 #include <mach/at91sam9_smc.h>
 #include <mach/at91_shdwc.h>
 #include <mach/system_rev.h>
@@ -344,6 +345,7 @@ MACHINE_START(AT91SAM9260EK, "Atmel AT91SAM9260-EK")
        /* Maintainer: Atmel */
        .timer          = &at91sam926x_timer,
        .map_io         = at91_map_io,
+       .handle_irq     = at91_aic_handle_irq,
        .init_early     = ek_init_early,
        .init_irq       = at91_init_irq_default,
        .init_machine   = ek_board_init,
index 2736453821b0d55e9782d065107c176102ca4c35..2269be5fa3841075539fd106746ce7c7cc88776d 100644 (file)
@@ -46,6 +46,7 @@
 
 #include <mach/hardware.h>
 #include <mach/board.h>
+#include <mach/at91_aic.h>
 #include <mach/at91sam9_smc.h>
 #include <mach/at91_shdwc.h>
 #include <mach/system_rev.h>
@@ -615,6 +616,7 @@ MACHINE_START(AT91SAM9G10EK, "Atmel AT91SAM9G10-EK")
        /* Maintainer: Atmel */
        .timer          = &at91sam926x_timer,
        .map_io         = at91_map_io,
+       .handle_irq     = at91_aic_handle_irq,
        .init_early     = ek_init_early,
        .init_irq       = at91_init_irq_default,
        .init_machine   = ek_board_init,
index 983cb98d2465c7253b2c9c2900de5379e2636979..82adf581afc2eb48868ea1d3198685bff22d457a 100644 (file)
@@ -45,6 +45,7 @@
 
 #include <mach/hardware.h>
 #include <mach/board.h>
+#include <mach/at91_aic.h>
 #include <mach/at91sam9_smc.h>
 #include <mach/at91_shdwc.h>
 #include <mach/system_rev.h>
@@ -443,6 +444,7 @@ MACHINE_START(AT91SAM9263EK, "Atmel AT91SAM9263-EK")
        /* Maintainer: Atmel */
        .timer          = &at91sam926x_timer,
        .map_io         = at91_map_io,
+       .handle_irq     = at91_aic_handle_irq,
        .init_early     = ek_init_early,
        .init_irq       = at91_init_irq_default,
        .init_machine   = ek_board_init,
index 6860d3451100321a8bfd8930c6d5bc96e5fc3b9e..4ea4ee00364b44fd2fe1ef693d72e08e57a734e9 100644 (file)
@@ -44,6 +44,7 @@
 #include <asm/mach/irq.h>
 
 #include <mach/board.h>
+#include <mach/at91_aic.h>
 #include <mach/at91sam9_smc.h>
 #include <mach/system_rev.h>
 
@@ -413,6 +414,7 @@ MACHINE_START(AT91SAM9G20EK, "Atmel AT91SAM9G20-EK")
        /* Maintainer: Atmel */
        .timer          = &at91sam926x_timer,
        .map_io         = at91_map_io,
+       .handle_irq     = at91_aic_handle_irq,
        .init_early     = ek_init_early,
        .init_irq       = at91_init_irq_default,
        .init_machine   = ek_board_init,
@@ -422,6 +424,7 @@ MACHINE_START(AT91SAM9G20EK_2MMC, "Atmel AT91SAM9G20-EK 2 MMC Slot Mod")
        /* Maintainer: Atmel */
        .timer          = &at91sam926x_timer,
        .map_io         = at91_map_io,
+       .handle_irq     = at91_aic_handle_irq,
        .init_early     = ek_init_early,
        .init_irq       = at91_init_irq_default,
        .init_machine   = ek_board_init,
index 63163dc7df46c4b416fadf21031c393716861fcc..3d48ec15468594f6b3fde5654f4f709eb4a4abea 100644 (file)
@@ -43,6 +43,7 @@
 #include <asm/mach/irq.h>
 
 #include <mach/board.h>
+#include <mach/at91_aic.h>
 #include <mach/at91sam9_smc.h>
 #include <mach/at91_shdwc.h>
 #include <mach/system_rev.h>
@@ -503,6 +504,7 @@ MACHINE_START(AT91SAM9M10G45EK, "Atmel AT91SAM9M10G45-EK")
        /* Maintainer: Atmel */
        .timer          = &at91sam926x_timer,
        .map_io         = at91_map_io,
+       .handle_irq     = at91_aic_handle_irq,
        .init_early     = ek_init_early,
        .init_irq       = at91_init_irq_default,
        .init_machine   = ek_board_init,
index be3239f13daa64341598d1b5f33041ff44058eab..e7dc3ead7045f3f938c65729263a71be5050dafb 100644 (file)
@@ -31,6 +31,7 @@
 
 #include <mach/hardware.h>
 #include <mach/board.h>
+#include <mach/at91_aic.h>
 #include <mach/at91sam9_smc.h>
 #include <mach/at91_shdwc.h>
 
@@ -319,6 +320,7 @@ MACHINE_START(AT91SAM9RLEK, "Atmel AT91SAM9RL-EK")
        /* Maintainer: Atmel */
        .timer          = &at91sam926x_timer,
        .map_io         = at91_map_io,
+       .handle_irq     = at91_aic_handle_irq,
        .init_early     = ek_init_early,
        .init_irq       = at91_init_irq_default,
        .init_machine   = ek_board_init,
index 9d446f1bb45fe6fcc91d78a35932bb56823e685e..a4e031a039fd50c0fd407ffc34d6ae9240070301 100644 (file)
@@ -33,6 +33,7 @@
 
 #include <mach/hardware.h>
 #include <mach/board.h>
+#include <mach/at91_aic.h>
 #include <mach/at91sam9_smc.h>
 
 #include "sam9_smc.h"
@@ -178,6 +179,7 @@ static void __init snapper9260_board_init(void)
 MACHINE_START(SNAPPER_9260, "Bluewater Systems Snapper 9260/9G20 module")
        .timer          = &at91sam926x_timer,
        .map_io         = at91_map_io,
+       .handle_irq     = at91_aic_handle_irq,
        .init_early     = snapper9260_init_early,
        .init_irq       = at91_init_irq_default,
        .init_machine   = snapper9260_board_init,
index ee86f9d7ee72ed87bf408e273858be3dbe4586e1..29eae1626bf79ffa1ca4c4bf562d6ef255b81f82 100644 (file)
@@ -26,6 +26,7 @@
 #include <asm/mach/arch.h>
 
 #include <mach/board.h>
+#include <mach/at91_aic.h>
 #include <mach/at91sam9_smc.h>
 
 #include "sam9_smc.h"
@@ -287,6 +288,7 @@ MACHINE_START(PORTUXG20, "taskit PortuxG20")
        /* Maintainer: taskit GmbH */
        .timer          = &at91sam926x_timer,
        .map_io         = at91_map_io,
+       .handle_irq     = at91_aic_handle_irq,
        .init_early     = stamp9g20_init_early,
        .init_irq       = at91_init_irq_default,
        .init_machine   = portuxg20_board_init,
@@ -296,6 +298,7 @@ MACHINE_START(STAMP9G20, "taskit Stamp9G20")
        /* Maintainer: taskit GmbH */
        .timer          = &at91sam926x_timer,
        .map_io         = at91_map_io,
+       .handle_irq     = at91_aic_handle_irq,
        .init_early     = stamp9g20_init_early,
        .init_irq       = at91_init_irq_default,
        .init_machine   = stamp9g20evb_board_init,
index 95393fcaf199c9664bc6cafa8fafe17e826e5d92..c1476b9fe7b91a98ef279e4be2ecd250300bb1fc 100644 (file)
@@ -42,6 +42,7 @@
 
 #include <mach/hardware.h>
 #include <mach/board.h>
+#include <mach/at91_aic.h>
 #include <mach/at91sam9_smc.h>
 #include <mach/at91_shdwc.h>
 
@@ -358,6 +359,7 @@ MACHINE_START(USB_A9263, "CALAO USB_A9263")
        /* Maintainer: calao-systems */
        .timer          = &at91sam926x_timer,
        .map_io         = at91_map_io,
+       .handle_irq     = at91_aic_handle_irq,
        .init_early     = ek_init_early,
        .init_irq       = at91_init_irq_default,
        .init_machine   = ek_board_init,
@@ -367,6 +369,7 @@ MACHINE_START(USB_A9260, "CALAO USB_A9260")
        /* Maintainer: calao-systems */
        .timer          = &at91sam926x_timer,
        .map_io         = at91_map_io,
+       .handle_irq     = at91_aic_handle_irq,
        .init_early     = ek_init_early,
        .init_irq       = at91_init_irq_default,
        .init_machine   = ek_board_init,
@@ -376,6 +379,7 @@ MACHINE_START(USB_A9G20, "CALAO USB_A92G0")
        /* Maintainer: Jean-Christophe PLAGNIOL-VILLARD */
        .timer          = &at91sam926x_timer,
        .map_io         = at91_map_io,
+       .handle_irq     = at91_aic_handle_irq,
        .init_early     = ek_init_early,
        .init_irq       = at91_init_irq_default,
        .init_machine   = ek_board_init,
index d56665ea4b55d3a8259228d8801fe20a547b9bab..516d340549d8db4c4ffe0a5ff461aee9cb7e6175 100644 (file)
@@ -44,6 +44,7 @@
 
 #include <mach/hardware.h>
 #include <mach/board.h>
+#include <mach/at91_aic.h>
 #include <mach/at91rm9200_mc.h>
 #include <mach/at91_ramc.h>
 #include <mach/cpu.h>
@@ -590,6 +591,7 @@ MACHINE_START(YL9200, "uCdragon YL-9200")
        /* Maintainer: S.Birtles */
        .timer          = &at91rm9200_timer,
        .map_io         = at91_map_io,
+       .handle_irq     = at91_aic_handle_irq,
        .init_early     = yl9200_init_early,
        .init_irq       = at91_init_irq_default,
        .init_machine   = yl9200_board_init,
index 0a60bf837037dd67382163c30f3290ed30acb9ae..f49650677653a0f0488e6c64346fcf07e46ae555 100644 (file)
@@ -29,6 +29,8 @@ extern void __init at91x40_init_interrupts(unsigned int priority[]);
 extern void __init at91_aic_init(unsigned int priority[]);
 extern int  __init at91_aic_of_init(struct device_node *node,
                                    struct device_node *parent);
+extern int  __init at91_aic5_of_init(struct device_node *node,
+                                   struct device_node *parent);
 
 
  /* Timer */
index 325837a264c930fdbe1787d3ed2e61d3f75d1772..be42cf0e74bddd39ded6e1b54d7f17d351a24bc1 100644 (file)
@@ -26,6 +26,8 @@
 #include <linux/of_irq.h>
 #include <linux/of_gpio.h>
 
+#include <asm/mach/irq.h>
+
 #include <mach/hardware.h>
 #include <mach/at91_pio.h>
 
@@ -585,15 +587,14 @@ static struct irq_chip gpio_irqchip = {
 
 static void gpio_irq_handler(unsigned irq, struct irq_desc *desc)
 {
+       struct irq_chip *chip = irq_desc_get_chip(desc);
        struct irq_data *idata = irq_desc_get_irq_data(desc);
-       struct irq_chip *chip = irq_data_get_irq_chip(idata);
        struct at91_gpio_chip *at91_gpio = irq_data_get_irq_chip_data(idata);
        void __iomem    *pio = at91_gpio->regbase;
        unsigned long   isr;
        int             n;
 
-       /* temporarily mask (level sensitive) parent IRQ */
-       chip->irq_ack(idata);
+       chained_irq_enter(chip, desc);
        for (;;) {
                /* Reading ISR acks pending (edge triggered) GPIO interrupts.
                 * When there none are pending, we're finished unless we need
@@ -614,7 +615,7 @@ static void gpio_irq_handler(unsigned irq, struct irq_desc *desc)
                        n = find_next_bit(&isr, BITS_PER_LONG, n + 1);
                }
        }
-       chip->irq_unmask(idata);
+       chained_irq_exit(chip, desc);
        /* now it may re-trigger */
 }
 
index 3045781c473f5d427e84e9ad83e51592c5e3d3da..eaea66197fa17f606e8f5d2228b5efa61e936c86 100644 (file)
@@ -23,12 +23,23 @@ extern void __iomem *at91_aic_base;
        __raw_readl(at91_aic_base + field)
 
 #define at91_aic_write(field, value) \
-       __raw_writel(value, at91_aic_base + field);
+       __raw_writel(value, at91_aic_base + field)
 #else
 .extern at91_aic_base
 #endif
 
+/* Number of irq lines managed by AIC */
+#define NR_AIC_IRQS    32
+#define NR_AIC5_IRQS   128
+
+#define AT91_AIC5_SSR          0x0                     /* Source Select Register [AIC5] */
+#define        AT91_AIC5_INTSEL_MSK    (0x7f << 0)             /* Interrupt Line Selection Mask */
+
+#define AT91_AIC_IRQ_MIN_PRIORITY      0
+#define AT91_AIC_IRQ_MAX_PRIORITY      7
+
 #define AT91_AIC_SMR(n)                ((n) * 4)               /* Source Mode Registers 0-31 */
+#define AT91_AIC5_SMR          0x4                     /* Source Mode Register [AIC5] */
 #define                AT91_AIC_PRIOR          (7 << 0)                /* Priority Level */
 #define                AT91_AIC_SRCTYPE        (3 << 5)                /* Interrupt Source Type */
 #define                        AT91_AIC_SRCTYPE_LOW            (0 << 5)
@@ -37,29 +48,52 @@ extern void __iomem *at91_aic_base;
 #define                        AT91_AIC_SRCTYPE_RISING         (3 << 5)
 
 #define AT91_AIC_SVR(n)                (0x80 + ((n) * 4))      /* Source Vector Registers 0-31 */
+#define AT91_AIC5_SVR          0x8                     /* Source Vector Register [AIC5] */
 #define AT91_AIC_IVR           0x100                   /* Interrupt Vector Register */
+#define AT91_AIC5_IVR          0x10                    /* Interrupt Vector Register [AIC5] */
 #define AT91_AIC_FVR           0x104                   /* Fast Interrupt Vector Register */
+#define AT91_AIC5_FVR          0x14                    /* Fast Interrupt Vector Register [AIC5] */
 #define AT91_AIC_ISR           0x108                   /* Interrupt Status Register */
+#define AT91_AIC5_ISR          0x18                    /* Interrupt Status Register [AIC5] */
 #define                AT91_AIC_IRQID          (0x1f << 0)             /* Current Interrupt Identifier */
 
 #define AT91_AIC_IPR           0x10c                   /* Interrupt Pending Register */
+#define AT91_AIC5_IPR0         0x20                    /* Interrupt Pending Register 0 [AIC5] */
+#define AT91_AIC5_IPR1         0x24                    /* Interrupt Pending Register 1 [AIC5] */
+#define AT91_AIC5_IPR2         0x28                    /* Interrupt Pending Register 2 [AIC5] */
+#define AT91_AIC5_IPR3         0x2c                    /* Interrupt Pending Register 3 [AIC5] */
 #define AT91_AIC_IMR           0x110                   /* Interrupt Mask Register */
+#define AT91_AIC5_IMR          0x30                    /* Interrupt Mask Register [AIC5] */
 #define AT91_AIC_CISR          0x114                   /* Core Interrupt Status Register */
+#define AT91_AIC5_CISR         0x34                    /* Core Interrupt Status Register [AIC5] */
 #define                AT91_AIC_NFIQ           (1 << 0)                /* nFIQ Status */
 #define                AT91_AIC_NIRQ           (1 << 1)                /* nIRQ Status */
 
 #define AT91_AIC_IECR          0x120                   /* Interrupt Enable Command Register */
+#define AT91_AIC5_IECR         0x40                    /* Interrupt Enable Command Register [AIC5] */
 #define AT91_AIC_IDCR          0x124                   /* Interrupt Disable Command Register */
+#define AT91_AIC5_IDCR         0x44                    /* Interrupt Disable Command Register [AIC5] */
 #define AT91_AIC_ICCR          0x128                   /* Interrupt Clear Command Register */
+#define AT91_AIC5_ICCR         0x48                    /* Interrupt Clear Command Register [AIC5] */
 #define AT91_AIC_ISCR          0x12c                   /* Interrupt Set Command Register */
+#define AT91_AIC5_ISCR         0x4c                    /* Interrupt Set Command Register [AIC5] */
 #define AT91_AIC_EOICR         0x130                   /* End of Interrupt Command Register */
+#define AT91_AIC5_EOICR                0x38                    /* End of Interrupt Command Register [AIC5] */
 #define AT91_AIC_SPU           0x134                   /* Spurious Interrupt Vector Register */
+#define AT91_AIC5_SPU          0x3c                    /* Spurious Interrupt Vector Register [AIC5] */
 #define AT91_AIC_DCR           0x138                   /* Debug Control Register */
+#define AT91_AIC5_DCR          0x6c                    /* Debug Control Register [AIC5] */
 #define                AT91_AIC_DCR_PROT       (1 << 0)                /* Protection Mode */
 #define                AT91_AIC_DCR_GMSK       (1 << 1)                /* General Mask */
 
 #define AT91_AIC_FFER          0x140                   /* Fast Forcing Enable Register [SAM9 only] */
+#define AT91_AIC5_FFER         0x50                    /* Fast Forcing Enable Register [AIC5] */
 #define AT91_AIC_FFDR          0x144                   /* Fast Forcing Disable Register [SAM9 only] */
+#define AT91_AIC5_FFDR         0x54                    /* Fast Forcing Disable Register [AIC5] */
 #define AT91_AIC_FFSR          0x148                   /* Fast Forcing Status Register [SAM9 only] */
+#define AT91_AIC5_FFSR         0x58                    /* Fast Forcing Status Register [AIC5] */
+
+void at91_aic_handle_irq(struct pt_regs *regs);
+void at91_aic5_handle_irq(struct pt_regs *regs);
 
 #endif
diff --git a/arch/arm/mach-at91/include/mach/at91_spi.h b/arch/arm/mach-at91/include/mach/at91_spi.h
deleted file mode 100644 (file)
index 2f6ba0c..0000000
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * arch/arm/mach-at91/include/mach/at91_spi.h
- *
- * Copyright (C) 2005 Ivan Kokshaysky
- * Copyright (C) SAN People
- *
- * Serial Peripheral Interface (SPI) registers.
- * Based on AT91RM9200 datasheet revision E.
- *
- * 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.
- */
-
-#ifndef AT91_SPI_H
-#define AT91_SPI_H
-
-#define AT91_SPI_CR                    0x00            /* Control Register */
-#define                AT91_SPI_SPIEN          (1 <<  0)               /* SPI Enable */
-#define                AT91_SPI_SPIDIS         (1 <<  1)               /* SPI Disable */
-#define                AT91_SPI_SWRST          (1 <<  7)               /* SPI Software Reset */
-#define                AT91_SPI_LASTXFER       (1 << 24)               /* Last Transfer [SAM9261 only] */
-
-#define AT91_SPI_MR                    0x04            /* Mode Register */
-#define                AT91_SPI_MSTR           (1    <<  0)            /* Master/Slave Mode */
-#define                AT91_SPI_PS             (1    <<  1)            /* Peripheral Select */
-#define                        AT91_SPI_PS_FIXED       (0 << 1)
-#define                        AT91_SPI_PS_VARIABLE    (1 << 1)
-#define                AT91_SPI_PCSDEC         (1    <<  2)            /* Chip Select Decode */
-#define                AT91_SPI_DIV32          (1    <<  3)            /* Clock Selection [AT91RM9200 only] */
-#define                AT91_SPI_MODFDIS        (1    <<  4)            /* Mode Fault Detection */
-#define                AT91_SPI_LLB            (1    <<  7)            /* Local Loopback Enable */
-#define                AT91_SPI_PCS            (0xf  << 16)            /* Peripheral Chip Select */
-#define                AT91_SPI_DLYBCS         (0xff << 24)            /* Delay Between Chip Selects */
-
-#define AT91_SPI_RDR           0x08                    /* Receive Data Register */
-#define                AT91_SPI_RD             (0xffff <<  0)          /* Receive Data */
-#define                AT91_SPI_PCS            (0xf    << 16)          /* Peripheral Chip Select */
-
-#define AT91_SPI_TDR           0x0c                    /* Transmit Data Register */
-#define                AT91_SPI_TD             (0xffff <<  0)          /* Transmit Data */
-#define                AT91_SPI_PCS            (0xf    << 16)          /* Peripheral Chip Select */
-#define                AT91_SPI_LASTXFER       (1      << 24)          /* Last Transfer [SAM9261 only] */
-
-#define AT91_SPI_SR            0x10                    /* Status Register */
-#define                AT91_SPI_RDRF           (1 <<  0)               /* Receive Data Register Full */
-#define                AT91_SPI_TDRE           (1 <<  1)               /* Transmit Data Register Full */
-#define                AT91_SPI_MODF           (1 <<  2)               /* Mode Fault Error */
-#define                AT91_SPI_OVRES          (1 <<  3)               /* Overrun Error Status */
-#define                AT91_SPI_ENDRX          (1 <<  4)               /* End of RX buffer */
-#define                AT91_SPI_ENDTX          (1 <<  5)               /* End of TX buffer */
-#define                AT91_SPI_RXBUFF         (1 <<  6)               /* RX Buffer Full */
-#define                AT91_SPI_TXBUFE         (1 <<  7)               /* TX Buffer Empty */
-#define                AT91_SPI_NSSR           (1 <<  8)               /* NSS Rising [SAM9261 only] */
-#define                AT91_SPI_TXEMPTY        (1 <<  9)               /* Transmission Register Empty [SAM9261 only] */
-#define                AT91_SPI_SPIENS         (1 << 16)               /* SPI Enable Status */
-
-#define AT91_SPI_IER           0x14                    /* Interrupt Enable Register */
-#define AT91_SPI_IDR           0x18                    /* Interrupt Disable Register */
-#define AT91_SPI_IMR           0x1c                    /* Interrupt Mask Register */
-
-#define AT91_SPI_CSR(n)                (0x30 + ((n) * 4))      /* Chip Select Registers 0-3 */
-#define                AT91_SPI_CPOL           (1    <<  0)            /* Clock Polarity */
-#define                AT91_SPI_NCPHA          (1    <<  1)            /* Clock Phase */
-#define                AT91_SPI_CSAAT          (1    <<  3)            /* Chip Select Active After Transfer [SAM9261 only] */
-#define                AT91_SPI_BITS           (0xf  <<  4)            /* Bits Per Transfer */
-#define                        AT91_SPI_BITS_8         (0 << 4)
-#define                        AT91_SPI_BITS_9         (1 << 4)
-#define                        AT91_SPI_BITS_10        (2 << 4)
-#define                        AT91_SPI_BITS_11        (3 << 4)
-#define                        AT91_SPI_BITS_12        (4 << 4)
-#define                        AT91_SPI_BITS_13        (5 << 4)
-#define                        AT91_SPI_BITS_14        (6 << 4)
-#define                        AT91_SPI_BITS_15        (7 << 4)
-#define                        AT91_SPI_BITS_16        (8 << 4)
-#define                AT91_SPI_SCBR           (0xff <<  8)            /* Serial Clock Baud Rate */
-#define                AT91_SPI_DLYBS          (0xff << 16)            /* Delay before SPCK */
-#define                AT91_SPI_DLYBCT         (0xff << 24)            /* Delay between Consecutive Transfers */
-
-#endif
diff --git a/arch/arm/mach-at91/include/mach/at91_ssc.h b/arch/arm/mach-at91/include/mach/at91_ssc.h
deleted file mode 100644 (file)
index a81114c..0000000
+++ /dev/null
@@ -1,106 +0,0 @@
-/*
- * arch/arm/mach-at91/include/mach/at91_ssc.h
- *
- * Copyright (C) SAN People
- *
- * Serial Synchronous Controller (SSC) registers.
- * Based on AT91RM9200 datasheet revision E.
- *
- * 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.
- */
-
-#ifndef AT91_SSC_H
-#define AT91_SSC_H
-
-#define AT91_SSC_CR            0x00    /* Control Register */
-#define                AT91_SSC_RXEN           (1 <<  0)       /* Receive Enable */
-#define                AT91_SSC_RXDIS          (1 <<  1)       /* Receive Disable */
-#define                AT91_SSC_TXEN           (1 <<  8)       /* Transmit Enable */
-#define                AT91_SSC_TXDIS          (1 <<  9)       /* Transmit Disable */
-#define                AT91_SSC_SWRST          (1 << 15)       /* Software Reset */
-
-#define AT91_SSC_CMR           0x04    /* Clock Mode Register */
-#define                AT91_SSC_CMR_DIV        (0xfff << 0)    /* Clock Divider */
-
-#define AT91_SSC_RCMR          0x10    /* Receive Clock Mode Register */
-#define                AT91_SSC_CKS            (3    <<  0)    /* Clock Selection */
-#define                        AT91_SSC_CKS_DIV                (0 << 0)
-#define                        AT91_SSC_CKS_CLOCK              (1 << 0)
-#define                        AT91_SSC_CKS_PIN                (2 << 0)
-#define                AT91_SSC_CKO            (7    <<  2)    /* Clock Output Mode Selection */
-#define                        AT91_SSC_CKO_NONE               (0 << 2)
-#define                        AT91_SSC_CKO_CONTINUOUS         (1 << 2)
-#define                AT91_SSC_CKI            (1    <<  5)    /* Clock Inversion */
-#define                        AT91_SSC_CKI_FALLING            (0 << 5)
-#define                        AT91_SSC_CK_RISING              (1 << 5)
-#define                AT91_SSC_CKG            (1    <<  6)    /* Receive Clock Gating Selection [AT91SAM9261 only] */
-#define                        AT91_SSC_CKG_NONE               (0 << 6)
-#define                        AT91_SSC_CKG_RFLOW              (1 << 6)
-#define                        AT91_SSC_CKG_RFHIGH             (2 << 6)
-#define                AT91_SSC_START          (0xf  <<  8)    /* Start Selection */
-#define                        AT91_SSC_START_CONTINUOUS       (0 << 8)
-#define                        AT91_SSC_START_TX_RX            (1 << 8)
-#define                        AT91_SSC_START_LOW_RF           (2 << 8)
-#define                        AT91_SSC_START_HIGH_RF          (3 << 8)
-#define                        AT91_SSC_START_FALLING_RF       (4 << 8)
-#define                        AT91_SSC_START_RISING_RF        (5 << 8)
-#define                        AT91_SSC_START_LEVEL_RF         (6 << 8)
-#define                        AT91_SSC_START_EDGE_RF          (7 << 8)
-#define                AT91_SSC_STOP           (1    << 12)    /* Receive Stop Selection [AT91SAM9261 only] */
-#define                AT91_SSC_STTDLY         (0xff << 16)    /* Start Delay */
-#define                AT91_SSC_PERIOD         (0xff << 24)    /* Period Divider Selection */
-
-#define AT91_SSC_RFMR          0x14    /* Receive Frame Mode Register */
-#define                AT91_SSC_DATALEN        (0x1f <<  0)    /* Data Length */
-#define                AT91_SSC_LOOP           (1    <<  5)    /* Loop Mode */
-#define                AT91_SSC_MSBF           (1    <<  7)    /* Most Significant Bit First */
-#define                AT91_SSC_DATNB          (0xf  <<  8)    /* Data Number per Frame */
-#define                AT91_SSC_FSLEN          (0xf  << 16)    /* Frame Sync Length */
-#define                AT91_SSC_FSOS           (7    << 20)    /* Frame Sync Output Selection */
-#define                        AT91_SSC_FSOS_NONE              (0 << 20)
-#define                        AT91_SSC_FSOS_NEGATIVE          (1 << 20)
-#define                        AT91_SSC_FSOS_POSITIVE          (2 << 20)
-#define                        AT91_SSC_FSOS_LOW               (3 << 20)
-#define                        AT91_SSC_FSOS_HIGH              (4 << 20)
-#define                        AT91_SSC_FSOS_TOGGLE            (5 << 20)
-#define                AT91_SSC_FSEDGE         (1    << 24)    /* Frame Sync Edge Detection */
-#define                        AT91_SSC_FSEDGE_POSITIVE        (0 << 24)
-#define                        AT91_SSC_FSEDGE_NEGATIVE        (1 << 24)
-
-#define AT91_SSC_TCMR          0x18    /* Transmit Clock Mode Register */
-#define AT91_SSC_TFMR          0x1c    /* Transmit Fram Mode Register */
-#define                AT91_SSC_DATDEF         (1 <<  5)       /* Data Default Value */
-#define                AT91_SSC_FSDEN          (1 << 23)       /* Frame Sync Data Enable */
-
-#define AT91_SSC_RHR           0x20    /* Receive Holding Register */
-#define AT91_SSC_THR           0x24    /* Transmit Holding Register */
-#define AT91_SSC_RSHR          0x30    /* Receive Sync Holding Register */
-#define AT91_SSC_TSHR          0x34    /* Transmit Sync Holding Register */
-
-#define AT91_SSC_RC0R          0x38    /* Receive Compare 0 Register [AT91SAM9261 only] */
-#define AT91_SSC_RC1R          0x3c    /* Receive Compare 1 Register [AT91SAM9261 only] */
-
-#define AT91_SSC_SR            0x40    /* Status Register */
-#define                AT91_SSC_TXRDY          (1 <<  0)       /* Transmit Ready */
-#define                AT91_SSC_TXEMPTY        (1 <<  1)       /* Transmit Empty */
-#define                AT91_SSC_ENDTX          (1 <<  2)       /* End of Transmission */
-#define                AT91_SSC_TXBUFE         (1 <<  3)       /* Transmit Buffer Empty */
-#define                AT91_SSC_RXRDY          (1 <<  4)       /* Receive Ready */
-#define                AT91_SSC_OVRUN          (1 <<  5)       /* Receive Overrun */
-#define                AT91_SSC_ENDRX          (1 <<  6)       /* End of Reception */
-#define                AT91_SSC_RXBUFF         (1 <<  7)       /* Receive Buffer Full */
-#define                AT91_SSC_CP0            (1 <<  8)       /* Compare 0 [AT91SAM9261 only] */
-#define                AT91_SSC_CP1            (1 <<  9)       /* Compare 1 [AT91SAM9261 only] */
-#define                AT91_SSC_TXSYN          (1 << 10)       /* Transmit Sync */
-#define                AT91_SSC_RXSYN          (1 << 11)       /* Receive Sync */
-#define                AT91_SSC_TXENA          (1 << 16)       /* Transmit Enable */
-#define                AT91_SSC_RXENA          (1 << 17)       /* Receive Enable */
-
-#define AT91_SSC_IER           0x44    /* Interrupt Enable Register */
-#define AT91_SSC_IDR           0x48    /* Interrupt Disable Register */
-#define AT91_SSC_IMR           0x4c    /* Interrupt Mask Register */
-
-#endif
diff --git a/arch/arm/mach-at91/include/mach/entry-macro.S b/arch/arm/mach-at91/include/mach/entry-macro.S
deleted file mode 100644 (file)
index 903bf20..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * arch/arm/mach-at91/include/mach/entry-macro.S
- *
- *  Copyright (C) 2003-2005 SAN People
- *
- * Low-level IRQ helper macros for AT91RM9200 platforms
- *
- * 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.
- */
-
-#include <mach/hardware.h>
-#include <mach/at91_aic.h>
-
-       .macro  get_irqnr_preamble, base, tmp
-       ldr     \base, =at91_aic_base           @ base virtual address of AIC peripheral
-       ldr     \base, [\base]
-       .endm
-
-       .macro  get_irqnr_and_base, irqnr, irqstat, base, tmp
-       ldr     \irqnr, [\base, #AT91_AIC_IVR]          @ read IRQ vector register: de-asserts nIRQ to processor (and clears interrupt)
-       ldr     \irqstat, [\base, #AT91_AIC_ISR]        @ read interrupt source number
-       teq     \irqstat, #0                            @ ISR is 0 when no current interrupt, or spurious interrupt
-       streq   \tmp, [\base, #AT91_AIC_EOICR]          @ not going to be handled further, then ACK it now.
-       .endm
-
diff --git a/arch/arm/mach-at91/include/mach/irqs.h b/arch/arm/mach-at91/include/mach/irqs.h
deleted file mode 100644 (file)
index ac8b7df..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * arch/arm/mach-at91/include/mach/irqs.h
- *
- *  Copyright (C) 2004 SAN People
- *
- * 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.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- */
-
-#ifndef __ASM_ARCH_IRQS_H
-#define __ASM_ARCH_IRQS_H
-
-#include <linux/io.h>
-#include <mach/at91_aic.h>
-
-#define NR_AIC_IRQS 32
-
-
-/*
- * Acknowledge interrupt with AIC after interrupt has been handled.
- *   (by kernel/irq.c)
- */
-#define irq_finish(irq) do { at91_aic_write(AT91_AIC_EOICR, 0); } while (0)
-
-
-/*
- * IRQ interrupt symbols are the AT91xxx_ID_* symbols
- * for IRQs handled directly through the AIC, or else the AT91_PIN_*
- * symbols in gpio.h for ones handled indirectly as GPIOs.
- * We make provision for 5 banks of GPIO.
- */
-#define        NR_IRQS         (NR_AIC_IRQS + (5 * 32))
-
-/* FIQ is AIC source 0. */
-#define FIQ_START AT91_ID_FIQ
-
-#endif
index cfcfcbe362699d1ed04be46e2d9680bc89917e58..1e02c0e49dccb76949be0fc9d855a5a3bb3504bc 100644 (file)
@@ -23,6 +23,7 @@
 #include <linux/init.h>
 #include <linux/module.h>
 #include <linux/mm.h>
+#include <linux/bitmap.h>
 #include <linux/types.h>
 #include <linux/irq.h>
 #include <linux/of.h>
 #include <linux/of_irq.h>
 #include <linux/irqdomain.h>
 #include <linux/err.h>
+#include <linux/slab.h>
 
 #include <mach/hardware.h>
 #include <asm/irq.h>
 #include <asm/setup.h>
 
+#include <asm/exception.h>
 #include <asm/mach/arch.h>
 #include <asm/mach/irq.h>
 #include <asm/mach/map.h>
 
+#include <mach/at91_aic.h>
+
 void __iomem *at91_aic_base;
 static struct irq_domain *at91_aic_domain;
 static struct device_node *at91_aic_np;
+static unsigned int n_irqs = NR_AIC_IRQS;
+static unsigned long at91_aic_caps = 0;
+
+/* AIC5 introduces a Source Select Register */
+#define AT91_AIC_CAP_AIC5      (1 << 0)
+#define has_aic5()             (at91_aic_caps & AT91_AIC_CAP_AIC5)
+
+#ifdef CONFIG_PM
+
+static unsigned long *wakeups;
+static unsigned long *backups;
+
+#define set_backup(bit) set_bit(bit, backups)
+#define clear_backup(bit) clear_bit(bit, backups)
+
+static int at91_aic_pm_init(void)
+{
+       backups = kzalloc(BITS_TO_LONGS(n_irqs) * sizeof(*backups), GFP_KERNEL);
+       if (!backups)
+               return -ENOMEM;
+
+       wakeups = kzalloc(BITS_TO_LONGS(n_irqs) * sizeof(*backups), GFP_KERNEL);
+       if (!wakeups) {
+               kfree(backups);
+               return -ENOMEM;
+       }
+
+       return 0;
+}
+
+static int at91_aic_set_wake(struct irq_data *d, unsigned value)
+{
+       if (unlikely(d->hwirq >= n_irqs))
+               return -EINVAL;
+
+       if (value)
+               set_bit(d->hwirq, wakeups);
+       else
+               clear_bit(d->hwirq, wakeups);
+
+       return 0;
+}
+
+void at91_irq_suspend(void)
+{
+       int i = 0, bit;
+
+       if (has_aic5()) {
+               /* disable enabled irqs */
+               while ((bit = find_next_bit(backups, n_irqs, i)) < n_irqs) {
+                       at91_aic_write(AT91_AIC5_SSR,
+                                      bit & AT91_AIC5_INTSEL_MSK);
+                       at91_aic_write(AT91_AIC5_IDCR, 1);
+                       i = bit;
+               }
+               /* enable wakeup irqs */
+               i = 0;
+               while ((bit = find_next_bit(wakeups, n_irqs, i)) < n_irqs) {
+                       at91_aic_write(AT91_AIC5_SSR,
+                                      bit & AT91_AIC5_INTSEL_MSK);
+                       at91_aic_write(AT91_AIC5_IECR, 1);
+                       i = bit;
+               }
+       } else {
+               at91_aic_write(AT91_AIC_IDCR, *backups);
+               at91_aic_write(AT91_AIC_IECR, *wakeups);
+       }
+}
+
+void at91_irq_resume(void)
+{
+       int i = 0, bit;
+
+       if (has_aic5()) {
+               /* disable wakeup irqs */
+               while ((bit = find_next_bit(wakeups, n_irqs, i)) < n_irqs) {
+                       at91_aic_write(AT91_AIC5_SSR,
+                                      bit & AT91_AIC5_INTSEL_MSK);
+                       at91_aic_write(AT91_AIC5_IDCR, 1);
+                       i = bit;
+               }
+               /* enable irqs disabled for suspend */
+               i = 0;
+               while ((bit = find_next_bit(backups, n_irqs, i)) < n_irqs) {
+                       at91_aic_write(AT91_AIC5_SSR,
+                                      bit & AT91_AIC5_INTSEL_MSK);
+                       at91_aic_write(AT91_AIC5_IECR, 1);
+                       i = bit;
+               }
+       } else {
+               at91_aic_write(AT91_AIC_IDCR, *wakeups);
+               at91_aic_write(AT91_AIC_IECR, *backups);
+       }
+}
+
+#else
+static inline int at91_aic_pm_init(void)
+{
+       return 0;
+}
+
+#define set_backup(bit)
+#define clear_backup(bit)
+#define at91_aic_set_wake      NULL
+
+#endif /* CONFIG_PM */
+
+asmlinkage void __exception_irq_entry
+at91_aic_handle_irq(struct pt_regs *regs)
+{
+       u32 irqnr;
+       u32 irqstat;
+
+       irqnr = at91_aic_read(AT91_AIC_IVR);
+       irqstat = at91_aic_read(AT91_AIC_ISR);
+
+       /*
+        * ISR value is 0 when there is no current interrupt or when there is
+        * a spurious interrupt
+        */
+       if (!irqstat)
+               at91_aic_write(AT91_AIC_EOICR, 0);
+       else
+               handle_IRQ(irqnr, regs);
+}
+
+asmlinkage void __exception_irq_entry
+at91_aic5_handle_irq(struct pt_regs *regs)
+{
+       u32 irqnr;
+       u32 irqstat;
+
+       irqnr = at91_aic_read(AT91_AIC5_IVR);
+       irqstat = at91_aic_read(AT91_AIC5_ISR);
+
+       if (!irqstat)
+               at91_aic_write(AT91_AIC5_EOICR, 0);
+       else
+               handle_IRQ(irqnr, regs);
+}
 
 static void at91_aic_mask_irq(struct irq_data *d)
 {
        /* Disable interrupt on AIC */
        at91_aic_write(AT91_AIC_IDCR, 1 << d->hwirq);
+       /* Update ISR cache */
+       clear_backup(d->hwirq);
+}
+
+static void __maybe_unused at91_aic5_mask_irq(struct irq_data *d)
+{
+       /* Disable interrupt on AIC5 */
+       at91_aic_write(AT91_AIC5_SSR, d->hwirq & AT91_AIC5_INTSEL_MSK);
+       at91_aic_write(AT91_AIC5_IDCR, 1);
+       /* Update ISR cache */
+       clear_backup(d->hwirq);
 }
 
 static void at91_aic_unmask_irq(struct irq_data *d)
 {
        /* Enable interrupt on AIC */
        at91_aic_write(AT91_AIC_IECR, 1 << d->hwirq);
+       /* Update ISR cache */
+       set_backup(d->hwirq);
+}
+
+static void __maybe_unused at91_aic5_unmask_irq(struct irq_data *d)
+{
+       /* Enable interrupt on AIC5 */
+       at91_aic_write(AT91_AIC5_SSR, d->hwirq & AT91_AIC5_INTSEL_MSK);
+       at91_aic_write(AT91_AIC5_IECR, 1);
+       /* Update ISR cache */
+       set_backup(d->hwirq);
 }
 
-unsigned int at91_extern_irq;
+static void at91_aic_eoi(struct irq_data *d)
+{
+       /*
+        * Mark end-of-interrupt on AIC, the controller doesn't care about
+        * the value written. Moreover it's a write-only register.
+        */
+       at91_aic_write(AT91_AIC_EOICR, 0);
+}
+
+static void __maybe_unused at91_aic5_eoi(struct irq_data *d)
+{
+       at91_aic_write(AT91_AIC5_EOICR, 0);
+}
 
-#define is_extern_irq(hwirq) ((1 << (hwirq)) & at91_extern_irq)
+unsigned long *at91_extern_irq;
 
-static int at91_aic_set_type(struct irq_data *d, unsigned type)
+#define is_extern_irq(hwirq) test_bit(hwirq, at91_extern_irq)
+
+static int at91_aic_compute_srctype(struct irq_data *d, unsigned type)
 {
-       unsigned int smr, srctype;
+       int srctype;
 
        switch (type) {
        case IRQ_TYPE_LEVEL_HIGH:
@@ -74,65 +255,51 @@ static int at91_aic_set_type(struct irq_data *d, unsigned type)
                if ((d->hwirq == AT91_ID_FIQ) || is_extern_irq(d->hwirq))               /* only supported on external interrupts */
                        srctype = AT91_AIC_SRCTYPE_LOW;
                else
-                       return -EINVAL;
+                       srctype = -EINVAL;
                break;
        case IRQ_TYPE_EDGE_FALLING:
                if ((d->hwirq == AT91_ID_FIQ) || is_extern_irq(d->hwirq))               /* only supported on external interrupts */
                        srctype = AT91_AIC_SRCTYPE_FALLING;
                else
-                       return -EINVAL;
+                       srctype = -EINVAL;
                break;
        default:
-               return -EINVAL;
+               srctype = -EINVAL;
        }
 
-       smr = at91_aic_read(AT91_AIC_SMR(d->hwirq)) & ~AT91_AIC_SRCTYPE;
-       at91_aic_write(AT91_AIC_SMR(d->hwirq), smr | srctype);
-       return 0;
+       return srctype;
 }
 
-#ifdef CONFIG_PM
-
-static u32 wakeups;
-static u32 backups;
-
-static int at91_aic_set_wake(struct irq_data *d, unsigned value)
+static int at91_aic_set_type(struct irq_data *d, unsigned type)
 {
-       if (unlikely(d->hwirq >= NR_AIC_IRQS))
-               return -EINVAL;
-
-       if (value)
-               wakeups |= (1 << d->hwirq);
-       else
-               wakeups &= ~(1 << d->hwirq);
+       unsigned int smr;
+       int srctype;
+
+       srctype = at91_aic_compute_srctype(d, type);
+       if (srctype < 0)
+               return srctype;
+
+       if (has_aic5()) {
+               at91_aic_write(AT91_AIC5_SSR,
+                              d->hwirq & AT91_AIC5_INTSEL_MSK);
+               smr = at91_aic_read(AT91_AIC5_SMR) & ~AT91_AIC_SRCTYPE;
+               at91_aic_write(AT91_AIC5_SMR, smr | srctype);
+       } else {
+               smr = at91_aic_read(AT91_AIC_SMR(d->hwirq))
+                     & ~AT91_AIC_SRCTYPE;
+               at91_aic_write(AT91_AIC_SMR(d->hwirq), smr | srctype);
+       }
 
        return 0;
 }
 
-void at91_irq_suspend(void)
-{
-       backups = at91_aic_read(AT91_AIC_IMR);
-       at91_aic_write(AT91_AIC_IDCR, backups);
-       at91_aic_write(AT91_AIC_IECR, wakeups);
-}
-
-void at91_irq_resume(void)
-{
-       at91_aic_write(AT91_AIC_IDCR, wakeups);
-       at91_aic_write(AT91_AIC_IECR, backups);
-}
-
-#else
-#define at91_aic_set_wake      NULL
-#endif
-
 static struct irq_chip at91_aic_chip = {
        .name           = "AIC",
-       .irq_ack        = at91_aic_mask_irq,
        .irq_mask       = at91_aic_mask_irq,
        .irq_unmask     = at91_aic_unmask_irq,
        .irq_set_type   = at91_aic_set_type,
        .irq_set_wake   = at91_aic_set_wake,
+       .irq_eoi        = at91_aic_eoi,
 };
 
 static void __init at91_aic_hw_init(unsigned int spu_vector)
@@ -161,41 +328,172 @@ static void __init at91_aic_hw_init(unsigned int spu_vector)
        at91_aic_write(AT91_AIC_ICCR, 0xFFFFFFFF);
 }
 
+static void __init __maybe_unused at91_aic5_hw_init(unsigned int spu_vector)
+{
+       int i;
+
+       /*
+        * Perform 8 End Of Interrupt Command to make sure AIC
+        * will not Lock out nIRQ
+        */
+       for (i = 0; i < 8; i++)
+               at91_aic_write(AT91_AIC5_EOICR, 0);
+
+       /*
+        * Spurious Interrupt ID in Spurious Vector Register.
+        * When there is no current interrupt, the IRQ Vector Register
+        * reads the value stored in AIC_SPU
+        */
+       at91_aic_write(AT91_AIC5_SPU, spu_vector);
+
+       /* No debugging in AIC: Debug (Protect) Control Register */
+       at91_aic_write(AT91_AIC5_DCR, 0);
+
+       /* Disable and clear all interrupts initially */
+       for (i = 0; i < n_irqs; i++) {
+               at91_aic_write(AT91_AIC5_SSR, i & AT91_AIC5_INTSEL_MSK);
+               at91_aic_write(AT91_AIC5_IDCR, 1);
+               at91_aic_write(AT91_AIC5_ICCR, 1);
+       }
+}
+
 #if defined(CONFIG_OF)
+static unsigned int *at91_aic_irq_priorities;
+
 static int at91_aic_irq_map(struct irq_domain *h, unsigned int virq,
                                                        irq_hw_number_t hw)
 {
        /* Put virq number in Source Vector Register */
        at91_aic_write(AT91_AIC_SVR(hw), virq);
 
-       /* Active Low interrupt, without priority */
-       at91_aic_write(AT91_AIC_SMR(hw), AT91_AIC_SRCTYPE_LOW);
+       /* Active Low interrupt, with priority */
+       at91_aic_write(AT91_AIC_SMR(hw),
+                      AT91_AIC_SRCTYPE_LOW | at91_aic_irq_priorities[hw]);
 
-       irq_set_chip_and_handler(virq, &at91_aic_chip, handle_level_irq);
+       irq_set_chip_and_handler(virq, &at91_aic_chip, handle_fasteoi_irq);
        set_irq_flags(virq, IRQF_VALID | IRQF_PROBE);
 
        return 0;
 }
 
+static int at91_aic5_irq_map(struct irq_domain *h, unsigned int virq,
+               irq_hw_number_t hw)
+{
+       at91_aic_write(AT91_AIC5_SSR, hw & AT91_AIC5_INTSEL_MSK);
+
+       /* Put virq number in Source Vector Register */
+       at91_aic_write(AT91_AIC5_SVR, virq);
+
+       /* Active Low interrupt, with priority */
+       at91_aic_write(AT91_AIC5_SMR,
+                      AT91_AIC_SRCTYPE_LOW | at91_aic_irq_priorities[hw]);
+
+       irq_set_chip_and_handler(virq, &at91_aic_chip, handle_fasteoi_irq);
+       set_irq_flags(virq, IRQF_VALID | IRQF_PROBE);
+
+       return 0;
+}
+
+static int at91_aic_irq_domain_xlate(struct irq_domain *d, struct device_node *ctrlr,
+                               const u32 *intspec, unsigned int intsize,
+                               irq_hw_number_t *out_hwirq, unsigned int *out_type)
+{
+       if (WARN_ON(intsize < 3))
+               return -EINVAL;
+       if (WARN_ON(intspec[0] >= n_irqs))
+               return -EINVAL;
+       if (WARN_ON((intspec[2] < AT91_AIC_IRQ_MIN_PRIORITY)
+                   || (intspec[2] > AT91_AIC_IRQ_MAX_PRIORITY)))
+               return -EINVAL;
+
+       *out_hwirq = intspec[0];
+       *out_type = intspec[1] & IRQ_TYPE_SENSE_MASK;
+       at91_aic_irq_priorities[*out_hwirq] = intspec[2];
+
+       return 0;
+}
+
 static struct irq_domain_ops at91_aic_irq_ops = {
        .map    = at91_aic_irq_map,
-       .xlate  = irq_domain_xlate_twocell,
+       .xlate  = at91_aic_irq_domain_xlate,
 };
 
-int __init at91_aic_of_init(struct device_node *node,
-                                    struct device_node *parent)
+int __init at91_aic_of_common_init(struct device_node *node,
+                                   struct device_node *parent)
 {
+       struct property *prop;
+       const __be32 *p;
+       u32 val;
+
+       at91_extern_irq = kzalloc(BITS_TO_LONGS(n_irqs)
+                                 * sizeof(*at91_extern_irq), GFP_KERNEL);
+       if (!at91_extern_irq)
+               return -ENOMEM;
+
+       if (at91_aic_pm_init()) {
+               kfree(at91_extern_irq);
+               return -ENOMEM;
+       }
+
+       at91_aic_irq_priorities = kzalloc(n_irqs
+                                         * sizeof(*at91_aic_irq_priorities),
+                                         GFP_KERNEL);
+       if (!at91_aic_irq_priorities)
+               return -ENOMEM;
+
        at91_aic_base = of_iomap(node, 0);
        at91_aic_np = node;
 
-       at91_aic_domain = irq_domain_add_linear(at91_aic_np, NR_AIC_IRQS,
+       at91_aic_domain = irq_domain_add_linear(at91_aic_np, n_irqs,
                                                &at91_aic_irq_ops, NULL);
        if (!at91_aic_domain)
                panic("Unable to add AIC irq domain (DT)\n");
 
+       of_property_for_each_u32(node, "atmel,external-irqs", prop, p, val) {
+               if (val >= n_irqs)
+                       pr_warn("AIC: external irq %d >= %d skip it\n",
+                               val, n_irqs);
+               else
+                       set_bit(val, at91_extern_irq);
+       }
+
        irq_set_default_host(at91_aic_domain);
 
-       at91_aic_hw_init(NR_AIC_IRQS);
+       return 0;
+}
+
+int __init at91_aic_of_init(struct device_node *node,
+                                    struct device_node *parent)
+{
+       int err;
+
+       err = at91_aic_of_common_init(node, parent);
+       if (err)
+               return err;
+
+       at91_aic_hw_init(n_irqs);
+
+       return 0;
+}
+
+int __init at91_aic5_of_init(struct device_node *node,
+                                    struct device_node *parent)
+{
+       int err;
+
+       at91_aic_caps |= AT91_AIC_CAP_AIC5;
+       n_irqs = NR_AIC5_IRQS;
+       at91_aic_chip.irq_ack           = at91_aic5_mask_irq;
+       at91_aic_chip.irq_mask          = at91_aic5_mask_irq;
+       at91_aic_chip.irq_unmask        = at91_aic5_unmask_irq;
+       at91_aic_chip.irq_eoi           = at91_aic5_eoi;
+       at91_aic_irq_ops.map            = at91_aic5_irq_map;
+
+       err = at91_aic_of_common_init(node, parent);
+       if (err)
+               return err;
+
+       at91_aic5_hw_init(n_irqs);
 
        return 0;
 }
@@ -204,22 +502,25 @@ int __init at91_aic_of_init(struct device_node *node,
 /*
  * Initialize the AIC interrupt controller.
  */
-void __init at91_aic_init(unsigned int priority[NR_AIC_IRQS])
+void __init at91_aic_init(unsigned int *priority)
 {
        unsigned int i;
        int irq_base;
 
+       if (at91_aic_pm_init())
+               panic("Unable to allocate bit maps\n");
+
        at91_aic_base = ioremap(AT91_AIC, 512);
        if (!at91_aic_base)
                panic("Unable to ioremap AIC registers\n");
 
        /* Add irq domain for AIC */
-       irq_base = irq_alloc_descs(-1, 0, NR_AIC_IRQS, 0);
+       irq_base = irq_alloc_descs(-1, 0, n_irqs, 0);
        if (irq_base < 0) {
                WARN(1, "Cannot allocate irq_descs, assuming pre-allocated\n");
                irq_base = 0;
        }
-       at91_aic_domain = irq_domain_add_legacy(at91_aic_np, NR_AIC_IRQS,
+       at91_aic_domain = irq_domain_add_legacy(at91_aic_np, n_irqs,
                                                irq_base, 0,
                                                &irq_domain_simple_ops, NULL);
 
@@ -232,15 +533,14 @@ void __init at91_aic_init(unsigned int priority[NR_AIC_IRQS])
         * The IVR is used by macro get_irqnr_and_base to read and verify.
         * The irq number is NR_AIC_IRQS when a spurious interrupt has occurred.
         */
-       for (i = 0; i < NR_AIC_IRQS; i++) {
+       for (i = 0; i < n_irqs; i++) {
                /* Put hardware irq number in Source Vector Register: */
-               at91_aic_write(AT91_AIC_SVR(i), i);
+               at91_aic_write(AT91_AIC_SVR(i), NR_IRQS_LEGACY + i);
                /* Active Low interrupt, with the specified priority */
                at91_aic_write(AT91_AIC_SMR(i), AT91_AIC_SRCTYPE_LOW | priority[i]);
-
-               irq_set_chip_and_handler(i, &at91_aic_chip, handle_level_irq);
+               irq_set_chip_and_handler(NR_IRQS_LEGACY + i, &at91_aic_chip, handle_fasteoi_irq);
                set_irq_flags(i, IRQF_VALID | IRQF_PROBE);
        }
 
-       at91_aic_hw_init(NR_AIC_IRQS);
+       at91_aic_hw_init(n_irqs);
 }
index 1bfaad628731b262c474bc23217a30f4119eece3..2c2d86505a541fe1964f3f717d7e81c04f9e6a30 100644 (file)
@@ -25,6 +25,7 @@
 #include <asm/mach/time.h>
 #include <asm/mach/irq.h>
 
+#include <mach/at91_aic.h>
 #include <mach/at91_pmc.h>
 #include <mach/cpu.h>
 
index f2f8a58470182c5d1d783b1a3496833f1b1dfbc7..c53469802c03cf0e79640e5b7af53ee7df83abbe 100644 (file)
 #include <plat/board-ams-delta.h>
 #include <plat/keypad.h>
 #include <plat/mux.h>
-#include <plat/usb.h>
 #include <plat/board.h>
 
 #include <mach/hardware.h>
 #include <mach/ams-delta-fiq.h>
 #include <mach/camera.h>
+#include <mach/usb.h>
 
 #include "iomap.h"
 #include "common.h"
index e75e2d55a2d72ba133c5e923389c03512058461e..6ec385e2b98e93553de87814452eacb95de775fb 100644 (file)
 #include <asm/mach/map.h>
 
 #include <plat/mux.h>
-#include <plat/usb.h>
 #include <plat/board.h>
+
+#include <mach/usb.h>
+
 #include "common.h"
 
 /* assume no Mini-AB port */
index a28e989a63f4369f94cd0081e11cb4f28f407215..44a4ab195fbc54ec0537d24328fed150216d8e3b 100644 (file)
 #include <plat/dma.h>
 #include <plat/tc.h>
 #include <plat/irda.h>
-#include <plat/usb.h>
 #include <plat/keypad.h>
 #include <plat/flash.h>
 
 #include <mach/hardware.h>
+#include <mach/usb.h>
 
 #include "common.h"
 #include "board-h2.h"
index 108a8640fc6f04c2c42c0accc0d6602716831ef0..86cb5a04a404e2ea3b8c89f5fb3051ab1d3583ec 100644 (file)
 
 #include <plat/mux.h>
 #include <plat/tc.h>
-#include <plat/usb.h>
 #include <plat/keypad.h>
 #include <plat/dma.h>
 #include <plat/flash.h>
 
 #include <mach/hardware.h>
 #include <mach/irqs.h>
+#include <mach/usb.h>
 
 #include "common.h"
 #include "board-h3.h"
index 118a9d4a4c54a56b2bad8b261c60335b3f3a3f82..b3f6e943e6616ca8f82874e56fbe408c49de086f 100644 (file)
 #include <plat/omap7xx.h>
 #include <plat/board.h>
 #include <plat/keypad.h>
-#include <plat/usb.h>
 #include <plat/mmc.h>
 
 #include <mach/irqs.h>
+#include <mach/usb.h>
 
 #include "common.h"
 
index 7970223a559d552d270953905a2107e3dfb2446f..f21c2966daad7f4cd820ed1594e64a13756bf3a9 100644 (file)
 #include <plat/flash.h>
 #include <plat/fpga.h>
 #include <plat/tc.h>
-#include <plat/usb.h>
 #include <plat/keypad.h>
 #include <plat/mmc.h>
 
 #include <mach/hardware.h>
+#include <mach/usb.h>
 
 #include "iomap.h"
 #include "common.h"
index 7212ae97f44acfc1ff508fbca348a3ff26702a8a..4007a372481b9a9bfac27c9fa8d55d2ed672fa27 100644 (file)
@@ -26,7 +26,6 @@
 #include <asm/mach/map.h>
 
 #include <plat/mux.h>
-#include <plat/usb.h>
 #include <plat/board.h>
 #include <plat/keypad.h>
 #include <plat/lcd_mipid.h>
@@ -34,6 +33,7 @@
 #include <plat/clock.h>
 
 #include <mach/hardware.h>
+#include <mach/usb.h>
 
 #include "common.h"
 
index da8d872d3d1cddf00bdab9c3bdec4684ec585989..8784705edb60135aac86a8bc660b02a8e1f284f5 100644 (file)
 #include <asm/mach/map.h>
 
 #include <plat/flash.h>
-#include <plat/usb.h>
 #include <plat/mux.h>
 #include <plat/tc.h>
 
 #include <mach/hardware.h>
+#include <mach/usb.h>
 
 #include "common.h"
 
index 949b62a736931b0a74158727ca2ca2ecf488c6e8..26bcb9defcdc830ff7ae97d8667cef70b956b598 100644 (file)
@@ -35,7 +35,6 @@
 
 #include <plat/flash.h>
 #include <plat/mux.h>
-#include <plat/usb.h>
 #include <plat/tc.h>
 #include <plat/dma.h>
 #include <plat/board.h>
@@ -43,6 +42,7 @@
 #include <plat/keypad.h>
 
 #include <mach/hardware.h>
+#include <mach/usb.h>
 
 #include "common.h"
 
index 7f1e1cf2bf46a47e525338ff47398b2226ea997f..4d099446dfa888e1898227d35eb260e9ee8b203f 100644 (file)
@@ -35,7 +35,6 @@
 #include <plat/led.h>
 #include <plat/flash.h>
 #include <plat/mux.h>
-#include <plat/usb.h>
 #include <plat/dma.h>
 #include <plat/tc.h>
 #include <plat/board.h>
@@ -43,6 +42,7 @@
 #include <plat/keypad.h>
 
 #include <mach/hardware.h>
+#include <mach/usb.h>
 
 #include "common.h"
 
index 3c71c6bace2cd09489b358d6569c2652471040aa..cc71a26723efb0937294bfe777b10aa9a59ed746 100644 (file)
@@ -37,7 +37,6 @@
 
 #include <plat/flash.h>
 #include <plat/mux.h>
-#include <plat/usb.h>
 #include <plat/dma.h>
 #include <plat/tc.h>
 #include <plat/board.h>
@@ -45,6 +44,7 @@
 #include <plat/keypad.h>
 
 #include <mach/hardware.h>
+#include <mach/usb.h>
 
 #include "common.h"
 
index 3b7b82b136840ac05fcedaa1e9ba3da1617df96b..8c665bd16ac20b38195fa126ae4e21a7595d31d1 100644 (file)
 #include <plat/mux.h>
 #include <plat/dma.h>
 #include <plat/irda.h>
-#include <plat/usb.h>
 #include <plat/tc.h>
 #include <plat/board.h>
 #include <plat/keypad.h>
 #include <plat/board-sx1.h>
 
 #include <mach/hardware.h>
+#include <mach/usb.h>
 
 #include "common.h"
 
index afd67f0ec495160d4c5f996f8f81b6832b03e1c2..3497769eb353965adc1aa435c599b0bab252fb12 100644 (file)
 #include <plat/flash.h>
 #include <plat/mux.h>
 #include <plat/tc.h>
-#include <plat/usb.h>
+#include <plat/board.h>
 
 #include <mach/hardware.h>
+#include <mach/usb.h>
 
 #include "common.h"
 
index c6ce93f71d08d5bb1bb1d546024dfdb2f363d1d0..c007d80dfb6244396606dfd38281b7d8b6c1bfbf 100644 (file)
 #include <plat/clock.h>
 #include <plat/cpu.h>
 #include <plat/clkdev_omap.h>
+#include <plat/board.h>
 #include <plat/sram.h> /* for omap_sram_reprogram_clock() */
-#include <plat/usb.h>   /* for OTG_BASE */
 
 #include <mach/hardware.h>
+#include <mach/usb.h>   /* for OTG_BASE */
 
 #include "iomap.h"
 #include "clock.h"
diff --git a/arch/arm/mach-omap1/include/mach/usb.h b/arch/arm/mach-omap1/include/mach/usb.h
new file mode 100644 (file)
index 0000000..753cd5c
--- /dev/null
@@ -0,0 +1,165 @@
+/*
+ * FIXME correct answer depends on hmc_mode,
+ * as does (on omap1) any nonzero value for config->otg port number
+ */
+#ifdef CONFIG_USB_GADGET_OMAP
+#define        is_usb0_device(config)  1
+#else
+#define        is_usb0_device(config)  0
+#endif
+
+struct omap_usb_config {
+       /* Configure drivers according to the connectors on your board:
+        *  - "A" connector (rectagular)
+        *      ... for host/OHCI use, set "register_host".
+        *  - "B" connector (squarish) or "Mini-B"
+        *      ... for device/gadget use, set "register_dev".
+        *  - "Mini-AB" connector (very similar to Mini-B)
+        *      ... for OTG use as device OR host, initialize "otg"
+        */
+       unsigned        register_host:1;
+       unsigned        register_dev:1;
+       u8              otg;    /* port number, 1-based:  usb1 == 2 */
+
+       u8              hmc_mode;
+
+       /* implicitly true if otg:  host supports remote wakeup? */
+       u8              rwc;
+
+       /* signaling pins used to talk to transceiver on usbN:
+        *  0 == usbN unused
+        *  2 == usb0-only, using internal transceiver
+        *  3 == 3 wire bidirectional
+        *  4 == 4 wire bidirectional
+        *  6 == 6 wire unidirectional (or TLL)
+        */
+       u8              pins[3];
+
+       struct platform_device *udc_device;
+       struct platform_device *ohci_device;
+       struct platform_device *otg_device;
+
+       u32 (*usb0_init)(unsigned nwires, unsigned is_device);
+       u32 (*usb1_init)(unsigned nwires);
+       u32 (*usb2_init)(unsigned nwires, unsigned alt_pingroup);
+
+       int (*ocpi_enable)(void);
+};
+
+void omap_otg_init(struct omap_usb_config *config);
+
+#if defined(CONFIG_USB) || defined(CONFIG_USB_MODULE)
+void omap1_usb_init(struct omap_usb_config *pdata);
+#else
+static inline void omap1_usb_init(struct omap_usb_config *pdata)
+{
+}
+#endif
+
+#define OMAP1_OTG_BASE                 0xfffb0400
+#define OMAP1_UDC_BASE                 0xfffb4000
+#define OMAP1_OHCI_BASE                        0xfffba000
+
+#define OMAP2_OHCI_BASE                        0x4805e000
+#define OMAP2_UDC_BASE                 0x4805e200
+#define OMAP2_OTG_BASE                 0x4805e300
+#define OTG_BASE                       OMAP1_OTG_BASE
+#define UDC_BASE                       OMAP1_UDC_BASE
+#define OMAP_OHCI_BASE                 OMAP1_OHCI_BASE
+
+/*
+ * OTG and transceiver registers, for OMAPs starting with ARM926
+ */
+#define OTG_REV                                (OTG_BASE + 0x00)
+#define OTG_SYSCON_1                   (OTG_BASE + 0x04)
+#      define   USB2_TRX_MODE(w)       (((w)>>24)&0x07)
+#      define   USB1_TRX_MODE(w)       (((w)>>20)&0x07)
+#      define   USB0_TRX_MODE(w)       (((w)>>16)&0x07)
+#      define   OTG_IDLE_EN            (1 << 15)
+#      define   HST_IDLE_EN            (1 << 14)
+#      define   DEV_IDLE_EN            (1 << 13)
+#      define   OTG_RESET_DONE         (1 << 2)
+#      define   OTG_SOFT_RESET         (1 << 1)
+#define OTG_SYSCON_2                   (OTG_BASE + 0x08)
+#      define   OTG_EN                 (1 << 31)
+#      define   USBX_SYNCHRO           (1 << 30)
+#      define   OTG_MST16              (1 << 29)
+#      define   SRP_GPDATA             (1 << 28)
+#      define   SRP_GPDVBUS            (1 << 27)
+#      define   SRP_GPUVBUS(w)         (((w)>>24)&0x07)
+#      define   A_WAIT_VRISE(w)        (((w)>>20)&0x07)
+#      define   B_ASE_BRST(w)          (((w)>>16)&0x07)
+#      define   SRP_DPW                (1 << 14)
+#      define   SRP_DATA               (1 << 13)
+#      define   SRP_VBUS               (1 << 12)
+#      define   OTG_PADEN              (1 << 10)
+#      define   HMC_PADEN              (1 << 9)
+#      define   UHOST_EN               (1 << 8)
+#      define   HMC_TLLSPEED           (1 << 7)
+#      define   HMC_TLLATTACH          (1 << 6)
+#      define   OTG_HMC(w)             (((w)>>0)&0x3f)
+#define OTG_CTRL                       (OTG_BASE + 0x0c)
+#      define   OTG_USB2_EN            (1 << 29)
+#      define   OTG_USB2_DP            (1 << 28)
+#      define   OTG_USB2_DM            (1 << 27)
+#      define   OTG_USB1_EN            (1 << 26)
+#      define   OTG_USB1_DP            (1 << 25)
+#      define   OTG_USB1_DM            (1 << 24)
+#      define   OTG_USB0_EN            (1 << 23)
+#      define   OTG_USB0_DP            (1 << 22)
+#      define   OTG_USB0_DM            (1 << 21)
+#      define   OTG_ASESSVLD           (1 << 20)
+#      define   OTG_BSESSEND           (1 << 19)
+#      define   OTG_BSESSVLD           (1 << 18)
+#      define   OTG_VBUSVLD            (1 << 17)
+#      define   OTG_ID                 (1 << 16)
+#      define   OTG_DRIVER_SEL         (1 << 15)
+#      define   OTG_A_SETB_HNPEN       (1 << 12)
+#      define   OTG_A_BUSREQ           (1 << 11)
+#      define   OTG_B_HNPEN            (1 << 9)
+#      define   OTG_B_BUSREQ           (1 << 8)
+#      define   OTG_BUSDROP            (1 << 7)
+#      define   OTG_PULLDOWN           (1 << 5)
+#      define   OTG_PULLUP             (1 << 4)
+#      define   OTG_DRV_VBUS           (1 << 3)
+#      define   OTG_PD_VBUS            (1 << 2)
+#      define   OTG_PU_VBUS            (1 << 1)
+#      define   OTG_PU_ID              (1 << 0)
+#define OTG_IRQ_EN                     (OTG_BASE + 0x10)       /* 16-bit */
+#      define   DRIVER_SWITCH          (1 << 15)
+#      define   A_VBUS_ERR             (1 << 13)
+#      define   A_REQ_TMROUT           (1 << 12)
+#      define   A_SRP_DETECT           (1 << 11)
+#      define   B_HNP_FAIL             (1 << 10)
+#      define   B_SRP_TMROUT           (1 << 9)
+#      define   B_SRP_DONE             (1 << 8)
+#      define   B_SRP_STARTED          (1 << 7)
+#      define   OPRT_CHG               (1 << 0)
+#define OTG_IRQ_SRC                    (OTG_BASE + 0x14)       /* 16-bit */
+       // same bits as in IRQ_EN
+#define OTG_OUTCTRL                    (OTG_BASE + 0x18)       /* 16-bit */
+#      define   OTGVPD                 (1 << 14)
+#      define   OTGVPU                 (1 << 13)
+#      define   OTGPUID                (1 << 12)
+#      define   USB2VDR                (1 << 10)
+#      define   USB2PDEN               (1 << 9)
+#      define   USB2PUEN               (1 << 8)
+#      define   USB1VDR                (1 << 6)
+#      define   USB1PDEN               (1 << 5)
+#      define   USB1PUEN               (1 << 4)
+#      define   USB0VDR                (1 << 2)
+#      define   USB0PDEN               (1 << 1)
+#      define   USB0PUEN               (1 << 0)
+#define OTG_TEST                       (OTG_BASE + 0x20)       /* 16-bit */
+#define OTG_VENDOR_CODE                        (OTG_BASE + 0xfc)       /* 16-bit */
+
+/*-------------------------------------------------------------------------*/
+
+/* OMAP1 */
+#define        USB_TRANSCEIVER_CTRL            (0xfffe1000 + 0x0064)
+#      define  CONF_USB2_UNI_R         (1 << 8)
+#      define  CONF_USB1_UNI_R         (1 << 7)
+#      define  CONF_USB_PORT0_R(x)     (((x)>>4)&0x7)
+#      define  CONF_USB0_ISOLATE_R     (1 << 3)
+#      define  CONF_USB_PWRDN_DM_R     (1 << 2)
+#      define  CONF_USB_PWRDN_DP_R     (1 << 1)
index e61afd9227662f123620a3243ed0a92d89cbe30b..65f88176fba87288a154e708979b6c0c9f98196c 100644 (file)
@@ -27,7 +27,8 @@
 #include <asm/irq.h>
 
 #include <plat/mux.h>
-#include <plat/usb.h>
+
+#include <mach/usb.h>
 
 #include "common.h"
 
 #define INT_USB_IRQ_HGEN       INT_USB_HHC_1
 #define INT_USB_IRQ_OTG                IH2_BASE + 8
 
+#ifdef CONFIG_ARCH_OMAP_OTG
+
+void __init
+omap_otg_init(struct omap_usb_config *config)
+{
+       u32             syscon;
+       int             alt_pingroup = 0;
+
+       /* NOTE:  no bus or clock setup (yet?) */
+
+       syscon = omap_readl(OTG_SYSCON_1) & 0xffff;
+       if (!(syscon & OTG_RESET_DONE))
+               pr_debug("USB resets not complete?\n");
+
+       //omap_writew(0, OTG_IRQ_EN);
+
+       /* pin muxing and transceiver pinouts */
+       if (config->pins[0] > 2)        /* alt pingroup 2 */
+               alt_pingroup = 1;
+       syscon |= config->usb0_init(config->pins[0], is_usb0_device(config));
+       syscon |= config->usb1_init(config->pins[1]);
+       syscon |= config->usb2_init(config->pins[2], alt_pingroup);
+       pr_debug("OTG_SYSCON_1 = %08x\n", omap_readl(OTG_SYSCON_1));
+       omap_writel(syscon, OTG_SYSCON_1);
+
+       syscon = config->hmc_mode;
+       syscon |= USBX_SYNCHRO | (4 << 16) /* B_ASE0_BRST */;
+#ifdef CONFIG_USB_OTG
+       if (config->otg)
+               syscon |= OTG_EN;
+#endif
+       if (cpu_class_is_omap1())
+               pr_debug("USB_TRANSCEIVER_CTRL = %03x\n",
+                        omap_readl(USB_TRANSCEIVER_CTRL));
+       pr_debug("OTG_SYSCON_2 = %08x\n", omap_readl(OTG_SYSCON_2));
+       omap_writel(syscon, OTG_SYSCON_2);
+
+       printk("USB: hmc %d", config->hmc_mode);
+       if (!alt_pingroup)
+               printk(", usb2 alt %d wires", config->pins[2]);
+       else if (config->pins[0])
+               printk(", usb0 %d wires%s", config->pins[0],
+                       is_usb0_device(config) ? " (dev)" : "");
+       if (config->pins[1])
+               printk(", usb1 %d wires", config->pins[1]);
+       if (!alt_pingroup && config->pins[2])
+               printk(", usb2 %d wires", config->pins[2]);
+       if (config->otg)
+               printk(", Mini-AB on usb%d", config->otg - 1);
+       printk("\n");
+
+       if (cpu_class_is_omap1()) {
+               u16 w;
+
+               /* leave USB clocks/controllers off until needed */
+               w = omap_readw(ULPD_SOFT_REQ);
+               w &= ~SOFT_USB_CLK_REQ;
+               omap_writew(w, ULPD_SOFT_REQ);
+
+               w = omap_readw(ULPD_CLOCK_CTRL);
+               w &= ~USB_MCLK_EN;
+               w |= DIS_USB_PVCI_CLK;
+               omap_writew(w, ULPD_CLOCK_CTRL);
+       }
+       syscon = omap_readl(OTG_SYSCON_1);
+       syscon |= HST_IDLE_EN|DEV_IDLE_EN|OTG_IDLE_EN;
+
+#ifdef CONFIG_USB_GADGET_OMAP
+       if (config->otg || config->register_dev) {
+               struct platform_device *udc_device = config->udc_device;
+               int status;
+
+               syscon &= ~DEV_IDLE_EN;
+               udc_device->dev.platform_data = config;
+               status = platform_device_register(udc_device);
+               if (status)
+                       pr_debug("can't register UDC device, %d\n", status);
+       }
+#endif
+
+#if    defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE)
+       if (config->otg || config->register_host) {
+               struct platform_device *ohci_device = config->ohci_device;
+               int status;
+
+               syscon &= ~HST_IDLE_EN;
+               ohci_device->dev.platform_data = config;
+               status = platform_device_register(ohci_device);
+               if (status)
+                       pr_debug("can't register OHCI device, %d\n", status);
+       }
+#endif
+
+#ifdef CONFIG_USB_OTG
+       if (config->otg) {
+               struct platform_device *otg_device = config->otg_device;
+               int status;
+
+               syscon &= ~OTG_IDLE_EN;
+               otg_device->dev.platform_data = config;
+               status = platform_device_register(otg_device);
+               if (status)
+                       pr_debug("can't register OTG device, %d\n", status);
+       }
+#endif
+       pr_debug("OTG_SYSCON_1 = %08x\n", omap_readl(OTG_SYSCON_1));
+       omap_writel(syscon, OTG_SYSCON_1);
+}
+
+#else
+void omap_otg_init(struct omap_usb_config *config) {}
+#endif
+
 #ifdef CONFIG_USB_GADGET_OMAP
 
 static struct resource udc_resources[] = {
index 4cf5142f22ccd9543f6795f491a24a64bc3d12a9..042f157a8f944e66216ed11fd58701d063743cab 100644 (file)
@@ -64,19 +64,16 @@ config SOC_OMAP2420
        depends on ARCH_OMAP2
        default y
        select OMAP_DM_TIMER
-       select ARCH_OMAP_OTG
 
 config SOC_OMAP2430
        bool "OMAP2430 support"
        depends on ARCH_OMAP2
        default y
-       select ARCH_OMAP_OTG
 
 config SOC_OMAP3430
        bool "OMAP3430 support"
        depends on ARCH_OMAP3
        default y
-       select ARCH_OMAP_OTG
 
 config SOC_TI81XX
        bool "TI81XX support"
index fa742f3c262947313f23df2b65e8b36521cf71d9..9ba1c406a4650a9641ddeeb120affa8c8c6f77cf 100644 (file)
@@ -116,7 +116,6 @@ obj-$(CONFIG_ARCH_OMAP4)            += powerdomains44xx_data.o
 
 # PRCM clockdomain control
 clockdomain-common                     += clockdomain.o
-clockdomain-common                     += clockdomains_common_data.o
 obj-$(CONFIG_ARCH_OMAP2)               += $(clockdomain-common)
 obj-$(CONFIG_ARCH_OMAP2)               += clockdomain2xxx_3xxx.o
 obj-$(CONFIG_ARCH_OMAP2)               += clockdomains2xxx_3xxx_data.o
@@ -244,9 +243,6 @@ obj-y                                       += $(omap-flash-y) $(omap-flash-m)
 omap-hsmmc-$(CONFIG_MMC_OMAP_HS)       := hsmmc.o
 obj-y                                  += $(omap-hsmmc-m) $(omap-hsmmc-y)
 
-
-usbfs-$(CONFIG_ARCH_OMAP_OTG)          := usb-fs.o
-obj-y                                  += $(usbfs-m) $(usbfs-y)
 obj-y                                  += usb-musb.o
 obj-y                                  += omap_phy_internal.o
 
index 99ca6bad5c30c210c0a6e19d5eae570ef862d632..6523aeabf9f2886684011dfa2657668da3b18fe8 100644 (file)
@@ -254,16 +254,6 @@ static struct omap2_hsmmc_info mmc[] __initdata = {
        {}      /* Terminator */
 };
 
-static struct omap_usb_config sdp2430_usb_config __initdata = {
-       .otg            = 1,
-#ifdef  CONFIG_USB_GADGET_OMAP
-       .hmc_mode       = 0x0,
-#elif   defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE)
-       .hmc_mode       = 0x1,
-#endif
-       .pins[0]        = 3,
-};
-
 #ifdef CONFIG_OMAP_MUX
 static struct omap_board_mux board_mux[] __initdata = {
        { .reg_offset = OMAP_MUX_TERMINATOR },
@@ -280,7 +270,6 @@ static void __init omap_2430sdp_init(void)
        omap_serial_init();
        omap_sdrc_init(NULL, NULL);
        omap_hsmmc_init(mmc);
-       omap2_usbfs_init(&sdp2430_usb_config);
 
        omap_mux_init_signal("usb0hs_stp", OMAP_PULL_ENA | OMAP_PULL_UP);
        usb_musb_init(NULL);
index 502c31e123be0308f46b44bb4c40dadb88ef6e4c..519bcd3079e888857ee5401a5500ad9efc9e0e2b 100644 (file)
@@ -35,7 +35,6 @@
 #include <asm/mach/flash.h>
 
 #include <plat/led.h>
-#include <plat/usb.h>
 #include <plat/board.h>
 #include "common.h"
 #include <plat/gpmc.h>
@@ -253,13 +252,6 @@ out:
        clk_put(gpmc_fck);
 }
 
-static struct omap_usb_config apollon_usb_config __initdata = {
-       .register_dev   = 1,
-       .hmc_mode       = 0x14, /* 0:dev 1:host1 2:disable */
-
-       .pins[0]        = 6,
-};
-
 static struct panel_generic_dpi_data apollon_panel_data = {
        .name                   = "apollon",
 };
@@ -297,15 +289,6 @@ static void __init apollon_led_init(void)
        gpio_request_array(apollon_gpio_leds, ARRAY_SIZE(apollon_gpio_leds));
 }
 
-static void __init apollon_usb_init(void)
-{
-       /* USB device */
-       /* DEVICE_SUSPEND */
-       omap_mux_init_signal("mcbsp2_clkx.gpio_12", 0);
-       gpio_request_one(12, GPIOF_OUT_INIT_LOW, "USB suspend");
-       omap2_usbfs_init(&apollon_usb_config);
-}
-
 #ifdef CONFIG_OMAP_MUX
 static struct omap_board_mux board_mux[] __initdata = {
        { .reg_offset = OMAP_MUX_TERMINATOR },
@@ -321,7 +304,6 @@ static void __init omap_apollon_init(void)
        apollon_init_smc91x();
        apollon_led_init();
        apollon_flash_init();
-       apollon_usb_init();
 
        /* REVISIT: where's the correct place */
        omap_mux_init_signal("sys_nirq", OMAP_PULL_ENA | OMAP_PULL_UP);
index 876becf8205a475ad6e168c5ca5ac513f737a49f..ace20482e3e1901eb4fedb311fa9e0ae55fa34b5 100644 (file)
@@ -32,7 +32,6 @@
 #include <asm/mach/arch.h>
 #include <asm/mach/map.h>
 
-#include <plat/usb.h>
 #include <plat/board.h>
 #include "common.h"
 #include <plat/menelaus.h>
@@ -329,17 +328,6 @@ static void __init h4_init_flash(void)
        h4_flash_resource.end   = base + SZ_64M - 1;
 }
 
-static struct omap_usb_config h4_usb_config __initdata = {
-       /* S1.10 OFF -- usb "download port"
-        * usb0 switched to Mini-B port and isp1105 transceiver;
-        * S2.POS3 = ON, S2.POS4 = OFF ... to enable battery charging
-        */
-       .register_dev   = 1,
-       .pins[0]        = 3,
-/*     .hmc_mode       = 0x14,*/       /* 0:dev 1:host 2:disable */
-       .hmc_mode       = 0x00,         /* 0:dev|otg 1:disable 2:disable */
-};
-
 static struct at24_platform_data m24c01 = {
        .byte_len       = SZ_1K / 8,
        .page_size      = 16,
@@ -381,7 +369,6 @@ static void __init omap_h4_init(void)
                        ARRAY_SIZE(h4_i2c_board_info));
 
        platform_add_devices(h4_devices, ARRAY_SIZE(h4_devices));
-       omap2_usbfs_init(&h4_usb_config);
        omap_serial_init();
        omap_sdrc_init(NULL, NULL);
        h4_init_flash();
index bace9308a4db89616b780f310738f35c6cee5644..7e39015357b126255707fed16515604b899b0d78 100644 (file)
@@ -1774,8 +1774,6 @@ static struct omap_clk omap2420_clks[] = {
        CLK(NULL,       "osc_ck",       &osc_ck,        CK_242X),
        CLK(NULL,       "sys_ck",       &sys_ck,        CK_242X),
        CLK(NULL,       "alt_ck",       &alt_ck,        CK_242X),
-       CLK("omap-mcbsp.1",     "pad_fck",      &mcbsp_clks,    CK_242X),
-       CLK("omap-mcbsp.2",     "pad_fck",      &mcbsp_clks,    CK_242X),
        CLK(NULL,       "mcbsp_clks",   &mcbsp_clks,    CK_242X),
        /* internal analog sources */
        CLK(NULL,       "dpll_ck",      &dpll_ck,       CK_242X),
@@ -1784,8 +1782,6 @@ static struct omap_clk omap2420_clks[] = {
        /* internal prcm root sources */
        CLK(NULL,       "func_54m_ck",  &func_54m_ck,   CK_242X),
        CLK(NULL,       "core_ck",      &core_ck,       CK_242X),
-       CLK("omap-mcbsp.1",     "prcm_fck",     &func_96m_ck,   CK_242X),
-       CLK("omap-mcbsp.2",     "prcm_fck",     &func_96m_ck,   CK_242X),
        CLK(NULL,       "func_96m_ck",  &func_96m_ck,   CK_242X),
        CLK(NULL,       "func_48m_ck",  &func_48m_ck,   CK_242X),
        CLK(NULL,       "func_12m_ck",  &func_12m_ck,   CK_242X),
index 3b4d09a5039905687b2723adbad0d76add914221..90a08c3b12acab0e84bb7a06866b3f35675bb908 100644 (file)
@@ -1858,11 +1858,6 @@ static struct omap_clk omap2430_clks[] = {
        CLK(NULL,       "osc_ck",       &osc_ck,        CK_243X),
        CLK(NULL,       "sys_ck",       &sys_ck,        CK_243X),
        CLK(NULL,       "alt_ck",       &alt_ck,        CK_243X),
-       CLK("omap-mcbsp.1",     "pad_fck",      &mcbsp_clks,    CK_243X),
-       CLK("omap-mcbsp.2",     "pad_fck",      &mcbsp_clks,    CK_243X),
-       CLK("omap-mcbsp.3",     "pad_fck",      &mcbsp_clks,    CK_243X),
-       CLK("omap-mcbsp.4",     "pad_fck",      &mcbsp_clks,    CK_243X),
-       CLK("omap-mcbsp.5",     "pad_fck",      &mcbsp_clks,    CK_243X),
        CLK(NULL,       "mcbsp_clks",   &mcbsp_clks,    CK_243X),
        /* internal analog sources */
        CLK(NULL,       "dpll_ck",      &dpll_ck,       CK_243X),
@@ -1871,11 +1866,6 @@ static struct omap_clk omap2430_clks[] = {
        /* internal prcm root sources */
        CLK(NULL,       "func_54m_ck",  &func_54m_ck,   CK_243X),
        CLK(NULL,       "core_ck",      &core_ck,       CK_243X),
-       CLK("omap-mcbsp.1",     "prcm_fck",     &func_96m_ck,   CK_243X),
-       CLK("omap-mcbsp.2",     "prcm_fck",     &func_96m_ck,   CK_243X),
-       CLK("omap-mcbsp.3",     "prcm_fck",     &func_96m_ck,   CK_243X),
-       CLK("omap-mcbsp.4",     "prcm_fck",     &func_96m_ck,   CK_243X),
-       CLK("omap-mcbsp.5",     "prcm_fck",     &func_96m_ck,   CK_243X),
        CLK(NULL,       "func_96m_ck",  &func_96m_ck,   CK_243X),
        CLK(NULL,       "func_48m_ck",  &func_48m_ck,   CK_243X),
        CLK(NULL,       "func_12m_ck",  &func_12m_ck,   CK_243X),
index 1efdec236ae89dac6671bbd8f09d7cffb2067deb..ff422bee804a3fe0f0ee4a5ded7e45e210de46e0 100644 (file)
@@ -3236,11 +3236,6 @@ static struct omap_clk omap3xxx_clks[] = {
        CLK(NULL,       "osc_sys_ck",   &osc_sys_ck,    CK_3XXX),
        CLK(NULL,       "sys_ck",       &sys_ck,        CK_3XXX),
        CLK(NULL,       "sys_altclk",   &sys_altclk,    CK_3XXX),
-       CLK("omap-mcbsp.1",     "pad_fck",      &mcbsp_clks,    CK_3XXX),
-       CLK("omap-mcbsp.2",     "pad_fck",      &mcbsp_clks,    CK_3XXX),
-       CLK("omap-mcbsp.3",     "pad_fck",      &mcbsp_clks,    CK_3XXX),
-       CLK("omap-mcbsp.4",     "pad_fck",      &mcbsp_clks,    CK_3XXX),
-       CLK("omap-mcbsp.5",     "pad_fck",      &mcbsp_clks,    CK_3XXX),
        CLK(NULL,       "mcbsp_clks",   &mcbsp_clks,    CK_3XXX),
        CLK(NULL,       "sys_clkout1",  &sys_clkout1,   CK_3XXX),
        CLK(NULL,       "dpll1_ck",     &dpll1_ck,      CK_3XXX),
@@ -3307,8 +3302,6 @@ static struct omap_clk omap3xxx_clks[] = {
        CLK(NULL,       "ts_fck",       &ts_fck,        CK_3430ES2PLUS | CK_AM35XX | CK_36XX),
        CLK(NULL,       "usbtll_fck",   &usbtll_fck,    CK_3430ES2PLUS | CK_AM35XX | CK_36XX),
        CLK("usbhs_omap",       "usbtll_fck",   &usbtll_fck,    CK_3430ES2PLUS | CK_AM35XX | CK_36XX),
-       CLK("omap-mcbsp.1",     "prcm_fck",     &core_96m_fck,  CK_3XXX),
-       CLK("omap-mcbsp.5",     "prcm_fck",     &core_96m_fck,  CK_3XXX),
        CLK(NULL,       "core_96m_fck", &core_96m_fck,  CK_3XXX),
        CLK(NULL,       "mmchs3_fck",   &mmchs3_fck,    CK_3430ES2PLUS | CK_AM35XX | CK_36XX),
        CLK(NULL,       "mmchs2_fck",   &mmchs2_fck,    CK_3XXX),
@@ -3413,9 +3406,6 @@ static struct omap_clk omap3xxx_clks[] = {
        CLK(NULL,       "omap_32ksync_ick", &omap_32ksync_ick, CK_3XXX),
        CLK(NULL,       "gpt12_ick",    &gpt12_ick,     CK_3XXX),
        CLK(NULL,       "gpt1_ick",     &gpt1_ick,      CK_3XXX),
-       CLK("omap-mcbsp.2",     "prcm_fck",     &per_96m_fck,   CK_3XXX),
-       CLK("omap-mcbsp.3",     "prcm_fck",     &per_96m_fck,   CK_3XXX),
-       CLK("omap-mcbsp.4",     "prcm_fck",     &per_96m_fck,   CK_3XXX),
        CLK(NULL,       "per_96m_fck",  &per_96m_fck,   CK_3XXX),
        CLK(NULL,       "per_48m_fck",  &per_48m_fck,   CK_3XXX),
        CLK(NULL,       "uart3_fck",    &uart3_fck,     CK_3XXX),
index f7b58609bad888b6b276a524badf9518e450a709..349dcbb6fecb1e08beec844341524f0429401f46 100644 (file)
@@ -206,7 +206,5 @@ extern struct clkdm_ops omap4_clkdm_operations;
 extern struct clkdm_dep gfx_24xx_wkdeps[];
 extern struct clkdm_dep dsp_24xx_wkdeps[];
 extern struct clockdomain wkup_common_clkdm;
-extern struct clockdomain prm_common_clkdm;
-extern struct clockdomain cm_common_clkdm;
 
 #endif
index 0ab8e46d5b2b04d431dd97cfec4345ff98d169a4..5c741852fac0294748d9f417ce9b73494eb25f32 100644 (file)
@@ -131,8 +131,6 @@ static struct clockdomain dss_2420_clkdm = {
 
 static struct clockdomain *clockdomains_omap242x[] __initdata = {
        &wkup_common_clkdm,
-       &cm_common_clkdm,
-       &prm_common_clkdm,
        &mpu_2420_clkdm,
        &iva1_2420_clkdm,
        &dsp_2420_clkdm,
index 3645ed04489042d5ff32b89a73988dcabf7403f7..f09617555e15d7da642621a1f076e2cdf8690bc5 100644 (file)
@@ -157,8 +157,6 @@ static struct clockdomain dss_2430_clkdm = {
 
 static struct clockdomain *clockdomains_omap243x[] __initdata = {
        &wkup_common_clkdm,
-       &cm_common_clkdm,
-       &prm_common_clkdm,
        &mpu_2430_clkdm,
        &mdm_clkdm,
        &dsp_2430_clkdm,
index 6038adb977108f6440ea0f002dcba63beefb9b29..2cdc17c9d2fa34dc40c7a0473f67828d4a9acc5a 100644 (file)
@@ -347,8 +347,6 @@ static struct clkdm_autodep clkdm_autodeps[] = {
 
 static struct clockdomain *clockdomains_omap3430_common[] __initdata = {
        &wkup_common_clkdm,
-       &cm_common_clkdm,
-       &prm_common_clkdm,
        &mpu_3xxx_clkdm,
        &neon_clkdm,
        &iva2_clkdm,
index c534258474939e8efe3b96dd1c5ed096bd30f3ab..bd7ed13515cc75c78662ef8adb323b693407247f 100644 (file)
@@ -430,8 +430,6 @@ static struct clockdomain *clockdomains_omap44xx[] __initdata = {
        &l4_wkup_44xx_clkdm,
        &emu_sys_44xx_clkdm,
        &l3_dma_44xx_clkdm,
-       &prm_common_clkdm,
-       &cm_common_clkdm,
        NULL
 };
 
diff --git a/arch/arm/mach-omap2/clockdomains_common_data.c b/arch/arm/mach-omap2/clockdomains_common_data.c
deleted file mode 100644 (file)
index 615b1f0..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * OMAP2+-common clockdomain data
- *
- * Copyright (C) 2008-2012 Texas Instruments, Inc.
- * Copyright (C) 2008-2010 Nokia Corporation
- *
- * Paul Walmsley, Jouni Högander
- */
-
-#include <linux/kernel.h>
-#include <linux/io.h>
-
-#include "clockdomain.h"
-
-/* These are implicit clockdomains - they are never defined as such in TRM */
-struct clockdomain prm_common_clkdm = {
-       .name           = "prm_clkdm",
-       .pwrdm          = { .name = "wkup_pwrdm" },
-};
-
-struct clockdomain cm_common_clkdm = {
-       .name           = "cm_clkdm",
-       .pwrdm          = { .name = "core_pwrdm" },
-};
index 08e674bb04171c2e6b81d97be51a7cab6e697d0c..3223b81e75327afb3af4ca47f88e69a744ac372e 100644 (file)
@@ -241,6 +241,49 @@ void omap3_ctrl_write_boot_mode(u8 bootmode)
 
 #endif
 
+/**
+ * omap_ctrl_write_dsp_boot_addr - set boot address for a remote processor
+ * @bootaddr: physical address of the boot loader
+ *
+ * Set boot address for the boot loader of a supported processor
+ * when a power ON sequence occurs.
+ */
+void omap_ctrl_write_dsp_boot_addr(u32 bootaddr)
+{
+       u32 offset = cpu_is_omap243x() ? OMAP243X_CONTROL_IVA2_BOOTADDR :
+                    cpu_is_omap34xx() ? OMAP343X_CONTROL_IVA2_BOOTADDR :
+                    cpu_is_omap44xx() ? OMAP4_CTRL_MODULE_CORE_DSP_BOOTADDR :
+                    0;
+
+       if (!offset) {
+               pr_err("%s: unsupported omap type\n", __func__);
+               return;
+       }
+
+       omap_ctrl_writel(bootaddr, offset);
+}
+
+/**
+ * omap_ctrl_write_dsp_boot_mode - set boot mode for a remote processor
+ * @bootmode: 8-bit value to pass to some boot code
+ *
+ * Sets boot mode for the boot loader of a supported processor
+ * when a power ON sequence occurs.
+ */
+void omap_ctrl_write_dsp_boot_mode(u8 bootmode)
+{
+       u32 offset = cpu_is_omap243x() ? OMAP243X_CONTROL_IVA2_BOOTMOD :
+                    cpu_is_omap34xx() ? OMAP343X_CONTROL_IVA2_BOOTMOD :
+                    0;
+
+       if (!offset) {
+               pr_err("%s: unsupported omap type\n", __func__);
+               return;
+       }
+
+       omap_ctrl_writel(bootmode, offset);
+}
+
 #if defined(CONFIG_ARCH_OMAP3) && defined(CONFIG_PM)
 /*
  * Clears the scratchpad contents in case of cold boot-
index a406fd045ce13e18649b488a663cc21c6520a415..fcc98f822d9d3e932c03521ab9c8a107c960b0c8 100644 (file)
@@ -397,6 +397,8 @@ extern u32 omap3_arm_context[128];
 extern void omap3_control_save_context(void);
 extern void omap3_control_restore_context(void);
 extern void omap3_ctrl_write_boot_mode(u8 bootmode);
+extern void omap_ctrl_write_dsp_boot_addr(u32 bootaddr);
+extern void omap_ctrl_write_dsp_boot_mode(u8 bootmode);
 extern void omap3630_ctrl_disable_rta(void);
 extern int omap3_ctrl_save_padconf(void);
 #else
index 88ffa1e645cd948614afe61c17502533c64650a7..a636ebc16b3975f8ae49cc9c18bd676920baf4df 100644 (file)
@@ -23,6 +23,7 @@
 
 #include <asm/memblock.h>
 
+#include "control.h"
 #include "cm2xxx_3xxx.h"
 #include "prm2xxx_3xxx.h"
 #ifdef CONFIG_BRIDGE_DVFS
@@ -46,6 +47,9 @@ static struct omap_dsp_platform_data omap_dsp_pdata __initdata = {
        .dsp_cm_read = omap2_cm_read_mod_reg,
        .dsp_cm_write = omap2_cm_write_mod_reg,
        .dsp_cm_rmw_bits = omap2_cm_rmw_mod_reg_bits,
+
+       .set_bootaddr = omap_ctrl_write_dsp_boot_addr,
+       .set_bootmode = omap_ctrl_write_dsp_boot_mode,
 };
 
 static phys_addr_t omap_dsp_phys_mempool_base;
index 2f7ac70a20d8f8ae8df8094ee75f818d0bf596e5..01970824e0e5d7a7773b49fd321b406d42c971dd 100644 (file)
@@ -42,6 +42,7 @@
 #define OMAP4_CTRL_MODULE_CORE_STD_FUSE_OPP_DPLL_1             0x0268
 #define OMAP4_CTRL_MODULE_CORE_STATUS                          0x02c4
 #define OMAP4_CTRL_MODULE_CORE_DEV_CONF                                0x0300
+#define OMAP4_CTRL_MODULE_CORE_DSP_BOOTADDR                    0x0304
 #define OMAP4_CTRL_MODULE_CORE_LDOVBB_IVA_VOLTAGE_CTRL         0x0314
 #define OMAP4_CTRL_MODULE_CORE_LDOVBB_MPU_VOLTAGE_CTRL         0x0318
 #define OMAP4_CTRL_MODULE_CORE_LDOSRAM_IVA_VOLTAGE_CTRL                0x0320
index 773193670ea265cefa67f938fa780e938400dbce..f97f0624bca0d8e16367281074c3b90515f16c80 100644 (file)
  */
 #define LINKS_PER_OCP_IF               2
 
+/**
+ * struct omap_hwmod_soc_ops - fn ptrs for some SoC-specific operations
+ * @enable_module: function to enable a module (via MODULEMODE)
+ * @disable_module: function to disable a module (via MODULEMODE)
+ *
+ * XXX Eventually this functionality will be hidden inside the PRM/CM
+ * device drivers.  Until then, this should avoid huge blocks of cpu_is_*()
+ * conditionals in this code.
+ */
+struct omap_hwmod_soc_ops {
+       void (*enable_module)(struct omap_hwmod *oh);
+       int (*disable_module)(struct omap_hwmod *oh);
+       int (*wait_target_ready)(struct omap_hwmod *oh);
+       int (*assert_hardreset)(struct omap_hwmod *oh,
+                               struct omap_hwmod_rst_info *ohri);
+       int (*deassert_hardreset)(struct omap_hwmod *oh,
+                                 struct omap_hwmod_rst_info *ohri);
+       int (*is_hardreset_asserted)(struct omap_hwmod *oh,
+                                    struct omap_hwmod_rst_info *ohri);
+       int (*init_clkdm)(struct omap_hwmod *oh);
+};
+
+/* soc_ops: adapts the omap_hwmod code to the currently-booted SoC */
+static struct omap_hwmod_soc_ops soc_ops;
+
 /* omap_hwmod_list contains all registered struct omap_hwmods */
 static LIST_HEAD(omap_hwmod_list);
 
@@ -186,6 +211,9 @@ static struct omap_hwmod_link *linkspace;
  */
 static unsigned short free_ls, max_ls, ls_supp;
 
+/* inited: set to true once the hwmod code is initialized */
+static bool inited;
+
 /* Private functions */
 
 /**
@@ -771,23 +799,19 @@ static void _disable_optional_clocks(struct omap_hwmod *oh)
 }
 
 /**
- * _enable_module - enable CLKCTRL modulemode on OMAP4
+ * _omap4_enable_module - enable CLKCTRL modulemode on OMAP4
  * @oh: struct omap_hwmod *
  *
  * Enables the PRCM module mode related to the hwmod @oh.
  * No return value.
  */
-static void _enable_module(struct omap_hwmod *oh)
+static void _omap4_enable_module(struct omap_hwmod *oh)
 {
-       /* The module mode does not exist prior OMAP4 */
-       if (cpu_is_omap24xx() || cpu_is_omap34xx())
-               return;
-
        if (!oh->clkdm || !oh->prcm.omap4.modulemode)
                return;
 
-       pr_debug("omap_hwmod: %s: _enable_module: %d\n",
-                oh->name, oh->prcm.omap4.modulemode);
+       pr_debug("omap_hwmod: %s: %s: %d\n",
+                oh->name, __func__, oh->prcm.omap4.modulemode);
 
        omap4_cminst_module_enable(oh->prcm.omap4.modulemode,
                                   oh->clkdm->prcm_partition,
@@ -807,10 +831,7 @@ static void _enable_module(struct omap_hwmod *oh)
  */
 static int _omap4_wait_target_disable(struct omap_hwmod *oh)
 {
-       if (!cpu_is_omap44xx())
-               return 0;
-
-       if (!oh)
+       if (!oh || !oh->clkdm)
                return -EINVAL;
 
        if (oh->_int_flags & _HWMOD_NO_MPU_PORT)
@@ -1285,24 +1306,20 @@ static struct omap_hwmod *_lookup(const char *name)
 
        return oh;
 }
+
 /**
  * _init_clkdm - look up a clockdomain name, store pointer in omap_hwmod
  * @oh: struct omap_hwmod *
  *
  * Convert a clockdomain name stored in a struct omap_hwmod into a
  * clockdomain pointer, and save it into the struct omap_hwmod.
- * return -EINVAL if clkdm_name does not exist or if the lookup failed.
+ * Return -EINVAL if the clkdm_name lookup failed.
  */
 static int _init_clkdm(struct omap_hwmod *oh)
 {
-       if (cpu_is_omap24xx() || cpu_is_omap34xx())
+       if (!oh->clkdm_name)
                return 0;
 
-       if (!oh->clkdm_name) {
-               pr_warning("omap_hwmod: %s: no clkdm_name\n", oh->name);
-               return -EINVAL;
-       }
-
        oh->clkdm = clkdm_lookup(oh->clkdm_name);
        if (!oh->clkdm) {
                pr_warning("omap_hwmod: %s: could not associate to clkdm %s\n",
@@ -1338,7 +1355,8 @@ static int _init_clocks(struct omap_hwmod *oh, void *data)
        ret |= _init_main_clk(oh);
        ret |= _init_interface_clks(oh);
        ret |= _init_opt_clks(oh);
-       ret |= _init_clkdm(oh);
+       if (soc_ops.init_clkdm)
+               ret |= soc_ops.init_clkdm(oh);
 
        if (!ret)
                oh->_state = _HWMOD_STATE_CLKS_INITED;
@@ -1348,53 +1366,6 @@ static int _init_clocks(struct omap_hwmod *oh, void *data)
        return ret;
 }
 
-/**
- * _wait_target_ready - wait for a module to leave slave idle
- * @oh: struct omap_hwmod *
- *
- * Wait for a module @oh to leave slave idle.  Returns 0 if the module
- * does not have an IDLEST bit or if the module successfully leaves
- * slave idle; otherwise, pass along the return value of the
- * appropriate *_cm*_wait_module_ready() function.
- */
-static int _wait_target_ready(struct omap_hwmod *oh)
-{
-       struct omap_hwmod_ocp_if *os;
-       int ret;
-
-       if (!oh)
-               return -EINVAL;
-
-       if (oh->flags & HWMOD_NO_IDLEST)
-               return 0;
-
-       os = _find_mpu_rt_port(oh);
-       if (!os)
-               return 0;
-
-       /* XXX check module SIDLEMODE */
-
-       /* XXX check clock enable states */
-
-       if (cpu_is_omap24xx() || cpu_is_omap34xx()) {
-               ret = omap2_cm_wait_module_ready(oh->prcm.omap2.module_offs,
-                                                oh->prcm.omap2.idlest_reg_id,
-                                                oh->prcm.omap2.idlest_idle_bit);
-       } else if (cpu_is_omap44xx()) {
-               if (!oh->clkdm)
-                       return -EINVAL;
-
-               ret = omap4_cminst_wait_module_ready(oh->clkdm->prcm_partition,
-                                                    oh->clkdm->cm_inst,
-                                                    oh->clkdm->clkdm_offs,
-                                                    oh->prcm.omap4.clkctrl_offs);
-       } else {
-               BUG();
-       };
-
-       return ret;
-}
-
 /**
  * _lookup_hardreset - fill register bit info for this hwmod/reset line
  * @oh: struct omap_hwmod *
@@ -1431,32 +1402,31 @@ static u8 _lookup_hardreset(struct omap_hwmod *oh, const char *name,
  * @oh: struct omap_hwmod *
  * @name: name of the reset line to lookup and assert
  *
- * Some IP like dsp, ipu or iva contain processor that require
- * an HW reset line to be assert / deassert in order to enable fully
- * the IP.
+ * Some IP like dsp, ipu or iva contain processor that require an HW
+ * reset line to be assert / deassert in order to enable fully the IP.
+ * Returns -EINVAL if @oh is null, -ENOSYS if we have no way of
+ * asserting the hardreset line on the currently-booted SoC, or passes
+ * along the return value from _lookup_hardreset() or the SoC's
+ * assert_hardreset code.
  */
 static int _assert_hardreset(struct omap_hwmod *oh, const char *name)
 {
        struct omap_hwmod_rst_info ohri;
-       u8 ret;
+       u8 ret = -EINVAL;
 
        if (!oh)
                return -EINVAL;
 
+       if (!soc_ops.assert_hardreset)
+               return -ENOSYS;
+
        ret = _lookup_hardreset(oh, name, &ohri);
        if (IS_ERR_VALUE(ret))
                return ret;
 
-       if (cpu_is_omap24xx() || cpu_is_omap34xx())
-               return omap2_prm_assert_hardreset(oh->prcm.omap2.module_offs,
-                                                 ohri.rst_shift);
-       else if (cpu_is_omap44xx())
-               return omap4_prminst_assert_hardreset(ohri.rst_shift,
-                                 oh->clkdm->pwrdm.ptr->prcm_partition,
-                                 oh->clkdm->pwrdm.ptr->prcm_offs,
-                                 oh->prcm.omap4.rstctrl_offs);
-       else
-               return -EINVAL;
+       ret = soc_ops.assert_hardreset(oh, &ohri);
+
+       return ret;
 }
 
 /**
@@ -1465,38 +1435,29 @@ static int _assert_hardreset(struct omap_hwmod *oh, const char *name)
  * @oh: struct omap_hwmod *
  * @name: name of the reset line to look up and deassert
  *
- * Some IP like dsp, ipu or iva contain processor that require
- * an HW reset line to be assert / deassert in order to enable fully
- * the IP.
+ * Some IP like dsp, ipu or iva contain processor that require an HW
+ * reset line to be assert / deassert in order to enable fully the IP.
+ * Returns -EINVAL if @oh is null, -ENOSYS if we have no way of
+ * deasserting the hardreset line on the currently-booted SoC, or passes
+ * along the return value from _lookup_hardreset() or the SoC's
+ * deassert_hardreset code.
  */
 static int _deassert_hardreset(struct omap_hwmod *oh, const char *name)
 {
        struct omap_hwmod_rst_info ohri;
-       int ret;
+       int ret = -EINVAL;
 
        if (!oh)
                return -EINVAL;
 
+       if (!soc_ops.deassert_hardreset)
+               return -ENOSYS;
+
        ret = _lookup_hardreset(oh, name, &ohri);
        if (IS_ERR_VALUE(ret))
                return ret;
 
-       if (cpu_is_omap24xx() || cpu_is_omap34xx()) {
-               ret = omap2_prm_deassert_hardreset(oh->prcm.omap2.module_offs,
-                                                  ohri.rst_shift,
-                                                  ohri.st_shift);
-       } else if (cpu_is_omap44xx()) {
-               if (ohri.st_shift)
-                       pr_err("omap_hwmod: %s: %s: hwmod data error: OMAP4 does not support st_shift\n",
-                              oh->name, name);
-               ret = omap4_prminst_deassert_hardreset(ohri.rst_shift,
-                                 oh->clkdm->pwrdm.ptr->prcm_partition,
-                                 oh->clkdm->pwrdm.ptr->prcm_offs,
-                                 oh->prcm.omap4.rstctrl_offs);
-       } else {
-               return -EINVAL;
-       }
-
+       ret = soc_ops.deassert_hardreset(oh, &ohri);
        if (ret == -EBUSY)
                pr_warning("omap_hwmod: %s: failed to hardreset\n", oh->name);
 
@@ -1509,31 +1470,28 @@ static int _deassert_hardreset(struct omap_hwmod *oh, const char *name)
  * @oh: struct omap_hwmod *
  * @name: name of the reset line to look up and read
  *
- * Return the state of the reset line.
+ * Return the state of the reset line.  Returns -EINVAL if @oh is
+ * null, -ENOSYS if we have no way of reading the hardreset line
+ * status on the currently-booted SoC, or passes along the return
+ * value from _lookup_hardreset() or the SoC's is_hardreset_asserted
+ * code.
  */
 static int _read_hardreset(struct omap_hwmod *oh, const char *name)
 {
        struct omap_hwmod_rst_info ohri;
-       u8 ret;
+       u8 ret = -EINVAL;
 
        if (!oh)
                return -EINVAL;
 
+       if (!soc_ops.is_hardreset_asserted)
+               return -ENOSYS;
+
        ret = _lookup_hardreset(oh, name, &ohri);
        if (IS_ERR_VALUE(ret))
                return ret;
 
-       if (cpu_is_omap24xx() || cpu_is_omap34xx()) {
-               return omap2_prm_is_hardreset_asserted(oh->prcm.omap2.module_offs,
-                                                      ohri.st_shift);
-       } else if (cpu_is_omap44xx()) {
-               return omap4_prminst_is_hardreset_asserted(ohri.rst_shift,
-                                 oh->clkdm->pwrdm.ptr->prcm_partition,
-                                 oh->clkdm->pwrdm.ptr->prcm_offs,
-                                 oh->prcm.omap4.rstctrl_offs);
-       } else {
-               return -EINVAL;
-       }
+       return soc_ops.is_hardreset_asserted(oh, &ohri);
 }
 
 /**
@@ -1571,10 +1529,6 @@ static int _omap4_disable_module(struct omap_hwmod *oh)
 {
        int v;
 
-       /* The module mode does not exist prior OMAP4 */
-       if (!cpu_is_omap44xx())
-               return -EINVAL;
-
        if (!oh->clkdm || !oh->prcm.omap4.modulemode)
                return -EINVAL;
 
@@ -1814,9 +1768,11 @@ static int _enable(struct omap_hwmod *oh)
        }
 
        _enable_clocks(oh);
-       _enable_module(oh);
+       if (soc_ops.enable_module)
+               soc_ops.enable_module(oh);
 
-       r = _wait_target_ready(oh);
+       r = (soc_ops.wait_target_ready) ? soc_ops.wait_target_ready(oh) :
+               -EINVAL;
        if (!r) {
                /*
                 * Set the clockdomain to HW_AUTO only if the target is ready,
@@ -1870,7 +1826,8 @@ static int _idle(struct omap_hwmod *oh)
                _idle_sysc(oh);
        _del_initiator_dep(oh, mpu_oh);
 
-       _omap4_disable_module(oh);
+       if (soc_ops.disable_module)
+               soc_ops.disable_module(oh);
 
        /*
         * The module must be in idle mode before disabling any parents
@@ -1975,7 +1932,8 @@ static int _shutdown(struct omap_hwmod *oh)
        if (oh->_state == _HWMOD_STATE_ENABLED) {
                _del_initiator_dep(oh, mpu_oh);
                /* XXX what about the other system initiators here? dma, dsp */
-               _omap4_disable_module(oh);
+               if (soc_ops.disable_module)
+                       soc_ops.disable_module(oh);
                _disable_clocks(oh);
                if (oh->clkdm)
                        clkdm_hwmod_disable(oh->clkdm, oh);
@@ -2431,6 +2389,194 @@ static int __init _alloc_linkspace(struct omap_hwmod_ocp_if **ois)
        return 0;
 }
 
+/* Static functions intended only for use in soc_ops field function pointers */
+
+/**
+ * _omap2_wait_target_ready - wait for a module to leave slave idle
+ * @oh: struct omap_hwmod *
+ *
+ * Wait for a module @oh to leave slave idle.  Returns 0 if the module
+ * does not have an IDLEST bit or if the module successfully leaves
+ * slave idle; otherwise, pass along the return value of the
+ * appropriate *_cm*_wait_module_ready() function.
+ */
+static int _omap2_wait_target_ready(struct omap_hwmod *oh)
+{
+       if (!oh)
+               return -EINVAL;
+
+       if (oh->flags & HWMOD_NO_IDLEST)
+               return 0;
+
+       if (!_find_mpu_rt_port(oh))
+               return 0;
+
+       /* XXX check module SIDLEMODE, hardreset status, enabled clocks */
+
+       return omap2_cm_wait_module_ready(oh->prcm.omap2.module_offs,
+                                         oh->prcm.omap2.idlest_reg_id,
+                                         oh->prcm.omap2.idlest_idle_bit);
+}
+
+/**
+ * _omap4_wait_target_ready - wait for a module to leave slave idle
+ * @oh: struct omap_hwmod *
+ *
+ * Wait for a module @oh to leave slave idle.  Returns 0 if the module
+ * does not have an IDLEST bit or if the module successfully leaves
+ * slave idle; otherwise, pass along the return value of the
+ * appropriate *_cm*_wait_module_ready() function.
+ */
+static int _omap4_wait_target_ready(struct omap_hwmod *oh)
+{
+       if (!oh || !oh->clkdm)
+               return -EINVAL;
+
+       if (oh->flags & HWMOD_NO_IDLEST)
+               return 0;
+
+       if (!_find_mpu_rt_port(oh))
+               return 0;
+
+       /* XXX check module SIDLEMODE, hardreset status */
+
+       return omap4_cminst_wait_module_ready(oh->clkdm->prcm_partition,
+                                             oh->clkdm->cm_inst,
+                                             oh->clkdm->clkdm_offs,
+                                             oh->prcm.omap4.clkctrl_offs);
+}
+
+/**
+ * _omap2_assert_hardreset - call OMAP2 PRM hardreset fn with hwmod args
+ * @oh: struct omap_hwmod * to assert hardreset
+ * @ohri: hardreset line data
+ *
+ * Call omap2_prm_assert_hardreset() with parameters extracted from
+ * the hwmod @oh and the hardreset line data @ohri.  Only intended for
+ * use as an soc_ops function pointer.  Passes along the return value
+ * from omap2_prm_assert_hardreset().  XXX This function is scheduled
+ * for removal when the PRM code is moved into drivers/.
+ */
+static int _omap2_assert_hardreset(struct omap_hwmod *oh,
+                                  struct omap_hwmod_rst_info *ohri)
+{
+       return omap2_prm_assert_hardreset(oh->prcm.omap2.module_offs,
+                                         ohri->rst_shift);
+}
+
+/**
+ * _omap2_deassert_hardreset - call OMAP2 PRM hardreset fn with hwmod args
+ * @oh: struct omap_hwmod * to deassert hardreset
+ * @ohri: hardreset line data
+ *
+ * Call omap2_prm_deassert_hardreset() with parameters extracted from
+ * the hwmod @oh and the hardreset line data @ohri.  Only intended for
+ * use as an soc_ops function pointer.  Passes along the return value
+ * from omap2_prm_deassert_hardreset().  XXX This function is
+ * scheduled for removal when the PRM code is moved into drivers/.
+ */
+static int _omap2_deassert_hardreset(struct omap_hwmod *oh,
+                                    struct omap_hwmod_rst_info *ohri)
+{
+       return omap2_prm_deassert_hardreset(oh->prcm.omap2.module_offs,
+                                           ohri->rst_shift,
+                                           ohri->st_shift);
+}
+
+/**
+ * _omap2_is_hardreset_asserted - call OMAP2 PRM hardreset fn with hwmod args
+ * @oh: struct omap_hwmod * to test hardreset
+ * @ohri: hardreset line data
+ *
+ * Call omap2_prm_is_hardreset_asserted() with parameters extracted
+ * from the hwmod @oh and the hardreset line data @ohri.  Only
+ * intended for use as an soc_ops function pointer.  Passes along the
+ * return value from omap2_prm_is_hardreset_asserted().  XXX This
+ * function is scheduled for removal when the PRM code is moved into
+ * drivers/.
+ */
+static int _omap2_is_hardreset_asserted(struct omap_hwmod *oh,
+                                       struct omap_hwmod_rst_info *ohri)
+{
+       return omap2_prm_is_hardreset_asserted(oh->prcm.omap2.module_offs,
+                                              ohri->st_shift);
+}
+
+/**
+ * _omap4_assert_hardreset - call OMAP4 PRM hardreset fn with hwmod args
+ * @oh: struct omap_hwmod * to assert hardreset
+ * @ohri: hardreset line data
+ *
+ * Call omap4_prminst_assert_hardreset() with parameters extracted
+ * from the hwmod @oh and the hardreset line data @ohri.  Only
+ * intended for use as an soc_ops function pointer.  Passes along the
+ * return value from omap4_prminst_assert_hardreset().  XXX This
+ * function is scheduled for removal when the PRM code is moved into
+ * drivers/.
+ */
+static int _omap4_assert_hardreset(struct omap_hwmod *oh,
+                                  struct omap_hwmod_rst_info *ohri)
+{
+       if (!oh->clkdm)
+               return -EINVAL;
+
+       return omap4_prminst_assert_hardreset(ohri->rst_shift,
+                               oh->clkdm->pwrdm.ptr->prcm_partition,
+                               oh->clkdm->pwrdm.ptr->prcm_offs,
+                               oh->prcm.omap4.rstctrl_offs);
+}
+
+/**
+ * _omap4_deassert_hardreset - call OMAP4 PRM hardreset fn with hwmod args
+ * @oh: struct omap_hwmod * to deassert hardreset
+ * @ohri: hardreset line data
+ *
+ * Call omap4_prminst_deassert_hardreset() with parameters extracted
+ * from the hwmod @oh and the hardreset line data @ohri.  Only
+ * intended for use as an soc_ops function pointer.  Passes along the
+ * return value from omap4_prminst_deassert_hardreset().  XXX This
+ * function is scheduled for removal when the PRM code is moved into
+ * drivers/.
+ */
+static int _omap4_deassert_hardreset(struct omap_hwmod *oh,
+                                    struct omap_hwmod_rst_info *ohri)
+{
+       if (!oh->clkdm)
+               return -EINVAL;
+
+       if (ohri->st_shift)
+               pr_err("omap_hwmod: %s: %s: hwmod data error: OMAP4 does not support st_shift\n",
+                      oh->name, ohri->name);
+       return omap4_prminst_deassert_hardreset(ohri->rst_shift,
+                               oh->clkdm->pwrdm.ptr->prcm_partition,
+                               oh->clkdm->pwrdm.ptr->prcm_offs,
+                               oh->prcm.omap4.rstctrl_offs);
+}
+
+/**
+ * _omap4_is_hardreset_asserted - call OMAP4 PRM hardreset fn with hwmod args
+ * @oh: struct omap_hwmod * to test hardreset
+ * @ohri: hardreset line data
+ *
+ * Call omap4_prminst_is_hardreset_asserted() with parameters
+ * extracted from the hwmod @oh and the hardreset line data @ohri.
+ * Only intended for use as an soc_ops function pointer.  Passes along
+ * the return value from omap4_prminst_is_hardreset_asserted().  XXX
+ * This function is scheduled for removal when the PRM code is moved
+ * into drivers/.
+ */
+static int _omap4_is_hardreset_asserted(struct omap_hwmod *oh,
+                                       struct omap_hwmod_rst_info *ohri)
+{
+       if (!oh->clkdm)
+               return -EINVAL;
+
+       return omap4_prminst_is_hardreset_asserted(ohri->rst_shift,
+                               oh->clkdm->pwrdm.ptr->prcm_partition,
+                               oh->clkdm->pwrdm.ptr->prcm_offs,
+                               oh->prcm.omap4.rstctrl_offs);
+}
+
 /* Public functions */
 
 u32 omap_hwmod_read(struct omap_hwmod *oh, u16 reg_offs)
@@ -2563,12 +2709,18 @@ int omap_hwmod_for_each(int (*fn)(struct omap_hwmod *oh, void *data),
  *
  * Intended to be called early in boot before the clock framework is
  * initialized.  If @ois is not null, will register all omap_hwmods
- * listed in @ois that are valid for this chip.  Returns 0.
+ * listed in @ois that are valid for this chip.  Returns -EINVAL if
+ * omap_hwmod_init() hasn't been called before calling this function,
+ * -ENOMEM if the link memory area can't be allocated, or 0 upon
+ * success.
  */
 int __init omap_hwmod_register_links(struct omap_hwmod_ocp_if **ois)
 {
        int r, i;
 
+       if (!inited)
+               return -EINVAL;
+
        if (!ois)
                return 0;
 
@@ -3401,3 +3553,32 @@ int omap_hwmod_pad_route_irq(struct omap_hwmod *oh, int pad_idx, int irq_idx)
 
        return 0;
 }
+
+/**
+ * omap_hwmod_init - initialize the hwmod code
+ *
+ * Sets up some function pointers needed by the hwmod code to operate on the
+ * currently-booted SoC.  Intended to be called once during kernel init
+ * before any hwmods are registered.  No return value.
+ */
+void __init omap_hwmod_init(void)
+{
+       if (cpu_is_omap24xx() || cpu_is_omap34xx()) {
+               soc_ops.wait_target_ready = _omap2_wait_target_ready;
+               soc_ops.assert_hardreset = _omap2_assert_hardreset;
+               soc_ops.deassert_hardreset = _omap2_deassert_hardreset;
+               soc_ops.is_hardreset_asserted = _omap2_is_hardreset_asserted;
+       } else if (cpu_is_omap44xx()) {
+               soc_ops.enable_module = _omap4_enable_module;
+               soc_ops.disable_module = _omap4_disable_module;
+               soc_ops.wait_target_ready = _omap4_wait_target_ready;
+               soc_ops.assert_hardreset = _omap4_assert_hardreset;
+               soc_ops.deassert_hardreset = _omap4_deassert_hardreset;
+               soc_ops.is_hardreset_asserted = _omap4_is_hardreset_asserted;
+               soc_ops.init_clkdm = _init_clkdm;
+       } else {
+               WARN(1, "omap_hwmod: unknown SoC type\n");
+       }
+
+       inited = true;
+}
index a7640d1b215e7f94f5dc8fea09738930d75a0208..50cfab61b0e21bb6fc3ff00e769bd38570c3761b 100644 (file)
@@ -192,6 +192,11 @@ static struct omap_hwmod_class omap2420_mcbsp_hwmod_class = {
        .name = "mcbsp",
 };
 
+static struct omap_hwmod_opt_clk mcbsp_opt_clks[] = {
+       { .role = "pad_fck", .clk = "mcbsp_clks" },
+       { .role = "prcm_fck", .clk = "func_96m_ck" },
+};
+
 /* mcbsp1 */
 static struct omap_hwmod_irq_info omap2420_mcbsp1_irqs[] = {
        { .name = "tx", .irq = 59 },
@@ -214,6 +219,8 @@ static struct omap_hwmod omap2420_mcbsp1_hwmod = {
                        .idlest_idle_bit = OMAP24XX_ST_MCBSP1_SHIFT,
                },
        },
+       .opt_clks       = mcbsp_opt_clks,
+       .opt_clks_cnt   = ARRAY_SIZE(mcbsp_opt_clks),
 };
 
 /* mcbsp2 */
@@ -238,6 +245,8 @@ static struct omap_hwmod omap2420_mcbsp2_hwmod = {
                        .idlest_idle_bit = OMAP24XX_ST_MCBSP2_SHIFT,
                },
        },
+       .opt_clks       = mcbsp_opt_clks,
+       .opt_clks_cnt   = ARRAY_SIZE(mcbsp_opt_clks),
 };
 
 static struct omap_hwmod_class_sysconfig omap2420_msdi_sysc = {
@@ -585,5 +594,6 @@ static struct omap_hwmod_ocp_if *omap2420_hwmod_ocp_ifs[] __initdata = {
 
 int __init omap2420_hwmod_init(void)
 {
+       omap_hwmod_init();
        return omap_hwmod_register_links(omap2420_hwmod_ocp_ifs);
 }
index 4d72649812303cddc2c1eeb73f6bee3bcd4c4027..58b5bc196d32c4de29054ead6137321d921c1b5a 100644 (file)
@@ -296,6 +296,11 @@ static struct omap_hwmod_class omap2430_mcbsp_hwmod_class = {
        .rev  = MCBSP_CONFIG_TYPE2,
 };
 
+static struct omap_hwmod_opt_clk mcbsp_opt_clks[] = {
+       { .role = "pad_fck", .clk = "mcbsp_clks" },
+       { .role = "prcm_fck", .clk = "func_96m_ck" },
+};
+
 /* mcbsp1 */
 static struct omap_hwmod_irq_info omap2430_mcbsp1_irqs[] = {
        { .name = "tx",         .irq = 59 },
@@ -320,6 +325,8 @@ static struct omap_hwmod omap2430_mcbsp1_hwmod = {
                        .idlest_idle_bit = OMAP24XX_ST_MCBSP1_SHIFT,
                },
        },
+       .opt_clks       = mcbsp_opt_clks,
+       .opt_clks_cnt   = ARRAY_SIZE(mcbsp_opt_clks),
 };
 
 /* mcbsp2 */
@@ -345,6 +352,8 @@ static struct omap_hwmod omap2430_mcbsp2_hwmod = {
                        .idlest_idle_bit = OMAP24XX_ST_MCBSP2_SHIFT,
                },
        },
+       .opt_clks       = mcbsp_opt_clks,
+       .opt_clks_cnt   = ARRAY_SIZE(mcbsp_opt_clks),
 };
 
 /* mcbsp3 */
@@ -370,6 +379,8 @@ static struct omap_hwmod omap2430_mcbsp3_hwmod = {
                        .idlest_idle_bit = OMAP2430_ST_MCBSP3_SHIFT,
                },
        },
+       .opt_clks       = mcbsp_opt_clks,
+       .opt_clks_cnt   = ARRAY_SIZE(mcbsp_opt_clks),
 };
 
 /* mcbsp4 */
@@ -401,6 +412,8 @@ static struct omap_hwmod omap2430_mcbsp4_hwmod = {
                        .idlest_idle_bit = OMAP2430_ST_MCBSP4_SHIFT,
                },
        },
+       .opt_clks       = mcbsp_opt_clks,
+       .opt_clks_cnt   = ARRAY_SIZE(mcbsp_opt_clks),
 };
 
 /* mcbsp5 */
@@ -432,6 +445,8 @@ static struct omap_hwmod omap2430_mcbsp5_hwmod = {
                        .idlest_idle_bit = OMAP2430_ST_MCBSP5_SHIFT,
                },
        },
+       .opt_clks       = mcbsp_opt_clks,
+       .opt_clks_cnt   = ARRAY_SIZE(mcbsp_opt_clks),
 };
 
 /* MMC/SD/SDIO common */
@@ -938,5 +953,6 @@ static struct omap_hwmod_ocp_if *omap2430_hwmod_ocp_ifs[] __initdata = {
 
 int __init omap2430_hwmod_init(void)
 {
+       omap_hwmod_init();
        return omap_hwmod_register_links(omap2430_hwmod_ocp_ifs);
 }
index b26d3c9bca1621cab9ac87eea39aff6cc489fc24..8379b8d7244a1f9803f5b63d6b504f3976a98cf1 100644 (file)
@@ -1074,6 +1074,17 @@ static struct omap_hwmod_class omap3xxx_mcbsp_hwmod_class = {
        .rev  = MCBSP_CONFIG_TYPE3,
 };
 
+/* McBSP functional clock mapping */
+static struct omap_hwmod_opt_clk mcbsp15_opt_clks[] = {
+       { .role = "pad_fck", .clk = "mcbsp_clks" },
+       { .role = "prcm_fck", .clk = "core_96m_fck" },
+};
+
+static struct omap_hwmod_opt_clk mcbsp234_opt_clks[] = {
+       { .role = "pad_fck", .clk = "mcbsp_clks" },
+       { .role = "prcm_fck", .clk = "per_96m_fck" },
+};
+
 /* mcbsp1 */
 static struct omap_hwmod_irq_info omap3xxx_mcbsp1_irqs[] = {
        { .name = "common", .irq = 16 },
@@ -1097,6 +1108,8 @@ static struct omap_hwmod omap3xxx_mcbsp1_hwmod = {
                        .idlest_idle_bit = OMAP3430_ST_MCBSP1_SHIFT,
                },
        },
+       .opt_clks       = mcbsp15_opt_clks,
+       .opt_clks_cnt   = ARRAY_SIZE(mcbsp15_opt_clks),
 };
 
 /* mcbsp2 */
@@ -1126,6 +1139,8 @@ static struct omap_hwmod omap3xxx_mcbsp2_hwmod = {
                        .idlest_idle_bit = OMAP3430_ST_MCBSP2_SHIFT,
                },
        },
+       .opt_clks       = mcbsp234_opt_clks,
+       .opt_clks_cnt   = ARRAY_SIZE(mcbsp234_opt_clks),
        .dev_attr       = &omap34xx_mcbsp2_dev_attr,
 };
 
@@ -1156,6 +1171,8 @@ static struct omap_hwmod omap3xxx_mcbsp3_hwmod = {
                        .idlest_idle_bit = OMAP3430_ST_MCBSP3_SHIFT,
                },
        },
+       .opt_clks       = mcbsp234_opt_clks,
+       .opt_clks_cnt   = ARRAY_SIZE(mcbsp234_opt_clks),
        .dev_attr       = &omap34xx_mcbsp3_dev_attr,
 };
 
@@ -1188,6 +1205,8 @@ static struct omap_hwmod omap3xxx_mcbsp4_hwmod = {
                        .idlest_idle_bit = OMAP3430_ST_MCBSP4_SHIFT,
                },
        },
+       .opt_clks       = mcbsp234_opt_clks,
+       .opt_clks_cnt   = ARRAY_SIZE(mcbsp234_opt_clks),
 };
 
 /* mcbsp5 */
@@ -1219,6 +1238,8 @@ static struct omap_hwmod omap3xxx_mcbsp5_hwmod = {
                        .idlest_idle_bit = OMAP3430_ST_MCBSP5_SHIFT,
                },
        },
+       .opt_clks       = mcbsp15_opt_clks,
+       .opt_clks_cnt   = ARRAY_SIZE(mcbsp15_opt_clks),
 };
 
 /* 'mcbsp sidetone' class */
@@ -3283,6 +3304,8 @@ int __init omap3xxx_hwmod_init(void)
        struct omap_hwmod_ocp_if **h = NULL;
        unsigned int rev;
 
+       omap_hwmod_init();
+
        /* Register hwmod links common to all OMAP3 */
        r = omap_hwmod_register_links(omap3xxx_hwmod_ocp_ifs);
        if (r < 0)
index f30e861ce6d9cf42c76d90cb78cfcc90cf99f31b..d055b4725679dc60a457379f0a532337a1e08782 100644 (file)
@@ -2544,14 +2544,12 @@ static struct omap_hwmod omap44xx_prcm_mpu_hwmod = {
 static struct omap_hwmod omap44xx_cm_core_aon_hwmod = {
        .name           = "cm_core_aon",
        .class          = &omap44xx_prcm_hwmod_class,
-       .clkdm_name     = "cm_clkdm",
 };
 
 /* cm_core */
 static struct omap_hwmod omap44xx_cm_core_hwmod = {
        .name           = "cm_core",
        .class          = &omap44xx_prcm_hwmod_class,
-       .clkdm_name     = "cm_clkdm",
 };
 
 /* prm */
@@ -2568,7 +2566,6 @@ static struct omap_hwmod_rst_info omap44xx_prm_resets[] = {
 static struct omap_hwmod omap44xx_prm_hwmod = {
        .name           = "prm",
        .class          = &omap44xx_prcm_hwmod_class,
-       .clkdm_name     = "prm_clkdm",
        .mpu_irqs       = omap44xx_prm_irqs,
        .rst_lines      = omap44xx_prm_resets,
        .rst_lines_cnt  = ARRAY_SIZE(omap44xx_prm_resets),
@@ -6148,6 +6145,7 @@ static struct omap_hwmod_ocp_if *omap44xx_hwmod_ocp_ifs[] __initdata = {
 
 int __init omap44xx_hwmod_init(void)
 {
+       omap_hwmod_init();
        return omap_hwmod_register_links(omap44xx_hwmod_ocp_ifs);
 }
 
diff --git a/arch/arm/mach-omap2/usb-fs.c b/arch/arm/mach-omap2/usb-fs.c
deleted file mode 100644 (file)
index 1481078..0000000
+++ /dev/null
@@ -1,359 +0,0 @@
-/*
- * Platform level USB initialization for FS USB OTG controller on omap1 and 24xx
- *
- * Copyright (C) 2004 Texas Instruments, Inc.
- *
- * 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.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- */
-
-#include <linux/module.h>
-#include <linux/kernel.h>
-#include <linux/types.h>
-#include <linux/errno.h>
-#include <linux/init.h>
-#include <linux/platform_device.h>
-#include <linux/clk.h>
-#include <linux/err.h>
-
-#include <asm/irq.h>
-
-#include <plat/usb.h>
-#include <plat/board.h>
-
-#include "control.h"
-#include "mux.h"
-
-#define INT_USB_IRQ_GEN                INT_24XX_USB_IRQ_GEN
-#define INT_USB_IRQ_NISO       INT_24XX_USB_IRQ_NISO
-#define INT_USB_IRQ_ISO                INT_24XX_USB_IRQ_ISO
-#define INT_USB_IRQ_HGEN       INT_24XX_USB_IRQ_HGEN
-#define INT_USB_IRQ_OTG                INT_24XX_USB_IRQ_OTG
-
-#if defined(CONFIG_ARCH_OMAP2)
-
-#ifdef CONFIG_USB_GADGET_OMAP
-
-static struct resource udc_resources[] = {
-       /* order is significant! */
-       {               /* registers */
-               .start          = UDC_BASE,
-               .end            = UDC_BASE + 0xff,
-               .flags          = IORESOURCE_MEM,
-       }, {            /* general IRQ */
-               .start          = INT_USB_IRQ_GEN,
-               .flags          = IORESOURCE_IRQ,
-       }, {            /* PIO IRQ */
-               .start          = INT_USB_IRQ_NISO,
-               .flags          = IORESOURCE_IRQ,
-       }, {            /* SOF IRQ */
-               .start          = INT_USB_IRQ_ISO,
-               .flags          = IORESOURCE_IRQ,
-       },
-};
-
-static u64 udc_dmamask = ~(u32)0;
-
-static struct platform_device udc_device = {
-       .name           = "omap_udc",
-       .id             = -1,
-       .dev = {
-               .dma_mask               = &udc_dmamask,
-               .coherent_dma_mask      = 0xffffffff,
-       },
-       .num_resources  = ARRAY_SIZE(udc_resources),
-       .resource       = udc_resources,
-};
-
-static inline void udc_device_init(struct omap_usb_config *pdata)
-{
-       pdata->udc_device = &udc_device;
-}
-
-#else
-
-static inline void udc_device_init(struct omap_usb_config *pdata)
-{
-}
-
-#endif
-
-#if    defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE)
-
-/* The dmamask must be set for OHCI to work */
-static u64 ohci_dmamask = ~(u32)0;
-
-static struct resource ohci_resources[] = {
-       {
-               .start  = OMAP_OHCI_BASE,
-               .end    = OMAP_OHCI_BASE + 0xff,
-               .flags  = IORESOURCE_MEM,
-       },
-       {
-               .start  = INT_USB_IRQ_HGEN,
-               .flags  = IORESOURCE_IRQ,
-       },
-};
-
-static struct platform_device ohci_device = {
-       .name                   = "ohci",
-       .id                     = -1,
-       .dev = {
-               .dma_mask               = &ohci_dmamask,
-               .coherent_dma_mask      = 0xffffffff,
-       },
-       .num_resources  = ARRAY_SIZE(ohci_resources),
-       .resource               = ohci_resources,
-};
-
-static inline void ohci_device_init(struct omap_usb_config *pdata)
-{
-       pdata->ohci_device = &ohci_device;
-}
-
-#else
-
-static inline void ohci_device_init(struct omap_usb_config *pdata)
-{
-}
-
-#endif
-
-#if    defined(CONFIG_USB_OTG) && defined(CONFIG_ARCH_OMAP_OTG)
-
-static struct resource otg_resources[] = {
-       /* order is significant! */
-       {
-               .start          = OTG_BASE,
-               .end            = OTG_BASE + 0xff,
-               .flags          = IORESOURCE_MEM,
-       }, {
-               .start          = INT_USB_IRQ_OTG,
-               .flags          = IORESOURCE_IRQ,
-       },
-};
-
-static struct platform_device otg_device = {
-       .name           = "omap_otg",
-       .id             = -1,
-       .num_resources  = ARRAY_SIZE(otg_resources),
-       .resource       = otg_resources,
-};
-
-static inline void otg_device_init(struct omap_usb_config *pdata)
-{
-       pdata->otg_device = &otg_device;
-}
-
-#else
-
-static inline void otg_device_init(struct omap_usb_config *pdata)
-{
-}
-
-#endif
-
-static void omap2_usb_devconf_clear(u8 port, u32 mask)
-{
-       u32 r;
-
-       r = omap_ctrl_readl(OMAP2_CONTROL_DEVCONF0);
-       r &= ~USBTXWRMODEI(port, mask);
-       omap_ctrl_writel(r, OMAP2_CONTROL_DEVCONF0);
-}
-
-static void omap2_usb_devconf_set(u8 port, u32 mask)
-{
-       u32 r;
-
-       r = omap_ctrl_readl(OMAP2_CONTROL_DEVCONF0);
-       r |= USBTXWRMODEI(port, mask);
-       omap_ctrl_writel(r, OMAP2_CONTROL_DEVCONF0);
-}
-
-static void omap2_usb2_disable_5pinbitll(void)
-{
-       u32 r;
-
-       r = omap_ctrl_readl(OMAP2_CONTROL_DEVCONF0);
-       r &= ~(USBTXWRMODEI(2, USB_BIDIR_TLL) | USBT2TLL5PI);
-       omap_ctrl_writel(r, OMAP2_CONTROL_DEVCONF0);
-}
-
-static void omap2_usb2_enable_5pinunitll(void)
-{
-       u32 r;
-
-       r = omap_ctrl_readl(OMAP2_CONTROL_DEVCONF0);
-       r |= USBTXWRMODEI(2, USB_UNIDIR_TLL) | USBT2TLL5PI;
-       omap_ctrl_writel(r, OMAP2_CONTROL_DEVCONF0);
-}
-
-static u32 __init omap2_usb0_init(unsigned nwires, unsigned is_device)
-{
-       u32     syscon1 = 0;
-
-       omap2_usb_devconf_clear(0, USB_BIDIR_TLL);
-
-       if (nwires == 0)
-               return 0;
-
-       if (is_device)
-               omap_mux_init_signal("usb0_puen", 0);
-
-       omap_mux_init_signal("usb0_dat", 0);
-       omap_mux_init_signal("usb0_txen", 0);
-       omap_mux_init_signal("usb0_se0", 0);
-       if (nwires != 3)
-               omap_mux_init_signal("usb0_rcv", 0);
-
-       switch (nwires) {
-       case 3:
-               syscon1 = 2;
-               omap2_usb_devconf_set(0, USB_BIDIR);
-               break;
-       case 4:
-               syscon1 = 1;
-               omap2_usb_devconf_set(0, USB_BIDIR);
-               break;
-       case 6:
-               syscon1 = 3;
-               omap_mux_init_signal("usb0_vp", 0);
-               omap_mux_init_signal("usb0_vm", 0);
-               omap2_usb_devconf_set(0, USB_UNIDIR);
-               break;
-       default:
-               printk(KERN_ERR "illegal usb%d %d-wire transceiver\n",
-                       0, nwires);
-       }
-
-       return syscon1 << 16;
-}
-
-static u32 __init omap2_usb1_init(unsigned nwires)
-{
-       u32     syscon1 = 0;
-
-       omap2_usb_devconf_clear(1, USB_BIDIR_TLL);
-
-       if (nwires == 0)
-               return 0;
-
-       /* NOTE:  board-specific code must set up pin muxing for usb1,
-        * since each signal could come out on either of two balls.
-        */
-
-       switch (nwires) {
-       case 2:
-               /* NOTE: board-specific code must override this setting if
-                * this TLL link is not using DP/DM
-                */
-               syscon1 = 1;
-               omap2_usb_devconf_set(1, USB_BIDIR_TLL);
-               break;
-       case 3:
-               syscon1 = 2;
-               omap2_usb_devconf_set(1, USB_BIDIR);
-               break;
-       case 4:
-               syscon1 = 1;
-               omap2_usb_devconf_set(1, USB_BIDIR);
-               break;
-       case 6:
-       default:
-               printk(KERN_ERR "illegal usb%d %d-wire transceiver\n",
-                       1, nwires);
-       }
-
-       return syscon1 << 20;
-}
-
-static u32 __init omap2_usb2_init(unsigned nwires, unsigned alt_pingroup)
-{
-       u32     syscon1 = 0;
-
-       omap2_usb2_disable_5pinbitll();
-       alt_pingroup = 0;
-
-       /* NOTE omap1 erratum: must leave USB2_UNI_R set if usb0 in use */
-       if (alt_pingroup || nwires == 0)
-               return 0;
-
-       omap_mux_init_signal("usb2_dat", 0);
-       omap_mux_init_signal("usb2_se0", 0);
-       if (nwires > 2)
-               omap_mux_init_signal("usb2_txen", 0);
-       if (nwires > 3)
-               omap_mux_init_signal("usb2_rcv", 0);
-
-       switch (nwires) {
-       case 2:
-               /* NOTE: board-specific code must override this setting if
-                * this TLL link is not using DP/DM
-                */
-               syscon1 = 1;
-               omap2_usb_devconf_set(2, USB_BIDIR_TLL);
-               break;
-       case 3:
-               syscon1 = 2;
-               omap2_usb_devconf_set(2, USB_BIDIR);
-               break;
-       case 4:
-               syscon1 = 1;
-               omap2_usb_devconf_set(2, USB_BIDIR);
-               break;
-       case 5:
-               /* NOTE: board-specific code must mux this setting depending
-                * on TLL link using DP/DM.  Something must also
-                * set up OTG_SYSCON2.HMC_TLL{ATTACH,SPEED}
-                * 2420: hdq_sio.usb2_tllse0 or vlynq_rx0.usb2_tllse0
-                * 2430: hdq_sio.usb2_tllse0 or sdmmc2_dat0.usb2_tllse0
-                */
-
-               syscon1 = 3;
-               omap2_usb2_enable_5pinunitll();
-               break;
-       case 6:
-       default:
-               printk(KERN_ERR "illegal usb%d %d-wire transceiver\n",
-                       2, nwires);
-       }
-
-       return syscon1 << 24;
-}
-
-void __init omap2_usbfs_init(struct omap_usb_config *pdata)
-{
-       struct clk *ick;
-
-       if (!cpu_is_omap24xx())
-               return;
-
-       ick = clk_get(NULL, "usb_l4_ick");
-       if (IS_ERR(ick))
-               return;
-
-       clk_enable(ick);
-       pdata->usb0_init = omap2_usb0_init;
-       pdata->usb1_init = omap2_usb1_init;
-       pdata->usb2_init = omap2_usb2_init;
-       udc_device_init(pdata);
-       ohci_device_init(pdata);
-       otg_device_init(pdata);
-       omap_otg_init(pdata);
-       clk_disable(ick);
-       clk_put(ick);
-}
-
-#endif
index ed8605f0115561ac44dc542c52d27afc0f98233b..6d87532871cdf808402ec9d6059772b1e6f522ca 100644 (file)
@@ -4,7 +4,7 @@
 
 # Common support
 obj-y := common.o sram.o clock.o devices.o dma.o mux.o \
-        usb.o fb.o counter_32k.o
+        fb.o counter_32k.o
 obj-m :=
 obj-n :=
 obj-  :=
index cb16ade437cb6d94fc608c4e2060dfa512514e58..7fe626761e53bc87a2aaec3add8c7f7854635875 100644 (file)
@@ -573,22 +573,25 @@ EXPORT_SYMBOL(omap_set_dma_dest_burst_mode);
 
 static inline void omap_enable_channel_irq(int lch)
 {
-       u32 status;
-
        /* Clear CSR */
        if (cpu_class_is_omap1())
-               status = p->dma_read(CSR, lch);
-       else if (cpu_class_is_omap2())
+               p->dma_read(CSR, lch);
+       else
                p->dma_write(OMAP2_DMA_CSR_CLEAR_MASK, CSR, lch);
 
        /* Enable some nice interrupts. */
        p->dma_write(dma_chan[lch].enabled_irqs, CICR, lch);
 }
 
-static void omap_disable_channel_irq(int lch)
+static inline void omap_disable_channel_irq(int lch)
 {
-       if (cpu_class_is_omap2())
-               p->dma_write(0, CICR, lch);
+       /* disable channel interrupts */
+       p->dma_write(0, CICR, lch);
+       /* Clear CSR */
+       if (cpu_class_is_omap1())
+               p->dma_read(CSR, lch);
+       else
+               p->dma_write(OMAP2_DMA_CSR_CLEAR_MASK, CSR, lch);
 }
 
 void omap_enable_dma_irq(int lch, u16 bits)
@@ -632,14 +635,14 @@ static inline void disable_lnk(int lch)
        l = p->dma_read(CLNK_CTRL, lch);
 
        /* Disable interrupts */
+       omap_disable_channel_irq(lch);
+
        if (cpu_class_is_omap1()) {
-               p->dma_write(0, CICR, lch);
                /* Set the STOP_LNK bit */
                l |= 1 << 14;
        }
 
        if (cpu_class_is_omap2()) {
-               omap_disable_channel_irq(lch);
                /* Clear the ENABLE_LNK bit */
                l &= ~(1 << 15);
        }
@@ -657,6 +660,9 @@ static inline void omap2_enable_irq_lch(int lch)
                return;
 
        spin_lock_irqsave(&dma_chan_lock, flags);
+       /* clear IRQ STATUS */
+       p->dma_write(1 << lch, IRQSTATUS_L0, lch);
+       /* Enable interrupt */
        val = p->dma_read(IRQENABLE_L0, lch);
        val |= 1 << lch;
        p->dma_write(val, IRQENABLE_L0, lch);
@@ -672,9 +678,12 @@ static inline void omap2_disable_irq_lch(int lch)
                return;
 
        spin_lock_irqsave(&dma_chan_lock, flags);
+       /* Disable interrupt */
        val = p->dma_read(IRQENABLE_L0, lch);
        val &= ~(1 << lch);
        p->dma_write(val, IRQENABLE_L0, lch);
+       /* clear IRQ STATUS */
+       p->dma_write(1 << lch, IRQSTATUS_L0, lch);
        spin_unlock_irqrestore(&dma_chan_lock, flags);
 }
 
@@ -745,11 +754,8 @@ int omap_request_dma(int dev_id, const char *dev_name,
        }
 
        if (cpu_class_is_omap2()) {
-               omap2_enable_irq_lch(free_ch);
                omap_enable_channel_irq(free_ch);
-               /* Clear the CSR register and IRQ status register */
-               p->dma_write(OMAP2_DMA_CSR_CLEAR_MASK, CSR, free_ch);
-               p->dma_write(1 << free_ch, IRQSTATUS_L0, 0);
+               omap2_enable_irq_lch(free_ch);
        }
 
        *dma_ch_out = free_ch;
@@ -768,27 +774,19 @@ void omap_free_dma(int lch)
                return;
        }
 
-       if (cpu_class_is_omap1()) {
-               /* Disable all DMA interrupts for the channel. */
-               p->dma_write(0, CICR, lch);
-               /* Make sure the DMA transfer is stopped. */
-               p->dma_write(0, CCR, lch);
-       }
-
-       if (cpu_class_is_omap2()) {
+       /* Disable interrupt for logical channel */
+       if (cpu_class_is_omap2())
                omap2_disable_irq_lch(lch);
 
-               /* Clear the CSR register and IRQ status register */
-               p->dma_write(OMAP2_DMA_CSR_CLEAR_MASK, CSR, lch);
-               p->dma_write(1 << lch, IRQSTATUS_L0, lch);
+       /* Disable all DMA interrupts for the channel. */
+       omap_disable_channel_irq(lch);
 
-               /* Disable all DMA interrupts for the channel. */
-               p->dma_write(0, CICR, lch);
+       /* Make sure the DMA transfer is stopped. */
+       p->dma_write(0, CCR, lch);
 
-               /* Make sure the DMA transfer is stopped. */
-               p->dma_write(0, CCR, lch);
+       /* Clear registers */
+       if (cpu_class_is_omap2())
                omap_clear_dma(lch);
-       }
 
        spin_lock_irqsave(&dma_chan_lock, flags);
        dma_chan[lch].dev_id = -1;
@@ -943,8 +941,7 @@ void omap_stop_dma(int lch)
        u32 l;
 
        /* Disable all interrupts on the channel */
-       if (cpu_class_is_omap1())
-               p->dma_write(0, CICR, lch);
+       omap_disable_channel_irq(lch);
 
        l = p->dma_read(CCR, lch);
        if (IS_DMA_ERRATA(DMA_ERRATA_i541) &&
index 4814c5b653068a94f14fcfa941b76c0b232c2f50..e62f20a5c0afafedbf1c620f01c25419e867c03f 100644 (file)
@@ -57,44 +57,6 @@ struct omap_camera_sensor_config {
        int (*power_off)(void * data);
 };
 
-struct omap_usb_config {
-       /* Configure drivers according to the connectors on your board:
-        *  - "A" connector (rectagular)
-        *      ... for host/OHCI use, set "register_host".
-        *  - "B" connector (squarish) or "Mini-B"
-        *      ... for device/gadget use, set "register_dev".
-        *  - "Mini-AB" connector (very similar to Mini-B)
-        *      ... for OTG use as device OR host, initialize "otg"
-        */
-       unsigned        register_host:1;
-       unsigned        register_dev:1;
-       u8              otg;    /* port number, 1-based:  usb1 == 2 */
-
-       u8              hmc_mode;
-
-       /* implicitly true if otg:  host supports remote wakeup? */
-       u8              rwc;
-
-       /* signaling pins used to talk to transceiver on usbN:
-        *  0 == usbN unused
-        *  2 == usb0-only, using internal transceiver
-        *  3 == 3 wire bidirectional
-        *  4 == 4 wire bidirectional
-        *  6 == 6 wire unidirectional (or TLL)
-        */
-       u8              pins[3];
-
-       struct platform_device *udc_device;
-       struct platform_device *ohci_device;
-       struct platform_device *otg_device;
-
-       u32 (*usb0_init)(unsigned nwires, unsigned is_device);
-       u32 (*usb1_init)(unsigned nwires);
-       u32 (*usb2_init)(unsigned nwires, unsigned alt_pingroup);
-
-       int (*ocpi_enable)(void);
-};
-
 struct omap_lcd_config {
        char panel_name[16];
        char ctrl_name[16];
index d0ef57c1d71b8d674fd649342f3241eed5d0ba53..656b9862279e7f757e9e1328a81279f20ef3b7e7 100644 (file)
@@ -156,7 +156,6 @@ struct dpll_data {
        u8                      min_divider;
        u16                     max_divider;
        u8                      modes;
-#if defined(CONFIG_ARCH_OMAP3) || defined(CONFIG_ARCH_OMAP4)
        void __iomem            *autoidle_reg;
        void __iomem            *idlest_reg;
        u32                     autoidle_mask;
@@ -167,7 +166,6 @@ struct dpll_data {
        u8                      auto_recal_bit;
        u8                      recal_en_bit;
        u8                      recal_st_bit;
-#  endif
        u8                      flags;
 };
 
index 9c604b390f9f74cd8fdfa63eb617a1cd6e3ebe02..5927709b19089910d6a04b5478ed19c7b3db5426 100644 (file)
@@ -18,6 +18,9 @@ struct omap_dsp_platform_data {
        u32 (*dsp_cm_read)(s16 , u16);
        u32 (*dsp_cm_rmw_bits)(u32, u32, s16, s16);
 
+       void (*set_bootaddr)(u32);
+       void (*set_bootmode)(u8);
+
        phys_addr_t phys_mempool_base;
        phys_addr_t phys_mempool_size;
 };
index c835b7194ff57ba71d5448746ea21e6134e39ef7..a8ecc53b3670cea57fcce1a9c3487d0a2f786a47 100644 (file)
@@ -629,6 +629,8 @@ int omap_hwmod_no_setup_reset(struct omap_hwmod *oh);
 
 int omap_hwmod_pad_route_irq(struct omap_hwmod *oh, int pad_idx, int irq_idx);
 
+extern void __init omap_hwmod_init(void);
+
 /*
  * Chip variant-specific hwmod init routines - XXX should be converted
  * to use initcalls once the initial boot ordering is straightened out
index 762eeb0626c128fd5c40bbb97daff230ef881466..548a4c8d63df4b5d072ee560d901d39137941d47 100644 (file)
@@ -44,6 +44,8 @@ struct usbhs_omap_board_data {
        struct regulator                *regulator[OMAP3_HS_USB_PORTS];
 };
 
+#ifdef CONFIG_ARCH_OMAP2PLUS
+
 struct ehci_hcd_omap_platform_data {
        enum usbhs_omap_port_mode       port_mode[OMAP3_HS_USB_PORTS];
        int                             reset_gpio_port[OMAP3_HS_USB_PORTS];
@@ -64,26 +66,6 @@ struct usbhs_omap_platform_data {
 };
 /*-------------------------------------------------------------------------*/
 
-#define OMAP1_OTG_BASE                 0xfffb0400
-#define OMAP1_UDC_BASE                 0xfffb4000
-#define OMAP1_OHCI_BASE                        0xfffba000
-
-#define OMAP2_OHCI_BASE                        0x4805e000
-#define OMAP2_UDC_BASE                 0x4805e200
-#define OMAP2_OTG_BASE                 0x4805e300
-
-#ifdef CONFIG_ARCH_OMAP1
-
-#define OTG_BASE                       OMAP1_OTG_BASE
-#define UDC_BASE                       OMAP1_UDC_BASE
-#define OMAP_OHCI_BASE                 OMAP1_OHCI_BASE
-
-#else
-
-#define OTG_BASE                       OMAP2_OTG_BASE
-#define UDC_BASE                       OMAP2_UDC_BASE
-#define OMAP_OHCI_BASE                 OMAP2_OHCI_BASE
-
 struct omap_musb_board_data {
        u8      interface_type;
        u8      mode;
@@ -107,44 +89,6 @@ extern int omap4430_phy_init(struct device *dev);
 extern int omap4430_phy_exit(struct device *dev);
 extern int omap4430_phy_suspend(struct device *dev, int suspend);
 
-/*
- * NOTE: Please update omap USB drivers to use ioremap + read/write
- */
-
-#define OMAP2_L4_IO_OFFSET     0xb2000000
-#define OMAP2_L4_IO_ADDRESS(pa)        IOMEM((pa) + OMAP2_L4_IO_OFFSET)
-
-static inline u8 omap_readb(u32 pa)
-{
-       return __raw_readb(OMAP2_L4_IO_ADDRESS(pa));
-}
-
-static inline u16 omap_readw(u32 pa)
-{
-       return __raw_readw(OMAP2_L4_IO_ADDRESS(pa));
-}
-
-static inline u32 omap_readl(u32 pa)
-{
-       return __raw_readl(OMAP2_L4_IO_ADDRESS(pa));
-}
-
-static inline void omap_writeb(u8 v, u32 pa)
-{
-       __raw_writeb(v, OMAP2_L4_IO_ADDRESS(pa));
-}
-
-
-static inline void omap_writew(u16 v, u32 pa)
-{
-       __raw_writew(v, OMAP2_L4_IO_ADDRESS(pa));
-}
-
-static inline void omap_writel(u32 v, u32 pa)
-{
-       __raw_writel(v, OMAP2_L4_IO_ADDRESS(pa));
-}
-
 #endif
 
 extern void am35x_musb_reset(void);
@@ -153,142 +97,6 @@ extern void am35x_musb_clear_irq(void);
 extern void am35x_set_mode(u8 musb_mode);
 extern void ti81xx_musb_phy_power(u8 on);
 
-/*
- * FIXME correct answer depends on hmc_mode,
- * as does (on omap1) any nonzero value for config->otg port number
- */
-#ifdef CONFIG_USB_GADGET_OMAP
-#define        is_usb0_device(config)  1
-#else
-#define        is_usb0_device(config)  0
-#endif
-
-void omap_otg_init(struct omap_usb_config *config);
-
-#if defined(CONFIG_USB) || defined(CONFIG_USB_MODULE)
-void omap1_usb_init(struct omap_usb_config *pdata);
-#else
-static inline void omap1_usb_init(struct omap_usb_config *pdata)
-{
-}
-#endif
-
-#if defined(CONFIG_ARCH_OMAP_OTG) || defined(CONFIG_ARCH_OMAP_OTG_MODULE)
-void omap2_usbfs_init(struct omap_usb_config *pdata);
-#else
-static inline void omap2_usbfs_init(struct omap_usb_config *pdata)
-{
-}
-#endif
-
-/*-------------------------------------------------------------------------*/
-
-/*
- * OTG and transceiver registers, for OMAPs starting with ARM926
- */
-#define OTG_REV                                (OTG_BASE + 0x00)
-#define OTG_SYSCON_1                   (OTG_BASE + 0x04)
-#      define   USB2_TRX_MODE(w)       (((w)>>24)&0x07)
-#      define   USB1_TRX_MODE(w)       (((w)>>20)&0x07)
-#      define   USB0_TRX_MODE(w)       (((w)>>16)&0x07)
-#      define   OTG_IDLE_EN            (1 << 15)
-#      define   HST_IDLE_EN            (1 << 14)
-#      define   DEV_IDLE_EN            (1 << 13)
-#      define   OTG_RESET_DONE         (1 << 2)
-#      define   OTG_SOFT_RESET         (1 << 1)
-#define OTG_SYSCON_2                   (OTG_BASE + 0x08)
-#      define   OTG_EN                 (1 << 31)
-#      define   USBX_SYNCHRO           (1 << 30)
-#      define   OTG_MST16              (1 << 29)
-#      define   SRP_GPDATA             (1 << 28)
-#      define   SRP_GPDVBUS            (1 << 27)
-#      define   SRP_GPUVBUS(w)         (((w)>>24)&0x07)
-#      define   A_WAIT_VRISE(w)        (((w)>>20)&0x07)
-#      define   B_ASE_BRST(w)          (((w)>>16)&0x07)
-#      define   SRP_DPW                (1 << 14)
-#      define   SRP_DATA               (1 << 13)
-#      define   SRP_VBUS               (1 << 12)
-#      define   OTG_PADEN              (1 << 10)
-#      define   HMC_PADEN              (1 << 9)
-#      define   UHOST_EN               (1 << 8)
-#      define   HMC_TLLSPEED           (1 << 7)
-#      define   HMC_TLLATTACH          (1 << 6)
-#      define   OTG_HMC(w)             (((w)>>0)&0x3f)
-#define OTG_CTRL                       (OTG_BASE + 0x0c)
-#      define   OTG_USB2_EN            (1 << 29)
-#      define   OTG_USB2_DP            (1 << 28)
-#      define   OTG_USB2_DM            (1 << 27)
-#      define   OTG_USB1_EN            (1 << 26)
-#      define   OTG_USB1_DP            (1 << 25)
-#      define   OTG_USB1_DM            (1 << 24)
-#      define   OTG_USB0_EN            (1 << 23)
-#      define   OTG_USB0_DP            (1 << 22)
-#      define   OTG_USB0_DM            (1 << 21)
-#      define   OTG_ASESSVLD           (1 << 20)
-#      define   OTG_BSESSEND           (1 << 19)
-#      define   OTG_BSESSVLD           (1 << 18)
-#      define   OTG_VBUSVLD            (1 << 17)
-#      define   OTG_ID                 (1 << 16)
-#      define   OTG_DRIVER_SEL         (1 << 15)
-#      define   OTG_A_SETB_HNPEN       (1 << 12)
-#      define   OTG_A_BUSREQ           (1 << 11)
-#      define   OTG_B_HNPEN            (1 << 9)
-#      define   OTG_B_BUSREQ           (1 << 8)
-#      define   OTG_BUSDROP            (1 << 7)
-#      define   OTG_PULLDOWN           (1 << 5)
-#      define   OTG_PULLUP             (1 << 4)
-#      define   OTG_DRV_VBUS           (1 << 3)
-#      define   OTG_PD_VBUS            (1 << 2)
-#      define   OTG_PU_VBUS            (1 << 1)
-#      define   OTG_PU_ID              (1 << 0)
-#define OTG_IRQ_EN                     (OTG_BASE + 0x10)       /* 16-bit */
-#      define   DRIVER_SWITCH          (1 << 15)
-#      define   A_VBUS_ERR             (1 << 13)
-#      define   A_REQ_TMROUT           (1 << 12)
-#      define   A_SRP_DETECT           (1 << 11)
-#      define   B_HNP_FAIL             (1 << 10)
-#      define   B_SRP_TMROUT           (1 << 9)
-#      define   B_SRP_DONE             (1 << 8)
-#      define   B_SRP_STARTED          (1 << 7)
-#      define   OPRT_CHG               (1 << 0)
-#define OTG_IRQ_SRC                    (OTG_BASE + 0x14)       /* 16-bit */
-       // same bits as in IRQ_EN
-#define OTG_OUTCTRL                    (OTG_BASE + 0x18)       /* 16-bit */
-#      define   OTGVPD                 (1 << 14)
-#      define   OTGVPU                 (1 << 13)
-#      define   OTGPUID                (1 << 12)
-#      define   USB2VDR                (1 << 10)
-#      define   USB2PDEN               (1 << 9)
-#      define   USB2PUEN               (1 << 8)
-#      define   USB1VDR                (1 << 6)
-#      define   USB1PDEN               (1 << 5)
-#      define   USB1PUEN               (1 << 4)
-#      define   USB0VDR                (1 << 2)
-#      define   USB0PDEN               (1 << 1)
-#      define   USB0PUEN               (1 << 0)
-#define OTG_TEST                       (OTG_BASE + 0x20)       /* 16-bit */
-#define OTG_VENDOR_CODE                        (OTG_BASE + 0xfc)       /* 16-bit */
-
-/*-------------------------------------------------------------------------*/
-
-/* OMAP1 */
-#define        USB_TRANSCEIVER_CTRL            (0xfffe1000 + 0x0064)
-#      define  CONF_USB2_UNI_R         (1 << 8)
-#      define  CONF_USB1_UNI_R         (1 << 7)
-#      define  CONF_USB_PORT0_R(x)     (((x)>>4)&0x7)
-#      define  CONF_USB0_ISOLATE_R     (1 << 3)
-#      define  CONF_USB_PWRDN_DM_R     (1 << 2)
-#      define  CONF_USB_PWRDN_DP_R     (1 << 1)
-
-/* OMAP2 */
-#      define  USB_UNIDIR                      0x0
-#      define  USB_UNIDIR_TLL                  0x1
-#      define  USB_BIDIR                       0x2
-#      define  USB_BIDIR_TLL                   0x3
-#      define  USBTXWRMODEI(port, x)   ((x) << (22 - (port * 2)))
-#      define  USBT2TLL5PI             (1 << 17)
-#      define  USB0PUENACTLOI          (1 << 16)
-#      define  USBSTANDBYCTRL          (1 << 15)
 /* AM35x */
 /* USB 2.0 PHY Control */
 #define CONF2_PHY_GPIOMODE     (1 << 23)
diff --git a/arch/arm/plat-omap/usb.c b/arch/arm/plat-omap/usb.c
deleted file mode 100644 (file)
index daa0327..0000000
+++ /dev/null
@@ -1,145 +0,0 @@
- /*
- * arch/arm/plat-omap/usb.c -- platform level USB initialization
- *
- * Copyright (C) 2004 Texas Instruments, Inc.
- *
- * 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.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- */
-
-#undef DEBUG
-
-#include <linux/module.h>
-#include <linux/kernel.h>
-#include <linux/init.h>
-#include <linux/platform_device.h>
-#include <linux/io.h>
-
-#include <plat/usb.h>
-#include <plat/board.h>
-
-#include <mach/hardware.h>
-
-#ifdef CONFIG_ARCH_OMAP_OTG
-
-void __init
-omap_otg_init(struct omap_usb_config *config)
-{
-       u32             syscon;
-       int             alt_pingroup = 0;
-
-       /* NOTE:  no bus or clock setup (yet?) */
-
-       syscon = omap_readl(OTG_SYSCON_1) & 0xffff;
-       if (!(syscon & OTG_RESET_DONE))
-               pr_debug("USB resets not complete?\n");
-
-       //omap_writew(0, OTG_IRQ_EN);
-
-       /* pin muxing and transceiver pinouts */
-       if (config->pins[0] > 2)        /* alt pingroup 2 */
-               alt_pingroup = 1;
-       syscon |= config->usb0_init(config->pins[0], is_usb0_device(config));
-       syscon |= config->usb1_init(config->pins[1]);
-       syscon |= config->usb2_init(config->pins[2], alt_pingroup);
-       pr_debug("OTG_SYSCON_1 = %08x\n", omap_readl(OTG_SYSCON_1));
-       omap_writel(syscon, OTG_SYSCON_1);
-
-       syscon = config->hmc_mode;
-       syscon |= USBX_SYNCHRO | (4 << 16) /* B_ASE0_BRST */;
-#ifdef CONFIG_USB_OTG
-       if (config->otg)
-               syscon |= OTG_EN;
-#endif
-       if (cpu_class_is_omap1())
-               pr_debug("USB_TRANSCEIVER_CTRL = %03x\n",
-                        omap_readl(USB_TRANSCEIVER_CTRL));
-       pr_debug("OTG_SYSCON_2 = %08x\n", omap_readl(OTG_SYSCON_2));
-       omap_writel(syscon, OTG_SYSCON_2);
-
-       printk("USB: hmc %d", config->hmc_mode);
-       if (!alt_pingroup)
-               printk(", usb2 alt %d wires", config->pins[2]);
-       else if (config->pins[0])
-               printk(", usb0 %d wires%s", config->pins[0],
-                       is_usb0_device(config) ? " (dev)" : "");
-       if (config->pins[1])
-               printk(", usb1 %d wires", config->pins[1]);
-       if (!alt_pingroup && config->pins[2])
-               printk(", usb2 %d wires", config->pins[2]);
-       if (config->otg)
-               printk(", Mini-AB on usb%d", config->otg - 1);
-       printk("\n");
-
-       if (cpu_class_is_omap1()) {
-               u16 w;
-
-               /* leave USB clocks/controllers off until needed */
-               w = omap_readw(ULPD_SOFT_REQ);
-               w &= ~SOFT_USB_CLK_REQ;
-               omap_writew(w, ULPD_SOFT_REQ);
-
-               w = omap_readw(ULPD_CLOCK_CTRL);
-               w &= ~USB_MCLK_EN;
-               w |= DIS_USB_PVCI_CLK;
-               omap_writew(w, ULPD_CLOCK_CTRL);
-       }
-       syscon = omap_readl(OTG_SYSCON_1);
-       syscon |= HST_IDLE_EN|DEV_IDLE_EN|OTG_IDLE_EN;
-
-#ifdef CONFIG_USB_GADGET_OMAP
-       if (config->otg || config->register_dev) {
-               struct platform_device *udc_device = config->udc_device;
-               int status;
-
-               syscon &= ~DEV_IDLE_EN;
-               udc_device->dev.platform_data = config;
-               status = platform_device_register(udc_device);
-               if (status)
-                       pr_debug("can't register UDC device, %d\n", status);
-       }
-#endif
-
-#if    defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE)
-       if (config->otg || config->register_host) {
-               struct platform_device *ohci_device = config->ohci_device;
-               int status;
-
-               syscon &= ~HST_IDLE_EN;
-               ohci_device->dev.platform_data = config;
-               status = platform_device_register(ohci_device);
-               if (status)
-                       pr_debug("can't register OHCI device, %d\n", status);
-       }
-#endif
-
-#ifdef CONFIG_USB_OTG
-       if (config->otg) {
-               struct platform_device *otg_device = config->otg_device;
-               int status;
-
-               syscon &= ~OTG_IDLE_EN;
-               otg_device->dev.platform_data = config;
-               status = platform_device_register(otg_device);
-               if (status)
-                       pr_debug("can't register OTG device, %d\n", status);
-       }
-#endif
-       pr_debug("OTG_SYSCON_1 = %08x\n", omap_readl(OTG_SYSCON_1));
-       omap_writel(syscon, OTG_SYSCON_1);
-}
-
-#else
-void omap_otg_init(struct omap_usb_config *config) {}
-#endif
index dc474bc6522de1d44295f67ad3ddb1f7bc33a771..fca9790c7de75550d6e9700be52ee0d019762531 100644 (file)
@@ -27,6 +27,7 @@
 #include <linux/interrupt.h>
 #include <linux/ioctl.h>
 #include <linux/completion.h>
+#include <linux/io.h>
 
 #include <asm/uaccess.h>
 
index bddc8fd9a7be3f65bab41b9b6b56c5cea2cd2e4e..271ca161d7ef0c77e87f02e9c10db94034391340 100644 (file)
@@ -185,7 +185,7 @@ config USB_FUSB300
 
 config USB_OMAP
        tristate "OMAP USB Device Controller"
-       depends on ARCH_OMAP
+       depends on ARCH_OMAP1
        select ISP1301_OMAP if MACH_OMAP_H2 || MACH_OMAP_H3 || MACH_OMAP_H4_OTG
        select USB_OTG_UTILS if ARCH_OMAP
        help
index a460e8c204f42c9bacbac82c55c83bf9896e6672..89cbd2b22ab03b0b378e011b2d8e040429389be0 100644 (file)
@@ -44,7 +44,8 @@
 #include <asm/mach-types.h>
 
 #include <plat/dma.h>
-#include <plat/usb.h>
+
+#include <mach/usb.h>
 
 #include "omap_udc.h"
 
index 83e58df29fe3ad32b1a7fc3c27cecc84f4e0a472..dcfaaa91a3fbe0ebf9fba190c223545086b76816 100644 (file)
@@ -308,7 +308,7 @@ config USB_OHCI_HCD
 
 config USB_OHCI_HCD_OMAP1
        bool "OHCI support for OMAP1/2 chips"
-       depends on USB_OHCI_HCD && (ARCH_OMAP1 || ARCH_OMAP2)
+       depends on USB_OHCI_HCD && ARCH_OMAP1
        default y
        ---help---
          Enables support for the OHCI controller on OMAP1/2 chips.
index 9ce35d0d9d5daad531209e6b651a1fcc714efb18..b02c344e2cc928b652e6af5358474647d81c4ba9 100644 (file)
 #include <linux/clk.h>
 #include <linux/gpio.h>
 
-#include <mach/hardware.h>
 #include <asm/io.h>
 #include <asm/mach-types.h>
 
 #include <plat/mux.h>
-#include <mach/irqs.h>
 #include <plat/fpga.h>
-#include <plat/usb.h>
+
+#include <mach/hardware.h>
+#include <mach/irqs.h>
+#include <mach/usb.h>
 
 
 /* OMAP-1510 OHCI has its own MMU for DMA */
index 70cf5d7bca48ed25ee08aa6e5fa40dec52b4268a..e0558dfcfafcb21ca413c401990eee9d0c48b0c4 100644 (file)
@@ -36,9 +36,9 @@
 #include <asm/irq.h>
 #include <asm/mach-types.h>
 
-#include <plat/usb.h>
 #include <plat/mux.h>
 
+#include <mach/usb.h>
 
 #ifndef        DEBUG
 #undef VERBOSE