netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Understanding Ethernet Architecture (I/O --> MDIO --> MII vs I/O --> MAC) for mt7620 (OpenWRT)
@ 2019-06-14 22:53 Daniel Santos
  2019-06-16  8:03 ` Daniel Santos
  0 siblings, 1 reply; 2+ messages in thread
From: Daniel Santos @ 2019-06-14 22:53 UTC (permalink / raw)
  To: Daniel Golle, Felix Fietkau, openwrt-devel, John Crispin,
	Michael Lee, netdev

Hello,

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?

Thanks,
Daniel

https://download.villagetelco.org/hardware/MT7620/MT7620_ProgrammingGuide.pdf

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-06-16  8:04 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-14 22:53 Understanding Ethernet Architecture (I/O --> MDIO --> MII vs I/O --> MAC) for mt7620 (OpenWRT) Daniel Santos
2019-06-16  8:03 ` Daniel Santos

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).