[U-Boot] [PATCH 29/32] nitrogen6x: config: configure usb_ether

Eric Nelson eric.nelson at boundarydevices.com
Mon Oct 6 18:41:06 CEST 2014


Hi Stefano,

On 10/06/2014 08:54 AM, Stefano Babic wrote:
> Hi Eric,
> 
> On 02/10/2014 21:16, Eric Nelson wrote:
>> Provide fixed USB networking mac addresses for host and client to enable
>> static configuration of host network stacks.
>>
>> Include a command 'usbrecover' both to illustrate the use of the USB
>> ethernet gadget and also to allow quick booting of a kernel (uImage)
>> and ram disk (uramdisk).
>>
>> Details and commentary are available here:
>>         http://boundarydevices.com/u-boot-2014-01/#usbrecover
>>
>> Signed-off-by: Eric Nelson <eric.nelson at boundarydevices.com>
>> ---
>>  include/configs/nitrogen6x.h | 10 ++++++++++
>>  1 file changed, 10 insertions(+)
>>
>> diff --git a/include/configs/nitrogen6x.h b/include/configs/nitrogen6x.h
>> index 60c942f..8afbded 100644
>> --- a/include/configs/nitrogen6x.h
>> +++ b/include/configs/nitrogen6x.h
>> @@ -314,6 +314,16 @@
>>  				"&& source 10008000 ; " \
>>  		"done ; " \
>>  	"done\0" \
>> +	"usbnet_devaddr=00:19:b8:00:00:02\0" \
>> +	"usbnet_hostaddr=00:19:b8:00:00:01\0" \
>> +	"usbrecover=setenv ethact usb_ether; " \
>> +		"setenv ipaddr 10.0.0.2; " \
>> +		"setenv netmask 255.255.255.0; " \
>> +		"setenv serverip 10.0.0.1; " \
>> +		"setenv bootargs console=ttymxc1,115200; " \
>> +		"tftpboot 10800000 10.0.0.1:uImage-${board}-recovery && " \
>> +		"tftpboot 12800000 10.0.0.1:uramdisk-${board}-recovery.img " \
>> +		"&& bootm 10800000 12800000\0" \
> 
> I understand the use case, but it does not always work (I mean, in all
> network configurations) and we regret generally having IP addresses hard
> coded in the default configuration.
> 

Can you clarify which parts (mac/IP address/both) are a problem?

The 'usb_ether' is kind of an odd beast, in that it's a link-local
protocol, which is why the the IP addresses aren't read from or written
to a persistent environment.

Our goal was to only require configuration of one side of the link
(the USB Host). It seems that without implementing a DHCP **server**,
this is the most convenient.

The mac addresses above are ours, and we can confirm that they are
not in use on any other hardware, so they're guaranteed to be unique
unless you happen to hook up multiple of our boards to a Host at the
same time.

Since the configuration of network adapters on most hosts is based
on mac addresses, hard-coding these prevents the need to re-configure
each time a new board is connected to a host.

Please advise,


Eric


More information about the U-Boot mailing list