From 317a8a8942d65e992b2de6a9c704db0bb0cf7b3d Mon Sep 17 00:00:00 2001 From: Gregory Nutt <gnutt@nuttx.org> Date: Wed, 29 Apr 2020 21:41:57 -0600 Subject: [PATCH] arch/z16: Build update Verfy build. Update to latest 2.2.2 toolchain. --- arch/z16/src/Makefile | 45 +++------ arch/z16/src/z16f/Kconfig | 5 +- arch/z16/src/z16f/Toolchain.defs | 3 + arch/z16/src/z16f/chip.h | 2 +- arch/z16/src/z16f/z16f_head.S | 2 +- arch/z16/src/z16f/z16f_irq.c | 1 + arch/z16/src/z16f/z16f_lowuart.S | 2 +- arch/z16/src/z16f/z16f_serial.c | 96 ++++++------------- arch/z16/src/z16f/z16f_sysexec.c | 16 ++-- boards/Board.mk | 4 +- boards/z16/z16f/z16f2800100zcog/README.txt | 3 + .../z16f/z16f2800100zcog/scripts/Make.defs | 42 +++----- boards/z16/z16f/z16f2800100zcog/src/Makefile | 43 ++++----- .../z16f/z16f2800100zcog/src/z16f_appinit.c | 71 ++++++++++++++ .../z16/z16f/z16f2800100zcog/src/z16f_boot.c | 77 ++++++++------- .../z16/z16f/z16f2800100zcog/src/z16f_leds.c | 14 +-- sched/sched/sched_mergeprioritized.c | 41 +++----- 17 files changed, 226 insertions(+), 241 deletions(-) create mode 100644 boards/z16/z16f/z16f2800100zcog/src/z16f_appinit.c diff --git a/arch/z16/src/Makefile b/arch/z16/src/Makefile index 6d4d956d5c..51ae243ae0 100644 --- a/arch/z16/src/Makefile +++ b/arch/z16/src/Makefile @@ -1,35 +1,20 @@ ############################################################################ # arch/z16/src/Makefile # -# Copyright (C) 2008, 2011-2012, 2014 Gregory Nutt. All rights reserved. -# Author: Gregory Nutt <gnutt@nuttx.org> +# 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 # -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: +# http://www.apache.org/licenses/LICENSE-2.0 # -# 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. +# 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. # ############################################################################ @@ -44,16 +29,16 @@ ifeq ($(CONFIG_WINDOWS_NATIVE),y) else ifeq ($(COMPILER),zneocc.exe) WARCHSRCDIR := ${shell cygpath -w $(ARCHSRCDIR)} - USRINCLUDES = -usrinc:'.;$(WTOPDIR)\sched;$(WARCHSRCDIR)$(DELIM)chip;$(WARCHSRCDIR)$(DELIM)common' + USRINCLUDES = -usrinc:'.;$(WTOPDIR)\sched;$(WARCHSRCDIR)\chip;$(WARCHSRCDIR)\common' else WARCHSRCDIR = $(ARCHSRCDIR) - USRINCLUDES = -I$(TOPDIR)/sched -I$(ARCHSRCDIR)$(DELIM)chip -I$(ARCHSRCDIR)$(DELIM)common + USRINCLUDES = -I$(TOPDIR)$(DELIM)sched -I$(ARCHSRCDIR)$(DELIM)chip -I$(ARCHSRCDIR)$(DELIM)common endif endif INCLUDES = $(ARCHSTDINCLUDES) $(USRINCLUDES) CFLAGS = $(ARCHWARNINGS) $(ARCHOPTIMIZATION) $(ARCHCPUFLAGS) $(INCLUDES) $(ARCHDEFINES) $(EXTRAFLAGS) -CPPFLAGS += -I$(ARCHSRCDIR) $(EXTRAFLAGS) +CPPFLAGS += -I$(TOPDIR)$(DELIM)sched -I$(ARCHSRCDIR)$(DELIM)chip -I$(ARCHSRCDIR)$(DELIM)common ifeq ($(CONFIG_WINDOWS_NATIVE),y) LDFLAGS += @"$(ARCHSRCDIR)/nuttx.linkcmd" diff --git a/arch/z16/src/z16f/Kconfig b/arch/z16/src/z16f/Kconfig index 1a958cebb9..88a2ec2cd1 100644 --- a/arch/z16/src/z16f/Kconfig +++ b/arch/z16/src/z16f/Kconfig @@ -43,7 +43,7 @@ endmenu # Z16F ESPI Configuration choice prompt "ZDS-II Toolchain version" - default Z16F_ZDSII_V521 + default Z16F_ZDSII_V522 config Z16F_ZDSII_V501 bool "ZDS-II 5.0.1" @@ -51,6 +51,9 @@ config Z16F_ZDSII_V501 config Z16F_ZDSII_V521 bool "ZDS-II 5.2.1" +config Z16F_ZDSII_V522 + bool "ZDS-II 5.2.2" + endchoice # ZDS-II Toolchain version endif # ARCH_CHIP_Z16F diff --git a/arch/z16/src/z16f/Toolchain.defs b/arch/z16/src/z16f/Toolchain.defs index 3e517a5610..6dedd02507 100644 --- a/arch/z16/src/z16f/Toolchain.defs +++ b/arch/z16/src/z16f/Toolchain.defs @@ -49,6 +49,9 @@ ZDSVERSION := 5.0.1 else ifeq ($(CONFIG_Z16F_ZDSII_V521),y) INSTALLROOT = C:/ZiLOG ZDSVERSION := 5.2.1 +else ifeq ($(CONFIG_Z16F_ZDSII_V522),y) +INSTALLROOT = C:/ZiLOG +ZDSVERSION := 5.2.2 endif ifeq ($(CONFIG_WINDOWS_NATIVE),y) diff --git a/arch/z16/src/z16f/chip.h b/arch/z16/src/z16f/chip.h index 64a17940cc..3ef977e33e 100644 --- a/arch/z16/src/z16f/chip.h +++ b/arch/z16/src/z16f/chip.h @@ -36,7 +36,7 @@ # include <nuttx/spi/spi.h> #endif -#include "common/z16_internal.h" +#include "z16_internal.h" /************************************************************************************ * Pre-processor Definitions diff --git a/arch/z16/src/z16f/z16f_head.S b/arch/z16/src/z16f/z16f_head.S index f43d2407c1..bcbf0a7689 100644 --- a/arch/z16/src/z16f/z16f_head.S +++ b/arch/z16/src/z16f/z16f_head.S @@ -26,7 +26,7 @@ #include <nuttx/config.h> #include <arch/irq.h> #include <arch/board/board.h> -#include "common/z16_internal.h" +#include "z16_internal.h" /************************************************************************** * Pre-processor Definitions diff --git a/arch/z16/src/z16f/z16f_irq.c b/arch/z16/src/z16f/z16f_irq.c index 2266adcf1a..7edf97230c 100644 --- a/arch/z16/src/z16f/z16f_irq.c +++ b/arch/z16/src/z16f/z16f_irq.c @@ -24,6 +24,7 @@ #include <nuttx/config.h> +#include <sys/types.h> #include <errno.h> #include <nuttx/irq.h> diff --git a/arch/z16/src/z16f/z16f_lowuart.S b/arch/z16/src/z16f/z16f_lowuart.S index 8afbfbfb9f..c917111215 100644 --- a/arch/z16/src/z16f/z16f_lowuart.S +++ b/arch/z16/src/z16f/z16f_lowuart.S @@ -25,7 +25,7 @@ #include <nuttx/config.h> #include "chip.h" -#include "common/z16_internal.h" +#include "z16_internal.h" #ifdef USE_LOWUARTINIT diff --git a/arch/z16/src/z16f/z16f_serial.c b/arch/z16/src/z16f/z16f_serial.c index d3264dd03c..a6b8db2160 100644 --- a/arch/z16/src/z16f/z16f_serial.c +++ b/arch/z16/src/z16f/z16f_serial.c @@ -139,36 +139,7 @@ static struct z16f_uart_s g_uart0priv = CONFIG_UART0_2STOP /* stopbits2 */ }; -static uart_dev_t g_uart0port = -{ - 0, /* open_count */ - false, /* xmitwaiting */ - false, /* recvwaiting */ -#ifdef CONFIG_UART0_SERIAL_CONSOLE - true, /* isconsole */ -#else - false, /* isconsole */ -#endif - { 0 }, /* closesem */ - { 0 }, /* xmitsem */ - { 0 }, /* recvsem */ - { - { 0 }, /* xmit.sem */ - 0, /* xmit.head */ - 0, /* xmit.tail */ - CONFIG_UART0_TXBUFSIZE, /* xmit.size */ - g_uart0txbuffer, /* xmit.buffer */ - }, - { - { 0 }, /* recv.sem */ - 0, /* recv.head */ - 0, /* recv.tail */ - CONFIG_UART0_RXBUFSIZE, /* recv.size */ - g_uart0rxbuffer, /* recv.buffer */ - }, - &g_uart_ops, /* ops */ - &g_uart0priv, /* priv */ -}; +static uart_dev_t g_uart0port; #endif #ifdef CONFIG_Z16F_UART1 @@ -186,36 +157,7 @@ static struct z16f_uart_s g_uart1priv = CONFIG_UART1_2STOP /* stopbits2 */ }; -static uart_dev_t g_uart1port = -{ - 0, /* open_count */ - false, /* xmitwaiting */ - false, /* recvwaiting */ -#ifdef CONFIG_UART1_SERIAL_CONSOLE - true, /* isconsole */ -#else - false, /* isconsole */ -#endif - { 0 }, /* closesem */ - { 0 }, /* xmitsem */ - { 0 }, /* recvsem */ - { - { 0 }, /* xmit.sem */ - 0, /* xmit.head */ - 0, /* xmit.tail */ - CONFIG_UART1_TXBUFSIZE, /* xmit.size */ - g_uart1txbuffer, /* xmit.buffer */ - }, - { - { 0 }, /* recv.sem */ - 0, /* recv.head */ - 0, /* recv.tail */ - CONFIG_UART1_RXBUFSIZE, /* recv.size */ - g_uart1rxbuffer, /* recv.buffer */ - }, - &g_uart_ops, /* ops */ - &g_uart1priv, /* priv */ -}; +static uart_dev_t g_uart1port; #endif /* Now, which one with be tty0/console and which tty1? */ @@ -709,6 +651,19 @@ void z16_earlyserialinit(void) regval = getreg8(Z16F_GPIOA_AFH); regval &= ~0x30; putreg8(regval, Z16F_GPIOA_AFH); + + /* Initialize the UART structure */ + + memset(&g_uart0port, 0, sizeof(uart_dev_t)); +#ifdef CONFIG_UART0_SERIAL_CONSOLE + g_uart0port.isconsole = true; +#endif + g_uart0port.xmit.size = CONFIG_UART0_TXBUFSIZE; + g_uart0port.xmit.buffer = g_uart0txbuffer; + g_uart0port.recv.size = CONFIG_UART0_RXBUFSIZE; + g_uart0port.recv.buffer = g_uart0rxbuffer; + g_uart0port.ops = &g_uart_ops; + g_uart0port.priv = &g_uart0priv; #endif #ifdef CONFIG_Z16F_UART1 @@ -721,6 +676,19 @@ void z16_earlyserialinit(void) regval = getreg8(Z16F_GPIOD_AFH); regval &= ~0x30; putreg8(regval, Z16F_GPIOD_AFH); + + /* Initialize the UART structure */ + + memset(&g_uart1port, 0, sizeof(uart_dev_t)); +#ifdef CONFIG_UART1_SERIAL_CONSOLE + g_uart1port.isconsole = true; +#endif + g_uart1port.xmit.size = CONFIG_UART1_TXBUFSIZE; + g_uart1port.xmit.buffer = g_uart1txbuffer; + g_uart1port.recv.size = CONFIG_UART1_RXBUFSIZE; + g_uart1port.recv.buffer = g_uart1rxbuffer; + g_uart1port.ops = &g_uart_ops; + g_uart1port.priv = &g_uart1priv; #endif /* Disable UART interrupts */ @@ -827,14 +795,6 @@ int up_putc(int ch) putreg8((uint8_t)(ch), Z16F_UART0_TXD) #endif -/**************************************************************************** - * Private Function Prototypes - ****************************************************************************/ - -/**************************************************************************** - * Private Data - ****************************************************************************/ - /**************************************************************************** * Private Functions ****************************************************************************/ diff --git a/arch/z16/src/z16f/z16f_sysexec.c b/arch/z16/src/z16f/z16f_sysexec.c index 25afe02fb1..f22be21d46 100644 --- a/arch/z16/src/z16f/z16f_sysexec.c +++ b/arch/z16/src/z16f/z16f_sysexec.c @@ -76,42 +76,42 @@ void z16f_sysexec(FAR chipreg_t *regs) excp = getreg16(Z16F_SYSEXCP); if ((excp & Z16F_SYSEXCP_SPOVF) != 0) { - err("ERROR: SP OVERFLOW\n"); + _err("ERROR: SP OVERFLOW\n"); } if ((excp & Z16F_SYSEXCP_PCOVF) != 0) { - err("ERROR: PC OVERFLOW\n"); + _err("ERROR: PC OVERFLOW\n"); } if ((excp & Z16F_SYSEXCP_DIV0) != 0) { - err("ERROR: Divide by zero\n"); + _err("ERROR: Divide by zero\n"); } if ((excp & Z16F_SYSEXCP_DIVOVF) != 0) { - err("ERROR: Divide overflow\n"); + _err("ERROR: Divide overflow\n"); } if ((excp & Z16F_SYSEXCP_ILL) != 0) { - err("ERROR: Illegal instruction\n"); + _err("ERROR: Illegal instruction\n"); } if ((excp & Z16F_SYSEXCP_WDTOSC) != 0) { - err("ERROR: WDT oscillator failure\n"); + _err("ERROR: WDT oscillator failure\n"); } if ((excp & Z16F_SYSEXCP_PRIOSC) != 0) { - err("ERROR: Primary Oscillator Failure\n"); + _err("ERROR: Primary Oscillator Failure\n"); } if ((excp & Z16F_SYSEXCP_WDT) != 0) { - err("ERROR: Watchdog timeout\n"); + _err("ERROR: Watchdog timeout\n"); z16f_reset(); } diff --git a/boards/Board.mk b/boards/Board.mk index 586d9b2a5a..c2e38ac6d7 100644 --- a/boards/Board.mk +++ b/boards/Board.mk @@ -79,9 +79,9 @@ ifneq ($(ZDSVERSION),) ifeq ($(WINTOOL),y) WSCHEDSRCDIR = ${shell cygpath -w $(SCHEDSRCDIR)} WARCHSRCDIR = ${shell cygpath -w $(ARCHSRCDIR)} - USRINCLUDES = -usrinc:'.;$(WSCHEDSRCDIR);$(WARCHSRCDIR)$(DELIM)chip;$(WARCHSRCDIR)$(DELIM)common' + USRINCLUDES = -usrinc:'.;$(WSCHEDSRCDIR);$(WARCHSRCDIR)\chip;$(WARCHSRCDIR)\common' else - USRINCLUDES = -usrinc:".;$(SCHEDSRCDIR);$(ARCHSRCDIR)$(DELIMI)chip;$(ARCHSRCDIR)$(DELIM)common" + USRINCLUDES = -usrinc:".;$(SCHEDSRCDIR);$(ARCHSRCDIR)$(DELIM)chip;$(ARCHSRCDIR)$(DELIM)common" endif else ifeq ($(WINTOOL),y) diff --git a/boards/z16/z16f/z16f2800100zcog/README.txt b/boards/z16/z16f/z16f2800100zcog/README.txt index 22387c42c5..9f7be4e98d 100644 --- a/boards/z16/z16f/z16f2800100zcog/README.txt +++ b/boards/z16/z16f/z16f2800100zcog/README.txt @@ -98,6 +98,9 @@ Version 5.2.1 There are a few outstanding build issues, but it seems close enough for the time being. +Version 5.2.2 + Verified April 29, 2020. No serious compilation issues were encountered. + Other Versions If you use any version of ZDS-II or if you install ZDS-II at any location diff --git a/boards/z16/z16f/z16f2800100zcog/scripts/Make.defs b/boards/z16/z16f/z16f2800100zcog/scripts/Make.defs index 300783d401..4240578315 100644 --- a/boards/z16/z16f/z16f2800100zcog/scripts/Make.defs +++ b/boards/z16/z16f/z16f2800100zcog/scripts/Make.defs @@ -1,35 +1,20 @@ ############################################################################ # boards/z16/z16f/z16f2800100zcog/scripts/Make.defs # -# Copyright (C) 2014, 2017, 2020 Gregory Nutt. All rights reserved. -# Author: Gregory Nutt <gnutt@nuttx.org> +# 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 # -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: +# http://www.apache.org/licenses/LICENSE-2.0 # -# 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. +# 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. # ############################################################################ @@ -81,7 +66,8 @@ ARFLAGS = -quiet -warn # Linker definitions -LINKCMDTEMPLATE = $(TOPDIR)$(DELIM)boards$(DELIM)$(CONFIG_ARCH_CHIP)$(DELIM)z16f2800100zcog$(DELIM)scripts$(DELIM)z16f2800100zcog.linkcmd +LDSCRIPT = z16f2800100zcog.linkcmd +LINKCMDTEMPLATE = $(TOPDIR)$(DELIM)boards$(DELIM)$(CONFIG_ARCH)$(DELIM)$(CONFIG_ARCH_CHIP)$(DELIM)$(CONFIG_ARCH_BOARD)$(DELIM)scripts$(DELIM)$(LDSCRIPT) # Windows native host tool definitions diff --git a/boards/z16/z16f/z16f2800100zcog/src/Makefile b/boards/z16/z16f/z16f2800100zcog/src/Makefile index f877d62d1a..860be9e0b0 100644 --- a/boards/z16/z16f/z16f2800100zcog/src/Makefile +++ b/boards/z16/z16f/z16f2800100zcog/src/Makefile @@ -1,35 +1,20 @@ ############################################################################ # boards/z16/z16f/z16f2800100zcog/Makefile # -# Copyright (C) 2008, 2012 Gregory Nutt. All rights reserved. -# Author: Gregory Nutt <gnutt@nuttx.org> +# 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 # -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: +# http://www.apache.org/licenses/LICENSE-2.0 # -# 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. +# 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. # ############################################################################ @@ -38,4 +23,8 @@ ASRCS = CSRCS = z16f_boot.c z16f_leds.c +ifeq ($(CONFIG_LIB_BOARDCTL),y) +CSRCS += z16f_appinit.c +endif + include $(TOPDIR)/boards/Board.mk diff --git a/boards/z16/z16f/z16f2800100zcog/src/z16f_appinit.c b/boards/z16/z16f/z16f2800100zcog/src/z16f_appinit.c new file mode 100644 index 0000000000..a88d794ac4 --- /dev/null +++ b/boards/z16/z16f/z16f2800100zcog/src/z16f_appinit.c @@ -0,0 +1,71 @@ +/**************************************************************************** + * boards/z16/z16f/z16f2800100zcog/src/z16f_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 <nuttx/config.h> + +#include <stdint.h> + +#include <nuttx/board.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) +{ + return OK; +} diff --git a/boards/z16/z16f/z16f2800100zcog/src/z16f_boot.c b/boards/z16/z16f/z16f2800100zcog/src/z16f_boot.c index 3024ad13b9..e9bd9f68a1 100644 --- a/boards/z16/z16f/z16f2800100zcog/src/z16f_boot.c +++ b/boards/z16/z16f/z16f2800100zcog/src/z16f_boot.c @@ -1,37 +1,20 @@ /**************************************************************************** * boards/z16/z16f/z16f2800100zcog/src/z16f_boot.c * - * Copyright (C) 2008, 2014 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt <gnutt@nuttx.org> + * 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 * - * Based upon sample code included with the Zilog ZDS-II toolchain. + * http://www.apache.org/licenses/LICENSE-2.0 * - * 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. + * 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. * ****************************************************************************/ @@ -43,10 +26,6 @@ #include "chip.h" -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - /**************************************************************************** * Private Functions ****************************************************************************/ @@ -59,6 +38,8 @@ * are set in the associated device drivers (such as UART, SPI, I2C, * etc.) and must be preserved. * + * Based upon sample code included with the Zilog ZDS-II toolchain. + * ****************************************************************************/ static void z16f_gpioinit(void) @@ -88,7 +69,37 @@ static void z16f_gpioinit(void) * Public Functions ****************************************************************************/ +/**************************************************************************** + * Name: z16f_board_initialize + * + * Description: + * All Z16 architectures must provide the following entry point. This + * entry point is called early in the initialization -- after all memory + * has been configured but before any devices have been initialized. + * + ****************************************************************************/ + void z16f_board_initialize(void) { z16f_gpioinit(); } + +/**************************************************************************** + * 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) +{ +} +#endif diff --git a/boards/z16/z16f/z16f2800100zcog/src/z16f_leds.c b/boards/z16/z16f/z16f2800100zcog/src/z16f_leds.c index 8082348658..1748efd29d 100644 --- a/boards/z16/z16f/z16f2800100zcog/src/z16f_leds.c +++ b/boards/z16/z16f/z16f2800100zcog/src/z16f_leds.c @@ -37,18 +37,6 @@ #include "z16_internal.h" -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -/**************************************************************************** - * Private Data - ****************************************************************************/ - -/**************************************************************************** - * Private Functions - ****************************************************************************/ - /**************************************************************************** * Public Functions ****************************************************************************/ @@ -60,7 +48,7 @@ #ifdef CONFIG_ARCH_LEDS void board_autoled_initialize(void) { - /* The following is performed up_board_initialize() as well */ + /* The following is performed z16f_board_initialize() as well */ putreg8(getreg8(Z16F_GPIOA_OUT) | 0x07, Z16F_GPIOA_OUT); putreg8(getreg8(Z16F_GPIOA_DD) & 0xf8, Z16F_GPIOA_DD); diff --git a/sched/sched/sched_mergeprioritized.c b/sched/sched/sched_mergeprioritized.c index 7fb7d07284..4372588c43 100644 --- a/sched/sched/sched_mergeprioritized.c +++ b/sched/sched/sched_mergeprioritized.c @@ -1,35 +1,20 @@ /**************************************************************************** * sched/sched/sched_mergeprioritized.c * - * Copyright (C) 2016 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt <gnutt@nuttx.org> + * 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 * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: + * http://www.apache.org/licenses/LICENSE-2.0 * - * 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. + * 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. * ****************************************************************************/ @@ -78,7 +63,7 @@ void sched_mergeprioritized(FAR dq_queue_t *list1, FAR dq_queue_t *list2, uint8_t task_state) { - FAR dq_queue_t clone; + dq_queue_t clone; FAR struct tcb_s *tcb1; FAR struct tcb_s *tcb2; FAR struct tcb_s *tmp;