From patchwork Tue Jul 16 03:17:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Protsenko X-Patchwork-Id: 812761 Delivered-To: patch@linaro.org Received: by 2002:a5d:42c4:0:b0:367:895a:4699 with SMTP id t4csp113687wrr; Mon, 15 Jul 2024 20:17:17 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUow0tTWBxr9qwGkxw7CyZVan2AsMspzyEC/dIiM0wvw7IlG8GbMGyRTqeIqNLFcoOkXeCdARaeYl2aFERQXYae X-Google-Smtp-Source: AGHT+IHsGD2qUvIFCW/tXQFuyxYkgA4bk84+CXOpmzRFSmh38UtVHuhibhBzViRYsyQH2TFNa5v6 X-Received: by 2002:a05:6402:3553:b0:57d:46f4:7df5 with SMTP id 4fb4d7f45d1cf-59eef775ca8mr486871a12.23.1721099836960; Mon, 15 Jul 2024 20:17:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1721099836; cv=none; d=google.com; s=arc-20160816; b=PFheLb6JCOKVTaOHDYA9jYcxqWpjSyA8fuudJ68V74Zqvhore/UmGvCLgPKttyhCH5 +i+NCbVQp3215M25LhMnVdp64oWuCogbyu4+PDV7+I42lTRHSiK2hYpDEaYF7goH+0Pi cEY8syEeMROTsP//3Edl3ah4cb7WXtcAWFkGUuqwCfNbnk8CfotR+IvsYRHaoyWSSlJj 8o6wSwrN9vc1rXoS4JNjyRCtggCsWQwwqlqUlOLB5ofuP99OSgmk24ujwm8BK0iulpnt YeZ69gB4sHprGylfI438Gxz7koJna2HhJKIbi+d1/+nsMb3+Q/I9IGZ2S38pWckXZ8kj ck4g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:cc:to:from:dkim-signature; bh=FIv15UTZn8DHWxa/3B+r7OrQpE6qZ9Tw3X9RDgCc4ow=; fh=+8JO9nje21fIUETyEVKrqH9kOCMXsuWsuSdbrJcq/kk=; b=v4hgvxrwnGgTh0cv0MDzuCR1U3o5XIbgLNiJoGlRu1asThsyhYEOzVxM2t/8rFB0wu WoZqPQpQ24oIe1h4SyWZYq88YdQtKrVZilAcwsCOntZWBp4edriIVBl0y9dHYoT1hSGY 68H/iYiU7VWoa/9ZyZ7UbazvDeUcrHBvh1DK+mXv285zBoddPg8RoJphZ8XDrL0igeuS pLATM/NcRARj4OJjFHc78LNVSyP5eDrgZ/rMEqD2jlWiejvABLAwOejlJgHOvSObBT1K VVhOeup1m62EBaBziMzlCpOuVVWVnXep9B2KYkaeqhHI9YTeXQWHGyJFPxM/o5gCKcLV cXjw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=t+7AIIpE; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [85.214.62.61]) by mx.google.com with ESMTPS id 4fb4d7f45d1cf-59b27b01109si3078766a12.680.2024.07.15.20.17.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Jul 2024 20:17:16 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) client-ip=85.214.62.61; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=t+7AIIpE; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 8439E88967; Tue, 16 Jul 2024 05:17:15 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="t+7AIIpE"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 84A6387E15; Tue, 16 Jul 2024 05:17:14 +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.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.2 Received: from mail-oa1-x2c.google.com (mail-oa1-x2c.google.com [IPv6:2001:4860:4864:20::2c]) (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 E6A5587919 for ; Tue, 16 Jul 2024 05:17:11 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=semen.protsenko@linaro.org Received: by mail-oa1-x2c.google.com with SMTP id 586e51a60fabf-25e3b8637c9so2057537fac.3 for ; Mon, 15 Jul 2024 20:17:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1721099830; x=1721704630; darn=lists.denx.de; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=FIv15UTZn8DHWxa/3B+r7OrQpE6qZ9Tw3X9RDgCc4ow=; b=t+7AIIpErLoZSeNA1Hxy4VWgRakCiVC9vyCbWvsVu3wG8WmzEFiWhjOhZNK0gIOZbA EOCIh2ni3THmUG+O8f+i3KP2KVn2MjHhJ3+W0as5a1xtnFpzq3VoHtXhRVIDzqzDXPgZ kFHC4mgdOMZFBI0J3LLR9qy/yRITZHQF2dE1qTdQZDCWTciJqhwhnWjBEzF9hOQk/wGa C4Ljh1EWKLZDUarpu1YOHShZVTFTXtlP+W6aVVYwQKqJ86h+s+fKAyawTk9nOwotj/bN C9c2FJHhfKl5JNAR8RodSPMVvgWE39xmuyzpEAc9q+0SXXcXvmVMxHcLPNgHB/mUaRJk opcw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721099830; x=1721704630; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=FIv15UTZn8DHWxa/3B+r7OrQpE6qZ9Tw3X9RDgCc4ow=; b=hbgTF3zVdUopvMLb8TNLQMMo6RnmJk4rt3fyjFlqwMjBhKRegLMfqxmFBtIu3lA/xp YZF07MNfA46qDU8dnCK6aDSIkqNfCcw24Xp+YQaYYfk2Dt+BuQvNEfZTM2iS80Kstvoc 62ZuPPtd8pQINoMei8TlNBYkz7jTVDP/SyogYIM8TTj1fLWHiwKLrTwy9uieGuTwlUGw ueeFK2ORir2fwyWEW+eepSpnecPcvFehzC2ZoYJMC95pV7fnbkaWwudOArH/MGv2UvL2 bAWGMQhO3X3ojMH1mfGYTJKXSdmI+NsloipNdUd2HWIKC1diUBxW72aICU+gvDJj/UoM nhwg== X-Forwarded-Encrypted: i=1; AJvYcCUX9O60Ide1nrIaEvvdBda6mkHUc+A7U0W+BVGPxfR24bYjhAxkais6UqFWsNybmmKMnfQjpOICy/oVxsgVcYDUgkjv1A== X-Gm-Message-State: AOJu0Yz0X+gZLXMkHlLnlH6Wg8ymnmUrxGTY6/yO1SLAMe8g2iDg9RbU tpHuwQuHNROW1aTDhWpQBSP0VCjWlChL80kXV+22cVQ2d3Is3xq6E+Rf8eEQ+B4= X-Received: by 2002:a05:6870:968b:b0:260:3ae9:c94 with SMTP id 586e51a60fabf-260bdfefaa4mr620459fac.51.1721099830341; Mon, 15 Jul 2024 20:17:10 -0700 (PDT) Received: from localhost ([136.62.192.75]) by smtp.gmail.com with ESMTPSA id 586e51a60fabf-26075176419sm1215496fac.31.2024.07.15.20.17.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Jul 2024 20:17:10 -0700 (PDT) From: Sam Protsenko To: Tom Rini , Minkyu Kang Cc: Simon Glass , Lukasz Majewski , Sean Anderson , Anand Moon , Sughosh Ganu , Heinrich Schuchardt , Sumit Garg , u-boot@lists.denx.de Subject: [PATCH v2 0/5] arm: exynos: Enable TRNG for E850-96 board Date: Mon, 15 Jul 2024 22:17:04 -0500 Message-Id: <20240716031709.24943-1-semen.protsenko@linaro.org> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean This series enables True Random Number Generator (TRNG) for E850-96 board. Here is a short breakdown of features implemented in this series: 1. Load LDFW (Loadable Firmware) on E850-96 board. It's needed to make TRNG SMC commands functional. To do so, add the default eMMC partition table and implement reading and applying LDFW in board_init(). 2. Add Exynos TRNG driver 3. Enable Exynos TRNG driver on E850-96 board. It requires SSS clocks to be enabled, so add those clocks as well. With this series it's possible to generate random numbers in U-Boot (e.g. using 'rng' command). The main reason for RNG enablement on E850-96 board -- it's needed for EFI_RNG_PROTOCOL and kaslr, so it's one of the requirements to enable EFI boot support on E850-96 board, which in turn is needed (among other things) for EBBR spec and SystemReady IR certification. With this series it's also possible to use TRNG in Linux kernel (which was recently added, see [1] for details), as Linux kernel Exynos TRNG driver also relies on LDFW firmware to be loaded in the bootloader. Changes in v2: - Addressed comments for [PATCH 4/5] rng: Add Exynos TRNG driver [1] https://lore.kernel.org/all/20240618003743.2975-1-semen.protsenko@linaro.org/T/#me6ba1762a254ca438a9715f011d32820babfe2d8 Sam Protsenko (5): board: samsung: e850-96: Add default partitions board: samsung: e850-96: Load LDFW firmware on board init clk: exynos: Add SSS clocks for Exynos850 rng: Add Exynos TRNG driver arm: exynos: Enable TRNG on E850-96 board arch/arm/dts/exynos850-e850-96-u-boot.dtsi | 11 + arch/arm/mach-exynos/Kconfig | 2 + board/samsung/e850-96/Makefile | 4 +- board/samsung/e850-96/e850-96.c | 6 +- board/samsung/e850-96/e850-96.env | 26 ++ board/samsung/e850-96/fw.c | 131 ++++++++++ board/samsung/e850-96/fw.h | 12 + configs/e850-96_defconfig | 1 + drivers/clk/exynos/clk-exynos850.c | 10 + drivers/rng/Kconfig | 13 + drivers/rng/Makefile | 1 + drivers/rng/exynos-trng.c | 291 +++++++++++++++++++++ 12 files changed, 504 insertions(+), 4 deletions(-) create mode 100644 board/samsung/e850-96/e850-96.env create mode 100644 board/samsung/e850-96/fw.c create mode 100644 board/samsung/e850-96/fw.h create mode 100644 drivers/rng/exynos-trng.c