This patch added a new architecture option in general setup menu, and after we choice the ARM architecture, we can define the cross-compiler-prefix. Since coreboot now depends on X86 architecture, we couldn't build an ARM coreboot now.
Signed-off-by: Yang Bai hamo.by@gmail.com
diff --git a/Makefile b/Makefile index ac7115d..cae3870 100644 --- a/Makefile +++ b/Makefile @@ -101,6 +101,12 @@ else
include $(HAVE_DOTCONFIG)
+ifneq ($(CONFIG_ARCH_X86),y) +ifneq ($(CONFIG_COMPILER_LLVM_CLANG),y) +CC := $(CONFIG_CROSS_COMPILE)$(CC) +endif +endif + ifneq ($(INNER_SCANBUILD),y) ifeq ($(CONFIG_COMPILER_LLVM_CLANG),y) CC:=clang -m32 diff --git a/src/Kconfig b/src/Kconfig index 05b4adb..abaa9a5 100644 --- a/src/Kconfig +++ b/src/Kconfig @@ -23,12 +23,37 @@ menu "General setup"
config EXPERT bool "Expert mode" + default n help This allows you to select certain advanced configuration options.
Warning: Only enable this option if you really know what you are doing! You have been warned!
+choice + prompt "Architecture" + default ARCH_X86 + help + This option is used to set the architecture of Coreboot. + +config ARCH_X86 + bool "X86" +config ARCH_ARM + bool "ARM" + depends on EXPERT +endchoice + +config CROSS_COMPILE + string "Cross-compiler tool prefix" + default "" + depends on !ARCH_X86 + depends on COMPILER_GCC + help + Same as running 'make CROSS_COMPILE=prefix-' but stored for + default make runs in this kernel build directory. You don't + need to set this unless you want the configured kernel build + directory to select the cross-compiler automatically. + config LOCALVERSION string "Local version string" help @@ -102,12 +127,6 @@ endmenu
source src/mainboard/Kconfig
-# This option is used to set the architecture of a mainboard to X86. -# It is usually set in mainboard/*/Kconfig. -config ARCH_X86 - bool - default n - if ARCH_X86 source src/arch/x86/Kconfig endif
On Sun, Apr 17, 2011 at 7:50 PM, Hamo hamo.by@gmail.com wrote:
This patch added a new architecture option in general setup menu, and after we choice the ARM architecture, we can define the cross-compiler-prefix. Since coreboot now depends on X86 architecture, we couldn't build an ARM coreboot now.
Signed-off-by: Yang Bai hamo.by@gmail.com
diff --git a/Makefile b/Makefile index ac7115d..cae3870 100644 --- a/Makefile +++ b/Makefile @@ -101,6 +101,12 @@ else
include $(HAVE_DOTCONFIG)
+ifneq ($(CONFIG_ARCH_X86),y) +ifneq ($(CONFIG_COMPILER_LLVM_CLANG),y) +CC := $(CONFIG_CROSS_COMPILE)$(CC) +endif +endif
ifneq ($(INNER_SCANBUILD),y) ifeq ($(CONFIG_COMPILER_LLVM_CLANG),y) CC:=clang -m32 diff --git a/src/Kconfig b/src/Kconfig index 05b4adb..abaa9a5 100644 --- a/src/Kconfig +++ b/src/Kconfig @@ -23,12 +23,37 @@ menu "General setup"
config EXPERT bool "Expert mode"
- default n
help This allows you to select certain advanced configuration options.
Warning: Only enable this option if you really know what you are doing! You have been warned!
+choice
- prompt "Architecture"
- default ARCH_X86
- help
- This option is used to set the architecture of Coreboot.
+config ARCH_X86
- bool "X86"
+config ARCH_ARM
- bool "ARM"
- depends on EXPERT
+endchoice
+config CROSS_COMPILE
- string "Cross-compiler tool prefix"
- default ""
- depends on !ARCH_X86
- depends on COMPILER_GCC
- help
- Same as running 'make CROSS_COMPILE=prefix-' but stored for
- default make runs in this kernel build directory. You don't
- need to set this unless you want the configured kernel build
- directory to select the cross-compiler automatically.
config LOCALVERSION string "Local version string" help @@ -102,12 +127,6 @@ endmenu
source src/mainboard/Kconfig
-# This option is used to set the architecture of a mainboard to X86. -# It is usually set in mainboard/*/Kconfig. -config ARCH_X86
- bool
- default n
if ARCH_X86 source src/arch/x86/Kconfig endif
-- coreboot mailing list: coreboot@coreboot.org http://www.coreboot.org/mailman/listinfo/coreboot
Hi Hamo,
Thanks for the patch. It is a little early to add this without the actual ARM additions. Please maintain this patch until the ARM code is ready to be added.
Have you considered how this will work with the existing coreboot cross compile, crosstools and xcompile?
Marc
Agree with Marc - well done everyone who is sending patches already!
Please continue sending small patches like this, they are easy to review and comment on.
Hamo wrote:
+choice
- prompt "Architecture"
- default ARCH_X86
- help
This option is used to set the architecture of Coreboot.
+config ARCH_X86
- bool "X86"
+config ARCH_ARM
- bool "ARM"
- depends on EXPERT
+endchoice
I don't think the above will work as-is. Consider the comment that was removed:
-# This option is used to set the architecture of a mainboard to X86. -# It is usually set in mainboard/*/Kconfig. -config ARCH_X86
- bool
- default n
This explains that ARCH_X86 is set by mainboards and not the user.
Going forward the question is if a new step should be added to configuration, where the user can choose the architecture they are interested in, and that will limit the list of mainboards that can be selected.
The alternative is that configuration continues to work like it does now, where all mainboards by all manufacturers are displayed, and the ARCH_* variable is set by the chosen mainboard.
The approach to add a step will require much more work changing how coreboot Kconfig works. The latter approach will be simpler. I personally think that it would be fine to not have an extra step for the user to choose architecture, that this is implicit from the mainboard.
Please also note that coreboot should always be written with all lowercase.
//Peter
On Mon, Apr 18, 2011 at 5:15 PM, Peter Stuge peter@stuge.se wrote:
Agree with Marc - well done everyone who is sending patches already!
Please continue sending small patches like this, they are easy to review and comment on.
Hamo wrote:
+choice
- prompt "Architecture"
- default ARCH_X86
- help
- This option is used to set the architecture of Coreboot.
+config ARCH_X86
- bool "X86"
+config ARCH_ARM
- bool "ARM"
- depends on EXPERT
+endchoice
I don't think the above will work as-is. Consider the comment that was removed:
-# This option is used to set the architecture of a mainboard to X86. -# It is usually set in mainboard/*/Kconfig. -config ARCH_X86
- bool
- default n
This explains that ARCH_X86 is set by mainboards and not the user.
Going forward the question is if a new step should be added to configuration, where the user can choose the architecture they are interested in, and that will limit the list of mainboards that can be selected.
The alternative is that configuration continues to work like it does now, where all mainboards by all manufacturers are displayed, and the ARCH_* variable is set by the chosen mainboard.
The approach to add a step will require much more work changing how coreboot Kconfig works. The latter approach will be simpler. I personally think that it would be fine to not have an extra step for the user to choose architecture, that this is implicit from the mainboard.
Peter makes a very good point here. The architecture would be tied to the mainboard and by extension CPU kconfig.
Marc
* Peter Stuge peter@stuge.se [110419 01:15]:
Going forward the question is if a new step should be added to configuration, where the user can choose the architecture they are interested in, and that will limit the list of mainboards that can be selected.
The advantage of this would be that a user (especially when compiling for non-x86) would be bothered with a significantly smaller choice of boards. The draw back is that the user has to know the architecture. :)
That said, I kind of like the approach that each component "draws in" the other components it needs without the user having to make a choice.