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.

dts file for custom board

I have custom OMAP4430 ES2.3 HS 1Gb board.

On 3.4 kernel device tree mode enabled by default (USE_OF).

I write my own dts file Name of my board is acclaim (MACHINE_START(OMAP4_NOOKTABLET, "acclaim") from board files)

/dts-v1/;
/include/ "omap4.dtsi" 
/ { 
model = "acclaim";
compatible = "ti,acclaim", "ti,omap4430", "ti,omap4";
memory {
device_type = "memory";
reg = <0x80000000 0x40000000>; /* 1 GB */
};

 But board can't boot.

Starting kernel ...

Uncompressing Linux... done, booting the kernel.
<6>Booting Linux on physical CPU 0
<6>Initializing cgroup subsys cpu
<5>Linux version 3.4.4-00000-OMAP5-Android+ (nook@localhost) (gcc version 4.4.1 (Sourcery G++ Lite 2010q1-202) ) #60 SMP PREE2
CPU: ARMv7 Processor [411fc093] revision 3 (ARMv7), cr=10c5387d
CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache

Error: unrecognized/unsupported device tree compatible list:
[
Error: unrecognized/unsupported device tree compatible list:
[ 'ti,acclaim' 'ti,acclaim' 'ti,omap4430' 'ti,omap4430' 'ti,omap4' 'ti,omap4' ]

]

Available machine support:

ID (hex) NAME
Available machine support:

ID (hex) NAME
00000e18 acclaim
00000e18 acclaim

Please check your kernel config and/or bootloader.

Please check your kernel config and/or bootloader. 

 

Where is my mistake?

  • I haven't seen much device tree support for TI devices but I'm no expert on this. There is some DTS files added to the Arago and Linux mainline. Not much more than that. Maybe Android is further along in DT support. This link implies that Android would need patching:

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

    Your board file should contain a dt_match field (init to "ti,acclaim"?) in it is MACHINE definitions and some OF calls, such as of_platform_bus_probe() or of_platform_populate().

  • Try this again. Seems my posts need approval.

    I haven't seen much device tree support for TI devices but I'm no expert on this. There is some DTS files added to the Arago and Linux mainline. Not much more than that. Maybe Android is further along in DT support. This link implies that Android would need patching:

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

    Your board file should contain a dt_match field in it is MACHINE definitions and some OF calls, such as of_platform_bus_probe() or of_platform_populate().

  • What kernel tree are you using? Appears to be an OMAP5 branch.

    Have you tried the mainline kernel?

    Cheers
    Jon

  • I use http://git.omapzoom.org/?p=kernel/omap.git;a=shortlog;h=refs/heads/p-android-omap-3.4

  • What defconfig file are you using? Can you paste your .config file?

    Thanks
    Jon

  • My .config

    http://pastebin.com/YcGnTdKA

  • Does your board file have something like:

    static const char *omap4_boards_compat[] __initdata = {
        "ti,omap4",
        "ti,acclaim",
        NULL,
    };

    MACHINE_START(OMAP4_NOOKTABLET, "acclaim")
    ...
        .dt_compat    = omap4_boards_compat,
    ..
    MACHINE_END

    Not sure if both "ti,omap4" and "ti,acclaim" need to be defined.

  • Well it should be using the following in arch/arm/mach-omap2/board-generic.c ...

    static const char *omap4_boards_compat[] __initdata = {
             "ti,omap4",
             NULL,
    };

    DT_MACHINE_START(OMAP4_DT, "Generic OMAP4 (Flattened Device Tree)")
            .reserve        = omap_reserve,
            .map_io         = omap4_map_io,
            .init_early     = omap4430_init_early,
            .init_irq       = omap_init_irq,
            .handle_irq     = gic_handle_irq,
            .init_machine   = omap4_init,
            .timer          = &omap4_timer,
            .dt_compat      = omap4_boards_compat,
            .restart        = omap_prcm_restart,
    MACHINE_END

    This works for the panda board and so I would expect the same should work for any other board that has "ti,omap4" in the compatible list. Eventually, you may need to make a custom entry but for initial booting it should work.

    Jon

  • I think I see the problem. The defconfig is not enabling the following option ...

    # CONFIG_MACH_OMAP_GENERIC is not set

    Hence, arch/arm/mach-omap2/board-generic.c is not built and the "Generic OMAP4 (Flattened Device Tree)" machine description is missing.

    Try enabling CONFIG_MACH_OMAP_GENERIC. Or you can add your own custom DT_MACHINE_START to your board file.

    Cheers
    Jon

  • Norman Wong said:

    Not sure if both "ti,omap4" and "ti,acclaim" need to be defined.

    The "ti,acclaim" should probably be there for a custom DT_MACHINE_START entry to distinguish from the generic or any other OMAP4 board. However, if the generic is not enabled it is not critical.

    Jon

  • I add this lines to my board file.

    static const char *omap4_boards_compat[] __initdata = {
        "ti,omap4",
        "ti,acclaim",
        NULL,
    };

    MACHINE_START(OMAP4_NOOKTABLET, "acclaim")
    ...
        .dt_compat    = omap4_boards_compat,
    ..
    MACHINE_END

    Now it booting but crashing

    http://pastebin.com/3ms12hTQ

  • You probably should port the other OF calls from board-generic.c, eg of_irq_init() and of_platform_populate(). Match the strings to your DTS file.

  • Kuzemko Aleksander said:

    I add this lines to my board file.

    static const char *omap4_boards_compat[] __initdata = {
        "ti,omap4",
        "ti,acclaim",
        NULL,
    };

    MACHINE_START(OMAP4_NOOKTABLET, "acclaim")
    ...
        .dt_compat    = omap4_boards_compat,
    ..
    MACHINE_END

    Now it booting but crashing

    http://pastebin.com/3ms12hTQ

    Please try enabling the option CONFIG_MACH_OMAP_GENERIC instead and see if this works.

    Jon

  • I enable in config Generic OMAP support.

    Boot log:

    http://pastebin.com/TSh08r7K

  • Kuzemko Aleksander said:

    I enable in config Generic OMAP support.

    Boot log:

    http://pastebin.com/TSh08r7K

    Did you remove your other change to the board file? If not remove this and only enable that option.

    Jon

  • Yes, I disable it. I get same results.

  • Looks like this patch is the culprit ...

    commit 8565fdf961b2c57a1bc13b96433d2c9759160e18
    Author: Nishanth Menon <nm@ti.com>
    Date:   Thu May 31 23:03:41 2012 -0500

        OMAP: PM: register to the memory throughput class of the PM QoS framework
        
        Implement the memory throughput constraints using the PM QoS notification
        handler for the PM_QOS_MEMORY_THROUGHPUT class. The handler shall apply the
        constraints aggregated value to the DVFS layer by calling the
        corresponding function in the DVFS.
        
        Note: The way requested throughput is converted to corresponding interconnect
        frequency is still under discussion and hence this conversion mechanism needs
        to be revisited.
        
        Signed-off-by: Jean Pihet <j-pihet@ti.com>
        Signed-off-by: Vishwanath BS <vishwanath.bs@ti.com>

    It is adding the following which is causing the crash when DT is present ...

    static int __init omap2_common_pm_init(void)
     {
            if (!of_have_populated_dt())
                    omap2_init_processor_devices();
            omap_pm_if_init();
     
    +       /* Register to the throughput class of PM QoS */
    +       omap2_pm_qos_tput_init();
    +
            return 0;

    Do you need to use this kernel? We are DT work on the mainline kernel and this should work well.

    Cheers
    Jon

  • Jon Hunter said:

    Do you need to use this kernel? We are DT work on the mainline kernel and this should work well.

    Oops meant to say, "we are doing most of the DT work on the mainline kernel".

    Cheers
    Jon

  • I try to use  this version (3.4) because I want boot Android and Linux distro with the same kernel.

    What do you mean when say about mainline kernel?

  • Kuzemko Aleksander said:

    What do you mean when say about mainline kernel?

    Sorry, by mainline I meant Linus Torvalds latest kernel ...

    http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=summary

    Cheers
    Jon

  • You could try ...

    static int __init omap2_common_pm_init(void)
     {
            if (!of_have_populated_dt())
                    omap2_init_processor_devices();
            omap_pm_if_init();
     
           /* Register to the throughput class of PM QoS */
    -      omap2_pm_qos_tput_init();
    +     if (!of_have_populated_dt())
    +              omap2_pm_qos_tput_init();

            return 0;
    }

    However, I was seeing other issues after doing this.

    Jon

  • Dmesg after applying your patch 

    http://pastebin.com/dEprmGYK 

    Strange i2c9-i2c11 initialization.  

  • Aleksander,

    I suggest that you use the 3.0 kernel with one of the recent 4AI releases listed for Blaze or Blaze Tablet here: http://www.omappedia.com/wiki/Release_Notes

    The OMAP 3.4 kernel branch is still very much under development.  Cloning the top of the tree at any given time gives you a codebase that has not necessarily undergone validation on our platform and could lead to other issues, perhaps explaining what you are seeing.

    Regards,
    Gina 

  • I have also heard that we don't have plans to support device tree yet on our android baselines as it is still too early as far as device tree readiness on OMAP. So it could be possible to workaround some of these issues by disabling drivers such as display that is failing but on our side we are not testing on these kernels with device tree. Most of the device tree development is being done on the latest linux kernel and this is booting fine for me with device tree enabled on OMAP4. Cheers Jon

  • Aleksander,

    Is this still an issue? Can we close the thread?

    Magdalena