summaryrefslogtreecommitdiff
path: root/board/netstar/eeprom.c
Commit message (Collapse)AuthorAgeLines
* Make sure that argv[] argument pointers are not modified.Wolfgang Denk2010-07-04-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The hush shell dynamically allocates (and re-allocates) memory for the argument strings in the "char *argv[]" argument vector passed to commands. Any code that modifies these pointers will cause serious corruption of the malloc data structures and crash U-Boot, so make sure the compiler can check that no such modifications are being done by changing the code into "char * const argv[]". This modification is the result of debugging a strange crash caused after adding a new command, which used the following argument processing code which has been working perfectly fine in all Unix systems since version 6 - but not so in U-Boot: int main (int argc, char **argv) { while (--argc > 0 && **++argv == '-') { /* ====> */ while (*++*argv) { switch (**argv) { case 'd': debug++; break; ... default: usage (); } } } ... } The line marked "====>" will corrupt the malloc data structures and usually cause U-Boot to crash when the next command gets executed by the shell. With the modification, the compiler will prevent this with an error: increment of read-only location '*argv' N.B.: The code above can be trivially rewritten like this: while (--argc > 0 && **++argv == '-') { char *arg = *argv; while (*++arg) { switch (*arg) { ... Signed-off-by: Wolfgang Denk <wd@denx.de> Acked-by: Mike Frysinger <vapier@gentoo.org>
* NetStar: eeprom - be less verboseLadislav Michl2010-03-07-14/+13
| | | | | | | | Use shorter yet descriptive messages, replace printf() with puts() where appropriate. This saves few bytes. Signed-off-by: Ladislav Michl <ladis@linux-mips.org> Signed-off-by: Sandeep Paulraj <s-paulraj@ti.com>
* NetStar: eeprom - undefined reference to `memset'Ladislav Michl2010-03-07-31/+37
| | | | | | | | | | | Defining partially initialized struct eth_device on stack means gcc has to zero out it, and some gcc versions optimize this with an implicit call to memset. Move definition to data section to avoid that (it has also nice side effect that we need not to pass it to helper functions anymore) Signed-off-by: Ladislav Michl <ladis@linux-mips.org> Signed-off-by: Sandeep Paulraj <s-paulraj@ti.com>
* NetStar: Remove debug junk leaked into eeprom utilityLadislav Michl2010-02-12-7/+1
| | | | | | | This patch removes debug junk leaked into eeprom utility. Signed-off-by: Ladislav Michl <ladis@linux-mips.org> Signed-off-by: Sandeep Paulraj <s-paulraj@ti.com>
* Convert SMC91111 Ethernet driver to CONFIG_NET_MULTI APIBen Warren2009-10-04-27/+30
| | | | | | | | | | | | | | All in-tree boards that use this controller have CONFIG_NET_MULTI added Also: - changed CONFIG_DRIVER_SMC91111 to CONFIG_SMC91111 - cleaned up line lengths - modified all boards that override weak function in this driver - modified all eeprom standalone apps to work with new driver - updated blackfin standalone EEPROM app after testing Signed-off-by: Ben Warren <biggerbadderben@gmail.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* Update U-Boot's build timestamp on every compilePeter Tyser2008-12-06-1/+2
| | | | | | | Use the GNU 'date' command to auto-generate a new U-Boot timestamp on every compile. Signed-off-by: Peter Tyser <ptyser@xes-inc.com>
* drivers/net : move net drivers to drivers/netJean-Christophe PLAGNIOL-VILLARD2007-11-25-1/+1
| | | | Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
* Code cleanupWolfgang Denk2006-07-21-1/+0
|
* Update NetStar boardWolfgang Denk2006-07-21-0/+1
| | | | Patch by Ladislav Michl, 03 Nov 2005
* Update of new NAND codeWolfgang Denk2005-09-14-0/+215
Patch by Ladislav Michl, 13 Sep 2005