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: 34697 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pa0-f69.google.com (mail-pa0-f69.google.com [209.85.220.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 8895A20540 for ; Fri, 1 Aug 2014 11:42:43 +0000 (UTC) Received: by mail-pa0-f69.google.com with SMTP id kx10sf26947768pab.8 for ; Fri, 01 Aug 2014 04:42:42 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:date:message-id:cc:subject :precedence:list-id:list-unsubscribe:list-archive:list-post :list-help:list-subscribe:mime-version:sender:errors-to :x-original-sender:x-original-authentication-results:mailing-list :content-type:content-transfer-encoding; bh=LnEzq+W75T8FOm+sgmcVQM2nuax2tLa0x+nkqFH+z28=; b=QzLPNBVn731fQ889sGLqwyclfyh2rdchscFJChCEzVJmUIu3LbAfB5/wNyPF0kDRqP /rLqDEIi7+BT/6rIQXVB2HYJbf4q5ynGBv5WsWoMcEqmnHc9Ym10g7QSobM6xNjSxBul nzfeHsH/K90R0ivtqpnmNkZjwo/CuGgnfMNM4UxG5ZPH/Xzoh5dQq9+1O9J6TOWClWsu MND4LrvQ3eQIWp8C5VpiIz9iaVF77/SWWD3mJyniuqKv5UFjw4IDGnA2KVEL6SneRtlA kKydOJEch/euJ7Vh3lHuiCc0gRGl9V+yDv20BNSpEuDsySpimzTUnql6/L9kyUelyQsZ dg7Q== X-Gm-Message-State: ALoCoQlut7SpRul4rvyhzMt3sQPxHyRzecJRCrLZy6Jpqy94h+7HffnIy6CxwhmckCDupfcyUwyE X-Received: by 10.70.87.202 with SMTP id ba10mr2003791pdb.1.1406893362866; Fri, 01 Aug 2014 04:42:42 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.30.137 with SMTP id d9ls1372591qgd.82.gmail; Fri, 01 Aug 2014 04:42:42 -0700 (PDT) X-Received: by 10.52.52.136 with SMTP id t8mr4352532vdo.21.1406893362734; Fri, 01 Aug 2014 04:42:42 -0700 (PDT) Received: from mail-vc0-f180.google.com (mail-vc0-f180.google.com [209.85.220.180]) by mx.google.com with ESMTPS id mx3si6956158vcb.63.2014.08.01.04.42.42 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 01 Aug 2014 04:42:42 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.180 as permitted sender) client-ip=209.85.220.180; Received: by mail-vc0-f180.google.com with SMTP id ij19so6387959vcb.11 for ; Fri, 01 Aug 2014 04:42:42 -0700 (PDT) X-Received: by 10.220.97.5 with SMTP id j5mr5283744vcn.16.1406893362634; Fri, 01 Aug 2014 04:42:42 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.221.37.5 with SMTP id tc5csp103793vcb; Fri, 1 Aug 2014 04:42:42 -0700 (PDT) X-Received: by 10.194.187.101 with SMTP id fr5mr7184113wjc.125.1406893361465; Fri, 01 Aug 2014 04:42:41 -0700 (PDT) Received: from theia.denx.de (theia.denx.de. [85.214.87.163]) by mx.google.com with ESMTP id na8si5117640wic.48.2014.08.01.04.42.32 for ; Fri, 01 Aug 2014 04:42:34 -0700 (PDT) Received-SPF: none (google.com: u-boot-bounces@lists.denx.de does not designate permitted sender hosts) client-ip=85.214.87.163; 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-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: 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 X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: christoffer.dall@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.180 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 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 */