Looking for some advice on kernel compiling

241 views
Skip to first unread message

Franco Palombo

unread,
Aug 2, 2023, 4:42:16 PM8/2/23
to VT8500/WM8505 Linux Kernel
I'm trying (for the first time) to "build the source" for a WM8650 laptop. One thing to note, its also my first time cross-compiling, so I expect dumb errors from my side.

I began by installing all the necessary stuff to be able to build the linux kernel:
    sudo apt-get install git fakeroot build-essential ncurses-dev xz-utils libssl-dev bc flex libelf-dev bison
and after executing:
    make ARCH=arm menuconfig
and enabling the suggested options on the github guide, I proceeded to execute:
    make ARCH=arm zImage
Just to get this:
    fpp@FPP-PC:~/Documentos/linux-vtwm$ make ARCH=arm zImage
    CHK include/config/kernel.release
    CHK include/generated/uapi/linux/version.h
    CHK include/generated/utsrelease.h
    CHK include/generated/timeconst.h
    CC kernel/bounds.s
    gcc: error: unrecognized argument in option ‘-mabi=aapcs-linux’
    gcc: note: valid arguments to ‘-mabi=’ are: ms sysv
    gcc: error: unrecognized command-line option ‘-mlittle-endian’
    gcc: error: unrecognized command-line option ‘-mapcs’
    gcc: error: unrecognized command-line option ‘-mno-sched-prolog’
    gcc: error: unrecognized command-line option ‘-mno-thumb-interwork’
    gcc: error: unrecognized command-line option ‘-mfpu=vfp’
    make[1]: *** [Kbuild:21: kernel/bounds.s] Error 1
    make: *** [Makefile:1064: prepare0] Error 2
After searching a bit, I found that I had to install the ARM cross-compile tools. And so I did:
    sudo apt-get install gcc-arm-linux-gnueabi
Just to execute the same command again and get the same error. After looking a bit more I found that I had to include the "CROSS_COMPILE=arm-none-eabi-" argument on the make command. I tried again and got a different output, but with another error:
    fpp@FPP-PC:~/Documentos/linux-vtwm$ make ARCH=arm CROSS_COMPILE=arm-none-eabi- zImage
      CHK     include/config/kernel.release
  
    CHK     include/generated/uapi/linux/version.h
      CHK     include/generated/utsrelease.h
      CHK     include/generated/timeconst.h
      CC      kernel/bounds.s
      CHK     include/generated/bounds.h
      UPD     include/generated/bounds.h
      GEN     scripts/gdb/linux/constants.py
      CC      arch/arm/kernel/asm-offsets.s
      CHK     include/generated/asm-offsets.h
      UPD     include/generated/asm-offsets.h
      CALL    scripts/checksyscalls.sh
      HOSTCC  scripts/dtc/dtc.o
      HOSTCC  scripts/dtc/flattree.o
      HOSTCC  scripts/dtc/fstree.o
      HOSTCC  scripts/dtc/data.o
      HOSTCC  scripts/dtc/livetree.o
      HOSTCC  scripts/dtc/treesource.o
      HOSTCC  scripts/dtc/srcpos.o
      HOSTCC  scripts/dtc/checks.o
      HOSTCC  scripts/dtc/util.o
      SHIPPED scripts/dtc/dtc-lexer.lex.c
      SHIPPED scripts/dtc/dtc-parser.tab.h
      HOSTCC  scripts/dtc/dtc-lexer.lex.o
      SHIPPED scripts/dtc/dtc-parser.tab.c
      HOSTCC  scripts/dtc/dtc-parser.tab.o
      HOSTLD  scripts/dtc/dtc
    /usr/bin/ld: scripts/dtc/dtc-parser.tab.o:(.bss+0x10): multiple definitions of `yylloc'; scripts/dtc/dtc-lexer.lex.o:(.bss+0x0): first defined here
    collect2: error: ld returned 1 exit status
    make[2]: *** [scripts/Makefile.host:110: scripts/dtc/dtc] Error 1
    make[1]: *** [scripts/Makefile.build:570: scripts/dtc] Error 2
    make: *** [Makefile:561: scripts] Error 2

I think I'm missing something, but I dont know what, and i wasnt able to find any solution by searching on internet

Franco Palombo

unread,
Aug 2, 2023, 5:42:54 PM8/2/23
to VT8500/WM8505 Linux Kernel
I was able to solve the last error by modifying the "dtc-lexer-lex.c" file. The solution is here. But got another error:
    fpp@FPP-PC:~/Documentos/linux-vtwm$ make ARCH=arm CROSS_COMPILE=arm-none-eabi- zImage
      ...
      HOSTCC  scripts/selinux/genheaders/genheaders
    In file included from scripts/selinux/genheaders/genheaders.c:18:
    ./security/selinux/include/classmap.h:244:2: error: #error New address family defined, please update secclass_map.
      244 | #error New address family defined, please update secclass_map.
      |  ^~~~~
    make[3]: *** [scripts/Makefile.host:101: scripts/selinux/genheaders/genheaders] Error 1
    make[2]: *** [scripts/Makefile.build:570: scripts/selinux/genheaders] Error 2
    make[1]: *** [scripts/Makefile.build:570: scripts/selinux] Error 2

    make: *** [Makefile:561: scripts] Error 2
Luckily, I was able to find this, and I made the changes and it continued compiling, until a new error appeared:
      CC      kernel/memremap.o
      AR      kernel/built-in.o
      CC      certs/system_keyring.o
    make[1]: *** There are no rules to build the file 'debian/canonical-certs.pem', needed for 'certs/x509_certificate_list'.  Stop.
    make: *** [Makefile:1019: certs] Error 2

Thanks to this (in spanish) that says to remove "CONFIG_SYSTEM_TRUSTED_KEYS" from the .config file, I was able to continue the build further, but this time the start was a little bit different:
    fpp@FPP-PC:~/Documentos/linux-vtwm$ make ARCH=arm CROSS_COMPILE=arm-none-eabi- zImage
    scripts/kconfig/conf  --silentoldconfig Kconfig
    *
    * Restart config...
    *
    *
    * Certificates for signature checking
    *
    File name or PKCS#11 URI of module signing key (MODULE_SIG_KEY) [certs/signing_key.pem] certs/signing_key.pem
    Provide system-wide ring of trusted keys (SYSTEM_TRUSTED_KEYRING) [Y/?] y
      Additional X.509 keys for default system keyring (SYSTEM_TRUSTED_KEYS) [] (NEW)
      Reserve area for inserting a certificate without recompiling (SYSTEM_EXTRA_CERTIFICATE) [Y/n/?] y
        Number of bytes to reserve for the extra certificate (SYSTEM_EXTRA_CERTIFICATE_SIZE) [4096] 4096
      Provide a keyring to which extra trustable keys may be added (SECONDARY_TRUSTED_KEYRING) [Y/n/?] y
    Provide system-wide ring of blacklisted keys (SYSTEM_BLACKLIST_KEYRING) [Y/n/?] y
      Hashes to be preloaded into the system blacklist keyring (SYSTEM_BLACKLIST_HASH_LIST) []
    #
    # configuration written to .config
    #

      CHK     include/config/kernel.release
      CHK     include/generated/uapi/linux/version.h
      CHK     include/generated/utsrelease.h
      CHK     include/generated/timeconst.h
      CHK     include/generated/bounds.h
      CHK     include/generated/asm-offsets.h
      CALL    scripts/checksyscalls.sh
      CHK     scripts/mod/devicetable-offsets.h
      CHK     include/generated/compile.h
      EXTRACT_CERTS  
    Generating X.509 key generation config
    ###
    ### Now generating an X.509 key pair to be used for signing modules.
    ###
    ### If this takes a long time, you might wish to run rngd in the
    ### background to keep the supply of entropy topped up.  It
    ### needs to be run as root, and uses a hardware random
    ### number generator if one is available.
    ###
    .......+..................+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*..+..+.......+..+...+...... +....+...........+....+..+.+...+......+........+...+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*...+........+...............+.+......+......+...+...........+.........+.+...+...+............+........+...+.........+.+..+.......+............+...+...+............+..+.........+........................+.......+..........................+.......+......+..+...+...............+.+.....+.........+.+...............+......+.....+...+.+......+............+..+.+..+...+.........+...+.+.....+.+.........+..+...+.+.....+....+...........+....+.....+....+........+....+......+...+............+.................+.......+......+...............+...+............+..+.+..+.........+...+......+.+.....+.+..............+.+..+..........+..+..........+...........+.........+...+.+.....+......+......+....+......+..+..................+...+......+..........+..............+...............+.........+.+............+...+............+.....+....+.........+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
...+.......+...+.....+.+..+....+...+..+.........+......+...+..........+..+...+......+.+......+...+..+.......+..+.+...+...........+.........+.+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*..+........+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*......+..+..........+......+..+...+...+...............+...............+.+...+...+....................+.......+..+....+......+.....+.........+..........+.........+..+.+...+......+........+.+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-----
    ###
    ### Key pair generated.
    ###

And, again, new errors:
    drivers/input/serio/i8042.c: In function 'i8042_stop':
    drivers/input/serio/i8042.c:467:18: error: 'I8042_AUX_IRQ' undeclared (first use in this function)
      467 |  synchronize_irq(I8042_AUX_IRQ);
          |                  ^~~~~~~~~~~~~
    drivers/input/serio/i8042.c:467:18: note: each undeclared identifier is reported only once for each function it appears in
    drivers/input/serio/i8042.c:468:18: error: 'I8042_KBD_IRQ' undeclared (first use in this function)
      468 |  synchronize_irq(I8042_KBD_IRQ);
          |                  ^~~~~~~~~~~~~
    drivers/input/serio/i8042.c: In function 'i8042_check_aux':
    drivers/input/serio/i8042.c:865:18: error: 'I8042_AUX_IRQ' undeclared (first use in this function)
      865 |  if (request_irq(I8042_AUX_IRQ, i8042_aux_test_irq, IRQF_SHARED,
          |                  ^~~~~~~~~~~~~
    drivers/input/serio/i8042.c: In function 'i8042_create_kbd_port':
    drivers/input/serio/i8042.c:1330:14: error: 'I8042_KBD_IRQ' undeclared (first use in this function)
     1330 |  port->irq = I8042_KBD_IRQ;
          |              ^~~~~~~~~~~~~
    drivers/input/serio/i8042.c: In function 'i8042_create_aux_port':
    drivers/input/serio/i8042.c:1367:14: error: 'I8042_AUX_IRQ' undeclared (first use in this function)
     1367 |  port->irq = I8042_AUX_IRQ;
          |              ^~~~~~~~~~~~~
    drivers/input/serio/i8042.c: In function 'i8042_free_irqs':
    drivers/input/serio/i8042.c:1422:12: error: 'I8042_AUX_IRQ' undeclared (first use in this function)
     1422 |   free_irq(I8042_AUX_IRQ, i8042_platform_device);
          |            ^~~~~~~~~~~~~
    drivers/input/serio/i8042.c:1424:12: error: 'I8042_KBD_IRQ' undeclared (first use in this function)
     1424 |   free_irq(I8042_KBD_IRQ, i8042_platform_device);
          |            ^~~~~~~~~~~~~
    drivers/input/serio/i8042.c: In function 'i8042_setup_aux':
    drivers/input/serio/i8042.c:1452:22: error: 'I8042_AUX_IRQ' undeclared (first use in this function)
     1452 |  error = request_irq(I8042_AUX_IRQ, i8042_interrupt, IRQF_SHARED,
          |                      ^~~~~~~~~~~~~
    drivers/input/serio/i8042.c: In function 'i8042_setup_kbd':
    drivers/input/serio/i8042.c:1478:22: error: 'I8042_KBD_IRQ' undeclared (first use in this function)
     1478 |  error = request_irq(I8042_KBD_IRQ, i8042_interrupt, IRQF_SHARED,
          |                      ^~~~~~~~~~~~~
    make[2]: *** [scripts/Makefile.build:312: drivers/input/serio/i8042.o] Error 1
    make[1]: *** [scripts/Makefile.build:570: drivers/input/serio] Error 2
    make: *** [Makefile:1019: drivers] Error 2

this time, I wasn't able to fin any solution (yet)

Fred 1

unread,
Aug 2, 2023, 6:50:43 PM8/2/23
to vt8500-wm8505...@googlegroups.com, Franco Palombo

hi Franco

haven't looked at this for a few years now, i kinda remember had to change some source in the lexer,

good on yer for finding. i've been meaning to get back to this, cuz i have a another use for my wm8650 but have so many other things to do.....

so can't help atm.  but encourage you to press on.

BTW, are you trying to recompile a newer kernel, or the old known one, i forget the kernel no. (i don't have that disk with all that running atm to check)

cheers anyway

fred

--
You received this message because you are subscribed to the Google Groups "VT8500/WM8505 Linux Kernel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vt8500-wm8505-linux...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vt8500-wm8505-linux-kernel/f3820cd1-df69-47aa-a616-f3f3bfead01dn%40googlegroups.com.

Franco Palombo

unread,
Aug 3, 2023, 12:29:59 AM8/3/23
to VT8500/WM8505 Linux Kernel
Hey Fred! Nice to see that this little potato of a cpu is still getting some interest! I'm trying to compile the latest one that you can build using this kernel source. At first I thought I was building for 3.13-rc8, but after cloning the repository I was prompted with the menuconfig of 4.14 I think. Its way better and newer than the Arch linux (2.6) I was running previously. Anyway, I think that my last issue has to be with some conflicting kernel modules, because I started to play a little bit with wh0`s bookconfig and was succesfully able to build the kernel and debian 11 for the WM8650. I only had to change every "wm8505-ref.dtb" to a "wm8650-mid.dtb" on the makefile, and had to change a little bit how the boot partition files were laid out, and I also had to make a new wmt_scriptcmd. I think I should be able to build 5.15 given that on wh0's bookconfig github there is a "v6" release claiming it has that kernel version. I haven't had time to look at it yet. I also seem to have some kind of issue with gpiod, or at least with the wgpio service, it dosent seems to change anything

Alexey Charkov

unread,
Aug 3, 2023, 5:10:38 AM8/3/23
to vt8500-wm8505...@googlegroups.com
Hi Franco!

