Message ID | 20170903131342.1092-1-marek.behun@nic.cz |
---|---|
State | Deferred |
Delegated to: | Tom Rini |
Headers | show |
Series | [U-Boot] mvebu: turris_omnia: Only set eth?addr env if CONFIG_CMD_NET | expand |
Hi Marek, On 03.09.2017 15:13, Marek Behún wrote: > Otherwise the linking will fail since eth_env_set_enetaddr cannot > be found. > > Signed-off-by: Marek Behun <marek.behun@nic.cz> > --- > board/CZ.NIC/turris_omnia/turris_omnia.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/board/CZ.NIC/turris_omnia/turris_omnia.c b/board/CZ.NIC/turris_omnia/turris_omnia.c > index af66837909..7db3b8ff3b 100644 > --- a/board/CZ.NIC/turris_omnia/turris_omnia.c > +++ b/board/CZ.NIC/turris_omnia/turris_omnia.c > @@ -470,6 +470,7 @@ out: > return 0; > } > > +#if defined(CONFIG_ATSHA204A) && defined(CONFIG_CMD_NET) > static void increment_mac(u8 *mac) > { > int i; > @@ -480,10 +481,11 @@ static void increment_mac(u8 *mac) > break; > } > } > +#endif > > int misc_init_r(void) > { > -#ifdef CONFIG_ATSHA204A > +#if defined(CONFIG_ATSHA204A) && defined(CONFIG_CMD_NET) > int err; > struct udevice *dev = get_atsha204a_dev(); > u8 mac0[4], mac1[4], mac[6]; > Perhaps its better to select or imply ATSHA204A and CMD_NET for turris_omnia in Kconfig instead. You can then remove all the #ifdef's from the code here. Just curious: Where did you see this compile / linking problem. Compiling current mainline does not cause any issues. Thanks, Stefan
Hi Marek, On 04.09.2017 08:42, Stefan Roese wrote: > On 03.09.2017 15:13, Marek Behún wrote: >> Otherwise the linking will fail since eth_env_set_enetaddr cannot >> be found. >> >> Signed-off-by: Marek Behun <marek.behun@nic.cz> >> --- >> board/CZ.NIC/turris_omnia/turris_omnia.c | 4 +++- >> 1 file changed, 3 insertions(+), 1 deletion(-) >> >> diff --git a/board/CZ.NIC/turris_omnia/turris_omnia.c >> b/board/CZ.NIC/turris_omnia/turris_omnia.c >> index af66837909..7db3b8ff3b 100644 >> --- a/board/CZ.NIC/turris_omnia/turris_omnia.c >> +++ b/board/CZ.NIC/turris_omnia/turris_omnia.c >> @@ -470,6 +470,7 @@ out: >> return 0; >> } >> +#if defined(CONFIG_ATSHA204A) && defined(CONFIG_CMD_NET) >> static void increment_mac(u8 *mac) >> { >> int i; >> @@ -480,10 +481,11 @@ static void increment_mac(u8 *mac) >> break; >> } >> } >> +#endif >> int misc_init_r(void) >> { >> -#ifdef CONFIG_ATSHA204A >> +#if defined(CONFIG_ATSHA204A) && defined(CONFIG_CMD_NET) >> int err; >> struct udevice *dev = get_atsha204a_dev(); >> u8 mac0[4], mac1[4], mac[6]; >> > > Perhaps its better to select or imply ATSHA204A and CMD_NET for > turris_omnia in Kconfig instead. You can then remove all the #ifdef's > from the code here. > > Just curious: > Where did you see this compile / linking problem. Compiling current > mainline does not cause any issues. I didn't receive any answers on these questions. Could you please check again? Thanks, Stefan
diff --git a/board/CZ.NIC/turris_omnia/turris_omnia.c b/board/CZ.NIC/turris_omnia/turris_omnia.c index af66837909..7db3b8ff3b 100644 --- a/board/CZ.NIC/turris_omnia/turris_omnia.c +++ b/board/CZ.NIC/turris_omnia/turris_omnia.c @@ -470,6 +470,7 @@ out: return 0; } +#if defined(CONFIG_ATSHA204A) && defined(CONFIG_CMD_NET) static void increment_mac(u8 *mac) { int i; @@ -480,10 +481,11 @@ static void increment_mac(u8 *mac) break; } } +#endif int misc_init_r(void) { -#ifdef CONFIG_ATSHA204A +#if defined(CONFIG_ATSHA204A) && defined(CONFIG_CMD_NET) int err; struct udevice *dev = get_atsha204a_dev(); u8 mac0[4], mac1[4], mac[6];
Otherwise the linking will fail since eth_env_set_enetaddr cannot be found. Signed-off-by: Marek Behun <marek.behun@nic.cz> --- board/CZ.NIC/turris_omnia/turris_omnia.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)