[U-Boot] [PATCH] add support for EMK TOP7000 CPU module (modified files)

This Patch adds support for the EMK TOP7000 CPU Module Part 2: modified files
Signed-off-by: Reinhard Meyer reinhard.meyer@emk-elektronik.de
--- MAINTAINERS | 6 ++++- Makefile | 3 ++ board/emk/common/vpd.c | 57 ++++++++++++++++++++++++++++++++++++++++---- 3 files changed, 59 insertions(+), 7 deletions(-) mode change 100755 => 100644 include/configs/top7000.h
diff --git a/MAINTAINERS b/MAINTAINERS index 7a13d28..9d5540a 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -311,7 +311,7 @@ Andrea "llandre" Marson andrea.marson@dave-tech.it
PPChameleonEVB PPC405EP
-Reinhard Meyer r.meyer@emk-elektronik.de +Reinhard Meyer reinhard.meyer@emk-elektronik.de
TOP860 MPC860T TOP5200 MPC5200 @@ -928,6 +928,10 @@ Haavard Skinnemoen haavard.skinnemoen@atmel.com ATSTK1006 AT32AP7000 ATNGW100 AT32AP7000
+Reinhard Meyer reinhard.meyer@emk-elektronik.de + + TOP7000 AT32AP7000 + ######################################################################### # SuperH Systems: # # # diff --git a/Makefile b/Makefile index c26e491..e57a4ca 100644 --- a/Makefile +++ b/Makefile @@ -3549,6 +3549,9 @@ hammerhead_config : unconfig mimc200_config : unconfig @$(MKCONFIG) $(@:_config=) avr32 at32ap mimc200 mimc at32ap700x
+top7000_config : unconfig + @$(MKCONFIG) $(@:_config=) avr32 at32ap top7000 emk at32ap700x + #======================================================================== # SH3 (SuperH) #======================================================================== diff --git a/board/emk/common/vpd.c b/board/emk/common/vpd.c index c2af219..50776bd 100644 --- a/board/emk/common/vpd.c +++ b/board/emk/common/vpd.c @@ -1,6 +1,6 @@ /* - * (C) Copyright 2003 - * Reinhard Meyer, EMK Elektronik GmbH, r.meyer@emk-elektronik.de + * (C) Copyright 2003-2010 + * Reinhard Meyer, EMK Elektronik * * See file CREDITS for list of people who contributed to this * project. @@ -22,6 +22,7 @@ */
#include <common.h> +#include <command.h>
/***************************************************************************** * read "factory" part of EEPROM and set some environment variables @@ -68,12 +69,56 @@ void read_factory_r (void) addr += p - buf; /*printf ("%s\n", buf); */ /* search for our specific entry */ - if (!strncmp ((char *) buf, "[RLA/lan/Ethernet] ", 19)) { + if (!strncmp ((char *) buf, "[RLA/lan/Ethernet] ", 19)) setenv ("ethaddr", (char *)(buf + 19)); - } else if (!strncmp ((char *) buf, "[BOARD/SERIAL] ", 15)) { +#if defined(CONFIG_TOP7000) + /* boards that have 2 LAN interfaces */ + else if (!strncmp ((char *) buf, "[RLA/lan2/Ethernet] ", 20)) + setenv ("eth1addr", (char *)(buf + 20)); +#endif + else if (!strncmp ((char *) buf, "[BOARD/SERIAL] ", 15)) setenv ("serial#", (char *)(buf + 15)); - } else if (!strncmp ((char *) buf, "[BOARD/TYPE] ", 13)) { + else if (!strncmp ((char *) buf, "[BOARD/TYPE] ", 13)) setenv ("board_id", (char *)(buf + 13)); - } } } + +#if defined(CONFIG_TOP7000) +int do_vpd (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) +{ + uchar buf[512]; + uchar *p; + int i; + u_int addr; + + if (argc != 3) + return 1; + + p = buf+2; + i = simple_strtoul(argv[1], NULL, 10); + if (i<1 || i>32766) + return 1; + + addr=(i-1)*2; + + p+=sprintf((char*)p, "[RLA/lan/Ethernet] 00:80:d9:0d:%02x:%02x\n", + addr/256, addr%256); + addr++; + p+=sprintf((char*)p, "[RLA/lan2/Ethernet] 00:80:d9:0d:%02x:%02x\n", + addr/256, addr%256); + p+=sprintf((char*)p, "[BOARD/SERIAL] %05d\n", i); + p+=sprintf((char*)p, "[BOARD/TYPE] %s\n", argv[2]); + + i = p-buf-2; + buf[0]=i; + buf[1]=i>>8; + if (eeprom_write (CONFIG_SYS_I2C_FACT_ADDR, CONFIG_SYS_FACT_OFFSET, buf, i+2)) { + printf ("cannot write factory configuration\n"); + return 1; + } + + return 0; +} + +U_BOOT_CMD(vpd, 3, 0, do_vpd, "enter vital product data", "serialnumer type"); +#endif diff --git a/include/configs/top7000.h b/include/configs/top7000.h old mode 100755 new mode 100644

Dear "Reinhard Meyer (-VC)",
In message 4C08ED38.8030308@emk-elektronik.de you wrote:
This Patch adds support for the EMK TOP7000 CPU Module Part 2: modified files
Signed-off-by: Reinhard Meyer reinhard.meyer@emk-elektronik.de
MAINTAINERS | 6 ++++- Makefile | 3 ++ board/emk/common/vpd.c | 57 ++++++++++++++++++++++++++++++++++++++++----
Fix your mailer, it is wrapping lines!
@@ -928,6 +928,10 @@ Haavard Skinnemoen haavard.skinnemoen@atmel.com ATSTK1006 AT32AP7000 ATNGW100 AT32AP7000
+Reinhard Meyer reinhard.meyer@emk-elektronik.de
Please keep lists sorted - M < S
--- a/board/emk/common/vpd.c +++ b/board/emk/common/vpd.c @@ -1,6 +1,6 @@ /*
- (C) Copyright 2003
- Reinhard Meyer, EMK Elektronik GmbH, r.meyer@emk-elektronik.de
- (C) Copyright 2003-2010
- Reinhard Meyer, EMK Elektronik
Please add mail address
@@ -68,12 +69,56 @@ void read_factory_r (void) addr += p - buf; /*printf ("%s\n", buf); */ /* search for our specific entry */
if (!strncmp ((char *) buf, "[RLA/lan/Ethernet] ", 19)) {
if (!strncmp ((char *) buf, "[RLA/lan/Ethernet] ", 19)) setenv ("ethaddr", (char *)(buf + 19));
} else if (!strncmp ((char *) buf, "[BOARD/SERIAL] ", 15)) {
+#if defined(CONFIG_TOP7000)
/* boards that have 2 LAN interfaces */
else if (!strncmp ((char *) buf, "[RLA/lan2/Ethernet] ", 20))
setenv ("eth1addr", (char *)(buf + 20));
+#endif
Curly braces are needed for multiline statements.
...
- if (eeprom_write (CONFIG_SYS_I2C_FACT_ADDR, CONFIG_SYS_FACT_OFFSET,
buf, i+2)) {
printf ("cannot write factory configuration\n");
All previous comments apply here, too (too long lines, wrapped lines, no spaces after function name, ...)
Best regards,
Wolfgang Denk

Wolfgang Denk schrieb:
Dear "Reinhard Meyer (-VC)",
In message 4C08ED38.8030308@emk-elektronik.de you wrote:
This Patch adds support for the EMK TOP7000 CPU Module Part 2: modified files
Signed-off-by: Reinhard Meyer reinhard.meyer@emk-elektronik.de
MAINTAINERS | 6 ++++- Makefile | 3 ++ board/emk/common/vpd.c | 57 ++++++++++++++++++++++++++++++++++++++++----
Fix your mailer, it is wrapping lines!
I will investigate on that. Using Thunderbird, should have settings for that.
@@ -928,6 +928,10 @@ Haavard Skinnemoen haavard.skinnemoen@atmel.com ATSTK1006 AT32AP7000 ATNGW100 AT32AP7000
+Reinhard Meyer reinhard.meyer@emk-elektronik.de
Please keep lists sorted - M < S
Well, what about that situation (two names as maintainers for HAMMERHEAD), where do I sort in?
Mark Jackson mpfj@mimc.co.uk
MIMC200 AT32AP7000
Alex Raimondi alex.raimondi@miromico.ch Julien May julien.may@miromico.ch
HAMMERHEAD AT32AP7000
Reinhard Meyer reinhard.meyer@emk-elektronik.de
TOP7000 AT32AP7000
Haavard Skinnemoen haavard.skinnemoen@atmel.com
--- a/board/emk/common/vpd.c +++ b/board/emk/common/vpd.c @@ -1,6 +1,6 @@ /*
- (C) Copyright 2003
- Reinhard Meyer, EMK Elektronik GmbH, r.meyer@emk-elektronik.de
- (C) Copyright 2003-2010
- Reinhard Meyer, EMK Elektronik
Please add mail address
I can do that. But is it really senseful to add an email address to each file? E-Mail adresses can change. Also "Rechtsform" (GmbH -> GmbH & Co. KG). Shall that all be reflected in a simple copyright string?
@@ -68,12 +69,56 @@ void read_factory_r (void) addr += p - buf; /*printf ("%s\n", buf); */ /* search for our specific entry */
if (!strncmp ((char *) buf, "[RLA/lan/Ethernet] ", 19)) {
if (!strncmp ((char *) buf, "[RLA/lan/Ethernet] ", 19)) setenv ("ethaddr", (char *)(buf + 19));
} else if (!strncmp ((char *) buf, "[BOARD/SERIAL] ", 15)) {
+#if defined(CONFIG_TOP7000)
/* boards that have 2 LAN interfaces */
else if (!strncmp ((char *) buf, "[RLA/lan2/Ethernet] ", 20))
setenv ("eth1addr", (char *)(buf + 20));
+#endif
Curly braces are needed for multiline statements.
Not sure what is multiline here? its like if (cond1) statement1; else if (cond2) statement2; else if (cond3) statement3;
...
- if (eeprom_write (CONFIG_SYS_I2C_FACT_ADDR, CONFIG_SYS_FACT_OFFSET,
buf, i+2)) {
printf ("cannot write factory configuration\n");
All previous comments apply here, too (too long lines, wrapped lines, no spaces after function name, ...)
willco.
Best Regards Reinhard

Dear "Reinhard Meyer (-VC)",
In message 4C09274B.2080901@emk-elektronik.de you wrote:
Well, what about that situation (two names as maintainers for HAMMERHEAD), where do I sort in?
Mark Jackson mpfj@mimc.co.uk
MIMC200 AT32AP7000
Alex Raimondi alex.raimondi@miromico.ch Julien May julien.may@miromico.ch
First name counts, i. e. this entry should sort as "Alex Raimondi".
Please add mail address
I can do that. But is it really senseful to add an email address to each file? E-Mail adresses can change. Also "Rechtsform" (GmbH -> GmbH & Co. KG). Shall that all be reflected in a simple copyright string?
It makes a lot of sense to the reader of the code, even i=f it should change later (when the code is properly maintained, such entries should get updated, too).
@@ -68,12 +69,56 @@ void read_factory_r (void) addr += p - buf; /*printf ("%s\n", buf); */ /* search for our specific entry */
if (!strncmp ((char *) buf, "[RLA/lan/Ethernet] ", 19)) {
if (!strncmp ((char *) buf, "[RLA/lan/Ethernet] ", 19)) setenv ("ethaddr", (char *)(buf + 19));
} else if (!strncmp ((char *) buf, "[BOARD/SERIAL] ", 15)) {
+#if defined(CONFIG_TOP7000)
/* boards that have 2 LAN interfaces */
else if (!strncmp ((char *) buf, "[RLA/lan2/Ethernet] ", 20))
setenv ("eth1addr", (char *)(buf + 20));
+#endif
Curly braces are needed for multiline statements.
Not sure what is multiline here? its like
Your code (ignoring the ifdef):
if (!strncmp ((char *) buf, "[RLA/lan/Ethernet] ", 19)) setenv ("ethaddr", (char *)(buf + 19)); /* boards that have 2 LAN interfaces */ else if (!strncmp ((char *) buf, "[RLA/lan2/Ethernet] ", 20))
To me this is multi-line, and badly indented, too.
Best regards,
Wolfgang Denk
participants (2)
-
Reinhard Meyer (-VC)
-
Wolfgang Denk