Two ideas:
1. Perhaps disable SELinux and kernel security subsystem altogether,
as they require more dependencies to build, and will add complexity
while tinkering with the machine later on. Not that you can achieve
much security with a "plug anything into the SD slot and my bootloader
will happily do whatever that SD card asks me to do, not even checking
with the user" machine in the first place
2. Try "make mrproper" whenever you switch target platforms and/or
compilers to make sure there are no half-built object files lying
around and getting in your way for the next build

Best,
Alexey
> To view this discussion on the web visit https://groups.google.com/d/msgid/vt8500-wm8505-linux-kernel/a8a91850-ff36-40da-86c8-f4a301228530n%40googlegroups.com.

Franco Palombo

unread,
Aug 3, 2023, 4:42:23 PM8/3/23
to VT8500/WM8505 Linux Kernel
Ok, the issue with gpiod (and other issues that i wasnt aware of probably) were solved by correctly configuring the kernel .config file to better suit my laptop. After doing that I cloned wh0's repository again, this time the only difference was that I replaced the .config with the one I made previously (using wh0's menuconfig) and repeated the modifications to the makefile and bootscript. I was able to boot debian 11 with kernel 5.15, but this time without keyboard support, so I rolled back to 4.14. This time I was able to succesfully build the kernel from source, using the same .config that worked with 5.15, and I was able to just "drag n drop" the uzImage.bin file to the sdcard and boot debian 11 again, this time with keyboard working. 
Something that I'm still not being able to figure out, is why does the Ethernet and the internal USB WiFi adapter and the serial console still not work. I know that they do actually work because on Android I can succesfully use them, but not here on debian. I think I included the necesary stuff to make the ethernet work, and I'm sure that I included the corect drivers for my internal adapter (I dissasembled the laptop to check with the IC markings), but still, after executing systemctl start wlgpio and verify that everithing is ok with systemctl status wlgpio, still, no Wireless networks show up on nmtui and no new network adapters show on nmcli. I even took the extra step of building the kernel again, this time including the drivers for a Ralink adapter I have, and this time I was able to connect to the internet and install some packages.
About the serial console, I dont really know what I might be doing wrong. I'll attach the wmt_scriptcmd so you can see the arguments I pass to the kernel. Checking from the laptop itself (dmesg | grep tty) I'm not able to see the internal serial port, only tty0 and ttyWMT0. I'll attach my kernel config, boot script, and some pics of the ICs that my laptop has.
Photos-001.zip
.config
wmt_scriptcmd

Franco Palombo

unread,
Aug 3, 2023, 8:00:17 PM8/3/23
to VT8500/WM8505 Linux Kernel
I was able to fix the WiFi issue. The systemctl start wlgpio service that wh0 created had to be modified so instead of using GPIO0:2 it used GPIO0:6. I was able to see the usb messages appear, but they were only errors. I had forgotten to add the RTL8192 firmware on the kernel. I recompiled and tried again. This time I was able to see wireless networks, authenticate, but after that, it instantly dropped the link, and a message appeared on the console: rtl8192c_common firmware is not ready to run. Here is the dmesg output for that:
    [   73.020000] usb 1-4: new high-speed USB device number 4 using ehci-platform
    [   73.250000] rtl8192cu: Chip version 0x10
    [   73.370000] rtl8192cu: Board Type 0
    [   73.370000] rtl_usb: rx_max_size 15360, rx_urb_num 8, in_ep 1
    [   73.370000] rtl8192cu: Loading firmware rtlwifi/rtl8192cufw_TMSC.bin
    [   73.370000] ieee80211 phy0: Selected rate control algorithm 'rtl_rc'
    [   73.740000] rtl8192cu 1-4:1.0 wlxc4604401a0a3: renamed from wlan0
    [   74.070000] IPv6: ADDRCONF(NETDEV_UP): wlxc4604401a0a3: link is not ready
    [   74.070000] rtl8192cu: MAC auto ON okay!
    [   74.180000] rtl8192cu: Tx queue select: 0x05
    [   74.600000] rtl8192c_common: chksum report fail! REG_MCUFWDL:0x00030000 .
    [   74.600000] rtl8192c_common: Firmware is not ready to run!
    [   74.970000] IPv6: ADDRCONF(NETDEV_UP): wlxc4604401a0a3: link is not ready
    [   75.360000] rtl8192cu: MAC auto ON okay!
    [   75.390000] rtl8192cu: Tx queue select: 0x05
    [   75.770000] rtl8192c_common: chksum report fail! REG_MCUFWDL:0x00030000 .
    [   75.770000] rtl8192c_common: Firmware is not ready to run!
    [   76.130000] IPv6: ADDRCONF(NETDEV_UP): wlxc4604401a0a3: link is not ready
    [   76.970000] IPv6: ADDRCONF(NETDEV_UP): wlxc4604401a0a3: link is not ready
    [   78.900000] rtl8192cu: MAC auto ON okay!
    [   78.930000] rtl8192cu: Tx queue select: 0x05
    [   79.260000] rtl8192c_common: chksum report fail! REG_MCUFWDL:0x00030000 .
    [   79.260000] rtl8192c_common: Firmware is not ready to run!
    [   79.630000] IPv6: ADDRCONF(NETDEV_UP): wlxc4604401a0a3: link is not ready
    [   81.190000] wlxc4604401a0a3: authenticate with e4:c3:2a:d9:87:7f
    [   81.250000] wlxc4604401a0a3: send auth to e4:c3:2a:d9:87:7f (try 1/3)
    [   81.260000] wlxc4604401a0a3: authenticated
    [   81.310000] wlxc4604401a0a3: associate with e4:c3:2a:d9:87:7f (try 1/3)
    [   81.370000] wlxc4604401a0a3: RX AssocResp from e4:c3:2a:d9:87:7f (capab=0x411 status=0 aid=2)
    [   81.480000] wlxc4604401a0a3: associated
    [   81.580000] IPv6: ADDRCONF(NETDEV_CHANGE): wlxc4604401a0a3: link becomes ready
    [  128.080000] wlxc4604401a0a3: deauthenticating from e4:c3:2a:d9:87:7f by local choice (Reason: 3=DEAUTH_LEAVING)
    [  128.450000] rtl8192cu: MAC auto ON okay!
    [  128.490000] rtl8192cu: Tx queue select: 0x05
    [  128.850000] rtl8192c_common: chksum report fail! REG_MCUFWDL:0x00030000 .
    [  128.850000] rtl8192c_common: Firmware is not ready to run!
    [  129.220000] IPv6: ADDRCONF(NETDEV_UP): wlxc4604401a0a3: link is not ready
    [  129.420000] IPv6: ADDRCONF(NETDEV_UP): wlxc4604401a0a3: link is not ready
    [  131.430000] rtl_usb: reg 0x4, usbctrl_vendorreq TimeOut! status:0xffffffb9 value=0x4d5
    [  131.470000] rtl_usb: reg 0x4, usbctrl_vendorreq TimeOut! status:0xffffffb9 value=0x3902d2a
    [  131.520000] rtl_usb: reg 0x21, usbctrl_vendorreq TimeOut! status:0xffffffb9 value=0x2d2d2d00
    [  131.570000] rtl_usb: reg 0x0, usbctrl_vendorreq TimeOut! status:0xffffffb9 value=0x2d2d2d00
    [  132.170000] rtl8192cu: MAC auto ON okay!
I tried running sudo apt-get reinstall firmware-realtek, but nothing changed, even after a reboot. 
Also, now that I gave the dmesg a proper look, I noticed this:
i8042: i8042_platform_init: no devicetree node found
I dont know if i should try ti fix this message. I know about this patch, but i dont seem to be able to apply it to my cloned source:
fpp@FPP-PC:~/Documentos/linux-vtwm$ git apply patch1
error: patch corrupted on line 58

I dont know if i did something wrong. I just simply copied the latest message from Tony, pasted it onto a file called patch1 inside the source, and ran the avobe command.
I attach my new .config file.
.config

Alexey Charkov

unread,
Aug 4, 2023, 1:47:57 AM8/4/23
to vt8500-wm8505...@googlegroups.com
Regarding the internal serial port, it’s the ttyWMT0 device you mentioned you can see, so please just try that.

Regarding i8042, I think you mentioned your device is a WM8650, which doesn’t have i8042 at all, and its keyboard and touchpad are USB devices connected to the UHCI controller.

As for the WiFi firmware issue, maybe it’s just a version mismatch or a broken file, given that it complains about checksum failure. Perhaps try and download a firmware binary from the linux-firmware git repo from around the time your kernel version was released?

Best,
Alexey

Alexey Charkov

unread,
Aug 4, 2023, 1:54:18 AM8/4/23
to vt8500-wm8505...@googlegroups.com
On Fri, 4 Aug 2023 at 00:42, Franco Palombo <ffpp...@hotmail.com> wrote:

Something that I'm still not being able to figure out, is why does the Ethernet and the internal USB WiFi adapter and the serial console still not work. I know that they do actually work because on Android I can succesfully use them, but not here on debian. I think I included the necesary stuff to make the ethernet work, and I'm sure that I included the corect drivers for my internal adapter (I dissasembled the laptop to check with the IC markings), but still, after executing systemctl start wlgpio and verify that everithing is ok with systemctl status wlgpio, still, no Wireless networks show up on nmtui and no new network adapters show on nmcli. I even took the extra step of building the kernel again, this time including the drivers for a Ralink adapter I have, and this time I was able to connect to the internet and install some packages.

For Ethernet on WM8650 you need the VIA Rhine driver, looks like you’ve missed that one:

CONFIG_NET_VENDOR_VIA=y
# CONFIG_VIA_RHINE is not set
CONFIG_VIA_VELOCITY=y

Best,
Alexey

Franco Palombo

