Received: from eggs.gnu.org ([2001:4830:134:3::10]:48793) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bYDSM-00038h-EG for qemu-devel@nongnu.org; Fri, 12 Aug 2016 10:29:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bYDSI-0000qu-77 for qemu-devel@nongnu.org; Fri, 12 Aug 2016 10:29:05 -0400 Received: from mo6.mail-out.ovh.net ([178.32.228.6]:36318) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bYDSH-0000qV-SU for qemu-devel@nongnu.org; Fri, 12 Aug 2016 10:29:02 -0400 Received: from player738.ha.ovh.net (b7.ovh.net [213.186.33.57]) by mo6.mail-out.ovh.net (Postfix) with ESMTP id 69C30FFA777 for ; Fri, 12 Aug 2016 10:33:16 +0200 (CEST) References: <1470158147-16378-1-git-send-email-clg@kaod.org> <1470158147-16378-4-git-send-email-clg@kaod.org> From: =?UTF-8?Q?C=c3=a9dric_Le_Goater?= Message-ID: Date: Fri, 12 Aug 2016 10:33:11 +0200 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH v3 03/10] aspeed-soc: provide a framework to add new SoCs List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: QEMU Developers , qemu-arm , Andrew Jeffery On 08/11/2016 12:14 PM, Peter Maydell wrote: > On 2 August 2016 at 18:15, C=C3=A9dric Le Goater wrote: >> Let's define an object class for each Aspeed SoC we support. A >> AspeedSoCInfo struct gathers the SoC specifications which can later be >> used by an instance of the class or by a board using the SoC. >> >> Signed-off-by: C=C3=A9dric Le Goater >=20 >> diff --git a/hw/arm/palmetto-bmc.c b/hw/arm/palmetto-bmc.c >> index 4d11905cfb18..531c266d9449 100644 >> --- a/hw/arm/palmetto-bmc.c >> +++ b/hw/arm/palmetto-bmc.c >> @@ -22,8 +22,6 @@ >> #include "sysemu/blockdev.h" >> >> static struct arm_boot_info palmetto_bmc_binfo =3D { >> - .loader_start =3D AST2400_SDRAM_BASE, >> - .board_id =3D 0, >> .nb_cpus =3D 1, >> }; >> >> @@ -61,14 +59,17 @@ static void palmetto_bmc_init_flashes(AspeedSMCSta= te *s, const char *flashtype, >> static void palmetto_bmc_init(MachineState *machine) >> { >> PalmettoBMCState *bmc; >> + AspeedSoCClass *sc; >> >> bmc =3D g_new0(PalmettoBMCState, 1); >> - object_initialize(&bmc->soc, (sizeof(bmc->soc)), TYPE_ASPEED_SOC)= ; >> + object_initialize(&bmc->soc, (sizeof(bmc->soc)), "ast2400-a0"); >> object_property_add_child(OBJECT(machine), "soc", OBJECT(&bmc->so= c), >> &error_abort); >> >> + sc =3D ASPEED_SOC_GET_CLASS(&bmc->soc); >> + >> memory_region_allocate_system_memory(&bmc->ram, NULL, "ram", ram_= size); >> - memory_region_add_subregion(get_system_memory(), AST2400_SDRAM_BA= SE, >> + memory_region_add_subregion(get_system_memory(), sc->info->sdram_= base, >> &bmc->ram); >> object_property_add_const_link(OBJECT(&bmc->soc), "ram", OBJECT(&= bmc->ram), >> &error_abort); >> @@ -84,6 +85,9 @@ static void palmetto_bmc_init(MachineState *machine) >> palmetto_bmc_binfo.initrd_filename =3D machine->initrd_filename; >> palmetto_bmc_binfo.kernel_cmdline =3D machine->kernel_cmdline; >> palmetto_bmc_binfo.ram_size =3D ram_size; >> + palmetto_bmc_binfo.board_id =3D sc->info->silicon_rev; >> + palmetto_bmc_binfo.loader_start =3D sc->info->sdram_base; >> + >=20 > This changes the behaviour from passing in the board_id > as 0 to passing in the silicon rev. Neither of those > things is actually a valid board ID value, which must > be one of: > (a) for legacy pre-device-tree boards, a value listed in > the official database at: > http://www.arm.linux.org.uk/developer/machines/download.php > (b) for device-tree-only boards, -1 >=20 > board_id 0 means "I am an EBSA110", which this isn't, > and your silicon rev values are completely out of range. OK. I was not aware of this. I will request new board ids for=20 the ast2400 and ast2500 Thanks, C. =20 > thanks > -- PMM >=20