linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCHv4 0/5] wifi: ath9k: add ahb OF support
@ 2025-05-25 21:42 Rosen Penev
  2025-05-25 21:42 ` [PATCHv4 1/5] wifi: ath9k: ahb: reorder declarations Rosen Penev
                   ` (4 more replies)
  0 siblings, 5 replies; 16+ messages in thread
From: Rosen Penev @ 2025-05-25 21:42 UTC (permalink / raw)
  To: linux-wireless
  Cc: Toke Høiland-Jørgensen, nbd, Johannes Berg, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Thomas Bogendoerfer,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	open list, open list:MIPS

First two commits are small cleanups to make the changes of the third
simpler. The fourth actually adds dts definitions to use ahb.

v2: Add documentation, use kernel_ulong_t, and of_device_get_match_data
v3: Use qcom prefix and wifi suffix as in other ath drivers.
v4: fix up dts example in Documentation

Rosen Penev (5):
  wifi: ath9k: ahb: reorder declarations
  wifi: ath9k: ahb: reorder includes
  wifi: ath9k: ahb: replace id_table with of
  dt-bindings: net: wireless: ath9k: add OF bindings
  mips: dts: qca: add wmac support

 .../bindings/net/wireless/qca,ath9k.yaml      | 23 ++++++-
 arch/mips/boot/dts/qca/ar9132.dtsi            |  9 +++
 .../boot/dts/qca/ar9132_tl_wr1043nd_v1.dts    |  4 ++
 arch/mips/boot/dts/qca/ar9331.dtsi            |  9 +++
 arch/mips/boot/dts/qca/ar9331_dpt_module.dts  |  4 ++
 .../mips/boot/dts/qca/ar9331_dragino_ms14.dts |  4 ++
 arch/mips/boot/dts/qca/ar9331_omega.dts       |  4 ++
 .../qca/ar9331_openembed_som9331_board.dts    |  4 ++
 arch/mips/boot/dts/qca/ar9331_tl_mr3020.dts   |  4 ++
 drivers/net/wireless/ath/ath9k/ahb.c          | 60 +++++++------------
 10 files changed, 84 insertions(+), 41 deletions(-)

-- 
2.49.0


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

* [PATCHv4 1/5] wifi: ath9k: ahb: reorder declarations
  2025-05-25 21:42 [PATCHv4 0/5] wifi: ath9k: add ahb OF support Rosen Penev
@ 2025-05-25 21:42 ` Rosen Penev
  2025-05-26  4:27   ` Krzysztof Kozlowski
  2025-05-25 21:42 ` [PATCHv4 2/5] wifi: ath9k: ahb: reorder includes Rosen Penev
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 16+ messages in thread
From: Rosen Penev @ 2025-05-25 21:42 UTC (permalink / raw)
  To: linux-wireless
  Cc: Toke Høiland-Jørgensen, nbd, Johannes Berg, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Thomas Bogendoerfer,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	open list, open list:MIPS

Easier to look at. Follows netdev style.

Also remove ret assignment. Because of all of these devm conversions,
ret = 0 is a path that never gets hit. The first time it does it when
request_irq fails, but that ends up reassigning it.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
---
 drivers/net/wireless/ath/ath9k/ahb.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/net/wireless/ath/ath9k/ahb.c b/drivers/net/wireless/ath/ath9k/ahb.c
index 49b7ab26c477..d2a97e74f451 100644
--- a/drivers/net/wireless/ath/ath9k/ahb.c
+++ b/drivers/net/wireless/ath/ath9k/ahb.c
@@ -71,14 +71,14 @@ static const struct ath_bus_ops ath_ahb_bus_ops  = {
 
 static int ath_ahb_probe(struct platform_device *pdev)
 {
-	void __iomem *mem;
-	struct ath_softc *sc;
-	struct ieee80211_hw *hw;
 	const struct platform_device_id *id = platform_get_device_id(pdev);
-	int irq;
-	int ret = 0;
+	struct ieee80211_hw *hw;
+	struct ath_softc *sc;
 	struct ath_hw *ah;
+	void __iomem *mem;
 	char hw_name[64];
+	int irq;
+	int ret;
 
 	if (!dev_get_platdata(&pdev->dev)) {
 		dev_err(&pdev->dev, "no platform data specified\n");
-- 
2.49.0


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

* [PATCHv4 2/5] wifi: ath9k: ahb: reorder includes
  2025-05-25 21:42 [PATCHv4 0/5] wifi: ath9k: add ahb OF support Rosen Penev
  2025-05-25 21:42 ` [PATCHv4 1/5] wifi: ath9k: ahb: reorder declarations Rosen Penev
