Skip to contentSkip to conversation

Kirkwood: add lschlv2 and lsxhl board support

PATCH Superseded Michael Walle 5 participants 15 messages Jun 1, 2012 – Jul 8, 2012

Subsystems (2)

v8 of 9 Superseded Latest is v9 →

lore
Share & tools
lore
#0 lore raw

v8 cover Kirkwood: add lschlv2 and lsxhl board support

Changes:
v8:
- revert CONFIG_RAND to old CONFIG_RANDOM_MACADDR
- the features CONFIG_BOOTP_RANDOM_DELAY and CONFIG_CMD_LINK_LOCAL pulls rand.o implicitly now as suggested by Joe Hershberger
- remove reset_phy() from board code. Thanks Luka Perkov for pointing this out
- dont derive the seed from the timer in seed_mac()

v7:
- rebase to new master
- new function rand_r()
- lib/rand.c is now selected by CONFIG_RAND, because it is used by three features (CONFIG_BOOTP_RANDOM_DELAY, CONFIG_RANDOM_MACADDR and CONFIG_CMD_LINK_LOCAL)
- new patch: use the common rand() functions as a replacement for net_rand.c. This will fix the confliction function declarations, too.

v6:
- remove dead code in Makefile
- use eth_{g,s}etenv_enetaddr() instead of eth_{g,s}etenv_enetaddr_by_index() since index is always 0

v5:
- combine patchset again. the "net: *" patches should be individually acked by net custodian
- make features configurable at compile time (CONFIG_RANDOM_MACADDR and CONFIG_SETENV_ENETADDR_BY_INDEX)
- remove unused variable in boards/buffalo/lsxl.c
- fix potential compiler warning "too many arguments for format"
- new patch which fixes eth_getenv_enetaddr_by_index() and eth_mac_skip()
- change initial seed of rand() to 1
- enable CONFIG_API and CONFIG_CMD_ELF for lsxl boards

v4:
- typo fixes (thanks Mike)
- seed all 46bits of the generated ethernet address (suggested by Mike)
- split patchset (generic net helpers and lsxl support)
- fix typo in bootcmd_hdd
- removed board/buffalo/lsxl/config.mk patch from patchset

v3:
- add "Kirkwood:" prefix to patch subject
- moved board/buffalo/lsxl/config.mk to an own patch, so it can be separately acked/naked ;)
- removed any hardcoding, that is the mac address is now automatically generated (random, locally administered) and the IP settings are fetched with DHCP/BOOTP.
- add detailed comments to every configuration line in kwbimage.cfg
- add comments in MPP configuration about GPIO usage
- removed lschlv2 ramboot
- use short board ident string
- small cleanups

v2:
- add to buffalo vendor directory instead of Marvell
- add both boards to MAINTAINERS
- don't define values for feature macros
- use tab for vertical alignment
- remove static network configuration, instead introduce a rescue mode
- add some convenience scripts
- small cleanups

Michael Walle (4):
lib: add rand() function
net: use common rand()/srand() functions
net: add helper to generate random mac address
Kirkwood: add lschlv2 and lsxhl board support

 MAINTAINERS                           |    5 +
 board/buffalo/lsxl/Makefile           |   44 +++++
 board/buffalo/lsxl/kwbimage-lschl.cfg |  229 ++++++++++++++++++++++++++
 board/buffalo/lsxl/kwbimage-lsxhl.cfg |  229 ++++++++++++++++++++++++++
 board/buffalo/lsxl/lsxl.c             |  283 +++++++++++++++++++++++++++++++++
 board/buffalo/lsxl/lsxl.h             |   75 +++++++++
 boards.cfg                            |    2 +
 include/common.h                      |   10 ++
 include/configs/lsxl.h                |  182 +++++++++++++++++++++
 include/net.h                         |   17 ++
 lib/Makefile                          |    5 +-
 lib/rand.c                            |   48 ++++++
 net/Makefile                          |    2 -
 net/eth.c                             |   22 +++
 net/link_local.c                      |    7 +-
 net/net_rand.c                        |   68 --------
 net/net_rand.h                        |   31 +++-
 17 files changed, 1178 insertions(+), 81 deletions(-)
 create mode 100644 board/buffalo/lsxl/Makefile
 create mode 100644 board/buffalo/lsxl/kwbimage-lschl.cfg
 create mode 100644 board/buffalo/lsxl/kwbimage-lsxhl.cfg
 create mode 100644 board/buffalo/lsxl/lsxl.c
 create mode 100644 board/buffalo/lsxl/lsxl.h
 create mode 100644 include/configs/lsxl.h
 create mode 100644 lib/rand.c
 delete mode 100644 net/net_rand.c
