Hi,

On 05/16/2014 04:21 PM, Jonathan Liu wrote:
> On 17/05/2014 12:01 AM, Hans de Goede wrote:
>> Hi,
>>
>> On 05/16/2014 01:32 PM, Jonathan Liu wrote:
>>> This allows accessing the EEPROM on the Olimex A20-OLinuXino-MICRO
>>> using the i2c command.
>>>
>>> Signed-off-by: Jonathan Liu <[email protected]>
>> p.s.
>>
>> I don't know what you want this for, but if it is for the purpose of
>> getting fixed MAC addresses for the NIC, please consider implementing
>> this: https://github.com/linux-sunxi/linux-sunxi/commit/e7d46d2c
>>
>> Instead (I've this on my todo for u-boot, so that the kernel and u-boot
>> behave the same).
>>
>> This way you will not only help getting a fixed MAC address on the
>> A20-OLinuXino-MICRO, but everywhere.
>>
>> Thanks,
>>
>> Hans
> setenv macaddr "02:"
> setexpr.l sid *0x01c23800
> setexpr c ${sid} / 10; setexpr c ${c} % 10; setenv macaddr "${macaddr}${c}"
> setexpr c ${sid} % 10; setenv macaddr "${macaddr}${c}"
> setexpr.l sid *0x01c2380c
> setexpr c ${sid} / 10000000; setenv macaddr "${macaddr}:${c}"
> setexpr c ${sid} / 1000000; setexpr c ${c} % 10; setenv macaddr 
> "${macaddr}${c}"
> setexpr c ${sid} / 100000; setexpr c ${c} % 10; setenv macaddr 
> "${macaddr}:${c}"
> setexpr c ${sid} / 10000; setexpr c ${c} % 10; setenv macaddr "${macaddr}${c}"
> setexpr c ${sid} / 1000; setexpr c ${c} % 10; setenv macaddr "${macaddr}:${c}"
> setexpr c ${sid} / 100; setexpr c ${c} % 10; setenv macaddr "${macaddr}${c}"
> setexpr c ${sid} / 10; setexpr c ${c} % 10; setenv macaddr "${macaddr}:${c}"
> setexpr c ${sid} % 10; setenv macaddr "${macaddr}${c}"
> setenv ethaddr "${macaddr}"

Heh, that is a cool trick, but I was actually hoping for a C-code patch doing
the same, so that we don't need to uglify our boot scripts (and make them non 
standard)
also you first need to check that: 1) No macaddr has been set, and 2) the sid 
is not
all 00000000 (which it is on some of the first batch of the A20 SoC).

Thanks,

Hans

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to