You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by ag...@apache.org on 2020/04/30 15:58:16 UTC

[incubator-nuttx] branch master updated: arch/z16: Build update

This is an automated email from the ASF dual-hosted git repository.

aguettouche pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git


The following commit(s) were added to refs/heads/master by this push:
     new 317a8a8  arch/z16:  Build update
317a8a8 is described below

commit 317a8a8942d65e992b2de6a9c704db0bb0cf7b3d
Author: Gregory Nutt <gn...@nuttx.org>
AuthorDate: Wed Apr 29 21:41:57 2020 -0600

    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 +
 boards/z16/z16f/z16f2800100zcog/scripts/Make.defs  | 42 ++++------
 boards/z16/z16f/z16f2800100zcog/src/Makefile       | 43 ++++------
 .../src/{z16f_leds.c => z16f_appinit.c}            | 81 +++++++-----------
 boards/z16/z16f/z16f2800100zcog/src/z16f_boot.c    | 77 +++++++++--------
 boards/z16/z16f/z16f2800100zcog/src/z16f_leds.c    | 14 +---
 sched/sched/sched_mergeprioritized.c               | 41 +++------
 17 files changed, 185 insertions(+), 292 deletions(-)

diff --git a/arch/z16/src/Makefile b/arch/z16/src/Makefile
index 6d4d956..51ae243 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 <gn...@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 1a958ce..88a2ec2 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 3e517a5..6dedd02 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 64a1794..3ef977e 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 f43d240..bcbf0a7 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 2266adc..7edf972 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 8afbfbf..c917111 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 d3264dd..a6b8db2 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 */
@@ -828,14 +796,6 @@ int up_putc(int ch)
 #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 25afe02..f22be21 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 586d9b2..c2e38ac 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 22387c4..9f7be4e 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 300783d..4240578 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 <gn...@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 f877d62..860be9e 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 <gn...@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_leds.c b/boards/z16/z16f/z16f2800100zcog/src/z16f_appinit.c
similarity index 51%
copy from boards/z16/z16f/z16f2800100zcog/src/z16f_leds.c
copy to boards/z16/z16f/z16f2800100zcog/src/z16f_appinit.c
index 8082348..a88d794 100644
--- a/boards/z16/z16f/z16f2800100zcog/src/z16f_leds.c
+++ b/boards/z16/z16f/z16f2800100zcog/src/z16f_appinit.c
@@ -1,5 +1,5 @@
 /****************************************************************************
- * boards/z16/z16f/z16f2800100zcog/z16f_leds.c
+ * 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
@@ -18,75 +18,54 @@
  *
  ****************************************************************************/
 
-/* The z16f2800100zcog board has four LEDs:
- *
- * - Green LED D1 which illuminates in the presence of Vcc
- * - Red LED D2 connected to chip port PA0_T0IN
- * - Yellow LED D3 connected to chip port PA1_T0OUT
- * - Green LED D4 connected to chip port PA2_DE0
- */
-
 /****************************************************************************
  * Included Files
  ****************************************************************************/
 
 #include <nuttx/config.h>
 
-#include <nuttx/board.h>
-#include <arch/board/board.h>
+#include <stdint.h>
 
-#include "z16_internal.h"
+#include <nuttx/board.h>
 
 /****************************************************************************
  * Pre-processor Definitions
  ****************************************************************************/
 
-/****************************************************************************
- * Private Data
- ****************************************************************************/
-
-/****************************************************************************
- * Private Functions
- ****************************************************************************/
+#ifndef OK
+#  define OK 0
+#endif
 
 /****************************************************************************
  * Public Functions
  ****************************************************************************/
 
 /****************************************************************************
- * Name: board_autoled_initialize
- ****************************************************************************/
-
-#ifdef CONFIG_ARCH_LEDS
-void board_autoled_initialize(void)
-{
-  /* The following is performed up_board_initialize() as well */
-
-  putreg8(getreg8(Z16F_GPIOA_OUT) | 0x07, Z16F_GPIOA_OUT);
-  putreg8(getreg8(Z16F_GPIOA_DD) & 0xf8, Z16F_GPIOA_DD);
-}
-
-/****************************************************************************
- * Name: board_autoled_on
- ****************************************************************************/
-
-void board_autoled_on(int led)
-{
-  if ((unsigned)led <= 7)
-    {
-       putreg8(((getreg8(Z16F_GPIOA_OUT) & 0xf8) | led), Z16F_GPIOA_OUT);
-    }
-}
-
-/****************************************************************************
- * Name: board_autoled_off
+ * 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.
+ *
  ****************************************************************************/
 
-void board_autoled_off(int led)
+int board_app_initialize(uintptr_t arg)
 {
-  if (led >= 1)
-    {
-      board_autoled_on(led - 1);
-    }
+  return OK;
 }
-#endif /* CONFIG_ARCH_LEDS */
diff --git a/boards/z16/z16f/z16f2800100zcog/src/z16f_boot.c b/boards/z16/z16f/z16f2800100zcog/src/z16f_boot.c
index 3024ad1..e9bd9f6 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 <gn...@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.
  *
  ****************************************************************************/
 
@@ -44,10 +27,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 8082348..1748efd 100644
--- a/boards/z16/z16f/z16f2800100zcog/src/z16f_leds.c
+++ b/boards/z16/z16f/z16f2800100zcog/src/z16f_leds.c
@@ -38,18 +38,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 7fb7d07..4372588 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 <gn...@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;