netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 net-next v3 0/4] net: dsa: mv88e6xxx: rework reset and PPU code
@ 2016-12-05 22:30 Vivien Didelot
  2016-12-05 22:30 ` [PATCH v3 net-next v3 1/4] net: dsa: mv88e6xxx: add helper to disable ports Vivien Didelot
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Vivien Didelot @ 2016-12-05 22:30 UTC (permalink / raw)
  To: netdev
  Cc: linux-kernel, kernel, David S. Miller, Florian Fainelli,
	Andrew Lunn, Stefan Eichenberger, Richard Cochran, Vivien Didelot

Old Marvell chips (like 88E6060) don't have a PHY Polling Unit (PPU).

Next chips (like 88E6185) have a PPU, which has exclusive access to the
PHY registers, thus must be disabled before access.

Newer chips (like 88E6352) have an indirect mechanism to access the PHY
registers whenever, thus loose control over the PPU (always enabled).

Here's a summary:

Model | PPU? | Has PPU ctrl?  | PPU state readable? | PHY access
----- | ---- | -------------- | ------------------- | ----------
 6060 | no   | no             | no                  | direct
 6185 | yes  | yes, PPUEn bit | yes, PPUState 2-bit | direct w/ PPU dis.
 6352 | yes  | no             | yes, PPUState 1-bit | indirect
 6390 | yes  | no             | yes, InitState bit  | indirect

Depending on the PPU control, a switch may have to restart the PPU when
resetting the switch. Once the switch is reset, we must wait for the PPU
state to be active polling again before accessing the registers.

For that purpose, add new operations to the chips to enable/disable the
PPU, and execute software reset. With these new ops in place, rework the
switch reset code and finally get rid of the MV88E6XXX_FLAG_PPU* flags.

Changes in v3:
  - consider 6097 as 6352 (no PPU ops and use mv88e6352_g1_reset).

Changes in v2:
  - wait in ppu/reset ops so that ppu_polling is not needed anymore.

Vivien Didelot (4):
  net: dsa: mv88e6xxx: add helper to disable ports
  net: dsa: mv88e6xxx: add helper to hardware reset
  net: dsa: mv88e6xxx: add a soft reset operation
  net: dsa: mv88e6xxx: add PPU operations

 drivers/net/dsa/mv88e6xxx/chip.c      | 176 +++++++++++++++------------------
 drivers/net/dsa/mv88e6xxx/global1.c   | 178 ++++++++++++++++++++++++++++++++++
 drivers/net/dsa/mv88e6xxx/global1.h   |   7 ++
 drivers/net/dsa/mv88e6xxx/mv88e6xxx.h |  34 +++----
 4 files changed, 276 insertions(+), 119 deletions(-)

-- 
2.10.2

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

end of thread, other threads:[~2016-12-06 16:44 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-12-05 22:30 [PATCH v3 net-next v3 0/4] net: dsa: mv88e6xxx: rework reset and PPU code Vivien Didelot
2016-12-05 22:30 ` [PATCH v3 net-next v3 1/4] net: dsa: mv88e6xxx: add helper to disable ports Vivien Didelot
2016-12-05 22:30 ` [PATCH v3 net-next v3 2/4] net: dsa: mv88e6xxx: add helper to hardware reset Vivien Didelot
2016-12-05 22:30 ` [PATCH v3 net-next v3 3/4] net: dsa: mv88e6xxx: add a soft reset operation Vivien Didelot
2016-12-05 22:30 ` [PATCH v3 net-next v3 4/4] net: dsa: mv88e6xxx: add PPU operations Vivien Didelot
2016-12-06 16:33 ` [PATCH v3 net-next v3 0/4] net: dsa: mv88e6xxx: rework reset and PPU code David Miller

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