From owner-svn-src-head@freebsd.org Thu Nov 5 21:47:43 2015 Return-Path: Delivered-To: svn-src-head@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 0A666A27DF8; Thu, 5 Nov 2015 21:47:43 +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 9C7761E87; Thu, 5 Nov 2015 21:47:42 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from zeppelin.tachypleus.net (airbears2-136-152-142-56.airbears2.berkeley.edu [136.152.142.56]) (authenticated bits=0) by c.mail.sonic.net (8.15.1/8.15.1) with ESMTPSA id tA5Lle7X010642 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Thu, 5 Nov 2015 13:47:40 -0800 Subject: Re: svn commit: r290373 - head/sys/dev/ofw To: Andreas Tobler , Warner Losh References: <201511042246.tA4MkUYU010551@repo.freebsd.org> <563BB466.8020801@freebsd.org> <563BC911.5060804@FreeBSD.org> Cc: src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" From: Nathan Whitehorn Message-ID: <563BCE7C.9020900@freebsd.org> Date: Thu, 5 Nov 2015 13:47:40 -0800 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <563BC911.5060804@FreeBSD.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Sonic-CAuth: UmFuZG9tSVYZh7CwlGPDEcrQbRvLR0UeAcLmpte41TQANxQTAAJ2r3K6xzjcJOTA08lF4KvUFQKIxl3y2wooszmmVY/HBHo8/+lA7E/wgbI= X-Sonic-ID: C;lsI21gaE5RGfU70U9jFv0A== M;ynFs1gaE5RGfU70U9jFv0A== X-Spam-Flag: No X-Sonic-Spam-Details: 0.0/5.0 by cerberusd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Nov 2015 21:47:43 -0000 On 11/05/15 13:24, Andreas Tobler wrote: > Hi Nathan, Warner, > > first, I had the feeling that I have to provide a fast solution which > makes PowerMacs usable again. I am aware that the committed version > doesn't win a prize. Thank you! > Also, I didn't know that we have AIM & FDT, Nathan which one? PS3 and POWER8 systems are AIM+FDT. Neither of these have I2C busses in their FDTs, so the impact is low for now, but it makes me a little nervous. > On 05.11.15 21:26, Warner Losh wrote: >> I'd suggested that this be driven off a global quirk like >> >> u_int fdt_quirks; >> #define FDT_QUIRK_8BIT_IIC_ADDR 1 >> ... > > In openfirm.h? I'd really prefer an explicit platform check in ofw_iicbus.c for this by looking at the compatible property of the root node. If this ever comes up on another system, we can modify it, but I think it won't. -Nathan > >> if (fdt_quirks & FDT_QUIRK_8BIT_IIC_ADDR) >> dinfo->opd_dinfo.addr = paddr; >> else >> dinfo->opd_dinfo.addr = paddr << 1; >> >> And the platform code, whatever that means, would set it when it "knows" >> this is the case. > > If I get that right, I'd have to set the fdt_quirk in each I2C parent, > like kiic.c and smu.c? > >> On Thu, Nov 5, 2015 at 12:56 PM, Nathan Whitehorn >> > wrote: >> >> 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? > > The 'compatible property' approach would be limited/isolated to one > file (ofw_iicbus.c) in comparison to the quirk approach where I'd have > to adapt at least (known now) four files. > > I can go either way, just my thoughts. > > Andreas >