* [PATCH v4 0/2] ath10k: device tree support
@ 2014-11-27 12:08 ` Kalle Valo
0 siblings, 0 replies; 24+ messages in thread
From: Kalle Valo @ 2014-11-27 12:08 UTC (permalink / raw)
To: ath10k; +Cc: devicetree, linux-wireless, toshik
Hi,
here's providing ath10k calibration data via device tree support which
Toshi and me have been working on. Please review.
Device tree maintainers: please review the bindings document
carefully, this is the first time I have written one.
v4:
* use correct devicetree mailing list address
v3:
* add a debug message to ath10k
* write bindings file
* use ar->dev.of_node instead of pci_device_to_OF_node()
v2:
* fixed a bug that returns an uninitialized value if the node is not
found
---
Kalle Valo (1):
dt: bindings: add ath10k wireless device
Toshi Kikuchi (1):
ath10k: read calibration data from Device Tree
.../bindings/net/wireless/qcom,ath10k.txt | 30 +++++++++
drivers/net/wireless/ath/ath10k/core.c | 70 ++++++++++++++++++++
drivers/net/wireless/ath/ath10k/core.h | 3 +
3 files changed, 102 insertions(+), 1 deletion(-)
create mode 100644 Documentation/devicetree/bindings/net/wireless/qcom,ath10k.txt
_______________________________________________
ath10k mailing list
ath10k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath10k
^ permalink raw reply [flat|nested] 24+ messages in thread
* [PATCH v4 0/2] ath10k: device tree support
@ 2014-11-27 12:08 ` Kalle Valo
0 siblings, 0 replies; 24+ messages in thread
From: Kalle Valo @ 2014-11-27 12:08 UTC (permalink / raw)
To: ath10k-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r
Cc: devicetree-u79uwXL29TY76Z2rM5mHXA,
linux-wireless-u79uwXL29TY76Z2rM5mHXA,
toshik-F7+t8E8rja9g9hUCZPvPmw
Hi,
here's providing ath10k calibration data via device tree support which
Toshi and me have been working on. Please review.
Device tree maintainers: please review the bindings document
carefully, this is the first time I have written one.
v4:
* use correct devicetree mailing list address
v3:
* add a debug message to ath10k
* write bindings file
* use ar->dev.of_node instead of pci_device_to_OF_node()
v2:
* fixed a bug that returns an uninitialized value if the node is not
found
---
Kalle Valo (1):
dt: bindings: add ath10k wireless device
Toshi Kikuchi (1):
ath10k: read calibration data from Device Tree
.../bindings/net/wireless/qcom,ath10k.txt | 30 +++++++++
drivers/net/wireless/ath/ath10k/core.c | 70 ++++++++++++++++++++
drivers/net/wireless/ath/ath10k/core.h | 3 +
3 files changed, 102 insertions(+), 1 deletion(-)
create mode 100644 Documentation/devicetree/bindings/net/wireless/qcom,ath10k.txt
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 24+ messages in thread
* [PATCH v4 1/2] dt: bindings: add ath10k wireless device
@ 2014-11-27 12:08 ` Kalle Valo
0 siblings, 0 replies; 24+ messages in thread
From: Kalle Valo @ 2014-11-27 12:08 UTC (permalink / raw)
To: ath10k; +Cc: devicetree, linux-wireless, toshik
Document how calibration data can be provided to ath10k via Device Tree.
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
---
.../bindings/net/wireless/qcom,ath10k.txt | 30 ++++++++++++++++++++
1 file changed, 30 insertions(+)
create mode 100644 Documentation/devicetree/bindings/net/wireless/qcom,ath10k.txt
diff --git a/Documentation/devicetree/bindings/net/wireless/qcom,ath10k.txt b/Documentation/devicetree/bindings/net/wireless/qcom,ath10k.txt
new file mode 100644
index 000000000000..edefc26c6204
--- /dev/null
+++ b/Documentation/devicetree/bindings/net/wireless/qcom,ath10k.txt
@@ -0,0 +1,30 @@
+* Qualcomm Atheros ath10k wireless devices
+
+For ath10k devices the calibration data can be provided through Device
+Tree. The node is a child node of the PCI controller.
+
+Required properties:
+-compatible : Should be "qcom,ath10k"
+
+Optional properties:
+- qcom,ath10k-calibration-data : calibration data as an array, the
+ length can vary between hw versions
+
+
+Example:
+
+pci {
+ pcie@0 {
+ reg = <0 0 0 0 0>;
+ #interrupt-cells = <1>;
+ #size-cells = <2>;
+ #address-cells = <3>;
+ device_type = "pci";
+
+ ath10k@0,0 {
+ reg = <0 0 0 0 0>;
+ device_type = "pci";
+ qcom,ath10k-calibration-data = [ 01 02 03 ... ];
+ };
+ };
+};
^ permalink raw reply related [flat|nested] 24+ messages in thread
* [PATCH v4 1/2] dt: bindings: add ath10k wireless device
@ 2014-11-27 12:08 ` Kalle Valo
0 siblings, 0 replies; 24+ messages in thread
From: Kalle Valo @ 2014-11-27 12:08 UTC (permalink / raw)
To: ath10k; +Cc: devicetree, linux-wireless, toshik
Document how calibration data can be provided to ath10k via Device Tree.
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
---
.../bindings/net/wireless/qcom,ath10k.txt | 30 ++++++++++++++++++++
1 file changed, 30 insertions(+)
create mode 100644 Documentation/devicetree/bindings/net/wireless/qcom,ath10k.txt
diff --git a/Documentation/devicetree/bindings/net/wireless/qcom,ath10k.txt b/Documentation/devicetree/bindings/net/wireless/qcom,ath10k.txt
new file mode 100644
index 000000000000..edefc26c6204
--- /dev/null
+++ b/Documentation/devicetree/bindings/net/wireless/qcom,ath10k.txt
@@ -0,0 +1,30 @@
+* Qualcomm Atheros ath10k wireless devices
+
+For ath10k devices the calibration data can be provided through Device
+Tree. The node is a child node of the PCI controller.
+
+Required properties:
+-compatible : Should be "qcom,ath10k"
+
+Optional properties:
+- qcom,ath10k-calibration-data : calibration data as an array, the
+ length can vary between hw versions
+
+
+Example:
+
+pci {
+ pcie@0 {
+ reg = <0 0 0 0 0>;
+ #interrupt-cells = <1>;
+ #size-cells = <2>;
+ #address-cells = <3>;
+ device_type = "pci";
+
+ ath10k@0,0 {
+ reg = <0 0 0 0 0>;
+ device_type = "pci";
+ qcom,ath10k-calibration-data = [ 01 02 03 ... ];
+ };
+ };
+};
_______________________________________________
ath10k mailing list
ath10k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath10k
^ permalink raw reply related [flat|nested] 24+ messages in thread
* [PATCH v4 1/2] dt: bindings: add ath10k wireless device
@ 2014-11-27 12:08 ` Kalle Valo
0 siblings, 0 replies; 24+ messages in thread
From: Kalle Valo @ 2014-11-27 12:08 UTC (permalink / raw)
To: ath10k-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r
Cc: devicetree-u79uwXL29TY76Z2rM5mHXA,
linux-wireless-u79uwXL29TY76Z2rM5mHXA,
toshik-F7+t8E8rja9g9hUCZPvPmw
Document how calibration data can be provided to ath10k via Device Tree.
Signed-off-by: Kalle Valo <kvalo-A+ZNKFmMK5xy9aJCnZT0Uw@public.gmane.org>
---
.../bindings/net/wireless/qcom,ath10k.txt | 30 ++++++++++++++++++++
1 file changed, 30 insertions(+)
create mode 100644 Documentation/devicetree/bindings/net/wireless/qcom,ath10k.txt
diff --git a/Documentation/devicetree/bindings/net/wireless/qcom,ath10k.txt b/Documentation/devicetree/bindings/net/wireless/qcom,ath10k.txt
new file mode 100644
index 000000000000..edefc26c6204
--- /dev/null
+++ b/Documentation/devicetree/bindings/net/wireless/qcom,ath10k.txt
@@ -0,0 +1,30 @@
+* Qualcomm Atheros ath10k wireless devices
+
+For ath10k devices the calibration data can be provided through Device
+Tree. The node is a child node of the PCI controller.
+
+Required properties:
+-compatible : Should be "qcom,ath10k"
+
+Optional properties:
+- qcom,ath10k-calibration-data : calibration data as an array, the
+ length can vary between hw versions
+
+
+Example:
+
+pci {
+ pcie@0 {
+ reg = <0 0 0 0 0>;
+ #interrupt-cells = <1>;
+ #size-cells = <2>;
+ #address-cells = <3>;
+ device_type = "pci";
+
+ ath10k@0,0 {
+ reg = <0 0 0 0 0>;
+ device_type = "pci";
+ qcom,ath10k-calibration-data = [ 01 02 03 ... ];
+ };
+ };
+};
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 24+ messages in thread
* Re: [PATCH v4 1/2] dt: bindings: add ath10k wireless device
@ 2014-11-27 12:28 ` Arnd Bergmann
0 siblings, 0 replies; 24+ messages in thread
From: Arnd Bergmann @ 2014-11-27 12:28 UTC (permalink / raw)
To: Kalle Valo; +Cc: ath10k, devicetree, linux-wireless, toshik
On Thursday 27 November 2014 14:08:56 Kalle Valo wrote:
> diff --git a/Documentation/devicetree/bindings/net/wireless/qcom,ath10k.txt b/Documentation/devicetree/bindings/net/wireless/qcom,ath10k.txt
> new file mode 100644
> index 000000000000..edefc26c6204
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/net/wireless/qcom,ath10k.txt
> @@ -0,0 +1,30 @@
> +* Qualcomm Atheros ath10k wireless devices
> +
> +For ath10k devices the calibration data can be provided through Device
> +Tree. The node is a child node of the PCI controller.
> +
> +Required properties:
> +-compatible : Should be "qcom,ath10k"
> +
> +Optional properties:
> +- qcom,ath10k-calibration-data : calibration data as an array, the
> + length can vary between hw versions
> +
Does the device always have a valid mac address in hardware? If not,
how about listing that as well using the mac-address property?
Arnd
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH v4 1/2] dt: bindings: add ath10k wireless device
@ 2014-11-27 12:28 ` Arnd Bergmann
0 siblings, 0 replies; 24+ messages in thread
From: Arnd Bergmann @ 2014-11-27 12:28 UTC (permalink / raw)
To: Kalle Valo; +Cc: devicetree, linux-wireless, toshik, ath10k
On Thursday 27 November 2014 14:08:56 Kalle Valo wrote:
> diff --git a/Documentation/devicetree/bindings/net/wireless/qcom,ath10k.txt b/Documentation/devicetree/bindings/net/wireless/qcom,ath10k.txt
> new file mode 100644
> index 000000000000..edefc26c6204
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/net/wireless/qcom,ath10k.txt
> @@ -0,0 +1,30 @@
> +* Qualcomm Atheros ath10k wireless devices
> +
> +For ath10k devices the calibration data can be provided through Device
> +Tree. The node is a child node of the PCI controller.
> +
> +Required properties:
> +-compatible : Should be "qcom,ath10k"
> +
> +Optional properties:
> +- qcom,ath10k-calibration-data : calibration data as an array, the
> + length can vary between hw versions
> +
Does the device always have a valid mac address in hardware? If not,
how about listing that as well using the mac-address property?
Arnd
_______________________________________________
ath10k mailing list
ath10k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath10k
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH v4 1/2] dt: bindings: add ath10k wireless device
@ 2014-11-27 12:28 ` Arnd Bergmann
0 siblings, 0 replies; 24+ messages in thread
From: Arnd Bergmann @ 2014-11-27 12:28 UTC (permalink / raw)
To: Kalle Valo
Cc: ath10k-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
devicetree-u79uwXL29TY76Z2rM5mHXA,
linux-wireless-u79uwXL29TY76Z2rM5mHXA,
toshik-F7+t8E8rja9g9hUCZPvPmw
On Thursday 27 November 2014 14:08:56 Kalle Valo wrote:
> diff --git a/Documentation/devicetree/bindings/net/wireless/qcom,ath10k.txt b/Documentation/devicetree/bindings/net/wireless/qcom,ath10k.txt
> new file mode 100644
> index 000000000000..edefc26c6204
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/net/wireless/qcom,ath10k.txt
> @@ -0,0 +1,30 @@
> +* Qualcomm Atheros ath10k wireless devices
> +
> +For ath10k devices the calibration data can be provided through Device
> +Tree. The node is a child node of the PCI controller.
> +
> +Required properties:
> +-compatible : Should be "qcom,ath10k"
> +
> +Optional properties:
> +- qcom,ath10k-calibration-data : calibration data as an array, the
> + length can vary between hw versions
> +
Does the device always have a valid mac address in hardware? If not,
how about listing that as well using the mac-address property?
Arnd
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH v4 1/2] dt: bindings: add ath10k wireless device
2014-11-27 12:28 ` Arnd Bergmann
(?)
@ 2014-11-28 9:54 ` Kalle Valo
-1 siblings, 0 replies; 24+ messages in thread
From: Kalle Valo @ 2014-11-28 9:54 UTC (permalink / raw)
To: Arnd Bergmann; +Cc: ath10k, devicetree, linux-wireless, toshik
Arnd Bergmann <arnd@arndb.de> writes:
> On Thursday 27 November 2014 14:08:56 Kalle Valo wrote:
>> diff --git a/Documentation/devicetree/bindings/net/wireless/qcom,ath10k.txt b/Documentation/devicetree/bindings/net/wireless/qcom,ath10k.txt
>> new file mode 100644
>> index 000000000000..edefc26c6204
>> --- /dev/null
>> +++ b/Documentation/devicetree/bindings/net/wireless/qcom,ath10k.txt
>> @@ -0,0 +1,30 @@
>> +* Qualcomm Atheros ath10k wireless devices
>> +
>> +For ath10k devices the calibration data can be provided through Device
>> +Tree. The node is a child node of the PCI controller.
>> +
>> +Required properties:
>> +-compatible : Should be "qcom,ath10k"
>> +
>> +Optional properties:
>> +- qcom,ath10k-calibration-data : calibration data as an array, the
>> + length can vary between hw versions
>> +
>
> Does the device always have a valid mac address in hardware? If not,
> how about listing that as well using the mac-address property?
Right now ath10k does not support that, but in the future we might want
to add mac address as well. We need to do some testing with the firmware
to make sure that we can safely change the "main" address from ath10k.
And because of Virtual AP (mBSSID) feature we actually would need to
provide multiple addresses, not just one. Maybe with addr_mask like
struct wiphy has?
* @perm_addr: permanent MAC address of this device
* @addr_mask: If the device supports multiple MAC addresses by masking,
* set this to a mask with variable bits set to 1, e.g. if the last
* four bits are variable then set it to 00-00-00-00-00-0f. The actual
* variable bits shall be determined by the interfaces added, with
* interfaces not matching the mask being rejected to be brought up.
/* permanent MAC address(es) */
u8 perm_addr[ETH_ALEN];
u8 addr_mask[ETH_ALEN];
--
Kalle Valo
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH v4 1/2] dt: bindings: add ath10k wireless device
@ 2014-11-28 9:54 ` Kalle Valo
0 siblings, 0 replies; 24+ messages in thread
From: Kalle Valo @ 2014-11-28 9:54 UTC (permalink / raw)
To: Arnd Bergmann; +Cc: devicetree, linux-wireless, toshik, ath10k
Arnd Bergmann <arnd@arndb.de> writes:
> On Thursday 27 November 2014 14:08:56 Kalle Valo wrote:
>> diff --git a/Documentation/devicetree/bindings/net/wireless/qcom,ath10k.txt b/Documentation/devicetree/bindings/net/wireless/qcom,ath10k.txt
>> new file mode 100644
>> index 000000000000..edefc26c6204
>> --- /dev/null
>> +++ b/Documentation/devicetree/bindings/net/wireless/qcom,ath10k.txt
>> @@ -0,0 +1,30 @@
>> +* Qualcomm Atheros ath10k wireless devices
>> +
>> +For ath10k devices the calibration data can be provided through Device
>> +Tree. The node is a child node of the PCI controller.
>> +
>> +Required properties:
>> +-compatible : Should be "qcom,ath10k"
>> +
>> +Optional properties:
>> +- qcom,ath10k-calibration-data : calibration data as an array, the
>> + length can vary between hw versions
>> +
>
> Does the device always have a valid mac address in hardware? If not,
> how about listing that as well using the mac-address property?
Right now ath10k does not support that, but in the future we might want
to add mac address as well. We need to do some testing with the firmware
to make sure that we can safely change the "main" address from ath10k.
And because of Virtual AP (mBSSID) feature we actually would need to
provide multiple addresses, not just one. Maybe with addr_mask like
struct wiphy has?
* @perm_addr: permanent MAC address of this device
* @addr_mask: If the device supports multiple MAC addresses by masking,
* set this to a mask with variable bits set to 1, e.g. if the last
* four bits are variable then set it to 00-00-00-00-00-0f. The actual
* variable bits shall be determined by the interfaces added, with
* interfaces not matching the mask being rejected to be brought up.
/* permanent MAC address(es) */
u8 perm_addr[ETH_ALEN];
u8 addr_mask[ETH_ALEN];
--
Kalle Valo
_______________________________________________
ath10k mailing list
ath10k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath10k
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH v4 1/2] dt: bindings: add ath10k wireless device
@ 2014-11-28 9:54 ` Kalle Valo
0 siblings, 0 replies; 24+ messages in thread
From: Kalle Valo @ 2014-11-28 9:54 UTC (permalink / raw)
To: Arnd Bergmann
Cc: ath10k-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
devicetree-u79uwXL29TY76Z2rM5mHXA,
linux-wireless-u79uwXL29TY76Z2rM5mHXA,
toshik-F7+t8E8rja9g9hUCZPvPmw
Arnd Bergmann <arnd-r2nGTMty4D4@public.gmane.org> writes:
> On Thursday 27 November 2014 14:08:56 Kalle Valo wrote:
>> diff --git a/Documentation/devicetree/bindings/net/wireless/qcom,ath10k.txt b/Documentation/devicetree/bindings/net/wireless/qcom,ath10k.txt
>> new file mode 100644
>> index 000000000000..edefc26c6204
>> --- /dev/null
>> +++ b/Documentation/devicetree/bindings/net/wireless/qcom,ath10k.txt
>> @@ -0,0 +1,30 @@
>> +* Qualcomm Atheros ath10k wireless devices
>> +
>> +For ath10k devices the calibration data can be provided through Device
>> +Tree. The node is a child node of the PCI controller.
>> +
>> +Required properties:
>> +-compatible : Should be "qcom,ath10k"
>> +
>> +Optional properties:
>> +- qcom,ath10k-calibration-data : calibration data as an array, the
>> + length can vary between hw versions
>> +
>
> Does the device always have a valid mac address in hardware? If not,
> how about listing that as well using the mac-address property?
Right now ath10k does not support that, but in the future we might want
to add mac address as well. We need to do some testing with the firmware
to make sure that we can safely change the "main" address from ath10k.
And because of Virtual AP (mBSSID) feature we actually would need to
provide multiple addresses, not just one. Maybe with addr_mask like
struct wiphy has?
* @perm_addr: permanent MAC address of this device
* @addr_mask: If the device supports multiple MAC addresses by masking,
* set this to a mask with variable bits set to 1, e.g. if the last
* four bits are variable then set it to 00-00-00-00-00-0f. The actual
* variable bits shall be determined by the interfaces added, with
* interfaces not matching the mask being rejected to be brought up.
/* permanent MAC address(es) */
u8 perm_addr[ETH_ALEN];
u8 addr_mask[ETH_ALEN];
--
Kalle Valo
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH v4 1/2] dt: bindings: add ath10k wireless device
@ 2014-11-28 10:23 ` Arnd Bergmann
0 siblings, 0 replies; 24+ messages in thread
From: Arnd Bergmann @ 2014-11-28 10:23 UTC (permalink / raw)
To: Kalle Valo; +Cc: ath10k, devicetree, linux-wireless, toshik
On Friday 28 November 2014 11:54:39 Kalle Valo wrote:
>
> Right now ath10k does not support that, but in the future we might want
> to add mac address as well. We need to do some testing with the firmware
> to make sure that we can safely change the "main" address from ath10k.
This is from Documentation/devicetree/bindings/net/ethernet.txt:
- local-mac-address: array of 6 bytes, specifies the MAC address that was
assigned to the network device;
- mac-address: array of 6 bytes, specifies the MAC address that was last used by
the boot program; should be used in cases where the MAC address assigned to
the device by the boot program is different from the "local-mac-address"
property;
If the address is fixed, you might still be able to use the local-mac-address
property to communicate the main address. Normally you only have to pass
the mac address in DT if the device itself doesn't know the address. Do you
know where the main address is stored? If it's always known to the card,
we don't need to pass it, and if the card doesn't know it, I suspect it would
be safe to change it.
> And because of Virtual AP (mBSSID) feature we actually would need to
> provide multiple addresses, not just one. Maybe with addr_mask like
> struct wiphy has?
>
> * @perm_addr: permanent MAC address of this device
> * @addr_mask: If the device supports multiple MAC addresses by masking,
> * set this to a mask with variable bits set to 1, e.g. if the last
> * four bits are variable then set it to 00-00-00-00-00-0f. The actual
> * variable bits shall be determined by the interfaces added, with
> * interfaces not matching the mask being rejected to be brought up.
>
> /* permanent MAC address(es) */
> u8 perm_addr[ETH_ALEN];
> u8 addr_mask[ETH_ALEN];
We don't have a common binding for this yet, I think drivers that do this
at the moment just know how many addresses they are allowed to take.
If the mask is generally considered useful, we could probably add that to
the binding though.
Arnd
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH v4 1/2] dt: bindings: add ath10k wireless device
@ 2014-11-28 10:23 ` Arnd Bergmann
0 siblings, 0 replies; 24+ messages in thread
From: Arnd Bergmann @ 2014-11-28 10:23 UTC (permalink / raw)
To: Kalle Valo; +Cc: devicetree, linux-wireless, toshik, ath10k
On Friday 28 November 2014 11:54:39 Kalle Valo wrote:
>
> Right now ath10k does not support that, but in the future we might want
> to add mac address as well. We need to do some testing with the firmware
> to make sure that we can safely change the "main" address from ath10k.
This is from Documentation/devicetree/bindings/net/ethernet.txt:
- local-mac-address: array of 6 bytes, specifies the MAC address that was
assigned to the network device;
- mac-address: array of 6 bytes, specifies the MAC address that was last used by
the boot program; should be used in cases where the MAC address assigned to
the device by the boot program is different from the "local-mac-address"
property;
If the address is fixed, you might still be able to use the local-mac-address
property to communicate the main address. Normally you only have to pass
the mac address in DT if the device itself doesn't know the address. Do you
know where the main address is stored? If it's always known to the card,
we don't need to pass it, and if the card doesn't know it, I suspect it would
be safe to change it.
> And because of Virtual AP (mBSSID) feature we actually would need to
> provide multiple addresses, not just one. Maybe with addr_mask like
> struct wiphy has?
>
> * @perm_addr: permanent MAC address of this device
> * @addr_mask: If the device supports multiple MAC addresses by masking,
> * set this to a mask with variable bits set to 1, e.g. if the last
> * four bits are variable then set it to 00-00-00-00-00-0f. The actual
> * variable bits shall be determined by the interfaces added, with
> * interfaces not matching the mask being rejected to be brought up.
>
> /* permanent MAC address(es) */
> u8 perm_addr[ETH_ALEN];
> u8 addr_mask[ETH_ALEN];
We don't have a common binding for this yet, I think drivers that do this
at the moment just know how many addresses they are allowed to take.
If the mask is generally considered useful, we could probably add that to
the binding though.
Arnd
_______________________________________________
ath10k mailing list
ath10k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath10k
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH v4 1/2] dt: bindings: add ath10k wireless device
@ 2014-11-28 10:23 ` Arnd Bergmann
0 siblings, 0 replies; 24+ messages in thread
From: Arnd Bergmann @ 2014-11-28 10:23 UTC (permalink / raw)
To: Kalle Valo
Cc: ath10k-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
devicetree-u79uwXL29TY76Z2rM5mHXA,
linux-wireless-u79uwXL29TY76Z2rM5mHXA,
toshik-F7+t8E8rja9g9hUCZPvPmw
On Friday 28 November 2014 11:54:39 Kalle Valo wrote:
>
> Right now ath10k does not support that, but in the future we might want
> to add mac address as well. We need to do some testing with the firmware
> to make sure that we can safely change the "main" address from ath10k.
This is from Documentation/devicetree/bindings/net/ethernet.txt:
- local-mac-address: array of 6 bytes, specifies the MAC address that was
assigned to the network device;
- mac-address: array of 6 bytes, specifies the MAC address that was last used by
the boot program; should be used in cases where the MAC address assigned to
the device by the boot program is different from the "local-mac-address"
property;
If the address is fixed, you might still be able to use the local-mac-address
property to communicate the main address. Normally you only have to pass
the mac address in DT if the device itself doesn't know the address. Do you
know where the main address is stored? If it's always known to the card,
we don't need to pass it, and if the card doesn't know it, I suspect it would
be safe to change it.
> And because of Virtual AP (mBSSID) feature we actually would need to
> provide multiple addresses, not just one. Maybe with addr_mask like
> struct wiphy has?
>
> * @perm_addr: permanent MAC address of this device
> * @addr_mask: If the device supports multiple MAC addresses by masking,
> * set this to a mask with variable bits set to 1, e.g. if the last
> * four bits are variable then set it to 00-00-00-00-00-0f. The actual
> * variable bits shall be determined by the interfaces added, with
> * interfaces not matching the mask being rejected to be brought up.
>
> /* permanent MAC address(es) */
> u8 perm_addr[ETH_ALEN];
> u8 addr_mask[ETH_ALEN];
We don't have a common binding for this yet, I think drivers that do this
at the moment just know how many addresses they are allowed to take.
If the mask is generally considered useful, we could probably add that to
the binding though.
Arnd
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH v4 1/2] dt: bindings: add ath10k wireless device
2014-11-28 10:23 ` Arnd Bergmann
(?)
@ 2014-11-28 12:21 ` Kalle Valo
-1 siblings, 0 replies; 24+ messages in thread
From: Kalle Valo @ 2014-11-28 12:21 UTC (permalink / raw)
To: Arnd Bergmann; +Cc: ath10k, devicetree, linux-wireless, toshik
Arnd Bergmann <arnd@arndb.de> writes:
> On Friday 28 November 2014 11:54:39 Kalle Valo wrote:
>>
>> Right now ath10k does not support that, but in the future we might want
>> to add mac address as well. We need to do some testing with the firmware
>> to make sure that we can safely change the "main" address from ath10k.
>
> This is from Documentation/devicetree/bindings/net/ethernet.txt:
>
> - local-mac-address: array of 6 bytes, specifies the MAC address that was
> assigned to the network device;
> - mac-address: array of 6 bytes, specifies the MAC address that was last used by
> the boot program; should be used in cases where the MAC address assigned to
> the device by the boot program is different from the "local-mac-address"
> property;
>
> If the address is fixed, you might still be able to use the local-mac-address
> property to communicate the main address. Normally you only have to pass
> the mac address in DT if the device itself doesn't know the address. Do you
> know where the main address is stored?
The ath10k main address is stored in the calibration data and the
firmware delivers the address to ath10k.
> If it's always known to the card, we don't need to pass it, and if the
> card doesn't know it, I suspect it would be safe to change it.
I suspect we can change the address afterwards, but I need to check to
be sure.
>> And because of Virtual AP (mBSSID) feature we actually would need to
>> provide multiple addresses, not just one. Maybe with addr_mask like
>> struct wiphy has?
>>
>> * @perm_addr: permanent MAC address of this device
>> * @addr_mask: If the device supports multiple MAC addresses by masking,
>> * set this to a mask with variable bits set to 1, e.g. if the last
>> * four bits are variable then set it to 00-00-00-00-00-0f. The actual
>> * variable bits shall be determined by the interfaces added, with
>> * interfaces not matching the mask being rejected to be brought up.
>>
>> /* permanent MAC address(es) */
>> u8 perm_addr[ETH_ALEN];
>> u8 addr_mask[ETH_ALEN];
>
> We don't have a common binding for this yet, I think drivers that do this
> at the moment just know how many addresses they are allowed to take.
>
> If the mask is generally considered useful, we could probably add that to
> the binding though.
Currently ath10k supports up to 8 Virtual APs but the manufacturer can
choose to allocate any number of MAC addresses (1-8). Something like
addr_mask would be good way to inform ath10k what address range it has
available.
--
Kalle Valo
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH v4 1/2] dt: bindings: add ath10k wireless device
@ 2014-11-28 12:21 ` Kalle Valo
0 siblings, 0 replies; 24+ messages in thread
From: Kalle Valo @ 2014-11-28 12:21 UTC (permalink / raw)
To: Arnd Bergmann; +Cc: devicetree, linux-wireless, toshik, ath10k
Arnd Bergmann <arnd@arndb.de> writes:
> On Friday 28 November 2014 11:54:39 Kalle Valo wrote:
>>
>> Right now ath10k does not support that, but in the future we might want
>> to add mac address as well. We need to do some testing with the firmware
>> to make sure that we can safely change the "main" address from ath10k.
>
> This is from Documentation/devicetree/bindings/net/ethernet.txt:
>
> - local-mac-address: array of 6 bytes, specifies the MAC address that was
> assigned to the network device;
> - mac-address: array of 6 bytes, specifies the MAC address that was last used by
> the boot program; should be used in cases where the MAC address assigned to
> the device by the boot program is different from the "local-mac-address"
> property;
>
> If the address is fixed, you might still be able to use the local-mac-address
> property to communicate the main address. Normally you only have to pass
> the mac address in DT if the device itself doesn't know the address. Do you
> know where the main address is stored?
The ath10k main address is stored in the calibration data and the
firmware delivers the address to ath10k.
> If it's always known to the card, we don't need to pass it, and if the
> card doesn't know it, I suspect it would be safe to change it.
I suspect we can change the address afterwards, but I need to check to
be sure.
>> And because of Virtual AP (mBSSID) feature we actually would need to
>> provide multiple addresses, not just one. Maybe with addr_mask like
>> struct wiphy has?
>>
>> * @perm_addr: permanent MAC address of this device
>> * @addr_mask: If the device supports multiple MAC addresses by masking,
>> * set this to a mask with variable bits set to 1, e.g. if the last
>> * four bits are variable then set it to 00-00-00-00-00-0f. The actual
>> * variable bits shall be determined by the interfaces added, with
>> * interfaces not matching the mask being rejected to be brought up.
>>
>> /* permanent MAC address(es) */
>> u8 perm_addr[ETH_ALEN];
>> u8 addr_mask[ETH_ALEN];
>
> We don't have a common binding for this yet, I think drivers that do this
> at the moment just know how many addresses they are allowed to take.
>
> If the mask is generally considered useful, we could probably add that to
> the binding though.
Currently ath10k supports up to 8 Virtual APs but the manufacturer can
choose to allocate any number of MAC addresses (1-8). Something like
addr_mask would be good way to inform ath10k what address range it has
available.
--
Kalle Valo
_______________________________________________
ath10k mailing list
ath10k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath10k
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH v4 1/2] dt: bindings: add ath10k wireless device
@ 2014-11-28 12:21 ` Kalle Valo
0 siblings, 0 replies; 24+ messages in thread
From: Kalle Valo @ 2014-11-28 12:21 UTC (permalink / raw)
To: Arnd Bergmann
Cc: ath10k-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
devicetree-u79uwXL29TY76Z2rM5mHXA,
linux-wireless-u79uwXL29TY76Z2rM5mHXA,
toshik-F7+t8E8rja9g9hUCZPvPmw
Arnd Bergmann <arnd-r2nGTMty4D4@public.gmane.org> writes:
> On Friday 28 November 2014 11:54:39 Kalle Valo wrote:
>>
>> Right now ath10k does not support that, but in the future we might want
>> to add mac address as well. We need to do some testing with the firmware
>> to make sure that we can safely change the "main" address from ath10k.
>
> This is from Documentation/devicetree/bindings/net/ethernet.txt:
>
> - local-mac-address: array of 6 bytes, specifies the MAC address that was
> assigned to the network device;
> - mac-address: array of 6 bytes, specifies the MAC address that was last used by
> the boot program; should be used in cases where the MAC address assigned to
> the device by the boot program is different from the "local-mac-address"
> property;
>
> If the address is fixed, you might still be able to use the local-mac-address
> property to communicate the main address. Normally you only have to pass
> the mac address in DT if the device itself doesn't know the address. Do you
> know where the main address is stored?
The ath10k main address is stored in the calibration data and the
firmware delivers the address to ath10k.
> If it's always known to the card, we don't need to pass it, and if the
> card doesn't know it, I suspect it would be safe to change it.
I suspect we can change the address afterwards, but I need to check to
be sure.
>> And because of Virtual AP (mBSSID) feature we actually would need to
>> provide multiple addresses, not just one. Maybe with addr_mask like
>> struct wiphy has?
>>
>> * @perm_addr: permanent MAC address of this device
>> * @addr_mask: If the device supports multiple MAC addresses by masking,
>> * set this to a mask with variable bits set to 1, e.g. if the last
>> * four bits are variable then set it to 00-00-00-00-00-0f. The actual
>> * variable bits shall be determined by the interfaces added, with
>> * interfaces not matching the mask being rejected to be brought up.
>>
>> /* permanent MAC address(es) */
>> u8 perm_addr[ETH_ALEN];
>> u8 addr_mask[ETH_ALEN];
>
> We don't have a common binding for this yet, I think drivers that do this
> at the moment just know how many addresses they are allowed to take.
>
> If the mask is generally considered useful, we could probably add that to
> the binding though.
Currently ath10k supports up to 8 Virtual APs but the manufacturer can
choose to allocate any number of MAC addresses (1-8). Something like
addr_mask would be good way to inform ath10k what address range it has
available.
--
Kalle Valo
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 24+ messages in thread
* [PATCH v4 2/2] ath10k: read calibration data from Device Tree
@ 2014-11-27 12:09 ` Kalle Valo
0 siblings, 0 replies; 24+ messages in thread
From: Kalle Valo @ 2014-11-27 12:09 UTC (permalink / raw)
To: ath10k; +Cc: devicetree, linux-wireless, toshik
From: Toshi Kikuchi <toshik@chromium.org>
This patch adds support for reading calibration data from Device Tree.
It looks for the calibration data in Device Tree if it can't find it
in a file. If there's no node in Device Tree, ath10k will try to find the
calibration data from OTP.
The node for the calibration data should be defined like this:
pci {
pcie@0 {
reg = <0 0 0 0 0>;
#interrupt-cells = <1>;
#size-cells = <2>;
#address-cells = <3>;
device_type = "pci";
ath10k@0,0 {
reg = <0 0 0 0 0>;
device_type = "pci";
qcom,ath10k-calibration-data = [ 01 02 03 ... ];
};
};
};
Signed-off-by: Toshi Kikuchi <toshik@chromium.org>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
---
drivers/net/wireless/ath/ath10k/core.c | 70 ++++++++++++++++++++++++++++++++
drivers/net/wireless/ath/ath10k/core.h | 3 +
2 files changed, 72 insertions(+), 1 deletion(-)
diff --git a/drivers/net/wireless/ath/ath10k/core.c b/drivers/net/wireless/ath/ath10k/core.c
index 7762061a1944..6165f2735b35 100644
--- a/drivers/net/wireless/ath/ath10k/core.c
+++ b/drivers/net/wireless/ath/ath10k/core.c
@@ -17,6 +17,7 @@
#include <linux/module.h>
#include <linux/firmware.h>
+#include <linux/of.h>
#include "core.h"
#include "mac.h"
@@ -249,6 +250,63 @@ static int ath10k_download_cal_file(struct ath10k *ar)
return 0;
}
+static int ath10k_download_cal_dt(struct ath10k *ar)
+{
+ struct device_node *node;
+ int data_len;
+ void *data;
+ int ret;
+
+ node = ar->dev->of_node;
+ if (!node)
+ /* Device Tree is optional, don't print any warnings if
+ * there's no node for ath10k.
+ */
+ return -ENOENT;
+
+ if (!of_get_property(node, "qcom,ath10k-calibration-data",
+ &data_len)) {
+ /* The calibration data node is optional */
+ return -ENOENT;
+ }
+
+ if (data_len != QCA988X_CAL_DATA_LEN) {
+ ath10k_warn(ar, "invalid calibration data length in DT: %d\n",
+ data_len);
+ ret = -EMSGSIZE;
+ goto out;
+ }
+
+ data = kmalloc(data_len, GFP_KERNEL);
+ if (!data) {
+ ret = -ENOMEM;
+ goto out;
+ }
+
+ ret = of_property_read_u8_array(node, "qcom,ath10k-calibration-data",
+ data, data_len);
+ if (ret) {
+ ath10k_warn(ar, "failed to read calibration data from DT: %d\n",
+ ret);
+ goto out_free;
+ }
+
+ ret = ath10k_download_board_data(ar, data, data_len);
+ if (ret) {
+ ath10k_warn(ar, "failed to download calibration data from Device Tree: %d\n",
+ ret);
+ goto out_free;
+ }
+
+ ret = 0;
+
+out_free:
+ kfree(data);
+
+out:
+ return ret;
+}
+
static int ath10k_download_and_run_otp(struct ath10k *ar)
{
u32 result, address = ar->hw_params.patch_load_addr;
@@ -662,7 +720,17 @@ static int ath10k_download_cal_data(struct ath10k *ar)
}
ath10k_dbg(ar, ATH10K_DBG_BOOT,
- "boot did not find a calibration file, try OTP next: %d\n",
+ "boot did not find a calibration file, try DT next: %d\n",
+ ret);
+
+ ret = ath10k_download_cal_dt(ar);
+ if (ret == 0) {
+ ar->cal_mode = ATH10K_CAL_MODE_DT;
+ goto done;
+ }
+
+ ath10k_dbg(ar, ATH10K_DBG_BOOT,
+ "boot did not find DT entry, try OTP next: %d\n",
ret);
ret = ath10k_download_and_run_otp(ar);
diff --git a/drivers/net/wireless/ath/ath10k/core.h b/drivers/net/wireless/ath/ath10k/core.h
index 4a294987736c..2dd1bb05a3fc 100644
--- a/drivers/net/wireless/ath/ath10k/core.h
+++ b/drivers/net/wireless/ath/ath10k/core.h
@@ -400,6 +400,7 @@ enum ath10k_dev_flags {
enum ath10k_cal_mode {
ATH10K_CAL_MODE_FILE,
ATH10K_CAL_MODE_OTP,
+ ATH10K_CAL_MODE_DT,
};
static inline const char *ath10k_cal_mode_str(enum ath10k_cal_mode mode)
@@ -409,6 +410,8 @@ static inline const char *ath10k_cal_mode_str(enum ath10k_cal_mode mode)
return "file";
case ATH10K_CAL_MODE_OTP:
return "otp";
+ case ATH10K_CAL_MODE_DT:
+ return "dt";
}
return "unknown";
^ permalink raw reply related [flat|nested] 24+ messages in thread
* [PATCH v4 2/2] ath10k: read calibration data from Device Tree
@ 2014-11-27 12:09 ` Kalle Valo
0 siblings, 0 replies; 24+ messages in thread
From: Kalle Valo @ 2014-11-27 12:09 UTC (permalink / raw)
To: ath10k; +Cc: devicetree, linux-wireless, toshik
From: Toshi Kikuchi <toshik@chromium.org>
This patch adds support for reading calibration data from Device Tree.
It looks for the calibration data in Device Tree if it can't find it
in a file. If there's no node in Device Tree, ath10k will try to find the
calibration data from OTP.
The node for the calibration data should be defined like this:
pci {
pcie@0 {
reg = <0 0 0 0 0>;
#interrupt-cells = <1>;
#size-cells = <2>;
#address-cells = <3>;
device_type = "pci";
ath10k@0,0 {
reg = <0 0 0 0 0>;
device_type = "pci";
qcom,ath10k-calibration-data = [ 01 02 03 ... ];
};
};
};
Signed-off-by: Toshi Kikuchi <toshik@chromium.org>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
---
drivers/net/wireless/ath/ath10k/core.c | 70 ++++++++++++++++++++++++++++++++
drivers/net/wireless/ath/ath10k/core.h | 3 +
2 files changed, 72 insertions(+), 1 deletion(-)
diff --git a/drivers/net/wireless/ath/ath10k/core.c b/drivers/net/wireless/ath/ath10k/core.c
index 7762061a1944..6165f2735b35 100644
--- a/drivers/net/wireless/ath/ath10k/core.c
+++ b/drivers/net/wireless/ath/ath10k/core.c
@@ -17,6 +17,7 @@
#include <linux/module.h>
#include <linux/firmware.h>
+#include <linux/of.h>
#include "core.h"
#include "mac.h"
@@ -249,6 +250,63 @@ static int ath10k_download_cal_file(struct ath10k *ar)
return 0;
}
+static int ath10k_download_cal_dt(struct ath10k *ar)
+{
+ struct device_node *node;
+ int data_len;
+ void *data;
+ int ret;
+
+ node = ar->dev->of_node;
+ if (!node)
+ /* Device Tree is optional, don't print any warnings if
+ * there's no node for ath10k.
+ */
+ return -ENOENT;
+
+ if (!of_get_property(node, "qcom,ath10k-calibration-data",
+ &data_len)) {
+ /* The calibration data node is optional */
+ return -ENOENT;
+ }
+
+ if (data_len != QCA988X_CAL_DATA_LEN) {
+ ath10k_warn(ar, "invalid calibration data length in DT: %d\n",
+ data_len);
+ ret = -EMSGSIZE;
+ goto out;
+ }
+
+ data = kmalloc(data_len, GFP_KERNEL);
+ if (!data) {
+ ret = -ENOMEM;
+ goto out;
+ }
+
+ ret = of_property_read_u8_array(node, "qcom,ath10k-calibration-data",
+ data, data_len);
+ if (ret) {
+ ath10k_warn(ar, "failed to read calibration data from DT: %d\n",
+ ret);
+ goto out_free;
+ }
+
+ ret = ath10k_download_board_data(ar, data, data_len);
+ if (ret) {
+ ath10k_warn(ar, "failed to download calibration data from Device Tree: %d\n",
+ ret);
+ goto out_free;
+ }
+
+ ret = 0;
+
+out_free:
+ kfree(data);
+
+out:
+ return ret;
+}
+
static int ath10k_download_and_run_otp(struct ath10k *ar)
{
u32 result, address = ar->hw_params.patch_load_addr;
@@ -662,7 +720,17 @@ static int ath10k_download_cal_data(struct ath10k *ar)
}
ath10k_dbg(ar, ATH10K_DBG_BOOT,
- "boot did not find a calibration file, try OTP next: %d\n",
+ "boot did not find a calibration file, try DT next: %d\n",
+ ret);
+
+ ret = ath10k_download_cal_dt(ar);
+ if (ret == 0) {
+ ar->cal_mode = ATH10K_CAL_MODE_DT;
+ goto done;
+ }
+
+ ath10k_dbg(ar, ATH10K_DBG_BOOT,
+ "boot did not find DT entry, try OTP next: %d\n",
ret);
ret = ath10k_download_and_run_otp(ar);
diff --git a/drivers/net/wireless/ath/ath10k/core.h b/drivers/net/wireless/ath/ath10k/core.h
index 4a294987736c..2dd1bb05a3fc 100644
--- a/drivers/net/wireless/ath/ath10k/core.h
+++ b/drivers/net/wireless/ath/ath10k/core.h
@@ -400,6 +400,7 @@ enum ath10k_dev_flags {
enum ath10k_cal_mode {
ATH10K_CAL_MODE_FILE,
ATH10K_CAL_MODE_OTP,
+ ATH10K_CAL_MODE_DT,
};
static inline const char *ath10k_cal_mode_str(enum ath10k_cal_mode mode)
@@ -409,6 +410,8 @@ static inline const char *ath10k_cal_mode_str(enum ath10k_cal_mode mode)
return "file";
case ATH10K_CAL_MODE_OTP:
return "otp";
+ case ATH10K_CAL_MODE_DT:
+ return "dt";
}
return "unknown";
_______________________________________________
ath10k mailing list
ath10k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath10k
^ permalink raw reply related [flat|nested] 24+ messages in thread
* [PATCH v4 2/2] ath10k: read calibration data from Device Tree
@ 2014-11-27 12:09 ` Kalle Valo
0 siblings, 0 replies; 24+ messages in thread
From: Kalle Valo @ 2014-11-27 12:09 UTC (permalink / raw)
To: ath10k-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r
Cc: devicetree-u79uwXL29TY76Z2rM5mHXA,
linux-wireless-u79uwXL29TY76Z2rM5mHXA,
toshik-F7+t8E8rja9g9hUCZPvPmw
From: Toshi Kikuchi <toshik-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
This patch adds support for reading calibration data from Device Tree.
It looks for the calibration data in Device Tree if it can't find it
in a file. If there's no node in Device Tree, ath10k will try to find the
calibration data from OTP.
The node for the calibration data should be defined like this:
pci {
pcie@0 {
reg = <0 0 0 0 0>;
#interrupt-cells = <1>;
#size-cells = <2>;
#address-cells = <3>;
device_type = "pci";
ath10k@0,0 {
reg = <0 0 0 0 0>;
device_type = "pci";
qcom,ath10k-calibration-data = [ 01 02 03 ... ];
};
};
};
Signed-off-by: Toshi Kikuchi <toshik-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
Signed-off-by: Kalle Valo <kvalo-A+ZNKFmMK5xy9aJCnZT0Uw@public.gmane.org>
---
drivers/net/wireless/ath/ath10k/core.c | 70 ++++++++++++++++++++++++++++++++
drivers/net/wireless/ath/ath10k/core.h | 3 +
2 files changed, 72 insertions(+), 1 deletion(-)
diff --git a/drivers/net/wireless/ath/ath10k/core.c b/drivers/net/wireless/ath/ath10k/core.c
index 7762061a1944..6165f2735b35 100644
--- a/drivers/net/wireless/ath/ath10k/core.c
+++ b/drivers/net/wireless/ath/ath10k/core.c
@@ -17,6 +17,7 @@
#include <linux/module.h>
#include <linux/firmware.h>
+#include <linux/of.h>
#include "core.h"
#include "mac.h"
@@ -249,6 +250,63 @@ static int ath10k_download_cal_file(struct ath10k *ar)
return 0;
}
+static int ath10k_download_cal_dt(struct ath10k *ar)
+{
+ struct device_node *node;
+ int data_len;
+ void *data;
+ int ret;
+
+ node = ar->dev->of_node;
+ if (!node)
+ /* Device Tree is optional, don't print any warnings if
+ * there's no node for ath10k.
+ */
+ return -ENOENT;
+
+ if (!of_get_property(node, "qcom,ath10k-calibration-data",
+ &data_len)) {
+ /* The calibration data node is optional */
+ return -ENOENT;
+ }
+
+ if (data_len != QCA988X_CAL_DATA_LEN) {
+ ath10k_warn(ar, "invalid calibration data length in DT: %d\n",
+ data_len);
+ ret = -EMSGSIZE;
+ goto out;
+ }
+
+ data = kmalloc(data_len, GFP_KERNEL);
+ if (!data) {
+ ret = -ENOMEM;
+ goto out;
+ }
+
+ ret = of_property_read_u8_array(node, "qcom,ath10k-calibration-data",
+ data, data_len);
+ if (ret) {
+ ath10k_warn(ar, "failed to read calibration data from DT: %d\n",
+ ret);
+ goto out_free;
+ }
+
+ ret = ath10k_download_board_data(ar, data, data_len);
+ if (ret) {
+ ath10k_warn(ar, "failed to download calibration data from Device Tree: %d\n",
+ ret);
+ goto out_free;
+ }
+
+ ret = 0;
+
+out_free:
+ kfree(data);
+
+out:
+ return ret;
+}
+
static int ath10k_download_and_run_otp(struct ath10k *ar)
{
u32 result, address = ar->hw_params.patch_load_addr;
@@ -662,7 +720,17 @@ static int ath10k_download_cal_data(struct ath10k *ar)
}
ath10k_dbg(ar, ATH10K_DBG_BOOT,
- "boot did not find a calibration file, try OTP next: %d\n",
+ "boot did not find a calibration file, try DT next: %d\n",
+ ret);
+
+ ret = ath10k_download_cal_dt(ar);
+ if (ret == 0) {
+ ar->cal_mode = ATH10K_CAL_MODE_DT;
+ goto done;
+ }
+
+ ath10k_dbg(ar, ATH10K_DBG_BOOT,
+ "boot did not find DT entry, try OTP next: %d\n",
ret);
ret = ath10k_download_and_run_otp(ar);
diff --git a/drivers/net/wireless/ath/ath10k/core.h b/drivers/net/wireless/ath/ath10k/core.h
index 4a294987736c..2dd1bb05a3fc 100644
--- a/drivers/net/wireless/ath/ath10k/core.h
+++ b/drivers/net/wireless/ath/ath10k/core.h
@@ -400,6 +400,7 @@ enum ath10k_dev_flags {
enum ath10k_cal_mode {
ATH10K_CAL_MODE_FILE,
ATH10K_CAL_MODE_OTP,
+ ATH10K_CAL_MODE_DT,
};
static inline const char *ath10k_cal_mode_str(enum ath10k_cal_mode mode)
@@ -409,6 +410,8 @@ static inline const char *ath10k_cal_mode_str(enum ath10k_cal_mode mode)
return "file";
case ATH10K_CAL_MODE_OTP:
return "otp";
+ case ATH10K_CAL_MODE_DT:
+ return "dt";
}
return "unknown";
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 24+ messages in thread
* Re: [PATCH v4 0/2] ath10k: device tree support
@ 2014-12-08 15:33 ` Kalle Valo
0 siblings, 0 replies; 24+ messages in thread
From: Kalle Valo @ 2014-12-08 15:33 UTC (permalink / raw)
To: ath10k; +Cc: devicetree, linux-wireless, toshik
Kalle Valo <kvalo@qca.qualcomm.com> writes:
> here's providing ath10k calibration data via device tree support which
> Toshi and me have been working on. Please review.
>
> Device tree maintainers: please review the bindings document
> carefully, this is the first time I have written one.
>
> v4:
>
> * use correct devicetree mailing list address
>
> v3:
>
> * add a debug message to ath10k
>
> * write bindings file
>
> * use ar->dev.of_node instead of pci_device_to_OF_node()
>
> v2:
>
> * fixed a bug that returns an uninitialized value if the node is not
> found
>
> ---
>
> Kalle Valo (1):
> dt: bindings: add ath10k wireless device
>
> Toshi Kikuchi (1):
> ath10k: read calibration data from Device Tree
Both patches applied. Thanks Toshi.
--
Kalle Valo
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH v4 0/2] ath10k: device tree support
@ 2014-12-08 15:33 ` Kalle Valo
0 siblings, 0 replies; 24+ messages in thread
From: Kalle Valo @ 2014-12-08 15:33 UTC (permalink / raw)
To: ath10k; +Cc: devicetree, linux-wireless, toshik
Kalle Valo <kvalo@qca.qualcomm.com> writes:
> here's providing ath10k calibration data via device tree support which
> Toshi and me have been working on. Please review.
>
> Device tree maintainers: please review the bindings document
> carefully, this is the first time I have written one.
>
> v4:
>
> * use correct devicetree mailing list address
>
> v3:
>
> * add a debug message to ath10k
>
> * write bindings file
>
> * use ar->dev.of_node instead of pci_device_to_OF_node()
>
> v2:
>
> * fixed a bug that returns an uninitialized value if the node is not
> found
>
> ---
>
> Kalle Valo (1):
> dt: bindings: add ath10k wireless device
>
> Toshi Kikuchi (1):
> ath10k: read calibration data from Device Tree
Both patches applied. Thanks Toshi.
--
Kalle Valo
_______________________________________________
ath10k mailing list
ath10k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath10k
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH v4 0/2] ath10k: device tree support
@ 2014-12-08 15:33 ` Kalle Valo
0 siblings, 0 replies; 24+ messages in thread
From: Kalle Valo @ 2014-12-08 15:33 UTC (permalink / raw)
To: ath10k-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r
Cc: devicetree-u79uwXL29TY76Z2rM5mHXA,
linux-wireless-u79uwXL29TY76Z2rM5mHXA,
toshik-F7+t8E8rja9g9hUCZPvPmw
Kalle Valo <kvalo-A+ZNKFmMK5xy9aJCnZT0Uw@public.gmane.org> writes:
> here's providing ath10k calibration data via device tree support which
> Toshi and me have been working on. Please review.
>
> Device tree maintainers: please review the bindings document
> carefully, this is the first time I have written one.
>
> v4:
>
> * use correct devicetree mailing list address
>
> v3:
>
> * add a debug message to ath10k
>
> * write bindings file
>
> * use ar->dev.of_node instead of pci_device_to_OF_node()
>
> v2:
>
> * fixed a bug that returns an uninitialized value if the node is not
> found
>
> ---
>
> Kalle Valo (1):
> dt: bindings: add ath10k wireless device
>
> Toshi Kikuchi (1):
> ath10k: read calibration data from Device Tree
Both patches applied. Thanks Toshi.
--
Kalle Valo
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 24+ messages in thread