From patchwork Mon Jun 10 16:09:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Quentin Schulz X-Patchwork-Id: 1945955 X-Patchwork-Delegate: sjg@chromium.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4VycFm0B68z20Py for ; Tue, 11 Jun 2024 02:09:48 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 925978862D; Mon, 10 Jun 2024 18:09:37 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=0leil.net Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by phobos.denx.de (Postfix, from userid 109) id E7A428812B; Mon, 10 Jun 2024 18:09:35 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL,RCVD_IN_VALIDITY_CERTIFIED_BLOCKED, RCVD_IN_VALIDITY_RPBL_BLOCKED,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from smtp-bc0d.mail.infomaniak.ch (smtp-bc0d.mail.infomaniak.ch [45.157.188.13]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 11AF488621 for ; Mon, 10 Jun 2024 18:09:34 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=0leil.net Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=foss+uboot@0leil.net Received: from smtp-4-0000.mail.infomaniak.ch (smtp-4-0000.mail.infomaniak.ch [10.7.10.107]) by smtp-4-3000.mail.infomaniak.ch (Postfix) with ESMTPS id 4VycFT593FzNR8; Mon, 10 Jun 2024 18:09:33 +0200 (CEST) Received: from unknown by smtp-4-0000.mail.infomaniak.ch (Postfix) with ESMTPA id 4VycFT0f4Rz1vZ; Mon, 10 Jun 2024 18:09:33 +0200 (CEST) From: Quentin Schulz Date: Mon, 10 Jun 2024 18:09:13 +0200 Subject: [PATCH 1/4] dm: core: fix misleading debug message when matching compatible MIME-Version: 1.0 Message-Id: <20240610-misc-20240610-v1-1-6914f1725dd4@cherry.de> References: <20240610-misc-20240610-v1-0-6914f1725dd4@cherry.de> In-Reply-To: <20240610-misc-20240610-v1-0-6914f1725dd4@cherry.de> To: Simon Glass , Tom Rini , Bin Meng , Michal Simek , Ashok Reddy Soma , Dario Binacchi Cc: u-boot@lists.denx.de, Quentin Schulz X-Mailer: b4 0.14-dev-a6ee3 X-Infomaniak-Routing: alpha X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean From: Quentin Schulz A driver can have multiple compatible. When the id->compatible matches for that driver, the first compatible supported by the driver is currently returned, which gives the following confusing message: - found match at 'rk3588_syscon': 'rockchip,rk3588-sys-grf' matches 'rockchip,rk3588-pmugrf' Considering that the compatible passed in argument is necessarily the one that exactly matched to enter this code path, there's no need to do some elaborate logic, just print the driver name and the compatible passed in argument. Fixes: d3e773613b6d ("dm: core: Use U-Boot logging instead of pr_debug()") Signed-off-by: Quentin Schulz --- drivers/core/lists.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/core/lists.c b/drivers/core/lists.c index 2839a9b7371..942fe4a4e67 100644 --- a/drivers/core/lists.c +++ b/drivers/core/lists.c @@ -246,9 +246,8 @@ int lists_bind_fdt(struct udevice *parent, ofnode node, struct udevice **devp, } if (entry->of_match) - log_debug(" - found match at '%s': '%s' matches '%s'\n", - entry->name, entry->of_match->compatible, - id->compatible); + log_debug(" - found match at driver '%s' for '%s'\n", + entry->name, id->compatible); ret = device_bind_with_driver_data(parent, entry, name, id ? id->data : 0, node, &dev); From patchwork Mon Jun 10 16:09:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Quentin Schulz X-Patchwork-Id: 1945956 X-Patchwork-Delegate: sjg@chromium.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org) Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4VycFx5MDZz20Py for ; Tue, 11 Jun 2024 02:09:57 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id EEE1988629; Mon, 10 Jun 2024 18:09:39 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=0leil.net Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by phobos.denx.de (Postfix, from userid 109) id 480898863B; Mon, 10 Jun 2024 18:09:39 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL,RCVD_IN_VALIDITY_CERTIFIED_BLOCKED, RCVD_IN_VALIDITY_RPBL_BLOCKED,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from smtp-bc08.mail.infomaniak.ch (smtp-bc08.mail.infomaniak.ch [45.157.188.8]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 61EA288626 for ; Mon, 10 Jun 2024 18:09:37 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=0leil.net Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=foss+uboot@0leil.net Received: from smtp-4-0000.mail.infomaniak.ch (smtp-4-0000.mail.infomaniak.ch [10.7.10.107]) by smtp-3-3000.mail.infomaniak.ch (Postfix) with ESMTPS id 4VycFY0yZszrrR; Mon, 10 Jun 2024 18:09:37 +0200 (CEST) Received: from unknown by smtp-4-0000.mail.infomaniak.ch (Postfix) with ESMTPA id 4VycFT5hC1z1Kw; Mon, 10 Jun 2024 18:09:33 +0200 (CEST) From: Quentin Schulz Date: Mon, 10 Jun 2024 18:09:14 +0200 Subject: [PATCH 2/4] dm: core: fix signedness in debug messages MIME-Version: 1.0 Message-Id: <20240610-misc-20240610-v1-2-6914f1725dd4@cherry.de> References: <20240610-misc-20240610-v1-0-6914f1725dd4@cherry.de> In-Reply-To: <20240610-misc-20240610-v1-0-6914f1725dd4@cherry.de> To: Simon Glass , Tom Rini , Bin Meng , Michal Simek , Ashok Reddy Soma , Dario Binacchi Cc: u-boot@lists.denx.de, Quentin Schulz X-Mailer: b4 0.14-dev-a6ee3 X-Infomaniak-Routing: alpha X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean From: Quentin Schulz outp always point to an unsigned type in ofnode_read_u* functions but the format specifier is currently always using signed type. This is an issue since the signed type can only contain half of the unsigned type values above 0. However, this now breaks another usecase. Indeed, ofnode_read_s32_default is actually passing an s32 but it'll be printed as a u32 instead. But since the function is called u32, it makes more sense to have it print an unsigned value. This was discovered because arm,smc-id = <0x82000010>; on RK3588S is above the max signed value and therefore would return a negative signed decimal value instead of its proper unsigned one. Fixes: fa12dfa08a7b ("dm: core: support reading a single indexed u64 value") Fixes: 4bb7075c830c ("dm: core: support reading a single indexed u32 value") Fixes: 7e5196c409f1 ("dm: core: Add ofnode function to read a 64-bit int") Fixes: 9e51204527dc ("dm: core: Add operations on device tree references") Signed-off-by: Quentin Schulz --- drivers/core/ofnode.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/core/ofnode.c b/drivers/core/ofnode.c index 9a5eaaa4d13..9ff46460e7d 100644 --- a/drivers/core/ofnode.c +++ b/drivers/core/ofnode.c @@ -326,7 +326,7 @@ int ofnode_read_u8(ofnode node, const char *propname, u8 *outp) return -EINVAL; } *outp = *cell; - debug("%#x (%d)\n", *outp, *outp); + debug("%#x (%u)\n", *outp, *outp); return 0; } @@ -357,7 +357,7 @@ int ofnode_read_u16(ofnode node, const char *propname, u16 *outp) return -EINVAL; } *outp = be16_to_cpup(cell); - debug("%#x (%d)\n", *outp, *outp); + debug("%#x (%u)\n", *outp, *outp); return 0; } @@ -409,7 +409,7 @@ int ofnode_read_u32_index(ofnode node, const char *propname, int index, } *outp = fdt32_to_cpu(cell[index]); - debug("%#x (%d)\n", *outp, *outp); + debug("%#x (%u)\n", *outp, *outp); return 0; } @@ -439,7 +439,7 @@ int ofnode_read_u64_index(ofnode node, const char *propname, int index, } *outp = fdt64_to_cpu(cell[index]); - debug("%#llx (%lld)\n", *outp, *outp); + debug("%#llx (%llu)\n", *outp, *outp); return 0; } @@ -479,7 +479,7 @@ int ofnode_read_u64(ofnode node, const char *propname, u64 *outp) return -EINVAL; } *outp = fdt64_to_cpu(cell[0]); - debug("%#llx (%lld)\n", (unsigned long long)*outp, + debug("%#llx (%llu)\n", (unsigned long long)*outp, (unsigned long long)*outp); return 0; From patchwork Mon Jun 10 16:09:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Quentin Schulz X-Patchwork-Id: 1945958 X-Patchwork-Delegate: sjg@chromium.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4VycGN4n2Bz20V0 for ; Tue, 11 Jun 2024 02:10:20 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id B4F9688636; Mon, 10 Jun 2024 18:09:43 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=0leil.net Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by phobos.denx.de (Postfix, from userid 109) id E673F8862C; Mon, 10 Jun 2024 18:09:41 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_PASS, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from smtp-42ae.mail.infomaniak.ch (smtp-42ae.mail.infomaniak.ch [IPv6:2001:1600:4:17::42ae]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 4A62488633 for ; Mon, 10 Jun 2024 18:09:38 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=0leil.net Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=foss+uboot@0leil.net Received: from smtp-4-0000.mail.infomaniak.ch (smtp-4-0000.mail.infomaniak.ch [10.7.10.107]) by smtp-3-3000.mail.infomaniak.ch (Postfix) with ESMTPS id 4VycFY6XVmzm7d; Mon, 10 Jun 2024 18:09:37 +0200 (CEST) Received: from unknown by smtp-4-0000.mail.infomaniak.ch (Postfix) with ESMTPA id 4VycFY167Fz2wZ; Mon, 10 Jun 2024 18:09:37 +0200 (CEST) From: Quentin Schulz Date: Mon, 10 Jun 2024 18:09:15 +0200 Subject: [PATCH 3/4] dm: core: migrate debug() messages to use dm_warn MIME-Version: 1.0 Message-Id: <20240610-misc-20240610-v1-3-6914f1725dd4@cherry.de> References: <20240610-misc-20240610-v1-0-6914f1725dd4@cherry.de> In-Reply-To: <20240610-misc-20240610-v1-0-6914f1725dd4@cherry.de> To: Simon Glass , Tom Rini , Bin Meng , Michal Simek , Ashok Reddy Soma , Dario Binacchi Cc: u-boot@lists.denx.de, Quentin Schulz X-Mailer: b4 0.14-dev-a6ee3 X-Infomaniak-Routing: alpha X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean From: Quentin Schulz Prior to that, seeing the debug() messages required to enable DM_DEBUG which defines DEBUG (and then _DEBUG) which in turn makes failing assert() calls reset U-Boot which isn't necessarily what is desired. Instead, let's migrate to dm_warn which is using log_debug when unset or log_warn when set. While at it, reword the DM_DEBUG symbol in Kconfig to explain what it now actually does. Signed-off-by: Quentin Schulz --- drivers/core/device.c | 2 +- drivers/core/fdtaddr.c | 6 ++-- drivers/core/lists.c | 2 +- drivers/core/of_access.c | 50 +++++++++++++++--------------- drivers/core/of_addr.c | 40 ++++++++++++------------ drivers/core/of_extra.c | 32 +++++++++---------- drivers/core/ofnode.c | 80 ++++++++++++++++++++++++------------------------ drivers/core/regmap.c | 56 ++++++++++++++++----------------- drivers/core/root.c | 14 ++++----- drivers/core/uclass.c | 4 +-- 10 files changed, 143 insertions(+), 143 deletions(-) diff --git a/drivers/core/device.c b/drivers/core/device.c index 18e2bd02dd5..779f371b9d5 100644 --- a/drivers/core/device.c +++ b/drivers/core/device.c @@ -58,7 +58,7 @@ static int device_bind_common(struct udevice *parent, const struct driver *drv, ret = uclass_get(drv->id, &uc); if (ret) { - debug("Missing uclass for driver %s\n", drv->name); + dm_warn("Missing uclass for driver %s\n", drv->name); return ret; } diff --git a/drivers/core/fdtaddr.c b/drivers/core/fdtaddr.c index 6be8ea0c0a9..e98cc399df4 100644 --- a/drivers/core/fdtaddr.c +++ b/drivers/core/fdtaddr.c @@ -32,19 +32,19 @@ fdt_addr_t devfdt_get_addr_index(const struct udevice *dev, int index) na = fdt_address_cells(gd->fdt_blob, parent); if (na < 1) { - debug("bad #address-cells\n"); + dm_warn("bad #address-cells\n"); return FDT_ADDR_T_NONE; } ns = fdt_size_cells(gd->fdt_blob, parent); if (ns < 0) { - debug("bad #size-cells\n"); + dm_warn("bad #size-cells\n"); return FDT_ADDR_T_NONE; } reg = fdt_getprop(gd->fdt_blob, offset, "reg", &len); if (!reg || (len <= (index * sizeof(fdt32_t) * (na + ns)))) { - debug("Req index out of range\n"); + dm_warn("Req index out of range\n"); return FDT_ADDR_T_NONE; } diff --git a/drivers/core/lists.c b/drivers/core/lists.c index 942fe4a4e67..bd0ab4f16c9 100644 --- a/drivers/core/lists.c +++ b/drivers/core/lists.c @@ -144,7 +144,7 @@ int device_bind_driver_to_node(struct udevice *parent, const char *drv_name, drv = lists_driver_lookup_name(drv_name); if (!drv) { - debug("Cannot find driver '%s'\n", drv_name); + dm_warn("Cannot find driver '%s'\n", drv_name); return -ENOENT; } ret = device_bind_with_driver_data(parent, drv, dev_name, 0 /* data */, diff --git a/drivers/core/of_access.c b/drivers/core/of_access.c index 41f2e09b9c2..127d2dfc898 100644 --- a/drivers/core/of_access.c +++ b/drivers/core/of_access.c @@ -489,17 +489,17 @@ int of_read_u8(const struct device_node *np, const char *propname, u8 *outp) { const u8 *val; - debug("%s: %s: ", __func__, propname); + dm_warn("%s: %s: ", __func__, propname); if (!np) return -EINVAL; val = of_find_property_value_of_size(np, propname, sizeof(*outp)); if (IS_ERR(val)) { - debug("(not found)\n"); + dm_warn("(not found)\n"); return PTR_ERR(val); } *outp = *val; - debug("%#x (%d)\n", *outp, *outp); + dm_warn("%#x (%d)\n", *outp, *outp); return 0; } @@ -508,17 +508,17 @@ int of_read_u16(const struct device_node *np, const char *propname, u16 *outp) { const __be16 *val; - debug("%s: %s: ", __func__, propname); + dm_warn("%s: %s: ", __func__, propname); if (!np) return -EINVAL; val = of_find_property_value_of_size(np, propname, sizeof(*outp)); if (IS_ERR(val)) { - debug("(not found)\n"); + dm_warn("(not found)\n"); return PTR_ERR(val); } *outp = be16_to_cpup(val); - debug("%#x (%d)\n", *outp, *outp); + dm_warn("%#x (%d)\n", *outp, *outp); return 0; } @@ -533,14 +533,14 @@ int of_read_u32_array(const struct device_node *np, const char *propname, { const __be32 *val; - debug("%s: %s: ", __func__, propname); + dm_warn("%s: %s: ", __func__, propname); val = of_find_property_value_of_size(np, propname, sz * sizeof(*out_values)); if (IS_ERR(val)) return PTR_ERR(val); - debug("size %zd\n", sz); + dm_warn("size %zd\n", sz); while (sz--) *out_values++ = be32_to_cpup(val++); @@ -552,19 +552,19 @@ int of_read_u32_index(const struct device_node *np, const char *propname, { const __be32 *val; - debug("%s: %s: ", __func__, propname); + dm_warn("%s: %s: ", __func__, propname); if (!np) return -EINVAL; val = of_find_property_value_of_size(np, propname, sizeof(*outp) * (index + 1)); if (IS_ERR(val)) { - debug("(not found)\n"); + dm_warn("(not found)\n"); return PTR_ERR(val); } *outp = be32_to_cpup(val + index); - debug("%#x (%d)\n", *outp, *outp); + dm_warn("%#x (%d)\n", *outp, *outp); return 0; } @@ -574,20 +574,20 @@ int of_read_u64_index(const struct device_node *np, const char *propname, { const __be64 *val; - debug("%s: %s: ", __func__, propname); + dm_warn("%s: %s: ", __func__, propname); if (!np) return -EINVAL; val = of_find_property_value_of_size(np, propname, sizeof(*outp) * (index + 1)); if (IS_ERR(val)) { - debug("(not found)\n"); + dm_warn("(not found)\n"); return PTR_ERR(val); } *outp = be64_to_cpup(val + index); - debug("%#llx (%lld)\n", (unsigned long long)*outp, - (unsigned long long)*outp); + dm_warn("%#llx (%lld)\n", (unsigned long long)*outp, + (unsigned long long)*outp); return 0; } @@ -620,7 +620,7 @@ int of_property_match_string(const struct device_node *np, const char *propname, l = strnlen(p, end - p) + 1; if (p + l > end) return -EILSEQ; - debug("comparing %s with %s\n", string, p); + dm_warn("comparing %s with %s\n", string, p); if (strcmp(string, p) == 0) return i; /* Found it; return index */ } @@ -707,17 +707,17 @@ static int __of_parse_phandle_with_args(const struct device_node *np, if (cells_name || cur_index == index) { node = of_find_node_by_phandle(NULL, phandle); if (!node) { - debug("%s: could not find phandle\n", - np->full_name); + dm_warn("%s: could not find phandle\n", + np->full_name); goto err; } } if (cells_name) { if (of_read_u32(node, cells_name, &count)) { - debug("%s: could not get %s for %s\n", - np->full_name, cells_name, - node->full_name); + dm_warn("%s: could not get %s for %s\n", + np->full_name, cells_name, + node->full_name); goto err; } } else { @@ -729,8 +729,8 @@ static int __of_parse_phandle_with_args(const struct device_node *np, * remaining property data length */ if (list + count > list_end) { - debug("%s: arguments longer than property\n", - np->full_name); + dm_warn("%s: arguments longer than property\n", + np->full_name); goto err; } } @@ -825,8 +825,8 @@ static void of_alias_add(struct alias_prop *ap, struct device_node *np, strncpy(ap->stem, stem, stem_len); ap->stem[stem_len] = 0; list_add_tail(&ap->link, &aliases_lookup); - debug("adding DT alias:%s: stem=%s id=%i node=%s\n", - ap->alias, ap->stem, ap->id, of_node_full_name(np)); + dm_warn("adding DT alias:%s: stem=%s id=%i node=%s\n", + ap->alias, ap->stem, ap->id, of_node_full_name(np)); } int of_alias_scan(void) diff --git a/drivers/core/of_addr.c b/drivers/core/of_addr.c index d7913ab3d2f..76e0ed2f57f 100644 --- a/drivers/core/of_addr.c +++ b/drivers/core/of_addr.c @@ -26,7 +26,7 @@ static struct of_bus *of_match_bus(struct device_node *np); #ifdef DEBUG static void of_dump_addr(const char *s, const __be32 *addr, int na) { - debug("%s", s); + dm_warn("%s", s); while (na--) pr_cont(" %08x", be32_to_cpu(*(addr++))); pr_cont("\n"); @@ -65,9 +65,9 @@ static u64 of_bus_default_map(__be32 *addr, const __be32 *range, s = of_read_number(range + na + pna, ns); da = of_read_number(addr, na); - debug("default map, cp=%llx, s=%llx, da=%llx\n", - (unsigned long long)cp, (unsigned long long)s, - (unsigned long long)da); + dm_warn("default map, cp=%llx, s=%llx, da=%llx\n", + (unsigned long long)cp, (unsigned long long)s, + (unsigned long long)da); if (da < cp || da >= (cp + s)) return OF_BAD_ADDR; @@ -193,17 +193,17 @@ static int of_translate_one(const struct device_node *parent, ranges = of_get_property(parent, rprop, &rlen); if (ranges == NULL && !of_empty_ranges_quirk(parent) && strcmp(rprop, "dma-ranges")) { - debug("no ranges; cannot translate\n"); + dm_warn("no ranges; cannot translate\n"); return 1; } if (ranges == NULL || rlen == 0) { offset = of_read_number(addr, na); memset(addr, 0, pna * 4); - debug("empty ranges; 1:1 translation\n"); + dm_warn("empty ranges; 1:1 translation\n"); goto finish; } - debug("walking ranges...\n"); + dm_warn("walking ranges...\n"); /* Now walk through the ranges */ rlen /= 4; @@ -214,14 +214,14 @@ static int of_translate_one(const struct device_node *parent, break; } if (offset == OF_BAD_ADDR) { - debug("not found !\n"); + dm_warn("not found !\n"); return 1; } memcpy(addr, ranges + na, 4 * pna); finish: of_dump_addr("parent translation for:", addr, pna); - debug("with offset: %llx\n", (unsigned long long)offset); + dm_warn("with offset: %llx\n", (unsigned long long)offset); /* Translate it into parent bus space */ return pbus->translate(addr, offset, pna); @@ -246,7 +246,7 @@ static u64 __of_translate_address(const struct device_node *dev, int na, ns, pna, pns; u64 result = OF_BAD_ADDR; - debug("** translation for device %s **\n", of_node_full_name(dev)); + dm_warn("** translation for device %s **\n", of_node_full_name(dev)); /* Increase refcount at current level */ (void)of_node_get(dev); @@ -260,13 +260,13 @@ static u64 __of_translate_address(const struct device_node *dev, /* Count address cells & copy address locally */ bus->count_cells(dev, &na, &ns); if (!OF_CHECK_COUNTS(na, ns)) { - debug("Bad cell count for %s\n", of_node_full_name(dev)); + dm_warn("Bad cell count for %s\n", of_node_full_name(dev)); goto bail; } memcpy(addr, in_addr, na * 4); - debug("bus is %s (na=%d, ns=%d) on %s\n", bus->name, na, ns, - of_node_full_name(parent)); + dm_warn("bus is %s (na=%d, ns=%d) on %s\n", bus->name, na, ns, + of_node_full_name(parent)); of_dump_addr("translating address:", addr, na); /* Translate */ @@ -278,7 +278,7 @@ static u64 __of_translate_address(const struct device_node *dev, /* If root, we have finished */ if (parent == NULL) { - debug("reached root node\n"); + dm_warn("reached root node\n"); result = of_read_number(addr, na); break; } @@ -287,13 +287,13 @@ static u64 __of_translate_address(const struct device_node *dev, pbus = of_match_bus(parent); pbus->count_cells(dev, &pna, &pns); if (!OF_CHECK_COUNTS(pna, pns)) { - debug("Bad cell count for %s\n", - of_node_full_name(dev)); + dm_warn("Bad cell count for %s\n", + of_node_full_name(dev)); break; } - debug("parent bus is %s (na=%d, ns=%d) on %s\n", pbus->name, - pna, pns, of_node_full_name(parent)); + dm_warn("parent bus is %s (na=%d, ns=%d) on %s\n", pbus->name, + pna, pns, of_node_full_name(parent)); /* Apply bus translation */ if (of_translate_one(dev, bus, pbus, addr, na, ns, pna, rprop)) @@ -358,8 +358,8 @@ int of_get_dma_range(const struct device_node *dev, phys_addr_t *cpu, } if (!dev || !ranges) { - debug("no dma-ranges found for node %s\n", - of_node_full_name(dev)); + dm_warn("no dma-ranges found for node %s\n", + of_node_full_name(dev)); ret = -ENOENT; goto out; } diff --git a/drivers/core/of_extra.c b/drivers/core/of_extra.c index a3ebe9e9c24..24c699a9f8d 100644 --- a/drivers/core/of_extra.c +++ b/drivers/core/of_extra.c @@ -16,13 +16,13 @@ int ofnode_read_fmap_entry(ofnode node, struct fmap_entry *entry) ofnode subnode; if (ofnode_read_u32(node, "image-pos", &entry->offset)) { - debug("Node '%s' has bad/missing 'image-pos' property\n", - ofnode_get_name(node)); + dm_warn("Node '%s' has bad/missing 'image-pos' property\n", + ofnode_get_name(node)); return log_msg_ret("image-pos", -ENOENT); } if (ofnode_read_u32(node, "size", &entry->length)) { - debug("Node '%s' has bad/missing 'size' property\n", - ofnode_get_name(node)); + dm_warn("Node '%s' has bad/missing 'size' property\n", + ofnode_get_name(node)); return log_msg_ret("size", -ENOENT); } entry->used = ofnode_read_s32_default(node, "used", entry->length); @@ -57,17 +57,17 @@ int ofnode_decode_region(ofnode node, const char *prop_name, fdt_addr_t *basep, const fdt_addr_t *cell; int len; - debug("%s: %s: %s\n", __func__, ofnode_get_name(node), prop_name); + dm_warn("%s: %s: %s\n", __func__, ofnode_get_name(node), prop_name); cell = ofnode_get_property(node, prop_name, &len); if (!cell || (len < sizeof(fdt_addr_t) * 2)) { - debug("cell=%p, len=%d\n", cell, len); + dm_warn("cell=%p, len=%d\n", cell, len); return -1; } *basep = fdt_addr_to_cpu(*cell); *sizep = fdt_size_to_cpu(cell[1]); - debug("%s: base=%08lx, size=%lx\n", __func__, (ulong)*basep, - (ulong)*sizep); + dm_warn("%s: base=%08lx, size=%lx\n", __func__, (ulong)*basep, + (ulong)*sizep); return 0; } @@ -85,7 +85,7 @@ int ofnode_decode_memory_region(ofnode config_node, const char *mem_type, if (!ofnode_valid(config_node)) { config_node = ofnode_path("/config"); if (!ofnode_valid(config_node)) { - debug("%s: Cannot find /config node\n", __func__); + dm_warn("%s: Cannot find /config node\n", __func__); return -ENOENT; } } @@ -96,14 +96,14 @@ int ofnode_decode_memory_region(ofnode config_node, const char *mem_type, suffix); mem = ofnode_read_string(config_node, prop_name); if (!mem) { - debug("%s: No memory type for '%s', using /memory\n", __func__, - prop_name); + dm_warn("%s: No memory type for '%s', using /memory\n", __func__, + prop_name); mem = "/memory"; } node = ofnode_path(mem); if (!ofnode_valid(node)) { - debug("%s: Failed to find node '%s'\n", __func__, mem); + dm_warn("%s: Failed to find node '%s'\n", __func__, mem); return -ENOENT; } @@ -112,8 +112,8 @@ int ofnode_decode_memory_region(ofnode config_node, const char *mem_type, * use the first */ if (ofnode_decode_region(node, "reg", &base, &size)) { - debug("%s: Failed to decode memory region %s\n", __func__, - mem); + dm_warn("%s: Failed to decode memory region %s\n", __func__, + mem); return -EINVAL; } @@ -121,8 +121,8 @@ int ofnode_decode_memory_region(ofnode config_node, const char *mem_type, suffix); if (ofnode_decode_region(config_node, prop_name, &offset, &offset_size)) { - debug("%s: Failed to decode memory region '%s'\n", __func__, - prop_name); + dm_warn("%s: Failed to decode memory region '%s'\n", __func__, + prop_name); return -EINVAL; } diff --git a/drivers/core/ofnode.c b/drivers/core/ofnode.c index 9ff46460e7d..855bcbcec27 100644 --- a/drivers/core/ofnode.c +++ b/drivers/core/ofnode.c @@ -314,7 +314,7 @@ int ofnode_read_u8(ofnode node, const char *propname, u8 *outp) int len; assert(ofnode_valid(node)); - debug("%s: %s: ", __func__, propname); + dm_warn("%s: %s: ", __func__, propname); if (ofnode_is_np(node)) return of_read_u8(ofnode_to_np(node), propname, outp); @@ -322,11 +322,11 @@ int ofnode_read_u8(ofnode node, const char *propname, u8 *outp) cell = fdt_getprop(gd->fdt_blob, ofnode_to_offset(node), propname, &len); if (!cell || len < sizeof(*cell)) { - debug("(not found)\n"); + dm_warn("(not found)\n"); return -EINVAL; } *outp = *cell; - debug("%#x (%u)\n", *outp, *outp); + dm_warn("%#x (%u)\n", *outp, *outp); return 0; } @@ -345,7 +345,7 @@ int ofnode_read_u16(ofnode node, const char *propname, u16 *outp) int len; assert(ofnode_valid(node)); - debug("%s: %s: ", __func__, propname); + dm_warn("%s: %s: ", __func__, propname); if (ofnode_is_np(node)) return of_read_u16(ofnode_to_np(node), propname, outp); @@ -353,11 +353,11 @@ int ofnode_read_u16(ofnode node, const char *propname, u16 *outp) cell = fdt_getprop(gd->fdt_blob, ofnode_to_offset(node), propname, &len); if (!cell || len < sizeof(*cell)) { - debug("(not found)\n"); + dm_warn("(not found)\n"); return -EINVAL; } *outp = be16_to_cpup(cell); - debug("%#x (%u)\n", *outp, *outp); + dm_warn("%#x (%u)\n", *outp, *outp); return 0; } @@ -390,7 +390,7 @@ int ofnode_read_u32_index(ofnode node, const char *propname, int index, int len; assert(ofnode_valid(node)); - debug("%s: %s: ", __func__, propname); + dm_warn("%s: %s: ", __func__, propname); if (ofnode_is_np(node)) return of_read_u32_index(ofnode_to_np(node), propname, index, @@ -399,17 +399,17 @@ int ofnode_read_u32_index(ofnode node, const char *propname, int index, cell = fdt_getprop(ofnode_to_fdt(node), ofnode_to_offset(node), propname, &len); if (!cell) { - debug("(not found)\n"); + dm_warn("(not found)\n"); return -EINVAL; } if (len < (sizeof(int) * (index + 1))) { - debug("(not large enough)\n"); + dm_warn("(not large enough)\n"); return -EOVERFLOW; } *outp = fdt32_to_cpu(cell[index]); - debug("%#x (%u)\n", *outp, *outp); + dm_warn("%#x (%u)\n", *outp, *outp); return 0; } @@ -429,17 +429,17 @@ int ofnode_read_u64_index(ofnode node, const char *propname, int index, cell = fdt_getprop(ofnode_to_fdt(node), ofnode_to_offset(node), propname, &len); if (!cell) { - debug("(not found)\n"); + dm_warn("(not found)\n"); return -EINVAL; } if (len < (sizeof(u64) * (index + 1))) { - debug("(not large enough)\n"); + dm_warn("(not large enough)\n"); return -EOVERFLOW; } *outp = fdt64_to_cpu(cell[index]); - debug("%#llx (%llu)\n", *outp, *outp); + dm_warn("%#llx (%llu)\n", *outp, *outp); return 0; } @@ -467,7 +467,7 @@ int ofnode_read_u64(ofnode node, const char *propname, u64 *outp) int len; assert(ofnode_valid(node)); - debug("%s: %s: ", __func__, propname); + dm_warn("%s: %s: ", __func__, propname); if (ofnode_is_np(node)) return of_read_u64(ofnode_to_np(node), propname, outp); @@ -475,12 +475,12 @@ int ofnode_read_u64(ofnode node, const char *propname, u64 *outp) cell = fdt_getprop(ofnode_to_fdt(node), ofnode_to_offset(node), propname, &len); if (!cell || len < sizeof(*cell)) { - debug("(not found)\n"); + dm_warn("(not found)\n"); return -EINVAL; } *outp = fdt64_to_cpu(cell[0]); - debug("%#llx (%llu)\n", (unsigned long long)*outp, - (unsigned long long)*outp); + dm_warn("%#llx (%llu)\n", (unsigned long long)*outp, + (unsigned long long)*outp); return 0; } @@ -498,11 +498,11 @@ bool ofnode_read_bool(ofnode node, const char *propname) bool prop; assert(ofnode_valid(node)); - debug("%s: %s: ", __func__, propname); + dm_warn("%s: %s: ", __func__, propname); prop = ofnode_has_property(node, propname); - debug("%s\n", prop ? "true" : "false"); + dm_warn("%s\n", prop ? "true" : "false"); return prop ? true : false; } @@ -513,7 +513,7 @@ const void *ofnode_read_prop(ofnode node, const char *propname, int *sizep) int len; assert(ofnode_valid(node)); - debug("%s: %s: ", __func__, propname); + dm_warn("%s: %s: ", __func__, propname); if (ofnode_is_np(node)) { struct property *prop = of_find_property( @@ -528,7 +528,7 @@ const void *ofnode_read_prop(ofnode node, const char *propname, int *sizep) propname, &len); } if (!val) { - debug("\n"); + dm_warn("\n"); if (sizep) *sizep = -FDT_ERR_NOTFOUND; return NULL; @@ -549,10 +549,10 @@ const char *ofnode_read_string(ofnode node, const char *propname) return NULL; if (strnlen(str, len) >= len) { - debug("\n"); + dm_warn("\n"); return NULL; } - debug("%s\n", str); + dm_warn("%s\n", str); return str; } @@ -572,7 +572,7 @@ ofnode ofnode_find_subnode(ofnode node, const char *subnode_name) ofnode subnode; assert(ofnode_valid(node)); - debug("%s: %s: ", __func__, subnode_name); + dm_warn("%s: %s: ", __func__, subnode_name); if (ofnode_is_np(node)) { struct device_node *np = ofnode_to_np(node); @@ -587,8 +587,8 @@ ofnode ofnode_find_subnode(ofnode node, const char *subnode_name) ofnode_to_offset(node), subnode_name); subnode = noffset_to_ofnode(node, ooffset); } - debug("%s\n", ofnode_valid(subnode) ? - ofnode_get_name(subnode) : ""); + dm_warn("%s\n", ofnode_valid(subnode) ? + ofnode_get_name(subnode) : ""); return subnode; } @@ -597,7 +597,7 @@ int ofnode_read_u32_array(ofnode node, const char *propname, u32 *out_values, size_t sz) { assert(ofnode_valid(node)); - debug("%s: %s: ", __func__, propname); + dm_warn("%s: %s: ", __func__, propname); if (ofnode_is_np(node)) { return of_read_u32_array(ofnode_to_np(node), propname, @@ -669,7 +669,7 @@ ofnode ofnode_get_parent(ofnode node) const char *ofnode_get_name(ofnode node) { if (!ofnode_valid(node)) { - debug("%s node not valid\n", __func__); + dm_warn("%s node not valid\n", __func__); return NULL; } @@ -1030,7 +1030,7 @@ ofnode ofnode_get_aliases_node(const char *name) if (!prop) return ofnode_null(); - debug("%s: node_path: %s\n", __func__, prop); + dm_warn("%s: node_path: %s\n", __func__, prop); return ofnode_path(prop); } @@ -1053,8 +1053,8 @@ static int decode_timing_property(ofnode node, const char *name, length = ofnode_read_size(node, name); if (length < 0) { - debug("%s: could not find property %s\n", - ofnode_get_name(node), name); + dm_warn("%s: could not find property %s\n", + ofnode_get_name(node), name); return length; } @@ -1299,7 +1299,7 @@ int ofnode_read_pci_addr(ofnode node, enum fdt_pci_space type, int len; int ret = -ENOENT; - debug("%s: %s: ", __func__, propname); + dm_warn("%s: %s: ", __func__, propname); /* * If we follow the pci bus bindings strictly, we should check @@ -1316,8 +1316,8 @@ int ofnode_read_pci_addr(ofnode node, enum fdt_pci_space type, int i; for (i = 0; i < num; i++) { - debug("pci address #%d: %08lx %08lx %08lx\n", i, - (ulong)fdt32_to_cpu(cell[0]), + dm_warn("pci address #%d: %08lx %08lx %08lx\n", i, + (ulong)fdt32_to_cpu(cell[0]), (ulong)fdt32_to_cpu(cell[1]), (ulong)fdt32_to_cpu(cell[2])); if ((fdt32_to_cpu(*cell) & type) == type) { @@ -1346,7 +1346,7 @@ int ofnode_read_pci_addr(ofnode node, enum fdt_pci_space type, ret = -EINVAL; fail: - debug("(not found)\n"); + dm_warn("(not found)\n"); return ret; } @@ -1630,7 +1630,7 @@ int ofnode_write_string(ofnode node, const char *propname, const char *value) { assert(ofnode_valid(node)); - debug("%s: %s = %s", __func__, propname, value); + dm_warn("%s: %s = %s", __func__, propname, value); return ofnode_write_prop(node, propname, value, strlen(value) + 1, false); @@ -1743,7 +1743,7 @@ int ofnode_read_bootscript_address(u64 *bootscr_address, u64 *bootscr_offset) uboot = ofnode_path("/options/u-boot"); if (!ofnode_valid(uboot)) { - debug("%s: Missing /u-boot node\n", __func__); + dm_warn("%s: Missing /u-boot node\n", __func__); return -EINVAL; } @@ -1769,7 +1769,7 @@ int ofnode_read_bootscript_flash(u64 *bootscr_flash_offset, uboot = ofnode_path("/options/u-boot"); if (!ofnode_valid(uboot)) { - debug("%s: Missing /u-boot node\n", __func__); + dm_warn("%s: Missing /u-boot node\n", __func__); return -EINVAL; } @@ -1784,7 +1784,7 @@ int ofnode_read_bootscript_flash(u64 *bootscr_flash_offset, return -EINVAL; if (!bootscr_flash_size) { - debug("bootscr-flash-size is zero. Ignoring properties!\n"); + dm_warn("bootscr-flash-size is zero. Ignoring properties!\n"); *bootscr_flash_offset = 0; return -EINVAL; } @@ -1831,7 +1831,7 @@ phy_interface_t ofnode_read_phy_mode(ofnode node) if (!strcmp(mode, phy_interface_strings[i])) return i; - debug("%s: Invalid PHY interface '%s'\n", __func__, mode); + dm_warn("%s: Invalid PHY interface '%s'\n", __func__, mode); return PHY_INTERFACE_MODE_NA; } diff --git a/drivers/core/regmap.c b/drivers/core/regmap.c index 7ff7834bdf0..f1a7eda8711 100644 --- a/drivers/core/regmap.c +++ b/drivers/core/regmap.c @@ -139,8 +139,8 @@ static int init_range(ofnode node, struct regmap_range *range, int addr_len, ret = of_address_to_resource(ofnode_to_np(node), index, &r); if (ret) { - debug("%s: Could not read resource of range %d (ret = %d)\n", - ofnode_get_name(node), index, ret); + dm_warn("%s: Could not read resource of range %d (ret = %d)\n", + ofnode_get_name(node), index, ret); return ret; } @@ -154,8 +154,8 @@ static int init_range(ofnode node, struct regmap_range *range, int addr_len, addr_len, size_len, &sz, true); if (range->start == FDT_ADDR_T_NONE) { - debug("%s: Could not read start of range %d\n", - ofnode_get_name(node), index); + dm_warn("%s: Could not read start of range %d\n", + ofnode_get_name(node), index); return -EINVAL; } @@ -173,15 +173,15 @@ int regmap_init_mem_index(ofnode node, struct regmap **mapp, int index) addr_len = ofnode_read_simple_addr_cells(ofnode_get_parent(node)); if (addr_len < 0) { - debug("%s: Error while reading the addr length (ret = %d)\n", - ofnode_get_name(node), addr_len); + dm_warn("%s: Error while reading the addr length (ret = %d)\n", + ofnode_get_name(node), addr_len); return addr_len; } size_len = ofnode_read_simple_size_cells(ofnode_get_parent(node)); if (size_len < 0) { - debug("%s: Error while reading the size length: (ret = %d)\n", - ofnode_get_name(node), size_len); + dm_warn("%s: Error while reading the size length: (ret = %d)\n", + ofnode_get_name(node), size_len); return size_len; } @@ -250,36 +250,36 @@ int regmap_init_mem(ofnode node, struct regmap **mapp) addr_len = ofnode_read_simple_addr_cells(ofnode_get_parent(node)); if (addr_len < 0) { - debug("%s: Error while reading the addr length (ret = %d)\n", - ofnode_get_name(node), addr_len); + dm_warn("%s: Error while reading the addr length (ret = %d)\n", + ofnode_get_name(node), addr_len); return addr_len; } size_len = ofnode_read_simple_size_cells(ofnode_get_parent(node)); if (size_len < 0) { - debug("%s: Error while reading the size length: (ret = %d)\n", - ofnode_get_name(node), size_len); + dm_warn("%s: Error while reading the size length: (ret = %d)\n", + ofnode_get_name(node), size_len); return size_len; } both_len = addr_len + size_len; if (!both_len) { - debug("%s: Both addr and size length are zero\n", - ofnode_get_name(node)); + dm_warn("%s: Both addr and size length are zero\n", + ofnode_get_name(node)); return -EINVAL; } len = ofnode_read_size(node, "reg"); if (len < 0) { - debug("%s: Error while reading reg size (ret = %d)\n", - ofnode_get_name(node), len); + dm_warn("%s: Error while reading reg size (ret = %d)\n", + ofnode_get_name(node), len); return len; } len /= sizeof(fdt32_t); count = len / both_len; if (!count) { - debug("%s: Not enough data in reg property\n", - ofnode_get_name(node)); + dm_warn("%s: Not enough data in reg property\n", + ofnode_get_name(node)); return -EINVAL; } @@ -424,8 +424,8 @@ int regmap_raw_read_range(struct regmap *map, uint range_num, uint offset, void *ptr; if (do_range_check() && range_num >= map->range_count) { - debug("%s: range index %d larger than range count\n", - __func__, range_num); + dm_warn("%s: range index %d larger than range count\n", + __func__, range_num); return -ERANGE; } range = &map->ranges[range_num]; @@ -433,7 +433,7 @@ int regmap_raw_read_range(struct regmap *map, uint range_num, uint offset, offset <<= map->reg_offset_shift; if (do_range_check() && (offset + val_len > range->size || offset + val_len < offset)) { - debug("%s: offset/size combination invalid\n", __func__); + dm_warn("%s: offset/size combination invalid\n", __func__); return -ERANGE; } @@ -455,7 +455,7 @@ int regmap_raw_read_range(struct regmap *map, uint range_num, uint offset, break; #endif default: - debug("%s: regmap size %zu unknown\n", __func__, val_len); + dm_warn("%s: regmap size %zu unknown\n", __func__, val_len); return -EINVAL; } @@ -564,15 +564,15 @@ int regmap_raw_write_range(struct regmap *map, uint range_num, uint offset, void *ptr; if (range_num >= map->range_count) { - debug("%s: range index %d larger than range count\n", - __func__, range_num); + dm_warn("%s: range index %d larger than range count\n", + __func__, range_num); return -ERANGE; } range = &map->ranges[range_num]; offset <<= map->reg_offset_shift; if (offset + val_len > range->size || offset + val_len < offset) { - debug("%s: offset/size combination invalid\n", __func__); + dm_warn("%s: offset/size combination invalid\n", __func__); return -ERANGE; } @@ -594,7 +594,7 @@ int regmap_raw_write_range(struct regmap *map, uint range_num, uint offset, break; #endif default: - debug("%s: regmap size %zu unknown\n", __func__, val_len); + dm_warn("%s: regmap size %zu unknown\n", __func__, val_len); return -EINVAL; } @@ -630,8 +630,8 @@ int regmap_write(struct regmap *map, uint offset, uint val) u.v64 = val; break; default: - debug("%s: regmap size %zu unknown\n", __func__, - (size_t)map->width); + dm_warn("%s: regmap size %zu unknown\n", __func__, + (size_t)map->width); return -EINVAL; } diff --git a/drivers/core/root.c b/drivers/core/root.c index 4bfd08f4813..7cf6607a9b7 100644 --- a/drivers/core/root.c +++ b/drivers/core/root.c @@ -207,7 +207,7 @@ static int dm_scan_fdt_node(struct udevice *parent, ofnode parent_node, err = lists_bind_fdt(parent, node, NULL, NULL, pre_reloc_only); if (err && !ret) { ret = err; - debug("%s: ret=%d\n", node_name, ret); + dm_warn("%s: ret=%d\n", node_name, ret); } } @@ -248,7 +248,7 @@ int dm_extended_scan(bool pre_reloc_only) ret = dm_scan_fdt(pre_reloc_only); if (ret) { - debug("dm_scan_fdt() failed: %d\n", ret); + dm_warn("dm_scan_fdt() failed: %d\n", ret); return ret; } @@ -256,8 +256,8 @@ int dm_extended_scan(bool pre_reloc_only) for (i = 0; i < ARRAY_SIZE(nodes); i++) { ret = dm_scan_fdt_ofnode_path(nodes[i], pre_reloc_only); if (ret) { - debug("dm_scan_fdt() scan for %s failed: %d\n", - nodes[i], ret); + dm_warn("dm_scan_fdt() scan for %s failed: %d\n", + nodes[i], ret); return ret; } } @@ -320,14 +320,14 @@ static int dm_scan(bool pre_reloc_only) ret = dm_scan_plat(pre_reloc_only); if (ret) { - debug("dm_scan_plat() failed: %d\n", ret); + dm_warn("dm_scan_plat() failed: %d\n", ret); return ret; } if (CONFIG_IS_ENABLED(OF_REAL)) { ret = dm_extended_scan(pre_reloc_only); if (ret) { - debug("dm_extended_scan() failed: %d\n", ret); + dm_warn("dm_extended_scan() failed: %d\n", ret); return ret; } } @@ -345,7 +345,7 @@ int dm_init_and_scan(bool pre_reloc_only) ret = dm_init(CONFIG_IS_ENABLED(OF_LIVE)); if (ret) { - debug("dm_init() failed: %d\n", ret); + dm_warn("dm_init() failed: %d\n", ret); return ret; } if (!CONFIG_IS_ENABLED(OF_PLATDATA_INST)) { diff --git a/drivers/core/uclass.c b/drivers/core/uclass.c index 762536eebc6..7ae0884a75e 100644 --- a/drivers/core/uclass.c +++ b/drivers/core/uclass.c @@ -59,8 +59,8 @@ static int uclass_add(enum uclass_id id, struct uclass **ucp) *ucp = NULL; uc_drv = lists_uclass_lookup(id); if (!uc_drv) { - debug("Cannot find uclass for id %d: please add the UCLASS_DRIVER() declaration for this UCLASS_... id\n", - id); + dm_warn("Cannot find uclass for id %d: please add the UCLASS_DRIVER() declaration for this UCLASS_... id\n", + id); /* * Use a strange error to make this case easier to find. When * a uclass is not available it can prevent driver model from From patchwork Mon Jun 10 16:09:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Quentin Schulz X-Patchwork-Id: 1945957 X-Patchwork-Delegate: sjg@chromium.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4VycG9172zz20KL for ; Tue, 11 Jun 2024 02:10:09 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 5601488633; Mon, 10 Jun 2024 18:09:42 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=0leil.net Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by phobos.denx.de (Postfix, from userid 109) id 25C8888637; Mon, 10 Jun 2024 18:09:41 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL,RCVD_IN_VALIDITY_CERTIFIED_BLOCKED, RCVD_IN_VALIDITY_RPBL_BLOCKED,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from smtp-bc08.mail.infomaniak.ch (smtp-bc08.mail.infomaniak.ch [45.157.188.8]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id AEA588812B for ; Mon, 10 Jun 2024 18:09:38 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=0leil.net Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=foss+uboot@0leil.net Received: from smtp-4-0000.mail.infomaniak.ch (smtp-4-0000.mail.infomaniak.ch [10.7.10.107]) by smtp-3-3000.mail.infomaniak.ch (Postfix) with ESMTPS id 4VycFZ3mwmzxRT; Mon, 10 Jun 2024 18:09:38 +0200 (CEST) Received: from unknown by smtp-4-0000.mail.infomaniak.ch (Postfix) with ESMTPA id 4VycFY6bFyzKG; Mon, 10 Jun 2024 18:09:37 +0200 (CEST) From: Quentin Schulz Date: Mon, 10 Jun 2024 18:09:16 +0200 Subject: [PATCH 4/4] dm: core: fix typo in SPL_DM_WARN prompt text MIME-Version: 1.0 Message-Id: <20240610-misc-20240610-v1-4-6914f1725dd4@cherry.de> References: <20240610-misc-20240610-v1-0-6914f1725dd4@cherry.de> In-Reply-To: <20240610-misc-20240610-v1-0-6914f1725dd4@cherry.de> To: Simon Glass , Tom Rini , Bin Meng , Michal Simek , Ashok Reddy Soma , Dario Binacchi Cc: u-boot@lists.denx.de, Quentin Schulz X-Mailer: b4 0.14-dev-a6ee3 X-Infomaniak-Routing: alpha X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean From: Quentin Schulz It should read "in SPL" and not "wuth SPL". Signed-off-by: Quentin Schulz --- drivers/core/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/core/Kconfig b/drivers/core/Kconfig index 1081d61fcf0..e4b1a66ecb1 100644 --- a/drivers/core/Kconfig +++ b/drivers/core/Kconfig @@ -56,7 +56,7 @@ config DM_WARN out - it will do nothing when called. config SPL_DM_WARN - bool "Enable warnings in driver model wuth SPL" + bool "Enable warnings in driver model in SPL" depends on SPL_DM help Enable this to see warnings related to driver model in SPL