unread,
Aug 5, 2023, 12:46:23 AM8/5/23
to VT8500/WM8505 Linux Kernel
Thanks for the suggestions Alexey. I'm now able to use the serial console and also now I have a working ethernet connection. 
I still dont know whats stopping me from haveing a working keyboard on Linux 5.15, but from comparing the dmesg from Linux 4.14 and Linux 5.15, I can see that now I have one USB hub missing, probably the one in charge of the keyboard and mousepad (i think is the holtek one, but I'm not sure). I dont really know what to do there, so I hear any ideas from you. I've also disabled all i8042 related stuff, so no more of that too.
About the wifi, I havent tried downloading the fw from linux-firmware git because now on linux 5.15 i get different error messages. This time, no errors about the firmware not being ready or any checksum errors, but instead it seems to fail to gain an IP address. The difference from my previous tests is that I now included the firmware-realtek package in the multistrap.conf file, so all the firmware files get preinstalled onto the rootfs. Whats weird, is that from the debug messages I can see that it tries to load the rtl8192cufw_TMSC.bin firmware file, but whats a bit weird is that in the chip markings of the internal adaptor i can see written "RTL8188CTV". There are firmware files listed as rtl8188efw.bin and rtl8188eufw.bin. It would make more sense loading one of those files instead of the one is actually loading, but I may be wrong. I attach the dmesg file so you can take a look at the errors. I have attempted to connect to my home network, then to my mobile hotspot, then i tried switching the gpio to reset the adaptor and it automatically tried again to connect to my home network, and after that the system got really slow and unstable, so I had to turn off the gpio pin again to gain acces to the system back again.
I also changed some things on the config file. No big changes, I just disabled some uneeded stuff (I hope)
config
dmesg.txt

Franco Palombo

unread,
Aug 5, 2023, 1:01:30 AM8/5/23
to VT8500/WM8505 Linux Kernel
Well, I was wrong. Just rebooted once again to test for consistency and i got the firmware not ready and checksum errors. Later I'll try to use the firmware from linux-firmware, but i doubt it will make a difference. I think the issue is somewhere else.
Also, I forgot to add that it seems that the Linux kernel is only running with 128MB of ram, where I have 256MB. I can confirm that from android and the bootloader messages. Is there i have to change on the kernel to add those extra 128MB?

Alexey Charkov

unread,
Aug 5, 2023, 2:05:56 AM8/5/23
to vt8500-wm8505...@googlegroups.com
On Sat, 5 Aug 2023 at 09:01, Franco Palombo <ffpp...@hotmail.com> wrote:

Also, I forgot to add that it seems that the Linux kernel is only running with 128MB of ram, where I have 256MB. I can confirm that from android and the bootloader messages. Is there i have to change on the kernel to add those extra 128MB?

Try adding mem=256M to your kernel cmdline (either in .config or in the u-boot script)

As for WiFi, no further ideas so far…

Best,
Alexey

Alexey Charkov

unread,
Aug 5, 2023, 2:19:45 AM8/5/23
to vt8500-wm8505...@googlegroups.com
On Sat, 5 Aug 2023 at 08:46, Franco Palombo <ffpp...@hotmail.com> wrote:
Thanks for the suggestions Alexey. I'm now able to use the serial console and also now I have a working ethernet connection. 
I still dont know whats stopping me from haveing a working keyboard on Linux 5.15, but from comparing the dmesg from Linux 4.14 and Linux 5.15, I can see that now I have one USB hub missing, probably the one in charge of the keyboard and mousepad (i think is the holtek one, but I'm not sure). I dont really know what to do there, so I hear any ideas from you. I've also disabled all i8042 related stuff, so no more of that too.

Your UHCI controller driver fails to probe for some reason, which is why you don’t get your internal keyboard to work:
[    1.030000] uhci_hcd: USB Universal Host Controller Interface driver
[    1.040000] platform-uhci: probe of d8007b00.uhci failed with error -2

Error -2 is not super helpful though (it’s just -EINVAL if memory serves me right). Maybe it’s missing some resource in the OF probe path - need to check the driver code and perhaps add extra debug messages to figure out what’s wrong 


About the wifi, I havent tried downloading the fw from linux-firmware git because now on linux 5.15 i get different error messages. This time, no errors about the firmware not being ready or any checksum errors, but instead it seems to fail to gain an IP address. The difference from my previous tests is that I now included the firmware-realtek package in the multistrap.conf file, so all the firmware files get preinstalled onto the rootfs. Whats weird, is that from the debug messages I can see that it tries to load the rtl8192cufw_TMSC.bin firmware file, but whats a bit weird is that in the chip markings of the internal adaptor i can see written "RTL8188CTV". There are firmware files listed as rtl8188efw.bin and rtl8188eufw.bin. It would make more sense loading one of those files instead of the one is actually loading, but I may be wrong. I attach the dmesg file so you can take a look at the errors. I have attempted to connect to my home network, then to my mobile hotspot, then i tried switching the gpio to reset the adaptor and it automatically tried again to connect to my home network, and after that the system got really slow and unstable, so I had to turn off the gpio pin again to gain acces to the system back again.
I also changed some things on the config file. No big changes, I just disabled some uneeded stuff (I hope)

Judging by your dmesg, it actually loads fine at first and only then starts misbehaving. That leads me to believe the problem might be unrelated to your setup: maybe some power issue or some bug in the driver?

Best,
Alexey

Franco Palombo

unread,
Aug 5, 2023, 11:47:45 AM8/5/23
to VT8500/WM8505 Linux Kernel
Thanks for the suggestion of the mem argument, now I have 256MB of ram under Linux. I'll open an issue in super user and linux and unix forums to see if I can get any help with the wifi issue. Regarding the keyboard, now that you mentioned modifying the driver, I took a look at this old conversation, where the last thing you suggested was to comment something about the clock when the device was being probed. I commented those lines, and et volià. Now I have working keyboard. Mousepad is still untested since i dont have any gui installed. Once I can figure out whats the issue with the wifi, I'll start to build up the system with features and utilites, to be as close as a "modern system" in terms of functionality (that means using the internal storage as root)

Franco Palombo

unread,
Aug 5, 2023, 2:52:41 PM8/5/23
to VT8500/WM8505 Linux Kernel
While I wait for any responses on the forums I posted, I wanted to try to install a different driver instead of using the one is in the linux kernel. I wanted to try with this driver, but the instructions on the readme are for rebuilding the kernel on the target system, something that will take ages on the WM8650. I also don't know how to include it when building the kernel. I'm already looking for some guide on the internet, but if anyone can guide me on how to do it I'll appreciate it.

Alexey Charkov

unread,
Aug 5, 2023, 3:08:14 PM8/5/23
to vt8500-wm8505...@googlegroups.com
On Sat, 5 Aug 2023 at 22:52, Franco Palombo <ffpp...@hotmail.com> wrote:
While I wait for any responses on the forums I posted, I wanted to try to install a different driver instead of using the one is in the linux kernel. I wanted to try with this driver, but the instructions on the readme are for rebuilding the kernel on the target system, something that will take ages on the WM8650. I also don't know how to include it when building the kernel. I'm already looking for some guide on the internet, but if anyone can guide me on how to do it I'll appreciate it.

Try setting environment variables during the make step: CC to your crosscompiler, KVER to the full version string (as reported by uname -r) of the kernel you are compiling for, KSRC to the absolute path to the compiled kernel source. That should let you build it on the big machine.

Best,
Alexey

Franco Palombo

unread,
Aug 5, 2023, 4:06:45 PM8/5/23
to VT8500/WM8505 Linux Kernel
I just tried copying the source of the driver to drivers/net/wireless/rtl8188ce and added the corresponding source line to the Kconfig file of the wireless directory, and then I ran make ARCH=arm menuconfig to disable everything that had to do with realtek wifi and bt and I then enabled the new option Realtek RTL8192CE/RTL8188SE Wireless Network Adapter, but that didn't seem to work, so I'll what you said and see how it goes

Franco Palombo

unread,
Aug 5, 2023, 4:49:05 PM8/5/23
to VT8500/WM8505 Linux Kernel
It seems that there are some issues with this driver. I get this errors:
    /home/fpp/Documentos/rtl8188ce-linux-driver/pci.c: In function ‘rtl_pci_parse_configuration’:
    /home/fpp/Documentos/rtl8188ce-linux-driver/pci.c:389:9: error: implicit declaration of function ‘pcie_capability_read_word’ [-Werror=implicit-function-declaration]
      389 |         pcie_capability_read_word( pdev, PCI_EXP_LNKCTL, &linkctrl_reg );
          |         ^~~~~~~~~~~~~~~~~~~~~~~~~
    /home/fpp/Documentos/rtl8188ce-linux-driver/pci.c: In function ‘rtl_pci_intr_mode_msi’:
    /home/fpp/Documentos/rtl8188ce-linux-driver/pci.c:2083:15: error: implicit declaration of function ‘pci_enable_msi’; did you mean ‘pci_enable_sriov’? [-Werror=implicit-function-declaration]
     2083 |         ret = pci_enable_msi( rtlpci->pdev );
          |               ^~~~~~~~~~~~~~
          |               pci_enable_sriov
    /home/fpp/Documentos/rtl8188ce-linux-driver/pci.c:2090:17: error: implicit declaration of function ‘pci_disable_msi’; did you mean ‘pci_disable_sriov’? [-Werror=implicit-function-declaration]
     2090 |                 pci_disable_msi( rtlpci->pdev );
          |                 ^~~~~~~~~~~~~~~
          |                 pci_disable_sriov
    cc1: some warnings being treated as errors

I think that compiling anything related to PCI is unnecessary for the WM8650, but I dont know how to get rid of that. Someone already asked about this in the git but the dev didnt seem to fix it. I tried commenting the pci.o line on the PCI_MAIN_OBJS, but it threw a bunch of other errors:
      LD [M]  /home/fpp/Documentos/rtl8188ce-linux-driver/rtlwifi.o
    ld: /home/fpp/Documentos/rtl8188ce-linux-driver/base.o: relocations in generic ELF (EM: 40)
    ld: /home/fpp/Documentos/rtl8188ce-linux-driver/base.o: relocations in generic ELF (EM: 40)
    ld: /home/fpp/Documentos/rtl8188ce-linux-driver/base.o: relocations in generic ELF (EM: 40)
    ld: /home/fpp/Documentos/rtl8188ce-linux-driver/base.o: relocations in generic ELF (EM: 40)
    ld: /home/fpp/Documentos/rtl8188ce-linux-driver/base.o: relocations in generic ELF (EM: 40)
    ld: /home/fpp/Documentos/rtl8188ce-linux-driver/base.o: relocations in generic ELF (EM: 40)
    ld: /home/fpp/Documentos/rtl8188ce-linux-driver/base.o: relocations in generic ELF (EM: 40)
    ld: /home/fpp/Documentos/rtl8188ce-linux-driver/base.o: relocations in generic ELF (EM: 40)
    ld: /home/fpp/Documentos/rtl8188ce-linux-driver/base.o: relocations in generic ELF (EM: 40)
    ld: /home/fpp/Documentos/rtl8188ce-linux-driver/base.o: relocations in generic ELF (EM: 40)
    ld: /home/fpp/Documentos/rtl8188ce-linux-driver/base.o: relocations in generic ELF (EM: 40)
    ld: /home/fpp/Documentos/rtl8188ce-linux-driver/base.o: relocations in generic ELF (EM: 40)
    ld: /home/fpp/Documentos/rtl8188ce-linux-driver/base.o: relocations in generic ELF (EM: 40)
    ld: /home/fpp/Documentos/rtl8188ce-linux-driver/base.o: relocations in generic ELF (EM: 40)
    ld: /home/fpp/Documentos/rtl8188ce-linux-driver/base.o: relocations in generic ELF (EM: 40)
    ld: /home/fpp/Documentos/rtl8188ce-linux-driver/base.o: relocations in generic ELF (EM: 40)
    ld: /home/fpp/Documentos/rtl8188ce-linux-driver/base.o: relocations in generic ELF (EM: 40)
    ld: /home/fpp/Documentos/rtl8188ce-linux-driver/base.o: relocations in generic ELF (EM: 40)
    ld: /home/fpp/Documentos/rtl8188ce-linux-driver/base.o: relocations in generic ELF (EM: 40)
    ld: /home/fpp/Documentos/rtl8188ce-linux-driver/base.o: relocations in generic ELF (EM: 40)
    ld: /home/fpp/Documentos/rtl8188ce-linux-driver/base.o: relocations in generic ELF (EM: 40)
    ld: /home/fpp/Documentos/rtl8188ce-linux-driver/base.o: relocations in generic ELF (EM: 40)
    ld: /home/fpp/Documentos/rtl8188ce-linux-driver/base.o: relocations in generic ELF (EM: 40)
    ld: /home/fpp/Documentos/rtl8188ce-linux-driver/base.o: relocations in generic ELF (EM: 40)
    ld: /home/fpp/Documentos/rtl8188ce-linux-driver/base.o: relocations in generic ELF (EM: 40)
    ld: /home/fpp/Documentos/rtl8188ce-linux-driver/base.o: relocations in generic ELF (EM: 40)
    ld: /home/fpp/Documentos/rtl8188ce-linux-driver/base.o: relocations in generic ELF (EM: 40)
    ld: /home/fpp/Documentos/rtl8188ce-linux-driver/base.o: relocations in generic ELF (EM: 40)
    ld: /home/fpp/Documentos/rtl8188ce-linux-driver/base.o: relocations in generic ELF (EM: 40)
    ld: /home/fpp/Documentos/rtl8188ce-linux-driver/base.o: relocations in generic ELF (EM: 40)
    ld: /home/fpp/Documentos/rtl8188ce-linux-driver/base.o: relocations in generic ELF (EM: 40)
    ld: /home/fpp/Documentos/rtl8188ce-linux-driver/base.o: relocations in generic ELF (EM: 40)
    ld: /home/fpp/Documentos/rtl8188ce-linux-driver/base.o: relocations in generic ELF (EM: 40)
    ld: /home/fpp/Documentos/rtl8188ce-linux-driver/base.o: error al añadir símbolos: file in wrong format
    make[2]: *** [scripts/Makefile.build:486: /home/fpp/Documentos/rtl8188ce-linux-driver/rtlwifi.o] Error 1

I think i'll have to look for another driver...

Franco Palombo

unread,
Aug 6, 2023, 2:17:56 PM8/6/23
to VT8500/WM8505 Linux Kernel
Ok, I think i found something that could work. Using this git, I've been able to compile the kernel module, and now I have the .ko file, but I don't know where to put it so when I build the kernel it gets included.
So far, I did this (in the same order):
In kernel_5.15/:
    make clean
    make mrproper
    make ARCH=arm menuconfig
    make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- CFLAGS="-march=armv5te -mtune=arm926ej-s" -j6 zImage
    make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- CFLAGS="-march=armv5te -mtune=arm926ej-s" -j6 modules
In rtl8192eu-linux/:
    make clean
    make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- CFLAGS="-march=armv5te -mtune=arm926ej-s" KVER="5.15.64-g0ae752685214-dirty" KSRC="/home/fpp/Documentos/kernel-5.15/" -j6
Now, I have what i think is the compiled kernel module named 8192eu.ko in rtl8192eu-linux/, but I don't know how to proceed.

Alexey Charkov

unread,
Aug 6, 2023, 10:50:43 PM8/6/23
to vt8500-wm8505...@googlegroups.com
On Sun, 6 Aug 2023 at 22:17, Franco Palombo <ffpp...@hotmail.com> wrote:
Ok, I think i found something that could work. Using this git, I've been able to compile the kernel module, and now I have the .ko file, but I don't know where to put it so when I build the kernel it gets included.
So far, I did this (in the same order):
In kernel_5.15/:
    make clean
    make mrproper
    make ARCH=arm menuconfig
    make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- CFLAGS="-march=armv5te -mtune=arm926ej-s" -j6 zImage
    make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- CFLAGS="-march=armv5te -mtune=arm926ej-s" -j6 modules

Better not to mess with CFLAGS while building the kernel. Its build system already sets them optimally accounting for your target system, compiler version etc. On this system it probably makes no difference at all, given that the processor is pretty basic, but in case of more complex ones like x86-64 it might lead to runtime problems if the compiler gets overzealous with optimizations and emits instructions unsuitable for a particular kernel context.

In rtl8192eu-linux/:
    make clean
    make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- CFLAGS="-march=armv5te -mtune=arm926ej-s" KVER="5.15.64-g0ae752685214-dirty" KSRC="/home/fpp/Documentos/kernel-5.15/" -j6
Now, I have what i think is the compiled kernel module named 8192eu.ko in rtl8192eu-linux/, but I don't know how to proceed.

Just copy it over to your target machine inside a suitable subdirectory in /lib/modules, run depmod and then modprobe 8192eu

Best,
Alexey

Franco Palombo

unread,
Aug 6, 2023, 10:55:36 PM8/6/23
to VT8500/WM8505 Linux Kernel
I'm starting to give up on the wifi thing. I cant seem to find a good "fixed" repository of the rtl8192cu driver to compile, and the one I found avobe didnt work since it is for the eu version, not the cu version of the adapter. I also tried the rtl8xxxu driver, this time, standalone (no rtl8192cu support), and i did get more promising results, mainly no firmware checksum errors/firmware readyness, but I still wasnt able to connect to any wifi (authentication timed out).
Anyway, i want to keep going on this, so I installed xfce, openbox and LightDM and now i have a very nice gui. There are some things that i still want to try to get working, such as backlight/contrast control, webcam, and (hopefully) audio.
About the webcam, i was able to find the correct gpio pin to power it on (pin 7) and i can see the device listed on lsusb: ID 090c:037c Silicon Motion 300k pixel camera, but i cant seem to connect to it using webcam (v4l2: open /dev/video0: no such file or directory). I have enabled under "Cameras and Video Grabbers support" and "Video4Linux2 userspace api support" under "Device Drivers > Multimedia Support", but maybe I need another driver for the webcam itself.
Regarding the backlight and contrast control, I'm kinda lost there. I have tried to echo to some of the sysfs files that i think would control something with the backlight or contrast, but i always got permission errors. Also, I cant find anything related to backlight on sysfs. There is a PWM folder, but its empty, i dont know if I'm missing something. I have included the pwm controller support when building the kernel.
Also, i noticed that if i reduce the mem argument on the bootargs, I get a "better graphical performance". is there any explanation for that? or maybe its a false positive?

Alexey Charkov

unread,
Aug 7, 2023, 12:39:25 AM8/7/23
to vt8500-wm8505...@googlegroups.com
On Mon, 7 Aug 2023 at 06:55, Franco Palombo <ffpp...@hotmail.com> wrote:
I'm starting to give up on the wifi thing. I cant seem to find a good "fixed" repository of the rtl8192cu driver to compile, and the one I found avobe didnt work since it is for the eu version, not the cu version of the adapter. I also tried the rtl8xxxu driver, this time, standalone (no rtl8192cu support), and i did get more promising results, mainly no firmware checksum errors/firmware readyness, but I still wasnt able to connect to any wifi (authentication timed out).
Anyway, i want to keep going on this, so I installed xfce, openbox and LightDM and now i have a very nice gui. There are some things that i still want to try to get working, such as backlight/contrast control, webcam, and (hopefully) audio.

For backlight control you need the PWM backlight driver and the VT8500 PWM driver, plus also check if you have a backlight node in your dts

Contrast should be exposed in sysfs by the wm8505fb driver

Audio would require writing a new driver for the built-in I2S/AC97 controller (or porting the WonderMedia one to upstream kernel)

About the webcam, i was able to find the correct gpio pin to power it on (pin 7) and i can see the device listed on lsusb: ID 090c:037c Silicon Motion 300k pixel camera, but i cant seem to connect to it using webcam (v4l2: open /dev/video0: no such file or directory). I have enabled under "Cameras and Video Grabbers support" and "Video4Linux2 userspace api support" under "Device Drivers > Multimedia Support", but maybe I need another driver for the webcam itself.

Given that it shows up as a USB device, most likely you need the UVC (USB video class) driver - those things are standardized

Regarding the backlight and contrast control, I'm kinda lost there. I have tried to echo to some of the sysfs files that i think would control something with the backlight or contrast, but i always got permission errors.

Look for a sysfs node called “contrast” for wm8505fb. It will accept a single number echoed to it and apply it immediately. This is to be done as root

Also, I cant find anything related to backlight on sysfs. There is a PWM folder, but its empty, i dont know if I'm missing something. I have included the pwm controller support when building the kernel.

Backlight node might be missing from your dts. There’s been a related thread here recently, please check around 

Also, i noticed that if i reduce the mem argument on the bootargs, I get a "better graphical performance". is there any explanation for that? or maybe its a false positive?

The framebuffer driver uses CMA allocation, which carves out a region for it out of the memory available to the kernel (not above that space, as was done in WonderMedia kernels). So no, there should not be any interrelation. Even if there was any overlap between the framebuffer memory and the kernel memory, the only thing it would have led to would have been corrupt display output and eventual kernel crash, not a change in performance.

Best,
Alexey

Franco Palombo

unread,
Aug 7, 2023, 6:19:56 PM8/7/23
to VT8500/WM8505 Linux Kernel
Thanks for the suggestions Alexey, I'm now able to tune the contrast of the display. It seems like for WM8650, decimal 16 is the sweetspot for the contrast.
Regarding brightness control, I enabled the PWM backlight driver and I had to modify wm8650-mid.dts:
+ #include <dt-bindings/pwm/pwm.h>
/ {
model = "Wondermedia WM8650-MID Tablet";

+ backlight {
+ compatible = "pwm-backlight";
+ pwms = <&pwm 0 50000 PWM_POLARITY_INVERTED>;
+
+ brightness-levels = <0 40 60 80 100 130 190 255>;
+ default-brightness-level = <5>;
+ };
...
};
...

and wm8650.dtsi (otherwise I got compile errors):
{
...
soc {
...
pmc@d8130000 {
compatible = "via,vt8500-pmc";
reg = <0xd8130000 0x1000>;
clocks {
...
+ clkpwm: pwm {
+ #clock-cells = <0>;
+ compatible = "via,vt8500-device-clock";
+ clocks = <&pllb>;
+ divisor-reg = <0x350>;
+ enable-reg = <0x250>;
+ enable-bit = <17>;
+ };
...
};
};
...
+ pwm: pwm@d8220000 {
+ #pwm-cells = <3>;
+ compatible = "via,vt8500-pwm";
+ reg = <0xd8220000 0x100>;
+ clocks = <&clkpwm>;
+ };
...
};
};
};


When booting for the first time, the backlight was off. I echoed a 1 to /sys/class/backlight/backlight/bl_power and the display lit up, but I was not able to change the brightness. echoing to /sys/class/backlight/backlight/brightness had no effect. Then I thought that maybe I needed to power down the backlight and then back on, and to my surprise, when bl_power is on 0, changing brightness actually does something, but the values are inverted, 0 is 100% brightness. Whats weird, is that when i echo 4 to brightness, its really dim, to the point that it seems like its off, and from 0 to 1, the difference is quite abrupt. It feels like 1 is 20% brightness, 2 is 15%, 3 is 10% and 4 is close to 0%. from 5 to 7 there appears to be no difference. To solve the "logic" issue with bl_power, I tried to remove PWM_POLARITY_INVERTED from wm8650-mid.dts to hopefully reverse that behavior, but that resulted in an empty /sys/class/backlight/.

Franco Palombo

unread,
Aug 7, 2023, 9:36:15 PM8/7/23
to VT8500/WM8505 Linux Kernel
Ok, I was able to fix the polarity issue by replacing the PWM_POLARITY_INVERTED with a 0. I think its because a #define is missing under dt-bindings/pwm/pwm.h, because using PWM_POLARITY_NORMAL throws compilation errors. What I've also noticed, now that I have a proper way to control brightness and added all 255 "brightness values" to the .dts file, is that from value 255 to value 254, there is quite a big gap, and from 200 and below the difference is very hard to notice because it gets really dim. At first sight I thought that under 150 the backlight was off, but because I have the front cover off, I can see from the side of the lcd itself a backlight leak, and with all my lights off I can see that is really dim, but not off. I'm not looking for more brightness, instead I would like to know why is that big jump when I change from 255 to 254. I was thinking that maybe the memory addres of the duty cycle is wrong or maybe there is another thing that is causing this behavior.

Alexey Charkov

unread,
Aug 7, 2023, 11:44:30 PM8/7/23
to vt8500-wm8505...@googlegroups.com
Instead of removing it altogether, please try changing to PWM_POLARITY_NORMAL. I guess it won’t parse correctly if removed.

Best regards,
Alexey

Franco Palombo

unread,
Aug 8, 2023, 7:33:09 PM8/8/23
to VT8500/WM8505 Linux Kernel
As I said in the previous message, that resulted in compile errors. 

Regarding other things, I have been having some "issues" that i think are important to address. I'm getting too many "segmentation fault" messages, specially when using apt. Its not something specific to one installation, but instead is something that appears to be in all the installations I do. I don't know if it has to do with the fact that I might be "loading too much" this little CPU with all the packages and dependencies, or if there are issues with kernel 5.15. Add to that that apparently i cannot seem to properly compile kernel 4.14. In most cases i get a "garbage screen" right after the "Loading kernel" message from u-boot. I figured out that it had to do with my 32gb SD card (i think), so I switched to a slower, smaller 8gb unbranded Micro SD card. Add to that that I'm not having success switching to a "dynamic module" capable kernel. I get stuck at the u-boot messages/garbage screen on Linux 4.14 or i get this on kernel 5.15:
    [  276.880000] tmpfs: Unknown parameter 'mode'
    [  276.880000] systemd[1]: Failed to mount tmpfs at /dev/shm: Invalid argument
    [  276.890000] tmpfs: Unknown parameter 'mode'
    [  276.890000] systemd[1]: Failed to mount tmpfs at /run: Invalid argument
    [  276.900000] tmpfs: Unknown parameter 'mode'
    [  276.900000] systemd[1]: Failed to mount tmpfs at /run/lock: Invalid argument
    [!!!!!!] Failed to mount API filesystems.
    [  276.940000] systemd[1]: Freezing execution.

I'll try to see what can I be doing wrong, but i cant find something to try to fix. In any case, if anyone has any .config for kernel 4.14 with modules support, please, could you share it? I dont know what to disable in the kernel config to try to minimize the things that can be messing everything up

Franco Palombo

unread,
Aug 8, 2023, 7:56:48 PM8/8/23
to VT8500/WM8505 Linux Kernel
Forgot to attach my current .config for kernel 4.14. Its based from vt8500_v6_v7_defconfig, with the appropriate modifications
.config

Alexey Charkov

unread,
Aug 9, 2023, 12:02:45 AM8/9/23
to vt8500-wm8505...@googlegroups.com
On Wed, 9 Aug 2023 at 03:33, Franco Palombo <ffpp...@hotmail.com> wrote:
As I said in the previous message, that resulted in compile errors. 

Regarding other things, I have been having some "issues" that i think are important to address. I'm getting too many "segmentation fault" messages, specially when using apt. Its not something specific to one installation, but instead is something that appears to be in all the installations I do.

Which userspace are you using? Given that you have an ARMv5 machine, it will crash on any ARMv6+ instructions, and it might look as what you describe. Last time I checked, Debian ‘armel’ variant should have still been usable on those, but maybe even there some ARMv6 stuff crept in because noone actually compiles things on real ARMv5 these days.

I don't know if it has to do with the fact that I might be "loading too much" this little CPU with all the packages and dependencies, or if there are issues with kernel 5.15. Add to that that apparently i cannot seem to properly compile kernel 4.14.

What are the issues you get trying to compile it? Could you please post the errors and the full diff of any local modifications you made to the sources?

In most cases i get a "garbage screen" right after the "Loading kernel" message from u-boot.

Garbage screen sounds like the kernel trying to claim a memory region for the display adapter while it’s still using that region 

I figured out that it had to do with my 32gb SD card (i think), so I switched to a slower, smaller 8gb unbranded Micro SD card.

Sounds like an SDHC/SDXC issue. The controller won’t work with too new cards

Best regards,
Alexey

Franco Palombo

unread,
Aug 9, 2023, 11:24:05 AM8/9/23
to VT8500/WM8505 Linux Kernel
El miércoles, 9 de agosto de 2023 a la(s) 01:02:45 UTC-3, alc...@gmail.com escribió:
Which userspace are you using? 
I'm using Debian 11, built using  multistrap. I basically took wh0's bookconfig and I'm using that to create my rootfs.

What are the issues you get trying to compile it? Could you please post the errors and the full diff of any local modifications you made to the sources?
Actually none. The compilation finishes with no errors. The problems are when I try to boot the compiled kernel. Since I thought maybe one of my modification were messing things up, i decided to clone the whole
 testing-alchark branch again and not touch anything

Garbage screen sounds like the kernel trying to claim a memory region for the display adapter while it’s still using that region 
Now that you mention it, i tried to remove the mem argument and now it started to boot. It seems that using the mem argument with a value higher than 249M makes things go boom. Even on 249M, it prints garbage on the screen but then it seems to recover and continue with the kernel execution. Here is the serial output when using mem=249M:
    Starting kernel ...
    
    [    0.000000] Booting Linux on physical CPU 0x0
    [    0.000000] Linux version 4.14.0-rc2-329699-gdd86784db672 (fpp@FPP-PC) (gcc version 11.4.0 (Ubuntu 11.4.0-1ubuntu1~22.04)) #2 Tue Aug 8 21:13:32 -03 2023
    [    0.000000] CPU: ARM926EJ-S [41069265] revision 5 (ARMv5TEJ), cr=0005317f
    [    0.000000] CPU: VIVT data cache, VIVT instruction cache
    [    0.000000] OF: fdt: Machine model: Wondermedia WM8650-MID Tablet
    [    0.000000] Memory policy: Data cache writeback
    [    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 63246
    [    0.000000] Kernel command line: root=/dev/mmcblk0p2 rw rootwait mem=249M console=ttyWMT0,115200
    [    0.000000] PID hash table entries: 1024 (order: 0, 4096 bytes)
    [    0.000000] Dentry cache hash table entries: 32768 (order: 5, 131072 bytes)
    [    0.000000] Inode-cache hash table entries: 16384 (order: 4, 65536 bytes)
    [    0.000000] Memory: 245020K/254976K available (5120K kernel code, 204K rwdata, 776K rodata, 1024K init, 242K bss, 9956K reserved, 0K cma-reserved, 0K highmem)
    [    0.000000] Virtual kernel memory layout:
    [    0.000000]     vector  : 0xffff0000 - 0xffff1000   (   4 kB)
    [    0.000000]     fixmap  : 0xffc00000 - 0xfff00000   (3072 kB)
    [    0.000000]     vmalloc : 0xd0000000 - 0xff800000   ( 760 MB)
    [    0.000000]     lowmem  : 0xc0000000 - 0xcf900000   ( 249 MB)
    [    0.000000]     pkmap   : 0xbfe00000 - 0xc0000000   (   2 MB)
    [    0.000000]       .text : 0xc0008000 - 0xc0600000   (6112 kB)
    [    0.000000]       .init : 0xc0700000 - 0xc0800000   (1024 kB)
    [    0.000000]       .data : 0xc0800000 - 0xc08331c0   ( 205 kB)
    [    0.000000]        .bss : 0xc083811c - 0xc0874a0c   ( 243 kB)
    [    0.000000] SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
    [    0.000000] NR_IRQS: 16, nr_irqs: 16, preallocated irqs: 16
    [    0.000000] vt8500-irq: Added interrupt controller
    [    0.000000] vt8500-irq: Added interrupt controller
    [    0.000000] vt8500-irq: Enabled slave->parent interrupts
    [    0.000000] clocksource: vt8500_timer: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 637086815595 ns
    [    0.000000] sched_clock: 32 bits at 100 Hz, resolution 10000000ns, wraps every 21474836475000000ns
    [    0.000000] Console: colour dummy device 80x30
    [    0.060000] Calibrating delay loop... 348.97 BogoMIPS (lpj=1744896)
    [    0.060000] pid_max: default: 32768 minimum: 301
    [    0.060000] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
    [    0.060000] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
    [    0.060000] CPU: Testing write buffer coherency: ok
    [    0.060000] Setting up static identity map for 0x100000 - 0x100058
    [    0.060000] devtmpfs: initialized
    [    0.060000] VFP support v0.3: not present
    [    0.060000] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
    [    0.060000] futex hash table entries: 256 (order: -1, 3072 bytes)
    [    0.060000] pinctrl core: initialized pinctrl subsystem
    [    0.070000] random: get_random_u32 called from bucket_table_alloc+0x88/0x1ac with crng_init=0
    [    0.070000] NET: Registered protocol family 16
    [    0.070000] DMA: preallocated 256 KiB pool for atomic coherent allocations
    [    0.090000] SCSI subsystem initialized
    [    0.090000] usbcore: registered new interface driver usbfs
    [    0.090000] usbcore: registered new interface driver hub
    [    0.090000] usbcore: registered new device driver usb
    [    0.090000] random: fast init done
    [    0.090000] clocksource: Switched to clocksource vt8500_timer
    [    0.110000] NET: Registered protocol family 2
    [    0.110000] TCP established hash table entries: 2048 (order: 1, 8192 bytes)
    [    0.110000] TCP bind hash table entries: 2048 (order: 1, 8192 bytes)
    [    0.110000] TCP: Hash tables configured (established 2048 bind 2048)
    [    0.110000] UDP hash table entries: 256 (order: 0, 4096 bytes)
    [    0.110000] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
    [    0.110000] NET: Registered protocol family 1
    [    0.120000] RPC: Registered named UNIX socket transport module.
    [    0.120000] RPC: Registered udp transport module.
    [    0.120000] RPC: Registered tcp transport module.
    [    0.120000] RPC: Registered tcp NFSv4.1 backchannel transport module.
    [    0.120000] workingset: timestamp_bits=30 max_order=16 bucket_order=0
    [    0.130000] NFS: Registering the id_resolver key type
    [    0.130000] Key type id_resolver registered
    [    0.130000] Key type id_legacy registered
    [    0.140000] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 252)
    [    0.140000] io scheduler noop registered
    [    0.140000] io scheduler deadline registered
    [    0.140000] io scheduler cfq registered (default)
    [    0.140000] io scheduler mq-deadline registered
    [    0.140000] io scheduler kyber registered
    [    0.150000] pinctrl-wm8650 d8110000.pinctrl: Pin controller initialized
    [    0.150000] Enabled support for WMT GE raster acceleration
    [    0.170000] Console: switching to colour frame buffer device 100x30
    [    0.180000] fb0: wm8505-fb frame buffer at 0xf200000-0xf376fff
    [    0.350000] d8200000.serial: ttyWMT0 at MMIO 0xd8200000 (irq = 28, base_baud = 923076) is a VT8500 UART-1
    [    0.800000] console [ttyWMT0] enabled
    [    0.810000] libphy: Fixed MDIO Bus: probed
    [    0.810000] via-rhine d8004000.ethernet (unnamed net_device) (uninitialized): Reset not complete yet. Trying harder.
    [    0.820000] via-rhine d8004000.ethernet eth0: VIA Rhine III at 0xf8004000, 00:40:63:12:21:12, IRQ 30
    [    0.830000] via-rhine d8004000.ethernet eth0: MII PHY found at address 1, status 0x7869 advertising 01e1 Link cde1
    [    0.840000] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
    [    0.850000] ehci-platform: EHCI generic platform driver
    [    0.850000] ehci-platform d8007900.ehci: EHCI Host Controller
    [    0.860000] ehci-platform d8007900.ehci: new USB bus registered, assigned bus number 1
    [    0.870000] ehci-platform d8007900.ehci: irq 25, io mem 0xd8007900
    [    0.900000] hrtimer: interrupt took 31334 ns
    [    0.900000] ehci-platform d8007900.ehci: USB 2.0 started, EHCI 1.00
    [    0.910000] hub 1-0:1.0: USB hub found
    [    0.910000] hub 1-0:1.0: 4 ports detected
    [    0.910000] uhci_hcd: USB Universal Host Controller Interface driver
    [    0.920000] platform-uhci d8007b00.uhci: Generic UHCI Host Controller
    [    0.930000] platform-uhci d8007b00.uhci: new USB bus registered, assigned bus number 2
    [    0.930000] platform-uhci d8007b00.uhci: irq 25, io mem 0xd8007b00
    [    0.940000] hub 2-0:1.0: USB hub found
    [    0.940000] hub 2-0:1.0: 2 ports detected
    [    0.950000] usbcore: registered new interface driver usb-storage
    [    0.960000] vt8500-rtc d8100000.rtc: rtc core: registered vt8500-rtc as rtc0
    [    0.960000] IR NEC protocol handler initialized
    [    0.970000] IR RC5(x/sz) protocol handler initialized
    [    0.970000] IR RC6 protocol handler initialized
    [    0.980000] IR JVC protocol handler initialized
    [    0.980000] IR Sony protocol handler initialized
    [    0.980000] IR SANYO protocol handler initialized
    [    0.990000] IR Sharp protocol handler initialized
    [    0.990000] IR MCE Keyboard/mouse protocol handler initialized
    [    1.000000] IR XMP protocol handler initialized
    [    1.070000] wmt-sdhc d800a000.sdhc: WMT SDHC Controller initialized
    [    1.070000] usbcore: registered new interface driver usbhid
    [    1.080000] usbhid: USB HID core driver
    [    1.080000] NET: Registered protocol family 10
    [    1.090000] Segment Routing with IPv6
    [    1.090000] sit: IPv6, IPv4 and MPLS over IPv4 tunneling driver
    [    1.100000] Key type dns_resolver registered
    [    1.110000] vt8500-rtc d8100000.rtc: setting system clock to 2000-01-01 00:17:43 UTC (946685863[    1.120000] Waiting for root device /dev/mmcblk0p2...
    [    1.170000] mmc0: new high speed SDHC card at address e624
    [    1.180000] mmcblk0: mmc0:e624 SU32G 29.7 GiB
    [    1.180000]  mmcblk0: p1 p2
    [    1.220000] EXT4-fs (mmcblk0p2): couldn't mount as ext3 due to feature incompatibilities
    [    1.230000] EXT4-fs (mmcblk0p2): couldn't mount as ext2 due to feature incompatibilities
    [    1.270000] EXT4-fs (mmcblk0p2): mounted filesystem with ordered data mode. Opts: (null)
    [    1.280000] VFS: Mounted root (ext4 filesystem) on device 179:2.
    [    1.290000] devtmpfs: error mounting -2
    [    1.290000] Freeing unused kernel memory: 1024K
    [    1.300000] Kernel panic - not syncing: No working init found.  Try passing init= option to kernel. See Linux Documentation/admin-guide/init.rst for guidance.
    [    1.300000] CPU: 0 PID: 1 Comm: swapper Not tainted 4.14.0-rc2-329699-gdd86784db672 #2
    [    1.300000] Hardware name: VIA/Wondermedia SoC (Device Tree Support)
    [    1.300000] Backtrace:
    [    1.300000] [<c010b534>] (dump_backtrace) from [<c010b704>] (show_stack+0x18/0x1c)
    [    1.300000]  r6:00000000 r5:c0838334 r4:00000000
    [    1.300000] [<c010b6ec>] (show_stack) from [<c057e188>] (dump_stack+0x20/0x28)
    [    1.300000] [<c057e168>] (dump_stack) from [<c0114410>] (panic+0xbc/0x238)
    [    1.300000] [<c0114358>] (panic) from [<c0591910>] (kernel_init+0xd8/0x10c)
    [    1.300000]  r3:00000000 r2:00000cb2 r1:cf8e0300 r0:c0683444
    [    1.300000]  r7:00000000
    [    1.300000] [<c0591838>] (kernel_init) from [<c0107508>] (ret_from_fork+0x14/0x2c)
    [    1.300000]  r4:00000000
    [    1.300000] ---[ end Kernel panic - not syncing: No working init found.  Try passing init= option to kernel. See Linux Documentation/admin-guide/init.rst for guidance.
    [  130.660000] random: crng init done
Sounds like an SDHC/SDXC issue. The controller won’t work with too new cards
Well it actually does now. It didnt worked because I was using the mem=256M. With mem=249M it works.

Alexey Charkov

unread,
Aug 9, 2023, 2:15:49 PM8/9/23
to vt8500-wm8505...@googlegroups.com
On Wed, 9 Aug 2023 at 19:24, Franco Palombo <ffpp...@hotmail.com> wrote:
El miércoles, 9 de agosto de 2023 a la(s) 01:02:45 UTC-3, alc...@gmail.com escribió:
Which userspace are you using? 
I'm using Debian 11, built using  multistrap. I basically took wh0's bookconfig and I'm using that to create my rootfs.

armel or armhf architecture?

The former is supposed to be using ARMv5 instructions only, and no floating point instructions (WM8650 has no FPU, it only appeared in WM8750 - and even then it was VFP2 which is incompatible with the standard armhf build). The latter presumes ARMv7 instructions and direct access to hardware FPU (can’t remember if Debian builds for VFP3 or NEON, but WM8650 has neither)

What are the issues you get trying to compile it? Could you please post the errors and the full diff of any local modifications you made to the sources?
Actually none. The compilation finishes with no errors. The problems are when I try to boot the compiled kernel. Since I thought maybe one of my modification were messing things up, i decided to clone the whole
 testing-alchark branch again and not touch anything

Garbage screen sounds like the kernel trying to claim a memory region for the display adapter while it’s still using that region 
Now that you mention it, i tried to remove the mem argument and now it started to boot. It seems that using the mem argument with a value higher than 249M makes things go boom. Even on 249M, it prints garbage on the screen but then it seems to recover and continue with the kernel execution. Here is the serial output when using mem=249M:
    Starting kernel ...
    
    [    0.000000] Booting Linux on physical CPU 0x0
    [    0.000000] Linux version 4.14.0-rc2-329699-gdd86784db672 (fpp@FPP-PC) (gcc version 11.4.0 (Ubuntu 11.4.0-1ubuntu1~22.04)) #2 Tue Aug 8 21:13:32 -03 2023
    [    0.000000] CPU: ARM926EJ-S [41069265] revision 5 (ARMv5TEJ), cr=0005317f
    [    0.000000] CPU: VIVT data cache, VIVT instruction cache
    [    0.000000] OF: fdt: Machine model: Wondermedia WM8650-MID Tablet
    [    0.000000] Memory policy: Data cache writeback
    [    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 63246
    [    0.000000] Kernel command line: root=/dev/mmcblk0p2 rw rootwait mem=249M console=ttyWMT0,115200
    [    0.000000] PID hash table entries: 1024 (order: 0, 4096 bytes)
    [    0.000000] Dentry cache hash table entries: 32768 (order: 5, 131072 bytes)
    [    0.000000] Inode-cache hash table entries: 16384 (order: 4, 65536 bytes)
    [    0.000000] Memory: 245020K/254976K available (5120K kernel code, 204K rwdata, 776K rodata, 1024K init, 242K bss, 9956K reserved, 0K cma-reserved, 0K highmem)

0K cma-reserved is fishy. Please try adding something like ‘cma=8MB’ to the kernel command line, or alternatively set CONFIG_CMA_SIZE_MBYTES in config
This log looks perfectly normal, up until it just cannot execute /sbin/init. Do you have a symlink to systemd there or something executable?

Sounds like an SDHC/SDXC issue. The controller won’t work with too new cards
Well it actually does now. It didnt worked because I was using the mem=256M. With mem=249M it works.

That’s great, though I believe SDXC support only appeared in WM8850 :) Not sure about SDHC.

Best,
Alexey

Franco Palombo

unread,
Aug 9, 2023, 3:08:45 PM8/9/23
to VT8500/WM8505 Linux Kernel
El miércoles, 9 de agosto de 2023 a la(s) 15:15:49 UTC-3, alc...@gmail.com escribió:
armel or armhf architecture?
armel. 
 
0K cma-reserved is fishy. Please try adding something like ‘cma=8MB’ to the kernel command line, or alternatively set CONFIG_CMA_SIZE_MBYTES in config
Tried to add cma=8 but it dosent seem to do anything:
    Starting kernel ...


    Booting Linux on physical CPU 0x0
    Linux version 4.14.0-rc2-329699-gdd86784db672 (fpp@FPP-PC) (gcc version 11.4.0 (Ubuntu 11.4.0-1ubuntu1~22.04)) #5 Wed Aug 9 14:48:29 -03 2023

    CPU: ARM926EJ-S [41069265] revision 5 (ARMv5TEJ), cr=0005317f
    CPU: VIVT data cache, VIVT instruction cache
    OF: fdt: Machine model: Wondermedia WM8650-MID Tablet
    Memory policy: Data cache writeback
    random: fast init done

    Built 1 zonelists, mobility grouping on.  Total pages: 63246
    Kernel command line: root=/dev/mmcblk0p2 rw rootwait mem=249M cma=8M console=ttyWMT0,115200

    PID hash table entries: 1024 (order: 0, 4096 bytes)
    Dentry cache hash table entries: 32768 (order: 5, 131072 bytes)
    Inode-cache hash table entries: 16384 (order: 4, 65536 bytes)
    Memory: 246528K/254976K available (4595K kernel code, 224K rwdata, 796K rodata, 136K init, 228K bss, 8448K reserved, 0K cma-reserved)
    Virtual kernel memory layout:

        vector  : 0xffff0000 - 0xffff1000   (   4 kB)
        fixmap  : 0xffc00000 - 0xfff00000   (3072 kB)
        vmalloc : 0xd0000000 - 0xff800000   ( 760 MB)
        lowmem  : 0xc0000000 - 0xcf900000   ( 249 MB)
          .text : 0xc0008000 - 0xc0485160   (4597 kB)
          .init : 0xc056c000 - 0xc058e000   ( 136 kB)
          .data : 0xc058e000 - 0xc05c6380   ( 225 kB)
           .bss : 0xc05cb6f0 - 0xc0604784   ( 229 kB)

    SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1

It looks like I was missing some stuff regarding DMA on my kernel .config, so I enabled what I thought it was needed but still, no change. It wasnt until i enabled CONFIG_DMA_CMA that cma-reserved memory got changed:
    Starting kernel ...

    
    Booting Linux on physical CPU 0x0
    Linux version 4.14.0-rc2-329699-gdd86784db672 (fpp@FPP-PC) (gcc version 11.4.0 (Ubuntu 11.4.0-1ubuntu1~22.04)) #8 Wed Aug 9 15:55:39 -03 2023

    CPU: ARM926EJ-S [41069265] revision 5 (ARMv5TEJ), cr=0005317f
    CPU: VIVT data cache, VIVT instruction cache
    OF: fdt: Machine model: Wondermedia WM8650-MID Tablet
    Memory policy: Data cache writeback
    cma: Reserved 8 MiB at 0x0f000000
    random: fast init done

    Built 1 zonelists, mobility grouping on.  Total pages: 63246
    Kernel command line: root=/dev/mmcblk0p2 rw rootwait mem=249M cma=8M console=ttyWMT0,115200

    PID hash table entries: 1024 (order: 0, 4096 bytes)
    Dentry cache hash table entries: 32768 (order: 5, 131072 bytes)
    Inode-cache hash table entries: 16384 (order: 4, 65536 bytes)
    Memory: 238188K/254976K available (4589K kernel code, 203K rwdata, 956K rodata, 136K init, 228K bss, 8596K reserved, 8192K cma-reserved)
    Virtual kernel memory layout:

        vector  : 0xffff0000 - 0xffff1000   (   4 kB)
        fixmap  : 0xffc00000 - 0xfff00000   (3072 kB)
        vmalloc : 0xd0000000 - 0xff800000   ( 760 MB)
        lowmem  : 0xc0000000 - 0xcf900000   ( 249 MB)
        modules : 0xbf000000 - 0xc0000000   (  16 MB)
          .text : 0xc0008000 - 0xc0483810   (4591 kB)
          .init : 0xc0592000 - 0xc05b4000   ( 136 kB)
          .data : 0xc05b4000 - 0xc05e6d20   ( 204 kB)
           .bss : 0xc05ec150 - 0xc062539c   ( 229 kB)

    SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1

Now, that seems to have made something change regarding the 256MB problem. Now it can boot with 256MB of ram, but there is some garbage on the bottom of the screen that changes while booting. Text that goes over that area gets corrupted:


This log looks perfectly normal, up until it just cannot execute /sbin/init. Do you have a symlink to systemd there or something executable?
Sorry, I forgot to say that I was just running the kernel only. No rootfs or nothing. Now I have it with debian 11 (armel, from wh0) and no segmentation faults so far, but only running with 128MB of ram. I have to say that the defconf file I was using previously has quite some stuff missing to boot (at least with my rootfs). It wasn't capable of mounting filesystems, had no cgroups, and something with networking seems to be missing because it wasn't able to obtain an IP address, so I'm back using wh0's seed file with the appropriate modifications for wm8650.
In any case, I'll attach my current kernel config.
.config

Alexey Charkov

unread,
Aug 10, 2023, 9:27:32 AM8/10/23
to vt8500-wm8505...@googlegroups.com
On Wed, Aug 9, 2023 at 11:08 PM Franco Palombo <ffpp...@hotmail.com> wrote:
Now, that seems to have made something change regarding the 256MB problem. Now it can boot with 256MB of ram, but there is some garbage on the bottom of the screen that changes while booting. Text that goes over that area gets corrupted:

Sounds like there is overlap between the framebuffer memory region and something else in memory, which shouldn't happen. Does it persist if you set aside a larger chunk of memory for CMA, like 64MB?

Another random guess is that there is something wrong with the alignment of the starting memory address of the framebuffer region - would be great to check which address it tries to use. Maybe try enabling CONFIG_CMA_DEBUG and look for /proc/cmainfo?

Best,
Alexey

Franco Palombo

unread,
Aug 10, 2023, 7:18:13 PM8/10/23
to VT8500/WM8505 Linux Kernel
Sounds like there is overlap between the framebuffer memory region and something else in memory, which shouldn't happen. Does it persist if you set aside a larger chunk of memory for CMA, like 64MB?
Ok, cma=64M allowed me to boot  with 256MB of ram. Here is the initial kernel output:
    Starting kernel ...
    
    Booting Linux on physical CPU 0x0
    Linux version 4.14.0-rc2-329699-gdd86784db672-dirty (fpp@FPP-PC) (gcc version 11.4.0 (Ubuntu 11.4.0-1ubuntu1~22.04)) #12 Thu Aug 10 20:04:09 -03 2023

    CPU: ARM926EJ-S [41069265] revision 5 (ARMv5TEJ), cr=0005317f
    CPU: VIVT data cache, VIVT instruction cache
    OF: fdt: Machine model: Wondermedia WM8650-MID Tablet
    Memory policy: Data cache writeback
    cma: Reserved 64 MiB at 0x0c000000
    random: fast init done
    Built 1 zonelists, mobility grouping on.  Total pages: 65024
    Kernel command line: root=/dev/mmcblk0p2 rw rootwait mem=256M cma=64M console=ttyWMT0,115200

    PID hash table entries: 1024 (order: 0, 4096 bytes)
    Dentry cache hash table entries: 32768 (order: 5, 131072 bytes)
    Inode-cache hash table entries: 16384 (order: 4, 65536 bytes)
    Memory: 187732K/262144K available (4655K kernel code, 207K rwdata, 1008K rodata, 140K init, 228K bss, 8876K reserved, 65536K cma-reserved)

    Virtual kernel memory layout:
        vector  : 0xffff0000 - 0xffff1000   (   4 kB)
        fixmap  : 0xffc00000 - 0xfff00000   (3072 kB)
        vmalloc : 0xd0800000 - 0xff800000   ( 752 MB)
        lowmem  : 0xc0000000 - 0xd0000000   ( 256 MB)

        modules : 0xbf000000 - 0xc0000000   (  16 MB)
          .text : 0xc0008000 - 0xc04942f0   (4657 kB)
          .init : 0xc05b1000 - 0xc05d4000   ( 140 kB)
          .data : 0xc05d4000 - 0xc0607c60   ( 208 kB)
           .bss : 0xc060d138 - 0xc06464bc   ( 229 kB)

    SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1

Another random guess is that there is something wrong with the alignment of the starting memory address of the framebuffer region - would be great to check which address it tries to use. Maybe try enabling CONFIG_CMA_DEBUG and look for /proc/cmainfo?
Ok, I wasn't able to find /proc/cmainfo, but I do have /sys/kernel/debug/cma (CONFIG_CMA_DEBUGFS). I can't find how to have that cmainfo file.

Also, I was able to fix the WiFi issue using this driver.

 

Alexey Charkov

unread,
Aug 11, 2023, 1:35:18 AM8/11/23
to vt8500-wm8505...@googlegroups.com
On Fri, 11 Aug 2023 at 03:18, Franco Palombo <ffpp...@hotmail.com> wrote:
Sounds like there is overlap between the framebuffer memory region and something else in memory, which shouldn't happen. Does it persist if you set aside a larger chunk of memory for CMA, like 64MB?
Ok, cma=64M allowed me to boot  with 256MB of ram. Here is the initial kernel output:

Sounds good! Does the display corruption issue still persist with a larger CMA pool?

Another random guess is that there is something wrong with the alignment of the starting memory address of the framebuffer region - would be great to check which address it tries to use. Maybe try enabling CONFIG_CMA_DEBUG and look for /proc/cmainfo?
Ok, I wasn't able to find /proc/cmainfo, but I do have /sys/kernel/debug/cma (CONFIG_CMA_DEBUGFS). I can't find how to have that cmainfo file.

Maybe that interface wasn’t available in 4.14

Another way to check would be to just go and add a printk in drivers/video/fbdev/wm8505fb.c after line 338 to show what it gets in fb_mem_phys and fb_mem_len

Also, I was able to fix the WiFi issue using this driver.

Great! Now thinking of it, using a driver from backports could have also been an option, but if that one works for you I’d rather not change anything :)

Best,
Alexey

Franco Palombo

unread,
Aug 11, 2023, 11:02:22 AM8/11/23
to VT8500/WM8505 Linux Kernel
Sounds good! Does the display corruption issue still persist with a larger CMA pool?
 Nope, no issues at all

Another way to check would be to just go and add a printk in drivers/video/fbdev/wm8505fb.c after line 338 to show what it gets in fb_mem_phys and fb_mem_len
Ok, I added  printk(KERN_EMERG, "FB_DEBUG: phys: 0x%X, len: 0x%X\n\r", fb_mem_phys, fb_mem_len); to line 339 on drivers/video/fbdev/wm8505fb.c, recompiled, and I wasn't able to find that message while booting or in dmesg. But while looking I found this: [    0.170000] fb0: wm8505-fb frame buffer at 0xf100000-0xf276fff. Also, for this test I forgot to add the cma=64MB line, and thanks to CONFIG_DMA_CMA that was set to 16M, there was no garbage on screen. This is the full serial output until systemd starts:
    Starting kernel ...
    
    Booting Linux on physical CPU 0x0
    Linux version 4.14.0-rc2-329699-gdd86784db672-dirty (fpp@FPP-PC) (gcc version 11.4.0 (Ubuntu 11.4.0-1ubuntu1~22.04)) #15 Fri Aug 11 11:46:14 -03 2023

    CPU: ARM926EJ-S [41069265] revision 5 (ARMv5TEJ), cr=0005317f
    CPU: VIVT data cache, VIVT instruction cache
    OF: fdt: Machine model: Wondermedia WM8650-MID Tablet
    Memory policy: Data cache writeback
    cma: Reserved 16 MiB at 0x0f000000

    Built 1 zonelists, mobility grouping on.  Total pages: 65024
    Kernel command line: root=/dev/mmcblk0p2 rw rootwait mem=256M console=ttyWMT0,115200

    PID hash table entries: 1024 (order: 0, 4096 bytes)
    Dentry cache hash table entries: 32768 (order: 5, 131072 bytes)
    Inode-cache hash table entries: 16384 (order: 4, 65536 bytes)
    Memory: 236980K/262144K available (4655K kernel code, 207K rwdata, 1008K rodata, 140K init, 228K bss, 8780K reserved, 16384K cma-reserved)

    Virtual kernel memory layout:
        vector  : 0xffff0000 - 0xffff1000   (   4 kB)
        fixmap  : 0xffc00000 - 0xfff00000   (3072 kB)
        vmalloc : 0xd0800000 - 0xff800000   ( 752 MB)
        lowmem  : 0xc0000000 - 0xd0000000   ( 256 MB)
        modules : 0xbf000000 - 0xc0000000   (  16 MB)
          .text : 0xc0008000 - 0xc0494310   (4657 kB)

          .init : 0xc05b1000 - 0xc05d4000   ( 140 kB)
          .data : 0xc05d4000 - 0xc0607c60   ( 208 kB)
           .bss : 0xc060d138 - 0xc06464bc   ( 229 kB)
    SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
    NR_IRQS: 16, nr_irqs: 16, preallocated irqs: 16
    vt8500-irq: Added interrupt controller
    vt8500-irq: Added interrupt controller

    vt8500-irq: Enabled slave->parent interrupts
    clocksource: vt8500_timer: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 637086815595 ns
    sched_clock: 32 bits at 100 Hz, resolution 10000000ns, wraps every 21474836475000000ns
    vConsole: colour dummy device 80x30

    Calibrating delay loop... 348.97 BogoMIPS (lpj=1744896)
    pid_max: default: 32768 minimum: 301
    Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
    Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)

    CPU: Testing write buffer coherency: ok
    Setting up static identity map for 0x8400 - 0x8458
    devtmpfs: initialized
    random: get_random_u32 called from bucket_table_alloc+0x80/0x1a4 with crng_init=0

    clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
    futex hash table entries: 256 (order: -1, 3072 bytes)
    pinctrl core: initialized pinctrl subsystem
    NET: Registered protocol family 16
    DMA: preallocated 256 KiB pool for atomic coherent allocations
    SCSI subsystem initialized

    usbcore: registered new interface driver usbfs
    usbcore: registered new interface driver hub
    usbcore: registered new device driver usb
    random: fast init done

    clocksource: Switched to clocksource vt8500_timer
    NET: Registered protocol family 2
    TCP established hash table entries: 2048 (order: 1, 8192 bytes)
    TCP bind hash table entries: 2048 (order: 1, 8192 bytes)
    TCP: Hash tables configured (established 2048 bind 2048)
    UDP hash table entries: 256 (order: 0, 4096 bytes)
    UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
    NET: Registered protocol family 1
    workingset: timestamp_bits=30 max_order=16 bucket_order=0
    ntfs: driver 2.1.32 [Flags: R/O].
    fuse init (API version 7.26)
    Block layer SCSI generic (bsg) driver version 0.4 loaded (major 251)
    io scheduler noop registered
    io scheduler deadline registered

    io scheduler cfq registered (default)
    io scheduler mq-deadline registered
    io scheduler kyber registered

    pinctrl-wm8650 d8110000.pinctrl: Pin controller initialized
    pwm-backlight backlight: invalid default brightness level: 7, using 6

    Enabled support for WMT GE raster acceleration
    Console: switching to colour frame buffer device 100x30
    fb0: wm8505-fb frame buffer at 0xf100000-0xf276fff

    d8200000.serial: ttyWMT0 at MMIO 0xd8200000 (irq = 28, base_baud = 923076) is a VT8500 UART-1
    console [ttyWMT0] enabled
    loop: module loaded

    via-rhine d8004000.ethernet (unnamed net_device) (uninitialized): Reset not complete yet. Trying harder.
    via-rhine d8004000.ethernet eth0: VIA Rhine III at 0xf8004000, 00:40:63:12:21:12, IRQ 30
    via-rhine d8004000.ethernet eth0: MII PHY found at address 1, status 0x7849 advertising 01e1 Link 0001

    ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
    ehci-platform: EHCI generic platform driver
    ehci-platform d8007900.ehci: EHCI Host Controller
    ehci-platform d8007900.ehci: new USB bus registered, assigned bus number 1
    ehci-platform d8007900.ehci: irq 25, io mem 0xd8007900
    ehci-platform d8007900.ehci: USB 2.0 started, EHCI 1.00
    hub 1-0:1.0: USB hub found
    hub 1-0:1.0: 4 ports detected
    uhci_hcd: USB Universal Host Controller Interface driver
    platform-uhci d8007b00.uhci: Generic UHCI Host Controller
    platform-uhci d8007b00.uhci: new USB bus registered, assigned bus number 2
    platform-uhci d8007b00.uhci: irq 25, io mem 0xd8007b00
    hub 2-0:1.0: USB hub found
    hub 2-0:1.0: 2 ports detected
    usbcore: registered new interface driver usb-storage
    usbcore: registered new interface driver usbserial
    usbcore: registered new interface driver ftdi_sio
    usbserial: USB Serial support registered for FTDI USB Serial Device
    usbcore: registered new interface driver pl2303
    usbserial: USB Serial support registered for pl2303

    vt8500-rtc d8100000.rtc: rtc core: registered vt8500-rtc as rtc0
    IR NEC protocol handler initialized
    IR RC5(x/sz) protocol handler initialized
    IR RC6 protocol handler initialized
    IR JVC protocol handler initialized
    IR Sony protocol handler initialized
    IR SANYO protocol handler initialized
    IR Sharp protocol handler initialized
    IR MCE Keyboard/mouse protocol handler initialized
    IR XMP protocol handler initialized
    device-mapper: ioctl: 4.36.0-ioctl (2017-06-09) initialised: dm-d...@redhat.com

    wmt-sdhc d800a000.sdhc: WMT SDHC Controller initialized
    usbcore: registered new interface driver usbhid
    usbhid: USB HID core driver
    NET: Registered protocol family 10
    Segment Routing with IPv6

    sit: IPv6, IPv4 and MPLS over IPv4 tunneling driver
    NET: Registered protocol family 17
    vt8500-rtc d8100000.rtc: setting system clock to 2023-08-11 14:46:52 UTC (1691765212)Waiting for root device /dev/mmcblk0p2...

    mmc0: new high speed SDHC card at address e624
    mmcblk0: mmc0:e624 SU32G 29.7 GiB
     mmcblk0: p1 p2

    EXT4-fs (mmcblk0p2): couldn't mount as ext3 due to feature incompatibilities
    EXT4-fs (mmcblk0p2): couldn't mount as ext2 due to feature incompatibilities
    EXT4-fs (mmcblk0p2): mounted filesystem with ordered data mode. Opts: (null)
    VFS: Mounted root (ext4 filesystem) on device 179:2.
    devtmpfs: mounted
    Freeing unused kernel memory: 140K
    This architecture does not have kernel memory protection.
    usb 2-2: new low-speed USB device number 2 using platform-uhci
    input: USB Keyboard as /devices/platform/soc/d8007b00.uhci/usb2/2-2/2-2:1.0/0003:04D9:2BA0.0001/input/input0
    hid-generic 0003:04D9:2BA0.0001: input: USB HID v1.10 Keyboard [USB Keyboard] on usb-d8007b00.uhci-2/input0
    systemd[1]: Failed to find module 'autofs4'
    input: USB Keyboard as /devices/platform/soc/d8007b00.uhci/usb2/2-2/2-2:1.1/0003:04D9:2BA0.0002/input/input1
    cgroup: cgroup2: unknown option "memory_recursiveprot"
    usb 1-3: new high-speed USB device number 3 using ehci-platform
    systemd[1]: systemd 247.3-7+deb11u2 running in system mode. (+PAM +AUDIT +SELINUX +IMA +APPARMOR +SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ +LZ4 +ZSTD     +SECCOMP +BLKID +ELFUTILS +KMOD +IDN2 -IDN +PCRE2 default-hierarchy=unified)
    hid-generic 0003:04D9:2BA0.0002: input: USB HID v1.10 Mouse [USB Keyboard] on usb-d8007b00.uhci-2/input1
    systemd[1]: Detected architecture arm.
    
    Welcome to Debian GNU/Linux 11 (bullseye)!

What is weird, is that I tested Linux 5.15 again, this time making sure it had no cma or dma, and none of the graphical issues appeared. Its kind of weird

Peter Vasil

unread,
Aug 11, 2023, 12:47:59 PM8/11/23
to vt8500-wm8505...@googlegroups.com
Hi everyone,
my wm8650 mini-notebook ended its life merrily as a friends' children's interactive toy, so I can't test anything anymore :-( so just a few observations...

Actually the first sign of a problem is here - "devtmpfs: error mounting -2" - which suggests there's no /dev directory in your mounted root, or it's not accessible. Are you sure your root is ok?
Another issue might be userspace vs kernel features incompatibility. I've seen elsewhere in your pasted boot logs messages like "tmpfs: Unknown parameter 'mode'", which suggest your userspace is trying to use tmpfs feature your kernel does not support - either obsolete removed ones, or (more likely) ones not present in your kernel build config, or perhaps even too recent ones not present in your kernel version (shouldn't happen with deb11+kernel5.15, but may VERY easily happen with deb11+kernel4.14), even if your log ultimately says "Mounted root...".
I have lots of similar issues with my nokia n810 development setup ; it has omap2420 soc - that's arm11, which should be armv6, but even SO I had to use older release (deb9-armel I think, but can't verify till tomorrow evening) to get a +/- stable userspace. Especially watch out for systemd - it expects things from kernel you may have problems with in <5.x.
Anyway, afaict your kernel is built with auto-devtmpfs mount which already fails before any /sbin/init; i'd start checking there. That has nothing to do with any userspace/debX/systemd issues.
It MIGHT be caused by some kind of incompatibility between your kernel and ext4 root partition. ext2/2/4 has lots of features; you'd be surprised what kinds of problems can pop up when you do a carefree mkfs.ext4 under kernel6.X (or flash such a prebuilt deb11 image to your sd) and then try to mount that in kernel4.X/5.X ...

