From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sekhar Nori Subject: Re: Fwd: DA850-evm MAC Address is random Date: Tue, 29 Aug 2017 13:53:12 +0530 Message-ID: <94c4cbb0-1df3-2f2f-69f3-f9a788e610fa@ti.com> References: <20170828211217.GO6008@atomide.com> Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Cc: Grygorii Strashko , , To: Tony Lindgren , Adam Ford Return-path: Received: from lelnx194.ext.ti.com ([198.47.27.80]:65387 "EHLO lelnx194.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750779AbdH2IXR (ORCPT ); Tue, 29 Aug 2017 04:23:17 -0400 In-Reply-To: <20170828211217.GO6008@atomide.com> Content-Language: en-US Sender: netdev-owner@vger.kernel.org List-ID: On Tuesday 29 August 2017 02:42 AM, Tony Lindgren wrote: > * Adam Ford [170828 13:33]: >> On Mon, Aug 28, 2017 at 1:54 PM, Grygorii Strashko >> wrote: >>> Cc: Sekhar >>> >>> On 08/28/2017 10:32 AM, Adam Ford wrote: >>>> >>>> The davinvi_emac MAC address seems to attempt a call to >>>> ti_cm_get_macid in cpsw-common.c but it returns the message >>>> 'davinci_emac davinci_emac.1: incompatible machine/device type for >>>> reading mac address ' and then generates a random MAC address. >>>> >>>> The function appears to lookup varions boards using >>>> 'of_machine_is_compaible' and supports dm8148, am33xx, am3517, dm816, >>>> am4372 and dra7. I don't see the ti,davinci-dm6467-emac which is >>>> what's shown in the da850 device tree. >>>> >>>> Is there a patch somewhere for supporting the da850-evm? >>> >>> >>> Not sure if MAC address can be read from Control module. >>> May be Sekhar can say more? >> >> My understanding is that the MAC address is programmed by Logic PD >> into the SPI flash. The Bootloader reads this from either SPI or its >> env variables. Looking at the partition info listed in the >> da850-evm.dts file, it appears as if they've reserved space for it. >> Unfortunately, I don't see any code that reads it out. I was hoping This code is present in U-Boot sources at board/davinci/da8xxevm/da850evm.c. See the function get_mac_addr() and its usage in misc_init_r(). >> there might be a way to just pass cmdline parameter from the >> bootloader to the kernel to accept the MAC address. >> >>> >>>> >>>> If not, is there a way to pass the MAC address from U-Boot to the >>>> driver so it doesn't generate a random MAC? >>> >>> >>> "local-mac-address" dt porp >> >> The downside here, is that we'd have to have the Bootloader modify the >> device tree. > > That piece of code exists somewhere in u-boot already. Note how Yes, it is fdt_fixup_ethernet() and its usage is in common/image-fdt.c. > we are populating the mac address for USB Ethernet drivers in > u-boot and then the Ethernet driver code parses it. See commit > 055d31de7158 ("ARM: omap3: beagleboard-xm: dt: Add ethernet to > the device tree") for some more information. > > I think u-boot needs the ethernet alias for finding the interface. That's exactly what was missing. I have sent a patch for fixing that and copied you there. Adam, if I can get your Tested-by, I will make an attempt to send it for v4.13 itself. Thanks, Sekhar From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sekhar Nori Subject: Re: Fwd: DA850-evm MAC Address is random Date: Tue, 29 Aug 2017 13:53:12 +0530 Message-ID: <94c4cbb0-1df3-2f2f-69f3-f9a788e610fa@ti.com> References: <20170828211217.GO6008@atomide.com> Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20170828211217.GO6008@atomide.com> Content-Language: en-US Sender: netdev-owner@vger.kernel.org To: Tony Lindgren , Adam Ford Cc: Grygorii Strashko , linux-omap@vger.kernel.org, netdev@vger.kernel.org List-Id: linux-omap@vger.kernel.org On Tuesday 29 August 2017 02:42 AM, Tony Lindgren wrote: > * Adam Ford [170828 13:33]: >> On Mon, Aug 28, 2017 at 1:54 PM, Grygorii Strashko >> wrote: >>> Cc: Sekhar >>> >>> On 08/28/2017 10:32 AM, Adam Ford wrote: >>>> >>>> The davinvi_emac MAC address seems to attempt a call to >>>> ti_cm_get_macid in cpsw-common.c but it returns the message >>>> 'davinci_emac davinci_emac.1: incompatible machine/device type for >>>> reading mac address ' and then generates a random MAC address. >>>> >>>> The function appears to lookup varions boards using >>>> 'of_machine_is_compaible' and supports dm8148, am33xx, am3517, dm816, >>>> am4372 and dra7. I don't see the ti,davinci-dm6467-emac which is >>>> what's shown in the da850 device tree. >>>> >>>> Is there a patch somewhere for supporting the da850-evm? >>> >>> >>> Not sure if MAC address can be read from Control module. >>> May be Sekhar can say more? >> >> My understanding is that the MAC address is programmed by Logic PD >> into the SPI flash. The Bootloader reads this from either SPI or its >> env variables. Looking at the partition info listed in the >> da850-evm.dts file, it appears as if they've reserved space for it. >> Unfortunately, I don't see any code that reads it out. I was hoping This code is present in U-Boot sources at board/davinci/da8xxevm/da850evm.c. See the function get_mac_addr() and its usage in misc_init_r(). >> there might be a way to just pass cmdline parameter from the >> bootloader to the kernel to accept the MAC address. >> >>> >>>> >>>> If not, is there a way to pass the MAC address from U-Boot to the >>>> driver so it doesn't generate a random MAC? >>> >>> >>> "local-mac-address" dt porp >> >> The downside here, is that we'd have to have the Bootloader modify the >> device tree. > > That piece of code exists somewhere in u-boot already. Note how Yes, it is fdt_fixup_ethernet() and its usage is in common/image-fdt.c. > we are populating the mac address for USB Ethernet drivers in > u-boot and then the Ethernet driver code parses it. See commit > 055d31de7158 ("ARM: omap3: beagleboard-xm: dt: Add ethernet to > the device tree") for some more information. > > I think u-boot needs the ethernet alias for finding the interface. That's exactly what was missing. I have sent a patch for fixing that and copied you there. Adam, if I can get your Tested-by, I will make an attempt to send it for v4.13 itself. Thanks, Sekhar