summaryrefslogtreecommitdiff
path: root/nuttx
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2009-12-11 23:46:08 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2009-12-11 23:46:08 +0000
commitf482801a71b3c57e0fba6443076850a0b1a90691 (patch)
tree36deded3aec57642751b13b061b2534930644344 /nuttx
parent85e0e91f408ee6c26e6eeb07742a73d3871215ce (diff)
downloadpx4-nuttx-f482801a71b3c57e0fba6443076850a0b1a90691.tar.gz
px4-nuttx-f482801a71b3c57e0fba6443076850a0b1a90691.tar.bz2
px4-nuttx-f482801a71b3c57e0fba6443076850a0b1a90691.zip
Add banked and non-banked configurations
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@2322 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx')
-rwxr-xr-xnuttx/arch/hc/src/mc9s12ne64/mc9s12ne64_start.S48
-rwxr-xr-xnuttx/arch/hc/src/mc9s12ne64/mc9s12ne64_vectors.S24
-rwxr-xr-xnuttx/configs/demo9s12ne64/README.txt12
-rwxr-xr-xnuttx/configs/demo9s12ne64/ostest/Make.defs20
-rwxr-xr-xnuttx/configs/demo9s12ne64/ostest/defconfig37
-rwxr-xr-xnuttx/configs/demo9s12ne64/ostest/ld.script.banked (renamed from nuttx/configs/demo9s12ne64/ostest/ld.script)2
-rwxr-xr-xnuttx/configs/demo9s12ne64/ostest/ld.script.nonbanked117
7 files changed, 201 insertions, 59 deletions
diff --git a/nuttx/arch/hc/src/mc9s12ne64/mc9s12ne64_start.S b/nuttx/arch/hc/src/mc9s12ne64/mc9s12ne64_start.S
index c99ca3a15..34823f307 100755
--- a/nuttx/arch/hc/src/mc9s12ne64/mc9s12ne64_start.S
+++ b/nuttx/arch/hc/src/mc9s12ne64/mc9s12ne64_start.S
@@ -94,6 +94,15 @@
movb #INITRM_MAP, HCS12_MMC_INITRM /* Set RAM position to 0x2000-0x3fff */
movb #INITEE_EE, HCS12_MMC_INITEE /* Set EEPROM position to 0x0800 */
+
+ /* In the non-banked mode, PPAGE is set to 0x3d to create a contiguous, 48Kb
+ * .text address space.
+ */
+
+#ifdef CONFIG_HCS12_NONBANKED
+ movb #0x3d, HCS12_MMC_PPAGE
+#endif
+
movb #MMC_MISC_ROMON, HCS12_MMC_MISC /* MISC: EXSTR1=0 EXSTR0=0 ROMHM=0 ROMON=1 */
.endm
@@ -188,7 +197,11 @@ __start:
/* Now, start the OS */
showprogress '\n'
+#ifdef CONFIG_HCS12_NONBANKED
+ jsr os_start
+#else
call os_start
+#endif
bra __start
/* Variables:
@@ -201,32 +214,37 @@ __start:
*/
.Lsbss:
- .long _sbss
+ .hword _sbss
.Lebss:
- .long _ebss
+ .hword _ebss
.Lstackbase:
.hword _ebss+CONFIG_IDLETHREAD_STACKSIZE-4
.Leronly:
- .long _eronly /* Where .data defaults are stored in FLASH */
+ .hword _eronly /* Where .data defaults are stored in FLASH */
.Lsdata:
- .long _sdata /* Where .data needs to reside in SDRAM */
+ .hword _sdata /* Where .data needs to reside in SDRAM */
.Ledata:
- .long _edata
+ .hword _edata
.size __start, .-__start
- /* This global variable is unsigned long g_heapbase and is
- * exported from here only because of its coupling to LCO
- * above.
- */
- .data
- .align 4
+/************************************************************************************
+ * .rodata
+ ************************************************************************************/
+
+ .section .rodata, "a"
+
+/* Variables: _sbss is the start of the BSS region (see ld.script) _ebss is the end
+ * of the BSS regsion (see ld.script). The idle task stack starts at the end of BSS
+ * and is of size CONFIG_IDLETHREAD_STACKSIZE. The IDLE thread is the thread that
+ * the system boots on and, eventually, becomes the idle, do nothing task that runs
+ * only when there is nothing else to run. The heap continues from there until the
+ * end of memory. See g_heapbase below.
+ */
+
.globl g_heapbase
.type g_heapbase, object
g_heapbase:
- .long _ebss+CONFIG_IDLETHREAD_STACKSIZE
+ .hword _ebss+CONFIG_IDLETHREAD_STACKSIZE
.size g_heapbase, .-g_heapbase
-
- .end
-
.end
diff --git a/nuttx/arch/hc/src/mc9s12ne64/mc9s12ne64_vectors.S b/nuttx/arch/hc/src/mc9s12ne64/mc9s12ne64_vectors.S
index 47d793ba0..b21f53b62 100755
--- a/nuttx/arch/hc/src/mc9s12ne64/mc9s12ne64_vectors.S
+++ b/nuttx/arch/hc/src/mc9s12ne64/mc9s12ne64_vectors.S
@@ -197,6 +197,9 @@ vcommon:
.size handlers, .-handlers
/************************************************************************************
+ * .bss
+ ************************************************************************************/
+/************************************************************************************
* Name: up_interruptstack/g_userstack
*
* Description:
@@ -212,26 +215,5 @@ up_interruptstack:
up_interruptstack_base:
.size up_interruptstack, .-up_interruptstack
#endif
-
-/************************************************************************************
- * .rodata
- ************************************************************************************/
-
- .section .rodata, "a"
-
-/* Variables: _sbss is the start of the BSS region (see ld.script) _ebss is the end
- * of the BSS regsion (see ld.script). The idle task stack starts at the end of BSS
- * and is of size CONFIG_IDLETHREAD_STACKSIZE. The IDLE thread is the thread that
- * the system boots on and, eventually, becomes the idle, do nothing task that runs
- * only when there is nothing else to run. The heap continues from there until the
- * end of memory. See g_heapbase below.
- */
-
- .globl g_heapbase
- .type g_heapbase, object
-g_heapbase:
- .long _ebss+CONFIG_IDLETHREAD_STACKSIZE
- .size g_heapbase, .-g_heapbase
-
.end
diff --git a/nuttx/configs/demo9s12ne64/README.txt b/nuttx/configs/demo9s12ne64/README.txt
index 54bfcb1d3..0aceb49fc 100755
--- a/nuttx/configs/demo9s12ne64/README.txt
+++ b/nuttx/configs/demo9s12ne64/README.txt
@@ -253,13 +253,19 @@ HCS12/DEMO9S12NEC64-specific Configuration Options
the 100 second delay then adjust CONFIG_ARCH_LOOPSPERMSEC until
the delay actually is 100 seconds.
- HCS12 specific chip initialization
-
- HCS12 specific device driver settings
+ HCS12 build options:
CONFIG_HCS12_SERIALMON - Indicates that the target systems uses
the Freescale serial bootloader.
+ CONFIG_HCS12_NONBANKED - Indicates that the target systems does not
+ support banking. Only short calls are made; one fixed page is
+ presented the the paging window. Only 48Kb of FLASH is usable
+ in this configuration: pages 3e, 3d, then 3f will appear as a
+ contiguous address space in memory.
+
+ HCS12 specific device driver settings:
+
CONFIG_SCIO_SERIAL_CONSOLE - selects the SCIO for the
console and ttys0 (default is the UART0).
diff --git a/nuttx/configs/demo9s12ne64/ostest/Make.defs b/nuttx/configs/demo9s12ne64/ostest/Make.defs
index d125c36f9..1068d3042 100755
--- a/nuttx/configs/demo9s12ne64/ostest/Make.defs
+++ b/nuttx/configs/demo9s12ne64/ostest/Make.defs
@@ -36,11 +36,19 @@
include ${TOPDIR}/.config
# Setup for the selected toolchain
+# NuttX buildroot under Linux or Cygwin
- # NuttX buildroot under Linux or Cygwin
- CROSSDEV = m68hc12-elf-
- ARCHCPUFLAGS = -m68hcs12 -mshort
- MAXOPTIMIZATION = -Os
+CROSSDEV = m68hc12-elf-
+MAXOPTIMIZATION = -Os
+WINTOOL = n
+
+ifeq ($(CONFIG_HCS12_NONBANKED),y)
+ ARCHCPUFLAGS = -m68hcs12 -mshort -mnolong-calls
+ LDSCRIPT = ld.script.nonbanked
+else
+ ARCHCPUFLAGS = -m68hcs12 -mshort -mlong-calls
+ LDSCRIPT = ld.script.banked
+endif
ifeq ($(WINTOOL),y)
# Windows-native toolchains
@@ -49,14 +57,14 @@ ifeq ($(WINTOOL),y)
MKDEP = $(TOPDIR)/tools/mknulldeps.sh
ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}"
ARCHXXINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" -isystem "${shell cygpath -w $(TOPDIR)/include/cxx}"
- ARCHSCRIPT = -T "${shell cygpath -w $(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/ostest/ld.script}"
+ ARCHSCRIPT = -T "${shell cygpath -w $(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/ostest/$(LDSCRIPT)}"
MAXOPTIMIZATION = -O2
else
# Linux/Cygwin-native toolchain
MKDEP = $(TOPDIR)/tools/mkdeps.sh
ARCHINCLUDES = -I. -isystem $(TOPDIR)/include
ARCHXXINCLUDES = -I. -isystem $(TOPDIR)/include -isystem $(TOPDIR)/include/cxx
- ARCHSCRIPT = -T$(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/ostest/ld.script
+ ARCHSCRIPT = -T$(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/ostest/$(LDSCRIPT)
endif
CC = $(CROSSDEV)gcc
diff --git a/nuttx/configs/demo9s12ne64/ostest/defconfig b/nuttx/configs/demo9s12ne64/ostest/defconfig
index 6e2409360..82fa012a3 100755
--- a/nuttx/configs/demo9s12ne64/ostest/defconfig
+++ b/nuttx/configs/demo9s12ne64/ostest/defconfig
@@ -89,12 +89,24 @@ CONFIG_ARCH_BUTTONS=n
CONFIG_ARCH_CALIBRATION=n
CONFIG_ARCH_DMA=n
+#
+# HCS12 build options:
+#
+# CONFIG_HCS12_SERIALMON - Indicates that the target systems uses
+# the Freescale serial bootloader.
+# CONFIG_HCS12_NONBANKED - Indicates that the target systems does not
+# support banking. Only short calls are made; one fixed page is
+# presented the the paging window. Only 48Kb of FLASH is usable
+# in this configuration: pages 3e, 3d, then 3f will appear as a
+# contiguous address space in memory.
+#
+
+CONFIG_HCS12_SERIALMON=y
+CONFIG_HCS12_NONBANKED=y
#
# MC9S12NEC64 specific serial device driver settings
#
-# CONFIG_HCS12_SERIALMON - Indicates that the target systems uses
-# the Freescale serial bootloader.
# CONFIG_SCIO_SERIAL_CONSOLE - selects the SCIO for the
# console and ttys0 (default is the SCIO).
# CONFIG_SCIO_RXBUFSIZE - Characters are buffered as received.
@@ -106,10 +118,9 @@ CONFIG_ARCH_DMA=n
# CONFIG_SCIO_PARTIY - 0=no parity, 1=odd parity, 2=even parity
# CONFIG_SCIO_2STOP - Two stop bits
#
-CONFIG_HCS12_SERIALMON=y
CONFIG_SCIO_SERIAL_CONSOLE=y
-CONFIG_SCIO_TXBUFSIZE=256
-CONFIG_SCIO_RXBUFSIZE=256
+CONFIG_SCIO_TXBUFSIZE=32
+CONFIG_SCIO_RXBUFSIZE=32
CONFIG_SCIO_BAUD=115200
CONFIG_SCIO_BITS=8
CONFIG_SCIO_PARITY=0
@@ -257,8 +268,8 @@ CONFIG_RR_INTERVAL=200
CONFIG_SCHED_INSTRUMENTATION=n
CONFIG_TASK_NAME_SIZE=0
CONFIG_START_YEAR=2009
-CONFIG_START_MONTH=9
-CONFIG_START_DAY=21
+CONFIG_START_MONTH=12
+CONFIG_START_DAY=11
CONFIG_GREGORIAN_TIME=n
CONFIG_JULIAN_TIME=n
CONFIG_DEV_CONSOLE=y
@@ -274,7 +285,7 @@ CONFIG_NXFLAT=n
CONFIG_SCHED_WORKQUEUE=n
CONFIG_SCHED_WORKPRIORITY=50
CONFIG_SCHED_WORKPERIOD=(50*1000)
-CONFIG_SCHED_WORKSTACKSIZE=1024
+CONFIG_SCHED_WORKSTACKSIZE=256
CONFIG_SIG_SIGWORK=4
#
@@ -605,7 +616,7 @@ CONFIG_EXAMPLE_NETTEST_CLIENTIP=(10<<24|0<<16|0<<8|1)
# Settings for examples/ostest
#
CONFIG_EXAMPLES_OSTEST_LOOPS=1
-CONFIG_EXAMPLES_OSTEST_STACKSIZE=2048
+CONFIG_EXAMPLES_OSTEST_STACKSIZE=512
CONFIG_EXAMPLES_OSTEST_NBARRIER_THREADS=3
#
@@ -645,7 +656,7 @@ CONFIG_EXAMPLES_OSTEST_NBARRIER_THREADS=3
CONFIG_EXAMPLES_NSH_FILEIOSIZE=512
CONFIG_EXAMPLES_NSH_STRERROR=n
CONFIG_EXAMPLES_NSH_LINELEN=64
-CONFIG_EXAMPLES_NSH_STACKSIZE=2048
+CONFIG_EXAMPLES_NSH_STACKSIZE=512
CONFIG_EXAMPLES_NSH_NESTDEPTH=3
CONFIG_EXAMPLES_NSH_DISABLESCRIPT=n
CONFIG_EXAMPLES_NSH_DISABLEBG=n
@@ -724,9 +735,9 @@ CONFIG_BOOT_RUNFROMFLASH=n
CONFIG_BOOT_COPYTORAM=n
CONFIG_CUSTOM_STACK=n
CONFIG_STACK_POINTER=
-CONFIG_IDLETHREAD_STACKSIZE=1024
-CONFIG_USERMAIN_STACKSIZE=2048
+CONFIG_IDLETHREAD_STACKSIZE=256
+CONFIG_USERMAIN_STACKSIZE=512
CONFIG_PTHREAD_STACK_MIN=256
-CONFIG_PTHREAD_STACK_DEFAULT=2048
+CONFIG_PTHREAD_STACK_DEFAULT=256
CONFIG_HEAP_BASE=
CONFIG_HEAP_SIZE=
diff --git a/nuttx/configs/demo9s12ne64/ostest/ld.script b/nuttx/configs/demo9s12ne64/ostest/ld.script.banked
index caf3ea449..39d063187 100755
--- a/nuttx/configs/demo9s12ne64/ostest/ld.script
+++ b/nuttx/configs/demo9s12ne64/ostest/ld.script.banked
@@ -45,7 +45,7 @@ MEMORY
sram (rwx) : ORIGIN = 0x2000, LENGTH = 8K-256
- /* Two fixed text flash pages (corresponding to page 3e and 3f */
+ /* Two fixed text flash pages (corresponding to page 3e and 3f) */
lowtext(rx) : ORIGIN = 0x4000, LENGTH = 16K /* Page 3e */
hitext (rx) : ORIGIN = 0xc000, LENGTH = 16K-2k /* Page 3f */
diff --git a/nuttx/configs/demo9s12ne64/ostest/ld.script.nonbanked b/nuttx/configs/demo9s12ne64/ostest/ld.script.nonbanked
new file mode 100755
index 000000000..d27ebff97
--- /dev/null
+++ b/nuttx/configs/demo9s12ne64/ostest/ld.script.nonbanked
@@ -0,0 +1,117 @@
+/****************************************************************************
+ * configs/demo9s12ne64/ostest/ld.script
+ *
+ * Copyright (C) 2009 Gregory Nutt. All rights reserved.
+ * Author: Gregory Nutt <spudmonkey@racsa.co.cr>
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ * 3. Neither the name NuttX nor the names of its contributors may be
+ * used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ ****************************************************************************/
+
+/* The DEMO9S12NE64 has 64Kb of FLASH and 8Kb of SRAM that are assumed to be
+ * paged and positioned as below:
+ */
+
+MEMORY
+{
+ /* The 8Kb SRAM is mapped to 0x2000-0x2fff. The top 256 bytes are reserved
+ * for the serial monitor stack space.
+ */
+
+ sram (rwx) : ORIGIN = 0x2000, LENGTH = 8K-256
+
+ /* Three fixed text flash pages (corresponding to page 3e, 3d, and 3f) at
+ * 16Kb each (minus 2Kb at the end of page 3f that is reserved at the top for
+ * the serial boot loader
+ */
+
+ text (rx) : ORIGIN = 0x4000, LENGTH = 48K-2k /* Page 3e, 3d, and 3f */
+
+ /* Vectors. These get relocated to 0xf780-f7ff by the serial loader */
+
+ vectors (rx) : ORIGIN = 0xff80, LENGTH = 256
+}
+
+OUTPUT_ARCH(m68hc12)
+ENTRY(_stext)
+SECTIONS
+{
+ .text : {
+ _stext = ABSOLUTE(.);
+ *(.vectors)
+ *(.text .text.*)
+ *(.fixup)
+ *(.gnu.warning)
+ *(.rodata .rodata.*)
+ *(.gnu.linkonce.t.*)
+ *(.glue_7)
+ *(.glue_7t)
+ *(.got)
+ *(.gcc_except_table)
+ *(.gnu.linkonce.r.*)
+ _etext = ABSOLUTE(.);
+ } > text
+
+ _eronly = ABSOLUTE(.); /* See below */
+
+ .data : {
+ _sdata = ABSOLUTE(.);
+ *(.data .data.*)
+ *(.gnu.linkonce.d.*)
+ CONSTRUCTORS
+ _edata = ABSOLUTE(.);
+ } > sram AT > text
+
+ .bss : { /* BSS */
+ _sbss = ABSOLUTE(.);
+ *(.bss .bss.*)
+ *(.gnu.linkonce.b.*)
+ *(COMMON)
+ _ebss = ABSOLUTE(.);
+ } > sram
+
+ .vectors : {
+ _svectors = ABSOLUTE(.);
+ *(.vectors)
+ _evectors = ABSOLUTE(.);
+ } > vectors
+
+ /* Stabs debugging sections. */
+ .stab 0 : { *(.stab) }
+ .stabstr 0 : { *(.stabstr) }
+ .stab.excl 0 : { *(.stab.excl) }
+ .stab.exclstr 0 : { *(.stab.exclstr) }
+ .stab.index 0 : { *(.stab.index) }
+ .stab.indexstr 0 : { *(.stab.indexstr) }
+ .comment 0 : { *(.comment) }
+ .debug_abbrev 0 : { *(.debug_abbrev) }
+ .debug_info 0 : { *(.debug_info) }
+ .debug_line 0 : { *(.debug_line) }
+ .debug_pubnames 0 : { *(.debug_pubnames) }
+ .debug_aranges 0 : { *(.debug_aranges) }
+}