All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mario Six <mario.six@gdsys.cc>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v2 2/2] tsec: Fix reading phy registers from DT
Date: Fri, 27 Apr 2018 14:52:57 +0200	[thread overview]
Message-ID: <20180427125257.1081-2-mario.six@gdsys.cc> (raw)
In-Reply-To: <20180427125257.1081-1-mario.six@gdsys.cc>

Bus translations should be applied when reading the address of the sgmii
phy registers from the DT. Use ofnode_get_addr_index instead of the
plain ofnode_read_u32_default to fix this.

Signed-off-by: Mario Six <mario.six@gdsys.cc>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
---

v1 -> v2:
No changes

---
 drivers/net/tsec.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/net/tsec.c b/drivers/net/tsec.c
index 6829e32dae..7a7ae1dccc 100644
--- a/drivers/net/tsec.c
+++ b/drivers/net/tsec.c
@@ -797,8 +797,9 @@ int tsec_probe(struct udevice *dev)
 
 	parent = ofnode_get_parent(phandle_args.node);
 	if (ofnode_valid(parent)) {
-		int reg = ofnode_read_u32_default(parent, "reg", 0);
-		priv->phyregs_sgmii = (struct tsec_mii_mng *)(reg + 0x520);
+		int reg = ofnode_get_addr_index(parent, 0);
+
+		priv->phyregs_sgmii = (struct tsec_mii_mng *)reg;
 	} else {
 		debug("No parent node for PHY?\n");
 		return -ENOENT;
-- 
2.16.1

  reply	other threads:[~2018-04-27 12:52 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-27 12:52 [U-Boot] [PATCH v2 1/2] net: Initialize as many ethernet devices as possible Mario Six
2018-04-27 12:52 ` Mario Six [this message]
2018-06-13 19:01   ` [U-Boot] tsec: Fix reading phy registers from DT Joe Hershberger
2018-06-13 19:01 ` [U-Boot] net: Initialize as many ethernet devices as possible Joe Hershberger

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=20180427125257.1081-2-mario.six@gdsys.cc \
    --to=mario.six@gdsys.cc \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.