From patchwork Wed Jul 31 04:58:42 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Samuel Holland X-Patchwork-Id: 1966826 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=27QzmPq1; 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=cHbcJ+2+; 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 4WYfzC3bq3z20FK for ; Wed, 31 Jul 2024 14:59:49 +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:References:In-Reply-To: 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: List-Owner; bh=ioRBavbNRo7owvUT1UM/bucP5OKQgu6PA9TPKeSAlEE=; b=27QzmPq1vkRR2x VICUcSTeKxfBVuNyHTrX29JsYdq54zo7ppUR+QM6JyuEU5YjFdd93Pze+vqImmD3TDkNwn0ShDa5v i/29GLiFOWLwtjqRPokiivjjjTN8/v5hGuc4qFhAkMv+FswfhlTJkjr/h6UnH3flyiL4XsVc5XCdv 8EpwIVxG2lZ+etRwPfoXExeRYoCGb8oH9up7X0L22Gx0Yk0oxrP/oSq1GOiDZYZLYChx5Jgzu18xc r7joOJbc2LZqjwa58OfLzmsGNMZ4xt94T4sUFeJis0sL91vPhBsy3OE2uhtE/7ZqLlYWQQBeIfWzo 4uF79l+QViC9TOkpOVKw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sZ1R5-0000000HKMm-3g43; Wed, 31 Jul 2024 04:59:39 +0000 Received: from mail-pl1-x632.google.com ([2607:f8b0:4864:20::632]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sZ1R2-0000000HKKm-3uGv for opensbi@lists.infradead.org; Wed, 31 Jul 2024 04:59:38 +0000 Received: by mail-pl1-x632.google.com with SMTP id d9443c01a7336-1fec34f94abso38871985ad.2 for ; Tue, 30 Jul 2024 21:59:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sifive.com; s=google; t=1722401975; x=1723006775; darn=lists.infradead.org; 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=OxM9bcup4zp78g+GMfsQzyIjrl0y2gkuaLUjxTKGeR4=; b=cHbcJ+2+NispmBjDX+4KEemdeP8huOZerFxdYi9y3hRb/jux/sukYTZpm8k7TdG0HN biuUrV2xqyGNIiYtq+NNZkRVluMrdcRAPzljXtMy12DG2NjsiO909W4jAHJShtk8Nv4x esynX/+QLk4++BA4p08MtI6YjUL6fhC4pnH/fyUyVSN7PKLsGvBOHJExwmlwTZh/iADX 7qGw7pR/b5qtHFiXoJX6LGs9l/HEjJALJYZTgD1vy0j45o4VuKhRO2y0QUfxtb9x6GPW 5fQvfCuOAilEPTsk/jS226MLlAOWLEC0vs6ziAryfQVVQsc/R9pGIuedpmWxXFBKNMaC BdXw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722401975; x=1723006775; 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=OxM9bcup4zp78g+GMfsQzyIjrl0y2gkuaLUjxTKGeR4=; b=heYtgXThgwHaXopPiAiArHblY75mn/5sBc9+EXe7RQNXqbFbfm3SlbRXmIAoNbGliy 7rocD6431Xr7LDJyIqXsparLwRmQzkoPdFUn2HDDIp4OjN95k7VxlPL6JsAzKUaa7H4/ o3eujrk/RjepnoSD4jMgrrHQoQ7a2M8/sF91fFTwKHsyEViq+dQhsbkOTgtZL2ZBVMmB GSD363YF2/bh3injyNlX5TgWxAzUMvMLFO8VzHEkycvjV0Jk+s6AcKCZZwYtJote7hzd hQUxoeLzpuw59jrUsQpgUqf9bTVNIM8frUN3054EZ6uvaY/t+dPMd4vgvNXUMHzdd1Q3 ojsg== X-Gm-Message-State: AOJu0YwsVwGzlU+NtguegOVKrRtk6IcP7ehMWrpQ0CrqaxmKBOJY32v7 tu50ZbsbrzQbxhy55XI67ELW6ZajX1LCXDJ0rfJ1xW/0D1PV/Wgzr/0LnOYeFqudgo/pT3dNuyA Q7HRGlnwJ5h6JvAd50OFUYOIluRiZa6o3dPPAtHZXXkvoerZ5akN01s3H7G7UyLUNtLoPUqEtAW HAMlf+ePb0qfhhWYdcpr2uN4RiDoaBfpWZ4lj3/757YZwh2OY2bwk= X-Google-Smtp-Source: AGHT+IEbqXrPWieahAb3XnPOkb5RnOi92UXG+lE/c5kq6LG68RvNe7DYOyBqRNp2yp3Qslry8rm4yw== X-Received: by 2002:a17:902:d4c8:b0:1ff:1bd:7e61 with SMTP id d9443c01a7336-1ff0481b232mr121785365ad.14.1722401974893; Tue, 30 Jul 2024 21:59:34 -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.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Jul 2024 21:59:34 -0700 (PDT) From: Samuel Holland To: opensbi@lists.infradead.org Subject: [PATCH 01/16] lib: utils/fdt: Fix fdt_add_cpu_idle_states() prototype Date: Tue, 30 Jul 2024 21:58:42 -0700 Message-ID: <20240731045931.2446799-2-samuel.holland@sifive.com> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240731045931.2446799-1-samuel.holland@sifive.com> References: <20240731045931.2446799-1-samuel.holland@sifive.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240730_215936_991225_EDA62BFF X-CRM114-Status: GOOD ( 10.21 ) 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: The function prototype should use the same parameter name as the documentation and the function definition. Fixes: 33bf9174602c ("lib: utils: Add fdt_add_cpu_idle_states() helper function") Signed-off-by: Samuel Holland --- Content analysis details: (-2.1 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:632 listed in] [list.dnswl.org] -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] 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 The function prototype should use the same parameter name as the documentation and the function definition. Fixes: 33bf9174602c ("lib: utils: Add fdt_add_cpu_idle_states() helper function") Signed-off-by: Samuel Holland --- include/sbi_utils/fdt/fdt_fixup.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/sbi_utils/fdt/fdt_fixup.h b/include/sbi_utils/fdt/fdt_fixup.h index ecd55a72..21a53011 100644 --- a/include/sbi_utils/fdt/fdt_fixup.h +++ b/include/sbi_utils/fdt/fdt_fixup.h @@ -30,7 +30,7 @@ struct sbi_cpu_idle_state { * @param states: array of idle state descriptions, ending with empty element * @return zero on success and -ve on failure */ -int fdt_add_cpu_idle_states(void *dtb, const struct sbi_cpu_idle_state *state); +int fdt_add_cpu_idle_states(void *fdt, const struct sbi_cpu_idle_state *state); /** * Fix up the CPU node in the device tree From patchwork Wed Jul 31 04:58:43 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Samuel Holland X-Patchwork-Id: 1966829 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=TRcXppVL; 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=F7HgL0Oy; 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 4WYfzC3ZZkz1yfG for ; Wed, 31 Jul 2024 14:59:49 +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:References:In-Reply-To: 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: List-Owner; bh=hkEsAaijrodkqZlzno4IfdequD4eWV6Lrtt5dLBq/ao=; b=TRcXppVL+YTVj7 x++Qx9hN0zX15PJDqY0O6RWUu3/Gc2MmxNcD1vWLkThSj8P4rM03Ss5fAE34De8D+rcmp4q7U6SCb ogNaPHzx20nKvrSy1fVuWVdqPnoVCvMo5hOTlYhKaxj+SFy2rpXZxNWZtHItfZbp260BzeA2PCfDo QX0qoiMHZFbIpWcSQWgnu3F10c1jHSLltE80iyZr9mn/jipDjLiFcMtB4eh5S3OIONWK6xeVfCof2 irxbQObfSbdc8JStQmBFo0SNiSvqkJJit2UyaCQwey9lGEHlPgv7rvzH/z5DfHrELFUnF4EpIBEnM Sw3bc58uOtYR82/GyNjw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sZ1R6-0000000HKMy-1euf; Wed, 31 Jul 2024 04:59:40 +0000 Received: from mail-pl1-x62c.google.com ([2607:f8b0:4864:20::62c]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sZ1R3-0000000HKL8-22LX for opensbi@lists.infradead.org; Wed, 31 Jul 2024 04:59:39 +0000 Received: by mail-pl1-x62c.google.com with SMTP id d9443c01a7336-1fc6a017abdso33431585ad.0 for ; Tue, 30 Jul 2024 21:59:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sifive.com; s=google; t=1722401976; x=1723006776; darn=lists.infradead.org; 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=vJSDLHujSRS7b1EKOsyopTxkarcV0Gkb4kfb3oF4ncY=; b=F7HgL0OyikoIK9JzQUoQf43QWciPAc8ozwBBLf05JnJqOmpDva0P8b3TbDSxCoAdHV RfPG27JLINFbwgYgro8eC6TtjrW36v5fjJGnwxGKlePAi44/h6lUyhivy6pL5uBITYw3 PokJLOKffbYBeXkJ/54CAi343qoRG6fx7P2QdskG/0yfD1q3eKRwchQy9IWqEhlN1MBm z0TJBuGWA+kCBOCD6rOEBDbc9Iv87aL3cxkOveyh3ispTpYzgz+XzXGFFkusecBNvpJN IykeGzLasMvPHxUfa0AkRsEVLpJpmmEDqsnXsONUkSxI1eP7vZVYTeGbV8bF6T9g2G4w aEvg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722401976; x=1723006776; 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=vJSDLHujSRS7b1EKOsyopTxkarcV0Gkb4kfb3oF4ncY=; b=PgJOphD4JAbGTO11ZgEp1Bv/s5Esbv9CfTsEWvILBwrvAm3V6gvXkwGAvNxmmVTRDG o8U8WP4dxiqu8rfkaniM0Wn9zq01r1znJjF33bKHjZ0o3oE48z4Tfu+DusIKP66QZtqZ OxR6G7pH8MHO0nJfsfw9Zxn4719WjtT2j5l+gv6pYcyIymUWpP4enCe+npfvft5k2blN vMxN92m3AyaBzZJq5mqZaZx4Sh1hlWKX5ACbPx/RaJ8ZkfqwuNGNqrNDto8Ew5Wksrvm iKe6OQv8pQjHmuKhDKEkJrXk31PR4UHX23xCt3rRAFoudJQShSf/al4yUDSHdz07Qn0r o0PA== X-Gm-Message-State: AOJu0YwuX7DmwDBBriucovcHwAqCaRQi/F7przMgGH74XZGP/xRdiKjv X4fS2em8sv3inIT+BQ4N/jkSWRlbN3C6z97ceJaBbfGCvg3nd8hMcncZo9qfu0/XqFgqqXDOYem DrfOmKwWiAUHVTfS0rJTvMfZzUa+hEYyKXi0dL8GMjV1Ni7Q0WTUB7GuJAdKRSV2xe1L5S0K0IP tSLncoISvez23XYG5gOoT76/LBjDKgFBHBoBhUKM4Xa3N+BAifeOs= X-Google-Smtp-Source: AGHT+IHtanNBaKr3/yPzMghiDqC5Coch5UKYEi6D6Ol191i/AGxhzYJjUncevbjGgwxVoGsp5TvgxQ== X-Received: by 2002:a17:902:ce09:b0:1fb:6294:2e35 with SMTP id d9443c01a7336-1ff0489f4b9mr102195495ad.50.1722401976182; Tue, 30 Jul 2024 21:59:36 -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.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Jul 2024 21:59:35 -0700 (PDT) From: Samuel Holland To: opensbi@lists.infradead.org Subject: [PATCH 02/16] lib: utils/regmap: Fix typo in comment Date: Tue, 30 Jul 2024 21:58:43 -0700 Message-ID: <20240731045931.2446799-3-samuel.holland@sifive.com> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240731045931.2446799-1-samuel.holland@sifive.com> References: <20240731045931.2446799-1-samuel.holland@sifive.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240730_215937_558902_4BD6B958 X-CRM114-Status: UNSURE ( 9.82 ) 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: Balance the quotation marks; double quotes are idiomatic here. Signed-off-by: Samuel Holland --- include/sbi_utils/regmap/fdt_regmap.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Content analysis details: (-2.1 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:62c listed in] [list.dnswl.org] -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] 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 Balance the quotation marks; double quotes are idiomatic here. Signed-off-by: Samuel Holland --- include/sbi_utils/regmap/fdt_regmap.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/sbi_utils/regmap/fdt_regmap.h b/include/sbi_utils/regmap/fdt_regmap.h index 0672162c..403dd7d4 100644 --- a/include/sbi_utils/regmap/fdt_regmap.h +++ b/include/sbi_utils/regmap/fdt_regmap.h @@ -25,7 +25,7 @@ struct fdt_regmap { int fdt_regmap_get_by_phandle(void *fdt, u32 phandle, struct regmap **out_rmap); -/** Get regmap instance based on "regmap' property of the specified DT node */ +/** Get regmap instance based on "regmap" property of the specified DT node */ int fdt_regmap_get(void *fdt, int nodeoff, struct regmap **out_rmap); #endif From patchwork Wed Jul 31 04:58:44 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Samuel Holland X-Patchwork-Id: 1966830 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=f69BHpnt; 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=Of5oY1Gf; 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 4WYfzC4ZH1z20Mt for ; Wed, 31 Jul 2024 14:59:51 +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:References:In-Reply-To: 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: List-Owner; bh=v6ZJ2VN4B9ZfGjB029fPIDIrRhNcu9klOdGXXtD2OsY=; b=f69BHpntzNbT/T niK7LIt3GQmEXs7LXsIy1BAGuHq+FQ8Ybkw3ki8t+StCxGLPh73pwrOvX88z9E1mGO4I6sw0r6Z1v CndpsJoEvtWW3RHEl/gZ4CcPybQp1NkgJaD7ccF0Dik4/Fwhy0ifqYYw0CzcUJcxXudKMDm13cNjZ WbwVZqLLu4LpHpir8lKGI34kprenFBovOI62WsYw/vMdmcEgfAFL1yEwKgo8jW+RVbG8EQo2HSFXo pl6hShyjUjQ+ao5kE3WTYihiLj1+u4bQFXzLUjdaQAmeMKI7Nsag4GMpfNJIuNHKKR190p8jNLOW8 u28zhoaveTqpTRQVXFxA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sZ1R8-0000000HKOQ-3HKh; Wed, 31 Jul 2024 04:59:42 +0000 Received: from mail-pl1-x62d.google.com ([2607:f8b0:4864:20::62d]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sZ1R4-0000000HKLo-3EZU for opensbi@lists.infradead.org; Wed, 31 Jul 2024 04:59:40 +0000 Received: by mail-pl1-x62d.google.com with SMTP id d9443c01a7336-1fc5549788eso40126065ad.1 for ; Tue, 30 Jul 2024 21:59:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sifive.com; s=google; t=1722401977; x=1723006777; darn=lists.infradead.org; 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=H2XJB42M0t7XoUA29BM0pA4HFmRQ0d9/iA4RVNN0ynU=; b=Of5oY1GfZyjqpytwoEHfwkIZs6yuUTBI/lfrUaLmysErkB8yXQYRJifa1ByLYZd8oZ FdoBuOUWP+ZoMeUrbJAcDjkfAvsLSHj3DOLa6nD62TevSx/a+q2QP3q1cQOT4AN5nKwt qnR0vTqYhpozcTZJYMDQvDFayqOWSX3PNMg8Q/flvAYcddXnjNIU3Zzq0xqHmC44f3ev mPU0DKaU/ohQEtQWIHM76gVn3tt9zmEl2H6HlJKdOftDtiJJBdG0iplrYY+OJ9TK7rys CAVqH4VYhw6ILCOD8J1KgLwNjTHTgRcKFGxtVQlC/NWfn62/PzmnsMaLD7xwR6j54V4q j+qA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722401977; x=1723006777; 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=H2XJB42M0t7XoUA29BM0pA4HFmRQ0d9/iA4RVNN0ynU=; b=ofelP6gDRG7++mdeDXVqzN0GkujnDo60G2AhWutFj/V837jGGFyjnS/PVSo+Z17z/F 5tG6fWVT5gKchdqRZ5pTS70SnSqB9kgCu117QH4R99DbIlGtdjdVPt02MJr33/+TXie/ rG6crQHXlAKIpdg/s4B3UP1MfIPK4aUJwOsp+iTiHVVNoyAAMgJieTuJ31A+nvb/ouKO kpYH+t8gt9DYQqQXbci+E+BEdsd/dC4l3zw/ZxqoiUTfG8OGNxU3WHoGJ4oUg3yjxqXp oM4JrULB/v1HrSjkIh8ktAY/agqVxBWg0T+VFMfoVXUlVo0tZwQoK1ANMy05OFpzR6Bk hUnw== X-Gm-Message-State: AOJu0Yyneave2VlO/rF75hj5wG68vkDDUO0+DqlYN/6WQJqNJj5QkC/4 aGLIr53dYXAWYmDmzJ9RWZ7tAQq7A1EkjP4idSJeLYljq/Kx95o6Wojq26Mo85xfG6Cl8x8pGaG f48hEPju1p9jU+CZ51ODW8N2fvGtvxG4pc4YLveAJkGxWQKLTJ6HlqFVU7esPwrCZkS8d17BBlB bZsEt1f3/xqNyJ4jKb6rvn4L3v75o+JlImnM8LPe5k8rzwy5p7KjA= X-Google-Smtp-Source: AGHT+IG2wXKuPev3LUBb6W3ObfBW/yVLADlTXIuFyCieZ6tT7Vvt4/Yxsd/KouCh+946bGvgziIWpw== X-Received: by 2002:a17:902:f743:b0:1fd:8eaf:ea73 with SMTP id d9443c01a7336-1ff0484d533mr126958435ad.35.1722401977372; Tue, 30 Jul 2024 21:59:37 -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.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Jul 2024 21:59:36 -0700 (PDT) From: Samuel Holland To: opensbi@lists.infradead.org Subject: [PATCH 03/16] lib: utils/fdt: Constify FDT parsing functions Date: Tue, 30 Jul 2024 21:58:44 -0700 Message-ID: <20240731045931.2446799-4-samuel.holland@sifive.com> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240731045931.2446799-1-samuel.holland@sifive.com> References: <20240731045931.2446799-1-samuel.holland@sifive.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240730_215938_934144_334B752E X-CRM114-Status: GOOD ( 15.89 ) 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: Distinguish between functions which modify the devicetree and those which only extract information from it. Other than the iterators in fdt_domain.c, this is a mechanical conversion. Signed-off-by: Samuel Holland --- Content analysis details: (-2.1 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:62d listed in] [list.dnswl.org] -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] 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 Distinguish between functions which modify the devicetree and those which only extract information from it. Other than the iterators in fdt_domain.c, this is a mechanical conversion. Signed-off-by: Samuel Holland --- include/sbi_utils/fdt/fdt_domain.h | 4 +- include/sbi_utils/fdt/fdt_helper.h | 54 +++++++++++++------------- include/sbi_utils/fdt/fdt_pmu.h | 4 +- lib/utils/fdt/fdt_domain.c | 31 +++++++++++---- lib/utils/fdt/fdt_helper.c | 62 +++++++++++++++--------------- lib/utils/fdt/fdt_pmu.c | 2 +- 6 files changed, 87 insertions(+), 70 deletions(-) diff --git a/include/sbi_utils/fdt/fdt_domain.h b/include/sbi_utils/fdt/fdt_domain.h index ee09d1bf..8c2dee09 100644 --- a/include/sbi_utils/fdt/fdt_domain.h +++ b/include/sbi_utils/fdt/fdt_domain.h @@ -70,12 +70,12 @@ void fdt_domain_fixup(void *fdt); * * @return 0 on success and negative error code on failure */ -int fdt_domains_populate(void *fdt); +int fdt_domains_populate(const void *fdt); #else static inline void fdt_domain_fixup(void *fdt) { } -static inline int fdt_domains_populate(void *fdt) { return 0; } +static inline int fdt_domains_populate(const void *fdt) { return 0; } #endif diff --git a/include/sbi_utils/fdt/fdt_helper.h b/include/sbi_utils/fdt/fdt_helper.h index ab4a80fa..28ae7677 100644 --- a/include/sbi_utils/fdt/fdt_helper.h +++ b/include/sbi_utils/fdt/fdt_helper.h @@ -34,84 +34,84 @@ struct platform_uart_data { unsigned long reg_offset; }; -const struct fdt_match *fdt_match_node(void *fdt, int nodeoff, +const struct fdt_match *fdt_match_node(const void *fdt, int nodeoff, const struct fdt_match *match_table); -int fdt_find_match(void *fdt, int startoff, +int fdt_find_match(const void *fdt, int startoff, const struct fdt_match *match_table, const struct fdt_match **out_match); -int fdt_parse_phandle_with_args(void *fdt, int nodeoff, +int fdt_parse_phandle_with_args(const void *fdt, int nodeoff, const char *prop, const char *cells_prop, int index, struct fdt_phandle_args *out_args); -int fdt_get_node_addr_size(void *fdt, int node, int index, +int fdt_get_node_addr_size(const void *fdt, int node, int index, uint64_t *addr, uint64_t *size); -int fdt_get_node_addr_size_by_name(void *fdt, int node, const char *name, +int fdt_get_node_addr_size_by_name(const void *fdt, int node, const char *name, uint64_t *addr, uint64_t *size); -bool fdt_node_is_enabled(void *fdt, int nodeoff); +bool fdt_node_is_enabled(const void *fdt, int nodeoff); -int fdt_parse_hart_id(void *fdt, int cpu_offset, u32 *hartid); +int fdt_parse_hart_id(const void *fdt, int cpu_offset, u32 *hartid); -int fdt_parse_max_enabled_hart_id(void *fdt, u32 *max_hartid); +int fdt_parse_max_enabled_hart_id(const void *fdt, u32 *max_hartid); -int fdt_parse_timebase_frequency(void *fdt, unsigned long *freq); +int fdt_parse_timebase_frequency(const void *fdt, unsigned long *freq); -int fdt_parse_isa_extensions(void *fdt, unsigned int hard_id, +int fdt_parse_isa_extensions(const void *fdt, unsigned int hard_id, unsigned long *extensions); -int fdt_parse_gaisler_uart_node(void *fdt, int nodeoffset, +int fdt_parse_gaisler_uart_node(const void *fdt, int nodeoffset, struct platform_uart_data *uart); -int fdt_parse_renesas_scif_node(void *fdt, int nodeoffset, +int fdt_parse_renesas_scif_node(const void *fdt, int nodeoffset, struct platform_uart_data *uart); -int fdt_parse_shakti_uart_node(void *fdt, int nodeoffset, +int fdt_parse_shakti_uart_node(const void *fdt, int nodeoffset, struct platform_uart_data *uart); -int fdt_parse_sifive_uart_node(void *fdt, int nodeoffset, +int fdt_parse_sifive_uart_node(const void *fdt, int nodeoffset, struct platform_uart_data *uart); -int fdt_parse_uart_node(void *fdt, int nodeoffset, +int fdt_parse_uart_node(const void *fdt, int nodeoffset, struct platform_uart_data *uart); -int fdt_parse_uart8250(void *fdt, struct platform_uart_data *uart, +int fdt_parse_uart8250(const void *fdt, struct platform_uart_data *uart, const char *compatible); -int fdt_parse_xlnx_uartlite_node(void *fdt, int nodeoffset, +int fdt_parse_xlnx_uartlite_node(const void *fdt, int nodeoffset, struct platform_uart_data *uart); struct aplic_data; -int fdt_parse_aplic_node(void *fdt, int nodeoff, struct aplic_data *aplic); +int fdt_parse_aplic_node(const void *fdt, int nodeoff, struct aplic_data *aplic); struct imsic_data; -bool fdt_check_imsic_mlevel(void *fdt); +bool fdt_check_imsic_mlevel(const void *fdt); -int fdt_parse_imsic_node(void *fdt, int nodeoff, struct imsic_data *imsic); +int fdt_parse_imsic_node(const void *fdt, int nodeoff, struct imsic_data *imsic); struct plic_data; -int fdt_parse_plic_node(void *fdt, int nodeoffset, struct plic_data *plic); +int fdt_parse_plic_node(const void *fdt, int nodeoffset, struct plic_data *plic); -int fdt_parse_plic(void *fdt, struct plic_data *plic, const char *compat); +int fdt_parse_plic(const void *fdt, struct plic_data *plic, const char *compat); -int fdt_parse_aclint_node(void *fdt, int nodeoffset, +int fdt_parse_aclint_node(const void *fdt, int nodeoffset, bool for_timer, bool allow_regname, unsigned long *out_addr1, unsigned long *out_size1, unsigned long *out_addr2, unsigned long *out_size2, u32 *out_first_hartid, u32 *out_hart_count); -int fdt_parse_plmt_node(void *fdt, int nodeoffset, unsigned long *plmt_base, - unsigned long *plmt_size, u32 *hart_count); +int fdt_parse_plmt_node(const void *fdt, int nodeoffset, unsigned long *plmt_base, + unsigned long *plmt_size, u32 *hart_count); -int fdt_parse_plicsw_node(void *fdt, int nodeoffset, unsigned long *plicsw_base, +int fdt_parse_plicsw_node(const void *fdt, int nodeoffset, unsigned long *plicsw_base, unsigned long *size, u32 *hart_count); -int fdt_parse_compat_addr(void *fdt, uint64_t *addr, +int fdt_parse_compat_addr(const void *fdt, uint64_t *addr, const char *compatible); static inline void *fdt_get_address(void) diff --git a/include/sbi_utils/fdt/fdt_pmu.h b/include/sbi_utils/fdt/fdt_pmu.h index b10ae270..b31d8351 100644 --- a/include/sbi_utils/fdt/fdt_pmu.h +++ b/include/sbi_utils/fdt/fdt_pmu.h @@ -52,7 +52,7 @@ int fdt_pmu_fixup(void *fdt); * * @return 0 on success and negative error code on failure */ -int fdt_pmu_setup(void *fdt); +int fdt_pmu_setup(const void *fdt); /** * Get the mhpmevent select value read from DT for a given event @@ -70,7 +70,7 @@ extern uint32_t hw_event_count; #else static inline void fdt_pmu_fixup(void *fdt) { } -static inline int fdt_pmu_setup(void *fdt) { return 0; } +static inline int fdt_pmu_setup(const void *fdt) { return 0; } static inline uint64_t fdt_pmu_get_select_value(uint32_t event_idx) { return 0; } #endif diff --git a/lib/utils/fdt/fdt_domain.c b/lib/utils/fdt/fdt_domain.c index fa1c3575..1fa53a72 100644 --- a/lib/utils/fdt/fdt_domain.c +++ b/lib/utils/fdt/fdt_domain.c @@ -48,6 +48,14 @@ int fdt_iterate_each_domain(void *fdt, void *opaque, return 0; } +static int fdt_iterate_each_domain_ro(const void *fdt, void *opaque, + int (*fn)(const void *fdt, int domain_offset, + void *opaque)) +{ + return fdt_iterate_each_domain((void *)fdt, opaque, + (int (*)(void *, int, void *))fn); +} + int fdt_iterate_each_memregion(void *fdt, int domain_offset, void *opaque, int (*fn)(void *fdt, int domain_offset, int region_offset, u32 region_access, @@ -88,6 +96,15 @@ int fdt_iterate_each_memregion(void *fdt, int domain_offset, void *opaque, return 0; } +static int fdt_iterate_each_memregion_ro(const void *fdt, int domain_offset, void *opaque, + int (*fn)(const void *fdt, int domain_offset, + int region_offset, u32 region_access, + void *opaque)) +{ + return fdt_iterate_each_memregion((void *)fdt, domain_offset, opaque, + (int (*)(void *, int, int, u32, void *))fn); +} + struct __fixup_find_domain_offset_info { const char *name; int *doffset; @@ -228,7 +245,7 @@ struct parse_region_data { u32 max_regions; }; -static int __fdt_parse_region(void *fdt, int domain_offset, +static int __fdt_parse_region(const void *fdt, int domain_offset, int region_offset, u32 region_access, void *opaque) { @@ -283,7 +300,7 @@ static int __fdt_parse_region(void *fdt, int domain_offset, return 0; } -static int __fdt_parse_domain(void *fdt, int domain_offset, void *opaque) +static int __fdt_parse_domain(const void *fdt, int domain_offset, void *opaque) { u32 val32; u64 val64; @@ -347,8 +364,8 @@ static int __fdt_parse_domain(void *fdt, int domain_offset, void *opaque) } /* Setup memregions from DT */ - err = fdt_iterate_each_memregion(fdt, domain_offset, &preg, - __fdt_parse_region); + err = fdt_iterate_each_memregion_ro(fdt, domain_offset, &preg, + __fdt_parse_region); if (err) goto fail_free_all; @@ -491,7 +508,7 @@ fail_free_domain: return err; } -int fdt_domains_populate(void *fdt) +int fdt_domains_populate(const void *fdt) { const u32 *val; int cold_domain_offset; @@ -530,6 +547,6 @@ int fdt_domains_populate(void *fdt) } /* Iterate over each domain in FDT and populate details */ - return fdt_iterate_each_domain(fdt, &cold_domain_offset, - __fdt_parse_domain); + return fdt_iterate_each_domain_ro(fdt, &cold_domain_offset, + __fdt_parse_domain); } diff --git a/lib/utils/fdt/fdt_helper.c b/lib/utils/fdt/fdt_helper.c index b7f7e075..cb350e5a 100644 --- a/lib/utils/fdt/fdt_helper.c +++ b/lib/utils/fdt/fdt_helper.c @@ -33,7 +33,7 @@ #define DEFAULT_SHAKTI_UART_FREQ 50000000 #define DEFAULT_SHAKTI_UART_BAUD 115200 -const struct fdt_match *fdt_match_node(void *fdt, int nodeoff, +const struct fdt_match *fdt_match_node(const void *fdt, int nodeoff, const struct fdt_match *match_table) { int ret; @@ -52,7 +52,7 @@ const struct fdt_match *fdt_match_node(void *fdt, int nodeoff, return NULL; } -int fdt_find_match(void *fdt, int startoff, +int fdt_find_match(const void *fdt, int startoff, const struct fdt_match *match_table, const struct fdt_match **out_match) { @@ -75,7 +75,7 @@ int fdt_find_match(void *fdt, int startoff, return SBI_ENODEV; } -int fdt_parse_phandle_with_args(void *fdt, int nodeoff, +int fdt_parse_phandle_with_args(const void *fdt, int nodeoff, const char *prop, const char *cells_prop, int index, struct fdt_phandle_args *out_args) { @@ -122,7 +122,7 @@ int fdt_parse_phandle_with_args(void *fdt, int nodeoff, return SBI_ENOENT; } -static int fdt_translate_address(void *fdt, uint64_t reg, int parent, +static int fdt_translate_address(const void *fdt, uint64_t reg, int parent, uint64_t *addr) { int i, rlen; @@ -160,7 +160,7 @@ static int fdt_translate_address(void *fdt, uint64_t reg, int parent, return 0; } -int fdt_get_node_addr_size(void *fdt, int node, int index, +int fdt_get_node_addr_size(const void *fdt, int node, int index, uint64_t *addr, uint64_t *size) { int parent, len, i, rc; @@ -216,7 +216,7 @@ int fdt_get_node_addr_size(void *fdt, int node, int index, return 0; } -int fdt_get_node_addr_size_by_name(void *fdt, int node, const char *name, +int fdt_get_node_addr_size_by_name(const void *fdt, int node, const char *name, uint64_t *addr, uint64_t *size) { int i, j, count; @@ -242,7 +242,7 @@ int fdt_get_node_addr_size_by_name(void *fdt, int node, const char *name, return SBI_ENODEV; } -bool fdt_node_is_enabled(void *fdt, int nodeoff) +bool fdt_node_is_enabled(const void *fdt, int nodeoff) { int len; const void *prop; @@ -260,7 +260,7 @@ bool fdt_node_is_enabled(void *fdt, int nodeoff) return false; } -int fdt_parse_hart_id(void *fdt, int cpu_offset, u32 *hartid) +int fdt_parse_hart_id(const void *fdt, int cpu_offset, u32 *hartid) { int len; const void *prop; @@ -288,7 +288,7 @@ int fdt_parse_hart_id(void *fdt, int cpu_offset, u32 *hartid) return 0; } -int fdt_parse_max_enabled_hart_id(void *fdt, u32 *max_hartid) +int fdt_parse_max_enabled_hart_id(const void *fdt, u32 *max_hartid) { u32 hartid; int err, cpu_offset, cpus_offset; @@ -319,7 +319,7 @@ int fdt_parse_max_enabled_hart_id(void *fdt, u32 *max_hartid) return 0; } -int fdt_parse_timebase_frequency(void *fdt, unsigned long *freq) +int fdt_parse_timebase_frequency(const void *fdt, unsigned long *freq) { const fdt32_t *val; int len, cpus_offset; @@ -423,7 +423,7 @@ static void fdt_parse_isa_extensions_one_hart(const char *isa, } } -static int fdt_parse_isa_all_harts(void *fdt) +static int fdt_parse_isa_all_harts(const void *fdt) { u32 hartid; const fdt32_t *val; @@ -472,7 +472,7 @@ static int fdt_parse_isa_all_harts(void *fdt) return 0; } -int fdt_parse_isa_extensions(void *fdt, unsigned int hartid, +int fdt_parse_isa_extensions(const void *fdt, unsigned int hartid, unsigned long *extensions) { int rc, i; @@ -502,7 +502,7 @@ int fdt_parse_isa_extensions(void *fdt, unsigned int hartid, return 0; } -static int fdt_parse_uart_node_common(void *fdt, int nodeoffset, +static int fdt_parse_uart_node_common(const void *fdt, int nodeoffset, struct platform_uart_data *uart, unsigned long default_freq, unsigned long default_baud) @@ -539,7 +539,7 @@ static int fdt_parse_uart_node_common(void *fdt, int nodeoffset, return 0; } -int fdt_parse_gaisler_uart_node(void *fdt, int nodeoffset, +int fdt_parse_gaisler_uart_node(const void *fdt, int nodeoffset, struct platform_uart_data *uart) { return fdt_parse_uart_node_common(fdt, nodeoffset, uart, @@ -547,7 +547,7 @@ int fdt_parse_gaisler_uart_node(void *fdt, int nodeoffset, DEFAULT_UART_BAUD); } -int fdt_parse_renesas_scif_node(void *fdt, int nodeoffset, +int fdt_parse_renesas_scif_node(const void *fdt, int nodeoffset, struct platform_uart_data *uart) { return fdt_parse_uart_node_common(fdt, nodeoffset, uart, @@ -555,7 +555,7 @@ int fdt_parse_renesas_scif_node(void *fdt, int nodeoffset, DEFAULT_RENESAS_SCIF_BAUD); } -int fdt_parse_shakti_uart_node(void *fdt, int nodeoffset, +int fdt_parse_shakti_uart_node(const void *fdt, int nodeoffset, struct platform_uart_data *uart) { return fdt_parse_uart_node_common(fdt, nodeoffset, uart, @@ -563,7 +563,7 @@ int fdt_parse_shakti_uart_node(void *fdt, int nodeoffset, DEFAULT_SHAKTI_UART_BAUD); } -int fdt_parse_sifive_uart_node(void *fdt, int nodeoffset, +int fdt_parse_sifive_uart_node(const void *fdt, int nodeoffset, struct platform_uart_data *uart) { return fdt_parse_uart_node_common(fdt, nodeoffset, uart, @@ -571,7 +571,7 @@ int fdt_parse_sifive_uart_node(void *fdt, int nodeoffset, DEFAULT_SIFIVE_UART_BAUD); } -int fdt_parse_uart_node(void *fdt, int nodeoffset, +int fdt_parse_uart_node(const void *fdt, int nodeoffset, struct platform_uart_data *uart) { int len, rc; @@ -604,7 +604,7 @@ int fdt_parse_uart_node(void *fdt, int nodeoffset, return 0; } -int fdt_parse_uart8250(void *fdt, struct platform_uart_data *uart, +int fdt_parse_uart8250(const void *fdt, struct platform_uart_data *uart, const char *compatible) { int nodeoffset; @@ -619,13 +619,13 @@ int fdt_parse_uart8250(void *fdt, struct platform_uart_data *uart, return fdt_parse_uart_node(fdt, nodeoffset, uart); } -int fdt_parse_xlnx_uartlite_node(void *fdt, int nodeoffset, +int fdt_parse_xlnx_uartlite_node(const void *fdt, int nodeoffset, struct platform_uart_data *uart) { return fdt_parse_uart_node_common(fdt, nodeoffset, uart, 0, 0); } -int fdt_parse_aplic_node(void *fdt, int nodeoff, struct aplic_data *aplic) +int fdt_parse_aplic_node(const void *fdt, int nodeoff, struct aplic_data *aplic) { bool child_found; const fdt32_t *val; @@ -785,7 +785,7 @@ skip_delegate_parse: return 0; } -bool fdt_check_imsic_mlevel(void *fdt) +bool fdt_check_imsic_mlevel(const void *fdt) { const fdt32_t *val; int i, len, noff = 0; @@ -808,7 +808,7 @@ bool fdt_check_imsic_mlevel(void *fdt) return false; } -int fdt_parse_imsic_node(void *fdt, int nodeoff, struct imsic_data *imsic) +int fdt_parse_imsic_node(const void *fdt, int nodeoff, struct imsic_data *imsic) { const fdt32_t *val; struct imsic_regs *regs; @@ -887,7 +887,7 @@ int fdt_parse_imsic_node(void *fdt, int nodeoff, struct imsic_data *imsic) return 0; } -int fdt_parse_plic_node(void *fdt, int nodeoffset, struct plic_data *plic) +int fdt_parse_plic_node(const void *fdt, int nodeoffset, struct plic_data *plic) { int len, rc; const fdt32_t *val; @@ -910,7 +910,7 @@ int fdt_parse_plic_node(void *fdt, int nodeoffset, struct plic_data *plic) return 0; } -int fdt_parse_plic(void *fdt, struct plic_data *plic, const char *compat) +int fdt_parse_plic(const void *fdt, struct plic_data *plic, const char *compat) { int nodeoffset; @@ -924,7 +924,7 @@ int fdt_parse_plic(void *fdt, struct plic_data *plic, const char *compat) return fdt_parse_plic_node(fdt, nodeoffset, plic); } -static int fdt_get_aclint_addr_size_by_name(void *fdt, int nodeoffset, +static int fdt_get_aclint_addr_size_by_name(const void *fdt, int nodeoffset, unsigned long *out_addr1, unsigned long *out_size1, unsigned long *out_addr2, @@ -950,7 +950,7 @@ static int fdt_get_aclint_addr_size_by_name(void *fdt, int nodeoffset, return 0; } -static int fdt_get_aclint_addr_size(void *fdt, int nodeoffset, +static int fdt_get_aclint_addr_size(const void *fdt, int nodeoffset, unsigned long *out_addr1, unsigned long *out_size1, unsigned long *out_addr2, @@ -978,7 +978,7 @@ static int fdt_get_aclint_addr_size(void *fdt, int nodeoffset, return 0; } -int fdt_parse_aclint_node(void *fdt, int nodeoffset, +int fdt_parse_aclint_node(const void *fdt, int nodeoffset, bool for_timer, bool allow_regname, unsigned long *out_addr1, unsigned long *out_size1, unsigned long *out_addr2, unsigned long *out_size2, @@ -1053,7 +1053,7 @@ int fdt_parse_aclint_node(void *fdt, int nodeoffset, return 0; } -int fdt_parse_plmt_node(void *fdt, int nodeoffset, unsigned long *plmt_base, +int fdt_parse_plmt_node(const void *fdt, int nodeoffset, unsigned long *plmt_base, unsigned long *plmt_size, u32 *hart_count) { const fdt32_t *val; @@ -1109,7 +1109,7 @@ int fdt_parse_plmt_node(void *fdt, int nodeoffset, unsigned long *plmt_base, return 0; } -int fdt_parse_plicsw_node(void *fdt, int nodeoffset, unsigned long *plicsw_base, +int fdt_parse_plicsw_node(const void *fdt, int nodeoffset, unsigned long *plicsw_base, unsigned long *size, u32 *hart_count) { const fdt32_t *val; @@ -1165,7 +1165,7 @@ int fdt_parse_plicsw_node(void *fdt, int nodeoffset, unsigned long *plicsw_base, return 0; } -int fdt_parse_compat_addr(void *fdt, uint64_t *addr, +int fdt_parse_compat_addr(const void *fdt, uint64_t *addr, const char *compatible) { int nodeoffset, rc; diff --git a/lib/utils/fdt/fdt_pmu.c b/lib/utils/fdt/fdt_pmu.c index e23e8223..64de569e 100644 --- a/lib/utils/fdt/fdt_pmu.c +++ b/lib/utils/fdt/fdt_pmu.c @@ -56,7 +56,7 @@ int fdt_pmu_fixup(void *fdt) return 0; } -int fdt_pmu_setup(void *fdt) +int fdt_pmu_setup(const void *fdt) { int i, pmu_offset, len, result; const u32 *event_val; From patchwork Wed Jul 31 04:58:45 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Samuel Holland X-Patchwork-Id: 1966828 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=Cgaosk9/; 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=hvG473yX; 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 4WYfzC4GW0z20Fw for ; Wed, 31 Jul 2024 14:59:49 +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:References:In-Reply-To: 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: List-Owner; bh=n/QbS2dvFnPQ5V2oQkhFlsxu9KR31bnGvbMTIUhdA/c=; b=Cgaosk9/IbI+8R sCQVgCt+JHJwX6ShwcJFPOhwdw9g4bpbYuT4YBurCFvQuBDUsavAhD6wREW9WMiZChZ5HweFiDOPJ h6sBlbYiQXNxW64BNYbYeT5oVr03lQ/wQC/kRJXV/KL2POX+TD02dFHg2OKZmv2ZfTx07OciEiJ6i GbdOqwraMYbf8tpnGqZG2KPuuEJTGRHYTzPEIW3Z5/pfudi/5IT7IMGH/6PTpSO3ck8cro+yxpj2p biVm8IdELB6wOmxdDM1FmCZMUOCLYG7n3ZsdoycN5iAOphfziHDAZNhzdTNwyByyH5XKkPFoMlSMK NCUIlBo2QJAJZVZxz/4w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sZ1R7-0000000HKNu-3oYA; Wed, 31 Jul 2024 04:59:41 +0000 Received: from mail-pl1-x62c.google.com ([2607:f8b0:4864:20::62c]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sZ1R5-0000000HKMM-1l36 for opensbi@lists.infradead.org; Wed, 31 Jul 2024 04:59:40 +0000 Received: by mail-pl1-x62c.google.com with SMTP id d9443c01a7336-1fd90c2fc68so40344895ad.1 for ; Tue, 30 Jul 2024 21:59:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sifive.com; s=google; t=1722401979; x=1723006779; darn=lists.infradead.org; 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=HM7z/aAKTFR6Xbb/gnRly8w3D2SvO+/L2V98oQRaQ4A=; b=hvG473yX5MZ2EqGeWGycuCIUGpEhqwIsrYzKFIDtSmErX7qEwTcXyWUAPT8OMqiK5T DDeS4llUrs8t0XEzI1G+bXXtD9MpPC5TVrCJNcJuTP6B2FETm5T7BSiJAaJTkxysEu2b PLbD1nWwkmwvz+Hk3SwrdeIGV4hxw2fr/kJVXKffGKIqK+L3XBKyzflZ0vuq962FjEOH Pm0uJeu0+n4Em9bjPvCzvHwMna9d6bZiXddSGWIoyBL1XqUexgLoYGGGog/zQl3RnMP9 o5nnUAQvqAaxPCI2gvfqe71begzbH8L7o8PZOglXNcu3Y2MLKUY/qPhySoTkGOl6IZRx Nhkw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722401979; x=1723006779; 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=HM7z/aAKTFR6Xbb/gnRly8w3D2SvO+/L2V98oQRaQ4A=; b=K34oqc2F8zXHMzSpLNHHhIFNCN7SMK/uDZIaXK1TW8bkH7gXwxaZWHNdYICML6fDK1 epewyD6++z9u8uRoH2NY7hCNpr+iePgN8YGIAxVLC+c6WXMsdMrH+/jGjneW//eCeaD4 qXLC0CTXwXXyWpcovtcOx4I5jCgg2XeKydTNTljehw2qaKN4ElYnNusByV+cbPHkQAbU m+Vv86NNHiY3QfVwlicP3I9/oBn7PwHp5yDSFFt/KqP5kzHED5rccmPWmMq0NYWpI4lJ pDmjepqTt9OatywcsScZBUx9Ize8a/V245Xp56rpZcAf1eHLh9WpiJX4Wl/Ls7qu4OBe Daxg== X-Gm-Message-State: AOJu0YyZTVSXCpwIQ3Dvoed0zN4C16lO0EyIdaewzZGdeWqo9gZbi6Q2 KvroM5J3VFyKeP7xBgNv41/EEKDqnpu/lf3VP9ZiMcWMLRYcL+/z1QtBYmqondutzfGaxDC/lv6 nnMh3cpzdf3MPdPycJUCvA8sEpblrncG8JpxDDpM96AngodV/4jPgCB7cjjCdd20UyAmYm5j0DG MRG2nw1pqh+ce2Ru1DgDs//MjfwMkV5MsD17zvO0aCYkMLeRZyRss= X-Google-Smtp-Source: AGHT+IE/nLstV7B3ZIVImvNQ6YFxABjCY0GF/NH2WAOnbbXQ0cu5QFGkhMBkQisfprrP3yjldGrsaw== X-Received: by 2002:a17:903:1245:b0:1fb:3e8c:95a6 with SMTP id d9443c01a7336-1ff048e59c8mr116557595ad.40.1722401978547; Tue, 30 Jul 2024 21:59:38 -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.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Jul 2024 21:59:38 -0700 (PDT) From: Samuel Holland To: opensbi@lists.infradead.org Subject: [PATCH 04/16] lib: utils/gpio: Constify FDT pointers in parsing functions Date: Tue, 30 Jul 2024 21:58:45 -0700 Message-ID: <20240731045931.2446799-5-samuel.holland@sifive.com> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240731045931.2446799-1-samuel.holland@sifive.com> References: <20240731045931.2446799-1-samuel.holland@sifive.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240730_215939_491493_EA952C98 X-CRM114-Status: GOOD ( 13.34 ) 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: Indicate that none of these functions modify the devicetree by constifying the parameter type. Signed-off-by: Samuel Holland --- include/sbi_utils/gpio/fdt_gpio.h | 4 ++-- 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 [...] Content analysis details: (-2.1 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:62c listed in] [list.dnswl.org] -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] 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 Indicate that none of these functions modify the devicetree by constifying the parameter type. Signed-off-by: Samuel Holland --- include/sbi_utils/gpio/fdt_gpio.h | 4 ++-- 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 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/include/sbi_utils/gpio/fdt_gpio.h b/include/sbi_utils/gpio/fdt_gpio.h index ccbf2a11..303ef632 100644 --- a/include/sbi_utils/gpio/fdt_gpio.h +++ b/include/sbi_utils/gpio/fdt_gpio.h @@ -20,12 +20,12 @@ struct fdt_gpio { int (*xlate)(struct gpio_chip *chip, const struct fdt_phandle_args *pargs, struct gpio_pin *out_pin); - int (*init)(void *fdt, int nodeoff, u32 phandle, + int (*init)(const void *fdt, int nodeoff, u32 phandle, const struct fdt_match *match); }; /** Get a GPIO pin using "gpios" DT property of client DT node */ -int fdt_gpio_pin_get(void *fdt, int nodeoff, int index, +int fdt_gpio_pin_get(const void *fdt, int nodeoff, int index, struct gpio_pin *out_pin); /** Simple xlate function to convert two GPIO FDT cells into GPIO pin */ diff --git a/lib/utils/gpio/fdt_gpio.c b/lib/utils/gpio/fdt_gpio.c index 7258128d..d8d847f1 100644 --- a/lib/utils/gpio/fdt_gpio.c +++ b/lib/utils/gpio/fdt_gpio.c @@ -31,7 +31,7 @@ static struct fdt_gpio *fdt_gpio_driver(struct gpio_chip *chip) return NULL; } -static int fdt_gpio_init(void *fdt, u32 phandle) +static int fdt_gpio_init(const void *fdt, u32 phandle) { int pos, nodeoff, rc; struct fdt_gpio *drv; @@ -64,7 +64,7 @@ static int fdt_gpio_init(void *fdt, u32 phandle) return SBI_ENOSYS; } -static int fdt_gpio_chip_find(void *fdt, u32 phandle, +static int fdt_gpio_chip_find(const void *fdt, u32 phandle, struct gpio_chip **out_chip) { int rc; @@ -88,7 +88,7 @@ static int fdt_gpio_chip_find(void *fdt, u32 phandle, return 0; } -int fdt_gpio_pin_get(void *fdt, int nodeoff, int index, +int fdt_gpio_pin_get(const void *fdt, int nodeoff, int index, struct gpio_pin *out_pin) { int rc; diff --git a/lib/utils/gpio/fdt_gpio_designware.c b/lib/utils/gpio/fdt_gpio_designware.c index 018e2d54..20701a15 100644 --- a/lib/utils/gpio/fdt_gpio_designware.c +++ b/lib/utils/gpio/fdt_gpio_designware.c @@ -78,7 +78,7 @@ static void dw_gpio_set(struct gpio_pin *gp, int value) * bank A is the only one with irq support but we're not using it here */ -static int dw_gpio_init_bank(void *fdt, int nodeoff, u32 phandle, +static int dw_gpio_init_bank(const void *fdt, int nodeoff, u32 phandle, const struct fdt_match *match) { struct dw_gpio_chip *chip; diff --git a/lib/utils/gpio/fdt_gpio_sifive.c b/lib/utils/gpio/fdt_gpio_sifive.c index 5e3f39d7..e5dbe2be 100644 --- a/lib/utils/gpio/fdt_gpio_sifive.c +++ b/lib/utils/gpio/fdt_gpio_sifive.c @@ -62,7 +62,7 @@ static void sifive_gpio_set(struct gpio_pin *gp, int value) extern struct fdt_gpio fdt_gpio_sifive; -static int sifive_gpio_init(void *fdt, int nodeoff, u32 phandle, +static int sifive_gpio_init(const void *fdt, int nodeoff, u32 phandle, const struct fdt_match *match) { int rc; diff --git a/lib/utils/gpio/fdt_gpio_starfive.c b/lib/utils/gpio/fdt_gpio_starfive.c index bd2a9f21..d84ff1fe 100644 --- a/lib/utils/gpio/fdt_gpio_starfive.c +++ b/lib/utils/gpio/fdt_gpio_starfive.c @@ -71,7 +71,7 @@ static void starfive_gpio_set(struct gpio_pin *gp, int value) extern struct fdt_gpio fdt_gpio_starfive; -static int starfive_gpio_init(void *fdt, int nodeoff, u32 phandle, +static int starfive_gpio_init(const void *fdt, int nodeoff, u32 phandle, const struct fdt_match *match) { int rc; From patchwork Wed Jul 31 04:58:46 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Samuel Holland X-Patchwork-Id: 1966824 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=B+GC6D1f; 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=UqUl7gZb; 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 4WYfzC5HGjz20Mv for ; Wed, 31 Jul 2024 14:59:51 +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:References:In-Reply-To: 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: List-Owner; bh=KUHxfw5EJOExAazVU6DuaJY4ybYt8HyuBb+AkqNCOUM=; b=B+GC6D1fm4oHlc Dh6JpvIR8jjdHr2Drvqn9jYOQlIfPCp366UVtkWR8ne8S2k/JSEp9TrG7tzmxXyttyMmxrD9/EHZZ 1BMLtDoV4QqHz/z69wHMqTVY8N0UWesivDUbUvUjLJahv60BmP8yUk6QoTcrTwSnHYaddBxsd3kTL VHn9HzVNBy4GcHc5vndvI3cQFylFKQqTKUytiD5d9bDQe1k5u5NW17dEb/jI/ujBwwhKLb3JdLi9F bQxi3jQB6aDdeB/UckAZ8HQoIRSPb+T5AIeC0Z5M/12WRZuRooKCpkO9i41+RIvKPR03SVPs6e7ZN RoMpi7HmhF56kHqSkJoQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sZ1RA-0000000HKQ3-3mgE; Wed, 31 Jul 2024 04:59:44 +0000 Received: from mail-pl1-x633.google.com ([2607:f8b0:4864:20::633]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sZ1R7-0000000HKN6-0bNr for opensbi@lists.infradead.org; Wed, 31 Jul 2024 04:59:42 +0000 Received: by mail-pl1-x633.google.com with SMTP id d9443c01a7336-1fc611a0f8cso37002165ad.2 for ; Tue, 30 Jul 2024 21:59:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sifive.com; s=google; t=1722401980; x=1723006780; darn=lists.infradead.org; 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=7d6OQwHP/TvElUDoeGJetGexHQ4BoGMsA5qxp+Ofy68=; b=UqUl7gZbWSjJBY19eYFFM831TtY+6rOjevVz2CrPmizHtDHS9LDkalcCP804QM2SoN 0J9gCMx5RgA8hFd+zJah+AhwjDn5QoRqWCXyI6RXUwV+LlIYmUGYeH3X116qCAHpXzaB QZwc3NMg+2pMnVH8RqbvC/eagjgwQV1V1rUWQELuDzbrNooa3OY9WC2r4536Z59Efpj8 PPlkYbu/3kqnBOmDg4xMmj9e2upA4t9uNoDppbbcir/bdvadj6/9CSOOt5HUzJGGwmw4 cLUCX7e2Jdgvm/7LwvBrGcmAfh0cJwrsrupXQjF6ZWpuTq8MH28YVKnAdul0y+o7O3WN UUhA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722401980; x=1723006780; 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=7d6OQwHP/TvElUDoeGJetGexHQ4BoGMsA5qxp+Ofy68=; b=dxEWQSEGxuVHS+hd6Gjq3r5R4asloawRg2P6hw8FqCWFPBi3+sMmQKu3AAgh8UQ0Q5 ZVdf0Tsg/UuGqVXEBbMGk2NEtHxzhPu4fZolRVBA9ySQ2WB3p170rAPwmGpJXQEB1IhV 1aGF34RLmAKTs1k6nGbFWHPjuFuUg/uiqfQxEBgRhHhvd0HlM0d4l+72jTOqy1tm0mGQ LHS3dD/09UrzvEMYtPEPyPZpCebE+NsLrz00hWqyEmD0ANyaIIfnTQxvrsqOGRezCd0U ooUvvLaDxZEYdroksGTJiH71giLL4ubUqpZ3w/Yn9BdVFJmibiCVUXvxNOpSFn9hdQqH iriQ== X-Gm-Message-State: AOJu0Yyxof7NcWRECsFuvGebEcvZ5mkUut72mjC/LWq8FfQd4lpzAcN5 +y9V+KyuaiQfK37AuHpppBChzB0uuBv88d2br3HqQt3wYXwuPF02WTT3dbnpduAXIVkM5t3W5Mn MTQUpfhDUsfq69gWY0EQShFylHAcRoFN9sLDX9RFiTLqKNGbrpwPI7/wcRdnx2Dck6EULwHc//L 9DBb+/5s7H0SgHTXJ2JBiJBmB+nRJMBNEwtQ4iEd0hxl8NuNiEM4I= X-Google-Smtp-Source: AGHT+IH4K2G+31fTL27tv9eAt8Dr1jl9a//SLW2/W7R7K5ljK6jRdPvmhs2YgCSZdj2eeD9KwvursA== X-Received: by 2002:a17:902:f68a:b0:1f9:f3c6:ed37 with SMTP id d9443c01a7336-1ff04809576mr123666295ad.14.1722401979755; Tue, 30 Jul 2024 21:59:39 -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.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Jul 2024 21:59:39 -0700 (PDT) From: Samuel Holland To: opensbi@lists.infradead.org Subject: [PATCH 05/16] lib: utils/i2c: Constify FDT pointers in parsing functions Date: Tue, 30 Jul 2024 21:58:46 -0700 Message-ID: <20240731045931.2446799-6-samuel.holland@sifive.com> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240731045931.2446799-1-samuel.holland@sifive.com> References: <20240731045931.2446799-1-samuel.holland@sifive.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240730_215941_208075_96B4A65E X-CRM114-Status: GOOD ( 12.29 ) 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: Indicate that none of these functions modify the devicetree by constifying the parameter type. Signed-off-by: Samuel Holland --- include/sbi_utils/i2c/fdt_i2c.h | 4 ++-- lib/utils/i2c/fdt_i2c.c | 6 +++--- lib/utils/i2c/fdt_i2c_dw.c | 4 ++-- lib/utils/i2c/fdt_i2c_sifive.c | 4 ++-- 4 files changed, 9 insertions(+), 9 deletions(- [...] Content analysis details: (-2.1 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:633 listed in] [list.dnswl.org] -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] 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 Indicate that none of these functions modify the devicetree by constifying the parameter type. Signed-off-by: Samuel Holland --- include/sbi_utils/i2c/fdt_i2c.h | 4 ++-- lib/utils/i2c/fdt_i2c.c | 6 +++--- lib/utils/i2c/fdt_i2c_dw.c | 4 ++-- lib/utils/i2c/fdt_i2c_sifive.c | 4 ++-- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/include/sbi_utils/i2c/fdt_i2c.h b/include/sbi_utils/i2c/fdt_i2c.h index c6e33399..65758ec2 100644 --- a/include/sbi_utils/i2c/fdt_i2c.h +++ b/include/sbi_utils/i2c/fdt_i2c.h @@ -15,12 +15,12 @@ /** FDT based I2C adapter driver */ struct fdt_i2c_adapter { const struct fdt_match *match_table; - int (*init)(void *fdt, int nodeoff, + int (*init)(const void *fdt, int nodeoff, const struct fdt_match *match); }; /** Get I2C adapter identified by nodeoff */ -int fdt_i2c_adapter_get(void *fdt, int nodeoff, +int fdt_i2c_adapter_get(const void *fdt, int nodeoff, struct i2c_adapter **out_adapter); #endif diff --git a/lib/utils/i2c/fdt_i2c.c b/lib/utils/i2c/fdt_i2c.c index 6fd35dd0..d23b40db 100644 --- a/lib/utils/i2c/fdt_i2c.c +++ b/lib/utils/i2c/fdt_i2c.c @@ -20,7 +20,7 @@ extern struct fdt_i2c_adapter *fdt_i2c_adapter_drivers[]; extern unsigned long fdt_i2c_adapter_drivers_size; -static int fdt_i2c_adapter_init(void *fdt, int nodeoff) +static int fdt_i2c_adapter_init(const void *fdt, int nodeoff) { int pos, rc; struct fdt_i2c_adapter *drv; @@ -43,7 +43,7 @@ static int fdt_i2c_adapter_init(void *fdt, int nodeoff) return SBI_ENOSYS; } -static int fdt_i2c_adapter_find(void *fdt, int nodeoff, +static int fdt_i2c_adapter_find(const void *fdt, int nodeoff, struct i2c_adapter **out_adapter) { int rc; @@ -67,7 +67,7 @@ static int fdt_i2c_adapter_find(void *fdt, int nodeoff, return 0; } -int fdt_i2c_adapter_get(void *fdt, int nodeoff, +int fdt_i2c_adapter_get(const void *fdt, int nodeoff, struct i2c_adapter **out_adapter) { int rc; diff --git a/lib/utils/i2c/fdt_i2c_dw.c b/lib/utils/i2c/fdt_i2c_dw.c index 358ad3c7..7d14ea0d 100644 --- a/lib/utils/i2c/fdt_i2c_dw.c +++ b/lib/utils/i2c/fdt_i2c_dw.c @@ -15,8 +15,8 @@ #include #include -static int fdt_dw_i2c_init(void *fdt, int nodeoff, - const struct fdt_match *match) +static int fdt_dw_i2c_init(const void *fdt, int nodeoff, + const struct fdt_match *match) { int rc; struct dw_i2c_adapter *adapter; diff --git a/lib/utils/i2c/fdt_i2c_sifive.c b/lib/utils/i2c/fdt_i2c_sifive.c index 11740624..b420a7da 100644 --- a/lib/utils/i2c/fdt_i2c_sifive.c +++ b/lib/utils/i2c/fdt_i2c_sifive.c @@ -230,8 +230,8 @@ static int sifive_i2c_adapter_read(struct i2c_adapter *ia, uint8_t addr, return 0; } -static int sifive_i2c_init(void *fdt, int nodeoff, - const struct fdt_match *match) +static int sifive_i2c_init(const void *fdt, int nodeoff, + const struct fdt_match *match) { int rc; struct sifive_i2c_adapter *adapter; From patchwork Wed Jul 31 04:58:47 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Samuel Holland X-Patchwork-Id: 1966825 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=Xbkn+4kD; 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=lNWIJ2lc; 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 4WYfzF4pY7z20Mw for ; Wed, 31 Jul 2024 14:59:53 +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:References:In-Reply-To: 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: List-Owner; bh=M7gI1XHyzmU1LE/ybLGyHFL5tVHbiZw4KB5/Oqy3Nd8=; b=Xbkn+4kDw38lhv Fp3zDy0LFPavxLQidz7Bx2xCOTS5H9Fk7TmqY7kCRb/3F6uetsA861/D5IKHQyo2Dx35CPlgPX1UT +HjA0MAme2z/pi1g7rYZUtaJnoADGWK6in6Xa03LYBpeTC4Njg2IMm3Z5efEQkADaulnz7t0z4R5M V9NGhf4VoO/sMI/KDXYc3kJFpLhMm1VK3ujvZgXHUpSO/yxydG/jhctwVLbUyoUK8RdshOI2UbMf1 j6VlvJGq9EO4KXjJisHcL93FlRaDfi/fTOzQ0FirD0AY/CoJVjbeOw0AUSfWy0jBtja0aLnqkDDUk V7Nm3L+UmZBUDv6eUlFQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sZ1RB-0000000HKQe-2J3K; Wed, 31 Jul 2024 04:59:45 +0000 Received: from mail-pg1-x52c.google.com ([2607:f8b0:4864:20::52c]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sZ1R8-0000000HKNn-0hVG for opensbi@lists.infradead.org; Wed, 31 Jul 2024 04:59:43 +0000 Received: by mail-pg1-x52c.google.com with SMTP id 41be03b00d2f7-7a1843b4cdbso3117057a12.2 for ; Tue, 30 Jul 2024 21:59:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sifive.com; s=google; t=1722401981; x=1723006781; darn=lists.infradead.org; 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=C0qQrVs6+rKYQ2QDg1CXp4TkYIv8Uy6/n0DzqeDV2IQ=; b=lNWIJ2lc+hyc0NdmkU+OzJuG1B2/32T72k5IAH7QY34/WmsSyywb0QrZZrJ+50Kqyz yiTvm9BWmjtvq3nv22fR323nUuXsDSYvg0R25dcVDFBVcKWFgokRg1O3rqIs/bYPU6MM OJtmB7hIRMZpjwI0DS6h2dltQYqLPlt/KQ4uvbIqS57nesG7XqAF05QH95KfJisPK/M0 UwwPdN2+RPX6QjqccoSdp57tZllgR3bMFCkE3QkdfcrlAZoGN8rundUJ4zEmx0UOuBbC 2ECSdR81kGPtUNV2Dv2yk4q9QtLpcRmuKFXPZUMdkYuEB+sYBg8/0j1y1/Tgj8/0qSfc rAYg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722401981; x=1723006781; 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=C0qQrVs6+rKYQ2QDg1CXp4TkYIv8Uy6/n0DzqeDV2IQ=; b=LepHZ6nA9nFl2joP3Lq6ODowcLllovmCNQDEQteWSsa/4drX+xgYs4kel68mx8fW+P 3BLEJPvKDBlzAs3CGLrJaBNZpCxZVFF3ZL3Al2hnIu2QbEhOuR+Aos27TV10zMTjX3/G lAWt4i0YFYsLjaepI1g7UD7bV8LkhvLJsU0gxec35uw1IEgJU1IIZwBajvUi1bOsdR7d LP/qLa6KxKcF9JFhyqlx84R0csbk3bJGTNC6898SAsg3WjTAlCamtA6NgMAEz2u3Ja/h frIH9oH9ntNV5zj+N0g5mxe6NUa2X6rcURux8A/VdYkExvkXqscFV4d2qcrOHTJL0reH A+Uw== X-Gm-Message-State: AOJu0YzxpwhT+aMaeNiSOS4FAr96wXwwuGoVi5EA4L/JTKPfcvFHOezD TwpebixY/cZwSOfChn0gUZNX0rSMEhG7/kqEZYzOGSQdlyCfo8lYv7wWfTiIGgM/kdwec8co4eW gZrCPFQ/9Egi/BeqX38mHYdtjJ/5Sa9Z3sis3nySQfZJnRo5IuSwogk1sDLy745FIQSzXnPU12R x2u1+9mV/y47xmn7GbihS7kzL/81Vbd5Xmhv0UST63EepeHsd4g3o= X-Google-Smtp-Source: AGHT+IG9HX9E1heH80lTfiwM7f3/HC5t3VFsDvnYkvSY4D3oTsbKmc61evh74HFoEwfxaLrMiMCizQ== X-Received: by 2002:a17:902:ce0d:b0:1fd:a360:446f with SMTP id d9443c01a7336-1ff048afb6dmr106993035ad.65.1722401980841; Tue, 30 Jul 2024 21:59:40 -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.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Jul 2024 21:59:40 -0700 (PDT) From: Samuel Holland To: opensbi@lists.infradead.org Subject: [PATCH 06/16] lib: utils/ipi: Constify FDT pointers in parsing functions Date: Tue, 30 Jul 2024 21:58:47 -0700 Message-ID: <20240731045931.2446799-7-samuel.holland@sifive.com> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240731045931.2446799-1-samuel.holland@sifive.com> References: <20240731045931.2446799-1-samuel.holland@sifive.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240730_215942_234645_BB0F7B11 X-CRM114-Status: GOOD ( 12.85 ) 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: Indicate that none of these functions modify the devicetree by constifying the parameter type. Signed-off-by: Samuel Holland --- include/sbi_utils/ipi/fdt_ipi.h | 2 +- lib/utils/ipi/fdt_ipi.c | 2 +- lib/utils/ipi/fdt_ipi_mswi.c | 2 +- lib/utils/ipi/fdt_ipi_plicsw.c | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) Content analysis details: (-2.1 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:52c listed in] [list.dnswl.org] -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] 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 Indicate that none of these functions modify the devicetree by constifying the parameter type. Signed-off-by: Samuel Holland --- include/sbi_utils/ipi/fdt_ipi.h | 2 +- lib/utils/ipi/fdt_ipi.c | 2 +- lib/utils/ipi/fdt_ipi_mswi.c | 2 +- lib/utils/ipi/fdt_ipi_plicsw.c | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/include/sbi_utils/ipi/fdt_ipi.h b/include/sbi_utils/ipi/fdt_ipi.h index 1dd9062d..c6245201 100644 --- a/include/sbi_utils/ipi/fdt_ipi.h +++ b/include/sbi_utils/ipi/fdt_ipi.h @@ -16,7 +16,7 @@ struct fdt_ipi { const struct fdt_match *match_table; - int (*cold_init)(void *fdt, int nodeoff, const struct fdt_match *match); + int (*cold_init)(const void *fdt, int nodeoff, const struct fdt_match *match); int (*warm_init)(void); void (*exit)(void); }; diff --git a/lib/utils/ipi/fdt_ipi.c b/lib/utils/ipi/fdt_ipi.c index 0b75093e..959cf57d 100644 --- a/lib/utils/ipi/fdt_ipi.c +++ b/lib/utils/ipi/fdt_ipi.c @@ -36,7 +36,7 @@ static int fdt_ipi_cold_init(void) int pos, noff, rc; struct fdt_ipi *drv; const struct fdt_match *match; - void *fdt = fdt_get_address(); + const void *fdt = fdt_get_address(); for (pos = 0; pos < fdt_ipi_drivers_size; pos++) { drv = fdt_ipi_drivers[pos]; diff --git a/lib/utils/ipi/fdt_ipi_mswi.c b/lib/utils/ipi/fdt_ipi_mswi.c index a709abe1..c78dead1 100644 --- a/lib/utils/ipi/fdt_ipi_mswi.c +++ b/lib/utils/ipi/fdt_ipi_mswi.c @@ -13,7 +13,7 @@ #include #include -static int ipi_mswi_cold_init(void *fdt, int nodeoff, +static int ipi_mswi_cold_init(const void *fdt, int nodeoff, const struct fdt_match *match) { int rc; diff --git a/lib/utils/ipi/fdt_ipi_plicsw.c b/lib/utils/ipi/fdt_ipi_plicsw.c index bf29bfc1..32885745 100644 --- a/lib/utils/ipi/fdt_ipi_plicsw.c +++ b/lib/utils/ipi/fdt_ipi_plicsw.c @@ -17,8 +17,8 @@ extern struct plicsw_data plicsw; -int fdt_plicsw_cold_ipi_init(void *fdt, int nodeoff, - const struct fdt_match *match) +int fdt_plicsw_cold_ipi_init(const void *fdt, int nodeoff, + const struct fdt_match *match) { int rc; From patchwork Wed Jul 31 04:58:48 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Samuel Holland X-Patchwork-Id: 1966831 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=VlwF/Ja0; 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=mS8vh8MF; 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 4WYfzG6r2Zz20Mv for ; Wed, 31 Jul 2024 14:59:54 +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:References:In-Reply-To: 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: List-Owner; bh=ONd2txJj4ODIi3CUiB06wwhi3tr06THIkIR33PYqOok=; b=VlwF/Ja0s2JOo/ MGAfBTNf3z18iEyafK11iEVjBeB//Tp5PkLKLOmWGclS/clvkqdKBDZbiXQ8JMintuMtAjX7VI0IN oQ0Hzp7mW4CjbNHC1s9mtRASG/KKHav4YPz4ailx3MTl1iN5rQeu/gYj/VgskgBhaehc3y4GeEpFR Cud6rIAvlNd/LPbe55MR4WeUUlwrGosPXmzxq3nC7aICSOo+cSGfDdD2TWi/u/3SqHvc+Vkhde+el VnTjRBB226xa+SyXT/v6zc28i3OllNKQIf5R3sPrEYHXrmrkKHII+yzDUovbsUZnEXt1e63fHSwiI bo9JhQC/R1IqeQnSgQaQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sZ1RC-0000000HKRh-1Yjo; Wed, 31 Jul 2024 04:59:46 +0000 Received: from mail-pl1-x632.google.com ([2607:f8b0:4864:20::632]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sZ1R8-0000000HKOU-2nXC for opensbi@lists.infradead.org; Wed, 31 Jul 2024 04:59:44 +0000 Received: by mail-pl1-x632.google.com with SMTP id d9443c01a7336-1ff3d5c6e9eso10018845ad.1 for ; Tue, 30 Jul 2024 21:59:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sifive.com; s=google; t=1722401982; x=1723006782; darn=lists.infradead.org; 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=WVmrJN/eYWE/If6iqn1qNixnk0WpblyHe63xFYlHJ/Y=; b=mS8vh8MFBHdDrjFJApoSarw1RZF95+fG0injiETon7JRctqGkPTdBbeSLO7ru7r+2H Tgtr9/QWiW/3WkPxplkFsxCJx94ArWqPPkCoBQhupqhGskiKYqFXbzpJKAMBu6Z53eTG 4vblaSZiQTGqEnscIZXoXy7ICz0I8U/jKPTC1K0bY+CNlcpj5D8ao8OZojo7f/BGqwQa xsmw8w41YxrhYDAwzeK18In4z8zW1ecgq6rgf7Lj1vJ9+ba0HOrMTTNQQCGPqKHIo3jv mO8T2wG///HEcTmxN0P2eGiDxEew49RTqw0g+xKwdLPeEu+pUhegh+wIyZZhrdVB1riV R5ig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722401982; x=1723006782; 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=WVmrJN/eYWE/If6iqn1qNixnk0WpblyHe63xFYlHJ/Y=; b=KUrb0PV95AV7L7M1oQEb6asiWsoFIix21aaf6+OLhknov+nn7WijRd0/B/2Bx7c+rb 6NzhzZtEbIcojjuhcnosVp8IbhTrF+j9Y+poFCxY7fDzMakMMn0SpP/7zL1nQHgcgNYH F9xlhXwBoJihY63Bwe2y3srYpW3QQrKF9rsVNbNR8xqoaTh+rMGT4HT68qGKynh9Av1N GSQBBR3fcDjrJnY0pE91FgDyFeKSwebSzv4BATbVWTvttr06mjHdgB1kggCZgtoF2sIm a/zk5KRhsjIiliyNVygyf11RQBmQAeXOejyXVNqtnQAU7wf1nFdJtYCjBm8ZxpUGWT3B C1Gw== X-Gm-Message-State: AOJu0YxGBK0EhY/CtrQDASXBYW716MRuCJJlxgHMTADm1KegfhLyNgnN uPXiLPh/gyKyZPN1nT4mMIqHvYjLoBUyscxJEwb0e601kdX5lfyQ3Mx3MwWu7bLxxjNdCNjFy6f ujbH+aMtoAkA1YXxUV5+Zd7WbrIumvVZLMRqivB/dtaaZrKqVWC0c3vqSsPMIz7GTRb7oDsqUnV u80zM9J4Dqu2nP5UdT7BHrytBqdbBsFzUuko2F3MViIamNcpxtYLA= X-Google-Smtp-Source: AGHT+IFVsKt+s5HLZL5zeLNchXwGOIeS69caeVeTGPXUsWxtJ9ED+Lq250a6cWzrOJS23BysoQWzsQ== X-Received: by 2002:a17:902:f54d:b0:1f3:dd7:ad42 with SMTP id d9443c01a7336-1ff046ed840mr137305155ad.0.1722401981910; Tue, 30 Jul 2024 21:59:41 -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.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Jul 2024 21:59:41 -0700 (PDT) From: Samuel Holland To: opensbi@lists.infradead.org Subject: [PATCH 07/16] lib: utils/irqchip: Constify FDT pointers in parsing functions Date: Tue, 30 Jul 2024 21:58:48 -0700 Message-ID: <20240731045931.2446799-8-samuel.holland@sifive.com> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240731045931.2446799-1-samuel.holland@sifive.com> References: <20240731045931.2446799-1-samuel.holland@sifive.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240730_215942_814973_A24FCCCC X-CRM114-Status: GOOD ( 13.18 ) 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: Indicate that none of these functions modify the devicetree by constifying the parameter type. Signed-off-by: Samuel Holland --- include/sbi_utils/irqchip/fdt_irqchip.h | 2 +- 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 [...] Content analysis details: (-2.1 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:632 listed in] [list.dnswl.org] -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] 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 Indicate that none of these functions modify the devicetree by constifying the parameter type. Signed-off-by: Samuel Holland --- include/sbi_utils/irqchip/fdt_irqchip.h | 2 +- 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 ++-- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/include/sbi_utils/irqchip/fdt_irqchip.h b/include/sbi_utils/irqchip/fdt_irqchip.h index 63e9fd9e..bc02c0c8 100644 --- a/include/sbi_utils/irqchip/fdt_irqchip.h +++ b/include/sbi_utils/irqchip/fdt_irqchip.h @@ -16,7 +16,7 @@ struct fdt_irqchip { const struct fdt_match *match_table; - int (*cold_init)(void *fdt, int nodeoff, const struct fdt_match *match); + int (*cold_init)(const void *fdt, int nodeoff, const struct fdt_match *match); int (*warm_init)(void); void (*exit)(void); }; diff --git a/lib/utils/irqchip/fdt_irqchip.c b/lib/utils/irqchip/fdt_irqchip.c index c38b1d85..b4f054ae 100644 --- a/lib/utils/irqchip/fdt_irqchip.c +++ b/lib/utils/irqchip/fdt_irqchip.c @@ -53,7 +53,7 @@ static int fdt_irqchip_cold_init(void) int pos, noff, rc; struct fdt_irqchip *drv; const struct fdt_match *match; - void *fdt = fdt_get_address(); + const void *fdt = fdt_get_address(); for (pos = 0; pos < fdt_irqchip_drivers_size; pos++) { drv = fdt_irqchip_drivers[pos]; diff --git a/lib/utils/irqchip/fdt_irqchip_aplic.c b/lib/utils/irqchip/fdt_irqchip_aplic.c index 583a3e30..6eb6e085 100644 --- a/lib/utils/irqchip/fdt_irqchip_aplic.c +++ b/lib/utils/irqchip/fdt_irqchip_aplic.c @@ -22,8 +22,8 @@ static int irqchip_aplic_warm_init(void) return 0; } -static int irqchip_aplic_cold_init(void *fdt, int nodeoff, - const struct fdt_match *match) +static int irqchip_aplic_cold_init(const void *fdt, int nodeoff, + const struct fdt_match *match) { int rc; struct aplic_data *pd; diff --git a/lib/utils/irqchip/fdt_irqchip_imsic.c b/lib/utils/irqchip/fdt_irqchip_imsic.c index 4eb18545..ca62b427 100644 --- a/lib/utils/irqchip/fdt_irqchip_imsic.c +++ b/lib/utils/irqchip/fdt_irqchip_imsic.c @@ -16,7 +16,7 @@ #include #include -static int irqchip_imsic_update_hartid_table(void *fdt, int nodeoff, +static int irqchip_imsic_update_hartid_table(const void *fdt, int nodeoff, struct imsic_data *id) { const fdt32_t *val; @@ -58,8 +58,8 @@ static int irqchip_imsic_update_hartid_table(void *fdt, int nodeoff, return 0; } -static int irqchip_imsic_cold_init(void *fdt, int nodeoff, - const struct fdt_match *match) +static int irqchip_imsic_cold_init(const void *fdt, int nodeoff, + const struct fdt_match *match) { int rc; struct imsic_data *id; diff --git a/lib/utils/irqchip/fdt_irqchip_plic.c b/lib/utils/irqchip/fdt_irqchip_plic.c index 829c5ee2..a8aa4fcd 100644 --- a/lib/utils/irqchip/fdt_irqchip_plic.c +++ b/lib/utils/irqchip/fdt_irqchip_plic.c @@ -85,7 +85,7 @@ static int irqchip_plic_warm_init(void) plic_get_hart_scontext(scratch)); } -static int irqchip_plic_update_hartid_table(void *fdt, int nodeoff, +static int irqchip_plic_update_hartid_table(const void *fdt, int nodeoff, struct plic_data *pd) { const fdt32_t *val; @@ -132,7 +132,7 @@ static int irqchip_plic_update_hartid_table(void *fdt, int nodeoff, return 0; } -static int irqchip_plic_cold_init(void *fdt, int nodeoff, +static int irqchip_plic_cold_init(const void *fdt, int nodeoff, const struct fdt_match *match) { int rc; From patchwork Wed Jul 31 04:58:49 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Samuel Holland X-Patchwork-Id: 1966832 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=S+n8mNdU; 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=PyHE0AHA; 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 4WYfzJ5wRPz1ybV for ; Wed, 31 Jul 2024 14:59:56 +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:References:In-Reply-To: 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: List-Owner; bh=nRhbTDw93TLCKbJZ3flf/gmn/AMbNNmgzp+Kg6EkCBs=; b=S+n8mNdU5vlsbx 2j5silNmOlyJzb5rb8A1rHcFOJWzQEdirPE24sCw6rNEhnEQW6knXa+SDFf1vEkuaN0dph8DMLmsf Wv6HBXLUXyKmlkgQh6otY8S0GUw2nqopUdz482VPdYXKQ4LOfhV+p7mVX1xfb+GyeQDYWSJ5DvnJq 7hQAf68OdFjN8MSICvUtgGwShFadA/l67uw4iOGKbYbS5L6jDatRH+jUC43wQjhOIdG7uwr3JBMod obw+zAFWjlCZMgsAmRxR2nHAUM1df6f67cOTZrYU01Bn/07zXY2jSOjtQBmPUu1szTt8Yz2Sjm8LC 2wrBnxbs61iNQmk3IzWA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sZ1RE-0000000HKU3-3Hxy; Wed, 31 Jul 2024 04:59:48 +0000 Received: from mail-pl1-x636.google.com ([2607:f8b0:4864:20::636]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sZ1RA-0000000HKPJ-1YSA for opensbi@lists.infradead.org; Wed, 31 Jul 2024 04:59:45 +0000 Received: by mail-pl1-x636.google.com with SMTP id d9443c01a7336-1fc56fd4de1so4128435ad.0 for ; Tue, 30 Jul 2024 21:59:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sifive.com; s=google; t=1722401983; x=1723006783; darn=lists.infradead.org; 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=KADP5EbEXLhjPwJc3emEZJJqOAUTSwN3Edin1pEeiOM=; b=PyHE0AHAV5Uv1Q/d6Tgx2ca2boSDObujvYC9SbroNaD1N/7Ti92IQEkS7h6z0DQWNk mKm7BJtJn7rTYfKwSijycx5Cc4GytebZiqd4BeBjBwvPT9gAhMD+ZcMwA/99z8mLv7Tb VhGWcq/iGhEMafyrSM2E6vmHOjgHyk0lKzJWqZw9EJGWfgy8NJAzWT7m3HGN53HsasHu QxYOuLm367UbLJ0y/KDEpXTgsIsFrZND7sTsYdyRUFO+vqyA2N4OVtaugnHU7ZlBViUJ fb9EjpjvRgezYoZO8uLqh3Ru0dUKOFBC1sFbFZtGwqomoBJUNYt9UF8e8F1U3azEFOh4 b3AA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722401983; x=1723006783; 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=KADP5EbEXLhjPwJc3emEZJJqOAUTSwN3Edin1pEeiOM=; b=kqpW6YQjw2OhKB5MolPY0a1GX43kk17BaLE8hKemFa/OiH2xXc9FErLUWJsg/Yjkzk Re9EMOTxsflZh4s8KlHlP88pT4AaCqRiBmObSKnI69kDgxF04SfiAW8vQ7f181fZznLb HChMawdTWsykZYa6gC47q83/ErBlJPsrVIe4x1umIZ3Np20HI5VfkZGXrH5nQtIeRqBP CnMcACqhWggwzK4WG5AfLU4pfTx6OGY8V3fjxgK5w4ZSNFoagbGVCjGIWIUPRCatsyzP 9M/Svemm2m7aYvBUIdIXwBMXTayX+CCf3//tYTZUqhRsj3rgl3kj1LQDc5Rew8wREYC6 uc/Q== X-Gm-Message-State: AOJu0YwcNNWvkMncXXonWF4/k8ffrhXfZnv8FCQrLE/yn85Zn8hnKM2w 8OSLIyJRsHeQ5lFNrWDZy1BOy0O3NjMWhhtkTwuA2yQJRIdrnuvaum2xJ6AXtOYIBuu9pzuYvq8 onqu1EuA59BaDZviXWDij1UGTVxC7VrqxChfC1VV+FoApobdMM0ZsDRUrVPd91xKYRRarqq1OVx uk+IAQqAGPoO1IHZojH9X786ZpUXhz23WUJ/IVIF/kqvTzSnfH+NU= X-Google-Smtp-Source: AGHT+IGaEGhhY8v2O6Sle9pnD2D5j5RQwrMXbin513+tRZNvns1brduh6Gq381ZhFeHFGCYtihaLVQ== X-Received: by 2002:a17:902:ec8c:b0:1fd:a412:5df2 with SMTP id d9443c01a7336-1ff37c316abmr62948385ad.29.1722401982993; Tue, 30 Jul 2024 21:59:42 -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.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Jul 2024 21:59:42 -0700 (PDT) From: Samuel Holland To: opensbi@lists.infradead.org Subject: [PATCH 08/16] lib: utils/regmap: Constify FDT pointers in parsing functions Date: Tue, 30 Jul 2024 21:58:49 -0700 Message-ID: <20240731045931.2446799-9-samuel.holland@sifive.com> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240731045931.2446799-1-samuel.holland@sifive.com> References: <20240731045931.2446799-1-samuel.holland@sifive.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240730_215944_448095_06BF214D X-CRM114-Status: GOOD ( 12.35 ) 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: Indicate that none of these functions modify the devicetree by constifying the parameter type. Signed-off-by: Samuel Holland --- include/sbi_utils/regmap/fdt_regmap.h | 6 +++--- lib/utils/regmap/fdt_regmap.c | 8 ++++---- lib/utils/regmap/fdt_regmap_syscon.c | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) Content analysis details: (-2.1 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:636 listed in] [list.dnswl.org] -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] 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 Indicate that none of these functions modify the devicetree by constifying the parameter type. Signed-off-by: Samuel Holland --- include/sbi_utils/regmap/fdt_regmap.h | 6 +++--- lib/utils/regmap/fdt_regmap.c | 8 ++++---- lib/utils/regmap/fdt_regmap_syscon.c | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/include/sbi_utils/regmap/fdt_regmap.h b/include/sbi_utils/regmap/fdt_regmap.h index 403dd7d4..86e72442 100644 --- a/include/sbi_utils/regmap/fdt_regmap.h +++ b/include/sbi_utils/regmap/fdt_regmap.h @@ -17,15 +17,15 @@ struct fdt_phandle_args; /** FDT based regmap driver */ struct fdt_regmap { const struct fdt_match *match_table; - int (*init)(void *fdt, int nodeoff, u32 phandle, + int (*init)(const void *fdt, int nodeoff, u32 phandle, const struct fdt_match *match); }; /** Get regmap instance based on phandle */ -int fdt_regmap_get_by_phandle(void *fdt, u32 phandle, +int fdt_regmap_get_by_phandle(const void *fdt, u32 phandle, struct regmap **out_rmap); /** Get regmap instance based on "regmap" property of the specified DT node */ -int fdt_regmap_get(void *fdt, int nodeoff, struct regmap **out_rmap); +int fdt_regmap_get(const void *fdt, int nodeoff, struct regmap **out_rmap); #endif diff --git a/lib/utils/regmap/fdt_regmap.c b/lib/utils/regmap/fdt_regmap.c index fffac1de..f02d2f07 100644 --- a/lib/utils/regmap/fdt_regmap.c +++ b/lib/utils/regmap/fdt_regmap.c @@ -16,7 +16,7 @@ extern struct fdt_regmap *fdt_regmap_drivers[]; extern unsigned long fdt_regmap_drivers_size; -static int fdt_regmap_init(void *fdt, int nodeoff, u32 phandle) +static int fdt_regmap_init(const void *fdt, int nodeoff, u32 phandle) { int pos, rc; struct fdt_regmap *drv; @@ -39,7 +39,7 @@ static int fdt_regmap_init(void *fdt, int nodeoff, u32 phandle) return SBI_ENOSYS; } -static int fdt_regmap_find(void *fdt, int nodeoff, u32 phandle, +static int fdt_regmap_find(const void *fdt, int nodeoff, u32 phandle, struct regmap **out_rmap) { int rc; @@ -63,7 +63,7 @@ static int fdt_regmap_find(void *fdt, int nodeoff, u32 phandle, return 0; } -int fdt_regmap_get_by_phandle(void *fdt, u32 phandle, +int fdt_regmap_get_by_phandle(const void *fdt, u32 phandle, struct regmap **out_rmap) { int pnodeoff; @@ -78,7 +78,7 @@ int fdt_regmap_get_by_phandle(void *fdt, u32 phandle, return fdt_regmap_find(fdt, pnodeoff, phandle, out_rmap); } -int fdt_regmap_get(void *fdt, int nodeoff, struct regmap **out_rmap) +int fdt_regmap_get(const void *fdt, int nodeoff, struct regmap **out_rmap) { int len; const fdt32_t *val; diff --git a/lib/utils/regmap/fdt_regmap_syscon.c b/lib/utils/regmap/fdt_regmap_syscon.c index d87b6e09..a95f2515 100644 --- a/lib/utils/regmap/fdt_regmap_syscon.c +++ b/lib/utils/regmap/fdt_regmap_syscon.c @@ -159,7 +159,7 @@ static int regmap_syscon_write_be32(struct regmap *rmap, unsigned int reg, return 0; } -static int regmap_syscon_init(void *fdt, int nodeoff, u32 phandle, +static int regmap_syscon_init(const void *fdt, int nodeoff, u32 phandle, const struct fdt_match *match) { struct syscon_regmap *srm; From patchwork Wed Jul 31 04:58:50 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Samuel Holland X-Patchwork-Id: 1966833 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=1wpB43HK; 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=E07XH1qw; 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 4WYfzP2Pjhz1ybV for ; Wed, 31 Jul 2024 15:00:01 +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:References:In-Reply-To: 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: List-Owner; bh=KB9KkBHVPUmbVY0i+/wKoyYCxi3cnEtdncZTGRz4YgA=; b=1wpB43HK2i/FXb bohGYtrlteGles4sXb+F6OeVGi676FI9cx+hA0e5bYWDkgREF2Wy9qJboSQY3BoSlTdrvTZ3GnOQ8 2r/Ims6/CDQAdvKzbRcFTCbZ4GvfEXIODH2XkIe09xNn9H3BCw0AGbXxuHVqtKl7jwJilxAdYfv2K ggdCygG4ntq30TYBFyje+maTiHkjnHzhLnuMb1CYKG7qVYMODcMxWJ2ghOtWNMWgjZFjQ9USvkEmB ku3rvDG994GBEYSbXUa8B3zLogK1zwSlfZSHi/947INO6DBRWDw1cHvBS18mtX2ceLQgH447SgF79 XN4PXLpi7+pKuGVncq6g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sZ1RI-0000000HKY0-3X4d; Wed, 31 Jul 2024 04:59:52 +0000 Received: from mail-pg1-x533.google.com ([2607:f8b0:4864:20::533]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sZ1RB-0000000HKQ4-1iJI for opensbi@lists.infradead.org; Wed, 31 Jul 2024 04:59:48 +0000 Received: by mail-pg1-x533.google.com with SMTP id 41be03b00d2f7-7a0e8b76813so3668113a12.3 for ; Tue, 30 Jul 2024 21:59:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sifive.com; s=google; t=1722401984; x=1723006784; darn=lists.infradead.org; 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=0moazPW/lT+BCtaATUOUZ+pqjUhRyysdFJvFBiO8XtU=; b=E07XH1qwNf4UnBT/kZUf2+5aiBy2vVp760at8tLXZxagsl+xdUY/NhNS2pg/wTEQ7/ UhLze7Bd805J+TaGW2ZhN6GdrOXnapNZ8jJCVq0m6dKTtBSi4c0RTrXOA9wg+WMu8Ac3 zRT4OShHoGKESoxJCxxQW41B9qomILCLzy/bj/SCbO9wruhjQJ6tqqCtXQBNJWvJuWha vpxc4RPgCnWnQbZJpNrRWHoIO2tqEvI1dMl7FQ8CSu5uiHGNehGBmejolMB3WicQR7oM f6kVVJxIGtPvHKuZ6guCFK1YCXDEsbS2SNSZjMvA9lfbLXQrMzamUAgHerW9No/ic/1o k37Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722401984; x=1723006784; 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=0moazPW/lT+BCtaATUOUZ+pqjUhRyysdFJvFBiO8XtU=; b=qNsweDqdKukWnnIcVn6pQbfjo3K5QMYOoOjBbev3zwOoqXDryx9/qjFkVYg5BZTnB2 ustQb8T4Ly7iVoa+KfSBjK47XsgMmDGewcd3v3k7uSanL4dJZlY5welXzqpRClLVXNSq 3GQc9nRDKVn6oUarR7awuIfet/Cfup5+os2mXKlhIv0AsaWy9GKGzrEiboBFDMAT4zcJ Frt28s53ROzCXabWRnJ9faXnwUNqZSfhtR0e3Ve5tGsXdHEzE+7gxQPPvqO4nBgM/xs1 hDX9jVu4Pni9muXN8xPwISuZ50jT7Q17NLU1MWqOy/2atES0gtMsrvPJy8KRdx2+gyFC fxHA== X-Gm-Message-State: AOJu0YxkhzsNkhUgRhxpPOiZd8FoSHyzKYKktmwKUe9f/u1QcYJTL7Nq k25ulY3tZScyIj8qyxxuOxCwoytdwID5+4BoiZVv/wweYRy+JduuvjoHc370P332CgqoKNwPp5x FuPnDwVgGvTjVmB5v3GBP6SaPghtr7WPdF42nkSkISajUK/Uv2WoSQ1pPesDhO9towSPij/nmvK cRMvaytNOOXISqEcOgJgbydZMSI0E6MidoQhwoAc/k1p9K/JZmySA= X-Google-Smtp-Source: AGHT+IFbLzumJSuT60qgESgTkRLBDvCBPEGeKzFYiTa6IKIi0oo5x852HXVU95y4LZY4Okes4up+yg== X-Received: by 2002:a05:6a21:6d92:b0:1c2:9554:fd07 with SMTP id adf61e73a8af0-1c4a1178e43mr16225628637.1.1722401984141; Tue, 30 Jul 2024 21:59:44 -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.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Jul 2024 21:59:43 -0700 (PDT) From: Samuel Holland To: opensbi@lists.infradead.org Subject: [PATCH 09/16] lib: utils/reset: Constify FDT pointers in parsing functions Date: Tue, 30 Jul 2024 21:58:50 -0700 Message-ID: <20240731045931.2446799-10-samuel.holland@sifive.com> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240731045931.2446799-1-samuel.holland@sifive.com> References: <20240731045931.2446799-1-samuel.holland@sifive.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240730_215945_508067_DA1BEF95 X-CRM114-Status: GOOD ( 13.94 ) 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: Indicate that none of these functions modify the devicetree by constifying the parameter type. Signed-off-by: Samuel Holland --- include/sbi_utils/reset/fdt_reset.h | 6 +++--- lib/utils/reset/fdt_reset.c | 4 ++-- lib/utils/reset/fdt_reset_atcwdt200.c | 2 +- lib/utils/reset/fdt_reset_gpio.c | 2 +- lib/utils/reset/fdt_reset_htif [...] Content analysis details: (-2.1 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:533 listed in] [list.dnswl.org] -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] 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 Indicate that none of these functions modify the devicetree by constifying the parameter type. Signed-off-by: Samuel Holland --- include/sbi_utils/reset/fdt_reset.h | 6 +++--- lib/utils/reset/fdt_reset.c | 4 ++-- 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 ++-- platform/generic/sifive/fu740.c | 2 +- platform/generic/starfive/jh7110.c | 6 +++--- 10 files changed, 16 insertions(+), 16 deletions(-) diff --git a/include/sbi_utils/reset/fdt_reset.h b/include/sbi_utils/reset/fdt_reset.h index ea8063b8..80179873 100644 --- a/include/sbi_utils/reset/fdt_reset.h +++ b/include/sbi_utils/reset/fdt_reset.h @@ -14,7 +14,7 @@ struct fdt_reset { const struct fdt_match *match_table; - int (*init)(void *fdt, int nodeoff, const struct fdt_match *match); + int (*init)(const void *fdt, int nodeoff, const struct fdt_match *match); }; #ifdef CONFIG_FDT_RESET @@ -22,7 +22,7 @@ struct fdt_reset { /** * fdt_reset_driver_init() - initialize reset driver based on the device-tree */ -int fdt_reset_driver_init(void *fdt, struct fdt_reset *drv); +int fdt_reset_driver_init(const void *fdt, struct fdt_reset *drv); /** * fdt_reset_init() - initialize reset drivers based on the device-tree @@ -33,7 +33,7 @@ void fdt_reset_init(void); #else -static inline int fdt_reset_driver_init(void *fdt, struct fdt_reset *drv) +static inline int fdt_reset_driver_init(const void *fdt, struct fdt_reset *drv) { return 0; } diff --git a/lib/utils/reset/fdt_reset.c b/lib/utils/reset/fdt_reset.c index ee4e29a3..960c08d0 100644 --- a/lib/utils/reset/fdt_reset.c +++ b/lib/utils/reset/fdt_reset.c @@ -17,7 +17,7 @@ extern struct fdt_reset *fdt_reset_drivers[]; extern unsigned long fdt_reset_drivers_size; -int fdt_reset_driver_init(void *fdt, struct fdt_reset *drv) +int fdt_reset_driver_init(const void *fdt, struct fdt_reset *drv) { int noff, rc, cnt = 0; const struct fdt_match *match; @@ -45,7 +45,7 @@ int fdt_reset_driver_init(void *fdt, struct fdt_reset *drv) void fdt_reset_init(void) { int pos; - void *fdt = fdt_get_address(); + const void *fdt = fdt_get_address(); for (pos = 0; pos < fdt_reset_drivers_size; pos++) fdt_reset_driver_init(fdt, fdt_reset_drivers[pos]); diff --git a/lib/utils/reset/fdt_reset_atcwdt200.c b/lib/utils/reset/fdt_reset_atcwdt200.c index 03d547b9..6ef3b134 100644 --- a/lib/utils/reset/fdt_reset_atcwdt200.c +++ b/lib/utils/reset/fdt_reset_atcwdt200.c @@ -80,7 +80,7 @@ static struct sbi_system_reset_device atcwdt200_reset = { .system_reset = ae350_system_reset, }; -static int atcwdt200_reset_init(void *fdt, int nodeoff, +static int atcwdt200_reset_init(const void *fdt, int nodeoff, const struct fdt_match *match) { uint64_t reg_addr; diff --git a/lib/utils/reset/fdt_reset_gpio.c b/lib/utils/reset/fdt_reset_gpio.c index 6a908dd7..de81e2eb 100644 --- a/lib/utils/reset/fdt_reset_gpio.c +++ b/lib/utils/reset/fdt_reset_gpio.c @@ -113,7 +113,7 @@ static struct sbi_system_reset_device gpio_restart = { .system_reset = gpio_system_restart }; -static int gpio_reset_init(void *fdt, int nodeoff, +static int gpio_reset_init(const void *fdt, int nodeoff, const struct fdt_match *match) { int rc, len; diff --git a/lib/utils/reset/fdt_reset_htif.c b/lib/utils/reset/fdt_reset_htif.c index 2cc52dda..7c04c81c 100644 --- a/lib/utils/reset/fdt_reset_htif.c +++ b/lib/utils/reset/fdt_reset_htif.c @@ -11,7 +11,7 @@ #include #include -static int htif_reset_init(void *fdt, int nodeoff, +static int htif_reset_init(const void *fdt, int nodeoff, const struct fdt_match *match) { bool custom = false; diff --git a/lib/utils/reset/fdt_reset_sg2042_hwmon_mcu.c b/lib/utils/reset/fdt_reset_sg2042_hwmon_mcu.c index 51bd74ab..368cd108 100644 --- a/lib/utils/reset/fdt_reset_sg2042_hwmon_mcu.c +++ b/lib/utils/reset/fdt_reset_sg2042_hwmon_mcu.c @@ -76,7 +76,7 @@ static int sg2042_mcu_reset_check_board(struct i2c_adapter *adap, uint32_t reg) return 0; } -static int sg2042_mcu_reset_init(void *fdt, int nodeoff, +static int sg2042_mcu_reset_init(const void *fdt, int nodeoff, const struct fdt_match *match) { int ret, i2c_bus; diff --git a/lib/utils/reset/fdt_reset_sunxi_wdt.c b/lib/utils/reset/fdt_reset_sunxi_wdt.c index 446d32b4..f4b06d23 100644 --- a/lib/utils/reset/fdt_reset_sunxi_wdt.c +++ b/lib/utils/reset/fdt_reset_sunxi_wdt.c @@ -49,7 +49,7 @@ static struct sbi_system_reset_device sunxi_wdt_reset = { .system_reset = sunxi_wdt_system_reset, }; -static int sunxi_wdt_reset_init(void *fdt, int nodeoff, +static int sunxi_wdt_reset_init(const void *fdt, int nodeoff, const struct fdt_match *match) { uint64_t reg_addr; diff --git a/lib/utils/reset/fdt_reset_syscon.c b/lib/utils/reset/fdt_reset_syscon.c index bae9ec58..0dd76acb 100644 --- a/lib/utils/reset/fdt_reset_syscon.c +++ b/lib/utils/reset/fdt_reset_syscon.c @@ -96,8 +96,8 @@ static struct sbi_system_reset_device syscon_reboot = { .system_reset = syscon_do_reboot }; -static int syscon_reset_init(void *fdt, int nodeoff, - const struct fdt_match *match) +static int syscon_reset_init(const void *fdt, int nodeoff, + const struct fdt_match *match) { int rc, len; const fdt32_t *val, *mask; diff --git a/platform/generic/sifive/fu740.c b/platform/generic/sifive/fu740.c index fe71ce6a..ce83a050 100644 --- a/platform/generic/sifive/fu740.c +++ b/platform/generic/sifive/fu740.c @@ -173,7 +173,7 @@ static struct sbi_system_reset_device da9063_reset_i2c = { .system_reset = da9063_system_reset }; -static int da9063_reset_init(void *fdt, int nodeoff, +static int da9063_reset_init(const void *fdt, int nodeoff, const struct fdt_match *match) { int rc, i2c_bus; diff --git a/platform/generic/starfive/jh7110.c b/platform/generic/starfive/jh7110.c index 62dcd256..560fe1d7 100644 --- a/platform/generic/starfive/jh7110.c +++ b/platform/generic/starfive/jh7110.c @@ -186,9 +186,9 @@ static struct sbi_system_reset_device pm_reset = { .system_reset = pm_system_reset }; -static int starfive_jh7110_inst_init(void *fdt); +static int starfive_jh7110_inst_init(const void *fdt); -static int pm_reset_init(void *fdt, int nodeoff, +static int pm_reset_init(const void *fdt, int nodeoff, const struct fdt_match *match) { int rc; @@ -232,7 +232,7 @@ static struct fdt_reset fdt_reset_pmic = { .init = pm_reset_init, }; -static int starfive_jh7110_inst_init(void *fdt) +static int starfive_jh7110_inst_init(const void *fdt) { int noff, rc = 0; const fdt32_t *val; From patchwork Wed Jul 31 04:58:51 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Samuel Holland X-Patchwork-Id: 1966835 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=cFp28gpp; 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=HKm5v3go; 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 4WYfzW3Mqnz1ybb for ; Wed, 31 Jul 2024 15:00:07 +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:References:In-Reply-To: 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: List-Owner; bh=d1JZDJyBjzQAXPeejxMrb9i+21FLMWa+L0MgVUFju2M=; b=cFp28gppwDicbn NOZzdh9lnH2/Y32TGctBMrgktOhOye9amoHwkGbUSX3k4LCyNnJyOXlGGjiTk3iSVH8lCzMQdaDiW E3Pwffp6CKhhU6s7GRYg5rqeb+uizGxjvzhpEcY54SlakGzeK+6IWrFh7ATrQXE4G5gJQ6CXxaU+W ZpBDTfmX0uqcDn+oG2a0wyf9pG5Cw25BgUCHnTxRO06NAlXvk09EYkQ3w4DtDY4x6H1SCPI64R4/S pqxfNTgALnAeBiZTeWwQESdCcf+u/QeM0bXo9DhnxjbC8uqneQju48xyXBjRDIBv6z91FropBRyt9 5OOtjKQhn+1dSztbZTjQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sZ1RO-0000000HKdu-2VDL; Wed, 31 Jul 2024 04:59:58 +0000 Received: from mail-pl1-x634.google.com ([2607:f8b0:4864:20::634]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sZ1RC-0000000HKRX-3GW3 for opensbi@lists.infradead.org; Wed, 31 Jul 2024 04:59:51 +0000 Received: by mail-pl1-x634.google.com with SMTP id d9443c01a7336-1fc6ee64512so36944915ad.0 for ; Tue, 30 Jul 2024 21:59:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sifive.com; s=google; t=1722401985; x=1723006785; darn=lists.infradead.org; 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=ph2V3heLI+rH7JS+P/P6nJvm6m+M+wJ08moOVPXfTLE=; b=HKm5v3goU3WEAkslyphzk7XiWgep95Qs38hJhgEWlUDhwpB7jpNbvWHVcDlGEh/h5L zxu8HIWullG3YLi446u/ivglyerwsBijnXph9YwQlzYFsOTEWl2Twlr+3I6FLVIZc5uQ uxouxGXgsCr4NUBo4AnzbCEDBNxWFmI8vIeipdjV5NDK8Vw+zlWx2g9v4v+i+c9mYWFO /9MxZiVkXuXdUPziwO65RFTxo7cuM/TJ13/fhawVjfyPzRdl2cQ3gqJY7l9WXxcQ7nL9 yVjxGJY65Ks7X+gkhIqe9TH8bEmP5DZ32Tq77DVlJ7maUJEn7AXj6yHwWipJ6d2mMVPj ZHmQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722401985; x=1723006785; 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=ph2V3heLI+rH7JS+P/P6nJvm6m+M+wJ08moOVPXfTLE=; b=tjK/ZP7Dvdn+4x3G2FCQr7i0oPwo5zB9PobaZnSGz5TkwCzCjkkEVVcsSuJUwc7N0w QbIPs261emX4Ggys8nw4OlIUqpDEeSDf5sxBDFAvUZK3ZBpuy/TUxi70xRLmeeGoOzuf KuBnmixhmi4gWiS+pJxCKt+lQQWIS/mduqLa2G9EWSY8iDzb590XuC44NFsB4lMOKO8a O+gA/FtOgKXk2QKDoqALagZAiMcoCuWYBunr3wURSbCPYKZpUZ7Jhuq+yFCbsZ2fX8Ek E8qF2jKiq+ulXrvBd14LcS1gTxsJxgqQROzBLJhV8DZsggkAVvkcnCVXQSVwl+BI9BOq GddA== X-Gm-Message-State: AOJu0YyCc3MSjzV78dLsWBjiYD9hwfA0TUQbcRcshm3KKvT8V9m/RyD+ adNp7zjSV6B0M35nHzKQ31F2UCuzKy9QTtuBGLcADBWYIAEncTo++sBfIdQBfm+0lNWhXawSWtE oF2GHKBa+2q7zwh6+XKN4TJ5WpVyo47JAjrWwqYl5x0sizHCY8y1guY3biYFB6ZrrOrDJn1aZei amV77oWUGjkc731KtuFaAjqS498wfYU5NhOlTCmzaRkVNcRoQqwqI= X-Google-Smtp-Source: AGHT+IG+ct1fwQe0Zl630DAhnI61t4yH7a8tkMoQQZECOwaXHlyuMju3BIjjnDJJwwO2dD3Hsjfvcw== X-Received: by 2002:a17:902:ec8c:b0:1f9:c508:acd5 with SMTP id d9443c01a7336-1ff047e4864mr113292475ad.5.1722401985270; Tue, 30 Jul 2024 21:59:45 -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.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Jul 2024 21:59:44 -0700 (PDT) From: Samuel Holland To: opensbi@lists.infradead.org Subject: [PATCH 10/16] lib: utils/serial: Constify FDT pointers in parsing functions Date: Tue, 30 Jul 2024 21:58:51 -0700 Message-ID: <20240731045931.2446799-11-samuel.holland@sifive.com> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240731045931.2446799-1-samuel.holland@sifive.com> References: <20240731045931.2446799-1-samuel.holland@sifive.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240730_215946_942211_A038D983 X-CRM114-Status: GOOD ( 12.99 ) 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: Indicate that none of these functions modify the devicetree by constifying the parameter type. Signed-off-by: Samuel Holland --- include/sbi_utils/serial/fdt_serial.h | 2 +- lib/utils/serial/fdt_serial.c | 2 +- lib/utils/serial/fdt_serial_cadence.c | 2 +- lib/utils/serial/fdt_serial_gaisler.c | 2 +- lib/utils/serial/fdt_serial [...] Content analysis details: (-2.1 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:634 listed in] [list.dnswl.org] -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] 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 Indicate that none of these functions modify the devicetree by constifying the parameter type. Signed-off-by: Samuel Holland --- include/sbi_utils/serial/fdt_serial.h | 2 +- lib/utils/serial/fdt_serial.c | 2 +- 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 ++-- 11 files changed, 14 insertions(+), 14 deletions(-) diff --git a/include/sbi_utils/serial/fdt_serial.h b/include/sbi_utils/serial/fdt_serial.h index daa2e4f5..a0053a16 100644 --- a/include/sbi_utils/serial/fdt_serial.h +++ b/include/sbi_utils/serial/fdt_serial.h @@ -16,7 +16,7 @@ struct fdt_serial { const struct fdt_match *match_table; - int (*init)(void *fdt, int nodeoff, const struct fdt_match *match); + int (*init)(const void *fdt, int nodeoff, const struct fdt_match *match); }; int fdt_serial_init(void); diff --git a/lib/utils/serial/fdt_serial.c b/lib/utils/serial/fdt_serial.c index 798ac749..6f995cf7 100644 --- a/lib/utils/serial/fdt_serial.c +++ b/lib/utils/serial/fdt_serial.c @@ -23,7 +23,7 @@ int fdt_serial_init(void) struct fdt_serial *drv; const struct fdt_match *match; int pos, noff = -1, len, coff, rc; - void *fdt = fdt_get_address(); + const void *fdt = fdt_get_address(); /* Find offset of node pointed to by stdout-path */ coff = fdt_path_offset(fdt, "/chosen"); diff --git a/lib/utils/serial/fdt_serial_cadence.c b/lib/utils/serial/fdt_serial_cadence.c index ae59e4c1..ee7d7797 100644 --- a/lib/utils/serial/fdt_serial_cadence.c +++ b/lib/utils/serial/fdt_serial_cadence.c @@ -10,7 +10,7 @@ #include #include -static int serial_cadence_init(void *fdt, int nodeoff, +static int serial_cadence_init(const void *fdt, int nodeoff, const struct fdt_match *match) { int rc; diff --git a/lib/utils/serial/fdt_serial_gaisler.c b/lib/utils/serial/fdt_serial_gaisler.c index 74988e34..cae1727d 100644 --- a/lib/utils/serial/fdt_serial_gaisler.c +++ b/lib/utils/serial/fdt_serial_gaisler.c @@ -11,7 +11,7 @@ #include #include -static int serial_gaisler_init(void *fdt, int nodeoff, +static int serial_gaisler_init(const void *fdt, int nodeoff, const struct fdt_match *match) { int rc; diff --git a/lib/utils/serial/fdt_serial_htif.c b/lib/utils/serial/fdt_serial_htif.c index 7d88e7a1..43557f6c 100644 --- a/lib/utils/serial/fdt_serial_htif.c +++ b/lib/utils/serial/fdt_serial_htif.c @@ -18,7 +18,7 @@ static const struct fdt_match serial_htif_match[] = { { }, }; -static int serial_htif_init(void *fdt, int nodeoff, +static int serial_htif_init(const void *fdt, int nodeoff, const struct fdt_match *match) { int rc; diff --git a/lib/utils/serial/fdt_serial_litex.c b/lib/utils/serial/fdt_serial_litex.c index 3b3b306b..9aed719f 100644 --- a/lib/utils/serial/fdt_serial_litex.c +++ b/lib/utils/serial/fdt_serial_litex.c @@ -12,7 +12,7 @@ #include #include -static int serial_litex_init(void *fdt, int nodeoff, +static int serial_litex_init(const void *fdt, int nodeoff, const struct fdt_match *match) { uint64_t reg_addr, reg_size; diff --git a/lib/utils/serial/fdt_serial_renesas_scif.c b/lib/utils/serial/fdt_serial_renesas_scif.c index c331ca1a..41356d1d 100644 --- a/lib/utils/serial/fdt_serial_renesas_scif.c +++ b/lib/utils/serial/fdt_serial_renesas_scif.c @@ -7,7 +7,7 @@ #include #include -static int serial_renesas_scif_init(void *fdt, int nodeoff, +static int serial_renesas_scif_init(const void *fdt, int nodeoff, const struct fdt_match *match) { struct platform_uart_data uart = { 0 }; diff --git a/lib/utils/serial/fdt_serial_shakti.c b/lib/utils/serial/fdt_serial_shakti.c index 0e056303..2bafc99b 100644 --- a/lib/utils/serial/fdt_serial_shakti.c +++ b/lib/utils/serial/fdt_serial_shakti.c @@ -9,8 +9,8 @@ #include #include -static int serial_shakti_init(void *fdt, int nodeoff, - const struct fdt_match *match) +static int serial_shakti_init(const void *fdt, int nodeoff, + const struct fdt_match *match) { int rc; struct platform_uart_data uart = { 0 }; diff --git a/lib/utils/serial/fdt_serial_sifive.c b/lib/utils/serial/fdt_serial_sifive.c index 3ca10913..f551b78c 100644 --- a/lib/utils/serial/fdt_serial_sifive.c +++ b/lib/utils/serial/fdt_serial_sifive.c @@ -11,8 +11,8 @@ #include #include -static int serial_sifive_init(void *fdt, int nodeoff, - const struct fdt_match *match) +static int serial_sifive_init(const void *fdt, int nodeoff, + const struct fdt_match *match) { int rc; struct platform_uart_data uart = { 0 }; diff --git a/lib/utils/serial/fdt_serial_uart8250.c b/lib/utils/serial/fdt_serial_uart8250.c index 7b5d6a4c..10d201cc 100644 --- a/lib/utils/serial/fdt_serial_uart8250.c +++ b/lib/utils/serial/fdt_serial_uart8250.c @@ -11,7 +11,7 @@ #include #include -static int serial_uart8250_init(void *fdt, int nodeoff, +static int serial_uart8250_init(const void *fdt, int nodeoff, const struct fdt_match *match) { int rc; diff --git a/lib/utils/serial/fdt_serial_xlnx_uartlite.c b/lib/utils/serial/fdt_serial_xlnx_uartlite.c index 9f04aea3..0a829ad2 100644 --- a/lib/utils/serial/fdt_serial_xlnx_uartlite.c +++ b/lib/utils/serial/fdt_serial_xlnx_uartlite.c @@ -11,8 +11,8 @@ #include #include -static int serial_xlnx_uartlite_init(void *fdt, int nodeoff, - const struct fdt_match *match) +static int serial_xlnx_uartlite_init(const void *fdt, int nodeoff, + const struct fdt_match *match) { int rc; struct platform_uart_data uart = { 0 }; From patchwork Wed Jul 31 04:58:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Samuel Holland X-Patchwork-Id: 1966834 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=39anOMpn; 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=GXkFsMcJ; 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 4WYfzT5LHDz1ybV for ; Wed, 31 Jul 2024 15:00:05 +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:References:In-Reply-To: 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: List-Owner; bh=mEE/HmdF673RTVD5vI5u6dB2nODVDNJQ5jJBPdXaGi4=; b=39anOMpnvGmtRu zIuj1oDxBzfH1MsdxTBQLQs7LrLz0/ZhBJV8ZhEX8MCh9qdd3v3AuKcNfViv4KzxSVwhPiFb8/tME tQUe8Vh+wDJoCICnati/k0VRWQLDaGSX8o+nu3OTzUGnJcFPF4fpTZ/bw1HM4xUP9gOEKFpyFk+W7 4gQD9oCNbXXYoOA5vvcQdZWhN4Rjn1TeGKipzJz9lCCgbMsQLgXwLCQPpUSPsNTchteF8ipyuAKZj wFBjPQwyM+1R4116SRFStyrDmJInteaRZUXWvHEdLEA22T2Yv7hs1GVjNcsz2QL0htYHs0+c//BoJ e4Nh/tjzuoxtDurnB8MA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sZ1RM-0000000HKbq-18u4; Wed, 31 Jul 2024 04:59:56 +0000 Received: from mail-pl1-x631.google.com ([2607:f8b0:4864:20::631]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sZ1RE-0000000HKSu-1sdj for opensbi@lists.infradead.org; Wed, 31 Jul 2024 04:59:51 +0000 Received: by mail-pl1-x631.google.com with SMTP id d9443c01a7336-1fc491f9b55so40662735ad.3 for ; Tue, 30 Jul 2024 21:59:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sifive.com; s=google; t=1722401986; x=1723006786; darn=lists.infradead.org; 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=eMWq1cpxfucY8Hh/VdHxn4UyJFL2fMmjLISsNG5aVeI=; b=GXkFsMcJlx3jraCAQhJOkg9rP5krVHGLWhFQUa7kEWKnoLu7iQEXUYKQ2B2lXGQkSA lbcPEbJBs/VJFMGqFXFytkcoGaUGCE93XIVwW7kF/ah4hr8D6YqGMiIw3TbJ5BabUkMl qvr9sik7IVgMkhSui9U7cNICbLExJSwcCs1q/eSDHafUuXV8H+oh9j/MWcNpww1oBRPq 0czEjY31neE3cbEvEdfyGJP5W7rqYL5H8VSYt7msRyNj9bmjoueJl6buRu0GAgRXpq36 8xq/X+IUaFiLYsuTjq7NGQMxVpXYIVgO4fg03BmFSdKt7kOL4W4DMSkEF0mcuv6aa3Za H5Cg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722401986; x=1723006786; 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=eMWq1cpxfucY8Hh/VdHxn4UyJFL2fMmjLISsNG5aVeI=; b=pUlSO1ekotyHhe1+D3ZiECt9POSUCn+aHIbDzLTTmj6/VM8L/vPqly9+B8ZchDd0Mk +WOw2edqxYKC0Gtfx2w7i8VbNPmAHMIqYQfa/8p+6KPyJ1tRRg2XzWImHlh/pSqhMspI +syE77/5FbGzrfZiosbjwraesopzwHWMx+tpeFgLEF5BaLZanRkDZdsrqrcdZPqyfhST las6oUd6gQ5gt7S3bSHNTX3eVZbINXdaagI4vqCqv3SncylOl59TSM4ifRaJWwjvKsYs hPEQ58ajIMG/NeCgCqyyAQ0HxOoV0W/JP2w2DEL5NGAngumsCBYDhEYL9Mbty1v7pLaz CuIw== X-Gm-Message-State: AOJu0YxHREo8W47gAJZmWoyciMRY/c9LKwzdNhKhCL89ZAp/NXt6P0NW 4pOcFn21U1wLBbQaWMYzOxkxyWnXC65wdhQv07m/p1M4rBG7fKoFc9+HUuIQGUnDaprUXuflOtT morJfrwA9eiSN5M2nu5VAAA3y8uz4D3kZKzhlOrGP5dH7S/5ugiw0R/L/MrqmA5f3I9HJTctHbg FzplrNlsxMIG35NAwkDXaCIo93JNyo2e9eYWMKAl8fdlNAnffFi0w= X-Google-Smtp-Source: AGHT+IHBJIkQaxT2kE3GFBdNeDPPQvHzJvAKdUWRdamVoD3/mh8ZRy+jd7ASpkbLbW121+pLmSo6ag== X-Received: by 2002:a17:902:f54f:b0:1fb:8797:beff with SMTP id d9443c01a7336-1ff0484da96mr114125445ad.36.1722401986335; Tue, 30 Jul 2024 21:59:46 -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.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Jul 2024 21:59:46 -0700 (PDT) From: Samuel Holland To: opensbi@lists.infradead.org Subject: [PATCH 11/16] lib: utils/timer: Constify FDT pointers in parsing functions Date: Tue, 30 Jul 2024 21:58:52 -0700 Message-ID: <20240731045931.2446799-12-samuel.holland@sifive.com> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240731045931.2446799-1-samuel.holland@sifive.com> References: <20240731045931.2446799-1-samuel.holland@sifive.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240730_215948_606599_C12AD417 X-CRM114-Status: GOOD ( 12.35 ) 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: Indicate that none of these functions modify the devicetree by constifying the parameter type. Signed-off-by: Samuel Holland --- include/sbi_utils/timer/fdt_timer.h | 2 +- lib/utils/timer/fdt_timer.c | 2 +- lib/utils/timer/fdt_timer_mtimer.c | 2 +- lib/utils/timer/fdt_timer_plmt.c | 2 +- 4 files changed, 4 insertions(+), 4 del [...] Content analysis details: (-2.1 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:631 listed in] [list.dnswl.org] -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] 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 Indicate that none of these functions modify the devicetree by constifying the parameter type. Signed-off-by: Samuel Holland --- include/sbi_utils/timer/fdt_timer.h | 2 +- lib/utils/timer/fdt_timer.c | 2 +- lib/utils/timer/fdt_timer_mtimer.c | 2 +- lib/utils/timer/fdt_timer_plmt.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/sbi_utils/timer/fdt_timer.h b/include/sbi_utils/timer/fdt_timer.h index cf105fed..555ebcba 100644 --- a/include/sbi_utils/timer/fdt_timer.h +++ b/include/sbi_utils/timer/fdt_timer.h @@ -16,7 +16,7 @@ struct fdt_timer { const struct fdt_match *match_table; - int (*cold_init)(void *fdt, int nodeoff, const struct fdt_match *match); + int (*cold_init)(const void *fdt, int nodeoff, const struct fdt_match *match); int (*warm_init)(void); void (*exit)(void); }; diff --git a/lib/utils/timer/fdt_timer.c b/lib/utils/timer/fdt_timer.c index f4687304..aa0494e4 100644 --- a/lib/utils/timer/fdt_timer.c +++ b/lib/utils/timer/fdt_timer.c @@ -36,7 +36,7 @@ static int fdt_timer_cold_init(void) int pos, noff, rc; struct fdt_timer *drv; const struct fdt_match *match; - void *fdt = fdt_get_address(); + const void *fdt = fdt_get_address(); for (pos = 0; pos < fdt_timer_drivers_size; pos++) { drv = fdt_timer_drivers[pos]; diff --git a/lib/utils/timer/fdt_timer_mtimer.c b/lib/utils/timer/fdt_timer_mtimer.c index 9e27e3ab..458e8881 100644 --- a/lib/utils/timer/fdt_timer_mtimer.c +++ b/lib/utils/timer/fdt_timer_mtimer.c @@ -30,7 +30,7 @@ static SBI_LIST_HEAD(mtn_list); static struct aclint_mtimer_data *mt_reference = NULL; -static int timer_mtimer_cold_init(void *fdt, int nodeoff, +static int timer_mtimer_cold_init(const void *fdt, int nodeoff, const struct fdt_match *match) { int rc; diff --git a/lib/utils/timer/fdt_timer_plmt.c b/lib/utils/timer/fdt_timer_plmt.c index e8be91b9..88a42e2a 100644 --- a/lib/utils/timer/fdt_timer_plmt.c +++ b/lib/utils/timer/fdt_timer_plmt.c @@ -13,7 +13,7 @@ extern struct plmt_data plmt; -static int fdt_plmt_cold_timer_init(void *fdt, int nodeoff, +static int fdt_plmt_cold_timer_init(const void *fdt, int nodeoff, const struct fdt_match *match) { int rc; From patchwork Wed Jul 31 04:58:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Samuel Holland X-Patchwork-Id: 1966853 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=r6EfvTH7; 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=OwQKmv4w; 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 4WYhKb2DNgz1yYq for ; Wed, 31 Jul 2024 16:00:51 +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:References:In-Reply-To: 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: List-Owner; bh=UFviR4CC4GFWMNzKDgeOURBApnuVx2mVrUnUvqEzXRk=; b=r6EfvTH7/Ewnri RD0TK6pwrwdBWl5kvY/YoCfrln06tVW45FzhPTznpq3sNMKN1BtcZ+Kz1cQmg2/rrKXIE/SysHK+d 17BiKdqjRn+61HtTHi2Oha0qfH5f3e2/c1Co4HNAuOcSQp21jr1Yb0/U5x/wZPoFGik9efgd2g6Ld IdGyHxL5xkG+L4qs3qL+WBwXh1MfDYaHnQwKI8eyj662Gag8UHwRvgAhW7Y04iU8DZcYWbTAEVdLY Tdd4HM/mWHkXb2ArtmZ2G9p6Jg1P6nh9h7lMZNjn8rsE0MUKMt5nZdYYOQn8AOG6yo5pD3a5I46Xw zzLG+SpA0zHUdBtN/vww==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sZ2O9-0000000HRxX-0imH; Wed, 31 Jul 2024 06:00:41 +0000 Received: from mail-pl1-x635.google.com ([2607:f8b0:4864:20::635]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sZ1RF-0000000HKTi-0fhe for opensbi@lists.infradead.org; Wed, 31 Jul 2024 04:59:55 +0000 Received: by mail-pl1-x635.google.com with SMTP id d9443c01a7336-1fd65aaac27so4108505ad.1 for ; Tue, 30 Jul 2024 21:59:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sifive.com; s=google; t=1722401988; x=1723006788; darn=lists.infradead.org; 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=VPsqNFboR8t0zzKjf8PskJZwQfU9Wbi907pu7jc+CgA=; b=OwQKmv4w8vPUCy9wOpnZ75XsyAZwBt1WFF7Ym+lPrF0wC1CmPzWv8xfNuPzZY7uksP YiSAHR2IQpHl8kX7uimX4sbwrNRwjvJxn2/PFbLIKukig0gra2QOz5Uo0Ue49vVQlw8u 9ElvoPue6YZO+IsTf6HaO4oimhZFV7Gy1Y+zzwd4MTA0qANqTeVwTTJWLI08G2Tq4KXG CGRzN3QHEjhbxv85an48tV+8CGNXFfRGhwGnhH7Zbzkf4U3Yxz4n2PzO+I4lL/D/kWtR 4nXO2DGSi6tLEvIqcxVXF+ya2PMBH4nf7Sa7l6x00CrAHLF88B/LVvJKb9WYs2VlPj/B n3qA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722401988; x=1723006788; 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=VPsqNFboR8t0zzKjf8PskJZwQfU9Wbi907pu7jc+CgA=; b=gKjiskCIeU5GH1iy+O4SRq5VSqEEQo3vqo3gXNHXMFve7p50AzTF/zellBRubKRfNm ggW5ld0KptAfG1c02JzKjXd558odV5jN9FQ8lxOGKHwlrIM7tae4grJkTlZyVnxjzbzD StmYcog9fVMa0/HeE5LimnVXoAdNf0n1KEjB2wussgsr1rzL5rNL6+0TCioM7F+l6l5H iItaEhrB4udAcWvkQvShu+W+ZSNVvRnaq1D5mjfzJytX4WOXnWilZDYTWyr7TajAwe1R OAWqjuy07wH9qPeNEW0P3csQ0wEq/yf1FxjYTPSEWOF2g4qlyETqxT0aZp5BdmiqgJKV QDhA== X-Gm-Message-State: AOJu0Yzh9ipmsw19/CYAn5i7/RJRC3p511oY14BPxYlwH3ilPd8SmTon yzG2aalLSQJ2BMCZa+AO9DTUBgb6ao0i5PG0AYk+WWPWgdu68xRfSYZeIixRWTWNE0owpB+mLox r4NGmmDkaOgENvlNk/k8YObXdZDoRZdHdemgPGEcjNXKolxKwdVYQ8sZhH9/RuO5+76sQO1aa82 xo3qSu6ikNWwZJ51CzWy6zINIYt5FmD12KiZd1adb92Qi7QxaARRw= X-Google-Smtp-Source: AGHT+IHsUAu4nerBUYrLJCEPKfdVHa48ckYpDRNS/wIKcHg/uUQJunEI1dcPf7LMDSmmyR3Q/A0Tkg== X-Received: by 2002:a17:903:1250:b0:1fe:d72d:13e1 with SMTP id d9443c01a7336-1ff37c1f3d6mr62880525ad.30.1722401987400; Tue, 30 Jul 2024 21:59:47 -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.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Jul 2024 21:59:47 -0700 (PDT) From: Samuel Holland To: opensbi@lists.infradead.org Subject: [PATCH 12/16] platform: generic: Constify FDT pointers in fw_platform_init() Date: Tue, 30 Jul 2024 21:58:53 -0700 Message-ID: <20240731045931.2446799-13-samuel.holland@sifive.com> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240731045931.2446799-1-samuel.holland@sifive.com> References: <20240731045931.2446799-1-samuel.holland@sifive.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240730_215949_620596_2088638E X-CRM114-Status: GOOD ( 12.93 ) 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: Indicate that none of these functions modify the devicetree by constifying the parameter type. Signed-off-by: Samuel Holland --- platform/generic/include/platform_override.h | 2 +- platform/generic/platform.c | 6 +++--- platform/generic/starfive/jh7110.c | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) Content analysis details: (-2.1 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:635 listed in] [list.dnswl.org] -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] 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 Indicate that none of these functions modify the devicetree by constifying the parameter type. Signed-off-by: Samuel Holland --- platform/generic/include/platform_override.h | 2 +- platform/generic/platform.c | 6 +++--- platform/generic/starfive/jh7110.c | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/platform/generic/include/platform_override.h b/platform/generic/include/platform_override.h index b0585c21..bd6fdacc 100644 --- a/platform/generic/include/platform_override.h +++ b/platform/generic/include/platform_override.h @@ -29,7 +29,7 @@ struct platform_override { int (*extensions_init)(const struct fdt_match *match, struct sbi_hart_features *hfeatures); int (*pmu_init)(const struct fdt_match *match); - void (*fw_init)(void *fdt, const struct fdt_match *match); + void (*fw_init)(const void *fdt, const struct fdt_match *match); int (*vendor_ext_provider)(long funcid, struct sbi_trap_regs *regs, struct sbi_ecall_return *out, diff --git a/platform/generic/platform.c b/platform/generic/platform.c index 3470474a..4d26ae7c 100644 --- a/platform/generic/platform.c +++ b/platform/generic/platform.c @@ -36,7 +36,7 @@ extern unsigned long platform_override_modules_size; static const struct platform_override *generic_plat = NULL; static const struct fdt_match *generic_plat_match = NULL; -static void fw_platform_lookup_special(void *fdt, int root_offset) +static void fw_platform_lookup_special(const void *fdt, int root_offset) { const struct platform_override *plat; const struct fdt_match *match; @@ -81,7 +81,7 @@ static DECLARE_BITMAP(generic_coldboot_harts, SBI_HARTMASK_MAX_BITS); * according to the DT property "cold-boot-harts" in "/chosen/opensbi-config" * DT node. If there is no "cold-boot-harts" in DT, all harts will be allowed. */ -static void fw_platform_coldboot_harts_init(void *fdt) +static void fw_platform_coldboot_harts_init(const void *fdt) { int chosen_offset, config_offset, cpu_offset, len, err; u32 val32; @@ -146,7 +146,7 @@ unsigned long fw_platform_init(unsigned long arg0, unsigned long arg1, unsigned long arg4) { const char *model; - void *fdt = (void *)arg1; + const void *fdt = (void *)arg1; u32 hartid, hart_count = 0; int rc, root_offset, cpus_offset, cpu_offset, len; diff --git a/platform/generic/starfive/jh7110.c b/platform/generic/starfive/jh7110.c index 560fe1d7..48451895 100644 --- a/platform/generic/starfive/jh7110.c +++ b/platform/generic/starfive/jh7110.c @@ -298,7 +298,7 @@ static bool starfive_jh7110_cold_boot_allowed(u32 hartid, return true; } -static void starfive_jh7110_fw_init(void *fdt, const struct fdt_match *match) +static void starfive_jh7110_fw_init(const void *fdt, const struct fdt_match *match) { const fdt32_t *val; int len, coff; From patchwork Wed Jul 31 04:58:54 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Samuel Holland X-Patchwork-Id: 1966854 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=HisWnL89; 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=KkbfD+kC; 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 4WYhKc2D7Xz1yYq for ; Wed, 31 Jul 2024 16:00:52 +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:References:In-Reply-To: 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: List-Owner; bh=UiWAIPbkanIiTCR5/KE0kiW62FVKEaPl8waNIGjgcTU=; b=HisWnL89xZMSh+ p1R5I3uf8+2xWRorWQBJfKmm86pA7l7vGXPtlwlsgPq6Qur9CA/f0fGSvcj69dZS4TSve+o2rmOqk 474073ZSKgzsjhkgMtwNpksRdVYEIo2asYzD0FkjHmxKiyOA8NU03M/vy4zFQo4gWENHw6Acp+Y2g Rr8KqiUOj+1cWLkzxHM6e1hVb+o0O1b8vOBLwv5GxE+Db3Mr5y9LEaOd8Rmmyvlgh0wTZiwxM6mK5 wsbt1Iru/za9f5QhFr4uu/U1oQrGca3xxSRckseQA0NB6yk3mPgtebnclZIUd3l4NhpwOF/q+vcmK MZWDMVRnpuAZjjox4Z2A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sZ2O9-0000000HRxh-2Vjd; Wed, 31 Jul 2024 06:00:41 +0000 Received: from mail-pl1-x62b.google.com ([2607:f8b0:4864:20::62b]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sZ1RG-0000000HKUp-1Ft1 for opensbi@lists.infradead.org; Wed, 31 Jul 2024 05:00:00 +0000 Received: by mail-pl1-x62b.google.com with SMTP id d9443c01a7336-1fec34f94abso38873285ad.2 for ; Tue, 30 Jul 2024 21:59:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sifive.com; s=google; t=1722401989; x=1723006789; darn=lists.infradead.org; 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=TtRaMAlK5ohqAO0Qo4chWKt28YRYZM1PvvUhxiH/Vuk=; b=KkbfD+kCUDv7/G58MoGUVh3pJP6QixqsZK9Y1gD+ssBEpyf02hXfd5vZlCcakSXtmc qydg6TCmw6cxeE0iUZA2qLP6qy7m62702QEsBCNVOJLwrncbtE3d6GrZqjfQB8mpdWlW 5pNkfNwTXVHdGCSEIBTwGoEn17bkLP2xe0DbuF4uLqKHUrFeMyF7S4tRB3gPTNSYz4Fm 2VEXwpEU6WnB9Ks0BxkmpA7ELaYkKYRn0hbQTbSMabUEjsN9QOCzg2A1k8UcBI9eYcai FYOLzlqpwqLjqz0TUvYaCKOHF8uzmLRxSQ71W0LVZp8DL7muvxKVuugfzk5bS6c1N1w0 eTdw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722401989; x=1723006789; 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=TtRaMAlK5ohqAO0Qo4chWKt28YRYZM1PvvUhxiH/Vuk=; b=hw5l5y/5a26pzsQg3EpityxrVHjjQXzgeh7rFNZnmSd+AfmQCEPi2hVdVyTBZrRh4N 9mmdhY+Ej6PvURQCV2tZdwnMdNizuvN5thHxpTOcohouGrE/tH3r7ysO/ppGAspG/m3j /a5ZSPwJNPU/m3Vges48JibfTP8gdUIF9GkzC2URCz3GgHwAYd43XweFBWSCV9wGjXeY 6SvT+g3FpwaVk0jqIiajEmzwbEb81FYRmhCMVoKn423gy9V4iAY0gnD1+9ooCWLh5nLW Q9bT/wQQz87qmNRsWa/7smVEZogJc1lXa3LSRAFmGVv8ckNrMYG4nS+tYvezsEc8fwdK NtfA== X-Gm-Message-State: AOJu0YyP4SxUbZQt5+TDlZHTf2ottPpTCUHkrRZP1brUCP2LN/EjGcUY KIa1FklyyLO08Zj7uhHuZ9lQU1mq9ivl2OfHHoquf2mCiunisBL9zyxwT8GvEFBjMUpPPMOeC/r v4jC/VoRutX9GJ9O23KKzieJfOYmXIGorfRxm6lJekCvwE8w7c1Fk7dseEgLksSb4az4N2uXze4 nYRNOPQEydKVN+KhRdXFBPraBIsbmq3Y6waXHiQuB7PzunlaBiZi4= X-Google-Smtp-Source: AGHT+IEk/OyMV7svwgF7kVedVWb/QYUMexrGN3bpqurAgyTh8jZ2NBOHFQAu8H24sJ2AMv1PxRModg== X-Received: by 2002:a17:902:f341:b0:1fb:8a61:129d with SMTP id d9443c01a7336-1ff0492d613mr88161065ad.56.1722401988498; Tue, 30 Jul 2024 21:59:48 -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.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Jul 2024 21:59:48 -0700 (PDT) From: Samuel Holland To: opensbi@lists.infradead.org Subject: [PATCH 13/16] platform: generic: Pass FDT to early/final_init overrides Date: Tue, 30 Jul 2024 21:58:54 -0700 Message-ID: <20240731045931.2446799-14-samuel.holland@sifive.com> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240731045931.2446799-1-samuel.holland@sifive.com> References: <20240731045931.2446799-1-samuel.holland@sifive.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240730_215950_762570_43CE9551 X-CRM114-Status: GOOD ( 18.00 ) 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: Several of these override functions access the FDT blob. Explicitly indicate which callbacks are allowed to modify the FDT blob by passing the parameter as a possibly-const pointer. This also reduces [...] Content analysis details: (-2.1 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:62b listed in] [list.dnswl.org] -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] 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 Several of these override functions access the FDT blob. Explicitly indicate which callbacks are allowed to modify the FDT blob by passing the parameter as a possibly-const pointer. This also reduces code size by deduplicating the call to fdt_get_address(). Signed-off-by: Samuel Holland --- 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 | 4 ++-- platform/generic/platform.c | 9 ++++----- platform/generic/renesas/rzfive/rzfive.c | 8 +++++--- platform/generic/sifive/fu740.c | 3 +-- platform/generic/sophgo/sg2042.c | 2 +- platform/generic/starfive/jh7110.c | 4 +--- platform/generic/thead/thead-generic.c | 2 +- 11 files changed, 25 insertions(+), 29 deletions(-) diff --git a/platform/generic/allwinner/sun20i-d1.c b/platform/generic/allwinner/sun20i-d1.c index ab2eee55..9b1d5559 100644 --- a/platform/generic/allwinner/sun20i-d1.c +++ b/platform/generic/allwinner/sun20i-d1.c @@ -187,7 +187,8 @@ static const struct sbi_hsm_device sun20i_d1_ppu = { .hart_resume = sun20i_d1_hart_resume, }; -static int sun20i_d1_final_init(bool cold_boot, const struct fdt_match *match) +static int sun20i_d1_final_init(bool cold_boot, void *fdt, + const struct fdt_match *match) { if (cold_boot) { sun20i_d1_riscv_cfg_init(); diff --git a/platform/generic/andes/ae350.c b/platform/generic/andes/ae350.c index 63c10bc4..efe36927 100644 --- a/platform/generic/andes/ae350.c +++ b/platform/generic/andes/ae350.c @@ -87,12 +87,9 @@ static const struct sbi_hsm_device andes_smu = { .hart_stop = ae350_hart_stop, }; -static void ae350_hsm_device_init(void) +static void ae350_hsm_device_init(const void *fdt) { int rc; - void *fdt; - - fdt = fdt_get_address(); rc = fdt_parse_compat_addr(fdt, (uint64_t *)&smu.addr, "andestech,atcsmu"); @@ -102,10 +99,11 @@ static void ae350_hsm_device_init(void) } } -static int ae350_final_init(bool cold_boot, const struct fdt_match *match) +static int ae350_final_init(bool cold_boot, void *fdt, + const struct fdt_match *match) { if (cold_boot) - ae350_hsm_device_init(); + ae350_hsm_device_init(fdt); return 0; } diff --git a/platform/generic/andes/andes_pma.c b/platform/generic/andes/andes_pma.c index 9c37720b..035f9ec9 100644 --- a/platform/generic/andes/andes_pma.c +++ b/platform/generic/andes/andes_pma.c @@ -238,14 +238,14 @@ static int andes_fdt_reserved_memory_fixup(void *fdt, return andes_fdt_pma_resv(fdt, pma, entry, parent); } -int andes_pma_setup_regions(const struct andes_pma_region *pma_regions, +int andes_pma_setup_regions(void *fdt, + const struct andes_pma_region *pma_regions, unsigned int pma_regions_count) { unsigned long mmsc = csr_read(CSR_MMSC_CFG); unsigned int dt_populate_cnt; unsigned int i, j; unsigned long pa; - void *fdt; int ret; if (!pma_regions || !pma_regions_count) @@ -270,8 +270,6 @@ int andes_pma_setup_regions(const struct andes_pma_region *pma_regions, if (!dt_populate_cnt) return 0; - fdt = fdt_get_address(); - ret = fdt_open_into(fdt, fdt, fdt_totalsize(fdt) + (64 * dt_populate_cnt)); if (ret < 0) diff --git a/platform/generic/include/andes/andes_pma.h b/platform/generic/include/andes/andes_pma.h index 5ea12475..1bcda788 100644 --- a/platform/generic/include/andes/andes_pma.h +++ b/platform/generic/include/andes/andes_pma.h @@ -44,7 +44,8 @@ struct andes_pma_region { bool dma_default; }; -int andes_pma_setup_regions(const struct andes_pma_region *pma_regions, +int andes_pma_setup_regions(void *fdt, + const struct andes_pma_region *pma_regions, unsigned int pma_regions_count); #endif /* _ANDES_PMA_H_ */ diff --git a/platform/generic/include/platform_override.h b/platform/generic/include/platform_override.h index bd6fdacc..946fb8f7 100644 --- a/platform/generic/include/platform_override.h +++ b/platform/generic/include/platform_override.h @@ -21,8 +21,8 @@ struct platform_override { u64 (*tlbr_flush_limit)(const struct fdt_match *match); u32 (*tlb_num_entries)(const struct fdt_match *match); bool (*cold_boot_allowed)(u32 hartid, const struct fdt_match *match); - int (*early_init)(bool cold_boot, const struct fdt_match *match); - int (*final_init)(bool cold_boot, const struct fdt_match *match); + int (*early_init)(bool cold_boot, const void *fdt, const struct fdt_match *match); + int (*final_init)(bool cold_boot, void *fdt, const struct fdt_match *match); void (*early_exit)(const struct fdt_match *match); void (*final_exit)(const struct fdt_match *match); int (*fdt_fixup)(void *fdt, const struct fdt_match *match); diff --git a/platform/generic/platform.c b/platform/generic/platform.c index 4d26ae7c..6f9fb4db 100644 --- a/platform/generic/platform.c +++ b/platform/generic/platform.c @@ -221,6 +221,7 @@ static int generic_nascent_init(void) static int generic_early_init(bool cold_boot) { + const void *fdt = fdt_get_address(); int rc; if (cold_boot) { @@ -237,16 +238,16 @@ static int generic_early_init(bool cold_boot) if (!generic_plat || !generic_plat->early_init) return 0; - return generic_plat->early_init(cold_boot, generic_plat_match); + return generic_plat->early_init(cold_boot, fdt, generic_plat_match); } static int generic_final_init(bool cold_boot) { - void *fdt; + void *fdt = fdt_get_address(); int rc; if (generic_plat && generic_plat->final_init) { - rc = generic_plat->final_init(cold_boot, generic_plat_match); + rc = generic_plat->final_init(cold_boot, fdt, generic_plat_match); if (rc) return rc; } @@ -254,8 +255,6 @@ static int generic_final_init(bool cold_boot) if (!cold_boot) return 0; - fdt = fdt_get_address(); - fdt_cpu_fixup(fdt); fdt_fixups(fdt); fdt_domain_fixup(fdt); diff --git a/platform/generic/renesas/rzfive/rzfive.c b/platform/generic/renesas/rzfive/rzfive.c index 515bcd76..59084c41 100644 --- a/platform/generic/renesas/rzfive/rzfive.c +++ b/platform/generic/renesas/rzfive/rzfive.c @@ -24,13 +24,15 @@ static const struct andes_pma_region renesas_rzfive_pma_regions[] = { }, }; -static int renesas_rzfive_final_init(bool cold_boot, const struct fdt_match *match) +static int renesas_rzfive_final_init(bool cold_boot, void *fdt, + const struct fdt_match *match) { - return andes_pma_setup_regions(renesas_rzfive_pma_regions, + return andes_pma_setup_regions(fdt, renesas_rzfive_pma_regions, array_size(renesas_rzfive_pma_regions)); } -static int renesas_rzfive_early_init(bool cold_boot, const struct fdt_match *match) +static int renesas_rzfive_early_init(bool cold_boot, const void *fdt, + const struct fdt_match *match) { /* * Renesas RZ/Five RISC-V SoC has Instruction local memory and diff --git a/platform/generic/sifive/fu740.c b/platform/generic/sifive/fu740.c index ce83a050..46dc02ae 100644 --- a/platform/generic/sifive/fu740.c +++ b/platform/generic/sifive/fu740.c @@ -226,11 +226,10 @@ static u64 sifive_fu740_tlbr_flush_limit(const struct fdt_match *match) return 0; } -static int sifive_fu740_final_init(bool cold_boot, +static int sifive_fu740_final_init(bool cold_boot, void *fdt, const struct fdt_match *match) { int rc; - void *fdt = fdt_get_address(); if (cold_boot) { rc = fdt_reset_driver_init(fdt, &fdt_reset_da9063); diff --git a/platform/generic/sophgo/sg2042.c b/platform/generic/sophgo/sg2042.c index ae2d702e..eca9afb7 100644 --- a/platform/generic/sophgo/sg2042.c +++ b/platform/generic/sophgo/sg2042.c @@ -21,7 +21,7 @@ #define SOPHGO_SG2042_TIMER_SIZE 0x10000UL #define SOPHGO_SG2042_TIMER_NUM 16 -static int sophgo_sg2042_early_init(bool cold_boot, +static int sophgo_sg2042_early_init(bool cold_boot, const void *fdt, const struct fdt_match *match) { thead_register_tlb_flush_trap_handler(); diff --git a/platform/generic/starfive/jh7110.c b/platform/generic/starfive/jh7110.c index 48451895..264fe99c 100644 --- a/platform/generic/starfive/jh7110.c +++ b/platform/generic/starfive/jh7110.c @@ -277,11 +277,9 @@ err: return rc; } -static int starfive_jh7110_final_init(bool cold_boot, +static int starfive_jh7110_final_init(bool cold_boot, void *fdt, const struct fdt_match *match) { - void *fdt = fdt_get_address(); - if (cold_boot) { fdt_reset_driver_init(fdt, &fdt_reset_pmic); } diff --git a/platform/generic/thead/thead-generic.c b/platform/generic/thead/thead-generic.c index c82e0c1b..be64831c 100644 --- a/platform/generic/thead/thead-generic.c +++ b/platform/generic/thead/thead-generic.c @@ -19,7 +19,7 @@ struct thead_generic_quirks { u64 errata; }; -static int thead_generic_early_init(bool cold_boot, +static int thead_generic_early_init(bool cold_boot, const void *fdt, const struct fdt_match *match) { struct thead_generic_quirks *quirks = (void *)match->data; From patchwork Wed Jul 31 04:58:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Samuel Holland X-Patchwork-Id: 1966836 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=S9CbgkJo; 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=UMTZQudH; 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 4WYfzl08zFz1yYq for ; Wed, 31 Jul 2024 15:00:19 +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:References:In-Reply-To: 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: List-Owner; bh=Jo0skddO5tSegH/HoulkFfsct6xElukibjhmbwH1q4U=; b=S9CbgkJodIJYT4 7fdpzCTEwZi1/u6ymOVT0QOSrE/cjUJYRd4TH9WQ+5inX5xybBfnZ5FsVdIXLpW9DEE8wFe2Drlt1 +xwon3YUy73HbYv3SWaKf7sKNrr6BskZa798HzAnMmYe+VdJSbiYM8cZISBuSLFLDvaD0Rg0MEwGm lqLswJ3akXQEhZxE0xPEYRK3q+BQzdeMroprHlI0VrFHfLqCwTHLCH6x8lTgd3oHpeeZ8KR4OsmIk rxbB/sJ0pwa7KOIPIyPrjxkrHBGQD0JCR9aSqk1wTx3KpeoYN0XruH/hxHlEBO5H9+y1c3D138jnm y3DYafIigRJgAebgrtbg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sZ1RZ-0000000HKp6-36sH; Wed, 31 Jul 2024 05:00:09 +0000 Received: from mail-pl1-x629.google.com ([2607:f8b0:4864:20::629]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sZ1RH-0000000HKVi-1GwS for opensbi@lists.infradead.org; Wed, 31 Jul 2024 05:00:01 +0000 Received: by mail-pl1-x629.google.com with SMTP id d9443c01a7336-1fd70ba6a15so38120665ad.0 for ; Tue, 30 Jul 2024 21:59:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sifive.com; s=google; t=1722401990; x=1723006790; darn=lists.infradead.org; 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=AEIHrI6A4g3U+OKv62nVt2TpsU3g3N9HnycACxdEfH0=; b=UMTZQudHMjED0TLSb1LhEofTY4DtxrSme8FvCAyCxLM3rGRO5oQmuxh5JDX0LrRvGA 93Sa8XOYnR+Th5U8RnJ1q/GPNdyXpQWLiaJNPbKhZdk9Dw9TNRQT1cf+aZaljW9sj0EM XNMSCx0MSKhGkZPLp4cP6f6aZumKCVKD1aWuE/lAgBCkbvZ/2gUuPlhcmuLZCkpaGVA3 0E0RrH09H+Ap6aDx8EYjNciy9VldNfBrePFlnfLUal/PCRFwjcdBfdSLrjgtx6aQFP7K z2HTXgg+DX904bzgGUsTj3rm5Wk6G2l0MUDtUrlzW8oTGoqkAW9BUZBcGfem4XL/XOjM dLxQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722401990; x=1723006790; 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=AEIHrI6A4g3U+OKv62nVt2TpsU3g3N9HnycACxdEfH0=; b=CEKZHjTIcXhqKJMgAn65X93HN1YaJ1RHQGpWBBsfdGLxGG3DmUF/ZjAmMSEBclbXZq 2KfA9E5bv8aW15i9NUXeeAxBj+DVsfFktNM1BJQ3G7BQy01W3Ap52qf6Dmj4pVhZvLUT Xv3gioikkXGggqz5dK7gcxW6BlxjI8EHe1Pb5LFWYVxCHCdpls8272IzxeMaRTL43xY0 1MMHKEbO2P/34soLV4vTc3c1WmqtBNAQbEJfut6ZquX5ze9d+wtZtzGHKbEvPrjf57Z3 49WGHP1bI/zXqURc21HNWOa57CfzJOzC0cSvwVe2wubXQ3Qa6NQKmvvEwiFhb0Gm/f57 +DAw== X-Gm-Message-State: AOJu0Yx2xCRXcT3j06Ig5coVf6il5CkmgGJhsSMwUmQjC1+QtEYUxXXP EFhfhW0yNNG+pgFQTf/YBmI2mFCn50Xv7gYZg/GZYHow3K1l21NyBzj5NO8CgxIQVckEh4cv2oJ jXX2waT+b7HK+e9JZePis/vueLgtfAGPog907GhxtRvUgiNiPp0qOFa6YmwG3CzWOe/Vnn/fa3U 9UoD8AmLmMsEHUIzQUGvFcWIYkRaiLC20CpB+o7Bf5oKOJtu0Yqts= X-Google-Smtp-Source: AGHT+IHLtvsIBjSXsiyc58azgCe+NjJzXQpVNSEMsNp7DpZ21EVI2WO1xqhzlqXidjRDKOX+ISlOyQ== X-Received: by 2002:a17:902:e542:b0:1fb:7e13:a7cd with SMTP id d9443c01a7336-1ff04853bdfmr124329355ad.37.1722401989544; Tue, 30 Jul 2024 21:59:49 -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.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Jul 2024 21:59:49 -0700 (PDT) From: Samuel Holland To: opensbi@lists.infradead.org Subject: [PATCH 14/16] lib: utils/reset: Pass the FDT to fdt_reset_init() Date: Tue, 30 Jul 2024 21:58:55 -0700 Message-ID: <20240731045931.2446799-15-samuel.holland@sifive.com> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240731045931.2446799-1-samuel.holland@sifive.com> References: <20240731045931.2446799-1-samuel.holland@sifive.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240730_215952_135606_3219139D X-CRM114-Status: GOOD ( 12.52 ) 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: Indicate that this function does not modify the FDT blob, and deduplicate the call to fdt_get_address(). Signed-off-by: Samuel Holland --- include/sbi_utils/reset/fdt_reset.h | 4 ++-- lib/utils/reset/fdt_reset.c | 3 +-- platform/generic/platform.c | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) Content analysis details: (-2.1 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:629 listed in] [list.dnswl.org] -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] 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 Indicate that this function does not modify the FDT blob, and deduplicate the call to fdt_get_address(). Signed-off-by: Samuel Holland --- include/sbi_utils/reset/fdt_reset.h | 4 ++-- lib/utils/reset/fdt_reset.c | 3 +-- platform/generic/platform.c | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/include/sbi_utils/reset/fdt_reset.h b/include/sbi_utils/reset/fdt_reset.h index 80179873..f126fd33 100644 --- a/include/sbi_utils/reset/fdt_reset.h +++ b/include/sbi_utils/reset/fdt_reset.h @@ -29,7 +29,7 @@ int fdt_reset_driver_init(const void *fdt, struct fdt_reset *drv); * * This function shall be invoked in final init. */ -void fdt_reset_init(void); +void fdt_reset_init(const void *fdt); #else @@ -37,7 +37,7 @@ static inline int fdt_reset_driver_init(const void *fdt, struct fdt_reset *drv) { return 0; } -static inline void fdt_reset_init(void) { } +static inline void fdt_reset_init(const void *fdt) { } #endif diff --git a/lib/utils/reset/fdt_reset.c b/lib/utils/reset/fdt_reset.c index 960c08d0..05deb75e 100644 --- a/lib/utils/reset/fdt_reset.c +++ b/lib/utils/reset/fdt_reset.c @@ -42,10 +42,9 @@ int fdt_reset_driver_init(const void *fdt, struct fdt_reset *drv) return cnt > 0 ? 0 : SBI_ENODEV; } -void fdt_reset_init(void) +void fdt_reset_init(const void *fdt) { int pos; - const void *fdt = fdt_get_address(); for (pos = 0; pos < fdt_reset_drivers_size; pos++) fdt_reset_driver_init(fdt, fdt_reset_drivers[pos]); diff --git a/platform/generic/platform.c b/platform/generic/platform.c index 6f9fb4db..2850d55d 100644 --- a/platform/generic/platform.c +++ b/platform/generic/platform.c @@ -225,7 +225,7 @@ static int generic_early_init(bool cold_boot) int rc; if (cold_boot) { - fdt_reset_init(); + fdt_reset_init(fdt); if (semihosting_enabled()) rc = semihosting_init(); From patchwork Wed Jul 31 04:58:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Samuel Holland X-Patchwork-Id: 1966852 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=ZiS5WyNn; 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=Cojh/96J; 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 4WYhKW2RhWz1yYq for ; Wed, 31 Jul 2024 16:00:45 +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:References:In-Reply-To: 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: List-Owner; bh=1Wvq5iioWqqrGhpzgnPYnNDzOcxkL4iualUDHnFsM5E=; b=ZiS5WyNndNNOaB 2cdDxiq7LLTZTrq7+l6vMei8RgF3RwIoNN2Pl4BBqNEjVpVXTkwk4VfC/jzPi8hMQWVA4gCDaJDCU yLdDow+BaJ3LWHrn4tumVFhFcgF/uaJHCEKNeDq+jwfLgqYSw6rzX283Ya60Z9Bwfhuu/zZ9h+jBq jo8oAuAtFMB8Wn93aNzi8Fo0mCmeyVfRlHvc2f7fogLw5UlgnQUybTHjkhkR2qU2t5p8cA+fLd9CM gDVNELqlw5apE+OWUmLHlGKmR2e6cBN3anxdlAgk3xCKWEezbq9N3l6frSbCkSWGlSZulONZcbksX g9J9VaqAoJ+23Z4As03w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sZ2OA-0000000HRxp-05QD; Wed, 31 Jul 2024 06:00:42 +0000 Received: from mail-pl1-x629.google.com ([2607:f8b0:4864:20::629]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sZ1RH-0000000HKXC-2zlV for opensbi@lists.infradead.org; Wed, 31 Jul 2024 05:00:02 +0000 Received: by mail-pl1-x629.google.com with SMTP id d9443c01a7336-1fc6ee64512so36945415ad.0 for ; Tue, 30 Jul 2024 21:59:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sifive.com; s=google; t=1722401991; x=1723006791; darn=lists.infradead.org; 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=HiiD3EAGwi0hOBdTfRXW/ecDTL8NjMm602GbRCUpQnc=; b=Cojh/96JrEDokcRyInhGGt7Y6v4D1KO2hK7WJBKcJ1fhO2nhHuz6YupkWd59k6S77Z D5pSNfZ66VWIeUm1YzRObfZvGrcg12hEcgMbuPZcQiBisKydStRRmruBJW28vh+hHYhM h+UPZCJtbP5l+26LBPVP7T5BlolIheG58XYMhCbuVvFjXBxABgHyk+BZKKLqN2BWu94v a2e1FBjX05aLJ4FbZoWJR10GgwkXK8mA3e17KcD4Lqqa84+Bypi4vAd4C8k7XICgp6nD Wb763A2quIQw+c31j0C2tew8s1L52KHE/LUTMNJb+0sXwZMVRipZ6/5ThglYmJDfPcF2 bKKw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722401991; x=1723006791; 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=HiiD3EAGwi0hOBdTfRXW/ecDTL8NjMm602GbRCUpQnc=; b=jIBCFYdFB+Pk39+MyGDTGSagIRRzZVaQWGw2jmb6KfVH8AF79F1Hbc8EkB7NWWmMWl e32QmuvEoM93AEXYAj6/wCIGtiNwCCKRO9eS5E9LjONXBgQwo/s3hMMfe7Lwfuxmhot6 32cXC6u8XSoZ2Mw0i/BjtuR1wcdOl6Gop9IvJId5jDr90KshEIHZ7bpyWC9wJn3Zzx6Q 7jKTF4u3ak9b5F1IjLuX63IyE/Fp85Q4gDNowWovoR/IZWqfkXgMfkz67e4gPtkYUW0v WV5OEatO347nmkAo5cK2EoWn1jButMZvW/vfCutj6xorcO+E12iPrNqe9abIfNbyLR/y 7daQ== X-Gm-Message-State: AOJu0YwSNTQEjc7sZhBTJ6Pa5c306zA6uCllfbIWNSHDyZf+cPhXFXul RNcOxSg1ELPg+cUp0SSWLiHjo3tbCS2Zzd0GRO5Q+mZXfcJJJRyetJf0gwobsocHoqvJr58GUtp xHcXjacWiis3MJ/6VZZjkj7xo3iFZeNmodvcvijfTA361MrJpVoSwPe+al09aCGuTEN1KBQ112k kowMHEPYF4/qkVOAuTI0Zm+/g26yH6umcruF9x05Fn71ZnsSrS6As= X-Google-Smtp-Source: AGHT+IHCx1Bagw9naPT669BL899RpQnkdcZ6LvhHJcuE0WpHW/1RvOurN4bO2kGNzkNt4isVx5u+9A== X-Received: by 2002:a17:902:d2cd:b0:1fd:78dd:8578 with SMTP id d9443c01a7336-1ff0492d5ebmr120232985ad.55.1722401990615; Tue, 30 Jul 2024 21:59:50 -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.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Jul 2024 21:59:50 -0700 (PDT) From: Samuel Holland To: opensbi@lists.infradead.org Subject: [PATCH 15/16] lib: utils/serial: Pass the FDT to fdt_serial_init() Date: Tue, 30 Jul 2024 21:58:56 -0700 Message-ID: <20240731045931.2446799-16-samuel.holland@sifive.com> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240731045931.2446799-1-samuel.holland@sifive.com> References: <20240731045931.2446799-1-samuel.holland@sifive.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240730_215952_365519_D1125AB7 X-CRM114-Status: GOOD ( 14.09 ) 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: Indicate that this function does not modify the FDT blob, and deduplicate the call to fdt_get_address(). Signed-off-by: Samuel Holland --- include/sbi_utils/serial/fdt_serial.h | 4 ++-- lib/utils/serial/fdt_serial.c | 3 +-- platform/generic/platform.c | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) Content analysis details: (-2.1 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:629 listed in] [list.dnswl.org] -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] 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 Indicate that this function does not modify the FDT blob, and deduplicate the call to fdt_get_address(). Signed-off-by: Samuel Holland --- include/sbi_utils/serial/fdt_serial.h | 4 ++-- lib/utils/serial/fdt_serial.c | 3 +-- platform/generic/platform.c | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/include/sbi_utils/serial/fdt_serial.h b/include/sbi_utils/serial/fdt_serial.h index a0053a16..572475c9 100644 --- a/include/sbi_utils/serial/fdt_serial.h +++ b/include/sbi_utils/serial/fdt_serial.h @@ -19,11 +19,11 @@ struct fdt_serial { int (*init)(const void *fdt, int nodeoff, const struct fdt_match *match); }; -int fdt_serial_init(void); +int fdt_serial_init(const void *fdt); #else -static inline int fdt_serial_init(void) { return 0; } +static inline int fdt_serial_init(const void *fdt) { return 0; } #endif diff --git a/lib/utils/serial/fdt_serial.c b/lib/utils/serial/fdt_serial.c index 6f995cf7..a2a96cb2 100644 --- a/lib/utils/serial/fdt_serial.c +++ b/lib/utils/serial/fdt_serial.c @@ -17,13 +17,12 @@ extern struct fdt_serial *fdt_serial_drivers[]; extern unsigned long fdt_serial_drivers_size; -int fdt_serial_init(void) +int fdt_serial_init(const void *fdt) { const void *prop; struct fdt_serial *drv; const struct fdt_match *match; int pos, noff = -1, len, coff, rc; - const void *fdt = fdt_get_address(); /* Find offset of node pointed to by stdout-path */ coff = fdt_path_offset(fdt, "/chosen"); diff --git a/platform/generic/platform.c b/platform/generic/platform.c index 2850d55d..7c809b00 100644 --- a/platform/generic/platform.c +++ b/platform/generic/platform.c @@ -230,7 +230,7 @@ static int generic_early_init(bool cold_boot) if (semihosting_enabled()) rc = semihosting_init(); else - rc = fdt_serial_init(); + rc = fdt_serial_init(fdt); if (rc) return rc; } From patchwork Wed Jul 31 04:58:57 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Samuel Holland X-Patchwork-Id: 1966837 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=O7l3fsAs; 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=fhk1Xu+Q; 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 4WYfzq1FzCz1yYq for ; Wed, 31 Jul 2024 15:00:23 +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:References:In-Reply-To: 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: List-Owner; bh=eW7VagTfXu0AP7k2JWRaWP+u8+oyo3PL2k5RSLQxycQ=; b=O7l3fsAsP1uNuI 4PgMTR24J5SPiNH1InNHJ7wILmgZSDKTMs7E8ZKujbJ+cXmL12sBGUDii8EDHsRQlJ0+QIUjqXy0N QyyADOrwM6dpPSo9fOITdJXllambRFQnG/ZvgpaY/nMRGudSkgNDR2+l0Z4zNPEoM10aBPPmqLOd/ BfhYEPjekVvxAMXOHNxEPbxgn1GLfVvp6SwIywKb7ExKtPYdrIM6J7PjKHdKuWG5JE3eKh4irJes+ IhrhSgusU2AYtqqquz/iJbnpcsB4jAf85apu2RQbM0JWlV5yTXx94fJF8yYtK3miVV4m2eRHwTxRQ 49rsJ4adKPqckmci9DkQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sZ1Rf-0000000HKtu-14EY; Wed, 31 Jul 2024 05:00:15 +0000 Received: from mail-pl1-x62f.google.com ([2607:f8b0:4864:20::62f]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sZ1RJ-0000000HKYV-10H6 for opensbi@lists.infradead.org; Wed, 31 Jul 2024 05:00:06 +0000 Received: by mail-pl1-x62f.google.com with SMTP id d9443c01a7336-1fc5296e214so39853815ad.0 for ; Tue, 30 Jul 2024 21:59:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sifive.com; s=google; t=1722401992; x=1723006792; darn=lists.infradead.org; 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=TlrwlMAqKVUwZAHti3ROOp6Ja1outYZd5jjzBrsOd9g=; b=fhk1Xu+QjMUUdaLbadz5I7/eULHo7UdY26HZjLRH380vsMbhbmW+hVJV3WTNW/iHan 6nLNUCm56d+HnGiLQhiNSdbasHB9tf+dfziOoXbLuCL4twnTLYEnITn5Ymuv50HUhsKp +E7WXUZHBE6qDRk5QLQWwE6KffVq6GiMTPvNjwcnPqM/sL0+BQRygcKE6wMorQUWWn2n SnyieaMsrt0EqCgmNVy21PtMDz6A+IQAwrNUuP7hCrVRsIzK8fHcYjNQtPpEsEXgvk04 vOc4YPHXSb5icadTjTlC7ImgR7UwdgPlf+NyK7f+U/SDNNWJhO7EmDLOMmvfgMAmUdNN F6WQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722401992; x=1723006792; 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=TlrwlMAqKVUwZAHti3ROOp6Ja1outYZd5jjzBrsOd9g=; b=a0NpblLzP0cGk0mARYt+/C5SHdhgQT69o0RpKUwGJP4rx1q4WMcq6KSD/rt4w2HX8W K4eFq8fh+JzgSdC+ZlxEnucazFhQP1aIwYAW9wE+qa7pYNn+QqWy2KMHjl2IrpXDZ+DN /dHzW5S/sgQXMEVUxGvrmSWMs2mbOwl/3PEHWIcuSk1n7FT6EnPyukqI8iz4vd+fhQDY Iiris7QNYXX7yPJCjttqvXuF8ZGQf05mxNxlGxiatc6gJm/MsndMjhSrZvQVxyqnwHtf DduMEfYbmzKPRuxVTnKROmEdyy0195owJ+VT5maBn0D2jUcuV7gS6Sj5/d5caff+iMk4 5bxw== X-Gm-Message-State: AOJu0YxpMZf8B6fLL8uFLIKyuebyMQLRdAM+KURaBH8vtKnG520W30hF Hqxqq3wUWBrGTyKbqEjI8CgU1CQG5A5B1dkyIADd//oIcK435h9eYmsRqtX4YhIFVl1aE6lV3qA ebrQMcp5GzfxqWbXFmwLcrwNlRx1HXXurzPZnHNvMqYccSV6tQdA4oasvY3JEJI4vVfWLtBjUlZ gtTEVLTiBtaCI/AhyzocoWZQox1cSiTwgV6DgQyqzxZLYldWL8mYs= X-Google-Smtp-Source: AGHT+IEcq6ybxBTpaEW7Xey83LhgBQxmjUexfh9nCpSUzTc+dKE6fQqrTDBBmPJE2Sjhsc5TSu7ECg== X-Received: by 2002:a17:903:24c:b0:1fa:9c04:946a with SMTP id d9443c01a7336-1ff047dd8b3mr172516355ad.1.1722401991884; Tue, 30 Jul 2024 21:59:51 -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.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Jul 2024 21:59:51 -0700 (PDT) From: Samuel Holland To: opensbi@lists.infradead.org Subject: [PATCH 16/16] lib: utils/fdt: Add fdt_get_address_rw() helper Date: Tue, 30 Jul 2024 21:58:57 -0700 Message-ID: <20240731045931.2446799-17-samuel.holland@sifive.com> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240731045931.2446799-1-samuel.holland@sifive.com> References: <20240731045931.2446799-1-samuel.holland@sifive.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240730_215954_111037_86AD3EB5 X-CRM114-Status: GOOD ( 13.51 ) 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: Help tracking the lifecycle of the FDT blob by indicating which parts of the firmware modify it, and thus invalidate any previously-obtained offsets or pointers to data inside the blob. Signed-off-by: Samuel Holland --- Content analysis details: (-2.1 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:62f listed in] [list.dnswl.org] -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] 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 Help tracking the lifecycle of the FDT blob by indicating which parts of the firmware modify it, and thus invalidate any previously-obtained offsets or pointers to data inside the blob. Signed-off-by: Samuel Holland --- include/sbi_utils/fdt/fdt_helper.h | 7 ++++++- platform/fpga/ariane/platform.c | 2 +- platform/fpga/openpiton/platform.c | 4 ++-- platform/generic/platform.c | 4 ++-- platform/kendryte/k210/platform.c | 2 +- platform/nuclei/ux600/platform.c | 2 +- 6 files changed, 13 insertions(+), 8 deletions(-) diff --git a/include/sbi_utils/fdt/fdt_helper.h b/include/sbi_utils/fdt/fdt_helper.h index 28ae7677..7329b84c 100644 --- a/include/sbi_utils/fdt/fdt_helper.h +++ b/include/sbi_utils/fdt/fdt_helper.h @@ -114,7 +114,12 @@ int fdt_parse_plicsw_node(const void *fdt, int nodeoffset, unsigned long *plicsw int fdt_parse_compat_addr(const void *fdt, uint64_t *addr, const char *compatible); -static inline void *fdt_get_address(void) +static inline const void *fdt_get_address(void) +{ + return (const void *)root.next_arg1; +} + +static inline void *fdt_get_address_rw(void) { return (void *)root.next_arg1; } diff --git a/platform/fpga/ariane/platform.c b/platform/fpga/ariane/platform.c index 8d46d888..ec0584ab 100644 --- a/platform/fpga/ariane/platform.c +++ b/platform/fpga/ariane/platform.c @@ -87,7 +87,7 @@ static int ariane_final_init(bool cold_boot) if (!cold_boot) return 0; - fdt = fdt_get_address(); + fdt = fdt_get_address_rw(); fdt_fixups(fdt); return 0; diff --git a/platform/fpga/openpiton/platform.c b/platform/fpga/openpiton/platform.c index dd74a0c2..81cc48f4 100644 --- a/platform/fpga/openpiton/platform.c +++ b/platform/fpga/openpiton/platform.c @@ -70,7 +70,7 @@ static struct aclint_mtimer_data mtimer = { */ static int openpiton_early_init(bool cold_boot) { - void *fdt; + const void *fdt; struct platform_uart_data uart_data = { 0 }; struct plic_data plic_data; unsigned long aclint_freq; @@ -118,7 +118,7 @@ static int openpiton_final_init(bool cold_boot) if (!cold_boot) return 0; - fdt = fdt_get_address(); + fdt = fdt_get_address_rw(); fdt_fixups(fdt); return 0; diff --git a/platform/generic/platform.c b/platform/generic/platform.c index 7c809b00..52dd6e62 100644 --- a/platform/generic/platform.c +++ b/platform/generic/platform.c @@ -243,7 +243,7 @@ static int generic_early_init(bool cold_boot) static int generic_final_init(bool cold_boot) { - void *fdt = fdt_get_address(); + void *fdt = fdt_get_address_rw(); int rc; if (generic_plat && generic_plat->final_init) { @@ -314,7 +314,7 @@ static int generic_extensions_init(struct sbi_hart_features *hfeatures) static int generic_domains_init(void) { - void *fdt = fdt_get_address(); + const void *fdt = fdt_get_address(); int offset, ret; ret = fdt_domains_populate(fdt); diff --git a/platform/kendryte/k210/platform.c b/platform/kendryte/k210/platform.c index 531adcd5..2f3f7079 100644 --- a/platform/kendryte/k210/platform.c +++ b/platform/kendryte/k210/platform.c @@ -124,7 +124,7 @@ static int k210_final_init(bool cold_boot) if (!cold_boot) return 0; - fdt = fdt_get_address(); + fdt = fdt_get_address_rw(); fdt_cpu_fixup(fdt); fdt_fixups(fdt); diff --git a/platform/nuclei/ux600/platform.c b/platform/nuclei/ux600/platform.c index 2289366c..5610e7c7 100644 --- a/platform/nuclei/ux600/platform.c +++ b/platform/nuclei/ux600/platform.c @@ -181,7 +181,7 @@ static int ux600_final_init(bool cold_boot) if (!cold_boot) return 0; - fdt = fdt_get_address(); + fdt = fdt_get_address_rw(); ux600_modify_dt(fdt); return 0;