diff mbox series

[v3,3/5] arm64: dts: rockchip: Add AP6275P wireless support to Khadas Edge 2

Message ID 20240630073605.2164346-4-jacobe.zang@wesion.com
State Superseded
Headers show
Series Add AP6275P wireless support | expand

Commit Message

Jacobe Zang June 30, 2024, 7:36 a.m. UTC
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. As a PCIe device the wifi@0 can be probed
without compatible.

Co-developed-by: Muhammed Efe Cetin <efectn@protonmail.com>
Signed-off-by: Muhammed Efe Cetin <efectn@protonmail.com>
Signed-off-by: Jacobe Zang <jacobe.zang@wesion.com>
---
 .../boot/dts/rockchip/rk3588s-khadas-edge2.dts    | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

Comments

Krzysztof Kozlowski July 1, 2024, 8:46 a.m. UTC | #1
On 30/06/2024 09:36, Jacobe Zang wrote:
> 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. As a PCIe device the wifi@0 can be probed
> without compatible.
> 
> Co-developed-by: Muhammed Efe Cetin <efectn@protonmail.com>
> Signed-off-by: Muhammed Efe Cetin <efectn@protonmail.com>
> Signed-off-by: Jacobe Zang <jacobe.zang@wesion.com>
> ---
>  .../boot/dts/rockchip/rk3588s-khadas-edge2.dts    | 15 +++++++++++++++
>  1 file changed, 15 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..8c152d587aefc 100644
> --- a/arch/arm64/boot/dts/rockchip/rk3588s-khadas-edge2.dts
> +++ b/arch/arm64/boot/dts/rockchip/rk3588s-khadas-edge2.dts
> @@ -283,6 +283,21 @@ &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 {

Where is the compatible (again!)? Test your code - you will see your
binding is a no-op.


Best regards,
Krzysztof
Jacobe Zang July 1, 2024, 10:38 a.m. UTC | #2
>> +     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 {
> Where is the compatible (again!)? Test your code - you will see your
> binding is a no-op.

I tried to build kernel with CHECK_DTBS=1. And didn't get any message
like 'compatible' is a required property in wifi node. But when I check
the bindings that do required the compatible... So I will add it next time.

---
Best Regards
Jacobe
Krzysztof Kozlowski July 1, 2024, 11:16 a.m. UTC | #3
On 01/07/2024 12:38, Jacobe Zang wrote:
>>> +     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 {
>> Where is the compatible (again!)? Test your code - you will see your
>> binding is a no-op.
> 
> I tried to build kernel with CHECK_DTBS=1. And didn't get any message
> like 'compatible' is a required property in wifi node. But when I check
> the bindings that do required the compatible... So I will add it next time.

Yep, use different clock name and then test. You should see errors,
right? But there are not, because schema is not applied to this node at all.

Look how Apple is doing this.

I have doubts that your code works at all in the first place. If there
is no compatible, how your platform device gets of_node?

Best regards,
Krzysztof
Jacobe Zang July 1, 2024, 11:31 a.m. UTC | #4
>>> +     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 {
>> Where is the compatible (again!)? Test your code - you will see your
>> binding is a no-op.
>
> I tried to build kernel with CHECK_DTBS=1. And didn't get any message
> like 'compatible' is a required property in wifi node. But when I check
> the bindings that do required the compatible... So I will add it next time.

> Yep, use different clock name and then test. You should see errors,
> right? But there are not, because schema is not applied to this node at all.
> 
> Look how Apple is doing this.
> 
> I have doubts that your code works at all in the first place. If there
> is no compatible, how your platform device gets of_node?

In file brcm_hw_ids.h and pcie.c has added Device ID and Vendor ID
for bus to enumerate the device when board bootup, so I didn't add
specific compatible in DTS. And by doing so, it can probe successfully.

---
Best Regards
Jacobe
Krzysztof Kozlowski July 1, 2024, 1:04 p.m. UTC | #5
On 01/07/2024 13:31, Jacobe Zang wrote:
>>>> +     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 {
>>> Where is the compatible (again!)? Test your code - you will see your
>>> binding is a no-op.
>>
>> I tried to build kernel with CHECK_DTBS=1. And didn't get any message
>> like 'compatible' is a required property in wifi node. But when I check
>> the bindings that do required the compatible... So I will add it next time.
> 
>> Yep, use different clock name and then test. You should see errors,
>> right? But there are not, because schema is not applied to this node at all.
>>
>> Look how Apple is doing this.
>>
>> I have doubts that your code works at all in the first place. If there
>> is no compatible, how your platform device gets of_node?
> 
> In file brcm_hw_ids.h and pcie.c has added Device ID and Vendor ID
> for bus to enumerate the device when board bootup, so I didn't add
> specific compatible in DTS. And by doing so, it can probe successfully.

I did not ask about probe()... that's quite obvious. How the device's
of_node is assigned?

Best regards,
Krzysztof
diff mbox series

Patch

diff --git a/arch/arm64/boot/dts/rockchip/rk3588s-khadas-edge2.dts b/arch/arm64/boot/dts/rockchip/rk3588s-khadas-edge2.dts
index dbddfc3bb4641..8c152d587aefc 100644
--- a/arch/arm64/boot/dts/rockchip/rk3588s-khadas-edge2.dts
+++ b/arch/arm64/boot/dts/rockchip/rk3588s-khadas-edge2.dts
@@ -283,6 +283,21 @@  &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 {
+			reg = <0x410000 0 0 0 0>;
+			clocks = <&hym8563>;
+			clock-names = "lpo";
+		};
+	};
 };
 
 &pwm11 {