From patchwork Sat Aug 26 09:06:28 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sughosh Ganu X-Patchwork-Id: 717225 Delivered-To: patch@linaro.org Received: by 2002:a5d:688a:0:b0:317:ecd7:513f with SMTP id h10csp294539wru; Sat, 26 Aug 2023 02:07:05 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHVEeWWnTiU7psK8g+C90V7lfHp2fKgqouGZx/RVL/JcmVAtKDBmrs6PrUhBOkT8i9K/JBj X-Received: by 2002:a5d:44c8:0:b0:317:e9d7:9387 with SMTP id z8-20020a5d44c8000000b00317e9d79387mr18112517wrr.25.1693040824968; Sat, 26 Aug 2023 02:07:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1693040824; cv=none; d=google.com; s=arc-20160816; b=L5x+L8Bef86vHvomPsqRCxzV/Gho9T16tfDOHV9x5/Ji3sCMBF7ux4F06RDXxkvDOd AMTZWkkzBLOqae2dmXUuGyM1bLsTSJAC2GP0wKDuz2f68pEK4L5GmLDO9Ylsfzx+4445 ECfneH5dnv62wZpgiQ3HJYfuox7zlPTj7lX0fGgS2Kx0Wi02Cntg6xyuTALYn4cOT9kF tyk7wLNFthQ+MFcFXJD6m+MqARdFOxeIhivWCMM4RlKcqYN5+4vBO6PyT7cOr/tPbcV+ ltubWSN8OaROekoYCPi2aSvleXuaJlfJJy+Ukw47e4ZsaYZHx2LNUPdFwK9Z4CEh2dCC zC8g== 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:message-id:date:subject:cc:to:from; bh=CVc7Xk9zME80mgszV6FfaCUYdSjAfdcJiajOo89LwyY=; fh=tDpHEVx4BDihs4P1vorAm6H8gshCC7IYyRuvww9bMZE=; b=PTcRwqS0EOSpKd24yiwbLCP5dfqK5iVPzXriehQE3ut0qj/X+gRwOuK0JiGstQeU2x QG59eyBotYY1p6vYLjmZzHtPWQCYPX94lMCd16u/mdRCfR1w+pUdFvWTMC75MSwHOkBC OfyIwH+VU+XJY8ojIHv54Qos4AXWIwyILxmpEAMwuIdAURGXncUWhef7IqZAS1vhclZk gPmVQrfd2JwpqLvUKg4vFdbctuwyMAlAtQTHHTnTHmAji9F32bKkwOh+3RwKMidIU3pY k/66ZjVsw3YwqQfLzgHG5pIvZ5sKO8PUhWKuI6/ycY7tz0S6TsAbVfzuPAxG5oNBHwpj Ijiw== 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 l12-20020adff48c000000b0031807c11738si30751wro.238.2023.08.26.02.07.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 26 Aug 2023 02:07:04 -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 A71A186B2C; Sat, 26 Aug 2023 11:07:03 +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 4D4E186B2C; Sat, 26 Aug 2023 11:07:03 +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 96B2086AFE for ; Sat, 26 Aug 2023 11:07:00 +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 1DDBB1FB; Sat, 26 Aug 2023 02:07:40 -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 179653F740; Sat, 26 Aug 2023 02:06:57 -0700 (PDT) From: Sughosh Ganu To: u-boot@lists.denx.de Cc: Tom Rini , Heinrich Schuchardt , Ilias Apalodimas , Simon Glass Subject: [RFC PATCH 0/5] Allow for removal of DT nodes and properties Date: Sat, 26 Aug 2023 14:36:28 +0530 Message-Id: <20230826090633.239342-1-sughosh.ganu@linaro.org> X-Mailer: git-send-email 2.34.1 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 Provide a way for removing certain devicetree nodes and/or properties from the devicetree. This is needed to purge certain nodes and properties which may be relevant only in U-Boot. Such nodes and properties are then removed from the devicetree before it is passed to the kernel. This ensures that the devicetree passed to the OS does not contain any non-compliant nodes and properties. The removal of the nodes and properties is being done through an EVT_FT_FIXUP handler. I am not sure if the removal code needs to be behind any Kconfig symbol. I have only build tested this on sandbox, and tested on qemu arm64 virt platform. This being a RFC, I have not put this through a CI run. Sughosh Ganu (5): dt: Provide a way to remove non-compliant nodes and properties fwu: Add the fwu-mdata node for removal from devicetree capsule: Add the capsule-key property for removal from devicetree bootefi: Call the EVT_FT_FIXUP event handler doc: Add a document for non-compliant DT node/property removal cmd/bootefi.c | 18 +++++ .../devicetree/dt_non_compliant_purge.rst | 64 ++++++++++++++++ drivers/fwu-mdata/fwu-mdata-uclass.c | 5 ++ include/dt-structs.h | 11 +++ lib/Makefile | 1 + lib/dt_purge.c | 73 +++++++++++++++++++ lib/efi_loader/efi_capsule.c | 7 ++ 7 files changed, 179 insertions(+) create mode 100644 doc/develop/devicetree/dt_non_compliant_purge.rst create mode 100644 lib/dt_purge.c