TL;DR: you seem to have a problem with rootfs long before init exec, even if it does not report any problems directly - check carefully your sd-card ext4 rootfs is fully feature-compatible with your cureently booted kernel. Especially if you use same rootfs for different major kernel builds.


Sounds like an SDHC/SDXC issue. The controller won’t work with too new cards
Well it actually does now. It didnt worked because I was using the mem=256M. With mem=249M it works.

That’s great, though I believe SDXC support only appeared in WM8850 :) Not sure about SDHC.

Best,
Alexey

--
You received this message because you are subscribed to the Google Groups "VT8500/WM8505 Linux Kernel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vt8500-wm8505-linux...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vt8500-wm8505-linux-kernel/CABjd4YwQpQaUDigoW-qntxq0os-pGQv0O0XtCewjEEddSQAn0w%40mail.gmail.com.

Franco Palombo

unread,
Aug 11, 2023, 6:30:42 PM8/11/23
to VT8500/WM8505 Linux Kernel
El viernes, 11 de agosto de 2023 a la(s) 13:47:59 UTC-3, peter...@gmail.com escribió:
Actually the first sign of a problem is here - "devtmpfs: error mounting -2" - which suggests there's no /dev directory in your mounted root, or it's not accessible. Are you sure your root is ok?
Well, for that test, as I said two or three messages after, I had no root partition. No debian or nothing, I just had the fat32 partition with the kernel an boot script. Thats why it failed. Now it works perfectly fine as you can see on one of my latest messages. 

