summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorzbb <zbb@FreeBSD.org>2016-01-20 14:21:06 +0000
committerzbb <zbb@FreeBSD.org>2016-01-20 14:21:06 +0000
commit66cdcc9f3061c22543162542cd734201f1de72a8 (patch)
treedfd46b9fe2813a0a6f62cab5d25152bf3967e700
parent7fee54ce95e5255001c9ddad3fba7907e8163926 (diff)
downloadFreeBSD-src-66cdcc9f3061c22543162542cd734201f1de72a8.zip
FreeBSD-src-66cdcc9f3061c22543162542cd734201f1de72a8.tar.gz
Add support for I2C on Armada38x
Extend driver's compatible strings' table and enable I2C compilation in kernconf. Reviewed by: andrew, ian Obtained from: Semihalf Sponsored by: Stormshield Submitted by: Jan Dabros <jsd@semihalf.com> Differential revision: https://reviews.freebsd.org/D4422
-rw-r--r--sys/arm/conf/ARMADA38X4
-rw-r--r--sys/arm/mv/twsi.c8
2 files changed, 11 insertions, 1 deletions
diff --git a/sys/arm/conf/ARMADA38X b/sys/arm/conf/ARMADA38X
index 7cd70da..663c57d 100644
--- a/sys/arm/conf/ARMADA38X
+++ b/sys/arm/conf/ARMADA38X
@@ -72,6 +72,10 @@ device scbus
device pass
device da
+# I2C
+device iic
+device iicbus
+
#FDT
options FDT
options FDT_DTB_STATIC
diff --git a/sys/arm/mv/twsi.c b/sys/arm/mv/twsi.c
index fa6f5d7..dfd0243 100644
--- a/sys/arm/mv/twsi.c
+++ b/sys/arm/mv/twsi.c
@@ -141,6 +141,12 @@ static struct resource_spec res_spec[] = {
{ -1, 0 }
};
+static struct ofw_compat_data compat_data[] = {
+ { "mrvl,twsi", true },
+ { "marvell,mv64xxx-i2c", true },
+ { NULL, false }
+};
+
static device_method_t mv_twsi_methods[] = {
/* device interface */
DEVMETHOD(device_probe, mv_twsi_probe),
@@ -308,7 +314,7 @@ mv_twsi_probe(device_t dev)
if (!ofw_bus_status_okay(dev))
return (ENXIO);
- if (!ofw_bus_is_compatible(dev, "mrvl,twsi"))
+ if (!ofw_bus_search_compatible(dev, compat_data)->ocd_data)
return (ENXIO);
device_set_desc(dev, "Marvell Integrated I2C Bus Controller");
OpenPOWER on IntegriCloud