From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44644) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cBuD8-0004YB-FG for qemu-devel@nongnu.org; Tue, 29 Nov 2016 21:01:27 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cBuD7-0007Rq-LX for qemu-devel@nongnu.org; Tue, 29 Nov 2016 21:01:26 -0500 Message-ID: <1480471266.2503.103.camel@aj.id.au> From: Andrew Jeffery Date: Wed, 30 Nov 2016 12:31:06 +1030 In-Reply-To: <1480434248-27138-29-git-send-email-clg@kaod.org> References: <1480434248-27138-1-git-send-email-clg@kaod.org> <1480434248-27138-29-git-send-email-clg@kaod.org> Content-Type: multipart/signed; micalg="pgp-sha512"; protocol="application/pgp-signature"; boundary="=-g/EZdLGL20cGmki9jwUr" Mime-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH for-2.9 28/30] aspeed: add a watchdog controller 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, Marcin Krzeminski , Peter Crosthwaite --=-g/EZdLGL20cGmki9jwUr Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tue, 2016-11-29 at 16:44 +0100, C=C3=A9dric Le Goater wrote: > This enables reboot of a guest from U-Boot and Linux. >=20 > Signed-off-by: C=C3=A9dric Le Goater > Reviewed-by: Joel Stanley Reviewed-by: Andrew Jeffery > --- > =C2=A0hw/arm/aspeed_soc.c=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0| 13 +++++++++++++ > =C2=A0include/hw/arm/aspeed_soc.h |=C2=A0=C2=A02 ++ > =C2=A02 files changed, 15 insertions(+) >=20 > diff --git a/hw/arm/aspeed_soc.c b/hw/arm/aspeed_soc.c > index 4fb777e6df6e..6df76382f007 100644 > --- a/hw/arm/aspeed_soc.c > +++ b/hw/arm/aspeed_soc.c > @@ -31,6 +31,7 @@ > =C2=A0#define ASPEED_SOC_SCU_BASE=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A00x1E6E2000 > =C2=A0#define ASPEED_SOC_SRAM_BASE=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A00x1E720000 > =C2=A0#define ASPEED_SOC_TIMER_BASE=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A00x1E782000 > +#define ASPEED_SOC_WDT_BASE=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A00x1E785000 > =C2=A0#define ASPEED_SOC_I2C_BASE=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A00x1E78A000 > =C2=A0 > =C2=A0static const int uart_irqs[] =3D { 9, 32, 33, 34, 10 }; > @@ -170,6 +171,10 @@ static void aspeed_soc_init(Object *obj) > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0sc->info->silicon_rev); > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0object_property_add_alias(obj, "ram-size", = OBJECT(&s->sdmc), > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0"ram-size", &error_abort); > + > +=C2=A0=C2=A0=C2=A0=C2=A0object_initialize(&s->wdt, sizeof(s->wdt), TYPE_= ASPEED_WDT); > +=C2=A0=C2=A0=C2=A0=C2=A0object_property_add_child(obj, "wdt", OBJECT(&s-= >wdt), NULL); > +=C2=A0=C2=A0=C2=A0=C2=A0qdev_set_parent_bus(DEVICE(&s->wdt), sysbus_get_= default()); > =C2=A0} > =C2=A0 > =C2=A0static void aspeed_soc_realize(DeviceState *dev, Error **errp) > @@ -289,6 +294,14 @@ static void aspeed_soc_realize(DeviceState *dev, > Error **errp) > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0return; > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0} > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0sysbus_mmio_map(SYS_BUS_DEVICE(&s->sdmc), 0= , > ASPEED_SOC_SDMC_BASE); > + > +=C2=A0=C2=A0=C2=A0=C2=A0/* Watch dog */ > +=C2=A0=C2=A0=C2=A0=C2=A0object_property_set_bool(OBJECT(&s->wdt), true, = "realized", > &err); > +=C2=A0=C2=A0=C2=A0=C2=A0if (err) { > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0error_propagate(errp, er= r); > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0return; > +=C2=A0=C2=A0=C2=A0=C2=A0} > +=C2=A0=C2=A0=C2=A0=C2=A0sysbus_mmio_map(SYS_BUS_DEVICE(&s->wdt), 0, > ASPEED_SOC_WDT_BASE); > =C2=A0} > =C2=A0 > =C2=A0static void aspeed_soc_class_init(ObjectClass *oc, void *data) > diff --git a/include/hw/arm/aspeed_soc.h > b/include/hw/arm/aspeed_soc.h > index 1ab5deaa0813..dbec0c159885 100644 > --- a/include/hw/arm/aspeed_soc.h > +++ b/include/hw/arm/aspeed_soc.h > @@ -19,6 +19,7 @@ > =C2=A0#include "hw/timer/aspeed_timer.h" > =C2=A0#include "hw/i2c/aspeed_i2c.h" > =C2=A0#include "hw/ssi/aspeed_smc.h" > +#include "hw/watchdog/wdt_aspeed.h" > =C2=A0 > =C2=A0#define ASPEED_SPIS_NUM=C2=A0=C2=A02 > =C2=A0 > @@ -37,6 +38,7 @@ typedef struct AspeedSoCState { > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0AspeedSMCState fmc; > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0AspeedSMCState spi[ASPEED_SPIS_NUM]; > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0AspeedSDMCState sdmc; > +=C2=A0=C2=A0=C2=A0=C2=A0AspeedWDTState wdt; > =C2=A0} AspeedSoCState; > =C2=A0 > =C2=A0#define TYPE_ASPEED_SOC "aspeed-soc" --=-g/EZdLGL20cGmki9jwUr Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- iQIcBAABCgAGBQJYPjLjAAoJEJ0dnzgO5LT5fMYP/jCKztHiRPX60ORO7x7LuRgn N6tXzFt9xM6NAVxIAWUzR71qYDIaLd5A/KUnfo56uQiEtFJjjsvHbcnTCIP9j6Wm b1blwadCdyNZw2WjT32GnJsOaJp2kiF/i6Ztlg0l5VbhUV2D5z/jWaE8Tz8ihN6L MhnAoxPnul5iITQgfwwmwsGtnRxSbv1cX2YtM66cipgj5i0FFdQDre64VWkf5ulr w5LA5Jc8PZzitDHVp0g+ICtKSNUW8pWgyUXj2hpzUcII5ULUE6rCUfxXP4Xrzhj7 fhFc9oPocjNAaVISzYw/RpDTA7WaV3cxYGAgbBzcglLfBDK0IKy06cZbaDpxjK5o RBr/qFJDopV3nsmUzIC50rvkfaSu7AssD1mv0Nt4kDTAxqoOQ7dU3K9wm88mWpth xVlOpFsGCVIjQotoU3ahIiO+DCgB8Sq5hhRaVjBno4sKo9iLZRbUJ/b9Cbq6T/La v1JRgSydTHbkCCsGzffxO3DLL2TnJzqQI8vdiLj39gJB+F3GLEmnd1Qu/Umluad7 W/sPxg9fcgSQKjcmZFJ7Cwz4gCZ6ZDlXhfKTUNnIHwFdsiDBp/MyyauHzJndIlqE 8CJ0RqdcTI+LNGsNGDEbjk8FxYHTQUDE9CYHFwbqefrxVD3qR7jWN1u44zSRFvtT J6zHyRZGbcFFdHSdtLUv =pJGR -----END PGP SIGNATURE----- --=-g/EZdLGL20cGmki9jwUr--