Commit graph

298 commits

Author SHA1 Message Date
Felix Fietkau
b134891b04 qca-swiss-army-knife: only depend on ath9k header files if ATHEROS is unset
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2012-06-27 17:54:05 -07:00
Felix Fietkau
1430882157 qca-swiss-army-knife: add ar9340 initvals
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2012-06-27 17:54:05 -07:00
Felix Fietkau
19e6bb0bf8 qca-swiss-army-knife: fix .gitignore for initvals
Do not make git ignore the whole directory

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2012-06-27 17:54:05 -07:00
Luis R. Rodriguez
4b2b0847dd qca-swiss-army-knife: update docs to refer to wiki
Documenation should be done on wikis. We just point to the top
level project wiki.

Signed-off-by: Luis R. Rodriguez <mcgrof@frijolero.org>
2012-05-25 12:52:44 -07:00
Luis R. Rodriguez
b14f751cfd qca-swiss-army-knife: halregdump: add original HAL -> CRDA dump code
This adds the code used to do the final work for the Atheros HAL regulatory
dump to a CRDA db.txt. The Atheros HAL regulatory code was the only source
of information we had at that time for regulatory information.

This code is the final resulting work of the changes made to Atheros
HAL code to extract regulatory information using a new format for CRDA.
The hal-reg-dump tool was used to scrape the Atheros HAL for regulatory
informationa and extract it in a legible form.

Putting this on a public tree for historical purposes, the code itself
diverges quite a bit from what was merged on ath9k on 2.6.27 since this
code was written prior that merge effort.

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
2012-05-25 12:46:40 -07:00
Luis R. Rodriguez
e23417edf7 qca-swiss-army-knife: add read-powers support
This python script can be used to read and interpret the power
rate registers for AR9003 using ath9k through debugfs. To use this you
will need applied:

0001-ath9k-Add-debugfs-interface-to-dump-registers.patch

from the crap/ directory of compat-wireless

Usage: cat /sys/kernel/debug/ath9k/phy0/regdump | read-powers

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
2012-05-25 12:43:42 -07:00
Luis R. Rodriguez
e1aae2b82b qca-swiss-army-knife: scripts: add irq-watch
This adds an IRQ watch for the ath9k debugfs interrupt file.

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
2012-05-25 12:43:37 -07:00
Luis R. Rodriguez
fc4d32e21b qca-swiss-army-knife: add tools directory for initvals
We are going to rename this git tree to qca-swiss-army-knife.git
and add more tools, as such lets throw the initvals work into
its own directory and allow for other tools to be thrown in here.
Lets add our own top level copyright license, and a simple README.

Signed-off-by: Luis R. Rodriguez <mcgrof@frijolero.org>
2012-05-25 12:37:52 -07:00
Felix Fietkau
ccacd17a6d atheros-initvals: update and refresh all generated files
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: Luis R. Rodriguez <mcgrof@frijolero.org>
2012-05-14 11:59:59 -07:00
Felix Fietkau
325c1b44a7 atheros-initvals: update copyright notices
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: Luis R. Rodriguez <mcgrof@frijolero.org>
2012-05-14 11:59:39 -07:00
Felix Fietkau
aa57b26ee7 atheros-initvals: drop the "turbo" column for older chipsets, it is unused and unsupported
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: Luis R. Rodriguez <mcgrof@frijolero.org>
2012-05-14 11:59:25 -07:00
Felix Fietkau
e289f46775 atheros-initvals: fix comments for non-fastclock 3-column tables
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: Luis R. Rodriguez <mcgrof@frijolero.org>
2012-05-14 11:58:21 -07:00
Felix Fietkau
67c02b7c59 atheros-initvals: remove the old script for generating ath9k headers
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: Luis R. Rodriguez <mcgrof@frijolero.org>
2012-05-14 11:57:50 -07:00
Felix Fietkau
1be018dfd0 atheros-initvals: add a makefile target for refreshing all initval files
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: Luis R. Rodriguez <mcgrof@frijolero.org>
2012-05-14 11:56:46 -07:00
Sujith Manoharan
c0d380e742 Add AR9462 support.
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: Luis R. Rodriguez <mcgrof@frijolero.org>
2012-05-07 11:09:48 -07:00
Sujith Manoharan
cc5d23a78b Add initvals for AR9462.
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: Luis R. Rodriguez <mcgrof@frijolero.org>
2012-05-07 11:09:37 -07:00
Sujith Manoharan
5382097fce Rename a few functions to map correctly with HAL names.
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: Luis R. Rodriguez <mcgrof@frijolero.org>
2012-05-07 11:09:25 -07:00
Sujith Manoharan
9cb51698c5 Add files to ATHEROS_DEPS.
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: Luis R. Rodriguez <mcgrof@frijolero.org>
2012-05-07 11:09:10 -07:00
Gabor Juhos
8ad9514351 initvals: use SHA1 for verifying initval arrays
The current checksum implementation is broken,
it does not catch all differences in the initval
arrays.

