Netdev Archive on
 help / color / Atom feed
From: Daniel Santos <>
To: Daniel Golle <>,
	Felix Fietkau <>,
	openwrt-devel <>,
	John Crispin <>, Michael Lee <>,
Subject: Understanding Ethernet Architecture (I/O --> MDIO --> MII vs I/O --> MAC) for mt7620 (OpenWRT)
Date: Fri, 14 Jun 2019 17:53:02 -0500
Message-ID: <> (raw)


I'm still fairly new to Ethernet drivers and there are a lot of
interesting pieces.  What I need help with is understanding MDIO -->
(R)MII vs direct I/O to the MAC (e.g., via ioread32, iowrite32).  Why is
there not always a struct mii_bus to talk to this hardware?  Is it
because the PHY and/or MAC hardware sometimes attached via an MDIO
device and sometimes directly to the I/O bus?  Or does some type of
"indirect access" need to be enabled for that to work?

I might be trying to do something that's unnecessary however, I'm not
sure yet.  I need to add functionality to change a port's
auto-negotiate, duplex, etc.  I'm adding it to the swconfig first and
then will look at adding it for DSA afterwards.  When I run "swconfig
dev switch0 port 0 show", the current mt7530 / mt7620 driver is querying
the MAC status register (at base + 0x3008 + 0x100 * port, described on
pages 323-324 of the MT7620 Programming Guide), so I implemented the
"set" functionality by modifying the MAC's control register (offset
0x3000 on page 321), but it doesn't seem to change anything.  So I
figured maybe I need to modify the MII interface's control register for
the port (page 350), but upon debugging I can see that the struct
mii_bus *bus member is NULL.

So should I be able to change it via the MAC's control register and
something else is wrong?  Why is there no struct mii_bus?  Can I talk to
the MII hardware in some other way?


             reply index

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-14 22:53 Daniel Santos [this message]
2019-06-16  8:03 ` Daniel Santos

Reply instructions:

You may reply publically 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:

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

  git send-email \ \ \ \ \ \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Netdev Archive on

Archives are clonable:
	git clone --mirror netdev/git/0.git
	git clone --mirror netdev/git/1.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 netdev netdev/ \
	public-inbox-index netdev

Newsgroup available over NNTP:

AGPL code for this site: git clone public-inbox