Message ID | 1311870338-18950-13-git-send-email-nagabhushana.netagunte@ti.com |
---|---|
State | Changes Requested |
Headers | show |
On Thu, Jul 28, 2011 at 09:25, <nagabhushana.netagunte@wrote:
> if (getenv("ethaddr") == NULL) {
this should get fixed to use the eth helper instead of poking the env
yourself. see board/bf537-stamp/bf537-stamp.c as an example.
-mike
On Thu, Jul 28, 2011 at 11:31, Mike Frysinger wrote: > On Thu, Jul 28, 2011 at 09:25, <nagabhushana.netagunte@wrote: >> if (getenv("ethaddr") == NULL) { > > this should get fixed to use the eth helper instead of poking the env > yourself. see board/bf537-stamp/bf537-stamp.c as an example. actually, it looks like this patch is simply a fix for another patch you just sent out. please dont post buggy patches ... just squash the two together. also, if you're posting patch series, you need to have [#/#] markers in the summary so that people can clearly see the order required for merging. -mike
Mike, Thanks for your valuable comments; I will use the helper function you suggested. -Nag On Fri, Jul 29, 2011 at 00:01:39, Mike Frysinger wrote: > On Thu, Jul 28, 2011 at 09:25, <nagabhushana.netagunte@wrote: > > if (getenv("ethaddr") == NULL) { > > this should get fixed to use the eth helper instead of poking the env yourself. see board/bf537-stamp/bf537-stamp.c as an example. > -mike >
Hi Mike, Thanks for your comments. Since the earlier patch is about reading env variable value in SPI flash and This patch concentrates on reading the same from I2C EEPROM, it will be better to have 2 different patches. Second patch is not to fix the first patch. If you want them to sent after squashing, I can do that as well. Regards, Nag On Sat, Jul 30, 2011 at 00:02:41, Mike Frysinger wrote: > On Thu, Jul 28, 2011 at 11:31, Mike Frysinger wrote: > > On Thu, Jul 28, 2011 at 09:25, <nagabhushana.netagunte@wrote: > >> if (getenv("ethaddr") == NULL) { > > > > this should get fixed to use the eth helper instead of poking the env > > yourself. see board/bf537-stamp/bf537-stamp.c as an example. > > actually, it looks like this patch is simply a fix for another patch you just sent out. please dont post buggy patches ... just squash the two together. > > also, if you're posting patch series, you need to have [#/#] markers in the summary so that people can clearly see the order required for merging. > -mike >
diff --git a/board/davinci/da8xxevm/da850evm.c b/board/davinci/da8xxevm/da850evm.c index d99f1a0..fd05703 100644 --- a/board/davinci/da8xxevm/da850evm.c +++ b/board/davinci/da8xxevm/da850evm.c @@ -489,10 +489,16 @@ int misc_init_r(void) printf("ARM Clock : %d Hz\n", clk_get(DAVINCI_ARM_CLKID)); if (getenv("ethaddr") == NULL) { - /* Set Ethernet MAC address from EEPROM */ - ret = get_mac_addr(addr); - if (ret != 0) - return -EINVAL; + /* Read Ethernet MAC address from EEPROM */ + if (dvevm_read_mac_address(addr)) { + /* Set Ethernet MAC address from EEPROM */ + davinci_sync_env_enetaddr(addr); + } else { + /* Set Ethernet MAC address from SPI flash */ + ret = get_mac_addr(addr); + if (ret != 0) + return -EINVAL; + } if (is_multicast_ether_addr(addr) || is_zero_ether_addr(addr)) { printf("Invalid MAC address read.\n");