From patchwork Tue Jul 18 19:48:38 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Rini X-Patchwork-Id: 790476 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 3xBrKq72z4z9s72 for ; Wed, 19 Jul 2017 05:47:43 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id AE4ECC21E14; Tue, 18 Jul 2017 19:47:39 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 3D76EC21D74; Tue, 18 Jul 2017 19:47:36 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 7561CC21D74; Tue, 18 Jul 2017 19:47:35 +0000 (UTC) Received: from mail-yw0-f194.google.com (mail-yw0-f194.google.com [209.85.161.194]) by lists.denx.de (Postfix) with ESMTPS id 63C1CC21C38 for ; Tue, 18 Jul 2017 19:47:33 +0000 (UTC) Received: by mail-yw0-f194.google.com with SMTP id z21so1556589ywz.2 for ; Tue, 18 Jul 2017 12:47:33 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id; bh=sfNue/q/DnVG0HqTK7ur2PaJZQMyWpVDFMlSwo/H43U=; b=iODUemKaP3xuFxoGkkYGKPHt0s2SNti/X5H8NZu+BXzckYiWDZXiLlXSrQufhLrldE UdGZD6N1tP0PN0DNw0fR4hidXO4baXmj1NfESuQSsj5IRgcp9yvJ/Fj/uTWjUm25bpaf G7Cxh3RN1vZCKJcwAK/dUMH6QcuZC7GkyV9czMnBrr/FjfrFZxjMX601phMwx3MQIH8U qUx2hN+cSu186yn4IuDmi0amPoW/DgOSIUiSvIv/K8R1u3HnMO6ISNlR32onPCOYU9+U vyr5r/B1WhFOviZOLpZmPdKJc4qlVcr3r/Ms3YSXfQGKjBxEFUpuIpo70MDxhVWHqE9h //8g== X-Gm-Message-State: AIVw112UJNkAf2YnyNf5WSIURq1D/qNuFSgLZZJDf1rnx3dgouOj6ZDC HN5TRaHvQBRqKM/z X-Received: by 10.129.57.212 with SMTP id g203mr2754105ywa.101.1500407252060; Tue, 18 Jul 2017 12:47:32 -0700 (PDT) Received: from localhost.localdomain (cpe-75-180-228-133.ec.res.rr.com. [75.180.228.133]) by smtp.gmail.com with ESMTPSA id f4sm1239720ywi.63.2017.07.18.12.47.31 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 18 Jul 2017 12:47:31 -0700 (PDT) From: Tom Rini To: u-boot@lists.denx.de Date: Tue, 18 Jul 2017 15:48:38 -0400 Message-Id: <1500407318-7977-1-git-send-email-trini@konsulko.com> X-Mailer: git-send-email 1.9.1 Subject: [U-Boot] [PATCH] HACK: DO NOT MERGE: Simple program to printout preprocessed values X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" When migrating to Kconfig there may be cases where the symbol to be migrated depends on a preprocessed or calculated value, and thus moveconfig.py will not migrate it correctly. Introduce an easily hackable tool, tools/printvars.c that will give the final value. Hack the main Makefile to only build this tool, and buildman to save this tool. Thus it becomes "quick" to have buildman build this tool for every board in U-Boot today. Signed-off-by: Tom Rini --- Makefile | 2 +- tools/Makefile | 3 +++ tools/buildman/builderthread.py | 4 +--- tools/printvars.c | 18 ++++++++++++++++++ 4 files changed, 23 insertions(+), 4 deletions(-) create mode 100644 tools/printvars.c diff --git a/Makefile b/Makefile index 452596485dd3..40542e9db077 100644 --- a/Makefile +++ b/Makefile @@ -851,7 +851,7 @@ quiet_cmd_cfgcheck = CFGCHK $2 cmd_cfgcheck = $(srctree)/scripts/check-config.sh $2 \ $(srctree)/scripts/config_whitelist.txt $(srctree) -all: $(ALL-y) +all: tools ifeq ($(CONFIG_DM_I2C_COMPAT)$(CONFIG_SANDBOX),y) @echo "===================== WARNING ======================" @echo "This board uses CONFIG_DM_I2C_COMPAT. Please remove" diff --git a/tools/Makefile b/tools/Makefile index cb1683e1539c..a0a5d71f608c 100644 --- a/tools/Makefile +++ b/tools/Makefile @@ -55,6 +55,9 @@ HOSTCFLAGS_xway-swap-bytes.o := -pedantic hostprogs-y += mkenvimage mkenvimage-objs := mkenvimage.o os_support.o lib/crc32.o +hostprogs-y += printvars +printvars-objs := printvars.o + hostprogs-y += dumpimage mkimage hostprogs-$(CONFIG_FIT_SIGNATURE) += fit_info fit_check_sign diff --git a/tools/buildman/builderthread.py b/tools/buildman/builderthread.py index 9e8ca80c5b53..3992f5fcd4cf 100644 --- a/tools/buildman/builderthread.py +++ b/tools/buildman/builderthread.py @@ -364,9 +364,7 @@ class BuilderThread(threading.Thread): # Now write the actual build output if keep_outputs: - self.CopyFiles(result.out_dir, build_dir, '', ['u-boot*', '*.bin', - '*.map', '*.img', 'MLO', 'SPL', 'include/autoconf.mk', - 'spl/u-boot-spl*']) + self.CopyFiles(result.out_dir, build_dir, '', ['tools/printvars']) def CopyFiles(self, out_dir, build_dir, dirname, patterns): """Copy files from the build directory to the output. diff --git a/tools/printvars.c b/tools/printvars.c new file mode 100644 index 000000000000..95ae065ab62f --- /dev/null +++ b/tools/printvars.c @@ -0,0 +1,18 @@ +#include +/* HACK: Give us typedefs so we can proceed */ +typedef uint32_t u32; +typedef uint16_t u16; +typedef uint8_t u8; +typedef int32_t s32; +typedef int16_t s16; +typedef int8_t s8; +#include +#include + +int main(int argc, char **argv) { +#ifdef CONFIG_WHATEVER + printf("CONFIG_WHATEVER=whatever"); +#endif + + return 0; +}