svn commit: r294672 - in stable/10/sys: boot/fdt/dts/arm dev/ofw
Ian Lepore
ian at FreeBSD.org
Sun Jan 24 18:50:39 UTC 2016
Author: ian
Date: Sun Jan 24 18:50:37 2016
New Revision: 294672
URL: https://svnweb.freebsd.org/changeset/base/294672
Log:
MFC r289704:
Fix parsing of I2C addresses properties in fdt data. I2C address is
represented in 7-bits format in DT files, but system expect it in 8-bit
format. Also, fix two drivers that locally hack around this bug.
This includes a direct-commit change to the beaglebone dts data in the
10-stable branch to adjust the i2c slave addresses directly. In -current
the equivelent change happened with a switch from homegrown to standard
fdt data.
Modified:
stable/10/sys/boot/fdt/dts/arm/beaglebone-black.dts
stable/10/sys/boot/fdt/dts/arm/beaglebone.dts
stable/10/sys/dev/ofw/ofw_iicbus.c
Directory Properties:
stable/10/ (props changed)
Modified: stable/10/sys/boot/fdt/dts/arm/beaglebone-black.dts
==============================================================================
--- stable/10/sys/boot/fdt/dts/arm/beaglebone-black.dts Sun Jan 24 18:25:37 2016 (r294671)
+++ stable/10/sys/boot/fdt/dts/arm/beaglebone-black.dts Sun Jan 24 18:50:37 2016 (r294672)
@@ -146,9 +146,9 @@
};
i2c at 44e0b000 {
- pmic at 48 {
+ pmic at 24 {
compatible = "ti,am335x-pmic";
- reg = <0x48>;
+ reg = <0x24>;
};
};
};
Modified: stable/10/sys/boot/fdt/dts/arm/beaglebone.dts
==============================================================================
--- stable/10/sys/boot/fdt/dts/arm/beaglebone.dts Sun Jan 24 18:25:37 2016 (r294671)
+++ stable/10/sys/boot/fdt/dts/arm/beaglebone.dts Sun Jan 24 18:50:37 2016 (r294672)
@@ -133,7 +133,7 @@
i2c at 44e0b000 {
pmic at 24 {
compatible = "ti,am335x-pmic";
- reg = <0x48>;
+ reg = <0x24>;
};
};
};
Modified: stable/10/sys/dev/ofw/ofw_iicbus.c
==============================================================================
--- stable/10/sys/dev/ofw/ofw_iicbus.c Sun Jan 24 18:25:37 2016 (r294671)
+++ stable/10/sys/dev/ofw/ofw_iicbus.c Sun Jan 24 18:50:37 2016 (r294672)
@@ -147,7 +147,11 @@ ofw_iicbus_attach(device_t dev)
M_NOWAIT | M_ZERO);
if (dinfo == NULL)
continue;
- dinfo->opd_dinfo.addr = paddr;
+ /*
+ * OFW uses 7-bit I2C address format (see ePAPR),
+ * but system expect 8-bit.
+ */
+ dinfo->opd_dinfo.addr = paddr << 1;
if (ofw_bus_gen_setup_devinfo(&dinfo->opd_obdinfo, child) !=
0) {
free(dinfo, M_DEVBUF);
More information about the svn-src-stable
mailing list