From patchwork Sat Oct 3 17:31:26 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1376329 X-Patchwork-Delegate: sjg@chromium.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: 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=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=FJlh9uei; dkim-atps=neutral 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 RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4C3Ypr2tGXz9sSG for ; Sun, 4 Oct 2020 04:32:52 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 1F6AA82390; Sat, 3 Oct 2020 19:32:16 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="FJlh9uei"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id B46078235C; Sat, 3 Oct 2020 19:32:13 +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=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-io1-xd41.google.com (mail-io1-xd41.google.com [IPv6:2607:f8b0:4864:20::d41]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 643728235C for ; Sat, 3 Oct 2020 19:32:10 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-io1-xd41.google.com with SMTP id z25so4874509iol.10 for ; Sat, 03 Oct 2020 10:32:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=V0aDGg1ABly3sPl0886CL4J/aUjQgFIzw7EHYbHOVBU=; b=FJlh9ueixQM4/UKp2MsuxngtRetIuPPdxSzLYjxYSd2zLVTtM3puSlYdG4wP7CTBEs b1Ob4GsBhmGP0S8lYaQSr1vawlcAfOOkdZwY6ckk7YtOEwum+FOpweAgDg21Fi/pne/T DoSVjPh9MGiWRO50Onu93JuUGsJ7Y1VDBj5H0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=V0aDGg1ABly3sPl0886CL4J/aUjQgFIzw7EHYbHOVBU=; b=ZXbYMChYd2rJnQUFJD/60aT0Zitp6rqWw6hNdfdOj2KwJI/nThWfb2WxINmWCJZdSe T3/IG+24HOAHQfUYfDZRu9A6hv49XS0MFa/NMuwVWIsAY9LlHJN7wz7M0G4KZQTL5Ovu NoAAHXc8yY0/SLmr2SDN2HlbMVbFOgLeTego8C56c9al2ycUMP5JKGmpbPygs4NGwuvV /vz26iDb/8vS9GjIAZAAijp+kHdHIVR2G2wO2+ltIH2kNAukmc02cp1YLW0ywgCELk1/ rw9eh97mA6rai5L4678XhdEib9KyGuun+eHxUEQe8ylXOZxlIaR17fjitLamM4JbHlDQ ku5A== X-Gm-Message-State: AOAM531ACWqIfzC4MVp04gUcCPt7ZC0Jl4pmNVskpPXYU8KcZaIIzyZY jJi2368D9dx/idI5BcRbvg8u9wXxilNS5sIM X-Google-Smtp-Source: ABdhPJwPhKcarYOWluFkjwfJHik6OwBBRBI1vpP/V+0YaR8EVM5EOWMVV4evlCBhpNtyf6VWzwnNrw== X-Received: by 2002:a02:3b27:: with SMTP id c39mr6948669jaa.95.1601746329022; Sat, 03 Oct 2020 10:32:09 -0700 (PDT) Received: from localhost.localdomain (c-73-14-175-90.hsd1.co.comcast.net. [73.14.175.90]) by smtp.gmail.com with ESMTPSA id t14sm2930963ilj.45.2020.10.03.10.32.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 03 Oct 2020 10:32:08 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Walter Lozano , Tom Rini , Simon Glass , Marek Vasut , Pavel Herrmann Subject: [PATCH 04/20] dm: core: Allow dm_warn() to be used in SPL Date: Sat, 3 Oct 2020 11:31:26 -0600 Message-Id: <20201003173142.3213123-5-sjg@chromium.org> X-Mailer: git-send-email 2.28.0.806.g8561365e88-goog In-Reply-To: <20201003173142.3213123-1-sjg@chromium.org> References: <20201003173142.3213123-1-sjg@chromium.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 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.102.3 at phobos.denx.de X-Virus-Status: Clean At present this option is disabled in SPL, meaning that warnings are not displayed. It is sometimes useful to see warnings in SPL for debugging purposes. Add a new Kconfig option to permit this. Signed-off-by: Simon Glass Signed-off-by: Simon Glass --- drivers/core/Kconfig | 18 ++++++++++++++++-- drivers/core/util.c | 2 +- include/config_uncmd_spl.h | 1 - include/dm/util.h | 2 +- 4 files changed, 18 insertions(+), 5 deletions(-) diff --git a/drivers/core/Kconfig b/drivers/core/Kconfig index 1ca5d66141b..603a1d27c0c 100644 --- a/drivers/core/Kconfig +++ b/drivers/core/Kconfig @@ -40,10 +40,24 @@ config DM_WARN depends on DM default y help + Enable this to see warnings related to driver model. + + Warnings may help with debugging, such as when expected devices do + not bind correctly. If the option is disabled, dm_warn() is compiled + out - it will do nothing when called. + +config SPL_DM_WARN + bool "Enable warnings in driver model wuth SPL" + depends on SPL_DM + help + Enable this to see warnings related to driver model in SPL + The dm_warn() function can use up quite a bit of space for its strings. By default this is disabled for SPL builds to save space. - This will cause dm_warn() to be compiled out - it will do nothing - when called. + + Warnings may help with debugging, such as when expected devices do + not bind correctly. If the option is disabled, dm_warn() is compiled + out - it will do nothing when called. config DM_DEBUG bool "Enable debug messages in driver model core" diff --git a/drivers/core/util.c b/drivers/core/util.c index 25b0d76f430..91e93b0cf14 100644 --- a/drivers/core/util.c +++ b/drivers/core/util.c @@ -11,7 +11,7 @@ #include #include -#ifdef CONFIG_DM_WARN +#if CONFIG_IS_ENABLED(DM_WARN) void dm_warn(const char *fmt, ...) { va_list args; diff --git a/include/config_uncmd_spl.h b/include/config_uncmd_spl.h index 31da6215b3a..af7e3e49fdd 100644 --- a/include/config_uncmd_spl.h +++ b/include/config_uncmd_spl.h @@ -16,7 +16,6 @@ #undef CONFIG_DM_SPI #endif -#undef CONFIG_DM_WARN #undef CONFIG_DM_STDIO #endif /* CONFIG_SPL_BUILD */ diff --git a/include/dm/util.h b/include/dm/util.h index 9773db6de17..01a044992f2 100644 --- a/include/dm/util.h +++ b/include/dm/util.h @@ -6,7 +6,7 @@ #ifndef __DM_UTIL_H #define __DM_UTIL_H -#ifdef CONFIG_DM_WARN +#if CONFIG_IS_ENABLED(DM_WARN) void dm_warn(const char *fmt, ...); #else static inline void dm_warn(const char *fmt, ...)