Skip to contentSkip to conversation

bootvx: Cleanup & improvements

PATCH New Niklaus Giger 4 participants 5 messages Nov 3, 2008

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 bootvx: Cleanup & improvements

The following improvements are made:
- document bootvx in README
- fix size too small by one in sprintf
- changed old (pre 2004) device name ibmEmac to emac
- boot device may be overriden in board config
- servername may be defined in board config
- additional parameters may be defined in board config
- fixed some line wrappings
- changed netstal-common.h to use the new settings

---
 README                           |   17 ++++++++
 common/cmd_elf.c                 |   80 ++++++++++++++++++--------------------
 include/configs/netstal-common.h |   29 +++++++-------
 3 files changed, 69 insertions(+), 57 deletions(-)
README +17 -0
index ebee20f..99d2a3d 100644
@@ -379,6 +379,23 @@ The following options need to be configured:
 		This define fills in the correct boot CPU in the boot
 		param header, the default value is zero if undefined.
 
+- vxWorks boot parameters:
+
+		bootvx constructs a valid bootline using the following
+		environments variables: bootfile, ipaddr, serverip, hostname.
+		It loads the vxWorks image pointed bootfile.
+
+		CONFIG_SYS_VXWORKS_BOOT_DEVICE - The vxworks device name
+		CONFIG_SYS_VXWORKS_MAC_PTR - Ethernet 6 byte MA -address
+		CONFIG_SYS_VXWORKS_SERVERNAME - Name of the server
+
+		CONFIG_SYS_VXWORKS_ADD_PARAMS
+
+		Add it at the end of the bootline. E.g "u=username pw=secret"
+
+		Note: If a "bootargs" environment is defined, it will overwride
+		the defaults discussed just above.
+
 - Serial Ports:
 		CONFIG_PL010_SERIAL
 
common/cmd_elf.c +38 -42

124 lines not on this page · raw message

include/configs/netstal-common.h +14 -15
index 1fa4b00..7f2b015 100644
@@ -201,8 +201,9 @@
 #define CONFIG_ETHADDR      00:60:13:00:00:00   /* Netstal Machines AG MAC */
 #define CONFIG_OVERWRITE_ETHADDR_ONCE
 
-#define CONFIG_SYS_TFTP_LOADADDR 0x01000000
-
+#define CONFIG_SYS_TFTP_LOADADDR	0x01000000
+#define CONFIG_SYS_VXWORKS_ADD_PARAMS	"u=dpu pw=netstal8752"
+#define CONFIG_SYS_VXWORKS_SERVERNAME	"c"
 /*
  * General common environment variables shared by all boards produced by Netstal Maschinen
  */
@@ -222,19 +223,17 @@
 	"fdt_addr_r=800000\0"						\
 	"hostname=" xstr(CONFIG_HOSTNAME) "\0"				\
 	"bootfile=" xstr(CONFIG_HOSTNAME) "/uImage\0"			\
