From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:40179) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rnrpp-0001wa-Mq for qemu-devel@nongnu.org; Thu, 19 Jan 2012 08:15:22 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Rnrpo-0002Lg-5d for qemu-devel@nongnu.org; Thu, 19 Jan 2012 08:15:21 -0500 Received: from mailout4.w1.samsung.com ([210.118.77.14]:44570) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rnrpn-0002LU-U2 for qemu-devel@nongnu.org; Thu, 19 Jan 2012 08:15:20 -0500 MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; charset=UTF-8; format=flowed Received: from euspt2 ([210.118.77.14]) by mailout4.w1.samsung.com (Sun Java(tm) System Messaging Server 6.3-8.04 (built Jul 29 2009; 32bit)) with ESMTP id <0LY1007LMRHH5760@mailout4.w1.samsung.com> for qemu-devel@nongnu.org; Thu, 19 Jan 2012 13:15:17 +0000 (GMT) Received: from [106.109.8.195] by spt2.w1.samsung.com (iPlanet Messaging Server 5.2 Patch 2 (built Jul 14 2004)) with ESMTPA id <0LY10000JRHGZE@spt2.w1.samsung.com> for qemu-devel@nongnu.org; Thu, 19 Jan 2012 13:15:17 +0000 (GMT) Date: Thu, 19 Jan 2012 17:15:14 +0400 From: Evgeny Voevodin In-reply-to: Message-id: <4F181762.9070100@samsung.com> References: <1326961896-25420-1-git-send-email-e.voevodin@samsung.com> <1326961896-25420-3-git-send-email-e.voevodin@samsung.com> Subject: Re: [Qemu-devel] [PATCH v8 2/8] ARM: Samsung exynos4210-based boards emulation List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: kyungmin.park@samsung.com, m.kozlov@samsung.com, jehyung.lee@samsung.com, qemu-devel@nongnu.org, d.solodkiy@samsung.com On 01/19/2012 04:19 PM, Peter Maydell wrote: > On 19 January 2012 08:31, Evgeny Voevodin wrote: > >> + /* >> + * Secondary CPU startup code will be placed here. >> + */ >> + memory_region_init_ram(&s->hack_mem, "exynos4210.hack", 0x1000); >> + memory_region_add_subregion(system_mem, EXYNOS4210_SMP_BOOT_ADDR, >> +&s->hack_mem); > I've been thinking about this 'hack' memory region, because I figured > out that we didn't actually need it on vexpress (or realview, though > I haven't submitted a patch to fix that yet). Basically the idea is that > we need to put the secondary CPU startup code somewhere where Linux > won't trash it before the secondary cores get started properly. However > this requirement exists also for the real hardware. So the right thing > to do here is identify where the real hardware's boot ROM puts the > secondary CPU holding pen code, and use the same thing. (On vexpress > this is in an area of SDRAM). What does the Exynos4 hardware/bootrom do > here? > In our case it is not a hack. Secondary CPU boot loader resides in ROM memory. And we have mapped a region in the ROM to place our boot-loader code there. Here all is correct. >> + /* >> + * Hack: Map SECOND_CPU_BOOTREG, because it is in PMU USER5 register. >> + */ >> + memory_region_init_ram(&s->bootreg_mem, "exynos4210.bootreg", 0x4); >> + memory_region_add_subregion(system_mem, EXYNOS4210_SECOND_CPU_BOOTREG, >> +&s->bootreg_mem); > If this was modelled as an actual register in a device model with a reset > function we wouldn't have needed the code in arm_boot.c:do_cpu_reset() > that clears smp_bootreg_addr. I think that's an argument for implementing > this as an actual qdev device, however minimal (one that implements > exactly one register would do) rather than as a bit of RAM. > Boot reg could be in the RAM on other platforms and code which is monitoring this address is awaiting a non-zero value here. If we would not clear this region, wrong boot address for secondary CPU will be read. So, code to clear this region should be at reset function anyway. I think that it is a matter of current board how to manage boot address - map a region or implement a device. >> +static QEMUMachine nuri_machine = { >> + .name = "nuri", >> + .desc = "Samsung NURI board (Exynos4210)", >> + .init = nuri_init, >> + .max_cpus = EXYNOS4210_MAX_CPUS, >> +}; >> + >> +static QEMUMachine smdkc210_machine = { >> + .name = "smdkc210", >> + .desc = "Samsung SMDKC210 board (Exynos4210)", >> + .init = smdkc210_init, >> + .max_cpus = EXYNOS4210_MAX_CPUS, >> +}; > Indentation in these is still wrong. > Sorry, will fix. > -- PMM > -- Kind regards, Evgeny Voevodin, Leading Software Engineer, ASWG, Moscow R&D center, Samsung Electronics e-mail: e.voevodin@samsung.com