devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mugunthan V N <mugunthanvnm@ti.com>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: "Markus Pargmann" <mpa@pengutronix.de>,
	"David S. Miller" <davem@davemloft.net>,
	"Benoît Cousson" <bcousson@baylibre.com>,
	"Tony Lindgren" <tony@atomide.com>,
	"Wolfram Sang" <wsa@the-dreams.de>,
	linux-omap@vger.kernel.org, devicetree@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org, kernel@pengutronix.de
Subject: Re: [PATCH v3 5/7] net: cpsw: Add am33xx MACID readout
Date: Tue, 19 Aug 2014 01:28:09 +0530	[thread overview]
Message-ID: <53F25AD1.8040504@ti.com> (raw)
In-Reply-To: <20140818154112.6601cbff@gandalf.local.home>

On Tuesday 19 August 2014 01:11 AM, Steven Rostedt wrote:
> On Mon, 18 Aug 2014 23:54:26 +0530
> Mugunthan V N <mugunthanvnm@ti.com> wrote:
>
>> On Saturday 16 August 2014 08:48 PM, Markus Pargmann wrote:
>>> +	mac_addr[5] = (macid_lo >> 8) & 0xff;
>>> +	mac_addr[4] = macid_lo & 0xff;
>>> +	mac_addr[3] = (macid_hi >> 24) & 0xff;
>>> +	mac_addr[2] = (macid_hi >> 16) & 0xff;
>>> +	mac_addr[1] = (macid_hi >> 8) & 0xff;
>>> +	mac_addr[0] = macid_hi & 0xff;
>>> +
>> This will fail incase of DRA74x and DRA72x platforms, please check for
>> u-boot src for parsing logic as TRM is not out yet. Below is the actual
>> code for DRA7 platforms for MAC address parsing
>>
>> mac_addr[0] = (mac_hi & 0xFF0000) >> 16;
>> mac_addr[1] = (mac_hi & 0xFF00) >> 8;
>> mac_addr[2] = mac_hi & 0xFF;
>> mac_addr[3] = (mac_lo & 0xFF0000) >> 16;
>> mac_addr[4] = (mac_lo & 0xFF00) >> 8;
>> mac_addr[5] = mac_lo & 0xFF;
>>
> But this fails with my beaglebone white.
>
> I tested Markus's patches and it came up with the same ethaddr that
> U-Boot had.
>
> From U-Boot:
>
> ethaddr=d4:94:a1:8b:ec:78
>
> With Markus's changes:
>
>  eth0      Link encap:Ethernet  HWaddr D4:94:A1:8B:EC:78
>
> But when I changed the code to match what you wrote, I got this:
>
>  eth0      Link encap:Ethernet  HWaddr CE:5A:8B:0E:44:45
>
> but it also gave me:
>
> cpsw 4a100000.ethernet: Random MACID = ce:5a:8b:0e:44:45
>
> which means it failed the valid mac test.
>
> Here's how I implemented your change:
>
> #if 1
>         mac_addr[0] = (macid_hi & 0xFF0000) >> 16;
>         mac_addr[1] = (macid_hi & 0xFF00) >> 8;
>         mac_addr[2] = macid_hi & 0xFF;
>         mac_addr[3] = (macid_lo & 0xFF0000) >> 16;
>         mac_addr[4] = (macid_lo & 0xFF00) >> 8;
>         mac_addr[5] = macid_lo & 0xFF;
>
> #else   
>         mac_addr[5] = (macid_lo >> 8) & 0xff;
>         mac_addr[4] = macid_lo & 0xff;
>         mac_addr[3] = (macid_hi >> 24) & 0xff;
>         mac_addr[2] = (macid_hi >> 16) & 0xff;
>         mac_addr[1] = (macid_hi >> 8) & 0xff;
>         mac_addr[0] = macid_hi & 0xff;
> #endif  
>
> Just to be consistent, I updated the code as this too:
>
>         mac_addr[0] = (macid_hi >> 16) & 0xFF;
>         mac_addr[1] = (macid_hi >> 8) & 0xFF;
>         mac_addr[2] = macid_hi & 0xFF;
>         mac_addr[3] = (macid_lo >> 16) & 0xFF;
>         mac_addr[4] = (macid_lo >> 8) & 0xFF;
>         mac_addr[5] = macid_lo & 0xFF;
>
> With the same affect.
>
> Thus, for this patchset, as is:
>
> Tested-by: Steven Rostedt <rostedt@goodmis.org>

This will fail for DRA7xx not in AM33xx

Regards
Mugunthan V N

  reply	other threads:[~2014-08-18 19:58 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-16 15:18 [PATCH v3 0/7] net: cpsw: Support for am335x chip MACIDs Markus Pargmann
2014-08-16 15:18 ` [PATCH v3 1/7] DT doc: net: cpsw mac-address is optional Markus Pargmann
2014-08-16 15:18 ` [PATCH v3 2/7] net: cpsw: Add missing return value Markus Pargmann
2014-08-16 15:18 ` [PATCH v3 3/7] net: cpsw: header, Add missing include Markus Pargmann
2014-08-16 15:18 ` [PATCH v3 4/7] net: cpsw: Replace pr_err by dev_err Markus Pargmann
2014-08-16 15:18 ` [PATCH v3 5/7] net: cpsw: Add am33xx MACID readout Markus Pargmann
2014-08-16 16:46   ` Wolfram Sang
2014-08-18  6:58     ` Markus Pargmann
2014-08-16 16:53   ` Wolfram Sang
2014-08-18  7:03     ` Markus Pargmann
2014-08-18 18:24   ` Mugunthan V N
2014-08-18 19:41     ` Steven Rostedt
2014-08-18 19:58       ` Mugunthan V N [this message]
2014-08-18 20:57         ` Steven Rostedt
2014-08-18 22:50         ` Javier Martinez Canillas
2014-08-19  8:50           ` Markus Pargmann
2014-08-19 16:37             ` Mugunthan V N
2014-08-16 15:18 ` [PATCH v3 6/7] am33xx: define syscon control module device node Markus Pargmann
2014-08-16 15:18 ` [PATCH v3 7/7] arm: dts: am33xx, Add syscon phandle to cpsw node Markus Pargmann
     [not found] ` <1408202315-20006-1-git-send-email-mpa-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2014-08-16 16:55   ` [PATCH v3 0/7] net: cpsw: Support for am335x chip MACIDs Wolfram Sang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=53F25AD1.8040504@ti.com \
    --to=mugunthanvnm@ti.com \
    --cc=bcousson@baylibre.com \
    --cc=davem@davemloft.net \
    --cc=devicetree@vger.kernel.org \
    --cc=kernel@pengutronix.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=mpa@pengutronix.de \
    --cc=rostedt@goodmis.org \
    --cc=tony@atomide.com \
    --cc=wsa@the-dreams.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).