rust-for-linux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next v2 0/6] net: phy: add Applied Micro QT2025 PHY driver
@ 2024-07-31  4:21 FUJITA Tomonori
  2024-07-31  4:21 ` [PATCH net-next v2 1/6] rust: sizes: add commonly used constants FUJITA Tomonori
                   ` (5 more replies)
  0 siblings, 6 replies; 21+ messages in thread
From: FUJITA Tomonori @ 2024-07-31  4:21 UTC (permalink / raw)
  To: netdev; +Cc: rust-for-linux, andrew, tmgross, miguel.ojeda.sandonis,
	benno.lossin

This patchset adds a PHY driver for Applied Micro Circuits Corporation
QT2025.

The first patch adds Rust equivalent to include/linux/sizes.h, makes
code more readable.

The 2-5th patches update the PHYLIB Rust bindings. Note that 4th and
5th patches are already reviewed by Trevor and Benno.

QT2025 PHY support was implemented as a part of an Ethernet driver for
Tehuti Networks TN40xx chips. Multiple vendors (DLink, Asus, Edimax,
QNAP, etc) developed adapters based on TN40xx chips. Tehuti Networks
went out of business and the driver wasn't merged into mainline. But
it's still distributed with some of the hardware (and also available
on some vendor sites).

The original driver handles multiple PHY hardware (AMCC QT2025, TI
TLK10232, Aqrate AQR105, and Marvell MV88X3120, MV88X3310, and
MV88E2010). I divided the original driver into MAC and PHY drivers and
implemented a QT2025 PHY driver in Rust.

The MAC driver for Tehuti Networks TN40xx chips was already merged in
6.11-rc1. The MAC and this PHY drivers have been tested with Edimax
EN-9320SFP+ 10G network adapter.

v2:
- add comments in accordance with the hw datasheet
- unify C22 and C45 APIs
- load firmware in probe callback instead of config_init
- use firmware API
- handle firmware endian
- check firmware size
- use SZ_*K constants
- avoid confusing phy_id variable
v1: https://lore.kernel.org/all/20240415104701.4772-1-fujita.tomonori@gmail.com/

FUJITA Tomonori (6):
  rust: sizes: add commonly used constants
  rust: net::phy support probe callback
  rust: net::phy implement AsRef<kernel::device::Device> trait
  rust: net::phy unified read/write API for C22 and C45 registers
  rust: net::phy unified genphy_read_status function for C22 and C45
    registers
  net: phy: add Applied Micro QT2025 PHY driver

 MAINTAINERS                      |   8 ++
 drivers/net/phy/Kconfig          |   6 +
 drivers/net/phy/Makefile         |   1 +
 drivers/net/phy/ax88796b_rust.rs |   7 +-
 drivers/net/phy/qt2025.rs        |  92 +++++++++++++
 rust/kernel/lib.rs               |   1 +
 rust/kernel/net/phy.rs           |  77 ++++++-----
 rust/kernel/net/phy/reg.rs       | 219 +++++++++++++++++++++++++++++++
 rust/kernel/sizes.rs             |  26 ++++
 rust/uapi/uapi_helper.h          |   1 +
 10 files changed, 400 insertions(+), 38 deletions(-)
 create mode 100644 drivers/net/phy/qt2025.rs
 create mode 100644 rust/kernel/net/phy/reg.rs
 create mode 100644 rust/kernel/sizes.rs


base-commit: 0a658d088cc63745528cf0ec8a2c2df0f37742d9
-- 
2.34.1


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

end of thread, other threads:[~2024-08-01  9:08 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-31  4:21 [PATCH net-next v2 0/6] net: phy: add Applied Micro QT2025 PHY driver FUJITA Tomonori
2024-07-31  4:21 ` [PATCH net-next v2 1/6] rust: sizes: add commonly used constants FUJITA Tomonori
2024-07-31  8:33   ` Alice Ryhl
2024-07-31 12:16   ` Andrew Lunn
2024-07-31 12:30     ` Alice Ryhl
2024-08-01  1:21       ` FUJITA Tomonori
2024-07-31  4:21 ` [PATCH net-next v2 2/6] rust: net::phy support probe callback FUJITA Tomonori
2024-07-31  8:33   ` Alice Ryhl
2024-07-31 12:24   ` Andrew Lunn
2024-07-31 12:32     ` Alice Ryhl
2024-07-31 20:57       ` Andrew Lunn
2024-08-01  9:07         ` Alice Ryhl
2024-08-01  0:17       ` FUJITA Tomonori
2024-08-01  9:07         ` Alice Ryhl
2024-07-31  4:21 ` [PATCH net-next v2 3/6] rust: net::phy implement AsRef<kernel::device::Device> trait FUJITA Tomonori
2024-07-31  8:38   ` Alice Ryhl
2024-08-01  1:03     ` FUJITA Tomonori
2024-07-31  4:21 ` [PATCH net-next v2 4/6] rust: net::phy unified read/write API for C22 and C45 registers FUJITA Tomonori
2024-07-31  4:21 ` [PATCH net-next v2 5/6] rust: net::phy unified genphy_read_status function " FUJITA Tomonori
2024-07-31  4:21 ` [PATCH net-next v2 6/6] net: phy: add Applied Micro QT2025 PHY driver FUJITA Tomonori
2024-08-01  1:55   ` FUJITA Tomonori

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