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: 20457 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ob0-f199.google.com (mail-ob0-f199.google.com [209.85.214.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id AB88023906 for ; Thu, 19 Sep 2013 16:08:39 +0000 (UTC) Received: by mail-ob0-f199.google.com with SMTP id vb8sf37994815obc.6 for ; Thu, 19 Sep 2013 09:08:39 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version: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=fF2ZtcUYNuP7vYRSqqHezjt8wcdYMCJqKOz9xPFsCC8=; b=biSTSJAjRXozpmm//63fEinb0SeaYi/FWnUWsKQDW101pny4i7CUGkBpmG4ozjVWxD khunF/SMyLlKq0obKRFs/1ZwfPEGilFsVGPJX8gtiBjoaZs1FL0y/7LOPume1P7E9RWD bVJJLAx7tRQEExhUnzF8XvA3xFMVHMFkMcY1C1aHSm4GDedl8dAOWZ2WBAFILwosvMlm 63cZ3WaiNY741KjjSABsPCmpkKh4wiAK90Nj9fbEJCCeWJyV+bymCeN29YmHRDLBvOpY K8vaERHzaTS2ScfrkjbkN2ngpzE830hDMThFyDX2e2QhLY6Uoqi7xVjOI2OBwLoV6J/G MN9g== X-Gm-Message-State: ALoCoQlUkErC/oIJwCLd84w1JndTuo/8nOW1ha5HAAxzXz3vKOliTQrubNAnwvcHHWVBfXF/hu6z X-Received: by 10.182.165.8 with SMTP id yu8mr444459obb.31.1379606919191; Thu, 19 Sep 2013 09:08:39 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.4.70 with SMTP id i6ls3878768qei.26.gmail; Thu, 19 Sep 2013 09:08:39 -0700 (PDT) X-Received: by 10.52.34.40 with SMTP id w8mr1562220vdi.7.1379606919090; Thu, 19 Sep 2013 09:08:39 -0700 (PDT) Received: from mail-ve0-f173.google.com (mail-ve0-f173.google.com [209.85.128.173]) by mx.google.com with ESMTPS id wh9si1980923vcb.18.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 19 Sep 2013 09:08:39 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.128.173 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.173; Received: by mail-ve0-f173.google.com with SMTP id cz12so7109763veb.32 for ; Thu, 19 Sep 2013 09:08:39 -0700 (PDT) X-Received: by 10.58.75.131 with SMTP id c3mr1893846vew.12.1379606919008; Thu, 19 Sep 2013 09:08:39 -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 u4csp286298vcz; Thu, 19 Sep 2013 09:08:38 -0700 (PDT) X-Received: by 10.182.225.162 with SMTP id rl2mr22365obc.72.1379606918427; Thu, 19 Sep 2013 09:08:38 -0700 (PDT) Received: from mail-ob0-f179.google.com (mail-ob0-f179.google.com [209.85.214.179]) by mx.google.com with ESMTPS id pu10si3578674obb.113.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 19 Sep 2013 09:08:38 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.214.179 is neither permitted nor denied by best guess record for domain of andre.przywara@linaro.org) client-ip=209.85.214.179; Received: by mail-ob0-f179.google.com with SMTP id wn1so10225731obc.10 for ; Thu, 19 Sep 2013 09:08:38 -0700 (PDT) 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 Cc: u-boot@lists.denx.de, marc.zyngier@arm.com, peter.maydell@linaro.org, agraf@suse.de, geoff.levand@linaro.org, kvmarm@lists.cs.columbia.edu, Masahiro Yamada , Nikolay Nikolaev , patches@linaro.org, Andre Przywara Subject: [PATCH v5 5/8] ARM: trigger non-secure state switch during bootm execution 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> 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.128.173 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(+) 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 */