[PATCH v12 0/2] Add Wi-Fi support for Khadas Edge2 and fallback compatible for Apple

STALE711d

6 messages, 2 authors, 2024-08-28 · open the first message on its own page

[PATCH v12 0/2] Add Wi-Fi support for Khadas Edge2 and fallback compatible for Apple

From: Jacobe Zang <hidden>
Date: 2024-08-28 03:41:00

Add basic Wi-Fi support on Khadas Edge2. Wireless driver need to check "brcm,bcm4329-fmac"
compatible so add it to Apple's devices.

Changes in v12:
 - Add fallback compatible for Apple's devices

 - Link to v11: https://lore.kernel.org/all/20240816015214.1271162-1-jacobe.zang@wesion.com/

Changes in v11:
 - Split DTS and submit separately

 - Link to v10: https://lore.kernel.org/all/20240813082007.2625841-1-jacobe.zang@wesion.com/

Changes in v10:
 - Use ret instead unused probe_attach_result in sdio.c 

 - Link to v9: https://lore.kernel.org/all/20240810035141.439024-1-jacobe.zang@wesion.com/

Changes in v9:
 - Add return -ENODEV error pointer from brcmf_sdio_probe as the default for the fail path
 - Add if statement for brcmf_of_probe in common.c
 - Retain modifications to of.c other than the return values

 - Link to v8: https://lore.kernel.org/all/20240805073425.3492078-1-jacobe.zang@wesion.com/

Changes in v8:
 - Add appropriate errno's for return values that will be
    send to bus when error occurred.
 
 - Link to v7: https://lore.kernel.org/all/20240802025715.2360456-1-jacobe.zang@wesion.com/

Changes in v7:
 - Change brcmf_of_probe prototypes from void to int, add appropriate errno's for return
    value, move clock check to the end of brcmf_of_probe
 - Add "brcm,bcm4329-fmac" compatible for wifi node

 - Link to v6: https://lore.kernel.org/all/20240731061132.703368-1-jacobe.zang@wesion.com/

Changes in v6:
 - Move "brcm,bcm4329-fmac" check to the top of brcmf_of_probe in of.c
 - Add return if clk didn't set in DTS

 -Link to v5: https://lore.kernel.org/all/20240730033053.4092132-1-jacobe.zang@wesion.com/

Changes in v5:
 - Add more commit message to the clock in bindings
 - Use IS_ERR_OR_NULL as a judgment condition of clk

 - Link to v4: https://lore.kernel.org/all/20240729070102.3770318-1-jacobe.zang@wesion.com/

Changes in v4:
 - Change clock description in dt-bindings
 - Move enable clk from pcie.c to of.c
 - Add compatible for wifi node in DTS
 - Add random seed flag for firmware download

 - Link to v3: https://lore.kernel.org/all/20240630073605.2164346-1-jacobe.zang@wesion.com/

Changes in v3:
 - Dropped redundant parts in dt-bindings.
 - Change driver patch title prefix as 'wifi: brcmfmac:'.
 - Change DTS Wi-Fi node clock-name as 'lpo'.
 
 - Link to v2: https://lore.kernel.org/all/20240624081906.1399447-1-jacobe.zang@wesion.com/

Changes in v2:
 - Add SoB tags for original developer.
 - Add dt-bindings for pci14e4,449d and clocks.
 - Replace dev_info to brcmf_dbg in pcie.c

 - Link to v1: https://lore.kernel.org/all/20240620020015.4021696-1-jacobe.zang@wesion.com/

Jacobe Zang (2):
  arm64: dts: rockchip: Add AP6275P wireless support to Khadas Edge 2
  arm64: dts: apple: add "brcm,bcm4329-fmac" fallback compatible

 arch/arm64/boot/dts/apple/t8103-jxxx.dtsi        |  2 +-
 arch/arm64/boot/dts/apple/t8112-j413.dts         |  2 +-
 arch/arm64/boot/dts/apple/t8112-j493.dts         |  2 +-
 .../boot/dts/rockchip/rk3588s-khadas-edge2.dts   | 16 ++++++++++++++++
 4 files changed, 19 insertions(+), 3 deletions(-)

-- 
2.34.1

[PATCH v12 1/2] arm64: dts: rockchip: Add AP6275P wireless support to Khadas Edge 2

From: Jacobe Zang <hidden>
Date: 2024-08-28 03:41:03

Khadas Edge2 uses the PCI-e Ampak AP6275P 2T2R Wi-Fi 6 module. The
pcie@0 node can be used as Bridge1, so the wifi@0 node is used as a
device under the Bridge1.

Co-developed-by: Muhammed Efe Cetin <redacted>
Signed-off-by: Muhammed Efe Cetin <redacted>
Reviewed-by: Arend van Spriel <arend.vanspriel@broadcom.com>
Signed-off-by: Jacobe Zang <redacted>
---
 .../boot/dts/rockchip/rk3588s-khadas-edge2.dts   | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
diff --git a/arch/arm64/boot/dts/rockchip/rk3588s-khadas-edge2.dts b/arch/arm64/boot/dts/rockchip/rk3588s-khadas-edge2.dts
index dbddfc3bb4641..3d0f55c123d92 100644
--- a/arch/arm64/boot/dts/rockchip/rk3588s-khadas-edge2.dts
+++ b/arch/arm64/boot/dts/rockchip/rk3588s-khadas-edge2.dts
@@ -283,6 +283,22 @@ &pcie2x1l2 {
 	reset-gpios = <&gpio3 RK_PD1 GPIO_ACTIVE_HIGH>;
 	vpcie3v3-supply = <&vcc3v3_pcie_wl>;
 	status = "okay";
+
+	pcie@0,0 {
+		reg = <0x400000 0 0 0 0>;
+		#address-cells = <3>;
+		#size-cells = <2>;
+		ranges;
+		device_type = "pci";
+		bus-range = <0x40 0x4f>;
+
+		wifi: wifi@0,0 {
+			compatible = "pci14e4,449d", "brcm,bcm4329-fmac";
+			reg = <0x410000 0 0 0 0>;
+			clocks = <&hym8563>;
+			clock-names = "lpo";
+		};
+	};
 };
 
 &pwm11 {
-- 
2.34.1

[PATCH v12 2/2] arm64: dts: apple: add "brcm,bcm4329-fmac" fallback compatible

From: Jacobe Zang <hidden>
Date: 2024-08-28 03:41:05

Broadcom driver need to check "brcm,bcm4329-fmac" compatible. Before
PCIe devices used PCI ID as base compabile so add it as fallback
compatible to pass the check.

Signed-off-by: Jacobe Zang <redacted>
---
 arch/arm64/boot/dts/apple/t8103-jxxx.dtsi | 2 +-
 arch/arm64/boot/dts/apple/t8112-j413.dts  | 2 +-
 arch/arm64/boot/dts/apple/t8112-j493.dts  | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/arch/arm64/boot/dts/apple/t8103-jxxx.dtsi b/arch/arm64/boot/dts/apple/t8103-jxxx.dtsi
index 5988a4eb6efaa..4b021626d4692 100644
--- a/arch/arm64/boot/dts/apple/t8103-jxxx.dtsi
+++ b/arch/arm64/boot/dts/apple/t8103-jxxx.dtsi
@@ -72,7 +72,7 @@ hpm1: usb-pd@3f {
 &port00 {
 	bus-range = <1 1>;
 	wifi0: network@0,0 {
-		compatible = "pci14e4,4425";
+		compatible = "pci14e4,4425", "brcm,bcm4329-fmac";
 		reg = <0x10000 0x0 0x0 0x0 0x0>;
 		/* To be filled by the loader */
 		local-mac-address = [00 00 00 00 00 00];
diff --git a/arch/arm64/boot/dts/apple/t8112-j413.dts b/arch/arm64/boot/dts/apple/t8112-j413.dts
index 6f69658623bf8..df2a63d8dd5e9 100644
--- a/arch/arm64/boot/dts/apple/t8112-j413.dts
+++ b/arch/arm64/boot/dts/apple/t8112-j413.dts
@@ -43,7 +43,7 @@ led-0 {
 &port00 {
 	bus-range = <1 1>;
 	wifi0: wifi@0,0 {
-		compatible = "pci14e4,4433";
+		compatible = "pci14e4,4433", "brcm,bcm4329-fmac";
 		reg = <0x10000 0x0 0x0 0x0 0x0>;
 		/* To be filled by the loader */
 		local-mac-address = [00 10 18 00 00 10];
diff --git a/arch/arm64/boot/dts/apple/t8112-j493.dts b/arch/arm64/boot/dts/apple/t8112-j493.dts
index 0ad908349f554..5f3453e109b85 100644
--- a/arch/arm64/boot/dts/apple/t8112-j493.dts
+++ b/arch/arm64/boot/dts/apple/t8112-j493.dts
@@ -43,7 +43,7 @@ led-0 {
 &port00 {
 	bus-range = <1 1>;
 	wifi0: wifi@0,0 {
-		compatible = "pci14e4,4425";
+		compatible = "pci14e4,4425", "brcm,bcm4329-fmac";
 		reg = <0x10000 0x0 0x0 0x0 0x0>;
 		/* To be filled by the loader */
 		local-mac-address = [00 00 00 00 00 00];
-- 
2.34.1

Re: [PATCH v12 2/2] arm64: dts: apple: add "brcm,bcm4329-fmac" fallback compatible

From: Krzysztof Kozlowski <krzk@kernel.org>
Date: 2024-08-28 05:57:04

On 28/08/2024 05:39, Jacobe Zang wrote:
Broadcom driver need to check "brcm,bcm4329-fmac" compatible. Before
What for?
quoted hunk
PCIe devices used PCI ID as base compabile so add it as fallback
compatible to pass the check.

Signed-off-by: Jacobe Zang <redacted>
---
 arch/arm64/boot/dts/apple/t8103-jxxx.dtsi | 2 +-
 arch/arm64/boot/dts/apple/t8112-j413.dts  | 2 +-
 arch/arm64/boot/dts/apple/t8112-j493.dts  | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/arch/arm64/boot/dts/apple/t8103-jxxx.dtsi b/arch/arm64/boot/dts/apple/t8103-jxxx.dtsi
index 5988a4eb6efaa..4b021626d4692 100644
--- a/arch/arm64/boot/dts/apple/t8103-jxxx.dtsi
+++ b/arch/arm64/boot/dts/apple/t8103-jxxx.dtsi
@@ -72,7 +72,7 @@ hpm1: usb-pd@3f {
 &port00 {
 	bus-range = <1 1>;
 	wifi0: network@0,0 {
-		compatible = "pci14e4,4425";
+		compatible = "pci14e4,4425", "brcm,bcm4329-fmac";
So devices are not compatible, but your argument is that driver needs to
do something here? That's not enough.

Best regards,
Krzysztof

Re: [PATCH v12 2/2] arm64: dts: apple: add "brcm,bcm4329-fmac" fallback compatible

From: Jacobe Zang <hidden>
Date: 2024-08-28 06:13:16


On 2024/8/28 13:56, Krzysztof Kozlowski wrote:
On 28/08/2024 05:39, Jacobe Zang wrote:
quoted
Broadcom driver need to check "brcm,bcm4329-fmac" compatible. Before
What for?
It matches the changes in the other series that I sent.
quoted
PCIe devices used PCI ID as base compabile so add it as fallback
compatible to pass the check.

Signed-off-by: Jacobe Zang <redacted>
---
  arch/arm64/boot/dts/apple/t8103-jxxx.dtsi | 2 +-
  arch/arm64/boot/dts/apple/t8112-j413.dts  | 2 +-
  arch/arm64/boot/dts/apple/t8112-j493.dts  | 2 +-
  3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/arch/arm64/boot/dts/apple/t8103-jxxx.dtsi b/arch/arm64/boot/dts/apple/t8103-jxxx.dtsi
index 5988a4eb6efaa..4b021626d4692 100644
--- a/arch/arm64/boot/dts/apple/t8103-jxxx.dtsi
+++ b/arch/arm64/boot/dts/apple/t8103-jxxx.dtsi
@@ -72,7 +72,7 @@ hpm1: usb-pd@3f {
  &port00 {
  	bus-range = <1 1>;
  	wifi0: network@0,0 {
-		compatible = "pci14e4,4425";
+		compatible = "pci14e4,4425", "brcm,bcm4329-fmac";
So devices are not compatible, but your argument is that driver needs to
do something here? That's not enough.
Before this change, the check of "brcm,bcm4329-fmac" compatible is set 
at the end of probe function for SDIO devices which need IRQ. But after 
this change I set it to the top as the first check. So I add this 
fallback compatible to the Apple's DTS.

Oh..I got what you mean. Maybe my commit message is not clearly. It is 
no need to mention driver in it. Because the intent of adding the 
"brcm,bcm4329-fmac" compatible is to conform to the bindings.

-- 
Best Regards
Jacobe

Re: [PATCH v12 2/2] arm64: dts: apple: add "brcm,bcm4329-fmac" fallback compatible

From: Krzysztof Kozlowski <krzk@kernel.org>
Date: 2024-08-28 09:08:42

On 28/08/2024 08:13, Jacobe Zang wrote:

On 2024/8/28 13:56, Krzysztof Kozlowski wrote:
quoted
On 28/08/2024 05:39, Jacobe Zang wrote:
quoted
Broadcom driver need to check "brcm,bcm4329-fmac" compatible. Before
What for?
It matches the changes in the other series that I sent.
Commit msg did not explain this at all. Anyway, then bindings should
provide proper rationale without referring to "driver" as the reason.
quoted
quoted
PCIe devices used PCI ID as base compabile so add it as fallback
compatible to pass the check.

Signed-off-by: Jacobe Zang <redacted>
---
  arch/arm64/boot/dts/apple/t8103-jxxx.dtsi | 2 +-
  arch/arm64/boot/dts/apple/t8112-j413.dts  | 2 +-
  arch/arm64/boot/dts/apple/t8112-j493.dts  | 2 +-
  3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/arch/arm64/boot/dts/apple/t8103-jxxx.dtsi b/arch/arm64/boot/dts/apple/t8103-jxxx.dtsi
index 5988a4eb6efaa..4b021626d4692 100644
--- a/arch/arm64/boot/dts/apple/t8103-jxxx.dtsi
+++ b/arch/arm64/boot/dts/apple/t8103-jxxx.dtsi
@@ -72,7 +72,7 @@ hpm1: usb-pd@3f {
  &port00 {
  	bus-range = <1 1>;
  	wifi0: network@0,0 {
-		compatible = "pci14e4,4425";
+		compatible = "pci14e4,4425", "brcm,bcm4329-fmac";
So devices are not compatible, but your argument is that driver needs to
do something here? That's not enough.
Before this change, the check of "brcm,bcm4329-fmac" compatible is set 
at the end of probe function for SDIO devices which need IRQ. But after 
this change I set it to the top as the first check. So I add this 
fallback compatible to the Apple's DTS.
You are not listening, I think, and still keep talking about driver. It
has nothing to do. Fix your driver.
Oh..I got what you mean. Maybe my commit message is not clearly. It is 
no need to mention driver in it. Because the intent of adding the 
"brcm,bcm4329-fmac" compatible is to conform to the bindings.
Explain the hardware, not the driver. DTS represents hardware, not drivers.

Best regards,
Krzysztof

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help