Received: from eggs.gnu.org ([2001:4830:134:3::10]:50623) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cBntq-0001UJ-Dw for qemu-devel@nongnu.org; Tue, 29 Nov 2016 14:17:10 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cBntm-0005hi-J0 for qemu-devel@nongnu.org; Tue, 29 Nov 2016 14:17:06 -0500 Received: from 3.mo69.mail-out.ovh.net ([188.165.52.203]:49284) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cBntm-0005hC-CA for qemu-devel@nongnu.org; Tue, 29 Nov 2016 14:17:02 -0500 Received: from player699.ha.ovh.net (b9.ovh.net [213.186.33.59]) by mo69.mail-out.ovh.net (Postfix) with ESMTP id 9758BC713 for ; Tue, 29 Nov 2016 20:16:59 +0100 (CET) References: <1480434248-27138-1-git-send-email-clg@kaod.org> <1480435656-28497-1-git-send-email-clg@kaod.org> From: =?UTF-8?Q?C=c3=a9dric_Le_Goater?= Message-ID: Date: Tue, 29 Nov 2016 20:16:54 +0100 MIME-Version: 1.0 In-Reply-To: <1480435656-28497-1-git-send-email-clg@kaod.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH for-2.9 29/30] aspeed/scu: add a aspeed_scu_get_clk() helper List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Peter Maydell , qemu-arm@nongnu.org, Andrew Jeffery , Marcin Krzeminski , Peter Crosthwaite This is a duplicate resend. Our SMTP server had an issue and=20 the message finaly went through ... On 11/29/2016 05:07 PM, C=C3=A9dric Le Goater wrote: > The clock frequency is defined in the HW STRAP1 register of the SCU > device. >=20 > Signed-off-by: C=C3=A9dric Le Goater > Reviewed-by: Joel Stanley > --- > hw/misc/aspeed_scu.c | 12 ++++++++++++ > include/hw/misc/aspeed_scu.h | 1 + > 2 files changed, 13 insertions(+) >=20 > diff --git a/hw/misc/aspeed_scu.c b/hw/misc/aspeed_scu.c > index 95022d3607ad..351b8f79aca0 100644 > --- a/hw/misc/aspeed_scu.c > +++ b/hw/misc/aspeed_scu.c > @@ -268,6 +268,18 @@ bool is_supported_silicon_rev(uint32_t silicon_rev= ) > return false; > } > =20 > +#define ASPEED_PLL_25MHZ 25000000 > +#define ASPEED_PLL_24MHZ 24000000 > +#define ASPEED_PLL_12MHZ 12000000 > + > +uint32_t aspeed_scu_get_clk(AspeedSCUState *scu) > +{ > + if (scu->hw_strap1 & AST2400_CLK_25M_IN) > + return ASPEED_PLL_25MHZ; > + else > + return ASPEED_PLL_24MHZ; > +} > + > static void aspeed_scu_realize(DeviceState *dev, Error **errp) > { > SysBusDevice *sbd =3D SYS_BUS_DEVICE(dev); > diff --git a/include/hw/misc/aspeed_scu.h b/include/hw/misc/aspeed_scu.= h > index bd4ac013f997..067f9f01819d 100644 > --- a/include/hw/misc/aspeed_scu.h > +++ b/include/hw/misc/aspeed_scu.h > @@ -37,6 +37,7 @@ typedef struct AspeedSCUState { > #define AST2500_A1_SILICON_REV 0x04010303U > =20 > extern bool is_supported_silicon_rev(uint32_t silicon_rev); > +extern uint32_t aspeed_scu_get_clk(AspeedSCUState *scu); > =20 > /* > * Extracted from Aspeed SDK v00.03.21. Fixes and extra definitions >=20