pgquiles / OpenELEC.tv

Port of the OpenELEC for Amlogic-based TV boxes
http://openelec.tv
0 stars 0 forks source link

AP6335e support is incomplete #3

Open pgquiles opened 8 years ago

pgquiles commented 8 years ago

These patches needs to add AP6335e:

projects/Amlogic/patches/linux/linux-ampak.patch

projects/Amlogic/patches/linux/linux-dhd.patch

pgquiles commented 8 years ago

Bluetooth and wifi worked at commit 89cb616c32f21e4683dcbf55d35f979d89146891

After adding those patches, Bluetooth works but wifi is broken and the firmware we are attempting to load is failing.

pgquiles commented 8 years ago

Removed in commit d4bc304e4880898529ec9ead0fbf8bdaa6366721 and wifi works again

pgquiles commented 8 years ago

Wifi does not work properly without these patches (I don't know with these patches either!)

Without these patches, wifi shows the wireless networks around but it will always fail to connect to any network, even those with no security.

This is the console output:

OpenELEC:/etc/wifi # [ 373.378173@3] dhd_open: Enter ed911000 [ 373.378182@3] dhd_conf_set_fw_name_by_chip: firmware_path=/lib/firmware/brcm/fw_bcm4339a0_ag.bin [ 373.378184@3] dhd_conf_set_nv_name_by_chip: nvram_path=/lib/firmware/brcm/ap6335e_nvram.txt [ 373.378188@3] [ 373.378188@3] Dongle Host Driver, version 1.88.45.4 (r420671) [ 373.378188@3] Compiled in drivers/net/wireless/bcmdhd on Aug 23 2015 at 12:59:49 [ 373.378189@3] wl_android_wifi_on in 1 [ 373.378192@3] wl_android_wifi_on in 2: g_wifi_on=0 [ 373.378198@3] WIFI Disable! 6 [ 373.588265@0] WIFI Enable! 6 [ 373.788172@0] sdio_reset_comm(): [ 373.802185@0] sdio_read_cis: 3 callbacks suppressed [ 373.802188@0] sdio: queuing unknown CIS tuple 0x80 (2 bytes) [ 373.803959@0] sdio: queuing unknown CIS tuple 0x80 (3 bytes) [ 373.805707@0] sdio: queuing unknown CIS tuple 0x80 (3 bytes) [ 373.808850@0] sdio: queuing unknown CIS tuple 0x80 (7 bytes) [ 373.892147@0] [sdio_reinit] finish [ 373.992170@0] =========== WLAN going back to live ======== [ 373.992472@0] [ 373.992472@0] [ 373.992472@0] dhd_bus_devreset: == WLAN ON == [ 373.994866@0] F1 signature OK, socitype:0x1 chip:0x4339 rev:0x1 pkg:0x2 [ 373.995251@0] DHD: dongle ram size is set to 786432(orig 786432) at 0x180000 [ 373.995293@0] dhd_conf_set_fw_name_by_chip: firmware_path=/lib/firmware/brcm/fw_bcm4339a0_ag.bin [ 373.995296@0] dhd_conf_set_nv_name_by_chip: nvram_path=/lib/firmware/brcm/ap6335e_nvram.txt [ 373.995739@0] dhd_conf_read_config: fw_count=4 [ 373.995741@0] dhd_conf_read_config: name=fw_bcm4339a0e_ag.bin, mac_count=5 [ 373.995745@0] dhd_conf_read_config: oui=0x0022F4, nic_start=0xE85408, nic_end=0xE8549D [ 373.995747@0] dhd_conf_read_config: oui=0x983B16, nic_start=0x3557A9, nic_end=0x35582A [ 373.995750@0] dhd_conf_read_config: oui=0x983B16, nic_start=0x406927, nic_end=0x406A20 [ 373.995753@0] dhd_conf_read_config: oui=0x983B16, nic_start=0x6E25BB, nic_end=0x6E269A [ 373.995755@0] dhd_conf_read_config: oui=0x983B16, nic_start=0x916157, nic_end=0x916487 [ 373.995757@0] dhd_conf_read_config: name=fw_bcm4339a0e_ag_p2p.bin, mac_count=5 [ 373.995759@0] dhd_conf_read_config: oui=0x0022F4, nic_start=0xE85408, nic_end=0xE8549D [ 373.995762@0] dhd_conf_read_config: oui=0x983B16, nic_start=0x3557A9, nic_end=0x35582A [ 373.995764@0] dhd_conf_read_config: oui=0x983B16, nic_start=0x406927, nic_end=0x406A20 [ 373.995767@0] dhd_conf_read_config: oui=0x983B16, nic_start=0x6E25BB, nic_end=0x6E269A [ 373.995769@0] dhd_conf_read_config: oui=0x983B16, nic_start=0x916157, nic_end=0x916487 [ 373.995771@0] dhd_conf_read_config: name=fw_bcm4339a0e_ag_apsta.bin, mac_count=5 [ 373.995774@0] dhd_conf_read_config: oui=0x0022F4, nic_start=0xE85408, nic_end=0xE8549D [ 373.995776@0] dhd_conf_read_config: oui=0x983B16, nic_start=0x3557A9, nic_end=0x35582A [ 373.995778@0] dhd_conf_read_config: oui=0x983B16, nic_start=0x406927, nic_end=0x406A20 [ 373.995781@0] dhd_conf_read_config: oui=0x983B16, nic_start=0x6E25BB, nic_end=0x6E269A [ 373.995783@0] dhd_conf_read_config: oui=0x983B16, nic_start=0x916157, nic_end=0x916487 [ 373.995785@0] dhd_conf_read_config: name=fw_bcm4339a0e_ag_mfg.bin, mac_count=5 [ 373.995788@0] dhd_conf_read_config: oui=0x0022F4, nic_start=0xE85408, nic_end=0xE8549D [ 373.995790@0] dhd_conf_read_config: oui=0x983B16, nic_start=0x3557A9, nic_end=0x35582A [ 373.995792@0] dhd_conf_read_config: oui=0x983B16, nic_start=0x406927, nic_end=0x406A20 [ 373.995795@0] dhd_conf_read_config: oui=0x983B16, nic_start=0x6E25BB, nic_end=0x6E269A [ 373.995797@0] dhd_conf_read_config: oui=0x983B16, nic_start=0x916157, nic_end=0x916487 [ 373.995839@0] dhd_conf_read_config: nv_count=1 [ 373.995841@0] dhd_conf_read_config: name=nvram_ap6335e.txt, mac_count=5 [ 373.995844@0] dhd_conf_read_config: oui=0x0022F4, nic_start=0xE85408, nic_end=0xE8549D [ 373.995846@0] dhd_conf_read_config: oui=0x983B16, nic_start=0x3557A9, nic_end=0x35582A [ 373.995849@0] dhd_conf_read_config: oui=0x983B16, nic_start=0x406927, nic_end=0x406A20 [ 373.995851@0] dhd_conf_read_config: oui=0x983B16, nic_start=0x6E25BB, nic_end=0x6E269A [ 373.995853@0] dhd_conf_read_config: oui=0x983B16, nic_start=0x916157, nic_end=0x916487 [ 373.996675@0] dhd_conf_read_config: bcn_timeout = 20 [ 373.996805@0] dhd_conf_read_config: kso_enable = 0 [ 373.996847@0] sdioh_cis_read: func_cis_ptr[0]=0x10ac [ 374.094370@0] dhd_conf_set_fw_name_by_mac: fw_typ=0 != fw_type_new=2 [ 374.094372@0] dhd_conf_set_fw_name_by_mac: fw_typ=0 != fw_type_new=1 [ 374.094374@0] dhd_conf_set_fw_name_by_mac: fw_typ=0 != fw_type_new=3 [ 374.094377@0] sdioh_cis_read: func_cis_ptr[0]=0x10ac [ 374.103128@0] Final fw_path=/lib/firmware/brcm/fw_bcm4339a0_ag.bin [ 374.103129@0] Final nv_path=/lib/firmware/brcm/ap6335e_nvram.txt [ 374.103130@0] Final conf_path=/etc/wifi/config.txt [ 374.180427@0] NVRAM version: AP6335_NVRAM_V1.4_01072014 [ 374.181110@0] dhdsdio_write_vars: Download, Upload and compare of NVRAM succeeded. [ 374.358789@0] dhd_bus_init: enable 0x06, ready 0x06 (waited 0us) [ 374.358992@0] bcmsdh_set_drvdata: Enter [ 374.358995@0] bcmsdh_set_irq: Flag = 1 [ 374.359073@0] dhd_conf_set_band: Set band 0 [ 374.369468@3] Firmware up: op_mode=0x0005, Broadcom Dongle Host Driver mac=6c:fa:a7:26:18:b3 [ 374.369470@3] Set country US, revision 0 [ 374.415489@3] Country code: US (US/0) [ 374.415713@3] dhd_conf_set_roam: Set roam_off 1 [ 374.416652@3] dhd_conf_set_glom: set bus:txglom 8 [ 374.417811@3] dhd_conf_set_ampdu_ba_wsize: set ampdu_ba_wsize 40 [ 374.422668@3] dhdcdc_set_ioctl: msg->status:fffffffb [ 374.422916@3] Firmware version = wl0: Dec 6 2013 15:47:10 version 6.37.32.RC23.34.10 (r) [ 374.422919@3] Driver: 1.88.45.4 (r420671) [ 374.422919@3] Firmware: wl0: Dec 6 2013 15:47:10 version 6.37.32.RC23.34.10 (r) [ 374.422924@3] wl_android_wifi_on: Success [ 374.478918@3] dhd_open: Exit ret=0 [ 384.570800@3] connect failed event=0 e->status 1 e->reason 0 [ 384.571006@3] CFG80211-ERROR) wl_bss_connect_done : Report connect result - connection failed

pgquiles commented 8 years ago

It seems it's loading the wrong firmware: it's loading a firmware for AP6335 ( [ 374.103128@0] Final fw_path=/lib/firmware/brcm/fw_bcm4339a0_ag.bin) instead of AP6335e (fw_bcm4339a0e_ag.bin). They are different:

3be944c0fc046eed127df77fcc43c8c0 fw_bcm4339a0_ag_apsta.bin 3be944c0fc046eed127df77fcc43c8c0 fw_bcm4339a0_ag.bin 3be944c0fc046eed127df77fcc43c8c0 fw_bcm4339a0_ag_p2p.bin 44c5f267c6645aa48df48cbcb393a0dc fw_bcm4339a0e_ag_apsta.bin 44c5f267c6645aa48df48cbcb393a0dc fw_bcm4339a0e_ag.bin 44c5f267c6645aa48df48cbcb393a0dc fw_bcm4339a0e_ag_p2p.bin

Maybe the patches made sense after all (although dhd_conf_set_nv_name_by_chip is missing a lot of cases dhd_conf_set_fw_name_by_chip does consider, that patch needs updating).

pgquiles commented 8 years ago

Also, country = US is wrong. The Android config.txt says country=ALL.

pgquiles commented 8 years ago

After commit b2a6b1b6aad4ff1d785052eb07f27851db774c9e it still fails:

[ 114.947208@3] dhd_stop: Enter ebb57800 [ 114.947648@2] wl_android_wifi_off in 1 [ 114.947651@2] wl_android_wifi_off in 2: g_wifi_on=1 [ 114.947925@1] bcmsdh_set_irq: Flag = 0 [ 114.947932@1] net_ratelimit: 5 callbacks suppressed [ 114.947934@1] dhd_bus_devreset: WLAN OFF DONE [ 114.947999@1] =========== WLAN placed in RESET ======== [ 114.948001@1] wl_android_wifi_off out [ 114.948002@1] dhd_stop: Exit [ 117.772970@2] dhd_open: Enter ebb57800 [ 117.772981@2] pgquiles - BCM4339A0_CHIP_REV and CHIP_REV is BCM4339A0_CHIP_REV (1)dhd_conf_set_fw_name_by_chip: firmware_path=/lib/firmware/brcm/fw_bcm4339a0_ag.bin [ 117.772984@2] dhd_conf_set_nv_name_by_chip: nvram_path=/lib/firmware/brcm/ap6335e_nvram.txt [ 117.772987@2] [ 117.772987@2] Dongle Host Driver, version 1.88.45.4 (r420671) [ 117.772987@2] Compiled in drivers/net/wireless/bcmdhd on Aug 25 2015 at 02:22:37 [ 117.772989@2] wl_android_wifi_on in 1 [ 117.772991@2] wl_android_wifi_on in 2: g_wifi_on=0 [ 117.773000@2] WIFI Disable! 6 [ 117.972811@2] WIFI Enable! 6 [ 118.172626@2] sdio_reset_comm(): [ 118.186557@1] sdio_read_cis: 3 callbacks suppressed [ 118.186560@1] sdio: queuing unknown CIS tuple 0x80 (2 bytes) [ 118.196235@1] sdio: queuing unknown CIS tuple 0x80 (3 bytes) [ 118.198009@1] sdio: queuing unknown CIS tuple 0x80 (3 bytes) [ 118.201214@1] sdio: queuing unknown CIS tuple 0x80 (7 bytes) [ 118.273760@1] [sdio_reinit] finish [ 118.373665@1] =========== WLAN going back to live ======== [ 118.374026@1] [ 118.374026@1] [ 118.374026@1] dhd_bus_devreset: == WLAN ON == [ 118.376820@1] F1 signature OK, socitype:0x1 chip:0x4339 rev:0x1 pkg:0x2 [ 118.377268@1] DHD: dongle ram size is set to 786432(orig 786432) at 0x180000 [ 118.377319@1] pgquiles - BCM4339A0_CHIP_REV and CHIP_REV is BCM4339A0_CHIP_REV (1)dhd_conf_set_fw_name_by_chip: firmware_path=/lib/firmware/brcm/fw_bcm4339a0_ag.bin [ 118.377321@1] dhd_conf_set_nv_name_by_chip: nvram_path=/lib/firmware/brcm/ap6335e_nvram.txt [ 118.377793@1] dhd_conf_read_config: fw_count=4 [ 118.377796@1] dhd_conf_read_config: name=fw_bcm4339a0e_ag.bin, mac_count=5 [ 118.377799@1] dhd_conf_read_config: oui=0x0022F4, nic_start=0xE85408, nic_end=0xE8549D [ 118.377802@1] dhd_conf_read_config: oui=0x983B16, nic_start=0x3557A9, nic_end=0x35582A [ 118.377804@1] dhd_conf_read_config: oui=0x983B16, nic_start=0x406927, nic_end=0x406A20 [ 118.377807@1] dhd_conf_read_config: oui=0x983B16, nic_start=0x6E25BB, nic_end=0x6E269A [ 118.377809@1] dhd_conf_read_config: oui=0x983B16, nic_start=0x916157, nic_end=0x916487 [ 118.377811@1] dhd_conf_read_config: name=fw_bcm4339a0e_ag_p2p.bin, mac_count=5 [ 118.377814@1] dhd_conf_read_config: oui=0x0022F4, nic_start=0xE85408, nic_end=0xE8549D [ 118.377816@1] dhd_conf_read_config: oui=0x983B16, nic_start=0x3557A9, nic_end=0x35582A [ 118.377819@1] dhd_conf_read_config: oui=0x983B16, nic_start=0x406927, nic_end=0x406A20 [ 118.377821@1] dhd_conf_read_config: oui=0x983B16, nic_start=0x6E25BB, nic_end=0x6E269A [ 118.377824@1] dhd_conf_read_config: oui=0x983B16, nic_start=0x916157, nic_end=0x916487 [ 118.377826@1] dhd_conf_read_config: name=fw_bcm4339a0e_ag_apsta.bin, mac_count=5 [ 118.377829@1] dhd_conf_read_config: oui=0x0022F4, nic_start=0xE85408, nic_end=0xE8549D [ 118.377831@1] dhd_conf_read_config: oui=0x983B16, nic_start=0x3557A9, nic_end=0x35582A [ 118.377833@1] dhd_conf_read_config: oui=0x983B16, nic_start=0x406927, nic_end=0x406A20 [ 118.377836@1] dhd_conf_read_config: oui=0x983B16, nic_start=0x6E25BB, nic_end=0x6E269A [ 118.377838@1] dhd_conf_read_config: oui=0x983B16, nic_start=0x916157, nic_end=0x916487 [ 118.377840@1] dhd_conf_read_config: name=fw_bcm4339a0e_ag_mfg.bin, mac_count=5 [ 118.377842@1] dhd_conf_read_config: oui=0x0022F4, nic_start=0xE85408, nic_end=0xE8549D [ 118.377845@1] dhd_conf_read_config: oui=0x983B16, nic_start=0x3557A9, nic_end=0x35582A [ 118.377847@1] dhd_conf_read_config: oui=0x983B16, nic_start=0x406927, nic_end=0x406A20 [ 118.377849@1] dhd_conf_read_config: oui=0x983B16, nic_start=0x6E25BB, nic_end=0x6E269A [ 118.377852@1] dhd_conf_read_config: oui=0x983B16, nic_start=0x916157, nic_end=0x916487 [ 118.377894@1] dhd_conf_read_config: nv_count=1 [ 118.377896@1] dhd_conf_read_config: name=nvram_ap6335e.txt, mac_count=5 [ 118.377898@1] dhd_conf_read_config: oui=0x0022F4, nic_start=0xE85408, nic_end=0xE8549D [ 118.377901@1] dhd_conf_read_config: oui=0x983B16, nic_start=0x3557A9, nic_end=0x35582A [ 118.377903@1] dhd_conf_read_config: oui=0x983B16, nic_start=0x406927, nic_end=0x406A20 [ 118.377905@1] dhd_conf_read_config: oui=0x983B16, nic_start=0x6E25BB, nic_end=0x6E269A [ 118.377908@1] dhd_conf_read_config: oui=0x983B16, nic_start=0x916157, nic_end=0x916487 [ 118.378718@1] dhd_conf_read_config: bcn_timeout = 20 [ 118.378846@1] dhd_conf_read_config: kso_enable = 0 [ 118.378887@1] sdioh_cis_read: func_cis_ptr[0]=0x10ac [ 118.656990@1] dhd_conf_set_fw_name_by_mac: fw_typ=0 != fw_type_new=2 [ 118.656994@1] dhd_conf_set_fw_name_by_mac: fw_typ=0 != fw_type_new=1 [ 118.656995@1] dhd_conf_set_fw_name_by_mac: fw_typ=0 != fw_type_new=3 [ 118.656998@1] sdioh_cis_read: func_cis_ptr[0]=0x10ac [ 118.720758@1] Final fw_path=/lib/firmware/brcm/fw_bcm4339a0_ag.bin [ 118.720760@1] Final nv_path=/lib/firmware/brcm/ap6335e_nvram.txt [ 118.720761@1] Final conf_path=/etc/wifi/config.txt [ 118.811041@1] NVRAM version: AP6335_NVRAM_V1.4_01072014 [ 118.811707@1] dhdsdio_write_vars: Download, Upload and compare of NVRAM succeeded. [ 118.989405@1] dhd_bus_init: enable 0x06, ready 0x06 (waited 0us) [ 118.989669@1] bcmsdh_set_drvdata: Enter [ 118.989672@1] bcmsdh_set_irq: Flag = 1 [ 118.989754@1] dhd_conf_set_band: Set band 0 [ 119.000324@2] Firmware up: op_mode=0x0005, Broadcom Dongle Host Driver mac=6c:fa:a7:26:18:b3 [ 119.000326@2] Set country US, revision 0 [ 119.046251@2] Country code: US (US/0) [ 119.046467@2] dhd_conf_set_roam: Set roam_off 1 [ 119.047316@2] dhd_conf_set_glom: set bus:txglom 8 [ 119.048355@2] dhd_conf_set_ampdu_ba_wsize: set ampdu_ba_wsize 40 [ 119.053173@2] dhdcdc_set_ioctl: msg->status:fffffffb [ 119.053419@2] Firmware version = wl0: Dec 6 2013 15:47:10 version 6.37.32.RC23.34.10 (r) [ 119.053423@2] Driver: 1.88.45.4 (r420671) [ 119.053423@2] Firmware: wl0: Dec 6 2013 15:47:10 version 6.37.32.RC23.34.10 (r) [ 119.053426@2] wl_android_wifi_on: Success [ 119.110004@2] dhd_open: Exit ret=0

It's still loading the wrong firmware because the chip revision says this is AP6335 instead of AP6335e.