From patchwork Fri Aug 9 15:03:09 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andre Przywara X-Patchwork-Id: 266077 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 7E3782C00A0 for ; Sat, 10 Aug 2013 01:05:21 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 6B4DE4A02E; Fri, 9 Aug 2013 17:05:10 +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 zd-703MaMFn6; Fri, 9 Aug 2013 17:05:10 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id A959F4A040; Fri, 9 Aug 2013 17:04:59 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 5E17C4A020 for ; Fri, 9 Aug 2013 17:04:53 +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 0CFd0bmjNfon for ; Fri, 9 Aug 2013 17:04:47 +0200 (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 2F6934A01F for ; Fri, 9 Aug 2013 17:04:40 +0200 (CEST) Received: by mail-ob0-f180.google.com with SMTP id up14so6411445obb.39 for ; Fri, 09 Aug 2013 08:04:39 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=F7ItiSbkXamMqXDtHPNFdNrV4UvPzOqoDR2xIBe/WKk=; b=mKrglJT2jgrPtjqjnrYstDUXIbmR+6LucHNMxQPhVfs1RWZyvGXjGRZ/SX7yscm4Ja Blhghv0eO5k1U9v1fLdG5X9W+jP+TkQpjFGYfN+cGSnmBaXYaxe2txM0/LLOykB5CUA3 Jd5xmlHRb8nO4GDLDziOshLnw/ApPbw+cnP5pqIrhKhY8KAYs/RoYOPqTA23PjhuzkfY XqigrizI1/1BZr5z38u46H8C7VasxJ/ChEQ0mED6WhO0qdSRF84EM+Obm7Y6ubrV/xgD vHsgna1TxKCb+ZKmaR38urCysWlYogHXcrbEHwjG2E/McqjR2FYv1cra20BfgkJxEAG9 nBIQ== X-Gm-Message-State: ALoCoQmdnUOsXGCuY5k/6FBIJk2rf833O3O8Tx6p5HmIDxrYL3MA6jjvl9t0xxHahWuNBUfpe2qf X-Received: by 10.182.220.199 with SMTP id py7mr215940obc.92.1376060679852; Fri, 09 Aug 2013 08:04:39 -0700 (PDT) Received: from slackpad.drs.calxeda.com (f053081188.adsl.alicedsl.de. [78.53.81.188]) by mx.google.com with ESMTPSA id hm1sm19249781obb.9.2013.08.09.08.04.36 for (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 09 Aug 2013 08:04:39 -0700 (PDT) From: Andre Przywara To: trini@ti.com, albert.u.boot@aribaud.net, christoffer.dall@linaro.org Date: Fri, 9 Aug 2013 17:03:09 +0200 Message-Id: <1376060592-10824-6-git-send-email-andre.przywara@linaro.org> X-Mailer: git-send-email 1.7.12.1 In-Reply-To: <1376060592-10824-1-git-send-email-andre.przywara@linaro.org> References: <1376060592-10824-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, nicknickolaev@gmail.com, kvmarm@lists.cs.columbia.edu Subject: [U-Boot] [PATCH v4 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(+) diff --git a/arch/arm/lib/bootm.c b/arch/arm/lib/bootm.c index 0325d08..6470eac 100644 --- a/arch/arm/lib/bootm.c +++ b/arch/arm/lib/bootm.c @@ -34,6 +34,10 @@ #include #include +#ifdef CONFIG_ARMV7_NONSEC +#include +#endif + DECLARE_GLOBAL_DATA_PTR; static struct tag *params; @@ -193,6 +197,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) { @@ -229,6 +241,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 */