summaryrefslogtreecommitdiffstats
path: root/sys/arm/allwinner/aintc.c
diff options
context:
space:
mode:
authorandrew <andrew@FreeBSD.org>2016-02-10 09:19:29 +0000
committerandrew <andrew@FreeBSD.org>2016-02-10 09:19:29 +0000
commit4cf4fddec8c3df6f92a4c842133d17613c459575 (patch)
treeef177bb0c7a78e6ce3af09f16bcb1a328099121c /sys/arm/allwinner/aintc.c
parent517ee62210c3163f71681eb95e09542ec96a6b24 (diff)
downloadFreeBSD-src-4cf4fddec8c3df6f92a4c842133d17613c459575.zip
FreeBSD-src-4cf4fddec8c3df6f92a4c842133d17613c459575.tar.gz
Update of the Allwinner drivers to:
* Use the Linux compat string * Use EARLY_DRIVER_MODULE to attach at the right time * Add a generic A10 kernel config file * A20 now use generic_timer * Add two new dts files for Olimex boards * Update our custom DTS file for A10 and A20 to use the same compatible property names as the vendor ones. Submitted by: Emmanuel Vadot <manu@bidouilliste.com> Differential Revision: https://reviews.freebsd.org/D4792
Diffstat (limited to 'sys/arm/allwinner/aintc.c')
-rw-r--r--sys/arm/allwinner/aintc.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/sys/arm/allwinner/aintc.c b/sys/arm/allwinner/aintc.c
index ed5f1fc..a15ead1 100644
--- a/sys/arm/allwinner/aintc.c
+++ b/sys/arm/allwinner/aintc.c
@@ -79,6 +79,12 @@ __FBSDID("$FreeBSD$");
#define SW_INT_ENABLE_REG(_b) (0x40 + ((_b) * 4))
#define SW_INT_MASK_REG(_b) (0x50 + ((_b) * 4))
+static struct ofw_compat_data compat_data[] = {
+ {"allwinner,sun4i-a10-ic", 1},
+ {"allwinner,sun7i-a20-sc-nmi", 1},
+ {NULL, 0}
+};
+
struct a10_aintc_softc {
device_t sc_dev;
struct resource * aintc_res;
@@ -101,7 +107,7 @@ a10_aintc_probe(device_t dev)
if (!ofw_bus_status_okay(dev))
return (ENXIO);
- if (!ofw_bus_is_compatible(dev, "allwinner,sun4i-ic"))
+ if (ofw_bus_search_compatible(dev, compat_data)->ocd_data == 0)
return (ENXIO);
device_set_desc(dev, "A10 AINTC Interrupt Controller");
return (BUS_PROBE_DEFAULT);
@@ -158,7 +164,8 @@ static driver_t a10_aintc_driver = {
static devclass_t a10_aintc_devclass;
-DRIVER_MODULE(aintc, simplebus, a10_aintc_driver, a10_aintc_devclass, 0, 0);
+EARLY_DRIVER_MODULE(aintc, simplebus, a10_aintc_driver, a10_aintc_devclass, 0, 0,
+ BUS_PASS_INTERRUPT + BUS_PASS_ORDER_FIRST);
int
arm_get_next_irq(int last_irq)
OpenPOWER on IntegriCloud