Received: from eggs.gnu.org ([2001:4830:134:3::10]:45871) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bSwPq-0004yw-FI for qemu-devel@nongnu.org; Thu, 28 Jul 2016 21:16:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bSwPp-0007GD-2b for qemu-devel@nongnu.org; Thu, 28 Jul 2016 21:16:42 -0400 Message-ID: <1469754973.5468.149.camel@aj.id.au> From: Andrew Jeffery Date: Fri, 29 Jul 2016 10:46:13 +0930 In-Reply-To: <9316329d-c22d-aab1-c5d9-e10ab306ffb8@kaod.org> References: <1469638018-17590-1-git-send-email-clg@kaod.org> <1469638018-17590-2-git-send-email-clg@kaod.org> <1469672053.5468.81.camel@aj.id.au> <9316329d-c22d-aab1-c5d9-e10ab306ffb8@kaod.org> Content-Type: multipart/signed; micalg="pgp-sha512"; protocol="application/pgp-signature"; boundary="=-9aThMwXhVcOD38W4d9L8" Mime-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH 1/6] palmetto-bmc: add a "silicon-rev" property at the soc level List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?ISO-8859-1?Q?C=E9dric?= Le Goater , Peter Maydell Cc: qemu-devel@nongnu.org, qemu-arm@nongnu.org --=-9aThMwXhVcOD38W4d9L8 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Thu, 2016-07-28 at 09:51 +0200, C=C3=A9dric Le Goater wrote: > On 07/28/2016 04:14 AM, Andrew Jeffery wrote: > >=20 > > On Wed, 2016-07-27 at 18:46 +0200, C=C3=A9dric Le Goater wrote: > > >=20 > > > The SCU controler holds the board revision number in its 0x7C > > > register. Let's use an alias to link a "silicon-rev" property of the > > > soc to the "silicon-rev" property of the SCU controler. > > >=20 > > > The SDMC controler "silicon-rev" property is derived from the SCU one > > > at realize time. I did not find a better way to handle this part. > > > Links and aliases being a one-to-one relation, I could not use one of > > > them. I might wrong though. > > Are we trying to over-use the silicon-rev value (it would seem so at > > least in the face of the link/alias constraints)? We know which SDMC > > revision we need for each SoC and we'll be modelling an explicit SoC > > revision, so should we instead set a separate property on the SDMC in > > the SoCs' respective initialise functions (and leave silicon-rev to the > > SCU)?=C2=A0 > This is the case. no ?=C2=A0 No, because you are selecting the SDMC configuration from the silicon- rev rather than letting e.g. the SDMC configuration define which silicon-rev the SoC takes. My thinking is the silicon rev is a property of the SoC. The platform should select a SoC to use and not be setting silicon revision values, that is I think it's a layering violation for the platform to be setting the silicon-rev (and also the CPU). We also wind up in a situation where the ast2500 soc identifies as an ast2400 in TypeInfo.name due to the approach to reuse by this series. >=20 > SCU holds the silicon-rev value. The patch adds a property alias to the= =C2=A0 > SCU 'silicon-rev' property at the soc level. This is convenient Right, but "convenient" here is a bit of a stretch given we are subsequently fetching the value out of the SCU to select the SDMC configuration. You might argue that it's due to limitations of the property alias/link API, but maybe we could rearrange things so this goes away. > for the > platform to initialize the soc. This is similar to what the rpi2 does, > which goes one level in the aliasing. Okay, maybe I'm barking up trees unnecessarily. >=20 > Then, at initialize time, the SCU 'silicon-rev' property value is read > to initialize the SDMC controller. If we have more controllers in the=C2= =A0 > future needing 'silicon-rev,=C2=A0=C2=A0we could follow the same pattern.= Not=C2=A0 > saying this is perfect.=C2=A0 >=20 > What I would have liked to do, is to link all the 'silicon-rev' do > the SCU one. I did not find a way. Yes, that would be nice. I did briefly poke around to see if there was a solution to the link/alias issue but it seems not.=C2=A0 >=20 > >=20 > > My thought was the silicon-rev value is reflective of the SoC > > design rather than the other way around - but maybe that's splitting > > hairs.=C2=A0 > ah. is your concern about which object is holding the value ? If so, > I thought that keeping it where it belongs on real HW was the better=C2= =A0 > option, that is in SCU, and then build from there. No, that's not my concern, but I agree that it would not reflect the hardware if there was a property on the SoC (i.e. there is nowhere besides the SCU that the value is held). >=20 > >=20 > > It would also be trading off a bit of ugliness in this patch for > > potential bugs if the properties get out of sync. > This is the exact the purpose of the patch ! I failed to make it feel > that way :) Right. I think we need another layer of abstraction, essentially a soc configuration struct that is accessed by what are currently the ast2400_{init,realise}() functions. This will capture differences like changes in IO addresses, changes to IP behaviour, the CPU types and ultimately the silicon-rev value. What is now ast2400_init() and ast2400_realise() can become generic aspeed_soc_{init,realise}(), and then we wrap calls to this up in SoC-specific ast2{4,5}00_{init,realise}() where we set the configuration struct. It is a bit more work but I think the result would better reflect the hardware and avoid introducing what feel to me like layering violations. Thoughts? Andrew --=-9aThMwXhVcOD38W4d9L8 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAABCgAGBQJXmq5eAAoJEJ0dnzgO5LT5Fe8QAKSBS94yGEGhYg+t0IjEfOCD fyi7f+qhqg16EkUjntvK1TFjA/nAUSv6HryI9yLkYV6ZOdSKak8RturpNrnWwZFv oTDMP/rKW43m5BkoHyJUxGqPlhBI6QtZDiLRTC55BBBhw2I+LZmkeEk51LcrA5GC FZADtRdr6QUdpCKvLqsc11hYxTbSnxNbrXuWZzy9fMDJHcNDyrJsA+go78CLvG6H +eDsCM+L08s7lP1vnM5GY1On6a0Iu+vMMQvplC77SK9VisEJ9VMGsdFOGwGXQO+u ReePPyWf8CbAYy0880Fec+NDGQGfuvJ28tXUITtkDqfa57AdHVKXBvCoBMBRKYs4 HJk8vSIr8TRVZgI54kimBqSNk4Obfd/0lrqOKzPGXEkXN0X8To5YaejHGXIOpBpf daUgy9rAJJXNtMkKCYUtuDg0y1dKrTuLLMY+nHT3XClnAhpwtOuaVVw9wqUjk6v7 5h1WayDVNCa5mkbPJwlCswQdStmDBYQVFm2feVgYRqxXclfLnnfrIFaqHUTQmMc2 x68O90Gj+uNF9G4gquZN3M784VPJ10eMx3KpxDBVOPPkN3uOH0Mllby2CCc63KK4 Lv6SBknk96AMmg8KUxy5KqSgHmgEqA6QvTkoBE2HDdcJHS4RiRYewQuPj+5T7MKl AnB9LoAw5pua36FE/fQG =J/wh -----END PGP SIGNATURE----- --=-9aThMwXhVcOD38W4d9L8--