From patchwork Fri Aug 1 11:35:44 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoffer Dall X-Patchwork-Id: 375718 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 891F7140116 for ; Fri, 1 Aug 2014 21:42:27 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id EC90F4B14B; Fri, 1 Aug 2014 13:42:23 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 04BIfoE0zVDz; Fri, 1 Aug 2014 13:42:23 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 24F184A04F; Fri, 1 Aug 2014 13:42:21 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id B93BA4A04F for ; Fri, 1 Aug 2014 13:42:16 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 4UEKIXnZ429y for ; Fri, 1 Aug 2014 13:42:14 +0200 (CEST) X-Greylist: delayed 384 seconds by postgrey-1.27 at theia; Fri, 01 Aug 2014 13:42:11 CEST X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from mail-lb0-f173.google.com (mail-lb0-f173.google.com [209.85.217.173]) by theia.denx.de (Postfix) with ESMTPS id 271804A04E for ; Fri, 1 Aug 2014 13:42:11 +0200 (CEST) Received: by mail-lb0-f173.google.com with SMTP id p9so3104064lbv.32 for ; Fri, 01 Aug 2014 04:42:09 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=Wrz0ZRN2zXpeSU2iUkF2PaUBvTzFjYSEGpHKpB5FLEU=; b=EKPZjgXUX1NfuqT9zKKNDIUFdhZeFB/Fc5K42isIQSp9HdpuDbl29a3TtYAqtaTT4W VmWxtkMBWAKzo8sNMCwWPq4m5wlYaE8IYYn4sZPZ1cSjqQcv+yloFJNAVfd1fEqgDkMF Crx7QjMFgGkN+wM+P91fiw3oS8WbbY8bga7rBeSVzGaAhlqKL2NMsvde4wl3lm3vPV9k 8rxcOOmNqBaSRpTeX32L4kfs8a6G6QapkOQFf5LihGdtJkPICUePl/WwOWj+VrlJAHnz VS+7dIKO0nhuDzbbGrQ+z2kti8NhUFawncac/7eiNBz1Bzbe9i2lB/x+2VOuyRMx+gIx PfBA== X-Gm-Message-State: ALoCoQmd3XxlgDLodI8hxISJuw3MDmsNcmlw9FwquZAVK4mbnlLj3t6EzvG4ECzC5nv4cUa4dijA X-Received: by 10.112.5.170 with SMTP id t10mr4930022lbt.54.1406892946856; Fri, 01 Aug 2014 04:35:46 -0700 (PDT) Received: from localhost.localdomain (188-178-240-98-static.dk.customer.tdc.net. [188.178.240.98]) by mx.google.com with ESMTPSA id h3sm4587998lah.20.2014.08.01.04.35.44 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 01 Aug 2014 04:35:45 -0700 (PDT) From: Christoffer Dall To: u-boot@lists.denx.de Date: Fri, 1 Aug 2014 13:35:44 +0200 Message-Id: <1406892944-4390-1-git-send-email-christoffer.dall@linaro.org> X-Mailer: git-send-email 1.8.5.2 Cc: Andre Przywara , Andre Przywara Subject: [U-Boot] [PATCH] ARM: enable ARMv7 virt support for the Arndale board X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de From: Andre Przywara To enable hypervisors utilizing the ARMv7 virtualization extension on the Arndale board, add the simple SMP pen address writer function and add the required configuration variables to switch all cores to HYP mode before launching the OS. This allows booting KVM and Xen directly from u-boot. Reviewed-by: Christoffer Dall Signed-off-by: Andre Przywara Signed-off-by: Christoffer Dall Signed-off-by: Andre Przywara --- Note that Andre previously reported a board reset on initial boot with this patch, but I have applied this patch on upstream master of U-Boot and tested on two separate Arndale boards and it boots perfectly fine and lets you use KVM, so I recommend taking this patch as is. board/samsung/arndale/arndale.c | 10 ++++++++++ include/configs/arndale.h | 8 ++++++++ 2 files changed, 18 insertions(+) diff --git a/board/samsung/arndale/arndale.c b/board/samsung/arndale/arndale.c index ef88314..83fd3bd 100644 --- a/board/samsung/arndale/arndale.c +++ b/board/samsung/arndale/arndale.c @@ -117,3 +117,13 @@ int checkboard(void) return 0; } #endif + +#ifdef CONFIG_S5P_PA_SYSRAM +void smp_set_core_boot_addr(unsigned long addr, int corenr) +{ + writel(addr, CONFIG_S5P_PA_SYSRAM); + + /* make sure this write is really executed */ + __asm__ volatile ("dsb\n"); +} +#endif diff --git a/include/configs/arndale.h b/include/configs/arndale.h index 64b54ab..75f9933 100644 --- a/include/configs/arndale.h +++ b/include/configs/arndale.h @@ -250,4 +250,12 @@ /* Enable Time Command */ #define CONFIG_CMD_TIME +#define CONFIG_S5P_PA_SYSRAM 0x02020000 +#define CONFIG_SMP_PEN_ADDR CONFIG_S5P_PA_SYSRAM + +/* The PERIPHBASE in the CBAR register is wrong on the Arndale, so override it */ +#define CONFIG_ARM_GIC_BASE_ADDRESS 0x10480000 + +#define CONFIG_ARMV7_VIRT + #endif /* __CONFIG_H */