Skip to contentSkip to conversation

Make CONFIG_OF user selectable

PATCH In review Rob Herring 5 participants 8 messages Jun 2, 2015 – Jun 4, 2015

Subsystems (2)
lore
Share & tools
lore

Rob Herring

author maintainer
#0 lore raw

cover Make CONFIG_OF user selectable

There are a couple of reasons we'd like to have CONFIG_OF be user visible and enabled. The first is DT overlays can be used on architectures regardless of whether they use DT for booting. One example is running DT unittests on x86. The second is simply to expand the compile coverage of the DT code. This change enables building DT code on x86 allyesconfig and allmodconfig.

Rob

Rob Herring (3):
MIPS: prepare for user enabling of CONFIG_OF
of: make CONFIG_OF user selectable
of: make unittest select OF_EARLY_FLATTREE instead of depend on it

 arch/mips/include/asm/prom.h |  2 +-
 arch/mips/kernel/prom.c      |  1 +
 drivers/of/Kconfig           | 12 ++++++------
 3 files changed, 8 insertions(+), 7 deletions(-)
Signature · 6 lines
2.1.0

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
author maintainer
#1 lore raw

PATCH 1/3 MIPS: prepare for user enabling of CONFIG_OF

In preparation to allow users to enable DeviceTree without arch or machine selecting it, we need to fix build errors on MIPS. When CONFIG_OF is enabled, device_tree_init cannot be resolved. This is trivially fixed by using CONFIG_USE_OF instead of CONFIG_OF for prom.h.

---
 arch/mips/include/asm/prom.h | 2 +-
 arch/mips/kernel/prom.c      | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)
arch/mips/include/asm/prom.h +1 -1
index 8ebc2aa..0b4b668 100644
@@ -11,7 +11,7 @@
 #ifndef __ASM_PROM_H
 #define __ASM_PROM_H
 
-#ifdef CONFIG_OF
+#ifdef CONFIG_USE_OF
 #include <linux/bug.h>
 #include <linux/io.h>
 #include <linux/types.h>
arch/mips/kernel/prom.c +1 -0
index e303cb1..b130033 100644
@@ -18,6 +18,7 @@
 #include <linux/of_fdt.h>
 #include <linux/of_platform.h>
 
+#include <asm/bootinfo.h>
 #include <asm/page.h>
 #include <asm/prom.h>
 
Signature · 1 line
2.1.0
Acked-by on v1 1/3
#2 lore raw

Re: [PATCH 1/3] MIPS: prepare for user enabling of CONFIG_OF

Quoted 4 lines · Rob Herring

In preparation to allow users to enable DeviceTree without arch or machine selecting it, we need to fix build errors on MIPS. When CONFIG_OF is enabled, device_tree_init cannot be resolved. This is trivially fixed by using CONFIG_USE_OF instead of CONFIG_OF for prom.h.

Want to take this through your tree? If so,

Ralf

Acked-by
#3 lore raw

Re: [PATCH 1/3] MIPS: prepare for user enabling of CONFIG_OF

Quoted 7 lines · Ralf Baechle
Quoted 4 lines · Rob Herring

In preparation to allow users to enable DeviceTree without arch or machine selecting it, we need to fix build errors on MIPS. When CONFIG_OF is enabled, device_tree_init cannot be resolved. This is trivially fixed by using CONFIG_USE_OF instead of CONFIG_OF for prom.h.

Quoted 5 lines

Want to take this through your tree? If so,

Ralf

For the whole series:

author maintainer
#4 lore raw

PATCH 2/3 of: make CONFIG_OF user selectable

In reply to Rob Herring

With the addition of overlays, it is now plausible to use DT on any arch and without an arch using it at boot time. It is also desirable to expand the compile coverage of the DT code. Make CONFIG_OF user selectable by converting the menu to menuconfig.

Cc Geert Uytterhoeven <[email protected]>
Cc Pantelis Antoniou <pantelis.antoniou-OWPKS81ov/FWk0Htik3J/[email protected]>
Cc Grant Likely <[email protected]>
---
 drivers/of/Kconfig | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)
drivers/of/Kconfig +4 -5
index 07bb3c8..415b51d 100644
@@ -1,11 +1,10 @@
 config DTC
 	bool
 
-config OF
-	bool
+menuconfig OF
+	bool "Device Tree and Open Firmware support"
 
-menu "Device Tree and Open Firmware support"
-	depends on OF
+if OF
 
 config OF_UNITTEST
 	bool "Device Tree runtime unit tests"