Another issue might be userspace vs kernel features incompatibility. I've seen elsewhere in your pasted boot logs messages like "tmpfs: Unknown parameter 'mode'", which suggest your userspace is trying to use tmpfs feature your kernel does not support - either obsolete removed ones, or (more likely) ones not present in your kernel build config, or perhaps even too recent ones not present in your kernel version (shouldn't happen with deb11+kernel5.15, but may VERY easily happen with deb11+kernel4.14), even if your log ultimately says "Mounted root...".
The issue there was that in my kernel config had FUSE and autofs4 disabled. For that config I had used as a base the vt8500_v6_v7_defconfig file, wich appearently has quite some stuff missing, and that's why I wasn't having any success.

I have lots of similar issues with my nokia n810 development setup ; it has omap2420 soc - that's arm11, which should be armv6, but even SO I had to use older release (deb9-armel I think, but can't verify till tomorrow evening) to get a +/- stable userspace. Especially watch out for systemd - it expects things from kernel you may have problems with in <5.x.
Yep, the systemd present in debian bookworm is constantly spitting issues with /proc/ not being how is supposed to, and because of that, with kernel 4.14 I'm stuck with debian 11.

Anyway, afaict your kernel is built with auto-devtmpfs mount which already fails before any /sbin/init; i'd start checking there. That has nothing to do with any userspace/debX/systemd issues.
Ok, the question would be: How do I check? I'm sorry if seem to not know, and its because I really don't know much about compiling the linux kernel. Its actually my first time doing it for real, and I think I got the basics sorted out pretty quickly, but I get lost easily when stuff that isn't clearly visible start to break things up.

