diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000000000000000000000000000000000000..7e1ef7361c0c425300666c33c07b395359100e58 --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +*.bz2 filter=lfs diff=lfs merge=lfs -text diff --git a/.lfsconfig b/.lfsconfig new file mode 100644 index 0000000000000000000000000000000000000000..f192e601700b16942a02b1cd06d325174c1c7bb1 --- /dev/null +++ b/.lfsconfig @@ -0,0 +1,2 @@ +[lfs] + url = https://artlfs.openeuler.openatom.cn/src-openEuler/uboot-tools diff --git a/backport-Provide-a-fallback-to-smbios-tables.patch b/backport-Provide-a-fallback-to-smbios-tables.patch deleted file mode 100644 index 0a58f2684c719ca6468e4fed43282fe50eedeeda..0000000000000000000000000000000000000000 --- a/backport-Provide-a-fallback-to-smbios-tables.patch +++ /dev/null @@ -1,686 +0,0 @@ -From patchwork Thu Dec 7 09:18:49 2023 -Content-Type: text/plain; charset="utf-8" -MIME-Version: 1.0 -Content-Transfer-Encoding: 7bit -X-Patchwork-Submitter: Ilias Apalodimas -X-Patchwork-Id: 1873089 -Return-Path: -X-Original-To: incoming@patchwork.ozlabs.org -Delivered-To: patchwork-incoming@legolas.ozlabs.org -Authentication-Results: legolas.ozlabs.org; - dkim=pass (2048-bit key; - unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 - header.s=google header.b=SyQQL6ZG; - dkim-atps=neutral -Authentication-Results: legolas.ozlabs.org; - spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de - (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; - envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org) -Received: from phobos.denx.de (phobos.denx.de - [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) - (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) - key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) - (No client certificate requested) - by legolas.ozlabs.org (Postfix) with ESMTPS id 4Sm7xz1DLXz23nD - for ; Thu, 7 Dec 2023 20:19:19 +1100 (AEDT) -Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) - by phobos.denx.de (Postfix) with ESMTP id 83BF287243; - Thu, 7 Dec 2023 10:19:05 +0100 (CET) -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="SyQQL6ZG"; - dkim-atps=neutral -Received: by phobos.denx.de (Postfix, from userid 109) - id 46C3C87243; Thu, 7 Dec 2023 10:19:04 +0100 (CET) -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, - T_SCC_BODY_TEXT_LINE 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 21B8586FFE - for ; Thu, 7 Dec 2023 10:19:02 +0100 (CET) -Authentication-Results: phobos.denx.de; - dmarc=pass (p=none dis=none) header.from=linaro.org -Authentication-Results: phobos.denx.de; - spf=pass smtp.mailfrom=ilias.apalodimas@linaro.org -Received: by mail-wm1-x330.google.com with SMTP id - 5b1f17b1804b1-40c2c65e6aaso1041145e9.2 - for ; Thu, 07 Dec 2023 01:19:02 -0800 (PST) -DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; - d=linaro.org; s=google; t=1701940741; x=1702545541; 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=vcf8Uy8SIKdN9TXuCeQubka7IJIfrvGMGj1JoUebFs0=; - b=SyQQL6ZGyEFpFFqauSbHRSSNY+KOw9ohESTeXyy7RkWEEIFaK7yPwRRy9NZX+DJLAJ - ECaT3Bchk61s+E1ZsuxrqdlxEYWDULw+4O2hm22gVZjL5L6r4+NwNgCHwzYW/bcro87o - KEGRF7CXG50v6mvrjAOHoy2LbojZLR9d7fjO4gmGtihdnTMOW1cjtrX/3Seiy99QoTK6 - 5Hs119W/hO0/5AE1VVSiIxV1Xx+qYcAHvQqcEEkBCKR2MpHTauUEonUf1LC5LKK2gKG5 - UEzq7XLrPki8hih4EcWsoctpdPp4kBtvpVSSshji9yxDX3EXKzcfA8xyqrB+5qKJU100 - zZ7A== -X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; - d=1e100.net; s=20230601; t=1701940741; x=1702545541; - 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=vcf8Uy8SIKdN9TXuCeQubka7IJIfrvGMGj1JoUebFs0=; - b=L6Ejctx8u+W0IeEi5FfC1q0ah2NYKTScSheLqomwMY3Q4/BPiEUP7KUarxUKsRwI/3 - yP4rTVAXqlGbT6kFKq3jrxXlRS4HIRZxtFbgHZEKuBnXpkHCQpvQwKUcYY9QkbfdZEir - 5YYfONEv2yTHHfoiBZiVmcPARIQ5+2ra+k493og2Bm0Hk5dVWyaHn/YY6Y+FCWH7ZYn0 - Eq1M9Ng8YB3oMx63KwV9XHBURccH8UdCqwsNDvk2gWLKdSvrjlFD7ExiySd90+i9+6vN - CMLoNESSYj2K9qW/sxbIDgUv1JwYCWgJrDejTzilfagawcPlKY2XtTnOlUsRryYrsPoq - RbZg== -X-Gm-Message-State: AOJu0YxG7g4q8NdX+N/0Mp5YNkHEVHntPyakSqHCtdqDzgaRcQCbtF0q - 2APTVIQc7yNsT16/19bvkV1NRw3x7lZmC4YcT+s= -X-Google-Smtp-Source: - AGHT+IFwnHtGX5IWm5lG5rRTsz6nU13lqUMnEUb8xEq/mngZuRtpzcNdrO7fNaBiIDDQLuKd+Y07Tw== -X-Received: by 2002:a05:600c:2184:b0:40b:dd1f:6dd1 with SMTP id - e4-20020a05600c218400b0040bdd1f6dd1mr1312043wme.240.1701940741617; - Thu, 07 Dec 2023 01:19:01 -0800 (PST) -Received: from localhost.localdomain (ppp046103111243.access.hol.gr. - [46.103.111.243]) by smtp.gmail.com with ESMTPSA id - u21-20020a05600c139500b00405d9a950a2sm1299003wmf.28.2023.12.07.01.19.00 - (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); - Thu, 07 Dec 2023 01:19:01 -0800 (PST) -From: Ilias Apalodimas -To: trini@konsulko.com, - sjg@chromium.org -Cc: sean.anderson@seco.com, neil.armstrong@linaro.org, - heinrich.schuchardt@canonical.com, mark.kettenis@xs4all.nl, - Ilias Apalodimas , u-boot@lists.denx.de -Subject: [PATCH 1/2 v3] smbios: Simplify reporting of unknown values -Date: Thu, 7 Dec 2023 11:18:49 +0200 -Message-Id: <20231207091850.17776-2-ilias.apalodimas@linaro.org> -X-Mailer: git-send-email 2.40.1 -In-Reply-To: <20231207091850.17776-1-ilias.apalodimas@linaro.org> -References: <20231207091850.17776-1-ilias.apalodimas@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 - -If a value is not valid during the DT or SYSINFO parsing, we explicitly -set that to "Unknown Product" and "Unknown" for the product and -manufacturer respectively. It's cleaner if we move the checks insisde -smbios_add_prop_si() and provide an alternative string in case the -primary is NULL or empty - -pre-patch dmidecode - -Handle 0x0001, DMI type 1, 27 bytes -System Information - Manufacturer: Unknown - Product Name: Unknown Product - Version: Not Specified - Serial Number: Not Specified - UUID: Not Settable - Wake-up Type: Reserved - SKU Number: Not Specified - Family: Not Specified - -[...] - -post-patch dmidecode: - -Handle 0x0001, DMI type 1, 27 bytes -System Information - Manufacturer: Unknown - Product Name: Unknown - Version: Unknown - Serial Number: Unknown - UUID: Not Settable - Wake-up Type: Reserved - SKU Number: Unknown - Family: Unknown -[...] - -While at it make smbios_add_prop_si() add a string directly if the prop -node is NULL and replace smbios_add_string() calls with -smbios_add_prop_si(ctx, NULL, ....) - -Signed-off-by: Ilias Apalodimas ---- -Changes since v2: -- refactor even more code and remove the smbios_add_string calls from the - main code. Instead use smbios_add_prop() foir everything and add a - default value, in case the parsed one is NULL or emtpy -Changes since v1: -- None - - lib/smbios.c | 73 +++++++++++++++++++++++++--------------------------- - 1 file changed, 35 insertions(+), 38 deletions(-) - --- -2.40.1 - -diff --git a/lib/smbios.c b/lib/smbios.c -index d7f4999e8b2a..444aa245a273 100644 ---- a/lib/smbios.c -+++ b/lib/smbios.c -@@ -102,9 +102,6 @@ static int smbios_add_string(struct smbios_ctx *ctx, const char *str) - int i = 1; - char *p = ctx->eos; - -- if (!*str) -- str = "Unknown"; -- - for (;;) { - if (!*p) { - ctx->last_str = p; -@@ -134,11 +131,18 @@ static int smbios_add_string(struct smbios_ctx *ctx, const char *str) - * - * @ctx: context for writing the tables - * @prop: property to write -+ * @dval: Default value to use if the string is not found or is empty - * Return: 0 if not found, else SMBIOS string number (1 or more) - */ - static int smbios_add_prop_si(struct smbios_ctx *ctx, const char *prop, -- int sysinfo_id) -+ int sysinfo_id, const char *dval) - { -+ if (!dval || !*dval) -+ dval = "Unknown"; -+ -+ if (!prop) -+ return smbios_add_string(ctx, dval); -+ - if (sysinfo_id && ctx->dev) { - char val[SMBIOS_STR_MAX]; - int ret; -@@ -151,8 +155,8 @@ static int smbios_add_prop_si(struct smbios_ctx *ctx, const char *prop, - const char *str; - - str = ofnode_read_string(ctx->node, prop); -- if (str) -- return smbios_add_string(ctx, str); -+ -+ return smbios_add_string(ctx, str ? str : dval); - } - - return 0; -@@ -161,12 +165,15 @@ static int smbios_add_prop_si(struct smbios_ctx *ctx, const char *prop, - /** - * smbios_add_prop() - Add a property from the devicetree - * -- * @prop: property to write -+ * @prop: property to write. The default string will be written if -+ * prop is NULL -+ * @dval: Default value to use if the string is not found or is empty - * Return: 0 if not found, else SMBIOS string number (1 or more) - */ --static int smbios_add_prop(struct smbios_ctx *ctx, const char *prop) -+static int smbios_add_prop(struct smbios_ctx *ctx, const char *prop, -+ const char *dval) - { -- return smbios_add_prop_si(ctx, prop, SYSINFO_ID_NONE); -+ return smbios_add_prop_si(ctx, prop, SYSINFO_ID_NONE, dval); - } - - static void smbios_set_eos(struct smbios_ctx *ctx, char *eos) -@@ -228,11 +235,9 @@ static int smbios_write_type0(ulong *current, int handle, - memset(t, 0, sizeof(struct smbios_type0)); - fill_smbios_header(t, SMBIOS_BIOS_INFORMATION, len, handle); - smbios_set_eos(ctx, t->eos); -- t->vendor = smbios_add_string(ctx, "U-Boot"); -+ t->vendor = smbios_add_prop(ctx, NULL, "U-Boot"); - -- t->bios_ver = smbios_add_prop(ctx, "version"); -- if (!t->bios_ver) -- t->bios_ver = smbios_add_string(ctx, PLAIN_VERSION); -+ t->bios_ver = smbios_add_prop(ctx, "version", PLAIN_VERSION); - if (t->bios_ver) - gd->smbios_version = ctx->last_str; - log_debug("smbios_version = %p: '%s'\n", gd->smbios_version, -@@ -241,7 +246,7 @@ static int smbios_write_type0(ulong *current, int handle, - print_buffer((ulong)gd->smbios_version, gd->smbios_version, - 1, strlen(gd->smbios_version) + 1, 0); - #endif -- t->bios_release_date = smbios_add_string(ctx, U_BOOT_DMI_DATE); -+ t->bios_release_date = smbios_add_prop(ctx, NULL, U_BOOT_DMI_DATE); - #ifdef CONFIG_ROM_SIZE - t->bios_rom_size = (CONFIG_ROM_SIZE / 65536) - 1; - #endif -@@ -280,22 +285,19 @@ static int smbios_write_type1(ulong *current, int handle, - memset(t, 0, sizeof(struct smbios_type1)); - fill_smbios_header(t, SMBIOS_SYSTEM_INFORMATION, len, handle); - smbios_set_eos(ctx, t->eos); -- t->manufacturer = smbios_add_prop(ctx, "manufacturer"); -- if (!t->manufacturer) -- t->manufacturer = smbios_add_string(ctx, "Unknown"); -- t->product_name = smbios_add_prop(ctx, "product"); -- if (!t->product_name) -- t->product_name = smbios_add_string(ctx, "Unknown Product"); -+ t->manufacturer = smbios_add_prop(ctx, "manufacturer", "Unknown"); -+ t->product_name = smbios_add_prop(ctx, "product", "Unknown"); - t->version = smbios_add_prop_si(ctx, "version", -- SYSINFO_ID_SMBIOS_SYSTEM_VERSION); -+ SYSINFO_ID_SMBIOS_SYSTEM_VERSION, -+ "Unknown"); - if (serial_str) { -- t->serial_number = smbios_add_string(ctx, serial_str); -+ t->serial_number = smbios_add_prop(ctx, NULL, serial_str); - strncpy((char *)t->uuid, serial_str, sizeof(t->uuid)); - } else { -- t->serial_number = smbios_add_prop(ctx, "serial"); -+ t->serial_number = smbios_add_prop(ctx, "serial", "Unknown"); - } -- t->sku_number = smbios_add_prop(ctx, "sku"); -- t->family = smbios_add_prop(ctx, "family"); -+ t->sku_number = smbios_add_prop(ctx, "sku", "Unknown"); -+ t->family = smbios_add_prop(ctx, "family", "Unknown"); - - len = t->length + smbios_string_table_len(ctx); - *current += len; -@@ -314,15 +316,12 @@ static int smbios_write_type2(ulong *current, int handle, - memset(t, 0, sizeof(struct smbios_type2)); - fill_smbios_header(t, SMBIOS_BOARD_INFORMATION, len, handle); - smbios_set_eos(ctx, t->eos); -- t->manufacturer = smbios_add_prop(ctx, "manufacturer"); -- if (!t->manufacturer) -- t->manufacturer = smbios_add_string(ctx, "Unknown"); -- t->product_name = smbios_add_prop(ctx, "product"); -- if (!t->product_name) -- t->product_name = smbios_add_string(ctx, "Unknown Product"); -+ t->manufacturer = smbios_add_prop(ctx, "manufacturer", "Unknown"); -+ t->product_name = smbios_add_prop(ctx, "product", "Unknown"); - t->version = smbios_add_prop_si(ctx, "version", -- SYSINFO_ID_SMBIOS_BASEBOARD_VERSION); -- t->asset_tag_number = smbios_add_prop(ctx, "asset-tag"); -+ SYSINFO_ID_SMBIOS_BASEBOARD_VERSION, -+ "Unknown"); -+ t->asset_tag_number = smbios_add_prop(ctx, "asset-tag", "Unknown"); - t->feature_flags = SMBIOS_BOARD_FEATURE_HOSTING; - t->board_type = SMBIOS_BOARD_MOTHERBOARD; - -@@ -343,9 +342,7 @@ static int smbios_write_type3(ulong *current, int handle, - memset(t, 0, sizeof(struct smbios_type3)); - fill_smbios_header(t, SMBIOS_SYSTEM_ENCLOSURE, len, handle); - smbios_set_eos(ctx, t->eos); -- t->manufacturer = smbios_add_prop(ctx, "manufacturer"); -- if (!t->manufacturer) -- t->manufacturer = smbios_add_string(ctx, "Unknown"); -+ t->manufacturer = smbios_add_prop(ctx, "manufacturer", "Unknown"); - t->chassis_type = SMBIOS_ENCLOSURE_DESKTOP; - t->bootup_state = SMBIOS_STATE_SAFE; - t->power_supply_state = SMBIOS_STATE_SAFE; -@@ -388,8 +385,8 @@ static void smbios_write_type4_dm(struct smbios_type4 *t, - #endif - - t->processor_family = processor_family; -- t->processor_manufacturer = smbios_add_string(ctx, vendor); -- t->processor_version = smbios_add_string(ctx, name); -+ t->processor_manufacturer = smbios_add_prop(ctx, NULL, vendor); -+ t->processor_version = smbios_add_prop(ctx, NULL, name); - } - - static int smbios_write_type4(ulong *current, int handle, - -From patchwork Thu Dec 7 09:18:50 2023 -Content-Type: text/plain; charset="utf-8" -MIME-Version: 1.0 -Content-Transfer-Encoding: 7bit -X-Patchwork-Submitter: Ilias Apalodimas -X-Patchwork-Id: 1873090 -Return-Path: -X-Original-To: incoming@patchwork.ozlabs.org -Delivered-To: patchwork-incoming@legolas.ozlabs.org -Authentication-Results: legolas.ozlabs.org; - dkim=pass (2048-bit key; - unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 - header.s=google header.b=KcFhbOkM; - dkim-atps=neutral -Authentication-Results: legolas.ozlabs.org; - spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de - (client-ip=85.214.62.61; helo=phobos.denx.de; - envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org) -Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) - (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) - key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) - (No client certificate requested) - by legolas.ozlabs.org (Postfix) with ESMTPS id 4Sm7yF71l9z23nD - for ; Thu, 7 Dec 2023 20:19:33 +1100 (AEDT) -Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) - by phobos.denx.de (Postfix) with ESMTP id 7D6CB87483; - Thu, 7 Dec 2023 10:19:07 +0100 (CET) -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="KcFhbOkM"; - dkim-atps=neutral -Received: by phobos.denx.de (Postfix, from userid 109) - id B1E298745E; Thu, 7 Dec 2023 10:19:05 +0100 (CET) -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, - T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 -Received: from mail-wr1-x433.google.com (mail-wr1-x433.google.com - [IPv6:2a00:1450:4864:20::433]) - (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 792A8871BB - for ; Thu, 7 Dec 2023 10:19:03 +0100 (CET) -Authentication-Results: phobos.denx.de; - dmarc=pass (p=none dis=none) header.from=linaro.org -Authentication-Results: phobos.denx.de; - spf=pass smtp.mailfrom=ilias.apalodimas@linaro.org -Received: by mail-wr1-x433.google.com with SMTP id - ffacd0b85a97d-3334a701cbbso717814f8f.0 - for ; Thu, 07 Dec 2023 01:19:03 -0800 (PST) -DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; - d=linaro.org; s=google; t=1701940743; x=1702545543; 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=JIRbBgzEcdaHWJ7fVa5JIsDJda65F2tSuL1aji2tJ5U=; - b=KcFhbOkMkvXbThdeAeI92+uSdN5LvKdwae+36Z/jz0Hg0yPDs5v8UqeDt2d+NaSlh9 - GERy8kIMCopTcJ13FoUM8Ok4PBSMRSDxbJo4lLaGIbddw7hcit4uxhJfTAL8zKxnboMU - YBZPC/E2NjWklmJx6p4zmLeXS5IzncTaDE9z2XFMRGrJ/KLqpTvwOp/nf57jP/kdIxpe - Q7vWAhVY8gC19ogSD41RB4ixA0HefI6xKq6fAl2GwvRlOvCEGAcVdpbl8aj5R8qEOSVT - BsuqzbDXHlQI6L9Y++Yqe89LcKMRoAWqHrgOuO3eBwnEp2jjjzV8G24mTFD+4wso1ERo - mIkQ== -X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; - d=1e100.net; s=20230601; t=1701940743; x=1702545543; - 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=JIRbBgzEcdaHWJ7fVa5JIsDJda65F2tSuL1aji2tJ5U=; - b=pee1V3/z6lW4enMw0ueHvBJJXGhNLq7KccXmY4QkXfVRLXGBOedbBwQH1KXDxj/gJs - RZ/KhsEvPN4qeqrqpeOnQoDBQs3QarjlsMHmlhnlBZMpgPKTJyg5MEpZPAlnfqZJkd4A - vMMYc1fZ+alT5gfZjdzpLypC2sOj9yC3ktb8ZYXQGQzN7yCYrQnBHgiYn3vDDaHMaQNH - n73RxiQNWJs9Ekow2hxk4l2FDpvlwuiFr9y+dnuzo5TvpbgaDbj64tcqxalnusBw3jKC - fE6r5cob553rh/ZM/bVJD/PIXP+LOSUHyiqJG+7KpEpSAY984EIHkKFRRbLHSIuwBAK+ - wTIw== -X-Gm-Message-State: AOJu0YwQcpf2rvKZHAPWsPT7fH7x3sa+mhF5kDJ557Oe9zwmQc4v6NzO - ZFEgE8KlljYnqibJKd2JdRCP6A== -X-Google-Smtp-Source: - AGHT+IEfJolrJ5g6Qgn465DsdBpMZMW+cn6kVgLvehQIXNT7VcXYfkBvC8Hf5zXnl7Q5Yto7bS2tOg== -X-Received: by 2002:a05:600c:d5:b0:40b:5e59:99c6 with SMTP id - u21-20020a05600c00d500b0040b5e5999c6mr940484wmm.230.1701940742953; - Thu, 07 Dec 2023 01:19:02 -0800 (PST) -Received: from localhost.localdomain (ppp046103111243.access.hol.gr. - [46.103.111.243]) by smtp.gmail.com with ESMTPSA id - u21-20020a05600c139500b00405d9a950a2sm1299003wmf.28.2023.12.07.01.19.01 - (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); - Thu, 07 Dec 2023 01:19:02 -0800 (PST) -From: Ilias Apalodimas -To: trini@konsulko.com, - sjg@chromium.org -Cc: sean.anderson@seco.com, neil.armstrong@linaro.org, - heinrich.schuchardt@canonical.com, mark.kettenis@xs4all.nl, - Ilias Apalodimas , u-boot@lists.denx.de -Subject: [PATCH 2/2 v3] smbios: Fallback to the default DT if sysinfo nodes - are missing -Date: Thu, 7 Dec 2023 11:18:50 +0200 -Message-Id: <20231207091850.17776-3-ilias.apalodimas@linaro.org> -X-Mailer: git-send-email 2.40.1 -In-Reply-To: <20231207091850.17776-1-ilias.apalodimas@linaro.org> -References: <20231207091850.17776-1-ilias.apalodimas@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 - -In order to fill in the SMBIOS tables U-Boot currently relies on a -"u-boot,sysinfo-smbios" compatible node. This is fine for the boards -that already include such nodes. However with some recent EFI changes, -the majority of boards can boot up distros, which usually rely on -things like dmidecode etc for their reporting. For boards that -lack this special node the SMBIOS output looks like: - -System Information - Manufacturer: Unknown - Product Name: Unknown - Version: Unknown - Serial Number: Unknown - UUID: Not Settable - Wake-up Type: Reserved - SKU Number: Unknown - Family: Unknown - -This looks problematic since most of the info are "Unknown". The DT spec -specifies standard properties containing relevant information like -'model' and 'compatible' for which the suggested format is -. Unfortunately the 'model' string found in DTs is -usually lacking the manufacturer so we can't use it for both -'Manufacturer' and 'Product Name' SMBIOS entries reliably. - -So let's add a last resort to our current smbios parsing. If none of -the sysinfo properties are found, scan for those information in the -root node of the device tree. Use the 'model' to fill the 'Product -Name' and the first value of 'compatible' for the 'Manufacturer', since -that always contains one. - -pre-patch: -Handle 0x0001, DMI type 1, 27 bytes -System Information - Manufacturer: Unknown - Product Name: Unknown - Version: Unknown - Serial Number: 100000000bb24ceb - UUID: 30303031-3030-3030-3061-613234636435 - Wake-up Type: Reserved - SKU Number: Unknown - Family: Unknown -[...] - -and post patch: -Handle 0x0001, DMI type 1, 27 bytes -System Information - Manufacturer: raspberrypi - Product Name: Raspberry Pi 4 Model B Rev 1.1 - Version: Unknown - Serial Number: 100000000bb24ceb - UUID: 30303031-3030-3030-3061-613234636435 - Wake-up Type: Reserved - SKU Number: Unknown - Family: Unknown -[...] - -Signed-off-by: Ilias Apalodimas ---- -Simon, I'll work with tou on the refactoring you wanted and -remove the EFI requirement of SMBIOS in !x86 platforms. -Since this code has no tests, I'll add some once the refactoring -is done - -Changes since v2: -- Spelling mistakes -- rebase on top of patch #1 changes -Changes since v1: -- Tokenize the DT node entry and use the appropriate value instead of - the entire string -- Removed Peters tested/reviewed-by tags due to the above - lib/smbios.c | 94 +++++++++++++++++++++++++++++++++++++++++++++++++--- - 1 file changed, 89 insertions(+), 5 deletions(-) - --- -2.40.1 - -diff --git a/lib/smbios.c b/lib/smbios.c -index 444aa245a273..3f0e1d529537 100644 ---- a/lib/smbios.c -+++ b/lib/smbios.c -@@ -9,11 +9,14 @@ - #include - #include - #include -+#include - #include - #include - #include - #include - #include -+#include -+#include - #ifdef CONFIG_CPU - #include - #include -@@ -43,6 +46,25 @@ - - DECLARE_GLOBAL_DATA_PTR; - -+/** -+ * struct map_sysinfo - Mapping of sysinfo strings to DT -+ * -+ * @sysinfo_str: sysinfo string -+ * @dt_str: DT string -+ * @max: Max index of the tokenized string to pick. Counting starts from 0 -+ * -+ */ -+struct map_sysinfo { -+ const char *sysinfo_str; -+ const char *dt_str; -+ int max; -+}; -+ -+static const struct map_sysinfo sysinfo_to_dt[] = { -+ { .sysinfo_str = "product", .dt_str = "model", 2 }, -+ { .sysinfo_str = "manufacturer", .dt_str = "compatible", 1 }, -+}; -+ - /** - * struct smbios_ctx - context for writing SMBIOS tables - * -@@ -87,6 +109,18 @@ struct smbios_write_method { - const char *subnode_name; - }; - -+static const struct map_sysinfo *convert_sysinfo_to_dt(const char *sysinfo_str) -+{ -+ int i; -+ -+ for (i = 0; i < ARRAY_SIZE(sysinfo_to_dt); i++) { -+ if (!strcmp(sysinfo_str, sysinfo_to_dt[i].sysinfo_str)) -+ return &sysinfo_to_dt[i]; -+ } -+ -+ return NULL; -+} -+ - /** - * smbios_add_string() - add a string to the string area - * -@@ -124,6 +158,42 @@ static int smbios_add_string(struct smbios_ctx *ctx, const char *str) - } - } - -+/** -+ * get_str_from_dt - Get a substring from a DT property. -+ * After finding the property in the DT, the function -+ * will parse comma-separated values and return the value. -+ * If nprop->max exceeds the number of comma-separated -+ * elements, the last non NULL value will be returned. -+ * Counting starts from zero. -+ * -+ * @nprop: sysinfo property to use -+ * @str: pointer to fill with data -+ * @size: str buffer length -+ */ -+static -+void get_str_from_dt(const struct map_sysinfo *nprop, char *str, size_t size) -+{ -+ const char *dt_str; -+ int cnt = 0; -+ char *token; -+ -+ memset(str, 0, size); -+ if (!nprop || !nprop->max) -+ return; -+ -+ dt_str = ofnode_read_string(ofnode_root(), nprop->dt_str); -+ if (!dt_str) -+ return; -+ -+ memcpy(str, dt_str, size); -+ token = strtok(str, ","); -+ while (token && cnt < nprop->max) { -+ strlcpy(str, token, strlen(token) + 1); -+ token = strtok(NULL, ","); -+ cnt++; -+ } -+} -+ - /** - * smbios_add_prop_si() - Add a property from the devicetree or sysinfo - * -@@ -137,6 +207,8 @@ static int smbios_add_string(struct smbios_ctx *ctx, const char *str) - static int smbios_add_prop_si(struct smbios_ctx *ctx, const char *prop, - int sysinfo_id, const char *dval) - { -+ int ret; -+ - if (!dval || !*dval) - dval = "Unknown"; - -@@ -145,18 +217,30 @@ static int smbios_add_prop_si(struct smbios_ctx *ctx, const char *prop, - - if (sysinfo_id && ctx->dev) { - char val[SMBIOS_STR_MAX]; -- int ret; - - ret = sysinfo_get_str(ctx->dev, sysinfo_id, sizeof(val), val); - if (!ret) - return smbios_add_string(ctx, val); - } - if (IS_ENABLED(CONFIG_OF_CONTROL)) { -- const char *str; -- -- str = ofnode_read_string(ctx->node, prop); -+ const char *str = NULL; -+ char str_dt[128] = { 0 }; -+ /* -+ * If the node is not valid fallback and try the entire DT -+ * so we can at least fill in manufacturer and board type -+ */ -+ if (ofnode_valid(ctx->node)) { -+ str = ofnode_read_string(ctx->node, prop); -+ } else { -+ const struct map_sysinfo *nprop; -+ -+ nprop = convert_sysinfo_to_dt(prop); -+ get_str_from_dt(nprop, str_dt, sizeof(str_dt)); -+ str = (const char *)str_dt; -+ } - -- return smbios_add_string(ctx, str ? str : dval); -+ ret = smbios_add_string(ctx, str && *str ? str : dval); -+ return ret; - } - - return 0; \ No newline at end of file diff --git a/backport-rockchip-Add-initial-support-for-the-PinePhone-Pro.patch b/backport-rockchip-Add-initial-support-for-the-PinePhone-Pro.patch deleted file mode 100644 index 663ec250e43e76d2345747ef3c186f6a69be5824..0000000000000000000000000000000000000000 --- a/backport-rockchip-Add-initial-support-for-the-PinePhone-Pro.patch +++ /dev/null @@ -1,236 +0,0 @@ -From 72400858605c085cf94a6cf5599269c8c39e3e72 Mon Sep 17 00:00:00 2001 -From: Peter Robinson -Date: Tue, 14 Mar 2023 12:30:36 +0000 -Subject: [PATCH] rockchip: pinephone pro: add initial display support - -Add proposed upstream DT patches for display, disable edp, -enable mipi and backlight, add required clocks. - -Clocks may not be required based on upstream review. Still -need to add panel pieces, the rk3288-evb has an example for -panel DT for u-boot, or may need to do a mipi addition to -simple-panel, or something else. - -Signed-off-by: Peter Robinson ---- - arch/arm/dts/rk3399-pinephone-pro.dts | 123 +++++++++++++++++++++++++ - configs/pinephone-pro-rk3399_defconfig | 3 +- - include/dt-bindings/clock/rk3399-cru.h | 2 + - 3 files changed, 127 insertions(+), 1 deletion(-) - -diff --git a/arch/arm/dts/rk3399-pinephone-pro.dts b/arch/arm/dts/rk3399-pinephone-pro.dts -index 04403a76238..d0609d1b534 100644 ---- a/arch/arm/dts/rk3399-pinephone-pro.dts -+++ b/arch/arm/dts/rk3399-pinephone-pro.dts -@@ -29,6 +29,12 @@ - stdout-path = "serial2:115200n8"; - }; - -+ backlight: backlight { -+ compatible = "pwm-backlight"; -+ pwms = <&pwm0 0 1000000 0>; -+ pwm-delay-us = <10000>; -+ }; -+ - gpio-keys { - compatible = "gpio-keys"; - pinctrl-names = "default"; -@@ -102,6 +108,32 @@ - /* WL_REG_ON on module */ - reset-gpios = <&gpio0 RK_PB2 GPIO_ACTIVE_LOW>; - }; -+ -+ /* MIPI DSI panel 1.8v supply */ -+ vcc1v8_lcd: vcc1v8-lcd-regulator { -+ compatible = "regulator-fixed"; -+ enable-active-high; -+ regulator-name = "vcc1v8_lcd"; -+ regulator-min-microvolt = <1800000>; -+ regulator-max-microvolt = <1800000>; -+ vin-supply = <&vcc3v3_sys>; -+ gpio = <&gpio3 RK_PA5 GPIO_ACTIVE_HIGH>; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&display_pwren1>; -+ }; -+ -+ /* MIPI DSI panel 2.8v supply */ -+ vcc2v8_lcd: vcc2v8-lcd-regulator { -+ compatible = "regulator-fixed"; -+ enable-active-high; -+ regulator-name = "vcc2v8_lcd"; -+ regulator-min-microvolt = <2800000>; -+ regulator-max-microvolt = <2800000>; -+ vin-supply = <&vcc3v3_sys>; -+ gpio = <&gpio3 RK_PA1 GPIO_ACTIVE_HIGH>; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&display_pwren>; -+ }; - }; - - &cpu_l0 { -@@ -132,6 +164,11 @@ - status = "okay"; - }; - -+&gpu { -+ mali-supply = <&vdd_gpu>; -+ status = "okay"; -+}; -+ - &i2c0 { - clock-frequency = <400000>; - i2c-scl-rising-time-ns = <168>; -@@ -214,6 +251,9 @@ - regulator-name = "vcc3v0_touch"; - regulator-min-microvolt = <3000000>; - regulator-max-microvolt = <3000000>; -+ regulator-state-mem { -+ regulator-off-in-suspend; -+ }; - }; - - vcca1v8_codec: LDO_REG3 { -@@ -347,6 +387,25 @@ - }; - }; - -+&i2c3 { -+ i2c-scl-rising-time-ns = <450>; -+ i2c-scl-falling-time-ns = <15>; -+ status = "okay"; -+ -+ touchscreen@14 { -+ compatible = "goodix,gt917s"; -+ reg = <0x14>; -+ interrupt-parent = <&gpio3>; -+ interrupts = ; -+ irq-gpios = <&gpio3 RK_PB5 GPIO_ACTIVE_HIGH>; -+ reset-gpios = <&gpio3 RK_PB4 GPIO_ACTIVE_HIGH>; -+ AVDD28-supply = <&vcc3v0_touch>; -+ VDDIO-supply = <&vcc3v0_touch>; -+ touchscreen-size-x = <720>; -+ touchscreen-size-y = <1440>; -+ }; -+}; -+ - &io_domains { - bt656-supply = <&vcc1v8_dvp>; - audio-supply = <&vcca1v8_codec>; -@@ -355,6 +414,40 @@ - status = "okay"; - }; - -+&mipi_dsi { -+ status = "okay"; -+ clock-master; -+ -+ ports { -+ mipi_out: port@1 { -+ #address-cells = <0>; -+ #size-cells = <0>; -+ reg = <1>; -+ -+ mipi_out_panel: endpoint { -+ remote-endpoint = <&mipi_in_panel>; -+ }; -+ }; -+ }; -+ -+ panel@0 { -+ compatible = "hannstar,hsd060bhw4"; -+ reg = <0>; -+ backlight = <&backlight>; -+ reset-gpios = <&gpio4 RK_PD1 GPIO_ACTIVE_LOW>; -+ vcc-supply = <&vcc2v8_lcd>; -+ iovcc-supply = <&vcc1v8_lcd>; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&display_rst_l>; -+ -+ port { -+ mipi_in_panel: endpoint { -+ remote-endpoint = <&mipi_out_panel>; -+ }; -+ }; -+ }; -+}; -+ - &pmu_io_domains { - pmu1830-supply = <&vcc_1v8>; - status = "okay"; -@@ -387,6 +480,20 @@ - }; - }; - -+ dsi { -+ display_rst_l: display-rst-l { -+ rockchip,pins = <4 RK_PD1 RK_FUNC_GPIO &pcfg_pull_down>; -+ }; -+ -+ display_pwren: display-pwren { -+ rockchip,pins = <3 RK_PA1 RK_FUNC_GPIO &pcfg_pull_down>; -+ }; -+ -+ display_pwren1: display-pwren1 { -+ rockchip,pins = <3 RK_PA5 RK_FUNC_GPIO &pcfg_pull_down>; -+ }; -+ }; -+ - sound { - vcc1v8_codec_en: vcc1v8-codec-en { - rockchip,pins = <3 RK_PA4 RK_FUNC_GPIO &pcfg_pull_down>; -@@ -422,6 +529,10 @@ - status = "okay"; - }; - -+&pwm0 { -+ status = "okay"; -+}; -+ - &sdmmc { - bus-width = <4>; - cap-sd-highspeed; -@@ -472,3 +583,15 @@ - &uart2 { - status = "okay"; - }; -+ -+&vopb { -+ status = "okay"; -+ assigned-clocks = <&cru DCLK_VOP0_DIV>, <&cru DCLK_VOP0>, -+ <&cru ACLK_VOP0>, <&cru HCLK_VOP0>; -+ assigned-clock-rates = <0>, <0>, <400000000>, <100000000>; -+ assigned-clock-parents = <&cru PLL_CPLL>, <&cru DCLK_VOP0_FRAC>; -+}; -+ -+&vopb_mmu { -+ status = "okay"; -+}; -diff --git a/configs/pinephone-pro-rk3399_defconfig b/configs/pinephone-pro-rk3399_defconfig -index 54f9b90536c..1982131c805 100644 ---- a/configs/pinephone-pro-rk3399_defconfig -+++ b/configs/pinephone-pro-rk3399_defconfig -@@ -96,6 +96,7 @@ CONFIG_USB_ETHER_RTL8152=y - CONFIG_VIDEO=y - CONFIG_DISPLAY=y - CONFIG_VIDEO_ROCKCHIP=y --CONFIG_DISPLAY_ROCKCHIP_EDP=y -+CONFIG_DISPLAY_ROCKCHIP_MIPI=y -+CONFIG_BACKLIGHT_PWM=y - CONFIG_SPL_TINY_MEMSET=y - CONFIG_ERRNO_STR=y -diff --git a/include/dt-bindings/clock/rk3399-cru.h b/include/dt-bindings/clock/rk3399-cru.h -index 211faf8fa89..7866e5266d2 100644 ---- a/include/dt-bindings/clock/rk3399-cru.h -+++ b/include/dt-bindings/clock/rk3399-cru.h -@@ -131,6 +131,8 @@ - #define DCLK_VOP0_DIV 182 - #define DCLK_VOP1_DIV 183 - #define DCLK_M0_PERILP 184 -+#define DCLK_VOP0_FRAC 185 -+#define DCLK_VOP1_FRAC 186 - - #define FCLK_CM0S 190 - --- -2.39.2 - \ No newline at end of file diff --git a/backport-scripts-dtc-pylibfdt-libfdt-i-shipped-Use-SWIG-AppendOutput.patch b/backport-scripts-dtc-pylibfdt-libfdt-i-shipped-Use-SWIG-AppendOutput.patch deleted file mode 100644 index a78b64d5ee560df785910e01fb06680b29ff1b95..0000000000000000000000000000000000000000 --- a/backport-scripts-dtc-pylibfdt-libfdt-i-shipped-Use-SWIG-AppendOutput.patch +++ /dev/null @@ -1,57 +0,0 @@ -From a63456b9191fae2fe49f4b121e025792022e3950 Mon Sep 17 00:00:00 2001 -From: Markus Volk -Date: Wed, 30 Oct 2024 06:07:16 +0100 -Subject: [PATCH] scripts/dtc/pylibfdt/libfdt.i_shipped: Use SWIG_AppendOutput -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Swig has changed language specific AppendOutput functions. The helper -macro SWIG_AppendOutput remains unchanged. Use that instead -of SWIG_Python_AppendOutput, which would require an extra parameter -since swig 4.3.0. - -/home/flk/poky/build-test/tmp/work/qemux86_64-poky-linux/u-boot/2024.10/git/arch/x86/cpu/u-boot-64.lds -| scripts/dtc/pylibfdt/libfdt_wrap.c: In function ‘_wrap_fdt_next_node’: -| scripts/dtc/pylibfdt/libfdt_wrap.c:5581:17: error: too few arguments to function ‘SWIG_Python_AppendOutput’ -| 5581 | resultobj = SWIG_Python_AppendOutput(resultobj, val); -| | ^~~~~~~~~~~~~~~~~~~~~~~~ - -Signed-off-by: Markus Volk -Reported-by: Rudi Heitbaum -Link: https://github.com/dgibson/dtc/pull/154 ---- - scripts/dtc/pylibfdt/libfdt.i_shipped | 6 +++--- - 1 file changed, 3 insertions(+), 3 deletions(-) - -diff --git a/scripts/dtc/pylibfdt/libfdt.i_shipped b/scripts/dtc/pylibfdt/libfdt.i_shipped -index 56cc5d48f4f9..e4659489a96a 100644 ---- a/scripts/dtc/pylibfdt/libfdt.i_shipped -+++ b/scripts/dtc/pylibfdt/libfdt.i_shipped -@@ -1037,7 +1037,7 @@ typedef uint32_t fdt32_t; - fdt_string(fdt1, fdt32_to_cpu($1->nameoff))); - buff = PyByteArray_FromStringAndSize( - (const char *)($1 + 1), fdt32_to_cpu($1->len)); -- resultobj = SWIG_Python_AppendOutput(resultobj, buff); -+ resultobj = SWIG_AppendOutput(resultobj, buff); - } - } - -@@ -1076,7 +1076,7 @@ typedef uint32_t fdt32_t; - - %typemap(argout) int *depth { - PyObject *val = Py_BuildValue("i", *arg$argnum); -- resultobj = SWIG_Python_AppendOutput(resultobj, val); -+ resultobj = SWIG_AppendOutput(resultobj, val); - } - - %apply int *depth { int *depth }; -@@ -1092,7 +1092,7 @@ typedef uint32_t fdt32_t; - if (PyTuple_GET_SIZE(resultobj) == 0) - resultobj = val; - else -- resultobj = SWIG_Python_AppendOutput(resultobj, val); -+ resultobj = SWIG_AppendOutput(resultobj, val); - } - } - diff --git a/backport-uefi-Boot-var-automatic-management-for-removable-medias.patch b/backport-uefi-Boot-var-automatic-management-for-removable-medias.patch deleted file mode 100644 index 13a23e31c327b1af37f2e3948cf7035045379812..0000000000000000000000000000000000000000 --- a/backport-uefi-Boot-var-automatic-management-for-removable-medias.patch +++ /dev/null @@ -1,574 +0,0 @@ -From patchwork Fri Nov 10 04:25:37 2023 -Content-Type: text/plain; charset="utf-8" -MIME-Version: 1.0 -Content-Transfer-Encoding: 8bit -X-Patchwork-Submitter: Masahisa Kojima -X-Patchwork-Id: 1862317 -X-Patchwork-Delegate: apalos@gmail.com -Return-Path: -X-Original-To: incoming@patchwork.ozlabs.org -Delivered-To: patchwork-incoming@legolas.ozlabs.org -Authentication-Results: legolas.ozlabs.org; - dkim=pass (2048-bit key; - unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 - header.s=google header.b=muA1rcXE; - dkim-atps=neutral -Authentication-Results: legolas.ozlabs.org; - spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de - (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; - envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org) -Received: from phobos.denx.de (phobos.denx.de - [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) - (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) - key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) - (No client certificate requested) - by legolas.ozlabs.org (Postfix) with ESMTPS id 4SRQnL1SNCz1yRF - for ; Fri, 10 Nov 2023 15:28:54 +1100 (AEDT) -Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) - by phobos.denx.de (Postfix) with ESMTP id 4C150877A0; - Fri, 10 Nov 2023 05:27:39 +0100 (CET) -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="muA1rcXE"; - dkim-atps=neutral -Received: by phobos.denx.de (Postfix, from userid 109) - id 9DA4487796; Fri, 10 Nov 2023 05:27:28 +0100 (CET) -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, - T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 -Received: from mail-qv1-xf30.google.com (mail-qv1-xf30.google.com - [IPv6:2607:f8b0:4864:20::f30]) - (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 E1AE487795 - for ; Fri, 10 Nov 2023 05:27:22 +0100 (CET) -Authentication-Results: phobos.denx.de; - dmarc=pass (p=none dis=none) header.from=linaro.org -Authentication-Results: phobos.denx.de; - spf=pass smtp.mailfrom=masahisa.kojima@linaro.org -Received: by mail-qv1-xf30.google.com with SMTP id - 6a1803df08f44-66d09b6d007so10800236d6.1 - for ; Thu, 09 Nov 2023 20:27:22 -0800 (PST) -DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; - d=linaro.org; s=google; t=1699590441; x=1700195241; 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=TMp02tF2/jn50c0fdB6OUXNmWJ9Af2C5T6zhn2D5BPI=; - b=muA1rcXEW1UV0ytByrk/oz/vuO7kL/M5Szuv8+JLohfHHFY3sZW5v5q4Tn1coMbMKW - 6+JvY0qla9DiPjvWA90QSopUCqBoggSNPTIlTn4YSs0zA/+Aa9ufsx25M+rq4pdYGAZq - ujAG9mRgWMuq7W+eZZWfQo6eFqEo14D6RbQL5NFW/G0Wkle6TwLwu7dp19DOw7hH/jPq - sq9/5/DA4FEI+4sRDsPBAQ48VTq05vuMv2PMU0t4d7SXPVCEk1lW+JFZB4wooN2XotQ+ - ni+S40bdTeGBscZ+sajQQgtDd49nxGSB518samtlg5SGdhDB9WKak39uPeWU4WFYc01J - R7BQ== -X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; - d=1e100.net; s=20230601; t=1699590441; x=1700195241; - 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=TMp02tF2/jn50c0fdB6OUXNmWJ9Af2C5T6zhn2D5BPI=; - b=o5TY9c0iL/aKbWJtamq+fAKn5twYwIcXo5Z8lxIo1/WL8jhCu3973LiJ6l2rbP6I26 - wEUpA97eZRYjRnp6Pfb9nJ5+Ip11akGFqY+UNFjwNues+jYvCmrhtbzt3RIwwRMopasI - IvpvSU+Vk0opNS2b96ZRak7X34ZoUNZVcjTBCSqx3UgQcaMOxrP5u7LholG/3rTttkkF - gdIAWrm7wPUrREhnt8opfpTWbusAkgJ1lAa0uqcfb4TRE7fKsiX3du3TwgJNsvACBXxW - W4w5nDy5AXlY05IOsmMvxjIudLF0aDB3y/aUT1K7/NyAO77e5CPoGEIRF4JnpngLM7yx - RcEw== -X-Gm-Message-State: AOJu0YwKFnJ+XRzaRWdr9TK+didg99ZRC2gUKVvYvCLFFGqfG4yFbCXC - IsubnJ6RTNtZqmONUFojqVLmrQYm513MFxxhCLg= -X-Google-Smtp-Source: - AGHT+IE/39rKwHRMrxLkfDXIlyOXct/rRbXebKb2Lc3eaLeJaCt4Vmnxn7CrXnlXXLzUgocEmJUKcA== -X-Received: by 2002:a05:6214:d44:b0:675:667d:a1b6 with SMTP id - 4-20020a0562140d4400b00675667da1b6mr7212832qvr.0.1699590440388; - Thu, 09 Nov 2023 20:27:20 -0800 (PST) -Received: from localhost ([164.70.16.189]) by smtp.gmail.com with ESMTPSA id - n18-20020a170902e55200b001c0bf60ba5csm4304818plf.272.2023.11.09.20.27.19 - (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); - Thu, 09 Nov 2023 20:27:19 -0800 (PST) -From: Masahisa Kojima -To: u-boot@lists.denx.de -Cc: Heinrich Schuchardt , - Ilias Apalodimas , - Simon Glass , - Takahiro Akashi , - Michal Simek , Raymond Mao , - Masahisa Kojima , - Joao Marcos Costa , - Huang Jianan , - Thomas Petazzoni , - Miquel Raynal , linux-erofs@lists.ozlabs.org -Subject: [PATCH v12 4/9] efi_loader: Boot var automatic management -Date: Fri, 10 Nov 2023 13:25:37 +0900 -Message-Id: <20231110042542.3797301-5-masahisa.kojima@linaro.org> -X-Mailer: git-send-email 2.34.1 -In-Reply-To: <20231110042542.3797301-1-masahisa.kojima@linaro.org> -References: <20231110042542.3797301-1-masahisa.kojima@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 - -From: Raymond Mao - -Changes for complying to EFI spec ยง3.5.1.1 -'Removable Media Boot Behavior'. -Boot variables can be automatically generated during a removable -media is probed. At the same time, unused boot variables will be -detected and removed. - -Please note that currently the function 'efi_disk_remove' has no -ability to distinguish below two scenarios -a) Unplugging of a removable media under U-Boot -b) U-Boot exiting and booting an OS -Thus currently the boot variables management is not added into -'efi_disk_remove' to avoid boot options being added/erased -repeatedly under scenario b) during power cycles -See TODO comments under function 'efi_disk_remove' for more details - -The original efi_secboot tests expect that BootOrder EFI variable -is not defined. With this commit, the BootOrder EFI variable is -automatically added when the disk is detected. The original -efi_secboot tests end up with unexpected failure. -The efi_secboot tests need to be modified to explicitly set -the BootOrder EFI variable. - -squashfs and erofs ls tests are also affected by this modification, -need to clear the previous state before squashfs ls test starts. - -Co-developed-by: Masahisa Kojima -Signed-off-by: Masahisa Kojima -Signed-off-by: Raymond Mao -Reviewed-by: Heinrich Schuchardt -Reviewed-by: Ilias Apalodimas -Reviewed-by: Joao Marcos Costa ---- - lib/efi_loader/efi_disk.c | 18 ++++++++ - lib/efi_loader/efi_setup.c | 7 ++++ - test/py/tests/test_efi_secboot/test_signed.py | 42 +++++++++---------- - .../test_efi_secboot/test_signed_intca.py | 14 +++---- - .../tests/test_efi_secboot/test_unsigned.py | 14 +++---- - test/py/tests/test_fs/test_erofs.py | 9 ++++ - .../test_fs/test_squashfs/test_sqfs_ls.py | 9 ++++ - 7 files changed, 78 insertions(+), 35 deletions(-) - -diff --git a/lib/efi_loader/efi_disk.c b/lib/efi_loader/efi_disk.c -index f0d76113b0..b808a7fe62 100644 ---- a/lib/efi_loader/efi_disk.c -+++ b/lib/efi_loader/efi_disk.c -@@ -690,6 +690,13 @@ int efi_disk_probe(void *ctx, struct event *event) - return -1; - } - -+ /* only do the boot option management when UEFI sub-system is initialized */ -+ if (IS_ENABLED(CONFIG_CMD_BOOTEFI_BOOTMGR) && efi_obj_list_initialized == EFI_SUCCESS) { -+ ret = efi_bootmgr_update_media_device_boot_option(); -+ if (ret != EFI_SUCCESS) -+ return -1; -+ } -+ - return 0; - } - -@@ -742,6 +749,17 @@ int efi_disk_remove(void *ctx, struct event *event) - dev_tag_del(dev, DM_TAG_EFI); - - return 0; -+ -+ /* -+ * TODO A flag to distinguish below 2 different scenarios of this -+ * function call is needed: -+ * a) Unplugging of a removable media under U-Boot -+ * b) U-Boot exiting and booting an OS -+ * In case of scenario a), efi_bootmgr_update_media_device_boot_option() -+ * needs to be invoked here to update the boot options and remove the -+ * unnecessary ones. -+ */ -+ - } - - /** -diff --git a/lib/efi_loader/efi_setup.c b/lib/efi_loader/efi_setup.c -index ad719afd63..c02569cb6d 100644 ---- a/lib/efi_loader/efi_setup.c -+++ b/lib/efi_loader/efi_setup.c -@@ -245,6 +245,13 @@ efi_status_t efi_init_obj_list(void) - if (ret != EFI_SUCCESS) - goto out; - -+ if (IS_ENABLED(CONFIG_CMD_BOOTEFI_BOOTMGR)) { -+ /* update boot option after variable service initialized */ -+ ret = efi_bootmgr_update_media_device_boot_option(); -+ if (ret != EFI_SUCCESS) -+ goto out; -+ } -+ - /* Define supported languages */ - ret = efi_init_platform_lang(); - if (ret != EFI_SUCCESS) -diff --git a/test/py/tests/test_efi_secboot/test_signed.py b/test/py/tests/test_efi_secboot/test_signed.py -index ca52e853d8..2f862a259a 100644 ---- a/test/py/tests/test_efi_secboot/test_signed.py -+++ b/test/py/tests/test_efi_secboot/test_signed.py -@@ -29,7 +29,7 @@ class TestEfiSignedImage(object): - output = u_boot_console.run_command_list([ - 'host bind 0 %s' % disk_img, - 'efidebug boot add -b 1 HELLO1 host 0:1 /helloworld.efi.signed -s ""', -- 'efidebug boot next 1', -+ 'efidebug boot order 1', - 'bootefi bootmgr']) - assert 'Hello, world!' in ''.join(output) - -@@ -37,7 +37,7 @@ class TestEfiSignedImage(object): - # Test Case 1b, run unsigned image if no PK - output = u_boot_console.run_command_list([ - 'efidebug boot add -b 2 HELLO2 host 0:1 /helloworld.efi -s ""', -- 'efidebug boot next 2', -+ 'efidebug boot order 2', - 'bootefi bootmgr']) - assert 'Hello, world!' in ''.join(output) - -@@ -59,13 +59,13 @@ class TestEfiSignedImage(object): - assert 'Failed to set EFI variable' not in ''.join(output) - output = u_boot_console.run_command_list([ - 'efidebug boot add -b 1 HELLO1 host 0:1 /helloworld.efi.signed -s ""', -- 'efidebug boot next 1', -+ 'efidebug boot order 1', - 'efidebug test bootmgr']) - assert('\'HELLO1\' failed' in ''.join(output)) - assert('efi_start_image() returned: 26' in ''.join(output)) - output = u_boot_console.run_command_list([ - 'efidebug boot add -b 2 HELLO2 host 0:1 /helloworld.efi -s ""', -- 'efidebug boot next 2', -+ 'efidebug boot order 2', - 'efidebug test bootmgr']) - assert '\'HELLO2\' failed' in ''.join(output) - assert 'efi_start_image() returned: 26' in ''.join(output) -@@ -77,12 +77,12 @@ class TestEfiSignedImage(object): - 'setenv -e -nv -bs -rt -at -i 4000000:$filesize db']) - assert 'Failed to set EFI variable' not in ''.join(output) - output = u_boot_console.run_command_list([ -- 'efidebug boot next 2', -+ 'efidebug boot order 2', - 'efidebug test bootmgr']) - assert '\'HELLO2\' failed' in ''.join(output) - assert 'efi_start_image() returned: 26' in ''.join(output) - output = u_boot_console.run_command_list([ -- 'efidebug boot next 1', -+ 'efidebug boot order 1', - 'bootefi bootmgr']) - assert 'Hello, world!' in ''.join(output) - -@@ -105,7 +105,7 @@ class TestEfiSignedImage(object): - assert 'Failed to set EFI variable' not in ''.join(output) - output = u_boot_console.run_command_list([ - 'efidebug boot add -b 1 HELLO host 0:1 /helloworld.efi.signed -s ""', -- 'efidebug boot next 1', -+ 'efidebug boot order 1', - 'efidebug test bootmgr']) - assert '\'HELLO\' failed' in ''.join(output) - assert 'efi_start_image() returned: 26' in ''.join(output) -@@ -117,7 +117,7 @@ class TestEfiSignedImage(object): - 'setenv -e -nv -bs -rt -at -i 4000000:$filesize db']) - assert 'Failed to set EFI variable' not in ''.join(output) - output = u_boot_console.run_command_list([ -- 'efidebug boot next 1', -+ 'efidebug boot order 1', - 'efidebug test bootmgr']) - assert '\'HELLO\' failed' in ''.join(output) - assert 'efi_start_image() returned: 26' in ''.join(output) -@@ -143,7 +143,7 @@ class TestEfiSignedImage(object): - assert 'Failed to set EFI variable' not in ''.join(output) - output = u_boot_console.run_command_list([ - 'efidebug boot add -b 1 HELLO host 0:1 /helloworld.efi.signed -s ""', -- 'efidebug boot next 1', -+ 'efidebug boot order 1', - 'efidebug test bootmgr']) - assert '\'HELLO\' failed' in ''.join(output) - assert 'efi_start_image() returned: 26' in ''.join(output) -@@ -170,7 +170,7 @@ class TestEfiSignedImage(object): - assert 'Failed to set EFI variable' not in ''.join(output) - output = u_boot_console.run_command_list([ - 'efidebug boot add -b 1 HELLO host 0:1 /helloworld.efi.signed_2sigs -s ""', -- 'efidebug boot next 1', -+ 'efidebug boot order 1', - 'efidebug test bootmgr']) - assert 'Hello, world!' in ''.join(output) - -@@ -181,7 +181,7 @@ class TestEfiSignedImage(object): - 'setenv -e -nv -bs -rt -at -a -i 4000000:$filesize db']) - assert 'Failed to set EFI variable' not in ''.join(output) - output = u_boot_console.run_command_list([ -- 'efidebug boot next 1', -+ 'efidebug boot order 1', - 'efidebug test bootmgr']) - assert 'Hello, world!' in ''.join(output) - -@@ -193,7 +193,7 @@ class TestEfiSignedImage(object): - 'setenv -e -nv -bs -rt -at -i 4000000:$filesize dbx']) - assert 'Failed to set EFI variable' not in ''.join(output) - output = u_boot_console.run_command_list([ -- 'efidebug boot next 1', -+ 'efidebug boot order 1', - 'efidebug test bootmgr']) - assert '\'HELLO\' failed' in ''.join(output) - assert 'efi_start_image() returned: 26' in ''.join(output) -@@ -205,7 +205,7 @@ class TestEfiSignedImage(object): - 'setenv -e -nv -bs -rt -at -a -i 4000000:$filesize dbx']) - assert 'Failed to set EFI variable' not in ''.join(output) - output = u_boot_console.run_command_list([ -- 'efidebug boot next 1', -+ 'efidebug boot order 1', - 'efidebug test bootmgr']) - assert '\'HELLO\' failed' in ''.join(output) - assert 'efi_start_image() returned: 26' in ''.join(output) -@@ -230,7 +230,7 @@ class TestEfiSignedImage(object): - assert 'Failed to set EFI variable' not in ''.join(output) - output = u_boot_console.run_command_list([ - 'efidebug boot add -b 1 HELLO host 0:1 /helloworld.efi.signed_2sigs -s ""', -- 'efidebug boot next 1', -+ 'efidebug boot order 1', - 'efidebug test bootmgr']) - assert '\'HELLO\' failed' in ''.join(output) - assert 'efi_start_image() returned: 26' in ''.join(output) -@@ -254,7 +254,7 @@ class TestEfiSignedImage(object): - assert 'Failed to set EFI variable' not in ''.join(output) - output = u_boot_console.run_command_list([ - 'efidebug boot add -b 1 HELLO host 0:1 /helloworld.efi.signed -s ""', -- 'efidebug boot next 1', -+ 'efidebug boot order 1', - 'bootefi bootmgr']) - assert 'Hello, world!' in ''.join(output) - -@@ -265,7 +265,7 @@ class TestEfiSignedImage(object): - 'setenv -e -nv -bs -rt -at -i 4000000:$filesize dbx']) - assert 'Failed to set EFI variable' not in ''.join(output) - output = u_boot_console.run_command_list([ -- 'efidebug boot next 1', -+ 'efidebug boot order 1', - 'efidebug test bootmgr']) - assert '\'HELLO\' failed' in ''.join(output) - assert 'efi_start_image() returned: 26' in ''.join(output) -@@ -279,7 +279,7 @@ class TestEfiSignedImage(object): - 'setenv -e -nv -bs -rt -at -i 4000000:$filesize dbx']) - assert 'Failed to set EFI variable' not in ''.join(output) - output = u_boot_console.run_command_list([ -- 'efidebug boot next 1', -+ 'efidebug boot order 1', - 'efidebug test bootmgr']) - assert '\'HELLO\' failed' in ''.join(output) - assert 'efi_start_image() returned: 26' in ''.join(output) -@@ -307,7 +307,7 @@ class TestEfiSignedImage(object): - assert 'Failed to set EFI variable' not in ''.join(output) - output = u_boot_console.run_command_list([ - 'efidebug boot add -b 1 HELLO host 0:1 /helloworld.efi.signed_2sigs -s ""', -- 'efidebug boot next 1', -+ 'efidebug boot order 1', - 'efidebug test bootmgr']) - assert '\'HELLO\' failed' in ''.join(output) - assert 'efi_start_image() returned: 26' in ''.join(output) -@@ -330,7 +330,7 @@ class TestEfiSignedImage(object): - assert 'Failed to set EFI variable' not in ''.join(output) - output = u_boot_console.run_command_list([ - 'efidebug boot add -b 1 HELLO host 0:1 /helloworld.efi.signed_2sigs -s ""', -- 'efidebug boot next 1', -+ 'efidebug boot order 1', - 'efidebug test bootmgr']) - assert '\'HELLO\' failed' in ''.join(output) - assert 'efi_start_image() returned: 26' in ''.join(output) -@@ -349,7 +349,7 @@ class TestEfiSignedImage(object): - output = u_boot_console.run_command_list([ - 'host bind 0 %s' % disk_img, - 'efidebug boot add -b 1 HELLO1 host 0:1 /helloworld_forged.efi.signed -s ""', -- 'efidebug boot next 1', -+ 'efidebug boot order 1', - 'efidebug test bootmgr']) - assert('hELLO, world!' in ''.join(output)) - -@@ -364,7 +364,7 @@ class TestEfiSignedImage(object): - 'setenv -e -nv -bs -rt -at -i 4000000:$filesize PK']) - assert 'Failed to set EFI variable' not in ''.join(output) - output = u_boot_console.run_command_list([ -- 'efidebug boot next 1', -+ 'efidebug boot order 1', - 'efidebug test bootmgr']) - assert(not 'hELLO, world!' in ''.join(output)) - assert('\'HELLO1\' failed' in ''.join(output)) -diff --git a/test/py/tests/test_efi_secboot/test_signed_intca.py b/test/py/tests/test_efi_secboot/test_signed_intca.py -index d8d599d22f..8d9a5f3e7f 100644 ---- a/test/py/tests/test_efi_secboot/test_signed_intca.py -+++ b/test/py/tests/test_efi_secboot/test_signed_intca.py -@@ -40,7 +40,7 @@ class TestEfiSignedImageIntca(object): - - output = u_boot_console.run_command_list([ - 'efidebug boot add -b 1 HELLO_a host 0:1 /helloworld.efi.signed_a -s ""', -- 'efidebug boot next 1', -+ 'efidebug boot order 1', - 'efidebug test bootmgr']) - assert '\'HELLO_a\' failed' in ''.join(output) - assert 'efi_start_image() returned: 26' in ''.join(output) -@@ -49,7 +49,7 @@ class TestEfiSignedImageIntca(object): - # Test Case 1b, signed and authenticated by root CA - output = u_boot_console.run_command_list([ - 'efidebug boot add -b 2 HELLO_ab host 0:1 /helloworld.efi.signed_ab -s ""', -- 'efidebug boot next 2', -+ 'efidebug boot order 2', - 'bootefi bootmgr']) - assert 'Hello, world!' in ''.join(output) - -@@ -71,7 +71,7 @@ class TestEfiSignedImageIntca(object): - - output = u_boot_console.run_command_list([ - 'efidebug boot add -b 1 HELLO_abc host 0:1 /helloworld.efi.signed_abc -s ""', -- 'efidebug boot next 1', -+ 'efidebug boot order 1', - 'efidebug test bootmgr']) - assert '\'HELLO_abc\' failed' in ''.join(output) - assert 'efi_start_image() returned: 26' in ''.join(output) -@@ -81,7 +81,7 @@ class TestEfiSignedImageIntca(object): - output = u_boot_console.run_command_list([ - 'fatload host 0:1 4000000 db_b.auth', - 'setenv -e -nv -bs -rt -at -i 4000000:$filesize db', -- 'efidebug boot next 1', -+ 'efidebug boot order 1', - 'efidebug test bootmgr']) - assert '\'HELLO_abc\' failed' in ''.join(output) - assert 'efi_start_image() returned: 26' in ''.join(output) -@@ -91,7 +91,7 @@ class TestEfiSignedImageIntca(object): - output = u_boot_console.run_command_list([ - 'fatload host 0:1 4000000 db_c.auth', - 'setenv -e -nv -bs -rt -at -i 4000000:$filesize db', -- 'efidebug boot next 1', -+ 'efidebug boot order 1', - 'efidebug test bootmgr']) - assert 'Hello, world!' in ''.join(output) - -@@ -117,7 +117,7 @@ class TestEfiSignedImageIntca(object): - - output = u_boot_console.run_command_list([ - 'efidebug boot add -b 1 HELLO_abc host 0:1 /helloworld.efi.signed_abc -s ""', -- 'efidebug boot next 1', -+ 'efidebug boot order 1', - 'efidebug test bootmgr']) - assert 'Hello, world!' in ''.join(output) - # Or, -@@ -129,7 +129,7 @@ class TestEfiSignedImageIntca(object): - output = u_boot_console.run_command_list([ - 'fatload host 0:1 4000000 dbx_c.auth', - 'setenv -e -nv -bs -rt -at -i 4000000:$filesize dbx', -- 'efidebug boot next 1', -+ 'efidebug boot order 1', - 'efidebug test bootmgr']) - assert '\'HELLO_abc\' failed' in ''.join(output) - assert 'efi_start_image() returned: 26' in ''.join(output) -diff --git a/test/py/tests/test_efi_secboot/test_unsigned.py b/test/py/tests/test_efi_secboot/test_unsigned.py -index df63f0df08..7c078f220d 100644 ---- a/test/py/tests/test_efi_secboot/test_unsigned.py -+++ b/test/py/tests/test_efi_secboot/test_unsigned.py -@@ -36,11 +36,11 @@ class TestEfiUnsignedImage(object): - - output = u_boot_console.run_command_list([ - 'efidebug boot add -b 1 HELLO host 0:1 /helloworld.efi -s ""', -- 'efidebug boot next 1', -+ 'efidebug boot order 1', - 'bootefi bootmgr']) - assert '\'HELLO\' failed' in ''.join(output) - output = u_boot_console.run_command_list([ -- 'efidebug boot next 1', -+ 'efidebug boot order 1', - 'efidebug test bootmgr']) - assert 'efi_start_image() returned: 26' in ''.join(output) - assert 'Hello, world!' not in ''.join(output) -@@ -65,7 +65,7 @@ class TestEfiUnsignedImage(object): - - output = u_boot_console.run_command_list([ - 'efidebug boot add -b 1 HELLO host 0:1 /helloworld.efi -s ""', -- 'efidebug boot next 1', -+ 'efidebug boot order 1', - 'bootefi bootmgr']) - assert 'Hello, world!' in ''.join(output) - -@@ -89,11 +89,11 @@ class TestEfiUnsignedImage(object): - - output = u_boot_console.run_command_list([ - 'efidebug boot add -b 1 HELLO host 0:1 /helloworld.efi -s ""', -- 'efidebug boot next 1', -+ 'efidebug boot order 1', - 'bootefi bootmgr']) - assert '\'HELLO\' failed' in ''.join(output) - output = u_boot_console.run_command_list([ -- 'efidebug boot next 1', -+ 'efidebug boot order 1', - 'efidebug test bootmgr']) - assert 'efi_start_image() returned: 26' in ''.join(output) - assert 'Hello, world!' not in ''.join(output) -@@ -107,11 +107,11 @@ class TestEfiUnsignedImage(object): - - output = u_boot_console.run_command_list([ - 'efidebug boot add -b 1 HELLO host 0:1 /helloworld.efi -s ""', -- 'efidebug boot next 1', -+ 'efidebug boot order 1', - 'bootefi bootmgr']) - assert '\'HELLO\' failed' in ''.join(output) - output = u_boot_console.run_command_list([ -- 'efidebug boot next 1', -+ 'efidebug boot order 1', - 'efidebug test bootmgr']) - assert 'efi_start_image() returned: 26' in ''.join(output) - assert 'Hello, world!' not in ''.join(output) -diff --git a/test/py/tests/test_fs/test_erofs.py b/test/py/tests/test_fs/test_erofs.py -index 458a52ba79..87ad8f2d5f 100644 ---- a/test/py/tests/test_fs/test_erofs.py -+++ b/test/py/tests/test_fs/test_erofs.py -@@ -196,6 +196,15 @@ def test_erofs(u_boot_console): - """ - build_dir = u_boot_console.config.build_dir - -+ # If the EFI subsystem is enabled and initialized, EFI subsystem tries to -+ # add EFI boot option when the new disk is detected. If there is no EFI -+ # System Partition exists, EFI subsystem outputs error messages and -+ # it ends up with test failure. -+ # Restart U-Boot to clear the previous state. -+ # TODO: Ideally EFI test cases need to be fixed, but it will -+ # increase the number of system reset. -+ u_boot_console.restart_uboot() -+ - try: - # setup test environment - make_erofs_image(build_dir) -diff --git a/test/py/tests/test_fs/test_squashfs/test_sqfs_ls.py b/test/py/tests/test_fs/test_squashfs/test_sqfs_ls.py -index 527a556ed8..a20a7d1a66 100644 ---- a/test/py/tests/test_fs/test_squashfs/test_sqfs_ls.py -+++ b/test/py/tests/test_fs/test_squashfs/test_sqfs_ls.py -@@ -118,6 +118,15 @@ def test_sqfs_ls(u_boot_console): - """ - build_dir = u_boot_console.config.build_dir - -+ # If the EFI subsystem is enabled and initialized, EFI subsystem tries to -+ # add EFI boot option when the new disk is detected. If there is no EFI -+ # System Partition exists, EFI subsystem outputs error messages and -+ # it ends up with test failure. -+ # Restart U-Boot to clear the previous state. -+ # TODO: Ideally EFI test cases need to be fixed, but it will -+ # increase the number of system reset. -+ u_boot_console.restart_uboot() -+ - # setup test environment - check_mksquashfs_version() - generate_sqfs_src_dir(build_dir) diff --git a/backport-disable-VBE-by-default.patch b/disable-VBE-by-default.patch similarity index 98% rename from backport-disable-VBE-by-default.patch rename to disable-VBE-by-default.patch index 28de705ab7dc8deb81d7708736a3c886b61bbe10..dffa9fc44c5876d8b13e3578d0c53aee4a8e6a87 100644 --- a/backport-disable-VBE-by-default.patch +++ b/disable-VBE-by-default.patch @@ -2,15 +2,15 @@ From 02513d9ecc38d11ffc051ed59529e11f82164785 Mon Sep 17 00:00:00 2001 From: Peter Robinson Date: Fri, 18 Aug 2023 13:28:05 +0100 Subject: [PATCH] disable VBE by default - + Fedora doesn't support the VBE boot method, disable it to reduce size and remove a possible boot attack vector. - + Signed-off-by: Peter Robinson --- boot/Kconfig | 1 - 1 file changed, 1 deletion(-) - + diff --git a/boot/Kconfig b/boot/Kconfig index e8fb03b8016..467b09e2350 100644 --- a/boot/Kconfig @@ -24,4 +24,5 @@ index e8fb03b8016..467b09e2350 100644 select EVENT help -- -2.41.0 \ No newline at end of file +2.41.0 + diff --git a/backport-enable-bootmenu-by-default.patch b/enable-bootmenu-by-default.patch similarity index 99% rename from backport-enable-bootmenu-by-default.patch rename to enable-bootmenu-by-default.patch index 7d1394b2cf3256c0aec51b713e7ea96936cadccd..1ecd514040ffed26a3f824fa5b1be1bbb41b312e 100644 --- a/backport-enable-bootmenu-by-default.patch +++ b/enable-bootmenu-by-default.patch @@ -2,16 +2,16 @@ From a956480a6d52ae90ef4a46275c2ee29a4074de36 Mon Sep 17 00:00:00 2001 From: Peter Robinson Date: Fri, 18 Aug 2023 23:10:42 +0100 Subject: [PATCH] enable bootmenu by default - + We want the boot menu on all Fedora devices as it makes it a whole lot more user friendly. - + Signed-off-by: Peter Robinson --- boot/Kconfig | 2 ++ cmd/Kconfig | 1 + 2 files changed, 3 insertions(+) - + diff --git a/boot/Kconfig b/boot/Kconfig index 467b09e2350..ad67b1f65a6 100644 --- a/boot/Kconfig @@ -46,4 +46,4 @@ index 43ca10f69cc..3d39f2914cc 100644 help -- 2.41.0 - + diff --git a/rockchip-Enable-preboot-start-for-pci-usb.patch b/rockchip-Enable-preboot-start-for-pci-usb.patch new file mode 100644 index 0000000000000000000000000000000000000000..64e688390cf13ddac16e1e090481367364e58dd6 --- /dev/null +++ b/rockchip-Enable-preboot-start-for-pci-usb.patch @@ -0,0 +1,783 @@ +From 020f67a37342b091c74dab93a133253401d4d899 Mon Sep 17 00:00:00 2001 +From: Peter Robinson +Date: Tue, 31 Dec 2024 14:15:41 +0000 +Subject: [PATCH] rockchip: Enable preboot start for pci/usb + +Enable the preboot so nvme works OOTB + +Signed-off-by: Peter Robinson +--- + configs/anbernic-rgxx3-rk3566_defconfig | 2 ++ + configs/bpi-r2-pro-rk3568_defconfig | 2 ++ + configs/cm3588-nas-rk3588_defconfig | 2 ++ + configs/coolpi-4b-rk3588s_defconfig | 2 ++ + configs/coolpi-cm5-evb-rk3588_defconfig | 2 ++ + configs/evb-rk3568_defconfig | 2 ++ + configs/evb-rk3588_defconfig | 2 ++ + configs/firefly-rk3399_defconfig | 2 ++ + configs/generic-rk3568_defconfig | 2 ++ + configs/generic-rk3588_defconfig | 2 ++ + configs/jaguar-rk3588_defconfig | 2 ++ + configs/lubancat-2-rk3568_defconfig | 2 ++ + configs/nanopc-t4-rk3399_defconfig | 2 ++ + configs/nanopc-t6-rk3588_defconfig | 2 ++ + configs/nanopi-r5c-rk3568_defconfig | 2 ++ + configs/nanopi-r5s-rk3568_defconfig | 2 ++ + configs/nanopi-r6c-rk3588s_defconfig | 2 ++ + configs/nanopi-r6s-rk3588s_defconfig | 2 ++ + configs/neu6a-io-rk3588_defconfig | 2 ++ + configs/neu6b-io-rk3588_defconfig | 2 ++ + configs/nova-rk3588s_defconfig | 2 ++ + configs/odroid-m1-rk3568_defconfig | 2 ++ + configs/orangepi-3b-rk3566_defconfig | 2 ++ + configs/orangepi-5-plus-rk3588_defconfig | 2 ++ + configs/orangepi-5-rk3588s_defconfig | 2 ++ + configs/pinebook-pro-rk3399_defconfig | 1 + + configs/pinetab2-rk3566_defconfig | 2 ++ + configs/powkiddy-x55-rk3566_defconfig | 2 ++ + configs/quartz64-a-rk3566_defconfig | 2 ++ + configs/quartz64-b-rk3566_defconfig | 2 ++ + configs/quartzpro64-rk3588_defconfig | 2 ++ + configs/radxa-cm3-io-rk3566_defconfig | 2 ++ + configs/radxa-e25-rk3568_defconfig | 2 ++ + configs/radxa-zero-3-rk3566_defconfig | 2 ++ + configs/roc-pc-mezzanine-rk3399_defconfig | 2 ++ + configs/rock-3a-rk3568_defconfig | 2 ++ + configs/rock-3b-rk3568_defconfig | 2 ++ + configs/rock-3c-rk3566_defconfig | 2 ++ + configs/rock-4c-plus-rk3399_defconfig | 2 ++ + configs/rock-4se-rk3399_defconfig | 2 ++ + configs/rock-5-itx-rk3588_defconfig | 2 ++ + configs/rock-pi-4-rk3399_defconfig | 2 ++ + configs/rock-pi-4c-rk3399_defconfig | 2 ++ + configs/rock-pi-n10-rk3399pro_defconfig | 2 ++ + configs/rock5a-rk3588s_defconfig | 2 ++ + configs/rock5b-rk3588_defconfig | 2 ++ + configs/rock960-rk3399_defconfig | 2 ++ + configs/rockpro64-rk3399_defconfig | 2 ++ + configs/sige7-rk3588_defconfig | 2 ++ + configs/soquartz-blade-rk3566_defconfig | 2 ++ + configs/soquartz-cm4-rk3566_defconfig | 2 ++ + configs/soquartz-model-a-rk3566_defconfig | 2 ++ + configs/tiger-rk3588_defconfig | 2 ++ + configs/toybrick-rk3588_defconfig | 2 ++ + configs/turing-rk1-rk3588_defconfig | 2 ++ + 55 files changed, 109 insertions(+) + +diff --git a/configs/anbernic-rgxx3-rk3566_defconfig b/configs/anbernic-rgxx3-rk3566_defconfig +index 14c97b4c5bf..de92e1b4141 100644 +--- a/configs/anbernic-rgxx3-rk3566_defconfig ++++ b/configs/anbernic-rgxx3-rk3566_defconfig +@@ -12,6 +12,8 @@ CONFIG_SYS_LOAD_ADDR=0xc00800 + CONFIG_DEBUG_UART_BASE=0xFE660000 + CONFIG_DEBUG_UART_CLOCK=24000000 + CONFIG_DEBUG_UART=y ++CONFIG_USE_PREBOOT=y ++CONFIG_PREBOOT="pci enum; usb start; nvme scan;" + # CONFIG_EFI_LOADER is not set + CONFIG_FIT=y + CONFIG_FIT_VERBOSE=y +diff --git a/configs/bpi-r2-pro-rk3568_defconfig b/configs/bpi-r2-pro-rk3568_defconfig +index d84ea2f955f..de777817c37 100644 +--- a/configs/bpi-r2-pro-rk3568_defconfig ++++ b/configs/bpi-r2-pro-rk3568_defconfig +@@ -9,6 +9,8 @@ CONFIG_SYS_LOAD_ADDR=0xc00800 + CONFIG_DEBUG_UART_BASE=0xFE660000 + CONFIG_DEBUG_UART_CLOCK=24000000 + CONFIG_DEBUG_UART=y ++CONFIG_USE_PREBOOT=y ++CONFIG_PREBOOT="pci enum; usb start; nvme scan;" + CONFIG_AHCI=y + CONFIG_FIT=y + CONFIG_FIT_VERBOSE=y +diff --git a/configs/cm3588-nas-rk3588_defconfig b/configs/cm3588-nas-rk3588_defconfig +index fd0a32d6d79..e561be511d4 100644 +--- a/configs/cm3588-nas-rk3588_defconfig ++++ b/configs/cm3588-nas-rk3588_defconfig +@@ -12,6 +12,8 @@ CONFIG_DEBUG_UART_BASE=0xFEB50000 + CONFIG_DEBUG_UART_CLOCK=24000000 + CONFIG_PCI=y + CONFIG_DEBUG_UART=y ++CONFIG_USE_PREBOOT=y ++CONFIG_PREBOOT="pci enum; usb start; nvme scan;" + CONFIG_FIT=y + CONFIG_FIT_VERBOSE=y + CONFIG_SPL_FIT_SIGNATURE=y +diff --git a/configs/coolpi-4b-rk3588s_defconfig b/configs/coolpi-4b-rk3588s_defconfig +index ea985b81670..96d7cffb075 100644 +--- a/configs/coolpi-4b-rk3588s_defconfig ++++ b/configs/coolpi-4b-rk3588s_defconfig +@@ -17,6 +17,8 @@ CONFIG_SPL_SPI_FLASH_SUPPORT=y + CONFIG_SPL_SPI=y + CONFIG_PCI=y + CONFIG_DEBUG_UART=y ++CONFIG_USE_PREBOOT=y ++CONFIG_PREBOOT="pci enum; usb start; nvme scan;" + CONFIG_AHCI=y + CONFIG_FIT=y + CONFIG_FIT_VERBOSE=y +diff --git a/configs/coolpi-cm5-evb-rk3588_defconfig b/configs/coolpi-cm5-evb-rk3588_defconfig +index 58ffe7baf5f..5eadc091242 100644 +--- a/configs/coolpi-cm5-evb-rk3588_defconfig ++++ b/configs/coolpi-cm5-evb-rk3588_defconfig +@@ -17,6 +17,8 @@ CONFIG_SPL_SPI_FLASH_SUPPORT=y + CONFIG_SPL_SPI=y + CONFIG_PCI=y + CONFIG_DEBUG_UART=y ++CONFIG_USE_PREBOOT=y ++CONFIG_PREBOOT="pci enum; usb start; nvme scan;" + CONFIG_AHCI=y + CONFIG_FIT=y + CONFIG_FIT_VERBOSE=y +diff --git a/configs/evb-rk3568_defconfig b/configs/evb-rk3568_defconfig +index a068bc6846c..8c94f7b21bc 100644 +--- a/configs/evb-rk3568_defconfig ++++ b/configs/evb-rk3568_defconfig +@@ -9,6 +9,8 @@ CONFIG_SYS_LOAD_ADDR=0xc00800 + CONFIG_DEBUG_UART_BASE=0xFE660000 + CONFIG_DEBUG_UART_CLOCK=24000000 + CONFIG_DEBUG_UART=y ++CONFIG_USE_PREBOOT=y ++CONFIG_PREBOOT="pci enum; usb start; nvme scan;" + CONFIG_FIT=y + CONFIG_FIT_VERBOSE=y + CONFIG_SPL_FIT_SIGNATURE=y +diff --git a/configs/evb-rk3588_defconfig b/configs/evb-rk3588_defconfig +index 3d4d2747145..051015fd811 100644 +--- a/configs/evb-rk3588_defconfig ++++ b/configs/evb-rk3588_defconfig +@@ -10,6 +10,8 @@ CONFIG_SYS_LOAD_ADDR=0xc00800 + CONFIG_DEBUG_UART_BASE=0xFEB50000 + CONFIG_DEBUG_UART_CLOCK=24000000 + CONFIG_DEBUG_UART=y ++CONFIG_USE_PREBOOT=y ++CONFIG_PREBOOT="pci enum; usb start; nvme scan;" + CONFIG_FIT=y + CONFIG_FIT_VERBOSE=y + CONFIG_SPL_FIT_SIGNATURE=y +diff --git a/configs/firefly-rk3399_defconfig b/configs/firefly-rk3399_defconfig +index 3871627318b..b96aadc78eb 100644 +--- a/configs/firefly-rk3399_defconfig ++++ b/configs/firefly-rk3399_defconfig +@@ -14,6 +14,8 @@ CONFIG_DEBUG_UART_BASE=0xFF1A0000 + CONFIG_DEBUG_UART_CLOCK=24000000 + CONFIG_PCI=y + CONFIG_DEBUG_UART=y ++CONFIG_USE_PREBOOT=y ++CONFIG_PREBOOT="pci enum; usb start; nvme scan;" + CONFIG_DEFAULT_FDT_FILE="rockchip/rk3399-firefly.dtb" + CONFIG_DISPLAY_BOARDINFO_LATE=y + CONFIG_SPL_MAX_SIZE=0x40000 +diff --git a/configs/generic-rk3568_defconfig b/configs/generic-rk3568_defconfig +index f79f0e84400..ba5339a004f 100644 +--- a/configs/generic-rk3568_defconfig ++++ b/configs/generic-rk3568_defconfig +@@ -14,6 +14,8 @@ CONFIG_DEBUG_UART_CLOCK=24000000 + CONFIG_SPL_SPI_FLASH_SUPPORT=y + CONFIG_SPL_SPI=y + CONFIG_DEBUG_UART=y ++CONFIG_USE_PREBOOT=y ++CONFIG_PREBOOT="pci enum; usb start; nvme scan;" + CONFIG_FIT=y + CONFIG_FIT_VERBOSE=y + CONFIG_SPL_FIT_SIGNATURE=y +diff --git a/configs/generic-rk3588_defconfig b/configs/generic-rk3588_defconfig +index 51e31dce3a9..1c767caa06a 100644 +--- a/configs/generic-rk3588_defconfig ++++ b/configs/generic-rk3588_defconfig +@@ -10,6 +10,8 @@ CONFIG_SYS_LOAD_ADDR=0xc00800 + CONFIG_DEBUG_UART_BASE=0xFEB50000 + CONFIG_DEBUG_UART_CLOCK=24000000 + CONFIG_DEBUG_UART=y ++CONFIG_USE_PREBOOT=y ++CONFIG_PREBOOT="pci enum; usb start; nvme scan;" + CONFIG_FIT=y + CONFIG_FIT_VERBOSE=y + CONFIG_SPL_FIT_SIGNATURE=y +diff --git a/configs/jaguar-rk3588_defconfig b/configs/jaguar-rk3588_defconfig +index 6e853991d1d..a5a56a33d09 100644 +--- a/configs/jaguar-rk3588_defconfig ++++ b/configs/jaguar-rk3588_defconfig +@@ -16,6 +16,8 @@ CONFIG_DEBUG_UART_BASE=0xfeb50000 + CONFIG_DEBUG_UART_CLOCK=24000000 + CONFIG_PCI=y + CONFIG_DEBUG_UART=y ++CONFIG_USE_PREBOOT=y ++CONFIG_PREBOOT="pci enum; usb start; nvme scan;" + CONFIG_FIT=y + CONFIG_FIT_VERBOSE=y + CONFIG_SPL_FIT_SIGNATURE=y +diff --git a/configs/lubancat-2-rk3568_defconfig b/configs/lubancat-2-rk3568_defconfig +index 46cc3c03fff..8915d5bfba9 100644 +--- a/configs/lubancat-2-rk3568_defconfig ++++ b/configs/lubancat-2-rk3568_defconfig +@@ -9,6 +9,8 @@ CONFIG_SYS_LOAD_ADDR=0xc00800 + CONFIG_DEBUG_UART_BASE=0xFE660000 + CONFIG_DEBUG_UART_CLOCK=24000000 + CONFIG_DEBUG_UART=y ++CONFIG_USE_PREBOOT=y ++CONFIG_PREBOOT="pci enum; usb start; nvme scan;" + CONFIG_EFI_VAR_BUF_SIZE=16384 + CONFIG_FIT=y + CONFIG_FIT_VERBOSE=y +diff --git a/configs/nanopc-t4-rk3399_defconfig b/configs/nanopc-t4-rk3399_defconfig +index 26c12c51078..33f7e838c2c 100644 +--- a/configs/nanopc-t4-rk3399_defconfig ++++ b/configs/nanopc-t4-rk3399_defconfig +@@ -14,6 +14,8 @@ CONFIG_DEBUG_UART_BASE=0xFF1A0000 + CONFIG_DEBUG_UART_CLOCK=24000000 + CONFIG_PCI=y + CONFIG_DEBUG_UART=y ++CONFIG_USE_PREBOOT=y ++CONFIG_PREBOOT="pci enum; usb start; nvme scan;" + CONFIG_DEFAULT_FDT_FILE="rockchip/rk3399-nanopc-t4.dtb" + CONFIG_DISPLAY_BOARDINFO_LATE=y + CONFIG_SPL_MAX_SIZE=0x40000 +diff --git a/configs/nanopc-t6-rk3588_defconfig b/configs/nanopc-t6-rk3588_defconfig +index 772b7df1555..ba6cf48308c 100644 +--- a/configs/nanopc-t6-rk3588_defconfig ++++ b/configs/nanopc-t6-rk3588_defconfig +@@ -18,6 +18,8 @@ CONFIG_SPL_SPI_FLASH_SUPPORT=y + CONFIG_SPL_SPI=y + CONFIG_PCI=y + CONFIG_DEBUG_UART=y ++CONFIG_USE_PREBOOT=y ++CONFIG_PREBOOT="pci enum; usb start; nvme scan;" + CONFIG_FIT=y + CONFIG_FIT_VERBOSE=y + CONFIG_SPL_FIT_SIGNATURE=y +diff --git a/configs/nanopi-r5c-rk3568_defconfig b/configs/nanopi-r5c-rk3568_defconfig +index 4a43b17ccb1..91c95b491d5 100644 +--- a/configs/nanopi-r5c-rk3568_defconfig ++++ b/configs/nanopi-r5c-rk3568_defconfig +@@ -11,6 +11,8 @@ CONFIG_DEBUG_UART_BASE=0xFE660000 + CONFIG_DEBUG_UART_CLOCK=24000000 + CONFIG_PCI=y + CONFIG_DEBUG_UART=y ++CONFIG_USE_PREBOOT=y ++CONFIG_PREBOOT="pci enum; usb start; nvme scan;" + CONFIG_FIT=y + CONFIG_FIT_VERBOSE=y + CONFIG_SPL_FIT_SIGNATURE=y +diff --git a/configs/nanopi-r5s-rk3568_defconfig b/configs/nanopi-r5s-rk3568_defconfig +index a60d229fbbf..355d8114a9b 100644 +--- a/configs/nanopi-r5s-rk3568_defconfig ++++ b/configs/nanopi-r5s-rk3568_defconfig +@@ -11,6 +11,8 @@ CONFIG_DEBUG_UART_BASE=0xFE660000 + CONFIG_DEBUG_UART_CLOCK=24000000 + CONFIG_PCI=y + CONFIG_DEBUG_UART=y ++CONFIG_USE_PREBOOT=y ++CONFIG_PREBOOT="pci enum; usb start; nvme scan;" + CONFIG_FIT=y + CONFIG_FIT_VERBOSE=y + CONFIG_SPL_FIT_SIGNATURE=y +diff --git a/configs/nanopi-r6c-rk3588s_defconfig b/configs/nanopi-r6c-rk3588s_defconfig +index c4de5518a72..92697c536d9 100644 +--- a/configs/nanopi-r6c-rk3588s_defconfig ++++ b/configs/nanopi-r6c-rk3588s_defconfig +@@ -12,6 +12,8 @@ CONFIG_DEBUG_UART_BASE=0xFEB50000 + CONFIG_DEBUG_UART_CLOCK=24000000 + CONFIG_PCI=y + CONFIG_DEBUG_UART=y ++CONFIG_USE_PREBOOT=y ++CONFIG_PREBOOT="pci enum; usb start; nvme scan;" + CONFIG_FIT=y + CONFIG_FIT_VERBOSE=y + CONFIG_SPL_FIT_SIGNATURE=y +diff --git a/configs/nanopi-r6s-rk3588s_defconfig b/configs/nanopi-r6s-rk3588s_defconfig +index 2726729b9ac..63a3690db8e 100644 +--- a/configs/nanopi-r6s-rk3588s_defconfig ++++ b/configs/nanopi-r6s-rk3588s_defconfig +@@ -12,6 +12,8 @@ CONFIG_DEBUG_UART_BASE=0xFEB50000 + CONFIG_DEBUG_UART_CLOCK=24000000 + CONFIG_PCI=y + CONFIG_DEBUG_UART=y ++CONFIG_USE_PREBOOT=y ++CONFIG_PREBOOT="pci enum; usb start; nvme scan;" + CONFIG_FIT=y + CONFIG_FIT_VERBOSE=y + CONFIG_SPL_FIT_SIGNATURE=y +diff --git a/configs/neu6a-io-rk3588_defconfig b/configs/neu6a-io-rk3588_defconfig +index 291e0d26d42..e385aba7bc4 100644 +--- a/configs/neu6a-io-rk3588_defconfig ++++ b/configs/neu6a-io-rk3588_defconfig +@@ -10,6 +10,8 @@ CONFIG_SYS_LOAD_ADDR=0xc00800 + CONFIG_DEBUG_UART_BASE=0xFEB50000 + CONFIG_DEBUG_UART_CLOCK=24000000 + CONFIG_DEBUG_UART=y ++CONFIG_USE_PREBOOT=y ++CONFIG_PREBOOT="pci enum; usb start; nvme scan;" + CONFIG_FIT=y + CONFIG_FIT_VERBOSE=y + CONFIG_SPL_FIT_SIGNATURE=y +diff --git a/configs/neu6b-io-rk3588_defconfig b/configs/neu6b-io-rk3588_defconfig +index 4e22852f23c..79f4e66cb9b 100644 +--- a/configs/neu6b-io-rk3588_defconfig ++++ b/configs/neu6b-io-rk3588_defconfig +@@ -10,6 +10,8 @@ CONFIG_SYS_LOAD_ADDR=0xc00800 + CONFIG_DEBUG_UART_BASE=0xFEB50000 + CONFIG_DEBUG_UART_CLOCK=24000000 + CONFIG_DEBUG_UART=y ++CONFIG_USE_PREBOOT=y ++CONFIG_PREBOOT="pci enum; usb start; nvme scan;" + CONFIG_FIT=y + CONFIG_FIT_VERBOSE=y + CONFIG_SPL_FIT_SIGNATURE=y +diff --git a/configs/nova-rk3588s_defconfig b/configs/nova-rk3588s_defconfig +index fb30dfd1db8..e99898355e1 100644 +--- a/configs/nova-rk3588s_defconfig ++++ b/configs/nova-rk3588s_defconfig +@@ -11,6 +11,8 @@ CONFIG_DEBUG_UART_BASE=0xFEB50000 + CONFIG_DEBUG_UART_CLOCK=24000000 + CONFIG_PCI=y + CONFIG_DEBUG_UART=y ++CONFIG_USE_PREBOOT=y ++CONFIG_PREBOOT="pci enum; usb start; nvme scan;" + CONFIG_FIT=y + CONFIG_FIT_VERBOSE=y + CONFIG_SPL_FIT_SIGNATURE=y +diff --git a/configs/odroid-m1-rk3568_defconfig b/configs/odroid-m1-rk3568_defconfig +index a8e8a8781e1..a3ea2e592b9 100644 +--- a/configs/odroid-m1-rk3568_defconfig ++++ b/configs/odroid-m1-rk3568_defconfig +@@ -17,6 +17,8 @@ CONFIG_SPL_SPI_FLASH_SUPPORT=y + CONFIG_SPL_SPI=y + CONFIG_PCI=y + CONFIG_DEBUG_UART=y ++CONFIG_USE_PREBOOT=y ++CONFIG_PREBOOT="pci enum; usb start; nvme scan;" + CONFIG_AHCI=y + CONFIG_FIT=y + CONFIG_FIT_VERBOSE=y +diff --git a/configs/orangepi-3b-rk3566_defconfig b/configs/orangepi-3b-rk3566_defconfig +index 2181c9caf58..fee0c719f25 100644 +--- a/configs/orangepi-3b-rk3566_defconfig ++++ b/configs/orangepi-3b-rk3566_defconfig +@@ -18,6 +18,8 @@ CONFIG_SPL_SPI_FLASH_SUPPORT=y + CONFIG_SPL_SPI=y + CONFIG_PCI=y + CONFIG_DEBUG_UART=y ++CONFIG_USE_PREBOOT=y ++CONFIG_PREBOOT="pci enum; usb start; nvme scan;" + CONFIG_AHCI=y + CONFIG_FIT=y + CONFIG_FIT_VERBOSE=y +diff --git a/configs/orangepi-5-plus-rk3588_defconfig b/configs/orangepi-5-plus-rk3588_defconfig +index 9050fceda45..2e1fe2c6dc5 100644 +--- a/configs/orangepi-5-plus-rk3588_defconfig ++++ b/configs/orangepi-5-plus-rk3588_defconfig +@@ -18,6 +18,8 @@ CONFIG_SPL_SPI_FLASH_SUPPORT=y + CONFIG_SPL_SPI=y + CONFIG_PCI=y + CONFIG_DEBUG_UART=y ++CONFIG_USE_PREBOOT=y ++CONFIG_PREBOOT="pci enum; usb start; nvme scan;" + CONFIG_AHCI=y + CONFIG_FIT=y + CONFIG_FIT_VERBOSE=y +diff --git a/configs/orangepi-5-rk3588s_defconfig b/configs/orangepi-5-rk3588s_defconfig +index 6e2ff7d338a..7ec7d13e1f9 100644 +--- a/configs/orangepi-5-rk3588s_defconfig ++++ b/configs/orangepi-5-rk3588s_defconfig +@@ -17,6 +17,8 @@ CONFIG_SPL_SPI_FLASH_SUPPORT=y + CONFIG_SPL_SPI=y + CONFIG_PCI=y + CONFIG_DEBUG_UART=y ++CONFIG_USE_PREBOOT=y ++CONFIG_PREBOOT="pci enum; usb start; nvme scan;" + CONFIG_AHCI=y + CONFIG_FIT=y + CONFIG_FIT_VERBOSE=y +diff --git a/configs/pinebook-pro-rk3399_defconfig b/configs/pinebook-pro-rk3399_defconfig +index dfa927ccb17..acc2a0a9fcd 100644 +--- a/configs/pinebook-pro-rk3399_defconfig ++++ b/configs/pinebook-pro-rk3399_defconfig +@@ -22,6 +22,7 @@ CONFIG_PCI=y + CONFIG_DEBUG_UART=y + CONFIG_BOOTDELAY=3 + CONFIG_USE_PREBOOT=y ++CONFIG_PREBOOT="pci enum; usb start; nvme scan;" + CONFIG_DEFAULT_FDT_FILE="rockchip/rk3399-pinebook-pro.dtb" + CONFIG_DISPLAY_BOARDINFO_LATE=y + CONFIG_SPL_MAX_SIZE=0x40000 +diff --git a/configs/pinetab2-rk3566_defconfig b/configs/pinetab2-rk3566_defconfig +index 45e63b42d19..3ef0ddbbe31 100644 +--- a/configs/pinetab2-rk3566_defconfig ++++ b/configs/pinetab2-rk3566_defconfig +@@ -18,6 +18,8 @@ CONFIG_DEBUG_UART_CLOCK=24000000 + CONFIG_SPL_SPI_FLASH_SUPPORT=y + CONFIG_SPL_SPI=y + CONFIG_DEBUG_UART=y ++CONFIG_USE_PREBOOT=y ++CONFIG_PREBOOT="pci enum; usb start; nvme scan;" + CONFIG_FIT=y + CONFIG_FIT_VERBOSE=y + CONFIG_SPL_FIT_SIGNATURE=y +diff --git a/configs/powkiddy-x55-rk3566_defconfig b/configs/powkiddy-x55-rk3566_defconfig +index 85280839889..f93a463087b 100644 +--- a/configs/powkiddy-x55-rk3566_defconfig ++++ b/configs/powkiddy-x55-rk3566_defconfig +@@ -9,6 +9,8 @@ CONFIG_SYS_LOAD_ADDR=0xc00800 + CONFIG_DEBUG_UART_BASE=0xFE660000 + CONFIG_DEBUG_UART_CLOCK=24000000 + CONFIG_DEBUG_UART=y ++CONFIG_USE_PREBOOT=y ++CONFIG_PREBOOT="pci enum; usb start; nvme scan;" + CONFIG_FIT=y + CONFIG_FIT_VERBOSE=y + CONFIG_SPL_FIT_SIGNATURE=y +diff --git a/configs/quartz64-a-rk3566_defconfig b/configs/quartz64-a-rk3566_defconfig +index fe3fa37611a..60b1f8f1784 100644 +--- a/configs/quartz64-a-rk3566_defconfig ++++ b/configs/quartz64-a-rk3566_defconfig +@@ -18,6 +18,8 @@ CONFIG_SPL_SPI_FLASH_SUPPORT=y + CONFIG_SPL_SPI=y + CONFIG_PCI=y + CONFIG_DEBUG_UART=y ++CONFIG_USE_PREBOOT=y ++CONFIG_PREBOOT="pci enum; usb start; nvme scan;" + CONFIG_AHCI=y + CONFIG_FIT=y + CONFIG_FIT_VERBOSE=y +diff --git a/configs/quartz64-b-rk3566_defconfig b/configs/quartz64-b-rk3566_defconfig +index 929736f76af..c3155d9b835 100644 +--- a/configs/quartz64-b-rk3566_defconfig ++++ b/configs/quartz64-b-rk3566_defconfig +@@ -17,6 +17,8 @@ CONFIG_SPL_SPI_FLASH_SUPPORT=y + CONFIG_SPL_SPI=y + CONFIG_PCI=y + CONFIG_DEBUG_UART=y ++CONFIG_USE_PREBOOT=y ++CONFIG_PREBOOT="pci enum; usb start; nvme scan;" + CONFIG_AHCI=y + CONFIG_FIT=y + CONFIG_FIT_VERBOSE=y +diff --git a/configs/quartzpro64-rk3588_defconfig b/configs/quartzpro64-rk3588_defconfig +index ade7be27e92..263d21bee8b 100644 +--- a/configs/quartzpro64-rk3588_defconfig ++++ b/configs/quartzpro64-rk3588_defconfig +@@ -12,6 +12,8 @@ CONFIG_DEBUG_UART_BASE=0xFEB50000 + CONFIG_DEBUG_UART_CLOCK=24000000 + CONFIG_PCI=y + CONFIG_DEBUG_UART=y ++CONFIG_USE_PREBOOT=y ++CONFIG_PREBOOT="pci enum; usb start; nvme scan;" + CONFIG_AHCI=y + CONFIG_FIT=y + CONFIG_FIT_VERBOSE=y +diff --git a/configs/radxa-cm3-io-rk3566_defconfig b/configs/radxa-cm3-io-rk3566_defconfig +index 2655fdc3170..c1a27f6e310 100644 +--- a/configs/radxa-cm3-io-rk3566_defconfig ++++ b/configs/radxa-cm3-io-rk3566_defconfig +@@ -9,6 +9,8 @@ CONFIG_SYS_LOAD_ADDR=0xc00800 + CONFIG_DEBUG_UART_BASE=0xFE660000 + CONFIG_DEBUG_UART_CLOCK=24000000 + CONFIG_DEBUG_UART=y ++CONFIG_USE_PREBOOT=y ++CONFIG_PREBOOT="pci enum; usb start; nvme scan;" + CONFIG_FIT=y + CONFIG_FIT_VERBOSE=y + CONFIG_SPL_FIT_SIGNATURE=y +diff --git a/configs/radxa-e25-rk3568_defconfig b/configs/radxa-e25-rk3568_defconfig +index 4df594ddc01..3830d27b264 100644 +--- a/configs/radxa-e25-rk3568_defconfig ++++ b/configs/radxa-e25-rk3568_defconfig +@@ -11,6 +11,8 @@ CONFIG_DEBUG_UART_BASE=0xFE660000 + CONFIG_DEBUG_UART_CLOCK=24000000 + CONFIG_PCI=y + CONFIG_DEBUG_UART=y ++CONFIG_USE_PREBOOT=y ++CONFIG_PREBOOT="pci enum; usb start; nvme scan;" + CONFIG_AHCI=y + CONFIG_FIT=y + CONFIG_FIT_VERBOSE=y +diff --git a/configs/radxa-zero-3-rk3566_defconfig b/configs/radxa-zero-3-rk3566_defconfig +index 5989b07ad79..1b571ec3847 100644 +--- a/configs/radxa-zero-3-rk3566_defconfig ++++ b/configs/radxa-zero-3-rk3566_defconfig +@@ -11,6 +11,8 @@ CONFIG_SYS_LOAD_ADDR=0xc00800 + CONFIG_DEBUG_UART_BASE=0xFE660000 + CONFIG_DEBUG_UART_CLOCK=24000000 + CONFIG_DEBUG_UART=y ++CONFIG_USE_PREBOOT=y ++CONFIG_PREBOOT="pci enum; usb start; nvme scan;" + CONFIG_FIT=y + CONFIG_FIT_VERBOSE=y + CONFIG_SPL_FIT_SIGNATURE=y +diff --git a/configs/roc-pc-mezzanine-rk3399_defconfig b/configs/roc-pc-mezzanine-rk3399_defconfig +index 3ab5fd69c62..ba254d8f6c0 100644 +--- a/configs/roc-pc-mezzanine-rk3399_defconfig ++++ b/configs/roc-pc-mezzanine-rk3399_defconfig +@@ -21,6 +21,8 @@ CONFIG_SPL_SPI_FLASH_SUPPORT=y + CONFIG_SPL_SPI=y + CONFIG_PCI=y + CONFIG_DEBUG_UART=y ++CONFIG_USE_PREBOOT=y ++CONFIG_PREBOOT="pci enum; usb start; nvme scan;" + # CONFIG_ANDROID_BOOT_IMAGE is not set + CONFIG_DEFAULT_FDT_FILE="rockchip/rk3399-roc-pc-mezzanine.dtb" + CONFIG_DISPLAY_BOARDINFO_LATE=y +diff --git a/configs/rock-3a-rk3568_defconfig b/configs/rock-3a-rk3568_defconfig +index 733ce631457..3387796a0c5 100644 +--- a/configs/rock-3a-rk3568_defconfig ++++ b/configs/rock-3a-rk3568_defconfig +@@ -16,6 +16,8 @@ CONFIG_SPL_SPI_FLASH_SUPPORT=y + CONFIG_SPL_SPI=y + CONFIG_PCI=y + CONFIG_DEBUG_UART=y ++CONFIG_USE_PREBOOT=y ++CONFIG_PREBOOT="pci enum; usb start; nvme scan;" + CONFIG_AHCI=y + CONFIG_FIT=y + CONFIG_FIT_VERBOSE=y +diff --git a/configs/rock-3b-rk3568_defconfig b/configs/rock-3b-rk3568_defconfig +index 2023feb36c2..84c6aab6b33 100644 +--- a/configs/rock-3b-rk3568_defconfig ++++ b/configs/rock-3b-rk3568_defconfig +@@ -16,6 +16,8 @@ CONFIG_SPL_SPI_FLASH_SUPPORT=y + CONFIG_SPL_SPI=y + CONFIG_PCI=y + CONFIG_DEBUG_UART=y ++CONFIG_USE_PREBOOT=y ++CONFIG_PREBOOT="pci enum; usb start; nvme scan;" + CONFIG_AHCI=y + CONFIG_FIT=y + CONFIG_FIT_VERBOSE=y +diff --git a/configs/rock-3c-rk3566_defconfig b/configs/rock-3c-rk3566_defconfig +index 2528c7c639c..0a0010b1268 100644 +--- a/configs/rock-3c-rk3566_defconfig ++++ b/configs/rock-3c-rk3566_defconfig +@@ -16,6 +16,8 @@ CONFIG_SPL_SPI_FLASH_SUPPORT=y + CONFIG_SPL_SPI=y + CONFIG_PCI=y + CONFIG_DEBUG_UART=y ++CONFIG_USE_PREBOOT=y ++CONFIG_PREBOOT="pci enum; usb start; nvme scan;" + CONFIG_AHCI=y + CONFIG_FIT=y + CONFIG_FIT_VERBOSE=y +diff --git a/configs/rock-4c-plus-rk3399_defconfig b/configs/rock-4c-plus-rk3399_defconfig +index 0c73a212ea1..2ae2eff39e2 100644 +--- a/configs/rock-4c-plus-rk3399_defconfig ++++ b/configs/rock-4c-plus-rk3399_defconfig +@@ -17,6 +17,8 @@ CONFIG_DEBUG_UART_CLOCK=24000000 + CONFIG_SPL_SPI_FLASH_SUPPORT=y + CONFIG_SPL_SPI=y + CONFIG_DEBUG_UART=y ++CONFIG_USE_PREBOOT=y ++CONFIG_PREBOOT="pci enum; usb start; nvme scan;" + CONFIG_EFI_CAPSULE_ON_DISK=y + CONFIG_EFI_CAPSULE_FIRMWARE_RAW=y + # CONFIG_ANDROID_BOOT_IMAGE is not set +diff --git a/configs/rock-4se-rk3399_defconfig b/configs/rock-4se-rk3399_defconfig +index 3ae19692155..12621b8a41b 100644 +--- a/configs/rock-4se-rk3399_defconfig ++++ b/configs/rock-4se-rk3399_defconfig +@@ -18,6 +18,8 @@ CONFIG_SPL_SPI_FLASH_SUPPORT=y + CONFIG_SPL_SPI=y + CONFIG_PCI=y + CONFIG_DEBUG_UART=y ++CONFIG_USE_PREBOOT=y ++CONFIG_PREBOOT="pci enum; usb start; nvme scan;" + CONFIG_AHCI=y + CONFIG_EFI_CAPSULE_ON_DISK=y + CONFIG_EFI_CAPSULE_FIRMWARE_RAW=y +diff --git a/configs/rock-5-itx-rk3588_defconfig b/configs/rock-5-itx-rk3588_defconfig +index d0dd1c20ece..b3a778907c8 100644 +--- a/configs/rock-5-itx-rk3588_defconfig ++++ b/configs/rock-5-itx-rk3588_defconfig +@@ -18,6 +18,8 @@ CONFIG_SPL_SPI_FLASH_SUPPORT=y + CONFIG_SPL_SPI=y + CONFIG_PCI=y + CONFIG_DEBUG_UART=y ++CONFIG_USE_PREBOOT=y ++CONFIG_PREBOOT="pci enum; usb start; nvme scan;" + CONFIG_AHCI=y + CONFIG_FIT=y + CONFIG_FIT_VERBOSE=y +diff --git a/configs/rock-pi-4-rk3399_defconfig b/configs/rock-pi-4-rk3399_defconfig +index f3a5c2c45f3..d95576e804a 100644 +--- a/configs/rock-pi-4-rk3399_defconfig ++++ b/configs/rock-pi-4-rk3399_defconfig +@@ -18,6 +18,8 @@ CONFIG_SPL_SPI_FLASH_SUPPORT=y + CONFIG_SPL_SPI=y + CONFIG_PCI=y + CONFIG_DEBUG_UART=y ++CONFIG_USE_PREBOOT=y ++CONFIG_PREBOOT="pci enum; usb start; nvme scan;" + CONFIG_AHCI=y + CONFIG_EFI_CAPSULE_ON_DISK=y + CONFIG_EFI_CAPSULE_FIRMWARE_RAW=y +diff --git a/configs/rock-pi-4c-rk3399_defconfig b/configs/rock-pi-4c-rk3399_defconfig +index 9bda50c8c77..d26eb3dcb44 100644 +--- a/configs/rock-pi-4c-rk3399_defconfig ++++ b/configs/rock-pi-4c-rk3399_defconfig +@@ -18,6 +18,8 @@ CONFIG_SPL_SPI_FLASH_SUPPORT=y + CONFIG_SPL_SPI=y + CONFIG_PCI=y + CONFIG_DEBUG_UART=y ++CONFIG_USE_PREBOOT=y ++CONFIG_PREBOOT="pci enum; usb start; nvme scan;" + CONFIG_AHCI=y + CONFIG_EFI_CAPSULE_ON_DISK=y + CONFIG_EFI_CAPSULE_FIRMWARE_RAW=y +diff --git a/configs/rock-pi-n10-rk3399pro_defconfig b/configs/rock-pi-n10-rk3399pro_defconfig +index a9c6d8a907a..1cde3859eef 100644 +--- a/configs/rock-pi-n10-rk3399pro_defconfig ++++ b/configs/rock-pi-n10-rk3399pro_defconfig +@@ -13,6 +13,8 @@ CONFIG_DEBUG_UART_BASE=0xFF1A0000 + CONFIG_DEBUG_UART_CLOCK=24000000 + CONFIG_PCI=y + CONFIG_DEBUG_UART=y ++CONFIG_USE_PREBOOT=y ++CONFIG_PREBOOT="pci enum; usb start; nvme scan;" + # CONFIG_ANDROID_BOOT_IMAGE is not set + CONFIG_DEFAULT_FDT_FILE="rockchip/rk3399pro-rock-pi-n10.dtb" + # CONFIG_CONSOLE_MUX is not set +diff --git a/configs/rock5a-rk3588s_defconfig b/configs/rock5a-rk3588s_defconfig +index 9618d590009..9608f7e7e4c 100644 +--- a/configs/rock5a-rk3588s_defconfig ++++ b/configs/rock5a-rk3588s_defconfig +@@ -10,6 +10,8 @@ CONFIG_SYS_LOAD_ADDR=0xc00800 + CONFIG_DEBUG_UART_BASE=0xFEB50000 + CONFIG_DEBUG_UART_CLOCK=24000000 + CONFIG_DEBUG_UART=y ++CONFIG_USE_PREBOOT=y ++CONFIG_PREBOOT="pci enum; usb start; nvme scan;" + CONFIG_FIT=y + CONFIG_FIT_VERBOSE=y + CONFIG_SPL_FIT_SIGNATURE=y +diff --git a/configs/rock5b-rk3588_defconfig b/configs/rock5b-rk3588_defconfig +index 47ee2109f8e..e1c6961a3ab 100644 +--- a/configs/rock5b-rk3588_defconfig ++++ b/configs/rock5b-rk3588_defconfig +@@ -18,6 +18,8 @@ CONFIG_SPL_SPI_FLASH_SUPPORT=y + CONFIG_SPL_SPI=y + CONFIG_PCI=y + CONFIG_DEBUG_UART=y ++CONFIG_USE_PREBOOT=y ++CONFIG_PREBOOT="pci enum; usb start; nvme scan;" + CONFIG_AHCI=y + CONFIG_FIT=y + CONFIG_FIT_VERBOSE=y +diff --git a/configs/rock960-rk3399_defconfig b/configs/rock960-rk3399_defconfig +index aebfa73459c..8b60ad3bf00 100644 +--- a/configs/rock960-rk3399_defconfig ++++ b/configs/rock960-rk3399_defconfig +@@ -12,6 +12,8 @@ CONFIG_DEBUG_UART_BASE=0xFF1A0000 + CONFIG_DEBUG_UART_CLOCK=24000000 + CONFIG_PCI=y + CONFIG_DEBUG_UART=y ++CONFIG_USE_PREBOOT=y ++CONFIG_PREBOOT="pci enum; usb start; nvme scan;" + CONFIG_DEFAULT_FDT_FILE="rockchip/rk3399-rock960.dtb" + CONFIG_SYS_PBSIZE=1052 + CONFIG_DISPLAY_BOARDINFO_LATE=y +diff --git a/configs/rockpro64-rk3399_defconfig b/configs/rockpro64-rk3399_defconfig +index 08b7e2784e9..d80e120c66f 100644 +--- a/configs/rockpro64-rk3399_defconfig ++++ b/configs/rockpro64-rk3399_defconfig +@@ -20,6 +20,8 @@ CONFIG_SPL_SPI_FLASH_SUPPORT=y + CONFIG_SPL_SPI=y + CONFIG_PCI=y + CONFIG_DEBUG_UART=y ++CONFIG_USE_PREBOOT=y ++CONFIG_PREBOOT="pci enum; usb start; nvme scan;" + CONFIG_BOOTSTAGE=y + CONFIG_BOOTSTAGE_REPORT=y + CONFIG_DEFAULT_FDT_FILE="rockchip/rk3399-rockpro64.dtb" +diff --git a/configs/sige7-rk3588_defconfig b/configs/sige7-rk3588_defconfig +index 8b033e22b84..978df10442c 100644 +--- a/configs/sige7-rk3588_defconfig ++++ b/configs/sige7-rk3588_defconfig +@@ -13,6 +13,8 @@ CONFIG_DEBUG_UART_CLOCK=24000000 + CONFIG_SPL_SPI=y + CONFIG_PCI=y + CONFIG_DEBUG_UART=y ++CONFIG_USE_PREBOOT=y ++CONFIG_PREBOOT="pci enum; usb start; nvme scan;" + CONFIG_AHCI=y + CONFIG_FIT=y + CONFIG_FIT_VERBOSE=y +diff --git a/configs/soquartz-blade-rk3566_defconfig b/configs/soquartz-blade-rk3566_defconfig +index a1a51b2c657..4083f217c0b 100644 +--- a/configs/soquartz-blade-rk3566_defconfig ++++ b/configs/soquartz-blade-rk3566_defconfig +@@ -11,6 +11,8 @@ CONFIG_DEBUG_UART_BASE=0xFE660000 + CONFIG_DEBUG_UART_CLOCK=24000000 + CONFIG_PCI=y + CONFIG_DEBUG_UART=y ++CONFIG_USE_PREBOOT=y ++CONFIG_PREBOOT="pci enum; usb start; nvme scan;" + CONFIG_AHCI=y + CONFIG_FIT=y + CONFIG_FIT_VERBOSE=y +diff --git a/configs/soquartz-cm4-rk3566_defconfig b/configs/soquartz-cm4-rk3566_defconfig +index a8bca0eaccc..c3dd48d9dc1 100644 +--- a/configs/soquartz-cm4-rk3566_defconfig ++++ b/configs/soquartz-cm4-rk3566_defconfig +@@ -11,6 +11,8 @@ CONFIG_DEBUG_UART_BASE=0xFE660000 + CONFIG_DEBUG_UART_CLOCK=24000000 + CONFIG_PCI=y + CONFIG_DEBUG_UART=y ++CONFIG_USE_PREBOOT=y ++CONFIG_PREBOOT="pci enum; usb start; nvme scan;" + CONFIG_AHCI=y + CONFIG_FIT=y + CONFIG_FIT_VERBOSE=y +diff --git a/configs/soquartz-model-a-rk3566_defconfig b/configs/soquartz-model-a-rk3566_defconfig +index f080d2e36d2..f6f2f67b0a6 100644 +--- a/configs/soquartz-model-a-rk3566_defconfig ++++ b/configs/soquartz-model-a-rk3566_defconfig +@@ -11,6 +11,8 @@ CONFIG_DEBUG_UART_BASE=0xFE660000 + CONFIG_DEBUG_UART_CLOCK=24000000 + CONFIG_PCI=y + CONFIG_DEBUG_UART=y ++CONFIG_USE_PREBOOT=y ++CONFIG_PREBOOT="pci enum; usb start; nvme scan;" + CONFIG_AHCI=y + CONFIG_FIT=y + CONFIG_FIT_VERBOSE=y +diff --git a/configs/tiger-rk3588_defconfig b/configs/tiger-rk3588_defconfig +index f962ac416f3..1fc7301f6ae 100644 +--- a/configs/tiger-rk3588_defconfig ++++ b/configs/tiger-rk3588_defconfig +@@ -17,6 +17,8 @@ CONFIG_DEBUG_UART_CLOCK=24000000 + # CONFIG_DEBUG_UART_BOARD_INIT is not set + CONFIG_PCI=y + CONFIG_DEBUG_UART=y ++CONFIG_USE_PREBOOT=y ++CONFIG_PREBOOT="pci enum; usb start; nvme scan;" + CONFIG_FIT=y + CONFIG_FIT_VERBOSE=y + CONFIG_SPL_FIT_SIGNATURE=y +diff --git a/configs/toybrick-rk3588_defconfig b/configs/toybrick-rk3588_defconfig +index 5e70341c987..fd7e842f9e5 100644 +--- a/configs/toybrick-rk3588_defconfig ++++ b/configs/toybrick-rk3588_defconfig +@@ -10,6 +10,8 @@ CONFIG_SYS_LOAD_ADDR=0xc00800 + CONFIG_DEBUG_UART_BASE=0xFEB50000 + CONFIG_DEBUG_UART_CLOCK=24000000 + CONFIG_DEBUG_UART=y ++CONFIG_USE_PREBOOT=y ++CONFIG_PREBOOT="pci enum; usb start; nvme scan;" + CONFIG_FIT=y + CONFIG_FIT_VERBOSE=y + CONFIG_SPL_FIT_SIGNATURE=y +diff --git a/configs/turing-rk1-rk3588_defconfig b/configs/turing-rk1-rk3588_defconfig +index 0eddf15833c..1a9aacc7b5d 100644 +--- a/configs/turing-rk1-rk3588_defconfig ++++ b/configs/turing-rk1-rk3588_defconfig +@@ -12,6 +12,8 @@ CONFIG_DEBUG_UART_BASE=0xFEBC0000 + CONFIG_DEBUG_UART_CLOCK=24000000 + CONFIG_PCI=y + CONFIG_DEBUG_UART=y ++CONFIG_USE_PREBOOT=y ++CONFIG_PREBOOT="pci enum; usb start; nvme scan;" + CONFIG_AHCI=y + CONFIG_FIT=y + CONFIG_FIT_VERBOSE=y +-- +2.47.1 + diff --git a/rpi-Add-identifiers-for-the-new-RPi-5-series.patch b/rpi-Add-identifiers-for-the-new-RPi-5-series.patch new file mode 100644 index 0000000000000000000000000000000000000000..66db2ca92f20de5f7ed1acb1cdef48dfe75ad2f1 --- /dev/null +++ b/rpi-Add-identifiers-for-the-new-RPi-5-series.patch @@ -0,0 +1,43 @@ +From 49423505898eef1baefa2823408dad8321571353 Mon Sep 17 00:00:00 2001 +From: Peter Robinson +Date: Sun, 29 Dec 2024 14:43:33 +0000 +Subject: [PATCH] rpi: Add identifiers for the new RPi 5 series + +The Raspberry Pi foundation have released the Raspberry +Pi 500, CM5 an CM5 lite devices so add the assoicated +revision identifers so we can detect them. + +Signed-off-by: Peter Robinson +--- + board/raspberrypi/rpi/rpi.c | 15 +++++++++++++++ + 1 file changed, 15 insertions(+) + +diff --git a/board/raspberrypi/rpi/rpi.c b/board/raspberrypi/rpi/rpi.c +index 18be244aa79..1e43c631898 100644 +--- a/board/raspberrypi/rpi/rpi.c ++++ b/board/raspberrypi/rpi/rpi.c +@@ -193,6 +193,21 @@ static const struct rpi_model rpi_models_new_scheme[] = { + DTB_DIR "bcm2712-rpi-5-b.dtb", + true, + }, ++ [0x18] = { ++ "Compute Module 5", ++ DTB_DIR "bcm2712-rpi-cm5-cm5io.dtb", ++ true, ++ }, ++ [0x19] = { ++ "500", ++ DTB_DIR "bcm2712-rpi-500.dtb", ++ true, ++ }, ++ [0x1A] = { ++ "Compute Module 5 Lite", ++ DTB_DIR "bcm2712-rpi-cm5l-cm5io.dtb", ++ true, ++ }, + }; + + static const struct rpi_model rpi_models_old_scheme[] = { +-- +2.47.1 + diff --git a/u-boot-2024.01.tar.bz2 b/u-boot-2024.01.tar.bz2 deleted file mode 100644 index b5a2158b836f9896921ab0c13a8317132925253a..0000000000000000000000000000000000000000 Binary files a/u-boot-2024.01.tar.bz2 and /dev/null differ diff --git a/u-boot-2025.01.tar.bz2 b/u-boot-2025.01.tar.bz2 new file mode 100644 index 0000000000000000000000000000000000000000..d4eff3cb84c67296ddd26d59cb46a333fd047cdc --- /dev/null +++ b/u-boot-2025.01.tar.bz2 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cdef7d507c93f1bbd9f015ea9bc21fa074268481405501945abc6f854d5b686f +size 32890299 diff --git a/uboot-tools.spec b/uboot-tools.spec index 9a95a0d050b96c20e328e3a27c77e5e52eb76435..ee795ca620fd6e1fee15180f23e572bcd73036e3 100644 --- a/uboot-tools.spec +++ b/uboot-tools.spec @@ -1,9 +1,8 @@ -%global _default_patch_fuzz 2 %global with_armv8 1 Name: uboot-tools -Version: 2024.01 -Release: 2 +Version: 2025.01 +Release: 1 Summary: tools for U-Boot License: GPL-2.0-or-later and Public Domain and GPL-2.0-only URL: http://www.denx.de/wiki/U-Boot @@ -11,28 +10,46 @@ Source0: https://ftp.denx.de/pub/u-boot/u-boot-%{version}.tar.bz2 Source1: aarch64-boards Source2: 10-devicetree.install -Patch1: backport-uefi-distro-load-FDT-from-any-partition-on-boot-device.patch -Patch2: backport-disable-VBE-by-default.patch -Patch3: backport-Provide-a-fallback-to-smbios-tables.patch -Patch4: backport-enable-bootmenu-by-default.patch -Patch5: backport-uefi-Boot-var-automatic-management-for-removable-medias.patch -Patch6: backport-rockchip-Add-initial-support-for-the-PinePhone-Pro.patch -Patch7: backport-scripts-dtc-pylibfdt-libfdt-i-shipped-Use-SWIG-AppendOutput.patch - -BuildRequires: bc dtc gcc make flex bison git-core openssl-devel -BuildRequires: python3-unversioned-command python3-devel python3-setuptools -BuildRequires: python3-libfdt python3-pyelftools SDL2-devel swig -BuildRequires: perl gnutls-devel ncurses-devel libuuid-devel -# this required when /usr/bin/python link to python3 +Patch1: uefi-distro-load-FDT-from-any-partition-on-boot-device.patch +Patch2: uefi-Add-all-options-for-EFI-System-Partitions.patch +Patch3: uefi-initial-find_fdt_location-for-finding-the-DT-on-disk.patch +Patch4: disable-VBE-by-default.patch +Patch5: enable-bootmenu-by-default.patch + +Patch10: rpi-Add-identifiers-for-the-new-RPi-5-series.patch +Patch11: rockchip-Enable-preboot-start-for-pci-usb.patch + +BuildRequires: bc +BuildRequires: bison +BuildRequires: dtc +BuildRequires: flex +BuildRequires: gcc +BuildRequires: gnutls-devel +BuildRequires: libuuid-devel +BuildRequires: make +BuildRequires: ncurses-devel +BuildRequires: openssl-devel +BuildRequires: perl-interpreter BuildRequires: python3-devel +BuildRequires: python3-setuptools +BuildRequires: python3-libfdt +BuildRequires: SDL2-devel +BuildRequires: swig %if %{with_armv8} %ifarch aarch64 BuildRequires: arm-trusted-firmware-armv8 BuildRequires: python3-pyelftools +BuildRequires: /usr/bin/xxd %endif %endif -Requires: dtc systemd +Requires: dtc +Requires: systemd + +%ifarch aarch64 +Obsoletes: uboot-images-elf < 2025.01 +Provides: uboot-images-elf < 2025.01 +%endif %description This package includes the mkimage program, which allows generation of U-Boot @@ -49,27 +66,6 @@ BuildArch: noarch %description -n uboot-images-armv8 u-boot bootloader images for aarch64 boards %endif - -%ifarch %{arm} -%package -n uboot-images-armv7 -Summary: u-boot bootloader images for armv7 boards -Requires: uboot-tools -BuildArch: noarch - -%description -n uboot-images-armv7 -u-boot bootloader images for armv7 boards -%endif - -%ifarch %{arm} aarch64 -%package -n uboot-images-elf -Summary: u-boot bootloader images for armv7 boards -Requires: uboot-tools -Obsoletes: uboot-images-qemu < %{version}-%{release} -Provides: uboot-images-qemu = %{version}-%{release} - -%description -n uboot-images-elf -u-boot bootloader ELF images for use with qemu and other platforms -%endif %endif %package_help @@ -86,7 +82,7 @@ mkdir builds %make_build HOSTCC="gcc $RPM_OPT_FLAGS" CROSS_COMPILE="" tools-all O=builds/ %if %{with_armv8} -%ifarch aarch64 %{arm} +%ifarch aarch64 for board in $(cat %{_arch}-boards) do echo "Building board: $board" @@ -133,50 +129,20 @@ mkdir -p %{buildroot}%{_datadir}/uboot/ %ifarch aarch64 for board in $(cat %{_arch}-boards) do -mkdir -p %{buildroot}%{_datadir}/uboot/$(echo $board)/ - for file in spl/*spl.bin u-boot.bin u-boot.dtb u-boot-dtb.img u-boot.img u-boot.itb spl/sunxi-spl.bin - do - if [ -f builds/$(echo $board)/$(echo $file) ]; then - install -p -m 0644 builds/$(echo $board)/$(echo $file) %{buildroot}%{_datadir}/uboot/$(echo $board)/ - fi - done -done -%endif - -%ifarch %{arm} -for board in $(cat %{_arch}-boards) -do -mkdir -p %{buildroot}%{_datadir}/uboot/$(echo $board)/ - for file in MLO SPL spl/arndale-spl.bin spl/origen-spl.bin spl/smdkv310-spl.bin spl/*spl.bin u-boot.bin u-boot.dtb u-boot-dtb-tegra.bin u-boot.img u-boot.imx u-boot-nodtb-tegra.bin u-boot-spl.kwb u-boot-sunxi-with-spl.bin - do - if [ -f builds/$(echo $board)/$(echo $file) ]; then - install -p -m 0644 builds/$(echo $board)/$(echo $file) %{buildroot}%{_datadir}/uboot/$(echo $board)/ - fi - done - -done - -for board in $(cat %{_arch}-boards) -do - if [ -f %{buildroot}%{_datadir}/uboot/$(echo $board)/u-boot-sunxi-with-spl.bin ]; then - rm -f %{buildroot}%{_datadir}/uboot/$(echo $board)/u-boot.* - fi - if [ -f %{buildroot}%{_datadir}/uboot/$(echo $board)/MLO ]; then - rm -f %{buildroot}%{_datadir}/uboot/$(echo $board)/u-boot.bin - fi - if [ -f %{buildroot}%{_datadir}/uboot/$(echo $board)/SPL ]; then - rm -f %{buildroot}%{_datadir}/uboot/$(echo $board)/u-boot.bin - fi - if [ -f %{buildroot}%{_datadir}/uboot/$(echo $board)/u-boot.imx ]; then - rm -f %{buildroot}%{_datadir}/uboot/$(echo $board)/u-boot.bin - fi + mkdir -p %{buildroot}%{_datadir}/uboot/$(echo $board)/ + for file in spl/*spl.bin u-boot.bin u-boot.dtb u-boot-dtb.img u-boot.img u-boot.itb spl/sunxi-spl.bin + do + if [ -f builds/$(echo $board)/$(echo $file) ]; then + install -p -m 0644 builds/$(echo $board)/$(echo $file) %{buildroot}%{_datadir}/uboot/$(echo $board)/ + fi + done done %endif %endif for tool in dumpimage env/fw_printenv fit_check_sign fit_info gdb/gdbcont gdb/gdbsend gen_eth_addr gen_ethaddr_crc ifwitool img2srec kwboot mkeficapsule mkenvimage mkimage mksunxiboot ncb proftool sunxi-spl-image-builder do -install -p -m 0755 builds/tools/$tool %{buildroot}%{_bindir} + install -p -m 0755 builds/tools/$tool %{buildroot}%{_bindir} done install -p -m 0644 doc/mkimage.1 %{buildroot}%{_mandir}/man1 @@ -203,17 +169,6 @@ install -p -m 0755 %{SOURCE2} %{buildroot}/lib/kernel/install.d/ %defattr(-,root,root) %{_datadir}/uboot/* %endif - -%ifarch %{arm} -%files -n uboot-images-armv7 -%defattr(-,root,root) -%{_datadir}/uboot/* -%endif - -%ifarch %{arm} aarch64 -%files -n uboot-images-elf -%defattr(-,root,root) -%endif %endif %files help @@ -222,6 +177,9 @@ install -p -m 0755 %{SOURCE2} %{buildroot}/lib/kernel/install.d/ %{_mandir}/man1/mkimage.1* %changelog +* Thu Feb 13 2025 lingsheng - 2025.01-1 +- update to 2025.01 + * Wed Jan 22 2025 lingsheng - 2024.01-2 - fix build with swig 4.3.0 diff --git a/uefi-Add-all-options-for-EFI-System-Partitions.patch b/uefi-Add-all-options-for-EFI-System-Partitions.patch new file mode 100644 index 0000000000000000000000000000000000000000..3bf1ec8c3fd3bda1777eccdb0bfe35c77103fcc9 --- /dev/null +++ b/uefi-Add-all-options-for-EFI-System-Partitions.patch @@ -0,0 +1,57 @@ +From 86782e882e9542f5f402e00cd87efb36ad0552d3 Mon Sep 17 00:00:00 2001 +From: Peter Robinson +Date: Sat, 2 Mar 2024 11:17:42 +0000 +Subject: [PATCH v4] disk: dos: Add all options for EFI System Partitions + +The EFI spec states that the ESP can be any of FAT12/16/32 but for +compatibility doesn't necssarily require the partition to be the +EFI partition table ID of 0xef. A number of arm devices will not +find their firmware on a FAT partition with an ID of 0xef so also +allow the original FAT12/16/32 partition IDs as they are also +permissable for an ESP. + +Signed-off-by: Peter Robinson +--- + +v2: +- Add 0x0c option +- Make hex constants consistent +- Move from if to switch statement +v3: +- Fix switch brain fart +v4: +- Drop boot_ind out of switch + + disk/part_dos.c | 13 ++++++++++++- + 1 file changed, 12 insertions(+), 1 deletion(-) + +diff --git a/disk/part_dos.c b/disk/part_dos.c +index 567ead7511d..a35181dff4f 100644 +--- a/disk/part_dos.c ++++ b/disk/part_dos.c +@@ -40,10 +40,21 @@ static int get_bootable(dos_partition_t *p) + { + int ret = 0; + +- if (p->sys_ind == 0xef) ++ switch (p->sys_ind) { ++ case 0x01: ++ case 0x06: ++ case 0x0b: ++ case 0x0c: ++ case 0xef: + ret |= PART_EFI_SYSTEM_PARTITION; ++ break; ++ default: ++ break; ++ } ++ + if (p->boot_ind == 0x80) + ret |= PART_BOOTABLE; ++ + return ret; + } + +-- +2.44.0 + diff --git a/backport-uefi-distro-load-FDT-from-any-partition-on-boot-device.patch b/uefi-distro-load-FDT-from-any-partition-on-boot-device.patch similarity index 99% rename from backport-uefi-distro-load-FDT-from-any-partition-on-boot-device.patch rename to uefi-distro-load-FDT-from-any-partition-on-boot-device.patch index c84c6096770e1b0f5f2a392a14fc0ede8a80fcfd..59548486d9c9f7bff7a3492969532db465c09c50 100644 --- a/backport-uefi-distro-load-FDT-from-any-partition-on-boot-device.patch +++ b/uefi-distro-load-FDT-from-any-partition-on-boot-device.patch @@ -2,29 +2,29 @@ From 4306c538d4a00dd1aa46c55c3c4005c2b0bf7cd5 Mon Sep 17 00:00:00 2001 From: Peter Robinson Date: Thu, 24 Nov 2022 12:57:55 +0000 Subject: [PATCH] distro: load FDT from any partition on boot device - + In the EFI_LOADER boot path, we were only checking the FAT partition containing the EFI payload for dtb files. But this is somewhat of a fiction. In reality there will be one small (V)FAT partition containing grub (or whatever the payload may be), and a second boot partition containing kernel/initrd/fdt (typically ext4). It is this second partition where we should be looking for a FDT to load. - + So instead scan all the partitions of the disk containing the EFI payload. This matches where grub looks for kernel/initrd (barring custom grub.cfg, in which case the user can use grub's 'devicetree' command to load the correct FDT). - + The other option is somehow passing the ${fdtfile} to grub so that it can load the FDT based on selected kernel version location (which grub knows) and SoC/board specific ${fdtfile} (which grub does not know). - + Signed-off-by: Rob Clark Signed-off-by: Peter Robinson --- include/config_distro_bootcmd.h | 37 +++++++++++++++++++++------------ 1 file changed, 24 insertions(+), 13 deletions(-) - + diff --git a/include/config_distro_bootcmd.h b/include/config_distro_bootcmd.h index fcb319a20ae..e71004fad9c 100644 --- a/include/config_distro_bootcmd.h @@ -84,4 +84,4 @@ index fcb319a20ae..e71004fad9c 100644 "setenv efi_fdtfile\0" -- 2.38.1 - + diff --git a/uefi-initial-find_fdt_location-for-finding-the-DT-on-disk.patch b/uefi-initial-find_fdt_location-for-finding-the-DT-on-disk.patch new file mode 100644 index 0000000000000000000000000000000000000000..c45924d73eebd06ee31ab57dc89480815f9615e5 --- /dev/null +++ b/uefi-initial-find_fdt_location-for-finding-the-DT-on-disk.patch @@ -0,0 +1,202 @@ +From 121fd475757e183428ca78f43420c42b9973aa33 Mon Sep 17 00:00:00 2001 +From: Peter Robinson +Date: Tue, 31 Dec 2024 14:11:12 +0000 +Subject: [PATCH] initial find_fdt_location for finding the DT on disk + +The old distro boot looked for a DT on the first boot partition +in the /dtb or /dtb/current directories, and Fedora extended this +to look not just on the boot partition but all the partitions on +that disk. + +The new ways of booting, both bootstd and bootefi bootmgr processes +don't properly look for those options. This provides a function +to search for the DTB on disk so that if the other DT mechanisms +don't work this will look for one on disk to provide a working DT +so that devices will continue to work as they did previously. + +Signed-off-by: Peter Robinson +--- + cmd/bootefi.c | 1 + + cmd/bootmenu.c | 5 ++ + include/efi_loader.h | 2 + + lib/efi_loader/efi_helper.c | 105 +++++++++++++++++++++++++++++++++++- + 4 files changed, 112 insertions(+), 1 deletion(-) + +diff --git a/cmd/bootefi.c b/cmd/bootefi.c +index c1454ffb948..ec869047f05 100644 +--- a/cmd/bootefi.c ++++ b/cmd/bootefi.c +@@ -143,6 +143,7 @@ static int do_bootefi(struct cmd_tbl *cmdtp, int flag, int argc, + if (argc > 2) { + uintptr_t fdt_addr; + ++ /* Do we need to run find_fdt_location here?*/ + fdt_addr = hextoul(argv[2], NULL); + fdt = map_sysmem(fdt_addr, 0); + } else { +diff --git a/cmd/bootmenu.c b/cmd/bootmenu.c +index b633aedf011..96a71a96820 100644 +--- a/cmd/bootmenu.c ++++ b/cmd/bootmenu.c +@@ -461,6 +461,11 @@ static void handle_uefi_bootnext(void) + u16 bootnext; + efi_status_t ret; + efi_uintn_t size; ++ const char *fdt_opt; ++ ++ /* Find the DTB on disk */ ++ log_debug("We will load the DTB\n"); ++ fdt_opt = find_fdt_location(); + + /* Initialize EFI drivers */ + ret = efi_init_obj_list(); +diff --git a/include/efi_loader.h b/include/efi_loader.h +index 39809eac1bc..511eba655e7 100644 +--- a/include/efi_loader.h ++++ b/include/efi_loader.h +@@ -514,6 +514,8 @@ struct efi_register_notify_event { + struct list_head handles; + }; + ++/* Find the FDT on any partition */ ++char *find_fdt_location(void); + /* called at pre-initialization */ + int efi_init_early(void); + /* Initialize efi execution environment */ +diff --git a/lib/efi_loader/efi_helper.c b/lib/efi_loader/efi_helper.c +index bf96f61d3d0..3f496cc0dfb 100644 +--- a/lib/efi_loader/efi_helper.c ++++ b/lib/efi_loader/efi_helper.c +@@ -12,6 +12,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -95,6 +96,99 @@ int efi_get_pxe_arch(void) + return -EINVAL; + } + ++/* We need to pass a blk device in and return a location, or a loaded DT */ ++char *find_fdt_location(void) ++{ ++ const char *fdt_filename; ++ /* FIXME: dynamic size */ ++ char fdt_fullpath[60]; ++ const char *prefix; ++ struct udevice *blk; ++ /* FIXME: Fedora really only cares about first 2*/ ++ int MAX_PART = 8; ++ int part; ++ struct disk_partition info; ++ int fdtext; ++ int ret; ++ int retfdt; ++ int retload; ++ loff_t fdtsize; ++ ulong pbraddr; ++ loff_t len_read; ++ ++ /* step one logic: we have the DT name we're hunting for */ ++ fdt_filename = env_get("fdtfile"); ++ if (fdt_filename) { ++ log_debug("FFL: We're looking for the DTB now!: %s\n", fdt_filename); ++ ++ /* probe all block disks to search for fdt */ ++ uclass_foreach_dev_probe(UCLASS_BLK, blk) { ++ log_debug("FFL: dev name: %s\n", blk->name); ++ struct blk_desc *desc; ++ desc = dev_get_uclass_plat(blk); ++ /* we should get a partition count here for looping */ ++ /* For loop for each partition */ ++ /* Need to also deal with zero part whole disk - part_get_info_whole_disk */ ++ for (part = 1; part <= MAX_PART; part++) { ++ log_debug("FFL: part num: %d\n", part); ++ ret = part_get_info(desc, part, &info); ++ /* if we have partition check it for DT */ ++ if (ret < 0) { ++ log_debug("FFL: no partition\n"); ++ } else { ++ log_debug("FFL: we have a partition\n"); ++ /* we should have a case/for prefix in =/ /dtb/ /dtb/current/ */ ++ /* but for now we hard code if for Fedora */ ++ prefix = "/dtb"; ++ snprintf(fdt_fullpath, sizeof(fdt_fullpath), "%s/%s", prefix, fdt_filename); ++ log_debug("FFL: full name: %s\n", fdt_fullpath); ++ /* search for DT on partition and either find and exit or continue */ ++ if (fs_set_blk_dev_with_part(desc, part) == 0){ ++ log_debug("FFL: set block part pass\n"); ++ fdtext = fs_exists(fdt_fullpath); ++ if (fdtext) { ++ /* we have a fdt!*/ ++ if (fs_set_blk_dev_with_part(desc, part) == 0){ ++ retfdt = fs_size(fdt_fullpath, &fdtsize); ++ if (retfdt == 0) { ++ log_debug("FFL: we have found a DT on disk, size %lld\n", fdtsize); ++ /* Get the main fdt and map it */ ++ const char *fdt_pbr; ++ fdt_pbr = env_get("fdt_addr_r"); ++ pbraddr = hextoul(fdt_pbr, NULL); ++ log_debug("FFL: fdr addr: %s\n", fdt_pbr); ++ if (fs_set_blk_dev_with_part(desc, part) == 0){ ++ retload = fs_read(fdt_fullpath, pbraddr, 0, fdtsize, &len_read); ++ if (retload == 0) { ++ log_debug("FFL: we have a loaded DT, size %lld we can return\n", fdtsize); ++ log_info("Found DTB: %s\n", fdt_filename); ++ return fdt_pbr; ++ } else { ++ log_debug("FFL: DT load failed\n"); ++ } ++ } ++ } else { ++ log_debug("FFL: we DON'T have a DT with size\n"); ++ } ++ } ++ } else { ++ /* we don't have a fdt!*/ ++ log_debug("FFL: we DON'T have a DT\n"); ++ } ++ } else { ++ log_debug("FFL: set block part FAIL\n"); ++ } ++ } ++ } ++ } ++ } else { ++ log_debug("FFL: fdt_filename not defined!!\n"); ++ } ++ ++ /* We didn't find a FDT */ ++ return NULL; ++} ++ + /** + * efi_create_current_boot_var() - Return Boot#### name were #### is replaced by + * the value of BootCurrent +@@ -548,11 +642,20 @@ efi_status_t efi_install_fdt(void *fdt) + /* Look for device tree that is already installed */ + if (efi_get_configuration_table(&efi_guid_fdt)) + return EFI_SUCCESS; ++ /* Check if there is device tree loaded from disk */ ++ fdt_opt = find_fdt_location(); ++ if (fdt_opt) ++ log_debug("Found DTB on disk\n"); + /* Check if there is a hardware device tree */ +- fdt_opt = env_get("fdt_addr"); ++ if (!fdt_opt) { ++ fdt_opt = env_get("fdt_addr"); ++ if (fdt_opt) ++ log_info("Found DTB: Prior firmware\n"); ++ } + /* Use our own device tree as fallback */ + if (!fdt_opt) { + fdt_opt = env_get("fdtcontroladdr"); ++ log_debug("Using DT from U-Boot\n"); + if (!fdt_opt) { + log_err("need device tree\n"); + return EFI_NOT_FOUND; +-- +2.47.1 +