[U-Boot] [PATCH] imx: missing CONFIG_NET after consolidation patches

Joe Hershberger joe.hershberger at gmail.com
Fri May 29 09:43:40 CEST 2015


Hi Bin,

On Fri, May 29, 2015 at 2:16 AM, Bin Meng <bmeng.cn at gmail.com> wrote:
> Hi Heiko,
>
> On Fri, May 29, 2015 at 1:19 PM, Heiko Schocher <hs at denx.de> wrote:
>> Hello Bin,
>>
>>
>> Am 29.05.2015 04:33, schrieb Bin Meng:
>>>
>>> Hi Joe,
>>>
>>> On Fri, May 29, 2015 at 1:53 AM, Joe Hershberger
>>> <joe.hershberger at gmail.com> wrote:
>>>>
>>>> Hi Stefano,
>>>>
>>>> On Wed, May 27, 2015 at 4:29 AM, Stefano Babic <sbabic at denx.de> wrote:
>>>>>
>>>>> commit fd3056337e6fcc140f400e11edd33f6f1cb37de1
>>>>> "Use env callbacks for net variables" has a side effect
>>>>> on i.MX6 boards because they do not set CONFIG_NET:
>>>>> the ip address results not set, but it is stored
>>>>> in the environment.
>>>>>
>>>>> => pri ipaddr
>>>>> ipaddr=192.168.178.66
>>>>> => ping 192.168.178.1
>>>>> *** ERROR: `ipaddr' not set
>>>>> ping failed; host 192.168.178.1 is not alive
>>>>>
>>>>> Setting CONFIG_NET solves this issue.
>>>>>
>>>>> Reported-by: Heiko Schoker <hs at denx.de>
>>>>> Signed-off-by: Stefano Babic <sbabic at denx.de>
>>>>> ---
>>>>>   include/configs/mx6_common.h | 3 +++
>>>>>   1 file changed, 3 insertions(+)
>>>>>
>>>>> diff --git a/include/configs/mx6_common.h b/include/configs/mx6_common.h
>>>>> index 233c6d2..3d859cf 100644
>>>>> --- a/include/configs/mx6_common.h
>>>>> +++ b/include/configs/mx6_common.h
>>>>> @@ -105,4 +105,7 @@
>>>>>   #define CONFIG_FSL_ESDHC
>>>>>   #define CONFIG_FSL_USDHC
>>>>>
>>>>> +/* NET */
>>>>> +#define CONFIG_NET
>>>>
>>>>
>>>> This config was added to Kconfig here:
>>>>
>>>> 60296a8 commands: add more command entries in Kconfig
>>>
>>>
>>> Looks CONFIG_NET was added by commit ed36323
>>>
>>> commit ed36323f6d217050f82a2200475959b8557a47e4
>>> Author: Masahiro Yamada <yamada.m at jp.panasonic.com>
>>> Date:   Tue Sep 16 16:32:58 2014 +0900
>>>
>>>      kconfig: add blank Kconfig files
>>>
>>>> Author: Masahiro Yamada <yamada.m at jp.panasonic.com>
>>>> Date:   Thu Nov 13 19:29:08 2014 +0900
>>>>
>>>> Apparently some of the boards that supported NET previously were not
>>>> properly added to their defconfigs.
>>>>
>>>> In any case, for this board, you should add the NET config to the
>>>> defconfig, not the header.
>>>>
>>>>>   #endif
>>>>
>>>>
>>>
>>> But I failed to understand why adding CONFIG_NET could resolve the
>>> "*** ERROR: `ipaddr" not set' problem. A grep of "^CONFIG_NET" gives
>>> me nothing helpful.
>>
>>
>> Reason is the following commit:
>>
>> commit fd3056337e6fcc140f400e11edd33f6f1cb37de1
>> Author: Joe Hershberger <joe.hershberger at ni.com>
>> Date:   Wed May 20 14:27:23 2015 -0500
>>
>>     net: Use env callbacks for net variables
>>
>> if CONFIG_NET is not defined, NET_CALLBACKS is empty, which results
>> in the above error message ...
>
> Ah, yes! I was confused by Joe's comments regarding to CONFIG_NET
> being the cause of this.
>
> My understanding is that since we already introduced CONFIG_NET, we
> should not have these network commands (ping, tftp) built in if
> CONFIG_NET is not there.

I think you are thinking of CONFIG_CMD_NET... if it is not defined,
then you will not have those commands. We are in a transitional period
and all of the NET features vs. the commands are not using the new /
appropriate configs yet. Many are not properly moved over to Kconfig.
We'll get there, but this change to Kconfig is fairly incomplete.

> Looks CONFIG_NET is only used in
> NET_CALLBACKS. Is CONFIG_NET really necessary here?

Yes... well either CONFIG_NET or CONFIG_CMD_NET. They should be
basically equivalent.

> +#ifdef CONFIG_NET
> +#define NET_CALLBACKS \
> +       "bootfile:bootfile," \
> +       "ipaddr:ipaddr," \
> +       "gatewayip:gatewayip," \
> +       "netmask:netmask," \
> +       "serverip:serverip," \
> +       "nvlan:nvlan," \
> +       "vlan:vlan," \
> +       DNS_CALLBACK
> +#else
> +#define NET_CALLBACKS
> +#endif

Cheers,
-Joe


More information about the U-Boot mailing list