Skip to contentSkip to conversation

Adding Configuration option for TQM5200S Board on Goetting

PATCH New Axel Beierlein 3 participants 4 messages Jul 24, 2009 – Aug 9, 2009 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Adding Configuration option for TQM5200S Board on Goetting

---
 Makefile                    |    7 +++++++
 board/tqc/tqm5200/tqm5200.c |    9 ++++++++-
 include/configs/TQM5200.h   |   33 ++++++++++++++++++++++++++-------
 3 files changed, 41 insertions(+), 8 deletions(-)
Makefile +7 -0
index 2a06440..7f197dd 100644
@@ -764,6 +764,7 @@ Total5200_Rev2_lowboot_config:	unconfig
 		}
 	@$(MKCONFIG) -a Total5200 ppc mpc5xxx total5200
 
+HG43630_config \
 cam5200_config \
 cam5200_niosflash_config \
 fo300_config \
@@ -808,6 +809,12 @@ TQM5200_STK100_config:	unconfig
 	@[ -z "$(findstring HIGHBOOT,$@)" ] || \
 		{ echo "TEXT_BASE = 0xFFF00000" >$(obj)board/tqm5200/config.tmp ; \
 		}
+	@[ -z "$(findstring HG43630,$@)" ] || \
+		{ echo "#define CONFIG_HG43630"	>>$(obj)include/config.h ; \
+		  echo "#define CONFIG_TQM5200S"	>>$(obj)include/config.h ; \
+		  echo "#define CONFIG_TQM5200_B"	>>$(obj)include/config.h ; \
+		  $(XECHO) "... TQM5200S on Goetting HG43630 Board" ; \
+		}
 	@$(MKCONFIG) -n $@ -a TQM5200 ppc mpc5xxx tqm5200 tqc
 
 uc101_config:		unconfig
board/tqc/tqm5200/tqm5200.c +8 -1
index faa2e02..0d69e86 100644
@@ -255,6 +255,10 @@ int checkboard (void)
 # error "UNKNOWN"
 #endif
 
+#ifdef CONFIG_HG43630
+#define CARRIER_NAME "HG43630"
+#endif
+
 	puts (	"Board: " MODULE_NAME " (TQ-Components GmbH)\n"
 		"       on a " CARRIER_NAME " carrier board\n");
 
