@@ -485,11 +485,16 @@ nuttx/
| | | | |- configs/nsh/README.txt
| | | | |- configs/poll/README.txt
| | | | `- README.txt
- | | | `- makerlisp/
- | | | |- configs/nsh_flash/README.txt
- | | | |- configs/nsh_ram/README.txt
- | | | |- configs/sdboot/README.txt
- | | | `- README.txt
+ | | | |- makerlisp/
+ | | | | |- configs/nsh_flash/README.txt
+ | | | | |- configs/nsh_ram/README.txt
+ | | | | |- configs/sdboot/README.txt
+ | | | | `- README.txt
+ | | | `- z20x/
+ | | | |- configs/nsh_flash/README.txt
+ | | | |- configs/nsh_ram/README.txt
+ | | | |- configs/sdboot/README.txt
+ | | | `- README.txt
| | |- z180/
| | | `- p112/
| | | `- README.txt
diff --git a/README.txt b/README.txt
index 940cfff273..4d870961b5 100644
--- a/README.txt
+++ b/README.txt
@@ -2197,7 +2197,12 @@ nuttx/
| | | | |- configs/nsh/README.txt
| | | | |- configs/poll/README.txt
| | | | `- README.txt
- | | | `- makerlisp/
+ | | | |- makerlisp/
+ | | | | |- configs/nsh_flash/README.txt
+ | | | | |- configs/nsh_ram/README.txt
+ | | | | |- configs/sdboot/README.txt
+ | | | | `- README.txt
+ | | | `- z80x/
| | | |- configs/nsh_flash/README.txt
| | | |- configs/nsh_ram/README.txt
| | | |- configs/sdboot/README.txt
diff --git a/boards/Kconfig b/boards/Kconfig
index 67c2cf9451..ccd1454024 100644
--- a/boards/Kconfig
+++ b/boards/Kconfig
@@ -1907,6 +1907,16 @@ config ARCH_BOARD_Z16F2800100ZCOG
development kit and the Zilog ZDS-II Windows command line tools. The
development environment is Cygwin under WinXP.
+config ARCH_BOARD_Z20X
+ bool "z20x"
+ depends on ARCH_CHIP_EZ80F92
+ ---help---
+ ez80Acclaim! Microcontroller. This port use the z80x board
+ based on an eZ80F092 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_Z80SIM
bool "Z80 Instruction Set Simulator"
depends on ARCH_CHIP_Z80
@@ -2225,6 +2235,7 @@ config ARCH_BOARD
default "viewtool-stm32f107" if ARCH_BOARD_VIEWTOOL_STM32F107
default "xmc4500-relax" if ARCH_BOARD_XMC4500RELAX
default "z16f2800100zcog" if ARCH_BOARD_Z16F2800100ZCOG
+ default "z20x" if ARCH_BOARD_Z20X
default "z80sim" if ARCH_BOARD_Z80SIM
default "z8encore000zco" if ARCH_BOARD_Z8ENCORE000ZCO
default "z8f64200100kit" if ARCH_BOARD_Z8F64200100KIT
@@ -2854,6 +2865,9 @@ endif
if ARCH_BOARD_Z8F64200100KIT
source "boards/z80/z8/z8f64200100kit/Kconfig"
endif
+if ARCH_BOARD_Z20X
+source "boards/z80/ez80/z20x/Kconfig"
+endif
if ARCH_BOARD_Z80SIM
source "boards/z80/z80/z80sim/Kconfig"
endif
diff --git a/boards/README.txt b/boards/README.txt
index 3fd2bf5812..167cd89aad 100644
--- a/boards/README.txt
+++ b/boards/README.txt
@@ -870,6 +870,10 @@ boards/z16/z16f/z16f2800100zcog
development kit and the Zilog ZDS-II Windows command line tools. The
development environment is Cygwin under WinXP.
+boards/z80/ez80/z20x
+ Microcontroller. This directory holds the port of NuttX to the z80x board
+ based on an ez80Acclaim! eZ80F091 microcontroller.
+
boards/z80/z80/z80sim
z80 Microcontroller. This port uses a Z80 instruction set simulator
called z80sim. This port also uses the SDCC toolchain
diff --git a/boards/z80/ez80/z20x/Kconfig b/boards/z80/ez80/z20x/Kconfig
new file mode 100644
index 0000000000..b324569c01
--- /dev/null
+++ b/boards/z80/ez80/z20x/Kconfig
@@ -0,0 +1,35 @@
+#
+# For a description of the syntax of this configuration file,
+# see the file kconfig-language.txt in the NuttX tools repository.
+#
+
+if ARCH_BOARD_Z20X
+
+config Z20X_VGA
+ bool "VGA Controller attached?"
+ default n
+ ---help---
+ Select this option if you have an I/O Controller and a VGA vide card
+ connected.
+
+config Z20X_COPYTORAM
+ bool "Copy to RAM"
+ default n
+ depends on BOOT_RUNFROMEXTSRAM
+ ---help---
+ This option is available only when running from external SRAM
+ (CONFIG_BOOT_RUNFROMEXTSRAM). In that case there are two possible
+ options: (1) The configuration runs entirely out of SRAM and must
+ be copied into SRAM by a boot loader. Or (2) The configuration
+ boots out of FLASH, copies itself to SRAM, and runs from SRAM. This
+ configuration setting selects that latter option.
+
+config Z20X_SDBOOT
+ bool "Build SD boot loader"
+ default n
+ ---help---
+ Select this option only with the boards/z20x/sdboot
+ configuration. This will enable the components needed only by the
+ boot loader.
+
+endif # ARCH_BOARD_Z20X
diff --git a/boards/z80/ez80/z20x/README.txt b/boards/z80/ez80/z20x/README.txt
new file mode 100644
index 0000000000..217452a191
--- /dev/null
+++ b/boards/z80/ez80/z20x/README.txt
@@ -0,0 +1,297 @@
+README.txt
+==========
+
+ Z20X is a simple expandable DIY computing system, built around the eZ80
+ microprocessor. The eZ80 was chosen due to its native simplicity and full
+ backward code compatibility with the great and very popular Z80 and Z180.
+ The design goal of Z20X is to offer a good DIY/LIY (Do-It-Yourself/Learn-
+ It-Yourself) kit for system built with through-hole components, simple
+ enough for assembly and learning in deep details, but without the
+ constraints of using only old technology ICs. In order to maintain full
+ exposure to technical details, the system also avoids using secondary
+ MCUs or programmable logic, and sticks only with true hardware solutions.
+
+
+ System Summary
+
+ eZ80 running at 20 MHz (default on board)
+ 128 KB flash ROM (internal for eZ80)
+ 520 KB total RAM on board (512K external plus 8K internal)
+ 4 MB non-volatile storage (optional, can be upgraded by changing the IC)
+ Real-time clock
+ SSD1963-powered 7.0 inch TFT display with resolution 800 x 480 pixels
+ and touch panel
+ SD card slot
+ YM2413 programmable sound generator with amplifier
+ PS/2 connectors for industry standard keyboard and mouse
+ Additionally installable processor modules
+ 72-pin expansion header with Z20X bus
+ Optional expander board with Z20X bus sockets and bonus support for
+ RC2014 bus
+
+Contents
+========
+
+ o ZDS-II Compiler Versions
+ o Serial Console
+ o LEDs and Buttons
+ - LEDs
+ - Buttons
+ o Configurations
+ - Common Configuration Notes
+ - Configuration Subdirectories
+
+ZDS-II Compiler Versions
+========================
+
+Version 5.3.3
+
+ As of this writing, this is the latest version available. This is the
+ default configured for all ez80 boards.
+
+ Compilation using version 5.3.3 was verified on February 20, 2020.
+
+Version 5.3.0
+
+ Compilation using version 5.3.0 was verified on February 19, 2020.
+
+Other Versions
+ If you use any version of ZDS-II other than 5.3.0/3 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)
+ boards/z80/ez80/z20x/scripts/Make.defs and, perhaps, (3)
+ arch/z80/src/ez80/Toolchain.defs.
+
+Serial Console
+==============
+
+ 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
+ ===============
+ PD0/TXD0/IR_IXD
+ PD1/RXD0/IR_RXD
+ PD2/RTS0
+ PD3/CTS0
+ PD4/DTR0
+ PD5/DSR0
+ PD6/DCD0
+ PD7/RIO0
+
+ PD0 and PD1 connect to the PS/2 keyboard connector.
+
+ UART 1: 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
+ ========
+ PC0/TXD1
+ PC1/RXD1
+ PC2/RTS1
+ PC3/CTS1
+ PC4/DTR1
+ PC5/DSR1
+ PC6/DCD1
+ PC7/RIO1
+
+ PC0 and PC1 connect both to the MCP2221 UART-to-USB converter and also to
+ the PS/2 mouse connector.
+
+ UART1 is the default serial console in all configurations unless
+ otherwise noted in the description of the configuration.
+
+LEDs and Buttons
+================
+
+ There are no on-board user LEDs or buttons.
+
+Configurations
+==============
+
+Common Configuration Notes
+--------------------------
+
+ 1. src/ and include/
+
+ These directories contain common logic for all z20x
+ configurations.
+
+ 2. Variations on the basic z20x configuration are maintained
+ in subdirectories. To configure any specific configuration, do the
+ following steps:
+
+ tools/configure.sh [OPTIONS] z20x:
+ 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.
+
+ When the build completes successfully, you will find this files in
+ the top level nuttx directory:
+
+ a. nuttx.hex - A loadable file in Intel HEX format
+ b. nuttx.lod - A loadable file in ZDS-II binary format
+ c. nuttx.map - A linker map file
+
+ 3. ZDS-II make be used to write the nuttx.lod file to FLASH. General
+ instructions:
+
+ a. Start ZDS-II
+ b. Open the project, for example, nsh/nsh.zdsproj
+ c. Select Debug->Connect To Target
+ d. Select Debug->Download code
+
+ There are projects for the ZiLOG Smart Flash Programmer as well but
+ these are not functional as of this writing.
+
+ 4. 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_flash, nsh_ram:
+
+ These configuration build the NuttShell (NSH). That code can be
+ found in apps/system/nsh and apps/system/nshlib.. For more
+ information see: apps/system/nsh/README.txt and
+ Documentation/NuttShell.html.
+
+ NOTES:
+
+ 1. The two configurations different only in that one builds for
+ execution entirely from FLASH and the other for execution entirely
+ from RAM. A bootloader of some kind is required to support such
+ execution from RAM! This difference is reflected in a single
+ configuration setting:
+
+ CONFIG_BOOT_RUNFROMFLASH=y # Execute from flash (default)
+ CONFIG_BOOT_RUNFROMEXTSRAM=y # Execute from external SRAM
+
+ A third configuration is possible but not formalized with its own
+ defconfig file: You can also configure the code to boot from FLASH,
+ copy the code to external SRAM, and then execute from RAM. Such a
+ configuration needs the following settings in the .config file:
+
+ CONFIG_BOOT_RUNFROMEXTSRAM=y # Execute from external SRAM
+ CONFIG_Z20X_COPYTORAM=y # Boot from FLASH but copy to SRAM
+
+ Why execute from SRAM at all? Because you will get MUCH better
+ performance because of the zero wait state SRAM implementation.
+
+ 2. The eZ80 RTC, the procFS file system, and SD card support in included.
+ The procFS file system will be auto-mounted at /proc when the board
+ boots.
+
+ The RTC can be read and set from the NSH date command.
+
+ nsh> date
+ Thu, Dec 19 20:53:29 2086
+ nsh> help date
+ date usage: date [-s "MMM DD HH:MM:SS YYYY"]
+ nsh> date -s "Jun 16 15:09:00 2019"
+ nsh> date
+ Sun, Jun 16 15:09:01 2019
+
+ When the system boots, it will probe the SD card and create a
+ block driver called mmcsd0:
+
+ nsh> ls /dev
+ /dev:
+ console
+ mmcsd0
+ null
+ ttyS0
+ nsh> mount
+ /proc type procfs
+
+ The SD card can be mounted with the following NSH mount command:
+
+ nsh> mount -t vfat /dev/mmcsd0 /mnt/sdcard
+ nsh> ls /mnt
+ /mnt:
+ sdcard/
+ nsh> mount
+ /mnt/sdcard type vfat
+ /proc type procfs
+ nsh> ls -lR /mnt/sdcard
+ /mnt/sdcard:
+ drw-rw-rw- 0 System Volume Information/
+ /mnt/sdcard/System Volume Information:
+ -rw-rw-rw- 76 IndexerVolumeGuid
+ -rw-rw-rw- 12 WPSettings.dat
+
+ You can they use the SD card as any other file system.
+
+ nsh> ls /mnt/sdcard
+ /mnt/sdcard:
+ System Volume Information/
+ nsh> echo "This is a test" >/mnt/sdcard/atest.txt
+ nsh> ls /mnt/sdcard
+ /mnt/sdcard:
+ System Volume Information/
+ atest.txt
+ nsh> cat /mnt/sdcard/atest.txt
+ This is a test
+
+ Don't forget to un-mount the volume before power cycling:
+
+ nsh> mount
+ /mnt/sdcard type vfat
+ /proc type procfs
+ nsh> umount /mnt/sdcard
+ nsh> mount
+ /proc type procfs
+
+ NOTE: The is no card detect signal so the microSD card must be
+ placed in the card slot before the system is started.
+
+ 3. Debugging the RAM version
+
+ You can debug the all RAM version using ZDS-II as follows:
+
+ a. Connect to the debugger,
+ b. Reset, Go, and Break. This will initialize the external RAM
+ c. Break and Load the nuttx.lod file
+ c. Set the PC to 0x040000
+ d. Single step a few times to make sure things look good, then
+ e. Go
+
+ 4. Optimizations:
+
+ - The stack sizes have not been tuned and, hence, are probably too
+ large.
+
+ sdboot
+
+ This configuration implements a very simple boot loader. In runs from
+ FLASH and simply initializes the external SRAM, mounts the FAT file
+ system on the SD card, and checks to see if there is a file called
+ nuttx.hex on the SD card. If so, it will load the Intel HEX file into
+ memory and jump to address 0x040000. This, of course, assumes that
+ the application's reset vector resides at address 0x040000 in external
+ SRAM.
+
+ The boot loader source is located at boards/z20x/src/sd_main.c.
diff --git a/boards/z80/ez80/z20x/configs/nsh_flash/.gitignore b/boards/z80/ez80/z20x/configs/nsh_flash/.gitignore
new file mode 100644
index 0000000000..739fb85e2e
--- /dev/null
+++ b/boards/z80/ez80/z20x/configs/nsh_flash/.gitignore
@@ -0,0 +1,6 @@
+nsh.hex
+nsh.map
+nsh.lod
+nsh.wsp
+*.asm
+Debug
diff --git a/boards/z80/ez80/z20x/configs/nsh_flash/README.txt b/boards/z80/ez80/z20x/configs/nsh_flash/README.txt
new file mode 100644
index 0000000000..f6a6791367
--- /dev/null
+++ b/boards/z80/ez80/z20x/configs/nsh_flash/README.txt
@@ -0,0 +1,13 @@
+README.txt
+^^^^^^^^^^
+
+nsh.zdsproj is a simple ZDS-II project that will allow you
+ to use the ZDS-II debugger.
+nsh.zfpproj is a simple project that will allow you to use the Smart Flash
+ Programming. NOTE: As of this writing this project does not work, probably
+ due to RAM configuration in the project. Use ZDS-II instead as is described
+ in the upper README.txt file
+nsh_flash.ztgt is the target file that accompanies the project files. This
+ one is identical to boards/scripts/z20x_ram.ztgt.
+nsh_ram.ztgt is the target file that accompanies the project files. This
+ one is identical to boards/scripts/z20x_flash.ztgt.
diff --git a/boards/z80/ez80/z20x/configs/nsh_flash/defconfig b/boards/z80/ez80/z20x/configs/nsh_flash/defconfig
new file mode 100644
index 0000000000..87fc3cc5e3
--- /dev/null
+++ b/boards/z80/ez80/z20x/configs/nsh_flash/defconfig
@@ -0,0 +1,59 @@
+#
+# 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_MMCSD_HAVE_CARDDETECT is not set
+# CONFIG_MMCSD_HAVE_WRITEPROTECT is not set
+# CONFIG_MMCSD_MMCSUPPORT is not set
+# CONFIG_SPI_CALLBACK is not set
+CONFIG_ARCH="z80"
+CONFIG_ARCH_BOARD="z20x"
+CONFIG_ARCH_BOARD_Z20X=y
+CONFIG_ARCH_CHIP="ez80"
+CONFIG_ARCH_CHIP_EZ80=y
+CONFIG_ARCH_CHIP_EZ80F92=y
+CONFIG_ARCH_STACKDUMP=y
+CONFIG_ARCH_Z80=y
+CONFIG_BOARD_LOOPSPERMSEC=1250
+CONFIG_DISABLE_MQUEUE=y
+CONFIG_EZ80_RTC=y
+CONFIG_EZ80_SPI=y
+CONFIG_EZ80_UART1=y
+CONFIG_FAT_LCNAMES=y
+CONFIG_FAT_LFN=y
+CONFIG_FS_FAT=y
+CONFIG_FS_PROCFS=y
+CONFIG_HOST_WINDOWS=y
+CONFIG_MAX_TASKS=16
+CONFIG_MAX_WDOGPARMS=2
+CONFIG_MMCSD=y
+CONFIG_MMCSD_MULTIBLOCK_DISABLE=y
+CONFIG_NFILE_DESCRIPTORS=8
+CONFIG_NFILE_STREAMS=8
+CONFIG_NSH_ARCHINIT=y
+CONFIG_NSH_DISABLE_IFUPDOWN=y
+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_RTC_ALARM=y
+CONFIG_SCHED_HPWORK=y
+CONFIG_SDCLONE_DISABLE=y
+CONFIG_SPI=y
+CONFIG_START_DAY=16
+CONFIG_START_MONTH=6
+CONFIG_START_YEAR=2019
+CONFIG_SYSTEM_NSH=y
+CONFIG_UART1_BITS=0
+CONFIG_UART1_RXBUFSIZE=192
+CONFIG_UART1_SERIAL_CONSOLE=y
+CONFIG_UART1_TXBUFSIZE=64
+CONFIG_USER_ENTRYPOINT="nsh_main"
+CONFIG_WDOG_INTRESERVE=1
diff --git a/boards/z80/ez80/z20x/configs/nsh_flash/nsh.zdsproj b/boards/z80/ez80/z20x/configs/nsh_flash/nsh.zdsproj
new file mode 100644
index 0000000000..4e2585e1dd
--- /dev/null
+++ b/boards/z80/ez80/z20x/configs/nsh_flash/nsh.zdsproj
@@ -0,0 +1,261 @@
+
+eZ80F92
+
+
+
+..\..\..\nuttx.hex
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/boards/z80/ez80/z20x/configs/nsh_flash/nsh.zfpproj b/boards/z80/ez80/z20x/configs/nsh_flash/nsh.zfpproj
new file mode 100644
index 0000000000..aba607c8fd
--- /dev/null
+++ b/boards/z80/ez80/z20x/configs/nsh_flash/nsh.zfpproj
@@ -0,0 +1,315 @@
+
+eZ80F92
+
+
+
+..\..\..\nuttx.hex
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/boards/z80/ez80/z20x/configs/nsh_flash/nsh_flash.ztgt b/boards/z80/ez80/z20x/configs/nsh_flash/nsh_flash.ztgt
new file mode 100644
index 0000000000..03c2326107
--- /dev/null
+++ b/boards/z80/ez80/z20x/configs/nsh_flash/nsh_flash.ztgt
@@ -0,0 +1,69 @@
+
+
+
+
+ true
+ 1f4
+ 8
+ 20000000
+
+ PLL
+ 20000000
+
+
+ 0
+ 140000
+ FFFF
+ true
+
+
+
+ 200000
+ false
+ 40000
+ 0BFFFF
+
+ 1
+ false
+ true
+
+
+
+
+ 0
+ 8
+ 4
+ B
+
+
+ 0
+ 0
+ 0
+ 0
+
+
+ 0
+ 0
+ 0
+ 0
+
+
+ 0
+ 0
+ 0
+ 0
+
+
+
+ 0
+ AF
+ true
+ true
+ false
+
+ 4
+
+ EZ80F92
+ 1.0.1
+ 1.00
+
diff --git a/boards/z80/ez80/z20x/configs/nsh_flash/nsh_ram.ztgt b/boards/z80/ez80/z20x/configs/nsh_flash/nsh_ram.ztgt
new file mode 100644
index 0000000000..6170e6d7df
--- /dev/null
+++ b/boards/z80/ez80/z20x/configs/nsh_flash/nsh_ram.ztgt
@@ -0,0 +1,69 @@
+
+
+
+
+ true
+ 1f4
+ 8
+ 20000000
+
+ PLL
+ 20000000
+
+
+ 0
+ 100000
+ ffff
+ true
+
+
+
+ 200000
+ false
+ 000000
+ FFFFF
+
+ 1
+ false
+ true
+
+
+
+
+ 0
+ 8
+ 0
+ 7
+
+
+ 0
+ 8
+ 8
+ F
+
+
+ 0
+ 28
+ 20
+ 9F
+
+
+ 0
+ 0
+ 0
+ 0
+
+
+
+ 0
+ AF
+ false
+ true
+ false
+
+ 4
+
+ EZ80F92
+ 1.0.1
+ 1.00
+
diff --git a/boards/z80/ez80/z20x/configs/nsh_ram/.gitignore b/boards/z80/ez80/z20x/configs/nsh_ram/.gitignore
new file mode 100644
index 0000000000..739fb85e2e
--- /dev/null
+++ b/boards/z80/ez80/z20x/configs/nsh_ram/.gitignore
@@ -0,0 +1,6 @@
+nsh.hex
+nsh.map
+nsh.lod
+nsh.wsp
+*.asm
+Debug
diff --git a/boards/z80/ez80/z20x/configs/nsh_ram/README.txt b/boards/z80/ez80/z20x/configs/nsh_ram/README.txt
new file mode 100644
index 0000000000..f6a6791367
--- /dev/null
+++ b/boards/z80/ez80/z20x/configs/nsh_ram/README.txt
@@ -0,0 +1,13 @@
+README.txt
+^^^^^^^^^^
+
+nsh.zdsproj is a simple ZDS-II project that will allow you
+ to use the ZDS-II debugger.
+nsh.zfpproj is a simple project that will allow you to use the Smart Flash
+ Programming. NOTE: As of this writing this project does not work, probably
+ due to RAM configuration in the project. Use ZDS-II instead as is described
+ in the upper README.txt file
+nsh_flash.ztgt is the target file that accompanies the project files. This
+ one is identical to boards/scripts/z20x_ram.ztgt.
+nsh_ram.ztgt is the target file that accompanies the project files. This
+ one is identical to boards/scripts/z20x_flash.ztgt.
diff --git a/boards/z80/ez80/z20x/configs/nsh_ram/defconfig b/boards/z80/ez80/z20x/configs/nsh_ram/defconfig
new file mode 100644
index 0000000000..b5d0e04d51
--- /dev/null
+++ b/boards/z80/ez80/z20x/configs/nsh_ram/defconfig
@@ -0,0 +1,60 @@
+#
+# 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_MMCSD_HAVE_CARDDETECT is not set
+# CONFIG_MMCSD_HAVE_WRITEPROTECT is not set
+# CONFIG_MMCSD_MMCSUPPORT is not set
+# CONFIG_SPI_CALLBACK is not set
+CONFIG_ARCH="z80"
+CONFIG_ARCH_BOARD="z20x"
+CONFIG_ARCH_BOARD_Z20X=y
+CONFIG_ARCH_CHIP="ez80"
+CONFIG_ARCH_CHIP_EZ80=y
+CONFIG_ARCH_CHIP_EZ80F92=y
+CONFIG_ARCH_STACKDUMP=y
+CONFIG_ARCH_Z80=y
+CONFIG_BOARD_LOOPSPERMSEC=1250
+CONFIG_BOOT_RUNFROMEXTSRAM=y
+CONFIG_DISABLE_MQUEUE=y
+CONFIG_EZ80_RTC=y
+CONFIG_EZ80_SPI=y
+CONFIG_EZ80_UART1=y
+CONFIG_FAT_LCNAMES=y
+CONFIG_FAT_LFN=y
+CONFIG_FS_FAT=y
+CONFIG_FS_PROCFS=y
+CONFIG_HOST_WINDOWS=y
+CONFIG_MAX_TASKS=16
+CONFIG_MAX_WDOGPARMS=2
+CONFIG_MMCSD=y
+CONFIG_MMCSD_MULTIBLOCK_DISABLE=y
+CONFIG_NFILE_DESCRIPTORS=8
+CONFIG_NFILE_STREAMS=8
+CONFIG_NSH_ARCHINIT=y
+CONFIG_NSH_DISABLE_IFUPDOWN=y
+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_RTC_ALARM=y
+CONFIG_SCHED_HPWORK=y
+CONFIG_SDCLONE_DISABLE=y
+CONFIG_SPI=y
+CONFIG_START_DAY=16
+CONFIG_START_MONTH=6
+CONFIG_START_YEAR=2019
+CONFIG_SYSTEM_NSH=y
+CONFIG_UART1_BITS=0
+CONFIG_UART1_RXBUFSIZE=192
+CONFIG_UART1_SERIAL_CONSOLE=y
+CONFIG_UART1_TXBUFSIZE=64
+CONFIG_USER_ENTRYPOINT="nsh_main"
+CONFIG_WDOG_INTRESERVE=1
diff --git a/boards/z80/ez80/z20x/configs/nsh_ram/nsh.zdsproj b/boards/z80/ez80/z20x/configs/nsh_ram/nsh.zdsproj
new file mode 100644
index 0000000000..f737e27bf5
--- /dev/null
+++ b/boards/z80/ez80/z20x/configs/nsh_ram/nsh.zdsproj
@@ -0,0 +1,261 @@
+
+eZ80F92
+
+
+
+..\..\..\nuttx.hex
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/boards/z80/ez80/z20x/configs/nsh_ram/nsh.zfpproj b/boards/z80/ez80/z20x/configs/nsh_ram/nsh.zfpproj
new file mode 100644
index 0000000000..aba607c8fd
--- /dev/null
+++ b/boards/z80/ez80/z20x/configs/nsh_ram/nsh.zfpproj
@@ -0,0 +1,315 @@
+
+eZ80F92
+
+
+
+..\..\..\nuttx.hex
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/boards/z80/ez80/z20x/configs/nsh_ram/nsh_flash.ztgt b/boards/z80/ez80/z20x/configs/nsh_ram/nsh_flash.ztgt
new file mode 100644
index 0000000000..03c2326107
--- /dev/null
+++ b/boards/z80/ez80/z20x/configs/nsh_ram/nsh_flash.ztgt
@@ -0,0 +1,69 @@
+
+
+
+
+ true
+ 1f4
+ 8
+ 20000000
+
+ PLL
+ 20000000
+
+
+ 0
+ 140000
+ FFFF
+ true
+
+
+
+ 200000
+ false
+ 40000
+ 0BFFFF
+
+ 1
+ false
+ true
+
+
+
+
+ 0
+ 8
+ 4
+ B
+
+
+ 0
+ 0
+ 0
+ 0
+
+
+ 0
+ 0
+ 0
+ 0
+
+
+ 0
+ 0
+ 0
+ 0
+
+
+
+ 0
+ AF
+ true
+ true
+ false
+
+ 4
+
+ EZ80F92
+ 1.0.1
+ 1.00
+
diff --git a/boards/z80/ez80/z20x/configs/nsh_ram/nsh_ram.ztgt b/boards/z80/ez80/z20x/configs/nsh_ram/nsh_ram.ztgt
new file mode 100644
index 0000000000..6170e6d7df
--- /dev/null
+++ b/boards/z80/ez80/z20x/configs/nsh_ram/nsh_ram.ztgt
@@ -0,0 +1,69 @@
+
+
+
+
+ true
+ 1f4
+ 8
+ 20000000
+
+ PLL
+ 20000000
+
+
+ 0
+ 100000
+ ffff
+ true
+
+
+
+ 200000
+ false
+ 000000
+ FFFFF
+
+ 1
+ false
+ true
+
+
+
+
+ 0
+ 8
+ 0
+ 7
+
+
+ 0
+ 8
+ 8
+ F
+
+
+ 0
+ 28
+ 20
+ 9F
+
+
+ 0
+ 0
+ 0
+ 0
+
+
+
+ 0
+ AF
+ false
+ true
+ false
+
+ 4
+
+ EZ80F92
+ 1.0.1
+ 1.00
+
diff --git a/boards/z80/ez80/z20x/configs/sdboot/.gitignore b/boards/z80/ez80/z20x/configs/sdboot/.gitignore
new file mode 100644
index 0000000000..739fb85e2e
--- /dev/null
+++ b/boards/z80/ez80/z20x/configs/sdboot/.gitignore
@@ -0,0 +1,6 @@
+nsh.hex
+nsh.map
+nsh.lod
+nsh.wsp
+*.asm
+Debug
diff --git a/boards/z80/ez80/z20x/configs/sdboot/README.txt b/boards/z80/ez80/z20x/configs/sdboot/README.txt
new file mode 100644
index 0000000000..2da9c46215
--- /dev/null
+++ b/boards/z80/ez80/z20x/configs/sdboot/README.txt
@@ -0,0 +1,13 @@
+README.txt
+^^^^^^^^^^
+
+sdboot.zdsproj is a simple ZDS-II project that will allow you
+ to use the ZDS-II debugger.
+sdboot.zfpproj is a simple project that will allow you to use the Smart Flash
+ Programming. NOTE: As of this writing this project does not work, probably
+ due to RAM configuration in the project. Use ZDS-II instead as is described
+ in the upper README.txt file
+sdboot_flash.ztgt is the target file that accompanies the project files. This
+ one is identical to boards/scripts/z20x_ram.ztgt.
+sdboot_ram.ztgt is the target file that accompanies the project files. This
+ one is identical to boards/scripts/z20x_flash.ztgt.
diff --git a/boards/z80/ez80/z20x/configs/sdboot/defconfig b/boards/z80/ez80/z20x/configs/sdboot/defconfig
new file mode 100644
index 0000000000..06d42657b0
--- /dev/null
+++ b/boards/z80/ez80/z20x/configs/sdboot/defconfig
@@ -0,0 +1,52 @@
+#
+# 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_MMCSD_HAVE_CARDDETECT is not set
+# CONFIG_MMCSD_HAVE_WRITEPROTECT is not set
+# CONFIG_MMCSD_MMCSUPPORT is not set
+# CONFIG_SPI_CALLBACK is not set
+CONFIG_ARCH="z80"
+CONFIG_ARCH_BOARD="z20x"
+CONFIG_ARCH_BOARD_Z20X=y
+CONFIG_ARCH_CHIP="ez80"
+CONFIG_ARCH_CHIP_EZ80=y
+CONFIG_ARCH_CHIP_EZ80F92=y
+CONFIG_ARCH_STACKDUMP=y
+CONFIG_ARCH_Z80=y
+CONFIG_BOARD_LOOPSPERMSEC=1250
+CONFIG_DISABLE_MQUEUE=y
+CONFIG_EZ80_SPI=y
+CONFIG_EZ80_UART1=y
+CONFIG_FAT_LCNAMES=y
+CONFIG_FAT_LFN=y
+CONFIG_FS_FAT=y
+CONFIG_HOST_WINDOWS=y
+CONFIG_LIB_HEX2BIN=y
+CONFIG_Z20X_SDBOOT=y
+CONFIG_MAX_TASKS=8
+CONFIG_MAX_WDOGPARMS=2
+CONFIG_MMCSD=y
+CONFIG_MMCSD_MULTIBLOCK_DISABLE=y
+CONFIG_NFILE_DESCRIPTORS=6
+CONFIG_NFILE_STREAMS=6
+CONFIG_PREALLOC_TIMERS=4
+CONFIG_PREALLOC_WDOGS=4
+CONFIG_PTHREAD_STACK_DEFAULT=1024
+CONFIG_RAM_SIZE=65536
+CONFIG_RR_INTERVAL=200
+CONFIG_SCHED_HPWORK=y
+CONFIG_SDCLONE_DISABLE=y
+CONFIG_SPI=y
+CONFIG_START_DAY=26
+CONFIG_START_MONTH=6
+CONFIG_START_YEAR=2019
+CONFIG_UART1_BITS=0
+CONFIG_UART1_RXBUFSIZE=192
+CONFIG_UART1_SERIAL_CONSOLE=y
+CONFIG_UART1_TXBUFSIZE=64
+CONFIG_USER_ENTRYPOINT="sd_main"
+CONFIG_WDOG_INTRESERVE=1
diff --git a/boards/z80/ez80/z20x/configs/sdboot/sdboot.zdsproj b/boards/z80/ez80/z20x/configs/sdboot/sdboot.zdsproj
new file mode 100644
index 0000000000..70f4367f19
--- /dev/null
+++ b/boards/z80/ez80/z20x/configs/sdboot/sdboot.zdsproj
@@ -0,0 +1,261 @@
+
+eZ80F92
+
+
+
+..\..\..\nuttx.hex
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/boards/z80/ez80/z20x/configs/sdboot/sdboot.zfpproj b/boards/z80/ez80/z20x/configs/sdboot/sdboot.zfpproj
new file mode 100644
index 0000000000..934be464d8
--- /dev/null
+++ b/boards/z80/ez80/z20x/configs/sdboot/sdboot.zfpproj
@@ -0,0 +1,315 @@
+
+eZ80F92
+
+
+
+..\..\..\nuttx.hex
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/boards/z80/ez80/z20x/configs/sdboot/sdboot_flash.ztgt b/boards/z80/ez80/z20x/configs/sdboot/sdboot_flash.ztgt
new file mode 100644
index 0000000000..03c2326107
--- /dev/null
+++ b/boards/z80/ez80/z20x/configs/sdboot/sdboot_flash.ztgt
@@ -0,0 +1,69 @@
+
+
+
+
+ true
+ 1f4
+ 8
+ 20000000
+
+ PLL
+ 20000000
+
+
+ 0
+ 140000
+ FFFF
+ true
+
+
+
+ 200000
+ false
+ 40000
+ 0BFFFF
+
+ 1
+ false
+ true
+
+
+
+
+ 0
+ 8
+ 4
+ B
+
+
+ 0
+ 0
+ 0
+ 0
+
+
+ 0
+ 0
+ 0
+ 0
+
+
+ 0
+ 0
+ 0
+ 0
+
+
+
+ 0
+ AF
+ true
+ true
+ false
+
+ 4
+
+ EZ80F92
+ 1.0.1
+ 1.00
+
diff --git a/boards/z80/ez80/z20x/configs/sdboot/sdboot_ram.ztgt b/boards/z80/ez80/z20x/configs/sdboot/sdboot_ram.ztgt
new file mode 100644
index 0000000000..6170e6d7df
--- /dev/null
+++ b/boards/z80/ez80/z20x/configs/sdboot/sdboot_ram.ztgt
@@ -0,0 +1,69 @@
+
+
+
+
+ true
+ 1f4
+ 8
+ 20000000
+
+ PLL
+ 20000000
+
+
+ 0
+ 100000
+ ffff
+ true
+
+
+
+ 200000
+ false
+ 000000
+ FFFFF
+
+ 1
+ false
+ true
+
+
+
+
+ 0
+ 8
+ 0
+ 7
+
+
+ 0
+ 8
+ 8
+ F
+
+
+ 0
+ 28
+ 20
+ 9F
+
+
+ 0
+ 0
+ 0
+ 0
+
+
+
+ 0
+ AF
+ false
+ true
+ false
+
+ 4
+
+ EZ80F92
+ 1.0.1
+ 1.00
+
diff --git a/boards/z80/ez80/z20x/include/board.h b/boards/z80/ez80/z20x/include/board.h
new file mode 100644
index 0000000000..71016b66d2
--- /dev/null
+++ b/boards/z80/ez80/z20x/include/board.h
@@ -0,0 +1,91 @@
+/****************************************************************************
+ * boards/z80/ez80/z20x/include/board.h
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership. The
+ * ASF licenses this file to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ *
+ ****************************************************************************/
+
+#ifndef __BOARDS_Z80_EZ80_Z20X_INCLUDE_BOARD_H
+#define __BOARDS_Z80_EZ80_Z20X_INCLUDE_BOARD_H
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include
+
+/****************************************************************************
+ * Pre-processor Definitions
+ ****************************************************************************/
+
+/* Clocking
+ *
+ * The z20x CPU board has a 20Mhz crystal. The eZ80F92 has no PLL; the
+ * system clock frequency is equal to the crystal frequency of 20MHz, the
+ * maximum for the eZ80F92 part.
+ */
+
+#define EZ80_SYS_CLK_FREQ 20000000
+
+/* 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 0
+#define LED_SIGNAL 0
+#define LED_PANIC 1
+
+/* Button definitions
+ * The z20x 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 /* __BOARDS_Z80_EZ80_Z20X_INCLUDE_BOARD_H */
diff --git a/boards/z80/ez80/z20x/scripts/Make.defs b/boards/z80/ez80/z20x/scripts/Make.defs
new file mode 100644
index 0000000000..fc654f489a
--- /dev/null
+++ b/boards/z80/ez80/z20x/scripts/Make.defs
@@ -0,0 +1,223 @@
+############################################################################
+# boards/z80/ez80/z20x/scripts/Make.defs
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership. The
+# ASF licenses this file to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance with the
+# License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations
+# under the License.
+#
+############################################################################
+
+include $(TOPDIR)/.config
+include $(TOPDIR)/tools/Config.mk
+include ${TOPDIR}/arch/z80/src/ez80/Toolchain.defs
+
+# CFLAGS
+
+ifeq ($(CONFIG_WINDOWS_NATIVE),y)
+ ARCHASMINCLUDES = -include:$(TOPDIR)\include;$(ZDSSTDINCDIR);$(ZDSZILOGINCDIR)
+ EARCHASMINCLUDES = -include:$(TOPDIR)\include;$(ZDSSTDINCDIR);$(ZDSZILOGINCDIR)
+ ARCHSTDINCLUDES = -stdinc:$(TOPDIR)\include;$(ZDSSTDINCDIR);$(ZDSZILOGINCDIR)
+ ARCHUSRINCLUDES = -usrinc:.
+else
+ 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_EZ80F92),y)
+ ARCHCPU = eZ80F92
+ ARCHCPUDEF = _EZ80F92
+ ARCHFAMILY = _EZ80ACCLAIM!
+else 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
+
+ifeq ($(CONFIG_BOOT_RUNFROMFLASH),y)
+ LDSCRIPT = z20x_flash.linkcmd
+else ifeq ($(CONFIG_Z20X_COPYTORAM),y)
+ LDSCRIPT = z20x_copytoram.linkcmd
+else # ifeq ($(CONFIG_BOOT_RUNFROMEXTSRAM),y)
+ LDSCRIPT = z20x_ram.linkcmd
+endif
+
+LINKCMDTEMPLATE = $(TOPDIR)$(DELIM)boards$(DELIM)$(CONFIG_ARCH)$(DELIM)$(CONFIG_ARCH_CHIP)$(DELIM)$(CONFIG_ARCH_BOARD)$(DELIM)scripts$(DELIM)$(LDSCRIPT)
+
+# 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) $($(strip $1)_CPPFLAGS) $1 -o $2
+endef
+
+define COMPILE
+ $(Q) $(CC) $(CFLAGS) $($(strip $1)_CFLAGS) ${shell echo $1 | sed -e "s/\//\\/g"}
+endef
+
+define ASSEMBLE
+ $(Q) $(AS) $(AFLAGS) $($(strip $1)_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
+ 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) $($(strip $1)_CPPFLAGS) $1 -o $2
+endef
+
+define COMPILE
+ $(Q) $(CC) $(CFLAGS) $($(strip $1)_CFLAGS) `cygpath -w "$1"`
+endef
+
+define ASSEMBLE
+ $(Q) $(AS) $(AFLAGS) $($(strip $1)_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
+ for __obj in $(2) ; do \
+ $(AR) $(ARFLAGS) $1=-+$$__obj \
+ 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/boards/z80/ez80/z20x/scripts/z20x_copytoram.linkcmd b/boards/z80/ez80/z20x/scripts/z20x_copytoram.linkcmd
new file mode 100644
index 0000000000..2c50296978
--- /dev/null
+++ b/boards/z80/ez80/z20x/scripts/z20x_copytoram.linkcmd
@@ -0,0 +1,75 @@
+/*****************************************************************************/
+/* boards/z80/ez80/z20x/scripts/z20x_copytoram.linkcmd */
+/* For configurations booting from flash but otherwise running out of RAM */
+/* */
+/* Licensed to the Apache Software Foundation (ASF) under one or more */
+/* contributor license agreements. See the NOTICE file distributed with */
+/* this work for additional information regarding copyright ownership. The */
+/* ASF licenses this file to you under the Apache License, Version 2.0 (the */
+/* "License"); you may not use this file except in compliance with the */
+/* License. You may obtain a copy of the License at */
+/* */
+/* http://www.apache.org/licenses/LICENSE-2.0 */
+/* */
+/* Unless required by applicable law or agreed to in writing, software */
+/* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT */
+/* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the */
+/* License for the specific language governing permissions and limitations */
+/* under the License. */
+/* */
+/*****************************************************************************/
+
+-FORMAT=OMF695,INTEL32
+-map -maxhexlen=64 -quiet -warnoverlap -xref -unresolved=fatal
+-sort NAME=ascending -warn -debug -NOigcase
+
+RANGE ROM $000000 : $03FFFF
+RANGE RAM $040000 : $0BFFFF
+RANGE EXTIO $000000 : $00FFFF
+RANGE INTIO $000000 : $0000FF
+
+CHANGE TEXT is CODE
+CHANGE CODE is RAM
+CHANGE STRSECT is CODE
+ORDER .RESET,.IVECTS,.STARTUP,CODE,DATA
+COPY CODE ROM
+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 = 1
+DEFINE __crtl = 1
+
+DEFINE __CS0_LBR_INIT_PARAM = $04
+DEFINE __CS0_UBR_INIT_PARAM = $0b
+DEFINE __CS0_CTL_INIT_PARAM = $08
+DEFINE __CS0_BMC_INIT_PARAM = $00
+DEFINE __CS1_LBR_INIT_PARAM = $00
+DEFINE __CS1_UBR_INIT_PARAM = $00
+DEFINE __CS1_CTL_INIT_PARAM = $00
+DEFINE __CS1_BMC_INIT_PARAM = $00
+DEFINE __CS2_LBR_INIT_PARAM = $00
+DEFINE __CS2_UBR_INIT_PARAM = $00
+DEFINE __CS2_CTL_INIT_PARAM = $00
+DEFINE __CS2_BMC_INIT_PARAM = $00
+DEFINE __CS3_LBR_INIT_PARAM = $00
+DEFINE __CS3_UBR_INIT_PARAM = $00
+DEFINE __CS3_CTL_INIT_PARAM = $00
+DEFINE __CS3_BMC_INIT_PARAM = $00
+DEFINE __RAM_CTL_INIT_PARAM = $80
+DEFINE __RAM_ADDR_U_INIT_PARAM = $AF
+DEFINE __FLASH_CTL_INIT_PARAM = $88
+DEFINE __FLASH_ADDR_U_INIT_PARAM = $00
+
+define _SYS_CLK_FREQ = 20000000
+
+/* arch/z80/src/Makefile.zdsii will append target, object and library paths below */
diff --git a/boards/z80/ez80/z20x/scripts/z20x_flash.linkcmd b/boards/z80/ez80/z20x/scripts/z20x_flash.linkcmd
new file mode 100644
index 0000000000..a7b6ad9c4c
--- /dev/null
+++ b/boards/z80/ez80/z20x/scripts/z20x_flash.linkcmd
@@ -0,0 +1,74 @@
+/*****************************************************************************/
+/* boards/z80/ez80/z20x/scripts/z20x_flash.linkcmd */
+/* For configurations running entirely out of FLASH */
+/* */
+/* Licensed to the Apache Software Foundation (ASF) under one or more */
+/* contributor license agreements. See the NOTICE file distributed with */
+/* this work for additional information regarding copyright ownership. The */
+/* ASF licenses this file to you under the Apache License, Version 2.0 (the */
+/* "License"); you may not use this file except in compliance with the */
+/* License. You may obtain a copy of the License at */
+/* */
+/* http://www.apache.org/licenses/LICENSE-2.0 */
+/* */
+/* Unless required by applicable law or agreed to in writing, software */
+/* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT */
+/* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the */
+/* License for the specific language governing permissions and limitations */
+/* under the License. */
+/* */
+/*****************************************************************************/
+
+-FORMAT=OMF695,INTEL32
+-map -maxhexlen=64 -quiet -warnoverlap -xref -unresolved=fatal
+-sort NAME=ascending -warn -debug -NOigcase
+
+RANGE ROM $000000 : $03FFFF
+RANGE RAM $040000 : $0BFFFF
+RANGE EXTIO $000000 : $00FFFF
+RANGE INTIO $000000 : $0000FF
+
+CHANGE TEXT is CODE
+CHANGE STRSECT is CODE
+
+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 = $04
+DEFINE __CS0_UBR_INIT_PARAM = $0b
+DEFINE __CS0_CTL_INIT_PARAM = $08
+DEFINE __CS0_BMC_INIT_PARAM = $00
+DEFINE __CS1_LBR_INIT_PARAM = $00
+DEFINE __CS1_UBR_INIT_PARAM = $00
+DEFINE __CS1_CTL_INIT_PARAM = $00
+DEFINE __CS1_BMC_INIT_PARAM = $00
+DEFINE __CS2_LBR_INIT_PARAM = $00
+DEFINE __CS2_UBR_INIT_PARAM = $00
+DEFINE __CS2_CTL_INIT_PARAM = $00
+DEFINE __CS2_BMC_INIT_PARAM = $00
+DEFINE __CS3_LBR_INIT_PARAM = $00
+DEFINE __CS3_UBR_INIT_PARAM = $00
+DEFINE __CS3_CTL_INIT_PARAM = $00
+DEFINE __CS3_BMC_INIT_PARAM = $00
+DEFINE __RAM_CTL_INIT_PARAM = $80
+DEFINE __RAM_ADDR_U_INIT_PARAM = $AF
+DEFINE __FLASH_CTL_INIT_PARAM = $88
+DEFINE __FLASH_ADDR_U_INIT_PARAM = $00
+
+define _SYS_CLK_FREQ = 20000000
+
+/* arch/z80/src/Makefile.zdsii will append target, object and library paths below */
diff --git a/boards/z80/ez80/z20x/scripts/z20x_flash.ztgt b/boards/z80/ez80/z20x/scripts/z20x_flash.ztgt
new file mode 100644
index 0000000000..b691cd5102
--- /dev/null
+++ b/boards/z80/ez80/z20x/scripts/z20x_flash.ztgt
@@ -0,0 +1,69 @@
+
+
+
+
+ true
+ 1f4
+ 8
+ 20000000
+
+ PLL
+ 20000000
+
+
+ 0
+ 140000
+ FFFF
+ true
+
+
+
+ 200000
+ false
+ 040000
+ 0BFFFF
+
+ 1
+ false
+ true
+
+
+
+
+ 0
+ 8
+ 4
+ B
+
+
+ 0
+ 0
+ 0
+ 0
+
+
+ 0
+ 0
+ 0
+ 0
+
+
+ 0
+ 0
+ 0
+ 0
+
+
+
+ 0
+ AF
+ true
+ true
+ false
+
+ 4
+
+ EZ80F92
+ 1.0.1
+ 1.00
+
diff --git a/boards/z80/ez80/z20x/scripts/z20x_ram.linkcmd b/boards/z80/ez80/z20x/scripts/z20x_ram.linkcmd
new file mode 100644
index 0000000000..ad4c1b36d7
--- /dev/null
+++ b/boards/z80/ez80/z20x/scripts/z20x_ram.linkcmd
@@ -0,0 +1,75 @@
+/*****************************************************************************/
+/* boards/z80/ez80/z20x/scripts/z20x_ram.linkcmd */
+/* For configurations running entirely out of RAM with nothing in FLASH */
+/* */
+/* Licensed to the Apache Software Foundation (ASF) under one or more */
+/* contributor license agreements. See the NOTICE file distributed with */
+/* this work for additional information regarding copyright ownership. The */
+/* ASF licenses this file to you under the Apache License, Version 2.0 (the */
+/* "License"); you may not use this file except in compliance with the */
+/* License. You may obtain a copy of the License at */
+/* */
+/* http://www.apache.org/licenses/LICENSE-2.0 */
+/* */
+/* Unless required by applicable law or agreed to in writing, software */
+/* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT */
+/* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the */
+/* License for the specific language governing permissions and limitations */
+/* under the License. */
+/* */
+/*****************************************************************************/
+
+-FORMAT=OMF695,INTEL32
+-map -maxhexlen=64 -quiet -warnoverlap -xref -unresolved=fatal
+-sort NAME=ascending -warn -debug -NOigcase
+
+RANGE ROM $000000 : $03FFFF
+RANGE RAM $040000 : $0BFFFF
+RANGE EXTIO $000000 : $00FFFF
+RANGE INTIO $000000 : $0000FF
+
+CHANGE .RESET is RAM
+CHANGE .STARTUP is RAM
+CHANGE TEXT is CODE
+CHANGE CODE is RAM
+CHANGE STRSECT is CODE
+ORDER .RESET,.IVECTS,.STARTUP,CODE,DATA
+
+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 = $04
+DEFINE __CS0_UBR_INIT_PARAM = $0b
+DEFINE __CS0_CTL_INIT_PARAM = $08
+DEFINE __CS0_BMC_INIT_PARAM = $00
+DEFINE __CS1_LBR_INIT_PARAM = $00
+DEFINE __CS1_UBR_INIT_PARAM = $00
+DEFINE __CS1_CTL_INIT_PARAM = $00
+DEFINE __CS1_BMC_INIT_PARAM = $00
+DEFINE __CS2_LBR_INIT_PARAM = $00
+DEFINE __CS2_UBR_INIT_PARAM = $00
+DEFINE __CS2_CTL_INIT_PARAM = $00
+DEFINE __CS2_BMC_INIT_PARAM = $00
+DEFINE __CS3_LBR_INIT_PARAM = $00
+DEFINE __CS3_UBR_INIT_PARAM = $00
+DEFINE __CS3_CTL_INIT_PARAM = $00
+DEFINE __CS3_BMC_INIT_PARAM = $00
+DEFINE __RAM_CTL_INIT_PARAM = $80
+DEFINE __RAM_ADDR_U_INIT_PARAM = $AF
+DEFINE __FLASH_CTL_INIT_PARAM = $88
+DEFINE __FLASH_ADDR_U_INIT_PARAM = $00
+
+define _SYS_CLK_FREQ = 20000000
+
+/* arch/z80/src/Makefile.zdsii will append target, object and library paths below */
diff --git a/boards/z80/ez80/z20x/scripts/z20x_ram.ztgt b/boards/z80/ez80/z20x/scripts/z20x_ram.ztgt
new file mode 100644
index 0000000000..8f78f6b941
--- /dev/null
+++ b/boards/z80/ez80/z20x/scripts/z20x_ram.ztgt
@@ -0,0 +1,69 @@
+
+
+
+
+ true
+ 1f4
+ 8
+ 20000000
+
+ PLL
+ 20000000
+
+
+ 0
+ 100000
+ ffff
+ true
+
+
+
+ 200000
+ false
+ 000000
+ FFFFF
+
+ 1
+ false
+ true
+
+
+
+
+ 0
+ 8
+ 0
+ 7
+
+
+ 0
+ 0
+ 0
+ 0
+
+
+ 0
+ 0
+ 0
+ 0
+
+
+ 0
+ 0
+ 0
+ 0
+
+
+
+ 0
+ AF
+ false
+ true
+ false
+
+ 4
+
+ EZ80F92
+ 1.0.1
+ 1.00
+
diff --git a/boards/z80/ez80/z20x/src/.gitignore b/boards/z80/ez80/z20x/src/.gitignore
new file mode 100644
index 0000000000..4b32ec6a3d
--- /dev/null
+++ b/boards/z80/ez80/z20x/src/.gitignore
@@ -0,0 +1,10 @@
+/Make.dep
+/.depend
+/*.asm
+/*.obj
+/*.rel
+/*.lst
+/*.sym
+/*.adb
+/*.lib
+/*.src
diff --git a/boards/z80/ez80/z20x/src/Makefile b/boards/z80/ez80/z20x/src/Makefile
new file mode 100644
index 0000000000..0c4b3af292
--- /dev/null
+++ b/boards/z80/ez80/z20x/src/Makefile
@@ -0,0 +1,41 @@
+############################################################################
+# boards/z80/ez80/z20x/Makefile
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership. The
+# ASF licenses this file to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance with the
+# License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations
+# under the License.
+#
+############################################################################
+
+-include $(TOPDIR)/Make.defs
+
+ASRCS =
+CSRCS = ez80_boot.c ez80_bringup.c
+
+ifeq ($(CONFIG_LIB_BOARDCTL),y)
+CSRCS += ez80_appinit.c
+endif
+
+ifeq ($(CONFIG_EZ80_SPI),y)
+CSRCS += ez80_spi.c
+ifeq ($(CONFIG_MMCSD_SPI),y)
+CSRCS += ez80_spimmcsd.c
+endif
+endif
+
+ifeq ($(CONFIG_Z20X_SDBOOT),y)
+CSRCS += sd_main.c
+endif
+
+include $(TOPDIR)/boards/Board.mk
diff --git a/boards/z80/ez80/z20x/src/ez80_appinit.c b/boards/z80/ez80/z20x/src/ez80_appinit.c
new file mode 100644
index 0000000000..5c4add99c8
--- /dev/null
+++ b/boards/z80/ez80/z20x/src/ez80_appinit.c
@@ -0,0 +1,79 @@
+/****************************************************************************
+ * boards/z80/ez80/z20x/src/ez80_appinit.c
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership. The
+ * ASF licenses this file to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ *
+ ****************************************************************************/
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include
+
+#include
+
+#include "z20x.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/boards/z80/ez80/z20x/src/ez80_boot.c b/boards/z80/ez80/z20x/src/ez80_boot.c
new file mode 100644
index 0000000000..0d3b13c14d
--- /dev/null
+++ b/boards/z80/ez80/z20x/src/ez80_boot.c
@@ -0,0 +1,79 @@
+/****************************************************************************
+ * boards/z80/ez80/z20x/src/ez80_boot.c
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership. The
+ * ASF licenses this file to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ *
+ ****************************************************************************/
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include
+
+#include
+
+#include
+#include
+
+#include "chip.h"
+#include "z80_internal.h"
+#include "z20x.h"
+
+/****************************************************************************
+ * Public Functions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Name: ez80_board_initialize
+ *
+ * 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_board_initialize(void)
+{
+#ifdef CONFIG_EZ80_SPI
+ /* Initialize SPI chip selects */
+
+ ez80_spidev_initialize();
+#endif
+}
+
+/****************************************************************************
+ * 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 */
+
+ ez80_bringup();
+}
+#endif
diff --git a/boards/z80/ez80/z20x/src/ez80_bringup.c b/boards/z80/ez80/z20x/src/ez80_bringup.c
new file mode 100644
index 0000000000..565bfe4f40
--- /dev/null
+++ b/boards/z80/ez80/z20x/src/ez80_bringup.c
@@ -0,0 +1,77 @@
+/****************************************************************************
+ * boards/z80/ez80/z20x/src/ez80_bringup.c
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership. The
+ * ASF licenses this file to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ *
+ ****************************************************************************/
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include
+
+#include
+#include
+#include
+
+#include "z20x.h"
+
+/****************************************************************************
+ * 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, "/proc", "procfs", 0, NULL);
+ if (ret < 0)
+ {
+ syslog(LOG_ERR, "ERROR: Failed to mount procfs at /proc: %d\n", ret);
+ }
+#endif
+
+#ifdef HAVE_MMCSD
+ /* Initialize SPI-based SD card slot */
+
+ ret = ez80_mmcsd_initialize();
+ if (ret < 0)
+ {
+ syslog(LOG_ERR, "ERROR: Failed to initialize SD card: %d\n", ret);
+ }
+#endif
+
+ UNUSED(ret);
+ return ret;
+}
diff --git a/boards/z80/ez80/z20x/src/ez80_spi.c b/boards/z80/ez80/z20x/src/ez80_spi.c
new file mode 100644
index 0000000000..90d16ccb5f
--- /dev/null
+++ b/boards/z80/ez80/z20x/src/ez80_spi.c
@@ -0,0 +1,151 @@
+/*****************************************************************************
+ * boards/z80/ez80/z20x/src/ez80_spi.c
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership. The
+ * ASF licenses this file to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ *
+ ****************************************************************************/
+
+/*****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include
+
+#include
+
+#include
+
+#include "chip.h"
+#include "z80_internal.h"
+#include "ez80f91_spi.h"
+#include "z20x.h"
+
+/*****************************************************************************
+ * 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_spidev_initialize
+ *
+ * Description:
+ * Called to configure SPI chip select GPIO pins for the z20x board.
+ *
+ ****************************************************************************/
+
+void ez80_spidev_initialize(void)
+{
+#ifdef HAVE_MMCSD
+ uint8_t regval;
+
+ /* MMC/SD CS: Port PB2/nSS as output */
+
+ regval = inp(EZ80_PB_DR);
+ regval |= EZ80_GPIOD2;
+ outp(EZ80_PB_DR, regval);
+
+ regval = inp(EZ80_PB_ALT1);
+ regval &= ~EZ80_GPIOD2;
+ outp(EZ80_PB_ALT1, regval);
+
+ regval = inp(EZ80_PB_ALT2);
+ regval &= ~EZ80_GPIOD2;
+ outp(EZ80_PB_ALT2, regval);
+
+ regval = inp(EZ80_PB_DDR);
+ regval &= ~EZ80_GPIOD2;
+ outp(EZ80_PB_DDR, regval);
+#endif
+}
+
+/*****************************************************************************
+ * The external functions, ez80_spiselect, ez80_spistatus, and
+ * ez80_spicmddata must be provided by board-specific logic. These are
+ * implementations of the select, status, and cmddata methods of the SPI
+ * interface defined by struct spi_ops_s (see include/nuttx/spi/spi.h). All
+ * other methods (including ez80_spibus_initialize()) are provided by common
+ * logic. To use this common SPI logic on your board:
+ *
+ * 1. Provide ez80_spiselect() and ez80_spistatus() functions in your
+ * board-specific logic. This function will perform chip selection and
+ * status operations using GPIOs in the way your board is configured.
+ * 2. If CONFIG_SPI_CMDDATA is defined in your NuttX configuration, provide
+ * the ez80_spiscmddata() function in your board-specific logic. This
+ * function will perform cmd/data selection operations using GPIOs in
+ * the way your board is configured.
+ * 3. Add a call to ez80_spibus_initialize() in your low level
+ * initialization logic
+ * 4. The handle returned by ez80_spibus_initialize() may then be used to
+ * bind the SPI driver to higher level logic (e.g., calling
+ * mmcsd_spislotinitialize(), for example, will bind the SPI driver to
+ * the SPI MMC/SD driver).
+ *
+ ****************************************************************************/
+
+void ez80_spiselect(FAR struct spi_dev_s *dev, uint32_t devid, bool selected)
+{
+#ifdef HAVE_MMCSD
+ if (devid == SPIDEV_MMCSD(0))
+ {
+ uint8_t regval;
+
+ /* Set PB2/nSS output */
+
+ regval = inp(EZ80_PB_DR);
+
+ if (selected)
+ {
+ regval &= ~EZ80_GPIOD2;
+ }
+ else
+ {
+ regval |= EZ80_GPIOD2;
+ }
+
+ outp(EZ80_PB_DR, regval);
+ }
+#endif
+}
+
+uint8_t ez80_spistatus(FAR struct spi_dev_s *dev, uint32_t devid)
+{
+ uint8_t status = 0;
+
+#ifdef HAVE_MMCSD
+ if (devid == SPIDEV_MMCSD(0))
+ {
+ /* No card detect pin.. Always claim that the card is present in
+ * slot 0
+ */
+
+ status |= SPI_STATUS_PRESENT;
+ }
+#endif
+
+ return status;
+}
+
+int ez80_spicmddata(FAR struct spi_dev_s *dev, uint32_t devid, bool cmd)
+{
+ return -ENODEV;
+}
diff --git a/boards/z80/ez80/z20x/src/ez80_spimmcsd.c b/boards/z80/ez80/z20x/src/ez80_spimmcsd.c
new file mode 100644
index 0000000000..86938c4da4
--- /dev/null
+++ b/boards/z80/ez80/z20x/src/ez80_spimmcsd.c
@@ -0,0 +1,94 @@
+/*****************************************************************************
+ * boards/z80/ez80/z20x/src/ez80_spimmcsd.c
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership. The
+ * ASF licenses this file to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ *
+ ****************************************************************************/
+
+/*****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include
+
+#include
+#include
+#include
+#include
+#include
+
+#include
+#include
+
+#include "chip.h"
+#include "ez80f91_spi.h"
+#include "z20x.h"
+
+#ifdef HAVE_MMCSD
+
+/*****************************************************************************
+ * Private Functions
+ ****************************************************************************/
+
+/* NOTES:
+ *
+ * 1. We are using a SDCard adapter/module without Card Detect pin!
+ * Then we don't need to Card Detect callback here.
+ * 2. Media Change callbacks are not yet implemented in the SPI driver.
+ */
+
+/*****************************************************************************
+ * Public Functions
+ ****************************************************************************/
+
+/*****************************************************************************
+ * 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/boards/z80/ez80/z20x/src/sd_main.c b/boards/z80/ez80/z20x/src/sd_main.c
new file mode 100644
index 0000000000..93961cba53
--- /dev/null
+++ b/boards/z80/ez80/z20x/src/sd_main.c
@@ -0,0 +1,153 @@
+/****************************************************************************
+ * boards/z80/ez80/z20x/src/sd_main.c
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership. The
+ * ASF licenses this file to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ *
+ ****************************************************************************/
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+#include
+
+#include "z20x.h"
+
+/****************************************************************************
+ * Pre-processor Definitions
+ ****************************************************************************/
+
+#define MMCSD_BLOCKDEV "/dev/mmcsd0"
+#define MMCSD_MOUNTPT "/mnt/sdcard"
+#define MMCSD_HEXFILE "/mnt/sdcard/nuttx.hex"
+
+#define SRAM_START 0x040000
+#define SRAM_SIZE 0x100000
+#define SRAM_END (SRAM_START + SRAM_SIZE)
+
+#define SRAM_RESET SRAM_START
+#define SRAM_ENTRY ((sram_entry_t)SRAM_START)
+
+/****************************************************************************
+ * Private Types
+ ****************************************************************************/
+
+typedef CODE void (*sram_entry_t)(void);
+
+/****************************************************************************
+ * Public Functions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Name: sd_main
+ *
+ * Description:
+ * sd_main is a tiny program that runs in FLASH. sd_main will
+ * configure SRAM and load an Intel HEX file into SRAM,
+ * and either start that program or wait for you to break in with the
+ * debugger.
+ *
+ ****************************************************************************/
+
+int sd_main(int argc, char *argv)
+{
+ int fd;
+ int ret;
+
+ /* SRAM was already initialized at boot time, so we are ready to load the
+ * Intel HEX stream into SRAM.
+ */
+
+#ifndef CONFIG_BOARD_LATE_INITIALIZE
+ /* Perform board-level initialization. This should include registering
+ * the MMC/SD block driver at /dev/mmcsd0.
+ */
+
+ DEBUGVERIFY(ez80_bringup());
+#endif
+
+ syslog(LOG_INFO, "Loading %s\n", MMCSD_HEXFILE);
+
+ /* Mount the MMC/SD block drivers at /mnt/sdcard */
+
+ ret = mount(MMCSD_BLOCKDEV, MMCSD_MOUNTPT, "vfat", 0, NULL);
+ if (ret < 0)
+ {
+ int errcode = errno;
+ syslog(LOG_ERR, "ERROR: Failed to mount filesystem at %s: %d\n",
+ MMCSD_MOUNTPT, errcode);
+ goto halt;
+ }
+
+ /* Open the file /mnt/sdcard/nuttx.hex */
+
+ fd = open(MMCSD_HEXFILE, O_RDONLY);
+ if (fd < 0)
+ {
+ int errcode = errno;
+ syslog(LOG_ERR, "ERROR: Failed to mount filesystem at %s: %d\n",
+ MMCSD_MOUNTPT, errcode);
+ goto halt_with_mount;
+ }
+
+ /* Load the HEX image into memory */
+
+ ret = hex2mem(fd, (uint32_t)SRAM_START, (uint32_t)SRAM_END, 0);
+ if (ret < 0)
+ {
+ /* We failed to load the HEX image */
+
+ syslog(LOG_ERR, "ERROR: Intel HEX file load failed: %d\n", ret);
+ goto halt_with_hexfile;
+ }
+
+ close(fd);
+ umount(MMCSD_MOUNTPT);
+
+ /* The reset vector should now be present at the beginning of SRAM.
+ * This assumes that the image was loaded at 0x040000 and that the reset
+ * vector is the first thing in memory.
+ */
+
+ syslog(LOG_INFO, "Starting at %p\n", SRAM_ENTRY);
+
+ /* Interrupts must be disabled through the following. */
+
+ up_irq_save();
+
+ /* Then jump into SRAM via the reset vector at 0x040000 */
+
+ SRAM_ENTRY();
+ goto halt;
+
+halt_with_hexfile:
+ close(fd);
+halt_with_mount:
+ umount(MMCSD_MOUNTPT);
+halt:
+ for (; ; );
+ return 0; /* Will not get here */
+}
diff --git a/boards/z80/ez80/z20x/src/z20x.h b/boards/z80/ez80/z20x/src/z20x.h
new file mode 100644
index 0000000000..ea87947925
--- /dev/null
+++ b/boards/z80/ez80/z20x/src/z20x.h
@@ -0,0 +1,141 @@
+/****************************************************************************
+ * boards/z80/ez80/z20x/src/z20x.h
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership. The
+ * ASF licenses this file to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ *
+ ****************************************************************************/
+
+#ifndef __BOARDS_Z80_EZ80_Z20X_SRC_Z20X_H
+#define __BOARDS_Z80_EZ80_Z20X_SRC_Z20X_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) (*(volatile uint8_t *)(a))
+#define ez80_putreg8(v,a) (*(volatile uint8_t *)(a) = (v))
+
+/* Memory map. Board-specific extensions to the basic ez80f91 memory map
+ * (see arch/z80/src/ez80/ez80f91.h)
+ *
+ * Chip select 0 is for the 512Kb AS6C4008 SRAM starting at address 0x40000
+ * (after the flash).
+ *
+ * __CS0_LBR_INIT_PARAM = 0x04 Lower address 04 0000
+ * __CS0_UBR_INIT_PARAM = 0x0b Upper address 0b ffff
+ * __CS0_CTL_INIT_PARAM = 0x08 CTL[5-7] = Zero wait states
+ * CTL[4] = Memory (vs I/O)
+ * CTL[3] = Enable
+ * CTL[0-2] = Unused
+ * __CS0_BMC_INIT_PARAM = 0x00 BMC[6-7] = eZ80 bus mode
+ * BMC[5] = Separate address and data
+ * BMC[4] = Unused
+ * BMC[0-3] = Ignored in eZ80 mode
+ *
+ * Chip select 1 is for the SSD1963 LCD frame buffer interface
+ * Chip select 2 is for the YM2413B Sound Generator
+ * Chip select 3 is not used
+ */
+
+/* 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)
+
+/****************************************************************************
+ * 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
+
+/****************************************************************************
+ * Name: ez80_spidev_initialize
+ *
+ * Description:
+ * Called to configure SPI chip select GPIO pins for the z20x board.
+ *
+ ****************************************************************************/
+
+#ifdef CONFIG_EZ80_SPI
+void ez80_spidev_initialize(void);
+#endif
+
+#undef EXTERN
+#if defined(__cplusplus)
+}
+#endif
+
+#endif /* __BOARDS_Z80_EZ80_Z20X_SRC_Z20X_H */