Open hansemro opened 3 years ago
arch/arm/boot/dts/omap4-kc1.dts
/ {
...
/* regulator for wl12xx on sdio5 */
wl12xx_vmmc: wl12xx_vmmc {
pinctrl-names = "default";
pinctrl-0 = <&wl12xx_gpio>;
compatible = "regulator-fixed";
regulator-name = "vwl1271";
regulator-min-microvolt = <1800000>;
regulator-max-microvolt = <1800000>;
gpio = <&gpio2 22 GPIO_ACTIVE_HIGH>; /* gpio_54 */
startup-delay-us = <70000>;
enable-active-high;
};
...
};
...
&omap4_pmx_core {
...
uart2_pins: pinmux_uart2_pins {
pinctrl-single,pins = <
OMAP4_IOPAD(0x118, PIN_INPUT_PULLUP | MUX_MODE0) /* uart2_cts.uart2_cts */
OMAP4_IOPAD(0x11a, PIN_OUTPUT | MUX_MODE0) /* uart2_rts.uart2_rts */
OMAP4_IOPAD(0x11c, PIN_INPUT_PULLUP | MUX_MODE0) /* uart2_rx.uart2_rx */
OMAP4_IOPAD(0x11e, PIN_OUTPUT | MUX_MODE0) /* uart2_tx.uart2_tx */
>;
};
/* wl12xx GPIO output: WLAN_IRQ */
wl12xx_gpio: pinmux_wl12xx_gpio {
pinctrl-single,pins = <
OMAP4_IOPAD(0x07a, PIN_OUTPUT | MUX_MODE3) /* gpmc_ncs3.gpio_53 */
>;
};
/* wl12xx GPIO inputs and WLAN_EN */
wl12xx_pins: pinmux_wl12xx_pins {
pinctrl-single,pins = <
OMAP4_IOPAD(0x07c, PIN_INPUT | MUX_MODE3) /* gpmc_nwp.gpio_54 */
OMAP4_IOPAD(0x148, PIN_INPUT_PULLUP | MUX_MODE0) /* sdmmc5_clk.sdmmc5_clk */
OMAP4_IOPAD(0x14a, PIN_INPUT_PULLUP | MUX_MODE0) /* sdmmc5_cmd.sdmmc5_cmd */
OMAP4_IOPAD(0x14c, PIN_INPUT_PULLUP | MUX_MODE0) /* sdmmc5_dat0.sdmmc5_dat0 */
OMAP4_IOPAD(0x14e, PIN_INPUT_PULLUP | MUX_MODE0) /* sdmmc5_dat1.sdmmc5_dat1 */
OMAP4_IOPAD(0x150, PIN_INPUT_PULLUP | MUX_MODE0) /* sdmmc5_dat2.sdmmc5_dat2 */
OMAP4_IOPAD(0x152, PIN_INPUT_PULLUP | MUX_MODE0) /* sdmmc5_dat3.sdmmc5_dat3 */
>;
};
...
};
...
&uart2 {
pinctrl-names = "default";
pinctrl-0 = <&uart2_pins>;
status = "okay";
};
&mmc5 {
pinctrl-names = "default";
pinctrl-0 = <&wl12xx_pins>;
status = "okay";
vmmc-supply = <&wl12xx_vmmc>;
non-removable;
bus-width = <4>;
cap-power-off-card;
#address-cells = <1>;
#size-cells = <0>;
wlcore: wlcore@2 {
compatible = "ti,wl1271";
reg = <2>;
interrupt-parent = <&gpio2>;
interrupts = <21 IRQ_TYPE_LEVEL_HIGH>; /* gpio 53 */
ref-clock-frequency = <38400000>;
/*tcxo-clock-frequency = <26000000>;*/
};
};
Issues:
[ 5.221221] reg-fixed-voltage wl12xx_vmmc: GPIO lookup for consumer (null) [ 5.230529] reg-fixed-voltage wl12xx_vmmc: using device tree for GPIO lookup [ 5.246887] of_get_named_gpiod_flags: can't parse 'gpios' property of node '/wl12xx_vmmc[0]' [ 5.256683] of_get_named_gpiod_flags: parsed 'gpio' property of node '/wl12xx_vmmc[0]' - status (0) [ 5.274414] vwl1271: 1800 mV, disabled [ 5.274414] reg-fixed-voltage wl12xx_vmmc: vwl1271 supplying 1800000uV ... [ 36.961303] vwl1271: disabling
Forced wl12xx_vmmc to always on
installed firmware via apk add linux-firmware-ti-connectivity
modprobe -a wlcore wl12xx wlcore_sdio
Modules are loaded, regulatory.db loaded (I think) all with no errors.
But no /dev/wlan , nothing in sysfs either - no wlan device is created, no driver probe in dmesg, no firmware load attempt - nothing
But no /dev/wlan , nothing in sysfs either - no wlan device is created
Something is wrong with the device tree. wl127x driver does not get loaded automatically
compatible string is right for sure
the rest seems pretty standard too
Yeah, you're right.
Since the clock is _XTAL , does the mean eXTernAL ? Then perhaps there are more nodes required for the clock setup
xtal usually means crystal oscillator for clock
Enabled very verbose dmesg - I haven't seen anything interesting
Related issue with what I encountered with 3.4.48 kernel: https://bugzilla.kernel.org/show_bug.cgi?id=119331 https://forum.digikey.com/t/pandaboard-a4-wifi-module-not-found/2951/5
It mentions TWL6030 driver not supporting 32kHz clock may cause issues.
So the patch in the digikey post actually makes the wlcore/wl12xx modules load.
[ 13.349822] wlcore: WARNING Detected unconfigured mac address in nvs, derive from fuse instead.
[ 13.359558] wlcore: WARNING Your device performance is not optimized.
[ 13.366455] wlcore: WARNING Please use the calibrator tool to configure your device.
[ 13.374694] wlcore: WARNING Fuse mac address is zero. using random mac
[ 13.381713] wlcore: WARNING NIC part of the MAC address wraps around!
[ 13.402008] wlcore: loaded
[ 17.395355] wlcore: firmware booted (Rev 6.3.10.0.142)
wlan0 also starts up! It needs to be calibrated, but I think we are getting closer.
Building calibrator (on kindle):
apk add patch
wget http://www.infradead.org/~tgr/libnl/files/libnl-2.0.tar.gz
cd libnl-2.0
./configure
make
make install
cd ..
git clone https://github.com/TI-OpenLink/ti-utils
cd ti-utils
wget https://git.buildroot.net/buildroot/plain/package/ti-utils/0001-plt.h-fix-build-with-gcc-10.patch
patch -p1 < 0001-plt*.patch
make
I guess calibration is not really required despite the warnings. I am able to connect to a network with nmtui and browse the web with w3m.
amazon-otter:~# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: usb0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
link/ether 3e:fa:88:ad:78:50 brd ff:ff:ff:ff:ff:ff
inet 10.0.0.1/8 brd 10.255.255.255 scope global usb0
valid_lft forever preferred_lft forever
inet6 fe80::3cfa:88ff:fead:7850/64 scope link tentative
valid_lft forever preferred_lft forever
3: sit0@NONE: <NOARP> mtu 1480 qdisc noop state DOWN qlen 1000
link/sit 0.0.0.0 brd 0.0.0.0
4: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP qlen 1000
link/ether 08:00:28:8b:f8:3d brd ff:ff:ff:ff:ff:ff
inet 192.168.137.43/24 brd 192.168.137.255 scope global dynamic noprefixroute wlan0
valid_lft 604395sec preferred_lft 604395sec
inet6 fe80::6e22:b802:8519:7636/64 scope link noprefixroute
valid_lft forever preferred_lft forever
Added a patch to enable clk32kg required for wlan: 0742b657c4c5813cef63804dc2877549a05e5580
Applied patch on 5.11 , still no dice. Made sure to update DTB also. Any other steps/commands needed?
Can you try this? v5.11_wlan.tar.gz
I did not take too many steps aside from installing ti firmware like you did above:
apk add linux-firmware-ti-connectivity
I also realize that some of the network-related kernel config options I have selected are not necessary.
I must have mucked something up, testing now
When loading modules, I get unknown symbol error: (This is using your boot.img and modules)
/ # modprobe -a wlcore wl12xx wlcore_sdio wlcore_spi
modprobe: ERROR: could not insert 'wlcore': Unknown symbol in module, or unknown parameter (see dmesg)
modprobe: ERROR: could not insert 'wl12xx': Unknown symbol in module, or unknown parameter (see dmesg)
modprobe: ERROR: could not insert 'wlcore_sdio': Unknown symbol in module, or unknown parameter (see dmesg)
modprobe: ERROR: could not insert 'wlcore_spi': Unknown symbol in module, or unknown parameter (see dmesg)
When loading modules, I get unknown symbol error:
Did you push the modules to /lib/modules/5.11.0+/
? The modules should load automatically.
Maybe I did something wrong? I will check.
I think I did, unless it didn't work.
Triple checked it now, should be your modules in /lib.
My usual process is to create a tar file that has /lib/modules/5.11.0+ , then I untar it at the root directory
More detail in dmesg:
[ 451.573944] cfg80211: Unknown symbol __stack_chk_guard (err -2)
[ 451.711059] cfg80211: Unknown symbol __stack_chk_guard (err -2)
[ 451.794769] wlcore_sdio: Unknown symbol __stack_chk_guard (err -2)
[ 451.882629] wlcore_spi: Unknown symbol __stack_chk_guard (err -2)
[ 869.729583] cfg80211: Unknown symbol __stack_chk_guard (err -2)
[ 869.839538] cfg80211: Unknown symbol __stack_chk_guard (err -2)
[ 869.923675] wlcore_sdio: Unknown symbol __stack_chk_guard (err -2)
[ 870.001617] wlcore_spi: Unknown symbol __stack_chk_guard (err -2)
I packaged the modules improperly. My bad.
What went wrong?
I packaged with symbolic links rather than the actual files. So I am now using zip again.
v5.11_modules.zip v5.11_wlan2.tar.gz
Notes:
omap4-kc1.dts
with touchscreen resolution after patchesI packaged with symbolic links rather than the actual files
ah
Working 100%
Very cool !!!!!!!!!!!!!!!!
Just tried my devicetree with your kernel and it stopped working, looks like I had something wrong with my DTS.
Just tried my devicetree with your kernel and it stopped working, looks like I had something wrong with my DTS.
Does the wlan regulator have regulator-always-on;
property?
Yeah that property is there
it's probably due to some other changes I made while debugging
Made some corrections to wlan dtsi in 82b2084ef42700db07b2af6fd40465c9faa8de03. @mj-sakellaropoulos Can you confirm that this works for you as well?
Fixes the following issue:
[ 23.835388] wlcore: WARNING Detected unconfigured mac address in nvs, derive from fuse instead.
[ 23.835723] wlcore: WARNING Your device performance is not optimized.
[ 23.835784] wlcore: WARNING Please use the calibrator tool to configure your device.
[ 23.835815] wlcore: WARNING Fuse mac address is zero. using random mac
[ 23.835968] wlcore: WARNING NIC part of the MAC address wraps around!
[ 23.853546] wlcore: loaded
[ 24.716827] EXT4-fs (mmcblk0p12): re-mounted. Opts: (null). Quota mode: none.
[ 28.097595] wlcore: firmware booted (Rev 6.3.10.0.142)
[ 28.147521] wlcore: down
[ 33.246154] wlcore: ERROR timeout waiting for the hardware to complete initialization
[ 35.054229] VDAC: disabling
[ 35.055816] VANA: disabling
[ 37.380126] wlcore: ERROR timeout waiting for the hardware to complete initialization
[ 41.491729] wlcore: ERROR timeout waiting for the hardware to complete initialization
[ 41.491973] wlcore: ERROR firmware boot failed despite 3 retries
Steps to reproduce:
cache
partition and root to media
partitionsudo rc-service networkmanager start
dmesg
and nmtui
and see that wlcore goes and stays down, and fails to load firmwareChanges:
After these changes, pmOS build can now powerdown and powerup wlan without issue.
Sure, I can test it Wednesday
(uni stuff until then)
Resources:
arch/arm/boot/dts/omap4-var-som-om44-wlan.dtsi
Based off board files, the kindle fire will share many similarities to 4430 SDP. In short, the following modifications will need to be made:
GPIO_WIFI_PMENA: 54 GPIO_WIFI_IRQ: 53