diff mbox series

[v6,1/3] dt-bindings: net: add mt76 wireless device binding

Message ID 20171006110249.31013-2-nbd@nbd.name
State Changes Requested, archived
Headers show
Series [v6,1/3] dt-bindings: net: add mt76 wireless device binding | expand

Commit Message

Felix Fietkau Oct. 6, 2017, 11:02 a.m. UTC
Add documentation describing how device tree can be used to configure
wireless chips supported by the mt76 driver.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
---
 .../bindings/net/wireless/mediatek,mt76.txt        | 24 ++++++++++++++++++++++
 1 file changed, 24 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/net/wireless/mediatek,mt76.txt

Comments

Rob Herring Oct. 13, 2017, 7:07 p.m. UTC | #1
On Fri, Oct 06, 2017 at 01:02:47PM +0200, Felix Fietkau wrote:
> Add documentation describing how device tree can be used to configure
> wireless chips supported by the mt76 driver.
> 
> Signed-off-by: Felix Fietkau <nbd@nbd.name>
> ---
>  .../bindings/net/wireless/mediatek,mt76.txt        | 24 ++++++++++++++++++++++
>  1 file changed, 24 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/net/wireless/mediatek,mt76.txt
> 
> diff --git a/Documentation/devicetree/bindings/net/wireless/mediatek,mt76.txt b/Documentation/devicetree/bindings/net/wireless/mediatek,mt76.txt
> new file mode 100644
> index 000000000000..19522ab97d62
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/net/wireless/mediatek,mt76.txt
> @@ -0,0 +1,24 @@
> +* MediaTek mt76xx devices
> +
> +This node provides properties for configuring the MediaTek mt76xx wireless
> +device. The node is expected to be specified as a child node of the PCI
> +controller to which the wireless chip is connected.
> +
> +Optional properties:
> +
> +- mac-address: See ethernet.txt in the parent directory
> +- local-mac-address: See ethernet.txt in the parent directory
> +- ieee80211-freq-limit: See ieee80211.txt
> +- mediatek,mtd-eeprom: Specify a MTD partition + offset containing EEPROM data

MTD is a Linuxism. And is an EEPROM the only supported device? I'd 
suggest naming if after what the data contains.

> +
> +&pcie {
> +	status = "okay";

Don't show status in examples.

> +
> +	pcie0 {
> +		wifi@0,0 {

You need a compatible here too.

> +			reg = <0x0000 0 0 0 0>;
> +			ieee80211-freq-limit = <5000000 6000000>;
> +			mediatek,mtd-eeprom = <&factory 0x8000>;
> +		};
> +	};
> +};
> -- 
> 2.14.2
> 
> --
> To unsubscribe from this list: send the line "unsubscribe devicetree" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Felix Fietkau Oct. 14, 2017, 7:20 a.m. UTC | #2
On 2017-10-13 21:07, Rob Herring wrote:
> On Fri, Oct 06, 2017 at 01:02:47PM +0200, Felix Fietkau wrote:
>> Add documentation describing how device tree can be used to configure
>> wireless chips supported by the mt76 driver.
>> 
>> Signed-off-by: Felix Fietkau <nbd@nbd.name>
>> ---
>>  .../bindings/net/wireless/mediatek,mt76.txt        | 24 ++++++++++++++++++++++
>>  1 file changed, 24 insertions(+)
>>  create mode 100644 Documentation/devicetree/bindings/net/wireless/mediatek,mt76.txt
>> 
>> diff --git a/Documentation/devicetree/bindings/net/wireless/mediatek,mt76.txt b/Documentation/devicetree/bindings/net/wireless/mediatek,mt76.txt
>> new file mode 100644
>> index 000000000000..19522ab97d62
>> --- /dev/null
>> +++ b/Documentation/devicetree/bindings/net/wireless/mediatek,mt76.txt
>> @@ -0,0 +1,24 @@
>> +* MediaTek mt76xx devices
>> +
>> +This node provides properties for configuring the MediaTek mt76xx wireless
>> +device. The node is expected to be specified as a child node of the PCI
>> +controller to which the wireless chip is connected.
>> +
>> +Optional properties:
>> +
>> +- mac-address: See ethernet.txt in the parent directory
>> +- local-mac-address: See ethernet.txt in the parent directory
>> +- ieee80211-freq-limit: See ieee80211.txt
>> +- mediatek,mtd-eeprom: Specify a MTD partition + offset containing EEPROM data
> 
> MTD is a Linuxism. And is an EEPROM the only supported device? I'd 
> suggest naming if after what the data contains.
PCI cards with this kind of wireless chip usually come with some form of
EEPROM or use the on-chip OTP ROM.
This property is for the case where the chip is built into an embedded
device and the data that would otherwise be on an EEPROM is stored on a
MTD partition instead.
The EEPROM data itself contains multiple things: calibration data,
hardware capabilities, MAC address, etc.
I couldn't think of a better name for it, do you have any suggestions?