Here is an example:

$ ./verify_checksums.sh ar9330-1p1
ar9330-1p1     3ce64df7a3121eab71a13ba9c8e9d9075ab9bae5 pass
$ cat csumtest.patch | awk '{print "\t"$0}'
	diff --git a/ar9330_1p1_initvals.h b/ar9330_1p1_initvals.h
	index f11d9b2..508df60 100644
	--- a/ar9330_1p1_initvals.h
	+++ b/ar9330_1p1_initvals.h
	@@ -19,7 +19,7 @@

	 static const u32 ar9331_1p1_baseband_postamble[][5] = {
		/*  Addr      5G_HT20     5G_HT40     2G_HT40     2G_HT20  */
	-       {0x00009810, 0xd00a8005, 0xd00a8005, 0xd00a8005, 0xd00a8005},
	+       {0x00009810, 0x110a8005, 0x220a8005, 0x330a8005, 0xd00a8005},
		{0x00009820, 0x206a002e, 0x206a002e, 0x206a002e, 0x206a002e},
		{0x00009824, 0x5ac640d0, 0x5ac640d0, 0x5ac640d0, 0x5ac640d0},
		{0x00009828, 0x06903081, 0x06903081, 0x06903881, 0x06903881},
	@@ -353,7 +353,7 @@ static const u32 ar9331_1p1_xtal_25M[][2] = {

	 static const u32 ar9331_1p1_radio_core[][2] = {
		/* Addr      allmodes  */
	-       {0x00016000, 0x36db6db6},
	+       {0x00016000, 0x00db6db6},
		{0x00016004, 0x6db6db40},
		{0x00016008, 0x73800000},
		{0x0001600c, 0x00000000},
	@@ -377,7 +377,7 @@ static const u32 ar9331_1p1_radio_core[][2] = {
		{0x000160b4, 0x92480040},
		{0x000160c0, 0x006db6db},
		{0x000160c4, 0x0186db60},
	-       {0x000160c8, 0x6db6db6c},
	+       {0x000160c8, 0xffb6db6c},
		{0x000160cc, 0x6de6c300},
		{0x000160d0, 0x14500820},
		{0x00016100, 0x04cb0001},
$ patch < csumtest.patch
patching file ar9330_1p1_initvals.h
$ ./verify_checksums.sh ar9330-1p1
ar9330-1p1     3ce64df7a3121eab71a13ba9c8e9d9075ab9bae5 pass

Although the 'ar9330_1p1_initvals.h' file has been
patched, the checksums are the same in both cases.

This patch uses the SHA1 algorithm to generate hashes
for the initval arrays, and the modifications from above
can be catched with it:

$ ./verify_checksums.sh ar9330-1p1
ar9330-1p1     e2011010f916d63f04bb8f17dbc9b977655a6132 pass
$ patch < csumtest.patch
patching file ar9330_1p1_initvals.h
$ ./verify_checksums.sh ar9330-1p1
ar9330-1p1     e2011010f916d63f04bb8f17dbc9b977655a6132 fail
+921643355e41fca62c2a97221bbd840b2f52d614        ar9331_1p1_baseband_postamble
+f3a229b38e29634251b453334db429887d0da825        ar9331_1p1_radio_core

For the reocrd, with the SHA1 code, verify_checksums.sh
will complain about the following:

$ ./verify_checksums.sh ar5008 ar9001
ar5008         e9b2f3c70ec0b86c9fe2b8611456743ee38f51c2 fail
+c8eae8c7820dded15c9f6e4d491f114faabcf70c        ar5416Common
ar9001         1b4ad3f6abde428039b8f813f9985246ef8b0d00 fail
+253547730d9a29d6236b82946f9a51b76c93041b        ar5416Common_9160

The checksum mismatch is caused by the fact, that the
CRC error fix submitted upstream is not yet present in
Atheros initvals.

The used SHA1 code is in public domain and it has
been taken from the MPICH2 project:

http://trac.mcs.anl.gov/projects/mpich2/export/8501/mpich2/trunk/src/mpi/romio/adio/common/sha1.c
http://trac.mcs.anl.gov/projects/mpich2/export/8501/mpich2/trunk/src/mpi/romio/adio/common/sha1.h

Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
2011-12-21 09:01:18 -08:00
Gabor Juhos
e4fb838fe5 initvals: add script for regenerating ath9k header files
The script helps to regenerate initval header files for ath9k.

screenshot:
$ ./gen_ath9k_headers.sh ar5008
ar5008 => ar5008_initvals.h

$ ./gen_ath9k_headers.sh
ar5008 => ar5008_initvals.h
ar9001 => ar9001_initvals.h
ar9002 => ar9002_initvals.h
ar9003-2p2 => ar9003_2p2_initvals.h
ar9330-1p1 => ar9330_1p1_initvals.h
ar9330-1p2 => ar9330_1p2_initvals.h
ar9485 => ar9485_initvals.h
ar9580-1p0 => ar9580_1p0_initvals.h

Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
2011-12-20 14:00:30 -08:00
Gabor Juhos
1bf8404daf initvals: add a script for simplifying checksum verification
The script helps to verify checksum values between the
atheros and ath9k initvals.

screenshot:
./verify_checksums.sh
ar5008         12f508dd13320697291eacdd276888188ff0bd1c pass
ar9001         b3489b0d3d7e5a20496a133cc36a1c47e42b28f4 pass
ar9002         908154dbc2a659809a32a23f3ee124afd5d20901 pass
ar9003-2p2     52159266be9751dd2fac9e47c92bb3507c5d5a1d pass
ar9330-1p1     3ce64df7a3121eab71a13ba9c8e9d9075ab9bae5 pass
ar9330-1p2     0b90668b470a08b3ae3c24fb3924c7d4401debe7 pass
ar9485         1d4011e162d8349a0b4f2a9dfab86e306ad33cc0 pass
ar9580-1p0     2364145b178ff42b8c5b14879feabd3cda2ca4d3 pass

$ ./verify_checksums.sh  ar5008
ar5008         12f508dd13320697291eacdd276888188ff0bd1c pass
$ vi ar5416.ini
$ ./verify_checksums.sh  ar5008
ar5008         b0df6fd03e1c677d9701524a8eed46d02497ef3d fail
+0x00000000aa44d980        ar5416Modes
+0x000000004d845983        ar5416Common
+0x00000000009fa667        ar5416Addac
$

Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
2011-12-20 14:00:02 -08:00
Gabor Juhos
a528af91b2 initvals: use private chksum variables in INI_PRINT* macros
This allows to simplify *hw_print_initvals functions a bit.

Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
2011-12-20 14:00:02 -08:00
Gabor Juhos
1da0066638 initvals: make 'print_initvals_family' static void
The patch fixes the following warnings
(with CFLAGS=-Wall):

initvals.c:608: warning: return type defaults to ‘int’
initvals.c: In function ‘print_initvals_family’:
initvals.c:670: warning: control reaches end of non-void function

Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
2011-12-20 14:00:02 -08:00
Gabor Juhos
835ef634b2 initvals: include <string.h> to make gcc happy
The patch fixes the following warning
(with CFLAGS=-Wimplicit-function-declaration):

initvals.c: In function ‘print_initvals_family’:
initvals.c:612: warning: implicit declaration of function ‘strncmp’

Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
2011-12-20 14:00:01 -08:00
Gabor Juhos
9d5cddff48 initvals: fix type of the second argument of 'main'
The patch fixes the followinf warning
(with CFLAGS=-Wmain):

initvals.c:673: warning: second argument of ‘main’ should be ‘char **’

Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
2011-12-20 14:00:01 -08:00
Gabor Juhos
3528beae27 initvals: fix printf format warnings
The patch fixes the following warnings
(with CFLAGS=-Wformat):

initvals.c: In function ‘ar5008_hw_print_initvals’:
initvals.c:393: warning: format ‘%ld’ expects type ‘long int’, but argument 2 has type ‘unsigned int’
initvals.c:394: warning: format ‘%ld’ expects type ‘long int’, but argument 2 has type ‘unsigned int’
initvals.c:395: warning: format ‘%ld’ expects type ‘long int’, but argument 2 has type ‘unsigned int’
initvals.c:396: warning: format ‘%ld’ expects type ‘long int’, but argument 2 has type ‘unsigned int’
initvals.c:397: warning: format ‘%ld’ expects type ‘long int’, but argument 2 has type ‘unsigned int’
initvals.c:398: warning: format ‘%ld’ expects type ‘long int’, but argument 2 has type ‘unsigned int’
initvals.c:399: warning: format ‘%ld’ expects type ‘long int’, but argument 2 has type ‘unsigned int’
initvals.c:400: warning: format ‘%ld’ expects type ‘long int’, but argument 2 has type ‘unsigned int’
initvals.c:401: warning: format ‘%ld’ expects type ‘long int’, but argument 2 has type ‘unsigned int’
initvals.c:402: warning: format ‘%ld’ expects type ‘long int’, but argument 2 has type ‘unsigned int’
initvals.c:403: warning: format ‘%ld’ expects type ‘long int’, but argument 2 has type ‘unsigned int’
...

Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
2011-12-20 14:00:01 -08:00
Gabor Juhos
cc078cc435 initvals: remove unused variable
The patch fixes the following warning
(with CFLAGS=-Wunused):

initvals.c: In function ‘ath9k_hw_print_initval’:
initvals.c:315: warning: unused variable ‘chksum’

Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
2011-12-20 14:00:01 -08:00
Gabor Juhos
799e5a6f71 initvals: allow to use additional CFLAGS
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
2011-12-20 14:00:01 -08:00
Gabor Juhos
da6181b5f6 initvals: add checksums for ar9580
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
2011-12-20 14:00:01 -08:00
Gabor Juhos
c0a68c504e initvals: add checksums for AR9330 1.[12]
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
2011-12-20 14:00:01 -08:00
Gabor Juhos
ae62fe9a07 initvals: add ar9485_initvals.h to ATH9K_DEPS
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
2011-12-20 14:00:01 -08:00
Gabor Juhos
3c00c11aa1 initvals: fix copy&paste error
Initvals generates bogus comment in 'ar9485_initvals.h'
due to a copy&paste error.

Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
2011-12-20 14:00:01 -08:00
Gabor Juhos
e34045fcfc initvals: fix typos in usage text
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
2011-12-20 14:00:01 -08:00
Gabor Juhos
fa1bb25456 initvals: add missing include for ar9330
The ar9330_1p2_initvals.h file was missing from commit
0497068591 (initvals: add
ath9k specific initvals for AR9330 1.2)

Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
2011-12-20 14:00:01 -08:00
Gabor Juhos
0497068591 initvals: add ath9k specific initvals for AR9330 1.2
The ar9330_1p2_initvals.h file submitted to ath9k has
been generated manually from the ar9330_12.ini from the
LSDK-WLAN-9.2.0.405.tgz tarball.

Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
2011-12-16 12:53:16 -08:00
Gabor Juhos
d78c388101 initvals: add ath9k specific initvals for AR9330 1.1
The ar9330_1p1_initvals.h file submitted to ath9k has
been generated manually from the ar9330_11.ini from the
LSDK-WLAN-9.2.0.405.tgz tarball.

Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
2011-12-16 12:53:13 -08:00
Gabor Juhos
6a319cf76f initvals: add support for printing one dimensional arrays
It will be used for printing AR9330 specific initvals.

Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
2011-12-16 12:53:10 -08:00
Gabor Juhos
54df26e759 initvals: change year in the licence header to 2011
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
2011-12-16 12:53:08 -08:00
Gabor Juhos
d39360a30a initvals: fix compiler error caused by a missing include
[juhosg@idared initvals-tool]$ make all
gcc  -o initvals initvals.c
initvals.c: In function ‘ar9580_1p0_hw_print_initvals’:
initvals.c:476: error: ‘ar9580_1p0_modes_fast_clock’ undeclared (first use in this function)
initvals.c:476: error: (Each undeclared identifier is reported only once
initvals.c:476: error: for each function it appears in.)
<...>

Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
2011-12-16 12:53:06 -08:00
Gabor Juhos
dbe95a984c initvals: add ar9580_1p0_initvals.h to dependency list
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
2011-12-16 12:53:03 -08:00
Gabor Juhos
7df7efec04 initvals: add ATH9K_DEPS variable to improve Makefile readability
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
2011-12-16 12:53:01 -08:00
Luis R. Rodriguez
8f00794d01 initvals: fix printing of checksums for AR9580
Signed-off-by: Luis R. Rodriguez <mcgrof@qca.qualcomm.com>
2011-08-22 17:32:42 -07:00
Luis R. Rodriguez
8dd4171011 initvals: fix license on ar9580_1p0_initvals.h
We are supposed to use -w to get the license and header crap.

./initvals -w -f ar9580-1p0 > ar9580_1p0_initvals.h

Signed-off-by: Luis R. Rodriguez <mcgrof@qca.qualcomm.com>
2011-08-22 17:01:35 -07:00
Luis R. Rodriguez
a488ecabc8 initvals: add ath9k based AR9580 initvals
This was generated with:

./initvals -f ar9580-1p0 > ar9580_1p0_initvals.h

Signed-off-by: Luis R. Rodriguez <mcgrof@qca.qualcomm.com>
2011-08-22 16:47:47 -07:00
Luis R. Rodriguez
7364aba7d2 initvals: remove emulation arrays for AR9580
Signed-off-by: Luis R. Rodriguez <mcgrof@qca.qualcomm.com>
2011-08-22 16:46:56 -07:00
Luis R. Rodriguez
4e53884ec4 initvals: add support for AR9580 1p0
Signed-off-by: Luis R. Rodriguez <mcgrof@qca.qualcomm.com>
2011-08-22 15:10:55 -07:00
Felix Fietkau
a616f321cf initvals: add AR9485 initvals based on latest from Atheros
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2010-12-13 13:04:26 -08:00
Felix Fietkau
25e0a28348 initvals.c: merge INI_PRINT and INI_CHECK to remove redundant per-family code
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2010-12-13 13:04:26 -08:00
Felix Fietkau
d19f1ba232 initvals.c: remove the unnecessary _cols argument to INI_CHECK and INI_PRINT
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2010-12-13 13:04:26 -08:00
Felix Fietkau
4286ff759a initvals: update AR9003 initvals based on latest from Atheros
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2010-12-13 13:04:26 -08:00