diff --git a/projects/Amlogic/devices/MXQ/filesystem/lib/firmware/brcm/ap6210_nvram.txt b/projects/Amlogic/devices/MXQ/filesystem/lib/firmware/brcm/ap6210_nvram.txt new file mode 100644 index 00000000000..4aa428706fc --- /dev/null +++ b/projects/Amlogic/devices/MXQ/filesystem/lib/firmware/brcm/ap6210_nvram.txt @@ -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
+ +#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 + diff --git a/projects/Amlogic/devices/MXQ/filesystem/lib/firmware/brcm/bcm40183-nvram.txt b/projects/Amlogic/devices/MXQ/filesystem/lib/firmware/brcm/bcm40183-nvram.txt deleted file mode 100644 index 197232da496..00000000000 --- a/projects/Amlogic/devices/MXQ/filesystem/lib/firmware/brcm/bcm40183-nvram.txt +++ /dev/null @@ -1,82 +0,0 @@ -#AP6330_NVRAM_V1.0_20121130 -#Sample variables file for BCM94330 SD FC AGB board -manfid=0x2d0 -prodid=0x0547 -vendid=0x14e4 -devid=0x4360 -boardtype=0x05e1 -boardrev=0x1202 -boardflags=0x0080200 -nocrc=1 -xtalfreq=26000 -boardnum=22 -macaddr=00:90:4c:c5:12:38 -ag0=254 -aa2g=1 -ccode=ALL -pa0itssit=0x20 -pa0b0=5587 -pa0b1=-633 -pa0b2=-158 -rssismf2g=0xa -rssismc2g=0x3 -rssisav2g=0x7 -#rssi params for 5GHz -rssismf5g=0x4 -rssismc5g=0x3 -rssisav5g=0x7 -#PA parameters for lower a-band -pa1lob0=4748 -pa1lob1=-566 -pa1lob2=-180 -#PA parameters for midband -pa1b0=4762 -pa1b1=-593 -pa1b2=-172 -#PA parameters for high band -#pa1hib0=4596 -pa1hib0=4666 -pa1hib1=-619 -pa1hib2=-163 -rxpo5g=0 -maxp2ga0=74 -maxp5ga0=66 -maxp5gla0=66 -maxp5gha0=66 -# 2.4G Tx Power offsets -cck2gpo=0x2222 -ofdm2gpo=0x44444444 -mcs2gpo0=0x6666 -mcs2gpo1=0x6666 -# 5G Tx Power offsets -ofdm5gpo=0x44444444 -ofdm5glpo=0x44444444 -ofdm5ghpo=0x44444444 -mcs5gpo0=0x6666 -mcs5gpo1=0x6666 -mcs5glpo0=0x6666 -mcs5glpo1=0x6666 -mcs5ghpo0=0x6666 -mcs5ghpo1=0x6666 -sromrev=3 -il0macaddr=00:90:4c:c5:12:38 -wl0id=0x431b -cckPwrOffset=4 -swctrlmap_2g=0x44844484,0x42824282,0x40804484,0x18282,0x1ff -triso5g=0 -swctrlmap_5g=0x00100010,0x20202020,0x20202020,0x14202,0x0f0 -rfreg033=0x19 -rfreg033_cck=0x1f -dacrate2g=160 -dacrate5g=160 -txalpfbyp2g=1 -bphyscale=17 -cckPwrIdxCorr=-15 -pacalidx2g=50 -#pacalidx5g=20 -noise_cal_ref_2g=53 -noise_cal_po_2g=0 -noise_cal_ref_5g=52 -noise_cal_po_5g=5,0,0 -# 4330 OOB parameter: High level trigger -muxenab=0x10 diff --git a/projects/Amlogic/devices/MXQ/filesystem/lib/firmware/brcm/fw_bcm40181a2.bin b/projects/Amlogic/devices/MXQ/filesystem/lib/firmware/brcm/fw_bcm40181a2.bin new file mode 100644 index 00000000000..ae76625463d Binary files /dev/null and b/projects/Amlogic/devices/MXQ/filesystem/lib/firmware/brcm/fw_bcm40181a2.bin differ diff --git a/projects/Amlogic/devices/MXQ/filesystem/lib/firmware/brcm/fw_bcm40183b2.bin b/projects/Amlogic/devices/MXQ/filesystem/lib/firmware/brcm/fw_bcm40183b2.bin deleted file mode 100644 index 6309e869225..00000000000 Binary files a/projects/Amlogic/devices/MXQ/filesystem/lib/firmware/brcm/fw_bcm40183b2.bin and /dev/null differ diff --git a/projects/Amlogic/devices/MXQ/filesystem/lib/firmware/brcm/nvram_ap6181.txt b/projects/Amlogic/devices/MXQ/filesystem/lib/firmware/brcm/nvram_ap6181.txt new file mode 100644 index 00000000000..9ecbfc27707 --- /dev/null +++ b/projects/Amlogic/devices/MXQ/filesystem/lib/firmware/brcm/nvram_ap6181.txt @@ -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 + +#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 diff --git a/projects/Amlogic/devices/MXQ/linux/linux.arm.conf b/projects/Amlogic/devices/MXQ/linux/linux.arm.conf index a977bc8d4b2..da713149d82 100644 --- a/projects/Amlogic/devices/MXQ/linux/linux.arm.conf +++ b/projects/Amlogic/devices/MXQ/linux/linux.arm.conf @@ -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 diff --git a/projects/Amlogic/patches/linux/110-dhd_auto.patch b/projects/Amlogic/patches/linux/110-dhd_auto.patch new file mode 100644 index 00000000000..cf6e400da79 --- /dev/null +++ b/projects/Amlogic/patches/linux/110-dhd_auto.patch @@ -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));