[U-Boot] [PATCH 0/5] sparc: some refactoring before generic board conversion and a new board

Francois Retief has posted patch sets to convert SPARC boards into generic board and add a new board.
Before the new work, let's do code cleanups by using Kconfig.
I build all the SPARC boards and compared MD5SUM to confirm this series still produce the same result.
Masahiro Yamada (5): sparc: Use nicer prompt for board select menu sparc: move CONFIG_{LEON,LEON2,LEON3} to Kconfig sparc: merge arch/sparc/cpu/*/config.mk to arch/sparc/config.mk sparc: merge CONFIG_SYS_CPU and CONFIG_SYS_VENDOR defines sparc: move CONFIG_SYS_TEXT_BASE to Kconfig
Kconfig | 6 +++++ arch/sparc/Kconfig | 43 +++++++++++++++++++++++++++------- arch/sparc/config.mk | 2 ++ arch/sparc/cpu/leon2/config.mk | 10 -------- arch/sparc/cpu/leon3/config.mk | 10 -------- board/gaisler/gr_cpci_ax2000/Kconfig | 6 ----- board/gaisler/gr_cpci_ax2000/config.mk | 19 --------------- board/gaisler/gr_ep2s60/Kconfig | 6 ----- board/gaisler/gr_ep2s60/config.mk | 17 -------------- board/gaisler/gr_xc3s_1500/Kconfig | 6 ----- board/gaisler/gr_xc3s_1500/config.mk | 16 ------------- board/gaisler/grsim/Kconfig | 6 ----- board/gaisler/grsim/config.mk | 16 ------------- board/gaisler/grsim_leon2/Kconfig | 6 ----- board/gaisler/grsim_leon2/config.mk | 16 ------------- configs/gr_cpci_ax2000_defconfig | 1 + configs/gr_ep2s60_defconfig | 1 + configs/gr_xc3s_1500_defconfig | 1 + configs/grsim_defconfig | 1 + configs/grsim_leon2_defconfig | 1 + 20 files changed, 48 insertions(+), 142 deletions(-) delete mode 100644 arch/sparc/cpu/leon2/config.mk delete mode 100644 arch/sparc/cpu/leon3/config.mk delete mode 100644 board/gaisler/gr_cpci_ax2000/config.mk delete mode 100644 board/gaisler/gr_ep2s60/config.mk delete mode 100644 board/gaisler/gr_xc3s_1500/config.mk delete mode 100644 board/gaisler/grsim/config.mk delete mode 100644 board/gaisler/grsim_leon2/config.mk

The Board names in the board select menu were simply taken from the board directory name by a conversion tool when switching to Kconfig.
Let's use more descriptive prompts taken from include/configs/gr*.h and board/gaisler/*/config.mk.
Signed-off-by: Masahiro Yamada yamada.m@jp.panasonic.com Cc: Daniel Hellstrom daniel@gaisler.com ---
arch/sparc/Kconfig | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-)
diff --git a/arch/sparc/Kconfig b/arch/sparc/Kconfig index 733334f..24bdccb 100644 --- a/arch/sparc/Kconfig +++ b/arch/sparc/Kconfig @@ -5,22 +5,26 @@ config SYS_ARCH default "sparc"
choice - prompt "Target select" + prompt "Board select"
config TARGET_GRSIM_LEON2 - bool "Support grsim_leon2" + bool "GRSIM simulating a LEON2 board"
config TARGET_GR_CPCI_AX2000 - bool "Support gr_cpci_ax2000" + bool "Gaisler GR-CPCI-AX2000 board"
config TARGET_GR_EP2S60 - bool "Support gr_ep2s60" + bool "Gaisler Template design for Altera NIOS board with Stratix EP2S60" + help + Gaisler Research AB's Template design (GPL Open Source SPARC/LEON3 + 96MHz) for Altera NIOS Development board Stratix II edition, + with the FPGA device EP2S60.
config TARGET_GR_XC3S_1500 - bool "Support gr_xc3s_1500" + bool "Gaisler GR-XC3S-1500 spartan board"
config TARGET_GRSIM - bool "Support grsim" + bool "GRSIM simulating a LEON3 GR-XC3S-1500 board"
endchoice

