Skip to contentSkip to conversation

sparc: some refactoring before generic board conversion and a new board

PATCH New Masahiro Yamada 2 participants 11 messages Oct 30, 2014 – Nov 4, 2014 SPARC + UltraSPARC (sparc/sparc64)

lore
Share & tools
lore
#0 lore raw

cover 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
Signature · 1 line
1.9.1
#1 lore raw

PATCH 1/5 sparc: Use nicer prompt for board select menu

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.

Cc Daniel Hellstrom <[email protected]>

---

 arch/sparc/Kconfig | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)
arch/sparc/Kconfig +10 -6
index 733334f..24bdccb 100644
@@ -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
 
Signature · 1 line
1.9.1
#2 lore raw

PATCH 1/5 sparc: Use nicer prompt for board select menu

Quoted 8 lines · Masahiro Yamada

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.

Cc Daniel Hellstrom <[email protected]>

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20141104/68cd03d3/attachment.pgp>
#3 lore raw

PATCH 2/5 sparc: move CONFIG_{LEON, LEON2, LEON3} to Kconfig

In reply to Masahiro Yamada
Cc Daniel Hellstrom <[email protected]>

---

 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(-)
arch/sparc/Kconfig +16 -0
index 24bdccb..56bdae6 100644
@@ -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
 
arch/sparc/cpu/leon2/config.mk +0 -2
index c44b093..15ba1be 100644
@@ -6,5 +6,3 @@
 #
 
 PLATFORM_RELFLAGS += -fPIC
-
-PLATFORM_CPPFLAGS += -DCONFIG_LEON -DCONFIG_LEON2
arch/sparc/cpu/leon3/config.mk +0 -2
index ca6c9b1..15ba1be 100644
@@ -6,5 +6,3 @@
 #
 
 PLATFORM_RELFLAGS += -fPIC
-
-PLATFORM_CPPFLAGS += -DCONFIG_LEON -DCONFIG_LEON3
Signature · 1 line
1.9.1
#4 lore raw

PATCH 2/5 sparc: move CONFIG_{LEON, LEON2, LEON3} to Kconfig

Quoted 2 lines · Masahiro Yamada
Cc Daniel Hellstrom <[email protected]>

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20141104/91be35d8/attachment.pgp>
#5 lore raw

PATCH 3/5 sparc: merge arch/sparc/cpu/*/config.mk to arch/sparc/config.mk

In reply to Masahiro Yamada

Remove arch/sparc/cpu/{leon2,leon3}/config.mk and move duplicated defines of -fPIC to arch/sparc/config.mk.

Cc Daniel Hellstrom <[email protected]>

---

 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
arch/sparc/config.mk +2 -0
index 196d28a..d615f29 100644
@@ -15,3 +15,5 @@ CONFIG_STANDALONE_LOAD_ADDR ?= 0x00000000 -L $(gcclibdir) \
 			       -T $(srctree)/examples/standalone/sparc.lds
 
 PLATFORM_CPPFLAGS += -D__sparc__
+
+PLATFORM_RELFLAGS += -fPIC
arch/sparc/cpu/leon2/config.mk deleted +0 -8
deleted file mode 100644
index 15ba1be..0000000
@@ -1,8 +0,0 @@
-#
-# (C) Copyright 2003
-# Wolfgang Denk, DENX Software Engineering, wd at denx.de.
-#
-# SPDX-License-Identifier:	GPL-2.0+
-#
-
-PLATFORM_RELFLAGS += -fPIC
arch/sparc/cpu/leon3/config.mk deleted +0 -8
deleted file mode 100644
index 15ba1be..0000000
@@ -1,8 +0,0 @@
-#
-# (C) Copyright 2003
-# Wolfgang Denk, DENX Software Engineering, wd at denx.de.
-#
-# SPDX-License-Identifier:	GPL-2.0+
-#
-
-PLATFORM_RELFLAGS += -fPIC
Signature · 1 line
1.9.1
#6 lore raw

PATCH 3/5 sparc: merge arch/sparc/cpu/*/config.mk to arch/sparc/config.mk

Quoted 5 lines · Masahiro Yamada

Remove arch/sparc/cpu/{leon2,leon3}/config.mk and move duplicated defines of -fPIC to arch/sparc/config.mk.

Cc Daniel Hellstrom <[email protected]>

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20141104/9d5bd4f9/attachment.pgp>
#7 lore raw

PATCH 4/5 sparc: merge CONFIG_SYS_CPU and CONFIG_SYS_VENDOR defines

In reply to Masahiro Yamada

For now, all the SPARC boards in U-Boot are provided by Gaisler.

Cc Daniel Hellstrom <[email protected]>

