From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42423) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VlbPj-0005e9-KN for qemu-devel@nongnu.org; Wed, 27 Nov 2013 04:28:12 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VlbPe-0001zy-TA for qemu-devel@nongnu.org; Wed, 27 Nov 2013 04:28:07 -0500 Received: from cantor2.suse.de ([195.135.220.15]:36161 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VlbPe-0001zu-Jx for qemu-devel@nongnu.org; Wed, 27 Nov 2013 04:28:02 -0500 Message-ID: <5295BB1E.1090600@suse.de> Date: Wed, 27 Nov 2013 10:27:58 +0100 From: =?ISO-8859-1?Q?Andreas_F=E4rber?= MIME-Version: 1.0 References: <1385450531-3170-1-git-send-email-lig.fnst@cn.fujitsu.com> <1385450531-3170-4-git-send-email-lig.fnst@cn.fujitsu.com> <5295B9BD.7080101@suse.de> In-Reply-To: <5295B9BD.7080101@suse.de> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH v4 3/4] hw/arm: add sunxi machine type List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: liguang Cc: Peter Maydell , Peter Crosthwaite , qemu-devel , Bamvor Jian Zhang Am 27.11.2013 10:22, schrieb Andreas F=E4rber: > Hi, >=20 > Am 26.11.2013 10:22, schrieb Peter Crosthwaite: >> On Tue, Nov 26, 2013 at 5:22 PM, liguang wro= te: >>> Signed-off-by: liguang >>> --- >>> hw/arm/Makefile.objs | 1 + >>> hw/arm/sunxi-soc.c | 98 ++++++++++++++++++++++++++++++++++++++++= ++++++++++ >>> 2 files changed, 99 insertions(+), 0 deletions(-) >>> create mode 100644 hw/arm/sunxi-soc.c >>> >>> diff --git a/hw/arm/Makefile.objs b/hw/arm/Makefile.objs >>> index 3671b42..f9f3071 100644 >>> --- a/hw/arm/Makefile.objs >>> +++ b/hw/arm/Makefile.objs >>> @@ -5,3 +5,4 @@ obj-y +=3D tosa.o versatilepb.o vexpress.o xilinx_zyn= q.o z2.o >>> >>> obj-y +=3D armv7m.o exynos4210.o pxa2xx.o pxa2xx_gpio.o pxa2xx_pic.o >>> obj-y +=3D omap1.o omap2.o strongarm.o >>> +obj-y +=3D sunxi-soc.o >>> diff --git a/hw/arm/sunxi-soc.c b/hw/arm/sunxi-soc.c >>> new file mode 100644 >>> index 0000000..b45af6d >>> --- /dev/null >>> +++ b/hw/arm/sunxi-soc.c >>> @@ -0,0 +1,98 @@ >>> +/* >>> + * Allwinner sunxi series SoC emulation >>> + * >>> + * Copyright (C) 2013 Li Guang >>> + * Written by Li Guang >>> + * >>> + * This program is free software; you can redistribute it and/or mod= ify it >>> + * under the terms of the GNU General Public License as published by= the >>> + * Free Software Foundation; either version 2 of the License, or >>> + * (at your option) any later version. >>> + * >>> + * This program is distributed in the hope that it will be useful, b= ut WITHOUT >>> + * ANY WARRANTY; without even the implied warranty of MERCHANTABILIT= Y or >>> + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public Lice= nse >>> + * for more details. >>> + */ >>> + >>> +#include "hw/sysbus.h" >>> +#include "hw/devices.h" >>> +#include "hw/boards.h" >>> +#include "hw/arm/arm.h" >>> +#include "hw/ptimer.h" >>> +#include "hw/char/serial.h" >>> +#include "hw/timer/sunxi-pit.h" >>> +#include "hw/intc/sunxi-pic.h" >>> + >>> +#include "sysemu/sysemu.h" >>> +#include "exec/address-spaces.h" >>> + >>> + >>> +#define SUNXI_PIC_REG_BASE 0x01c20400 >>> +#define SUNXI_PIT_REG_BASE 0x01c20c00 >>> +#define SUNXI_UART0_REG_BASE 0x01c28000 >>> + >>> +static struct arm_boot_info sunxi_binfo =3D { >>> + .loader_start =3D 0x40000000, >>> + .board_id =3D 0x1008, >>> +}; >>> + >>> +static void sunxi_init(QEMUMachineInitArgs *args) >> >> I would check with Andreas/PMM on what the go is with SoCs regarding >> container devices and boards. My (vague) understanding is that SoCs >> should be container devices and boards instantiate those containers >> with off-chip connectivity. This seems flat to me, with everything on >> board level. >=20 > Yes, thanks, that matches what I was going to comment. But I think it's > even more complicated: To my understanding, "sunxi" is the name of a > community effort [1] to clean up and upstream the BSP kernels from > Allwinner, so it sounds as if this was an attempt to write an emulation > for that kernel family while naming everything "sunxi" when in fact the > SoCs are called Axx [2] (with A1x =3D sun4i, A2x =3D sun5i, A3x =3D sun= 6i but My interpolation was incorrect: A10 =3D sun4i, A13 =3D sun5i, A3x =3D sun= 6i, A20 =3D sun7i Andreas > no literal "sunxi" AFAIK) and boards include Cubieboard, Cubieboard2, > Cubieboard3/Cubietruck [3] and whatever tablets etc. are out there. > (CC'ing Bamvor) >=20 > That's a lesson we learned from the old "prep" machine: Please name > things after real hardware, only then can it later be verified whether > the modeling is actually correct or which changes need to be performed. >=20 > A practical aspect of modeling SoCs correctly is that they can more > easily be reused across boards or modules, and you don't need to mess > with machine-level cpu_model if you have a fixed SoC-CPU mapping. >=20 > You may want to consult the recent DIGIC or earlier Faraday series or m= y > Tegra2 repository for examples of how to implement this paradigm. > I believe the composition tree naming wrt "cortex" and the MPCore was > still open, hopefully PMM can comment on his current preferences. >=20 > And thanks for your efforts, from a distribution viewpoint I am looking > forward to testing our kernels and images with this. >=20 > Regards, > Andreas >=20 > [1] http://linux-sunxi.org/Main_Page > [2] http://www.allwinnertech.com/en/product/A-Serial.html > [3] http://cubieboard.org/ >=20 --=20 SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 N=FCrnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imend=F6rffer; HRB 16746 AG N=FCrnbe= rg