From owner-svn-src-all@freebsd.org Sun Jan 24 18:50:39 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3B058A3182A; Sun, 24 Jan 2016 18:50:39 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E08601D40; Sun, 24 Jan 2016 18:50:38 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0OIob10067265; Sun, 24 Jan 2016 18:50:37 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0OIobxW067262; Sun, 24 Jan 2016 18:50:37 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201601241850.u0OIobxW067262@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 24 Jan 2016 18:50:37 +0000 (UTC) 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 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Jan 2016 18:50:39 -0000 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);