Signature · 1 line
1.7.2.5
#1 lore raw

PATCH v8 1/4 lib: add rand() function

It's a PRNG using the simple and fast xorshift method.

---
 include/common.h |    8 ++++++++
 lib/Makefile     |    1 +
 lib/rand.c       |   48 ++++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 57 insertions(+), 0 deletions(-)
 create mode 100644 lib/rand.c
include/common.h +8 -0
index 8564a65..6ba27bc 100644
@@ -751,6 +751,14 @@ char *	strmhz(char *buf, unsigned long hz);
 /* lib/crc32.c */
 #include <u-boot/crc.h>
 
+/* lib/rand.c */
+#ifdef CONFIG_RANDOM_MACADDR
+#define RAND_MAX -1U
+void srand(unsigned int seed);
+unsigned int rand(void);
+unsigned int rand_r(unsigned int *seedp);
+#endif
+
 /* common/console.c */
 int	console_init_f(void);	/* Before relocation; uses the serial  stuff	*/
 int	console_init_r(void);	/* After  relocation; uses the console stuff	*/
lib/Makefile +1 -0
index 1e8478f..0ca45fc 100644
@@ -66,6 +66,7 @@ COBJS-y += string.o
 COBJS-y += time.o
 COBJS-$(CONFIG_BOOTP_PXE) += uuid.o
 COBJS-y += vsprintf.o
+COBJS-$(CONFIG_RANDOM_MACADDR) += rand.o
 
 COBJS	:= $(COBJS-y)
 SRCS	:= $(COBJS:.o=.c)
lib/rand.c new file +48 -0

48 lines not on this page · raw message

Signature · 1 line
1.7.2.5
#2 lore raw

PATCH v8 2/4 net: use common rand()/srand() functions

In reply to Michael Walle

Replace rand() with the functions from lib/. The link-local network code stores its own seed, derived from the MAC address. Thus making it independent from calls to srand() in other modules.

Cc Joe Hershberger <[email protected]>
---
 include/common.h |    4 ++-
 lib/Makefile     |    4 ++-
 net/Makefile     |    2 -
 net/link_local.c |    7 +++--
 net/net_rand.c   |   68 ------------------------------------------------------
 net/net_rand.h   |   31 +++++++++++++++++++-----
 6 files changed, 34 insertions(+), 82 deletions(-)
 delete mode 100644 net/net_rand.c
include/common.h +3 -1
index 6ba27bc..c42f93b 100644
@@ -752,7 +752,9 @@ char *	strmhz(char *buf, unsigned long hz);
 #include <u-boot/crc.h>
 
 /* lib/rand.c */
-#ifdef CONFIG_RANDOM_MACADDR
+#if defined(CONFIG_RANDOM_MACADDR) || \
+	defined(CONFIG_BOOTP_RANDOM_DELAY) || \
+	defined(CONFIG_CMD_LINK_LOCAL)
 #define RAND_MAX -1U
 void srand(unsigned int seed);
 unsigned int rand(void);
lib/Makefile +3 -1
index 0ca45fc..556601c 100644
@@ -67,8 +67,10 @@ COBJS-y += time.o
 COBJS-$(CONFIG_BOOTP_PXE) += uuid.o
 COBJS-y += vsprintf.o
 COBJS-$(CONFIG_RANDOM_MACADDR) += rand.o
+COBJS-$(CONFIG_BOOTP_RANDOM_DELAY) += rand.o
+COBJS-$(CONFIG_CMD_LINK_LOCAL) += rand.o
 
