Davinci: MAC address updates
cover Davinci: MAC address updates
One patch making davinci code more usable at none-evaluation boards One pathch fixing confusing console output
The following changes since commit 54b08efcf2f4ff532ce99c53f341a59c193331a5:
README.mips: update known issues and TODOs (2013-01-16 10:52:08 +0100)
are available in the git repository at:
git://gitorious.org/~kibo/u-boot-shr/kibos-u-boot master
http://gitorious.org/~kibo/u-boot-shr/kibos-u-boot/commits/kibo-master
Kim B?ndergaard (2):
Davinci: Make MAC address offset in EEPROM configurable,
CONFIG_MAC_EEPROM_ADDR
Davinci: Fix, console output confusing while setting MAC address
arch/arm/cpu/arm926ejs/davinci/misc.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-)
Signature · 1 line
1.8.0.3
PATCH 1/2 Davinci: Make MAC address offset in EEPROM configurable, CONFIG_MAC_EEPROM_ADDR
--- arch/arm/cpu/arm926ejs/davinci/misc.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
arch/arm/cpu/arm926ejs/davinci/misc.c +4 -1
@@ -55,11 +55,14 @@ void dram_init_banksize(void)* Read ethernet MAC address from EEPROM for DVEVM compatible boards. * Returns 1 if found, 0 otherwise. */ +#ifndef CONFIG_MAC_EEPROM_ADDR +#define CONFIG_MAC_EEPROM_ADDR 0x7F00 +#endif int dvevm_read_mac_address (uint8_t *buf) {#ifdef CONFIG_SYS_I2C_EEPROM_ADDR /* Read MAC address. */ -if (i2c_read (CONFIG_SYS_I2C_EEPROM_ADDR ,0x7F00 , +if (i2c_read (CONFIG_SYS_I2C_EEPROM_ADDR ,CONFIG_MAC_EEPROM_ADDR ,CONFIG_SYS_I2C_EEPROM_ADDR_LEN , (uint8_t *) &buf[0 ],6 )) goto i2cerr;
Signature · 1 line
1.8.0.3
PATCH 2/2 Davinci: Fix, console output confusing while setting MAC address
In reply to Kim Bøndergaard--- arch/arm/cpu/arm926ejs/davinci/misc.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-)
arch/arm/cpu/arm926ejs/davinci/misc.c +3 -6
@@ -104,10 +104,8 @@ void davinci_emac_mii_mode_sel(int mode_sel)void davinci_sync_env_enetaddr (uint8_t *rom_enetaddr) {uint8_t env_enetaddr[6 ]; -int ret; - ret =eth_getenv_enetaddr_by_index ("eth" ,0 , env_enetaddr); -if (ret) { +if (!eth_getenv_enetaddr_by_index ("eth" ,0 , env_enetaddr)) {/* * There is no MAC address in the environment, so we * initialize it from the value in the EEPROM.
@@ -115,10 +113,9 @@ void davinci_sync_env_enetaddr(uint8_t *rom_enetaddr)debug ("### Setting environment from EEPROM MAC address = " "\"%pM\"\n" , env_enetaddr); - ret = !eth_setenv_enetaddr("ethaddr", rom_enetaddr); +if (!eth_setenv_enetaddr ("ethaddr" , rom_enetaddr)) + printf("Failed to set mac address from EEPROM\n"); } -if (!ret) -printf ("Failed to set mac address from EEPROM\n" ); }#endif /* CONFIG_DRIVER_TI_EMAC */
Signature · 1 line
1.8.0.3
PATCH 1/2 Davinci: Make MAC address offset in EEPROM configurable, CONFIG_MAC_EEPROM_ADDR
In reply to Kim Bøndergaard-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Quoted 4 lines · Kim B?ndergaard
---
arch/arm/cpu/arm926ejs/davinci/misc.c| 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)(quoted diff) +0
-0
Quoted 12 lines
b/arch/arm/cpu/arm926ejs/davinci/misc.cindex c310c69..d0389a4 100644 ---a/arch/arm/cpu/arm926ejs/davinci/misc.c+++b/arch/arm/cpu/arm926ejs/davinci/misc.c@@ -55,11 +55,14 @@ voiddram_init_banksize(void)* Read ethernet MAC address from EEPROM for DVEVM compatible boards. * Returns 1 if found, 0 otherwise. */ +#ifndefCONFIG_MAC_EEPROM_ADDR+#defineCONFIG_MAC_EEPROM_ADDR0x7F00+#endif intdvevm_read_mac_address(uint8_t *buf){ #ifdefCONFIG_SYS_I2C_EEPROM_ADDR/* Read MAC address. */ - if
(i2c_read(CONFIG_SYS_I2C_EEPROM_ADDR,0x7F00, + if
(i2c_read(CONFIG_SYS_I2C_EEPROM_ADDR,CONFIG_MAC_EEPROM_ADDR,CONFIG_SYS_I2C_EEPROM_ADDR_LEN, (uint8_t*) &buf[0], 6)) goto i2cerr;
Lets use CONFIG_SYS_I2C_EEPROM_MAC_OFFSET and just set it in all of the davinci configs (yes, that's touching more files). Thanks!
- --
Tom
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
iQIcBAEBAgAGBQJRCDGxAAoJENk4IS6UOR1WAXUP/1W8kLQrWCuIunb6SB2m1ef3 7I3i9hFpENqyX1agmQtXbqaxqUC3claLWrbzzIr/3Ddrwq9ZEmjRjgl0ZWnhYsUx sryioGP+xMd6GXzVsCO59He1Qnb9x7n5NqActNdeC2gQvVV7H0ED/7tuYO97kXRV hfUkuw6zZl/TSK4Sz7aNBkk0xCGkvcMVZbghjW+KdgmEJRp3QJOg8USUbypN9Osp VDVDXPB/BZkALyX30/w1qTxMDXebq3yhkEAs6LypEVeq/2KOMRs6zrCLQfO2yL2t sEaVFWPJMH8BJL+/Us8Ol4mV3PWkE1JaI7IDpPDYpZmmAdzA8kMb6xymTCa35+r8 KKCNYnHi/uVLzL6KilBAJGqRT6HSlsxwjO3WP4XHDaWlfL3IIITJg/es3NUIvDzF GAgR3ORY/myZ4wWhlY5BKxVONvq08ZTG5wVvuxmSpBVpmXQrpXqGRR1Tjcg/rjP5 +bFsguseMxJnYuCmWz/DS/93/NRpIGLPd4lt+nGxgnWsWYA2iY7F8UCFhPB/gAse NTkIMEf0L1eRJM88Ktl4KLsElHBPGAsa1nEkrDfrfUOlqTzHKnTp/c1jX+AUArLW U0kOyTfS69quoJQmPbSC9f5QlnzSWKw7nUE36xryFgdMGXaxzXYyDbHj1b7jtI3Y rA5AhaQw/jpeBBxcmfgB
=WlpG
-----END PGP SIGNATURE-----
PATCH 1/2 Davinci: Make MAC address offset in EEPROM configurable, CONFIG_MAC_EEPROM_ADDR
In reply to a message not in the archive-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Quoted 27 lines · Kim B?ndergaard Poulsen
Hi Tom
Quoted 6 lines
-----Original Message----- From: Tom Rini [mailto:trini at ti.com]
Sent: 29. januar 2013 21:32 To: Kim B?ndergaard Poulsen Cc:
u-boot at lists.denx.de; vapier at gentoo.org; manjunath.hadli at ti.com
Subject: Re: [PATCH 1/2] Davinci: Make MAC address offset in EEPROM configurable,CONFIG_MAC_EEPROM_ADDRQuoted 12 lines · Kim B?ndergaard
Quoted 12 lines
Quoted 4 lines
---
arch/arm/cpu/arm926ejs/davinci/misc.c| 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)(quoted diff) +0
-0Quoted 8 lines
b/arch/arm/cpu/arm926ejs/davinci/misc.cindex c310c69..d0389a4 100644 ---a/arch/arm/cpu/arm926ejs/davinci/misc.c+++b/arch/arm/cpu/arm926ejs/davinci/misc.c@@ -55,11 +55,14 @@ voiddram_init_banksize(void)* Read ethernet MAC address from EEPROM for DVEVM compatible boards. * Returns 1 if found, 0 otherwise. */ +#ifndefCONFIG_MAC_EEPROM_ADDR+#define
CONFIG_MAC_EEPROM_ADDRQuoted 4 lines
Quoted 4 lines
Quoted 4 lines
0x7F00+#endif intdvevm_read_mac_address(uint8_t *buf){ #ifdefCONFIG_SYS_I2C_EEPROM_ADDR/* Read MAC address. */ -
if (i2c_read(CONFIG_SYS_I2C_EEPROM_ADDR,0x7F00, + if
(i2c_read(CONFIG_SYS_I2C_EEPROM_ADDR,
Quoted 27 lines
CONFIG_MAC_EEPROM_ADDR,Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
CONFIG_SYS_I2C_EEPROM_ADDR_LEN, (uint8_t*) &buf[0], 6)) goto i2cerr;Lets use
CONFIG_SYS_I2C_EEPROM_MAC_OFFSETand just set it in all of the davinci configs (yes, that's touching more files). Thanks!Quoted 19 lines
So what you suggest is to add a #define
CONFIG_SYS_I2C_EEPROM_MAC_OFFSET0x7F00in all DAVINCI related
include/configs/*.h?Also I assume you want me to remove the #ifdef
CONFIG_SYS_I2C_EEPROM_MAC_OFFSETinmisc.c?My only problem is that I don't know if it makes sense to define it for all boards
grep -l DAVINCI * in
include/configsgives me the following
files:calimain.hcam_enc_4xx.hda830evm.hda850evm.hdavinci_dm355evm.hdavinci_dm355leopard.hdavinci_dm365evm.hdavinci_dm6467evm.hdavinci_dvevm.hdavinci_schmoogie.hdavinci_sffsdr.hdavinci_sonata.hea20.henbw_cmc.hhawkboard.htnetv107x_evm.hAnyone who knows if they all have I2C eeproms
The subset of these with CONFIG_SYS_I2C_EEPROM set to start with, should as they have been reading there already. Cc'ing the various board maintainers with the patch would be good.
- --
Tom
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
iQIcBAEBAgAGBQJRCu/WAAoJENk4IS6UOR1WKBcP/3bE685l64rhKRGhsVp7zdsT 3XsD4oKMqIeFiHwiSiiS5PXuRibgt3h3aLgbbJnrhMGKBrXsDkEvb9Mjg3f/2yqg duuWIiER6utP2WW16PzjwR5Y/RNjjttzBHfDKsZCOtoZqA8v2+MmnMNrcBZmGI48 foimzTD2VikxO63UElzX3vB83JyFkBaicNfk06vjE73wU2dRR1dnPi5+ufbyMp8r ra9BI5++xVQHBmeZiGngRkO2tESll+L6L9HiTp3NNcNU3TWvV0675lwTnmXXHYy5 yoQHCI4wXQteBixPybp/903p3BhFbw8jRnAok0icSP2chcp8Dvjt8z8n29/JCxYZ 1ZOJdfbrPQXg68Un9+AQnXIoP1wby0ldkVnUfySVNL+ZzKXNA249idx8aY4s1V/K 8jBwP9xMhEaCVirP/DnLV3MetXNKy8hiE9pXqMUhuRn1xe3GwUGV4VUC0EgHJNfx iK8Ne/p68Oeol8WHrWqG3gG9UMZgSzUqWKMSeSIILclLoo8DXLNRM2HM630rfgdA E1MMzpBHPp4XB7RArlWXmibbh9A+ZLFraUZzCp75+OF3Ox0Tdn+vPKyMkf5qXV8w WMZSKZBQbFI2xAYzi6YlcqBP2jC/6e2zOwFXvehQErRI51H5gLMsv0MoPnPx54t4 sUbq0r0V0EdaH2LCS2iM
=zDPr
-----END PGP SIGNATURE-----