Device-tree improvements

This is for any ARMv7 device that we do not officially support.

Re: Device-tree improvements

Postby TheSaint » Mon Jan 14, 2019 6:17 am

I just planned to get the latest kernel running. Unfortunately these days I'm busy for a little help to my friend to program a MCU.
I'll get back to you ASAP. Perhaps in few hours.

EDIT
I updated the system and kernel. In few words, your make is the BEST. The system started latest kernel flawlessly.
Then, I tried the new dtb rk2388-tinker-s.dtb, from mainline. It boot smoothly, but the WiFi is not there and the NIC also fails to do the simplest things.
Code: Select all
$ ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN group default qlen 1000
    link/ether 88:d7:f6:c2:f1:42 brd ff:ff:ff:ff:ff:ff
=======================================
$ lsmod
Module                  Size  Used by
realtek                16384  1
snd_soc_hdmi_codec     16384  1
dw_hdmi_cec            16384  0
dw_hdmi_i2s_audio      16384  0
snd_soc_simple_card    16384  0
snd_soc_simple_card_utils    16384  1 snd_soc_simple_card
rockchip_rga           20480  0
v4l2_mem2mem           24576  1 rockchip_rga
snd_soc_rockchip_i2s    16384  2
videobuf2_dma_sg       16384  1 rockchip_rga
videobuf2_memops       16384  1 videobuf2_dma_sg
videobuf2_v4l2         24576  2 v4l2_mem2mem,rockchip_rga
snd_soc_rockchip_pcm    16384  1 snd_soc_rockchip_i2s
videobuf2_common       45056  3 v4l2_mem2mem,videobuf2_v4l2,rockchip_rga
snd_soc_core          159744  5 snd_soc_rockchip_i2s,snd_soc_hdmi_codec,snd_soc_simple_card_utils,snd_soc_rockchip_pcm,snd_soc_simple_card
ac97_bus               16384  1 snd_soc_core
snd_pcm_dmaengine      16384  1 snd_soc_core
rk_crypto              24576  0
dw_wdt                 16384  0
snd_usb_audio         188416  0
snd_usbmidi_lib        28672  1 snd_usb_audio
snd_hwdep              16384  1 snd_usb_audio
evdev                  24576  2
joydev                 20480  0
snd_rawmidi            32768  1 snd_usbmidi_lib
snd_seq_device         16384  1 snd_rawmidi
snd_pcm                94208  4 snd_usb_audio,snd_pcm_dmaengine,snd_soc_hdmi_codec,snd_soc_core
snd_timer              32768  1 snd_pcm
pwm_rockchip           16384  0
dwmac_rk               28672  0
rockchipdrm            94208  0
stmmac_platform        20480  1 dwmac_rk
analogix_dp            32768  1 rockchipdrm
stmmac                126976  2 stmmac_platform,dwmac_rk
dw_hdmi                32768  2 rockchipdrm,dw_hdmi_i2s_audio
rockchip_saradc        16384  0
uio_pdrv_genirq        16384  0
uio                    20480  1 uio_pdrv_genirq
sch_fq_codel           20480  2
crypto_user            20480  0
ip_tables              28672  0
x_tables               32768  1 ip_tables

Here's what journalctl -b said during the boot.
Regarding the SD card detection, still best the parameters we put earlier.
Code: Select all
$ cat /boot/boot.txt
    # After modifying, run ./mkscr

    setenv rootcmd "LABEL=TB-MM-root"
    setenv fdtfile rk3288-tinker-s.dtb
    setenv bootargs "console=ttyS2,115200n8 root=${rootcmd} rw rootwait"

    if load ${devtype} ${devnum}:${bootpart} ${kernel_addr_r} /boot/zImage; then
      if load ${devtype} ${devnum}:${bootpart} ${fdt_addr_r} /boot/dtbs/${fdtfile}; then
        fdt addr ${fdt_addr_r}
        fdt resize
        fdt set /dwmmc@ff0c0000 broken-cd
#        fdt set /usb@ff500000 no-relinquish-port
        if load ${devtype} ${devnum}:${bootpart} ${ramdisk_addr_r} /boot/initramfs-linux.img; then
          bootz ${kernel_addr_r} ${ramdisk_addr_r}:${filesize} ${fdt_addr_r};
        else
          bootz ${kernel_addr_r} - ${fdt_addr_r};
        fi;
      fi;
    fi

Summarizing, I'll put back rk3288-tinkerS.dtb, which gives the WiFi working with the latest kernel. Perhaps still crash when starting SoftAP with the module 80211.
BTW, I just noted that the 80211 is not loaded, even the NIC wants it.

