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.

Creating Linux configuration for custom DM368 design

I am making a new Linux kernel configuration for our board design, which is based on the DM365 EVM.  The chip on our board is the DM368, but for now the DM365EVM configuration is all I have.  I have installed the DVSDK 4 beta and the kernel is 2.6.32 rc2.

The problem I currently have is that after the kernel is loaded and uncompressed it freezes at "booting the kernel".  I'll explain my procedure for creating the new configuration and perhaps someone will have some comments.  Also it seems like the kind of info that should be available as I would think that most would want to create a configuration for their board.

I'll use "myboard" instead of "dm365 evm" for the purposes of discussion

1) First I copied the file....

arch/arm/mach-davini/board-dm365_evm.c to board-myboard.c

This is so my configuration starts off exactly the same as the EVM.  Then I can start making changed.


2) Edit the MACHINE_START definition at the end of the file board_myboard.c

MACHINE_START(DAVINCI_MYBOARD, "DaVinci MyBoard")


3) Edit arch/arm/mach_davinci/kconfig to add my config....

config MACH_DAVINCI_MYBOARD
    bool "DM365 Myboard"
    default ARCH_DAVINCI_DM365
    depends on ARCH_DAVINCI_DM365
    help
      Configure this option to specify whether the board used
      for development is My Board

NOTE: One thing that I ran into is that selecting MyBoard doesn't unselect the EVM in the configuration. Not sure why.
Also I'm not sure what the line "default ARCH_DAVINCI_DM365" does but I moved it from the EVM to MyBoard.


4) Edit arch/arm/mach-davini/ to add the line....

obj-$(CONFIG_MACH_DAVINCI_MYBOARD)    += board-myboard.o


5) Edit include/asm/mach_types.h to create a new machine type for "myboard".

#define MACH_TYPE_DAVINCI_MYBOARD      2438

and...

#ifdef CONFIG_MACH_DAVINCI_MYBOARD
# ifdef machine_arch_type
#  undef machine_arch_type
#  define machine_arch_type    __machine_arch_type
# else
#  define machine_arch_type    MACH_TYPE_DAVINCI_MYBOARD
# endif
# define machine_is_myboard()    (machine_arch_type == MACH_TYPE_DAVINCI_MYBOARD)
#else
# define machine_is_myboard()    (0)
#endif

6) Search the kernel source for all occurances of machine_is_davinci_dm365_evm() and add machine_is_myboard().

I do this so initially all things that are done for the EVM are also done for MYBOARD.

I may have missed something, but that's pretty much it.  My intention is to then use diff again the orig kernel source to make a patch file.

 

John A

  • Found some more additions...

    7) Edit sound/soc/davinci/Kconfig.

    change...

    depends on MACH_DAVINCI_EVM || MACH_DAVINCI_DM355_EVM  || MACH_DAVINCI_DM365_EVM

    to...

    depends on MACH_DAVINCI_EVM || MACH_DAVINCI_DM355_EVM  || MACH_DAVINCI_DM365_EVM || MACH_DAVINCI_MYBOARD

     

    8) Edit drivers/input/misc/Kconfig

    change...

    depends on MACH_DAVINCI_DM365_EVM

    to...

    depends on MACH_DAVINCI_DM365_EVM || MACH_DAVINCI_MYBOARD

     

  • Does anyone know how the machine gets initialized?  None of the routines in my MACHINE_START definition are being called.  Somewhere in the Linux kernel my configuration is missing some info.

    John A

  • Issue solved!  The machine definition is actually in u-boot.  If you create a new type then u-boot must be updated to start that machine.  The machine type code for the dm365 evm is 1939.  In my original post I created a new machine code for my board.  Without updating u-boot with the code I couldn't get the kernel started.  My solution at this point was to also use the same code 1939 for my board definition.

    I hope this thread serves to help others who need to makea custom kernel configuration for their own board.  Our board doesn't have all the same chips on it as the EVM, so a custom configuration seemed like the way to go.

    John A