From bcc61339f95e2a8fdf734b5ccc536d2eefdb2f96 Mon Sep 17 00:00:00 2001 From: patacongo Date: Fri, 23 Mar 2007 02:25:54 +0000 Subject: [PATCH] Create configs/ dir; separate board configuration from processor architecture git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@126 42af7a65-404d-4744-a932-0658087f49c3 --- Documentation/NuttX.html | 4 + Documentation/NuttxPortingGuide.html | 238 +++++++++++++++++---------- 2 files changed, 159 insertions(+), 83 deletions(-) diff --git a/Documentation/NuttX.html b/Documentation/NuttX.html index 6552e9510fa..01bfbbc02c8 100644 --- a/Documentation/NuttX.html +++ b/Documentation/NuttX.html @@ -430,6 +430,10 @@ Other memory: * Some Documentation updates * Added support for the Neuros OSD / DM320 +0.2.2 2007-xx-xx Gregory Nutt + * Created the configs/ directory; separated board configuration + from processor architecture logic + * Started m68322 diff --git a/Documentation/NuttxPortingGuide.html b/Documentation/NuttxPortingGuide.html index 77d274b65f4..707c8001f25 100644 --- a/Documentation/NuttxPortingGuide.html +++ b/Documentation/NuttxPortingGuide.html @@ -16,7 +16,7 @@

by

Gregory Nutt

-

Last Update: March 20, 2007

+

Last Update: March 22, 2007

Table of Contents

