[RFCv2 15/16] common: Add a comment about the current state of common.h

Tom Rini trini at konsulko.com
Wed Aug 19 15:09:07 CEST 2020


From: Simon Glass <sjg at chromium.org>

This file still includes the auto-generated config.h header. Add a comment
as to why, to help guide further work.

Signed-off-by: Simon Glass <sjg at chromium.org>
---
 include/common.h          |  8 ++++----
 scripts/Makefile.autoconf | 19 +++++++++++++++++++
 2 files changed, 23 insertions(+), 4 deletions(-)

diff --git a/include/common.h b/include/common.h
index 1a9a2ce0ea85..2669f93c978f 100644
--- a/include/common.h
+++ b/include/common.h
@@ -2,17 +2,17 @@
 /*
  * Common header file for U-Boot
  *
- * This file still includes quite a few headers that should be included
- * individually as needed. Patches to remove things are welcome.
+ * This just includes the auto-generated config.h which is documented in
+ * Makefile.autoconf
  *
  * (C) Copyright 2000-2009
  * Wolfgang Denk, DENX Software Engineering, wd at denx.de.
  */
 
 #ifndef __COMMON_H_
-#define __COMMON_H_	1
+#define __COMMON_H_
 
-#ifndef __ASSEMBLY__		/* put C only stuff in this section */
+#ifndef __ASSEMBLY__
 #include <config.h>
 #endif	/* __ASSEMBLY__ */
 
diff --git a/scripts/Makefile.autoconf b/scripts/Makefile.autoconf
index 89882e3c71a4..a0f6783bc7da 100644
--- a/scripts/Makefile.autoconf
+++ b/scripts/Makefile.autoconf
@@ -99,6 +99,25 @@ tpl/include/autoconf.mk: tpl/u-boot.cfg
 
 # include/config.h
 # Prior to Kconfig, it was generated by mkconfig. Now it is created here.
+# This currently has the following contents:
+#
+#	1. #define CONFIG_BOARDDIR board/...
+#	2. #include <config_uncmd_spl.h>
+#	3. #include <configs/....h>
+#	4. #include <asm/config.h>
+#	5. #include <linux/kconfig.h>
+#	6. #include <config_fallbacks.h>
+#
+# 1 should be able to move to Kconfig
+# 2 should be removed by tidying up a few Kconfig items
+# 3 uses CONFIG_SYS_CONFIG_NAME and will go away when Kconfig migration is
+#	completed and all files in include/configs are removed
+# 4 should be removed when all CONFIG options in those files move to Kconfig
+# 5 is automatically included by the build system (see UBOOTINCLUDE) so is
+#	already unnecessary
+# 6 should be removed by tidying up a few Kconfig items
+#
+# So all of the above should eventually go away
 define filechk_config_h
 	(echo "/* Automatically generated - do not edit */";		\
 	for i in $$(echo $(CONFIG_SYS_EXTRA_OPTIONS) | sed 's/,/ /g'); do \
-- 
2.17.1



More information about the U-Boot mailing list