From patchwork Fri Jan 26 02:09:38 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bryan O'Donoghue X-Patchwork-Id: 866119 X-Patchwork-Delegate: sbabic@denx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="e0SCd5I5"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 3zSMnt4J39z9sPk for ; Fri, 26 Jan 2018 13:10:58 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id 07187C223C5; Fri, 26 Jan 2018 02:10:23 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 102D6C2236A; Fri, 26 Jan 2018 02:09:52 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 6DA14C22022; Fri, 26 Jan 2018 02:09:41 +0000 (UTC) Received: from mail-wm0-f65.google.com (mail-wm0-f65.google.com [74.125.82.65]) by lists.denx.de (Postfix) with ESMTPS id AEE74C2238A for ; Fri, 26 Jan 2018 02:09:41 +0000 (UTC) Received: by mail-wm0-f65.google.com with SMTP id f71so18177244wmf.0 for ; Thu, 25 Jan 2018 18:09:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=B/Zqa5lgzBct4kH+K5aIDEn8JAK0hEBymM3BNPNEuAc=; b=e0SCd5I5jlnJfnjB21h81cfGYAn8zvyLEU57UGw0K1uvpiTowJEMUVvVysuYLa6PSw P/NTPAzyy225iBiT6eUbtAN+Hd24EKl974zpM2WIwTOb1PlU8bXy4mVmAVOwSF1cdNvs OCE5xn9pJci/vMa7Wo+BSHRJoltqvK+xdk+4U= 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=B/Zqa5lgzBct4kH+K5aIDEn8JAK0hEBymM3BNPNEuAc=; b=bL2zpg37yhiaivhspuDBFMkNfNNyRHzpGo+au1ZkpaEnN9sqzsO1b14yQbh+i/nIno /r6G18yHenbC8A9KfkJfcZJzGL7OGkO/2RQKBAgbPFOKTq1bNnRYsI7CBAcIfHnyFnbt DJlGX6mIv6FtxyKtF1KmZ4B1J2to7JLNpL7JJgSjDIHVz9KEqmpdhKOINFh9nuuKeYGx o5gegwgRrUBoTtkYW12RLSdCzwbdM9k56ZVh6HvKEX28tr6moXuOR93Jdl7a12SVx/gX t23Gjfb4KW2mMeGjfBRUVmVSALMdMvoz+RnPBLlCedASFDGm/TiRjedYFYRnSl9LADnD LwaA== X-Gm-Message-State: AKwxytc/iJv/JQPTUjZLqfJn3dIHJQbbf+U3C3ZLHU7kqNEaovrHsPH9 LvHB+hsNoLc3tJyFWmL0T2x/hmEy4mk= X-Google-Smtp-Source: AH8x227XZ10qY8bs9i18yJlwC4CLW/KgY0mitZlpt+JXCkKpqh6l7cwUBZ2R50HMTOYY7mCM8ggsDw== X-Received: by 10.80.245.10 with SMTP id t10mr31399529edm.168.1516932581217; Thu, 25 Jan 2018 18:09:41 -0800 (PST) Received: from localhost.localdomain ([109.255.42.2]) by smtp.gmail.com with ESMTPSA id w41sm1935792edd.32.2018.01.25.18.09.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 25 Jan 2018 18:09:40 -0800 (PST) From: Bryan O'Donoghue To: u-boot@lists.denx.de, trini@konsulko.com Date: Fri, 26 Jan 2018 02:09:38 +0000 Message-Id: <1516932578-19992-3-git-send-email-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1516932578-19992-1-git-send-email-bryan.odonoghue@linaro.org> References: <1516932578-19992-1-git-send-email-bryan.odonoghue@linaro.org> Cc: Vanessa Maegima , fabio.estevam@nxp.com, Marco Franchi Subject: [U-Boot] [PATCH v2 2/2] warp7 : run sec_init for CAAM RNG X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" This patch adds a sec_init call into board_init. Doing so in conjunction with the patch "drivers/crypto/fsl: assign job-rings to non-TrustZone" enables use of the CAAM in Linux when OPTEE/TrustZone is active. u-boot will initialise the RNG and assign ownership of the job-ring registers to a non-TrustZone context. Linux then simply has to detect or be told to skip RNG initialisation. This change is safe both for the OPTEE/TrustZone boot path and the regular non-OPTEE/TrustZone boot path. Signed-off-by: Bryan O'Donoghue Cc: Fabio Estevam Cc: Peng Fan Cc: Marco Franchi Cc: Vanessa Maegima Cc: Stefano Babic --- board/warp7/warp7.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/board/warp7/warp7.c b/board/warp7/warp7.c index 337e76b..219ab6f 100644 --- a/board/warp7/warp7.c +++ b/board/warp7/warp7.c @@ -16,6 +16,7 @@ #include #include #include +#include #include #include #include @@ -225,6 +226,10 @@ int board_init(void) setup_i2c(0, CONFIG_SYS_I2C_SPEED, 0x7f, &i2c_pad_info1); #endif + #ifdef CONFIG_FSL_CAAM + sec_init(); + #endif + return 0; } @@ -366,5 +371,4 @@ int g_dnl_bind_fixup(struct usb_device_descriptor *dev, const char *name) return 0; } - #endif /* ifdef CONFIG_USB_GADGET */