Message ID | 20200427105207.5659-47-rayagonda.kokatanur@broadcom.com |
---|---|
State | Superseded |
Delegated to: | Tom Rini |
Headers | show
Return-Path: <u-boot-bounces@lists.denx.de> X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=<UNKNOWN>) Authentication-Results: ozlabs.org; dmarc=pass (p=quarantine dis=none) header.from=broadcom.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=broadcom.com header.i=@broadcom.com header.a=rsa-sha256 header.s=google header.b=QPYtIyl8; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 499kb708qsz9sSK for <incoming@patchwork.ozlabs.org>; Mon, 27 Apr 2020 22:28:34 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 440A881E86; Mon, 27 Apr 2020 14:22:46 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=broadcom.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=broadcom.com header.i=@broadcom.com header.b="QPYtIyl8"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 9862081E1A; Mon, 27 Apr 2020 13:05:42 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-pg1-x543.google.com (mail-pg1-x543.google.com [IPv6:2607:f8b0:4864:20::543]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 0E6C281E0A for <u-boot@lists.denx.de>; Mon, 27 Apr 2020 13:05:38 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=broadcom.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=rayagonda.kokatanur@broadcom.com Received: by mail-pg1-x543.google.com with SMTP id n16so8528345pgb.7 for <u-boot@lists.denx.de>; Mon, 27 Apr 2020 04:05:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=zVoQFyIrxGpipzVhNvvWwJfu1WQ4uLPO8USTcr7UxOQ=; b=QPYtIyl8Rg5xFLSHW2E+necjInsyuZxVZriIh2H4QSNCEDSnPyM59k7811aTPXufQp GPYRLUc6dse1lYyi2w12tfWXW8uryLDb02XdZs38b4Q64XCswEx2eWrzZwoh9gthrhge E9CXfhP+Jtsm/R7mEmjnyCJ/IngtwGSU+D4FY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=zVoQFyIrxGpipzVhNvvWwJfu1WQ4uLPO8USTcr7UxOQ=; b=IVuGWX6bQ7mA36qFyTyyJHQ7/5El84EcbPSlNGaNkBxCm0aYhUCp4r67lGYdODUkPC dqvPlYFkfXKoFsoejggOaS1LWS9HqEalfd9GNSCXLJdB0NmH1x0IPwjphu2UROms3NdJ l1ygRn7znWqy2GGVa2gikD6AYaDCv4f9Z+hA9iaUA+erQU6wUI0l9CUP/mIZ2d0kaRNz BTLhvKm7CA4iMpDcd4kj9m8SpVZ/QAF9OwJ9FafuNCb0YauYx+cZO1IuIUx/GrOXPK28 rHYQzSp/JQyLYJQMYvrpOZEDAbEajuHfTfLDp0JvUBH1CB8Io+G4XG1ilT8Oc5KqgOeM kKeA== X-Gm-Message-State: AGi0PuYFa1ZBYAlzBtOCSaA+ymGU+R39Xv0ZclAyQUbGZllSnrLoukLm XYoGgDmTyUVJ8AhSzyQhehpbrD2kqJyolYJgzxiYbZh2dR8ghzmCjkzA7MCOZSjna092wK2iGkQ WAeG38QacjHvVrNEJNtcwE2gNYSHbU3dXAqU6NQW/LQoLvZ3oS+0Z8aaCAyDkYBnnmG5UttPhVY aMLCLDbiA8 X-Google-Smtp-Source: APiQypIYmy1cUvMJJxi1MP6am7Aq9CmIRx7U+T18MrbD6V1MAKiTFHDLe+H4vTJTpN4Z2JTwTyOKkQ== X-Received: by 2002:a63:ba09:: with SMTP id k9mr23474714pgf.305.1587985535534; Mon, 27 Apr 2020 04:05:35 -0700 (PDT) Received: from rayagonda.dhcp.broadcom.net ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id u3sm11996430pfn.217.2020.04.27.04.05.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Apr 2020 04:05:34 -0700 (PDT) From: Rayagonda Kokatanur <rayagonda.kokatanur@broadcom.com> To: u-boot@lists.denx.de, Simon Glass <sjg@chromium.org>, Kever Yang <kever.yang@rock-chips.com>, Michal Simek <michal.simek@xilinx.com>, Jagan Teki <jagan@amarulasolutions.com>, Marek Vasut <marex@denx.de>, Fabio Estevam <festevam@gmail.com>, Baruch Siach <baruch@tkos.co.il>, Troy Kisky <troy.kisky@boundarydevices.com>, Josip Kelecic <josip.kelecic@sartura.hr>, Priyanka Jain <priyanka.jain@nxp.com>, Biwen Li <biwen.li@nxp.com>, Jason Li <jason.li@cortina-access.com>, Philippe Reynes <philippe.reynes@softathome.com>, Eddie James <eajames@linux.ibm.com>, Heinrich Schuchardt <xypron.glpk@gmx.de>, Sam Protsenko <joe.skb7@gmail.com>, Lukasz Majewski <lukma@denx.de>, Miquel Raynal <miquel.raynal@bootlin.com>, Ramon Fried <rfried.dev@gmail.com>, Anup Patel <Anup.Patel@wdc.com>, AKASHI Takahiro <takahiro.akashi@linaro.org>, Patrice Chotard <patrice.chotard@st.com>, Eugeniu Rosca <roscaeugeniu@gmail.com>, Joe Hershberger <joe.hershberger@ni.com>, Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>, Boris Brezillon <bbrezillon@kernel.org>, Simon South <simon@simonsouth.net>, Andy Shevchenko <andriy.shevchenko@linux.intel.com>, Marek Bykowski <marek.bykowski@gmail.com>, Lokesh Vutla <lokeshvutla@ti.com>, Patrick Delaunay <patrick.delaunay@st.com>, Rajesh Ravi <rajesh.ravi@broadcom.com>, Abhishek Shah <abhishek.shah@broadcom.com>, Vladimir Olovyannikov <vladimir.olovyannikov@broadcom.com>, Bharat Kumar Reddy Gooty <bharat.gooty@broadcom.com>, Srinath Mannam <srinath.mannam@broadcom.com>, Pramod Kumar <pramod.kumar_1@nxp.com>, Ray Jui <ray.jui@broadcom.com>, Vikas Gupta <vikas.gupta@broadcom.com>, Trac Hoang <trac.hoang@broadcom.com>, Corneliu Doban <cdoban@broadcom.com>, Sheetal Tigadoli <sheetal.tigadoli@broadcom.com> Cc: Rayagonda Kokatanur <rayagonda.kokatanur@broadcom.com> Subject: [PATCH v1 46/49] cmd: bcm: add nitro boot command Date: Mon, 27 Apr 2020 16:22:04 +0530 Message-Id: <20200427105207.5659-47-rayagonda.kokatanur@broadcom.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200427105207.5659-1-rayagonda.kokatanur@broadcom.com> References: <20200427105207.5659-1-rayagonda.kokatanur@broadcom.com> X-Mailman-Approved-At: Mon, 27 Apr 2020 14:18:25 +0200 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.30rc1 Precedence: list List-Id: U-Boot discussion <u-boot.lists.denx.de> List-Unsubscribe: <https://lists.denx.de/options/u-boot>, <mailto:u-boot-request@lists.denx.de?subject=unsubscribe> List-Archive: <https://lists.denx.de/pipermail/u-boot/> List-Post: <mailto:u-boot@lists.denx.de> List-Help: <mailto:u-boot-request@lists.denx.de?subject=help> List-Subscribe: <https://lists.denx.de/listinfo/u-boot>, <mailto:u-boot-request@lists.denx.de?subject=subscribe> Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" <u-boot-bounces@lists.denx.de> X-Virus-Scanned: clamav-milter 0.102.2 at phobos.denx.de X-Virus-Status: Clean |
Series |
add support for broadcom NS3 soc
|
expand
|
diff --git a/cmd/bcm/Makefile b/cmd/bcm/Makefile index 96dc8f7ad7..dc274f6b96 100644 --- a/cmd/bcm/Makefile +++ b/cmd/bcm/Makefile @@ -2,3 +2,4 @@ # Copyright 2020 Broadcom obj-$(CONFIG_CMD_BCM_LOGSETUP) += logsetup.o +obj-y += chimp_boot.o diff --git a/cmd/bcm/chimp_boot.c b/cmd/bcm/chimp_boot.c new file mode 100644 index 0000000000..dcab9a5bcb --- /dev/null +++ b/cmd/bcm/chimp_boot.c @@ -0,0 +1,36 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Copyright 2020 Broadcom + */ + +#include <command.h> +#include <common.h> +#include <brcm/chimp.h> + +static int do_chimp_fastboot_secure(cmd_tbl_t *cmdtp, int flag, int argc, + char *const argv[]) +{ + u32 health = 0; + + if (chimp_health_status_optee(&health) != BCM_CHIMP_SUCCESS) { + pr_err("Chimp health command fail\n"); + return CMD_RET_FAILURE; + } + + if (health == BCM_CHIMP_RUNNIG_GOOD) { + printf("skip fastboot...\n"); + return CMD_RET_SUCCESS; + } + + if (chimp_fastboot_optee() != BCM_CHIMP_SUCCESS) { + pr_err("Failed to load secure ChiMP image\n"); + return CMD_RET_FAILURE; + } + return CMD_RET_SUCCESS; +} + +U_BOOT_CMD + (chimp_ld_secure, 1, 0, do_chimp_fastboot_secure, + "Invoke chimp fw load via optee", + "chimp_ld_secure\n" +); diff --git a/include/brcm/chimp.h b/include/brcm/chimp.h index c3d4594c4b..9099a70ef5 100644 --- a/include/brcm/chimp.h +++ b/include/brcm/chimp.h @@ -13,6 +13,8 @@ #define BCM_CHIMP_SUCCESS 0 #define BCM_CHIMP_FAILURE (!BCM_CHIMP_SUCCESS) +#define BCM_CHIMP_RUNNIG_GOOD 0x8000 + #ifdef CONFIG_CHIMP_OPTEE int chimp_fastboot_optee(void); int chimp_health_status_optee(u32 *status);