@Yusuf_Bulbul you have enabled I2c only in kernel-options or did you also enabled anything additional in the DTS(i)?
that question must be answered by bpi-team…i did not know how the Combo-chip (mt6625l) for wifi/BT is connected to main-SOC
@Yusuf_Bulbul you have enabled I2c only in kernel-options or did you also enabled anything additional in the DTS(i)?
that question must be answered by bpi-team…i did not know how the Combo-chip (mt6625l) for wifi/BT is connected to main-SOC
Well, there’s no relationship between I2C and combo chip. I guess you probably switch pinmux to other function when you enable something, but I don’t know the actual pin setting on R2. You could check it yourself.
I have no problems with i2c…i have nodes for i2c0-2 in dtsi and i2c0+1 enabled in dts
@Yusuf_Bulbul which kernel-option have you enabled? You know,that you must create ap0 after each boot?
As far as i know i2c1 is used for audio-controller
See here:
Hı frank. I couldn’t understand the issue. Sometimes, the wmtWifi is created with i2c nodes. But, sometimes after second kernel building with same kernel config, wmtWifi is not created.
I enabled this options from kernel config
*I2C device interface
*Usermode spi device driver support
*Cameras/video grabbers support
*Enable advanced debug functionality on V4L2 driver
*Enable old style fixed minor ranges on /drivers/video device
*V4L platform sevicez
*USB video class
*Uvc input events device support
*Gspca Based webcams
And also I add uart nodes to mt7623.dtsi and mt7623n_bpi_r2.dts files.
How can I check wmtWifi nodes logs or some information about wmtWifi on userspace? Or Which command should I use for this?
As ryder.lee confirmed wmtwifi have nothing to with i2c. wmtWifi will be created via wmt-tools (wmt_loader, stp_uart_launcher).
I assume that gary put that commands in autorun (rc.local or init-script) on the image you are using and there is sometimes a (timing) issue.
You can look in /etc/rc.local or /etc/init.d or /etc/system.d
Also logs in /var/log (messages,syslog,…) and dmesg can be helpful
`stp_uart_launcher -p /etc/firmware &`
What does this command do? Do you know? Because, I think this can use some uart ports.
This is the second command which creates the wmtwifi device (first initializes the mt6625-chip).
it does not use the uart-ports on gpio, only a uart-like bus named btif
But you have problems with i2c and not uart
Here my merge of the uart-driver in 4.14 where you can see which device-nodes involved: https://github.com/frank-w/BPI-R2-4.14/commit/e6b369a5ade19206db433b46d0102ae000b87e99
Here you see commands to create ap0: http://www.fw-web.de/dokuwiki/doku.php?id=en:bpi-r2:wlan#internal
It may be wrong uart nodes lines.
Is there any problem these lines which I add mt7623n_bpi_dts?
uart0: serial@11002000 {
compatible = "mediatek,mt7623-uart",
"mediatek,mt6577-uart";
reg = <0 0x11002000 0 0x400>;
interrupts = <GIC_SPI 51 IRQ_TYPE_LEVEL_LOW>;
clocks = <&pericfg CLK_PERI_UART0_SEL>,
<&pericfg CLK_PERI_UART0>;
clock-names = "baud", "bus";
status = "disabled";
};
uart1: serial@11003000 {
compatible = "mediatek,mt7623-uart",
"mediatek,mt6577-uart";
reg = <0 0x11003000 0 0x400>;
interrupts = <GIC_SPI 52 IRQ_TYPE_LEVEL_LOW>;
clocks = <&pericfg CLK_PERI_UART1_SEL>,
<&pericfg CLK_PERI_UART1>;
clock-names = "baud", "bus";
status = "disabled";
};
and I add to mt7623.dtsi ?
&uart0 {
status = "okay";
};
&uart1 {
status = "okay";
};
also, Kernel 4.14 includes these lines. when I add lines to pio block in kernel 4.4, it gives kernel compiling error. So, I don’t add this lines.
uart0_pins_a: uart@0 {
pins_dat {
pinmux = <MT7623_PIN_79_URXD0_FUNC_URXD0>,
<MT7623_PIN_80_UTXD0_FUNC_UTXD0>;
};
};
uart1_pins_a: uart@1 {
pins_dat {
pinmux = <MT7623_PIN_81_URXD1_FUNC_URXD1>,
<MT7623_PIN_82_UTXD1_FUNC_UTXD1>;
};
};
Many Thanks your helps.
Uart0/1 is added to my 4.4 repo to…you can use that dts(i)…but uart has also nothing to do with i2c or wifi
Okay. I will make somethings clear tomorrow and back here. Thank you my friend. You are the best.
Please decide if you mean uart or i2c…these are 2 different things and having nothing to do with the internal wifi. And a separate thread is imho here also indicated
Hi Frank. When I enabled i2c, wmtWifi registered and works fine.
dmesg |grep -i wifi
[ 42.246822] [MTK-WIFI] WIFI_init: mtk_wmt_WIFI_chrdev driver(major 153) installed.
[ 42.246837] [WLAN-MOD-INIT][I]do_wlan_drv_init:WMT-WIFI char dev init, ret:0
[ 44.258510] [MTK-WIFI] WIFI_open: WIFI_open: major 153 minor 0 (pid 992)
[ 44.258570] [MTK-WIFI] WIFI_write: WIFI_write 1
[ 44.611472] [MTK-WIFI] WIFI_write: WMT turn on WIFI fail!
[ 44.611637] [MTK-WIFI] WIFI_close: WIFI_close: major 153 minor 0 (pid 992)
When I added Uart nodes and I enabled spi, wmtWifi has been failed.
dmesg |grep -i wifi
[ 19.867838] [MTK-WIFI] WIFI_init: Fail to register chrdev
[ 19.867841] [WLAN-MOD-INIT][I]do_wlan_drv_init:WMT-WIFI char dev init, ret:-16
Also, When I removed the uart nodes after this. And wmtWifi init has been succesfull.
What does it mean -16 return code for wifi init?
Have you tried my dts(i) from 4.4-repo?
I assume the dts is broken after uart is added (maybe wrong order or similar).
On uart there must uart2 before uart0/1 else debug-uart is not working…
I think, I am wrong again. Sorry. I tested Uart again without SPI. And it worked.
There is a crash with SPI not Uart actually.
There is wifi device major number defination in the file “linux-mt/drivers/misc/mediatek/connectivity/common/combo/linux/wmt_chrdev_wifi.c”
#define WIFI_DEV_MAJOR 153
#define PFX "[MTK-WIFI] "
#define WIFI_LOG_DBG 3
#define WIFI_LOG_INFO 2
#define WIFI_LOG_WARN 1
#define WIFI_LOG_ERR 0
In here, The major number of Wifi device is defined as 153. If I look at /proc/devices;
153 mtk_wmt_WIFI_chrdev
Also When I enabled spi user support and I looked at /proc/devices;
153 Spi
Spi is defined as 153 too. I think, When I enabled User Spi support from kernel options, wifi_init is failed because of this.
Is there any way to define wifi_dev_mojor number as diffirent from 153?
In 4.14 there is a Problem with spidev (crash on loading spidev) because of missing compatible-definition…Maybe 4.4 has that problem too
See also link from ryder.lee in Spi-thread
Hi Frank I solved the problem by changing the major number of wifi device as 155.
For this operation, I change #define WIFI_DEV_MAJOR 155 defination in the files
linux-mt/drivers/misc/mediatek/connectivity/common/combo/linux/wmt_chrdev_wifi.c
linux-mt/drivers/misc/mediatek/connectivity/common/conn_soc/linux/pub/wmt_chrdev_wifi.c
and I have rebuiled the kernel. The crash of spidev and wifi_dev has been removed.
cat /proc/devices
153 spi
154 mtk_wcn_detect
155 mtk_wmt_WIFI_chrdev
dmesg |grep -i wifi
[ 21.342303] [MTK-WIFI] WIFI_init: mtk_wmt_WIFI_chrdev driver(major 155) installed.
[ 21.342312] [WLAN-MOD-INIT][I]do_wlan_drv_init:WMT-WIFI char dev init, ret:0
[ 23.376886] [MTK-WIFI] WIFI_open: WIFI_open: major 155 minor 0 (pid 848)
[ 23.376931] [MTK-WIFI] WIFI_write: WIFI_write 1
[ 25.638586] [WMT-FUNC][W]wmt_func_wifi_on:WMT-FUNC: wmt wlan func on before wlan probe
[ 26.772321] [MTK-WIFI] register_set_p2p_mode_handler: (pid 858) register set p2p mode handler c07223e4
[ 26.772349] [WMT-FUNC][W]wmt_func_wifi_on:WMT-FUNC: wmt call wlan probe ok
[ 26.772448] [MTK-WIFI] WIFI_write: WMT turn on WIFI success!
[ 26.772470] [MTK-WIFI] WIFI_close: WIFI_close: major 155 minor 0 (pid 848)
Can you use ap0?
Imho combo-folder is not used (removed in 4.14) so it must be changed only in conn_soc
Yes. I can create and use ap0.
I am using kernel 4.4
According to http://elixir.free-electrons.com/linux/latest/source/Documentation/admin-guide/devices.txt major 154 (and 155) is assigned to “Specialix RIO serial card” but these should not be used on r2 so maybe we can use that. Else we have to use e.g. 60-63 (local/experiental)
tried on 4.14…same behaviour (as expected), fixed the same way
also uploaded fixed compiled version to my gdrive: https://drive.google.com/drive/folders/1EGN1TvqCpDHdOAS-mjRg9ipi0kahnOUV?usp=sharing
created an issue on sinovoips repo: https://github.com/BPI-SINOVOIP/BPI-R2-bsp/issues/27
also fixed in my 4.4-fork:
Hi Frank.
I tried NAT operations with my new kernel. But; after command “iptables -S”. It gives this error.
modprobe: ERROR: could not insert 'ip_tables': Invalid argument
iptables v1.6.0: can't initialize iptables table `filter': Table does not exist (do you need to insmod?)
Perhaps iptables or your kernel needs to be upgraded.
Have you any idea? Should I enabled something like iptables from kernel options?