Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
#AP6210_NVRAM_V1.2_03192013
manfid=0x2d0
prodid=0x492
vendid=0x14e4
devid=0x4343
boardtype=0x0598

# Board Revision is P307, same nvram file can be used for P304, P305, P306 and P307 as the tssi pa params used are same
#Please force the automatic RX PER data to the respective board directory if not using P307 board, for e.g. for P305 boards force the data into the following directory /projects/BCM43362/a1_labdata/boardtests/results/sdg_rev0305
boardrev=0x1307
boardnum=777
xtalfreq=26000
boardflags=0x80201
boardflags2=0x80
sromrev=3
wl0id=0x431b
macaddr=00:90:4c:07:71:12
aa2g=1
ag0=2
maxp2ga0=74
cck2gpo=0x2222
ofdm2gpo=0x44444444
mcs2gpo0=0x6666
mcs2gpo1=0x6666
pa0maxpwr=56

#P207 PA params
#pa0b0=5447
#pa0b1=-658
#pa0b2=-175<div></div>

#Same PA params for P304,P305, P306, P307

pa0b0=5447
pa0b1=-607
pa0b2=-160
pa0itssit=62
pa1itssit=62


cckPwrOffset=5
ccode=0
rssismf2g=0xa
rssismc2g=0x3
rssisav2g=0x7
triso2g=0
noise_cal_enable_2g=0
noise_cal_po_2g=0
swctrlmap_2g=0x04040404,0x02020202,0x02020202,0x010101,0x1ff
temp_add=29767
temp_mult=425

btc_flags=0x6
btc_params0=5000
btc_params1=1000
btc_params6=63

This file was deleted.

Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
#AP6181_NVRAM_V1.1_01152013
#adjuest PA parameter for g/n mode
manfid=0x2d0
prodid=0x492
vendid=0x14e4
devid=0x4343
boardtype=0x0598

# Board Revision is P307, same nvram file can be used for P304, P305, P306 and P307 as the tssi pa params used are same
#Please force the automatic RX PER data to the respective board directory if not using P307 board, for e.g. for P305 boards force the data into the following directory /projects/BCM43362/a1_labdata/boardtests/results/sdg_rev0305
boardrev=0x1307
boardnum=777
xtalfreq=26000
boardflags=0xa00
sromrev=3
wl0id=0x431b
macaddr=00:90:4c:07:71:12
aa2g=1
ag0=2
maxp2ga0=74
cck2gpo=0x2222
ofdm2gpo=0x66666666
mcs2gpo0=0x7777
mcs2gpo1=0x7777
pa0maxpwr=56

#P207 PA params
#pa0b0=5447
#pa0b1=-658
#pa0b2=-175<div></div>

#Same PA params for P304,P305, P306, P307

pa0b0=5447
pa0b1=-607
pa0b2=-160
pa0itssit=62
pa1itssit=62


cckPwrOffset=5
ccode=0
rssismf2g=0xa
rssismc2g=0x3
rssisav2g=0x7
triso2g=0
noise_cal_enable_2g=0
noise_cal_po_2g=0
swctrlmap_2g=0x04040404,0x02020202,0x02020202,0x010101,0x1ff
temp_add=29767
temp_mult=425
2 changes: 1 addition & 1 deletion projects/Amlogic/devices/MXQ/linux/linux.arm.conf
Original file line number Diff line number Diff line change
Expand Up @@ -1043,7 +1043,7 @@ CONFIG_RTL8188EU=m
CONFIG_RTL8188EU_MP=m
CONFIG_SDIO_DHD_CDC_WIFI_40181_MODULE=y
CONFIG_BCMDHD_FW_PATH="/lib/firmware/brcm/"
CONFIG_BCMDHD_NVRAM_PATH="/lib/firmware/brcm/bcm40183-nvram.txt"
CONFIG_BCMDHD_NVRAM_PATH="/lib/firmware/brcm/nvram_ap6181.txt"
CONFIG_BCMDHD_CONFIG_PATH="/etc/wifi/config.txt"
CONFIG_BCMDHD_POWER_OFF_IN_SUSPEND=y
CONFIG_BCMDHD_OOB=y
Expand Down
146 changes: 146 additions & 0 deletions projects/Amlogic/patches/linux/110-dhd_auto.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,146 @@
diff -Naru a/drivers/amlogic/wifi/broadcm_40181/dhd_config.c b/drivers/amlogic/wifi/broadcm_40181/dhd_config.c
--- a/drivers/amlogic/wifi/broadcm_40181/dhd_config.c 2015-02-13 00:17:44.000000000 +0100
+++ b/drivers/amlogic/wifi/broadcm_40181/dhd_config.c 2015-04-01 20:22:54.163011472 +0200
@@ -109,6 +109,13 @@
"fw_bcm4339a0_ag_mfg.bin"
};

