From owner-freebsd-arm@freebsd.org Tue Apr 19 06:21:05 2016 Return-Path: Delivered-To: freebsd-arm@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7BA92B1378D for ; Tue, 19 Apr 2016 06:21:05 +0000 (UTC) (envelope-from danny@cs.huji.ac.il) Received: from kabab.cs.huji.ac.il (kabab.cs.huji.ac.il [132.65.116.210]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F421C1E9A; Tue, 19 Apr 2016 06:21:04 +0000 (UTC) (envelope-from danny@cs.huji.ac.il) Received: from chamsa.cs.huji.ac.il ([132.65.80.19]) by kabab.cs.huji.ac.il with esmtp id 1asP1q-0002CO-9B; Tue, 19 Apr 2016 09:20:54 +0300 Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2104\)) Subject: Re: Odroidc1+ ethernet(dwc0) not working From: Daniel Braniss In-Reply-To: <1460991896.52955.46.camel@freebsd.org> Date: Tue, 19 Apr 2016 09:20:54 +0300 Cc: =?utf-8?Q?=22Wei=C3=9F=2C_Dr=2E_J=C3=BCrgen=22?= , freebsd-arm Message-Id: <8093174F-CCA7-47FE-AF96-C7C3AA7CB719@cs.huji.ac.il> References: <773D8BC8-EA89-42AA-A251-9DE37F7B9750@cs.huji.ac.il> <9C393F68-3355-48B0-A21D-00208407D5D0@cs.huji.ac.il> <1460991896.52955.46.camel@freebsd.org> To: Ian Lepore X-Mailer: Apple Mail (2.2104) Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.21 X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Porting FreeBSD to ARM processors." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Apr 2016 06:21:05 -0000 > On 18 Apr 2016, at 18:04, Ian Lepore wrote: >=20 > On Mon, 2016-04-18 at 12:28 +0300, Daniel Braniss wrote: >>> On 17 Apr 2016, at 18:20, Wei=DF, Dr. J=FCrgen >>> wrote: >>>=20 >>> 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. >>>=20 >> not nice. >> this is what I see: >> ... >> dwc0: mem 0xc9410000 >> -0xc9411fff irq 10017 on simplebus0 >> miibus0: on dwc0 >> rgephy0: 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: 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 >> .. >>=20 >> also, I think that the fact that kenv(1) does not show anything >> means there is something else fishy. >>=20 >> danny >=20 > 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 :-) >=20 > 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) >=20 > 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. >=20 it=92s 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=92s in head. >=20 cheers, danny