-	"load=tftp 200000 " xstr(CONFIG_HOSTNAME) "/u-boot.bin\0"	\
-	"update=protect off " xstr(CONFIG_SYS_MONITOR_BASE) " FFFFFFFF;"	\
-		"era " xstr(CONFIG_SYS_MONITOR_BASE) " FFFFFFFF;"		\
-		"cp.b ${fileaddr} " xstr(CONFIG_SYS_MONITOR_BASE) " ${filesize};" \
-		"setenv filesize\0"					\
-	"upd=run load update\0"						\
-	"vx_rom=" xstr(CONFIG_HOSTNAME) "/"     			\
-	xstr(CONFIG_HOSTNAME) "_vx_rom\0"				\
-	"vx=tftp " xstr(CONFIG_SYS_TFTP_LOADADDR) " ${vx_rom};run vxargs;"	\
-	"bootvx\0"							\
-	"vxargs=setenv bootargs emac(0,0)c:${vx_rom} e=${ipaddr}"	\
-	" h=${serverip} u=dpu pw=netstal8752 "				\
-	"tn=" xstr(CONFIG_HOSTNAME) " f=0x3008\0"			\
+	"uload=tftp " xstr(CONFIG_SYS_TFTP_LOADADDR) " "		\
+		xstr(CONFIG_HOSTNAME) "/u-boot.bin\0"			\
+	"vx_rom=" xstr(CONFIG_HOSTNAME) "/"				\
+		xstr(CONFIG_HOSTNAME) "_vx_rom\0"			\
+	"update=protect off " xstr(CONFIG_SYS_MONITOR_BASE) " FFFFFFFF;"\
+		"era " xstr(CONFIG_SYS_MONITOR_BASE) " FFFFFFFF;"	\
+		"cp.b ${fileaddr} "xstr(CONFIG_SYS_MONITOR_BASE) 	\
+		" ${filesize}; setenv filesize\0"			\
+	"upd=run uload update\0"					\
+	"vx=setenv bootfile ${vx_rom}; tftp " 				\
+		xstr(CONFIG_SYS_TFTP_LOADADDR) "; bootvx\0"		\
 	CONFIG_NETSTAL_DEF_ENV_ROOTPATH
 
 /*
Signature · 1 line
1.5.4.3
#1 lore raw

PATCH 1/1 bootvx: Cleanup & improvements

Quoted 9 lines · Niklaus Giger

The following improvements are made:
- document bootvx in README
- fix size too small by one in sprintf
- changed old (pre 2004) device name ibmEmac to emac
- boot device may be overriden in board config
- servername may be defined in board config
- additional parameters may be defined in board config
- fixed some line wrappings
- changed netstal-common.h to use the new settings

Could you split your patch a smallest changeset?

Quoted 72 lines
---
 README                           |   17 ++++++++
 common/cmd_elf.c                 |   80 ++++++++++++++++++--------------------
 include/configs/netstal-common.h |   29 +++++++-------
 3 files changed, 69 insertions(+), 57 deletions(-)
README +17 -0
index ebee20f..99d2a3d 100644
@@ -379,6 +379,23 @@ The following options need to be configured:
 		This define fills in the correct boot CPU in the boot
 		param header, the default value is zero if undefined.
 
+- vxWorks boot parameters:
+
+		bootvx constructs a valid bootline using the following
+		environments variables: bootfile, ipaddr, serverip, hostname.
+		It loads the vxWorks image pointed bootfile.
+
+		CONFIG_SYS_VXWORKS_BOOT_DEVICE - The vxworks device name
+		CONFIG_SYS_VXWORKS_MAC_PTR - Ethernet 6 byte MA -address
+		CONFIG_SYS_VXWORKS_SERVERNAME - Name of the server
+
+		CONFIG_SYS_VXWORKS_ADD_PARAMS
+
+		Add it at the end of the bootline. E.g "u=username pw=secret"
+
+		Note: If a "bootargs" environment is defined, it will overwride
+		the defaults discussed just above.
+
 - Serial Ports:
 		CONFIG_PL010_SERIAL
 
common/cmd_elf.c +7 -6
index 3ebb6d9..d537478 100644
@@ -102,10 +102,8 @@ int do_bootvx (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 	unsigned long bootaddr;		/* Address to put the bootline */
 	char *bootline;			/* Text of the bootline        */
 	char *tmp;			/* Temporary char pointer      */
+	char build_buf[128];		/* Buffer for building the bootline */
 
