lkml.org 
[lkml]   [2020]   [Nov]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v2] ARM: dts: exynos: Add a placeholder for a MAC address
From
Date
Hi Anand,

On 01.11.2020 15:07, Anand Moon wrote:
> Hi Lukasz,
>
> On Thu, 1 Oct 2020 at 19:25, Łukasz Stelmach <l.stelmach@samsung.com> wrote:
>> Add a placeholder for a MAC address. A bootloader may fill it
>> to set the MAC address and override EEPROM settings.
>>
>> Signed-off-by: Łukasz Stelmach <l.stelmach@samsung.com>
>> ---
>> Changes in v2:
>> - use local-mac-address and leave mac-address to be added by a bootloader
>>
>> arch/arm/boot/dts/exynos5422-odroidxu3.dts | 18 ++++++++++++++++++
>> 1 file changed, 18 insertions(+)
>>
>> diff --git a/arch/arm/boot/dts/exynos5422-odroidxu3.dts b/arch/arm/boot/dts/exynos5422-odroidxu3.dts
>> index db0bc17a667b..d0f6ac5fa79d 100644
>> --- a/arch/arm/boot/dts/exynos5422-odroidxu3.dts
>> +++ b/arch/arm/boot/dts/exynos5422-odroidxu3.dts
>> @@ -70,3 +70,21 @@ &pwm {
>> &usbdrd_dwc3_1 {
>> dr_mode = "peripheral";
>> };
>> +
>> +&usbhost2 {
>> + #address-cells = <1>;
>> + #size-cells = <0>;
>> +
>> + hub@1 {
>> + compatible = "usb8087,0024";
>> + reg = <1>;
>> + #address-cells = <1>;
>> + #size-cells = <0>;
>> +
>> + ethernet: usbether@1 {
>> + compatible = "usb0c45,6310";
>> + reg = <1>;
>> + local-mac-address = [00 00 00 00 00 00]; /* Filled in by a bootloader */
>> + };
>> + };
>> +};
>> --
>> 2.26.2
>>
> Thanks for this patch, can you share some example on how to set the
> mac address via u-boot bootargs

A little bit hacky script to set permanent board unique MAC address:

# setexp.b u0 *0x10000014; setexp.b u1 *0x10000015; setexp.b u2
*0x10000016; setexp.b u3 *0x10000017; setenv ethaddr
0:0:${u0}:${u1}:${u2}:${u3}; setenv usbethaddr ${ethaddr};

Then if there is proper ethernet0 alias set, u-boot will then
automatically save the configured MAC address to the device tree. I've
just check this on recent u-boot v2020.10 and Odroid U3 board.

Lukasz will send updated patch soon (with proper alias entry).

If you want to hack setting MAC address manually, this will work with
the current patch:

# setexp.b u0 *0x10000014; setexp.b u1 *0x10000015; setexp.b u2
*0x10000016; setexp.b u3 *0x10000017; fdt addr ${fdtaddr}; fdt set
/soc/usb@12110000/hub@1/usbether@1 local-mac-address [ 0 0 ${u0} ${u1}
${u2} ${u3} ]

> also can you update this patch for exynos5422-odroidxu3-lite.dts and
> exynos4412-odroidu3.dts.

Also odroid-x2 and odroid-xu. Lukasz will take care of them.

Best regards

--
Marek Szyprowski, PhD
Samsung R&D Institute Poland

\
 
 \ /
  Last update: 2020-11-02 17:23    [W:0.089 / U:0.112 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site