@@ -646,7 +650,7 @@ void video_get_info_str (int line_number, char *info)
 {
 	if (line_number == 1) {
 	strcpy (info, " Board: TQM5200 (TQ-Components GmbH)");
-#if defined (CONFIG_STK52XX) || defined (CONFIG_TB5200) || defined(CONFIG_FO300)
+#if defined (CONFIG_STK52XX) || defined (CONFIG_TB5200) || defined(CONFIG_FO300) || defined(CONFIG_HG43630)
 	} else if (line_number == 2) {
 #if defined (CONFIG_STK52XX)
 		strcpy (info, "        on a STK52xx carrier board");
@@ -657,6 +661,9 @@ void video_get_info_str (int line_number, char *info)
 #if defined (CONFIG_FO300)
 		strcpy (info, "        on a FO300 carrier board");
 #endif
+#if defined (CONFIG_HG43630)
+		strcpy (info, "        on a HG43630 carrier board");
+#endif
 #endif
 	}
 	else {
include/configs/TQM5200.h +26 -7
index a4336a7..0f5ff77 100644
@@ -71,7 +71,7 @@
 							/* switch is open */
 #endif	/* CONFIG_FO300 */
 
-#ifdef CONFIG_STK52XX
+#if defined(CONFIG_STK52XX) && !defined(CONFIG_HG43630)
 #define CONFIG_PS2KBD			/* AT-PS/2 Keyboard		*/
 #define CONFIG_PS2MULT			/* .. on PS/2 Multiplexer	*/
 #define CONFIG_PS2SERIAL	6	/* .. on PSC6			*/
@@ -85,6 +85,7 @@
  * 0x50000000 - 0x50ffffff - PCI IO Space
  */
 #ifdef CONFIG_STK52XX
+#ifndef CONFIG_HG43630
 #define CONFIG_PCI		1
 #define CONFIG_PCI_PNP		1
 /* #define CONFIG_PCI_SCAN_SHOW	1 */
@@ -96,7 +97,7 @@
 #define CONFIG_PCI_IO_BUS	0x50000000
 #define CONFIG_PCI_IO_PHYS	CONFIG_PCI_IO_BUS
 #define CONFIG_PCI_IO_SIZE	0x01000000
-
+#endif/* ifndef(CONFIG_HG43630)*/
 #define CONFIG_NET_MULTI	1
 #define CONFIG_EEPRO100		1
 #define CONFIG_SYS_RX_ETH_BUFFER	8  /* use 8 rx buffer on eepro100  */
@@ -132,7 +133,7 @@
 #define CONFIG_ISO_PARTITION
 
 /* USB */
-#if defined(CONFIG_STK52XX) || defined(CONFIG_FO300)
+#if defined(CONFIG_STK52XX) || defined(CONFIG_FO300) && !defined(CONFIG_HG43630)
 #define CONFIG_USB_OHCI_NEW
 #define CONFIG_SYS_OHCI_BE_CONTROLLER
 #define CONFIG_USB_STORAGE
@@ -196,7 +197,7 @@
 #define CONFIG_PCIAUTO_SKIP_HOST_BRIDGE	1
 #endif
 
-#if defined(CONFIG_MINIFAP) || defined(CONFIG_STK52XX) || defined(CONFIG_FO300)
+#if defined(CONFIG_MINIFAP) || defined(CONFIG_STK52XX) || defined(CONFIG_FO300) 
     #define CONFIG_CMD_IDE
     #define CONFIG_CMD_FAT
     #define CONFIG_CMD_EXT2
@@ -223,6 +224,11 @@
  */
 #define CONFIG_BOOTDELAY	5	/* autoboot after 5 seconds */
 
+#if defined(CONFIG_HG43630)
+#define CONFIG_AUTOBOOT_KEYED
+#define CONFIG_AUTOBOOT_STOP_STR	"HG"
+#endif
+
 #define CONFIG_PREBOOT	"echo;" \
 	"echo Type \\\"run flash_nfs\\\" to mount root filesystem over NFS;" \
 	"echo"
@@ -262,6 +268,7 @@
 	"kernel_addr=FC140000\0"					\
 	"ramdisk_addr=FC600000\0"
 #else	/* !CONFIG_TQM5200_B */
+
 #define ENV_FLASH_LAYOUT						\
 	"fdt_addr=FC0A0000\0"						\
 	"kernel_addr=FC0C0000\0"					\
@@ -415,6 +422,15 @@
 #ifdef CONFIG_STK52XX
 # if defined(CONFIG_TQM5200_B)
 #  if defined(CONFIG_SYS_LOWBOOT)
+#   if defined(CONFIG_HG43630) 
+#   define MTDPARTS_DEFAULT	"mtdparts=TQM5200-0:512k(u-boot),"	\
+						"512k(env),"		\
+						"2m(kernel),"		\
+						"16m(ramfs1),"		\
+						"5m(ramfs2),"		\
+						"8m(jffs2)"		\
+
+#   else
 #   define MTDPARTS_DEFAULT	"mtdparts=TQM5200-0:1m(firmware),"	\
 						"256k(dtb),"		\
 						"2304k(kernel),"	\
@@ -422,6 +438,7 @@
 						"2m(initrd),"		\
 						"8m(misc),"		\
 						"16m(big-fs)"
+#   endif /* CONFIG_HG43630 */
 #  else	/* highboot */
 #   define MTDPARTS_DEFAULT	"mtdparts=TQM5200-0:2560k(kernel),"	\
 						"3584k(small-fs),"	\
@@ -700,13 +717,16 @@
 
 #undef	CONFIG_IDE_8xx_DIRECT		/* Direct IDE	 not supported	*/
 #undef	CONFIG_IDE_LED			/* LED	 for ide not supported	*/
-
 #define CONFIG_IDE_RESET		/* reset for ide supported	*/
 #define CONFIG_IDE_PREINIT
 
+#ifndef CONFIG_HG43630
 #define CONFIG_SYS_IDE_MAXBUS		1	/* max. 1 IDE bus		*/
 #define CONFIG_SYS_IDE_MAXDEVICE	2	/* max. 2 drives per IDE bus	*/
-
+#else
+#define CONFIG_SYS_IDE_MAXBUS		0
+#define CONFIG_SYS_IDE_MAXDEVICE	0
+#endif /* CONFIG_HG43630 */
 #define CONFIG_SYS_ATA_IDE0_OFFSET	0x0000
 
 #define CONFIG_SYS_ATA_BASE_ADDR	MPC5XXX_ATA
@@ -725,7 +745,6 @@
 
 /* Support ATAPI devices */
 #define CONFIG_ATAPI            1
-
 /*-----------------------------------------------------------------------
  * Open firmware flat tree support
  *-----------------------------------------------------------------------
Signature · 1 line
1.5.6.3
#1 lore raw

PATCH 1/1 Adding Configuration option for TQM5200S Board on Goetting

Dear Axel Beierlein,

Quoted 12 lines · In message <[email protected]> you wrote:
---
 Makefile                    |    7 +++++++
 board/tqc/tqm5200/tqm5200.c |    9 ++++++++-
 include/configs/TQM5200.h   |   33 ++++++++++++++++++++++++++-------
 3 files changed, 41 insertions(+), 8 deletions(-)
Makefile +0 -0
index 2a06440..7f197dd 100644

Makefile Total5200_Rev2_lowboot_config: unconfig · line 770

Quoted 7 lines
Makefile +1 -0
@@ -764,6 +764,7 @@ Total5200_Rev2_lowboot_config:	unconfig
 		}
 	@$(MKCONFIG) -a Total5200 ppc mpc5xxx total5200
 
+HG43630_config \
 cam5200_config \
 cam5200_niosflash_config \
 fo300_config \

Please use a lower case board name, and keep list sorted.

Makefile TQM5200_STK100_config: unconfig · line 818

Quoted 11 lines
Makefile +6 -0
@@ -808,6 +809,12 @@ TQM5200_STK100_config:	unconfig
 	@[ -z "$(findstring HIGHBOOT,$@)" ] || \
 		{ echo "TEXT_BASE = 0xFFF00000" >$(obj)board/tqm5200/config.tmp ; \
 		}
+	@[ -z "$(findstring HG43630,$@)" ] || \
+		{ echo "#define CONFIG_HG43630"	>>$(obj)include/config.h ; \
+		  echo "#define CONFIG_TQM5200S"	>>$(obj)include/config.h ; \
+		  echo "#define CONFIG_TQM5200_B"	>>$(obj)include/config.h ; \
+		  $(XECHO) "... TQM5200S on Goetting HG43630 Board" ; \
+		}
 	@$(MKCONFIG) -n $@ -a TQM5200 ppc mpc5xxx tqm5200 tqc

Please don't add board specific configuration to the top level Makefile; do thi sin your board config file instead.

board/tqc/tqm5200/tqm5200.c int checkboard (void) · line 260

Quoted 11 lines
board/tqc/tqm5200/tqm5200.c +3 -0
index faa2e02..0d69e86 100644
@@ -255,6 +255,10 @@ int checkboard (void)
 # error "UNKNOWN"
 #endif
 
+#ifdef CONFIG_HG43630
+#define CARRIER_NAME "HG43630"
+#endif

Please add as "#elif" in the "#if" construct above. And move the block out of checkboard(), please.

board/tqc/tqm5200/tqm5200.c void video_get_info_str (int line_number, char *info) · line 653

Quoted 5 lines
board/tqc/tqm5200/tqm5200.c +1 -1
 {
 	if (line_number == 1) {
 	strcpy (info, " Board: TQM5200 (TQ-Components GmbH)");
-#if defined (CONFIG_STK52XX) || defined (CONFIG_TB5200) || defined(CONFIG_FO300)
+#if defined (CONFIG_STK52XX) || defined (CONFIG_TB5200) || defined(CONFIG_FO300) || defined(CONFIG_HG43630)

Line too long.

board/tqc/tqm5200/tqm5200.c void video_get_info_str (int line_number, char *info) · line 666

Quoted 9 lines

#if defined (CONFIG_STK52XX)

board/tqc/tqm5200/tqm5200.c +3 -0
 		strcpy (info, "        on a STK52xx carrier board");
@@ -657,6 +661,9 @@ void video_get_info_str (int line_number, char *info)
 #if defined (CONFIG_FO300)
 		strcpy (info, "        on a FO300 carrier board");
 #endif
+#if defined (CONFIG_HG43630)
+		strcpy (info, "        on a HG43630 carrier board");
+#endif

It's time to get rid of this "#if" here and use something like

	strcpy (info, "        on a " CARRIER_NAME " carrier board");

instead, as it has been done in checkboard() long ago.

include/configs/TQM5200.h line 74

Quoted 10 lines
include/configs/TQM5200.h +1 -1
index a4336a7..0f5ff77 100644
@@ -71,7 +71,7 @@
 							/* switch is open */
 #endif	/* CONFIG_FO300 */
 
-#ifdef CONFIG_STK52XX
+#if defined(CONFIG_STK52XX) && !defined(CONFIG_HG43630)

Is CONFIG_STK52XX really defined for CONFIG_HG43630? where?

Quoted 12 lines
include/configs/TQM5200.h +1 -0
 #define CONFIG_PS2KBD			/* AT-PS/2 Keyboard		*/
 #define CONFIG_PS2MULT			/* .. on PS/2 Multiplexer	*/
 #define CONFIG_PS2SERIAL	6	/* .. on PSC6			*/
@@ -85,6 +85,7 @@
  * 0x50000000 - 0x50ffffff - PCI IO Space
  */
 #ifdef CONFIG_STK52XX
+#ifndef CONFIG_HG43630
 #define CONFIG_PCI		1
 #define CONFIG_PCI_PNP		1
 /* #define CONFIG_PCI_SCAN_SHOW	1 */

include/configs/TQM5200.h line 100

Quoted 5 lines
include/configs/TQM5200.h +1 -1
@@ -96,7 +97,7 @@
 #define CONFIG_PCI_IO_BUS	0x50000000
 #define CONFIG_PCI_IO_PHYS	CONFIG_PCI_IO_BUS
 #define CONFIG_PCI_IO_SIZE	0x01000000
-
+#endif/* ifndef(CONFIG_HG43630)*/

Add blank line here. But - isn;t it sufficient to only not define CONFIG_PCI, while leaving the rest unchanged?

include/configs/TQM5200.h line 136

Quoted 2 lines
include/configs/TQM5200.h +1 -1
-#if defined(CONFIG_STK52XX) || defined(CONFIG_FO300)
+#if defined(CONFIG_STK52XX) || defined(CONFIG_FO300) && !defined(CONFIG_HG43630)

Are you sure this logic is correct, and necessary?

include/configs/TQM5200.h line 200

Quoted 6 lines
include/configs/TQM5200.h +1 -1
@@ -196,7 +197,7 @@
 #define CONFIG_PCIAUTO_SKIP_HOST_BRIDGE	1
 #endif
 
-#if defined(CONFIG_MINIFAP) || defined(CONFIG_STK52XX) || defined(CONFIG_FO300)
+#if defined(CONFIG_MINIFAP) || defined(CONFIG_STK52XX) || defined(CONFIG_FO300) 

Please do not add trailing white space.

Quoted 16 lines
include/configs/TQM5200.h +9 -0
 #ifdef CONFIG_STK52XX
 # if defined(CONFIG_TQM5200_B)
 #  if defined(CONFIG_SYS_LOWBOOT)
+#   if defined(CONFIG_HG43630) 
+#   define MTDPARTS_DEFAULT	"mtdparts=TQM5200-0:512k(u-boot),"	\
+						"512k(env),"		\
+						"2m(kernel),"		\
+						"16m(ramfs1),"		\
+						"5m(ramfs2),"		\
+						"8m(jffs2)"		\
+
+#   else
 #   define MTDPARTS_DEFAULT	"mtdparts=TQM5200-0:1m(firmware),"	\
 						"256k(dtb),"		\
 						"2304k(kernel),"	\

include/configs/TQM5200.h line 443

Quoted 6 lines
include/configs/TQM5200.h +1 -0
@@ -422,6 +438,7 @@
 						"2m(initrd),"		\
 						"8m(misc),"		\
 						"16m(big-fs)"
+#   endif /* CONFIG_HG43630 */
 #  else	/* highboot */
 #   define MTDPARTS_DEFAULT	"mtdparts=TQM5200-0:2560k(kernel),"	\

This #ifdef block is becoming an unreadable mess. Please split up into separate definitions for each board plus a default config, something like

	#define MTDPARTS_DEFAULT ...
	#define MTDPARTS_HG43630 ...
	#define MTDPARTS_CAM5200 ...
	#define MTDPARTS_FO300 ...
	#define MTDPARTS_STK5200 MTDPARTS_DEFAULT

and then use reference the needed version based on the CARRIER_NAME setting.

Quoted 3 lines
include/configs/TQM5200.h +0 -0
 #undef	CONFIG_IDE_8xx_DIRECT		/* Direct IDE	 not supported	*/

#undef CONFIG_IDE_LED /* LED for ide not supported */
-

Don't delete this blank line.

include/configs/TQM5200.h line 730

Quoted 12 lines

#define CONFIG_IDE_RESET /* reset for ide supported */
#define CONFIG_IDE_PREINIT

include/configs/TQM5200.h +5 -1
+#ifndef CONFIG_HG43630
 #define CONFIG_SYS_IDE_MAXBUS		1	/* max. 1 IDE bus		*/
 #define CONFIG_SYS_IDE_MAXDEVICE	2	/* max. 2 drives per IDE bus	*/
-
+#else
+#define CONFIG_SYS_IDE_MAXBUS		0
+#define CONFIG_SYS_IDE_MAXDEVICE	0
+#endif /* CONFIG_HG43630 */
 #define CONFIG_SYS_ATA_IDE0_OFFSET	0x0000

Is it not sufficient to not enable IDE support?

include/configs/TQM5200.h line 748

Quoted 7 lines

#define CONFIG_SYS_ATA_BASE_ADDR MPC5XXX_ATA

include/configs/TQM5200.h +0 -1
@@ -725,7 +745,6 @@
 
 /* Support ATAPI devices */
 #define CONFIG_ATAPI            1
-
 /*-----------------------------------------------------------------------

Don't delete this blank line.

Best regards,

Wolfgang Denk

Signature · 7 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
KLB is an acronym for `Known Lazy Bastard', aka non-FAQ  reader,  aka
person  who  would  rather  make  someone  take their time to explain
something basic than look it up in a  FAQ.
         -- Tom Christiansen in <[email protected]>
#2 lore raw

PATCH 1/1 Adding Configuration option for TQM5200S Board on Goetting

Hi Wolfgang,

Quoted 25 lines

Dear Axel Beierlein,

Quoted 12 lines · In message <[email protected]> you wrote:
---
 Makefile                    |    7 +++++++
 board/tqc/tqm5200/tqm5200.c |    9 ++++++++-
 include/configs/TQM5200.h   |   33 ++++++++++++++++++++++++++-------
 3 files changed, 41 insertions(+), 8 deletions(-)
Makefile +0 -0
index 2a06440..7f197dd 100644

Makefile Total5200_Rev2_lowboot_config: unconfig · line 770

Quoted 7 lines
Makefile +1 -0
@@ -764,6 +764,7 @@ Total5200_Rev2_lowboot_config:	unconfig
 		}
 	@$(MKCONFIG) -a Total5200 ppc mpc5xxx total5200
 
+HG43630_config \
 cam5200_config \
 cam5200_niosflash_config \
 fo300_config \

Please use a lower case board name, and keep list sorted.

Quoted 14 lines

Makefile TQM5200_STK100_config: unconfig · line 818

Quoted 11 lines
Makefile +6 -0
@@ -808,6 +809,12 @@ TQM5200_STK100_config:	unconfig
 	@[ -z "$(findstring HIGHBOOT,$@)" ] || \
 		{ echo "TEXT_BASE = 0xFFF00000" >$(obj)board/tqm5200/config.tmp ; \
 		}
+	@[ -z "$(findstring HG43630,$@)" ] || \
+		{ echo "#define CONFIG_HG43630"	>>$(obj)include/config.h ; \
+		  echo "#define CONFIG_TQM5200S"	>>$(obj)include/config.h ; \
+		  echo "#define CONFIG_TQM5200_B"	>>$(obj)include/config.h ; \
+		  $(XECHO) "... TQM5200S on Goetting HG43630 Board" ; \
+		}
 	@$(MKCONFIG) -n $@ -a TQM5200 ppc mpc5xxx tqm5200 tqc

Please don't add board specific configuration to the top level Makefile; do thi sin your board config file instead.

Can you explain what you want to see here? The board is based on a tqm5200 module, so he actually does not want to copy his own config file. Personally I think this solution to be ok, can you explain what you don't like about it?

Cheers
Detlev

Signature · 7 lines
The success of PCs is in large part due to the fact that, by making all
hardware equivalent, good software enabled bad hardware. (Ugly)
                                    -- Rob Pike
--
DENX Software Engineering GmbH,      MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich,  Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-40 Fax: (+49)-8142-66989-80 Email: dzu at denx.de
#3 lore raw

PATCH 1/1 Adding Configuration option for TQM5200S Board on Goetting

Dear Detlev Zundel,

Quoted 16 lines · In message <[email protected]> you wrote:
Quoted 15 lines

Makefile TQM5200_STK100_config: unconfig · line 818

Quoted 12 lines
Makefile +6 -0
@@ -808,6 +809,12 @@ TQM5200_STK100_config:	unconfig
 	@[ -z "$(findstring HIGHBOOT,$@)" ] || \
 		{ echo "TEXT_BASE = 0xFFF00000" >$(obj)board/tqm5200/config.tmp ; \
 		}
+	@[ -z "$(findstring HG43630,$@)" ] || \
+		{ echo "#define CONFIG_HG43630"	>>$(obj)include/config.h ; \
+		  echo "#define CONFIG_TQM5200S"	>>$(obj)include/config.h ; \
+		  echo "#define CONFIG_TQM5200_B"	>>$(obj)include/config.h ; \
+		  $(XECHO) "... TQM5200S on Goetting HG43630 Board" ; \
+		}
 	@$(MKCONFIG) -n $@ -a TQM5200 ppc mpc5xxx tqm5200 tqc

Please don't add board specific configuration to the top level Makefile; do thi sin your board config file instead.

Quoted 4 lines

Can you explain what you want to see here? The board is based on a tqm5200 module, so he actually does not want to copy his own config file. Personally I think this solution to be ok, can you explain what you don't like about it?

Board specific configurations (liek #defining CONFIG_TQM5200S and CONFIG_TQM5200_B when CONFIG_HG43630 is set) should not be done in the Makefile, but in the board config file instead.

Actually I want to get rid of most of such longish scripting in the Makefile, and I started rejecting all patches that add such stuff.

An example how to solve this can be found here:
http://thread.gmane.org/gmane.comp.boot-loaders.u-boot/65499

Best regards,

Wolfgang Denk

Signature · 6 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
If all the Chinese simultaneously jumped into the Pacific  off  a  10
foot platform erected 10 feet off their coast, it would cause a tidal
wave that would destroy everything in this country west of Nebraska.