From: Lorenzo Bianconi <lorenzo@kernel.org>
To: Kalle Valo <kvalo@codeaurora.org>
Cc: nbd@nbd.name, linux-wireless@vger.kernel.org,
lorenzo.bianconi@redhat.com,
kevin.patrick.schmidt@googlemail.com
Subject: Re: [PATCH] mt76: eeprom: add support for big endian eeprom partition
Date: Mon, 25 Nov 2019 15:59:22 +0200 [thread overview]
Message-ID: <20191125135922.GC3528@localhost.localdomain> (raw)
In-Reply-To: <87k17o83lk.fsf@tynnyri.adurom.net>
[-- Attachment #1: Type: text/plain, Size: 1550 bytes --]
> Lorenzo Bianconi <lorenzo@kernel.org> writes:
>
> > mt76x0e users reported some devices (e.g TP-Link Archer VR200v) have
> > been flashed with big endian radio partition. Add the possibility to
> > specify eeprom endianness using big-endian dts property and in case
> > covert eeprom data in little endian
> >
> > Tested-by: Kevin Schmidt <kevin.patrick.schmidt@googlemail.com>
> > Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
> > ---
> > drivers/net/wireless/mediatek/mt76/eeprom.c | 10 ++++++++++
> > 1 file changed, 10 insertions(+)
> >
> > diff --git a/drivers/net/wireless/mediatek/mt76/eeprom.c b/drivers/net/wireless/mediatek/mt76/eeprom.c
> > index 804224e81103..33d992d5662a 100644
> > --- a/drivers/net/wireless/mediatek/mt76/eeprom.c
> > +++ b/drivers/net/wireless/mediatek/mt76/eeprom.c
> > @@ -64,6 +64,16 @@ mt76_get_of_eeprom(struct mt76_dev *dev, int len)
> > goto out_put_node;
> > }
> >
> > + if (of_property_read_bool(dev->dev->of_node, "big-endian")) {
> > + u8 *data = (u8 *)dev->eeprom.data;
> > + int i;
> > +
> > + /* convert eeprom data in Little Endian */
> > + for (i = 0; i < round_down(len, 2); i += 2)
> > + put_unaligned_le16(get_unaligned_be16(&data[i]),
> > + &data[i]);
> > + }
>
> What about the bindings documentation? I don't see this "big-endian"
> documented in the mt76 doc, at least.
Right, I will fold a patch for it in v2.
Regards,
Lorenzo
>
> --
> https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
next prev parent reply other threads:[~2019-11-25 13:59 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-11-23 9:54 [PATCH] mt76: eeprom: add support for big endian eeprom partition Lorenzo Bianconi
2019-11-25 13:53 ` Kalle Valo
[not found] ` <87k17o83lk.fsf@tynnyri.adurom.net>
2019-11-25 13:59 ` Lorenzo Bianconi [this message]
2019-11-25 14:17 ` Kalle Valo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20191125135922.GC3528@localhost.localdomain \
--to=lorenzo@kernel.org \
--cc=kevin.patrick.schmidt@googlemail.com \
--cc=kvalo@codeaurora.org \
--cc=linux-wireless@vger.kernel.org \
--cc=lorenzo.bianconi@redhat.com \
--cc=nbd@nbd.name \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox