From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tom Rini Date: Tue, 7 Feb 2017 13:28:27 -0500 Subject: [U-Boot] [u-boot PATCH v3 7/8] ARM: k2g: setup PRU ethernet MAC addresses In-Reply-To: <2cb25fbe-7615-d04c-6f55-de6f9965ab43@compulab.co.il> References: <1486373775-29580-1-git-send-email-rogerq@ti.com> <1486373775-29580-8-git-send-email-rogerq@ti.com> <2cb25fbe-7615-d04c-6f55-de6f9965ab43@compulab.co.il> Message-ID: <20170207182827.GJ26129@bill-the-cat> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Tue, Feb 07, 2017 at 09:52:25AM +0200, Igor Grinberg wrote: > Hi Roger, > > On 02/06/17 11:36, Roger Quadros wrote: > > PRU ethernet MAC address range is present in the > > board EEPROM. Parse it and setup eth?addr > > environment variables. > > > > Signed-off-by: Roger Quadros > > Reviewed-by: Lokesh Vutla > > --- > > board/ti/ks2_evm/board_k2g.c | 19 +++++++++++++++++++ > > 1 file changed, 19 insertions(+) > > > > diff --git a/board/ti/ks2_evm/board_k2g.c b/board/ti/ks2_evm/board_k2g.c > > index 40edbaa..a738dd2 100644 > > --- a/board/ti/ks2_evm/board_k2g.c > > +++ b/board/ti/ks2_evm/board_k2g.c > > @@ -12,6 +12,7 @@ > > #include > > #include > > #include "mux-k2g.h" > > +#include "../common/board_detect.h" > > > > #define SYS_CLK 24000000 > > > > @@ -149,6 +150,24 @@ int board_early_init_f(void) > > } > > #endif > > > > +#ifdef CONFIG_BOARD_LATE_INIT > > +int board_late_init(void) > > +{ > > +#if !defined(CONFIG_SPL_BUILD) && defined(CONFIG_TI_I2C_BOARD_DETECT) > > + int rc; > > + > > + rc = ti_i2c_eeprom_am_get(CONFIG_EEPROM_BUS_ADDRESS, > > + CONFIG_EEPROM_CHIP_ADDRESS); > > + if (rc) > > + printf("ti_i2c_eeprom_init failed %d\n", rc); > > + > > + board_ti_set_ethaddr(1); > > What if the MAC address has already been set in the environment? > AFAIR, the MAC address in the environment has a higher precedence > than others. > May be I missed this, but I don't remember any discussion about changing > this assumption. > So, if the assumption is still correct, you shouldn't change the MAC in the env. This is true. Can we perhaps come up with a helper function that's normally called to set the "eth?addr" to MAC if unset already, instead of having N instances of the same logic? -- Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: Digital signature URL: