Linux Kernel

From Linux/Xtensa
Revision as of 23:47, 18 March 2013 by Chris (talk | contribs)
Jump to navigation Jump to search

The current mechanism to support a specific Xtensa processor configuration is not yet fully automated, but is a very simple and straight forward process. Note that the Xtensa port of Linux uses the terminology variant to describe a processor configuration. For this example, we will use MyCore as the new processor name, but any name can be used. The steps involved adding a processor configuration are:

  1. Create a new directory for the processor variant (MyCore) and copy a set of configuration files that describes the processor to that directory
  2. Add the name of the processor configuration to a Linux configuration file.
  3. Add the path of the variant directory to a Makefile

Create a directory for the variant and copy configuration files

All processor configuration specific sources and header files are located in arch/xtensa/variants/variant-name for source files, and arch/xtensa/variants/variant-name/include/variant for header files. The include directory typically contains at least the following three files that describe the processor configuration:

  • tie.h - describing custom defined TIE registers
  • tie-asm.h - macros to access additional TIE registers
  • core.h - describing various processor configurations, such as cache sizes, register options, etc.

All processor configurations provide a set of these files as part of the overlay provided by Tensilica.

If we want to add another processor, we have to create the following directory and copy the three configurations file to that directory:

mkdir -p arch/xtensa/variants/MyCore/include/variant
cp tie.h tie-asm.h core.h arch/xtensa/variants/MyCore/include/variant

Add the processor name to a Linux configuration file

The file arch/xtensa/Kconfig contains a list of processor configurations. Simply add a new entry under the menu "Processor type and features" in the "Xtensa Processor Configuration" list. In most cases, the configuration will have an MMU, so add also the line select MMU.

        prompt "Xtensa Processor Configuration"
        bool "dc233c - Diamond 233L Standard Core Rev.C (LE)"
        select MMU
        bool "MyCore - My extreeem core"
        select MMU
          MyCore with various optimizations.

Add the processor to the makefile

Simply add a line for your core at the top of the file. The part of the configuration name CONFIG_XTENSA_VARIANT_MYCORE after CONFIG_ must match the name that was added to Kconfig, and the right hand side must match the name of the directory created in step 1.

variant-$(CONFIG_XTENSA_VARIANT_S6000)          := s6000
variant-$(CONFIG_XTENSA_VARIANT_MYCORE)         := MyCore