[U-Boot] [RFC PATCH 1/3] expose eth_is_active() function to test network device state

Joe Hershberger joe.hershberger at gmail.com
Tue Aug 25 17:55:57 CEST 2015


Hi Bernhard,

On Tue, Aug 25, 2015 at 4:53 AM, Bernhard Nortmann
<bernhard.nortmann at web.de> wrote:
> Am 24.08.2015 um 19:02 schrieb Joe Hershberger:
>>
>> Hi Simon,
>>
>> On Mon, Aug 24, 2015 at 11:59 AM, Simon Glass <sjg at chromium.org> wrote:
>>>
>>> Hi Bernhard,
>>>
>>> [...]
>>> i.e. sunxi GMAC (by simply adding #define CONFIG_NETCONSOLE).
>>> In that case how about adding that config to that board? Does it cause
>>> problems for other people?
>>
>> I'll pile on and agree that it would be great to have at least one
>> board with this enabled, and even better to have one that supports
>> DM_ETH and one that does not.
>>
>> -Joe
>
>
> grep "#define CONFIG_NETCONSOLE" include/configs/*
> lists a considerable number of boards where NETCONSOLE seems to be active
> by default. I guess none of these has moved to DM_ETH yet, or I'd have
> expected reports of "broken" builds.
>
> If you're all for it, I can of course enable NETCONSOLE for the Banana
> Pi/Pro. (It may even be done across-the-board for all SUNXI_[EG]MAC
> configs?)

Seems reasonable to me.

> Personally, I'm a bit reluctant to "enforce" this setting, because until
> now my understanding was that NETCONSOLE is supposed to be mostly
> optional, i.e. at user's choice - especially for boards where other
> means of input/output are readily available (serial console, vga, usb
> keyboard).

These are not resource constrained boards, right?

> I don't expect this to create problems, it just adds code that probably
> won't be used most of the time (as long as "nc" doesn't get used for
> stdin/stdout).

It's good to have a build target and also a test or so. We should
maybe enable it in sandbox.

> I guess the proper way to do it would be to introduce Kconfig support;
> will this do?
>
> diff --git a/net/Kconfig b/net/Kconfig
> index 915371d..87c1729 100644
> --- a/net/Kconfig
> +++ b/net/Kconfig
> @@ -16,4 +16,10 @@ config NET_RANDOM_ETHADDR
>           A new MAC address will be generated on every boot and it will
>           not be added to the environment.
>
> +config NETCONSOLE
> +       bool "Netconsole support"

I'm pretty sure CamelCase is used in NetConsole.

> +       help
> +         Support the 'nc' input/output device for networked console.
> +         See README.NetConsole for details.
> +
>  endif   # if NET
>
>
> In case this gets a "go", I'd prepare a v2 patch set that includes enabling
> CONFIG_NETCONSOLE via Bananapi_defconfig / Bananapro_defconfig.

I guess that will work (not running moveconfig.pl) with
CONFIG_NETCONSOLE since so far most boards that don't define
CONFIG_DM_ETH don't define CONFIG_NET or CONFIG_NETDEVICES so that
CONFIG_NETCONSOLE option wouldn't be available. We'll have to change
that for next release.

-Joe


More information about the U-Boot mailing list