Merged in alinjerpelea/nuttx (pull request #966)

group boards by architecture

* z80: group boards by architecture

    all boards that share the same architecture are moved to the same arch
    folder following the soc layout

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* z16: group boards by architecture

    all boards that share the same architecture are moved to the same arch
    folder following the soc layout

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* xtensa: group boards by architecture

    all boards that share the same architecture are moved to the same arch
    folder following the soc layout

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* x86: group boards by architecture

    all boards that share the same architecture are moved to the same arch
    folder following the soc layout

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* sim: group boards by architecture

    all boards that share the same architecture are moved to the same arch
    folder following the soc layout

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* risc-v: group boards by architecture

    all boards that share the same architecture are moved to the same arch
    folder following the soc layout

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* renesas: group boards by architecture

    all boards that share the same architecture are moved to the same arch
    folder following the soc layout

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* or1k: group boards by architecture

    all boards that share the same architecture are moved to the same arch
    folder following the soc layout

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* misoc: group boards by architecture

    all boards that share the same architecture are moved to the same arch
    folder following the soc layout

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* mips: group boards by architecture

    all boards that share the same architecture are moved to the same arch
    folder following the soc layout

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* hc: group boards by architecture

    all boards that share the same architecture are moved to the same arch
    folder following the soc layout

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* avr: group boards by architecture

    all boards that share the same architecture are moved to the same arch
    folder following the soc layout

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* arm: group boards by architecture

    all boards that share the same architecture are moved to the same arch
    folder following the soc layout

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* boards: group boards by architecture

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

Approved-by: Gregory Nutt <gnutt@nuttx.org>
This commit is contained in:
Alin Jerpelea
2019-08-06 14:37:27 +00:00
committed by Gregory Nutt
parent c6b5049e3e
commit af28821c77
3863 changed files with 2177 additions and 2160 deletions
+7
View File
@@ -0,0 +1,7 @@
#
# For a description of the syntax of this configuration file,
# see the file kconfig-language.txt in the NuttX tools repository.
#
if ARCH_BOARD_SKP16C26
endif
+112
View File
@@ -0,0 +1,112 @@
boards/skp16c26/README.txt
^^^^^^^^^^^^^^^^^^^^^^^^^^^
1. The buildroot package can be used to build an M16C toolchain. The toolchain
buildroot can be downloaded from buildroot in the NuttX GIT. Insructions
for building the toolchain are provided below.
However, the target cannot be built because the GNU m16c-nuttx-elf-ld link fails with
the following message:
m32c-nuttx-elf-ld: BFD (GNU Binutils) 2.19 assertion fail /home/Owner/projects/nuttx/buildroot/toolchain_build_m32c/binutils-2.19/bfd/elf32-m32c.c:482
Where the reference line is:
/* If the symbol is out of range for a 16-bit address,
we must have allocated a plt entry. */
BFD_ASSERT (*plt_offset != (bfd_vma) -1);
No workaround is known at this time. This is a show stopper for M16C.
2. A supported version of the M16C toolchain is available here:
http://www.kpitgnutools.com/index.php
This download is free but requires registration. Unfortunately, this v0901 of
this toolchain shows the same behavior:
c:\Hew3\Tools\KPIT Cummins\GNUM16CM32C-ELF\v0901\m32c-elf\bin\m32c-elf-ld.exe: BFD (GNU Binutils) 2.19-GNUM16CM32C_v0901 assertion fail /home/kpit/fsfsrc/binutils-2.19/bfd/elf32-m32c.c:482
It is possible that this error messasge my be telling me -- a very roundabout way --
that I have exceeded the FLASH region, but I think that unlikely (it is difficult
to know if the link does not complete gracefully).
BUILDING THE R8C/M16C/M32C GNU TOOLCHAIN USING BUILDROOT
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
NOTE: See the toolchain issues above -- you may not want to waste your time.
1. CD to the correct directory.
Change to the directory just above the NuttX installation. If <nuttx-dir> is
where NuttX is installed, then cd to <nuttx-dir>/..
2. Get and Install the buildroot Module
a. Using a release tarball:
cd <nuttx-dir>/..
Download the appropriate buildroot package.
unpack the buildroot package
rename the directory to buildroot
b. Using GIT
Check out the buildroot module. GIT checkout instructions:
git clone hhttps://patacongo@bitbucket.org/nuttx/buildroot.git buildroot
Make the archive directory:
mkdir archive
The <nuttx-dir>/../buildroot is where the toolchain is built;
The <nuttx-dir>/../archive directory is where toolchain sources will be downloaded.
3. Make sure that NuttX is configured
cd <nuttx-dir>
tools/configure.sh <nuttx-configuration>
4. Configure and Make the buildroot
cd <buildroot-dir>
cp boards/m32c-defconfig-4.2.4 .config
make oldconfig
make
This will download the large source packages for the toolchain and build the toolchain.
The resulting binaries will be under buildroot/build_m32c. There will also be a
large build directory called toolchain_build_m32c; this directory can be removed once
the build completes successfully.
Cygwin GCC BUILD NOTES
^^^^^^^^^^^^^^^^^^^^^^
On Cygwin, the buildroot 'make' command will fail with an error like:
"...
build/genchecksum cc1-dummy > cc1-checksum.c
opening cc1-dummy: No such file or directory
..."
This is caused because on Cygwin, host executables will be generated with the extension .exe
and, apparently, the make variable "exeext" is set incorrectly. A work around after the
above occurs is:
cd toolchain_build_m32c/gcc-4.2.4-initial/gcc # Go to the directory where error occurred
mv cc1-dummy.exe cc1-dummy # Rename the executable without .exe
rm cc1-checksum.c # Get rid of the bad generated file
Then resume the buildroot make:
cd - # Back to the buildroot make directory
make # Restart the build
GCC is built twice. First a initial, "bootstap" GCC is produced in
toolchain_build_m32c/gcc-4.2.4-initial, then the final GCC is produced in
toolchain_build_m32c/gcc-4.2.4-final. The above error will occur twice: Once for
the initial GCC build (see above) and once for the final GCC build. For the final GCC
build, the workaround is the same except that the directory will be
toolchain_build_m32c/gcc-4.2.4-final/gcc.
@@ -0,0 +1,47 @@
#
# This file is autogenerated: PLEASE DO NOT EDIT IT.
#
# You can use "make menuconfig" to make any modifications to the installed .config file.
# You can then do "make savedefconfig" to generate a new defconfig file that includes your
# modifications.
#
# CONFIG_DISABLE_POSIX_TIMERS is not set
CONFIG_ARCH="renesas"
CONFIG_ARCH_BOARD="skp16c26"
CONFIG_ARCH_BOARD_SKP16C26=y
CONFIG_ARCH_CHIP_M30262F8=y
CONFIG_ARCH_INTERRUPTSTACK=128
CONFIG_ARCH_RENESAS=y
CONFIG_ARCH_STACKDUMP=y
CONFIG_BOARD_LOOPSPERMSEC=16945
CONFIG_DEFAULT_SMALL=y
CONFIG_DEV_LOWCONSOLE=y
CONFIG_DISABLE_MOUNTPOINT=y
CONFIG_DISABLE_MQUEUE=y
CONFIG_ENDIAN_BIG=y
CONFIG_IDLETHREAD_STACKSIZE=256
CONFIG_MAX_TASKS=8
CONFIG_MAX_WDOGPARMS=2
CONFIG_MOTOROLA_SREC=y
CONFIG_NFILE_DESCRIPTORS=8
CONFIG_NFILE_STREAMS=8
CONFIG_NPTHREAD_KEYS=0
CONFIG_NUNGET_CHARS=0
CONFIG_PREALLOC_TIMERS=0
CONFIG_PREALLOC_WDOGS=8
CONFIG_PTHREAD_STACK_DEFAULT=256
CONFIG_PTHREAD_STACK_MIN=64
CONFIG_RAM_SIZE=2048
CONFIG_RAM_START=0x00400
CONFIG_RR_INTERVAL=200
CONFIG_SDCLONE_DISABLE=y
CONFIG_SLCD=y
CONFIG_SLCD_CONSOLE=y
CONFIG_START_DAY=20
CONFIG_START_MONTH=2
CONFIG_START_YEAR=2009
CONFIG_TASK_NAME_SIZE=0
CONFIG_TESTING_OSTEST=y
CONFIG_USERMAIN_STACKSIZE=256
CONFIG_USER_ENTRYPOINT="ostest_main"
CONFIG_WDOG_INTRESERVE=1
+134
View File
@@ -0,0 +1,134 @@
/************************************************************************************
* boards/renesas/skp16c26/include/board.h
* arch/board/board.h
*
* Copyright (C) 2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* 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.
*
************************************************************************************/
#ifndef __BOARDS_RENESAS_SKP16C26_INCLUDE_BOARD_H
#define __BOARDS_RENESAS_SKP16C26_INCLUDE_BOARD_H
/************************************************************************************
* Included Files
************************************************************************************/
/************************************************************************************
* Pre-processor Definitions
************************************************************************************/
/* User configuration checks ********************************************************/
/* According to SKP16C26 documention, "SIO/UART1 pins are used for communication
* between the SKP16C26 board kernel and KD30 Debugger through the ICD. Do not
* connect these pins to any other circuit, as UART1 cannot be used in the user
* program. For details, please see ICD (RTA-FoUSB-MON) User Manual on Target M16C
* ROM Monitor Resources or related ICD application notes."
*
* However, the schematic appears to show that SIO/UART2 is actual connection.
* To be safe, we will error out on either selection:
*/
#if defined(CONFIG_M16C_UART1) || defined(CONFIG_M16C_UART2)
# error "UART1/2 should not be used on SKP16C26"
#endif
/* Hardware defintitions ************************************************************/
/* Xin Freq */
#define M16C_XIN_FREQ 20000000 /* 20MHz */
/* Interrupt Priority Levels ********************************************************/
/* IPL settings */
#define M16C_DEFAULT_IPL 0 /* Default M16C Interrupt priority level */
#undef M16C_INTERRUPT_IPL /* Default interrupt IPL to enabled nested interrupts */
/* Define any of the following to specify interrupt priorities. A default
* value of 5 will be used for any unspecified values
*/
#undef M16C_INT3_PRIO /* INT3 interrupt priority */
#undef M16C_INT5_PRIO /* INT5 interrupt priority */
#undef M16C_INT4_PRIO /* INT4 interrupt priority */
#undef M16C_BCN_PRIO /* Bus collision detection interrupt priority */
#undef M16C_DM0_PRIO /* DMA0 interrupt priority */
#undef M16C_DM1_PRIO /* DMA1 interrupt priority */
#undef M16C_KUP_PRIO /* Key input interrupt priority */
#undef M16C_AD_PRIO /* A-D conversion interrupt priority */
#undef M16C_S2T_PRIO /* UART2 transmit interrupt priority */
#undef M16C_S2R_PRIO /* UART2 receive interrupt priority */
#undef M16C_S0T_PRIO /* UART0 transmit interrupt priority */
#undef M16C_S0R_PRIO /* UART0 receive interrupt priority */
#undef M16C_S1T_PRIO /* UART1 transmit interrupt priority */
#undef M16C_S1R_PRIO /* UART1 receive interrupt priority */
#define M16C_TA0_PRIO 5 /* Timer A0 interrupt priority */
#undef M16C_TA1_PRIO /* Timer A1 interrupt priority */
#undef M16C_TA2_PRIO /* Timer A2 interrupt priority */
#undef M16C_TA3_PRIO /* Timer A3 interrupt priority */
#undef M16C_TA4_PRIO /* Timer A4 interrupt priority */
#undef M16C_TB0_PRIO /* Timer B0 interrupt priority */
#undef M16C_TB1_PRIO /* Timer B1 interrupt priority */
#undef M16C_TB2_PRIO /* Timer B2 interrupt priority */
#undef M16C_INT0_PRIO /* INT0 interrupt priority */
#undef M16C_INT1_PRIO /* INT1 interrupt priority */
/* LED definitions **********************************************************/
/* GREEN YELLOW RED */
#define LED_STARTED 0 /* OFF OFF OFF */
#define LED_HEAPALLOCATE 1 /* ON OFF OFF */
#define LED_IRQSENABLED 2 /* OFF ON OFF */
#define LED_STACKCREATED 3 /* ON ON OFF */
#define LED_INIRQ 4 /* ON OFF ON */
#define LED_SIGNAL 5 /* OFF ON ON */
#define LED_ASSERTION 6 /* ON ON ON */
#define LED_PANIC 7 /* NC** NC** ON* */
/* *=FLASHING **=if INIRQ, SIGNAL, or ASSERTION will be flashing */
/* BUTTON definitions **************************************************************/
#define SW1_PRESSED 0x01 /* Bit 0: 1=SW1 pressed */
#define SW2_PRESSED 0x02 /* Bit 1: 1=SW2 pressed */
#define SW3_PRESSED 0x04 /* Bit 2: 1=SW3 pressed */
/************************************************************************************
* Inline Functions
************************************************************************************/
#ifndef __ASSEMBLY__
#endif
#endif /* __BOARDS_RENESAS_SKP16C26_INCLUDE_BOARD_H */
+86
View File
@@ -0,0 +1,86 @@
############################################################################
# boards/renesas/skp16c26/scripts/Make.defs
#
# Copyright (C) 2009, 2017 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <gnutt@nuttx.org>
#
# 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.
#
############################################################################
include ${TOPDIR}/.config
include ${TOPDIR}/tools/Config.mk
CROSSDEV = m32c-nuttx-elf-
CC = $(CROSSDEV)gcc
CPP = $(CROSSDEV)gcc -E
LD = $(CROSSDEV)ld
AR = $(CROSSDEV)ar rcs
NM = $(CROSSDEV)nm
OBJCOPY = $(CROSSDEV)objcopy
OBJDUMP = $(CROSSDEV)objdump
ARCHCCVERSION = ${shell $(CC) -v 2>&1 | sed -n '/^gcc version/p' | sed -e 's/^gcc version \([0-9\.]\)/\1/g' -e 's/[-\ ].*//g' -e '1q'}
ARCHCCMAJOR = ${shell echo $(ARCHCCVERSION) | cut -d'.' -f1}
ifeq ($(CONFIG_DEBUG_SYMBOLS),y)
ARCHOPTIMIZATION = -g
endif
ifneq ($(CONFIG_DEBUG_NOOPT),y)
ARCHOPTIMIZATION += -Os -fno-strict-aliasing -fno-strength-reduce -fomit-frame-pointer
endif
ARCHCPUFLAGS = -mcpu=m16c -fno-builtin
ARCHPICFLAGS = -fpic
ARCHWARNINGS = -Wall -Wstrict-prototypes -Wshadow -Wundef
ARCHDEFINES =
ARCHINCLUDES = -I. -isystem $(TOPDIR)/include
ARCHSCRIPT = -T$(TOPDIR)/boards/$(CONFIG_ARCH)/$(CONFIG_ARCH_BOARD)/scripts/skp16c26.ld
CFLAGS = $(ARCHWARNINGS) $(ARCHOPTIMIZATION) \
$(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) -pipe
CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES)
AFLAGS = $(CFLAGS) -D__ASSEMBLY__
ASMEXT = .S
OBJEXT = .o
LIBEXT = .a
EXEEXT =
ifeq ($(CONFIG_DEBUG_SYMBOLS),y)
LDFLAGS += -g
endif
MKDEP = $(TOPDIR)/tools/mkdeps$(HOSTEXEEXT)
HOSTCC = gcc
HOSTINCLUDES = -I.
HOSTCFLAGS = -Wall -Wstrict-prototypes -Wshadow -Wundef -g -pipe
HOSTLDFLAGS =
+139
View File
@@ -0,0 +1,139 @@
/****************************************************************************
* boards/renesas/skp16c26/scripts/skp16c26.ld
*
* Copyright (C) 2009, 2017 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* 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.
*
****************************************************************************/
OUTPUT_ARCH(m32c)
ENTRY(_stext)
SECTIONS
{
/* "Far" flash memory begins at address 0xf0000 for the M20262F8 part and
* ends at address 0xfffff (all parts). The program entry point is
* the first address in flash
*/
. = 0xf0000;
.text : {
_stext = ABSOLUTE(.);
*(.text)
*(.fixup)
*(.gnu.warning)
*(.rodata)
*(.glue_7)
*(.glue_7t)
*(.got) /* Global offset table */
_etext = ABSOLUTE(.);
}
_enronly = ABSOLUTE(.); /* End of read-only values */
/* .ndata will be relocated */
/* from this address */
/* The "variable" vector table will be fixed at the following address */
. = 0xffd00;
.varvect : {
_svarvect = ABSOLUTE(.);
*(.varvect)
_evarvect = ABSOLUTE(.);
}
/* Followed by the special page/fixed vector table. */
. = 0xffe00;
.specpg : {
_sspecpg = ABSOLUTE(.);
*(.specpg)
_especpg = ABSOLUTE(.);
}
. = 0xfffdc;
.fixvect : {
_sfixvect = ABSOLUTE(.);
*(.fixvect)
_efixvect = ABSOLUTE(.);
}
/* Internal "near" RAM begins at address 0x00400 (all parts) and ends at
* address 0x00bff (M20262F6 and M20262F8 parts). With the RAM
* region, used is .data followed by .bss. The remainder of RAM
* carved up by the start-up code into stacks and heaps.
*/
. = 0x00400;
.ndata : {
_sndata = ABSOLUTE(.);
*(.data)
CONSTRUCTORS
_endata = ABSOLUTE(.);
}
.nbss : { /* BSS */
_snbss = ABSOLUTE(.);
*(.bss)
*(COMMON)
_enbss = ABSOLUTE(.);
}
/* "Far" RAM begins at 0x10000. The SKP16C26 has no far RAM */
. = 0x10000;
.fdata : {
_sfdata = ABSOLUTE(.);
*(.fdata)
CONSTRUCTORS
_efdata = ABSOLUTE(.);
}
.fbss : { /* BSS */
_sfbss = ABSOLUTE(.);
*(.fbss)
*(COMMON)
_efbss = ABSOLUTE(.);
}
/* 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) }
}
+2
View File
@@ -0,0 +1,2 @@
/.depend
/Make.dep
+78
View File
@@ -0,0 +1,78 @@
############################################################################
# boards/renesas/skp16c26/src/Makefile
#
# Copyright (C) 2009, 2012 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <gnutt@nuttx.org>
#
# 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.
#
############################################################################
-include $(TOPDIR)/Make.defs
CFLAGS += -I$(TOPDIR)/sched
ASRCS =
AOBJS = $(ASRCS:.S=$(OBJEXT))
CSRCS = m16c_leds.c m16c_buttons.c m16c_lcd.c m16c_lcdconsole.c
COBJS = $(CSRCS:.c=$(OBJEXT))
SRCS = $(ASRCS) $(CSRCS)
OBJS = $(AOBJS) $(COBJS)
ARCH_SRCDIR = $(TOPDIR)/arch/$(CONFIG_ARCH)/src
CFLAGS += -I$(ARCH_SRCDIR)/chip -I$(ARCH_SRCDIR)/common
all: libboard$(LIBEXT)
$(AOBJS): %$(OBJEXT): %.S
$(call ASSEMBLE, $<, $@)
$(COBJS) $(LINKOBJS): %$(OBJEXT): %.c
$(call COMPILE, $<, $@)
libboard$(LIBEXT): $(OBJS)
$(call ARCHIVE, $@, $(OBJS))
.depend: Makefile $(SRCS)
$(Q) $(MKDEP) $(CC) -- $(CFLAGS) -- $(SRCS) >Make.dep
$(Q) touch $@
depend: .depend
context:
clean:
$(call DELFILE, libboard$(LIBEXT))
$(call CLEAN)
distclean: clean
$(call DELFILE, Make.dep)
$(call DELFILE, .depend)
-include Make.dep
+114
View File
@@ -0,0 +1,114 @@
/****************************************************************************
* boards/renesas/skp16c26/src/m16c_buttons.c
*
* Copyright (C) 2009, 2015 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* 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.
*
****************************************************************************/
/****************************************************************************
* Included Files
****************************************************************************/
#include <nuttx/config.h>
#include <stdint.h>
#include <nuttx/board.h>
#include "chip.h"
#include "up_arch.h"
#include "up_internal.h"
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
/* The SKP62C26 has 3 buttons control by bits 1, 2, and 3 in port 8. */
#define SW1_BIT (1 << 3) /* Bit 3, port 8 */
#define SW2_BIT (1 << 2) /* Bit 2, port 8 */
#define SW3_BIT (1 << 1) /* Bit 1, port 8 */
#define SW_PRESSED(p,b) (((p) & (b)) == 0)
/****************************************************************************
* Private Data
****************************************************************************/
/****************************************************************************
* Private Functions
****************************************************************************/
/****************************************************************************
* Public Functions
****************************************************************************/
/****************************************************************************
* Name: board_button_initialize
****************************************************************************/
#ifdef CONFIG_ARCH_BUTTONS
void board_button_initialize(void)
{
uint8_t regval;
regval = getreg8(M16C_PD8);
regval |= (SW1_BIT | SW2_BIT | SW3_BIT);
putreg8(regval, M16C_PD8);
}
/****************************************************************************
* Name: board_buttons
****************************************************************************/
uint32_t board_buttons(void)
{
uint32_t swset = 0;
uint8_t regval = getreg8(M16C_P8);
if (SW_PRESSED(regval, SW1_BIT))
{
swset |= SW1_PRESSED;
}
if (SW_PRESSED(regval, SW2_BIT))
{
swset |= SW2_PRESSED;
}
if (SW_PRESSED(regval, SW3_BIT))
{
swset |= SW3_PRESSED;
}
return swset;
}
#endif /* CONFIG_ARCH_BUTTONS */
+283
View File
@@ -0,0 +1,283 @@
/************************************************************************************
* boards/renesas/scp16c26/src/m16c_lcd.c
*
* Copyright (C) 2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* 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 Gregory Nutt 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.
*
************************************************************************************/
/************************************************************************************
* Included Files
************************************************************************************/
#include <nuttx/config.h>
#include <stdint.h>
#include <stdbool.h>
#include <ctype.h>
#include "up_arch.h"
#include "up_internal.h"
#include "chip.h"
#ifdef CONFIG_SLCD
/************************************************************************************
* Pre-processor Definitions
************************************************************************************/
/* LCD dimensions *******************************************************************/
#define LCD_NLINES 2 /* Two lines */
#define LCD_NCHARS 8 /* Eight characters per line */
/* LCD commands *********************************************************************/
#define LCD_CLEAR 0x01 /* Clear LCD display and home cursor */
#define CURSOR_MODE_DEC 0x04 /* Cursor auto decrement after R/W */
#define CURSOR_MODE_INC 0x06 /* Cursor auto increment after R/W */
#define LCD_CURSOR_ON 0x0e /* Display ON with Cursor */
#define LCD_CURSOR_OFF 0x0c /* Display ON with Cursor off */
#define LCD_CURSOR_BLINK 0x0d /* Display on with blinking cursor */
#define LCD_CURSOR_LEFT 0x10 /* Move Cursor Left One Position */
#define LCD_CURSOR_RIGHT 0x14 /* Move Cursor Right One Position */
#define FUNCTION_SET 0x28 /* Setup, 4 bits,2 lines, 5X7 */
#define LCD_CGRAM 0x40 /* Map characters to CG RAM */
#define LCD_POS_L1(p) (0x80 | p) /* Move cursor to line 1, character p+1 */
#define LCD_POS_L2(p) (0xc0 | p) /* Move cursor to line 2, character p+1 */
#define LCD_HOME_L1 0x80 /* Move cursor to line 1 */
#define LCD_HOME_L2 0xc0 /* Move cursor to line 2 */
/************************************************************************************
* Private Data
************************************************************************************/
static uint8_t g_nchars; /* Number of characters in lines 2 */
static uint8_t g_line[LCD_NCHARS]; /* The content of lines 2 */
/************************************************************************************
* Private Functions
************************************************************************************/
/************************************************************************************
* Name: up_lcddelay
************************************************************************************/
static void up_lcddelay(uint16_t count)
{
uint32_t counter = (uint16_t)count << 8;
while (counter--)
{
asm("\tnop\n\tnop\n\tnop\n" : :); /* 3 NOPs */
}
}
/************************************************************************************
* Name: up_setrs
************************************************************************************/
static inline void up_setrs(bool data)
{
/* Set/clear bit 1 of port 6 */
register uint8_t regval = getreg8(M16C_P6);
if (data)
{
regval |= (1 << 0); /* High = data */
}
else
{
regval &= ~(1 << 0); /* Low = control */
}
putreg8(regval, M16C_P6);
}
/************************************************************************************
* Name: up_seten
************************************************************************************/
static inline void up_seten(void)
{
/* Set bit 1 of port 6 */
register uint8_t regval = getreg8(M16C_P6);
regval |= (1 << 1);
putreg8(regval, M16C_P6);
}
/************************************************************************************
* Name: up_clren
************************************************************************************/
static inline void up_clren(void)
{
/* Clear bit 1 of port 6 */
register uint8_t regval = getreg8(M16C_P6);
regval &= ~(1 << 1);
putreg8(regval, M16C_P6);
}
/************************************************************************************
* Name: up_enpluse
************************************************************************************/
static inline void up_enpulse(bool data)
{
up_seten(); /* EN enable chip (HIGH) */
up_lcddelay(0); /* Short delay */
up_clren(); /* Latch data by setting EN low */
up_lcddelay(0); /* Short delay for data writes */
if (!data) up_lcddelay(0); /* Longer delay for control writes */
}
/************************************************************************************
* Name: up_lcdwrite
************************************************************************************/
void up_lcdwrite(bool data, uint8_t ch)
{
up_setrs(data); /* Set RS appropriately */
/* Write upper nibble first. Only the lower 4 bits of P9 are valid. The upper four
* bits are reserved and must be zero.
*/
putreg8(ch >> 4, M16C_P9);
up_enpulse(data);
/* Write lower nibble second */
putreg8(ch & 0x0f, M16C_P9);
up_enpulse(data);
}
/************************************************************************************
* Name: up_scroll
************************************************************************************/
static void up_scroll(void)
{
int i;
/* Clear the display and position the cursor at the beginning of line 1 */
up_lcdwrite(false, LCD_CLEAR);
up_lcdwrite(false, LCD_HOME_L1);
/* Copy line 2 to line 1 */
for (i = 0; i < g_nchars; i++)
{
up_lcdwrite(true, g_line[i]);
}
/* Position the cursor at the beginning of line 2 */
up_lcdwrite(false, LCD_HOME_L2);
g_nchars = 0;
}
/************************************************************************************
* Public Functions
************************************************************************************/
/************************************************************************************
* Name: up_lcdinit
************************************************************************************/
void up_lcdinit(void)
{
uint8_t regval;
/* Enable writing to PD9 by selecting bit 2 in the protection register */
regval = getreg8(M16C_PRCR);
regval |= (1 << 2);
putreg8(regval, M16C_PRCR);
/* We can't read PD9, so we can't OR the values in */
putreg8(0x0f, M16C_PD9);
/* Set EN (port 6 bit 1) and Set RS (port 6 bit 0) as outputs */
regval = getreg8(M16C_P6);
regval |= (1 << 1) | (1 << 0);
putreg8(regval, M16C_P6);
regval = getreg8(M16C_PD6);
regval |= (1 << 1) | (1 << 0);
putreg8(regval, M16C_PD6);
/* Set EN low */
up_clren();
/* Write the reset sequence */
up_lcdwrite(false, 0x33);
up_lcddelay(20);
up_lcdwrite(false, 0x32);
up_lcddelay(20);
up_lcdwrite(false, FUNCTION_SET); /* reset sequence */
up_lcdwrite(false, FUNCTION_SET);
up_lcdwrite(false, LCD_CURSOR_OFF);
up_lcdwrite(false, LCD_CLEAR);
up_lcdwrite(false, LCD_HOME_L1);
}
/************************************************************************************
* Name: up_lcdputc
************************************************************************************/
void up_lcdputc(char ch)
{
/* Check for new line */
if (ch == '\n')
{
up_scroll();
}
/* Should we wrap to truncate at the end of line??? Let's truncate. In either
* case, let's ignore all other non-printable characters.
*/
else if (g_nchars < LCD_NCHARS && isprint(ch))
{
up_lcdwrite(true, ch);
g_line[g_nchars] = ch;
g_nchars++;
}
}
#endif /* CONFIG_SLCD */
@@ -0,0 +1,142 @@
/************************************************************************************
* boards/renesas/scp16c26/src/m16c_lcdconsole.c
*
* Copyright (C) 2009, 2012 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* 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 Gregory Nutt 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.
*
************************************************************************************/
/************************************************************************************
* Included Files
************************************************************************************/
#include <nuttx/config.h>
#include <nuttx/arch.h>
#include "up_internal.h"
#include "skp16c26.h"
/* Only use the LCD as a console if there are is no serial console */
#if defined(CONFIG_UART0_SERIAL_CONSOLE) && defined(CONFIG_M16C_UART0)
# define HAVE_SERIALCONSOLE 1
#elif defined(CONFIG_UART1_SERIAL_CONSOLE) && defined(CONFIG_M16C_UART1)
# define HAVE_SERIALCONSOLE 1
#elif defined(CONFIG_UART2_SERIAL_CONSOLE) && defined(CONFIG_M16C_UART2)
# define HAVE_SERIALCONSOLE 1
#else
# undef HAVE_SERIALCONSOLE
#endif
#if !defined(HAVE_SERIALCONSOLE) && defined(CONFIG_SLCD) && \
defined(CONFIG_SLCD_CONSOLE)
/************************************************************************************
* Pre-processor Definitions
************************************************************************************/
/************************************************************************************
* Private Data
************************************************************************************/
/************************************************************************************
* Private Functions
************************************************************************************/
/************************************************************************************
* Public Functions
************************************************************************************/
/************************************************************************************
* Name: up_earlyconsoleinit
*
* Description:
* Performs the low level UART initialization early in debug so that the serial
* console will be available during bootup. This must be called before
* up_consoleinit.
*
************************************************************************************/
#ifdef USE_EARLYSERIALINIT
# warning "You probably need to define CONFIG_ARCH_LOWCONSOLE"
void up_earlyconsoleinit(void)
{
/* There is probably a problem if we are here */
}
#endif
/************************************************************************************
* Name: up_consoleinit
*
* Description:
* Register serial console and serial ports. This assumes that
* up_earlyconsoleinit was called previously.
*
************************************************************************************/
#if USE_SERIALDRIVER
# warning "You probably need to define CONFIG_ARCH_LOWCONSOLE"
void up_consoleinit(void)
{
/* There is probably a problem if we are here */
lowconsole_init();
}
#endif
/************************************************************************************
* Name: up_lowputc
*
* Description:
* Output one character on the console
*
************************************************************************************/
void up_lowputc(char ch)
{
up_lcdputc(ch);
}
/************************************************************************************
* Name: up_putc
*
* Description:
* Output one character on the console
*
************************************************************************************/
int up_putc(int ch)
{
up_lcdputc(ch);
return ch;
}
#endif /* !HAVE_SERIALCONSOLE && CONFIG_SLCD && CONFIG_SLCD_CONSOLE */
+250
View File
@@ -0,0 +1,250 @@
/************************************************************************************
* boards/renesas/scp16c26/src/m16c_leds.c
*
* Copyright (C) 2009, 2015 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* 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 Gregory Nutt 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.
*
************************************************************************************/
/************************************************************************************
* Included Files
************************************************************************************/
#include <nuttx/config.h>
#include <stdint.h>
#include <nuttx/board.h>
#include <arch/board/board.h>
#include "up_arch.h"
#include "up_internal.h"
#include "chip.h"
#ifdef CONFIG_ARCH_LEDS
/************************************************************************************
* Pre-processor Definitions
************************************************************************************/
/* The SKP62C26 has 3 LEDs control by bits 0 and 2 in port 7 and bit 0 in port 8. */
#define GREEN_LED (1 << 2) /* Bit 2, port 7 */
#define YELLOW_LED (1 << 4) /* Bit 4, port 7 */
#define RED_LED (1 << 0) /* Bit 0, port 8 */
#define GREEN_LED_ON 0
#define GREEN_LED_OFF GREEN_LED
#define GREEN_LED_MASK GREEN_LED
#define GREEN_LED_PORT M16C_P7
#define YELLOW_LED_ON 0
#define YELLOW_LED_OFF YELLOW_LED
#define YELLOW_LED_MASK YELLOW_LED
#define YELLOW_LED_PORT M16C_P7
#define GREENYELLOW_LED_MASK (GREEN_LED_MASK|YELLOW_LED_MASK)
#define GREENYELLOW_LED_PORT M16C_P7
#define GREENYELLOW_DIR_PORT M16C_PD7
#define RED_LED_ON 0
#define RED_LED_OFF RED_LED
#define RED_LED_MASK RED_LED
#define RED_LED_PORT M16C_P8
#define RED_DIR_PORT M16C_PD8
/************************************************************************************
* Private Types
************************************************************************************/
/************************************************************************************
* Private Data
************************************************************************************/
static const uint8_t g_ledstate[7] =
{
(GREEN_LED_OFF | YELLOW_LED_OFF | RED_LED_OFF), /* LED_STARTED */
(GREEN_LED_ON | YELLOW_LED_OFF | RED_LED_OFF), /* LED_HEAPALLOCATE */
(GREEN_LED_OFF | YELLOW_LED_ON | RED_LED_OFF), /* LED_IRQSENABLED */
(GREEN_LED_ON | YELLOW_LED_ON | RED_LED_OFF), /* LED_STACKCREATED */
(GREEN_LED_ON | YELLOW_LED_OFF | RED_LED_ON ), /* LED_INIRQ */
(GREEN_LED_OFF | YELLOW_LED_ON | RED_LED_ON ), /* LED_SIGNAL */
(GREEN_LED_ON | YELLOW_LED_ON | RED_LED_ON ) /* LED_ASSERTION */
};
static uint8_t g_prevled[3];
static uint8_t g_nestlevel;
/************************************************************************************
* Private Functions
************************************************************************************/
/************************************************************************************
* Name: m16c_setleds
************************************************************************************/
static void m16c_setleds(uint8_t gybits, uint8_t rbit)
{
uint8_t regval;
regval = getreg8(GREENYELLOW_LED_PORT);
regval &= ~GREENYELLOW_LED_MASK;
regval |= gybits;
putreg8(regval, GREENYELLOW_LED_PORT);
regval = getreg8(RED_LED_PORT);
regval &= ~RED_LED_MASK;
regval |= rbit;
putreg8(regval, RED_LED_PORT);
}
/************************************************************************************
* Public Functions
************************************************************************************/
/************************************************************************************
* Name: board_autoled_initialize
************************************************************************************/
void board_autoled_initialize(void)
{
register uint8_t regval;
/* Make sure that the LEDs are in the OFF state */
regval = getreg8(GREENYELLOW_LED_PORT);
regval |= (GREEN_LED_OFF |YELLOW_LED_OFF);
putreg8(regval, GREENYELLOW_LED_PORT);
regval = getreg8(RED_LED_PORT);
regval |= RED_LED_OFF;
putreg8(regval, RED_LED_PORT);
/* Set the direction to output */
regval = getreg8(GREENYELLOW_DIR_PORT);
regval |= (GREEN_LED |YELLOW_LED);
putreg8(regval, GREENYELLOW_DIR_PORT);
regval = getreg8(RED_DIR_PORT);
regval |= RED_LED;
putreg8(regval, RED_DIR_PORT);
}
/************************************************************************************
* Name: board_autoled_on
************************************************************************************/
void board_autoled_on(int led)
{
uint8_t ledset;
/* If this is the ASSERTION led, preserve the Y&G bits from the last setting and
* set the RED LED on.
*/
if (led == LED_ASSERTION)
{
ledset = g_ledstate[g_prevled[g_nestlevel]];
m16c_setleds(ledset & GREENYELLOW_LED_MASK, RED_LED_ON);
}
else if (led < LED_ASSERTION)
{
/* Otherwise, just show the LEDs corresponding to this state */
ledset = g_ledstate[led];
m16c_setleds(ledset & GREENYELLOW_LED_MASK, ledset & RED_LED_MASK);
/* If this was a nested states (INIRQ, SIGNAL, or ASSERTION) then
* stack up the previous value.
*/
if (led > LED_STACKCREATED)
{
g_nestlevel++;
}
g_prevled[g_nestlevel] = led;
}
}
/************************************************************************************
* Name: board_autoled_off
************************************************************************************/
void board_autoled_off(int led)
{
uint8_t ledset;
/* If this is the ASSERTION led then what we do depends on the previous state */
if (led == LED_ASSERTION)
{
/* If the previous state was one of the nested states (INIRQ, SIGNAL, or ASSERTION),
* then turn the green and yellow LEDs all off. That way we can distinguish
* that case from the simple cases.
*/
if (g_nestlevel > 0)
{
ledset = 0;
}
else
{
ledset = g_ledstate[g_prevled[0]];
}
m16c_setleds(ledset & GREENYELLOW_LED_MASK, RED_LED_OFF);
}
else if (led > 0 && led < LED_ASSERTION)
{
/* If this was one of the nested states, then we want to back to the LED setting
* before entering that nested statel.
*/
if (g_nestlevel > 0)
{
g_nestlevel--;
led = g_prevled[g_nestlevel];
}
else if (led > LED_STACKCREATED)
{
/* This shouldn't happen */
led--;
}
ledset = g_ledstate[led];
m16c_setleds(ledset & GREENYELLOW_LED_MASK, ledset & RED_LED_MASK);
g_prevled[g_nestlevel]= led;
}
}
#endif /* CONFIG_ARCH_LEDS */
+63
View File
@@ -0,0 +1,63 @@
/************************************************************************************
* boards/renesas/skp16c26/src/scp16c26.h
*
* Copyright (C) 2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* 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.
*
************************************************************************************/
#ifndef __BOARDS_RENESAS_SKP16C26_SRC_SKP16C26_H
#define __BOARDS_RENESAS_SKP16C26_SRC_SKP16C26_H
/************************************************************************************
* Included Files
************************************************************************************/
/************************************************************************************
* Pre-processor Definitions
************************************************************************************/
/************************************************************************************
* Inline Functions
************************************************************************************/
#ifndef __ASSEMBLY__
#endif
/************************************************************************************
* Public Function Prototypes
************************************************************************************/
#ifndef __ASSEMBLY__
#endif
#endif /* __BOARDS_RENESAS_SKP16C26_SRC_SKP16C26_H */
+7
View File
@@ -0,0 +1,7 @@
#
# For a description of the syntax of this configuration file,
# see the file kconfig-language.txt in the NuttX tools repository.
#
if ARCH_BOARD_TWR_K60N512
endif
+151
View File
@@ -0,0 +1,151 @@
Status
^^^^^^
*** UNSTABLE ***
The port is basically complete and many examples run correctly. However, there
are remaining instabilities that make the port un-usable. The nature of these
is not understood; the behavior is that certain SH-1 instructions stop working
as advertised. This could be a silicon problem, some pipeline issue that is not
handled properly by the gcc 3.4.5 toolchain (which has very limited SH-1 support
to begin with), or perhaps with the CMON debugger. At any rate, I have exhausted
all of the energy that I am willing to put into this cool old processor for the
time being.
Toolchain
^^^^^^^^^
A GNU GCC-based toolchain is assumed. The PATH environment variable should
be modified to point to the correct path to the SH toolchain (if
different from the default).
If you have no SH toolchain, one can be downloaded from the NuttX
Bitbucket download site (https://bitbucket.org/nuttx/buildroot/downloads/).
1. You must have already configured Nuttx in <some-dir>nuttx.
tools/configure.sh us7032evb1:<sub-dir>
2. Download the latest buildroot package into <some-dir>
3. unpack
4. cd <some-dir>/buildroot
5. cp boards/sh-defconfig .config
6. make oldconfig
7. make
8. Make sure that the PATH variable includes the path to the newly built
binaries.
shterm
^^^^^^
The USB7032EVB1 supports CMON in PROM. CMON requires special
serial interactions in order to upload and download program files.
Therefore, a standard terminal emulation program (such as minicom)
cannot be used.
The shterm subdirectory contains a small terminal emulation
program that supports these special interactions for file transfers.
Configurations
^^^^^^^^^^^^^^
Common Configuration Notes
--------------------------
1. Each SH-1 configuration is maintained in a sub-directory and
can be selected as follow:
tools/configure.sh us7032evb1:<subdir>
Where <subdir> is one of the configuration sub-directories described in
the following paragraph.
2. These configurations use the mconf-based configuration tool. To
change a configurations using that tool, you should:
a. Build and install the kconfig-mconf tool. See nuttx/README.txt
see additional README.txt files in the NuttX tools repository.
b. Execute 'make menuconfig' in nuttx/ in order to start the
reconfiguration process.
3. By default, all configurations assume that you are building under
Linux (should work under Windows with Cygwin as well). This is
is easily reconfigured:
CONFIG_HOST_LINUX=y
Configuration Sub-Directories
-----------------------------
ostest
This configuration directory, performs a simple OS test using
examples/ostest.
nsh
Configures the NuttShell (nsh) located at examples/nsh. The
Configuration enables only the serial NSH interfaces.
NOTE: At present, the NSH example does not run. See the "Status"
discussion above for a full explanation.
Configuration Options
^^^^^^^^^^^^^^^^^^^^^
In additional to the common configuration options listed in the
file boards/README.txt, there are other configuration options
specific to the SH-1
Architecture selection
CONFIG_ARCH - identifies the arch subdirectory and, hence, the
processor architecture. This should be renesas (for arch/renesas)
CONFIG_ARCH_CHIP - Identifies the arch/*/chip subdirectory.
This should be sh1 (for arch/renesas/src/sh1 and arch/renesas/include/sh1)
CONFIG_ARCH_SH1 and CONFIG_ARCH_CHIP_SH7032 - for use in C code. These
identify the particular chip or SoC that the architecture is
implemented in.
CONFIG_ARCH_BOARD - identifies the boards/ subdirectory and, hence,
the board that supports the particular chip or SoC. This
should be us7032evb1 for (boards/us7032evb1).
CONFIG_ARCH_BOARD_US7032EVB1 - for use in C code
CONFIG_ENDIAN_BIG - the SH-1 usually runs big-endian
CONFIG_ARCH_NOINTC - define if the architecture does not
support an interrupt controller or otherwise cannot support
APIs like up_enable_irq() and up_disable_irq(). Should be
defined.
CONFIG_BOARD_LOOPSPERMSEC - for delay loops
CONFIG_ARCH_LEDS - Use LEDs to show state. Unique to SH1_LCEVB1
CONFIG_RAM_SIZE - Describes the internal DRAM.
CONFIG_RAM_START - The start address of internal DRAM
CONFIG_ARCH_INTERRUPTSTACK - This architecture supports an interrupt
stack. If defined, this symbol is the size of the interrupt
stack in bytes. If not defined, the user task stacks will be
used during interrupt handling.
CONFIG_ARCH_STACKDUMP - Do stack dumps after assertions
CONFIG_SH1_DMAC0, CONFIG_SH1_DMAC1, CONFIG_SH1_DMAC2, CONFIG_SH1_DMAC3,
CONFIG_SH1_ITU1, CONFIG_SH1_ITU2, CONFIG_SH1_ITU3, CONFIG_SH1_ITU4,
CONFIG_SH1_SCI0, CONFIG_SH1_SCI1, CONFIG_SH1_PCU, CONFIG_SH1_AD,
CONFIG_SH1_WDT, CONFIG_SH1_CMI - Each unused chip block should b
disabled to save space
SH1 specific device driver settings
CONFIG_SCIn_SERIAL_CONSOLE - selects the SCIn for the
console and ttys0 (default is the UART0).
CONFIG_SCIn_RXBUFSIZE - Characters are buffered as received.
This specific the size of the receive buffer
CONFIG_SCIn_TXBUFSIZE - Characters are buffered before
being sent. This specific the size of the transmit buffer
CONFIG_SCIn_BAUD - The configure BAUD of the UART. Must be
CONFIG_SCIn_BITS - The number of bits. Must be either 7 or 8.
CONFIG_SCIn_PARTIY - 0=no parity, 1=odd parity, 2=even parity, 3=mark 1, 4=space 0
CONFIG_SCIn_2STOP - Two stop bits
+2
View File
@@ -0,0 +1,2 @@
shterm
@@ -0,0 +1,50 @@
#
# This file is autogenerated: PLEASE DO NOT EDIT IT.
#
# You can use "make menuconfig" to make any modifications to the installed .config file.
# You can then do "make savedefconfig" to generate a new defconfig file that includes your
# modifications.
#
# CONFIG_NSH_DISABLE_IFCONFIG is not set
# CONFIG_NSH_DISABLE_PS is not set
CONFIG_ARCH_BOARD_US7032EVB1=y
CONFIG_ARCH_BOARD="us7032evb1"
CONFIG_ARCH_BUTTONS=y
CONFIG_ARCH_CHIP_SH7032=y
CONFIG_ARCH_RENESAS=y
CONFIG_ARCH_STACKDUMP=y
CONFIG_ARCH="renesas"
CONFIG_BOARD_LOOPSPERMSEC=572
CONFIG_DISABLE_MOUNTPOINT=y
CONFIG_DISABLE_MQUEUE=y
CONFIG_DISABLE_POSIX_TIMERS=y
CONFIG_DISABLE_PTHREAD=y
CONFIG_ENDIAN_BIG=y
CONFIG_SYSTEM_NSH=y
CONFIG_MAX_TASKS=8
CONFIG_MAX_WDOGPARMS=2
CONFIG_MOTOROLA_SREC=y
CONFIG_NFILE_DESCRIPTORS=8
CONFIG_NFILE_STREAMS=8
CONFIG_NSH_FILEIOSIZE=512
CONFIG_NSH_LINELEN=64
CONFIG_NSH_READLINE=y
CONFIG_NUNGET_CHARS=0
CONFIG_PREALLOC_TIMERS=0
CONFIG_PREALLOC_WDOGS=4
CONFIG_PTHREAD_STACK_DEFAULT=1024
CONFIG_RAM_SIZE=57344
CONFIG_RAM_START=0x0a002000
CONFIG_RAW_BINARY=y
CONFIG_SCI1_BAUD=9600
CONFIG_SCI1_SERIAL_CONSOLE=y
CONFIG_SDCLONE_DISABLE=y
CONFIG_SH1_SCI1=y
CONFIG_START_DAY=10
CONFIG_START_MONTH=11
CONFIG_START_YEAR=2008
CONFIG_STDIO_DISABLE_BUFFERING=y
CONFIG_TASK_NAME_SIZE=0
CONFIG_USER_ENTRYPOINT="nsh_main"
CONFIG_USERMAIN_STACKSIZE=1024
CONFIG_WDOG_INTRESERVE=0
@@ -0,0 +1,49 @@
#
# This file is autogenerated: PLEASE DO NOT EDIT IT.
#
# You can use "make menuconfig" to make any modifications to the installed .config file.
# You can then do "make savedefconfig" to generate a new defconfig file that includes your
# modifications.
#
CONFIG_ARCH="renesas"
CONFIG_ARCH_BOARD="us7032evb1"
CONFIG_ARCH_BOARD_US7032EVB1=y
CONFIG_ARCH_BUTTONS=y
CONFIG_ARCH_CHIP_SH7032=y
CONFIG_ARCH_RENESAS=y
CONFIG_ARCH_STACKDUMP=y
CONFIG_BOARD_LOOPSPERMSEC=572
CONFIG_DEV_LOWCONSOLE=y
CONFIG_DISABLE_ENVIRON=y
CONFIG_DISABLE_MOUNTPOINT=y
CONFIG_DISABLE_MQUEUE=y
CONFIG_DISABLE_POSIX_TIMERS=y
CONFIG_DISABLE_PTHREAD=y
CONFIG_ENDIAN_BIG=y
CONFIG_MAX_TASKS=8
CONFIG_MAX_WDOGPARMS=2
CONFIG_MOTOROLA_SREC=y
CONFIG_NFILE_DESCRIPTORS=8
CONFIG_NFILE_STREAMS=8
CONFIG_NUNGET_CHARS=0
CONFIG_PREALLOC_TIMERS=0
CONFIG_PREALLOC_WDOGS=4
CONFIG_PTHREAD_STACK_DEFAULT=1024
CONFIG_RAM_SIZE=57344
CONFIG_RAM_START=0x0a002000
CONFIG_RAW_BINARY=y
CONFIG_SCI1_BAUD=9600
CONFIG_SCI1_SERIAL_CONSOLE=y
CONFIG_SDCLONE_DISABLE=y
CONFIG_SH1_SCI1=y
CONFIG_START_DAY=10
CONFIG_START_MONTH=11
CONFIG_START_YEAR=2008
CONFIG_STDIO_DISABLE_BUFFERING=y
CONFIG_TASK_NAME_SIZE=0
CONFIG_TESTING_OSTEST=y
CONFIG_TESTING_OSTEST_NBARRIER_THREADS=3
CONFIG_TESTING_OSTEST_STACKSIZE=4096
CONFIG_USERMAIN_STACKSIZE=1024
CONFIG_USER_ENTRYPOINT="ostest_main"
CONFIG_WDOG_INTRESERVE=0
@@ -0,0 +1,92 @@
/****************************************************************************
* boards/
enesas/us7032evb1/ostest/ld.script
*
* Copyright (C) 2008 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* 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.
*
****************************************************************************/
OUTPUT_ARCH(sh)
ENTRY(_stext)
SECTIONS
{
/* The us7032evb1 has CMON in PROM beginning at address 0x00000000 and
* either 64Kb or 256Kb of SRAM beginning at 0x0a000000. Neither the
* PROM nor the first 8Kb of SRAM are avaible to the devoleper as these
* are used by CMON. The next 1Kb of SRAM is dedicated to relocated
* interrupt vectors.
*/
. = 0x0a002000;
.text : {
_svect = ABSOLUTE(.);
*(.vects); /* Relocated interrupt vectors */
_evect = ABSOLUTE(.);
_stext = ABSOLUTE(.);
*(.reset) /* Reset/IRQ code */
*(.text) /* Code */
*(.fixup)
*(.gnu.warning)
*(.rodata) /* Read-only data */
*(.rodata.str1.4)
*(.glue_7)
*(.glue_7t)
*(.got) /* Global offset table */
_etext = ABSOLUTE(.);
}
. = ALIGN(4);
.data : {
_sdata = ABSOLUTE(.);
*(.data) /* Modifiable data */
CONSTRUCTORS
_edata = ABSOLUTE(.);
}
.bss : { /* BSS */
_sbss = ABSOLUTE(.);
*(.bss)
*(COMMON)
_ebss = ABSOLUTE(.);
}
/* 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) }
+95
View File
@@ -0,0 +1,95 @@
/****************************************************************************
* boards/renesas/us7032evb1/include/board.h
*
* Copyright (C) 2008-2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* 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.
*
****************************************************************************/
#ifndef _CONFIGS_US7032EVB1_BOARD_H
#define _CONFIGS_US7032EVB1_BOARD_H
/****************************************************************************
* Included Files
****************************************************************************/
#ifndef __ASSEMBLY__
# include <stdint.h>
#endif
#include "chip.h"
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
/* Clocking *****************************************************************/
#define SH1_CLOCK 20000000 /* 20 MHz */
/* LED definitions **********************************************************/
/* The SH1_LPEVB only a single LED controlled by either port A, pin 15, or
* port B, pin 15 (selectable via JP8).
*/
#define LED_STARTED 0
#define LED_HEAPALLOCATE 1
#define LED_IRQSENABLED 1
#define LED_STACKCREATED 1
#define LED_INIRQ 0
#define LED_SIGNAL 0
#define LED_ASSERTION 0
#define LED_PANIC 1
/* Button definitions *******************************************************/
/****************************************************************************
* Public Data
****************************************************************************/
#ifndef __ASSEMBLY__
#ifdef __cplusplus
#define EXTERN extern "C"
extern "C" {
#else
#define EXTERN extern
#endif
/****************************************************************************
* Public Functions
****************************************************************************/
#undef EXTERN
#ifdef __cplusplus
}
#endif
#endif
#endif /* _CONFIGS_US7032EVB1_BOARD_H */
@@ -0,0 +1,85 @@
##############################################################################
# boards/renesas/us7032evb1/scripts/Make.defs
#
# Copyright (C) 2008, 2017 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <gnutt@nuttx.org>
#
# 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.
#
##############################################################################
include ${TOPDIR}/.config
include ${TOPDIR}/tools/Config.mk
ifeq ($(CONFIG_DEBUG_SYMBOLS),y)
ARCHOPTIMIZATION = -g
endif
ifneq ($(CONFIG_DEBUG_NOOPT),y)
ARCHOPTIMIZATION += -Os -fno-strict-aliasing -fno-strength-reduce -fomit-frame-pointer
endif
ARCHCPUFLAGS = -m1 -fno-builtin
ARCHPICFLAGS = -fpic
ARCHWARNINGS = -Wall -Wstrict-prototypes -Wshadow -Wundef
ARCHDEFINES =
ARCHINCLUDES = -I. -isystem $(TOPDIR)/include
ARCHSCRIPT = -T$(TOPDIR)/boards/$(CONFIG_ARCH)/$(CONFIG_ARCH_BOARD)/scripts/sdram.ld
CROSSDEV = sh-nuttx-elf-
CC = $(CROSSDEV)gcc
CPP = $(CROSSDEV)gcc -E
LD = $(CROSSDEV)ld
STRIP = $(CROSSDEV)strip --strip-unneeded
AR = $(CROSSDEV)ar rcs
NM = $(CROSSDEV)nm
OBJCOPY = $(CROSSDEV)objcopy
OBJDUMP = $(CROSSDEV)objdump
CFLAGS = $(ARCHWARNINGS) $(ARCHOPTIMIZATION) \
$(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) -pipe
CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES)
AFLAGS = $(CFLAGS) -D__ASSEMBLY__
ASMEXT = .S
OBJEXT = .o
LIBEXT = .a
EXEEXT =
ifeq ($(CONFIG_DEBUG_SYMBOLS),y)
LDFLAGS += -g
endif
MKDEP = $(TOPDIR)/tools/mkdeps$(HOSTEXEEXT)
HOSTCC = gcc
HOSTINCLUDES = -I.
HOSTCFLAGS = -Wall -Wstrict-prototypes -Wshadow -Wundef -g -pipe
HOSTLDFLAGS =
+91
View File
@@ -0,0 +1,91 @@
/****************************************************************************
* boards/renesas/us7032evb1/nsh/ld.script
*
* Copyright (C) 2008 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* 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.
*
****************************************************************************/
OUTPUT_ARCH(sh)
ENTRY(_stext)
SECTIONS
{
/* The us7032evb1 has CMON in PROM beginning at address 0x00000000 and
* either 64Kb or 256Kb of SRAM beginning at 0x0a000000. Neither the
* PROM nor the first 8Kb of SRAM are avaible to the devoleper as these
* are used by CMON. The next 1Kb of SRAM is dedicated to relocated
* interrupt vectors.
*/
. = 0x0a002000;
.text : {
_svect = ABSOLUTE(.);
*(.vects); /* Relocated interrupt vectors */
_evect = ABSOLUTE(.);
_stext = ABSOLUTE(.);
*(.reset) /* Reset/IRQ code */
*(.text) /* Code */
*(.fixup)
*(.gnu.warning)
*(.rodata) /* Read-only data */
*(.rodata.str1.4)
*(.glue_7)
*(.glue_7t)
*(.got) /* Global offset table */
_etext = ABSOLUTE(.);
}
.data : {
_sdata = ABSOLUTE(.);
*(.data) /* Modifiable data */
CONSTRUCTORS
_edata = ABSOLUTE(.);
}
.bss : { /* BSS */
_sbss = ABSOLUTE(.);
*(.bss)
*(COMMON)
_ebss = ABSOLUTE(.);
}
/* 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) }
}
@@ -0,0 +1,3 @@
shterm
*.o
+52
View File
@@ -0,0 +1,52 @@
############################################################################
# boards/renesas/us7032evb1/shterm/Makefile
#
# Copyright (C) 2008 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <gnutt@nuttx.org>
#
# 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.
#
############################################################################
include $(TOPDIR)/Make.defs
SRC = shterm.c
BIN = shterm
all: ..$(DELIM)bin$(DELIM)$(BIN)$(EXEEXT)
$(BIN)$(EXEEXT): $(SRC)
$(HOSTCC) $(HOSTCFLAGS) $^ -o $@
..$(DELIM)bin$(DELIM)$(BIN)$(EXEEXT): $(BIN)$(EXEEXT)
install -m 0755 $^ $@
clean:
$(call DELFILE, $(BIN)$(EXEEXT))
$(call DELFILE..$(DELIM)bin$(DELIM)$(BIN)$(EXEEXT))
$(call CLEAN)
File diff suppressed because it is too large Load Diff
+2
View File
@@ -0,0 +1,2 @@
/.depend
/Make.dep
+76
View File
@@ -0,0 +1,76 @@
############################################################################
# boards/
enesas/us7032evb1/src/Makefile
#
# Copyright (C) 2008, 2012 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <gnutt@nuttx.org>
#
# 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.
#
############################################################################
-include $(TOPDIR)/Make.defs
ARCH_SRCDIR = $(TOPDIR)/arch/$(CONFIG_ARCH)/src
CFLAGS += -I$(ARCH_SRCDIR)/chip -I$(ARCH_SRCDIR)/common -I$(TOPDIR)/sched
ASRCS =
AOBJS = $(ASRCS:.S=$(OBJEXT))
CSRCS = sh1_leds.c
COBJS = $(CSRCS:.c=$(OBJEXT))
SRCS = $(ASRCS) $(CSRCS)
OBJS = $(AOBJS) $(COBJS)
CFLAGS += -I $(TOPDIR)/arch/$(CONFIG_ARCH)/src
all: libboard$(LIBEXT)
$(AOBJS): %$(OBJEXT): %.S
$(call ASSEMBLE, $<, $@)
$(COBJS) $(LINKOBJS): %$(OBJEXT): %.c
$(call COMPILE, $<, $@)
libboard$(LIBEXT): $(OBJS)
$(call ARCHIVE, $@, $(OBJS))
.depend: Makefile $(SRCS)
$(Q) $(MKDEP) $(CC) -- $(CFLAGS) -- $(SRCS) >Make.dep
$(Q) touch $@
depend: .depend
clean:
$(call DELFILE, libboard$(LIBEXT))
$(call CLEAN)
distclean: clean
$(call DELFILE, Make.dep)
$(call DELFILE, .depend)
+138
View File
@@ -0,0 +1,138 @@
/****************************************************************************
* boards/
enesas/us7032evb1/src/sh1_leds.c
*
* Copyright (C) 2008-2009, 2015 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* 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.
*
****************************************************************************/
/****************************************************************************
* Included Files
****************************************************************************/
#include <nuttx/config.h>
#include <stdint.h>
#include <nuttx/board.h>
#include "chip.h"
#include "up_arch.h"
#include "up_internal.h"
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
/* The SH1_LPEVB only a single LED controlled by either port A, pin 15, or
* port B, pin 15 (selectable via JP8). In this file, we assume the portB
* setup.
*/
#define SH1_PBDR_LED 0x8000
#define SH1_PBIOR_LED 0x8000
#define SH1_PBCR2_LED 0xc000
/****************************************************************************
* Private Data
****************************************************************************/
/****************************************************************************
* Private Functions
****************************************************************************/
/****************************************************************************
* Public Functions
****************************************************************************/
/****************************************************************************
* Name: board_autoled_initialize
****************************************************************************/
#ifdef CONFIG_ARCH_LEDS
void board_autoled_initialize(void)
{
uint16_t reg16;
/* Setup port B, pin 15 as an output */
reg16 = getreg16(SH1_PFC_PBIOR);
reg16 |= SH1_PBIOR_LED;
putreg16(reg16, SH1_PFC_PBIOR);
/* Setup port B, pin 15 as a normal I/O register */
reg16 = getreg16(SH1_PFC_PBCR1);
reg16 &= ~SH1_PBCR2_LED;
putreg16(reg16, SH1_PFC_PBCR1);
/* Turn the LED off */
reg16 = getreg16(SH1_PORTB_DR);
reg16 &= ~SH1_PBDR_LED;
putreg16(reg16, SH1_PORTB_DR);
}
/****************************************************************************
* Name: board_autoled_on
****************************************************************************/
void board_autoled_on(int led)
{
uint16_t reg16;
if (led)
{
/* Turn the LED on */
reg16 = getreg16(SH1_PORTB_DR);
reg16 |= SH1_PBDR_LED;
putreg16(reg16, SH1_PORTB_DR);
}
}
/****************************************************************************
* Name: board_autoled_off
****************************************************************************/
void board_autoled_off(int led)
{
uint16_t reg16;
if (led)
{
/* Turn the LED off */
reg16 = getreg16(SH1_PORTB_DR);
reg16 &= ~SH1_PBDR_LED;
putreg16(reg16, SH1_PORTB_DR);
}
}