From patchwork Mon Sep 16 09:41:48 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Neil Armstrong X-Patchwork-Id: 829002 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:4187:b0:367:895a:4699 with SMTP id ei7csp695214wrb; Mon, 16 Sep 2024 02:42:19 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWkfh4qhiKxX5d55ouisMTAKup2dVjy9Uc20OHDNM+UbfXegbBrapsC5JPf3dcH/Yd4f64HdA==@linaro.org X-Google-Smtp-Source: AGHT+IEmrGaM5CPv8X6m+NOymD6d7uTvdcNFAb7GX+IngsrU1s4HcVQoZ8aHLvKfzxYvgiT6HrRb X-Received: by 2002:a5d:46c2:0:b0:371:8685:84c with SMTP id ffacd0b85a97d-378c27b0c2dmr8709643f8f.15.1726479739186; Mon, 16 Sep 2024 02:42:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1726479739; cv=none; d=google.com; s=arc-20240605; b=CxTw4rDwiCs9N8pWqayqghyDEl+6be4QclDQZTd5JntaDeuKijF1FHhYy7hDoo6oK/ 5hoVtNkwNSFpygk93McMG9kIl7+/hgR5rX9luYD66eYjilabR8mAFe6wJfDtNha/xMHw jkuNEHzYO/R7YZmN/3UowqMHrRH+iR0ZVFMrOhWioVrOzCdetLoJay5HXUi5BYJRSvaV pFohCsRk0KIzxhJgncG+wtKU6amw6oPedMnG3SAGO6xy2NcsUvQ7V2V2g3t57r1n+J40 f6cX/smj9f+OqP3K0DX56Xd12YxQ4uxiaIaizpMedeoot6XBOhNHXEmhah941Lq3ffQz ZeZA== 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=O59TxTW0HDIbwPHxy3+eSERFQazILORdcosjvsbEYTo=; b=PMHt9k26GBs+W7PErXkx5CJzFBqkBK0EfbdojloLG+RCZBJTDfaRj1fV1TNASdpAp9 ncGfjXGJ2BYpv7sdI2Yx6AlALFasuiMmwrqLQ/DPdFp//MDwYCkeqR/yPC7/1AaS6kjz A9JfD5lY0O88OIugpjmJHiMgNqyQ1emr76l5Vlyrq56eDG41OJ32u/McyaS6W8AHGxd4 5wWEcYsaf1W7+kGEhX37SHt2i0sp3XaA7NPHq0wCqen6YSEKXUFhBnsCphVMtX1U0H2N 9mHPMxBCa0ctVGFYotNL1HzqqqBRNUyYCfCVbx9ZnjFqAVfx//R7lHCi1ch0hPyDhEF+ NVrA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=OJq+ODCi; 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 ffacd0b85a97d-378e78194c4si1977525f8f.795.2024.09.16.02.42.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Sep 2024 02:42:19 -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=OJq+ODCi; 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 33E9E88ED2; Mon, 16 Sep 2024 11:42:01 +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="OJq+ODCi"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 46C5488EB8; Mon, 16 Sep 2024 11:41:59 +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-x32f.google.com (mail-wm1-x32f.google.com [IPv6:2a00:1450: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 D0EDE88EC0 for ; Mon, 16 Sep 2024 11:41: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=neil.armstrong@linaro.org Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-42cba8340beso32542085e9.1 for ; Mon, 16 Sep 2024 02:41:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1726479714; x=1727084514; 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=OJq+ODCiVTTFb9yIQtL528oyN4yx93ZuUlGu3ZlwFhzbMUgLMgAHyvNkVQ621fGxn+ tdx3KeXBfjbvjQhLofIgdFaeUVkc3GtFeH/2G5Vi3camenAzfQSGHQcQXkkNiQkB/fb4 iriLoblZBH+HZIJp+AwsGcEbx6MYqY3kQ3WLj0YcbL+BOUNC9LXFmhmKFyXIFHNWUjLS CwTdRfVUHzWye/yqtwrSXthWuZR5MqLNhM0Spwl7/ZdUq1lw5mbocqYbncTUuky4T1UQ 3eGZSykb5ZecwfzUMsxKHcBCD+j52KuNOfHRxZFlSmxXT+e/rkaPejF9W7tiWrwHGAyw Op5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726479714; x=1727084514; 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=TW/ZK/gejszX4KAeE32sK/WKG3lj6zodGjIGKhk1IjEiYMxOQAMaxYOCAi4zy+k/0u Mx8A0I6BsOSMW6riI93qu/ryQXviv3Ta+Raj6vLMpk/oOJlKvc4Q6CrBk8KBUWdmNG65 9yE6dGkfnBcl9vZrsnZnQpBneNVKyAWfTxH99x8F+1UAasbo2E8UaVrReAHto2ZXBbPm lvA7R8lhCZAXkzd7Jm+7kxUiPkVFxUzTch26SB+x9FRwJ2thbSCcYhcrFtWteD9Ad0K+ Ue4v3wgDygmat+r4EitL2qWK9MwGVkS9XuzT/ynzgJTxppqD5BFE+rQe5CJJh4W/+yd7 vBKw== X-Forwarded-Encrypted: i=1; AJvYcCVefRYE+SKmTMfCCjXao7lhl9Kdg2cWRP1UbwseFJqeP3KQXgqObHCr8Vt7KOJoatmdvDuTkO0=@lists.denx.de X-Gm-Message-State: AOJu0Yw7U62AbHPlYzXe2LzwNw4EF/VlrzT6AB5029Yc4RlQXdPywWUG paGG840a/LrIVHLz8FhgxsMGdUw8hmT2IrId/W7JwOADtNsWrIwHaA7w9N7bRpU= X-Received: by 2002:a05:600c:4e87:b0:426:6fb1:6b64 with SMTP id 5b1f17b1804b1-42cbddcefd1mr132381365e9.7.1726479713594; Mon, 16 Sep 2024 02:41:53 -0700 (PDT) Received: from arrakeen.starnux.net ([2a01:e0a:982:cbb0:8261:5fff:fe11:bdda]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-42d9b05d4e1sm106398555e9.12.2024.09.16.02.41.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Sep 2024 02:41:53 -0700 (PDT) From: Neil Armstrong Date: Mon, 16 Sep 2024 11:41:48 +0200 Subject: [PATCH 1/2] board: libretech-ac: move board support into dedicated directory MIME-Version: 1.0 Message-Id: <20240916-u-boot-topic-dynamic-uuid-v1-1-7e4f48542a0f@linaro.org> References: <20240916-u-boot-topic-dynamic-uuid-v1-0-7e4f48542a0f@linaro.org> In-Reply-To: <20240916-u-boot-topic-dynamic-uuid-v1-0-7e4f48542a0f@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/ZANAwAKAXfc29rIyEnRAcsmYgBm5/1f6aRlN14iJL7c1sDv5qCCyozqru4Q5zrm6+23 bhtieFGJAjMEAAEKAB0WIQQ9U8YmyFYF/h30LIt33NvayMhJ0QUCZuf9XwAKCRB33NvayMhJ0QmiD/ 0cQGOKPkqX6cU0x9QJJO5kgeLxEWNCMmiaXRq+A2aNCQ+fs8HZdkCoeFGXp0G1UfOml8WdHK5x6lOi 5OffvM9k6XMNZAeHIE2hnoVEB44DlwfS3vOF1TA/YZF34KOmaCXetlguh1CCe5fmsPYHioItcckNK9 6fZd6LZ926SYgSZ0hoMkDNVehzNWM4x1za8B55gfVGlZ1G7eyz1NL3mQB2dwApKBGB8Z8Qk+KXkdvr m1w90E1RJD8rDrR65439Ile8kz6hWKqKSKCbQcXbyAEo/5YwHGTHGoVQ0P+V5/2SY5quPuoK1XaE5F wOXiNhhLzKCJm1ZFi1JC8ThN2n0wFCAvg3bv/NjQejJ1icKzhFD8EmYZH/N5wAVRC6O9rcnnSTzEv7 rMbgJ6gUDhcHWYa+0qtUPwaD98HrpbedfOyvdHvQhkpUKyAQb6TeduMIdmwnn8MdyxGetcR/14gWiP FKXMC/AZ7mmvBa2Vi60qtMoOkbepcYH+o8W9JTCaYfct9gVcKVxNbyLYBnWTny7rmXbO92CfHm1jf0 J/9/w90cslrXf/oB3/OdQ8MbQhgWwlNKs41cq2nlbmc+Nmp1uM0PNY84db/3brrA1WLJyHvALwpT3Y n/1/jzeknh4zYPpP+G2RQ5h3Pz6hbmV0dyG4mI915l8LKYgzL9j7EmAuIh/w== 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 Mon Sep 16 09:41:49 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Neil Armstrong X-Patchwork-Id: 829001 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:4187:b0:367:895a:4699 with SMTP id ei7csp695177wrb; Mon, 16 Sep 2024 02:42:09 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVI8jRHSOQu1ud6STQRtEyg3X5RquImLFo+2X2pwMExhu+uURSkDnGoHO15lVr+wUffMk94mQ==@linaro.org X-Google-Smtp-Source: AGHT+IH958Skeft0ZvQX4JFXMI7JENBpCizLJxTlg/RD4tt5nvoHnrCB0wlPWREjsNzv8txjZ8n2 X-Received: by 2002:a5d:5d85:0:b0:378:c887:586d with SMTP id ffacd0b85a97d-378dd30948fmr5558715f8f.59.1726479728773; Mon, 16 Sep 2024 02:42:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1726479728; cv=none; d=google.com; s=arc-20240605; b=C1gWLCLwlAFhck2jgdsTXhwX7mVTBdtRxbXvKh6bGWf1jT/bk57GkG+uMrsnOzcx46 iXJ4Cp5lljG0jgsBoYFlKjM8lq06csguWf8r9df8pE+KnG3jGlPqEuuu9FuCXHoJBz5/ uBB7wei6a1rwu+UelgEAzgwWgJRXo8yxWPim4iSefc+i+QK2jx4WukrtBi0rir5PuOw5 W12DWecUVVdC7NbaChYbOhYtBEspMara4Sl+PN93YRus85PnBNSKS43/jtJ4OMKsNjLo 9veVbzg4mrPuZWFcbixzCrjHs6CFUAdjS6jo5mxPiK8Un5H6r/F48eQzBODMegnZ/P0r gqKA== 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=WXhkHhavhOUcV2XIl92zcF8hBcWoeJ6wr38Qdh/V28Q=; fh=8mxazqDz31lJ0r8qEz+IGph9VJJZL93R+noooY/0ZWU=; b=LPBI99oDy84m0u5nMIaWLI8/b7z206vtJg8uugS9b64xs0Qo7d+Dt6WXCdTDn4h8vg U1DcK96vxFI4SJzWHhFUixjtH783js0qgigKkfi3EF74WYcqzaw/97C6JuqvfxUdubSr NJARzEr7zvFB/6NCsqZ0OxIRB36FHmc3n3s4tuWYJcCbZvQziJpP5+JCm3VXYTw9Cen4 j1sR1U62reN4JNnWL6ADWoyPfS5giy/W++dJj4u4Nak4MC+jhOzrpndKZ7+zYSzd5CB9 ORZ79uCllIp6UPC6WCsKVLErmQqK3vEsJxH9tJ9VExlHSLEwGhLGOWDcwvqdcpvRw9d5 0uqA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=HtPPNaoX; 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 ffacd0b85a97d-378e780db26si2052471f8f.619.2024.09.16.02.42.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Sep 2024 02:42:08 -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=HtPPNaoX; 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 BB43D88EC0; Mon, 16 Sep 2024 11:42: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="HtPPNaoX"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id E7D2188EB6; Mon, 16 Sep 2024 11:41:57 +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-x32d.google.com (mail-wm1-x32d.google.com [IPv6:2a00:1450:4864:20::32d]) (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 5CD7D88EC4 for ; Mon, 16 Sep 2024 11:41: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=neil.armstrong@linaro.org Received: by mail-wm1-x32d.google.com with SMTP id 5b1f17b1804b1-42cc8782869so41658295e9.2 for ; Mon, 16 Sep 2024 02:41:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1726479715; x=1727084515; 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=WXhkHhavhOUcV2XIl92zcF8hBcWoeJ6wr38Qdh/V28Q=; b=HtPPNaoX3SzautAknmNIoiJiICq1aJDOGMkgkWdnSW3b9bURewtZc70JwMlqs43wzw jBs8AtguAyWgmN9UosIVPc0P8l3aQjVimpAPBW5Kgyt0MojtuJ9z14mSjpGkld2izAWC SMya7cirnS0qznyowTUAvjUmD79V8vhCahGl0vw7X8EYGy24ih6N3m9AilFr3jk3/yWm QOG6WrLgK5DjzoonkZ7nTUbJ1FJIbYE/DysRqUY6db5dXJ4mM+1M7XBeSdBmSmF6XXYg MxCieo20fH9nRqkj4qhiZy1E0xXyqrTBPHze2CwdQDVL3Rk6C3DS6QbCdxJvJlYmsKox Px2g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726479715; x=1727084515; 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=WXhkHhavhOUcV2XIl92zcF8hBcWoeJ6wr38Qdh/V28Q=; b=Par1CTY4V12C5Lg0LKMnIKo1dxqVza83lUSJWBE0B0s+A06yWTefIk07rXesKZkYVL MNxW4fpNDKAnLZXicGCVvgtQYbFZ0YLcQ4RZNjY4M3qBweR5ViziLPlJqMzKLUwuSPUx 39VNCWhHoIfaqp4vUOmQO1old2t4XuDH0en8tCxneqd1wbwWVeeTIoNfAquJfrlhkDYB O9J+QrlUHHxGL64rPocczKsQmOniJZFEizTedVrG0ObJ8WyeZGVy4KCYgKrpKorytc6M ag2h/E/D3XJprH33t2rqRKqhM838G3oh8FWSBdlqHGdSnXExNzlAcZ/4QmPUP2X2FLwZ YuzA== X-Forwarded-Encrypted: i=1; AJvYcCVkPqiBn3W27UjHWP6TmLv8Sll6V02bLEUcqTvZRNt3DDbVlWE/LoZImC5fqygx/UocaVmU2TE=@lists.denx.de X-Gm-Message-State: AOJu0Yw4yht3QBjIWHnarQTMm1v8YkEXvlqsaFuyZSBw93O5+IRcnWgv sYNutVfaGcnzVPkAitdCWNXxNLTZBYFfJBhl23Lu3/FBMZauGv82EQu2WpeSgp0= X-Received: by 2002:a05:600c:1d84:b0:42c:bae0:f066 with SMTP id 5b1f17b1804b1-42cdb539e84mr125983195e9.13.1726479714619; Mon, 16 Sep 2024 02:41:54 -0700 (PDT) Received: from arrakeen.starnux.net ([2a01:e0a:982:cbb0:8261:5fff:fe11:bdda]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-42d9b05d4e1sm106398555e9.12.2024.09.16.02.41.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Sep 2024 02:41:54 -0700 (PDT) From: Neil Armstrong Date: Mon, 16 Sep 2024 11:41:49 +0200 Subject: [PATCH 2/2] board: libre-computer: aml-s805-cc: Enable capsule updates MIME-Version: 1.0 Message-Id: <20240916-u-boot-topic-dynamic-uuid-v1-2-7e4f48542a0f@linaro.org> References: <20240916-u-boot-topic-dynamic-uuid-v1-0-7e4f48542a0f@linaro.org> In-Reply-To: <20240916-u-boot-topic-dynamic-uuid-v1-0-7e4f48542a0f@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=3162; i=neil.armstrong@linaro.org; h=from:subject:message-id; bh=o7r6FW1caQIgnnPyt9ucbd3e0OvrsME6kk385uYnm8s=; b=owEBbQKS/ZANAwAKAXfc29rIyEnRAcsmYgBm5/1f/bRi8MTXgfCO9XfMI3zP0d4Fh9YyBpxnieIV bcvwU66JAjMEAAEKAB0WIQQ9U8YmyFYF/h30LIt33NvayMhJ0QUCZuf9XwAKCRB33NvayMhJ0UmVEA DFEv63ttwwp/xr0NKOPjXDwI7urvHYtxgmSbTq3jnrhcKaeN89YfahBOxGq5YyfuilaXfVBqerhwY1 IG1N1wSPrd3jb+vU8nbqBsdjZWjQZ13CprhT3sHIZ7WiPf1lpdejQhvCWXLqPiQVu32OpQ5pUXftIU Lgs4leNMP+dLgaAE7Ez8tqqM94R5p/UOaLARW5JfzLwIBzJZMWNZqQa/u/kEacLS+7lfiuShdcgeVA FQjtC+vwPjGXZvmRuK5OU37uztah4jzY4ndY23Ujrj2FC/U7QRJeLkXFeveObER+zVA1k2lFhRnmjY 96F74W70pWFVkFHSP/i+9XlQUy7s/gAIOzgHPkOMuolFK4vgObDu4rEDulxR2f8yldOB/GnAmfuan+ sa/ZTFI6iBegLZpWpQ1SQwiiieA0aJJ3+BrVF1zBeuHTAusXwSsN0EnwC5baiHxdkv+X3MaeC4oCC/ tdLutDtvi92fwhtlV1MrosKaCBJv8qcsKT77T0ucxKv5iyNu4FnjNp/UUVwUQ0sppFmc7mrHm+1p2B Rr7xZcCSGXLQgHiwLcOy+J55sMcscbLs5QeosHedc6Acpxzq8uZOmYzBYlqQ2zVbcqAxYq2TegSuE1 Xm9KkMNM8dy61lr6IbiZkTGif/Ffp0UZVlJbykYDPVamOuEFbAx55PnwmNJQ== 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. Signed-off-by: Neil Armstrong Reviewed-by: Ilias Apalodimas --- board/libre-computer/aml-s805x-ac/aml-s805x-ac.c | 14 ++++++++++++++ configs/libretech-ac_defconfig | 5 +++++ 2 files changed, 19 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..ba14df54967 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,19 @@ #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, +}; + 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..f146a495654 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,7 @@ 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_MMC_MESON_GX=y CONFIG_MTD=y CONFIG_DM_MTD=y @@ -98,3 +101,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