- Felix
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Christian Lamparter Oct. 14, 2017, 3:43 p.m. UTC | #3
On Saturday, October 14, 2017 9:20:46 AM CEST Felix Fietkau wrote:
> On 2017-10-13 21:07, Rob Herring wrote:
> > On Fri, Oct 06, 2017 at 01:02:47PM +0200, Felix Fietkau wrote:
> >> Add documentation describing how device tree can be used to configure
> >> wireless chips supported by the mt76 driver.
> >> 
> >> Signed-off-by: Felix Fietkau <nbd@nbd.name>
> >> ---
> >>  .../bindings/net/wireless/mediatek,mt76.txt        | 24 ++++++++++++++++++++++
> >>  1 file changed, 24 insertions(+)
> >>  create mode 100644 Documentation/devicetree/bindings/net/wireless/mediatek,mt76.txt
> >> 
> >> diff --git a/Documentation/devicetree/bindings/net/wireless/mediatek,mt76.txt b/Documentation/devicetree/bindings/net/wireless/mediatek,mt76.txt
> >> new file mode 100644
> >> index 000000000000..19522ab97d62
> >> --- /dev/null
> >> +++ b/Documentation/devicetree/bindings/net/wireless/mediatek,mt76.txt
> >> @@ -0,0 +1,24 @@
> >> +* MediaTek mt76xx devices
> >> +
> >> +This node provides properties for configuring the MediaTek mt76xx wireless
> >> +device. The node is expected to be specified as a child node of the PCI
> >> +controller to which the wireless chip is connected.
> >> +
> >> +Optional properties:
> >> +
> >> +- mac-address: See ethernet.txt in the parent directory
> >> +- local-mac-address: See ethernet.txt in the parent directory
> >> +- ieee80211-freq-limit: See ieee80211.txt
> >> +- mediatek,mtd-eeprom: Specify a MTD partition + offset containing EEPROM data
> > 
> > MTD is a Linuxism. And is an EEPROM the only supported device? I'd 
> > suggest naming if after what the data contains.
> PCI cards with this kind of wireless chip usually come with some form of
> EEPROM or use the on-chip OTP ROM.
> This property is for the case where the chip is built into an embedded
> device and the data that would otherwise be on an EEPROM is stored on a
> MTD partition instead.
> The EEPROM data itself contains multiple things: calibration data,
> hardware capabilities, MAC address, etc.
> I couldn't think of a better name for it, do you have any suggestions?
This sort of reminds me of the failed ath9k nvmem patches:
https://patchwork.kernel.org/patch/9622127/

Which uses the nvmem system.

https://github.com/torvalds/linux/blob/master/Documentation/nvmem/nvmem.txt

Rob, would this be acceptable?

