Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 18 Apr 2016 09:04:56 -0600
From:      Ian Lepore <ian@freebsd.org>
To:        Daniel Braniss <danny@cs.huji.ac.il>, =?ISO-8859-1?Q?=22Wei=DF=2C?= "Dr." =?ISO-8859-1?Q?J=FCrgen=22?= <weiss@uni-mainz.de>
Cc:        freebsd-arm <freeBSD-arm@freebsd.org>
Subject:   Re: Odroidc1+ ethernet(dwc0) not working
Message-ID:  <1460991896.52955.46.camel@freebsd.org>
In-Reply-To: <9C393F68-3355-48B0-A21D-00208407D5D0@cs.huji.ac.il>
References:  <A0F7E1EB-3208-4DEB-8E3E-538E2D92296D@cs.huji.ac.il> <773D8BC8-EA89-42AA-A251-9DE37F7B9750@cs.huji.ac.il> <da68a99a7c924cee8d3dd78e7dbc3170@uni-mainz.de> <9C393F68-3355-48B0-A21D-00208407D5D0@cs.huji.ac.il>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, 2016-04-18 at 12:28 +0300, Daniel Braniss wrote:
> > On 17 Apr 2016, at 18:20, Weiß, Dr. Jürgen <weiss@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.

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.

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.

-- Ian



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1460991896.52955.46.camel>