@ 2025-05-25 21:42 ` Rosen Penev
  2025-05-26  4:27   ` Krzysztof Kozlowski
  2025-05-25 21:42 ` [PATCHv4 3/5] dt-bindings: net: wireless: ath9k: add WIFI bindings Rosen Penev
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 16+ messages in thread
From: Rosen Penev @ 2025-05-25 21:42 UTC (permalink / raw)
  To: linux-wireless
  Cc: Toke Høiland-Jørgensen, nbd, Johannes Berg, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Thomas Bogendoerfer,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	open list, open list:MIPS

Alphabetic includes are easier to look at and to make further changes to
them.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
---
 drivers/net/wireless/ath/ath9k/ahb.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/ath/ath9k/ahb.c b/drivers/net/wireless/ath/ath9k/ahb.c
index d2a97e74f451..1ffec827ed87 100644
--- a/drivers/net/wireless/ath/ath9k/ahb.c
+++ b/drivers/net/wireless/ath/ath9k/ahb.c
@@ -16,10 +16,11 @@
  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
+#include <linux/mod_devicetable.h>
+#include <linux/module.h>
 #include <linux/nl80211.h>
 #include <linux/platform_device.h>
-#include <linux/module.h>
-#include <linux/mod_devicetable.h>
+
 #include "ath9k.h"
 
 static const struct platform_device_id ath9k_platform_id_table[] = {
-- 
2.49.0


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

* [PATCHv4 3/5] dt-bindings: net: wireless: ath9k: add WIFI bindings
  2025-05-25 21:42 [PATCHv4 0/5] wifi: ath9k: add ahb OF support Rosen Penev
  2025-05-25 21:42 ` [PATCHv4 1/5] wifi: ath9k: ahb: reorder declarations Rosen Penev
  2025-05-25 21:42 ` [PATCHv4 2/5] wifi: ath9k: ahb: reorder includes Rosen Penev
@ 2025-05-25 21:42 ` Rosen Penev
  2025-05-26  4:26   ` Krzysztof Kozlowski
  2025-05-26  5:23   ` Krzysztof Kozlowski
  2025-05-25 21:42 ` [PATCHv4 4/5] wifi: ath9k: ahb: replace id_table with of Rosen Penev
  2025-05-25 21:42 ` [PATCHv4 5/5] mips: dts: qca: add wmac support Rosen Penev
  4 siblings, 2 replies; 16+ messages in thread
From: Rosen Penev @ 2025-05-25 21:42 UTC (permalink / raw)
  To: linux-wireless
  Cc: Toke Høiland-Jørgensen, nbd, Johannes Berg, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Thomas Bogendoerfer,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	open list, open list:MIPS

These are for the wireless chips that come built in with various
Atheros/QCA SoCs. dts wise, the difference between pcie and the wmac is

AHB > PCIE > WIFI
AHB > WIFI

These will be used to replace the platform_device code with OF in the
following patch.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
---
 .../bindings/net/wireless/qca,ath9k.yaml       | 18 +++++++++++++++++-
 1 file changed, 17 insertions(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/net/wireless/qca,ath9k.yaml b/Documentation/devicetree/bindings/net/wireless/qca,ath9k.yaml
index 0e5412cff2bc..68d56e5b8680 100644
--- a/Documentation/devicetree/bindings/net/wireless/qca,ath9k.yaml
+++ b/Documentation/devicetree/bindings/net/wireless/qca,ath9k.yaml
@@ -12,7 +12,7 @@ maintainers:
 description: |
   This node provides properties for configuring the ath9k wireless device.
   The node is expected to be specified as a child node of the PCI controller
-  to which the wireless chip is connected.
+  or AHB bus to which the wireless chip is connected.
 
 allOf:
   - $ref: ieee80211.yaml#
@@ -35,6 +35,12 @@ properties:
       - pci168c,0034  # AR9462
       - pci168c,0036  # AR9565
       - pci168c,0037  # AR1111 and AR9485
+      - qcom,ar9130-wifi
+      - qcom,ar9330-wifi
+      - qcom,ar9340-wifi
+      - qcom,qca9530-wifi
+      - qcom,qca9550-wifi
+      - qcom,qca9560-wifi
 
   reg:
     maxItems: 1
@@ -88,3 +94,13 @@ examples:
         nvmem-cell-names = "mac-address", "calibration";
       };
     };
+  - |
+    ahb {
+      #address-cells = <1>;
+      #size-cells = <1>;
+      wifi@180c0000 {
+        compatible = "qcom,ar9130-wifi";
+        reg = <0x180c0000 0x230000>;
+        interrupts = <2>;
+      };
+    };
-- 
2.49.0


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

* [PATCHv4 4/5] wifi: ath9k: ahb: replace id_table with of
  2025-05-25 21:42 [PATCHv4 0/5] wifi: ath9k: add ahb OF support Rosen Penev
                   ` (2 preceding siblings ...)
  2025-05-25 21:42 ` [PATCHv4 3/5] dt-bindings: net: wireless: ath9k: add WIFI bindings Rosen Penev
@ 2025-05-25 21:42 ` Rosen Penev
  2025-05-26  4:30   ` Krzysztof Kozlowski
  2025-05-26  5:23   ` Krzysztof Kozlowski
  2025-05-25 21:42 ` [PATCHv4 5/5] mips: dts: qca: add wmac support Rosen Penev
  4 siblings, 2 replies; 16+ messages in thread
From: Rosen Penev @ 2025-05-25 21:42 UTC (permalink / raw)
  To: linux-wireless
  Cc: Toke Høiland-Jørgensen, nbd, Johannes Berg, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Thomas Bogendoerfer,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	open list, open list:MIPS

Since 2b0996c7646 , all of this platform code became no-op with no OF
replacement. Not only that, there are no users of AHB here. Add an OF
match table that mostly mirrors the original platform device id table.
Use a qca prefix as is done for the only other property: qca,no-eeprom.
Also used qca prefix for ar9530 as the latter seems to be a mistake.

