From patchwork Sat Aug 26 09:06:32 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sughosh Ganu X-Patchwork-Id: 717229 Delivered-To: patch@linaro.org Received: by 2002:a5d:688a:0:b0:317:ecd7:513f with SMTP id h10csp294704wru; Sat, 26 Aug 2023 02:07:41 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFrO2QNKshH5cE5HWjjiUsgR9qv6ENIrW4cKv1dPjR4aXmg5fwEVM7dRXKNp95o/7auCTjo X-Received: by 2002:a05:600c:2157:b0:3fe:89be:cd3 with SMTP id v23-20020a05600c215700b003fe89be0cd3mr16966419wml.22.1693040860867; Sat, 26 Aug 2023 02:07:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1693040860; cv=none; d=google.com; s=arc-20160816; b=JixbfoApqso6sCGZiSdcCGdgyd2n47wpfJHH5hq2tyobjY21M6RMSkigSwUM01da/3 V3TeHIt/5BCHdUPVrLuUGy+jVdeNXMgxPkd6cVQAaks+EEAXcZZIyN7ux9io4Yn6rWM6 f+bg7kz2VoqQjlxNMzoY1Ly8HGY1SJBfVIIfzWcxdJOVIsS0fo5l2MDAOICztg2CJqmM 0gbDF2hk5wuy2MLoQQIOvKZ5QQs4NPdjbzwd6KynlH+FRnAkNkGppFUPpCTQj+rmsxEZ lkOO2ucJxK9Vr1gAYVsyUdupKXcCM8XbfYpklS/sIqXK9jiGcgBtUkLbULRcHskM5dOk wpQg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from; bh=u8KaKSX/NOuY4RW1ekqngd1sYU4roSfu4rMg8FOyQWk=; fh=wxXZJCQRz/XgBTfKhuJFfNV+eZ/MzU8zncY23uTJ9bU=; b=y7b94wp3eX1BTThmmlnvHN/QhcNdYWIkqfOWiOmCVeTgmHTyUBuW7tTL176ze+kcj1 3MXSStNRGTcnFIsvHjlAXCuWhrOtZi+3X5njRWAshB33tlcNW2YtUl4mPUuiWJfI1QA1 HKldtEFUga8gJCMOLXyTqL5FiKhJ620VMSB4I5Vd/PijeRqZ4BZEug9K3yr89l7AqyiS UGgq1Q7IE5t4kzy5snA2CVTmUH/goMGreIiElFqBUvJ5+mwFBKEYuxiwXRW0DwfC8KVG X9VgGpukPeHGDzqW/FqwmOD0ibd1a+97SPjl+VRCR9MmM/XR6aAiEKP/ZYoxjjjpZmV2 tKHA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [85.214.62.61]) by mx.google.com with ESMTPS id v12-20020a05600c15cc00b003fee7a8aac8si308254wmf.156.2023.08.26.02.07.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 26 Aug 2023 02:07:40 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) client-ip=85.214.62.61; Authentication-Results: mx.google.com; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id C096286B4B; Sat, 26 Aug 2023 11:07:13 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by phobos.denx.de (Postfix, from userid 109) id D91A786B4B; Sat, 26 Aug 2023 11:07:12 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.2 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_SOFTFAIL autolearn=no autolearn_force=no version=3.4.2 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by phobos.denx.de (Postfix) with ESMTP id 431BB86B12 for ; Sat, 26 Aug 2023 11:07:10 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=fail smtp.mailfrom=sughosh.ganu@linaro.org Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id EBC841FB; Sat, 26 Aug 2023 02:07:49 -0700 (PDT) Received: from a076522.blr.arm.com (a076522.blr.arm.com [10.162.46.7]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id ABB1B3F844; Sat, 26 Aug 2023 02:07:07 -0700 (PDT) From: Sughosh Ganu To: u-boot@lists.denx.de Cc: Tom Rini , Heinrich Schuchardt , Ilias Apalodimas , Simon Glass , Sughosh Ganu Subject: [RFC PATCH 4/5] bootefi: Call the EVT_FT_FIXUP event handler Date: Sat, 26 Aug 2023 14:36:32 +0530 Message-Id: <20230826090633.239342-5-sughosh.ganu@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230826090633.239342-1-sughosh.ganu@linaro.org> References: <20230826090633.239342-1-sughosh.ganu@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 The bootefi command passes the devicetree to the kernel through the EFI config table. Call the event handlers for fixing the devicetree before jumping into the kernel. This removes any devicetree nodes and/or properties that are specific only to U-Boot, and are not to be passed to the OS. Signed-off-by: Sughosh Ganu --- cmd/bootefi.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/cmd/bootefi.c b/cmd/bootefi.c index f73d6eb0e2..c359a46ec4 100644 --- a/cmd/bootefi.c +++ b/cmd/bootefi.c @@ -237,6 +237,23 @@ static void *get_config_table(const efi_guid_t *guid) return NULL; } +/** + * event_notify_dt_fixup() - call ft_fixup event + * + * @fdt: address of the device tree to be passed to the kernel + * through the configuration table + * Return: None + */ +static void event_notify_dt_fixup(void *fdt) +{ + int ret; + struct event_ft_fixup fixup = {0}; + + fixup.tree.fdt = fdt; + ret = event_notify(EVT_FT_FIXUP, &fixup, sizeof(fixup)); + if (ret) + printf("Error: %d: FDT Fixup event failed\n", ret); +} #endif /* !CONFIG_IS_ENABLED(GENERATE_ACPI_TABLE) */ /** @@ -318,6 +335,7 @@ efi_status_t efi_install_fdt(void *fdt) efi_carve_out_dt_rsv(fdt); efi_try_purge_kaslr_seed(fdt); + event_notify_dt_fixup(fdt); if (CONFIG_IS_ENABLED(EFI_TCG2_PROTOCOL_MEASURE_DTB)) { ret = efi_tcg2_measure_dtb(fdt);