As far as I understand it, the driver modules get compiled into the kernel, they get probed during boot and then will look into the dts how to initialize the hardware etc.
Interesting logs. This line should most likely also happen in 4.16 for the wifi module to find it, unless in 4.16 they altered this behavior. I expect it to be somewhere (indirectly) in the mtk-wdt driver.
Just for fun I tried those printk’s also on 4.17-rc1, which also doesn’t call reset_controller_register for watchdog, same as your 4.16.
Good find, but I don’t think these changes have any impact.
Could you please add some printk’s to: mtk_infrasys_init, at least at the top and before mtk_register_reset_controller. If reset controller is called, then continue in there. At the end of that function, the reset controller is registered. This method should be called. If you see no prints at all, check if the drivers/clk/mediatek/clk-mt2701.o file exists and has recent changes.
Incomplete type in this case probably means the type was forward declared and only used as pointer (not as regmap type).
The logs are sufficient, thanks. On a quick look it seems that sadly were not on the right path as everything is called as it’s supposed to. I didn’t have any time yet to dive into further, busy weekend , but we need to find out how kernel 4.14 mtk_wdt_probe finally causes calling reset_controller_register. This what your earlier log was showing:
Note that the Watchdog enabled is the last line of mtk_wdt_probe, while the register_controller_register is called after, according to the log. I now suspect this is because the watchdog is scheduled somewhere, and registered upon start. I was hoping the infrasys logs would give some more insight…
In your wifi-debug.log (4.16-wlan) I don’t see the line MTK_WDT_NONRST_REG(0) that is in wifi-debug-4.14.log. I think you forgot to merge drivers/watchdog/mtk_wdt.c
Hah! you’re probably right… 4.14 from your 4.14-main branch has DRIVER_VERSION 2.0 and 4.16 has 1.0. Also for 4.14 the file is 621 lines vs 280 in 4.16… pff I was comparing with 4.14 mainline
Wow, great! Good job! You still did most of the work
Do you know why this awful wmt whatever tool and stp blabla loader is required? Maybe we can combine some efforts to ban them as well, if it’s not too much work.
Wmt-tools are required because this driver is from android…i also want to kickoff these tools,but don’t know where these hook into the driver…i’m still no kernel-developer…i only copy files,compile them and try to fix the errors the compiler reports me
Stp_art_launcher throw firmware-file to the driver, wmt_loader makes the init
I’m not sure, maybe I’ll buy a board (I quit my old job so I don’t have any R2 anymore which I can use) to try to mainline only the WIFI driver (with all his dependencies such as watchdog 2.0, pwrap, etc.), is anyone working on this or interested in helping? Does anyone know if MTK guys already planned to do that? I think we could proceed as step, by porting all drivers one by one.
I still have to check if the WIFI firmware is proprietary but other core drivers (watchdog, pwrap…) can be already ported to mainline.
The wifi-driver is imho to large for mainline…and with the wmt-tools-depency we have imho no chance for mainline-integration. Afaik we can not hope for mtk-support…i have asked gary multiple times for porting this driver and some others for other drivers (hdmi,dual gmac,hnat)…there was not the best response
Thanks Frank! Sounds awesome! I’m also interested in getting the wifi driver in a better shape, have already a project with yocto on banana pi with 4.16, right now I’m just using external wifi card, soon will try to apply changes from your branch to a vanilla 4.16.x.
It will be good to get the smallest possible patch for latest upstream kernel to enable the wifi driver, last time I’ve checked that on 4.14 it was a huge ~7MB diff.
Of course we should mainline the watchdog driver first, then the pwrap one, then the mt6625 core one, then… (this is an example, IDK all mini-drivers involved), you think it is too large because you’re seeing it as a single big driver
I think it can be integrated in mainline (at least some simple drivers such as the watchdog). Also maybe…maybe… MTK guys (and others) will help us to remove that wmt-tools-thing if everything else is already in mainline
About BT: I think we can merge the Wifi driver without BT (it’s another config so it is quite easy to remove it)
thats why i guess, we cannot do it…i have not much time for cleaning up this hugh folder…tried to do it a bit, but there is also much garbage in it (references to LTE,GPS-Driver in makefiles/code that is not existent)…there are many compiler-switches in the code currently not used.
maybe we can push code outside the driver/misc/mediatek-folder like watchdog and genetlink to avoid porting that every time…as a first step
@garywang / @Ryder.Lee: i made a pull-request for merging wlan-branch into 4.16-main…there i see some changes in cpu-section in dtsi: