From patchwork Fri Dec 9 13:34:37 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Evgeny Voevodin X-Patchwork-Id: 130396 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [140.186.70.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 1C086B6F9B for ; Sat, 10 Dec 2011 01:39:16 +1100 (EST) Received: from localhost ([::1]:42950 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RZ0cx-0007YO-Mx for incoming@patchwork.ozlabs.org; Fri, 09 Dec 2011 08:36:39 -0500 Received: from eggs.gnu.org ([140.186.70.92]:34516) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RZ0bm-0004YU-5l for qemu-devel@nongnu.org; Fri, 09 Dec 2011 08:35:32 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RZ0bg-0000YE-2L for qemu-devel@nongnu.org; Fri, 09 Dec 2011 08:35:26 -0500 Received: from mailout3.w1.samsung.com ([210.118.77.13]:8508) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RZ0bf-0000Xq-K4 for qemu-devel@nongnu.org; Fri, 09 Dec 2011 08:35:19 -0500 MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: TEXT/PLAIN Received: from euspt2 ([210.118.77.13]) by mailout3.w1.samsung.com (Sun Java(tm) System Messaging Server 6.3-8.04 (built Jul 29 2009; 32bit)) with ESMTP id <0LVX005U0V2V7250@mailout3.w1.samsung.com> for qemu-devel@nongnu.org; Fri, 09 Dec 2011 13:35:19 +0000 (GMT) Received: from evvoevodinPC.rnd.samsung.ru ([106.109.8.48]) by spt2.w1.samsung.com (iPlanet Messaging Server 5.2 Patch 2 (built Jul 14 2004)) with ESMTPA id <0LVX00MANV28B5@spt2.w1.samsung.com> for qemu-devel@nongnu.org; Fri, 09 Dec 2011 13:35:19 +0000 (GMT) Date: Fri, 09 Dec 2011 17:34:37 +0400 From: Evgeny Voevodin In-reply-to: <1323437682-28792-1-git-send-email-e.voevodin@samsung.com> To: qemu-devel@nongnu.org Message-id: <1323437682-28792-11-git-send-email-e.voevodin@samsung.com> X-Mailer: git-send-email 1.7.4.1 References: <1323437682-28792-1-git-send-email-e.voevodin@samsung.com> X-detected-operating-system: by eggs.gnu.org: Solaris 9.1 X-Received-From: 210.118.77.13 Cc: m.kozlov@samsung.com, d.solodkiy@samsung.com, Evgeny Voevodin Subject: [Qemu-devel] [PATCH 10/15] hw/exynos4210.c: Boot secondary CPU. X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Signed-off-by: Evgeny Voevodin --- hw/exynos4210.c | 28 +++++++++++++++++++++++++++- 1 files changed, 27 insertions(+), 1 deletions(-) diff --git a/hw/exynos4210.c b/hw/exynos4210.c index f172346..8d8a12c 100644 --- a/hw/exynos4210.c +++ b/hw/exynos4210.c @@ -93,6 +93,12 @@ #define EXYNOS4210_EXT_COMBINER_BASE_ADDR 0x10440000 #define EXYNOS4210_INT_COMBINER_BASE_ADDR 0x10448000 +/* Secondary CPU polling address to get loader start from */ +#define EXYNOS4210_SECOND_CPU_BOOTREG 0x10020814 + +/* Secondary CPU startup code is in IROM memory */ +#define EXYNOS4210_SMP_BOOT_ADDR EXYNOS4210_IROM_BASE_ADDR + static struct arm_boot_info exynos4210_binfo = { .loader_start = EXYNOS4210_BASE_BOOT_ADDR, }; @@ -208,6 +214,8 @@ static void exynos4210_init(ram_addr_t ram_size, MemoryRegion *irom_alias_mem = g_new(MemoryRegion, 1); MemoryRegion *dram0_mem = g_new(MemoryRegion, 1); MemoryRegion *dram1_mem = NULL; + MemoryRegion *hack_mem = g_new(MemoryRegion, 1); + MemoryRegion *bootreg_mem = g_new(MemoryRegion, 1); Exynos4210Irq *irqs; qemu_irq *irq_table; qemu_irq *irqp; @@ -219,10 +227,12 @@ static void exynos4210_init(ram_addr_t ram_size, switch (board_type) { case BOARD_EXYNOS4210_NURI: - exynos4210_binfo.board_id = MACH_NURI_ID; + exynos4210_binfo.board_id = MACH_NURI_ID; + exynos4210_binfo.smp_bootreg_addr = EXYNOS4210_SECOND_CPU_BOOTREG; break; case BOARD_EXYNOS4210_SMDKC210: exynos4210_binfo.board_id = MACH_SMDKC210_ID; + exynos4210_binfo.smp_bootreg_addr = EXYNOS4210_SECOND_CPU_BOOTREG; break; default: break; @@ -353,6 +363,21 @@ static void exynos4210_init(ram_addr_t ram_size, memory_region_add_subregion(system_mem, EXYNOS4210_DRAM0_BASE_ADDR, dram0_mem); + /* + * Secondary CPU startup code will be placed here. + */ + memory_region_init_ram(hack_mem, NULL, "exynos4210.hack", 0x1000); + memory_region_add_subregion(system_mem, EXYNOS4210_SMP_BOOT_ADDR, + hack_mem); + + /* + * Hack: Map SECOND_CPU_BOOTREG, because it is in PMU USER5 register. + */ + memory_region_init_ram(bootreg_mem, NULL, "exynos4210.bootreg", 0x4); + memory_region_add_subregion(system_mem, EXYNOS4210_SECOND_CPU_BOOTREG, + bootreg_mem); + + /* CMU */ sysbus_create_simple("exynos4210.cmu", EXYNOS4210_CMU_BASE_ADDR, NULL); @@ -427,6 +452,7 @@ static void exynos4210_init(ram_addr_t ram_size, exynos4210_binfo.kernel_filename = kernel_filename; exynos4210_binfo.initrd_filename = initrd_filename; exynos4210_binfo.kernel_cmdline = kernel_cmdline; + exynos4210_binfo.smp_priv_base = EXYNOS4210_SMP_PRIVATE_BASE_ADDR; arm_load_kernel(first_cpu, &exynos4210_binfo); }