diff --git a/arch/z80/src/ez80/Kconfig b/arch/z80/src/ez80/Kconfig index 423891e382e..fdd661e44fb 100644 --- a/arch/z80/src/ez80/Kconfig +++ b/arch/z80/src/ez80/Kconfig @@ -149,12 +149,6 @@ config EZ80_PHYCONFIG ---help--- 0:Autonegotiate, 1:100FD, 2:100HD, 3:10FD, 4:10HD -config EZ80_RAMADDR - hex "Address of internal SRAM" - default 0xffc000 - ---help--- - Address of internal SRAM (default is 0xffc000) - config EZ80_PKTBUFSIZE int "Packet Buffer Size" default 64 diff --git a/arch/z80/src/ez80/Toolchain.defs b/arch/z80/src/ez80/Toolchain.defs index 041c71fa8b9..f869a56ef53 100644 --- a/arch/z80/src/ez80/Toolchain.defs +++ b/arch/z80/src/ez80/Toolchain.defs @@ -121,18 +121,19 @@ endif # Optimization level ifeq ($(CONFIG_DEBUG_SYMBOLS),y) - ARCHASMOPTIMIZATION = -debug -NOsdiopt + ARCHASMOPTIMIZATION = -debug ARCHOPTIMIZATION = -debug else - ARCHASMOPTIMIZATION = -nodebug -sdiopt + ARCHASMOPTIMIZATION = -NOdebug ARCHOPTIMIZATION = -NOdebug endif ifeq ($(CONFIG_DEBUG_NOOPT),y) - ARCHOPTIMIZATION += -reduceopt -#else -# ARCHOPTIMIZATION += -promote -NOreduceopt -optsize - ARCHOPTIMIZATION += -promote -NOreduceopt +# ARCHOPTIMIZATION += -promote -reduceopt -NOsdiopt + ARCHOPTIMIZATION += -NOsdiopt +else +# ARCHOPTIMIZATION += -NOpromote -NOreduceopt -sdiopt -optsize + ARCHOPTIMIZATION += -sdiopt endif # Tool names/paths. diff --git a/arch/z80/src/ez80/ez80_emac.c b/arch/z80/src/ez80/ez80_emac.c index bfeed35fc23..e092aa74925 100644 --- a/arch/z80/src/ez80/ez80_emac.c +++ b/arch/z80/src/ez80/ez80_emac.c @@ -1,7 +1,7 @@ /**************************************************************************** * arch/z80/src/ez80/ez80_emac.c * - * Copyright (C) 2009-2010, 2012, 2014-2018 Gregory Nutt. All rights + * Copyright (C) 2009-2010, 2012, 2014-2018, 2020 Gregory Nutt. All rights * reserved. * Author: Gregory Nutt * @@ -96,9 +96,14 @@ #define ETHWORK LPWORK -#ifndef CONFIG_EZ80_RAMADDR -# define CONFIG_EZ80_RAMADDR EZ80_EMACSRAM -#endif +/* The eZ80F92 has 16Kb of SRAM. The base address of the SRAM is setup by + * the eZ80 start-up logic by setting the RAM_ADDR_U register to the upper + * 8 bits of the 24-bit address. The EMAC RAM is at an offset of 0x00c000 + * into that region. + */ + +extern uintptr_t __RAM_ADDR_U_INIT_PARAM; +#define ETH_RAMADDR ((uintptr_t)&__RAM_ADDR_U_INIT_PARAM << 16) + 0x00c000 #if CONFIG_NET_ETH_PKTSIZE > 1518 # error "MAXF size too big for this device" @@ -380,11 +385,12 @@ static struct ez80emac_driver_s g_emac; /* MII logic */ static void ez80emac_waitmiibusy(void); -static void ez80emac_miiwrite(FAR struct ez80emac_driver_s *priv, uint8_t offset, - uint16_t value); -static uint16_t ez80emac_miiread(FAR struct ez80emac_driver_s *priv, uint32_t offset); -static bool ez80emac_miipoll(FAR struct ez80emac_driver_s *priv, uint32_t offset, - uint16_t bits, bool bclear); +static void ez80emac_miiwrite(FAR struct ez80emac_driver_s *priv, + uint8_t offset, uint16_t value); +static uint16_t ez80emac_miiread(FAR struct ez80emac_driver_s *priv, + uint32_t offset); +static bool ez80emac_miipoll(FAR struct ez80emac_driver_s *priv, + uint32_t offset, uint16_t bits, bool bclear); static int ez80emac_miiconfigure(FAR struct ez80emac_driver_s *priv); /* Multi-cast filtering */ @@ -405,13 +411,16 @@ static int ez80emac_receive(struct ez80emac_driver_s *priv); /* Interrupt handling */ static void ez80emac_txinterrupt_work(FAR void *arg); -static int ez80emac_txinterrupt(int irq, FAR void *context, FAR void *arg); +static int ez80emac_txinterrupt(int irq, FAR void *context, + FAR void *arg); static void ez80emac_rxinterrupt_work(FAR void *arg); -static int ez80emac_rxinterrupt(int irq, FAR void *context, FAR void *arg); +static int ez80emac_rxinterrupt(int irq, FAR void *context, + FAR void *arg); static void ez80emac_sysinterrupt_work(FAR void *arg); -static int ez80emac_sysinterrupt(int irq, FAR void *context, FAR void *arg); +static int ez80emac_sysinterrupt(int irq, FAR void *context, + FAR void *arg); /* Watchdog timer expirations */ @@ -430,8 +439,10 @@ static void ez80emac_txavail_work(FAR void *arg); static int ez80emac_txavail(struct net_driver_s *dev); #ifdef CONFIG_NET_MCASTGROUP -static int ez80emac_addmac(struct net_driver_s *dev, FAR const uint8_t *mac); -static int ez80emac_rmmac(struct net_driver_s *dev, FAR const uint8_t *mac); +static int ez80emac_addmac(struct net_driver_s *dev, + FAR const uint8_t *mac); +static int ez80emac_rmmac(struct net_driver_s *dev, + FAR const uint8_t *mac); #endif /* Initialization */ @@ -750,16 +761,26 @@ static int ez80emac_miiconfigure(FAR struct ez80emac_driver_s *priv) } dumpregs: - ninfo("Am79c874 MII registers (FIAD=%lx)\n", CONFIG_EZ80_FIAD); - ninfo(" MII_MCR: %04x\n", ez80emac_miiread(priv, MII_MCR)); - ninfo(" MII_MSR: %04x\n", ez80emac_miiread(priv, MII_MSR)); - ninfo(" MII_PHYID1: %04x\n", ez80emac_miiread(priv, MII_PHYID1)); - ninfo(" MII_PHYID2: %04x\n", ez80emac_miiread(priv, MII_PHYID2)); - ninfo(" MII_ADVERTISE: %04x\n", ez80emac_miiread(priv, MII_ADVERTISE)); - ninfo(" MII_LPA: %04x\n", ez80emac_miiread(priv, MII_LPA)); - ninfo(" MII_EXPANSION: %04x\n", ez80emac_miiread(priv, MII_EXPANSION)); - ninfo(" MII_DIAGNOSTICS: %04x\n", ez80emac_miiread(priv, MII_AM79C874_DIAGNOSTIC)); - ninfo("EMAC CFG1: %02x\n", inp(EZ80_EMAC_CFG1)); + ninfo("Am79c874 MII registers (FIAD=%lx)\n", + CONFIG_EZ80_FIAD); + ninfo(" MII_MCR: %04x\n", + ez80emac_miiread(priv, MII_MCR)); + ninfo(" MII_MSR: %04x\n", + ez80emac_miiread(priv, MII_MSR)); + ninfo(" MII_PHYID1: %04x\n", + ez80emac_miiread(priv, MII_PHYID1)); + ninfo(" MII_PHYID2: %04x\n", + ez80emac_miiread(priv, MII_PHYID2)); + ninfo(" MII_ADVERTISE: %04x\n", + ez80emac_miiread(priv, MII_ADVERTISE)); + ninfo(" MII_LPA: %04x\n", + ez80emac_miiread(priv, MII_LPA)); + ninfo(" MII_EXPANSION: %04x\n", + ez80emac_miiread(priv, MII_EXPANSION)); + ninfo(" MII_DIAGNOSTICS: %04x\n", + ez80emac_miiread(priv, MII_AM79C874_DIAGNOSTIC)); + ninfo("EMAC CFG1: %02x\n", + inp(EZ80_EMAC_CFG1)); return ret; } #else @@ -824,7 +845,8 @@ static int ez80emac_miiconfigure(FAR struct ez80emac_driver_s *priv) /* Check for 100BASETX half duplex */ - else if ((advertise & MII_ADVERTISE_100BASETXHALF) && (lpa & MII_LPA_100BASETXHALF)) + else if ((advertise & MII_ADVERTISE_100BASETXHALF) && + (lpa & MII_LPA_100BASETXHALF)) { ninfo("100BASETX half duplex\n"); regval = inp(EZ80_EMAC_CFG1); @@ -1195,7 +1217,7 @@ static int ez80emac_txpoll(struct net_driver_s *dev) static inline FAR struct ez80emac_desc_s *ez80emac_rwp(void) { return (FAR struct ez80emac_desc_s *) - (CONFIG_EZ80_RAMADDR + + (ETH_RAMADDR + ((uint24_t)inp(EZ80_EMAC_RWP_H) << 8) + (uint24_t)inp(EZ80_EMAC_RWP_L)); } @@ -1216,7 +1238,7 @@ static inline FAR struct ez80emac_desc_s *ez80emac_rwp(void) static inline FAR struct ez80emac_desc_s *ez80emac_rrp(void) { return (FAR struct ez80emac_desc_s *) - (CONFIG_EZ80_RAMADDR + + (ETH_RAMADDR + ((uint24_t)inp(EZ80_EMAC_RRP_H) << 8) + (uint24_t)inp(EZ80_EMAC_RRP_L)); } @@ -1772,9 +1794,11 @@ static void ez80emac_sysinterrupt_work(FAR void *arg) if ((istat & EMAC_ISTAT_TXFSMERR) != 0) { - nwarn("WARNING: Tx FSMERR txhead=%p {%06x, %u, %04x} trp=%02x%02x istat=%02x\n", - priv->txhead, priv->txhead->np, priv->txhead->pktsize, priv->txhead->stat, - inp(EZ80_EMAC_TRP_H), inp(EZ80_EMAC_TRP_L), istat); + nwarn("WARNING: Tx FSMERR txhead=%p {%06x, %u, %04x} trp=%02x%02x " + "istat=%02x\n", + priv->txhead, priv->txhead->np, priv->txhead->pktsize, + priv->txhead->stat, inp(EZ80_EMAC_TRP_H), inp(EZ80_EMAC_TRP_L), + istat); /* Increment statistics */ @@ -2017,7 +2041,8 @@ static void ez80emac_poll_expiry(int argc, wdparm_t arg, ...) static int ez80emac_ifup(FAR struct net_driver_s *dev) { - FAR struct ez80emac_driver_s *priv = (FAR struct ez80emac_driver_s *)dev->d_private; + FAR struct ez80emac_driver_s *priv = + (FAR struct ez80emac_driver_s *)dev->d_private; uint8_t regval; int ret; @@ -2202,7 +2227,8 @@ static void ez80emac_txavail_work(FAR void *arg) static int ez80emac_txavail(FAR struct net_driver_s *dev) { - FAR struct ez80emac_driver_s *priv = (FAR struct ez80emac_driver_s *)dev->d_private; + FAR struct ez80emac_driver_s *priv = + (FAR struct ez80emac_driver_s *)dev->d_private; /* Is our single work structure available? It may not be if there are * pending interrupt actions and we will have to ignore the Tx @@ -2313,12 +2339,14 @@ static int ez80_emacinitialize(void) /* The ez80 has a fixed 8kb of EMAC SRAM memory (+ 8kb of * general purpose SRAM) located in the high address space. - * Configure the GP and EMAC SRAM + * Configure the GP and EMAC SRAM. + * + * EZ80_RAM_CTL and EZ80_RAM_ADDR_U where configured by ez80 start-up + * logic. We need only enable EMAC RAM here. */ outp(EZ80_RAM_CTL, (RAMCTL_ERAMEN | RAMCTL_GPRAMEN)); - outp(EZ80_RAM_ADDR_U, (CONFIG_EZ80_RAMADDR >> 16)); - outp(EZ80_EMAC_BP_U, (CONFIG_EZ80_RAMADDR >> 16)); + outp(EZ80_EMAC_BP_U, (ETH_RAMADDR >> 16)); /* The EMAC memory is broken into two parts: the Tx buffer and the Rx buffer. * @@ -2328,7 +2356,7 @@ static int ez80_emacinitialize(void) * The Transmit Write Pointer, TRP, will be set to the TLBP. */ - addr = CONFIG_EZ80_RAMADDR; + addr = ETH_RAMADDR; outp(EZ80_EMAC_TLBP_L, (uint8_t)(addr & 0xff)); outp(EZ80_EMAC_TLBP_H, (uint8_t)((addr >> 8) & 0xff)); diff --git a/arch/z80/src/ez80/ez80_startup.asm b/arch/z80/src/ez80/ez80_startup.asm index 696158d8b50..93943f27462 100644 --- a/arch/z80/src/ez80/ez80_startup.asm +++ b/arch/z80/src/ez80/ez80_startup.asm @@ -41,11 +41,16 @@ ; Constants ;************************************************************************** +EZ80_RAM_CTL EQU %b4 +EZ80_RAM_ADDR_U EQU %b5 + +EZ80_FLASH_ADDR_U EQU %f7 +EZ80_FLASH_CTRL EQU %f8 + ;************************************************************************** ; Global symbols used ;************************************************************************** - xref __stack xref _ez80_init xref _ez80_initvectors xref _ez80_initsysclk @@ -61,6 +66,12 @@ xref __len_code xref __low_code xref __low_romcode + + xref __RAM_ADDR_U_INIT_PARAM + xref __RAM_CTL_INIT_PARAM + xref __FLASH_ADDR_U_INIT_PARAM + xref __FLASH_CTL_INIT_PARAM + xref _nx_start xdef _ez80_startup xdef _ez80_halt @@ -77,10 +88,22 @@ ;************************************************************************** _ez80_startup: - ; Set up the stack pointer at the location determined the linkcmd - ; file + ; Enable internal memory using settings from the linkcmd file - ld sp, __stack + ld a, __FLASH_ADDR_U_INIT_PARAM + out0 (EZ80_FLASH_ADDR_U), a + ld a, __FLASH_CTL_INIT_PARAM + out0 (EZ80_FLASH_CTRL), a + + ld a, __RAM_ADDR_U_INIT_PARAM + out0 (EZ80_RAM_ADDR_U), a + ld a, __RAM_CTL_INIT_PARAM + out0 (EZ80_RAM_CTL), a + + ; Position the IDLE task stack point at an offset of 1Kb in on-chip SRAM + ; On-chip SRAM resides at an offset of %00e000 from the RAM base address. + + ld sp, __RAM_ADDR_U_INIT_PARAM << 16 + %00e400 ; Perform chip-specific initialization diff --git a/arch/z80/src/ez80/ez80f91.h b/arch/z80/src/ez80/ez80f91.h index 5df6fa7f67d..f4d61533af0 100644 --- a/arch/z80/src/ez80/ez80f91.h +++ b/arch/z80/src/ez80/ez80f91.h @@ -55,6 +55,9 @@ #define EZ80_EMACSRAM 0xffc000 /* On-chip EMAC SRAM (8Kb) on reset*/ #define EZ80_ONCHIPSRAM 0xffe000 /* On-chip SRAM (8Kb) on reset */ +#define EZ80_FLASH_SIZE 0x040000 /* 256Kb on-chip flash */ +#define EZ80_SRAM_SIZE 0x002000 /* 8Kb on-chip sram */ + /* Product ID Registers ************************************************************/ #define EZ80_ZDI_ID_L 0x00 diff --git a/arch/z80/src/ez80/ez80f91_emac.h b/arch/z80/src/ez80/ez80f91_emac.h index b3cb1c0456e..467c5b3b964 100644 --- a/arch/z80/src/ez80/ez80f91_emac.h +++ b/arch/z80/src/ez80/ez80f91_emac.h @@ -1,6 +1,5 @@ /************************************************************************************ * arch/z80/src/ez80/ez80f91_emac.h - * arch/z80/src/chip/ez80f91_emac.h * * Copyright (C) 2008-2009 Gregory Nutt. All rights reserved. * Author: Gregory Nutt diff --git a/arch/z80/src/ez80/ez80f91_init.asm b/arch/z80/src/ez80/ez80f91_init.asm index 49087142532..25b90686b3e 100644 --- a/arch/z80/src/ez80/ez80f91_init.asm +++ b/arch/z80/src/ez80/ez80f91_init.asm @@ -188,17 +188,6 @@ _ez80_init: ld a, __CS3_CTL_INIT_PARAM out0 (CS3_CTL), a - ; Enable internal memory - - ld a, __FLASH_ADDR_U_INIT_PARAM - out0 (FLASH_ADDR_U), a - ld a, __FLASH_CTL_INIT_PARAM - out0 (FLASH_CTRL), a - - ld a, __RAM_ADDR_U_INIT_PARAM - out0 (RAM_ADDR_U), a - ld a, __RAM_CTL_INIT_PARAM - out0 (RAM_CTL), a ret ;***************************************************************************** diff --git a/arch/z80/src/ez80/ez80f92.h b/arch/z80/src/ez80/ez80f92.h index 8449ebd2c2f..37a628aef05 100644 --- a/arch/z80/src/ez80/ez80f92.h +++ b/arch/z80/src/ez80/ez80f92.h @@ -25,7 +25,7 @@ * Included Files ************************************************************************************/ -#include "ez80f91_emac.h" +#include "nuttx/config.h" /************************************************************************************ * Pre-processor Definitions @@ -33,11 +33,19 @@ /* Memory map ***********************************************************************/ -#define EZ80_ONCHIPFLASH 0x000000 /* CS0: 128Kb of on-chip flash */ +#define EZ80_ONCHIPFLASH 0x000000 /* CS0: 64-128Kb of on-chip flash */ #define EZ80_OFFCHIPCS0 0x400000 /* CS0: Off chip use (usually flash) */ #define EZ80_OFFCHIPCS2 0x800000 /* CS2: Off chip use (e.g. memory mapped I/O) */ #define EZ80_OFFCHIPCS1 0xc00000 /* CS1: Off chip use (usually SRAM) */ -#define EZ80_ONCHIPSRAM 0xffe000 /* On-chip SRAM (8Kb) on reset */ +#define EZ80_ONCHIPSRAM 0xffe000 /* On-chip SRAM (4-8Kb) on reset */ + +#if defined(CONFIGS_ARCH_CHIP_EZ80L92) +# define EZ80_FLASH_SIZE 0x020000 /* 128Kb on-chip flash */ +# define EZ80_SRAM_SIZE 0x002000 /* 8Kb on-chip sram */ +#elif defined(CONFIGS_ARCH_CHIP_EZ80L93) +# define EZ80_FLASH_SIZE 0x010000 /* 64Kb on-chip flash */ +# define EZ80_SRAM_SIZE 0x001000 /* 4Kb on-chip sram */ +#endif /* Product ID Registers ************************************************************/ diff --git a/arch/z80/src/ez80/ez80f92_init.asm b/arch/z80/src/ez80/ez80f92_init.asm index 384edec401e..4db99b9819a 100644 --- a/arch/z80/src/ez80/ez80f92_init.asm +++ b/arch/z80/src/ez80/ez80f92_init.asm @@ -133,17 +133,6 @@ _ez80_init: ld a, __CS3_CTL_INIT_PARAM out0 (CS3_CTL), a - ; Enable internal memory - - ld a, __FLASH_ADDR_U_INIT_PARAM - out0 (FLASH_ADDR_U), a - ld a, __FLASH_CTL_INIT_PARAM - out0 (FLASH_CTRL), a - - ld a, __RAM_ADDR_U_INIT_PARAM - out0 (RAM_ADDR_U), a - ld a, __RAM_CTL_INIT_PARAM - out0 (RAM_CTL), a ret ;***************************************************************************** diff --git a/boards/z80/ez80/ez80f910200kitg/configs/ostest/defconfig b/boards/z80/ez80/ez80f910200kitg/configs/ostest/defconfig index 4aa81e8e3d6..37f9bb2e9ba 100644 --- a/boards/z80/ez80/ez80f910200kitg/configs/ostest/defconfig +++ b/boards/z80/ez80/ez80f910200kitg/configs/ostest/defconfig @@ -43,9 +43,9 @@ CONFIG_TESTING_OSTEST=y CONFIG_TESTING_OSTEST_NBARRIER_THREADS=3 CONFIG_TESTING_OSTEST_STACKSIZE=2048 CONFIG_UART0_BAUD=57600 -CONFIG_UART0_RXBUFSIZE=0 +CONFIG_UART0_RXBUFSIZE=32 CONFIG_UART0_SERIAL_CONSOLE=y -CONFIG_UART0_TXBUFSIZE=0 +CONFIG_UART0_TXBUFSIZE=32 CONFIG_USERMAIN_STACKSIZE=1024 CONFIG_USER_ENTRYPOINT="ostest_main" CONFIG_WDOG_INTRESERVE=0 diff --git a/boards/z80/ez80/ez80f910200zco/configs/dhcpd/defconfig b/boards/z80/ez80/ez80f910200zco/configs/dhcpd/defconfig index 5414cf36e25..f00d8cf29bd 100644 --- a/boards/z80/ez80/ez80f910200zco/configs/dhcpd/defconfig +++ b/boards/z80/ez80/ez80f910200zco/configs/dhcpd/defconfig @@ -54,9 +54,9 @@ CONFIG_STDIO_DISABLE_BUFFERING=y CONFIG_TASK_NAME_SIZE=0 CONFIG_UART0_BAUD=57600 CONFIG_UART0_BITS=0 -CONFIG_UART0_RXBUFSIZE=0 +CONFIG_UART0_RXBUFSIZE=32 CONFIG_UART0_SERIAL_CONSOLE=y -CONFIG_UART0_TXBUFSIZE=0 +CONFIG_UART0_TXBUFSIZE=32 CONFIG_USERMAIN_STACKSIZE=1024 CONFIG_USER_ENTRYPOINT="dhcpd_main" CONFIG_WDOG_INTRESERVE=1 diff --git a/boards/z80/ez80/ez80f910200zco/configs/httpd/defconfig b/boards/z80/ez80/ez80f910200zco/configs/httpd/defconfig index eecc329c815..196b73de056 100644 --- a/boards/z80/ez80/ez80f910200zco/configs/httpd/defconfig +++ b/boards/z80/ez80/ez80f910200zco/configs/httpd/defconfig @@ -53,9 +53,9 @@ CONFIG_STDIO_DISABLE_BUFFERING=y CONFIG_TASK_NAME_SIZE=0 CONFIG_UART0_BAUD=57600 CONFIG_UART0_BITS=0 -CONFIG_UART0_RXBUFSIZE=0 +CONFIG_UART0_RXBUFSIZE=32 CONFIG_UART0_SERIAL_CONSOLE=y -CONFIG_UART0_TXBUFSIZE=0 +CONFIG_UART0_TXBUFSIZE=32 CONFIG_USERMAIN_STACKSIZE=1024 CONFIG_USER_ENTRYPOINT="webserver_main" CONFIG_WDOG_INTRESERVE=1 diff --git a/boards/z80/ez80/ez80f910200zco/configs/nettest/defconfig b/boards/z80/ez80/ez80f910200zco/configs/nettest/defconfig index 7663504885b..48443f160bb 100644 --- a/boards/z80/ez80/ez80f910200zco/configs/nettest/defconfig +++ b/boards/z80/ez80/ez80f910200zco/configs/nettest/defconfig @@ -50,9 +50,9 @@ CONFIG_STDIO_DISABLE_BUFFERING=y CONFIG_TASK_NAME_SIZE=0 CONFIG_UART0_BAUD=57600 CONFIG_UART0_BITS=0 -CONFIG_UART0_RXBUFSIZE=0 +CONFIG_UART0_RXBUFSIZE=32 CONFIG_UART0_SERIAL_CONSOLE=y -CONFIG_UART0_TXBUFSIZE=0 +CONFIG_UART0_TXBUFSIZE=32 CONFIG_USERMAIN_STACKSIZE=1024 CONFIG_USER_ENTRYPOINT="nettest_main" CONFIG_WDOG_INTRESERVE=1 diff --git a/boards/z80/ez80/ez80f910200zco/configs/poll/defconfig b/boards/z80/ez80/ez80f910200zco/configs/poll/defconfig index 978fb533bd8..3a6a68017f7 100644 --- a/boards/z80/ez80/ez80f910200zco/configs/poll/defconfig +++ b/boards/z80/ez80/ez80f910200zco/configs/poll/defconfig @@ -52,9 +52,9 @@ CONFIG_STDIO_DISABLE_BUFFERING=y CONFIG_TASK_NAME_SIZE=0 CONFIG_UART0_BAUD=57600 CONFIG_UART0_BITS=0 -CONFIG_UART0_RXBUFSIZE=0 +CONFIG_UART0_RXBUFSIZE=32 CONFIG_UART0_SERIAL_CONSOLE=y -CONFIG_UART0_TXBUFSIZE=0 +CONFIG_UART0_TXBUFSIZE=32 CONFIG_USERMAIN_STACKSIZE=1024 CONFIG_USER_ENTRYPOINT="poll_main" CONFIG_WDOG_INTRESERVE=1 diff --git a/boards/z80/ez80/z20x/README.txt b/boards/z80/ez80/z20x/README.txt index 217452a191b..b55384b8c51 100644 --- a/boards/z80/ez80/z20x/README.txt +++ b/boards/z80/ez80/z20x/README.txt @@ -33,6 +33,7 @@ Contents ======== o ZDS-II Compiler Versions + o Environments o Serial Console o LEDs and Buttons - LEDs @@ -62,6 +63,26 @@ Other Versions boards/z80/ez80/z20x/scripts/Make.defs and, perhaps, (3) arch/z80/src/ez80/Toolchain.defs. +Environments +============ + +Cygwin: + + All testing was done using the Cygwin environment under Windows. + +MinGW/MSYS + + One attempt was made using the MSYS2 environment under Windws. That build + correctly until the very end, then it failed to include "chip.h". this + was traced to arch/z80/src/Makefile.zdsiil: The usrinc paths created by + Makefile.zdsiil contained POSIX-style paths that were not usable to the + ZDS-II compiler. + +Native + + The Windows native build has not been attempt. I would expect that it + would have numerous problems. + Serial Console ============== diff --git a/boards/z80/ez80/z20x/configs/nsh_flash/nsh.zdsproj b/boards/z80/ez80/z20x/configs/nsh_flash/nsh.zdsproj index 190c4f79f2b..bbfaf3aaae4 100644 --- a/boards/z80/ez80/z20x/configs/nsh_flash/nsh.zdsproj +++ b/boards/z80/ez80/z20x/configs/nsh_flash/nsh.zdsproj @@ -110,7 +110,7 @@ - + @@ -230,7 +230,7 @@ - + diff --git a/boards/z80/ez80/z20x/configs/nsh_flash/nsh.zfpproj b/boards/z80/ez80/z20x/configs/nsh_flash/nsh.zfpproj index aba607c8fdd..1340f9599e8 100644 --- a/boards/z80/ez80/z20x/configs/nsh_flash/nsh.zfpproj +++ b/boards/z80/ez80/z20x/configs/nsh_flash/nsh.zfpproj @@ -140,7 +140,7 @@ - + @@ -291,7 +291,7 @@ - + diff --git a/boards/z80/ez80/z20x/configs/nsh_ram/nsh.zdsproj b/boards/z80/ez80/z20x/configs/nsh_ram/nsh.zdsproj index 8ca82304473..6e62a160d1c 100644 --- a/boards/z80/ez80/z20x/configs/nsh_ram/nsh.zdsproj +++ b/boards/z80/ez80/z20x/configs/nsh_ram/nsh.zdsproj @@ -110,7 +110,7 @@ - + @@ -230,7 +230,7 @@ - + diff --git a/boards/z80/ez80/z20x/configs/nsh_ram/nsh.zfpproj b/boards/z80/ez80/z20x/configs/nsh_ram/nsh.zfpproj index aba607c8fdd..1340f9599e8 100644 --- a/boards/z80/ez80/z20x/configs/nsh_ram/nsh.zfpproj +++ b/boards/z80/ez80/z20x/configs/nsh_ram/nsh.zfpproj @@ -140,7 +140,7 @@ - + @@ -291,7 +291,7 @@ - + diff --git a/boards/z80/ez80/z20x/configs/sdboot/sdboot.zdsproj b/boards/z80/ez80/z20x/configs/sdboot/sdboot.zdsproj index 0400938a3d7..6013f26ed1b 100644 --- a/boards/z80/ez80/z20x/configs/sdboot/sdboot.zdsproj +++ b/boards/z80/ez80/z20x/configs/sdboot/sdboot.zdsproj @@ -110,7 +110,7 @@ - + @@ -230,7 +230,7 @@ - + diff --git a/boards/z80/ez80/z20x/configs/sdboot/sdboot.zfpproj b/boards/z80/ez80/z20x/configs/sdboot/sdboot.zfpproj index 934be464d81..a4f18a4dc1d 100644 --- a/boards/z80/ez80/z20x/configs/sdboot/sdboot.zfpproj +++ b/boards/z80/ez80/z20x/configs/sdboot/sdboot.zfpproj @@ -140,7 +140,7 @@ - + @@ -291,7 +291,7 @@ - + diff --git a/boards/z80/ez80/z20x/scripts/z20x_copytoram.linkcmd b/boards/z80/ez80/z20x/scripts/z20x_copytoram.linkcmd index bf4015beb54..f7a9d39241a 100644 --- a/boards/z80/ez80/z20x/scripts/z20x_copytoram.linkcmd +++ b/boards/z80/ez80/z20x/scripts/z20x_copytoram.linkcmd @@ -23,7 +23,7 @@ -map -maxhexlen=64 -quiet -warnoverlap -xref -unresolved=fatal -sort NAME=ascending -warn -debug -NOigcase -RANGE ROM $000000 : $03FFFF +RANGE ROM $000000 : $01FFFF RANGE RAM $040000 : $0BFFFF RANGE EXTIO $000000 : $00FFFF RANGE INTIO $000000 : $0000FF diff --git a/boards/z80/ez80/z20x/scripts/z20x_flash.linkcmd b/boards/z80/ez80/z20x/scripts/z20x_flash.linkcmd index 4b5ff57624f..0b28dccf74b 100644 --- a/boards/z80/ez80/z20x/scripts/z20x_flash.linkcmd +++ b/boards/z80/ez80/z20x/scripts/z20x_flash.linkcmd @@ -23,7 +23,7 @@ -map -maxhexlen=64 -quiet -warnoverlap -xref -unresolved=fatal -sort NAME=ascending -warn -debug -NOigcase -RANGE ROM $000000 : $03FFFF +RANGE ROM $000000 : $01FFFF RANGE RAM $040000 : $0BFFFF RANGE EXTIO $000000 : $00FFFF RANGE INTIO $000000 : $0000FF diff --git a/boards/z80/ez80/z20x/scripts/z20x_ram.linkcmd b/boards/z80/ez80/z20x/scripts/z20x_ram.linkcmd index cbc949fa415..966a4566d65 100644 --- a/boards/z80/ez80/z20x/scripts/z20x_ram.linkcmd +++ b/boards/z80/ez80/z20x/scripts/z20x_ram.linkcmd @@ -23,7 +23,7 @@ -map -maxhexlen=64 -quiet -warnoverlap -xref -unresolved=fatal -sort NAME=ascending -warn -debug -NOigcase -RANGE ROM $000000 : $03FFFF +RANGE ROM $000000 : $01FFFF RANGE RAM $040000 : $0BFFFF RANGE EXTIO $000000 : $00FFFF RANGE INTIO $000000 : $0000FF diff --git a/boards/z80/ez80/z20x/src/z20x.h b/boards/z80/ez80/z20x/src/z20x.h index ea87947925c..85161e85ba6 100644 --- a/boards/z80/ez80/z20x/src/z20x.h +++ b/boards/z80/ez80/z20x/src/z20x.h @@ -48,6 +48,14 @@ /* Memory map. Board-specific extensions to the basic ez80f91 memory map * (see arch/z80/src/ez80/ez80f91.h) * + * 00 0000 - 01 ffff - 128Kb FLASH + * 02 0000 - 03 ffff - (Reserved for parts with 256Kb FLASH) + * 04 0000 - 0b ffff - 512Kb External SRAM + * SSD1963 LCD frame buffer interface + * YM2413B Sound Generator + * af e000 - af ffff - 8Kb on-chip SRAM + * af e000 - af e3ff - IDLE stack + * * Chip select 0 is for the 512Kb AS6C4008 SRAM starting at address 0x40000 * (after the flash). *