On Thu, Oct 30, 2014 at 03:30:54PM +0900, Masahiro Yamada wrote:
The Board names in the board select menu were simply taken from the board directory name by a conversion tool when switching to Kconfig.
Let's use more descriptive prompts taken from include/configs/gr*.h and board/gaisler/*/config.mk.
Signed-off-by: Masahiro Yamada yamada.m@jp.panasonic.com Cc: Daniel Hellstrom daniel@gaisler.com
Applied to u-boot/master, thanks!

Signed-off-by: Masahiro Yamada yamada.m@jp.panasonic.com Cc: Daniel Hellstrom daniel@gaisler.com ---
arch/sparc/Kconfig | 16 ++++++++++++++++ arch/sparc/cpu/leon2/config.mk | 2 -- arch/sparc/cpu/leon3/config.mk | 2 -- 3 files changed, 16 insertions(+), 4 deletions(-)
diff --git a/arch/sparc/Kconfig b/arch/sparc/Kconfig index 24bdccb..56bdae6 100644 --- a/arch/sparc/Kconfig +++ b/arch/sparc/Kconfig @@ -4,17 +4,31 @@ menu "SPARC architecture" config SYS_ARCH default "sparc"
+config LEON + bool + +config LEON2 + bool + select LEON + +config LEON3 + bool + select LEON + choice prompt "Board select"
config TARGET_GRSIM_LEON2 bool "GRSIM simulating a LEON2 board" + select LEON2
config TARGET_GR_CPCI_AX2000 bool "Gaisler GR-CPCI-AX2000 board" + select LEON3
config TARGET_GR_EP2S60 bool "Gaisler Template design for Altera NIOS board with Stratix EP2S60" + select LEON3 help Gaisler Research AB's Template design (GPL Open Source SPARC/LEON3 96MHz) for Altera NIOS Development board Stratix II edition, @@ -22,9 +36,11 @@ config TARGET_GR_EP2S60
config TARGET_GR_XC3S_1500 bool "Gaisler GR-XC3S-1500 spartan board" + select LEON3
config TARGET_GRSIM bool "GRSIM simulating a LEON3 GR-XC3S-1500 board" + select LEON3
endchoice
diff --git a/arch/sparc/cpu/leon2/config.mk b/arch/sparc/cpu/leon2/config.mk index c44b093..15ba1be 100644 --- a/arch/sparc/cpu/leon2/config.mk +++ b/arch/sparc/cpu/leon2/config.mk @@ -6,5 +6,3 @@ #
PLATFORM_RELFLAGS += -fPIC - -PLATFORM_CPPFLAGS += -DCONFIG_LEON -DCONFIG_LEON2 diff --git a/arch/sparc/cpu/leon3/config.mk b/arch/sparc/cpu/leon3/config.mk index ca6c9b1..15ba1be 100644 --- a/arch/sparc/cpu/leon3/config.mk +++ b/arch/sparc/cpu/leon3/config.mk @@ -6,5 +6,3 @@ #
PLATFORM_RELFLAGS += -fPIC - -PLATFORM_CPPFLAGS += -DCONFIG_LEON -DCONFIG_LEON3

On Thu, Oct 30, 2014 at 03:30:55PM +0900, Masahiro Yamada wrote:
Signed-off-by: Masahiro Yamada yamada.m@jp.panasonic.com Cc: Daniel Hellstrom daniel@gaisler.com
Applied to u-boot/master, thanks!