---

 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(-)
arch/sparc/Kconfig +10 -3
index 56bdae6..2df09b2 100644
@@ -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"
board/gaisler/gr_cpci_ax2000/Kconfig +0 -6
index 8da0504..c12a002 100644
@@ -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"
 
board/gaisler/gr_ep2s60/Kconfig +0 -6
index 00b2097..f49937c 100644
@@ -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"
 
board/gaisler/gr_xc3s_1500/Kconfig +0 -6
index 765e028..e695ba2 100644
@@ -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"
 
board/gaisler/grsim/Kconfig +0 -6
index 751fa03..18598d3 100644
@@ -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"
 
board/gaisler/grsim_leon2/Kconfig +0 -6
index 0907f3a..0d21a0a 100644
@@ -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"
 
Signature · 1 line
1.9.1
#8 lore raw

PATCH 4/5 sparc: merge CONFIG_SYS_CPU and CONFIG_SYS_VENDOR defines

Quoted 4 lines · Masahiro Yamada

For now, all the SPARC boards in U-Boot are provided by Gaisler.

Cc Daniel Hellstrom <[email protected]>

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20141104/b56d9f26/attachment.pgp>
#9 lore raw

PATCH 5/5 sparc: move CONFIG_SYS_TEXT_BASE to Kconfig

In reply to Masahiro Yamada

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.

Cc Daniel Hellstrom <[email protected]>

---

 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
Kconfig +6 -0
index 932fc8b..f34f341 100644
@@ -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"
board/gaisler/gr_cpci_ax2000/config.mk deleted +0 -19
deleted file mode 100644
index 731a539..0000000
@@ -1,19 +0,0 @@
-#
-# (C) Copyright 2008
-# Daniel Hellstrom, Gaisler Research, daniel at 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
board/gaisler/gr_ep2s60/config.mk deleted +0 -17
deleted file mode 100644
index 6e01f07..0000000
@@ -1,17 +0,0 @@
-#
-# (C) Copyright 2008
-# Daniel Hellstrom, Gaisler Research, daniel at 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
board/gaisler/gr_xc3s_1500/config.mk deleted +0 -16
deleted file mode 100644
index e4a66cb..0000000
@@ -1,16 +0,0 @@
-#
-# (C) Copyright 2007
-# Daniel Hellstrom, Gaisler Research, daniel at 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
board/gaisler/grsim/config.mk deleted +0 -16
deleted file mode 100644
index d1f61da..0000000
@@ -1,16 +0,0 @@
-#
-# (C) Copyright 2007
-# Daniel Hellstrom, Gaisler Research, daniel at 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
board/gaisler/grsim_leon2/config.mk deleted +0 -16
deleted file mode 100644
index f98b23b..0000000
@@ -1,16 +0,0 @@
-#
-# (C) Copyright 2007
-# Daniel Hellstrom, Gaisler Research, daniel at 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
configs/gr_cpci_ax2000_defconfig +1 -0
index 6eb02ad..b59d077 100644
@@ -1,2 +1,3 @@
+CONFIG_SYS_TEXT_BASE=0x00000000
 CONFIG_SPARC=y
 CONFIG_TARGET_GR_CPCI_AX2000=y
configs/gr_ep2s60_defconfig +1 -0
index 6e1eb83..2c69efa 100644
@@ -1,2 +1,3 @@
+CONFIG_SYS_TEXT_BASE=0x00000000
 CONFIG_SPARC=y
 CONFIG_TARGET_GR_EP2S60=y
configs/gr_xc3s_1500_defconfig +1 -0
index da846db..fecdd25 100644
@@ -1,2 +1,3 @@
+CONFIG_SYS_TEXT_BASE=0x00000000
 CONFIG_SPARC=y
 CONFIG_TARGET_GR_XC3S_1500=y
configs/grsim_defconfig +1 -0
index 2a7e8e7..e3ffd69 100644
@@ -1,2 +1,3 @@
+CONFIG_SYS_TEXT_BASE=0x00000000
 CONFIG_SPARC=y
 CONFIG_TARGET_GRSIM=y
configs/grsim_leon2_defconfig +1 -0
index e91eb96..6090e34 100644
@@ -1,2 +1,3 @@
+CONFIG_SYS_TEXT_BASE=0x00000000
 CONFIG_SPARC=y
 CONFIG_TARGET_GRSIM_LEON2=y
Signature · 1 line
1.9.1
#10 lore raw

PATCH 5/5 sparc: move CONFIG_SYS_TEXT_BASE to Kconfig

Quoted 9 lines · Masahiro Yamada

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.

Cc Daniel Hellstrom <[email protected]>

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20141104/14f2fd64/attachment.pgp>