From: Christian Lamparter <chunkeey@googlemail.com>
To: Alban <albeu@free.fr>
Cc: QCA ath9k Development <ath9k-devel@qca.qualcomm.com>,
John Crispin <john@phrozen.org>,
Kalle Valo <kvalo@codeaurora.org>,
linux-wireless@vger.kernel.org, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org, chrisrblake93@gmail.com
Subject: Re: [PATCH 3/7] ath9k: Add support for reading the EEPROM data using the nvmem API
Date: Tue, 14 Mar 2017 00:53:55 +0100 [thread overview]
Message-ID: <1609202.bQK0rlNN3Y@debian64> (raw)
In-Reply-To: <1489439116-4233-3-git-send-email-albeu@free.fr>
On Monday, March 13, 2017 10:05:11 PM CET Alban wrote:
> Currently SoC platforms use a firmware request to get the EEPROM data.
> This is mostly a hack and rely on using a user-helper scripts which is
> deprecated. A nicer alternative is to use the nvmem API which was
> designed for this kind of task.
>
> Furthermore we let CONFIG_ATH9K_AHB select CONFIG_NVMEM as such
> devices will generally use this method for loading the EEPROM data.
>
> Signed-off-by: Alban <albeu@free.fr>
> ---
> @@ -654,6 +656,25 @@ static int ath9k_init_softc(u16 devid, struct ath_softc *sc,
> if (ret)
> return ret;
>
> + /* If the EEPROM hasn't been retrieved via firmware request
> + * use the nvmem API insted.
> + */
> + if (!ah->eeprom_blob) {
> + struct nvmem_cell *eeprom_cell;
> +
> + eeprom_cell = nvmem_cell_get(ah->dev, "eeprom");
> + if (!IS_ERR(eeprom_cell)) {
> + ah->eeprom_data = nvmem_cell_read(
> + eeprom_cell, &ah->eeprom_size);
> + nvmem_cell_put(eeprom_cell);
> +
> + if (IS_ERR(ah->eeprom_data)) {
> + dev_err(ah->dev, "failed to read eeprom");
> + return PTR_ERR(ah->eeprom_data);
> + }
> + }
> + }
> +
> if (ath9k_led_active_high != -1)
> ah->config.led_active_high = ath9k_led_active_high == 1;
>
Are you sure this works with AR93XX SoCs that have the calibration data
in the OTP?
I've added Chris to the CC, since he has a HiveAP 121 that has this
configuration, so he can test, whenever this is a problem or not.
But from what I can tell, devices with the calibration data in the
OTP would fail now. This is because the OTP is done by ath9k_hw_init()
which hasn't run yet (it's a bit further down the road in the same
function though).
Note: the OTP doesn't store the whole caldata. Just a few parts.
A temporary "eeprom" gets constructed with the help of the
ar9300_eep_templates in ar9003_eeprom.c's
ar9300_eeprom_restore_internal(). But from what I don't think,
that the eeprom_blob is constructed/set by the functions in
ar9003_eeprom.
I think this will require an additional property like
qca,calibration-in-otp. What's your opinion?
Thanks,
Christian
next prev parent reply other threads:[~2017-03-13 23:53 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-13 21:05 [PATCH 1/7] Documentation: dt: net: Update the ath9k binding for SoC devices Alban
2017-03-13 21:05 ` [PATCH 2/7] ath9k: ahb: Add OF support Alban
2017-03-14 11:17 ` Sergei Shtylyov
2017-03-13 21:05 ` [PATCH 3/7] ath9k: Add support for reading the EEPROM data using the nvmem API Alban
2017-03-13 22:17 ` Rafał Miłecki
2017-03-13 23:53 ` Christian Lamparter [this message]
2017-03-23 14:43 ` Alban
2017-03-24 16:24 ` Christian Lamparter
2017-03-24 16:24 ` Christian Lamparter
2017-03-13 21:05 ` [PATCH 4/7] ath9k: Add support for reading the MAC address with nvmem Alban
2017-03-13 21:05 ` [PATCH 5/7] ath9k: of: Use the clk API to get the reference clock rate Alban
2017-03-13 22:17 ` Rafał Miłecki
2017-03-13 21:05 ` [PATCH 6/7] ath9k: Allow using the reset API for the external reset Alban
2017-03-13 21:05 ` [PATCH 7/7] ath9k: hw: Reset the device with the external reset before init Alban
2017-03-20 22:06 ` [PATCH 1/7] Documentation: dt: net: Update the ath9k binding for SoC devices Rob Herring
2017-03-27 16:11 ` Christian Lamparter
2017-03-28 8:44 ` Alban
2017-03-28 8:44 ` Alban
2017-03-28 14:53 ` Christian Lamparter
2017-03-28 15:18 ` Andrew Lunn
2017-03-28 15:18 ` Andrew Lunn
2017-03-28 16:21 ` Christian Lamparter
2017-03-28 16:41 ` Andrew Lunn
2017-03-28 17:09 ` Christian Lamparter
2017-03-28 17:09 ` Christian Lamparter
2017-04-05 10:09 ` Kalle Valo
2017-04-05 10:09 ` 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=1609202.bQK0rlNN3Y@debian64 \
--to=chunkeey@googlemail.com \
--cc=albeu@free.fr \
--cc=ath9k-devel@qca.qualcomm.com \
--cc=chrisrblake93@gmail.com \
--cc=john@phrozen.org \
--cc=kvalo@codeaurora.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=netdev@vger.kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.