From patchwork Tue Sep 17 12:34:45 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Neil Armstrong X-Patchwork-Id: 829242 Delivered-To: patch@linaro.org Received: by 2002:a5d:44c6:0:b0:367:895a:4699 with SMTP id z6csp259664wrr; Tue, 17 Sep 2024 05:35:03 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWYhkq8SYota2n/eQjfzgsxWlWcl2JQD1R/3mut0wruKZU+6GRgsdKs2RDTVMH5bZgNKMhiHw==@linaro.org X-Google-Smtp-Source: AGHT+IGGvg4Yspi7QhqEgxrazh7r686lBMxb1PhLCncbrcG5QwjN4wgK8DJSanYP+4Fnt6H6DfTh X-Received: by 2002:a2e:1312:0:b0:2f5:1ec5:f4fb with SMTP id 38308e7fff4ca-2f79190619amr59420801fa.13.1726576503530; Tue, 17 Sep 2024 05:35:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1726576503; cv=none; d=google.com; s=arc-20240605; b=jK2V8KCbIqRgvpmYrn7cJ3LxZGOK/OqdkRsml5V67GyNGvc8VZT24sSm5ohFeMRqF2 ecZdw3O+beSyYpjh3ZhkWIdgt0PjwBNPOS8mwHQFvFIw0mvzwtr9wS9F+yMMaOHgDkoK yF/OJ0hNLJr+0QaNDmlOmBvWFdvT/gJPEaA/y+UpMvRRtQbY6XtObNCb6CVg3EvGjF9z xl+auqCn6SDaYOUGGIIdyavGZdQBJIZu9pDG1P1BQLL67R78x3JT5HkQvzve14IXqw01 /irk94Lmd5NTDQ73TIaqm6AU3CIHq4kwR69oqs9HWU8BEhAM5fqcplV6rGfhhs1n+lDs alUQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:cc:to:in-reply-to:references :message-id:content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=isM0wkxM75qh7yVsSrZ/ILYNAN2B3+md2rez5tZORVY=; fh=Qzz/bs4phcEIoM2+vNuCIOu7NYWkHInC8nCw9J9cZyY=; b=la79dmyPbQHOOlc9OfyBQEZGnh0KlGMojpoXUJm2S2Sgn+mHp0TALXnQJal7UBGjvP zgU3q/FFFFYDVy9kE+iqyaI9HlgUPH+rjRI6b6X2ZtCwWPTfRz1U8/oXEkPdQdQBMBKd kVGLMo9P1LftQIgXyHxveXGo0aiFTihdGn/HFvP1T76VaLlzkz5g97a1msgrSi2aK//0 1RvetzCWdsKHR4Tb4uPj87CpDpWOsv2UlLmIeJU8JE1Y7mtxsm2K7VypkYIgNCYc1WhJ qlZCpTH1JSD1xrVNNfPz3jrEjQs+Gm1ceur8tDzbq8nD6yErDSaduljSzJACykljjuEz LQMw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=pLup+ZLh; 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 4fb4d7f45d1cf-5c42bb5bd93si5017999a12.167.2024.09.17.05.35.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Sep 2024 05:35:03 -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=pLup+ZLh; 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 D846B88E70; Tue, 17 Sep 2024 14:34: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="pLup+ZLh"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 0489188E08; Tue, 17 Sep 2024 14:34:54 +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-wm1-x330.google.com (mail-wm1-x330.google.com [IPv6:2a00:1450:4864:20::330]) (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 F100E88E53 for ; Tue, 17 Sep 2024 14:34:51 +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=neil.armstrong@linaro.org Received: by mail-wm1-x330.google.com with SMTP id 5b1f17b1804b1-42cae102702so36013855e9.0 for ; Tue, 17 Sep 2024 05:34:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1726576491; x=1727181291; darn=lists.denx.de; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=isM0wkxM75qh7yVsSrZ/ILYNAN2B3+md2rez5tZORVY=; b=pLup+ZLhvatoyVx+OYyd4ZFqZLF2JL+GzXR3U4U6DOR0WjGoLBjcZwjdEZA2gpAU6Y Tpa2y67Ah+PDIrDiBdDyA5ZJd/rIkMimGwSOcQtm0plaafvOEM5YoqXbKTdFhAJ7F/z6 jTIWI9jh4LJSI15CkkJ9uW9QfHecakRu7agtjRl2UBUnmGxSBOLrbNXocTsnA/LnwFZ+ 30SDhxNgScJWav3tMQ/YZzI/WrzLlbOVysmoSw7vDecL6kCBjjlqrYiarkp5V8Oi10Y8 vkaSMUvpYw3BGkhshMT7YRUsb8aQnOyZk1FC41TSDtNsY3Io2CLNkSfxSrgkrC8tnYcJ 3kEQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726576491; x=1727181291; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=isM0wkxM75qh7yVsSrZ/ILYNAN2B3+md2rez5tZORVY=; b=so3UyQT5I63xaymjUgVsBiRACk85Hre+k6gHbGO5npXZ0ilHb1heQuHxSnC1qvPj3v gnStVubaAOq4FS3IG5BfbFsHYnQl9Jfq6sjJcuqvaJVmS+LEDD/maDLrzNvrZmj+NL5J A2DUdb51RBlVQ1OGjD3C7COkn6YgHGXkbWO+Qucrh4Jrl0ozp4kYPCXtXgvKuHgFq6fi YNT8LqGQJcS+Y7AUsuRGf6i88rRo+tZ/kLeJCDRGKcFIEV5HPkKh4iOi/bdxTOzqX0vE FSnofJ3pgR+imsOJBoPZqOiSR1m7aZqDYM4xx5SZx8FDuL3FBpQGf7kgg54WbVXgBzSn tH5Q== X-Forwarded-Encrypted: i=1; AJvYcCUlxY1mZ85gW/ieyIJQcNug21ALQMAwnXQpadLzgARrEXmDRk4xAhUjGse1ATobxPgYOKTxU5o=@lists.denx.de X-Gm-Message-State: AOJu0Ywgsj0bvSEeoUs6tMtbXLebh1CI9mDTr8USM+DR6G0gae/U7M6i AMtkrVsCNNdaM91n1vEtYUZcUNROAecebjy1qhnbDqH2mVOx+23J9r6U9RgZwtEdkU/rhZ6N2xK x X-Received: by 2002:a5d:4fc7:0:b0:374:c8dd:ea47 with SMTP id ffacd0b85a97d-378d6253618mr7621200f8f.50.1726576491083; Tue, 17 Sep 2024 05:34:51 -0700 (PDT) Received: from arrakeen.starnux.net ([2a01:e0a:982:cbb0:52eb:f6ff:feb3:451a]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-378e73e80eesm9381772f8f.30.2024.09.17.05.34.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Sep 2024 05:34:50 -0700 (PDT) From: Neil Armstrong Date: Tue, 17 Sep 2024 14:34:45 +0200 Subject: [PATCH v2 1/2] board: libretech-ac: move board support into dedicated directory MIME-Version: 1.0 Message-Id: <20240917-u-boot-topic-dynamic-uuid-v2-1-416e39c6e271@linaro.org> References: <20240917-u-boot-topic-dynamic-uuid-v2-0-416e39c6e271@linaro.org> In-Reply-To: <20240917-u-boot-topic-dynamic-uuid-v2-0-416e39c6e271@linaro.org> To: Tom Rini Cc: u-boot-amlogic@groups.io, u-boot@lists.denx.de, Ilias Apalodimas , Da Xue , Neil Armstrong X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=openpgp-sha256; l=4053; i=neil.armstrong@linaro.org; h=from:subject:message-id; bh=PkfVFZOTXdUMNl5kZ51pRdlVcMTOlH1wQ6hn+etanQs=; b=owEBbQKS/ZANAwAKAXfc29rIyEnRAcsmYgBm6XdnYz6f82WCIqUbu89MJrFSf11/WQgColC8lCjo CopY916JAjMEAAEKAB0WIQQ9U8YmyFYF/h30LIt33NvayMhJ0QUCZul3ZwAKCRB33NvayMhJ0aATD/ 43Fz2mKfTBggMmsmwiyhjlxJWtQYNefpUUz92IJzu/CY4jQTTzXKkUTj/UoP6MyDD5r4cHd9bsiB1i cAXSbSuWJRgeDRlENunenlaZLCkjBYB+76Qpj/Kxd281E3VrC42r9RS3UbhaBHrMSKYrywpe1H/wwE 9o45TwORFuYJZiKwq2sVc6jEfqxtWYWf/NX/cvU7VkA7FUQt6JUMM0x3v2Co0lXfIk1bCk/exepVjl md/6SbT00gakp+5XJlAsmbFFSbckJHyp/Jx5cXgT+wTMIslo+AMOmmtj5/OC3fTylQa/PGaNJKjjqA tXPngOPiHMmjtcJdJULdh/V7hvCgZCQoREwU1bq7op5FAFLDX/ThtA9M49zyyjm1oyJbBQKajUj17S r/f67laF8USdUGAvWtpkIAYcp2ko9/NnhiDmpJvGCQnAV+L6b79+3mkI+g+OQkdzv4CrCZCjHvD2Fe 0RhoERhOIqTzPwvTIaNjPBZMPCOA17GALhi1Dhbk4/Z+Mnq3oizRxn7V1u1diYJ/PpSixy3F36LtFU /J+qN7OGLpqR7ifvyx7g9l9Tl1a5BTpKzifbe99GoCd3whn4vRYeFUH87oyX7ZRPPwcQQwXcPNrM4j JMeT7mkP7eDARbq2QQhMheKHXd2dCKsfHMep4uIiNddkeKJvG440733al/1g== X-Developer-Key: i=neil.armstrong@linaro.org; a=openpgp; fpr=89EC3D058446217450F22848169AB7B1A4CFF8AE 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 The libretech-ac aka aml-s805x-ac supports mainline U-boot from a dedicated SPI flash, move the board support into a dedicated vendor/board subdirectory in order to support vendor specific customization. It also aligns with the vendor downstream changes. Signed-off-by: Neil Armstrong --- board/amlogic/p212/MAINTAINERS | 2 - board/libre-computer/aml-s805x-ac/MAINTAINERS | 8 ++++ board/libre-computer/aml-s805x-ac/Makefile | 6 +++ board/libre-computer/aml-s805x-ac/aml-s805x-ac.c | 47 ++++++++++++++++++++++++ configs/libretech-ac_defconfig | 2 + 5 files changed, 63 insertions(+), 2 deletions(-) diff --git a/board/amlogic/p212/MAINTAINERS b/board/amlogic/p212/MAINTAINERS index b2e3205fdf0..e73a4e52c1f 100644 --- a/board/amlogic/p212/MAINTAINERS +++ b/board/amlogic/p212/MAINTAINERS @@ -5,11 +5,9 @@ L: u-boot-amlogic@groups.io F: board/amlogic/p212/ F: include/configs/p212.h F: configs/khadas-vim_defconfig -F: configs/libretech-ac_defconfig F: configs/libretech-cc_defconfig F: configs/libretech-cc_v2_defconfig F: configs/p212_defconfig F: doc/board/amlogic/p212.rst -F: doc/board/amlogic/libretech-ac.rst F: doc/board/amlogic/libretech-cc.rst F: doc/board/amlogic/khadas-vim.rst diff --git a/board/libre-computer/aml-s805x-ac/MAINTAINERS b/board/libre-computer/aml-s805x-ac/MAINTAINERS new file mode 100644 index 00000000000..7cbc08aeb6c --- /dev/null +++ b/board/libre-computer/aml-s805x-ac/MAINTAINERS @@ -0,0 +1,8 @@ +LIBRE-COMPUTER AML-S805X-AC +M: Neil Armstrong +S: Maintained +L: u-boot-amlogic@groups.io +F: board/amlogic/aml-s805x-ac/ +F: include/configs/libretech-ac.h +F: configs/libretech-ac_defconfig +F: doc/board/amlogic/libretech-ac.rst diff --git a/board/libre-computer/aml-s805x-ac/Makefile b/board/libre-computer/aml-s805x-ac/Makefile new file mode 100644 index 00000000000..b4367ea522b --- /dev/null +++ b/board/libre-computer/aml-s805x-ac/Makefile @@ -0,0 +1,6 @@ +# SPDX-License-Identifier: GPL-2.0+ +# +# (C) Copyright 2016 BayLibre, SAS +# Author: Neil Armstrong + +obj-y := aml-s805x-ac.o diff --git a/board/libre-computer/aml-s805x-ac/aml-s805x-ac.c b/board/libre-computer/aml-s805x-ac/aml-s805x-ac.c new file mode 100644 index 00000000000..ae9834c0bf8 --- /dev/null +++ b/board/libre-computer/aml-s805x-ac/aml-s805x-ac.c @@ -0,0 +1,47 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Copyright (C) 2016 BayLibre, SAS + * Author: Neil Armstrong + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define EFUSE_SN_OFFSET 20 +#define EFUSE_SN_SIZE 16 +#define EFUSE_MAC_OFFSET 52 +#define EFUSE_MAC_SIZE 6 + +int misc_init_r(void) +{ + u8 mac_addr[EFUSE_MAC_SIZE + 1]; + char serial[EFUSE_SN_SIZE + 1]; + ssize_t len; + + if (!eth_env_get_enetaddr("ethaddr", mac_addr)) { + len = meson_sm_read_efuse(EFUSE_MAC_OFFSET, + mac_addr, EFUSE_MAC_SIZE); + mac_addr[len] = '\0'; + if (len == EFUSE_MAC_SIZE && is_valid_ethaddr(mac_addr)) + eth_env_set_enetaddr("ethaddr", mac_addr); + else + meson_generate_serial_ethaddr(); + } + + if (!env_get("serial#")) { + len = meson_sm_read_efuse(EFUSE_SN_OFFSET, serial, + EFUSE_SN_SIZE); + serial[len] = '\0'; + if (len == EFUSE_SN_SIZE) + env_set("serial#", serial); + } + + return 0; +} diff --git a/configs/libretech-ac_defconfig b/configs/libretech-ac_defconfig index 6ad04570022..11d9795e05d 100644 --- a/configs/libretech-ac_defconfig +++ b/configs/libretech-ac_defconfig @@ -1,5 +1,7 @@ CONFIG_ARM=y CONFIG_SYS_CONFIG_NAME="libretech-ac" +CONFIG_SYS_VENDOR="libre-computer" +CONFIG_SYS_BOARD="aml-s805x-ac" CONFIG_ARCH_MESON=y CONFIG_TEXT_BASE=0x01000000 CONFIG_NR_DRAM_BANKS=1 From patchwork Tue Sep 17 12:34:46 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Neil Armstrong X-Patchwork-Id: 829243 Delivered-To: patch@linaro.org Received: by 2002:a5d:44c6:0:b0:367:895a:4699 with SMTP id z6csp259703wrr; Tue, 17 Sep 2024 05:35:13 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCU79IzdivOF7PYyXsbSCZDliG1Qm3N3lmlT1RC+XLKNgVoOHmgmexU7CEEMR5BY47RqO35LFQ==@linaro.org X-Google-Smtp-Source: AGHT+IFbuCbo4E36r0ZHZPMJUSk9BZVP9FyGjsHNfitOW1Tc/NxBjpjoMzzcTWnVOwR/0Jul1xBS X-Received: by 2002:a17:907:7210:b0:a7d:a453:dba1 with SMTP id a640c23a62f3a-a902a5c502dmr2050565966b.20.1726576512796; Tue, 17 Sep 2024 05:35:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1726576512; cv=none; d=google.com; s=arc-20240605; b=GkoWOaRrrrLa8urxzONJS43XQu6tVsypqZc4rHFypKgIAsaGg8v4FXSXMgKS+kOD0R uflDgR2pxCNiRm+QWm9AQjtmopqmvA/KLDKaZPneyIlieURLGdKGAVv5Vv5BNKXmgpCv QJ6/NHcVlydP2KB86dhHJQALMEdnbwVWzaSYl3xbHbxaWx3r1u9hAIHCO93yEcmR4SLq cyDr0g5suXdaMlAqWf+0mXhRoyxbzVEJe8HTmnylQApeXU4xte1fODvCjtGlTbQc55a9 1L3q9/T+eK/mgs4XGU/EA24lib6UKzsmpCUFZdaqsaLytEShluI55yG5bKdsotHJflgT uvKw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:cc:to:in-reply-to:references :message-id:content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=aJrg2ShcpGeoJr2BRuQhpu5iq0h9WOCdFu465pSgpys=; fh=Cu35qLLxjLIFmBRxhsc3Nk868fQXC/S5DlNk/u2tFzw=; b=eBQegWkZTD9xL5PSIW8FU/me9FHtXAlaIfx/mJcschcIJklQ2tB2DLzw/MGmcB2ndE 5dT7XmkU9HJuzUJh/o6lfuzeaOAAjOLaDzDT/654hSPV1WMWpgrfBghAyDt7M6YDl7MQ dDcX/SOtDexZAyW2vime3CtTqeLTHMVL+0vCgVsxyLO7T3BseJDDbXJzuuMUHazxH3TE P0XQktrDQSnLeXIA14GdjukYvyBPRo6sCeqgj49FQC9FhQxm+cg/zd9DSai08WnuOaIp BlNU1t0udp5MArmmy3JWjNEwaszQsWDcTdNhbZOQrh0DkaJi5slSnJy2qmQPT537fFD1 iDtw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="cN/Oe0Le"; 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-a906109a387si522822366b.9.2024.09.17.05.35.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Sep 2024 05:35:12 -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="cN/Oe0Le"; 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 3AD5188E78; Tue, 17 Sep 2024 14:34:56 +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="cN/Oe0Le"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 24D0388E78; Tue, 17 Sep 2024 14:34:55 +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-wr1-x42d.google.com (mail-wr1-x42d.google.com [IPv6:2a00:1450:4864:20::42d]) (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 C16EE88E5E for ; Tue, 17 Sep 2024 14:34: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=neil.armstrong@linaro.org Received: by mail-wr1-x42d.google.com with SMTP id ffacd0b85a97d-374c5bab490so4428038f8f.1 for ; Tue, 17 Sep 2024 05:34:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1726576492; x=1727181292; darn=lists.denx.de; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=aJrg2ShcpGeoJr2BRuQhpu5iq0h9WOCdFu465pSgpys=; b=cN/Oe0LeJ6VLzjk07o0HMogKXbFOlJTSEO+TRe2IjxiHgCTe5dKhzNJ54yt5ek0roL MAHLPSB6Z5HUubDLwNam0kHVy7wNK00nsqauNA9rwyF4G6x3SG5Pq5+fT1QT0TkDv72e 9HaMQSBOxIq7ICx8D5/2rnfgOny4c6O9kMi3MgCZ295eYnKofi91iiydBZsu1+ACX6ad vSDFqq0OR1fT7RI01Q+ugfp1eJuJ1ggkxu01Ziofa8oaC1qmGnwtxnsoTT/JW/pGjNhr g0cVoi6Od6XmE3q7zAzpA8ICjddsIXLIPBbgOlAljGhrzMcIJ7wkVIAL+GWCAVz9fuvF jCkg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726576492; x=1727181292; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=aJrg2ShcpGeoJr2BRuQhpu5iq0h9WOCdFu465pSgpys=; b=LXB7yJ3qewsva/Y34Wg7tfluD7ox7PIAKxLugYX65lgpidG91r5yjssLwZ7xmlaoLd KrcABz482rvbPxRbzqdBUUDQlRYlwxQa+I25qfMimRLPqtmVdXjj82wsawn9gHrDwFya iVm/4TF3Y+iHbybyd9/P8RdnLEPsSWtVy3AfHKnIqKUYaJVm2b8/6OzHqkox/IN2VA7A sNLQgPjQGwOtqlc8D2SaDVKaAH9LyqDxH9amqJIvBjhza7/AFF1PSyuVHcxCLHNfz2dB bHbTHr+u+qbp5zIX32RMTVar+KmzEX0j6dCGZ+8Rm/3D19S0wYWj4e8g8n230N7wJ76u N3IA== X-Forwarded-Encrypted: i=1; AJvYcCWGZKu6I4c879IaQFaU5EN/a5Iutb5QVmsVR/uo0cQzu0h28ZBTKxhkti03A3LFdsrurC1aJ1I=@lists.denx.de X-Gm-Message-State: AOJu0YyDkXaTtNaxI42Mjj1Wdkjr3F831YetVCIz730VkiYnHhv++Ca+ tQpgMDyWG5e9GmJiDCCBB4Tv2ePE77vdR/bwZANyIeF/LRHy057dCEYzD9VF1Yg= X-Received: by 2002:a05:6000:1249:b0:374:c400:8556 with SMTP id ffacd0b85a97d-378c27a8a80mr10214214f8f.11.1726576492079; Tue, 17 Sep 2024 05:34:52 -0700 (PDT) Received: from arrakeen.starnux.net ([2a01:e0a:982:cbb0:52eb:f6ff:feb3:451a]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-378e73e80eesm9381772f8f.30.2024.09.17.05.34.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Sep 2024 05:34:51 -0700 (PDT) From: Neil Armstrong Date: Tue, 17 Sep 2024 14:34:46 +0200 Subject: [PATCH v2 2/2] board: libre-computer: aml-s805x-cc: Enable capsule updates MIME-Version: 1.0 Message-Id: <20240917-u-boot-topic-dynamic-uuid-v2-2-416e39c6e271@linaro.org> References: <20240917-u-boot-topic-dynamic-uuid-v2-0-416e39c6e271@linaro.org> In-Reply-To: <20240917-u-boot-topic-dynamic-uuid-v2-0-416e39c6e271@linaro.org> To: Tom Rini Cc: u-boot-amlogic@groups.io, u-boot@lists.denx.de, Ilias Apalodimas , Da Xue , Neil Armstrong X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=openpgp-sha256; l=3593; i=neil.armstrong@linaro.org; h=from:subject:message-id; bh=zPvetaBnOXIbwLciZ582jmJJxdSfwJxTLM7x5mHwgFs=; b=owEBbQKS/ZANAwAKAXfc29rIyEnRAcsmYgBm6XdoaNLyaTdYxEmyzmMqLRFS57XgKpKPFqjoKcxS LiH0Vh+JAjMEAAEKAB0WIQQ9U8YmyFYF/h30LIt33NvayMhJ0QUCZul3aAAKCRB33NvayMhJ0XsLD/ oCm3/Imtrd3QplxZRmxzJ/Lx58OEbwSkyn4FY+0zY2adP4e8WfoFkVM7fooJjvODV44c4tkJrxuIkm h1pdCD0C5Pva7yLHEKBSDfHcV5fzoTT1hAdVv5vYGdrAoOHK1mkqbjpxtRFyaMKeiGiZb6ZzMSRvA+ LzoZwHcmnYjlbAvlsyYtDaqh9qQPBwzFYhnnQ9oJ9PcJ3iZeVGycKIgp4TKRPcKeP3UxIQ9d8HBEV1 5+TJarMPT7Jaa2xgoKM2bVcKDPcp2mVeysC8R3hNHCorKnY+MSPNI3Zu20eYVx1xuMBvnLi2Pl5q+g 60B1jM5H6xHL5jMU84w1IUiZgluXm0iH/O/mr/3eUMmhWHjoAWzAzt6jxIrfu1M5SPcd9a6X1luxzk E+m4qI4A1czl4kCv5ZQAVDrrblAnP1s/icb/U1IUkgPj0UPeUHROepsOm2ou0F8Tx+kiiHBe9x00X/ ecFDDRx6xR7Jsr6pxvkR8eppJf8XRqqQmVMEq6Mc/QvjAZvDfafuyRaDaFPJId9FM97rzuQNSVFMkn x5UNKAPSGAyt5fwJcDtLUXKd3HzPYH9bx6bNntvDXa1eZjcU839MBMl4WFB9Zrkpz2rON4/rtluhJd tlqXY5wE/fnSBSMyg6BHNeEgKZAwYA8gFRnPaFEw/Id2CAnqC6s5xT+UrS3w== X-Developer-Key: i=neil.armstrong@linaro.org; a=openpgp; fpr=89EC3D058446217450F22848169AB7B1A4CFF8AE 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 Since the aml-s805-cc works well using EFI, and now the capsule updates backend has been merged, let's enable the missing configs and add the required structures to support it. The GUID is dynamically generated for the board, to get it: => efidebug capsule esrt ======================================== ESRT: fw_resource_count=1 ESRT: fw_resource_count_max=1 ESRT: fw_resource_version=1 [entry 0]============================== ESRT: fw_class=B8079027-9B2C-57D4-86AA-CC782ADA598C ESRT: fw_type=unknown ESRT: fw_version=0 ESRT: lowest_supported_fw_version=0 ESRT: capsule_flags=0 ESRT: last_attempt_version=0 ESRT: last_attempt_status=success ======================================== On the host (with the aml_encrypt_gxl result binary): $ eficapsule --guid B8079027-9B2C-57D4-86AA-CC782ADA598C -i 1 u-boot.bin u-boot.cap On the board (from USB disk containing u-boot.cap at root): => load usb 0:1 $kernel_addr_r u-boot.cap => efidebug capsule update $kernel_addr_r The binary will then be flashed on the SPI. Reviewed-by: Ilias Apalodimas Signed-off-by: Neil Armstrong --- board/libre-computer/aml-s805x-ac/aml-s805x-ac.c | 24 ++++++++++++++++++++++++ configs/libretech-ac_defconfig | 6 ++++++ 2 files changed, 30 insertions(+) diff --git a/board/libre-computer/aml-s805x-ac/aml-s805x-ac.c b/board/libre-computer/aml-s805x-ac/aml-s805x-ac.c index ae9834c0bf8..94cf5b4361f 100644 --- a/board/libre-computer/aml-s805x-ac/aml-s805x-ac.c +++ b/board/libre-computer/aml-s805x-ac/aml-s805x-ac.c @@ -8,6 +8,7 @@ #include #include #include +#include #include #include #include @@ -19,6 +20,29 @@ #define EFUSE_MAC_OFFSET 52 #define EFUSE_MAC_SIZE 6 +struct efi_fw_image fw_images[] = { + { + .fw_name = u"AML_S805X_AC_BOOT", + .image_index = 1, + }, +}; + +struct efi_capsule_update_info update_info = { + .dfu_string = "sf 0:0=u-boot-bin raw 0 0x10000", + .num_images = ARRAY_SIZE(fw_images), + .images = fw_images, +}; + +#if IS_ENABLED(CONFIG_SET_DFU_ALT_INFO) +void set_dfu_alt_info(char *interface, char *devstr) +{ + if (strcmp(interface, "ram") == 0) + env_set("dfu_alt_info", "fitimage ram 0x08080000 0x4000000"); + else if (IS_ENABLED(CONFIG_EFI_HAVE_CAPSULE_SUPPORT)) + env_set("dfu_alt_info", update_info.dfu_string); +} +#endif + int misc_init_r(void) { u8 mac_addr[EFUSE_MAC_SIZE + 1]; diff --git a/configs/libretech-ac_defconfig b/configs/libretech-ac_defconfig index 11d9795e05d..7763a14f203 100644 --- a/configs/libretech-ac_defconfig +++ b/configs/libretech-ac_defconfig @@ -35,6 +35,7 @@ CONFIG_SYS_MAXARGS=32 # CONFIG_CMD_IMI is not set CONFIG_CMD_ADC=y CONFIG_CMD_DFU=y +CONFIG_CMD_NVEDIT_EFI=y CONFIG_CMD_GPIO=y # CONFIG_CMD_LOADS is not set CONFIG_CMD_MMC=y @@ -42,6 +43,7 @@ CONFIG_CMD_SF_TEST=y CONFIG_CMD_SPI=y CONFIG_CMD_USB=y CONFIG_CMD_USB_MASS_STORAGE=y +CONFIG_CMD_EFIDEBUG=y # CONFIG_CMD_SETEXPR is not set CONFIG_CMD_REGULATOR=y CONFIG_OF_CONTROL=y @@ -49,6 +51,8 @@ CONFIG_ENV_IS_IN_SPI_FLASH=y CONFIG_SYS_RELOC_GD_ENV_ADDR=y CONFIG_SARADC_MESON=y CONFIG_DFU_RAM=y +CONFIG_DFU_SF=y +CONFIG_SET_DFU_ALT_INFO=y CONFIG_MMC_MESON_GX=y CONFIG_MTD=y CONFIG_DM_MTD=y @@ -98,3 +102,5 @@ CONFIG_VIDEO_BMP_RLE8=y CONFIG_BMP_16BPP=y CONFIG_BMP_24BPP=y CONFIG_BMP_32BPP=y +CONFIG_EFI_RUNTIME_UPDATE_CAPSULE=y +CONFIG_EFI_CAPSULE_FIRMWARE_RAW=y