From patchwork Tue Jan 23 21:10:53 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: 865045 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="crU6Y6pw"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 3zR1GP25nRz9s7F for ; Wed, 24 Jan 2018 08:12:28 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id 82CBCC2217A; Tue, 23 Jan 2018 21:11:38 +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 AA94DC21F0A; Tue, 23 Jan 2018 21:11:07 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 2160DC22174; Tue, 23 Jan 2018 21:11:03 +0000 (UTC) Received: from mail-wm0-f68.google.com (mail-wm0-f68.google.com [74.125.82.68]) by lists.denx.de (Postfix) with ESMTPS id 74D45C21EE5 for ; Tue, 23 Jan 2018 21:10:58 +0000 (UTC) Received: by mail-wm0-f68.google.com with SMTP id 141so4558409wme.3 for ; Tue, 23 Jan 2018 13:10:58 -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=crU6Y6pwH88EzoXyPivU6HsdAYgp2a+flelUItddcByzSiG0boh16jSwpO1kHymw9x 8L2x4FA117vGdacuM1GhNqUZTVQIKbn3jOxxoF7jyW282SK4AwlFej8Yml3Yhhs7Jlh/ WraVJKotJlRCrObWxc38ODZIL43Hl11E+sPTc= 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=LnPmjjS1mWnDx9a7jATxuBVFhK158kjhM0ZDfQ+a2PC5VQFrvF11nBABEZc4hhozYs 21nlxZ7XmmdKxVkgsUDj34YKA5HGA9C9mDqgbm/YH2qMfzXFF9mZzdNC9/DH2K5Fxtth aZBCiWFhkpbWKBINq7Cyk55khplBLvAtoLWGC0D6z/0ScQZSOGGVbOyJ4V1o8sJEeGRb zqFHWssG/QpX0lwu4nyrkrsfdvUW3vD5Go603DNGdIMzJXBvlVooc+ZxcDgLCZV1LTFa 01MB4OTgF9olKewYyNw6Y1vzyj/smGrhGuaz9IrgSesrK8iisxhA5k/tky/wXpvp7BoF tLyw== X-Gm-Message-State: AKwxyte/YyoiTctuSl4OFosO/xr58beL5GibS+9cg10/D8NZG+wJjZvl C9vYx5u0uOtv8SfbqygJt4U/+GAPL/8= X-Google-Smtp-Source: AH8x226vU6tGBt0WnKhIGSZaL5yHfaedA2rcpVgUJwrUfYid1qXkQj21WMhJ1eAs21tEhW6C94a7bw== X-Received: by 10.80.163.136 with SMTP id s8mr20369686edb.162.1516741857908; Tue, 23 Jan 2018 13:10:57 -0800 (PST) Received: from localhost.localdomain ([109.255.42.2]) by smtp.gmail.com with ESMTPSA id x25sm13860657eda.8.2018.01.23.13.10.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 23 Jan 2018 13:10:57 -0800 (PST) From: Bryan O'Donoghue To: u-boot@lists.denx.de, trini@konsulko.com Date: Tue, 23 Jan 2018 21:10:53 +0000 Message-Id: <1516741853-12458-3-git-send-email-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1516741853-12458-1-git-send-email-bryan.odonoghue@linaro.org> References: <1516741853-12458-1-git-send-email-bryan.odonoghue@linaro.org> Cc: Vanessa Maegima , fabio.estevam@nxp.com, Marco Franchi Subject: [U-Boot] [PATCH 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 */