Udoo neo device tree (yocto)

Discussion in 'UDOO NEO' started by modjo, Mar 10, 2016.

  1. modjo

    modjo Active Member

    Joined:
    Sep 29, 2014
    Messages:
    417
    Likes Received:
    127
    Hi all udooer, i use the yocto image for my neo, it works fine. Yocto use the same device tree that they have on udoobuntu2, the problem is that we don't have the web interface to reconfigure the pin and i need to enable another ...
    I would to enable CAN (pin 40,41), ECSPI_2 (20 21 38 39), Uart6 (18,19) and i would like to know if is possible to use Uart1 for user app (not Cortex A9 serial debug).

    @Andrea Rovai , @Francesco is it possible for you to make a guide to compile the dts file for neo and use custom device tree ? You make a guide for kernel but not for the device tree.
     
  2. Andrea Rovai

    Andrea Rovai Well-Known Member

    Joined:
    Oct 27, 2014
    Messages:
    1,703
    Likes Received:
    240
  3. Francesco

    Francesco Active Member

    Joined:
    Jun 23, 2015
    Messages:
    220
    Likes Received:
    110
    DTBs can be built with "make dtbs".
    If you add php to yocto you can run dtweb on it; otherwise you can use udoobuntu to compile the DTBs and copy them to yocto SD card.
     
    graugans and modjo like this.
  4. modjo

    modjo Active Member

    Joined:
    Sep 29, 2014
    Messages:
    417
    Likes Received:
    127
    Thanks Francesco this is what we need. Where is located dtbs file on udoobuntu ? what do dtweb tool --> compil a new dtb file for next boot ? Can we modify Uart1 to use it in user side (not A9 debug) ?
     
    graugans likes this.
  5. graugans

    graugans Administrator Staff Member

    Joined:
    Sep 17, 2015
    Messages:
    328
    Likes Received:
    141
    modjo likes this.
  6. Francesco

    Francesco Active Member

    Joined:
    Jun 23, 2015
    Messages:
    220
    Likes Received:
    110
    Hi, let me write a quick explanation on your (and maybe future) questions. dtweb is a simple tool which has a reduced copy of the Linux kernel (dtbkernel.tbz2, see https://github.com/fmntf/dtweb).
    The web interface (javascript) collects information about which pin configure as GPIO/device; the PHP script creates a custom "udoo-externalpins.dtsi" file (which is included by all other *udoo*.dts files, then it spawns a "make dtbs" on the dtbkernel.
    The built files are placed in /boot/dts-overlay/ and uEnv.txt is changed to load files from that directory, instead of the standard /boot/dts/.

    dtweb to minize the footprint on the SD image:
    - uses the reduced dtbkernel, which is just a reduced copy of our kernel - https://github.com/UDOOboard/linux_kernel
    - uses the webserver integrated in PHP.
    You can use the PHP script against the full UDOO kernel, but not another kernel (since it has no UDOO DTBs). It is also possible run dtweb on nginx (using PHP-FPM); I'm sure there are binding to run PHP scripts on lighttpd too.
     
    modjo and graugans like this.
  7. Francesco

    Francesco Active Member

    Joined:
    Jun 23, 2015
    Messages:
    220
    Likes Received:
    110
    Probably, never did it btw.
    UART1 is initialized during the boot (https://github.com/UDOOboard/uboot-imx/blob/2015.04.imx-neo/board/udoo/neo/neo.c#L175) and used by the Linux kernel as debug console (https://github.com/UDOOboard/uboot-imx/blob/2015.04.imx-neo/include/configs/udoo_neo.h#L204); finally getty is spawned over the tty device (https://github.com/UDOOboard/mkudoobuntu/blob/master/include/configure.sh#L36).
    Removing the console arg from bootargs (via uEnv.txt) and the init file should do the trick.
     
    modjo likes this.
  8. graugans

    graugans Administrator Staff Member

    Joined:
    Sep 17, 2015
    Messages:
    328
    Likes Received:
    141
    Thx for the explanation. This is what I thought it could be. Otherwise you would have to write a full DTS parser in php/JavaScript. We can add the dependency on udookernels. As a starter I would recommend to use full blown source, so it is guaranteed to have matching dtb files for the running kernel. I am looking forward for a pull request from @modjo on this.

    In case of any question please do not hesitate to ask @modjo.

    Gesendet von meinem FP2 mit Tapatalk
     
  9. Francesco

    Francesco Active Member

    Joined:
    Jun 23, 2015
    Messages:
    220
    Likes Received:
    110
    Using the full kernel would be better as you pointed out; however in udoobuntu we want to provide a light SD image, so we reduced the kernel to the bare minimum to run dtc. The downside is we have to keep thins in sync, so a kernel release brings a dtweb release too.
     
  10. graugans

    graugans Administrator Staff Member

    Joined:
    Sep 17, 2015
    Messages:
    328
    Likes Received:
    141
    Yes, I was thinking about a recipe which condense the dts files from kernel src to reduce footprint. In real world yocto scenarios one would create a overlay to the meta-udoo layer and provide the appropriate device tree. But having your dtweb tool brings kind of flexibility and makes it easy to alter the device tree....

    Gesendet von meinem FP2 mit Tapatalk
     
  11. modjo

    modjo Active Member

    Joined:
    Sep 29, 2014
    Messages:
    417
    Likes Received:
    127
    Thanks for this explanation ! can you just precise more how we can write uEnv.txt to remove console arg to setenv ? Where is the ini file ?
     
  12. Francesco

    Francesco Active Member

    Joined:
    Jun 23, 2015
    Messages:
    220
    Likes Received:
    110
    Append
    Code:
    mmcargs=setenv bootargs root=${mmcroot} rootfstype=${mmcrootfstype} ${m4mmcargs}
    to /boot/uEnv.txt
    The init files for serial ports are in /etc/init (see the 3rd link on my previous post)
     
    modjo likes this.
  13. modjo

    modjo Active Member

    Joined:
    Sep 29, 2014
    Messages:
    417
    Likes Received:
    127
    I will try !
     
    Andrea Rovai likes this.

Share This Page