+const static char *nv_name[] = {
+ "ap6210_nvram.txt",
+ "ap6330_nvram.txt",
+ "ap6181_nvram.txt",
+ "ap6335e_nvram.txt",
+};
+
#define htod32(i) i
#define htod16(i) i
#define dtoh32(i) i
@@ -323,6 +330,67 @@
}

void
+dhd_conf_set_nv_name_by_chip(dhd_pub_t *dhd, char *dst, char *src)
+{
+ int fw_type, ag_type;
+ static uint chip, chiprev, first=1;
+ int i;
+
+ if (first) {
+ chip = dhd_bus_chip_id(dhd);
+ chiprev = dhd_bus_chiprev_id(dhd);
+ first = 0;
+ }
+
+ if (src[0] == '\0') {
+#ifdef CONFIG_BCMDHD_NVRAM_PATH
+ bcm_strncpy_s(src, sizeof(nvram_path), CONFIG_BCMDHD_NVRAM_PATH, MOD_PARAM_PATHLEN-1);
+ if (src[0] == '\0')
+#endif
+ {
+ printf("src nvram path is null\n");
+ return;
+ }
+ }
+
+ strcpy(dst, src);
+ #ifndef FW_PATH_AUTO_SELECT
+ return;
+ #endif
+
+ /* find out the last '/' */
+ i = strlen(dst);
+ while (i>0){
+ if (dst[i] == '/') break;
+ i--;
+ }
+ switch (chip) {
+ case BCM4330_CHIP_ID:
+ strcpy(&dst[i+1], nv_name[1]);
+ break;
+ case BCM43362_CHIP_ID:
+ strcpy(&dst[i+1], nv_name[0]);
+ break;
+ case BCM43340_CHIP_ID: //bcm43341b0ag BCM43340B0
+ strcpy(&dst[i+1], nv_name[0]);
+ break;
+// case BCM43341_CHIP_ID: //bcm43341b0ag BCM43341B0
+// strcpy(&dst[i+1], nv_name[0]);
+// break;
+// case BCM4324_CHIP_ID: //bcm43241b4ag BCM43241B4
+// strcpy(&dst[i+1], nv_name[0]);
+// break;
+ case BCM4335_CHIP_ID: //bcm4339a0ag BCM4335A0
+ strcpy(&dst[i+1], nv_name[3]);
+ break;
+ case BCM4339_CHIP_ID: //bcm4339a0ag
+ strcpy(&dst[i+1], nv_name[3]);
+ break;
+ }
+ printf("%s: nvram_path=%s\n", __FUNCTION__, dst);
+}
+
+void
dhd_conf_set_fw_name_by_chip(dhd_pub_t *dhd, char *dst, char *src)
{
int fw_type, ag_type;
diff -Naru a/drivers/amlogic/wifi/broadcm_40181/dhd_config.h b/drivers/amlogic/wifi/broadcm_40181/dhd_config.h
--- a/drivers/amlogic/wifi/broadcm_40181/dhd_config.h 2015-02-13 00:17:44.000000000 +0100
+++ b/drivers/amlogic/wifi/broadcm_40181/dhd_config.h 2015-04-01 20:22:54.163011472 +0200
@@ -15,6 +15,7 @@

#define FW_PATH_AUTO_SELECT 1
extern char firmware_path[MOD_PARAM_PATHLEN];
+extern char nvram_path[MOD_PARAM_PATHLEN];
extern int disable_proptx;
extern uint dhd_doflow;
#ifdef POWER_OFF_IN_SUSPEND
@@ -111,6 +112,7 @@
extern void *bcmsdh_get_drvdata(void);
void dhd_conf_set_fw_name_by_mac(dhd_pub_t *dhd, bcmsdh_info_t *sdh, char *fw_path);
void dhd_conf_set_nv_name_by_mac(dhd_pub_t *dhd, bcmsdh_info_t *sdh, char *nv_path);
+void dhd_conf_set_nv_name_by_chip(dhd_pub_t *dhd, char *dst, char *src);
void dhd_conf_set_fw_name_by_chip(dhd_pub_t *dhd, char *dst, char *src);
#if defined(HW_OOB)
void dhd_conf_set_hw_oob_intr(bcmsdh_info_t *sdh, uint chip);
diff -Naru a/drivers/amlogic/wifi/broadcm_40181/dhd_linux.c b/drivers/amlogic/wifi/broadcm_40181/dhd_linux.c
--- a/drivers/amlogic/wifi/broadcm_40181/dhd_linux.c 2015-02-13 00:17:44.000000000 +0100
+++ b/drivers/amlogic/wifi/broadcm_40181/dhd_linux.c 2015-04-01 20:22:54.163011472 +0200
@@ -2936,6 +2936,7 @@
if (firmware_path[strlen(firmware_path)-1] == '\n')
firmware_path[strlen(firmware_path)-1] = '\0';
dhd_conf_set_fw_name_by_chip(&dhd->pub, fw_path, firmware_path);
+ dhd_conf_set_nv_name_by_chip(&dhd->pub, nv_path, nvram_path);
}