-COBJS	:= $(COBJS-y)
+COBJS	:= $(sort $(COBJS-y))
 SRCS	:= $(COBJS:.o=.c)
 OBJS	:= $(addprefix $(obj),$(COBJS))
 
net/Makefile +0 -2
index 5264687..e7764ce 100644
@@ -34,8 +34,6 @@ COBJS-$(CONFIG_CMD_DNS)  += dns.o
 COBJS-$(CONFIG_CMD_NET)  += eth.o
 COBJS-$(CONFIG_CMD_LINK_LOCAL) += link_local.o
 COBJS-$(CONFIG_CMD_NET)  += net.o
-COBJS-$(CONFIG_BOOTP_RANDOM_DELAY) += net_rand.o
-COBJS-$(CONFIG_CMD_LINK_LOCAL) += net_rand.o
 COBJS-$(CONFIG_CMD_NFS)  += nfs.o
 COBJS-$(CONFIG_CMD_PING) += ping.o
 COBJS-$(CONFIG_CMD_RARP) += rarp.o
net/link_local.c +4 -3
index 3362863..582d011 100644
@@ -56,6 +56,7 @@ static unsigned conflicts;
 static unsigned nprobes;
 static unsigned nclaims;
 static int ready;
+static unsigned int seed;
 
 static void link_local_timeout(void);
 
@@ -68,7 +69,7 @@ static IPaddr_t pick(void)
 	unsigned tmp;
 
 	do {
-		tmp = rand() & IN_CLASSB_HOST;
+		tmp = rand_r(&seed) & IN_CLASSB_HOST;
 	} while (tmp > (IN_CLASSB_HOST - 0x0200));
 	return (IPaddr_t) htonl((LINKLOCAL_ADDR + 0x0100) + tmp);
 }
@@ -78,7 +79,7 @@ static IPaddr_t pick(void)
  */
 static inline unsigned random_delay_ms(unsigned secs)
 {
-	return rand() % (secs * 1000);
+	return rand_r(&seed) % (secs * 1000);
 }
 
 static void configure_wait(void)
@@ -109,7 +110,7 @@ void link_local_start(void)
 	}
 	NetOurSubnetMask = IN_CLASSB_NET;
 
-	srand_mac();
+	seed = seed_mac();
 	if (ip == 0)
 		ip = pick();
 
net/net_rand.c deleted +0 -68

68 lines not on this page · raw message

net/net_rand.h +24 -7
index c98db64..ba9d064 100644
@@ -9,18 +9,35 @@
 #ifndef __NET_RAND_H__
 #define __NET_RAND_H__
 
-#define RAND_MAX 0xffffffff
+#include <common.h>
 
 /*
- * Seed the random number generator using the eth0 MAC address
+ * Return a seed for the PRNG derived from the eth0 MAC address.
  */
-void srand_mac(void);
+static inline unsigned int seed_mac(void)
+{
+	unsigned char enetaddr[6];
+	unsigned int seed;
+
+	/* get our mac */
+	eth_getenv_enetaddr("ethaddr", enetaddr);
+
+	seed = enetaddr[5];
+	seed ^= enetaddr[4] << 8;
+	seed ^= enetaddr[3] << 16;
+	seed ^= enetaddr[2] << 24;
+	seed ^= enetaddr[1];
+	seed ^= enetaddr[0] << 8;
+
+	return seed;
+}
 
 /*
- * Get a random number (after seeding with MAC address)
- *
- * @return random number
+ * Seed the random number generator using the eth0 MAC address.
  */
-unsigned long rand(void);
+static inline void srand_mac(void)
+{
+	srand(seed_mac());
+}
 
 #endif /* __NET_RAND_H__ */
Signature · 1 line
1.7.2.5
#4 lore raw

PATCH v8 2/4 net: use common rand()/srand() functions

Quoted 10 lines · On Mon, 4 Jun 2012 15:10:55 -0500 Joe Hershberger <[email protected]>…
Quoted 7 lines · Michael Walle

Replace rand() with the functions from lib/. The link-local network code stores its own seed, derived from the MAC address. Thus making it independent from calls to srand() in other modules.

Cc Joe Hershberger <[email protected]>

---