It MIGHT be caused by some kind of incompatibility between your kernel and ext4 root partition. ext2/2/4 has lots of features; you'd be surprised what kinds of problems can pop up when you do a carefree mkfs.ext4 under kernel6.X (or flash such a prebuilt deb11 image to your sd) and then try to mount that in kernel4.X/5.X ...
Regarding that, I'm formatting the SDcard on Linux Mint 21.1 (5.15) using the gnome disks manager. Should I try to format the disk in another way?

Guest⁠ ⁠

unread,
Aug 11, 2023, 9:38:43 PM8/11/23
to VT8500/WM8505 Linux Kernel
>  I added  printk(KERN_EMERG, "FB_DEBUG: phys: 0x%X, len: 0x%X\n\r", fb_mem_phys, fb_mem_len); to line 339 on drivers/video/fbdev/wm8505fb.c, recompiled, and I wasn't able to find that message while booting or in dmesg.

It should be like `printk(KERN_EMERG "FB_DEBUG: ...\n", ...);`, i.e. with no comma after the log level macro. It concatenates it at the beginning of the message, not as a separate argument.

Franco Palombo

unread,
Aug 11, 2023, 11:38:25 PM8/11/23
to VT8500/WM8505 Linux Kernel
El viernes, 11 de agosto de 2023 a la(s) 22:38:43 UTC-3, Guest⁠ ⁠ escribió:
It should be like `printk(KERN_EMERG "FB_DEBUG: ...\n", ...);`, i.e. with no comma after the log level macro. It concatenates it at the beginning of the message, not as a separate argument.
Thanks for the suggestion. I modified the line to: printk(KERN_EMERG "FB_DEBUG: phys: 0x%X, len: 0x%X\n", fb_mem_phys, fb_mem_len);, but it still doesn't print anything. I can see that its being compiled because it complains about the format specifier, but nothing gets printed to the serial output or dmesg. 
In any case, the:
 fb0: wm8505-fb frame buffer at 0xf100000-0xf276fff
