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(-)
--
2.1.0
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.
Signed-off-by: Rob Herring <[email protected]>
Cc: Ralf Baechle <[email protected]>
Cc: [email protected]
---
arch/mips/include/asm/prom.h | 2 +-
arch/mips/kernel/prom.c | 1 +
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/arch/mips/include/asm/prom.h b/arch/mips/include/asm/prom.h
index 8ebc2aa..0b4b668 100644
--- a/arch/mips/include/asm/prom.h
+++ b/arch/mips/include/asm/prom.h
@@ -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>
diff --git a/arch/mips/kernel/prom.c b/arch/mips/kernel/prom.c
index e303cb1..b130033 100644
--- a/arch/mips/kernel/prom.c
+++ b/arch/mips/kernel/prom.c
@@ -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>
--
2.1.0
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.
Signed-off-by: Rob Herring <[email protected]>
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(-)
diff --git a/drivers/of/Kconfig b/drivers/of/Kconfig
index 07bb3c8..415b51d 100644
--- a/drivers/of/Kconfig
+++ b/drivers/of/Kconfig
@@ -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
--
2.1.0
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.
Signed-off-by: Rob Herring <[email protected]>
Cc: Geert Uytterhoeven <[email protected]>
Cc: Pantelis Antoniou <[email protected]>
Cc: Grant Likely <[email protected]>
---
drivers/of/Kconfig | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/of/Kconfig b/drivers/of/Kconfig
index 415b51d..7e76af9 100644
--- a/drivers/of/Kconfig
+++ b/drivers/of/Kconfig
@@ -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
--
2.1.0
Hi Rob,
On Wed, Jun 3, 2015 at 12:46 AM, Rob Herring <[email protected]> wrote:
> 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!
> Signed-off-by: Rob Herring <[email protected]>
> Cc: Geert Uytterhoeven <[email protected]>
> Cc: Pantelis Antoniou <[email protected]>
> Cc: Grant Likely <[email protected]>
Acked-by: Geert Uytterhoeven <[email protected]>
with one minor docu nit below.
> ---
> drivers/of/Kconfig | 9 ++++-----
> 1 file changed, 4 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/of/Kconfig b/drivers/of/Kconfig
> index 07bb3c8..415b51d 100644
> --- a/drivers/of/Kconfig
> +++ b/drivers/of/Kconfig
> @@ -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
Hi Rob,
> On Jun 3, 2015, at 01:46 , Rob Herring <[email protected]> wrote:
>
> 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.
>
> Signed-off-by: Rob Herring <[email protected]>
> 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(-)
>
> diff --git a/drivers/of/Kconfig b/drivers/of/Kconfig
> index 07bb3c8..415b51d 100644
> --- a/drivers/of/Kconfig
> +++ b/drivers/of/Kconfig
> @@ -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
> --
> 2.1.0
>
Acked-by: Pantelis Antoniou <[email protected]>
On Tue, Jun 02, 2015 at 05:46:42PM -0500, Rob Herring wrote:
> 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,
Acked-by: Ralf Baechle <[email protected]>
Ralf
On Wed, 3 Jun 2015 10:24:10 +0200
, Ralf Baechle <[email protected]>
wrote:
> On Tue, Jun 02, 2015 at 05:46:42PM -0500, Rob Herring wrote:
>
> > 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,
>
> Acked-by: Ralf Baechle <[email protected]>
>
> Ralf
For the whole series:
Acked-by: Grant Likely <[email protected]>