From: Thomas Chou <thomas@wytron.com.tw>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] net: convert altera_tse to driver model and phylib
Date: Wed, 21 Oct 2015 21:09:27 +0800 [thread overview]
Message-ID: <56278E87.9000208@wytron.com.tw> (raw)
In-Reply-To: <201510191431.55460.marex@denx.de>
Hi Marek,
On 10/19/2015 08:31 PM, Marek Vasut wrote:
>> + /* decode regs, assume address-cells and size-cells are both one */
>> + list = fdt_getprop(blob, node, "reg-names", &len);
>> + if (!list)
>> + return -ENOENT;
>> + end = list + len;
>> + cell = fdt_getprop(blob, node, "reg", &len);
>> + if (!cell)
>> + return -ENOENT;
>> + idx = 0;
>> + while (list < end) {
>> + addr = fdt_translate_address((void *)blob,
>> + node, cell + idx);
>> + size = fdt_addr_to_cpu(cell[idx + 1]);
>> + base = ioremap(addr, size);
>> + len = strlen(list);
>> + if (strcmp(list, "control_port") == 0)
>> + priv->mac_dev = base;
>
> fdtdec_get_addr() won't do here?
There are multiple "reg" tuples, and need to match "reg-names". That's
beyond fdtdec_get_addr().
tse_mac: ethernet at 0x4000 {
compatible = "altr,tse-1.0";
reg = <0x00004000 0x00000400>,
<0x00004400 0x00000040>,
<0x00004800 0x00000040>,
<0x00002000 0x00002000>;
reg-names = "control_port", "rx_csr", "tx_csr", "s1";
Thanks a lot for your reviews.
Best regards,
Thomas
next prev parent reply other threads:[~2015-10-21 13:09 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-19 2:36 [U-Boot] [PATCH] net: convert altera_tse to driver model and phylib Thomas Chou
2015-10-19 12:31 ` Marek Vasut
2015-10-21 13:09 ` Thomas Chou [this message]
2015-10-22 1:53 ` Marek Vasut
2015-10-21 13:05 ` [U-Boot] [PATCH v2] " Thomas Chou
2015-10-22 1:59 ` Marek Vasut
2015-10-22 2:15 ` Simon Glass
2015-10-22 3:06 ` Thomas Chou
2015-10-22 7:35 ` [U-Boot] [PATCH v3] " Thomas Chou
2015-10-23 0:21 ` Thomas Chou
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=56278E87.9000208@wytron.com.tw \
--to=thomas@wytron.com.tw \
--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