is printed by the next:
fb_info(&fbi->fb, "%s frame buffer at 0x%lx-0x%lx\n",
fbi->fb.fix.id, fbi->fb.fix.smem_start,
fbi->fb.fix.smem_start + fbi->fb.fix.smem_len - 1);

where:
fbi->fb.fix.smem_start = fb_mem_phys;
fbi->fb.fix.smem_len = fb_mem_len;

so:
fb_mem_phys = 0xf100000;
fb_mem_len = 0x177000;
so it wasn't necessary to add a printk.

Alexey Charkov

unread,
Aug 12, 2023, 2:26:56 AM8/12/23
to vt8500-wm8505...@googlegroups.com
This is 1M aligned. If alignment was indeed an issue you would be seeing something like bottom half of the screen filled with garbage every other frame, given that the whole framebuffer is about 1.5M split into one visible buffer and one back buffer, which switch after every frame. Does it look like that or any different?

I saw you tried posting a picture, but it didn’t show up for me.

I remember that the VT8500 LCD controller expected 4MB alignment, but not what WM8505 GOVR required…

Best,
Alexey

Franco Palombo

unread,
Aug 12, 2023, 10:36:17 AM8/12/23
to VT8500/WM8505 Linux Kernel
Well, when using 8mb of cma, I had half of the screen good, and the other half had some garbage. With 16mb of cma, no graphical issues (at least on tty1, no gui), but fb_info prints the same for both cases. In linux 5.15, fb_info prints the same too. I'll attach the pic as a file so you can see it. Something to note on the pic: If too much text was written, sometimes the garbage and corruption expanded to the middle of the screen.
IMG_20230809_160516.jpg

Alexey Charkov

unread,
Aug 12, 2023, 2:26:42 PM8/12/23
to vt8500-wm8505...@googlegroups.com
On Sat, 12 Aug 2023 at 18:36, Franco Palombo <ffpp...@hotmail.com> wrote:
Well, when using 8mb of cma, I had half of the screen good, and the other half had some garbage. With 16mb of cma, no graphical issues (at least on tty1, no gui), but fb_info prints the same for both cases.

Okay, then it’s not about alignment. Are there any errors in dmesg when the corruption appears?

It’s perfectly fine to just go ahead with a 16MB CMA pool if that works for you, but it’s still curious how the kernel ends up with two overlapping allocations for different uses, as that shouldn’t happen. Makes me wonder if there is some sort of a use-after-free issue here.

Best,
Alexey

Franco Palombo

