From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40230) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vo07r-00033W-82 for qemu-devel@nongnu.org; Tue, 03 Dec 2013 19:15:39 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Vo07m-0001hw-J3 for qemu-devel@nongnu.org; Tue, 03 Dec 2013 19:15:35 -0500 Received: from [222.73.24.84] (port=3226 helo=song.cn.fujitsu.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vo07m-0001gS-0H for qemu-devel@nongnu.org; Tue, 03 Dec 2013 19:15:30 -0500 Message-ID: <529E70AF.9040006@cn.fujitsu.com> Date: Wed, 04 Dec 2013 08:00:47 +0800 From: Li Guang MIME-Version: 1.0 References: <1386061881-12720-1-git-send-email-lig.fnst@cn.fujitsu.com> <1386061881-12720-6-git-send-email-lig.fnst@cn.fujitsu.com> <529DEE54.20405@suse.de> In-Reply-To: <529DEE54.20405@suse.de> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH 5/5] hw/arm: add cubieboard support List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?ISO-8859-1?Q?Andreas_F=E4rber?= Cc: Peter Maydell , Peter Crosthwaite , "qemu-devel@nongnu.org Developers" Andreas F=E4rber wrote: > Am 03.12.2013 13:01, schrieb Peter Crosthwaite: > =20 >> On Tue, Dec 3, 2013 at 7:11 PM, liguang wrote: >> =20 >>> Signed-off-by: liguang >>> --- >>> hw/arm/Makefile.objs | 2 +- >>> hw/arm/cubieboard.c | 33 +++++++++++++++++++++++++++++++++ >>> 2 files changed, 34 insertions(+), 1 deletions(-) >>> create mode 100644 hw/arm/cubieboard.c >>> >>> diff --git a/hw/arm/Makefile.objs b/hw/arm/Makefile.objs >>> index b9e5983..8be8d8e 100644 >>> --- a/hw/arm/Makefile.objs >>> +++ b/hw/arm/Makefile.objs >>> @@ -4,4 +4,4 @@ obj-y +=3D omap=5Fsx1.o palm.o realview.o spitz.o stell= aris.o >>> obj-y +=3D tosa.o versatilepb.o vexpress.o xilinx=5Fzynq.o z2.o >>> >>> obj-y +=3D armv7m.o exynos4210.o pxa2xx.o pxa2xx=5Fgpio.o pxa2xx=5Fpi= c.o >>> -obj-y +=3D omap1.o omap2.o strongarm.o allwinner-a10.o >>> +obj-y +=3D omap1.o omap2.o strongarm.o allwinner-a10.o cubieboard.o >>> diff --git a/hw/arm/cubieboard.c b/hw/arm/cubieboard.c >>> new file mode 100644 >>> index 0000000..a5be21c >>> --- /dev/null >>> +++ b/hw/arm/cubieboard.c >>> @@ -0,0 +1,33 @@ >>> +#include "hw/sysbus.h" >>> +#include "hw/devices.h" >>> +#include "hw/boards.h" >>> +#include "hw/arm/allwinner-a10.h" >>> + >>> + >>> +static struct arm=5Fboot=5Finfo cubieboard=5Fbinfo =3D { >>> + .loader=5Fstart =3D A10=5FSDRAM=5FBASE, >>> + .board=5Fid =3D 0x1008, >>> +}; >>> + >>> +static void cubieboard=5Finit(QEMUMachineInitArgs *args) >>> +{ >>> + A10State *s =3D a10=5Finit(get=5Fsystem=5Fmemory(), args->ram=5Fsi= ze); >>> + >>> + cubieboard=5Fbinfo.ram=5Fsize =3D args->ram=5Fsize; >>> + cubieboard=5Fbinfo.kernel=5Ffilename =3D args->kernel=5Ffilename; >>> + cubieboard=5Fbinfo.kernel=5Fcmdline =3D args->kernel=5Fcmdline; >>> =20 >> I cant help but think that serial attachment needs to happen on the >> board level. but im not sure how this can be made to work with the >> un-qomified serial=5Fmm=5Finit, so no block from me unless Andreas has a >> better idea. >> =20 > I don't have an immediate solution, same problem in Tegra2 code. > > If someone is willing to convert serial=5Fmm into QOM-friendly form that > would be nice but I will be unavailable for review the next ~two weeks. > > What I do wonder here is why this is calling a new a10=5Finit() rather > than object=5Fnew() and related QOM APIs. get=5Fsystem=5Fmemory() can wit= hout > problems be called inside the device. If RAM is really on the SoC (it is > for Tegra2/3) then it could become a property of the device with > MemoryRegion initialization in realize - that is still unclean in my > code IIRC. > > =20 >>> + arm=5Fload=5Fkernel(s->cpu,&cubieboard=5Fbinfo); >>> +} >>> =20 > [...] > =20 >>> +machine=5Finit(cubieboard=5Fmachine=5Finit); >>> =20 > No semicolon here please, it's a function. > > =20 Yes, thanks! =