From 914e17dbe88ea504c56d3e942cba1f69003c6247 Mon Sep 17 00:00:00 2001 From: patacongo Date: Wed, 25 Apr 2007 00:09:44 +0000 Subject: [PATCH] Makesystem changes to better support different SoCs git-svn-id: https://nuttx.svn.sourceforge.net/svnroot/nuttx/trunk@184 7fd9a85b-ad96-42d3-883c-3090e2eb8679 --- nuttx/ChangeLog | 1 + nuttx/Documentation/NuttxPortingGuide.html | 35 +++++++++++++--- nuttx/Makefile | 46 ++++++++++++++++++++-- nuttx/arch/c5471/src/c5471.h | 2 +- nuttx/arch/c5471/src/up_internal.h | 2 +- nuttx/arch/dm320/src/dm320.h | 2 +- nuttx/arch/pjrc-8051/src/up_internal.h | 2 +- nuttx/configs/README.txt | 13 +++++- nuttx/configs/c5471evm/Make.defs | 2 +- nuttx/configs/c5471evm/defconfig | 8 ++-- nuttx/configs/m68332evb/Make.defs | 2 +- nuttx/configs/m68332evb/defconfig | 8 ++-- nuttx/configs/ntosd-dm320/Make.defs | 2 +- nuttx/configs/ntosd-dm320/defconfig | 8 ++-- nuttx/configs/pjrc-8051/defconfig | 10 ++--- nuttx/configs/sim/defconfig | 8 ++-- 16 files changed, 111 insertions(+), 40 deletions(-) diff --git a/nuttx/ChangeLog b/nuttx/ChangeLog index b4364a331..84ef49523 100644 --- a/nuttx/ChangeLog +++ b/nuttx/ChangeLog @@ -114,4 +114,5 @@ 0.2.4 2007-xx-xx Gregory Nutt * Verfied c5471 build under Cygwin on WinXP + * Makesystem changes to better support different SoCs. * Started m68322 diff --git a/nuttx/Documentation/NuttxPortingGuide.html b/nuttx/Documentation/NuttxPortingGuide.html index 90dfcec54..c0cd8eaca 100644 --- a/nuttx/Documentation/NuttxPortingGuide.html +++ b/nuttx/Documentation/NuttxPortingGuide.html @@ -331,16 +331,24 @@ 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. +
  • arch/c5471: TI TMS320C5471 (also called TMS320DM180 or just C5471). NuttX operates on the ARM7 of this dual core processor. This port is complete, verified, and included in the NuttX release 0.1.1. + +
  • configs/mcu123-lpc214x: + The mcu123.com lpc214x development board. + This is a work in progress. +
  • arch/dm320: - TI TMS320DM320 (also called just DM320). - NuttX operates on the ARM9EJS of this dual core processor. - This port complete, verified, and included in the NuttX release 0.2.1. + TI TMS320DM320 (also called just DM320). + NuttX operates on the ARM9EJS of this dual core processor. + This port complete, verified, and included in the NuttX release 0.2.1. +
  • arch/m68322 - A work in progress.
  • + A work in progress. +
  • arch/pjrc-8051: 8051 Microcontroller. This port is not quite ready for prime time.
  • @@ -463,6 +471,10 @@ with a GNU arm-elf toolchain*. This port is complete, verified, and included in the NuttX release. +
  • configs/mcu123-lpc214x: + This is a port to the mcu123.com lpc214x development board. + This OS is also built with the arm-elf toolchain*.
  • +
  • configs/ntosd-dm320: This port uses the Neuros OSD with a GNU arm-elf toolchain*. See Neuros Wiki @@ -1035,8 +1047,19 @@ The system can be re-made subsequently by just typing make.

    Architecture selection

      -
    • CONFIG_ARCH: identifies the arch subdirectory -
    • CONFIG_ARCH_name: for use in C code +
    • CONFIG_ARCH: + Identifies the arch subdirectory
    • +
    • CONFIG_ARCH_name: + For use in C code
    • +
    • CONFIG_ARCH_CHIP: + Identifies the arch/*/chip subdirectory
    • +
    • CONFIG_ARCH_CHIP_name: + For use in C code
    • +
    • CONFIG_ARCH_BOARD: + Identifies the configs subdirectory and hence, the board that supports + the particular chip or SoC.
    • +
    • CONFIG_ARCH_BOARD_name: + For use in C code

    General OS setup

    diff --git a/nuttx/Makefile b/nuttx/Makefile index 9a76f077a..b0af8e938 100644 --- a/nuttx/Makefile +++ b/nuttx/Makefile @@ -40,7 +40,7 @@ TOPDIR = ${shell pwd} ARCH_DIR = arch/$(CONFIG_ARCH) ARCH_SRC = $(ARCH_DIR)/src ARCH_INC = $(ARCH_DIR)/include -BOARD_DIR = configs/$(CONFIG_BOARD) +BOARD_DIR = configs/$(CONFIG_ARCH_BOARD) SUBDIRS = sched lib $(ARCH_SRC) mm fs drivers examples/$(CONFIG_EXAMPLE) @@ -53,12 +53,15 @@ BIN = nuttx$(EXEEXT) all: $(BIN) .PHONY: clean context clean_context distclean +# Build the mkconfig tool used to create include/nuttx/config.h tools/mkconfig: $(MAKE) -C tools -f Makefile.mkconfig TOPDIR=$(TOPDIR) mkconfig +# Create the include/nuttx/config.h file include/nuttx/config.h: $(TOPDIR)/.config tools/mkconfig tools/mkconfig $(TOPDIR) > include/nuttx/config.h +# link the arch//include dir to include/arch include/arch: Make.defs @if [ -e include/arch ]; then \ if [ -h include/arch ]; then \ @@ -70,6 +73,7 @@ include/arch: Make.defs fi @ln -s $(TOPDIR)/$(ARCH_DIR)/include include/arch +# Link the configs//include dir to include/arch/board include/arch/board: Make.defs include/arch @if [ -e include/arch/board ]; then \ if [ -h include/arch/board ]; then \ @@ -81,6 +85,7 @@ include/arch/board: Make.defs include/arch fi @ln -s $(TOPDIR)/$(BOARD_DIR)/include include/arch/board +# Link the configs//src dir to arch//src/board $(ARCH_SRC)/board: Make.defs @if [ -e $(ARCH_SRC)/board ]; then \ if [ -h $(ARCH_SRC)/board ]; then \ @@ -92,10 +97,45 @@ $(ARCH_SRC)/board: Make.defs fi @ln -s $(TOPDIR)/$(BOARD_DIR)/src $(ARCH_SRC)/board -context: check_context include/nuttx/config.h include/arch include/arch/board $(ARCH_SRC)/board +# Link arch//include/ to arch//include/chip +$(ARCH_SRC)/chip: Make.defs +ifneq ($(CONFIG_ARCH_CHIP),) + @if [ -e $(ARCH_SRC)/chip ]; then \ + if [ -h $(ARCH_SRC)/chip ]; then \ + rm -f $(ARCH_SRC)/chip ; \ + else \ + echo "$(ARCH_SRC)/chip exists but is not a symbolic link" ; \ + exit 1 ; \ + fi ; \ + fi + @ln -s $(CONFIG_ARCH_CHIP) $(ARCH_SRC)/chip +endif + +# Link arch//src/ to arch//src/chip +$(ARCH_INC)/chip: Make.defs +ifneq ($(CONFIG_ARCH_CHIP),) + @if [ -e $(ARCH_INC)/chip ]; then \ + if [ -h $(ARCH_INC)/chip ]; then \ + rm -f $(ARCH_INC)/chip ; \ + else \ + echo "$(ARCH_INC)/chip exists but is not a symbolic link" ; \ + exit 1 ; \ + fi ; \ + fi + @ln -s $(CONFIG_ARCH_CHIP) $(ARCH_INC)/chip +endif + +dirlinks: include/arch include/arch/board $(ARCH_SRC)/board $(ARCH_SRC)/chip $(ARCH_INC)/chip + +context: check_context include/nuttx/config.h dirlinks clean_context: - rm -f include/nuttx/config.h include/arch $(ARCH_INC)/board $(ARCH_SRC)/board + @rm -f include/nuttx/config.h include/arch + @if [ -h include/arch ]; then rm -f include/arch ; fi + @if [ -h $(ARCH_INC)/board ]; then rm -f $(ARCH_INC)/board ; fi + @if [ -h $(ARCH_SRC)/board ]; then rm -f $(ARCH_SRC)/board ; fi + @if [ -h $(ARCH_INC)/chip ]; then rm -f $(ARCH_INC)/chip ; fi + @if [ -h $(ARCH_SRC)/chip ]; then rm -f $(ARCH_SRC)/chip ; fi check_context: @if [ ! -e ${TOPDIR}/.config -o ! -e ${TOPDIR}/Make.defs ]; then \ diff --git a/nuttx/arch/c5471/src/c5471.h b/nuttx/arch/c5471/src/c5471.h index b91c9f3d1..9c085d7d7 100644 --- a/nuttx/arch/c5471/src/c5471.h +++ b/nuttx/arch/c5471/src/c5471.h @@ -46,7 +46,7 @@ # include #endif -#if defined(CONFIG_BOARD_C5471EVM) +#if defined(CONFIG_ARCH_BOARD_C5471EVM) # include #else # warning "Undefined C5471 Board" diff --git a/nuttx/arch/c5471/src/up_internal.h b/nuttx/arch/c5471/src/up_internal.h index fc5f92f7b..c032fa543 100644 --- a/nuttx/arch/c5471/src/up_internal.h +++ b/nuttx/arch/c5471/src/up_internal.h @@ -42,7 +42,7 @@ #include -#if defined(CONFIG_BOARD_C5471EVM) +#if defined(CONFIG_ARCH_BOARD_C5471EVM) # include #else # warning "Undefined C5471 Board" diff --git a/nuttx/arch/dm320/src/dm320.h b/nuttx/arch/dm320/src/dm320.h index 6f0f89e16..a147abd41 100644 --- a/nuttx/arch/dm320/src/dm320.h +++ b/nuttx/arch/dm320/src/dm320.h @@ -47,7 +47,7 @@ #include "arm9.h" -#if defined(CONFIG_BOARD_NTOSD_DM320) +#if defined(CONFIG_ARCH_BOARD_NTOSD_DM320) # include #else # warning "Unknown DM320 board" diff --git a/nuttx/arch/pjrc-8051/src/up_internal.h b/nuttx/arch/pjrc-8051/src/up_internal.h index 90ba556e9..8b2e2018a 100644 --- a/nuttx/arch/pjrc-8051/src/up_internal.h +++ b/nuttx/arch/pjrc-8051/src/up_internal.h @@ -43,7 +43,7 @@ #include #include -#if defined(CONFIG_BOARD_PJRC_87C52) +#if defined(CONFIG_ARCH_BOARD_PJRC_87C52) # include #else # warning "805x board not recognized" diff --git a/nuttx/configs/README.txt b/nuttx/configs/README.txt index f09046dff..ac1565f84 100644 --- a/nuttx/configs/README.txt +++ b/nuttx/configs/README.txt @@ -104,8 +104,13 @@ defconfig -- This is a configuration file similar to the Linux Architecture selection: - CONFIG_ARCH - identifies the arch/ subdirectory - CONFIG_ARCH_name - for use in C code + CONFIG_ARCH - Identifies the arch/ subdirectory + CONFIG_ARCH_name - For use in C code + CONFIG_ARCH_CHIP - Identifies the arch/*/chip subdirectory + CONFIG_ARCH_CHIP_name - For use in C code + CONFIG_ARCH_BOARD - Identifies the configs subdirectory and + hence, the board that supports the particular chip or SoC. + CONFIG_ARCH_BOARD_name - For use in C code General OS setup @@ -220,6 +225,10 @@ configs/c5471evm with a GNU arm-elf toolchain*. This port is complete, verified, and included in the NuttX release. +configs/mcu123-lpc214x + This is a port to the mcu123.com lpc214x development board. + This OS is also built with the the arm-elf toolchain* + configs/ntosd-dm320 This port uses the Neuros OSD with a GNU arm-elf toolchain*: see http://wiki.neurostechnology.com/index.php/Developer_Welcome . diff --git a/nuttx/configs/c5471evm/Make.defs b/nuttx/configs/c5471evm/Make.defs index f0ef5c845..8baeb3f36 100644 --- a/nuttx/configs/c5471evm/Make.defs +++ b/nuttx/configs/c5471evm/Make.defs @@ -47,7 +47,7 @@ ARCHPICFLAGS = -fpic ARCHWARNINGS = -Wall -Wstrict-prototypes -Wshadow ARCHDEFINES = ARCHINCLUDES = -I. -isystem $(TOPDIR)/include -ARCHSCRIPT = -T$(TOPDIR)/configs/$(CONFIG_BOARD)/ld.script +ARCHSCRIPT = -T$(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/ld.script CROSSDEV = arm-elf- CC = $(CROSSDEV)gcc diff --git a/nuttx/configs/c5471evm/defconfig b/nuttx/configs/c5471evm/defconfig index 2971805c5..3fd6a2e5d 100644 --- a/nuttx/configs/c5471evm/defconfig +++ b/nuttx/configs/c5471evm/defconfig @@ -40,9 +40,9 @@ # CONFIG_ARCH_name - for use in C code. This identifies the # particular chip or SoC that the architecture is implemented # in. -# CONFIG_BOARD - identifies the configs subdirectory and, hence, +# CONFIG_ARCH_BOARD - identifies the configs subdirectory and, hence, # the board that supports the particular chip or SoC. -# CONFIG_BOARD_name - for use in C code +# CONFIG_ARCH_BOARD_name - for use in C code # CONFIG_ROM_VECTORS - unique to c5471 # CONFIG_DRAM_END - the size of installed DRAM. # Unique to c5471 @@ -51,8 +51,8 @@ # CONFIG_ARCH=c5471 CONFIG_ARCH_C5471=y -CONFIG_BOARD=c5471evm -CONFIG_BOARD_C5471EVM=y +CONFIG_ARCH_BOARD=c5471evm +CONFIG_ARCH_BOARD_C5471EVM=y CONFIG_ROM_VECTORS=n CONFIG_DRAM_END=0x11000000 CONFIG_ARCH_LEDS=y diff --git a/nuttx/configs/m68332evb/Make.defs b/nuttx/configs/m68332evb/Make.defs index 2dc2d5b2b..74f14b967 100644 --- a/nuttx/configs/m68332evb/Make.defs +++ b/nuttx/configs/m68332evb/Make.defs @@ -47,7 +47,7 @@ ARCHPICFLAGS = -pic ARCHWARNINGS = -Wall -Wstrict-prototypes -Wshadow ARCHDEFINES = ARCHINCLUDES = -I. -isystem $(TOPDIR)/include -ARCHSCRIPT = -T$(TOPDIR)/configs/$(CONFIG_BOARD)/ld.script +ARCHSCRIPT = -T$(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/ld.script CROSSDEV = m68k-elf- CC = $(CROSSDEV)gcc diff --git a/nuttx/configs/m68332evb/defconfig b/nuttx/configs/m68332evb/defconfig index c63dc6aa2..256256362 100644 --- a/nuttx/configs/m68332evb/defconfig +++ b/nuttx/configs/m68332evb/defconfig @@ -40,17 +40,17 @@ # CONFIG_ARCH_name - for use in C code. This identifies the # particular chip or SoC that the architecture is implemented # in. -# CONFIG_BOARD - identifies the configs subdirectory and, hence, +# CONFIG_ARCH_BOARD - identifies the configs subdirectory and, hence, # the board that supports the particular chip or SoC. -# CONFIG_BOARD_name - for use in C code +# CONFIG_ARCH_BOARD_name - for use in C code # CONFIG_DRAM_SIZE - Describes the installed DRAM. # CONFIG_ARCH_STACKDUMP - Do stack dumps after assertions # CONFIG_ARCH=m68332evb CONFIG_ARCH_M68332=y CONFIG_ARCH_M68332EVB=y -CONFIG_BOARD=m68332evb -CONFIG_BOARD_M68332EVB=y +CONFIG_ARCH_BOARD=m68332evb +CONFIG_ARCH_BOARD_M68332EVB=y CONFIG_DRAM_SIZE=0x003000 CONFIG_DRAM_NUTTXENTRY=0x003000 CONFIG_ARCH_STACKDUMP=y diff --git a/nuttx/configs/ntosd-dm320/Make.defs b/nuttx/configs/ntosd-dm320/Make.defs index 8fbe74836..62302a2f4 100644 --- a/nuttx/configs/ntosd-dm320/Make.defs +++ b/nuttx/configs/ntosd-dm320/Make.defs @@ -47,7 +47,7 @@ ARCHPICFLAGS = -fpic ARCHWARNINGS = -Wall -Wstrict-prototypes -Wshadow ARCHDEFINES = ARCHINCLUDES = -I. -isystem $(TOPDIR)/include -ARCHSCRIPT = -T$(TOPDIR)/configs/$(CONFIG_BOARD)/ld.script +ARCHSCRIPT = -T$(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/ld.script CROSSDEV = arm-elf- CC = $(CROSSDEV)gcc diff --git a/nuttx/configs/ntosd-dm320/defconfig b/nuttx/configs/ntosd-dm320/defconfig index 7ea06e217..bb20353e0 100644 --- a/nuttx/configs/ntosd-dm320/defconfig +++ b/nuttx/configs/ntosd-dm320/defconfig @@ -40,17 +40,17 @@ # CONFIG_ARCH_name - for use in C code. This identifies the # particular chip or SoC that the architecture is implemented # in. -# CONFIG_BOARD - identifies the configs subdirectory and, hence, +# CONFIG_ARCH_BOARD - identifies the configs subdirectory and, hence, # the board that supports the particular chip or SoC. -# CONFIG_BOARD_name - for use in C code +# CONFIG_ARCH_BOARD_name - for use in C code # CONFIG_ROM_VECTORS - unique to dm320 # CONFIG_DRAM_SIZE - Describes the installed DRAM. # CONFIG_ARCH_STACKDUMP - Do stack dumps after assertions # CONFIG_ARCH=dm320 CONFIG_ARCH_DM320=y -CONFIG_BOARD=ntosd-dm320 -CONFIG_BOARD_NTOSD_DM320=y +CONFIG_ARCH_BOARD=ntosd-dm320 +CONFIG_ARCH_BOARD_NTOSD_DM320=y CONFIG_ROM_VECTORS=n CONFIG_DRAM_SIZE=0x01000000 CONFIG_DRAM_NUTTXENTRY=0x01008000 diff --git a/nuttx/configs/pjrc-8051/defconfig b/nuttx/configs/pjrc-8051/defconfig index cc5da93bd..a3aabdbdb 100644 --- a/nuttx/configs/pjrc-8051/defconfig +++ b/nuttx/configs/pjrc-8051/defconfig @@ -39,17 +39,15 @@ # processor architecture. # CONFIG_ARCH_8051 - Set if processor is 8051 family # CONFIG_ARCH_8052 = Set if processor is 8052 family -# CONFIG_BOARD - identifies the configs subdirectory and, hence, +# CONFIG_ARCH_BOARD - identifies the configs subdirectory and, hence, # the board that supports the particular chip or SoC. -# CONFIG_BOARD_name - for use in C code -# CONFIG_BOARD - identifies the configs subdirectory -# CONFIG_BARD_name - for use in C code +# CONFIG_ARCH_BOARD_name - for use in C code # CONFIG_ARCH=pjrc-8051 CONFIG_ARCH_8051=n CONFIG_ARCH_8052=y -CONFIG_BOARD=pjrc-8051 -CONFIG_BOARD_PJRC_87C52=y +CONFIG_ARCH_BOARD=pjrc-8051 +CONFIG_ARCH_BOARD_PJRC_87C52=y # # Architecture-specific settings. These may mean nothing to diff --git a/nuttx/configs/sim/defconfig b/nuttx/configs/sim/defconfig index 935ca1db2..7736a65de 100644 --- a/nuttx/configs/sim/defconfig +++ b/nuttx/configs/sim/defconfig @@ -40,14 +40,14 @@ # CONFIG_ARCH_name - for use in C code. This identifies the # particular chip or SoC that the architecture is implemented # in. -# CONFIG_BOARD - identifies the configs subdirectory and, hence, +# CONFIG_ARCH_BOARD - identifies the configs subdirectory and, hence, # the board that supports the particular chip or SoC. -# CONFIG_BOARD_name - for use in C code +# CONFIG_ARCH_BOARD_name - for use in C code # CONFIG_ARCH=sim CONFIG_ARCH_SIM=y -CONFIG_BOARD=sim -CONFIG_BOARD_SIM=y +CONFIG_ARCH_BOARD=sim +CONFIG_ARCH_BOARD_SIM=y # # General OS setup