From patchwork Tue Jul 23 18:14:35 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Protsenko X-Patchwork-Id: 813963 Delivered-To: patch@linaro.org Received: by 2002:adf:f288:0:b0:367:895a:4699 with SMTP id k8csp2443385wro; Tue, 23 Jul 2024 11:15:24 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUAi9i3Lv3zvakLw++9DZ+0aHLLnBPAUyCzNCsW+bdN3uho7FUNUFqNbIzoiJs5rDu3By85IBtNOJIBvL3EqAxw X-Google-Smtp-Source: AGHT+IF1QLm6GSmthTBglTvwzajLMCQkFBdIpXS1B15HsH8GFlJTVGn9ztUhdYREQJaf1mNn3WaA X-Received: by 2002:a05:6402:2791:b0:5a1:b9c0:7758 with SMTP id 4fb4d7f45d1cf-5a3f0ececd7mr8548404a12.33.1721758524486; Tue, 23 Jul 2024 11:15:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1721758524; cv=none; d=google.com; s=arc-20160816; b=JGNtBZ4o5zosKAQr/8V822lnvtphbw9lpyd5ju3Ud9oFfpVst+lnGx+cKaCNxu5tRo A+AMRgMtkWhFfDIhkqBr/xvFh5xyN65xMImQTCrGD5TtIIcF9ODeEwliqwMCam16FCt/ Me+4gU4kvoMp6BJQMzBkQGC12bJicAF6a2t/GoIufwsuntiiM99HddhlXyEfsDgxABS6 9Qm89hjh1nkGzEJN8ufHCZsWNJizGsBDNApmZN+OQ9VS4hOT9U70xPbJfLLS0Vft0QOc XuqI1Vn4iSyksvcHxrLJjgO+dDVmr7kQuw8uCWl6i3z3jdp7yEPlU/VoL8v4pW/rw4re jmHg== 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:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=YRsO6VmWB1lCczjG4aRpiPgyxqRccJBmQzQdXC0BsdQ=; fh=0QG0UQLdU9qG2p2kxsNLe1LAjZC92YhQn8ZXPZzLkc4=; b=BiK+D9fvKCCFN3kPXstIM5Ky6/M8V96tWO9ISfnZbmaOPiImrhIbRwK4GjYMrAzQro V1kefUm6WMY/gGSOZsvpmsAUIoW0HirWg1yOJoz21aW/Nw5kYDHKhhfzRr59wnk3802B Uxy/oZGOO3DS415JX5VnxzcLXqhviXv8ueMlQer4WjVR+H0u5gP3vmfDKplsE8ikYW08 nZRme30C4YzFRKsEItjkc2QDT9STIywuAhRHdhn1rrNe21nOQ9oBGBZagayQauqqUPz+ qXS0rrXrvIXALbuwSjDCKUd5K8TnevVAGIF3TIsNZx7jGhdoM84qFI3qwKSojQHHNfoY FQgQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=jBgr4ADN; 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-5a30a4d7569si6219703a12.176.2024.07.23.11.15.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Jul 2024 11:15:24 -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=jBgr4ADN; 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 5267A88890; Tue, 23 Jul 2024 20:14:53 +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="jBgr4ADN"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 1C1AB88886; Tue, 23 Jul 2024 20:14:52 +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=-1.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,SPF_HELO_NONE,T_SPF_TEMPERROR autolearn=no autolearn_force=no version=3.4.2 Received: from mail-oo1-xc2e.google.com (mail-oo1-xc2e.google.com [IPv6:2607:f8b0:4864:20::c2e]) (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 96AE78876D for ; Tue, 23 Jul 2024 20:14:42 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=fail smtp.mailfrom=semen.protsenko@linaro.org Received: by mail-oo1-xc2e.google.com with SMTP id 006d021491bc7-5c669a0b5d1so3491877eaf.3 for ; Tue, 23 Jul 2024 11:14:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1721758481; x=1722363281; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=YRsO6VmWB1lCczjG4aRpiPgyxqRccJBmQzQdXC0BsdQ=; b=jBgr4ADNJ2gQbaj3V/gcAwhz/773evRACX9CBpDf4LSI7ICqoJm5FmtzSCb2+/2qEv H1wIOCyzYpho/+a7VvQYJneDtKLKzKrnV8t8XrvrFyZACNrCKjekI8YsgbyhPuImlOtc HjjCMhnYYMo9hGg93K5rxHNUzt0K9QgbDwvIaI0RW+pUb3vmZHIqhqSYy9bPfOEGFoiK tmkMtMSHf5bpbPfQiFMZ5uPDQSEdZJ7wxhoYnEb9CI3vIBIvwmfYHyuqbCtYdhqGE5k6 ZHLmRVgs3RmJJ89kaMECL0endwAuRoU0JAlUsahPOsMPs3IL+hUV1SkwHdEC8YyGx/UE AYFQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721758481; x=1722363281; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=YRsO6VmWB1lCczjG4aRpiPgyxqRccJBmQzQdXC0BsdQ=; b=OLBTtaNdicZvrvUKRcHdqVPOMSOLL0kNyQ9NuGP5cIKcVmqTX1vnIulvgFOZuk+PQt +NHJAZvEWB/UXbsRDadcAihqaK+Yu2DdZfR/HNIXroOfjrQkHidM6xlJT6tVOJDjGqZq OXE+x8N78fkxDAoFA1qNBMmeM8PzBmRzZG9OZYbHba7ZMRYKKLmWargvH3nZOiCncx/k eTSUap1Yd4ooxOWTsSSQqCMtXfro3kHZMz3lYB0kV930ybRUxqB1K8hYz1kT9iGo0H3c tBKSOgBhhUlHwiYzTMsgXCofY2RfHkZ4EtEWBytWmoDJolHwaSlc4srIvrkZv8dj/8yb 9jfw== X-Forwarded-Encrypted: i=1; AJvYcCUGzBcqlyv2+9qfPlvciV8i4XQNTZn1msYHKC5KREg6OB9TevC9ZJyGRl7qUSP0JDnx9S9YGbooNxmVOYF7bnbkPyMosQ== X-Gm-Message-State: AOJu0YyFOpoZ69L5QVVRyC7/7QKca7VvvQjVFvGIoqhBmiVSTmz6GVE4 o+LC8F7Gfki87zt1VFIJCe8aQU5WXTk5MGYlMXxK8ft5sxG4Tf0xHz2VH4bCFlM= X-Received: by 2002:a05:6820:2014:b0:5b9:e7db:1cf8 with SMTP id 006d021491bc7-5d564f82ed7mr15422484eaf.4.1721758481314; Tue, 23 Jul 2024 11:14:41 -0700 (PDT) Received: from localhost ([136.62.192.75]) by smtp.gmail.com with ESMTPSA id 006d021491bc7-5d59f048948sm2285eaf.30.2024.07.23.11.14.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Jul 2024 11:14:41 -0700 (PDT) From: Sam Protsenko To: Minkyu Kang , Minkyu Kang Cc: Tom Rini , Simon Glass , Lukasz Majewski , Sean Anderson , Anand Moon , Sughosh Ganu , Heinrich Schuchardt , Sumit Garg , u-boot@lists.denx.de Subject: [PATCH v3 1/5] board: samsung: e850-96: Add default partitions Date: Tue, 23 Jul 2024 13:14:35 -0500 Message-Id: <20240723181439.7089-2-semen.protsenko@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240723181439.7089-1-semen.protsenko@linaro.org> References: <20240723181439.7089-1-semen.protsenko@linaro.org> 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 Add an environment file for E850-96 board with default eMMC partition list. It follows the Samsung's partition list used for Android-Q on Exynos850 devices. It was verified on E850-96 board with: => gpt verify mmc 0 "$partitions" Verify GPT: success! Signed-off-by: Sam Protsenko --- Changes in v3: - (none) Changes in v2: - (none) board/samsung/e850-96/e850-96.env | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 board/samsung/e850-96/e850-96.env diff --git a/board/samsung/e850-96/e850-96.env b/board/samsung/e850-96/e850-96.env new file mode 100644 index 000000000000..f36f90be9509 --- /dev/null +++ b/board/samsung/e850-96/e850-96.env @@ -0,0 +1,26 @@ +partitions= + uuid_disk=${uuid_gpt_disk}; + name=efs,start=512K,size=20M,uuid=${uuid_gpt_efs}; + name=env,size=16K,uuid=${uuid_gpt_env}; + name=kernel,size=30M,uuid=${uuid_gpt_kernel}; + name=ramdisk,size=26M,uuid=${uuid_gpt_ramdisk}; + name=dtbo,size=1M,uuid=${uuid_gpt_dtbo}; + name=ldfw,size=4016K,uuid=${uuid_gpt_ldfw}; + name=keystorage,size=8K,uuid=${uuid_gpt_keystorage}; + name=tzsw,size=1M,uuid=${uuid_gpt_tzsw}; + name=harx,size=2M,uuid=${uuid_gpt_harx}; + name=harx_rkp,size=2M,uuid=${uuid_gpt_harx_rkp}; + name=logo,size=40M,uuid=${uuid_gpt_logo}; + name=super,size=3600M,uuid=${uuid_gpt_super}; + name=cache,size=300M,uuid=${uuid_gpt_cache}; + name=modem,size=100M,uuid=${uuid_gpt_modem}; + name=boot,size=100M,uuid=${uuid_gpt_boot}; + name=persist,size=30M,uuid=${uuid_gpt_persist}; + name=recovery,size=40M,uuid=${uuid_gpt_recovery}; + name=misc,size=40M,uuid=${uuid_gpt_misc}; + name=mnv,size=20M,uuid=${uuid_gpt_mnv}; + name=frp,size=512K,uuid=${uuid_gpt_frp}; + name=vbmeta,size=64K,uuid=${uuid_gpt_vbmeta}; + name=metadata,size=16M,uuid=${uuid_gpt_metadata}; + name=dtb,size=1M,uuid=${uuid_gpt_dtb}; + name=userdata,size=-,uuid=${uuid_gpt_userdata} From patchwork Tue Jul 23 18:14:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Protsenko X-Patchwork-Id: 813962 Delivered-To: patch@linaro.org Received: by 2002:adf:f288:0:b0:367:895a:4699 with SMTP id k8csp2443342wro; Tue, 23 Jul 2024 11:15:14 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUWiEDtjt1ShrbAc5XN3/q3xAZPhQFUUcg5+0m+elQQIBFtoRbSjpDNitJ2UpcTDOkcqZgBDBLmk40kF4BbeWbj X-Google-Smtp-Source: AGHT+IEsBmcvpKBcs0h717rVAKMa361QPbay/B+kT58Uor5RTVUVme4nCbkObSVt1W/IMyYb+JyV X-Received: by 2002:a50:cdd8:0:b0:58d:81ac:ea90 with SMTP id 4fb4d7f45d1cf-5a943cf6ed9mr1977599a12.38.1721758513947; Tue, 23 Jul 2024 11:15:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1721758513; cv=none; d=google.com; s=arc-20160816; b=XBmwT+uuSKaA1WICtX7ofWItBSmDO1teR/+mGfAjIDZ0nMjnpUvzX69VOWZ49FGcvw POkKAn76s6Pn2q3TWKmgkKkeuYYL7dJkgKcr1UryJeqRcZ3Zg6KLKYcZtAcJrCRWK2fG ywnTTVb3z9DxTdrmzZFtgvTgZ+uFDcm9MFObPWnlM/3JhITXZoEe1AVVp6iDlSSCS7UG qb4XTvp2yfA8lVSAsoUtdhkbCgfu0Yz9GSbSOE23Trtfz0ZSWgXVV7MLDcUVBZIrW5jT hWAyrJJwGuN6uXZYu8iL1hB+/nlzSmHEp7Y6YvHUZZHcJxpq8AblNGOELFgv0fo49Vnt iAiQ== 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:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=oHPYsvDXjO8Wqgk24Z47cj1cvnKaTkkeSwxtugiopmk=; fh=yDhhD7MpkefZYmYFLRa7gQP6R49dFy0zlYudy3LpojI=; b=OBxYARIifmnxdFmHzSirVKSGerVHOT6K+BjYTqYP+X84TWK8XXl/8DV9EE8ooSyMCV 0dugAXecMZERzS8KN6UImY1LuCjbnKwBIRfa+nvmomwTL/xQkFXLZdkH0iQicv2XHFoe zNKqscmn4ttiyr8FFJ+f5s99ayaHlkJovnPuALIO3y4J6IpVZ2m0+TOx/YB8Xv9PqX6c SXGtwMCGKSjeAoO33sL51IVj3cWzzs2PpYMIrMcEn+wrQQrURHL8kwazomGGZ9J2MIW6 49DxejHEfF48meTCYYZPvjncssL05SnhR4G3GUS/RrF+fr34NQeBMaBVtQvmInDI4JvI /Hqg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=upgIxGo1; 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-5a309fffc82si6265939a12.25.2024.07.23.11.15.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Jul 2024 11:15:13 -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=upgIxGo1; 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 F060A8884D; Tue, 23 Jul 2024 20:14:52 +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="upgIxGo1"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 00F208887E; Tue, 23 Jul 2024 20:14:47 +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=ham autolearn_force=no version=3.4.2 Received: from mail-ot1-x32e.google.com (mail-ot1-x32e.google.com [IPv6:2607:f8b0:4864:20::32e]) (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 3E78088800 for ; Tue, 23 Jul 2024 20:14:43 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=fail smtp.mailfrom=semen.protsenko@linaro.org Received: by mail-ot1-x32e.google.com with SMTP id 46e09a7af769-70446231242so2920142a34.1 for ; Tue, 23 Jul 2024 11:14:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1721758482; x=1722363282; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=oHPYsvDXjO8Wqgk24Z47cj1cvnKaTkkeSwxtugiopmk=; b=upgIxGo1KYppKUUlncuJ8OPHa+Q3NrLIOBB6hEBoYfGDKwMS9+IkW3qCgGgh32zEvy 8DFFQ6s9WqMpjCJSZTZ9vP84LImJGqP39R294f9u8gm0oQu90Pyki0Rc+3x6GgLEBCY8 qOZuwJfdHFv5HE4Vp1dC+qxrwDMDPJ7Si14PpjEz5A/z2yzrh5PDCMnX1QPA4zVH7Vz1 uC2YrcCk8fiCQ5VXZlVFmHJN/K6yDXPvZOoqtjZ8M4fPoRs/axaLgsbH2AgR1pfHa9Bf 8NOz1cD8i8UPRAD0Gdp3Q48qJp3VNjm40n4IsuxW32mNMx86W6RZxK5HMll8OlkVjcrE Qcyg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721758482; x=1722363282; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=oHPYsvDXjO8Wqgk24Z47cj1cvnKaTkkeSwxtugiopmk=; b=sCS9z1Z4FJFqfCnYNwXu0snqU4C8JJAlpjfFaeEH8p2DUOILLZ+rHDGmdr6y97kOv7 BSJTlEonrpIF/RP8ZERyYUcMPH16Y/c8PBYkqA1JNSGs9MHSoUrFkja2Nfgk0BnUBiAt RE7syImP+AjeCsOgXXI9gLoUUluJNv6Bui6QKdH8kiCT0hnGSGcDFv+0UClqGQk/qah4 +AeGIOmhXo+JBmY8jDqB8K1feeOzxJCGyHwXRp9ItBKsHnU7U6nyZt2UU+ufXE7mYT5j DO3fmk8+09Yc3nVw28yAbYusip4cmJqqAEOwxF2P/nyBb4Y4X8gq0Tnk9raviK72radu AXKw== X-Forwarded-Encrypted: i=1; AJvYcCWTAcyuG/1QErcbm/Y62BTpuu5PaLbm+ryhMg+4xbJoqWQQUlgeP5+TZ5FMK0wrw8ZvJX/ijXLO8gWBhdieV6d4LqhhDg== X-Gm-Message-State: AOJu0YxCLsDcyCn8LB6PvKulBjqYvXtvRY/9zJ2dLY7D7H5jzhwwT7v+ YseKUYBRyLnzwh6BSPG1rcC1Ne+cQstzcSmdEcx4NgH2ly493/wR/04mwESeBRaDK23WdZUWRPM m X-Received: by 2002:a05:6830:6a8b:b0:703:68c2:3cb6 with SMTP id 46e09a7af769-709181dfe83mr4639016a34.32.1721758481949; Tue, 23 Jul 2024 11:14:41 -0700 (PDT) Received: from localhost ([136.62.192.75]) by smtp.gmail.com with ESMTPSA id 46e09a7af769-708f6174fc9sm2103134a34.56.2024.07.23.11.14.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Jul 2024 11:14:41 -0700 (PDT) From: Sam Protsenko To: Minkyu Kang , Minkyu Kang Cc: Tom Rini , Simon Glass , Lukasz Majewski , Sean Anderson , Anand Moon , Sughosh Ganu , Heinrich Schuchardt , Sumit Garg , u-boot@lists.denx.de Subject: [PATCH v3 2/5] board: samsung: e850-96: Load LDFW firmware on board init Date: Tue, 23 Jul 2024 13:14:36 -0500 Message-Id: <20240723181439.7089-3-semen.protsenko@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240723181439.7089-1-semen.protsenko@linaro.org> References: <20240723181439.7089-1-semen.protsenko@linaro.org> 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 LDFW is a Loadable Firmware which provides additional security capabilities in EL3 monitor. For example, True Random Number Generator (TRNG) block registers can't be accessed from EL1 (where U-Boot and Linux kernel are running), but it's possible to access TRNG capabilities via corresponding SMC calls, which in turn are handled by LDFW. To do so, LDFW firmware has to be loaded first. It's stored on a raw eMMC partition, so it has to be read into NWD (Normal World) RAM buffer, and then loaded to SWD (Secure World) memory using the special SMC call to EL3 monitor program. EL3_MON will load LDFW to SWD memory, more specifically to the area starting at 0xbf700000 (with size of 7.5 MiB). That memory area is reserved in device tree, so there shouldn't be any collisions. After that LDFW becomes functional. Implement LDFW firmware loading on board init. While at it, fix the copyright date in header comments, as this board support was actually added in 2024, not in 2020: it was probably a copy-paste mistake. Signed-off-by: Sam Protsenko --- Changes in v3: - (none) Changes in v2: - (none) board/samsung/e850-96/Makefile | 4 +- board/samsung/e850-96/e850-96.c | 6 +- board/samsung/e850-96/fw.c | 131 ++++++++++++++++++++++++++++++++ board/samsung/e850-96/fw.h | 12 +++ 4 files changed, 149 insertions(+), 4 deletions(-) create mode 100644 board/samsung/e850-96/fw.c create mode 100644 board/samsung/e850-96/fw.h diff --git a/board/samsung/e850-96/Makefile b/board/samsung/e850-96/Makefile index 301c22337119..71d46ea3d2b4 100644 --- a/board/samsung/e850-96/Makefile +++ b/board/samsung/e850-96/Makefile @@ -1,6 +1,6 @@ # SPDX-License-Identifier: GPL-2.0+ # -# Copyright (C) 2020, Linaro Limited +# Copyright (C) 2024, Linaro Limited # Sam Protsenko -obj-y := e850-96.o +obj-y := e850-96.o fw.o diff --git a/board/samsung/e850-96/e850-96.c b/board/samsung/e850-96/e850-96.c index a00d81b5d4c3..c5cef6f19d22 100644 --- a/board/samsung/e850-96/e850-96.c +++ b/board/samsung/e850-96/e850-96.c @@ -1,10 +1,11 @@ // SPDX-License-Identifier: GPL-2.0+ /* - * Copyright (C) 2020, Linaro Limited - * Sam Protsenko + * Copyright (c) 2024, Linaro Ltd. + * Author: Sam Protsenko */ #include +#include "fw.h" int dram_init(void) { @@ -18,5 +19,6 @@ int dram_init_banksize(void) int board_init(void) { + load_ldfw(); return 0; } diff --git a/board/samsung/e850-96/fw.c b/board/samsung/e850-96/fw.c new file mode 100644 index 000000000000..82a0b224c670 --- /dev/null +++ b/board/samsung/e850-96/fw.c @@ -0,0 +1,131 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Copyright (c) 2024 Linaro Ltd. + * Author: Sam Protsenko + * + * Firmware loading code. + */ + +#include +#include +#include "fw.h" + +#define EMMC_IFACE "mmc" +#define EMMC_DEV_NUM 0 + +/* LDFW constants */ +#define LDFW_PART_NAME "ldfw" +#define LDFW_NWD_ADDR 0x88000000 +#define LDFW_MAGIC 0x10adab1e +#define SMC_CMD_LOAD_LDFW -0x500 +#define SDM_HW_RESET_STATUS 0x1230 +#define SDM_SW_RESET_STATUS 0x1231 +#define SB_ERROR_PREFIX 0xfdaa0000 + +struct ldfw_header { + u32 magic; + u32 size; + u32 init_entry; + u32 entry_point; + u32 suspend_entry; + u32 resume_entry; + u32 start_smc_id; + u32 version; + u32 set_runtime_entry; + u32 reserved[3]; + char fw_name[16]; +}; + +static int read_fw(const char *part_name, void *buf) +{ + struct blk_desc *blk_desc; + struct disk_partition part; + unsigned long cnt; + int part_num; + + blk_desc = blk_get_dev(EMMC_IFACE, EMMC_DEV_NUM); + if (!blk_desc) { + debug("%s: Can't get eMMC device\n", __func__); + return -ENODEV; + } + + part_num = part_get_info_by_name(blk_desc, part_name, &part); + if (part_num < 0) { + debug("%s: Can't get LDWF partition\n", __func__); + return -ENOENT; + } + + cnt = blk_dread(blk_desc, part.start, part.size, buf); + if (cnt != part.size) { + debug("%s: Can't read LDFW partition\n", __func__); + return -EIO; + } + + return 0; +} + +int load_ldfw(void) +{ + const phys_addr_t addr = (phys_addr_t)LDFW_NWD_ADDR; + struct ldfw_header *hdr; + struct arm_smccc_res res; + void *buf = (void *)addr; + u64 size = 0; + int err, i; + + /* Load LDFW from the block device partition into RAM buffer */ + err = read_fw(LDFW_PART_NAME, buf); + if (err) + return err; + + /* Validate LDFW by magic number in its header */ + hdr = buf; + if (hdr->magic != LDFW_MAGIC) { + debug("%s: Wrong LDFW magic; is LDFW flashed?\n", __func__); + return -EINVAL; + } + + /* Calculate actual total size of all LDFW blobs */ + for (i = 0; hdr->magic == LDFW_MAGIC; ++i) { +#ifdef DEBUG + char name[17] = { 0 }; + + strncpy(name, hdr->fw_name, 16); + debug("%s: ldfw #%d: version = 0x%x, name = %s\n", __func__, i, + hdr->version, name); +#endif + + size += (u64)hdr->size; + hdr = (struct ldfw_header *)((u64)hdr + (u64)hdr->size); + } + debug("%s: The whole size of all LDFWs: 0x%llx\n", __func__, size); + + /* Load LDFW firmware to SWD (Secure World) memory via EL3 monitor */ + arm_smccc_smc(SMC_CMD_LOAD_LDFW, addr, size, 0, 0, 0, 0, 0, &res); + err = (int)res.a0; + if (err == -1 || err == SDM_HW_RESET_STATUS) { + debug("%s: Can't load LDFW in dump_gpr state\n", __func__); + return -EIO; + } else if (err == SDM_SW_RESET_STATUS) { + debug("%s: Can't load LDFW in kernel panic (SW RESET) state\n", + __func__); + return -EIO; + } else if (err < 0 && (err & 0xffff0000) == SB_ERROR_PREFIX) { + debug("%s: LDFW signature is corrupted! ret=0x%x\n", __func__, + (u32)err); + return -EIO; + } else if (err == 0) { + debug("%s: No LDFW is inited\n", __func__); + return -EIO; + } + +#ifdef DEBUG + u32 tried = res.a0 & 0xffff; + u32 failed = (res.a0 >> 16) & 0xffff; + + debug("%s: %d/%d LDFWs have been loaded successfully\n", __func__, + tried - failed, tried); +#endif + + return 0; +} diff --git a/board/samsung/e850-96/fw.h b/board/samsung/e850-96/fw.h new file mode 100644 index 000000000000..472664e4ed21 --- /dev/null +++ b/board/samsung/e850-96/fw.h @@ -0,0 +1,12 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +/* + * Copyright (c) 2024 Linaro Ltd. + * Sam Protsenko + */ + +#ifndef __E850_96_FW_H +#define __E850_96_FW_H + +int load_ldfw(void); + +#endif /* __E850_96_FW_H */ From patchwork Tue Jul 23 18:14:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Protsenko X-Patchwork-Id: 813964 Delivered-To: patch@linaro.org Received: by 2002:adf:f288:0:b0:367:895a:4699 with SMTP id k8csp2443449wro; Tue, 23 Jul 2024 11:15:36 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXV6bQIZAcOlW8ykIWEfip2AkF9T5ZDCch8l206fOEWMje4xaDngK2lWgHIyCdsdhpNYrT06pnn7C+r81KGib7l X-Google-Smtp-Source: AGHT+IFAoIWoYR/h0h1/lwesYYzGgMllvBl+cQQJ4+hv1ywEULd5VcbDQwxbzgq0NhX3CCT1s4OW X-Received: by 2002:a17:907:3f98:b0:a7a:9f78:fef with SMTP id a640c23a62f3a-a7a9f781133mr168753066b.45.1721758535934; Tue, 23 Jul 2024 11:15:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1721758535; cv=none; d=google.com; s=arc-20160816; b=LLYXai/O50ReoqyzbndgOJZw/e9YuY8Ma44mh3f1pGBuasQ4JPeD59ShzW4FVUtvwl XEhfruMXPL5INzXDdnuZ0ELCcal4X1BNYHQmGgwFA8DIwjtj85CV2ksGjN7hG0oO7ZuR 1RqOwadXwnmnpmcJqJeQvifte5/Z0q/66C41M7jvDRqJSxkvj3/+bf3n6C8xhHe6bWc7 1dyobj5lGzTzH+IPWeoB8qwopbNM6Z3V00PWt3nUFs+q88cHVbJKbglzggbaGb3T2Qqb aKFGrY6Tub1L+u8r78OM8LWqXcwZcV0yM8WA9+jhMhLxdMT69z8/y4Z2MGm0SHb8pMjb ZkBA== 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:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=h7x02m9/X1nGZUg7wrvjrfkcmJ2jc/Kg6fCq7AurZhY=; fh=vv1AzfnQ437y2ouVzGGm8lk/j8ZyJh+Sdc5jS+hnP+g=; b=B5lsdi0pdupGZHrn/CoDuYVwpk/7cqr9/LEgyYAeuvYIG549atCAsw3wggzgszZus1 AclpQPb2o8r/b/fih5HIhe+DBDNXpYV9kV5qS4BkN3OCp8NAzUcicLhhDcidjYU+/IWM HLV6rMHYFaT0CvfsMze8Gk91G1++vXhUaq+fPwtJx2XYGVmgDRpdUWQEZX4BLYooXJk5 6K8T+W6AevH3pL4TPtiyjLe5LrMSBW5M92OP+iyD+H9KYXySJ+q+iiCeSm2P7grckbVp sWwpV9t0J82e+9rsUTfJvnGhv4cawwffdXLxoECEPE+7fvAS6np8xzNkF0+1zUZd6IaZ C5nA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=XiJVzKen; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 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. [2a01:238:438b:c500:173d:9f52:ddab:ee01]) by mx.google.com with ESMTPS id a640c23a62f3a-a7a3c8c72bcsi560803466b.463.2024.07.23.11.15.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Jul 2024 11:15:35 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=XiJVzKen; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 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 B3612887F5; Tue, 23 Jul 2024 20:14:54 +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="XiJVzKen"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id ADDE588840; Tue, 23 Jul 2024 20:14:53 +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-oi1-x22f.google.com (mail-oi1-x22f.google.com [IPv6:2607:f8b0:4864:20::22f]) (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 F1BF188840 for ; Tue, 23 Jul 2024 20:14:43 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=fail smtp.mailfrom=semen.protsenko@linaro.org Received: by mail-oi1-x22f.google.com with SMTP id 5614622812f47-3d9e13ef9aaso3569393b6e.1 for ; Tue, 23 Jul 2024 11:14:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1721758483; x=1722363283; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=h7x02m9/X1nGZUg7wrvjrfkcmJ2jc/Kg6fCq7AurZhY=; b=XiJVzKenbojk+IvAVtZyxhV8BJovgLx396QsjsQcwP8XpM8ymdwP0CHkZTQgup23hd h9Sv39IpejmmJlykt+LwANQ28DRNpMWAlu539DFQGIPwH8z5nPi+2oA1wawmKJuTiOci HQ+1g639HqDajCAyLAG/yIAOG4ROjvxQyuV6M5l4hswGBLJ/YUnGUVR7DgzabLInGJ0X 4dtVOnTA8NgZKG8cXG3GyHuDEQyTPm58a00PI4rpWIHyKrrl97IntV9uXXYmbOraoJSF Tt1vxVkOX5pC8jwlruPfADtBXZqw6ilu7aogyN0/L+LCwrhWRKt3NsF9b6QRph8RA07k Y0yw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721758483; x=1722363283; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=h7x02m9/X1nGZUg7wrvjrfkcmJ2jc/Kg6fCq7AurZhY=; b=OIwQe+0TJRAb/qazYOaBCz8YlUZTE9Nk6XE65xAMZ1DP7/EvXTp4dl83iqG/w0q+/1 3kDCmnSrVB2w4oPn6S5yGcCMgNGlhMxq9DJbnMuf/S9wokUGaR3sE3RNd0/31EZqRTe3 egRPvNdysdjkuvlS7u6UNkacUDO51zCfdykmObjsyIQTfIrJAaAPU8gMjN+hgXZyvfLp nvkUDauJOEwXLp/jZMGNNNpD0r1P3iNU0cL0clAfRPfwU+Gc7QubmKw8AfRT1VGKycd2 QoVJnVjKV9u3RfBLvcIKFygyIyGuAQOmOAuqpeZqSu35gidCghudtiyz6U5XA7iJvHCE rPyg== X-Forwarded-Encrypted: i=1; AJvYcCX2Ocsvd9hy8qAhzHwzaGcBPJSZ6MptT+aK6CE78Alb4OWPKg4ZEAzMFuU3Qpam/FNqREGmtAFSKgaB3PLTEyfem95gdA== X-Gm-Message-State: AOJu0YyJIqBiD0z/DOSDdxlxlZdhHauf4FYFP6ieqTyx3YHLXJBcpyu5 BvtofPDH/+ysd3Aa/buMbtp8MqvE3l9UEnmnxr0FhGqswBbwNyznQw3PR59uk5W6W8r2syyU9JH b X-Received: by 2002:a05:6808:2189:b0:3da:a6b7:47f3 with SMTP id 5614622812f47-3dae979ff92mr15302166b6e.1.1721758482645; Tue, 23 Jul 2024 11:14:42 -0700 (PDT) Received: from localhost ([136.62.192.75]) by smtp.gmail.com with ESMTPSA id 5614622812f47-3dae0982785sm2084678b6e.23.2024.07.23.11.14.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Jul 2024 11:14:42 -0700 (PDT) From: Sam Protsenko To: Minkyu Kang , Minkyu Kang Cc: Tom Rini , Simon Glass , Lukasz Majewski , Sean Anderson , Anand Moon , Sughosh Ganu , Heinrich Schuchardt , Sumit Garg , u-boot@lists.denx.de Subject: [PATCH v3 3/5] clk: exynos: Add SSS clocks for Exynos850 Date: Tue, 23 Jul 2024 13:14:37 -0500 Message-Id: <20240723181439.7089-4-semen.protsenko@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240723181439.7089-1-semen.protsenko@linaro.org> References: <20240723181439.7089-1-semen.protsenko@linaro.org> 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 Add ACLK (operating clock) and PCLK (bus clock) for Security Sub System (SSS) in Exynos850. Those clocks are needed for RNG enablement. Signed-off-by: Sam Protsenko --- Changes in v3: - (none) Changes in v2: - (none) drivers/clk/exynos/clk-exynos850.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/clk/exynos/clk-exynos850.c b/drivers/clk/exynos/clk-exynos850.c index 0c09ba02de4a..8cbc626f31e8 100644 --- a/drivers/clk/exynos/clk-exynos850.c +++ b/drivers/clk/exynos/clk-exynos850.c @@ -323,14 +323,18 @@ U_BOOT_DRIVER(exynos850_cmu_peri) = { /* Register Offset definitions for CMU_CORE (0x12000000) */ #define PLL_CON0_MUX_CLKCMU_CORE_BUS_USER 0x0600 #define PLL_CON0_MUX_CLKCMU_CORE_MMC_EMBD_USER 0x0620 +#define PLL_CON0_MUX_CLKCMU_CORE_SSS_USER 0x0630 #define CLK_CON_DIV_DIV_CLK_CORE_BUSP 0x1800 #define CLK_CON_GAT_GOUT_CORE_MMC_EMBD_I_ACLK 0x20e8 #define CLK_CON_GAT_GOUT_CORE_MMC_EMBD_SDCLKIN 0x20ec +#define CLK_CON_GAT_GOUT_CORE_SSS_I_ACLK 0x2128 +#define CLK_CON_GAT_GOUT_CORE_SSS_I_PCLK 0x212c /* List of parent clocks for Muxes in CMU_CORE */ PNAME(mout_core_bus_user_p) = { "clock-oscclk", "dout_core_bus" }; PNAME(mout_core_mmc_embd_user_p) = { "clock-oscclk", "dout_core_mmc_embd" }; +PNAME(mout_core_sss_user_p) = { "clock-oscclk", "dout_core_sss" }; static const struct samsung_mux_clock core_mux_clks[] = { MUX(CLK_MOUT_CORE_BUS_USER, "mout_core_bus_user", mout_core_bus_user_p, @@ -338,6 +342,8 @@ static const struct samsung_mux_clock core_mux_clks[] = { MUX_F(CLK_MOUT_CORE_MMC_EMBD_USER, "mout_core_mmc_embd_user", mout_core_mmc_embd_user_p, PLL_CON0_MUX_CLKCMU_CORE_MMC_EMBD_USER, 4, 1, CLK_SET_RATE_PARENT, 0), + MUX(CLK_MOUT_CORE_SSS_USER, "mout_core_sss_user", mout_core_sss_user_p, + PLL_CON0_MUX_CLKCMU_CORE_SSS_USER, 4, 1), }; static const struct samsung_div_clock core_div_clks[] = { @@ -351,6 +357,10 @@ static const struct samsung_gate_clock core_gate_clks[] = { GATE(CLK_GOUT_MMC_EMBD_SDCLKIN, "gout_mmc_embd_sdclkin", "mout_core_mmc_embd_user", CLK_CON_GAT_GOUT_CORE_MMC_EMBD_SDCLKIN, 21, CLK_SET_RATE_PARENT, 0), + GATE(CLK_GOUT_SSS_ACLK, "gout_sss_aclk", "mout_core_sss_user", + CLK_CON_GAT_GOUT_CORE_SSS_I_ACLK, 21, 0, 0), + GATE(CLK_GOUT_SSS_PCLK, "gout_sss_pclk", "dout_core_busp", + CLK_CON_GAT_GOUT_CORE_SSS_I_PCLK, 21, 0, 0), }; static const struct samsung_clk_group core_cmu_clks[] = { From patchwork Tue Jul 23 18:14:38 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Protsenko X-Patchwork-Id: 813965 Delivered-To: patch@linaro.org Received: by 2002:adf:f288:0:b0:367:895a:4699 with SMTP id k8csp2443562wro; Tue, 23 Jul 2024 11:15:57 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWqeuNlIJnQ3ZkrgqWQaCk7IqAHE+rIpIIw5iYHVHMbZAXihPMCVdpqAJ5cTm9iyGQDQI+VbsBvoJ2VDQUvnoG8 X-Google-Smtp-Source: AGHT+IF2EHMyAgKrwGTVDsJ95RkJbloiuW13JMLo17rFonhxlXsVQlb9ZbxNISjQ48Pvln3aJd/v X-Received: by 2002:a17:907:7f24:b0:a77:c9cc:f96f with SMTP id a640c23a62f3a-a7aab5f7616mr36389466b.7.1721758557362; Tue, 23 Jul 2024 11:15:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1721758557; cv=none; d=google.com; s=arc-20160816; b=xbvE+mdHDq/S/i3JQ7fAeG0gav3+WvLANPt3aI3bsr3K0OOyWnzZ6Z7eU8ROgH9xeU Mg1P4rrgNBKoOfg5R39rrsRBUaIwS2RFqVSxCt8O10O+uLyWI11b85DLT0j7iMQyHjLh 0L9sVgJnZdow2zoaUvFdMtb6fn7XkrLc2uc6eYyys71fRYFnF+Bq61BbMuaBo9TCdXDh lRtFo0Z5BqAGwRCpzJahpXOxZp9zi+efoYCoh/vt5Uh05KQh1Xr0GsyNP+N1v6eCOmpz dhuqXU+5u6qK5zyoOMuycwqnlb5YKaFHogNOsnWT7s2JQp4ZSCql632gf7WFLdGi0xZl jf0Q== 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:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=9JwyOCcRX4UXF8qd2zTrPr78vJRSQmf5Ie5aRukRNk4=; fh=p9iAtV4gnvWJYRQMme8cVU5bTZyzu9MuZx1FDUfyOxY=; b=hqhv3nyBWi+CHIWRMDPg0sgFG5D9c0UeTfrJp79yK9BNC7vrWxgutJnEj30r7fVBiS bceB5g/18CJU8o5se/rZe99P3gCqeyQ13yWYN3WhWIAyHJPK5dXk1hBuuscGSKR+NZb1 EpNJjYb0EOxsVSf5c1De26ZzkFX6rXtTW9u6dCy1PjwnSniVHy98QL1qq0QhPIZhHK8Z lNUjL8h0wxqusQDLQ3eG+S77uirsNd6+NnLf21VoI1EorCM6zXCA8Nxeu4ezItEv0KYX GbVp6dwUNEkh3bCQ2c9+PuukgMJsQ3++yhBrw6J5M6Zus2JmQFRrA7LMNOBA1weqJTB5 JIQA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=BuvTVjW1; 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 a640c23a62f3a-a7a3c8c643dsi576510766b.408.2024.07.23.11.15.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Jul 2024 11:15:57 -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=BuvTVjW1; 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 20153888A1; Tue, 23 Jul 2024 20:14:55 +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="BuvTVjW1"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id B2BA388747; Tue, 23 Jul 2024 20:14:53 +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,T_SPF_TEMPERROR autolearn=unavailable autolearn_force=no version=3.4.2 Received: from mail-ot1-x32e.google.com (mail-ot1-x32e.google.com [IPv6:2607:f8b0:4864:20::32e]) (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 B03BB88845 for ; Tue, 23 Jul 2024 20:14:44 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=fail smtp.mailfrom=semen.protsenko@linaro.org Received: by mail-ot1-x32e.google.com with SMTP id 46e09a7af769-7044c085338so3306267a34.2 for ; Tue, 23 Jul 2024 11:14:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1721758483; x=1722363283; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=9JwyOCcRX4UXF8qd2zTrPr78vJRSQmf5Ie5aRukRNk4=; b=BuvTVjW1NJdeM4ih9EZTg6gvNbvDKUBIEc4RajWpuHcw2hA64/zk5U0/gL3AEtw8bQ fIjOVBM2AYyxUbAn/EivIUrY1ojKWLJJgh1xTFK80rvHZvlI6rwL+/QlODxZKnlM9nie iFYIRY7/pcDSUy8k9g85hg0W/XrvxfSko4zCJU45ANwN+YApx3xUOYBC9lCtqXUflGUm hY8GJ80IOM0wbUzuerFN2fs6H5W2C828uZAk8kwmUXQEdBbT1u7lMmn8ON0qxSbCnY6i F1tovP7VngBg+tBXiH8GydnHc4U5jn1pQFoR242OeJP+081Dz+sY0uLvJtOYyvAW8R5B sdmA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721758483; x=1722363283; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=9JwyOCcRX4UXF8qd2zTrPr78vJRSQmf5Ie5aRukRNk4=; b=bqoj2OcNyq0mB2ym+TCdRcyHcJQig/hx5Il/Y543iDY/BljiTX34ZV2MRSJ1kkKnkt ckVm7GwJFCLXhc0MYX720u1BSmthSrGSCAMm7nokAevQbEaDn4T5W3YS+SHmuiMgroty Wl6yNZswk3gqjm/WnMvPxiWVZSqb+yUpN7Z0zQ4xdjh99DnXSidfdNgMJpd/+TZ9nWcV sY+LKvHIPjDVohiw+KDDVu3IyN2aT0fl2Wd18EvGdH2018X6UFSSxEmMUsosi1dpptfM lOdK6mmZVwNHZi4nCgbzsP1gY1lerYXK/hTn3mm/7pxhTkZrzCaNfVWhedMp3IaPnMDI OX6w== X-Forwarded-Encrypted: i=1; AJvYcCUme3D51sYpYDWeFeEwb1MdH3e4/ju3Me6WU0LFnlBVibRFlK8czrtbFszQwEcctVVQ1jkNrkQcH7vcaAMqGRO/PWx0ew== X-Gm-Message-State: AOJu0YzB8yxc9uc+ynKyf6Z6K9qkP2O/9aQN1ML217N2nxNq2bf9bctS AuM6MqfV++QKhdZKPECEofO2kwnJhd6hX3lC23JSCGjk8AGgCcosbVdB0d6yo1s= X-Received: by 2002:a05:6830:6212:b0:704:4d82:1fed with SMTP id 46e09a7af769-709234c91efmr698164a34.31.1721758483378; Tue, 23 Jul 2024 11:14:43 -0700 (PDT) Received: from localhost ([136.62.192.75]) by smtp.gmail.com with ESMTPSA id 46e09a7af769-708f60c3ba0sm2109641a34.27.2024.07.23.11.14.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Jul 2024 11:14:43 -0700 (PDT) From: Sam Protsenko To: Minkyu Kang , Minkyu Kang Cc: Tom Rini , Simon Glass , Lukasz Majewski , Sean Anderson , Anand Moon , Sughosh Ganu , Heinrich Schuchardt , Sumit Garg , u-boot@lists.denx.de Subject: [PATCH v3 4/5] rng: Add Exynos TRNG driver Date: Tue, 23 Jul 2024 13:14:38 -0500 Message-Id: <20240723181439.7089-5-semen.protsenko@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240723181439.7089-1-semen.protsenko@linaro.org> References: <20240723181439.7089-1-semen.protsenko@linaro.org> 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 Add True Random Number Generator (TRNG) driver for Exynos chips. This implementation is heavily based on Linux kernel's counterpart [1]. It also follows upstream dt-bindings [2]. TRNG block is usually a part of SSS (Security Sub System) IP-core on Exynos chips. Because SSS access on Exynos850 is protected by TZPC (TrustZone Protection Control), it's not possible to read/write TRNG registers from U-Boot, as it's running in EL1 mode. Instead, the corresponding SMC calls should be used to make the secure software running in EL3 mode access it for us. Those SMC calls are handled by LDFW (Loadable Firmware), which has to be loaded first. For example, for E850-96 board it's done in its board_init(), so by the time RNG capabilities are needed the LDFW should be already loaded and TRNG should be functional. [1] drivers/char/hw_random/exynos-trng.c [2] dts/upstream/Bindings/rng/samsung,exynos5250-trng.yaml Signed-off-by: Sam Protsenko --- Changes in v3: - (none) Changes in v2: - Mentioned LDFW firmware in help section for RNG_EXYNOS config option - Renamed struct exynos_trng -> struct exynos_trng_priv - Added kernel-doc comments for struct exynos_trng_priv - Added kernel-doc comments for struct exynos_trng_variant - Fixed error codes in exynos_trng_of_to_plat() - Renamed 'err' variable to 'ret' in exynos_trng_probe() drivers/rng/Kconfig | 13 ++ drivers/rng/Makefile | 1 + drivers/rng/exynos-trng.c | 291 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 305 insertions(+) create mode 100644 drivers/rng/exynos-trng.c diff --git a/drivers/rng/Kconfig b/drivers/rng/Kconfig index 5758ae192a66..b35d8c66b9c6 100644 --- a/drivers/rng/Kconfig +++ b/drivers/rng/Kconfig @@ -120,4 +120,17 @@ config RNG_TURRIS_RWTM on other Armada-3700 devices (like EspressoBin) if Secure Firmware from CZ.NIC is used. +config RNG_EXYNOS + bool "Samsung Exynos True Random Number Generator support" + depends on DM_RNG + help + Enable support for True Random Number Generator (TRNG) available on + Exynos SoCs. + + On some chips (like Exynos850) TRNG registers are protected with TZPC + (TrustZone Protection Control). For such chips the driver provides an + implementation based on SMC calls to EL3 monitor program. In that + case the LDFW (Loadable Firmware) has to be loaded first, as it + actually implements TRNG SMC calls. + endif diff --git a/drivers/rng/Makefile b/drivers/rng/Makefile index c1f1c616e009..30553c9d6e99 100644 --- a/drivers/rng/Makefile +++ b/drivers/rng/Makefile @@ -18,3 +18,4 @@ obj-$(CONFIG_RNG_ARM_RNDR) += arm_rndr.o obj-$(CONFIG_TPM_RNG) += tpm_rng.o obj-$(CONFIG_RNG_JH7110) += jh7110_rng.o obj-$(CONFIG_RNG_TURRIS_RWTM) += turris_rwtm_rng.o +obj-$(CONFIG_RNG_EXYNOS) += exynos-trng.o diff --git a/drivers/rng/exynos-trng.c b/drivers/rng/exynos-trng.c new file mode 100644 index 000000000000..d2479d244ed5 --- /dev/null +++ b/drivers/rng/exynos-trng.c @@ -0,0 +1,291 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Copyright (c) 2024 Linaro Ltd. + * Author: Sam Protsenko + * + * Samsung Exynos TRNG driver (True Random Number Generator). + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define EXYNOS_TRNG_CLKDIV 0x0 +#define EXYNOS_TRNG_CLKDIV_MASK GENMASK(15, 0) +#define EXYNOS_TRNG_CLOCK_RATE 500000 + +#define EXYNOS_TRNG_CTRL 0x20 +#define EXYNOS_TRNG_CTRL_RNGEN BIT(31) + +#define EXYNOS_TRNG_POST_CTRL 0x30 +#define EXYNOS_TRNG_ONLINE_CTRL 0x40 +#define EXYNOS_TRNG_ONLINE_STAT 0x44 +#define EXYNOS_TRNG_ONLINE_MAXCHI2 0x48 +#define EXYNOS_TRNG_FIFO_CTRL 0x50 +#define EXYNOS_TRNG_FIFO_0 0x80 +#define EXYNOS_TRNG_FIFO_1 0x84 +#define EXYNOS_TRNG_FIFO_2 0x88 +#define EXYNOS_TRNG_FIFO_3 0x8c +#define EXYNOS_TRNG_FIFO_4 0x90 +#define EXYNOS_TRNG_FIFO_5 0x94 +#define EXYNOS_TRNG_FIFO_6 0x98 +#define EXYNOS_TRNG_FIFO_7 0x9c +#define EXYNOS_TRNG_FIFO_LEN 8 +#define EXYNOS_TRNG_FIFO_TIMEOUT (1 * USEC_PER_SEC) + +#define EXYNOS_SMC_CALL_VAL(func_num) \ + ARM_SMCCC_CALL_VAL(ARM_SMCCC_FAST_CALL, \ + ARM_SMCCC_SMC_32, \ + ARM_SMCCC_OWNER_SIP, \ + func_num) + +/* SMC command for DTRNG access */ +#define SMC_CMD_RANDOM EXYNOS_SMC_CALL_VAL(0x1012) + +/* SMC_CMD_RANDOM: arguments */ +#define HWRNG_INIT 0x0 +#define HWRNG_EXIT 0x1 +#define HWRNG_GET_DATA 0x2 + +/* SMC_CMD_RANDOM: return values */ +#define HWRNG_RET_OK 0x0 +#define HWRNG_RET_RETRY_ERROR 0x2 + +#define HWRNG_MAX_TRIES 100 + +/** + * struct exynos_trng_variant - Chip specific data + * + * @smc: Set "true" if TRNG block has to be accessed via SMC calls + * @init: (Optional) TRNG initialization function to call on probe + * @exit: (Optional) TRNG deinitialization function to call on remove + * @read: Function to read the random data from TRNG block + */ +struct exynos_trng_variant { + bool smc; + int (*init)(struct udevice *dev); + void (*exit)(struct udevice *dev); + int (*read)(struct udevice *dev, void *data, size_t len); +}; + +/** + * struct exynos_trng_priv - Driver's private data + * + * @base: Base address of MMIO registers of TRNG block + * @clk: Operating clock (needed for TRNG block functioning) + * @pclk: Bus clock (needed for interfacing the TRNG block registers) + * @data: Chip specific data + */ +struct exynos_trng_priv { + void __iomem *base; + struct clk *clk; + struct clk *pclk; + const struct exynos_trng_variant *data; +}; + +static int exynos_trng_read_reg(struct udevice *dev, void *data, size_t len) +{ + struct exynos_trng_priv *trng = dev_get_priv(dev); + int val; + + len = min_t(size_t, len, EXYNOS_TRNG_FIFO_LEN * 4); + writel_relaxed(len * 8, trng->base + EXYNOS_TRNG_FIFO_CTRL); + val = readl_poll_timeout(trng->base + EXYNOS_TRNG_FIFO_CTRL, val, + val == 0, EXYNOS_TRNG_FIFO_TIMEOUT); + if (val < 0) + return val; + + memcpy_fromio(data, trng->base + EXYNOS_TRNG_FIFO_0, len); + + return 0; +} + +static int exynos_trng_read_smc(struct udevice *dev, void *data, size_t len) +{ + struct arm_smccc_res res; + unsigned int copied = 0; + u32 *buf = data; + int tries = 0; + + while (copied < len) { + arm_smccc_smc(SMC_CMD_RANDOM, HWRNG_GET_DATA, 0, 0, 0, 0, 0, 0, + &res); + switch (res.a0) { + case HWRNG_RET_OK: + *buf++ = res.a2; + *buf++ = res.a3; + copied += 8; + tries = 0; + break; + case HWRNG_RET_RETRY_ERROR: + if (++tries >= HWRNG_MAX_TRIES) + return -EIO; + udelay(10); + break; + default: + return -EIO; + } + } + + return 0; +} + +static int exynos_trng_init_reg(struct udevice *dev) +{ + const u32 max_div = EXYNOS_TRNG_CLKDIV_MASK; + struct exynos_trng_priv *trng = dev_get_priv(dev); + unsigned long sss_rate; + u32 div; + + sss_rate = clk_get_rate(trng->clk); + + /* + * For most TRNG circuits the clock frequency of under 500 kHz is safe. + * The clock divider should be an even number. + */ + div = sss_rate / EXYNOS_TRNG_CLOCK_RATE; + div -= div % 2; /* make sure it's even */ + if (div > max_div) { + dev_err(dev, "Clock divider too large: %u", div); + return -ERANGE; + } + writel_relaxed(div, trng->base + EXYNOS_TRNG_CLKDIV); + + /* Enable the generator */ + writel_relaxed(EXYNOS_TRNG_CTRL_RNGEN, trng->base + EXYNOS_TRNG_CTRL); + + /* Disable post-processing */ + writel_relaxed(0, trng->base + EXYNOS_TRNG_POST_CTRL); + + return 0; +} + +static int exynos_trng_init_smc(struct udevice *dev) +{ + struct arm_smccc_res res; + int ret = 0; + + arm_smccc_smc(SMC_CMD_RANDOM, HWRNG_INIT, 0, 0, 0, 0, 0, 0, &res); + if (res.a0 != HWRNG_RET_OK) { + dev_err(dev, "SMC command for TRNG init failed (%d)\n", + (int)res.a0); + ret = -EIO; + } + if ((int)res.a0 == -1) + dev_info(dev, "Make sure LDFW is loaded\n"); + + return ret; +} + +static void exynos_trng_exit_smc(struct udevice *dev) +{ + struct arm_smccc_res res; + + arm_smccc_smc(SMC_CMD_RANDOM, HWRNG_EXIT, 0, 0, 0, 0, 0, 0, &res); +} + +static int exynos_trng_read(struct udevice *dev, void *data, size_t len) +{ + struct exynos_trng_priv *trng = dev_get_priv(dev); + + return trng->data->read(dev, data, len); +} + +static int exynos_trng_of_to_plat(struct udevice *dev) +{ + struct exynos_trng_priv *trng = dev_get_priv(dev); + + trng->data = (struct exynos_trng_variant *)dev_get_driver_data(dev); + if (!trng->data->smc) { + trng->base = dev_read_addr_ptr(dev); + if (!trng->base) + return -EINVAL; + } + + trng->clk = devm_clk_get(dev, "secss"); + if (IS_ERR(trng->clk)) + return PTR_ERR(trng->clk); + + trng->pclk = devm_clk_get_optional(dev, "pclk"); + if (IS_ERR(trng->pclk)) + return PTR_ERR(trng->pclk); + + return 0; +} + +static int exynos_trng_probe(struct udevice *dev) +{ + struct exynos_trng_priv *trng = dev_get_priv(dev); + int ret; + + ret = clk_enable(trng->pclk); + if (ret) + return ret; + + ret = clk_enable(trng->clk); + if (ret) + return ret; + + if (trng->data->init) + ret = trng->data->init(dev); + + return ret; +} + +static int exynos_trng_remove(struct udevice *dev) +{ + struct exynos_trng_priv *trng = dev_get_priv(dev); + + if (trng->data->exit) + trng->data->exit(dev); + + /* Keep SSS clocks enabled, they are needed for EL3_MON and kernel */ + + return 0; +} + +static const struct dm_rng_ops exynos_trng_ops = { + .read = exynos_trng_read, +}; + +static const struct exynos_trng_variant exynos5250_trng_data = { + .init = exynos_trng_init_reg, + .read = exynos_trng_read_reg, +}; + +static const struct exynos_trng_variant exynos850_trng_data = { + .smc = true, + .init = exynos_trng_init_smc, + .exit = exynos_trng_exit_smc, + .read = exynos_trng_read_smc, +}; + +static const struct udevice_id exynos_trng_match[] = { + { + .compatible = "samsung,exynos5250-trng", + .data = (ulong)&exynos5250_trng_data, + }, { + .compatible = "samsung,exynos850-trng", + .data = (ulong)&exynos850_trng_data, + }, + { }, +}; + +U_BOOT_DRIVER(exynos_trng) = { + .name = "exynos-trng", + .id = UCLASS_RNG, + .of_match = exynos_trng_match, + .of_to_plat = exynos_trng_of_to_plat, + .probe = exynos_trng_probe, + .remove = exynos_trng_remove, + .ops = &exynos_trng_ops, + .priv_auto = sizeof(struct exynos_trng_priv), +}; From patchwork Tue Jul 23 18:14:39 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Protsenko X-Patchwork-Id: 813966 Delivered-To: patch@linaro.org Received: by 2002:adf:f288:0:b0:367:895a:4699 with SMTP id k8csp2443630wro; Tue, 23 Jul 2024 11:16:07 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWEZAhZd5elL+ZiK7jVSw8f1qQAGO4G29VCh9J74R/m7rPDRzrAroCfJBeLWkHd3myauNHZSqtL5NzlOMxCplF/ X-Google-Smtp-Source: AGHT+IGM4InGupyFaZrYaBRfVQ9d8iLQPyrBvRgcypCipdGcINktCR0G6GoaykXKEnAArT/HGeHF X-Received: by 2002:a05:6402:524e:b0:58c:36e:51bf with SMTP id 4fb4d7f45d1cf-5a99cc3ee21mr3058508a12.3.1721758566807; Tue, 23 Jul 2024 11:16:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1721758566; cv=none; d=google.com; s=arc-20160816; b=cs4LeF0fEy+GzM2N4ueqb+Q0Y7qk5xKR2lx3nophGL7H43ahMp+nKTK8+cj8BeQYP/ K6FOeh6K3vdCAZC2PUDJIQtD6UH8AsuPzILpVlbfRKpqmGWqJ49dKnyniI84PfGx3QQ6 BAq2JJym1ecFQxY1IeVBZZTN3MfX53VYhfTRHjTX228f87+YjeBH8Rni+F1m+lqWZr4r 9LegTW7dqLzsRCJIuQBBMaSlNts44woHBIyDj5rqhcRNUQmn0XFLFZDjdHv+oCW44UNR KSauoLy5WO4UcYrsXwPZq5I3hJbgxEbCa5EmCVyLFpckjYOUVqxgP3aAKnIQ/8H5ebV/ deCA== 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:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=8gq0A8rChaBn6EPPkSZgzwRXNnHZA5AQoq4NfD5Yfog=; fh=KlvVXRl650i1Y8IlrpFsdr6FlIKe82zz54THIbB0Ueg=; b=GATurvm84m5yzN8hXbi3Nt808nvF8AMUuTa/yGRgvhUDuYGMV2ZJT4nKdYB+FygBn+ 7/3m87pFwagJXWZdZohu4mUUKYmh2UFZdKvoFoz7YcrbdxfbF/dMFn/Q/HoutYCxcCXU H6jZshd0q/QgQf8kiT0MOsCQmAV7190KhFavw+etc7TmLXMcbsTLFkt47KkpISZmGF7z Oxrkj3LLRAdRmN13u1y3jFQEWnOtsIXZ4pTFHJDJHCkc+qigfGHffleGgyfK+TVA/ruF IfTzrW69SrXiPDtd7YBBLyMihefaY7cOjZ96Wn/+uwwALjBXH/V3E/nKxwGdNHkBKeCu 2gmw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=h+LFVVYH; 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-5a4b37813easi4737410a12.519.2024.07.23.11.16.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Jul 2024 11:16:06 -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=h+LFVVYH; 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 840AE887D6; Tue, 23 Jul 2024 20:15:00 +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="h+LFVVYH"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 17B64884BC; Tue, 23 Jul 2024 20:14:58 +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,T_SPF_TEMPERROR autolearn=unavailable autolearn_force=no version=3.4.2 Received: from mail-ot1-x32f.google.com (mail-ot1-x32f.google.com [IPv6:2607:f8b0:4864:20::32f]) (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 4C4BB88852 for ; Tue, 23 Jul 2024 20:14:45 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=fail smtp.mailfrom=semen.protsenko@linaro.org Received: by mail-ot1-x32f.google.com with SMTP id 46e09a7af769-704494efa7cso2972404a34.3 for ; Tue, 23 Jul 2024 11:14:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1721758484; x=1722363284; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=8gq0A8rChaBn6EPPkSZgzwRXNnHZA5AQoq4NfD5Yfog=; b=h+LFVVYHkSUthhDM2QR3bG1IQG+VSWMstvjkaqo5TVeVRo8r5ExjrIGKUG0bLddB04 kb3qNiZXTQ5pHb9wWiTs5xZ9e9A1jo9V6G7eEecWl92612hH+asGMp6xPqQdG5DruTtn bmC94xr8d9VHxs5lmiGdrY01RA9b33YCf6oy6Mdh/H+sLck8UKYqsKsl4sMZL/g8wPeq KrtzjzEvDjIuufFDAg4Sn+aRaC2bHmsXXufaRwmRTcS23Cbzspb4xrWfWufD7LKIZhPg POOGW76hB+jdDFReiv1kMtX/rXy9utP7n8Hwp7f4ZVEWT/cXVA+RXN4wxsjgFgNI7Qtn h0mg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721758484; x=1722363284; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=8gq0A8rChaBn6EPPkSZgzwRXNnHZA5AQoq4NfD5Yfog=; b=K+unwbIv8HK3Kev4A8Jpjmb957L071PIbY4a9M8VnQa+rWIUwSJMAeqyYr+fEDEEkE 29Z/4kr9pBBqbqmi9cWMNr5ffhzw2S4A61AHrqDRba5GpZxljVrNAExsVNpwK9TDBLGC kwTqKGMab1y9XhUtw+iSOSV21J7iPTfgS4q1GSk3dAz4f95eyJiEL4+F+Yacj2Tiq92D +U3+vFN/KyLT7ZaMSOsgncjrUUfADKyx9uZnEEsiQD6oAFam8XRnrVSYFOc4I3DdEGxj OIyW/2y6Ps/7wkS0RO2kabSpsdNDNaB8yoWQqFFjtKlwbhQaBb9ggF7Fick+x5WzjbHS d3HQ== X-Forwarded-Encrypted: i=1; AJvYcCXRnW/b41C6m46yldb+/HnNmjvnUfE2HEqa69hiDtBBuUdacb08QvS4S8luXEePaYy/0+f8Mj3aVkGNZSi9bTYA2N3m2A== X-Gm-Message-State: AOJu0YzoVhfxrWQxntHQ+cXWI/W29FrWvWsiZPENxvrz6uC+mRcHJOBJ kJbhfu5FDQHXv54UEsu51kCiq++OWhKuA1UlYjDggbAQKioy3RViDrWdsB6ef7U= X-Received: by 2002:a05:6830:6b0d:b0:703:6a3e:d3ca with SMTP id 46e09a7af769-709234a9492mr749477a34.26.1721758484102; Tue, 23 Jul 2024 11:14:44 -0700 (PDT) Received: from localhost ([136.62.192.75]) by smtp.gmail.com with ESMTPSA id 46e09a7af769-708f60d5368sm2137771a34.33.2024.07.23.11.14.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Jul 2024 11:14:43 -0700 (PDT) From: Sam Protsenko To: Minkyu Kang , Minkyu Kang Cc: Tom Rini , Simon Glass , Lukasz Majewski , Sean Anderson , Anand Moon , Sughosh Ganu , Heinrich Schuchardt , Sumit Garg , u-boot@lists.denx.de Subject: [PATCH v3 5/5] arm: exynos: Enable TRNG on E850-96 board Date: Tue, 23 Jul 2024 13:14:39 -0500 Message-Id: <20240723181439.7089-6-semen.protsenko@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240723181439.7089-1-semen.protsenko@linaro.org> References: <20240723181439.7089-1-semen.protsenko@linaro.org> 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 Enable True Random Number Generator (TRNG) on E850-96 board. To do so: 1. Enable DM_RNG and RNG_EXYNOS for TARGET_E850_96 2. Add TRNG node to E850-96 device tree 3. Enable 'rng' command support for easy TRNG testing TRNG node is already applied in Linux kernel device tree, but it hasn't appeared in upstream dts yet. Add it in U-Boot override dtsi file temporarily; it can be removed once it appears in upstream dts. Signed-off-by: Sam Protsenko --- Changes in v3: - Fixed applying the defconfig changes on U-Boot/master branch Changes in v2: - (none) arch/arm/dts/exynos850-e850-96-u-boot.dtsi | 11 +++++++++++ arch/arm/mach-exynos/Kconfig | 2 ++ configs/e850-96_defconfig | 1 + 3 files changed, 14 insertions(+) diff --git a/arch/arm/dts/exynos850-e850-96-u-boot.dtsi b/arch/arm/dts/exynos850-e850-96-u-boot.dtsi index 6d7148f7264a..3aa5d8bb10d0 100644 --- a/arch/arm/dts/exynos850-e850-96-u-boot.dtsi +++ b/arch/arm/dts/exynos850-e850-96-u-boot.dtsi @@ -3,6 +3,17 @@ * Copyright (c) 2023 Linaro Ltd. */ +&soc { + /* TODO: Remove this node once it appears in upstream dts */ + trng: rng@12081400 { + compatible = "samsung,exynos850-trng"; + reg = <0x12081400 0x100>; + clocks = <&cmu_core CLK_GOUT_SSS_ACLK>, + <&cmu_core CLK_GOUT_SSS_PCLK>; + clock-names = "secss", "pclk"; + }; +}; + &pmu_system_controller { bootph-all; samsung,uart-debug-1; diff --git a/arch/arm/mach-exynos/Kconfig b/arch/arm/mach-exynos/Kconfig index cad8bb044cf0..3fee5a4299b8 100644 --- a/arch/arm/mach-exynos/Kconfig +++ b/arch/arm/mach-exynos/Kconfig @@ -250,6 +250,8 @@ config TARGET_E850_96 select PINCTRL select PINCTRL_EXYNOS850 imply OF_UPSTREAM + imply DM_RNG + imply RNG_EXYNOS endchoice endif diff --git a/configs/e850-96_defconfig b/configs/e850-96_defconfig index 38b9968c1671..2949da24267f 100644 --- a/configs/e850-96_defconfig +++ b/configs/e850-96_defconfig @@ -11,6 +11,7 @@ CONFIG_DEFAULT_DEVICE_TREE="exynos/exynos850-e850-96" CONFIG_SYS_LOAD_ADDR=0x80000000 # CONFIG_AUTOBOOT is not set # CONFIG_DISPLAY_CPUINFO is not set +CONFIG_CMD_RNG=y # CONFIG_NET is not set CONFIG_CLK_EXYNOS850=y # CONFIG_MMC is not set