This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

How to do the pinmux change and compile the device tree source(.dts) to .dtb

Hi,

We use the pre-built image from TI for our custom beaglebone black board which is integrated with WL8 wifi/bluetooth cape.

We know that there is a limitation that WL8 cape uses the same MMC as the eMMC for the BBB ,once you apply the device tree patch (or use the pre-built images) you can only use the uSD card of the BBB and the eMMC is disabled.

Therefore, We made hardware changes and use different MMC interfaces for WL8 cape( mmc2 ), on board eMMC ( mmc1 ) and uSD card ( mmc0 ). But it requires a pinmux change in the device tree. My questions are as follows:

1. where can I find the DT source file--am335x-boneblack.dts that was used to compile to the am335x-boneblack.dtb file in the pre-built image?

2. After making the pinmux changes in the .dts file, how to recompile the kernel and the device tree source using the following commands.

make omap2plus_defconfig
make zImage dtbs
make modules
make modules_install INSTALL_MOD_PATH=<rootfs location>

If anyone could answer my questions, I would really appreciate it. Thanks.

Shu
  • Thanks for you reply. I am really new to Linux. I downloaded the SDK.

    Can you please let me know in the SDK where to get the device tree source? and how to recompile it and the kernel after make the pinmux changes?  Can I use the current pre-built image since it works fine for us and we just need the pinmux change?

    Thanks again. 

    Shu

  • Hi Biser,

    I found the .dts files in the /arch/arm/boot/dts of the SDK. Can you please let me know how to recompile it and recompile the kernel?

    Can I still use the current pre-built TI image? Can I just replace the current am335x-boneblack.dtb and zImage with the recompiled the my.dtb and recompiled zImage ?

    Regards,

    Shu

  • Sorry, I'm not a Linux expert, but you can go to the wiki portal http://processors.wiki.ti.com/index.php/Sitara_AM335x_Portal and from there you will find a lot of wiki pages on Linux.

  • Hi Shu,

    Yes, you can use a pre build zImage and .dtb files.

    BR
    Ivan

  • Ivan,

    Thanks for your reply. Can you please let me know how to recompile the device tree source file and the Linux kernel? Then I can replace the old .dtb file and the old zImage.

    Biser,

    Thanks for your link.

    Regards,

    Shu 

  • Your steps from your first post should work if you are using a 3.x kernel.  If you are cross-compiling
    (building a Linux ARM image on an x86 machine), you will need to add some variables to make.
    In particular, check that your CROSS_COMPILE variable is set correctly.
    For my specific environment (Beaglebone Black), my commands might look like this:

    make ARCH=arm CROSS_COMPILE=armv7a-hardfloat-linux-gnueabihf- omap2plus_defconfig
    this will create a .config file in the kernel directory which the kernel uses to build.
    you should only need to do this once. if you change any options in the .config this will overwrite them


    make ARCH=arm CROSS_COMPILE=armv7a-hardfloat-linux-gnueabihf- menuconfig
    if you need to change any options before building the kernel

    make ARCH=arm CROSS_COMPILE=armv7a-hardfloat-linux-gnueabihf-
    compile the kernel
    make ARCH=arm CROSS_COMPILE=armv7a-hardfloat-linux-gnueabihf- zImage dtbs
    create a zImage and compile all the dtb files
    make ARCH=arm CROSS_COMPILE=armv7a-hardfloat-linux-gnueabihf- modules
    compile any modules built for the kernel
    make ARCH=arm CROSS_COMPILE=armv7a-hardfloat-linux-gnueabihf-
    modules_install INSTALL_MOD_PATH=<rootfs location>
    install the recompiled modules to the destination drive

    Now just copy the zImage, .dtb file to the destination and you should be good to go.
    To find out where they go, just find the zImage and dtb file on the destination drive
    and replace them (locations can vary).
  • Hi,

    I agree with the James, but only for clarity please see the:

    http://processors.wiki.ti.com/index.php/Linux_Kernel_Users_Guide

    BR

    Ivan

  • Hi,

    I follow the link that you provided. http://processors.wiki.ti.com/index.php/Linux_Kernel_Users_Guide

    When compiling kernel, I typed " make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- zImage. It took about 5 mins and I got the error below. Should I use a different compiler or what? I do not have the compiler that James had.

    "make ARCH=arm CROSS_COMPILE=armv7a-hardfloat-linux-gnueabihf-"

    I only made one change to the am335x-bone-common.dtsi file.

      CC      lib/show_mem.o
      CC      lib/string.o
      CC      lib/timerqueue.o
      CC      lib/vsprintf.o
      AR      lib/lib.a
      LINK    vmlinux
      LD      vmlinux.o
      MODPOST vmlinux.o
      GEN     .version
      CHK     include/generated/compile.h
      UPD     include/generated/compile.h
      CC      init/version.o
      LD      init/built-in.o
    drivers/built-in.o: In function `omap2_mbox_remove':
    /home/vdev/ti-sdk-am335x-evm-07.00.00.00/board-support/linux-3.12.10-ti2013.12.01/drivers/mailbox/mailbox-omap2.c:536: undefined reference to `omap_mbox_unregister'
    drivers/built-in.o: In function `omap2_mbox_probe':
    /home/vdev/ti-sdk-am335x-evm-07.00.00.00/board-support/linux-3.12.10-ti2013.12.01/drivers/mailbox/mailbox-omap2.c:501: undefined reference to `omap_mbox_register'
    make: *** [vmlinux] Error 1

    Regards,

    Shu

  • I resolved it by cleaning the kernel sources. 

    make ARCH=arm CROSS_COMPILE=<compiler> distclean

    Thanks.