Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1543375 > unrolled thread
| Started by | Pali Rohár <pali.rohar@gmail.com> |
|---|---|
| First post | 2016-12-16 12:10 +0100 |
| Last post | 2016-12-24 14:00 +0100 |
| Articles | 7 — 2 participants |
Back to article view | Back to linux.kernel
wl1251 NVS calibration data format Pali Rohár <pali.rohar@gmail.com> - 2016-12-16 12:10 +0100
Re: wl1251 NVS calibration data format Pali Rohár <pali.rohar@gmail.com> - 2016-12-16 12:20 +0100
Re: wl1251 NVS calibration data format Sebastian Reichel <sre@kernel.org> - 2016-12-17 10:40 +0100
Re: wl1251 NVS calibration data format Pali Rohár <pali.rohar@gmail.com> - 2016-12-17 12:20 +0100
Re: wl1251 NVS calibration data format Sebastian Reichel <sre@kernel.org> - 2016-12-17 13:10 +0100
MAC address in wl1251 NVS data (Was: Re: wl1251 NVS calibration data format) Pali Rohár <pali.rohar@gmail.com> - 2016-12-17 14:20 +0100
Re: wl1251 NVS calibration data format Pali Rohár <pali.rohar@gmail.com> - 2016-12-24 14:00 +0100
| From | Pali Rohár <pali.rohar@gmail.com> |
|---|---|
| Date | 2016-12-16 12:10 +0100 |
| Subject | wl1251 NVS calibration data format |
| Message-ID | <sOYyK-2L0-49@gated-at.bofh.it> |
[Multipart message — attachments visible in raw view] — view raw
Hi! Do you know format of wl1251 NVS calibration data file? I found that there is tool for changing NVS file for wl1271 and newer chips (so not for wl1251!) at: https://github.com/gxk/ti-utils And wl1271 has in NVS data already place for MAC address. And in wlcore (for wl1271 and newer) there is really kernel code which is doing something with MAC address in NVS, see: https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/drivers/net/wireless/ti/wlcore/boot.c#n352 So... I would like to know if in wl1251 NVS calibration file is also some place for MAC address or not. Default wl1251 NVS calibration file is available in linux-firmware: https://git.kernel.org/cgit/linux/kernel/git/firmware/linux-firmware.git/tree/ti-connectivity/wl1251-nvs.bin -- Pali Rohár pali.rohar@gmail.com
[toc] | [next] | [standalone]
| From | Pali Rohár <pali.rohar@gmail.com> |
|---|---|
| Date | 2016-12-16 12:20 +0100 |
| Message-ID | <sOYIq-2PB-25@gated-at.bofh.it> |
| In reply to | #1543375 |
[Multipart message — attachments visible in raw view] — view raw
Resending email to new Gery's address... On Friday 16 December 2016 12:01:48 Pali Rohár wrote: > Hi! Do you know format of wl1251 NVS calibration data file? > > I found that there is tool for changing NVS file for wl1271 and newer > chips (so not for wl1251!) at: https://github.com/gxk/ti-utils > > And wl1271 has in NVS data already place for MAC address. And in wlcore > (for wl1271 and newer) there is really kernel code which is doing > something with MAC address in NVS, see: > https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/drivers/net/wireless/ti/wlcore/boot.c#n352 Also, there is parsing MAC address from NVS wl1271 data: https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/drivers/net/wireless/ti/wlcore/main.c#n6009 > So... I would like to know if in wl1251 NVS calibration file is also > some place for MAC address or not. > > Default wl1251 NVS calibration file is available in linux-firmware: > https://git.kernel.org/cgit/linux/kernel/git/firmware/linux-firmware.git/tree/ti-connectivity/wl1251-nvs.bin -- Pali Rohár pali.rohar@gmail.com
[toc] | [prev] | [next] | [standalone]
| From | Sebastian Reichel <sre@kernel.org> |
|---|---|
| Date | 2016-12-17 10:40 +0100 |
| Message-ID | <sPjDb-7R9-11@gated-at.bofh.it> |
| In reply to | #1543375 |
[Multipart message — attachments visible in raw view] — view raw
Hi, On Fri, Dec 16, 2016 at 12:01:48PM +0100, Pali Rohár wrote: > Hi! Do you know format of wl1251 NVS calibration data file? > > I found that there is tool for changing NVS file for wl1271 and newer > chips (so not for wl1251!) at: https://github.com/gxk/ti-utils > > And wl1271 has in NVS data already place for MAC address. And in wlcore > (for wl1271 and newer) there is really kernel code which is doing > something with MAC address in NVS, see: > https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/drivers/net/wireless/ti/wlcore/boot.c#n352 > > So... I would like to know if in wl1251 NVS calibration file is also > some place for MAC address or not. > > Default wl1251 NVS calibration file is available in linux-firmware: > https://git.kernel.org/cgit/linux/kernel/git/firmware/linux-firmware.git/tree/ti-connectivity/wl1251-nvs.bin Pandora people [0] have a description of the format at [1]. [0] https://pandorawiki.org/WiFi [1] http://notaz.gp2x.de/misc/pnd/wl1251/nvs_map.txt -- Sebastian
[toc] | [prev] | [next] | [standalone]
| From | Pali Rohár <pali.rohar@gmail.com> |
|---|---|
| Date | 2016-12-17 12:20 +0100 |
| Message-ID | <sPlbX-tx-3@gated-at.bofh.it> |
| In reply to | #1543947 |
[Multipart message — attachments visible in raw view] — view raw
On Saturday 17 December 2016 10:37:05 Sebastian Reichel wrote: > Hi, > > On Fri, Dec 16, 2016 at 12:01:48PM +0100, Pali Rohár wrote: > > Hi! Do you know format of wl1251 NVS calibration data file? > > > > I found that there is tool for changing NVS file for wl1271 and > > newer chips (so not for wl1251!) at: > > https://github.com/gxk/ti-utils > > > > And wl1271 has in NVS data already place for MAC address. And in > > wlcore (for wl1271 and newer) there is really kernel code which is > > doing something with MAC address in NVS, see: > > https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tre > > e/drivers/net/wireless/ti/wlcore/boot.c#n352 > > > > So... I would like to know if in wl1251 NVS calibration file is > > also some place for MAC address or not. > > > > Default wl1251 NVS calibration file is available in linux-firmware: > > https://git.kernel.org/cgit/linux/kernel/git/firmware/linux-firmwar > > e.git/tree/ti-connectivity/wl1251-nvs.bin > > Pandora people [0] have a description of the format at [1]. > > [0] https://pandorawiki.org/WiFi > [1] http://notaz.gp2x.de/misc/pnd/wl1251/nvs_map.txt Thank you very very much! I tried to search for something, but I have not find anything. In that description is something about STA mac address: 01a 6d //STA_ADDR_L Register Address. (STA MAC Address) 01b 54 // 01c 00 //STA_ADDR_L Register 01d 00 // 01e 32 // 01f 28 // 020 00 //STA_ADDR_H Register Data. STA would be abbreviation for station and so it should be really set to mac address of that chip? If yes, that could allow us to set permanent MAC address at time when loading & sending NVS calibration data... Exactly same as wl1271 and new drivers are working. I will try to play with driver if it is really truth! I already looked into original TI's multiplatform HAL driver for wl1251 chip (big mess) and found there that there is wl1251 command to read mac address from chip. It could be done by this wl1251 function: wl1251_cmd_interrogate(wl, DOT11_STATION_ID, mac, sizeof(*mac)) (same id as for setting permanent mac address, but opposite to read it) -- Pali Rohár pali.rohar@gmail.com
[toc] | [prev] | [next] | [standalone]
| From | Sebastian Reichel <sre@kernel.org> |
|---|---|
| Date | 2016-12-17 13:10 +0100 |
| Message-ID | <sPlYl-10x-13@gated-at.bofh.it> |
| In reply to | #1543955 |
[Multipart message — attachments visible in raw view] — view raw
Hi, On Sat, Dec 17, 2016 at 12:14:50PM +0100, Pali Rohár wrote: > On Saturday 17 December 2016 10:37:05 Sebastian Reichel wrote: > > On Fri, Dec 16, 2016 at 12:01:48PM +0100, Pali Rohár wrote: > > > Hi! Do you know format of wl1251 NVS calibration data file? > > > > > > I found that there is tool for changing NVS file for wl1271 and > > > newer chips (so not for wl1251!) at: > > > https://github.com/gxk/ti-utils > > > > > > And wl1271 has in NVS data already place for MAC address. And in > > > wlcore (for wl1271 and newer) there is really kernel code which is > > > doing something with MAC address in NVS, see: > > > https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tre > > > e/drivers/net/wireless/ti/wlcore/boot.c#n352 > > > > > > So... I would like to know if in wl1251 NVS calibration file is > > > also some place for MAC address or not. > > > > > > Default wl1251 NVS calibration file is available in linux-firmware: > > > https://git.kernel.org/cgit/linux/kernel/git/firmware/linux-firmwar > > > e.git/tree/ti-connectivity/wl1251-nvs.bin > > > > Pandora people [0] have a description of the format at [1]. > > > > [0] https://pandorawiki.org/WiFi > > [1] http://notaz.gp2x.de/misc/pnd/wl1251/nvs_map.txt > > Thank you very very much! You are welcome. > I tried to search for something, but I have not find anything. > In that description is something about STA mac address: > > 01a 6d //STA_ADDR_L Register Address. (STA MAC Address) > 01b 54 // > 01c 00 //STA_ADDR_L Register > 01d 00 // > 01e 32 // > 01f 28 // > 020 00 //STA_ADDR_H Register Data. > > STA would be abbreviation for station and so it should be really set to > mac address of that chip? Yes, STA is a common abbreviation: https://en.wikipedia.org/wiki/Station_(networking) > If yes, that could allow us to set permanent MAC address at time when > loading & sending NVS calibration data... Exactly same as wl1271 and new > drivers are working. > > I will try to play with driver if it is really truth! Thanks for your work. > I already looked into original TI's multiplatform HAL driver for wl1251 > chip (big mess) and found there that there is wl1251 command to read mac > address from chip. It could be done by this wl1251 function: > > wl1251_cmd_interrogate(wl, DOT11_STATION_ID, mac, sizeof(*mac)) > > (same id as for setting permanent mac address, but opposite to read it) -- Sebastian
[toc] | [prev] | [next] | [standalone]
| From | Pali Rohár <pali.rohar@gmail.com> |
|---|---|
| Date | 2016-12-17 14:20 +0100 |
| Subject | MAC address in wl1251 NVS data (Was: Re: wl1251 NVS calibration data format) |
| Message-ID | <sPn45-1Ge-13@gated-at.bofh.it> |
| In reply to | #1543962 |
[Multipart message — attachments visible in raw view] — view raw
> On Sat, Dec 17, 2016 at 12:14:50PM +0100, Pali Rohár wrote:
> > > [1] http://notaz.gp2x.de/misc/pnd/wl1251/nvs_map.txt
> > In that description is something about STA mac address:
> >
019 02 //length
> > 01a 6d //STA_ADDR_L Register Address. (STA MAC
> > Address)
> > 01b 54 //
> > 01c 00 //STA_ADDR_L Register
> > 01d 00 //
> > 01e 32 //
> > 01f 28 //
> > 020 00 //STA_ADDR_H Register Data.
021 08 //
022 00 //
023 00 //
So... above data means:
019 - number of words
01a - low bits of offset applied with mask 0xfe
01b - high bits of offset
01c-01f first word
020-023 second word
Interpreted as: at address offset 0x536c are written two words
0x28320000 and 0x00000800
wl1271 driver has in linux/drivers/net/wireless/ti/wlcore/boot.c this:
/* update current MAC address to NVS */
nvs_ptr[11] = wl->addresses[0].addr[0];
nvs_ptr[10] = wl->addresses[0].addr[1];
nvs_ptr[6] = wl->addresses[0].addr[2];
nvs_ptr[5] = wl->addresses[0].addr[3];
nvs_ptr[4] = wl->addresses[0].addr[4];
nvs_ptr[3] = wl->addresses[0].addr[5];
Looking at wl1271-nvs.bin file (which is "modified" in kernel by boot.c)
000: 01
001: 6d
002: 54
003: 00
004: 00
005: ef
006: be
Means: at address offset 0x536c is written one word 0xBEEF0000
007: 01
008: 71
009: 54
00a: ad
00b: de
00c: 00
00d: 00
Means: at address offset 0x5371 is written one word 0x0000DEAD
Above boot.c kernel code updates those data to MAC address, so at
address offset 0x536c is written four low bytes of MAC address and to
0x5371 are written remaining two bytes. So 00:00:DE:AD:BE:EF
So conclusion: address offset for wl1271 (where is written MAC address)
is exactly same as for wl1251 which is marked in that documentation as
STA_ADDR_L Register.
Btw, in our wl1251-nvs.bin found in Maemo rootfs, which is exactly same
as in linux-firmware.git tree there are those data:
019: 02
01a: 6d
01b: 54
01c: 09
01d: 03
01e: 07
01f: 20
020: 00
021: 00
022: 00
023: 00
So hardcoded MAC address in wl1251-nvs.bin is: 00:00:20:07:03:09. Which
is assigned to DIAB. Strange that it is not TI...
--
Pali Rohár
pali.rohar@gmail.com
[toc] | [prev] | [next] | [standalone]
| From | Pali Rohár <pali.rohar@gmail.com> |
|---|---|
| Date | 2016-12-24 14:00 +0100 |
| Message-ID | <sRU5E-734-3@gated-at.bofh.it> |
| In reply to | #1543955 |
[Multipart message — attachments visible in raw view] — view raw
On Saturday 17 December 2016 12:14:50 Pali Rohár wrote: > I will try to play with driver if it is really truth! > > I already looked into original TI's multiplatform HAL driver for > wl1251 chip (big mess) and found there that there is wl1251 command > to read mac address from chip. It could be done by this wl1251 > function: > > wl1251_cmd_interrogate(wl, DOT11_STATION_ID, mac, sizeof(*mac)) > > (same id as for setting permanent mac address, but opposite to read > it) Confirmed! Calling that function (before setting real linux mac address) returns MAC address 00:00:20:07:03:09. Changing NVS data at position 0x1c-0x21 changes also what above function returns. So really at position 0x1c-0x21 in NVS data is stored MAC address (in reverse order). Just default is some unknown 00:00:20:07:03:09. So MAC address is really part of NVS data. -- Pali Rohár pali.rohar@gmail.com
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web