@@ -26,19 +26,25 @@
  • 2.1 Documentation
  • 2.2 arch -
  • 2.3 drivers
  • -
  • 2.4 examples
  • -
  • 2.5 fs
  • -
  • 2.6 include
  • -
  • 2.7 lib
  • -
  • 2.8 mm
  • -
  • 2.9 sched
  • -
  • 2.10 tools
  • +
  • 2.3 configs/
  • + +
  • 2.4 drivers
  • +
  • 2.5 examples
  • +
  • 2.6 fs
  • +
  • 2.7 include
  • +
  • 2.8 lib
  • +
  • 2.9 mm
  • +
  • 2.10 sched
  • +
  • 2.11 tools
  • 3.0 Configuring and Building
  • 4.0 Architecture APIs
  • @@ -101,13 +107,16 @@ below and discussed in the following paragraphs:

    |-- Documentation | `-- (documentation files) |-- arch -| |-- (architecture) +| |-- <arch-name> +| | |-- include +| | `-- src +| `-- <:;other-architectures> +|-- configs +| |-- <board-name> | | |-- Make.defs | | |-- defconfig -| | |-- include -| | |-- setenv.sh -| | `-- src -| `-- (other architectures) +| | `-- setenv.sh +| `-- <:;other-architectures> |-- drivers | |-- Makefile | `-- (driver source files) @@ -149,68 +158,32 @@ below and discussed in the following paragraphs:

    2.2 arch

    -

    2.2.1 Subdirectory Structure

    +

    2.2.1 Subdirectory Structure

    This directory contains several sub-directories, each containing architecture-specific logic. - The task of porting NuttX to a new processor or board consists of + The task of porting NuttX to a new processor consists of add a new sudirectory under arch/ containing logic specific to the new architecuture. + The complete board port in is defined by the architecture-specific code in this + directory (plus the board-specific configurations in the config/ + subdirectory). Each architecture must provide a subdirectory, <arch-name> - under arch/ with the folling characteristics: + under arch/ with the following characteristics:

       	<arch-name>
      -	|-- Make.defs
      -	|-- defconfig
      -	|-- setenv.sh
       	|-- include
       	|   |-- arch.h
       	|   |-- irq.h
       	|   `-- types.h
       	`-- src
       	    |-- Makefile
      -	    `-- (architecture-specific source files)
      +	    `-- (architecture-specific source files)
       
    -

    2.2.2 Summary of Files

    +

    2.2.2 Summary of Files

      -
    • - Make.defs: This makefile fragment provides architecture and - tool-specific build options. It will be included by all other - makefiles in the build (once it is installed). This make fragment - should define: -
        -
      • Tools: CC, LD, AR, NM, OBJCOPY, OBJDUMP
      • -
      • Tool options: CFLAGS, LDFLAGS
      • -
      -

      - When this makefile fragment runs, it will be passed TOPDIR which - is the path to the root directory of the build. This makefile - fragment may include ${TOPDIR}/.config to perform configuration - specific settings. For example, the CFLAGS will most likely be - different if CONFIG_DEBUG=y. -

    • -
    • - defconfig: This is a configuration file similar to the Linux - configuration file. In contains varialble/value pairs like: -
        -
      • CONFIG_VARIABLE=value
      • -
      -

      - This configuration file will be used at build time: -

      -
        -
      1. As a makefile fragment included in other makefiles, and
      2. -
      3. to generate include/nuttx/config.h which is included by - most C files in the system.
      4. -
      -
    • -
    • - setenv.sh: This is a script that you can include that will be installed at - the toplevel of the directory structure and can be sourced to set any - necessary environment variables. -
    • include/arch.h: This is a hook for any architecture specific definitions that may @@ -273,6 +246,12 @@ below and discussed in the following paragraphs:

      the final link with libup.a and other system archives to generate the final executable.
    • +
    • + (architecture-specific source files). + The file include/nuttx/arch.h identifies all of the APIs that must + be provided by the architecture specific logic. (It also includes + arch/<arch-name>/arch.h as described above). +

    2.2.3 Supported Architectures

    @@ -284,33 +263,126 @@ below and discussed in the following paragraphs:

    round robin scheduler) Otherwise, it is complete.
  • arch/c5471: TI TMS320C5471 (also called TMS320DM180 or just C5471). - NuttX operates on the ARM7 of this dual core processor. This port - uses the Spectrum Digital evaluation board with a GNU arm-elf toolchain*. - This port is complete, verified, and included in the NuttX release. + NuttX operates on the ARM7 of this dual core processor. + This port is complete, verified, and included in the NuttX release 0.1.1.
  • arch/dm320: TI TMS320DM320 (also called just DM320). NuttX operates on the ARM9EJS of this dual core processor. - This port uses the Neuros OSD with a GNU arm-elf toolchain*: - see http://wiki.neurostechnology.com/index.php/Developer_Welcome . - STATUS: This port is code complete but totally untested due to - hardware issues with my OSD. + This port complete, verified, and included in the NuttX release 0.2.1. +
  • arch/m68322 + A work in progress.
  • arch/pjrc-8051: - 8051 Microcontroller. This port uses the PJRC 87C52 development system - and the SDCC toolchain. This port is not quite ready for prime time. + 8051 Microcontroller. This port is not quite ready for prime time.
  • Other ports for the for the TI TMS320DM270 and for MIPS are in various states of progress

    -

    2.2.4 Configuring NuttX

    +

    2.3 configs

    +

    + The configs/ subdirectory contains configuration data for each board. + These board-specific configurations plus the architecture-specific configurations in + the arch/ subdirectory complete define a customized port of NuttX. +

    + +

    2.3.1 Subdirectory Structure

    +

    + The configs directory contains board specific configuration files. Each board must + provide a subdirectory <board-name> under configs/ with the following characteristics: +

    +
      +	<board-name>
      +	|-- Make.defs
      +	|-- defconfig
      +	`-- setenv.sh
      +
    + +

    2.3.2 Summary of Files

    +
      +
    • + Make.defs: This makefile fragment provides architecture and + tool-specific build options. It will be included by all other + makefiles in the build (once it is installed). This make fragment + should define: +
        +
      • Tools: CC, LD, AR, NM, OBJCOPY, OBJDUMP
      • +
      • Tool options: CFLAGS, LDFLAGS
      • +
      +

      + When this makefile fragment runs, it will be passed TOPDIR which + is the path to the root directory of the build. This makefile + fragment may include ${TOPDIR}/.config to perform configuration + specific settings. For example, the CFLAGS will most likely be + different if CONFIG_DEBUG=y. +

    • +
    • + defconfig: This is a configuration file similar to the Linux + configuration file. In contains varialble/value pairs like: +
        +
      • CONFIG_VARIABLE=value
      • +
      +

      + This configuration file will be used at build time: +

      +
        +
      1. As a makefile fragment included in other makefiles, and
      2. +
      3. to generate include/nuttx/config.h which is included by + most C files in the system.
      4. +
      +
    • +
    • + setenv.sh: This is a script that you can include that will be installed at + the toplevel of the directory structure and can be sourced to set any + necessary environment variables. +
    • +
    + +

    2.3.3 Supported Boards

    +
      +
    • configs/sim: + A user-mode port of NuttX to the x86 Linux platform is available. + The purpose of this port is primarily to support OS feature developement. + This port does not support interrupts or a real timer (and hence no + round robin scheduler) Otherwise, it is complete.
    • + +
    • configs/c5471evm: + This is a port to the Spectrum Digital C5471 evaluation board. The + C5471 is a dual core processor from TI with an ARM7TDMI general purpose + processor and a c54 SDP. NuttX runs on the ARM core and is built with + with a GNU arm-elf toolchain*. This port is complete, verified, and + included in the NuttX release.
    • + +
    • configs/ntosd-dm320: + This port uses the Neuros OSD with a GNU arm-elf toolchain*. + See Neuros Wiki + for futher information. + NuttX operates on the ARM9EJS of this dual core processor. + STATUS: This port is code complete, verified, and included in the + NuttX 0.2.1 release.
    • + +
    • configs/m68322evb: + This is a work in progress for the venerable m68322evb board from + Motorola.
    • + +
    • configs/pjrc-8051: + 8051 Microcontroller. This port uses the PJRC 87C52 development system + and the SDCC toolchain. This port is not quite ready for prime time.
    • +
    + +

    + * A customized version of the buildroot + is available to build these toolchains. +

    + +

    2.3.4 Configuring NuttX

    Configuring NuttX requires only copying:

      - arch/<arch-name>/Make.def to ${TOPDIR}/Make.defs, - arch/<arch-name>/setenv.sh to ${TOPDIR}/setenv.sh, and - arch-name>/defconfig to ${TOPDIR}/.config + configs/<board-name>/Make.def to ${TOPDIR}/Make.defs, + configs/<board-name>/setenv.sh to ${TOPDIR}/setenv.sh, and + configs/<board-name>/defconfig to ${TOPDIR}/.config

    There is a script that automates these steps. The following steps will @@ -318,22 +390,22 @@ below and discussed in the following paragraphs:

         cd tools
      -  ./configure.sh <arch-name>
      +  ./configure.sh <board-name>
       
    -

    2.3 drivers

    +

    2.4 drivers

    This directory holds architecture-independent device drivers.

    -

    2.4 examples

    +

    2.5 examples

    Example and test programs to build against.

    -

    2.5 fs

    +

    2.6 fs

    This directory contains the NuttX filesystem. @@ -345,7 +417,7 @@ below and discussed in the following paragraphs:

    in a file-system-like name space.

    -

    2.6 include

    +

    2.7 include

    This directory holds NuttX header files. Standard header files file retained in can be included in the normal fashion: @@ -356,26 +428,26 @@ below and discussed in the following paragraphs:

    etc. -

    2.7 lib

    +

    2.8 lib

    This directory holds a collection of standard libc-like functions with custom interfaces into Nuttx.

    -

    2.8 mm

    +

    2.9 mm

    This is the NuttX memory manager.

    -

    2.9 sched

    +

    2.10 sched

    The files forming core of the NuttX RTOS reside here.

    -

    2.10 tools

    +

    2.11 tools

    This directory holds a collection of tools and scripts to simplify