build-testing mpc83xx on the current u-boot-arm tree (v1.3.4-10940-gb003588, which contains this patch) produces the following new warning:

$ ./MAKEALL MPC8313ERDB_66
Configuring for MPC8313ERDB_66 - Board: MPC8313ERDB, Options: SYS_66MHZ
   text	   data	    bss	    dec	    hex	filename
 271988	  13976	  41768	 327732	  50034	./u-boot
In file included from bootp.c:15:0:
net_rand.h: In function 'srand_mac':
net_rand.h:40:2: warning: implicit declaration of function 'srand' [-Wimplicit-function-declaration]

How do we fix this?

Kim

#5 lore raw

PATCH v8 2/4 net: use common rand()/srand() functions

Am Donnerstag 05 Juli 2012, 20:18:12 schrieb Kim Phillips:

Quoted 27 lines

On Mon, 4 Jun 2012 15:10:55 -0500

Quoted 10 lines · Joe Hershberger
Quoted 7 lines · Michael Walle

Replace rand() with the functions from lib/. The link-local network code stores its own seed, derived from the MAC address. Thus making it independent from calls to srand() in other modules.

Cc Joe Hershberger <[email protected]>

---

build-testing mpc83xx on the current u-boot-arm tree (v1.3.4-10940-gb003588, which contains this patch) produces the following new warning:

$ ./MAKEALL MPC8313ERDB_66
Configuring for MPC8313ERDB_66 - Board: MPC8313ERDB, Options: SYS_66MHZ
   text	   data	    bss	    dec	    hex	filename
 271988	  13976	  41768	 327732	  50034	./u-boot
In file included from bootp.c:15:0:
net_rand.h: In function 'srand_mac':
net_rand.h:40:2: warning: implicit declaration of function 'srand'
[-Wimplicit-function-declaration]
Quoted 1 line

How do we fix this?

sth like that for example?

net/bootp.c +3 -2
index 0f0867b..87e30ab 100644
@@ -12,12 +12,14 @@
 #include <command.h>
 #include <net.h>
 #include "bootp.h"
-#include "net_rand.h"
 #include "tftp.h"
 #include "nfs.h"
 #ifdef CONFIG_STATUS_LED
 #include <status_led.h>
 #endif
+#ifdef CONFIG_BOOTP_RANDOM_DELAY
+#include "net_rand.h"
+#endif
 
 
-- 

Michael

#6 lore raw

PATCH 1/1 net: make net_rand.h inclusion depend on BOOTP_RANDOM_DELAY

commit "net: use common rand()/srand() functions" introduced the following build warning on the current u-boot-arm tree:

$ ./MAKEALL MPC8313ERDB_66
Configuring for MPC8313ERDB_66 - Board: MPC8313ERDB, Options: SYS_66MHZ
   text	   data	    bss	    dec	    hex	filename
 271988	  13976	  41768	 327732	  50034	./u-boot
In file included from bootp.c:15:0:
net_rand.h: In function 'srand_mac':
net_rand.h:40:2: warning: implicit declaration of function 'srand' [-Wimplicit-function-declaration]

adding this dependency fixes it.

Cc Michael Walle <[email protected]>
Cc Joe Hershberger <[email protected]>
---
 net/bootp.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
net/bootp.c +3 -1
index 0f0867b..87e30ab 100644
@@ -12,12 +12,14 @@
 #include <command.h>
 #include <net.h>
 #include "bootp.h"
-#include "net_rand.h"
 #include "tftp.h"
 #include "nfs.h"
 #ifdef CONFIG_STATUS_LED
 #include <status_led.h>
 #endif
+#ifdef CONFIG_BOOTP_RANDOM_DELAY
+#include "net_rand.h"
+#endif
 
 #define BOOTP_VENDOR_MAGIC	0x63825363	/* RFC1048 Magic Cookie */
 
Signature · 1 line
1.7.11.1
#7 lore raw

PATCH 1/1 net: make net_rand.h inclusion depend on BOOTP_RANDOM_DELAY

Quoted 14 lines

commit "net: use common rand()/srand() functions" introduced the following
build warning on the current u-boot-arm tree:

$ ./MAKEALL MPC8313ERDB_66
Configuring for MPC8313ERDB_66 - Board: MPC8313ERDB, Options: SYS_66MHZ
  text	   data	    bss	    dec	    hex	filename
271988	  13976	  41768	 327732	  50034	./u-boot
In file included from bootp.c:15:0:
net_rand.h: In function 'srand_mac':
net_rand.h:40:2: warning: implicit declaration of function 'srand'
[-Wimplicit-function-declaration]
Quoted 5 lines

adding this dependency fixes it.

Cc Michael Walle <[email protected]>
Cc Joe Hershberger <[email protected]>
Quoted 26 lines

---
net/bootp.c | 4 +++-

1 file changed, 3 insertions(+), 1 deletion(-)
net/bootp.c +3 -1
index 0f0867b..87e30ab 100644
@@ -12,12 +12,14 @@
 #include <command.h>
 #include <net.h>
 #include "bootp.h"
-#include "net_rand.h"
 #include "tftp.h"
 #include "nfs.h"
 #ifdef CONFIG_STATUS_LED
 #include <status_led.h>
 #endif
+#ifdef CONFIG_BOOTP_RANDOM_DELAY
+#include "net_rand.h"
+#endif
 
 #define BOOTP_VENDOR_MAGIC	0x63825363	/* RFC1048 Magic Cookie */
 
Signature · 1 line
1.7.11.1
#8 lore raw

PATCH 1/1 net: make net_rand.h inclusion depend on BOOTP_RANDOM_DELAY

In reply to Kim Phillips

Dear Kim Phillips,

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

commit "net: use common rand()/srand() functions" introduced the following build warning on the current u-boot-arm tree:

$ ./MAKEALL MPC8313ERDB_66
Configuring for MPC8313ERDB_66 - Board: MPC8313ERDB, Options: SYS_66MHZ
   text	   data	    bss	    dec	    hex	filename
 271988	  13976	  41768	 327732	  50034	./u-boot
In file included from bootp.c:15:0:
net_rand.h: In function 'srand_mac':
net_rand.h:40:2: warning: implicit declaration of function 'srand' [-Wimplicit-function-declaration]
Quoted 8 lines

adding this dependency fixes it.

Cc Michael Walle <[email protected]>
Cc Joe Hershberger <[email protected]>
---
 net/bootp.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Applied, thanks.

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 it happens once, it's a bug.
If it happens twice, it's a feature.
If it happens more than twice, it's a design philosophy.
#9 lore raw

PATCH v8 3/4 net: add helper to generate random mac address

In reply to Michael Walle

Add new function eth_random_enetaddr() to generate a locally administered ethernet address.

---
 include/net.h |   17 +++++++++++++++++
 net/eth.c     |   22 ++++++++++++++++++++++
 2 files changed, 39 insertions(+), 0 deletions(-)
include/net.h +17 -0
index a092f29..6d2d6cd 100644
@@ -122,6 +122,23 @@ extern int eth_setenv_enetaddr(char *name, const uchar *enetaddr);
 extern int eth_getenv_enetaddr_by_index(const char *base_name, int index,
 					uchar *enetaddr);
 
+#ifdef CONFIG_RANDOM_MACADDR
+/*
+ * The u-boot policy does not allow hardcoded ethernet addresses. Under the
+ * following circumstances a random generated address is allowed:
+ *  - in emergency cases, where you need a working network connection to set
+ *    the ethernet address.
+ *    Eg. you want a rescue boot and don't have a serial port to access the
+ *    CLI to set environment variables.
+ *
+ * In these cases, we generate a random locally administered ethernet address.
+ *
+ * Args:
+ *  enetaddr - returns 6 byte hardware address
+ */
+extern void eth_random_enetaddr(uchar *enetaddr);
+#endif
+
 extern int usb_eth_initialize(bd_t *bi);
 extern int eth_init(bd_t *bis);			/* Initialize the device */
 extern int eth_send(void *packet, int length);	   /* Send a packet */
net/eth.c +22 -0
index d9a6430..d526264 100644
@@ -70,6 +70,28 @@ static int eth_mac_skip(int index)
 	return ((skip_state = getenv(enetvar)) != NULL);
 }
 