This will be used to add ath9k support for the various ath79 devices
here.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
---
 drivers/net/wireless/ath/ath9k/ahb.c | 47 ++++++++--------------------
 1 file changed, 13 insertions(+), 34 deletions(-)

diff --git a/drivers/net/wireless/ath/ath9k/ahb.c b/drivers/net/wireless/ath/ath9k/ahb.c
index 1ffec827ed87..c5e36f9e7390 100644
--- a/drivers/net/wireless/ath/ath9k/ahb.c
+++ b/drivers/net/wireless/ath/ath9k/ahb.c
@@ -19,35 +19,18 @@
 #include <linux/mod_devicetable.h>
 #include <linux/module.h>
 #include <linux/nl80211.h>
+#include <linux/of.h>
 #include <linux/platform_device.h>
 
 #include "ath9k.h"
 
-static const struct platform_device_id ath9k_platform_id_table[] = {
-	{
-		.name = "ath9k",
-		.driver_data = AR5416_AR9100_DEVID,
-	},
-	{
-		.name = "ar933x_wmac",
-		.driver_data = AR9300_DEVID_AR9330,
-	},
-	{
-		.name = "ar934x_wmac",
-		.driver_data = AR9300_DEVID_AR9340,
-	},
-	{
-		.name = "qca955x_wmac",
-		.driver_data = AR9300_DEVID_QCA955X,
-	},
-	{
-		.name = "qca953x_wmac",
-		.driver_data = AR9300_DEVID_AR953X,
-	},
-	{
-		.name = "qca956x_wmac",
-		.driver_data = AR9300_DEVID_QCA956X,
-	},
+static const struct of_device_id ath9k_of_match_table[] = {
+	{ .compatible = "qcom,ar9130-wifi", .data = (void *)AR5416_AR9100_DEVID },
+	{ .compatible = "qcom,ar9330-wifi", .data = (void *)AR9300_DEVID_AR9330 },
+	{ .compatible = "qcom,ar9340-wifi", .data = (void *)AR9300_DEVID_AR9340 },
+	{ .compatible = "qcom,qca9530-wifi", .data = (void *)AR9300_DEVID_AR953X },
+	{ .compatible = "qcom,qca9550-wifi", .data = (void *)AR9300_DEVID_QCA955X },
+	{ .compatible = "qcom,qca9560-wifi", .data = (void *)AR9300_DEVID_QCA956X },
 	{},
 };
 
@@ -72,20 +55,15 @@ static const struct ath_bus_ops ath_ahb_bus_ops  = {
 
 static int ath_ahb_probe(struct platform_device *pdev)
 {
-	const struct platform_device_id *id = platform_get_device_id(pdev);
 	struct ieee80211_hw *hw;
 	struct ath_softc *sc;
 	struct ath_hw *ah;
 	void __iomem *mem;
 	char hw_name[64];
+	u16 dev_id;
 	int irq;
 	int ret;
 
-	if (!dev_get_platdata(&pdev->dev)) {
-		dev_err(&pdev->dev, "no platform data specified\n");
-		return -EINVAL;
-	}
-
 	mem = devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(mem)) {
 		dev_err(&pdev->dev, "ioremap failed\n");
@@ -118,7 +96,8 @@ static int ath_ahb_probe(struct platform_device *pdev)
 		goto err_free_hw;
 	}
 
-	ret = ath9k_init_device(id->driver_data, sc, &ath_ahb_bus_ops);
+	dev_id = (u16)(kernel_ulong_t)of_device_get_match_data(&pdev->dev);
+	ret = ath9k_init_device(dev_id, sc, &ath_ahb_bus_ops);
 	if (ret) {
 		dev_err(&pdev->dev, "failed to initialize device\n");
 		goto err_irq;
@@ -156,11 +135,11 @@ static struct platform_driver ath_ahb_driver = {
 	.remove = ath_ahb_remove,
 	.driver = {
 		.name = "ath9k",
+		.of_match_table = ath9k_of_match_table,
 	},
-	.id_table = ath9k_platform_id_table,
 };
 
-MODULE_DEVICE_TABLE(platform, ath9k_platform_id_table);
+MODULE_DEVICE_TABLE(of, ath9k_of_match_table);
 
 int ath_ahb_init(void)
 {
-- 
2.49.0


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

* [PATCHv4 5/5] mips: dts: qca: add wmac support
  2025-05-25 21:42 [PATCHv4 0/5] wifi: ath9k: add ahb OF support Rosen Penev
                   ` (3 preceding siblings ...)
  2025-05-25 21:42 ` [PATCHv4 4/5] wifi: ath9k: ahb: replace id_table with of Rosen Penev
@ 2025-05-25 21:42 ` Rosen Penev
  2025-05-26  4:26   ` Krzysztof Kozlowski
  4 siblings, 1 reply; 16+ messages in thread
From: Rosen Penev @ 2025-05-25 21:42 UTC (permalink / raw)
  To: linux-wireless
  Cc: Toke Høiland-Jørgensen, nbd, Johannes Berg, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Thomas Bogendoerfer,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	open list, open list:MIPS

Now that OF ahb support was added to the ath9k driver, we can use it to
enable and use the SoC wireless found in these chipsets.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
---
 arch/mips/boot/dts/qca/ar9132.dtsi                       | 9 +++++++++
 arch/mips/boot/dts/qca/ar9132_tl_wr1043nd_v1.dts         | 4 ++++
 arch/mips/boot/dts/qca/ar9331.dtsi                       | 9 +++++++++
 arch/mips/boot/dts/qca/ar9331_dpt_module.dts             | 4 ++++
 arch/mips/boot/dts/qca/ar9331_dragino_ms14.dts           | 4 ++++
 arch/mips/boot/dts/qca/ar9331_omega.dts                  | 4 ++++
 .../mips/boot/dts/qca/ar9331_openembed_som9331_board.dts | 4 ++++
 arch/mips/boot/dts/qca/ar9331_tl_mr3020.dts              | 4 ++++
 8 files changed, 42 insertions(+)

diff --git a/arch/mips/boot/dts/qca/ar9132.dtsi b/arch/mips/boot/dts/qca/ar9132.dtsi
index aa148d51ab68..47bddd36cd94 100644
--- a/arch/mips/boot/dts/qca/ar9132.dtsi
+++ b/arch/mips/boot/dts/qca/ar9132.dtsi
@@ -155,6 +155,15 @@ spi: spi@1f000000 {
 			#address-cells = <1>;
 			#size-cells = <0>;
 		};
+
+		wifi: wifi@180c0000 {
+			compatible = "qcom,ar9130-wifi";
+			reg = <0x180c0000 0x230000>;
+
+			interrupts = <2>;
+
+			status = "disabled";
+		};
 	};
 
 	usb_phy: usb-phy {
diff --git a/arch/mips/boot/dts/qca/ar9132_tl_wr1043nd_v1.dts b/arch/mips/boot/dts/qca/ar9132_tl_wr1043nd_v1.dts
index f894fe17816b..a7901bb040ce 100644
--- a/arch/mips/boot/dts/qca/ar9132_tl_wr1043nd_v1.dts
+++ b/arch/mips/boot/dts/qca/ar9132_tl_wr1043nd_v1.dts
@@ -108,3 +108,7 @@ partition@2 {
 		};
 	};
 };
+
+&wifi {
+	status = "okay";
+};
diff --git a/arch/mips/boot/dts/qca/ar9331.dtsi b/arch/mips/boot/dts/qca/ar9331.dtsi
index 768ac0f869b1..9a2590f490bb 100644
--- a/arch/mips/boot/dts/qca/ar9331.dtsi
+++ b/arch/mips/boot/dts/qca/ar9331.dtsi
@@ -285,6 +285,15 @@ spi: spi@1f000000 {
 
 			status = "disabled";
 		};
+
+		wifi: wifi@18100000 {
+			compatible = "qcom,ar9330-wifi";
+			reg = <0x18100000 0x20000>;
+
+			interrupts = <2>;
+
+			status = "disabled";
+		};
 	};
 
 	usb_phy: usb-phy {
diff --git a/arch/mips/boot/dts/qca/ar9331_dpt_module.dts b/arch/mips/boot/dts/qca/ar9331_dpt_module.dts
index c857cd22f7db..08e728b8ced8 100644
--- a/arch/mips/boot/dts/qca/ar9331_dpt_module.dts
+++ b/arch/mips/boot/dts/qca/ar9331_dpt_module.dts
@@ -97,3 +97,7 @@ &phy_port0 {
 &phy_port4 {
 	status = "okay";
 };
+
+&wifi {
+	status = "okay";
+};
diff --git a/arch/mips/boot/dts/qca/ar9331_dragino_ms14.dts b/arch/mips/boot/dts/qca/ar9331_dragino_ms14.dts
index 7affa58d4fa6..37a74aabe4b4 100644
--- a/arch/mips/boot/dts/qca/ar9331_dragino_ms14.dts
+++ b/arch/mips/boot/dts/qca/ar9331_dragino_ms14.dts
@@ -98,3 +98,7 @@ spiflash: w25q128@0 {
 		reg = <0>;
 	};
 };
+
+&wifi {
+	status = "okay";
+};
diff --git a/arch/mips/boot/dts/qca/ar9331_omega.dts b/arch/mips/boot/dts/qca/ar9331_omega.dts
index 8904aa917a6e..1450419024cb 100644
--- a/arch/mips/boot/dts/qca/ar9331_omega.dts
+++ b/arch/mips/boot/dts/qca/ar9331_omega.dts
@@ -74,3 +74,7 @@ spiflash: w25q128@0 {
 		reg = <0>;
 	};
 };
+
+&wifi {
+	status = "okay";
+};
diff --git a/arch/mips/boot/dts/qca/ar9331_openembed_som9331_board.dts b/arch/mips/boot/dts/qca/ar9331_openembed_som9331_board.dts
index dc65ebd60bbc..5786a827c000 100644
--- a/arch/mips/boot/dts/qca/ar9331_openembed_som9331_board.dts
+++ b/arch/mips/boot/dts/qca/ar9331_openembed_som9331_board.dts
@@ -106,3 +106,7 @@ &phy_port2 {
 &phy_port4 {
 	status = "okay";
 };
+
+&wifi {
+	status = "okay";
+};
diff --git a/arch/mips/boot/dts/qca/ar9331_tl_mr3020.dts b/arch/mips/boot/dts/qca/ar9331_tl_mr3020.dts
index 10b9759228b7..a7108c803eb3 100644
--- a/arch/mips/boot/dts/qca/ar9331_tl_mr3020.dts
+++ b/arch/mips/boot/dts/qca/ar9331_tl_mr3020.dts
@@ -114,3 +114,7 @@ spiflash: s25sl032p@0 {
 		reg = <0>;
 	};
 };
+
+&wifi {
+	status = "okay";
+};
-- 
2.49.0


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

* Re: [PATCHv4 3/5] dt-bindings: net: wireless: ath9k: add WIFI bindings
  2025-05-25 21:42 ` [PATCHv4 3/5] dt-bindings: net: wireless: ath9k: add WIFI bindings Rosen Penev
@ 2025-05-26  4:26   ` Krzysztof Kozlowski
  2025-05-26  5:18     ` Rosen Penev
  2025-05-26  5:23   ` Krzysztof Kozlowski
  1 sibling, 1 reply; 16+ messages in thread
From: Krzysztof Kozlowski @ 2025-05-26  4:26 UTC (permalink / raw)
  To: Rosen Penev, linux-wireless
  Cc: Toke Høiland-Jørgensen, nbd, Johannes Berg, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Thomas Bogendoerfer,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	open list, open list:MIPS

On 25/05/2025 23:42, Rosen Penev wrote:
> These are for the wireless chips that come built in with various
> Atheros/QCA SoCs. dts wise, the difference between pcie and the wmac is
> 
> AHB > PCIE > WIFI
> AHB > WIFI
> 
> These will be used to replace the platform_device code with OF in the
> following patch.

Drop the sentence. If we use auxiliary driver instead, should it
invalidate this commit msg?

> 
> Signed-off-by: Rosen Penev <rosenp@gmail.com>
> ---
>  .../bindings/net/wireless/qca,ath9k.yaml       | 18 +++++++++++++++++-
>  1 file changed, 17 insertions(+), 1 deletion(-)
> 
> diff --git a/Documentation/devicetree/bindings/net/wireless/qca,ath9k.yaml b/Documentation/devicetree/bindings/net/wireless/qca,ath9k.yaml
> index 0e5412cff2bc..68d56e5b8680 100644
> --- a/Documentation/devicetree/bindings/net/wireless/qca,ath9k.yaml
> +++ b/Documentation/devicetree/bindings/net/wireless/qca,ath9k.yaml
> @@ -12,7 +12,7 @@ maintainers:
>  description: |
>    This node provides properties for configuring the ath9k wireless device.
>    The node is expected to be specified as a child node of the PCI controller
> -  to which the wireless chip is connected.
> +  or AHB bus to which the wireless chip is connected.
>  
>  allOf:
>    - $ref: ieee80211.yaml#
> @@ -35,6 +35,12 @@ properties:
>        - pci168c,0034  # AR9462
>        - pci168c,0036  # AR9565
>        - pci168c,0037  # AR1111 and AR9485
> +      - qcom,ar9130-wifi
> +      - qcom,ar9330-wifi
> +      - qcom,ar9340-wifi

I assume all these qr9xxx are capable of running Linux, thus you
document here other side - having them as part of other SoC.

> +      - qcom,qca9530-wifi
> +      - qcom,qca9550-wifi
> +      - qcom,qca9560-wifi

But what about these? As well? Do they have other interfaces? IOW,
suffix "-wifi" is added ONLY if there is "qcom,qca9530" or
"qcom,qca9530-foo" somewhere or possible.


Best regards,
Krzysztof

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

* Re: [PATCHv4 5/5] mips: dts: qca: add wmac support
  2025-05-25 21:42 ` [PATCHv4 5/5] mips: dts: qca: add wmac support Rosen Penev
@ 2025-05-26  4:26   ` Krzysztof Kozlowski
  0 siblings, 0 replies; 16+ messages in thread
From: Krzysztof Kozlowski @ 2025-05-26  4:26 UTC (permalink / raw)
  To: Rosen Penev, linux-wireless
  Cc: Toke Høiland-Jørgensen, nbd, Johannes Berg, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Thomas Bogendoerfer,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	open list, open list:MIPS

On 25/05/2025 23:42, Rosen Penev wrote:
> Now that OF ahb support was added to the ath9k driver, we can use it to
> enable and use the SoC wireless found in these chipsets.
> 
> Signed-off-by: Rosen Penev <rosenp@gmail.com>

Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

<form letter>
This is an automated instruction, just in case, because many review tags
are being ignored. If you know the process, you can skip it (please do
not feel offended by me posting it here - no bad intentions intended).
If you do not know the process, here is a short explanation:

Please add Acked-by/Reviewed-by/Tested-by tags when posting new versions
of patchset, under or above your Signed-off-by tag, unless patch changed
significantly (e.g. new properties added to the DT bindings). Tag is
"received", when provided in a message replied to you on the mailing
list. Tools like b4 can help here. However, there's no need to repost
patches *only* to add the tags. The upstream maintainer will do that for
tags received on the version they apply.

Full context and explanation:
https://elixir.bootlin.com/linux/v6.12-rc3/source/Documentation/process/submitting-patches.rst#L577
</form letter>

Best regards,
Krzysztof

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

* Re: [PATCHv4 1/5] wifi: ath9k: ahb: reorder declarations
  2025-05-25 21:42 ` [PATCHv4 1/5] wifi: ath9k: ahb: reorder declarations Rosen Penev
@ 2025-05-26  4:27   ` Krzysztof Kozlowski
  0 siblings, 0 replies; 16+ messages in thread
From: Krzysztof Kozlowski @ 2025-05-26  4:27 UTC (permalink / raw)
  To: Rosen Penev, linux-wireless
  Cc: Toke Høiland-Jørgensen, nbd, Johannes Berg, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Thomas Bogendoerfer,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	open list, open list:MIPS

On 25/05/2025 23:42, Rosen Penev wrote:
> Easier to look at. Follows netdev style.
> 
> Also remove ret assignment. Because of all of these devm conversions,
> ret = 0 is a path that never gets hit. The first time it does it when
> request_irq fails, but that ends up reassigning it.
> 
> Signed-off-by: Rosen Penev <rosenp@gmail.com>
> ---

Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

Best regards,
Krzysztof

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

* Re: [PATCHv4 2/5] wifi: ath9k: ahb: reorder includes
  2025-05-25 21:42 ` [PATCHv4 2/5] wifi: ath9k: ahb: reorder includes Rosen Penev
@ 2025-05-26  4:27   ` Krzysztof Kozlowski
  0 siblings, 0 replies; 16+ messages in thread
From: Krzysztof Kozlowski @ 2025-05-26  4:27 UTC (permalink / raw)
  To: Rosen Penev, linux-wireless
  Cc: Toke Høiland-Jørgensen, nbd, Johannes Berg, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Thomas Bogendoerfer,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	open list, open list:MIPS

On 25/05/2025 23:42, Rosen Penev wrote:
> Alphabetic includes are easier to look at and to make further changes to
> them.
> 
> Signed-off-by: Rosen Penev <rosenp@gmail.com>
> ---

Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

Best regards,
Krzysztof

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

* Re: [PATCHv4 4/5] wifi: ath9k: ahb: replace id_table with of
  2025-05-25 21:42 ` [PATCHv4 4/5] wifi: ath9k: ahb: replace id_table with of Rosen Penev
@ 2025-05-26  4:30   ` Krzysztof Kozlowski
  2025-05-26  4:59     ` Rosen Penev
  2025-05-26  5:23   ` Krzysztof Kozlowski
  1 sibling, 1 reply; 16+ messages in thread
From: Krzysztof Kozlowski @ 2025-05-26  4:30 UTC (permalink / raw)
  To: Rosen Penev, linux-wireless
  Cc: Toke Høiland-Jørgensen, nbd, Johannes Berg, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Thomas Bogendoerfer,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	open list, open list:MIPS

On 25/05/2025 23:42, Rosen Penev wrote:
> @@ -72,20 +55,15 @@ static const struct ath_bus_ops ath_ahb_bus_ops  = {
>  
>  static int ath_ahb_probe(struct platform_device *pdev)
>  {
> -	const struct platform_device_id *id = platform_get_device_id(pdev);
>  	struct ieee80211_hw *hw;
>  	struct ath_softc *sc;
>  	struct ath_hw *ah;
>  	void __iomem *mem;
>  	char hw_name[64];
> +	u16 dev_id;

I don't think these are u16 in the headers, but unsigned int.

>  	int irq;
>  	int ret;
>  
> -	if (!dev_get_platdata(&pdev->dev)) {
> -		dev_err(&pdev->dev, "no platform data specified\n");
> -		return -EINVAL;
> -	}
> -
>  	mem = devm_platform_ioremap_resource(pdev, 0);
>  	if (IS_ERR(mem)) {
>  		dev_err(&pdev->dev, "ioremap failed\n");
> @@ -118,7 +96,8 @@ static int ath_ahb_probe(struct platform_device *pdev)
>  		goto err_free_hw;
>  	}
>  
> -	ret = ath9k_init_device(id->driver_data, sc, &ath_ahb_bus_ops);
> +	dev_id = (u16)(kernel_ulong_t)of_device_get_match_data(&pdev->dev);

u16 cast looks not needed.


> +	ret = ath9k_init_device(dev_id, sc, &ath_ahb_bus_ops);
>  	if (ret) {
>  		dev_err(&pdev->dev, "failed to initialize device\n");
>  		goto err_irq;
Best regards,
Krzysztof

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

* Re: [PATCHv4 4/5] wifi: ath9k: ahb: replace id_table with of
  2025-05-26  4:30   ` Krzysztof Kozlowski
@ 2025-05-26  4:59     ` Rosen Penev
  2025-05-26  5:03       ` Krzysztof Kozlowski
  0 siblings, 1 reply; 16+ messages in thread
From: Rosen Penev @ 2025-05-26  4:59 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: linux-wireless, Toke Høiland-Jørgensen, nbd,
	Johannes Berg, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Thomas Bogendoerfer,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	open list, open list:MIPS

On Sun, May 25, 2025 at 9:30 PM Krzysztof Kozlowski <krzk@kernel.org> wrote:
>
> On 25/05/2025 23:42, Rosen Penev wrote:
> > @@ -72,20 +55,15 @@ static const struct ath_bus_ops ath_ahb_bus_ops  = {
> >
> >  static int ath_ahb_probe(struct platform_device *pdev)
> >  {
> > -     const struct platform_device_id *id = platform_get_device_id(pdev);
> >       struct ieee80211_hw *hw;
> >       struct ath_softc *sc;
> >       struct ath_hw *ah;
> >       void __iomem *mem;
> >       char hw_name[64];
> > +     u16 dev_id;
>
> I don't think these are u16 in the headers, but unsigned int.
Sure. I can change to int or kernel_ulong_t. It doesn't matter much.
The function that uses this has an int parameter, so might make sense
to use that.
>
> >       int irq;
> >       int ret;
> >
> > -     if (!dev_get_platdata(&pdev->dev)) {
> > -             dev_err(&pdev->dev, "no platform data specified\n");
> > -             return -EINVAL;
> > -     }
> > -
> >       mem = devm_platform_ioremap_resource(pdev, 0);
> >       if (IS_ERR(mem)) {
> >               dev_err(&pdev->dev, "ioremap failed\n");
> > @@ -118,7 +96,8 @@ static int ath_ahb_probe(struct platform_device *pdev)
> >               goto err_free_hw;
> >       }
> >
> > -     ret = ath9k_init_device(id->driver_data, sc, &ath_ahb_bus_ops);
> > +     dev_id = (u16)(kernel_ulong_t)of_device_get_match_data(&pdev->dev);
>
> u16 cast looks not needed.
Correct. It's placed for extra clarity, although probably not needed.
>
>
> > +     ret = ath9k_init_device(dev_id, sc, &ath_ahb_bus_ops);
> >       if (ret) {
> >               dev_err(&pdev->dev, "failed to initialize device\n");
> >               goto err_irq;
> Best regards,
> Krzysztof

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

* Re: [PATCHv4 4/5] wifi: ath9k: ahb: replace id_table with of
  2025-05-26  4:59     ` Rosen Penev
@ 2025-05-26  5:03       ` Krzysztof Kozlowski
  0 siblings, 0 replies; 16+ messages in thread
From: Krzysztof Kozlowski @ 2025-05-26  5:03 UTC (permalink / raw)
  To: Rosen Penev
  Cc: linux-wireless, Toke Høiland-Jørgensen, nbd,
	Johannes Berg, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Thomas Bogendoerfer,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	open list, open list:MIPS

On 26/05/2025 06:59, Rosen Penev wrote:
> On Sun, May 25, 2025 at 9:30 PM Krzysztof Kozlowski <krzk@kernel.org> wrote:
>>
>> On 25/05/2025 23:42, Rosen Penev wrote:
>>> @@ -72,20 +55,15 @@ static const struct ath_bus_ops ath_ahb_bus_ops  = {
>>>
>>>  static int ath_ahb_probe(struct platform_device *pdev)
>>>  {
>>> -     const struct platform_device_id *id = platform_get_device_id(pdev);
>>>       struct ieee80211_hw *hw;
>>>       struct ath_softc *sc;
>>>       struct ath_hw *ah;
>>>       void __iomem *mem;
>>>       char hw_name[64];
>>> +     u16 dev_id;
>>
>> I don't think these are u16 in the headers, but unsigned int.
> Sure. I can change to int or kernel_ulong_t. It doesn't matter much.
> The function that uses this has an int parameter, so might make sense
> to use that.

Ah, ok, that's fine then. Ignore both comments.

Best regards,
Krzysztof

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

* Re: [PATCHv4 3/5] dt-bindings: net: wireless: ath9k: add WIFI bindings
  2025-05-26  4:26   ` Krzysztof Kozlowski
@ 2025-05-26  5:18     ` Rosen Penev
  0 siblings, 0 replies; 16+ messages in thread
From: Rosen Penev @ 2025-05-26  5:18 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: linux-wireless, Toke Høiland-Jørgensen, nbd,
	Johannes Berg, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Thomas Bogendoerfer,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	open list, open list:MIPS

On Sun, May 25, 2025 at 9:26 PM Krzysztof Kozlowski <krzk@kernel.org> wrote:
>
> On 25/05/2025 23:42, Rosen Penev wrote:
> > These are for the wireless chips that come built in with various
> > Atheros/QCA SoCs. dts wise, the difference between pcie and the wmac is
> >
> > AHB > PCIE > WIFI
> > AHB > WIFI
> >
> > These will be used to replace the platform_device code with OF in the
> > following patch.
>
> Drop the sentence. If we use auxiliary driver instead, should it
> invalidate this commit msg?
Will drop.
>
> >
> > Signed-off-by: Rosen Penev <rosenp@gmail.com>
> > ---
> >  .../bindings/net/wireless/qca,ath9k.yaml       | 18 +++++++++++++++++-
> >  1 file changed, 17 insertions(+), 1 deletion(-)
> >
> > diff --git a/Documentation/devicetree/bindings/net/wireless/qca,ath9k.yaml b/Documentation/devicetree/bindings/net/wireless/qca,ath9k.yaml
> > index 0e5412cff2bc..68d56e5b8680 100644
> > --- a/Documentation/devicetree/bindings/net/wireless/qca,ath9k.yaml
> > +++ b/Documentation/devicetree/bindings/net/wireless/qca,ath9k.yaml
> > @@ -12,7 +12,7 @@ maintainers:
> >  description: |
> >    This node provides properties for configuring the ath9k wireless device.
> >    The node is expected to be specified as a child node of the PCI controller
> > -  to which the wireless chip is connected.
> > +  or AHB bus to which the wireless chip is connected.
> >
> >  allOf:
> >    - $ref: ieee80211.yaml#
> > @@ -35,6 +35,12 @@ properties:
> >        - pci168c,0034  # AR9462
> >        - pci168c,0036  # AR9565
> >        - pci168c,0037  # AR1111 and AR9485
> > +      - qcom,ar9130-wifi
> > +      - qcom,ar9330-wifi
> > +      - qcom,ar9340-wifi
>
> I assume all these qr9xxx are capable of running Linux, thus you
> document here other side - having them as part of other SoC.
I assume you're referring to
Documentation/devicetree/bindings/mips/ath79-soc.txt
>
> > +      - qcom,qca9530-wifi
> > +      - qcom,qca9550-wifi
> > +      - qcom,qca9560-wifi
>
> But what about these? As well? Do they have other interfaces? IOW,
> suffix "-wifi" is added ONLY if there is "qcom,qca9530" or
> "qcom,qca9530-foo" somewhere or possible.
They do. An example being the ar71xx driver which has

              - qca,ar9130-eth   # Atheros AR9130
              - qca,ar9330-eth   # Atheros AR9330
              - qca,ar9340-eth   # Atheros AR9340
              - qca,qca9530-eth  # Qualcomm Atheros QCA9530
              - qca,qca9550-eth  # Qualcomm Atheros QCA9550
              - qca,qca9560-eth  # Qualcomm Atheros QCA9560

I was advised earlier to change it to qcom instead of qca. Qualcomm
itself uses the qcom, prefix for its maintained drivers while the non
Qualcomm maintained stuff uses qca.
>
>
> Best regards,
> Krzysztof

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

* Re: [PATCHv4 3/5] dt-bindings: net: wireless: ath9k: add WIFI bindings
  2025-05-25 21:42 ` [PATCHv4 3/5] dt-bindings: net: wireless: ath9k: add WIFI bindings Rosen Penev
  2025-05-26  4:26   ` Krzysztof Kozlowski
@ 2025-05-26  5:23   ` Krzysztof Kozlowski
  1 sibling, 0 replies; 16+ messages in thread
From: Krzysztof Kozlowski @ 2025-05-26  5:23 UTC (permalink / raw)
  To: Rosen Penev, linux-wireless
  Cc: Toke Høiland-Jørgensen, nbd, Johannes Berg, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Thomas Bogendoerfer,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	open list, open list:MIPS

On 25/05/2025 23:42, Rosen Penev wrote:
> These are for the wireless chips that come built in with various
> Atheros/QCA SoCs. dts wise, the difference between pcie and the wmac is
> 
> AHB > PCIE > WIFI
> AHB > WIFI
> 
> These will be used to replace the platform_device code with OF in the
> following patch.
> 

Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

Best regards,
Krzysztof

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

* Re: [PATCHv4 4/5] wifi: ath9k: ahb: replace id_table with of
  2025-05-25 21:42 ` [PATCHv4 4/5] wifi: ath9k: ahb: replace id_table with of Rosen Penev
  2025-05-26  4:30   ` Krzysztof Kozlowski
@ 2025-05-26  5:23   ` Krzysztof Kozlowski
  1 sibling, 0 replies; 16+ messages in thread
From: Krzysztof Kozlowski @ 2025-05-26  5:23 UTC (permalink / raw)
  To: Rosen Penev, linux-wireless
  Cc: Toke Høiland-Jørgensen, nbd, Johannes Berg, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Thomas Bogendoerfer,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	open list, open list:MIPS

On 25/05/2025 23:42, Rosen Penev wrote:
> Since 2b0996c7646 , all of this platform code became no-op with no OF
> replacement. Not only that, there are no users of AHB here. Add an OF
> match table that mostly mirrors the original platform device id table.
> Use a qca prefix as is done for the only other property: qca,no-eeprom.
> Also used qca prefix for ar9530 as the latter seems to be a mistake.
> 
> This will be used to add ath9k support for the various ath79 devices
> here.
> 
> Signed-off-by: Rosen Penev <rosenp@gmail.com>
> ---

Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

Best regards,
Krzysztof

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

end of thread, other threads:[~2025-05-26  5:24 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-25 21:42 [PATCHv4 0/5] wifi: ath9k: add ahb OF support Rosen Penev
2025-05-25 21:42 ` [PATCHv4 1/5] wifi: ath9k: ahb: reorder declarations Rosen Penev
2025-05-26  4:27   ` Krzysztof Kozlowski
2025-05-25 21:42 ` [PATCHv4 2/5] wifi: ath9k: ahb: reorder includes Rosen Penev
2025-05-26  4:27   ` Krzysztof Kozlowski
2025-05-25 21:42 ` [PATCHv4 3/5] dt-bindings: net: wireless: ath9k: add WIFI bindings Rosen Penev
2025-05-26  4:26   ` Krzysztof Kozlowski
2025-05-26  5:18     ` Rosen Penev
2025-05-26  5:23   ` Krzysztof Kozlowski
2025-05-25 21:42 ` [PATCHv4 4/5] wifi: ath9k: ahb: replace id_table with of Rosen Penev
2025-05-26  4:30   ` Krzysztof Kozlowski
2025-05-26  4:59     ` Rosen Penev
2025-05-26  5:03       ` Krzysztof Kozlowski
2025-05-26  5:23   ` Krzysztof Kozlowski
2025-05-25 21:42 ` [PATCHv4 5/5] mips: dts: qca: add wmac support Rosen Penev
2025-05-26  4:26   ` Krzysztof Kozlowski

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