Regards,
Christian
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Rob Herring Oct. 18, 2017, 2:02 a.m. UTC | #4
On Sat, Oct 14, 2017 at 10:43 AM, Christian Lamparter
<chunkeey@gmail.com> wrote:
> On Saturday, October 14, 2017 9:20:46 AM CEST Felix Fietkau wrote:
>> On 2017-10-13 21:07, Rob Herring wrote:
>> > On Fri, Oct 06, 2017 at 01:02:47PM +0200, Felix Fietkau wrote:
>> >> Add documentation describing how device tree can be used to configure
>> >> wireless chips supported by the mt76 driver.
>> >>
>> >> Signed-off-by: Felix Fietkau <nbd@nbd.name>
>> >> ---
>> >>  .../bindings/net/wireless/mediatek,mt76.txt        | 24 ++++++++++++++++++++++
>> >>  1 file changed, 24 insertions(+)
>> >>  create mode 100644 Documentation/devicetree/bindings/net/wireless/mediatek,mt76.txt
>> >>
>> >> diff --git a/Documentation/devicetree/bindings/net/wireless/mediatek,mt76.txt b/Documentation/devicetree/bindings/net/wireless/mediatek,mt76.txt
>> >> new file mode 100644
>> >> index 000000000000..19522ab97d62
>> >> --- /dev/null
>> >> +++ b/Documentation/devicetree/bindings/net/wireless/mediatek,mt76.txt
>> >> @@ -0,0 +1,24 @@
>> >> +* MediaTek mt76xx devices
>> >> +
>> >> +This node provides properties for configuring the MediaTek mt76xx wireless
>> >> +device. The node is expected to be specified as a child node of the PCI
>> >> +controller to which the wireless chip is connected.
>> >> +
>> >> +Optional properties:
>> >> +
>> >> +- mac-address: See ethernet.txt in the parent directory
>> >> +- local-mac-address: See ethernet.txt in the parent directory
>> >> +- ieee80211-freq-limit: See ieee80211.txt
>> >> +- mediatek,mtd-eeprom: Specify a MTD partition + offset containing EEPROM data
>> >
>> > MTD is a Linuxism. And is an EEPROM the only supported device? I'd
>> > suggest naming if after what the data contains.
>> PCI cards with this kind of wireless chip usually come with some form of
>> EEPROM or use the on-chip OTP ROM.
>> This property is for the case where the chip is built into an embedded
>> device and the data that would otherwise be on an EEPROM is stored on a
>> MTD partition instead.
>> The EEPROM data itself contains multiple things: calibration data,
>> hardware capabilities, MAC address, etc.
>> I couldn't think of a better name for it, do you have any suggestions?

Naming is hard.

> This sort of reminds me of the failed ath9k nvmem patches:
> https://patchwork.kernel.org/patch/9622127/
>
> Which uses the nvmem system.
>
> https://github.com/torvalds/linux/blob/master/Documentation/nvmem/nvmem.txt
>
> Rob, would this be acceptable?

Yeah, alignment with other drivers is a good thing.

