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: 18923 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qa0-f70.google.com (mail-qa0-f70.google.com [209.85.216.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 1B4062391D for ; Fri, 9 Aug 2013 15:04:41 +0000 (UTC) Received: by mail-qa0-f70.google.com with SMTP id cd7sf2340711qab.5 for ; Fri, 09 Aug 2013 08:04:40 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:x-gm-message-state:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=F7ItiSbkXamMqXDtHPNFdNrV4UvPzOqoDR2xIBe/WKk=; b=XxeeMSChKAOzuk/zBattWiBoywkPMTsvvXlGvo1tThvWOouvKTlTt6bv4ilWvxCLUk 31pkvEkqd2V5oBaeEwbDORrBF0l3E+Hz4JXAYRfk7yVLd3CLHT7Z5oCr8bBifWWeK5V4 J1ZAoqLCwjYbC9BNJUpHBSY+z5A2Mf82zFiWZudCv/Fq+Y66NvdR7kzS7ajUDWn09jxk e2nvM15SRwbRITfWrCfo8FadHVF4yhv+DWvKWUbm0HOWGBIiIcYQRVrDwS4yI7L1VqfC MrrXMte+DfqfkTTZ84F80WOCd1HRqAEXjya35EOU1q9oHpbbBSEWe4mRlCZ80ucbAEeR HUvw== X-Received: by 10.59.6.99 with SMTP id ct3mr1179625ved.12.1376060680881; Fri, 09 Aug 2013 08:04:40 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.62.99 with SMTP id x3ls1473366qer.56.gmail; Fri, 09 Aug 2013 08:04:40 -0700 (PDT) X-Received: by 10.220.169.146 with SMTP id z18mr669063vcy.80.1376060680778; Fri, 09 Aug 2013 08:04:40 -0700 (PDT) Received: from mail-vb0-f41.google.com (mail-vb0-f41.google.com [209.85.212.41]) by mx.google.com with ESMTPS id n6si4730507ven.117.2013.08.09.08.04.40 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 09 Aug 2013 08:04:40 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.212.41 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.212.41; Received: by mail-vb0-f41.google.com with SMTP id g17so4185813vbg.28 for ; Fri, 09 Aug 2013 08:04:40 -0700 (PDT) X-Gm-Message-State: ALoCoQmMoo5T+sRh8O6o9nNXz2o8GmmCMN5KceNUGV2toPnsTHmSMmRvUq3GJO8QDnXzqbHpaHdT X-Received: by 10.52.243.201 with SMTP id xa9mr534314vdc.106.1376060680651; Fri, 09 Aug 2013 08:04:40 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.174.196 with SMTP id u4csp78359vcz; Fri, 9 Aug 2013 08:04:40 -0700 (PDT) X-Received: by 10.182.76.38 with SMTP id h6mr672341obw.74.1376060680096; Fri, 09 Aug 2013 08:04:40 -0700 (PDT) Received: from mail-oa0-f52.google.com (mail-oa0-f52.google.com [209.85.219.52]) by mx.google.com with ESMTPS id f9si2242996obv.153.2013.08.09.08.04.39 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 09 Aug 2013 08:04:40 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.219.52 is neither permitted nor denied by best guess record for domain of andre.przywara@linaro.org) client-ip=209.85.219.52; Received: by mail-oa0-f52.google.com with SMTP id n12so6889975oag.39 for ; Fri, 09 Aug 2013 08:04:39 -0700 (PDT) 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 Cc: u-boot@lists.denx.de, marc.zyngier@arm.com, peter.maydell@linaro.org, geoff.levand@linaro.org, agraf@suse.de, kvmarm@lists.cs.columbia.edu, yamada.m@jp.panasonic.com, nicknickolaev@gmail.com, patches@linaro.org, Andre Przywara Subject: [PATCH v4 5/8] ARM: trigger non-secure state switch during bootm execution 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> X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: andre.przywara@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.212.41 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , 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 */