-#if defined(CONFIG_4xx) || defined(CONFIG_IOP480)
-	char build_buf[80];		/* Buffer for building the bootline */
-#endif
 	/* -------------------------------------------------- */
 
 	/*
@@ -124,7 +122,8 @@ int do_bootvx (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 	if ((argc == 2) && (strcmp (argv[1], "tftp") == 0)) {
 		if (NetLoop (TFTP) <= 0)
 			return 1;
-		printf ("Automatic boot of VxWorks image at address 0x%08lx ... \n", addr);
+		printf ("Automatic boot of VxWorks image at address 0x%08lx ... \n",
+		     addr);
 	}
 #endif
 
@@ -163,54 +162,53 @@ int do_bootvx (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 	 */
 
 	if ((bootline = getenv ("bootargs")) != NULL) {
-		memcpy ((void *) bootaddr, bootline, MAX(strlen(bootline), 255));
-		flush_cache (bootaddr, MAX(strlen(bootline), 255));
+		memcpy ((void *) bootaddr, bootline,
+			MAX (strlen (bootline), 255));
+		flush_cache (bootaddr, MAX (strlen (bootline), 255));
 	} else {
+

common/cmd_elf.c int do_bootvx (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) · line 178

Quoted 10 lines
common/cmd_elf.c +8 -1
+#ifndef CONFIG_SYS_VXWORKS_BOOT_DEVICE
 #if defined(CONFIG_4xx)
-		sprintf (build_buf, "ibmEmac(0,0)");
+#define		CONFIG_SYS_VXWORKS_BOOT_DEVICE "emac(0,0)"
+#elif defined(CONFIG_IOP480)
+#define		CONFIG_SYS_VXWORKS_BOOT_DEVICE "dc(0,0)"
+#else
+#define		CONFIG_SYS_VXWORKS_BOOT_DEVICE "eth(0,0)"
+#endif
+#endif

could we move thie define to an header?

Best Regards,
J.

#2 lore raw

PATCH 1/1 bootvx: Cleanup & improvements

Quoted 11 lines · Jean-Christophe PLAGNIOL-VILLARD
Quoted 9 lines · Niklaus Giger

The following improvements are made:
- document bootvx in README
- fix size too small by one in sprintf
- changed old (pre 2004) device name ibmEmac to emac
- boot device may be overriden in board config
- servername may be defined in board config
- additional parameters may be defined in board config
- fixed some line wrappings
- changed netstal-common.h to use the new settings

Could you split your patch a smallest changeset?

How many changeset do you want? Is it sufficient to make two by just isolating the changes in netstal-common.h? <,,.>

Quoted 11 lines

common/cmd_elf.c int do_bootvx (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) · line 178

Quoted 10 lines
common/cmd_elf.c +8 -1
+#ifndef CONFIG_SYS_VXWORKS_BOOT_DEVICE
 #if defined(CONFIG_4xx)
-		sprintf (build_buf, "ibmEmac(0,0)");
+#define		CONFIG_SYS_VXWORKS_BOOT_DEVICE "emac(0,0)"
+#elif defined(CONFIG_IOP480)
+#define		CONFIG_SYS_VXWORKS_BOOT_DEVICE "dc(0,0)"
+#else
+#define		CONFIG_SYS_VXWORKS_BOOT_DEVICE "eth(0,0)"
+#endif
+#endif

could we move thie define to an header?

Which header shall I use? Is common.h right?

Mmm. Looking at common.h I found that there max is defined with the same meaning as in cmd_elf.h. Probably worth a fix too.

Best regards

Niklaus

#3 lore raw

PATCH 1/1 bootvx: Cleanup & improvements

Quoted 26 lines · Niklaus Giger
Quoted 11 lines · Jean-Christophe PLAGNIOL-VILLARD
Quoted 9 lines · Niklaus Giger

The following improvements are made:
- document bootvx in README
- fix size too small by one in sprintf
- changed old (pre 2004) device name ibmEmac to emac
- boot device may be overriden in board config
- servername may be defined in board config
- additional parameters may be defined in board config
- fixed some line wrappings
- changed netstal-common.h to use the new settings

Could you split your patch a smallest changeset?

How many changeset do you want? Is it sufficient to make two by just isolating the changes in netstal-common.h? <,,.>

Quoted 11 lines

common/cmd_elf.c int do_bootvx (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) · line 178

Quoted 10 lines
common/cmd_elf.c +8 -1
+#ifndef CONFIG_SYS_VXWORKS_BOOT_DEVICE
 #if defined(CONFIG_4xx)
-		sprintf (build_buf, "ibmEmac(0,0)");
+#define		CONFIG_SYS_VXWORKS_BOOT_DEVICE "emac(0,0)"
+#elif defined(CONFIG_IOP480)
+#define		CONFIG_SYS_VXWORKS_BOOT_DEVICE "dc(0,0)"
+#else
+#define		CONFIG_SYS_VXWORKS_BOOT_DEVICE "eth(0,0)"
+#endif
+#endif

could we move thie define to an header?

Quoted 4 lines

Which header shall I use? Is common.h right?

Mmm. Looking at common.h I found that there max is defined with the same meaning as in cmd_elf.h. Probably worth a fix too.

Maybe wxvorks.h

Best Regards,
J.

#4 lore raw

PATCH 1/1 bootvx: Cleanup & improvements

In reply to Niklaus Giger

Dear Niklaus Giger,

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

The following improvements are made:
- document bootvx in README
- fix size too small by one in sprintf
- changed old (pre 2004) device name ibmEmac to emac
- boot device may be overriden in board config
- servername may be defined in board config
- additional parameters may be defined in board config
- fixed some line wrappings
- changed netstal-common.h to use the new settings

Quoted 2 lines
Quoted 1 line

Could you split your patch a smallest changeset?

How many changeset do you want? Is it sufficient to make two by just isolating the changes in netstal-common.h?

Please see http://www.denx.de/wiki/U-Boot/Patches:

Changes that contain different, unrelated modifications shall be submitted as separate patches, one patch per changeset.

Quoted 11 lines
Quoted 11 lines

common/cmd_elf.c int do_bootvx (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) · line 178

Quoted 10 lines
common/cmd_elf.c +8 -1
+#ifndef CONFIG_SYS_VXWORKS_BOOT_DEVICE
 #if defined(CONFIG_4xx)
-		sprintf (build_buf, "ibmEmac(0,0)");
+#define		CONFIG_SYS_VXWORKS_BOOT_DEVICE "emac(0,0)"
+#elif defined(CONFIG_IOP480)
+#define		CONFIG_SYS_VXWORKS_BOOT_DEVICE "dc(0,0)"
+#else
+#define		CONFIG_SYS_VXWORKS_BOOT_DEVICE "eth(0,0)"
+#endif
+#endif

could we move thie define to an header?

Quoted 1 line

Which header shall I use? Is common.h right?

For VxWorks boot device names? Not really. vxworks.h ?

Quoted 1 line

Mmm. Looking at common.h I found that there max is defined with the same meaning as in cmd_elf.h. Probably worth a fix too.

Thanks.

Best regards,

Wolfgang Denk

Signature · 8 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
The universe contains any amount of horrible ways  to  be  woken  up,
such as the noise of the mob breaking down the front door, the scream
of fire engines, or the realization that today is the Monday which on
Friday night was a comfortably long way off.
                                 - Terry Pratchett, _Moving Pictures_