mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [RFC PATCH v2 0/6] vfio: platform: reset: Introduce tegra234 mgbe reset module
@ 2024-09-17  9:38 Eric Auger
  2024-09-17  9:38 ` [RFC PATCH v2 1/6] vfio_platform: Introduce vfio_platform_get_region helper Eric Auger
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: Eric Auger @ 2024-09-17  9:38 UTC (permalink / raw)
  To: eric.auger.pro, eric.auger, treding, vbhadram, jonathanh,
	mperttunen, linux-kernel, kvm, alex.williamson, clg,
	alexandre.torgue, joabreu
  Cc: msalter

We introduce a new vfio platform reset module for the tegra234
Multi-Gigabit Ethernet (MGBE).

This reset driver is more complex than previous ones because some
resources need to be prepared and released (clocks and reset). The
existing infrastructure was too simplistic to do that. So this series
extends the original single reset function to an ops struct enhanced
with optional init/release callbacks.

There the reset and clocks are handled. the callbacks are called
respectively on vfio_platform_init/release_common().

The actual reset toggles the mac reset, disable mac interrupts,
stop DMA requests and do a SW reset.

The reset code is inspired of the native driver:
net/ethernet/stmicro/stmmac/dwxgmac2_dma.c and
net/ethernet/stmicro/stmmac/dwmac-tegra.c

This series can be found at:
https://github.com/eauger/linux/tree/tegra234-mgbe-reset-module-rfc-v2

The qemu series to test with can be found at
https://github.com/eauger/qemu/tree/tegra234-mgbe-rfc

Best Regards

Eric

---

History:
v1 -> v2:
- rename reset_ops into of_reset_ops
- Move region initialization to vfio_platform_init_common
- Use init/release of_reset_ops callbacks instead of open/close


Eric Auger (6):
  vfio_platform: Introduce vfio_platform_get_region helper
  vfio_platform: reset: Prepare for additional reset ops
  vfio-platform: Move region initialization to vfio_platform_init_common
  vfio_platform: reset: Introduce new init and release callbacks
  vfio-platform: Add a new handle to store reset data
  vfio/platform: Add tegra234-mgbe vfio platform reset module

 drivers/vfio/platform/reset/Kconfig           |   7 +
 drivers/vfio/platform/reset/Makefile          |   2 +
 .../platform/reset/vfio_platform_amdxgbe.c    |   7 +-
 .../reset/vfio_platform_calxedaxgmac.c        |   7 +-
 .../reset/vfio_platform_tegra234_mgbe.c       | 234 ++++++++++++++++++
 drivers/vfio/platform/vfio_platform_common.c  |  88 +++++--
 drivers/vfio/platform/vfio_platform_private.h |  43 +++-
 7 files changed, 349 insertions(+), 39 deletions(-)
 create mode 100644 drivers/vfio/platform/reset/vfio_platform_tegra234_mgbe.c

-- 
2.41.0


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

end of thread, other threads:[~2024-09-17  9:39 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-09-17  9:38 [RFC PATCH v2 0/6] vfio: platform: reset: Introduce tegra234 mgbe reset module Eric Auger
2024-09-17  9:38 ` [RFC PATCH v2 1/6] vfio_platform: Introduce vfio_platform_get_region helper Eric Auger
2024-09-17  9:38 ` [RFC PATCH v2 2/6] vfio_platform: reset: Prepare for additional reset ops Eric Auger
2024-09-17  9:38 ` [RFC PATCH v2 3/6] vfio-platform: Move region initialization to vfio_platform_init_common Eric Auger
2024-09-17  9:38 ` [RFC PATCH v2 4/6] vfio_platform: reset: Introduce new init and release callbacks Eric Auger
2024-09-17  9:38 ` [RFC PATCH v2 5/6] vfio-platform: Add a new handle to store reset data Eric Auger
2024-09-17  9:38 ` [RFC PATCH v2 6/6] vfio/platform: Add tegra234-mgbe vfio platform reset module Eric Auger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®