[1/3] dt-bindings: ath10k: Add wifi-firmware subnode for wifi node
diff mbox series

Message ID 1585054044-18667-2-git-send-email-pillair@codeaurora.org
State New
Headers show
Series
  • Add support to handle targets without TrustZone
Related show

Commit Message

Rakesh Pillai March 24, 2020, 12:47 p.m. UTC
Add a wifi-firmware subnode for the wifi node.
This wifi-firmware subnode is needed for the
targets which do not support TrustZone.

Signed-off-by: Rakesh Pillai <pillair@codeaurora.org>
---
 .../devicetree/bindings/net/wireless/qcom,ath10k.txt       | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

Comments

Kalle Valo March 24, 2020, 2:14 p.m. UTC | #1
Rakesh Pillai <pillair@codeaurora.org> wrote:

> Add a wifi-firmware subnode for the wifi node.
> This wifi-firmware subnode is needed for the
> targets which do not support TrustZone.
> 
> Signed-off-by: Rakesh Pillai <pillair@codeaurora.org>

Fails to build and has warnings. How did you test this?

drivers/net/wireless/ath/ath10k/qmi.c: In function 'ath10k_qmi_msa_mem_info_send_sync_msg':
drivers/net/wireless/ath/ath10k/qmi.c:160:23: error: 'struct ath10k_qmi' has no member named 'msa_pa'
  max_mapped_addr = qmi->msa_pa + qmi->msa_mem_size;
                       ^~
drivers/net/wireless/ath/ath10k/qmi.c:160:37: error: 'struct ath10k_qmi' has no member named 'msa_mem_size'
  max_mapped_addr = qmi->msa_pa + qmi->msa_mem_size;
                                     ^~
