From patchwork Wed Jul 31 04:58:41 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Samuel Holland X-Patchwork-Id: 1966827 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; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=TfQcn3iw; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=sifive.com header.i=@sifive.com header.a=rsa-sha256 header.s=google header.b=ZuN05wWn; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=opensbi-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=patchwork.ozlabs.org) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (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 4WYfzC3Xrtz1ybV for ; Wed, 31 Jul 2024 14:59:50 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:To :From:Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=e6lo3nEFQlIv4MZdlDIIHol1l3na6sjF6IDGS5wtBx0=; b=TfQcn3iwhj6H94 HEZSej6B2+Pqrd0RsXcrg13vHe84NRptHFNZ6aUkFKTgkCw/GDqsYP8J5zyxmoxzPdupJEkExF5pY VRpgMmSZ7DFPOZRXFR6LE2l1VEThyiQhCRKOWIZ/2r442ZNqkfCZuJm4Nox/czXeSTQqwbxaYqKi0 6tQSrFmEWRid6AvnkcT26C0t7kewpAt8fKloTYFAy/MPZUfGs+L6PNEXXdwRA3tiskvS1/Efccvsc RAOmAmEvs8zx+kxUUfJqcSKProgwAOLMIGs4mV0j5EClDlBY+QmfaH3lEU6W3cB25nx6/RL5G1Lu2 TVwHoXKFEqIQAyWn0HPg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sZ1R4-0000000HKLt-3zFI; Wed, 31 Jul 2024 04:59:38 +0000 Received: from mail-pl1-x62a.google.com ([2607:f8b0:4864:20::62a]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sZ1R1-0000000HKKk-3y2n for opensbi@lists.infradead.org; Wed, 31 Jul 2024 04:59:37 +0000 Received: by mail-pl1-x62a.google.com with SMTP id d9443c01a7336-1fc6a017abdso33431385ad.0 for ; Tue, 30 Jul 2024 21:59:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sifive.com; s=google; t=1722401974; x=1723006774; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=+vAaszax5bMeTuakgbyxz4xMkDzQ07DoUBxcGIhp0tQ=; b=ZuN05wWn4vQZiz9huGqiol5CHNLdbxgtTzD0mAZ+PAJWpnOS3VRzgsCjbiSDfpNvlk SLgq4Mx9Cma6rfKl7NoEZwHMgHbkh4X7Kni8aKs2IAAvu6+ybnCJ826vjuHTBA7NInWM U3DhQILSxqDYXrsEv4MbB3w0bbRbTkSw4vlI20jJgJIT55y36Zl1IsF3NZZ/ZaoVpyIv cH+JqwqtFqyOrI8NKrK2d0Fo8blevwvRPVEb2g+7rmvAwcrhMCbo17MCSM2jvJkoG5eC 6k1+F7B3NaY0KPskEe7BaB5B84ponZ9J5eI2n69Rdc/7sA6Owrpepl8l03fb7foh6k6K SeDg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722401974; x=1723006774; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=+vAaszax5bMeTuakgbyxz4xMkDzQ07DoUBxcGIhp0tQ=; b=Vjjy3Lpti+f6kDj/SR0tDRtRBbwJi74F9hVR1nsoMKJbyFz4M9E4z6aMZkB0FwwQMP DxDj8BxQxQPl0QxyAHD3Za3FjdeB3MctX9sKL/iKkVLe5SWIpBDenxyEkCV7YjzBst7e hyN1QhQ3dMA9aLpFHCuWaQrFDAbn7c0XdaC+XFJLAWPyw6P0CgQMsNwLKyCrfPDPVvAf trvCtzX0w7gplwC+qj9vK+jXehm09oyLR+eOXAEU8qGJfmBdFxs9m+pUgFzCIts31jFC J8sgZM4+SqL2yLVSpXZnYGanWUWJiyaOrlag1txDI0TnrTkDse9mCuagP7Zal10XUw2e R2Mg== X-Gm-Message-State: AOJu0YzK6K9GRyDM3exa/nfh6YK3PDI7RV6ePFv4D1EZcQrbqehtVDrD y70CIEZWJp5Yrk1hU+gKpZisqvDXCp+vEgKmCO2QvxuygD+Hydg0r0V9frjVXxCnM5fOR/uTDkU N61SZ6HkClLFu9C+letxi4/B/K9PxWbmWub9+N+7+q74I22jZNDRey+iOrxbbI6vhtWc+krZxpM 9ZlQFwtO7IP8cf8mTzL4AjEz/s+AIXmTZcQw59jOrVjtE+EfjGfXE= X-Google-Smtp-Source: AGHT+IEfVx+Jz9Ous/+Cr947iqzfFiUADnTkoaR3d48jdA5IPvcp0jU1Fr0h1qe2AdxHj7zyOygHPQ== X-Received: by 2002:a17:902:db0d:b0:1fa:d1df:d41e with SMTP id d9443c01a7336-1ff048e1947mr110962975ad.58.1722401973599; Tue, 30 Jul 2024 21:59:33 -0700 (PDT) Received: from sw06.internal.sifive.com ([4.53.31.132]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-1fed7ccd777sm110569535ad.75.2024.07.30.21.59.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Jul 2024 21:59:33 -0700 (PDT) From: Samuel Holland To: opensbi@lists.infradead.org Subject: [PATCH 00/16] Improve FDT blob lifecycle self-documentation Date: Tue, 30 Jul 2024 21:58:41 -0700 Message-ID: <20240731045931.2446799-1-samuel.holland@sifive.com> X-Mailer: git-send-email 2.45.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240730_215936_184553_FE55A1E8 X-CRM114-Status: UNSURE ( 8.68 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.1 (--) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: This series improves the documentation of the FDT blob lifecycle within the OpenSBI code by more explicitly indicating which functions and platform callbacks may modify the FDT blob, and by avoiding a [...] Content analysis details: (-2.1 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:62a listed in] [list.dnswl.org] X-BeenThere: opensbi@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "opensbi" Errors-To: opensbi-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org This series improves the documentation of the FDT blob lifecycle within the OpenSBI code by more explicitly indicating which functions and platform callbacks may modify the FDT blob, and by avoiding ad-hoc calls to fdt_get_address() outside the top-level platform callbacks. Samuel Holland (16): lib: utils/fdt: Fix fdt_add_cpu_idle_states() prototype lib: utils/regmap: Fix typo in comment lib: utils/fdt: Constify FDT parsing functions lib: utils/gpio: Constify FDT pointers in parsing functions lib: utils/i2c: Constify FDT pointers in parsing functions lib: utils/ipi: Constify FDT pointers in parsing functions lib: utils/irqchip: Constify FDT pointers in parsing functions lib: utils/regmap: Constify FDT pointers in parsing functions lib: utils/reset: Constify FDT pointers in parsing functions lib: utils/serial: Constify FDT pointers in parsing functions lib: utils/timer: Constify FDT pointers in parsing functions platform: generic: Constify FDT pointers in fw_platform_init() platform: generic: Pass FDT to early/final_init overrides lib: utils/reset: Pass the FDT to fdt_reset_init() lib: utils/serial: Pass the FDT to fdt_serial_init() lib: utils/fdt: Add fdt_get_address_rw() helper include/sbi_utils/fdt/fdt_domain.h | 4 +- include/sbi_utils/fdt/fdt_fixup.h | 2 +- include/sbi_utils/fdt/fdt_helper.h | 61 ++++++++++--------- include/sbi_utils/fdt/fdt_pmu.h | 4 +- include/sbi_utils/gpio/fdt_gpio.h | 4 +- include/sbi_utils/i2c/fdt_i2c.h | 4 +- include/sbi_utils/ipi/fdt_ipi.h | 2 +- include/sbi_utils/irqchip/fdt_irqchip.h | 2 +- include/sbi_utils/regmap/fdt_regmap.h | 8 +-- include/sbi_utils/reset/fdt_reset.h | 10 ++-- include/sbi_utils/serial/fdt_serial.h | 6 +- include/sbi_utils/timer/fdt_timer.h | 2 +- lib/utils/fdt/fdt_domain.c | 31 +++++++--- lib/utils/fdt/fdt_helper.c | 62 ++++++++++---------- lib/utils/fdt/fdt_pmu.c | 2 +- lib/utils/gpio/fdt_gpio.c | 6 +- lib/utils/gpio/fdt_gpio_designware.c | 2 +- lib/utils/gpio/fdt_gpio_sifive.c | 2 +- lib/utils/gpio/fdt_gpio_starfive.c | 2 +- lib/utils/i2c/fdt_i2c.c | 6 +- lib/utils/i2c/fdt_i2c_dw.c | 4 +- lib/utils/i2c/fdt_i2c_sifive.c | 4 +- lib/utils/ipi/fdt_ipi.c | 2 +- lib/utils/ipi/fdt_ipi_mswi.c | 2 +- lib/utils/ipi/fdt_ipi_plicsw.c | 4 +- lib/utils/irqchip/fdt_irqchip.c | 2 +- lib/utils/irqchip/fdt_irqchip_aplic.c | 4 +- lib/utils/irqchip/fdt_irqchip_imsic.c | 6 +- lib/utils/irqchip/fdt_irqchip_plic.c | 4 +- lib/utils/regmap/fdt_regmap.c | 8 +-- lib/utils/regmap/fdt_regmap_syscon.c | 2 +- lib/utils/reset/fdt_reset.c | 5 +- lib/utils/reset/fdt_reset_atcwdt200.c | 2 +- lib/utils/reset/fdt_reset_gpio.c | 2 +- lib/utils/reset/fdt_reset_htif.c | 2 +- lib/utils/reset/fdt_reset_sg2042_hwmon_mcu.c | 2 +- lib/utils/reset/fdt_reset_sunxi_wdt.c | 2 +- lib/utils/reset/fdt_reset_syscon.c | 4 +- lib/utils/serial/fdt_serial.c | 3 +- lib/utils/serial/fdt_serial_cadence.c | 2 +- lib/utils/serial/fdt_serial_gaisler.c | 2 +- lib/utils/serial/fdt_serial_htif.c | 2 +- lib/utils/serial/fdt_serial_litex.c | 2 +- lib/utils/serial/fdt_serial_renesas_scif.c | 2 +- lib/utils/serial/fdt_serial_shakti.c | 4 +- lib/utils/serial/fdt_serial_sifive.c | 4 +- lib/utils/serial/fdt_serial_uart8250.c | 2 +- lib/utils/serial/fdt_serial_xlnx_uartlite.c | 4 +- lib/utils/timer/fdt_timer.c | 2 +- lib/utils/timer/fdt_timer_mtimer.c | 2 +- lib/utils/timer/fdt_timer_plmt.c | 2 +- platform/fpga/ariane/platform.c | 2 +- platform/fpga/openpiton/platform.c | 4 +- platform/generic/allwinner/sun20i-d1.c | 3 +- platform/generic/andes/ae350.c | 10 ++-- platform/generic/andes/andes_pma.c | 6 +- platform/generic/include/andes/andes_pma.h | 3 +- platform/generic/include/platform_override.h | 6 +- platform/generic/platform.c | 21 ++++--- platform/generic/renesas/rzfive/rzfive.c | 8 ++- platform/generic/sifive/fu740.c | 5 +- platform/generic/sophgo/sg2042.c | 2 +- platform/generic/starfive/jh7110.c | 12 ++-- platform/generic/thead/thead-generic.c | 2 +- platform/kendryte/k210/platform.c | 2 +- platform/nuclei/ux600/platform.c | 2 +- 66 files changed, 210 insertions(+), 194 deletions(-) Reviewed-by: Andrew Jones Reviewed-by: Anup Patel