Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 24 Jan 2016 18:50:37 +0000 (UTC)
From:      Ian Lepore <ian@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject:   svn commit: r294672 - in stable/10/sys: boot/fdt/dts/arm dev/ofw
Message-ID:  <201601241850.u0OIobxW067262@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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@44e0b000 {
-			pmic@48 {
+			pmic@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@44e0b000 {
 			pmic@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);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201601241850.u0OIobxW067262>