From: Mike Frysinger <vapier@gentoo.org>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 1/2] net: add Calxeda xgmac driver
Date: Fri, 2 Dec 2011 17:14:42 -0500 [thread overview]
Message-ID: <201112021714.43547.vapier@gentoo.org> (raw)
In-Reply-To: <4ED94AD8.7020505@gmail.com>
On Friday 02 December 2011 17:02:00 Rob Herring wrote:
> On 12/02/2011 03:30 PM, Mike Frysinger wrote:
> > On Friday 02 December 2011 15:21:48 Rob Herring wrote:
> >> --- /dev/null
> >> +++ b/drivers/net/calxedaxgmac.c
> >>
> >> + writel(value, dev->iobase + XGMAC_CORE_CONFIG);
> >
> > you should declare a C struct that represents the hardware's register
> > layout, and then use that rather than iobase+register_offset
>
> Is that a suggestion or u-boot mandate? Because the Linux version of the
> driver does it the current way already, it's certainly done both ways in
> u-boot drivers already and personally I really don't like structs for
> register offsets.
i think Wolfgang would tell you it's a mandate, and code you see using
register offsets are the old style that should get updated. sorry.
> >> + macaddr[1] = readl(dev->iobase + XGMAC_CORE_MACADDR0HI);
> >> + macaddr[0] = readl(dev->iobase + XGMAC_CORE_MACADDR0LO);
> >> + memcpy(dev->enetaddr, macaddr, 6);
> >
> > does the initial mac regs really start off with useful info ?
>
> Yes. It contains the only value that will work.
what i mean is that on embedded peripheral blocks, the device powers on with
blank register settings and the core needs to program them. how did your
device get a mac address already programmed into it ? did something run
before u-boot and initialize the registers ? does the hardware block preseed
the registers itself by talking to some internal storage ? certainly the mac
address isn't programmed into the hardware block itself :).
> >> + sprintf(enetvar, id ? "eth%daddr" : "ethaddr", id);
> >> + eth_setenv_enetaddr(enetvar, dev->enetaddr);
> >
> > NAK: delete this
>
> PXE boot needs the MAC address to generate filenames and gets it from
> the env. See format_mac_pxe function in common/cmd_pxe.c. Should that be
> done differently? The user setting a MAC address on our platform won't
> work, so using the env setting as an override is not valid.
device drivers should not be touching the env. common code takes care of
that. your driver should only be writing dev->enetaddr.
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20111202/efd292c4/attachment.pgp>
next prev parent reply other threads:[~2011-12-02 22:14 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-12-02 20:21 [U-Boot] [PATCH 0/2] Network support for Calxeda highbank Rob Herring
2011-12-02 20:21 ` [U-Boot] [PATCH 1/2] net: add Calxeda xgmac driver Rob Herring
2011-12-02 21:30 ` Mike Frysinger
2011-12-02 22:02 ` Rob Herring
2011-12-02 22:14 ` Mike Frysinger [this message]
2011-12-02 22:46 ` Rob Herring
2011-12-02 23:54 ` Mike Frysinger
2011-12-02 20:21 ` [U-Boot] [PATCH 2/2] ARM: highbank: enable networking and pxe Rob Herring
2011-12-02 21:31 ` Mike Frysinger
2011-12-02 22:03 ` Rob Herring
2011-12-02 22:15 ` Mike Frysinger
2011-12-07 17:56 ` [U-Boot] [PATCH v2 1/2] net: add Calxeda xgmac driver Rob Herring
2011-12-07 17:56 ` [U-Boot] [PATCH v2 2/2] ARM: highbank: enable networking and pxe Rob Herring
2011-12-09 4:00 ` Mike Frysinger
2011-12-09 3:56 ` [U-Boot] [PATCH v2 1/2] net: add Calxeda xgmac driver Mike Frysinger
2011-12-15 21:15 ` [U-Boot] [PATCH v3 " Rob Herring
2011-12-15 21:15 ` [U-Boot] [PATCH v3 2/2] ARM: highbank: enable networking and pxe Rob Herring
2012-01-05 16:32 ` Wolfgang Denk
2011-12-20 22:42 ` [U-Boot] [PATCH v3 1/2] net: add Calxeda xgmac driver Wolfgang Denk
2011-12-20 22:54 ` Rob Herring
2011-12-20 23:09 ` Wolfgang Denk
2011-12-20 23:12 ` Rob Herring
2012-01-05 16:31 ` Wolfgang Denk
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=201112021714.43547.vapier@gentoo.org \
--to=vapier@gentoo.org \
--cc=u-boot@lists.denx.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