If you need, I'll post the data when I boot with your rk3288-tinkerS.dtb.
TheSaint
 
Posts: 260
Joined: Mon Jul 23, 2018 7:57 am

Re: Device-tree improvements

Postby summers » Mon Jan 14, 2019 1:00 pm

Ta thanks for that. With the rk3288-tinker-s.dtb did you try booting from eMMC, and then ejecting the sd card to see if you get the sd errors?

Missing wifi and bluetooth is known, the asus device tree, mainline hated. I'm just going though it now, getting to speed with what it did. Much of the problem is it invented fictional nodes; and no way for this to be mainlined. So changing it to mainline set up, it should make some things better (e.g. the bluetooth set up is better in mainline). Anyway I'm still getting my head around what mainline will allow - means needing to think device tree in a mainline way ...

Ah wait read your above more clearly - so you still need the "broken-cd". OK I'll make sure that is added ...
summers
 
Posts: 560
Joined: Sat Sep 06, 2014 12:56 pm

Re: Device-tree improvements

Postby TheSaint » Mon Jan 14, 2019 11:40 pm

There's a module parameter to set the bluetooth working, which is BT_COEX. But not yet feasible in all the used dtb.
I'm curious to know why the debian derived are mostly keen to use miniarm dtf.
TheSaint
 
Posts: 260
Joined: Mon Jul 23, 2018 7:57 am

Re: Device-tree improvements

Postby summers » Tue Jan 15, 2019 11:48 am

Bluetooth in the kernel should be enabled using two configurations:

Code: Select all
config BT_HCIUART_3WIRE
   bool "Three-wire UART (H5) protocol support"
   depends on BT_HCIUART
   depends on BT_HCIUART_SERDEV
   help
     The HCI Three-wire UART Transport Layer makes it possible to
     user the Bluetooth HCI over a serial port interface. The HCI
     Three-wire UART Transport Layer assumes that the UART
     communication may have bit errors, overrun errors or burst
     errors and thereby making CTS/RTS lines unnecessary.

Say Y here to compile support for Three-wire UART protocol.

and
Code: Select all
config BT_HCIBTUSB_RTL
   bool "Realtek protocol support"
   depends on BT_HCIBTUSB
   select BT_RTL
   default y
   help
     The Realtek protocol support enables firmware and configuration
     download support for Realtek Bluetooth controllers.

Say Y here to compile support for Realtek protocol.

Am not sure what the module will get called, something like hci_h5 ... or maybe
Code: Select all
hci_uart


I think debium use the miniarm dtb probably becuase it works and has most things enabled. The problem with miniarm, is that the dts is very none standard - no way it will be accepted in mainline. Its clear to me that mainlining it is a real hassle - need at least basic understanding of all parts of the device tree. E.g. one needs to power the bluetooth chip, and that is done in one part of the device tree, needs to ensure discrete lines are pulled the right way to bring the chip up, finally need a driver that talks across the uart. Doing all these as they are meant to be done is a hassle in mainline, and so I suspect no one at debian can be bothered to mainline it.

Really the problem is with asus, they pushed out the patches to make miniarm dtb work, without any thought as to how to mainline it. As they had understanding of the hardware, they could have done it in a way acceptable to mainline, which would have been more effort - but means it would be supported. Whereas to take miniarm and mainline it, takes additional effort - need to understand the hardware from the miniarm dts, before translating into mainline ...
summers
 
Posts: 560
Joined: Sat Sep 06, 2014 12:56 pm

Re: Device-tree improvements

Postby TheSaint » Tue Jan 15, 2019 2:27 pm

Keeping your dtb is the most suited. I just wonder what is the cause to mess up with 80211 module. This is primarily caused by hostapd.
In the linux word, it's well know that we must wait for some time before the things get well known. So as it's for my laptop, which still doesn't fully function after 6 years, then the Tinker Board might follow a similar sort.
TheSaint
 
Posts: 260
Joined: Mon Jul 23, 2018 7:57 am

Re: Device-tree improvements

Postby TheSaint » Thu Jan 24, 2019 12:27 am

Latest kernel update
Code: Select all
Linux alarm 4.20.2-2-ARCH #1 SMP PREEMPT Fri Jan 18 03:39:51 UTC 2019 armv7l GNU/Linux

Alas no changes :cry:
TheSaint
 
Posts: 260
Joined: Mon Jul 23, 2018 7:57 am

Previous

Return to Community Supported

Who is online

Users browsing this forum: No registered users and 0 guests