From patchwork Thu Sep 19 16:06:43 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andre Przywara X-Patchwork-Id: 276001 X-Patchwork-Delegate: albert.aribaud@free.fr 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 454AE2C00E0 for ; Fri, 20 Sep 2013 02:14:17 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 122494A0B0; Thu, 19 Sep 2013 18:14: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 eIqFfHApho-o; Thu, 19 Sep 2013 18:14:15 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 49C714A0C6; Thu, 19 Sep 2013 18:14:10 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id E709F4A0E3 for ; Thu, 19 Sep 2013 18:14:02 +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 bRcMT6SsB4fJ for ; Thu, 19 Sep 2013 18:13:57 +0200 (CEST) X-Greylist: delayed 331 seconds by postgrey-1.27 at theia; Thu, 19 Sep 2013 18:13:46 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-ob0-f180.google.com (mail-ob0-f180.google.com [209.85.214.180]) by theia.denx.de (Postfix) with ESMTPS id 435EC4A0C6 for ; Thu, 19 Sep 2013 18:13:45 +0200 (CEST) Received: by mail-ob0-f180.google.com with SMTP id wm4so9674066obc.25 for ; Thu, 19 Sep 2013 09:13:44 -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:in-reply-to :references; bh=fF2ZtcUYNuP7vYRSqqHezjt8wcdYMCJqKOz9xPFsCC8=; b=atID4JhZlwIR004tekrecpqG5CLP21XM3PWav/DEdDVpIvWoHBYy0+RdbOg+GWrOdP 44cRJiU0XcZuraCvcSjoixUe/y1F3TSYmhA77uIxrm33WdxXnERFQECyn1XOZXqiNsp/ 9tprWMIw18+0uLLoQBBL1o5pyAW65qN3QkQICEM13E/CmWAwx1FKIA5r1SP+lJHlZ5Zk CfkdrZyQfPHcy1imJpGRZgU5YcDG+8eiqYPI22Ogu9so2Ev8JrvnrnyDXBvPYmFbjel7 rhKLEfcQfxDT1nsFhK/RzHDmKEzlpWoYuO1Su13is0ti201TRVrIbANLUTRcIP0zd2IG GguQ== X-Gm-Message-State: ALoCoQmS35bQJs77hdY6hIMR+7lmyUd3T/ukemf0+woq7ujUOTs290yQxm+eviTJ6PFQjOgI6vo5 X-Received: by 10.182.45.195 with SMTP id p3mr1768419obm.29.1379606917935; Thu, 19 Sep 2013 09:08:37 -0700 (PDT) Received: from slackpad.drs.calxeda.com (f053081156.adsl.alicedsl.de. [78.53.81.156]) by mx.google.com with ESMTPSA id s9sm4867327obu.4.1969.12.31.16.00.00 (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 19 Sep 2013 09:08:37 -0700 (PDT) From: Andre Przywara To: trini@ti.com, albert.u.boot@aribaud.net, christoffer.dall@linaro.org Date: Thu, 19 Sep 2013 18:06:43 +0200 Message-Id: <1379606806-439-6-git-send-email-andre.przywara@linaro.org> X-Mailer: git-send-email 1.7.12.1 In-Reply-To: <1379606806-439-1-git-send-email-andre.przywara@linaro.org> References: <1379606806-439-1-git-send-email-andre.przywara@linaro.org> Cc: peter.maydell@linaro.org, geoff.levand@linaro.org, patches@linaro.org, marc.zyngier@arm.com, agraf@suse.de, u-boot@lists.denx.de, Nikolay Nikolaev , kvmarm@lists.cs.columbia.edu Subject: [U-Boot] [PATCH v5 5/8] ARM: trigger non-secure state switch during bootm execution 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 To actually trigger the non-secure switch we just implemented, call the switching routine from within the bootm command implementation. This way we automatically enable this feature without further user intervention. Signed-off-by: Andre Przywara --- arch/arm/lib/bootm.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) Changes: v3..v4: (splitted of from former 4/7 patch) v4..v5: none diff --git a/arch/arm/lib/bootm.c b/arch/arm/lib/bootm.c index eefb456..b3a961a 100644 --- a/arch/arm/lib/bootm.c +++ b/arch/arm/lib/bootm.c @@ -22,6 +22,10 @@ #include #include +#ifdef CONFIG_ARMV7_NONSEC +#include +#endif + DECLARE_GLOBAL_DATA_PTR; static struct tag *params; @@ -181,6 +185,14 @@ static void setup_end_tag(bd_t *bd) __weak void setup_board_tags(struct tag **in_params) {} +static void do_nonsec_virt_switch(void) +{ +#if defined(CONFIG_ARMV7_NONSEC) || defined(CONFIG_ARMV7_VIRT) + if (armv7_switch_nonsec() == 0) + debug("entered non-secure state\n"); +#endif +} + /* Subcommand: PREP */ static void boot_prep_linux(bootm_headers_t *images) { @@ -217,6 +229,7 @@ static void boot_prep_linux(bootm_headers_t *images) printf("FDT and ATAGS support not compiled in - hanging\n"); hang(); } + do_nonsec_virt_switch(); } /* Subcommand: GO */