Beginnings of OMAP5 support.diff -r1.25 -r1.26 src/sys/arch/arm/omap/files.omap2
(matt)
--- src/sys/arch/arm/omap/Attic/files.omap2 2013/04/17 14:34:02 1.25
+++ src/sys/arch/arm/omap/Attic/files.omap2 2013/06/15 21:55:09 1.26
@@ -1,154 +1,159 @@ | @@ -1,154 +1,159 @@ | |||
1 | # $NetBSD: files.omap2,v 1.25 2013/04/17 14:34:02 bouyer Exp $ | 1 | # $NetBSD: files.omap2,v 1.26 2013/06/15 21:55:09 matt Exp $ | |
2 | # | 2 | # | |
3 | # Configuration info for Texas Instruments OMAP2/OMAP3 CPU support | 3 | # Configuration info for Texas Instruments OMAP2/OMAP3 CPU support | |
4 | # Based on xscale/files.pxa2x0 | 4 | # Based on xscale/files.pxa2x0 | |
5 | # | 5 | # | |
6 | 6 | |||
7 | include "arch/arm/pic/files.pic" | 7 | include "arch/arm/pic/files.pic" | |
8 | include "arch/arm/cortex/files.cortex" | 8 | include "arch/arm/cortex/files.cortex" | |
9 | 9 | |||
10 | file arch/arm/arm32/irq_dispatch.S | 10 | file arch/arm/arm32/irq_dispatch.S | |
11 | file arch/arm/omap/omap_dma.c | 11 | file arch/arm/omap/omap_dma.c | |
12 | 12 | |||
13 | # Memory size in megabytes | 13 | # Memory size in megabytes | |
14 | defparam opt_omap.h MEMSIZE | 14 | defparam opt_omap.h MEMSIZE | |
15 | defparam opt_omap.h OMAP_EMIFF_PBASE OMAP_EMIFF_SIZE | 15 | defparam opt_omap.h OMAP_EMIFF_PBASE OMAP_EMIFF_SIZE | |
16 | defflag opt_omap.h OMAP2 | 16 | defflag opt_omap.h OMAP2 | |
17 | defflag opt_omap.h OMAP3: OMAP2 | 17 | defflag opt_omap.h OMAP3: OMAP2 | |
18 | defflag opt_omap.h OMAP4: OMAP3 | 18 | defflag opt_omap.h OMAP4: OMAP3 | |
19 | defflag opt_omap.h OMAP_2430: OMAP2 | 19 | defflag opt_omap.h OMAP5: OMAP4 | |
20 | defflag opt_omap.h OMAP_2430: OMAP2 | |||
20 | defflag opt_omap.h OMAP_2420: OMAP2 | 21 | defflag opt_omap.h OMAP_2420: OMAP2 | |
21 | defflag opt_omap.h OMAP_3430: OMAP3 | 22 | defflag opt_omap.h OMAP_3430: OMAP3 | |
22 | defflag opt_omap.h OMAP_3530: OMAP3 | 23 | defflag opt_omap.h OMAP_3530: OMAP3 | |
23 | defflag opt_omap.h OMAP_4430: OMAP4 | 24 | defflag opt_omap.h OMAP_4430: OMAP4 | |
25 | defflag opt_omap.h OMAP_5430: OMAP4 | |||
24 | defflag opt_omap.h TI_AM335X: OMAP3 | 26 | defflag opt_omap.h TI_AM335X: OMAP3 | |
25 | defflag opt_omap.h TI_DM37XX: OMAP3 | 27 | defflag opt_omap.h TI_DM37XX: OMAP3 | |
26 | 28 | |||
27 | # OBIO just an attach point | 29 | # OBIO just an attach point | |
28 | device obio { [addr=-1], [size=0], [intr=-1], [mult=1], [intrbase=-1], [nobyteacc=0] | 30 | device obio { [addr=-1], [size=0], [intr=-1], [mult=1], [intrbase=-1], [nobyteacc=0] | |
29 | } : bus_space_generic | 31 | } : bus_space_generic | |
30 | attach obio at mainbus | 32 | attach obio at mainbus | |
31 | file arch/arm/omap/omap2_obio.c obio needs-count | 33 | file arch/arm/omap/omap2_obio.c obio needs-count | |
32 | 34 | |||
33 | # OBIO files | 35 | # OBIO files | |
34 | file arch/arm/omap/omap_space.c obio | 36 | file arch/arm/omap/omap_space.c obio | |
35 | file arch/arm/omap/omap_a2x_space.c obio | 37 | file arch/arm/omap/omap_a2x_space.c obio | |
36 | file arch/arm/arm/bus_space_a2x.S obio | 38 | file arch/arm/arm/bus_space_a2x.S obio | |
37 | file arch/arm/omap/omap_a4x_space.c obio | 39 | file arch/arm/omap/omap_a4x_space.c obio | |
38 | file arch/arm/arm/bus_space_a4x.S obio | 40 | file arch/arm/arm/bus_space_a4x.S obio | |
39 | 41 | |||
40 | # TI Sitara control module | 42 | # TI Sitara control module | |
41 | device sitaracm | 43 | device sitaracm | |
42 | attach sitaracm at obio with sitaracm | 44 | attach sitaracm at obio with sitaracm | |
43 | file arch/arm/omap/sitara_cm.c sitaracm | 45 | file arch/arm/omap/sitara_cm.c sitaracm | |
44 | file arch/arm/omap/am335x_cm_padconf.c ti_am335x | 46 | file arch/arm/omap/am335x_cm_padconf.c ti_am335x | |
45 | 47 | |||
46 | # OMAP2 interrupt controller | 48 | # OMAP2 interrupt controller | |
47 | device omapicu: pic, pic_splfuncs | 49 | device omapicu: pic, pic_splfuncs | |
48 | attach omapicu at obio with omap2icu | 50 | attach omapicu at obio with omap2icu | |
49 | file arch/arm/omap/omap2_icu.c (omap2 | omap3) & omapicu | 51 | file arch/arm/omap/omap2_icu.c (omap2 | omap3) & omapicu | |
50 | file arch/arm/omap/omap2430_intr.c omap2 & !omapicu & !omap4 | 52 | file arch/arm/omap/omap2430_intr.c omap2 & !omapicu & !omap4 | |
51 | 53 | |||
52 | # OMAP2 GPIO controllers | 54 | # OMAP2 GPIO controllers | |
53 | device omapgpio: gpiobus | 55 | device omapgpio: gpiobus | |
54 | attach omapgpio at obio with omap2gpio | 56 | attach omapgpio at obio with omap2gpio | |
55 | file arch/arm/omap/omap2_gpio.c (omap2 | omap3) & omapgpio | 57 | file arch/arm/omap/omap2_gpio.c (omap2 | omap3) & omapgpio | |
56 | 58 | |||
57 | # TI_AM335X (and maybe TI OMAP4) I2C controllers | 59 | # TI_AM335X (and maybe TI OMAP4) I2C controllers | |
58 | device tiiic: i2cbus, i2cexec | 60 | device tiiic: i2cbus, i2cexec | |
59 | attach tiiic at obio with ti_iic | 61 | attach tiiic at obio with ti_iic | |
60 | file arch/arm/omap/ti_iic.c ti_iic | 62 | file arch/arm/omap/ti_iic.c ti_iic | |
61 | 63 | |||
62 | # OMAP3 I2C controllers | 64 | # OMAP3 I2C controllers | |
63 | device omapiic: i2cbus, i2cexec | 65 | device omapiic: i2cbus, i2cexec | |
64 | attach omapiic at obio with omap3_i2c | 66 | attach omapiic at obio with omap3_i2c | |
65 | file arch/arm/omap/omap3_i2c.c omap3_i2c | 67 | file arch/arm/omap/omap3_i2c.c omap3_i2c | |
66 | 68 | |||
67 | # OMAP3 system control module | 69 | # OMAP3 system control module | |
68 | device omapscm: sysmon_envsys | 70 | device omapscm: sysmon_envsys | |
69 | attach omapscm at obio with omap3_scm | 71 | attach omapscm at obio with omap3_scm | |
70 | file arch/arm/omap/omap3_scm.c omap3_scm | 72 | file arch/arm/omap/omap3_scm.c omap3_scm | |
71 | 73 | |||
72 | # OMAP dual-mode timer | 74 | # OMAP dual-mode timer | |
73 | device omapdmtimer | 75 | device omapdmtimer | |
74 | file arch/arm/omap/omap_dmtimer.c omapdmtimer | 76 | file arch/arm/omap/omap_dmtimer.c omapdmtimer | |
75 | defparam opt_omap.h OMAP_SYSTEM_CLOCK_FREQ | 77 | defparam opt_omap.h OMAP_SYSTEM_CLOCK_FREQ | |
76 | 78 | |||
77 | attach omapdmtimer at obio with omap_dmtimer_obio | 79 | attach omapdmtimer at obio with omap_dmtimer_obio | |
78 | file arch/arm/omap/am335x_dmtimer.c ti_am335x & omapdmtimer | 80 | file arch/arm/omap/am335x_dmtimer.c ti_am335x & omapdmtimer | |
79 | 81 | |||
80 | # OMAP 2430 General Purpose Timer | 82 | # OMAP 2430 General Purpose Timer | |
81 | device omapmputmr | 83 | device omapmputmr | |
82 | file arch/arm/omap/omap2_mputmr.c omapmputmr | 84 | file arch/arm/omap/omap2_mputmr.c omapmputmr | |
83 | defparam opt_omap.h OMAP_GP_TIMER_CLOCK_FREQ | 85 | defparam opt_omap.h OMAP_GP_TIMER_CLOCK_FREQ | |
84 | 86 | |||
85 | # OBIO/2430 GP Timer | 87 | # OBIO/2430 GP Timer | |
86 | attach omapmputmr at obio with obiomputmr | 88 | attach omapmputmr at obio with obiomputmr | |
87 | file arch/arm/omap/obio_mputmr.c obiomputmr | 89 | file arch/arm/omap/obio_mputmr.c obiomputmr | |
88 | 90 | |||
89 | # Dual Mode (General Purpose) Timer | 91 | # Dual Mode (General Purpose) Timer | |
90 | device omapgptmr | 92 | device omapgptmr | |
91 | attach omapgptmr at obio | 93 | attach omapgptmr at obio | |
92 | file arch/arm/omap/omap2_gptmr.c omapgptmr | 94 | file arch/arm/omap/omap2_gptmr.c omapgptmr | |
93 | #file arch/arm/omap/omap_pwm.c omapgptmr | 95 | #file arch/arm/omap/omap_pwm.c omapgptmr | |
94 | 96 | |||
95 | # Watchdog timers | 97 | # Watchdog timers | |
96 | 98 | |||
97 | device omapwdt32k: sysmon_wdog | 99 | device omapwdt32k: sysmon_wdog | |
98 | file arch/arm/omap/omap_wdt.c omapwdt32k needs-flag | 100 | file arch/arm/omap/omap_wdt.c omapwdt32k needs-flag | |
99 | 101 | |||
100 | attach omapwdt32k at obio with obiowdt32k | 102 | attach omapwdt32k at obio with obiowdt32k | |
101 | file arch/arm/omap/obio_wdt.c obiowdt32k | 103 | file arch/arm/omap/obio_wdt.c obiowdt32k | |
102 | 104 | |||
103 | # L3 Interconnect | 105 | # L3 Interconnect | |
104 | device L3i { [addr=-1], [size=0], [intr=-1], [mult=1], [nobyteacc=0] | 106 | device L3i { [addr=-1], [size=0], [intr=-1], [mult=1], [nobyteacc=0] | |
105 | } : bus_space_generic | 107 | } : bus_space_generic | |
106 | attach L3i at mainbus | 108 | attach L3i at mainbus | |
107 | file arch/arm/omap/omap2_l3i.c omap2 | omap3 | 109 | file arch/arm/omap/omap2_l3i.c omap2 | omap3 | |
108 | 110 | |||
109 | # General Purpose Memory Controller | 111 | # General Purpose Memory Controller | |
110 | # XXX some addl. chip select config parms may be desired here (e.g. timing) | 112 | # XXX some addl. chip select config parms may be desired here (e.g. timing) | |
111 | # XXX so far we just use the setup established by boot firmware | 113 | # XXX so far we just use the setup established by boot firmware | |
112 | device gpmc { [addr=-1], [size=0], [intr=-1], [mult=1], [nobyteacc=0] | 114 | device gpmc { [addr=-1], [size=0], [intr=-1], [mult=1], [nobyteacc=0] | |
113 | } : bus_space_generic | 115 | } : bus_space_generic | |
114 | attach gpmc at mainbus | 116 | attach gpmc at mainbus | |
115 | file arch/arm/omap/omap2_gpmc.c gpmc | 117 | file arch/arm/omap/omap2_gpmc.c gpmc | |
116 | 118 | |||
117 | # SDMMC controller | 119 | # SDMMC controller | |
118 | attach sdhc at obio with obiosdhc | 120 | attach sdhc at obio with obiosdhc | |
119 | file arch/arm/omap/omap3_sdhc.c obiosdhc | 121 | file arch/arm/omap/omap3_sdhc.c obiosdhc | |
120 | 122 | |||
121 | # NAND flash controller | 123 | # NAND flash controller | |
122 | device omapnand: nandbus | 124 | device omapnand: nandbus | |
123 | attach omapnand at gpmc | 125 | attach omapnand at gpmc | |
124 | file arch/arm/omap/omap2_nand.c omapnand | 126 | file arch/arm/omap/omap2_nand.c omapnand | |
125 | 127 | |||
126 | # PRCM interface | 128 | # PRCM interface | |
127 | device prcm | 129 | device prcm | |
128 | attach prcm at obio | 130 | attach prcm at obio | |
129 | file arch/arm/omap/omap2_prcm.c prcm needs-flag | 131 | file arch/arm/omap/omap2_prcm.c prcm needs-flag | |
130 | file arch/arm/omap/am335x_prcm.c ti_am335x | 132 | file arch/arm/omap/am335x_prcm.c ti_am335x | |
131 | 133 | |||
132 | # OHCI USB controller | 134 | # OHCI USB controller | |
133 | attach ohci at obio with obioohci | 135 | attach ohci at obio with obioohci | |
134 | file arch/arm/omap/obio_ohci.c obioohci | 136 | file arch/arm/omap/obio_ohci.c obioohci | |
135 | 137 | |||
136 | attach ehci at obio with omap3_ehci | 138 | attach ehci at obio with omap3_ehci | |
137 | file arch/arm/omap/omap3_ehci.c omap3_ehci | 139 | file arch/arm/omap/omap3_ehci.c omap3_ehci | |
138 | 140 | |||
141 | attach ahcisata at obio with omap5_ahcisata | |||
142 | file arch/arm/omap/omap5_ahcisata.c omap5_ahcisata | |||
143 | ||||
139 | device omapfb: rasops16, rasops8, wsemuldisplaydev, vcons, edid | 144 | device omapfb: rasops16, rasops8, wsemuldisplaydev, vcons, edid | |
140 | attach omapfb at obio | 145 | attach omapfb at obio | |
141 | file arch/arm/omap/omapfb.c omapfb | 146 | file arch/arm/omap/omapfb.c omapfb | |
142 | 147 | |||
143 | device cpsw: ether, ifnet, arp, mii, mii_phy | 148 | device cpsw: ether, ifnet, arp, mii, mii_phy | |
144 | attach cpsw at obio | 149 | attach cpsw at obio | |
145 | file arch/arm/omap/if_cpsw.c cpsw | 150 | file arch/arm/omap/if_cpsw.c cpsw | |
146 | 151 | |||
147 | device omapdma | 152 | device omapdma | |
148 | attach omapdma at obio | 153 | attach omapdma at obio | |
149 | file arch/arm/omap/omap3_sdma.c omapdma needs-flag | 154 | file arch/arm/omap/omap3_sdma.c omapdma needs-flag | |
150 | 155 | |||
151 | # these bus space methods are not bus-specific ... | 156 | # these bus space methods are not bus-specific ... | |
152 | # | 157 | # | |
153 | file arch/arm/omap/omap_nobyteacc_space.c emifs | gpmc | 158 | file arch/arm/omap/omap_nobyteacc_space.c emifs | gpmc | |
154 | file arch/arm/omap/omap_nobyteacc_io.S emifs | gpmc | 159 | file arch/arm/omap/omap_nobyteacc_io.S emifs | gpmc |
--- src/sys/arch/arm/omap/Attic/omap2_intr.h 2012/08/29 17:48:17 1.8
+++ src/sys/arch/arm/omap/Attic/omap2_intr.h 2013/06/15 21:55:09 1.9
@@ -1,54 +1,56 @@ | @@ -1,54 +1,56 @@ | |||
1 | /* $NetBSD: omap2_intr.h,v 1.8 2012/08/29 17:48:17 matt Exp $ */ | 1 | /* $NetBSD: omap2_intr.h,v 1.9 2013/06/15 21:55:09 matt Exp $ */ | |
2 | 2 | |||
3 | /* | 3 | /* | |
4 | * Define the SDP2430 specific information and then include the generic OMAP | 4 | * Define the SDP2430 specific information and then include the generic OMAP | |
5 | * interrupt header. | 5 | * interrupt header. | |
6 | */ | 6 | */ | |
7 | 7 | |||
8 | /* | 8 | /* | |
9 | * Redistribution and use in source and binary forms, with or without | 9 | * Redistribution and use in source and binary forms, with or without | |
10 | * modification, are permitted provided that the following conditions | 10 | * modification, are permitted provided that the following conditions | |
11 | * are met: | 11 | * are met: | |
12 | * 1. Redistributions of source code must retain this list of conditions | 12 | * 1. Redistributions of source code must retain this list of conditions | |
13 | * and the following disclaimer. | 13 | * and the following disclaimer. | |
14 | * 2. Redistributions in binary form must reproduce this list of conditions | 14 | * 2. Redistributions in binary form must reproduce this list of conditions | |
15 | * and the following disclaimer in the documentation and/or other materials | 15 | * and the following disclaimer in the documentation and/or other materials | |
16 | * provided with the distribution. | 16 | * provided with the distribution. | |
17 | * | 17 | * | |
18 | * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, | 18 | * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, | |
19 | * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND | 19 | * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND | |
20 | * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL ANY | 20 | * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL ANY | |
21 | * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, | 21 | * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, | |
22 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, | 22 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, | |
23 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; | 23 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; | |
24 | * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, | 24 | * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, | |
25 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR | 25 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR | |
26 | * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF | 26 | * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF | |
27 | * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 27 | * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |
28 | */ | 28 | */ | |
29 | 29 | |||
30 | #ifndef _ARM_OMAP_OMAP2_INTR_H_ | 30 | #ifndef _ARM_OMAP_OMAP2_INTR_H_ | |
31 | #define _ARM_OMAP_OMAP2_INTR_H_ | 31 | #define _ARM_OMAP_OMAP2_INTR_H_ | |
32 | 32 | |||
33 | #ifdef _KERNEL_OPT | 33 | #ifdef _KERNEL_OPT | |
34 | #include "opt_omap.h" | 34 | #include "opt_omap.h" | |
35 | #endif | 35 | #endif | |
36 | 36 | |||
37 | #ifndef _LOCORE | 37 | #ifndef _LOCORE | |
38 | #include <arm/armreg.h> | 38 | #include <arm/armreg.h> | |
39 | #include <arm/cpufunc.h> | 39 | #include <arm/cpufunc.h> | |
40 | #endif | 40 | #endif | |
41 | 41 | |||
42 | #if defined(OMAP_4430) | 42 | #if defined(OMAP_4430) | |
43 | #include <arm/omap/omap4430_intr.h> | 43 | #include <arm/omap/omap4430_intr.h> | |
44 | #elif defined(OMAP_5430) | |||
45 | #include <arm/omap/omap5430_intr.h> | |||
44 | #elif defined(OMAP2) || defined(OMAP3) | 46 | #elif defined(OMAP2) || defined(OMAP3) | |
45 | #include <arm/omap/omap2430_intr.h> | 47 | #include <arm/omap/omap2430_intr.h> | |
46 | #endif | 48 | #endif | |
47 | 49 | |||
48 | #ifndef _LOCORE | 50 | #ifndef _LOCORE | |
49 | 51 | |||
50 | #include <arm/pic/picvar.h> | 52 | #include <arm/pic/picvar.h> | |
51 | 53 | |||
52 | #endif /* ! _LOCORE */ | 54 | #endif /* ! _LOCORE */ | |
53 | 55 | |||
54 | #endif /* _ARM_OMAP_OMAP2_INTR_H_ */ | 56 | #endif /* _ARM_OMAP_OMAP2_INTR_H_ */ |
/* $NetBSD: omap5430_intr.h,v 1.1 2013/06/15 21:55:09 matt Exp $ */
/*-
* Copyright (c) 2012 The NetBSD Foundation, Inc.
* All rights reserved.
*
* This code is derived from software contributed to The NetBSD Foundation
* by Matt Thomas of 3am Software Foundry.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef _ARM_OMAP_OMAP5430_INTR_H_
#define _ARM_OMAP_OMAP5430_INTR_H_
/*
* 0-15 are used for SGIs (software generated interrupts).
* 16-31 are used for PPIs (private peripheral interrupts).
* 32... are used for SPIs (shared peripheral interrupts).
*
* To make things easier, SPIs will start at 0 and SGIs/PPIs
* will at the end of SPIs (these are internal and shouldn't
* be used by real devices).
*/
#define PIC_MAXSOURCES (32+160)
#define PIC_MAXMAXSOURCES (PIC_MAXSOURCES+8*32)
/*
* The BCM53xx uses a generic interrupt controller so pull that stuff.
*/
#include <arm/cortex/gic_intr.h>
#include <arm/cortex/gtmr_intr.h> /* A9 Timer PPIs */
#ifndef _LOCORE
#define IRQ_MPU_CLUSTER (32+0) // Illegal writes to interrupt controller memory map region
#define IRQ_CTI_0 (32+1) // Cross-trigger module 0 (CTI0) interrupt
#define IRQ_CTI_1 (32+2) // Cross-trigger module 1 (CTI1) interrupt
#define IRQ_ELM (32+4) // Error location process completion
#define IRQ_WD_TIMER_C0 (32+5) // WD_TIMER_MPU_C0 warning interrupt
#define IRQ_WD_TIMER_C1 (32+6) // WD_TIMER_MPU_C1 warning interrupt
#define IRQ_SYS_NIRQ1 (32+7) // External interrupt 1 (active low)
#define IRQ_L3_DBG (32+9) // L3 interconnect debug error
#define IRQ_L3_APP (32+10) // L3 interconnect application error
#define IRQ_PRCM_MPU (32+11) // PRCM interrupt
#define IRQ_SDMA_0 (32+12) // sDMA interrupt 0
#define IRQ_SDMA_1 (32+13) // sDMA interrupt 1
#define IRQ_SDMA_2 (32+14) // sDMA interrupt 2
#define IRQ_SDMA_3 (32+15) // sDMA interrupt 3
#define IRQ_L3_MAIN_STAT_ALARM (32+16) // L3 N0C statistic collector alarm
#define IRQ_MCBSP1 (32+17) // MCBSP1 interrupt
#define IRQ_SR_MPU (32+18) // SmartReflex MPU interrupt
#define IRQ_SR_CORE (32+19) // SmartReflex Core interrupt
#define IRQ_GPMC (32+20) // GPMC interrupt
#define IRQ_GPU (32+21) // 2D/3D graphics module interrupt
#define IRQ_MCBSP2 (32+22) // MCBSP2 interrupt
#define IRQ_MCBSP3 (32+23) // MCBSP3 interrupt
#define IRQ_ISS5 (32+24) // Imaging subsystem interrupt 5
#define IRQ_DSS_DISPC (32+25) // Display controller interrupt
#define IRQ_MAIL_U0_MPU (32+26) // Mailbox user 0 interrupt
#define IRQ_27 (32+27) // Reserved
#define IRQ_DSP_MMU (32+28) // DSP MMU interrupt
#define IRQ_GPIO1_MPU (32+29) // GPIO1 MPU interrupt
#define IRQ_GPIO2_MPU (32+30) // GPIO2 MPU interrupt
#define IRQ_GPIO3_MPU (32+31) // GPIO3 MPU interrupt
#define IRQ_GPIO4_MPU (32+32) // GPIO4 MPU interrupt
#define IRQ_GPIO5_MPU (32+33) // GPIO5 MPU interrupt
#define IRQ_GPIO6_MPU (32+34) // GPIO6 MPU interrupt
#define IRQ_GPIO7_MPU (32+35) // GPIO7 MPU interrupt
#define IRQ_WDT3 (32+36) // WDTIMER3 overflow
#define IRQ_GPT1 (32+37) // GPTIMER1 interrupt
#define IRQ_GPT2 (32+38) // GPTIMER2 interrupt
#define IRQ_GPT3 (32+39) // GPTIMER3 interrupt
#define IRQ_GPT4 (32+40) // GPTIMER4 interrupt
#define IRQ_GPT5 (32+41) // GPTIMER5 interrupt
#define IRQ_GPT6 (32+42) // GPTIMER6 interrupt
#define IRQ_GPT7 (32+43) // GPTIMER7 interrupt
#define IRQ_GPT8 (32+44) // GPTIMER8 interrupt
#define IRQ_GPT9 (32+45) // GPTIMER9 interrupt
#define IRQ_GPT10 (32+46) // GPTIMER10 interrupt
#define IRQ_GPT11 (32+47) // GPTIMER11 interrupt
#define IRQ_MCSPI4 (32+48) // MCSPI4 interrupt
#define IRQ_DSS_DSI1_A (32+53) // Display Subsystem DSI1_A interrupt
#define IRQ_SATA (32+54) // SATA interrupt
#define IRQ_DSS_DSI1_C (32+55) // Display Subsystem DSI1_C interrupt
#define IRQ_I2C1 (32+56) // I2C1 interrupt
#define IRQ_I2C2 (32+57) // I2C2 interrupt
#define IRQ_HDQ (32+58) // HDQ/1wire interrupt
#define IRQ_MMC5 (32+59) // MMC5 interrupt
#define IRQ_I2C3 (32+61) // I2C3 interrupt
#define IRQ_I2C4 (32+62) // I2C4 interrupt
#define IRQ_MCSPI1 (32+65) // MCSPI1 interrupt
#define IRQ_MCSPI2 (32+66) // MCSPI2 interrupt
#define IRQ_HSI_P1_MPU (32+67) // HSI Port 1 interrupt
#define IRQ_HSI_P2_MPU (32+68) // HSI Port 2 interrupt
#define IRQ_FDIF_3 (32+69) // Face detect interrupt 3
#define IRQ_UART4 (32+70) // UART module 4 interrupt
#define IRQ_HSI_DMA_MPU (32+71) // HSI DMA engine IRQ_MPU request
#define IRQ_UART1 (32+72) // UART1 interrupt
#define IRQ_UART2 (32+73) // UART2 interrupt
#define IRQ_UART3 (32+74) // UART3 interrupt
#define IRQ_PBIAS (32+75) // Merged interrupt for PBIASlite1 and 2
#define IRQ_HSUSB_OHCI (32+76) // HSUSB MP host interrupt OHCI controller
#define IRQ_HSUSB_EHCI (32+77) // HSUSB MP host interrupt EHCI controller
#define IRQ_HSUSB_TLL (32+78) // HSUSB MP TLL interrupt
#define IRQ_WDT2 (32+80) // WDTIMER2 interrupt
#define IRQ_MMC1 (32+83) // MMC1 interrupt
#define IRQ_MMC2 (32+86) // MMC2 interrupt
#define IRQ_DEBUGSS_CT_UART (32+90) // CT_UART interrupt generated when data ready on RX or when TX empty
#define IRQ_MCSPI3 (32+91) // MCSPI3 interrupt
#define IRQ_HSUSB_OTG (32+92) // HSUSB OTG controller interrupt
#define IRQ_HSUSB_OTG_DMA (32+93) // HSUSB OTG DMA interrupt
#define IRQ_MMC3 (32+94) // MMC3 interrupt
#define IRQ_MMC4 (32+96) // MMC4 interrupt
#define IRQ_ABE_MPU (32+99) // Audio back-end interrupt
#define IRQ_IPU_MMU (32+100) // Cortex-M4 MMU interrupt
#define IRQ_HDMI (32+101) // Display subsystem HDMI interrupt
#define IRQ_SR_IVA (32+102) // SmartReflex IVA interrupt
#define IRQ_IVAHD2 (32+103) // Sync interrupt from ICONT2 (vDMA)
#define IRQ_IVAHD1 (32+104) // Sync interrupt from ICONT1
#define IRQ_UART5 (32+105) // UART5 interrupt
#define IRQ_UART6 (32+106) // UART6 interrupt
#define IRQ_IVAHD_MAILBOX_0 (32+107) // IVAHD mailbox interrupt 0
#define IRQ_MCASP1_AXINT (32+109) // McASP1 transmit interrupt
#define IRQ_EMIF1 (32+110) // EMIF1 interrupt
#define IRQ_EMIF2 (32+111) // EMIF2 interrupt
#define IRQ_MCPDM (32+112) // MCPDM interrupt
#define IRQ_DMM (32+113) // DMM interrupt
#define IRQ_DMIC (32+114) // DMIC interupt
#define IRQ_SYS_NIRQ2 (32+119) // External interrupt 2 (active low)
#define IRQ_KBD_CTL (32+120) // Keyboard controller interrupt
#define IRQ_GPIO8 (32+121) // GPIO8 interupt
#define IRQ_BB2D (32+125) // BB2D interupt
#endif /* _LOCORE */
#endif /* _ARM_OMAP_OMAP5430_INTR_H_ */
/* $NetBSD: omap5_ahcisata.c,v 1.1 2013/06/15 21:55:09 matt Exp $ */
/*-
* Copyright (c) 2013 The NetBSD Foundation, Inc.
* All rights reserved.
*
* This code is derived from software contributed to The NetBSD Foundation
* by Matt Thomas of 3am Software Foundry.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: omap5_ahcisata.c,v 1.1 2013/06/15 21:55:09 matt Exp $");
#include "locators.h"
#include "opt_omap.h"
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/intr.h>
#include <sys/kernel.h>
#include <sys/device.h>
#include <sys/bus.h>
#include <sys/gpio.h>
#include <dev/ata/atavar.h>
#include <dev/ic/ahcisatavar.h>
#include <arm/omap/omap2_obioreg.h>
#include <arm/omap/omap2_obiovar.h>
#include <arm/omap/omap2_reg.h>
struct omap5_ahci_softc {
struct ahci_softc psc_sc;
void *psc_ih;
};
static int
omap5_ahcisata_match(device_t parent, cfdata_t match, void *aux)
{
#if defined(OMAP5)
struct obio_attach_args *obio = aux;
if (obio->obio_addr == AHCI1_BASE_OMAP5)
return 1;
#endif
return 0;
}
static void
omap5_ahcisata_attach(device_t parent, device_t self, void *aux)
{
struct omap5_ahci_softc *psc = device_private(self);
struct ahci_softc * const sc = &psc->psc_sc;
struct obio_attach_args * const obio = aux;
int rv;
sc->sc_atac.atac_dev = self;
aprint_naive("\n");
aprint_normal(": OMAP AHCI controller\n");
sc->sc_dmat = obio->obio_dmat;
sc->sc_ahcit = obio->obio_iot;
sc->sc_ahcis = obio->obio_size;
rv = bus_space_map(obio->obio_iot, obio->obio_addr, obio->obio_size,
0, &sc->sc_ahcih);
if (rv) {
aprint_error_dev(self, "couldn't map memory space\n");
return;
}
psc->psc_ih = intr_establish(obio->obio_intr, IPL_BIO, IST_LEVEL,
ahci_intr, sc);
ahci_attach(sc);
}
static int
omap5_ahcisata_detach(device_t self, int flags)
{
struct omap5_ahci_softc * const psc = device_private(self);
struct ahci_softc * const sc = &psc->psc_sc;
int rv;
rv = ahci_detach(sc, flags);
if (rv)
return rv;
if (psc->psc_ih) {
intr_disestablish(psc->psc_ih);
psc->psc_ih = NULL;
}
if (sc->sc_ahcis) {
bus_space_unmap(sc->sc_ahcit, sc->sc_ahcih, sc->sc_ahcis);
sc->sc_ahcit = 0;
sc->sc_ahcih = 0;
sc->sc_ahcis = 0;
}
return 0;
}
CFATTACH_DECL_NEW(omap5_ahcisata, sizeof(struct omap5_ahci_softc),
omap5_ahcisata_match,
omap5_ahcisata_attach,
omap5_ahcisata_detach,
0
);