Remove arch/sparc/cpu/{leon2,leon3}/config.mk and move duplicated defines of -fPIC to arch/sparc/config.mk.
Signed-off-by: Masahiro Yamada yamada.m@jp.panasonic.com Cc: Daniel Hellstrom daniel@gaisler.com ---
arch/sparc/config.mk | 2 ++ arch/sparc/cpu/leon2/config.mk | 8 -------- arch/sparc/cpu/leon3/config.mk | 8 -------- 3 files changed, 2 insertions(+), 16 deletions(-) delete mode 100644 arch/sparc/cpu/leon2/config.mk delete mode 100644 arch/sparc/cpu/leon3/config.mk
diff --git a/arch/sparc/config.mk b/arch/sparc/config.mk index 196d28a..d615f29 100644 --- a/arch/sparc/config.mk +++ b/arch/sparc/config.mk @@ -15,3 +15,5 @@ CONFIG_STANDALONE_LOAD_ADDR ?= 0x00000000 -L $(gcclibdir) \ -T $(srctree)/examples/standalone/sparc.lds
PLATFORM_CPPFLAGS += -D__sparc__ + +PLATFORM_RELFLAGS += -fPIC diff --git a/arch/sparc/cpu/leon2/config.mk b/arch/sparc/cpu/leon2/config.mk deleted file mode 100644 index 15ba1be..0000000 --- a/arch/sparc/cpu/leon2/config.mk +++ /dev/null @@ -1,8 +0,0 @@ -# -# (C) Copyright 2003 -# Wolfgang Denk, DENX Software Engineering, wd@denx.de. -# -# SPDX-License-Identifier: GPL-2.0+ -# - -PLATFORM_RELFLAGS += -fPIC diff --git a/arch/sparc/cpu/leon3/config.mk b/arch/sparc/cpu/leon3/config.mk deleted file mode 100644 index 15ba1be..0000000 --- a/arch/sparc/cpu/leon3/config.mk +++ /dev/null @@ -1,8 +0,0 @@ -# -# (C) Copyright 2003 -# Wolfgang Denk, DENX Software Engineering, wd@denx.de. -# -# SPDX-License-Identifier: GPL-2.0+ -# - -PLATFORM_RELFLAGS += -fPIC

On Thu, Oct 30, 2014 at 03:30:56PM +0900, Masahiro Yamada wrote:
Remove arch/sparc/cpu/{leon2,leon3}/config.mk and move duplicated defines of -fPIC to arch/sparc/config.mk.
Signed-off-by: Masahiro Yamada yamada.m@jp.panasonic.com Cc: Daniel Hellstrom daniel@gaisler.com
Applied to u-boot/master, thanks!