Rob
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Felix Fietkau Oct. 18, 2017, 6:47 a.m. UTC | #5
On 2017-10-18 04:02, Rob Herring wrote:
> On Sat, Oct 14, 2017 at 10:43 AM, Christian Lamparter
> <chunkeey@gmail.com> wrote:
>> On Saturday, October 14, 2017 9:20:46 AM CEST Felix Fietkau wrote:
>>> On 2017-10-13 21:07, Rob Herring wrote:
>>> > On Fri, Oct 06, 2017 at 01:02:47PM +0200, Felix Fietkau wrote:
>>> >> Add documentation describing how device tree can be used to configure
>>> >> wireless chips supported by the mt76 driver.
>>> >>
>>> >> Signed-off-by: Felix Fietkau <nbd@nbd.name>
>>> >> ---
>>> >>  .../bindings/net/wireless/mediatek,mt76.txt        | 24 ++++++++++++++++++++++
>>> >>  1 file changed, 24 insertions(+)
>>> >>  create mode 100644 Documentation/devicetree/bindings/net/wireless/mediatek,mt76.txt
>>> >>
>>> >> diff --git a/Documentation/devicetree/bindings/net/wireless/mediatek,mt76.txt b/Documentation/devicetree/bindings/net/wireless/mediatek,mt76.txt
>>> >> new file mode 100644
>>> >> index 000000000000..19522ab97d62
>>> >> --- /dev/null
>>> >> +++ b/Documentation/devicetree/bindings/net/wireless/mediatek,mt76.txt
>>> >> @@ -0,0 +1,24 @@
>>> >> +* MediaTek mt76xx devices
>>> >> +
>>> >> +This node provides properties for configuring the MediaTek mt76xx wireless
>>> >> +device. The node is expected to be specified as a child node of the PCI
>>> >> +controller to which the wireless chip is connected.
>>> >> +
>>> >> +Optional properties:
>>> >> +
>>> >> +- mac-address: See ethernet.txt in the parent directory
>>> >> +- local-mac-address: See ethernet.txt in the parent directory
>>> >> +- ieee80211-freq-limit: See ieee80211.txt
>>> >> +- mediatek,mtd-eeprom: Specify a MTD partition + offset containing EEPROM data
>>> >
>>> > MTD is a Linuxism. And is an EEPROM the only supported device? I'd
>>> > suggest naming if after what the data contains.
>>> PCI cards with this kind of wireless chip usually come with some form of
>>> EEPROM or use the on-chip OTP ROM.
>>> This property is for the case where the chip is built into an embedded
>>> device and the data that would otherwise be on an EEPROM is stored on a
>>> MTD partition instead.
>>> The EEPROM data itself contains multiple things: calibration data,
>>> hardware capabilities, MAC address, etc.
>>> I couldn't think of a better name for it, do you have any suggestions?
> 
> Naming is hard.
> 
>> This sort of reminds me of the failed ath9k nvmem patches:
>> https://patchwork.kernel.org/patch/9622127/
>>
>> Which uses the nvmem system.
>>
>> https://github.com/torvalds/linux/blob/master/Documentation/nvmem/nvmem.txt
>>
>> Rob, would this be acceptable?
> 
> Yeah, alignment with other drivers is a good thing.
This depends on another round of patches which also never made it 
upstream and from reading the thread[1], I'm not actually sure what's 
missing, or what should be changed.

I'm also not convinced that this makes things better in any meaningful 
way. It pulls in extra dependencies (nvmem subsystem), which means 
more kernel bloat for embedded systems, which are currently the only
ones that even need this.

Would it be acceptable to you if I submit an updated version that fixes 
the other things you pointed out?

- Felix

[1]: http://lists.infradead.org/pipermail/linux-mtd/2017-March/072541.html
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/net/wireless/mediatek,mt76.txt b/Documentation/devicetree/bindings/net/wireless/mediatek,mt76.txt
new file mode 100644
index 000000000000..19522ab97d62
--- /dev/null
+++ b/Documentation/devicetree/bindings/net/wireless/mediatek,mt76.txt
@@ -0,0 +1,24 @@ 
+* MediaTek mt76xx devices
+
+This node provides properties for configuring the MediaTek mt76xx wireless
+device. The node is expected to be specified as a child node of the PCI
+controller to which the wireless chip is connected.
+
+Optional properties:
+
+- mac-address: See ethernet.txt in the parent directory
+- local-mac-address: See ethernet.txt in the parent directory
+- ieee80211-freq-limit: See ieee80211.txt
+- mediatek,mtd-eeprom: Specify a MTD partition + offset containing EEPROM data
+
+&pcie {
+	status = "okay";
+
+	pcie0 {
+		wifi@0,0 {
+			reg = <0x0000 0 0 0 0>;
+			ieee80211-freq-limit = <5000000 6000000>;
+			mediatek,mtd-eeprom = <&factory 0x8000>;
+		};
+	};
+};