From patchwork Mon Nov 13 01:39:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Marangi X-Patchwork-Id: 743584 Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5E86210E6; Mon, 13 Nov 2023 01:40:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="FruBOy9i" Received: from mail-wr1-x435.google.com (mail-wr1-x435.google.com [IPv6:2a00:1450:4864:20::435]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5459B1FDA; Sun, 12 Nov 2023 17:40:08 -0800 (PST) Received: by mail-wr1-x435.google.com with SMTP id ffacd0b85a97d-32f7abbb8b4so2376676f8f.0; Sun, 12 Nov 2023 17:40:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1699839606; x=1700444406; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:from:to:cc:subject:date:message-id:reply-to; bh=92mM3S+rftnVoyhzP0G9ontuc5Lmaq8xtKxeNl6NQec=; b=FruBOy9iu9m9pEdKBJbLTL/TxRf3j2qiwdiBLnYH8ucOHrsfr+RdUDe2W77o3Xt+yy 7MSUu7jrvXFBbeskiKAZhJALcziXR7QWTOmmJJa2lAb+t127uy5rUgtYyO1WP8un5nH9 rTZgvKsJ8E9vKbc9MDzrj9dvU3IzxU03++ibyn/uZD1vOcwbz9V49Jtoqq08705rmX1f PSzAYeKYL7Ka/e2QdyC6Ukd7b1UhB9FlG+dP4MSmRRO/9aJTR3irKM6hbxS77BVDQ+li c6vxpptiinAuWY3PJmchK2PpSgjGyIFoRnd+5ucyuzNiNiwKToZlnOmEIlc93EZpvgSE RvFw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699839606; x=1700444406; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=92mM3S+rftnVoyhzP0G9ontuc5Lmaq8xtKxeNl6NQec=; b=GNdPRzYT5LbcMnb0OsrXf4CHJbbitMqVv4DUPs/d/i2XegrCrW8+tMQYtsTlqUk5MU YtipSlztYyH4g73n4obSDWvUjdlasKBBEROqPKc0NvzduZXBbO7rwLLaHIIcdkXK6gDq Lbf08p+LDOWlyGIOkjTDaLBictGwa7fQV+6PhxdwhYUoZ2yOwaBlP6aCGt6b8ijY6opk sH3Ue+jr7ixlwaFUGHnVpg+DnF5+6ZChoz/Ftlb0vjaTOLZsWAjtOb9LxAuQFZBO6U36 yhjufF8WrQHwgq+5bjCyOLRcV5ufllovEQctsC959WSPkTtXTUk7semuQEGuSvt+oa6L VjgQ== X-Gm-Message-State: AOJu0YxwWVKSZ1CJ/PKIMY18+pe/sx/AsqU5xBEpeJ1qb64p6fhLBhWL 0TbBIUSAUhgRfHrO2V0PnBYr0UgqKGs= X-Google-Smtp-Source: AGHT+IFZy5wWkuI0ag278wevSMrOe7WuThjmfk9GdaUkjAyc3whMMcsaJmu9a8Vpmt/IXU5OnRQ+kw== X-Received: by 2002:adf:b651:0:b0:32d:81f7:d6f2 with SMTP id i17-20020adfb651000000b0032d81f7d6f2mr3049869wre.30.1699839606117; Sun, 12 Nov 2023 17:40:06 -0800 (PST) Received: from localhost.localdomain (93-34-89-13.ip49.fastwebnet.it. [93.34.89.13]) by smtp.googlemail.com with ESMTPSA id d16-20020adfe850000000b0032fb17c65desm4257268wrn.19.2023.11.12.17.40.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 12 Nov 2023 17:40:05 -0800 (PST) From: Christian Marangi To: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Andrew Lunn , Heiner Kallweit , Russell King , Christian Marangi , Robert Marko , Vladimir Oltean , netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [net-next PATCH RFC v7 1/4] net: phy: aquantia: move to separate directory Date: Mon, 13 Nov 2023 02:39:57 +0100 Message-Id: <20231113014000.22840-1-ansuelsmth@gmail.com> X-Mailer: git-send-email 2.40.1 Precedence: bulk X-Mailing-List: devicetree@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Move aquantia PHY driver to separate driectory in preparation for firmware loading support to keep things tidy. Signed-off-by: Christian Marangi Reviewed-by: Andrew Lunn --- Changes v7: - Add Reviewed-by tag Changes v4: - Keep order for kconfig config Changes v3: - Add this patch drivers/net/phy/Kconfig | 5 +---- drivers/net/phy/Makefile | 6 +----- drivers/net/phy/aquantia/Kconfig | 5 +++++ drivers/net/phy/aquantia/Makefile | 6 ++++++ drivers/net/phy/{ => aquantia}/aquantia.h | 0 drivers/net/phy/{ => aquantia}/aquantia_hwmon.c | 0 drivers/net/phy/{ => aquantia}/aquantia_main.c | 0 7 files changed, 13 insertions(+), 9 deletions(-) create mode 100644 drivers/net/phy/aquantia/Kconfig create mode 100644 drivers/net/phy/aquantia/Makefile rename drivers/net/phy/{ => aquantia}/aquantia.h (100%) rename drivers/net/phy/{ => aquantia}/aquantia_hwmon.c (100%) rename drivers/net/phy/{ => aquantia}/aquantia_main.c (100%) diff --git a/drivers/net/phy/Kconfig b/drivers/net/phy/Kconfig index 421d2b62918f..25cfc5ded1da 100644 --- a/drivers/net/phy/Kconfig +++ b/drivers/net/phy/Kconfig @@ -96,10 +96,7 @@ config ADIN1100_PHY Currently supports the: - ADIN1100 - Robust,Industrial, Low Power 10BASE-T1L Ethernet PHY -config AQUANTIA_PHY - tristate "Aquantia PHYs" - help - Currently supports the Aquantia AQ1202, AQ2104, AQR105, AQR405 +source "drivers/net/phy/aquantia/Kconfig" config AX88796B_PHY tristate "Asix PHYs" diff --git a/drivers/net/phy/Makefile b/drivers/net/phy/Makefile index c945ed9bd14b..f65e85c91fc1 100644 --- a/drivers/net/phy/Makefile +++ b/drivers/net/phy/Makefile @@ -35,11 +35,7 @@ obj-y += $(sfp-obj-y) $(sfp-obj-m) obj-$(CONFIG_ADIN_PHY) += adin.o obj-$(CONFIG_ADIN1100_PHY) += adin1100.o obj-$(CONFIG_AMD_PHY) += amd.o -aquantia-objs += aquantia_main.o -ifdef CONFIG_HWMON -aquantia-objs += aquantia_hwmon.o -endif -obj-$(CONFIG_AQUANTIA_PHY) += aquantia.o +obj-$(CONFIG_AQUANTIA_PHY) += aquantia/ obj-$(CONFIG_AT803X_PHY) += at803x.o obj-$(CONFIG_AX88796B_PHY) += ax88796b.o obj-$(CONFIG_BCM54140_PHY) += bcm54140.o diff --git a/drivers/net/phy/aquantia/Kconfig b/drivers/net/phy/aquantia/Kconfig new file mode 100644 index 000000000000..226146417a6a --- /dev/null +++ b/drivers/net/phy/aquantia/Kconfig @@ -0,0 +1,5 @@ +# SPDX-License-Identifier: GPL-2.0-only +config AQUANTIA_PHY + tristate "Aquantia PHYs" + help + Currently supports the Aquantia AQ1202, AQ2104, AQR105, AQR405 diff --git a/drivers/net/phy/aquantia/Makefile b/drivers/net/phy/aquantia/Makefile new file mode 100644 index 000000000000..346f350bc084 --- /dev/null +++ b/drivers/net/phy/aquantia/Makefile @@ -0,0 +1,6 @@ +# SPDX-License-Identifier: GPL-2.0 +aquantia-objs += aquantia_main.o +ifdef CONFIG_HWMON +aquantia-objs += aquantia_hwmon.o +endif +obj-$(CONFIG_AQUANTIA_PHY) += aquantia.o diff --git a/drivers/net/phy/aquantia.h b/drivers/net/phy/aquantia/aquantia.h similarity index 100% rename from drivers/net/phy/aquantia.h rename to drivers/net/phy/aquantia/aquantia.h diff --git a/drivers/net/phy/aquantia_hwmon.c b/drivers/net/phy/aquantia/aquantia_hwmon.c similarity index 100% rename from drivers/net/phy/aquantia_hwmon.c rename to drivers/net/phy/aquantia/aquantia_hwmon.c diff --git a/drivers/net/phy/aquantia_main.c b/drivers/net/phy/aquantia/aquantia_main.c similarity index 100% rename from drivers/net/phy/aquantia_main.c rename to drivers/net/phy/aquantia/aquantia_main.c From patchwork Mon Nov 13 01:40:00 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Marangi X-Patchwork-Id: 743583 Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B35F553BD; Mon, 13 Nov 2023 01:40:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="J6Rns8e5" Received: from mail-wr1-x42a.google.com (mail-wr1-x42a.google.com [IPv6:2a00:1450:4864:20::42a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BBE93D7A; Sun, 12 Nov 2023 17:40:11 -0800 (PST) Received: by mail-wr1-x42a.google.com with SMTP id ffacd0b85a97d-32fb190bf9bso2873469f8f.1; Sun, 12 Nov 2023 17:40:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1699839610; x=1700444410; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=wtqg1rFWEHKzSzI4x+itPoe4FygsbFj76j8H27OY3F0=; b=J6Rns8e5RA4H2lJRs7pncukaoagJzyVj0v5txgrum5f8gP/1Zf702VtdNdCJJ31m4/ lJusdKu5x0jEAZr4kBR43FSEei88Lg+BorpSJrj0EznWK1Civxu//peWuZZcXUc+LI6E esVqVCKwJdAXUV6dTgDZR7O0P5cfUM2JjF9RvRkagWayvnAdIk3iARvUFq5diyy83Lud odhmPvMdux1b3Zq0h5s5G5CBHa3j1R9cCRCJsjNjCfBvU0geAWGetAWal5FTbK/0Nn8L tPn6qP2i7k0xf7TnB7Tmsu/fXNuVgi9WVj2jGXTUz4AmZ0tUkLuDWwnc49wrj2k1wzqX 978g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699839610; x=1700444410; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=wtqg1rFWEHKzSzI4x+itPoe4FygsbFj76j8H27OY3F0=; b=t8KJ1fHQi0u0pQyOB0fuQLrn2Jdu7Pqm5zj+PR9RrNARyvTjXLV+6O4zpqn2g0bbVj vHgrXet8tNWJ6KpRGqL+eCuNTXUEiqo61rkkkUxirBkeB4ncFPxb09ZgD7gatwyWX8Cs CMBnHd9hCNdF/aTVCrp5etTCR1fLCP/oPluMWI+GENjLRfJ58WrLLzV/cBXmvdGn/mWI LxaJsdspdPX2nBohz/Gzo+NiVG1EQ+3wl8R6DKuqMnSK90OqdMaMp0ADymaw1wpLVm0x TjNjkNvnNyjiWok0dqbBkplwg6rij9fwR6eMir8r5/ZKAJXHN7Eu7MvdjZb3v0+Y6Lg5 7mLw== X-Gm-Message-State: AOJu0YwrV4RhY4FIQQHOBCVfIPjKwud1UJmDV3XfcB8GCs7xpRqFNUSs 3YVwvpZc6yFkmxsrUAHbDMM= X-Google-Smtp-Source: AGHT+IGxniIK6xLD/CSzPkIGS4NMb7vHxrnw6pXgdnbnrA/2gU7B+bwpeyfiu9rtsjdXag1G8feq5w== X-Received: by 2002:a05:6000:2c7:b0:32f:7beb:d009 with SMTP id o7-20020a05600002c700b0032f7bebd009mr8787446wry.17.1699839610004; Sun, 12 Nov 2023 17:40:10 -0800 (PST) Received: from localhost.localdomain (93-34-89-13.ip49.fastwebnet.it. [93.34.89.13]) by smtp.googlemail.com with ESMTPSA id d16-20020adfe850000000b0032fb17c65desm4257268wrn.19.2023.11.12.17.40.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 12 Nov 2023 17:40:09 -0800 (PST) From: Christian Marangi To: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Andrew Lunn , Heiner Kallweit , Russell King , Christian Marangi , Robert Marko , Vladimir Oltean , netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Conor Dooley , Rob Herring Subject: [net-next PATCH RFC v7 4/4] dt-bindings: Document Marvell Aquantia PHY Date: Mon, 13 Nov 2023 02:40:00 +0100 Message-Id: <20231113014000.22840-4-ansuelsmth@gmail.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20231113014000.22840-1-ansuelsmth@gmail.com> References: <20231113014000.22840-1-ansuelsmth@gmail.com> Precedence: bulk X-Mailing-List: devicetree@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Document bindings for Marvell Aquantia PHY. The Marvell Aquantia PHY require a firmware to work correctly and there at least 3 way to load this firmware. Describe all the different way and document the binding "firmware-name" to load the PHY firmware from userspace. Signed-off-by: Christian Marangi Reviewed-by: Conor Dooley Acked-by: Rob Herring --- Changes v7: - Add Acked-by tag Changes v6: - Add Reviewed-by tag - Drop comments in dts examples - Improve commit title - Fix wrong reg in example Changes v5: - Drop extra entry not related to HW description Changes v3: - Make DT description more OS agnostic - Use custom select to fix dtbs checks Changes v2: - Add DT patch .../bindings/net/marvell,aquantia.yaml | 116 ++++++++++++++++++ 1 file changed, 116 insertions(+) create mode 100644 Documentation/devicetree/bindings/net/marvell,aquantia.yaml diff --git a/Documentation/devicetree/bindings/net/marvell,aquantia.yaml b/Documentation/devicetree/bindings/net/marvell,aquantia.yaml new file mode 100644 index 000000000000..9854fab4c4db --- /dev/null +++ b/Documentation/devicetree/bindings/net/marvell,aquantia.yaml @@ -0,0 +1,116 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/net/marvell,aquantia.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Marvell Aquantia Ethernet PHY + +maintainers: + - Christian Marangi + +description: | + Marvell Aquantia Ethernet PHY require a firmware to be loaded to actually + work. + + This can be done and is implemented by OEM in 3 different way: + - Attached SPI flash directly to the PHY with the firmware. The PHY + will self load the firmware in the presence of this configuration. + - Read from a dedicated partition on system NAND declared in an + NVMEM cell, and loaded to the PHY using its mailbox interface. + - Manually provided firmware loaded from a file in the filesystem. + +allOf: + - $ref: ethernet-phy.yaml# + +select: + properties: + compatible: + contains: + enum: + - ethernet-phy-id03a1.b445 + - ethernet-phy-id03a1.b460 + - ethernet-phy-id03a1.b4a2 + - ethernet-phy-id03a1.b4d0 + - ethernet-phy-id03a1.b4e0 + - ethernet-phy-id03a1.b5c2 + - ethernet-phy-id03a1.b4b0 + - ethernet-phy-id03a1.b662 + - ethernet-phy-id03a1.b712 + - ethernet-phy-id31c3.1c12 + required: + - compatible + +properties: + reg: + maxItems: 1 + + firmware-name: + description: specify the name of PHY firmware to load + + nvmem-cells: + description: phandle to the firmware nvmem cell + maxItems: 1 + + nvmem-cell-names: + const: firmware + +required: + - compatible + - reg + +unevaluatedProperties: false + +examples: + - | + mdio { + #address-cells = <1>; + #size-cells = <0>; + + ethernet-phy@0 { + compatible = "ethernet-phy-id31c3.1c12", + "ethernet-phy-ieee802.3-c45"; + + reg = <0>; + firmware-name = "AQR-G4_v5.4.C-AQR_CIG_WF-1945_0x8_ID44776_VER1630.cld"; + }; + + ethernet-phy@1 { + compatible = "ethernet-phy-id31c3.1c12", + "ethernet-phy-ieee802.3-c45"; + + reg = <1>; + nvmem-cells = <&aqr_fw>; + nvmem-cell-names = "firmware"; + }; + }; + + flash { + compatible = "jedec,spi-nor"; + #address-cells = <1>; + #size-cells = <1>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + /* ... */ + + partition@650000 { + compatible = "nvmem-cells"; + label = "0:ethphyfw"; + reg = <0x650000 0x80000>; + read-only; + #address-cells = <1>; + #size-cells = <1>; + + aqr_fw: aqr_fw@0 { + reg = <0x0 0x5f42a>; + }; + }; + + /* ... */ + + }; + };