For now, all the SPARC boards in U-Boot are provided by Gaisler.
Signed-off-by: Masahiro Yamada yamada.m@jp.panasonic.com Cc: Daniel Hellstrom daniel@gaisler.com ---
arch/sparc/Kconfig | 13 ++++++++++--- board/gaisler/gr_cpci_ax2000/Kconfig | 6 ------ board/gaisler/gr_ep2s60/Kconfig | 6 ------ board/gaisler/gr_xc3s_1500/Kconfig | 6 ------ board/gaisler/grsim/Kconfig | 6 ------ board/gaisler/grsim_leon2/Kconfig | 6 ------ 6 files changed, 10 insertions(+), 33 deletions(-)
diff --git a/arch/sparc/Kconfig b/arch/sparc/Kconfig index 56bdae6..2df09b2 100644 --- a/arch/sparc/Kconfig +++ b/arch/sparc/Kconfig @@ -1,9 +1,6 @@ menu "SPARC architecture" depends on SPARC
-config SYS_ARCH - default "sparc" - config LEON bool
@@ -44,6 +41,16 @@ config TARGET_GRSIM
endchoice
+config SYS_ARCH + default "sparc" + +config SYS_CPU + default "leon2" if LEON2 + default "leon3" if LEON3 + +config SYS_VENDOR + default "gaisler" + source "board/gaisler/gr_cpci_ax2000/Kconfig" source "board/gaisler/gr_ep2s60/Kconfig" source "board/gaisler/gr_xc3s_1500/Kconfig" diff --git a/board/gaisler/gr_cpci_ax2000/Kconfig b/board/gaisler/gr_cpci_ax2000/Kconfig index 8da0504..c12a002 100644 --- a/board/gaisler/gr_cpci_ax2000/Kconfig +++ b/board/gaisler/gr_cpci_ax2000/Kconfig @@ -1,14 +1,8 @@ if TARGET_GR_CPCI_AX2000
-config SYS_CPU - default "leon3" - config SYS_BOARD default "gr_cpci_ax2000"
-config SYS_VENDOR - default "gaisler" - config SYS_CONFIG_NAME default "gr_cpci_ax2000"
diff --git a/board/gaisler/gr_ep2s60/Kconfig b/board/gaisler/gr_ep2s60/Kconfig index 00b2097..f49937c 100644 --- a/board/gaisler/gr_ep2s60/Kconfig +++ b/board/gaisler/gr_ep2s60/Kconfig @@ -1,14 +1,8 @@ if TARGET_GR_EP2S60
-config SYS_CPU - default "leon3" - config SYS_BOARD default "gr_ep2s60"
-config SYS_VENDOR - default "gaisler" - config SYS_CONFIG_NAME default "gr_ep2s60"
diff --git a/board/gaisler/gr_xc3s_1500/Kconfig b/board/gaisler/gr_xc3s_1500/Kconfig index 765e028..e695ba2 100644 --- a/board/gaisler/gr_xc3s_1500/Kconfig +++ b/board/gaisler/gr_xc3s_1500/Kconfig @@ -1,14 +1,8 @@ if TARGET_GR_XC3S_1500
-config SYS_CPU - default "leon3" - config SYS_BOARD default "gr_xc3s_1500"
-config SYS_VENDOR - default "gaisler" - config SYS_CONFIG_NAME default "gr_xc3s_1500"
diff --git a/board/gaisler/grsim/Kconfig b/board/gaisler/grsim/Kconfig index 751fa03..18598d3 100644 --- a/board/gaisler/grsim/Kconfig +++ b/board/gaisler/grsim/Kconfig @@ -1,14 +1,8 @@ if TARGET_GRSIM
-config SYS_CPU - default "leon3" - config SYS_BOARD default "grsim"
-config SYS_VENDOR - default "gaisler" - config SYS_CONFIG_NAME default "grsim"
diff --git a/board/gaisler/grsim_leon2/Kconfig b/board/gaisler/grsim_leon2/Kconfig index 0907f3a..0d21a0a 100644 --- a/board/gaisler/grsim_leon2/Kconfig +++ b/board/gaisler/grsim_leon2/Kconfig @@ -1,14 +1,8 @@ if TARGET_GRSIM_LEON2
-config SYS_CPU - default "leon2" - config SYS_BOARD default "grsim_leon2"
-config SYS_VENDOR - default "gaisler" - config SYS_CONFIG_NAME default "grsim_leon2"

On Thu, Oct 30, 2014 at 03:30:57PM +0900, Masahiro Yamada wrote:
For now, all the SPARC boards in U-Boot are provided by Gaisler.
Signed-off-by: Masahiro Yamada yamada.m@jp.panasonic.com Cc: Daniel Hellstrom daniel@gaisler.com
Applied to u-boot/master, thanks!