drivers/net/wireless/ath/ath10k/qmi.c:163:41: error: 'struct ath10k_qmi' has no member named 'msa_mem_size'
   if (resp.mem_region_info[i].size > qmi->msa_mem_size ||
                                         ^~
drivers/net/wireless/ath/ath10k/qmi.c:165:48: error: 'struct ath10k_qmi' has no member named 'msa_pa'
       resp.mem_region_info[i].region_addr < qmi->msa_pa ||
                                                ^~
make[5]: *** [drivers/net/wireless/ath/ath10k/qmi.o] Error 1
make[5]: *** Waiting for unfinished jobs....
In file included from ./include/linux/byteorder/little_endian.h:5,
                 from ./arch/x86/include/uapi/asm/byteorder.h:5,
                 from ./include/asm-generic/bitops/le.h:6,
                 from ./arch/x86/include/asm/bitops.h:395,
                 from ./include/linux/bitops.h:29,
                 from ./include/linux/kernel.h:12,
                 from ./include/linux/clk.h:13,
                 from drivers/net/wireless/ath/ath10k/snoc.c:6:
drivers/net/wireless/ath/ath10k/snoc.c: In function 'ath10k_msa_dump_memory':
drivers/net/wireless/ath/ath10k/snoc.c:1424:54: error: 'struct ath10k_qmi' has no member named 'msa_va'
  hdr->start = cpu_to_le32((unsigned long)ar_snoc->qmi->msa_va);
                                                      ^~
./include/uapi/linux/byteorder/little_endian.h:33:51: note: in definition of macro '__cpu_to_le32'
 #define __cpu_to_le32(x) ((__force __le32)(__u32)(x))
                                                   ^
drivers/net/wireless/ath/ath10k/snoc.c:1424:15: note: in expansion of macro 'cpu_to_le32'
  hdr->start = cpu_to_le32((unsigned long)ar_snoc->qmi->msa_va);
               ^~~~~~~~~~~
drivers/net/wireless/ath/ath10k/snoc.c:1425:40: error: 'struct ath10k_qmi' has no member named 'msa_mem_size'
  hdr->length = cpu_to_le32(ar_snoc->qmi->msa_mem_size);
                                        ^~
./include/uapi/linux/byteorder/little_endian.h:33:51: note: in definition of macro '__cpu_to_le32'
 #define __cpu_to_le32(x) ((__force __le32)(__u32)(x))
                                                   ^
drivers/net/wireless/ath/ath10k/snoc.c:1425:16: note: in expansion of macro 'cpu_to_le32'
  hdr->length = cpu_to_le32(ar_snoc->qmi->msa_mem_size);
                ^~~~~~~~~~~
drivers/net/wireless/ath/ath10k/snoc.c:1427:40: error: 'struct ath10k_qmi' has no member named 'msa_mem_size'
  if (current_region->len < ar_snoc->qmi->msa_mem_size) {
                                        ^~
drivers/net/wireless/ath/ath10k/snoc.c:1428:27: error: 'struct ath10k_qmi' has no member named 'msa_va'
   memcpy(buf, ar_snoc->qmi->msa_va, current_region->len);
                           ^~
drivers/net/wireless/ath/ath10k/snoc.c:1430:41: error: 'struct ath10k_qmi' has no member named 'msa_mem_size'
        current_region->len, ar_snoc->qmi->msa_mem_size);
                                         ^~
drivers/net/wireless/ath/ath10k/snoc.c:1432:27: error: 'struct ath10k_qmi' has no member named 'msa_va'
   memcpy(buf, ar_snoc->qmi->msa_va, ar_snoc->qmi->msa_mem_size);
                           ^~
drivers/net/wireless/ath/ath10k/snoc.c:1432:49: error: 'struct ath10k_qmi' has no member named 'msa_mem_size'
   memcpy(buf, ar_snoc->qmi->msa_va, ar_snoc->qmi->msa_mem_size);
                                                 ^~
drivers/net/wireless/ath/ath10k/snoc.c: In function 'ath10k_fw_deinit':
drivers/net/wireless/ath/ath10k/snoc.c:1593:14: error: assignment of read-only variable 'mapped_size'
  mapped_size = ar_snoc->fw.mapped_mem_size;
              ^
drivers/net/wireless/ath/ath10k/snoc.c:1599:46: warning: format '%d' expects argument of type 'int', but argument 3 has type 'size_t' {aka 'long unsigned int'} [-Wformat=]
   ath10k_err(ar, "failed to unmap firmware: %d\n",
                                             ~^
                                             %ld
       unmapped_size);
       ~~~~~~~~~~~~~                           
make[5]: *** [drivers/net/wireless/ath/ath10k/snoc.o] Error 1
make[4]: *** [drivers/net/wireless/ath/ath10k] Error 2
make[3]: *** [drivers/net/wireless/ath] Error 2
make[2]: *** [drivers/net/wireless] Error 2
make[1]: *** [drivers/net] Error 2
make: *** [drivers] Error 2

3 patches set to Changes Requested.

11455345 [1/3] dt-bindings: ath10k: Add wifi-firmware subnode for wifi node
11455351 [2/3] ath10k: Setup the msa resources before qmi init
11455353 [3/3] ath10k: Add support for targets without trustzone
Rakesh Pillai March 25, 2020, 11 a.m. UTC | #2
Hi Kalle,

I had tested it on a slightly older ath10k tree, and missed a few cleanup while rebasing it on the ath10k tree tip.
I have now fixed these build errors and will send out v2 for this patchset.

Thanks,
Rakesh Pillai.

> -----Original Message-----
> From: Kalle Valo <kvalo@codeaurora.org>
> Sent: Tuesday, March 24, 2020 7:44 PM
> To: Rakesh Pillai <pillair@codeaurora.org>
> Cc: ath10k@lists.infradead.org; linux-wireless@vger.kernel.org;
> devicetree@vger.kernel.org; linux-kernel@vger.kernel.org; Rakesh Pillai
> <pillair@codeaurora.org>
> Subject: Re: [PATCH 1/3] dt-bindings: ath10k: Add wifi-firmware subnode for
> wifi node
> 
> Rakesh Pillai <pillair@codeaurora.org> wrote:
> 
> > Add a wifi-firmware subnode for the wifi node.
> > This wifi-firmware subnode is needed for the
> > targets which do not support TrustZone.
> >
> > Signed-off-by: Rakesh Pillai <pillair@codeaurora.org>
> 
> Fails to build and has warnings. How did you test this?
> 
> drivers/net/wireless/ath/ath10k/qmi.c: In function
> 'ath10k_qmi_msa_mem_info_send_sync_msg':
> drivers/net/wireless/ath/ath10k/qmi.c:160:23: error: 'struct ath10k_qmi' has
> no member named 'msa_pa'
>   max_mapped_addr = qmi->msa_pa + qmi->msa_mem_size;
>                        ^~
> drivers/net/wireless/ath/ath10k/qmi.c:160:37: error: 'struct ath10k_qmi' has
> no member named 'msa_mem_size'
>   max_mapped_addr = qmi->msa_pa + qmi->msa_mem_size;
>                                      ^~
> drivers/net/wireless/ath/ath10k/qmi.c:163:41: error: 'struct ath10k_qmi' has
> no member named 'msa_mem_size'
>    if (resp.mem_region_info[i].size > qmi->msa_mem_size ||
>                                          ^~
> drivers/net/wireless/ath/ath10k/qmi.c:165:48: error: 'struct ath10k_qmi' has
> no member named 'msa_pa'
>        resp.mem_region_info[i].region_addr < qmi->msa_pa ||
>                                                 ^~
> make[5]: *** [drivers/net/wireless/ath/ath10k/qmi.o] Error 1
> make[5]: *** Waiting for unfinished jobs....
> In file included from ./include/linux/byteorder/little_endian.h:5,
>                  from ./arch/x86/include/uapi/asm/byteorder.h:5,
>                  from ./include/asm-generic/bitops/le.h:6,
>                  from ./arch/x86/include/asm/bitops.h:395,
>                  from ./include/linux/bitops.h:29,
>                  from ./include/linux/kernel.h:12,
>                  from ./include/linux/clk.h:13,
>                  from drivers/net/wireless/ath/ath10k/snoc.c:6:
> drivers/net/wireless/ath/ath10k/snoc.c: In function
> 'ath10k_msa_dump_memory':
> drivers/net/wireless/ath/ath10k/snoc.c:1424:54: error: 'struct ath10k_qmi'
> has no member named 'msa_va'
>   hdr->start = cpu_to_le32((unsigned long)ar_snoc->qmi->msa_va);
>                                                       ^~
> ./include/uapi/linux/byteorder/little_endian.h:33:51: note: in definition of
> macro '__cpu_to_le32'
>  #define __cpu_to_le32(x) ((__force __le32)(__u32)(x))
>                                                    ^
> drivers/net/wireless/ath/ath10k/snoc.c:1424:15: note: in expansion of macro
> 'cpu_to_le32'
>   hdr->start = cpu_to_le32((unsigned long)ar_snoc->qmi->msa_va);
>                ^~~~~~~~~~~
> drivers/net/wireless/ath/ath10k/snoc.c:1425:40: error: 'struct ath10k_qmi'
> has no member named 'msa_mem_size'
>   hdr->length = cpu_to_le32(ar_snoc->qmi->msa_mem_size);
>                                         ^~
> ./include/uapi/linux/byteorder/little_endian.h:33:51: note: in definition of
> macro '__cpu_to_le32'
>  #define __cpu_to_le32(x) ((__force __le32)(__u32)(x))
>                                                    ^
> drivers/net/wireless/ath/ath10k/snoc.c:1425:16: note: in expansion of macro
> 'cpu_to_le32'
>   hdr->length = cpu_to_le32(ar_snoc->qmi->msa_mem_size);
>                 ^~~~~~~~~~~
> drivers/net/wireless/ath/ath10k/snoc.c:1427:40: error: 'struct ath10k_qmi'
> has no member named 'msa_mem_size'
>   if (current_region->len < ar_snoc->qmi->msa_mem_size) {
>                                         ^~
> drivers/net/wireless/ath/ath10k/snoc.c:1428:27: error: 'struct ath10k_qmi'
> has no member named 'msa_va'
>    memcpy(buf, ar_snoc->qmi->msa_va, current_region->len);
>                            ^~
> drivers/net/wireless/ath/ath10k/snoc.c:1430:41: error: 'struct ath10k_qmi'
> has no member named 'msa_mem_size'
>         current_region->len, ar_snoc->qmi->msa_mem_size);
>                                          ^~
> drivers/net/wireless/ath/ath10k/snoc.c:1432:27: error: 'struct ath10k_qmi'
> has no member named 'msa_va'
>    memcpy(buf, ar_snoc->qmi->msa_va, ar_snoc->qmi->msa_mem_size);
>                            ^~
> drivers/net/wireless/ath/ath10k/snoc.c:1432:49: error: 'struct ath10k_qmi'
> has no member named 'msa_mem_size'
>    memcpy(buf, ar_snoc->qmi->msa_va, ar_snoc->qmi->msa_mem_size);
>                                                  ^~
> drivers/net/wireless/ath/ath10k/snoc.c: In function 'ath10k_fw_deinit':
> drivers/net/wireless/ath/ath10k/snoc.c:1593:14: error: assignment of read-
> only variable 'mapped_size'
>   mapped_size = ar_snoc->fw.mapped_mem_size;
>               ^
> drivers/net/wireless/ath/ath10k/snoc.c:1599:46: warning: format '%d'
> expects argument of type 'int', but argument 3 has type 'size_t' {aka 'long
> unsigned int'} [-Wformat=]
>    ath10k_err(ar, "failed to unmap firmware: %d\n",
>                                              ~^
>                                              %ld
>        unmapped_size);
>        ~~~~~~~~~~~~~
> make[5]: *** [drivers/net/wireless/ath/ath10k/snoc.o] Error 1
> make[4]: *** [drivers/net/wireless/ath/ath10k] Error 2
> make[3]: *** [drivers/net/wireless/ath] Error 2
> make[2]: *** [drivers/net/wireless] Error 2
> make[1]: *** [drivers/net] Error 2
> make: *** [drivers] Error 2
> 
> 3 patches set to Changes Requested.
> 
> 11455345 [1/3] dt-bindings: ath10k: Add wifi-firmware subnode for wifi node
> 11455351 [2/3] ath10k: Setup the msa resources before qmi init
> 11455353 [3/3] ath10k: Add support for targets without trustzone
> 
> --
> https://patchwork.kernel.org/patch/11455345/
> 
> https://wireless.wiki.kernel.org/en/developers/documentation/submittingp
> atches

Patch
diff mbox series

diff --git a/Documentation/devicetree/bindings/net/wireless/qcom,ath10k.txt b/Documentation/devicetree/bindings/net/wireless/qcom,ath10k.txt
index 71bf91f..65ee68e 100644
--- a/Documentation/devicetree/bindings/net/wireless/qcom,ath10k.txt
+++ b/Documentation/devicetree/bindings/net/wireless/qcom,ath10k.txt
@@ -96,6 +96,17 @@  Optional properties:
 - qcom,coexist-gpio-pin : gpio pin number  information to support coex
 			  which will be used by wifi firmware.
 
+* Subnodes
+The ath10k wifi node can contain one optional firmware subnode.
+Firmware subnode is needed when the platform does not have TustZone.
+The firmware subnode must have:
+
+- iommus:
+	Usage: required
+	Value type: <prop-encoded-array>
+	Definition: A list of phandle and IOMMU specifier pairs.
+
+
 Example (to supply PCI based wifi block details):
 
 In this example, the node is defined as child node of the PCI controller.
@@ -196,4 +207,7 @@  wifi@18000000 {
 		memory-region = <&wifi_msa_mem>;
 		iommus = <&apps_smmu 0x0040 0x1>;
 		qcom,msa-fixed-perm;
+		wifi-firmware {
+			iommus = <&apps_iommu 0xc22 0x1>;
+		};
 };