diff --git a/Documentation/README.html b/Documentation/README.html index 348a2278cb..094a883ce9 100644 --- a/Documentation/README.html +++ b/Documentation/README.html @@ -8,7 +8,7 @@

NuttX README Files

-

Last Updated: April 22, 2019

+

Last Updated: June 4, 2019

@@ -159,6 +159,8 @@ nuttx/ | | `- README.txt | |- lpcxpresso-lpc54628/ | | `- README.txt + | |- makerlisp/ + | | `- README.txt\ | |- maple/ | | `- README.txt\ | |- max32660-evsys/ diff --git a/README.txt b/README.txt index a5f6c41d98..d4e4acb15e 100644 --- a/README.txt +++ b/README.txt @@ -1833,6 +1833,8 @@ nuttx/ | | `- README.txt | |- lpcxpresso-lpc54628/ | | `- README.txt + | |- makerlisp/ + | | `- README.txt | |- maple/ | | `- README.txt | |- max32660-evsys/ diff --git a/arch/z80/include/ez80/io.h b/arch/z80/include/ez80/io.h index e843db3567..643da9eed0 100644 --- a/arch/z80/include/ez80/io.h +++ b/arch/z80/include/ez80/io.h @@ -46,22 +46,6 @@ #include -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -/**************************************************************************** - * Public Types - ****************************************************************************/ - -/**************************************************************************** - * Inline functions - ****************************************************************************/ - -/**************************************************************************** - * Public Data - ****************************************************************************/ - /**************************************************************************** * Public Function Prototypes ****************************************************************************/ diff --git a/arch/z80/src/ez80/Make.defs b/arch/z80/src/ez80/Make.defs index 136ecdbb9c..43e95b98df 100644 --- a/arch/z80/src/ez80/Make.defs +++ b/arch/z80/src/ez80/Make.defs @@ -53,7 +53,7 @@ endif CHIP_SSRCS = CHIP_CSRCS = ez80_clock.c ez80_initialstate.c ez80_irq.c ez80_copystate.c CHIP_CSRCS += ez80_schedulesigaction.c ez80_sigdeliver.c ez80_lowuart.c -CHIP_CSRCS += ez80_serial.c ez80_registerdump.c +CHIP_CSRCS += ez80_timerisr.c ez80_serial.c ez80_registerdump.c ifneq ($(CONFIG_EZ80_I2C),y) CHIP_CSRCS += ez80_i2c.c diff --git a/arch/z80/src/ez80/chip.h b/arch/z80/src/ez80/chip.h index 637a0cd3e0..a3c04736e5 100644 --- a/arch/z80/src/ez80/chip.h +++ b/arch/z80/src/ez80/chip.h @@ -58,7 +58,7 @@ #define EZ80_Z_FLAG 0x40 /* Bit 5: Zero flag */ #define EZ80_S_FLAG 0x80 /* Bit 7: Sign flag */ -/* Include chip-specific regiser definitions */ +/* Include chip-specific register definitions */ #if defined(CONFIG_ARCH_CHIP_EZ80F91) # include "ez80f91.h" diff --git a/arch/z80/src/ez80/ez80_irqsave.asm b/arch/z80/src/ez80/ez80_irqsave.asm index 75df49561a..56aadee7f5 100644 --- a/arch/z80/src/ez80/ez80_irqsave.asm +++ b/arch/z80/src/ez80/ez80_irqsave.asm @@ -38,11 +38,12 @@ ;************************************************************************** ;************************************************************************** -; Global Symbols Expported +; Global Symbols Exported ;************************************************************************** xdef _up_irq_save xdef _up_irq_restore + xdef _up_irq_enable ;************************************************************************** ; Code @@ -93,7 +94,7 @@ _disabled: ;* ;************************************************************************** -up_irq_enable: +_up_irq_enable: ld a, i ; AF = interrupt state ei ; Interrupts are enabled (does not affect F) push af ; Transfer to HL via the stack diff --git a/arch/z80/src/ez80/ez80_sigdeliver.c b/arch/z80/src/ez80/ez80_sigdeliver.c index eb949575a4..6d7f50d5ac 100644 --- a/arch/z80/src/ez80/ez80_sigdeliver.c +++ b/arch/z80/src/ez80/ez80_sigdeliver.c @@ -46,6 +46,8 @@ #include #include #include + +#include #include #include "chip/switch.h" diff --git a/arch/z80/src/ez80/ez80f91_spi.h b/arch/z80/src/ez80/ez80f91_spi.h index 0c49cad1d7..31aca65502 100644 --- a/arch/z80/src/ez80/ez80f91_spi.h +++ b/arch/z80/src/ez80/ez80f91_spi.h @@ -1,6 +1,5 @@ /************************************************************************************ * arch/z80/src/ez80/ez80f91_spi.h - * arch/z80/src/chip/ez80f91_spi.h * * Copyright (C) 2009-2010, 2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -61,7 +60,7 @@ * No bit definitions -- These two 8-bit registers set the 16-bit BRG divider value */ -/* SPI Control (CTL} Register Definitions */ +/* SPI Control (CTL) Register Definitions */ #define SPI_CTL_IRQEN (1 << 7) /* Bit 7: 1=SPI system interrupt is enabled */ #define SPI_CTL_SPIEN (1 << 5) /* Bit 5: 1=SPI is enabled */ diff --git a/configs/Kconfig b/configs/Kconfig index 5c9c089fca..11c4c4ba13 100644 --- a/configs/Kconfig +++ b/configs/Kconfig @@ -611,6 +611,17 @@ config ARCH_BOARD_LPC1766STK This port uses the Olimex LPC1766-STK board and a GNU GCC toolchain* under Linux or Cygwin. STATUS: Complete and mature. +config ARCH_BOARD_MAKERLISP + bool "MakerLisp" + depends on ARCH_CHIP_EZ80F91 + select ARCH_HAVE_LEDS + ---help--- + ez80Acclaim! Microcontroller. This port use the MakerLips machine + based on an eZ80F091 part, and the Zilog ZDS-II Windows command line + tools. The development environment is Cygwin under Windows. A + Windows native development environment is available but has not + been verified. + config ARCH_BOARD_MAPLE bool "maple board" depends on ARCH_CHIP_STM32F103RB || ARCH_CHIP_STM32F103CB @@ -1870,6 +1881,7 @@ config ARCH_BOARD default "lpcxpresso-lpc1768" if ARCH_BOARD_LPCXPRESSO default "lpcxpresso-lpc54628" if ARCH_BOARD_LPCXPRESSO_LPC54628 default "maple" if ARCH_BOARD_MAPLE + default "makerlisp" if ARCH_BOARD_MAKERLISP default "max32660-evsys" if ARCH_BOARD_MAX32660_EVSYS default "mbed" if ARCH_BOARD_MBED default "mcb1700" if ARCH_BOARD_MCB1700 @@ -2169,6 +2181,9 @@ endif if ARCH_BOARD_LPCXPRESSO_LPC54628 source "configs/lpcxpresso-lpc54628/Kconfig" endif +if ARCH_BOARD_MAKERLISP +source "configs/makerlisp/Kconfig" +endif if ARCH_BOARD_MAPLE source "configs/maple/Kconfig" endif diff --git a/configs/README.txt b/configs/README.txt index 8d07fe78c6..af3740039a 100644 --- a/configs/README.txt +++ b/configs/README.txt @@ -368,6 +368,12 @@ configs/lpc4370-link2 LPC4370FET100 MCU. Based on the LPC4300 Xplorer port and provided by Lok Tep. +configs/makerlisp + This port use the MakerLips machine based on an eZ80F091 ez80Acclaim! + Microcontroller, and the Zilog ZDS-II Windows command line tools. The + development environment is Cygwin under Windows. A Windows native + development environment is available but has not been verified. + configs/maple NuttX support for the LeafLab's Maple and Maple Mini boards. These boards are based on the STM32F103RBT6 chip for the standard version and on the diff --git a/configs/ez80f910200kitg/README.txt b/configs/ez80f910200kitg/README.txt index fbd0963cf5..582476d996 100644 --- a/configs/ez80f910200kitg/README.txt +++ b/configs/ez80f910200kitg/README.txt @@ -89,13 +89,17 @@ Version 5.3.0 The consequence is, of course, that these interfaces will not be available to applications. - Another issue is that the ZDS-II version of stdarg.h does not provide - va_copy(). This affects libs/libc/lib_sysloc.c. + Alternatively, you can use 'make -i' to build the system. The above + errors will occur, but will not stop the build (unless the failed build + objects are brought into the link). The has the negative side effects + that (1) the archives will always be rebuild in the directories where + the error occur, and (2) you might miss other, real compilation error + since these will no longer stop the compilation. Other Versions If you use any version of ZDS-II other than 5.1.1, 5.2.1, or 5.3.0 or if you install ZDS-II at any location other than the default location, - you will have to modify one or three files: (1) arch/arm/z80/src/ez80Kconfig, + you will have to modify three files: (1) arch/arm/z80/src/ez80/Kconfig, (2) configs/ez80f910200kitg/scripts/Make.defs and, perhaps, (3) arch/z80/src/ez80/Toolchain.defs. diff --git a/configs/ez80f910200zco/README.txt b/configs/ez80f910200zco/README.txt index 3dd26d39ad..15c5ef1d47 100644 --- a/configs/ez80f910200zco/README.txt +++ b/configs/ez80f910200zco/README.txt @@ -97,13 +97,17 @@ Version 5.3.0 The consequence is, of course, that these interfaces will not be available to applications. - Another issue is that the ZDS-II version of stdarg.h does not provide - va_copy(). This affects libs/libc/lib_sysloc.c. + Alternatively, you can use 'make -i' to build the system. The above + errors will occur, but will not stop the build (unless the failed build + objects are brought into the link). The has the negative side effects + that (1) the archives will always be rebuild in the directories where + the error occur, and (2) you might miss other, real compilation error + since these will no longer stop the compilation. Other Versions If you use any version of ZDS-II other than 5.1.1, 5.2.1, or 5.3.0 or if you install ZDS-II at any location other than the default location, - you will have to modify one or three files: (1) arch/arm/z80/src/ez80Kconfig, + you will have to modify three files: (1) arch/arm/z80/src/ez80/Kconfig, (2) configs/ez80f910200zco/scripts/Make.defs and, perhaps, (3) arch/z80/src/ez80/Toolchain.defs. diff --git a/configs/makerlisp/Kconfig b/configs/makerlisp/Kconfig new file mode 100644 index 0000000000..0b93d4bd01 --- /dev/null +++ b/configs/makerlisp/Kconfig @@ -0,0 +1,8 @@ +# +# For a description of the syntax of this configuration file, +# see the file kconfig-language.txt in the NuttX tools repository. +# + +if ARCH_BOARD_MAKERLISP + +endif # ARCH_BOARD_MAKERLISP diff --git a/configs/makerlisp/README.txt b/configs/makerlisp/README.txt new file mode 100644 index 0000000000..8de635e4d6 --- /dev/null +++ b/configs/makerlisp/README.txt @@ -0,0 +1,227 @@ +README.txt +========== + +The MakerLisp machine is a portable, modular computer system, designed to +recapture the feel of classic computing, with modern hardware. + +The machine centers on a 2" x 3.5" business card-sized CPU, which can be used +stand-alone, or plugged in to a 2" x 8" main board, for expansion into a full +computer system. A laser-cut wood enclosure holds a small keyboard, an LCD +monitor, the circuit boards, and a prototyping area with a breadboard for +electronics experimentation and development. + +The CPU is a Zilog eZ80 running at 50 MHz, with up to 16 Mb of zero-wait state +RAM. A VGA display adapter provides an IBM PC-like color text-mode display. A +USB Host Controller supports a USB keyboard and other USB communications. +Data storage and interchange is accomplished by a micro-SD card supporting the +FAT file system. All four of these circuit boards (shown on the web site's cover +page) are new MakerLisp products, and will be available as part of the first +product offering + +Contents +======== + + o ZDS-II Compiler Versions + o Serial Console + - UARTs + - Serial Keyboard and VGA Display + o LEDs and Buttons + - LEDs + - Buttons + o Configurations + - Common Configuration Notes + - Configuration Subdirectories + +ZDS-II Compiler Versions +======================== + +Version 5.3.0 + + The initial bring-up of the MakerLisp board used the ZiLOG ZDS-II 5.3.0 + toolchain. To use this toolchain, I had to suppress the gmtime() and + gmtimer() because these were causing an internal compiler error: + + time\lib_gmtimer.c + P2: Internal Error(0xB47E59): + Please contact Technical Support + + This is the change to suppress building these files: + + diff --git a/libs/libc/time/Make.defs b/libs/libc/time/Make.defs + index 5c9b746778..8327e287f4 100644 + --- a/libs/libc/time/Make.defs + +++ b/libs/libc/time/Make.defs + @@ -44,7 +44,7 @@ ifdef CONFIG_LIBC_LOCALTIME + CSRCS += lib_localtime.c lib_asctime.c lib_asctimer.c lib_ctime.c + CSRCS += lib_ctimer.c + else + -CSRCS += lib_mktime.c lib_gmtime.c lib_gmtimer.c + +CSRCS += lib_mktime.c # lib_gmtime.c lib_gmtimer.c + ifdef CONFIG_TIME_EXTENDED + CSRCS += lib_dayofweek.c lib_asctime.c lib_asctimer.c lib_ctime.c + CSRCS += lib_ctimer.c + + And there is also this: + + stdlib\lib_strtof.c + stdlib\lib_strtof.c (76,36) : WARNING (32) Division by zero encountered + stdlib\lib_strtof.c (102,36) : WARNING (32) Division by zero encountered + + Which can be worked around by removing it from the build + + The consequence is, of course, that these interfaces will not be available + to applications. + + Alternatively, you can use 'make -i' to build the system. The above + errors will occur, but will not stop the build (unless the failed build + objects are brought into the link). The has the negative side effects + that (1) the archives will always be rebuild in the directories where + the error occur, and (2) you might miss other, real compilation error + since these will no longer stop the compilation. + +Other Versions + If you use any version of ZDS-II other than 5.3.0 or if you install ZDS-II + at any location other than the default location, you will have to modify + three files: (1) arch/arm/z80/src/ez80/Kconfig, (2) + configs/makerlisp/scripts/Make.defs and, perhaps, (3) + arch/z80/src/ez80/Toolchain.defs. + +Serial Console +============== + + There are two options for a serial console: (1) A UART connected to a + terminal program or (2) the MakerLisp Serial Keyboard and VGA display. + +UARTs +----- + + The eZ80 has two UART peripherals: + + UART 0: All of Port D pins can support UART0 functions when configured + for the alternate function 7. For typical configurations only RXD and TXD + need be configured. + + eZ80 PIN BOARD SIGNAL CN1 ACCESS + ======================================= + PD0/TXD1/IR_IXD CN1_TX0 Pin 61 + PD1/RXD1/IR_RXD CN1_RX0 Pin 59 + PD2/RTS1 CN1_RTS0 Pin 63 + PD3/CTS1 CN1_CTS0 Pin 65 + PD4/DTR1 CN1_DTR0 Pin 67 + PD5/DSR1 CN1_DSR0 Pin 69 + PD6/DCD1 CN1_DCD0 Pin 71 + PD7/RIO1 CN1_RI0 Pin 73 + + UART 0: All of Port C pins can support UART1 functions when configured + for the alternate function 7. For typical configurations only RXD and TXD + need be configured. + + eZ80 PIN BOARD SIGNAL CN1 ACCESS + ======================================= + PC0/TXD1 CN1_TX1 Pin 62 + PC1/RXD1 CN1_RX1 Pin 60 + PC2/RTS1 CN1_RTS1 Pin 64 + PC3/CTS1 CN1_CTS1 Pin 66 + PC4/DTR1 CN1_DTR1 Pin 68 + PC5/DSR1 CN1_DSR1 Pin 70 + PC6/DCD1 CN1_DCD1 Pin 72 + PC7/RIO1 CN1_RI1 Pin 74 + +Serial Keyboard and VGA Display +------------------------------- + + The serial console can also be implemented using the MakerLisp USB + Keyboard Controller Board and VGA Display Controller. These are accessed + via the two UART ports. + + [more to be provided] + +LEDs and Buttons +================ + +LEDs +---- + + Three LEDs are available on the CPU Card, but none are available for + general use by applications: + + D2 RED: CPU Card power. Not under eZ80 control + D3 GREEN: Driven by CPU GPI/O pin. However, it has some additional + properties: + + 1. On input, it will be '1' if the I/O expansion board is + present. + 2. Setting it to an output of '0' will generate a system reset. + 3. Setting it to an output of '1' will not only illuminate the + LED take the card out of reset and enable power to the SD + card slot. + + As a consequence, the GREEN LED will not be illuminated if + SD card support or SPI is disabled. The only effect of + CONFIG_ARCH_LEDS is that the GREEN LED will turned off in + the event of a crash. + + D1 AMBER: Controlled by the on-board MCP2221A USB bridge and provides USB + enumeration status. Not under eZ80 control. + +Buttons +------- + + The MakerLisp CPU board has no on-board buttons that can be sensed by the + eZ80. + +Configurations +============== + +Common Configuration Notes +-------------------------- + + 1. src/ and include/ + + These directories contain common logic for all MakerLisp + configurations. + + 2. Variations on the basic MakerLisp configuration are maintained + in subdirectories. To configure any specific configuration, do the + following steps: + + tools/configure.sh [OPTIONS] makerlisp/ + make + + Where is the specific board configuration that you + wish to build. Use 'tools/configure.sh -h' to see the possible + options. Typical options are: + + -l Configure for a Linux host + -c Configure for a Windows Cygwin host + -g Configure for a Windows MYS2 host + + Use configure.bat instead of configure.sh if you are building in a + native Windows environment. + + The available board-specific configurations are summarized in the + following paragraphs. + + 3. This configuration uses the mconf-based configuration tool. To + change this 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. + +Configuration Subdirectories +---------------------------- + + nsh: + + This configuration builds the NuttShell (NSH). That code can be + found in examples/nsh. For more information see: examples/nsh/README.txt + and Documentation/NuttShell.html. + + NOTES: + + 1. A serial console is provided on UART0. It will be necessary to + connect either a TTL-to-RS232 or a TTL-to-USB Serial adapter to CN1 + pins 59 and 61. diff --git a/configs/makerlisp/include/board.h b/configs/makerlisp/include/board.h new file mode 100644 index 0000000000..a294d7505f --- /dev/null +++ b/configs/makerlisp/include/board.h @@ -0,0 +1,101 @@ +/**************************************************************************** + * arch/makerlisp/include/board.h + * + * Copyright (C) 2019 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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_MAKERLISP_INCLUDE_BOARD_H +#define __CONFIGS_MAKERLISP_INCLUDE_BOARD_H + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ + +/* Clocking */ + +#define EZ80_SYS_CLK_FREQ 50000000 + +/* LEDs */ + +/* The D3 GREEN LED is driven by an eZ80 GPI/O pin. However, it has some + * additional properties: + * + * 1. On input, it will be '1' if the I/O expansion board is present. + * 2. Setting it to an output of '0' will generate a system reset. + * 3. Setting it to an output of '1' will not only illuminate the LED + * take the card out of reset and enable power to the SD card slot. + * + * As a consequence, the GREEN LED will not be illuminated if SD card + * support or SPI is disabled. The only effect of CONFIG_ARCH_LEDS is that + * the GREEN LED will turned off in the event of a crash. + */ + +#define LED_STARTED 0 +#define LED_HEAPALLOCATE 0 +#define LED_IRQSENABLED 0 +#define LED_STACKCREATED 0 +#define LED_IDLE 0 +#define LED_INIRQ 0 +#define LED_ASSERTION 1 +#define LED_SIGNAL 0 +#define LED_PANIC 1 + +/* Button definitions + * The MakerLisp CPU board has no on-board buttons that can be sensed by the + * eZ80. + */ + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +#undef EXTERN +#if defined(__cplusplus) +#define EXTERN extern "C" +extern "C" +{ +#else +#define EXTERN extern +#endif + +#undef EXTERN +#if defined(__cplusplus) +} +#endif + +#endif /* __CONFIGS_MAKERLISP_INCLUDE_BOARD_H */ diff --git a/configs/makerlisp/nsh/.gitignore b/configs/makerlisp/nsh/.gitignore new file mode 100644 index 0000000000..739b8373b8 --- /dev/null +++ b/configs/makerlisp/nsh/.gitignore @@ -0,0 +1,7 @@ +nsh.hex +nsh.map +nsh.lod +nsh.wsp +*.asm +Debug + diff --git a/configs/makerlisp/nsh/README.txt b/configs/makerlisp/nsh/README.txt new file mode 100644 index 0000000000..72e48fc2be --- /dev/null +++ b/configs/makerlisp/nsh/README.txt @@ -0,0 +1,5 @@ +README.txt +^^^^^^^^^^ + +nsh.zdsproj is a simple ZDS-II project that will allow you + to use the ZDS-II debugger. diff --git a/configs/makerlisp/nsh/defconfig b/configs/makerlisp/nsh/defconfig new file mode 100644 index 0000000000..cd83ba4961 --- /dev/null +++ b/configs/makerlisp/nsh/defconfig @@ -0,0 +1,46 @@ +# +# 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="z80" +CONFIG_ARCH_BOARD="makerlisp" +CONFIG_ARCH_BOARD_MAKERLISP=y +CONFIG_ARCH_CHIP_EZ80=y +CONFIG_ARCH_CHIP_EZ80F91=y +CONFIG_ARCH_LEDS=y +CONFIG_ARCH_Z80=y +CONFIG_BOARD_LOOPSPERMSEC=1250 +CONFIG_DISABLE_MQUEUE=y +CONFIG_EZ80_UART0=y +CONFIG_HOST_WINDOWS=y +CONFIG_MAX_TASKS=16 +CONFIG_MAX_WDOGPARMS=2 +CONFIG_NFILE_DESCRIPTORS=8 +CONFIG_NFILE_STREAMS=8 +CONFIG_NSH_FILEIOSIZE=512 +CONFIG_NSH_LINELEN=64 +CONFIG_NSH_READLINE=y +CONFIG_PREALLOC_TIMERS=4 +CONFIG_PREALLOC_WDOGS=8 +CONFIG_PTHREAD_STACK_DEFAULT=1024 +CONFIG_RAM_SIZE=65536 +CONFIG_RR_INTERVAL=200 +CONFIG_SCHED_HPWORK=y +CONFIG_SDCLONE_DISABLE=y +CONFIG_START_DAY=14 +CONFIG_START_MONTH=3 +CONFIG_START_YEAR=2009 +CONFIG_SYSTEM_NSH=y +CONFIG_TASK_NAME_SIZE=0 +CONFIG_UART0_BAUD=57600 +CONFIG_UART0_BITS=0 +CONFIG_UART0_RXBUFSIZE=192 +CONFIG_UART0_SERIAL_CONSOLE=y +CONFIG_UART0_TXBUFSIZE=64 +CONFIG_USER_ENTRYPOINT="nsh_main" +CONFIG_WDOG_INTRESERVE=1 diff --git a/configs/makerlisp/nsh/nsh.zdsproj b/configs/makerlisp/nsh/nsh.zdsproj new file mode 100644 index 0000000000..605c8a0fce --- /dev/null +++ b/configs/makerlisp/nsh/nsh.zdsproj @@ -0,0 +1,247 @@ + +eZ80F91 + + + +..\..\..\nuttx.hex + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/configs/makerlisp/scripts/Make.defs b/configs/makerlisp/scripts/Make.defs new file mode 100644 index 0000000000..18f8e973f1 --- /dev/null +++ b/configs/makerlisp/scripts/Make.defs @@ -0,0 +1,284 @@ +############################################################################ +# configs/makerlisp/nsh/Make.defs +# +# Copyright (C) 2019 Gregory Nutt. All rights reserved. +# Author: Gregory Nutt +# +# 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 + +# These are the default directories where the ZDS-II toolchain is installed. +# NOTE that short 8.3 path names are used in order to avoid spaces. On my +# machine I have: +# +# Versions 5.1.1 and 5.2.1 +# C:\PROGRA~1\ = C:\Program Files\ +# C:\PROGRA~2\ = C:\Program Files (x86)\ +# +# Your PC may be configured differently. +# +# Version 5.3.0, the default install location is C:\ZiLOG + +ifeq ($(CONFIG_EZ80_ZDSII_V511),y) +INSTALLROOT = C:/PROGRA~2/ZiLOG +ZDSVERSION := 5.1.1 +else ifeq ($(CONFIG_EZ80_ZDSII_V521),y) +INSTALLROOT = C:/PROGRA~2/ZiLOG +ZDSVERSION := 5.2.1 +else ifeq ($(CONFIG_EZ80_ZDSII_V530),y) +INSTALLROOT = C:/ZiLOG +ZDSVERSION := 5.3.0 +endif + +ifeq ($(CONFIG_WINDOWS_NATIVE),y) + ZDSINSTALLDIR := $(INSTALLROOT)/ZDSII_eZ80Acclaim!_$(ZDSVERSION) + INSTALLDIR = ${shell echo $(ZDSINSTALLDIR)| sed -e "s/\//\\/g"} + ZDSBINDIR := $(INSTALLDIR)\bin + ZDSSTDINCDIR := $(INSTALLDIR)\include\std + ZDSZILOGINCDIR := $(INSTALLDIR)\include\zilog + ZDSSTDLIBDIR := $(INSTALLDIR)\lib\std + ZDSZILOGLIBDIR := $(INSTALLDIR)\lib\zilog + + # CFLAGs + + ARCHASMINCLUDES = -include:$(TOPDIR)\include;$(ZDSSTDINCDIR);$(ZDSZILOGINCDIR) + EARCHASMINCLUDES = -include:$(TOPDIR)\include;$(ZDSSTDINCDIR);$(ZDSZILOGINCDIR) + ARCHSTDINCLUDES = -stdinc:$(TOPDIR)\include;$(ZDSSTDINCDIR);$(ZDSZILOGINCDIR) + ARCHUSRINCLUDES = -usrinc:. +else + WINTOOL := y + ZDSINSTALLDIR := $(INSTALLROOT)/ZDSII_eZ80Acclaim!_$(ZDSVERSION) + INSTALLDIR = ${shell cygpath -u "$(ZDSINSTALLDIR)"} + ZDSBINDIR := $(INSTALLDIR)/bin + ZDSSTDINCDIR := $(INSTALLDIR)/include/std + ZDSZILOGINCDIR := $(INSTALLDIR)/include/zilog + ZDSSTDLIBDIR := $(INSTALLDIR)/lib/std + ZDSZILOGLIBDIR := $(INSTALLDIR)/lib/zilog + + # These are the same directories but with the directory separator + # character swapped as needed by the ZDS-II compiler + + WTOPDIR := ${shell cygpath -w "$(TOPDIR)"} + WZDSSTDINCDIR := ${shell cygpath -w "$(ZDSSTDINCDIR)"} + WZDSZILOGINCDIR := ${shell cygpath -w "$(ZDSZILOGINCDIR)"} + WZDSSTDLIBDIR := ${shell cygpath -w "$(ZDSSTDLIBDIR)"} + WZDSZILOGLIBDIR := ${shell cygpath -w "$(ZDSZILOGLIBDIR)"} + + # Escaped versions + + ETOPDIR := ${shell echo "$(WTOPDIR)" | sed -e "s/ /%20/g"} + EZDSSTDINCDIR := ${shell echo "$(WZDSSTDINCDIR)" | sed -e "s/ /%20/g"} + EZDSZILOGINCDIR := ${shell echo "$(WZDSZILOGINCDIR)" | sed -e "s/ /%20/g"} + + # CFLAGs + + ARCHASMINCLUDES = -include:'$(WTOPDIR)\include;$(WZDSSTDINCDIR);$(WZDSZILOGINCDIR)' + EARCHASMINCLUDES = -include:'$(ETOPDIR)\include;$(EZDSSTDINCDIR);$(EZDSZILOGINCDIR)' + ARCHSTDINCLUDES = -stdinc:'$(WTOPDIR)\include;$(WZDSSTDINCDIR);$(WZDSZILOGINCDIR)' + ARCHUSRINCLUDES = -usrinc:'.' +endif + +# Assembler definitions + +ifeq ($(CONFIG_ARCH_CHIP_EZ80F91),y) + ARCHCPU = eZ80F91 + ARCHCPUDEF = _EZ80F91 + ARCHFAMILY = _EZ80ACCLAIM! +endif + +ifeq ($(CONFIG_DEBUG_SYMBOLS),y) + ARCHASMOPTIMIZATION = -debug -NOsdiopt +else + ARCHASMOPTIMIZATION = -nodebug -NOsdiopt +endif + +ARCHASMCPUFLAGS = -cpu:$(ARCHCPU) -NOigcase +ARCHASMLIST = -list -NOlistmac -name -pagelen:56 -pagewidth:80 -quiet +ARCHASMWARNINGS = -warn +ARCHASMDEFINES = -define:$(ARCHCPUDEF)=1 -define:$(ARCHFAMILYDEF)=1 -define:__ASSEMBLY__ +AFLAGS = $(ARCHASMCPUFLAGS) $(ARCHASMINCLUDES) $(ARCHASMLIST) $(ARCHASMWARNINGS) $(ARCHASMOPTIMIZATION) + +# Compiler definitions + +ifeq ($(CONFIG_DEBUG_SYMBOLS),y) + ARCHOPTIMIZATION = -debug +else + ARCHOPTIMIZATION = -nodebug +endif + +ifeq ($(CONFIG_DEBUG_NOOPT),y) + ARCHOPTIMIZATION += -reduceopt +else + ARCHOPTIMIZATION += -optsize +endif + +ARCHCPUFLAGS = -chartype:S -promote -cpu:$(ARCHCPU) -NOgenprintf -NOmodsect \ + -asmsw:" $(ARCHASMCPUFLAGS) $(EARCHASMINCLUDES) $(ARCHASMWARNINGS) $(ARCHASMOPTIMIZATION)" +ARCHLIST = -keeplst -NOlist -NOlistinc -keepasm +ARCHPICFLAGS = +ARCHWARNINGS = -warn +ARCHDEFINES = -define:$(ARCHCPUDEF) -define:$(ARCHFAMILYDEF) +ARCHINCLUDES = $(ARCHSTDINCLUDES) $(ARCHUSRINCLUDES) +CFLAGS = $(ARCHWARNINGS) $(ARCHOPTIMIZATION) $(ARCHLIST) $(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) + +CPPDEFINES = -D$(ARCHFAMILYDEF) -D$(ARCHCPUDEF) -D__ASSEMBLY__ +CPPINCLUDES = -I$(TOPDIR)$(DELIM)include +CPPFLAGS = $(CPPDEFINES) $(CPPINCLUDES) + +# Librarian definitions + +ARFLAGS = -quiet -warn + +# Linker definitions + +LINKCMDTEMPLATE = $(TOPDIR)$(DELIM)configs$(DELIM)makerlisp$(DELIM)scripts$(DELIM)makerlisp.linkcmd + +# Tool names/paths. + +CROSSDEV = +CC = $(ZDSBINDIR)$(DELIM)ez80cc.exe +CPP = gcc -E +LD = $(ZDSBINDIR)$(DELIM)ez80link.exe +AS = $(ZDSBINDIR)$(DELIM)ez80asm.exe +AR = $(ZDSBINDIR)$(DELIM)ez80lib.exe + +# File extensions + +ASMEXT = .asm +OBJEXT = .obj +LIBEXT = .lib +EXEEXT = .lod +HEXEXT = .hex + +# These are the macros that will be used in the NuttX make system +# to compile and assembly source files and to insert the resulting +# object files into an archive + +ifeq ($(CONFIG_WINDOWS_NATIVE),y) + +define PREPROCESS + @echo CPP: $1->$2 + $(Q) $(CPP) $(CPPFLAGS) $1 -o $2 +endef + +define COMPILE + $(Q) $(CC) $(CFLAGS) ${shell echo $1 | sed -e "s/\//\\/g"} +endef + +define ASSEMBLE + $(Q) $(AS) $(AFLAGS) ${shell echo $1 | sed -e "s/\//\\/g"} +endef + +define MOVEOBJ + $(call MOVEFILE, "$1.obj", "$2$(DELIM)$1.obj") + $(call MOVEFILE, "$1.lst", "$2$(DELIM)$1.lst") + $(call MOVEFILE, "$1.src", "$2$(DELIM)$1.src") +endef + +define ARCHIVE + @echo AR: $2 + $(Q) for %%G in ($(2)) do ( $(AR) $(ARFLAGS) $1=-+%%G ) +endef + +define CLEAN + $(Q) if exist *.obj (del /f /q *.obj) + $(Q) if exist *.src (del /f /q *.src) + $(Q) if exist *.lib (del /f /q *.lib) + $(Q) if exist *.hex (del /f /q *.hex) + $(Q) if exist *.lod (del /f /q *.lod) + $(Q) if exist *.lst (del /f /q *.lst) +endef + +else + +define PREPROCESS + @echo "CPP: $1->$2" + $(Q) $(CPP) $(CPPFLAGS) $1 -o $2 +endef + +define COMPILE + $(Q) $(CC) $(CFLAGS) `cygpath -w "$1"` +endef + +define ASSEMBLE + $(Q) $(AS) $(AFLAGS) `cygpath -w "$1"` +endef + +define MOVEOBJ + $(call MOVEFILE, "$1.obj", "$2$(DELIM)$1.obj") + $(call MOVEFILE, "$1.lst", "$2$(DELIM)$1.lst") + $(call MOVEFILE, "$1.src", "$2$(DELIM)$1.src") +endef + +define ARCHIVE + $(Q) for __obj in $(2) ; do \ + echo "AR: $$__obj"; \ + $(AR) $(ARFLAGS) $1=-+$$__obj || { echo "$(AR) $1=-+$$__obj FAILED!" ; exit 1 ; } \ + done +endef + +define CLEAN + $(Q) rm -f *.obj *.src *.lib *.hex *.lod *.lst +endef +endif + +# Windows native host tool definitions + +ifeq ($(CONFIG_WINDOWS_NATIVE),y) + HOSTCC = mingw32-gcc.exe + HOSTINCLUDES = -I. + HOSTCFLAGS = -Wall -Wstrict-prototypes -Wshadow -Wundef -g -pipe + HOSTLDFLAGS = + HOSTEXEEXT = .exe + + # Windows-native host tools + + #MKDEP = $(TOPDIR)\tools\mkdeps.exe --winnative + MKDEP = $(TOPDIR)$(DELIM)tools$(DELIM)mknulldeps.sh +else + +# Linux/Cygwin host tool definitions + + HOSTCC = gcc + HOSTINCLUDES = -I. + HOSTCFLAGS = -Wall -Wstrict-prototypes -Wshadow -Wundef -g -pipe + HOSTLDFLAGS = + + # This is the tool to use for dependencies (i.e., none) + + MKDEP = $(TOPDIR)$(DELIM)tools$(DELIM)mknulldeps.sh + + # ZDS-II cannot follow Cygwin soft links, so we will have to use directory copies + + DIRLINK = $(TOPDIR)$(DELIM)tools$(DELIM)copydir.sh + DIRUNLINK = $(TOPDIR)$(DELIM)tools$(DELIM)unlink.sh +endif diff --git a/configs/makerlisp/scripts/makerlisp.linkcmd b/configs/makerlisp/scripts/makerlisp.linkcmd new file mode 100644 index 0000000000..3be276acbc --- /dev/null +++ b/configs/makerlisp/scripts/makerlisp.linkcmd @@ -0,0 +1,94 @@ +/****************************************************************************/ +/* configs/makerlisp/scripts/makerlisp.linkcmd */ +/* */ +/* Copyright (C) 2019 Gregory Nutt. All rights reserved. */ +/* Author: Gregory Nutt */ +/* */ +/* 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. */ +/* */ +/****************************************************************************/ + +-FORMAT=OMF695,INTEL32 +-map -maxhexlen=64 -quiet -NOwarnoverlap -xref -unresolved=fatal +-sort ADDRESS=ascending -warn -NOdebug -NOigcase + +RANGE ROM $000000 : $03FFFF +RANGE RAM $B80000 : $BFFFFF +RANGE EXTIO $000000 : $00FFFF +RANGE INTIO $000000 : $0000FF + +CHANGE STRSECT is ROM + +ORDER .RESET,.IVECTS,.STARTUP,CODE,DATA +COPY DATA ROM + +DEFINE __low_romdata = copy base of DATA +DEFINE __low_data = base of DATA +DEFINE __len_data = length of DATA +DEFINE __low_bss = base of BSS +DEFINE __len_bss = length of BSS +DEFINE __stack = highaddr of RAM + 1 +DEFINE __heaptop = highaddr of RAM +DEFINE __heapbot = top of RAM + 1 +DEFINE __low_romcode = copy base of CODE +DEFINE __low_code = base of CODE +DEFINE __len_code = length of CODE +DEFINE __copy_code_to_ram = 0 +DEFINE __crtl = 1 +DEFINE __CS0_LBR_INIT_PARAM = $10 +DEFINE __CS0_UBR_INIT_PARAM = $1f +DEFINE __CS0_CTL_INIT_PARAM = $a8 +DEFINE __CS0_BMC_INIT_PARAM = $02 +DEFINE __CS1_LBR_INIT_PARAM = $c0 +DEFINE __CS1_UBR_INIT_PARAM = $c7 +DEFINE __CS1_CTL_INIT_PARAM = $28 +DEFINE __CS1_BMC_INIT_PARAM = $02 +DEFINE __CS2_LBR_INIT_PARAM = $80 +DEFINE __CS2_UBR_INIT_PARAM = $bf +DEFINE __CS2_CTL_INIT_PARAM = $28 +DEFINE __CS2_BMC_INIT_PARAM = $81 +DEFINE __CS3_LBR_INIT_PARAM = $00 +DEFINE __CS3_UBR_INIT_PARAM = $00 +DEFINE __CS3_CTL_INIT_PARAM = $00 +DEFINE __CS3_BMC_INIT_PARAM = $02 +DEFINE __RAM_CTL_INIT_PARAM = $C0 +DEFINE __RAM_ADDR_U_INIT_PARAM = $B7 +DEFINE __FLASH_CTL_INIT_PARAM = $68 +DEFINE __FLASH_ADDR_U_INIT_PARAM = $00 + +define _SYS_CLK_FREQ = 50000000 + +define _OSC_FREQ = 50000000 +define _SYS_CLK_SRC = 0 +define _OSC_FREQ_MULT = 1 +define __PLL_CTL0_INIT_PARAM = $40 + +define _zsl_g_clock_xdefine = 50000000 + +/* arch/z80/src/Makefile.zdsii will append target, object and library paths below */ + diff --git a/configs/makerlisp/src/.gitignore b/configs/makerlisp/src/.gitignore new file mode 100644 index 0000000000..4b32ec6a3d --- /dev/null +++ b/configs/makerlisp/src/.gitignore @@ -0,0 +1,10 @@ +/Make.dep +/.depend +/*.asm +/*.obj +/*.rel +/*.lst +/*.sym +/*.adb +/*.lib +/*.src diff --git a/configs/makerlisp/src/Makefile b/configs/makerlisp/src/Makefile new file mode 100644 index 0000000000..f14a81b141 --- /dev/null +++ b/configs/makerlisp/src/Makefile @@ -0,0 +1,55 @@ +############################################################################ +# configs/makerlisp/Makefile +# +# Copyright (C) 2019 Gregory Nutt. All rights reserved. +# Author: Gregory Nutt +# +# 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 + +ASRCS = +CSRCS = ez80_lowinit.c ez80_bringup.c + +ifeq ($(CONFIG_LIB_BOARDCTL),y) +CSRCS += ez80_appinit.c +endif + +ifeq ($(CONFIG_ARCH_LEDS),y) +CSRCS += ez80_leds.c +endif + +ifeq ($(CONFIG_MMCSD_SPI),y) +ifeq ($(CONFIG_EZ80_SPI),y) +CSRCS += ez80_spimmcsd.c +endif +endif + +include $(TOPDIR)/configs/Board.mk diff --git a/configs/makerlisp/src/ez80_appinit.c b/configs/makerlisp/src/ez80_appinit.c new file mode 100644 index 0000000000..7740be760d --- /dev/null +++ b/configs/makerlisp/src/ez80_appinit.c @@ -0,0 +1,94 @@ +/**************************************************************************** + * config/makerlisp/src/ez80_appinit.c + * + * Copyright (C) 2019 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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 + +#include + +#include "makerlisp.h" + +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ + +#ifndef OK +# define OK 0 +#endif + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: board_app_initialize + * + * Description: + * Perform application specific initialization. This function is never + * called directly from application code, but only indirectly via the + * (non-standard) boardctl() interface using the command BOARDIOC_INIT. + * + * Input Parameters: + * arg - The boardctl() argument is passed to the board_app_initialize() + * implementation without modification. The argument has no + * meaning to NuttX; the meaning of the argument is a contract + * between the board-specific initialization logic and the + * matching application logic. The value cold be such things as a + * mode enumeration value, a set of DIP switch switch settings, a + * pointer to configuration data read from a file or serial FLASH, + * or whatever you would like to do with it. Every implementation + * should accept zero/NULL as a default configuration. + * + * Returned Value: + * Zero (OK) is returned on success; a negated errno value is returned on + * any failure to indicate the nature of the failure. + * + ****************************************************************************/ + +int board_app_initialize(uintptr_t arg) +{ +#ifdef CONFIG_BOARD_LATE_INITIALIZE + /* Board initialization already performed by board_late_initialize() */ + + return OK; +#else + /* Perform board-specific initialization */ + + return ez80_bringup(); +#endif +} diff --git a/configs/makerlisp/src/ez80_bringup.c b/configs/makerlisp/src/ez80_bringup.c new file mode 100644 index 0000000000..9390bef025 --- /dev/null +++ b/configs/makerlisp/src/ez80_bringup.c @@ -0,0 +1,91 @@ +/**************************************************************************** + * config/makerlisp/src/ez80_bringup.c + * + * Copyright (C) 2019 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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 + +#include +#include +#include + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: ez80_bringup + * + * Description: + * Perform architecture-specific initialization + * + * CONFIG_BOARD_LATE_INITIALIZE=y : + * Called from board_late_initialize(). + * + * CONFIG_BOARD_LATE_INITIALIZE=n && CONFIG_LIB_BOARDCTL=y : + * Called from the NSH library + * + ****************************************************************************/ + +int ez80_bringup(void) +{ + int ret = OK; + +#ifdef CONFIG_FS_PROCFS + /* Mount the procfs file system */ + + ret = mount(NULL, STM32_PROCFS_MOUNTPOINT, "procfs", 0, NULL); + if (ret < 0) + { + serr("ERROR: Failed to mount procfs at %s: %d\n", + STM32_PROCFS_MOUNTPOINT, ret); + } +#endif + +#ifdef HAVE_MMCSD + /* Initialize SPI-based SD card slot */ + + ret = ez80_mmcsd_initialize(void); + if (ret < 0) + { + serr("ERROR: Failed to initialize SD card: %d\n", ret); + } +#endif + + UNUSED(ret); + return ret; +} diff --git a/configs/makerlisp/src/ez80_leds.c b/configs/makerlisp/src/ez80_leds.c new file mode 100644 index 0000000000..f19cdff18b --- /dev/null +++ b/configs/makerlisp/src/ez80_leds.c @@ -0,0 +1,98 @@ +/**************************************************************************** + * configs/makerlisp/src/ez80_leds.c + * + * Copyright (C) 2019 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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 D3 GREEN LED is driven by an eZ80 GPI/O pin. However, it has some + * additional properties: + * + * 1. On input, it will be '1' if the I/O expansion board is present. + * 2. Setting it to an output of '0' will generate a system reset. + * 3. Setting it to an output of '1' will not only illuminate the LED + * take the card out of reset and enable power to the SD card slot. + * + * As a consequence, the GREEN LED will not be illuminated if SD card + * support or SPI is disabled. The only effect of CONFIG_ARCH_LEDS is that + * the GREEN LED will turned off in the event of a crash. + */ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include + +#include +#include + +#include "up_internal.h" +#include "makerlisp.h" + +#ifdef CONFIG_ARCH_LEDS + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: board_autoled_initialize + ****************************************************************************/ + +void board_autoled_initialize(void) +{ +} + +/**************************************************************************** + * Name: board_autoled_on + ****************************************************************************/ + +void board_autoled_on(int led) +{ + if (led != 0) /* LED_ASSERTION or LED_PANIC */ + { + /* To be provided */ + } +} + +/**************************************************************************** + * Name: board_autoled_off + ****************************************************************************/ + +void board_autoled_off(int led) +{ + /* Ignored */ +} + +#endif /* CONFIG_ARCH_LEDS */ diff --git a/configs/makerlisp/src/ez80_lowinit.c b/configs/makerlisp/src/ez80_lowinit.c new file mode 100644 index 0000000000..f664c73fe5 --- /dev/null +++ b/configs/makerlisp/src/ez80_lowinit.c @@ -0,0 +1,161 @@ +/**************************************************************************** + * configs/makerlisp/src/ez80_lowinit.c + * + * Copyright (C) 2019 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * Based upon sample code included with the Zilog ZDS-II toolchain. + * + * 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 + +#include + +#include +#include + +#include "chip.h" +#include "makerlisp.h" + +/**************************************************************************** + * Public Data + ****************************************************************************/ + +bool g_ebpresent = false; /* True: I/O Expansion board is present */ + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: ez80_lowinit + * + * Description: + * All eZ80 architectures must provide the following entry point. This + * entry point is called early in the initialization -- after basic CPU + * configuration is complete but before any devices have been initialized. + * + ****************************************************************************/ + +void ez80_lowinit(void) +{ + register uint8_t regval; + + /* Port B pin 5 is set if the I/O expansion board is present */ + + regval = inp(EZ80_PB_DR); + g_ebpresent = (regval & EZ80_GPIOD5 != 0); + + /* Set Port B pin 5 as output, assert /sysreset, SD card power off */ + + regval &= ~EZ80_GPIOD5; + outp(EZ80_PB_DR, regval); + + regval = inp(EZ80_PB_ALT1); + regval &= ~EZ80_GPIOD5; + outp(EZ80_PB_ALT1, regval); + + regval = inp(EZ80_PB_ALT2); + regval &= ~EZ80_GPIOD5; + outp(EZ80_PB_ALT2, regval); + + regval = inp(EZ80_PB_DDR); + regval &= ~EZ80_GPIOD5; + outp(EZ80_PB_DDR, regval); + + /* Set port B pins 7 (MOSI), 6 (MISO), 3 (SCK), 2 (/SS) to SPI */ + + regval = inp(EZ80_PB_ALT1); + regval &= ~(EZ80_GPIOD2 | EZ80_GPIOD3 | EZ80_GPIOD6 | EZ80_GPIOD7); + outp(EZ80_PB_ALT1, regval); + + regval = inp(EZ80_PB_ALT2); + regval &= ~(EZ80_GPIOD2 | EZ80_GPIOD3 | EZ80_GPIOD6 | EZ80_GPIOD7); + outp(EZ80_PB_ALT2, regval); + + /* Set port B pin 4 as output, high - use for /CS */ + + regval = inp(EZ80_PB_DR); + regval |= EZ80_GPIOD4; + outp(EZ80_PB_DR, regval); + + regval = inp(EZ80_PB_ALT1); + regval &= ~EZ80_GPIOD4; + outp(EZ80_PB_ALT1, regval); + + regval = inp(EZ80_PB_ALT2); + regval &= ~EZ80_GPIOD4; + outp(EZ80_PB_ALT2, regval); + + regval = inp(EZ80_PB_DDR); + regval &= ~EZ80_GPIOD4; + outp(EZ80_PB_DDR, regval); + + /* Leave /sysreset asserted for a while */ + + up_udelay(150); + + /* Take the system out of reset and and turn on SD card power */ + + regval = inp(EZ80_PB_DR); + regval |= EZ80_GPIOD5; + outp(EZ80_PB_DR, regval); + + /* Wait for the SD card to power up */ + + up_udelay(750); +} + +/**************************************************************************** + * Name: board_late_initialize + * + * Description: + * If CONFIG_BOARD_LATE_INITIALIZE is selected, then an additional + * initialization call will be performed in the boot-up sequence to a + * function called board_late_initialize(). board_late_initialize() will be + * called immediately after up_initialize() is called and just before the + * initial application is started. This additional initialization phase + * may be used, for example, to initialize board-specific device drivers. + * + ****************************************************************************/ + +#ifdef CONFIG_BOARD_LATE_INITIALIZE +void board_late_initialize(void) +{ + /* Perform board-specific initialization */ + + (void)ez80_bringup(); +} +#endif diff --git a/configs/makerlisp/src/ez80_spimmcsd.c b/configs/makerlisp/src/ez80_spimmcsd.c new file mode 100644 index 0000000000..dff41eb84f --- /dev/null +++ b/configs/makerlisp/src/ez80_spimmcsd.c @@ -0,0 +1,121 @@ +/***************************************************************************** + * configs/makerlisp/src/ez80_spimmcsd.c + * + * Copyright (C) 2019 Greg Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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 + +#include +#include +#include +#include +#include +#include + +#include +#include + +#include "chip.h" +#include "ez80f91_spi.h" +#include "makerlisp.h" + +#ifdef HAVE_MMCSD + +/***************************************************************************** + * Private Functions + ****************************************************************************/ + +/* NOTE: We are using a SDCard adapter/module without Card Detect pin! + * Then we don't need to Card Detect callback here. + */ + +/***************************************************************************** + * Public Functions + ****************************************************************************/ + +/***************************************************************************** + * Name: ez80_spi1register + * + * Description: + * Registers media change callback + * + ****************************************************************************/ + +int ez80_spi1register(struct spi_dev_s *dev, spi_mediachange_t callback, + void *arg) +{ + spiinfo("INFO: Registering spi1 device\n"); + return OK; +} + +/***************************************************************************** + * Name: ez80_mmcsd_initialize + * + * Description: + * Initialize SPI-based SD card. + * + ****************************************************************************/ + +int ez80_mmcsd_initialize(void) +{ + struct spi_dev_s *spi; + int ret; + + mcinfo("INFO: Initializing mmcsd card\n"); + + /* Get/initialize the SPI interface */ + + spi = ez80_spibus_initialize(1); + if (spi == NULL) + { + mcerr("ERROR: Failed to initialize SPI\n"); + return -ENODEV; + } + + /* Register the MMC/SD block driver for slot 0 with device minor number 0. */ + + ret = mmcsd_spislotinitialize(0, 0, spi); + if (ret < 0) + { + mcerr("ERROR: Failed to bind SPI to SD slot 0\n"); + return ret; + } + + mcinfo("INFO: mmcsd card has been initialized successfully\n"); + return OK; +} + +#endif /* HAVE_MMCSD */ diff --git a/configs/makerlisp/src/makerlisp.h b/configs/makerlisp/src/makerlisp.h new file mode 100644 index 0000000000..5d0d504c44 --- /dev/null +++ b/configs/makerlisp/src/makerlisp.h @@ -0,0 +1,165 @@ +/**************************************************************************** + * arch/makerlisp/src/makerlisp.h + * + * Copyright (C) 2019 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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_MAKERLISP_SRC_MAKERLISP_H +#define _CONFIGS_MAKERLISP_SRC_MAKERLISP_H + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#ifndef __ASSEMBLY__ +# include +#endif + +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ + +/* Configuration */ + +#define HAVE_MMCSD 1 +#if !defined(CONFIG_MMCSD_SPI) || !defined(CONFIG_EZ80_SPI) +# undef HAVE_MMCSD +#endif + +/* Helpers for accessing memory mapped registers */ + +#define ez80_getreg8(a) (*(uint8_t*)(a)) +#define ez80_putreg8(v,a) (*(uint8_t*)(a) = (v)) + +/* Memory map. Board-specific extensions to the basic ez80f91 memory map + * (see arch/z80/src/ez80/ez80f91.h) + */ + /* CS0: 0x000000 256Kb of on-chip flash */ +#define EZ80_OFFCHIPFLASH 0x400000 /* CS0: Off chip flash (Up to 4Mb-256Kb) */ +#define EZ80_LEDGPIOCNTRL 0x800000 /* CS2: (See below) */ +#define EZ80_PLTFMSRAM 0xb80000 /* CS2: Platform SRAM (512Kb) */ +#define EZ80_MODULESRAM 0xc00000 /* CS1: Module SRAM (up to 2Mb) */ + /* 0xffc000 On-chip EMAC SRAM (8Kb) */ + /* 0xffe000 On-chip SRAM (8Kb) */ + +/* LED and port emulation memory register addresses */ + +/* GPIO data bit definitions */ + +#define EZ80_GPIOD0 (1 << 0) +#define EZ80_GPIOD1 (1 << 1) +#define EZ80_GPIOD2 (1 << 2) +#define EZ80_GPIOD3 (1 << 3) +#define EZ80_GPIOD4 (1 << 4) +#define EZ80_GPIOD5 (1 << 5) +#define EZ80_GPIOD6 (1 << 6) +#define EZ80_GPIOD7 (1 << 7) + +/* Modem Signals: + * + * DCD: + * The Data Carrier Detect (DCD) signal at D1 indicates that a good carrier + * signal is being received from the remove mode. + * RX: + * The RX signal at D2 indicates that data is received from the modem. + * DTR: + * The Data Terminal Ready (DTR) signal at D3 informs the modem that the PC + * is ready. + * TX: + * The TX signal at D4 indicates that data is transmitted to the modem. + */ + + /* Push buttons: + * + * PB0 SW1 Bit 0 of GPIO Port B + * PB1 SW2 Bit 1 of GPIO Port B + * PB2 SW3 Bit 2 of GPIO Port B + * RESET SW4 + */ + +#define EZ80_PB0_IRQ EZ80_PORTB0_IRQ /* Vector Oxa0 */ +#define EZ80_PB1_IRQ EZ80_PORTB1_IRQ /* Vector Oxa4 */ +#define EZ80_PB2_IRQ EZ80_PORTB2_IRQ /* Vector Oxa8 */ + +/**************************************************************************** + * Public Data + ****************************************************************************/ + +extern bool g_ebpresent; /* True: I/O Expansion board is present */ + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +#undef EXTERN +#if defined(__cplusplus) +#define EXTERN extern "C" +extern "C" +{ +#else +#define EXTERN extern +#endif + +/**************************************************************************** + * Name: ez80_bringup + * + * Description: + * Perform architecture-specific initialization + * + * CONFIG_BOARD_LATE_INITIALIZE=y : + * Called from board_late_initialize(). + * + * CONFIG_BOARD_LATE_INITIALIZE=y && CONFIG_LIB_BOARDCTL=y : + * Called from the NSH library + * + ****************************************************************************/ + +int ez80_bringup(void); + +/***************************************************************************** + * Name: ez80_mmcsd_initialize + * + * Description: + * Initialize SPI-based SD card. + * + ****************************************************************************/ + +#ifdef HAVE_MMCSD +int ez80_mmcsd_initialize(void); +#endif + +#undef EXTERN +#if defined(__cplusplus) +} +#endif + +#endif /* _CONFIGS_MAKERLISP_SRC_MAKERLISP_H */ diff --git a/configs/stm32f4discovery/src/stm32_appinit.c b/configs/stm32f4discovery/src/stm32_appinit.c index c0c0924a83..a6e9174506 100644 --- a/configs/stm32f4discovery/src/stm32_appinit.c +++ b/configs/stm32f4discovery/src/stm32_appinit.c @@ -1,7 +1,7 @@ /**************************************************************************** * config/stm32f4discovery/src/stm32_appinit.c * - * Copyright (C) 2012, 2014, 2016, 20018 Gregory Nutt. All rights reserved. + * Copyright (C) 2012, 2014, 2016, 2018 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without diff --git a/libs/libc/syslog/lib_syslog.c b/libs/libc/syslog/lib_syslog.c index 311579c5b3..60e7340b04 100644 --- a/libs/libc/syslog/lib_syslog.c +++ b/libs/libc/syslog/lib_syslog.c @@ -66,8 +66,6 @@ void vsyslog(int priority, FAR const IPTR char *fmt, va_list ap) { - va_list copy; - /* Check if this priority is enabled */ if ((g_syslog_mask & LOG_MASK(priority)) != 0) @@ -76,11 +74,10 @@ void vsyslog(int priority, FAR const IPTR char *fmt, va_list ap) * * NOTE: The va_list parameter is passed by reference. That is * because the va_list is a structure in some compilers and passing - * of structures in the NuttX sycalls does not work. + * of structures in the NuttX syscalls does not work. */ - va_copy(copy, ap); - (void)nx_vsyslog(priority, fmt, ©); + (void)nx_vsyslog(priority, fmt, &ap); } }