Defining CONFIG_SYS_TEXT_BASE in config.mk is very old style.
Create CONFIG_SYS_TEXT_BASE option in Kconfig, but let it depend on CONFIG_SPARC because we do not want to disturb the other architectures that still define CONFIG_SYS_TEXT_BASE in their header files.
Signed-off-by: Masahiro Yamada yamada.m@jp.panasonic.com Cc: Daniel Hellstrom daniel@gaisler.com ---
Kconfig | 6 ++++++ board/gaisler/gr_cpci_ax2000/config.mk | 19 ------------------- board/gaisler/gr_ep2s60/config.mk | 17 ----------------- board/gaisler/gr_xc3s_1500/config.mk | 16 ---------------- board/gaisler/grsim/config.mk | 16 ---------------- board/gaisler/grsim_leon2/config.mk | 16 ---------------- configs/gr_cpci_ax2000_defconfig | 1 + configs/gr_ep2s60_defconfig | 1 + configs/gr_xc3s_1500_defconfig | 1 + configs/grsim_defconfig | 1 + configs/grsim_leon2_defconfig | 1 + 11 files changed, 11 insertions(+), 84 deletions(-) delete mode 100644 board/gaisler/gr_cpci_ax2000/config.mk delete mode 100644 board/gaisler/gr_ep2s60/config.mk delete mode 100644 board/gaisler/gr_xc3s_1500/config.mk delete mode 100644 board/gaisler/grsim/config.mk delete mode 100644 board/gaisler/grsim_leon2/config.mk
diff --git a/Kconfig b/Kconfig index 932fc8b..f34f341 100644 --- a/Kconfig +++ b/Kconfig @@ -107,6 +107,12 @@ config SYS_EXTRA_OPTIONS configuration to Kconfig. Since this option will be removed sometime, new boards should not use this option.
+config SYS_TEXT_BASE + depends on SPARC + hex "Text Base" + help + TODO: Move CONFIG_SYS_TEXT_BASE for all the architecture + endmenu # Boot images
source "arch/Kconfig" diff --git a/board/gaisler/gr_cpci_ax2000/config.mk b/board/gaisler/gr_cpci_ax2000/config.mk deleted file mode 100644 index 731a539..0000000 --- a/board/gaisler/gr_cpci_ax2000/config.mk +++ /dev/null @@ -1,19 +0,0 @@ -# -# (C) Copyright 2008 -# Daniel Hellstrom, Gaisler Research, daniel@gaisler.com. -# -# SPDX-License-Identifier: GPL-2.0+ -# - -# -# GR-CPCI-AX2000 board -# - -# U-BOOT IN FLASH -CONFIG_SYS_TEXT_BASE = 0x00000000 - -# U-BOOT IN RAM or SDRAM with -nosram flag set when starting GRMON -#CONFIG_SYS_TEXT_BASE = 0x40000000 - -# U-BOOT IN SDRAM -#CONFIG_SYS_TEXT_BASE = 0x60000000 diff --git a/board/gaisler/gr_ep2s60/config.mk b/board/gaisler/gr_ep2s60/config.mk deleted file mode 100644 index 6e01f07..0000000 --- a/board/gaisler/gr_ep2s60/config.mk +++ /dev/null @@ -1,17 +0,0 @@ -# -# (C) Copyright 2008 -# Daniel Hellstrom, Gaisler Research, daniel@gaisler.com. -# -# SPDX-License-Identifier: GPL-2.0+ -# - -# -# Altera NIOS delopment board Stratix II edition, FPGA device EP2S60, -# with GRLIB Template design (GPL Open Source SPARC/LEON3) -# - -# U-BOOT IN FLASH -CONFIG_SYS_TEXT_BASE = 0x00000000 - -# U-BOOT IN SDRAM -#CONFIG_SYS_TEXT_BASE = 0x40000000 diff --git a/board/gaisler/gr_xc3s_1500/config.mk b/board/gaisler/gr_xc3s_1500/config.mk deleted file mode 100644 index e4a66cb..0000000 --- a/board/gaisler/gr_xc3s_1500/config.mk +++ /dev/null @@ -1,16 +0,0 @@ -# -# (C) Copyright 2007 -# Daniel Hellstrom, Gaisler Research, daniel@gaisler.com. -# -# SPDX-License-Identifier: GPL-2.0+ -# - -# -# GR-XC3S-1500 board -# - -# U-BOOT IN FLASH -CONFIG_SYS_TEXT_BASE = 0x00000000 - -# U-BOOT IN RAM -#CONFIG_SYS_TEXT_BASE = 0x40000000 diff --git a/board/gaisler/grsim/config.mk b/board/gaisler/grsim/config.mk deleted file mode 100644 index d1f61da..0000000 --- a/board/gaisler/grsim/config.mk +++ /dev/null @@ -1,16 +0,0 @@ -# -# (C) Copyright 2007 -# Daniel Hellstrom, Gaisler Research, daniel@gaisler.com -# -# SPDX-License-Identifier: GPL-2.0+ -# - -# -# GRSIM simulating a LEON3 GR-XC3S-1500 board -# - -# U-BOOT IN FLASH -CONFIG_SYS_TEXT_BASE = 0x00000000 - -# U-BOOT IN RAM -#CONFIG_SYS_TEXT_BASE = 0x40000000 diff --git a/board/gaisler/grsim_leon2/config.mk b/board/gaisler/grsim_leon2/config.mk deleted file mode 100644 index f98b23b..0000000 --- a/board/gaisler/grsim_leon2/config.mk +++ /dev/null @@ -1,16 +0,0 @@ -# -# (C) Copyright 2007 -# Daniel Hellstrom, Gaisler Research, daniel@gaisler.com -# -# SPDX-License-Identifier: GPL-2.0+ -# - -# -# GRSIM simulating a LEON2 board -# - -# RUN U-BOOT FROM PROM -CONFIG_SYS_TEXT_BASE = 0x00000000 - -# RUN U-BOOT FROM RAM -#CONFIG_SYS_TEXT_BASE = 0x40000000 diff --git a/configs/gr_cpci_ax2000_defconfig b/configs/gr_cpci_ax2000_defconfig index 6eb02ad..b59d077 100644 --- a/configs/gr_cpci_ax2000_defconfig +++ b/configs/gr_cpci_ax2000_defconfig @@ -1,2 +1,3 @@ +CONFIG_SYS_TEXT_BASE=0x00000000 CONFIG_SPARC=y CONFIG_TARGET_GR_CPCI_AX2000=y diff --git a/configs/gr_ep2s60_defconfig b/configs/gr_ep2s60_defconfig index 6e1eb83..2c69efa 100644 --- a/configs/gr_ep2s60_defconfig +++ b/configs/gr_ep2s60_defconfig @@ -1,2 +1,3 @@ +CONFIG_SYS_TEXT_BASE=0x00000000 CONFIG_SPARC=y CONFIG_TARGET_GR_EP2S60=y diff --git a/configs/gr_xc3s_1500_defconfig b/configs/gr_xc3s_1500_defconfig index da846db..fecdd25 100644 --- a/configs/gr_xc3s_1500_defconfig +++ b/configs/gr_xc3s_1500_defconfig @@ -1,2 +1,3 @@ +CONFIG_SYS_TEXT_BASE=0x00000000 CONFIG_SPARC=y CONFIG_TARGET_GR_XC3S_1500=y diff --git a/configs/grsim_defconfig b/configs/grsim_defconfig index 2a7e8e7..e3ffd69 100644 --- a/configs/grsim_defconfig +++ b/configs/grsim_defconfig @@ -1,2 +1,3 @@ +CONFIG_SYS_TEXT_BASE=0x00000000 CONFIG_SPARC=y CONFIG_TARGET_GRSIM=y diff --git a/configs/grsim_leon2_defconfig b/configs/grsim_leon2_defconfig index e91eb96..6090e34 100644 --- a/configs/grsim_leon2_defconfig +++ b/configs/grsim_leon2_defconfig @@ -1,2 +1,3 @@ +CONFIG_SYS_TEXT_BASE=0x00000000 CONFIG_SPARC=y CONFIG_TARGET_GRSIM_LEON2=y

On Thu, Oct 30, 2014 at 03:30:58PM +0900, Masahiro Yamada wrote:
Defining CONFIG_SYS_TEXT_BASE in config.mk is very old style.
Create CONFIG_SYS_TEXT_BASE option in Kconfig, but let it depend on CONFIG_SPARC because we do not want to disturb the other architectures that still define CONFIG_SYS_TEXT_BASE in their header files.
Signed-off-by: Masahiro Yamada yamada.m@jp.panasonic.com Cc: Daniel Hellstrom daniel@gaisler.com
Applied to u-boot/master, thanks!
participants (2)
-
Masahiro Yamada
-
Tom Rini