+#ifdef CONFIG_RANDOM_MACADDR
+void eth_random_enetaddr(uchar *enetaddr)
+{
+	uint32_t rval;
+
+	srand(get_timer(0));
+
+	rval = rand();
+	enetaddr[0] = rval & 0xff;
+	enetaddr[1] = (rval >> 8) & 0xff;
+	enetaddr[2] = (rval >> 16) & 0xff;
+
+	rval = rand();
+	enetaddr[3] = rval & 0xff;
+	enetaddr[4] = (rval >> 8) & 0xff;
+	enetaddr[5] = (rval >> 16) & 0xff;
+
+	/* make sure it's local and unicast */
+	enetaddr[0] = (enetaddr[0] | 0x02) & ~0x01;
+}
+#endif
+
 /*
  * CPU and board-specific Ethernet initializations.  Aliased function
  * signals caller to move on
Signature · 1 line
1.7.2.5
#10 lore raw

PATCH v8 4/4 Kirkwood: add lschlv2 and lsxhl board support

In reply to Michael Walle

This patch adds support for both the Linkstation Live (LS-CHLv2) and Linkstation Pro (LS-XHL) by Buffalo.

Cc Prafulla Wadaskar <[email protected]>
---
 MAINTAINERS                           |    5 +
 board/buffalo/lsxl/Makefile           |   44 +++++
 board/buffalo/lsxl/kwbimage-lschl.cfg |  229 ++++++++++++++++++++++++++
 board/buffalo/lsxl/kwbimage-lsxhl.cfg |  229 ++++++++++++++++++++++++++
 board/buffalo/lsxl/lsxl.c             |  283 +++++++++++++++++++++++++++++++++
 board/buffalo/lsxl/lsxl.h             |   75 +++++++++
 boards.cfg                            |    2 +
 include/configs/lsxl.h                |  182 +++++++++++++++++++++
 8 files changed, 1049 insertions(+), 0 deletions(-)
 create mode 100644 board/buffalo/lsxl/Makefile
 create mode 100644 board/buffalo/lsxl/kwbimage-lschl.cfg
 create mode 100644 board/buffalo/lsxl/kwbimage-lsxhl.cfg
 create mode 100644 board/buffalo/lsxl/lsxl.c
 create mode 100644 board/buffalo/lsxl/lsxl.h
 create mode 100644 include/configs/lsxl.h
MAINTAINERS +5 -0
index f796872..fbb2e2e 100644
@@ -902,6 +902,11 @@ Prafulla Wadaskar <[email protected]>
 	rd6281a		ARM926EJS (Kirkwood SoC)
 	sheevaplug	ARM926EJS (Kirkwood SoC)
 
+Michael Walle <[email protected]>
+
+	lschlv2		ARM926EJS (Kirkwood SoC)
+	lsxhl		ARM926EJS (Kirkwood SoC)
+
 Tom Warren <[email protected]>
 
 	harmony		Tegra2 (ARM7 & A9 Dual Core)
board/buffalo/lsxl/Makefile new file +44 -0

44 lines not on this page · raw message

board/buffalo/lsxl/kwbimage-lschl.cfg new file +229 -0

229 lines not on this page · raw message

board/buffalo/lsxl/kwbimage-lsxhl.cfg new file +229 -0

229 lines not on this page · raw message

board/buffalo/lsxl/lsxl.c new file +283 -0

283 lines not on this page · raw message

board/buffalo/lsxl/lsxl.h new file +75 -0

75 lines not on this page · raw message

boards.cfg +2 -0
index 0dee43f..84463b5 100644
@@ -138,6 +138,8 @@ enbw_cmc                     arm         arm926ejs   enbw_cmc            enbw
 calimain                     arm         arm926ejs   calimain            omicron        davinci
 pogo_e02                     arm         arm926ejs   -                   cloudengines   kirkwood
 dns325                       arm         arm926ejs   -                   d-link         kirkwood
+lschlv2                      arm         arm926ejs   lsxl                buffalo        kirkwood    lsxl:LSCHLV2
+lsxhl                        arm         arm926ejs   lsxl                buffalo        kirkwood    lsxl:LSXHL
 km_kirkwood                  arm         arm926ejs   km_arm              keymile        kirkwood	km_kirkwood:KM_DISABLE_PCI
 km_kirkwood_pci              arm         arm926ejs   km_arm              keymile        kirkwood	km_kirkwood:KM_RECONFIG_XLX
 mgcoge3un                    arm         arm926ejs   km_arm              keymile        kirkwood
include/configs/lsxl.h new file +182 -0

182 lines not on this page · raw message

Signature · 1 line
1.7.2.5
#11 lore raw

v8 cover Kirkwood: add lschlv2 and lsxhl board support

In reply to Michael Walle

Hi Prafulla,

do you have any additional comments? With both net patches acked by Joe, i guess its ready to be merged with your tree. Should i post another patch version with the ACK added to the second net patch?

Signature · 1 line
michael
Quoted 97 lines · Michael Walle

Changes:
v8:
- revert CONFIG_RAND to old CONFIG_RANDOM_MACADDR
- the features CONFIG_BOOTP_RANDOM_DELAY and CONFIG_CMD_LINK_LOCAL pulls rand.o implicitly now as suggested by Joe Hershberger
- remove reset_phy() from board code. Thanks Luka Perkov for pointing this out
- dont derive the seed from the timer in seed_mac()

v7:
- rebase to new master
- new function rand_r()
- lib/rand.c is now selected by CONFIG_RAND, because it is used by three features (CONFIG_BOOTP_RANDOM_DELAY, CONFIG_RANDOM_MACADDR and CONFIG_CMD_LINK_LOCAL)
- new patch: use the common rand() functions as a replacement for net_rand.c. This will fix the confliction function declarations, too.

v6:
- remove dead code in Makefile
- use eth_{g,s}etenv_enetaddr() instead of eth_{g,s}etenv_enetaddr_by_index() since index is always 0

v5:
- combine patchset again. the "net: *" patches should be individually acked by net custodian
- make features configurable at compile time (CONFIG_RANDOM_MACADDR and CONFIG_SETENV_ENETADDR_BY_INDEX)
- remove unused variable in boards/buffalo/lsxl.c
- fix potential compiler warning "too many arguments for format"
- new patch which fixes eth_getenv_enetaddr_by_index() and eth_mac_skip()
- change initial seed of rand() to 1
- enable CONFIG_API and CONFIG_CMD_ELF for lsxl boards

v4:
- typo fixes (thanks Mike)
- seed all 46bits of the generated ethernet address (suggested by Mike)
- split patchset (generic net helpers and lsxl support)
- fix typo in bootcmd_hdd
- removed board/buffalo/lsxl/config.mk patch from patchset

v3:
- add "Kirkwood:" prefix to patch subject
- moved board/buffalo/lsxl/config.mk to an own patch, so it can be separately acked/naked ;)
- removed any hardcoding, that is the mac address is now automatically generated (random, locally administered) and the IP settings are fetched with DHCP/BOOTP.
- add detailed comments to every configuration line in kwbimage.cfg
- add comments in MPP configuration about GPIO usage
- removed lschlv2 ramboot
- use short board ident string
- small cleanups

v2:
- add to buffalo vendor directory instead of Marvell
- add both boards to MAINTAINERS
- don't define values for feature macros
- use tab for vertical alignment
- remove static network configuration, instead introduce a rescue mode
- add some convenience scripts
- small cleanups

Michael Walle (4):
lib: add rand() function
net: use common rand()/srand() functions
net: add helper to generate random mac address
Kirkwood: add lschlv2 and lsxhl board support

 MAINTAINERS                           |    5 +
 board/buffalo/lsxl/Makefile           |   44 +++++
 board/buffalo/lsxl/kwbimage-lschl.cfg |  229 ++++++++++++++++++++++++++
 board/buffalo/lsxl/kwbimage-lsxhl.cfg |  229 ++++++++++++++++++++++++++
 board/buffalo/lsxl/lsxl.c             |  283
+++++++++++++++++++++++++++++++++
 board/buffalo/lsxl/lsxl.h             |   75 +++++++++
 boards.cfg                            |    2 +
 include/common.h                      |   10 ++
 include/configs/lsxl.h                |  182 +++++++++++++++++++++
 include/net.h                         |   17 ++
 lib/Makefile                          |    5 +-
 lib/rand.c                            |   48 ++++++
 net/Makefile                          |    2 -
 net/eth.c                             |   22 +++
 net/link_local.c                      |    7 +-
 net/net_rand.c                        |   68 --------
 net/net_rand.h                        |   31 +++-
 17 files changed, 1178 insertions(+), 81 deletions(-)
 create mode 100644 board/buffalo/lsxl/Makefile
 create mode 100644 board/buffalo/lsxl/kwbimage-lschl.cfg
 create mode 100644 board/buffalo/lsxl/kwbimage-lsxhl.cfg
 create mode 100644 board/buffalo/lsxl/lsxl.c
 create mode 100644 board/buffalo/lsxl/lsxl.h
 create mode 100644 include/configs/lsxl.h
 create mode 100644 lib/rand.c
 delete mode 100644 net/net_rand.c
#12 lore raw

v8 cover Kirkwood: add lschlv2 and lsxhl board support

Quoted 11 lines

-----Original Message-----
From: Michael Walle [mailto:michael at walle.cc]
Sent: 05 June 2012 16:39
To: Prafulla Wadaskar
Cc: u-boot at lists.denx.de; Joe Hershberger
Subject: Re: [PATCH v8 0/4] Kirkwood: add lschlv2 and lsxhl board support

Quoted 7 lines

Hi Prafulla,

do you have any additional comments? With both net patches acked by Joe, i
guess its ready to be merged with your tree. Should i post another patch
version with the ACK added to the second net patch?

No, I think those are ready to merge, I will pull them soon

Hi Joe,
What do you think?

Regards..
Prafulla . . .

#13 lore raw

v8 cover Kirkwood: add lschlv2 and lsxhl board support

Hi Prafulla,

Quoted 19 lines · Prafulla Wadaskar
Quoted 11 lines

-----Original Message-----
From: Michael Walle [mailto:michael at walle.cc]
Sent: 05 June 2012 16:39
To: Prafulla Wadaskar
Cc: u-boot at lists.denx.de; Joe Hershberger
Subject: Re: [PATCH v8 0/4] Kirkwood: add lschlv2 and lsxhl board support

Quoted 7 lines

Hi Prafulla,

do you have any additional comments? With both net patches acked by Joe, i
guess its ready to be merged with your tree. Should i post another patch
version with the ACK added to the second net patch?

Quoted 4 lines

No, I think those are ready to merge, I will pull them soon

Hi Joe,
What do you think?

Looks good.

Quoted 2 lines

Regards..
Prafulla . . .

#14 lore raw

v8 cover Kirkwood: add lschlv2 and lsxhl board support

In reply to Michael Walle
Quoted 23 lines

-----Original Message-----
From: Prafulla Wadaskar
Sent: 05 June 2012 19:41
To: 'Michael Walle'
Cc: u-boot at lists.denx.de; Joe Hershberger
Subject: RE: [PATCH v8 0/4] Kirkwood: add lschlv2 and lsxhl board support

Quoted 11 lines

-----Original Message-----
From: Michael Walle [mailto:michael at walle.cc]
Sent: 05 June 2012 16:39
To: Prafulla Wadaskar
Cc: u-boot at lists.denx.de; Joe Hershberger
Subject: Re: [PATCH v8 0/4] Kirkwood: add lschlv2 and lsxhl board support

Hi Prafulla,

Quoted 7 lines
Quoted 5 lines

do you have any additional comments? With both net patches acked by Joe, i
guess its ready to be merged with your tree. Should i post another patch
version with the ACK added to the second net patch?

No, I think those are ready to merge, I will pull them soon

Hi Michael

I have pulled Kirkwood spi patch series that breaks the Kirkwood_mpp_conf(), So your patch series gives me build error.

May you pls pull u-boot-marvell.git master and send your patch series against that?

Regards..
Prafulla . . .