nuttx/arch/z80/src/ez80/Toolchain.defs
Gregory Nutt 161104c76a eZ80/z20x: Correct uninitialized stack memory
arch/z80/src/ez80/Toolchain.defs:  Correct some CFLAGS when optimization suppressed.

arch/z80/src/ez80/Kconfig arch/z80/src/ez80/ez80_emac.c:  Remove configuration option for selecting EMAC RAM address.  This is duplicated and possibly conflicting.  The correct address for the RAM is provided in the linker command file.  The RAM should be configured once and using this single definitions.

arch/z80/src/ez80/ez80_startup.asm and arch/z80/src/ez80/ez80f9*_init.asm.  Move RAM and FLAH intialization out of MCU-specific logic to common start-up logic.  We cannot call any functions until SRAM is initialized and the stack is properly initialized because the return address is stored on the stack.  Use internal SRAM for the IDLE stack to avoid the chicken'n'egg problem.

boards/z80/ez80/z20x/configs/sdboot/sdboot.zdsproj:  Discuss build environments.
2020-02-27 22:53:27 +01:00

155 lines
4.9 KiB
Plaintext

############################################################################
# arch/z80/src/ez80/Toolchain.defs
#
# Copyright (C) 2012, 2016, 2020 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <gnutt@nuttx.org>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in
# the documentation and/or other materials provided with the
# distribution.
# 3. Neither the name NuttX nor the names of its contributors may be
# used to endorse or promote products derived from this software
# without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
#
############################################################################
# Setup for the selected toolchain
#
# The ZiLOG ZDS-II Windows toolchain is the only toolchain available for
# the ez80.
#
CONFIG_EZ80_TOOLCHAIN ?= ZDSII
ifeq ($(CONFIG_WINDOWS_CYGWIN),y)
WINTOOL = y
endif
# 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 and 5.3.3, 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
else ifeq ($(CONFIG_EZ80_ZDSII_V533),y)
INSTALLROOT = C:/ZiLOG
ZDSVERSION := 5.3.3
endif
ZDSINSTALLDIR := $(INSTALLROOT)/ZDSII_eZ80Acclaim!_$(ZDSVERSION)
ifeq ($(CONFIG_WINDOWS_NATIVE),y)
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
else
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"}
endif
# CPU Identification
ifeq ($(CONFIG_ARCH_CHIP_EZ80F91),y)
ARCHCPU = eZ80F91
ARCHCPUDEF = _EZ80F91
ARCHFAMILY = _EZ80ACCLAIM!
else ifeq ($(CONFIG_ARCH_CHIP_EZ80F92),y)
#ARCHCPU = eZ80F92
#ARCHCPUDEF = _EZ80F92
ARCHCPU = eZ80F91
ARCHCPUDEF = _EZ80F91
ARCHFAMILY = _EZ80ACCLAIM!
endif
# Optimization level
ifeq ($(CONFIG_DEBUG_SYMBOLS),y)
ARCHASMOPTIMIZATION = -debug
ARCHOPTIMIZATION = -debug
else
ARCHASMOPTIMIZATION = -NOdebug
ARCHOPTIMIZATION = -NOdebug
endif
ifeq ($(CONFIG_DEBUG_NOOPT),y)
# ARCHOPTIMIZATION += -promote -reduceopt -NOsdiopt
ARCHOPTIMIZATION += -NOsdiopt
else
# ARCHOPTIMIZATION += -NOpromote -NOreduceopt -sdiopt -optsize
ARCHOPTIMIZATION += -sdiopt
endif
# 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