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: 125887 Delivered-To: patch@linaro.org Received: by 10.46.89.16 with SMTP id n16csp40111ljb; Thu, 25 Jan 2018 18:11:10 -0800 (PST) X-Google-Smtp-Source: AH8x225l0lZ5/+kXlenO3kkgg0InSAQ4hFXT8GTLUfMSlV9mfK6CPwot3WM0RweMxDcBiyi13sTd X-Received: by 10.80.182.203 with SMTP id f11mr31792781ede.157.1516932670725; Thu, 25 Jan 2018 18:11:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516932670; cv=none; d=google.com; s=arc-20160816; b=bPBiwNSCrKbyW+SAXSt9+WUvqAVBs8grNWVJfY+cvTRcUl4Dhwfn2VjGGGUnMxddH6 x59IYVt2O5WH8+Iq+9lJ51r4OKxcI84+RaK2dge1lI1gCj5yXjHcz3wIrxBAGv4b3y56 Yp9mfBRbK7jpFv8hZ7KLqNszrhsDL5OrSG2Nj9T0fvfoxYpObO6inHsVvYqDzIuhS7rM V92c96INvOgladTbzClqqlxmk4xBD7S+K4rTYiPuanGnsLVu6W8yRrBBqIjP2ID0cZ2j h58bZGolqKMZm8kGHo4zRC/WDlmDk7o/Z7dyfyKAiig45hPbQ2QcyGlSwZ2O1G2de2gJ mmDQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:cc:references:in-reply-to:message-id :date:to:from:dkim-signature:arc-authentication-results; bh=3eLRq2mg8jJsQy01ZJ8r7VH6I1+dG63V9TtZ+upiCf8=; b=S4yDQ6xgOtq02AVuzOi1J1dl+djmmfXUCfxeAKwmexWGb1AkwI/EJ2K0vEEG59Kovp nlyuyS+byCnX9C31fp3vKKarYsbmzMbZFbEfNIpxbnMglRTBLxzyNOh8kuRm30U4Ebpz 6vpfwhKzLxc9ZdkWBd7qpzLoqMAC+LcXnmvEuvPl8UhUL0MxI1zYBS1+L0tjsExqmjD3 zr4/YLfRF3KYg9ERhyMOhqpkpq5ZVP5cOzGzS2kZvSto6RCXNm69/F4WylUVErBJIfKb hwQ+4y5+IIoTOAYK9VF43hbo00I+9OMY5mZ4duSXh9emKNgBjfzuFtUDQI+DZ81SpnQx etlA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=e0SCd5I5; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.denx.de (dione.denx.de. [81.169.180.215]) by mx.google.com with ESMTP id c92si2416993edd.246.2018.01.25.18.11.10; Thu, 25 Jan 2018 18:11:10 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) client-ip=81.169.180.215; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=e0SCd5I5; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: by lists.denx.de (Postfix, from userid 105) id 4EBE2C22397; 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-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 */