From owner-svn-src-all@freebsd.org Thu Nov 5 20:06:47 2015 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 2CE20A2755B; Thu, 5 Nov 2015 20:06:47 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from c.mail.sonic.net (c.mail.sonic.net [64.142.111.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CB18614F1; Thu, 5 Nov 2015 20:06:46 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from comporellon.tachypleus.net (75-101-50-44.static.sonic.net [75.101.50.44]) (authenticated bits=0) by c.mail.sonic.net (8.15.1/8.15.1) with ESMTPSA id tA5JuMWU006254 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Thu, 5 Nov 2015 11:56:22 -0800 Subject: Re: svn commit: r290373 - head/sys/dev/ofw To: Andreas Tobler , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201511042246.tA4MkUYU010551@repo.freebsd.org> From: Nathan Whitehorn Message-ID: <563BB466.8020801@freebsd.org> Date: Thu, 5 Nov 2015 11:56:22 -0800 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 In-Reply-To: <201511042246.tA4MkUYU010551@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Sonic-CAuth: UmFuZG9tSVYkb0F5Bf3CxdZS5Zi7xjYJQzxJygrW9lXOBOAoKHfWZsOSsFxD7+Ut6aluPqYnMVGXp8VTp+VytaD+KAqu2oGXt6a8oxJ+ifk= X-Sonic-ID: C;PtzUSfeD5RGJs70U9jFv0A== M;0EcxSveD5RGJs70U9jFv0A== X-Spam-Flag: No X-Sonic-Spam-Details: 0.0/5.0 by cerberusd 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: Thu, 05 Nov 2015 20:06:47 -0000 I'm not sure this is the best way to do this: we have AIM systems that use FDT, for example. Can we make it a quirk in the host-bus driver? Or do a run-time check to see if the root node has MacRISC in its compatible property? -Nathan On 11/04/15 14:46, Andreas Tobler wrote: > Author: andreast > Date: Wed Nov 4 22:46:30 2015 > New Revision: 290373 > URL: https://svnweb.freebsd.org/changeset/base/290373 > > Log: > Add a compile time switch to distinguish between 7-bit and 8-bit I2C address > usage. The comment in the code should explain the situation. > > Discussed with: ian@ > > Modified: > head/sys/dev/ofw/ofw_iicbus.c > > Modified: head/sys/dev/ofw/ofw_iicbus.c > ============================================================================== > --- head/sys/dev/ofw/ofw_iicbus.c Wed Nov 4 19:09:42 2015 (r290372) > +++ head/sys/dev/ofw/ofw_iicbus.c Wed Nov 4 22:46:30 2015 (r290373) > @@ -148,10 +148,16 @@ ofw_iicbus_attach(device_t dev) > if (dinfo == NULL) > continue; > /* > - * OFW uses 7-bit I2C address format (see ePAPR), > - * but system expect 8-bit. > + * FreeBSD drivers expect I2C addresses to be expressed as > + * 8-bit values. Apple OFW data contains 8-bit values, but > + * Linux FDT data contains 7-bit values, so shift them up to > + * 8-bit format. > */ > +#ifdef AIM > + dinfo->opd_dinfo.addr = paddr; > +#else > dinfo->opd_dinfo.addr = paddr << 1; > +#endif > if (ofw_bus_gen_setup_devinfo(&dinfo->opd_obdinfo, child) != > 0) { > free(dinfo, M_DEVBUF); >