@@ -97,4 +96,4 @@ config OF_OVERLAY
 	  While this option is selected automatically when needed, you can
 	  enable it manually to improve device tree unit test coverage.
 
-endmenu # OF
+endif # OF
Signature · 6 lines
2.1.0

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Acked-by on v1 2/3
#5 lore raw

Re: [PATCH 2/3] of: make CONFIG_OF user selectable

Hi Rob,

Quoted 4 lines · Rob Herring

With the addition of overlays, it is now plausible to use DT on any arch and without an arch using it at boot time. It is also desirable to expand the compile coverage of the DT code. Make CONFIG_OF user selectable by converting the menu to menuconfig.

Thanks!

Quoted 4 lines
Cc Geert Uytterhoeven <[email protected]>
Cc Pantelis Antoniou <pantelis.antoniou-OWPKS81ov/FWk0Htik3J/[email protected]>
Cc Grant Likely <[email protected]>

with one minor docu nit below.

Quoted 9 lines
---
 drivers/of/Kconfig | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)
drivers/of/Kconfig +0 -0
index 07bb3c8..415b51d 100644

drivers/of/Kconfig line 5

Quoted 7 lines
drivers/of/Kconfig +2 -2
@@ -1,11 +1,10 @@
 config DTC
        bool
 
-config OF
-       bool
+menuconfig OF
+       bool "Device Tree and Open Firmware support"

This needs a help text. In "[PATCH 1/3] of: Allow OF to be enabled if COMPILE_TEST to increase coverage", I had:

+         This option enables the device tree infrastructure.
+         If is automatically selected by platforms that need it, but can
+         be enabled manually to increase compile-coverage.

Feel free to adapt...

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

Acked-by on v1 2/3
#6 lore raw

Re: [PATCH 2/3] of: make CONFIG_OF user selectable

In reply to Rob Herring

Hi Rob,

Quoted 43 lines · Rob Herring

With the addition of overlays, it is now plausible to use DT on any arch and without an arch using it at boot time. It is also desirable to expand the compile coverage of the DT code. Make CONFIG_OF user selectable by converting the menu to menuconfig.

Cc Geert Uytterhoeven <[email protected]>
Cc Pantelis Antoniou <[email protected]>
Cc Grant Likely <[email protected]>

---
drivers/of/Kconfig | 9 ++++-----

1 file changed, 4 insertions(+), 5 deletions(-)
drivers/of/Kconfig +0 -0
index 07bb3c8..415b51d 100644
@@ -1,11 +1,10 @@

config DTC
bool

drivers/of/Kconfig +3 -4
-config OF
-	bool
+menuconfig OF
+	bool "Device Tree and Open Firmware support"
 
-menu "Device Tree and Open Firmware support"
-	depends on OF
+if OF

config OF_UNITTEST
bool "Device Tree runtime unit tests"

drivers/of/Kconfig +1 -1
@@ -97,4 +96,4 @@ config OF_OVERLAY
 	  While this option is selected automatically when needed, you can
 	  enable it manually to improve device tree unit test coverage.
 
-endmenu # OF
+endif # OF
Signature · 1 line
2.1.0
author maintainer
#7 lore raw

PATCH 3/3 of: make unittest select OF_EARLY_FLATTREE instead of depend on it

In reply to Rob Herring

The DT unittest currently requires an arch (typically) to select OF_EARLY_FLATTREE. Remove this dependency by selecting it directly so that the unittest can be enabled easily on any architecture. With this and the prior commit, we can easily enable and run unittests starting with x86 defconfig rather than hunting for the combination of config options to enable OF on x86.

Cc Geert Uytterhoeven <[email protected]>
Cc Pantelis Antoniou <pantelis.antoniou-OWPKS81ov/FWk0Htik3J/[email protected]>
Cc Grant Likely <[email protected]>
---
 drivers/of/Kconfig | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/of/Kconfig +2 -1
index 415b51d..7e76af9 100644
@@ -8,7 +8,8 @@ if OF
 
 config OF_UNITTEST
 	bool "Device Tree runtime unit tests"
-	depends on OF_IRQ && OF_EARLY_FLATTREE
+	depends on OF_IRQ
+	select OF_EARLY_FLATTREE
 	select OF_RESOLVE
 	help
 	  This option builds in test cases for the device tree infrastructure
Signature · 6 lines
2.1.0

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html