Odroidc1+ ethernet(dwc0) not working

Daniel Braniss danny at cs.huji.ac.il
Tue Apr 19 06:21:05 UTC 2016


> On 18 Apr 2016, at 18:04, Ian Lepore <ian at FreeBSD.org> wrote:
> 
> On Mon, 2016-04-18 at 12:28 +0300, Daniel Braniss wrote:
>>> On 17 Apr 2016, at 18:20, Weiß, Dr. Jürgen <weiss at uni-mainz.de>
>>> wrote:
>>> 
>>> It seems the FreeBSD driver is only able to use the
>>> mac address which is already programmed into the nic.
>>> So if you use a command in u-boot, which needs and
>>> initializes the network, FreeBSD uses the same mac
>>> address as u-boot. If not it seems to be random.
>>> 
>> not nice.
>> this is what I see:
>> ...
>> dwc0: <Amlogic Meson Gigabit Ethernet Controller> mem 0xc9410000
>> -0xc9411fff irq 10017 on simplebus0
>> miibus0: <MII bus> on dwc0
>> rgephy0: <RTL8169S/8110S/8211 1000BASE-T media interface> PHY 0 on
>> miibus0
>> rgephy0: OUI 0x00e04c, model 0x0011, rev. 6
>> 000baseT-FDX-master, auto
>> random: harvesting attach, 8 bytes (4 bits) from rgephy0
>> rgephy1: <RTL8169S/8110S/8211 1000BASE-T media interface> PHY 1 on
>> miibus0
>> rgephy1: OUI 0x00e04c, model 0x0011, rev. 6
>> 000baseT-FDX-master, auto
>> random: harvesting attach, 8 bytes (4 bits) from rgephy1
>> random: harvesting attach, 8 bytes (4 bits) from miibus0
>> dwc0: bpf attached
>> dwc0: Ethernet address: 62:73:64:b7:54:2e
>> ..
>> 
>> also, I think that the fact that kenv(1) does not show anything
>> means there is something else fishy.
>> 
>> danny
> 
> If you're loading the kernel directly from u-boot, of course kenv is
> empty -- where would env vars have come from?  It's loader(8) that sets
> up a kernel env as part of loading/launching the kernel.
logical my dear Watson :-)

> 
> It's also very common for u-boot to be responsible for setting up a MAC
> address.  Otherwise, how would the dwc driver (which works on a variety
> of different unrelated hardware) know where to get one from?  On some
> boards it's stored in an i2c eeprom, on some it's in a u-boot env var,
> on others it's burned into one-time-programmable fuses on the cpu chip.
> Board-specific code in u-boot knows where to find it and program it
> into the MAC hardware.
I have now 2 sd cards, both have the same mac address when doing bootp
but different ones when booting off the sd card.
(random generated, but not that random, after reboot, the same mac)

> 
> It's supposed to be possible to set a mac address in the fdt data as
> well, but most of our drivers don't look for it there.
> 
it’s not a good idea to have it in the fdt, since duplicating sd cards will
be a headache!

so my project now is to see if I can merge Daisuke-san's image
with what’s in head.
> 

cheers,
	danny




More information about the freebsd-arm mailing list