unread,
Aug 12, 2023, 8:10:34 PM8/12/23
to VT8500/WM8505 Linux Kernel
El sábado, 12 de agosto de 2023 a la(s) 15:26:42 UTC-3, alc...@gmail.com escribió:
Okay, then it’s not about alignment. Are there any errors in dmesg when the corruption appears?
No that I can see, but I can send you the serial output when booting with cma=8
    [    0.000000] Booting Linux on physical CPU 0x0
    [    0.000000] Linux version 4.14.0-rc2-329699-gdd86784db672-dirty (fpp@FPP-PC) (gcc version 11.4.0 (Ubuntu 11.4.0-1ubuntu1~22.04)) #24 Sat Aug 12 20:46:16 -03 2023
    [    0.000000] CPU: ARM926EJ-S [41069265] revision 5 (ARMv5TEJ), cr=0005317f
    [    0.000000] CPU: VIVT data cache, VIVT instruction cache
    [    0.000000] OF: fdt: Machine model: Wondermedia WM8650-MID Tablet
    [    0.000000] Memory policy: Data cache writeback
    [    0.000000] cma: Reserved 8 MiB at 0x0f800000
    [    0.000000] On node 0 totalpages: 65536
    [    0.000000] free_area_init_node: node 0, pgdat c061b360, node_mem_map cf5f5000
    [    0.000000]   Normal zone: 512 pages used for memmap
    [    0.000000]   Normal zone: 0 pages reserved
    [    0.000000]   Normal zone: 65536 pages, LIFO batch:15
    [    0.000000] random: fast init done
    [    0.000000] pcpu-alloc: s0 r0 d32768 u32768 alloc=1*32768
    [    0.000000] pcpu-alloc: [0] 0
    [    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 65024
    [    0.000000] Kernel command line: root=/dev/mmcblk0p2 rw rootwait mem=256M cma=8M console=ttyWMT0,115200
    [    0.000000] PID hash table entries: 1024 (order: 0, 4096 bytes)
    [    0.000000] Dentry cache hash table entries: 32768 (order: 5, 131072 bytes)
    [    0.000000] Inode-cache hash table entries: 16384 (order: 4, 65536 bytes)
    [    0.000000] Memory: 245100K/262144K available (4694K kernel code, 207K rwdata, 1016K rodata, 176K init, 237K bss, 8852K reserved, 8192K cma-reserved)

    [    0.000000] Virtual kernel memory layout:
    [    0.000000]     vector  : 0xffff0000 - 0xffff1000   (   4 kB)
    [    0.000000]     fixmap  : 0xffc00000 - 0xfff00000   (3072 kB)
    [    0.000000]     vmalloc : 0xd0800000 - 0xff800000   ( 752 MB)
    [    0.000000]     lowmem  : 0xc0000000 - 0xd0000000   ( 256 MB)
    [    0.000000]     modules : 0xbf000000 - 0xc0000000   (  16 MB)
    [    0.000000]       .text : 0xc0008000 - 0xc049dee8   (4696 kB)
    [    0.000000]       .init : 0xc05bc000 - 0xc05e8000   ( 176 kB)
    [    0.000000]       .data : 0xc05e8000 - 0xc061bda0   ( 208 kB)
    [    0.000000]        .bss : 0xc062129c - 0xc065c82c   ( 238 kB)

    [    0.000000] SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
    [    0.000000] NR_IRQS: 16, nr_irqs: 16, preallocated irqs: 16
    [    0.000000] vt8500-irq: Added interrupt controller
    [    0.000000] vt8500-irq: Added interrupt controller
    [    0.000000] vt8500-irq: Enabled slave->parent interrupts
    [    0.000000] clocksource: vt8500_timer: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 637086815595 ns
    [    0.000000] sched_clock: 32 bits at 100 Hz, resolution 10000000ns, wraps every 21474836475000000ns
    [    0.000000] Console: colour dummy device 80x30
    [    0.060000] Calibrating delay loop... 348.97 BogoMIPS (lpj=1744896)
    [    0.060000] pid_max: default: 32768 minimum: 301
    [    0.060000] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
    [    0.060000] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
    [    0.060000] CPU: Testing write buffer coherency: ok
    [    0.060000] Setting up static identity map for 0x8400 - 0x8458
    [    0.070000] devtmpfs: initialized
    [    0.150000] DMA-API: preallocated 4096 debug entries
    [    0.150000] DMA-API: debugging enabled by kernel config
    [    0.150000] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
    [    0.150000] futex hash table entries: 256 (order: -1, 3072 bytes)
    [    0.150000] pinctrl core: initialized pinctrl subsystem
    [    0.150000] NET: Registered protocol family 16
    [    0.160000] DMA: preallocated 256 KiB pool for atomic coherent allocations
    [    0.230000] SCSI subsystem initialized
    [    0.230000] usbcore: registered new interface driver usbfs
    [    0.230000] usbcore: registered new interface driver hub
    [    0.230000] usbcore: registered new device driver usb
    [    0.240000] clocksource: Switched to clocksource vt8500_timer
    [    0.320000] NET: Registered protocol family 2
    [    0.320000] TCP established hash table entries: 2048 (order: 1, 8192 bytes)
    [    0.330000] TCP bind hash table entries: 2048 (order: 1, 8192 bytes)
    [    0.330000] TCP: Hash tables configured (established 2048 bind 2048)
    [    0.330000] UDP hash table entries: 256 (order: 0, 4096 bytes)
    [    0.330000] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
    [    0.330000] NET: Registered protocol family 1
    [    0.330000] workingset: timestamp_bits=30 max_order=16 bucket_order=0
    [    0.400000] ntfs: driver 2.1.32 [Flags: R/O].
    [    0.410000] fuse init (API version 7.26)
    [    0.430000] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 251)
    [    0.430000] io scheduler noop registered
    [    0.430000] io scheduler deadline registered
    [    0.430000] io scheduler cfq registered (default)
    [    0.430000] io scheduler mq-deadline registered
    [    0.430000] io scheduler kyber registered
    [    0.440000] pinctrl-wm8650 d8110000.pinctrl: Pin controller initialized
    [    0.440000] pwm-backlight backlight: invalid default brightness level: 7, using 6
    [    0.440000] Enabled support for WMT GE raster acceleration
    [    0.470000] Console: switching to colour frame buffer device 100x30
    [    0.480000] fb0: wm8505-fb frame buffer at 0xf900000-0xfa76fff
    [    1.000000] d8200000.serial: ttyWMT0 at MMIO 0xd8200000 (irq = 28, base_baud = 923076) is a VT8500 UART-1
    [    1.470000] console [ttyWMT0] enabled
    [    1.540000] loop: module loaded
    [    1.550000] via-rhine d8004000.ethernet (unnamed net_device) (uninitialized): Reset not complete yet. Trying harder.
    [    1.560000] via-rhine d8004000.ethernet eth0: VIA Rhine III at 0xf8004000, 00:40:63:12:21:12, IRQ 30
    [    1.570000] via-rhine d8004000.ethernet eth0: MII PHY found at address 1, status 0x7849 advertising 01e1 Link 0001
    [    1.580000] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
    [    1.580000] ehci-platform: EHCI generic platform driver
    [    1.590000] ehci-platform d8007900.ehci: EHCI Host Controller
    [    1.600000] ehci-platform d8007900.ehci: new USB bus registered, assigned bus number 1
    [    1.610000] ehci-platform d8007900.ehci: irq 25, io mem 0xd8007900
    [    1.640000] ehci-platform d8007900.ehci: USB 2.0 started, EHCI 1.00
    [    1.650000] hub 1-0:1.0: USB hub found
    [    1.650000] hub 1-0:1.0: 4 ports detected
    [    1.660000] uhci_hcd: USB Universal Host Controller Interface driver
    [    1.660000] platform-uhci d8007b00.uhci: Generic UHCI Host Controller
    [    1.670000] platform-uhci d8007b00.uhci: new USB bus registered, assigned bus number 2
    [    1.680000] platform-uhci d8007b00.uhci: irq 25, io mem 0xd8007b00
    [    1.690000] hub 2-0:1.0: USB hub found
    [    1.690000] hub 2-0:1.0: 2 ports detected
    [    1.700000] usbcore: registered new interface driver usb-storage
    [    1.710000] usbcore: registered new interface driver usbserial
    [    1.710000] usbcore: registered new interface driver ftdi_sio
    [    1.720000] usbserial: USB Serial support registered for FTDI USB Serial Device
    [    1.730000] usbcore: registered new interface driver pl2303
    [    1.730000] usbserial: USB Serial support registered for pl2303
    [    1.740000] vt8500-rtc d8100000.rtc: rtc core: registered vt8500-rtc as rtc0
    [    1.750000] IR NEC protocol handler initialized
    [    1.750000] IR RC5(x/sz) protocol handler initialized
    [    1.760000] IR RC6 protocol handler initialized
    [    1.760000] IR JVC protocol handler initialized
    [    1.760000] IR Sony protocol handler initialized
    [    1.770000] IR SANYO protocol handler initialized
    [    1.770000] IR Sharp protocol handler initialized
    [    1.780000] IR MCE Keyboard/mouse protocol handler initialized
    [    1.780000] IR XMP protocol handler initialized
    [    1.790000] device-mapper: ioctl: 4.36.0-ioctl (2017-06-09) initialised: dm-d...@redhat.com
    [    1.860000] wmt-sdhc d800a000.sdhc: WMT SDHC Controller initialized
    [    1.870000] usbcore: registered new interface driver usbhid
    [    1.870000] usbhid: USB HID core driver
    [    1.880000] NET: Registered protocol family 10
    [    1.890000] Segment Routing with IPv6
    [    1.890000] sit: IPv6, IPv4 and MPLS over IPv4 tunneling driver
    [    1.900000] NET: Registered protocol family 17
    [    1.930000] kmemleak: Kernel memory leak detector initialized
    [    1.940000] kmemleak: Automatic memory scanning thread started
    [    1.940000] vt8500-rtc d8100000.rtc: setting system clock to 2023-08-12 23:47:43 UTC (1691884063)
    [    1.950000] Waiting for root device /dev/mmcblk0p2...
    [    1.980000] mmc0: new high speed SDHC card at address e624
    [    1.980000] mmcblk0: mmc0:e624 SU32G 29.7 GiB
    [    1.990000]  mmcblk0: p1 p2
    [    2.030000] EXT4-fs (mmcblk0p2): couldn't mount as ext3 due to feature incompatibilities
    [    2.040000] EXT4-fs (mmcblk0p2): couldn't mount as ext2 due to feature incompatibilities
    [    2.110000] EXT4-fs (mmcblk0p2): mounted filesystem with ordered data mode. Opts: (null)
    [    2.110000] VFS: Mounted root (ext4 filesystem) on device 179:2.
    [    2.120000] devtmpfs: mounted
    [    2.130000] Freeing unused kernel memory: 176K
    [    2.130000] This architecture does not have kernel memory protection.
    [    2.270000] usb 2-2: new low-speed USB device number 2 using platform-uhci
    [    2.630000] input: USB Keyboard as /devices/platform/soc/d8007b00.uhci/usb2/2-2/2-2:1.0/0003:04D9:2BA0.0001/input/input0
    [    2.710000] hid-generic 0003:04D9:2BA0.0001: input: USB HID v1.10 Keyboard [USB Keyboard] on usb-d8007b00.uhci-2/input0
    [    2.840000] input: USB Keyboard as /devices/platform/soc/d8007b00.uhci/usb2/2-2/2-2:1.1/0003:04D9:2BA0.0002/input/input1
    [    2.920000] usb 1-3: new high-speed USB device number 3 using ehci-platform
    [    2.920000] hid-generic 0003:04D9:2BA0.0002: input: USB HID v1.10 Mouse [USB Keyboard] on usb-d8007b00.uhci-2/input1
    [    3.070000] cgroup: cgroup2: unknown option "memory_recursiveprot"
    [    3.120000] systemd[1]: systemd 247.3-7+deb11u2 running in system mode. (+PAM +AUDIT +SELINUX +IMA +APPARMOR +SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ +LZ4 +ZSTD +SECCOMP +BLKID +ELFUTILS +KMOD +IDN2 -IDN +PCRE2 default-hierarchy=unified)
    [    3.150000] hub 1-3:1.0: USB hub found
    [    3.150000] hub 1-3:1.0: 4 ports detected
    [    3.160000] systemd[1]: Detected architecture arm.


    Welcome to Debian GNU/Linux 11 (bullseye)!
I think that I've enabled some extra debug messages, but if you need me to enable another config for extra debug info, tell me and i'll send you the new dmesg output. No problem at all.
A side note: with cma=8, when pressing keys, I can see that the thin corrupted line closest to the middle of the screen, changes when I press a key on the keyboard/mousepad or move the mousepad. Also, when enabling the wifi/webcam, I can see that the lower line also changes. Plugging any usb device triggers the same effect on screen. I don't know if its useful info, but its somewhere to start.
Something that i also noticed: I accidentally started testing with kernel 5.15 for the above test, and even kernel 5.15 with cma=8 had the weird lines at the bottom half of the screen. But with no cma argument, no issues on screen at all.

I'll now test to add a gui, and if everything seems ok, I'll proceed to make a new question, because I think that the title is already quite off-topic from what we're discussing now, and also I want to start looking at the nand flash to see if there is any possibility of getting it to work (i doubt it. I don't think i will be able to do anything by my own. not for the moment at least) and boot from it.

Franco Palombo

unread,
Aug 13, 2023, 9:32:34 PM8/13/23
to VT8500/WM8505 Linux Kernel
So, after some testing, GUI is decent, but its somewhat unstable. I'm using openbox and LXDE. On the first boot, the screen was turning on and off with nothing on it after the initial setup had finished. Rebooting fixed the issue. Enabling the webcam makes the whole gui crash (at least the first time, the second time didn't), and now systemd-journal is complaining about corrupted journal files. In any case, it took too long for the gui to load the lockscreen, and after logging in it also took some time for the desktop to appear, so its pretty "useless". Don't get me wrong, it doesn't seems to lag (just a little bit) when dragging windows or anything, it's just the cpu that is too slow. Opening apps makes it go to 100% and even the lightest apps (LXterminal and PCManFM) take 3 to 5 seconds to completely appear. In any case, I want to keep going with this. Maybe I can use it for some super lightweight home server to host files or a small http server, or a home security camera server, I don't know yet, but its a good little project that i like. For the moment, I'm going to start a new question to see how far can we get the nand flash to work

Brigham Campbell

unread,
Nov 18, 2023, 3:56:52 AM11/18/23
to VT8500/WM8505 Linux Kernel
Interesting, looks like "Rhine" isn't mentioned in the wiki (https://github.com/linux-wmt/linux-vtwm/wiki/Build-the-source). Do you have access to edit it, Alexey?

Cheers,
Brigham
On Thursday, August 3, 2023 at 11:54:18 PM UTC-6 alc...@gmail.com wrote:
On Fri, 4 Aug 2023 at 00:42, Franco Palombo <ffpp...@hotmail.com> wrote:

Something that I'm still not being able to figure out, is why does the Ethernet and the internal USB WiFi adapter and the serial console still not work. I know that they do actually work because on Android I can succesfully use them, but not here on debian. I think I included the necesary stuff to make the ethernet work, and I'm sure that I included the corect drivers for my internal adapter (I dissasembled the laptop to check with the IC markings), but still, after executing systemctl start wlgpio and verify that everithing is ok with systemctl status wlgpio, still, no Wireless networks show up on nmtui and no new network adapters show on nmcli. I even took the extra step of building the kernel again, this time including the drivers for a Ralink adapter I have, and this time I was able to connect to the internet and install some packages.

For Ethernet on WM8650 you need the VIA Rhine driver, looks like you’ve missed that one:

CONFIG_NET_VENDOR_VIA=y
# CONFIG_VIA_RHINE is not set
CONFIG_VIA_VELOCITY=y

Best,
Alexey

Alexey Charkov

unread,
Nov 20, 2023, 6:47:01 AM11/20/23
to vt8500-wm8505...@googlegroups.com
On Sat, Nov 18, 2023 at 12:56 PM Brigham Campbell
<m...@brighamcampbell.com> wrote:
>
> Interesting, looks like "Rhine" isn't mentioned in the wiki (https://github.com/linux-wmt/linux-vtwm/wiki/Build-the-source). Do you have access to edit it, Alexey?

Yep! Added it. Thanks for spotting!

Best,
Alexey
Reply all
Reply to author
Forward
0 new messages