@@ -3258,8 +3259,10 @@
/* Link to bus module */
dhd->pub.bus = bus;
dhd->pub.hdrlen = bus_hdrlen;
- if (strlen(firmware_path) != 0)
+ if (strlen(firmware_path) != 0){
dhd_conf_set_fw_name_by_chip(&dhd->pub, fw_path, firmware_path);
+ dhd_conf_set_nv_name_by_chip(&dhd->pub, nv_path, nvram_path);
+ }

/* Set network interface name if it was provided as module parameter */
if (iface_name[0]) {
diff -Naru a/drivers/amlogic/wifi/broadcm_40181/dhd_sdio.c b/drivers/amlogic/wifi/broadcm_40181/dhd_sdio.c
--- a/drivers/amlogic/wifi/broadcm_40181/dhd_sdio.c 2015-02-13 00:17:44.000000000 +0100
+++ b/drivers/amlogic/wifi/broadcm_40181/dhd_sdio.c 2015-04-01 20:22:54.163011472 +0200
@@ -8466,6 +8466,7 @@
bus->cl_devid)) {
/* Attempt to download binary to the dongle */
dhd_conf_set_fw_name_by_chip(dhdp, fw_path, firmware_path); // terence
+ dhd_conf_set_nv_name_by_chip(dhdp, nv_path, nvram_path);
if (dhdsdio_probe_init(bus, bus->dhd->osh, bus->sdh) &&
dhdsdio_download_firmware(bus, bus->dhd->osh, bus->sdh)) {

@@ -8519,6 +8520,7 @@
dhd_conf_set_hw_oob_intr(bus->sdh, bus->sih->chip); // terence 20120615: fix for OOB initial issue
#endif
dhd_conf_set_fw_name_by_chip(dhdp, fw_path, firmware_path);
+ dhd_conf_set_nv_name_by_chip(dhdp, nv_path, nvram_path);
if ((bcmerror = dhd_bus_start(dhdp)) != 0)
DHD_ERROR(("%s: dhd_bus_start fail with %d\n",
__FUNCTION__, bcmerror));