<div dir="ltr"><div>Took a while to get to but here is a new patch incorporating the feedback.</div><div><br></div><div>Sorry to drop this and run but I'm on vacation for a week as soon as I send this.  So don't expect to see responses from me until July 10th or later.<br></div><div><br></div><div>Once I'm back and this is through, expect to see some follow-on patches for enabling MPU, cache, and lwip support.  I have that working and tested but it needs some cleanup before I'll feel good about a patch.<br></div><div><br></div><div>---</div><div><br></div><div>diff --git a/bsps/arm/xilinx-zynqmp-rpu/console/console-config.c b/bsps/arm/xilinx-zynqmp-rpu/console/console-config.c<br>new file mode 100644<br>index 0000000000..469178fd86<br>--- /dev/null<br>+++ b/bsps/arm/xilinx-zynqmp-rpu/console/console-config.c<br>@@ -0,0 +1,128 @@<br>+/*<br>+ * SPDX-License-Identifier: BSD-2-Clause<br>+ *<br>+ * Copyright (C) 2013, 2017 embedded brains GmbH<br>+ *<br>+ * Copyright (C) 2019 DornerWorks<br>+ *<br>+ * Written by Jeff Kubascik <<a href="mailto:jeff.kubascik@dornerworks.com">jeff.kubascik@dornerworks.com</a>><br>+ *        and Josh Whitehead <<a href="mailto:josh.whitehead@dornerworks.com">josh.whitehead@dornerworks.com</a>><br>+ *<br>+ * Redistribution and use in source and binary forms, with or without<br>+ * modification, are permitted provided that the following conditions<br>+ * are met:<br>+ * 1. Redistributions of source code must retain the above copyright<br>+ *    notice, this list of conditions and the following disclaimer.<br>+ * 2. Redistributions in binary form must reproduce the above copyright<br>+ *    notice, this list of conditions and the following disclaimer in the<br>+ *    documentation and/or other materials provided with the distribution.<br>+ *<br>+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"<br>+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE<br>+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE<br>+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE<br>+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR<br>+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF<br>+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS<br>+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN<br>+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)<br>+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE<br>+ * POSSIBILITY OF SUCH DAMAGE.<br>+ */<br>+<br>+#include <rtems/console.h><br>+#include <rtems/bspIo.h><br>+#include <rtems/sysinit.h><br>+<br>+#include <bsp/irq.h><br>+#include <dev/serial/zynq-uart.h><br>+<br>+#include <bspopts.h><br>+<br>+static zynq_uart_context zynqmp_uart_instances[2] = {<br>+  {<br>+    .base = RTEMS_TERMIOS_DEVICE_CONTEXT_INITIALIZER( "Zynq UART 0" ),<br>+    .regs = (volatile struct zynq_uart *) 0xff000000,<br>+    .irq = ZYNQMP_IRQ_UART_0<br>+  }, {<br>+    .base = RTEMS_TERMIOS_DEVICE_CONTEXT_INITIALIZER( "Zynq UART 1" ),<br>+    .regs = (volatile struct zynq_uart *) 0xff010000,<br>+    .irq = ZYNQMP_IRQ_UART_1<br>+  }<br>+};<br>+<br>+rtems_status_code console_initialize(<br>+  rtems_device_major_number major,<br>+  rtems_device_minor_number minor,<br>+  void *arg<br>+)<br>+{<br>+  size_t i;<br>+<br>+  for (i = 0; i < RTEMS_ARRAY_SIZE(zynqmp_uart_instances); ++i) {<br>+    char uart[] = "/dev/ttySX";<br>+<br>+    uart[sizeof(uart) - 2] = (char) ('0' + i);<br>+    rtems_termios_device_install(<br>+      &uart[0],<br>+      &zynq_uart_handler,<br>+      NULL,<br>+      &zynqmp_uart_instances[i].base<br>+    );<br>+<br>+    if (i == BSP_CONSOLE_MINOR) {<br>+      link(&uart[0], CONSOLE_DEVICE_NAME);<br>+    }<br>+  }<br>+<br>+  return RTEMS_SUCCESSFUL;<br>+}<br>+<br>+void zynqmp_debug_console_flush(void)<br>+{<br>+  zynq_uart_reset_tx_flush(&zynqmp_uart_instances[BSP_CONSOLE_MINOR]);<br>+}<br>+<br>+static void zynqmp_debug_console_out(char c)<br>+{<br>+  rtems_termios_device_context *base =<br>+    &zynqmp_uart_instances[BSP_CONSOLE_MINOR].base;<br>+<br>+  zynq_uart_write_polled(base, c);<br>+}<br>+<br>+static void zynqmp_debug_console_init(void)<br>+{<br>+  rtems_termios_device_context *base =<br>+    &zynqmp_uart_instances[BSP_CONSOLE_MINOR].base;<br>+<br>+  zynq_uart_initialize(base);<br>+  BSP_output_char = zynqmp_debug_console_out;<br>+}<br>+<br>+static void zynqmp_debug_console_early_init(char c)<br>+{<br>+  rtems_termios_device_context *base =<br>+    &zynqmp_uart_instances[BSP_CONSOLE_MINOR].base;<br>+<br>+  zynq_uart_initialize(base);<br>+  zynqmp_debug_console_out(c);<br>+}<br>+<br>+static int zynqmp_debug_console_in(void)<br>+{<br>+  rtems_termios_device_context *base =<br>+    &zynqmp_uart_instances[BSP_CONSOLE_MINOR].base;<br>+<br>+  return zynq_uart_read_polled(base);<br>+}<br>+<br>+BSP_output_char_function_type BSP_output_char = zynqmp_debug_console_early_init;<br>+<br>+BSP_polling_getchar_function_type BSP_poll_char = zynqmp_debug_console_in;<br>+<br>+RTEMS_SYSINIT_ITEM(<br>+  zynqmp_debug_console_init,<br>+  RTEMS_SYSINIT_BSP_START,<br>+  RTEMS_SYSINIT_ORDER_LAST_BUT_5<br>+);<br>diff --git a/bsps/arm/xilinx-zynqmp-rpu/include/bsp.h b/bsps/arm/xilinx-zynqmp-rpu/include/bsp.h<br>new file mode 100644<br>index 0000000000..9b71487999<br>--- /dev/null<br>+++ b/bsps/arm/xilinx-zynqmp-rpu/include/bsp.h<br>@@ -0,0 +1,93 @@<br>+/**<br>+ * @file<br>+ * @ingroup RTEMSBSPsARMZynqMP<br>+ * @brief Global BSP definitions.<br>+ */<br>+<br>+/*<br>+ * SPDX-License-Identifier: BSD-2-Clause<br>+ *<br>+ * Copyright (C) 2013, 2014 embedded brains GmbH<br>+ *<br>+ * Copyright (C) 2019 DornerWorks<br>+ *<br>+ * Written by Jeff Kubascik <<a href="mailto:jeff.kubascik@dornerworks.com">jeff.kubascik@dornerworks.com</a>><br>+ *        and Josh Whitehead <<a href="mailto:josh.whitehead@dornerworks.com">josh.whitehead@dornerworks.com</a>><br>+ *<br>+ * Redistribution and use in source and binary forms, with or without<br>+ * modification, are permitted provided that the following conditions<br>+ * are met:<br>+ * 1. Redistributions of source code must retain the above copyright<br>+ *    notice, this list of conditions and the following disclaimer.<br>+ * 2. Redistributions in binary form must reproduce the above copyright<br>+ *    notice, this list of conditions and the following disclaimer in the<br>+ *    documentation and/or other materials provided with the distribution.<br>+ *<br>+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"<br>+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE<br>+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE<br>+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE<br>+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR<br>+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF<br>+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS<br>+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN<br>+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)<br>+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE<br>+ * POSSIBILITY OF SUCH DAMAGE.<br>+ */<br>+<br>+#ifndef LIBBSP_ARM_XILINX_ZYNQMP_BSP_H<br>+#define LIBBSP_ARM_XILINX_ZYNQMP_BSP_H<br>+<br>+/**<br>+ * @defgroup RTEMSBSPsARMZynqMP Xilinx Zynq UltraScale+ MPSoC<br>+ *<br>+ * @ingroup RTEMSBSPsARM<br>+ *<br>+ * @brief Xilinx Zynq UltraScale+ MPSoC Board Support Package.<br>+ *<br>+ * @{<br>+ */<br>+<br>+#include <bspopts.h><br>+<br>+#define BSP_FEATURE_IRQ_EXTENSION<br>+<br>+#ifndef ASM<br>+<br>+#include <rtems.h><br>+<br>+#include <bsp/default-initial-extension.h><br>+#include <bsp/start.h><br>+<br>+#ifdef __cplusplus<br>+extern "C" {<br>+#endif /* __cplusplus */<br>+<br>+<br>+#define BSP_ARM_GIC_CPUIF_BASE 0x00F9001000<br>+<br>+#define BSP_ARM_GIC_DIST_BASE 0xF9000000<br>+<br>+#define BSP_ARM_A9MPCORE_SCU_BASE 0<br>+<br>+#define BSP_ARM_A9MPCORE_GT_BASE 0<br>+<br>+/**<br>+ * @brief Zynq UltraScale+ MPSoC specific set up of the MMU.<br>+ *<br>+ * Provide in the application to override the defaults in the BSP.<br>+ */<br>+BSP_START_TEXT_SECTION void zynqmp_setup_mmu_and_cache(void);<br>+<br>+void zynqmp_debug_console_flush(void);<br>+<br>+#ifdef __cplusplus<br>+}<br>+#endif /* __cplusplus */<br>+<br>+#endif /* ASM */<br>+<br>+/** @} */<br>+<br>+#endif /* LIBBSP_ARM_XILINX_ZYNQMP_BSP_H */<br>diff --git a/bsps/arm/xilinx-zynqmp-rpu/include/bsp/irq.h b/bsps/arm/xilinx-zynqmp-rpu/include/bsp/irq.h<br>new file mode 100644<br>index 0000000000..681ccfb48c<br>--- /dev/null<br>+++ b/bsps/arm/xilinx-zynqmp-rpu/include/bsp/irq.h<br>@@ -0,0 +1,81 @@<br>+/**<br>+ * @file<br>+ * @ingroup zynqmp_interrupt<br>+ * @brief Interrupt definitions.<br>+ */<br>+<br>+/*<br>+ * SPDX-License-Identifier: BSD-2-Clause<br>+ *<br>+ * Copyright (C) 2013 embedded brains GmbH<br>+ *<br>+ * Copyright (C) 2019 DornerWorks<br>+ *<br>+ * Written by Jeff Kubascik <<a href="mailto:jeff.kubascik@dornerworks.com">jeff.kubascik@dornerworks.com</a>><br>+ *        and Josh Whitehead <<a href="mailto:josh.whitehead@dornerworks.com">josh.whitehead@dornerworks.com</a>><br>+ *<br>+ * Redistribution and use in source and binary forms, with or without<br>+ * modification, are permitted provided that the following conditions<br>+ * are met:<br>+ * 1. Redistributions of source code must retain the above copyright<br>+ *    notice, this list of conditions and the following disclaimer.<br>+ * 2. Redistributions in binary form must reproduce the above copyright<br>+ *    notice, this list of conditions and the following disclaimer in the<br>+ *    documentation and/or other materials provided with the distribution.<br>+ *<br>+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"<br>+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE<br>+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE<br>+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE<br>+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR<br>+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF<br>+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS<br>+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN<br>+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)<br>+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE<br>+ * POSSIBILITY OF SUCH DAMAGE.<br>+ */<br>+<br>+#ifndef LIBBSP_ARM_XILINX_ZYNQMP_IRQ_H<br>+#define LIBBSP_ARM_XILINX_ZYNQMP_IRQ_H<br>+<br>+#ifndef ASM<br>+<br>+#include <rtems/irq.h><br>+#include <rtems/irq-extension.h><br>+<br>+#include <dev/irq/arm-gic-irq.h><br>+<br>+#ifdef __cplusplus<br>+extern "C" {<br>+#endif /* __cplusplus */<br>+<br>+/* SPIs */<br>+#define ZYNQMP_IRQ_UART_0 53<br>+#define ZYNQMP_IRQ_UART_1 54<br>+<br>+#define ZYNQMP_IRQ_TTC_0_0 68<br>+#define ZYNQMP_IRQ_TTC_0_1 69<br>+#define ZYNQMP_IRQ_TTC_0_2 70<br>+#define ZYNQMP_IRQ_TTC_1_0 71<br>+#define ZYNQMP_IRQ_TTC_1_1 72<br>+#define ZYNQMP_IRQ_TTC_1_2 73<br>+#define ZYNQMP_IRQ_TTC_2_0 74<br>+#define ZYNQMP_IRQ_TTC_2_1 75<br>+#define ZYNQMP_IRQ_TTC_2_2 76<br>+#define ZYNQMP_IRQ_TTC_3_0 77<br>+#define ZYNQMP_IRQ_TTC_3_1 78<br>+#define ZYNQMP_IRQ_TTC_3_2 79<br>+<br>+<br>+#define BSP_INTERRUPT_VECTOR_COUNT 188<br>+<br>+/** @} */<br>+<br>+#ifdef __cplusplus<br>+}<br>+#endif /* __cplusplus */<br>+<br>+#endif /* ASM */<br>+<br>+#endif /* LIBBSP_ARM_XILINX_ZYNQMP_IRQ_H */<br>diff --git a/bsps/arm/xilinx-zynqmp-rpu/include/tm27.h b/bsps/arm/xilinx-zynqmp-rpu/include/tm27.h<br>new file mode 100644<br>index 0000000000..14214fe151<br>--- /dev/null<br>+++ b/bsps/arm/xilinx-zynqmp-rpu/include/tm27.h<br>@@ -0,0 +1,54 @@<br>+/**<br>+ * @file<br>+ * @ingroup zynqmp_tm27<br>+ * @brief Interrupt mechanisms for tm27 test.<br>+ */<br>+<br>+/*<br>+ * SPDX-License-Identifier: BSD-2-Clause<br>+ *<br>+ * Copyright (C) 2013 embedded brains GmbH<br>+ *<br>+ * Copyright (C) 2019 DornerWorks<br>+ *<br>+ * Written by Jeff Kubascik <<a href="mailto:jeff.kubascik@dornerworks.com">jeff.kubascik@dornerworks.com</a>><br>+ *        and Josh Whitehead <<a href="mailto:josh.whitehead@dornerworks.com">josh.whitehead@dornerworks.com</a>><br>+ *<br>+ * Redistribution and use in source and binary forms, with or without<br>+ * modification, are permitted provided that the following conditions<br>+ * are met:<br>+ * 1. Redistributions of source code must retain the above copyright<br>+ *    notice, this list of conditions and the following disclaimer.<br>+ * 2. Redistributions in binary form must reproduce the above copyright<br>+ *    notice, this list of conditions and the following disclaimer in the<br>+ *    documentation and/or other materials provided with the distribution.<br>+ *<br>+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"<br>+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE<br>+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE<br>+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE<br>+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR<br>+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF<br>+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS<br>+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN<br>+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)<br>+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE<br>+ * POSSIBILITY OF SUCH DAMAGE.<br>+ */<br>+<br>+#ifndef _RTEMS_TMTEST27<br>+#error "This is an RTEMS internal file you must not include directly."<br>+#endif<br>+<br>+#ifndef __tm27_h<br>+#define __tm27_h<br>+<br>+/**<br>+ * @defgroup zynqmp_tm27 TM27 Test Support<br>+ * @ingroup RTEMSBSPsARMZynqMP<br>+ * @brief Interrupt Mechanisms for tm27 test<br>+ */<br>+<br>+#include <dev/irq/arm-gic-tm27.h><br>+<br>+#endif /* __tm27_h */<br>diff --git a/bsps/arm/xilinx-zynqmp-rpu/start/bspreset.c b/bsps/arm/xilinx-zynqmp-rpu/start/bspreset.c<br>new file mode 100644<br>index 0000000000..14f7d32436<br>--- /dev/null<br>+++ b/bsps/arm/xilinx-zynqmp-rpu/start/bspreset.c<br>@@ -0,0 +1,42 @@<br>+/*<br>+ * SPDX-License-Identifier: BSD-2-Clause<br>+ *<br>+ * Copyright (C) 2013 embedded brains GmbH<br>+ *<br>+ * Copyright (C) 2019 DornerWorks<br>+ *<br>+ * Written by Jeff Kubascik <<a href="mailto:jeff.kubascik@dornerworks.com">jeff.kubascik@dornerworks.com</a>><br>+ *        and Josh Whitehead <<a href="mailto:josh.whitehead@dornerworks.com">josh.whitehead@dornerworks.com</a>><br>+ *<br>+ * Redistribution and use in source and binary forms, with or without<br>+ * modification, are permitted provided that the following conditions<br>+ * are met:<br>+ * 1. Redistributions of source code must retain the above copyright<br>+ *    notice, this list of conditions and the following disclaimer.<br>+ * 2. Redistributions in binary form must reproduce the above copyright<br>+ *    notice, this list of conditions and the following disclaimer in the<br>+ *    documentation and/or other materials provided with the distribution.<br>+ *<br>+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"<br>+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE<br>+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE<br>+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE<br>+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR<br>+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF<br>+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS<br>+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN<br>+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)<br>+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE<br>+ * POSSIBILITY OF SUCH DAMAGE.<br>+ */<br>+<br>+#include <bsp.h><br>+<br>+void bsp_reset(void)<br>+{<br>+  zynqmp_debug_console_flush();<br>+<br>+  while (true) {<br>+    /* Wait */<br>+  }<br>+}<br>diff --git a/bsps/arm/xilinx-zynqmp-rpu/start/bspstart.c b/bsps/arm/xilinx-zynqmp-rpu/start/bspstart.c<br>new file mode 100644<br>index 0000000000..a3cc498d7e<br>--- /dev/null<br>+++ b/bsps/arm/xilinx-zynqmp-rpu/start/bspstart.c<br>@@ -0,0 +1,50 @@<br>+/*<br>+ * SPDX-License-Identifier: BSD-2-Clause<br>+ *<br>+ * Copyright (C) 2013, 2015 embedded brains GmbH<br>+ *<br>+ * Copyright (C) 2019 DornerWorks<br>+ *<br>+ * Written by Jeff Kubascik <<a href="mailto:jeff.kubascik@dornerworks.com">jeff.kubascik@dornerworks.com</a>><br>+ *        and Josh Whitehead <<a href="mailto:josh.whitehead@dornerworks.com">josh.whitehead@dornerworks.com</a>><br>+ *<br>+ * Redistribution and use in source and binary forms, with or without<br>+ * modification, are permitted provided that the following conditions<br>+ * are met:<br>+ * 1. Redistributions of source code must retain the above copyright<br>+ *    notice, this list of conditions and the following disclaimer.<br>+ * 2. Redistributions in binary form must reproduce the above copyright<br>+ *    notice, this list of conditions and the following disclaimer in the<br>+ *    documentation and/or other materials provided with the distribution.<br>+ *<br>+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"<br>+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE<br>+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE<br>+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE<br>+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR<br>+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF<br>+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS<br>+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN<br>+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)<br>+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE<br>+ * POSSIBILITY OF SUCH DAMAGE.<br>+ */<br>+<br>+#include <bsp.h><br>+#include <bsp/bootcard.h><br>+#include <bsp/irq-generic.h><br>+#include <bsp/linker-symbols.h><br>+<br>+#include <libcpu/arm-cp15.h><br>+<br>+void bsp_start(void)<br>+{<br>+  bsp_interrupt_initialize();<br>+  // TODO: enable cache<br>+#if 0<br>+  rtems_cache_coherent_add_area(<br>+    bsp_section_nocacheheap_begin,<br>+    (uintptr_t) bsp_section_nocacheheap_size<br>+  );<br>+#endif<br>+}<br>diff --git a/bsps/arm/xilinx-zynqmp-rpu/start/bspstarthooks.c b/bsps/arm/xilinx-zynqmp-rpu/start/bspstarthooks.c<br>new file mode 100644<br>index 0000000000..c0d35d31b7<br>--- /dev/null<br>+++ b/bsps/arm/xilinx-zynqmp-rpu/start/bspstarthooks.c<br>@@ -0,0 +1,66 @@<br>+/*<br>+ * SPDX-License-Identifier: BSD-2-Clause<br>+ *<br>+ * Copyright (C) 2013, 2014 embedded brains GmbH<br>+ *<br>+ * Copyright (C) 2019 DornerWorks<br>+ *<br>+ * Written by Jeff Kubascik <<a href="mailto:jeff.kubascik@dornerworks.com">jeff.kubascik@dornerworks.com</a>><br>+ *        and Josh Whitehead <<a href="mailto:josh.whitehead@dornerworks.com">josh.whitehead@dornerworks.com</a>><br>+ *<br>+ * Redistribution and use in source and binary forms, with or without<br>+ * modification, are permitted provided that the following conditions<br>+ * are met:<br>+ * 1. Redistributions of source code must retain the above copyright<br>+ *    notice, this list of conditions and the following disclaimer.<br>+ * 2. Redistributions in binary form must reproduce the above copyright<br>+ *    notice, this list of conditions and the following disclaimer in the<br>+ *    documentation and/or other materials provided with the distribution.<br>+ *<br>+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"<br>+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE<br>+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE<br>+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE<br>+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR<br>+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF<br>+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS<br>+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN<br>+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)<br>+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE<br>+ * POSSIBILITY OF SUCH DAMAGE.<br>+ */<br>+<br>+#include <bsp.h><br>+#include <bsp/start.h><br>+<br>+BSP_START_TEXT_SECTION void bsp_start_hook_0(void)<br>+{<br>+    /*<br>+     * On reset, V will be set.  This points the exceptions to the FSBL's vectors.  The FSBL<br>+     * should clear this bit before booting RTEMS but in some debugging<br>+     * configurations the bit may not be.  The other bits should already be clear<br>+     * on reset.  Since the correct settings in these bits are critical,<br>+     * make sure SCTLR[M, I, A, C, V] are cleared.  Afterwards, exceptions are<br>+     * handled by RTEMS.<br>+     * Note 1: The APU also does these steps in start.S in _start in the #if block:<br>+     *         `#if (__ARM_ARCH >= 7 && __ARM_ARCH_PROFILE == 'A') || __ARM_ARCH >= 8`<br>+     * Note 2: Not all Arm R cores need this (like the TMS570).  So, this probably should<br>+     *         be in this hook and not in start.S<br>+     * <br>+     * Ref: <a href="https://developer.arm.com/documentation/ddi0460/c/System-Control/Register-descriptions/c1--System-Control-Register?lang=en">https://developer.arm.com/documentation/ddi0460/c/System-Control/Register-descriptions/c1--System-Control-Register?lang=en</a><br>+     */<br>+<br>+    __asm__ volatile(<br>+      "mrc  p15, 0, r0, c1, c0, 0   \n"<br>+      "bic   r1, r0, #0x3000 \n"     // Clear V[13] and I[12]<br>+      "bic    r1, r1, #0x7 \n"        // Clear C[2] A[1] and M[0]<br>+      "mcr       p15, 0, r1, c1, c0, 0 \n"<br>+        : :);<br>+}<br>+<br>+BSP_START_TEXT_SECTION void bsp_start_hook_1(void)<br>+{<br>+  bsp_start_copy_sections();<br>+  // TODO: Setup/enable cache HERE<br>+  bsp_start_clear_bss();<br>+}<br>diff --git a/bsps/include/xil/xttcps_hw.h b/bsps/include/xil/xttcps_hw.h<br>new file mode 100644<br>index 0000000000..0872e66c8f<br>--- /dev/null<br>+++ b/bsps/include/xil/xttcps_hw.h<br>@@ -0,0 +1,223 @@<br>+/******************************************************************************<br>+* Copyright (C) 2010 - 2021 Xilinx, Inc.  All rights reserved.<br>+* SPDX-License-Identifier: MIT<br>+******************************************************************************/<br>+<br>+/*****************************************************************************/<br>+/**<br>+*<br>+* @file xttcps_hw.h<br>+* @addtogroup ttcps_v3_14<br>+* @{<br>+*<br>+* This file defines the hardware interface to one of the three timer counters<br>+* in the Ps block.<br>+*<br>+*<br>+* <pre><br>+* MODIFICATION HISTORY:<br>+*<br>+* Ver   Who    Date     Changes<br>+* ----- ------ -------- -------------------------------------------------<br>+* 1.00a drg/jz 01/21/10 First release<br>+* 3.00  kvn    02/13/15 Modified code for MISRA-C:2012 compliance.<br>+* 3.5   srm    10/06/17 Updated XTTCPS_COUNT_VALUE_MASK,<br>+*                       XTTCPS_INTERVAL_VAL_MASK, XTTCPS_MATCH_MASK macros to<br>+*                       mask 16 bit values for zynq and 32 bit values for<br>+*                       zynq ultrascale+mpsoc "<br>+* </pre><br>+*<br>+******************************************************************************/<br>+<br>+#ifndef XTTCPS_HW_H         /* prevent circular inclusions */<br>+#define XTTCPS_HW_H         /* by using protection macros */<br>+<br>+#ifdef __cplusplus<br>+extern "C" {<br>+#endif<br>+<br>+/***************************** Include Files *********************************/<br>+<br>+<br>+#ifndef __rtems__<br>+#include "xil_types.h"<br>+#include "xil_assert.h"<br>+#include "xil_io.h"<br>+#else<br>+#include "xil_types.h"<br>+static inline u32 Xil_In32(UINTPTR Addr)<br>+{<br>+   return *(volatile u32 *) Addr;<br>+}<br>+static inline void Xil_Out32(UINTPTR Addr, u32 Value)<br>+{<br>+       volatile u32 *LocalAddr = (volatile u32 *)Addr;<br>+      *LocalAddr = Value;<br>+}<br>+#endif /* __rtems__ */<br>+<br>+/************************** Constant Definitions *****************************/<br>+/*<br>+ * Flag for a9 processor<br>+ */<br>+#ifndef __rtems__<br>+ #if !defined (ARMR5) && !defined (__aarch64__) && !defined (ARMA53_32)<br>+ #define ARMA9<br>+ #endif<br>+#endif<br>+<br>+/** @name Register Map<br>+ *<br>+ * Register offsets from the base address of the device.<br>+ *<br>+ * @{<br>+ */<br>+#define XTTCPS_CLK_CNTRL_OFFSET          0x00000000U  /**< Clock Control Register */<br>+#define XTTCPS_CNT_CNTRL_OFFSET               0x0000000CU  /**< Counter Control Register*/<br>+#define XTTCPS_COUNT_VALUE_OFFSET    0x00000018U  /**< Current Counter Value */<br>+#define XTTCPS_INTERVAL_VAL_OFFSET     0x00000024U  /**< Interval Count Value */<br>+#define XTTCPS_MATCH_0_OFFSET           0x00000030U  /**< Match 1 value */<br>+#define XTTCPS_MATCH_1_OFFSET          0x0000003CU  /**< Match 2 value */<br>+#define XTTCPS_MATCH_2_OFFSET          0x00000048U  /**< Match 3 value */<br>+#define XTTCPS_ISR_OFFSET                      0x00000054U  /**< Interrupt Status Register */<br>+#define XTTCPS_IER_OFFSET                  0x00000060U  /**< Interrupt Enable Register */<br>+/* @} */<br>+<br>+/** @name Clock Control Register<br>+ * Clock Control Register definitions<br>+ * @{<br>+ */<br>+#define XTTCPS_CLK_CNTRL_PS_EN_MASK         0x00000001U  /**< Prescale enable */<br>+#define XTTCPS_CLK_CNTRL_PS_VAL_MASK 0x0000001EU  /**< Prescale value */<br>+#define XTTCPS_CLK_CNTRL_PS_VAL_SHIFT                  1U  /**< Prescale shift */<br>+#define XTTCPS_CLK_CNTRL_PS_DISABLE                           16U  /**< Prescale disable */<br>+#define XTTCPS_CLK_CNTRL_SRC_MASK           0x00000020U  /**< Clock source */<br>+#define XTTCPS_CLK_CNTRL_EXT_EDGE_MASK  0x00000040U  /**< External Clock edge */<br>+/* @} */<br>+<br>+/** @name Counter Control Register<br>+ * Counter Control Register definitions<br>+ * @{<br>+ */<br>+#define XTTCPS_CNT_CNTRL_DIS_MASK             0x00000001U /**< Disable the counter */<br>+#define XTTCPS_CNT_CNTRL_INT_MASK          0x00000002U /**< Interval mode */<br>+#define XTTCPS_CNT_CNTRL_DECR_MASK               0x00000004U /**< Decrement mode */<br>+#define XTTCPS_CNT_CNTRL_MATCH_MASK             0x00000008U /**< Match mode */<br>+#define XTTCPS_CNT_CNTRL_RST_MASK           0x00000010U /**< Reset counter */<br>+#define XTTCPS_CNT_CNTRL_EN_WAVE_MASK    0x00000020U /**< Enable waveform */<br>+#define XTTCPS_CNT_CNTRL_POL_WAVE_MASK 0x00000040U /**< Waveform polarity */<br>+#define XTTCPS_CNT_CNTRL_RESET_VALUE 0x00000021U /**< Reset value */<br>+/* @} */<br>+<br>+/** @name Current Counter Value Register<br>+ * Current Counter Value Register definitions<br>+ * @{<br>+ */<br>+#if defined(ARMA9)<br>+#define XTTCPS_COUNT_VALUE_MASK                0x0000FFFFU /**< 16-bit counter value */<br>+#else<br>+#define XTTCPS_COUNT_VALUE_MASK           0xFFFFFFFFU /**< 32-bit counter value */<br>+#endif<br>+/* @} */<br>+<br>+/** @name Interval Value Register<br>+ * Interval Value Register is the maximum value the counter will count up or<br>+ * down to.<br>+ * @{<br>+ */<br>+#if defined(ARMA9)<br>+#define XTTCPS_INTERVAL_VAL_MASK       (u32)(0x0000FFFF) /**< 16-bit Interval value*/<br>+#else<br>+#define XTTCPS_INTERVAL_VAL_MASK    (u32)(0xFFFFFFFF) /**< 32-bit Interval value*/<br>+#endif<br>+/* @} */<br>+<br>+/** @name Match Registers<br>+ * Definitions for Match registers, each timer counter has three match<br>+ * registers.<br>+ * @{<br>+ */<br>+#if defined(ARMA9)<br>+#define XTTCPS_MATCH_MASK            0x0000FFFFU /**< 16-bit Match value */<br>+#else<br>+#define XTTCPS_MATCH_MASK           0xFFFFFFFFU /**< 32-bit Match value */<br>+#endif<br>+#define XTTCPS_NUM_MATCH_REG                        3U /**< Num of Match reg */<br>+/* @} */<br>+<br>+/** @name Interrupt Registers<br>+ * Following register bit mask is for all interrupt registers.<br>+ *<br>+ * @{<br>+ */<br>+#define XTTCPS_IXR_INTERVAL_MASK    0x00000001U  /**< Interval Interrupt */<br>+#define XTTCPS_IXR_MATCH_0_MASK           0x00000002U  /**< Match 1 Interrupt */<br>+#define XTTCPS_IXR_MATCH_1_MASK            0x00000004U  /**< Match 2 Interrupt */<br>+#define XTTCPS_IXR_MATCH_2_MASK            0x00000008U  /**< Match 3 Interrupt */<br>+#define XTTCPS_IXR_CNT_OVR_MASK            0x00000010U  /**< Counter Overflow */<br>+#define XTTCPS_IXR_ALL_MASK                 0x0000001FU  /**< All valid Interrupts */<br>+/* @} */<br>+<br>+<br>+/***************** Macros (Inline Functions) Definitions *********************/<br>+<br>+/****************************************************************************/<br>+/**<br>+*<br>+* Read the given Timer Counter register.<br>+*<br>+* @param        BaseAddress is the base address of the timer counter device.<br>+* @param RegOffset is the register offset to be read<br>+*<br>+* @return     The 32-bit value of the register<br>+*<br>+* @note          C-style signature:<br>+*          u32 XTtcPs_ReadReg(u32 BaseAddress, u32 RegOffset)<br>+*<br>+*****************************************************************************/<br>+#define XTtcPs_ReadReg(BaseAddress, RegOffset) \<br>+    (Xil_In32((BaseAddress) + (u32)(RegOffset)))<br>+<br>+/****************************************************************************/<br>+/**<br>+*<br>+* Write the given Timer Counter register.<br>+*<br>+* @param        BaseAddress is the base address of the timer counter device.<br>+* @param RegOffset is the register offset to be written<br>+* @param       Data is the 32-bit value to write to the register<br>+*<br>+* @return       None.<br>+*<br>+* @note             C-style signature:<br>+*          void XTtcPs_WriteReg(XTtcPs BaseAddress, u32 RegOffset,<br>+*             u32 Data)<br>+*<br>+*****************************************************************************/<br>+#define XTtcPs_WriteReg(BaseAddress, RegOffset, Data) \<br>+    (Xil_Out32((BaseAddress) + (u32)(RegOffset), (u32)(Data)))<br>+<br>+/****************************************************************************/<br>+/**<br>+*<br>+* Calculate a match register offset using the Match Register index.<br>+*<br>+* @param  MatchIndex is the 0-2 value of the match register<br>+*<br>+* @return       MATCH_N_OFFSET.<br>+*<br>+* @note           C-style signature:<br>+*          u32 XTtcPs_Match_N_Offset(u8 MatchIndex)<br>+*<br>+*****************************************************************************/<br>+#define XTtcPs_Match_N_Offset(MatchIndex) \<br>+          ((u32)XTTCPS_MATCH_0_OFFSET + ((u32)(12U) * (u32)(MatchIndex)))<br>+<br>+/************************** Function Prototypes ******************************/<br>+<br>+/************************** Variable Definitions *****************************/<br>+#ifdef __cplusplus<br>+}<br>+#endif<br>+#endif /* end of protection macro */<br>+/** @} */<br>diff --git a/bsps/include/xil/zynqmp.h b/bsps/include/xil/zynqmp.h<br>new file mode 100644<br>index 0000000000..34051c525a<br>--- /dev/null<br>+++ b/bsps/include/xil/zynqmp.h<br>@@ -0,0 +1,99 @@<br>+/**<br>+ * @file<br>+ * @ingroup RTEMSBSPsARMZynqMP<br>+ * @brief Peripheral memory map.<br>+ */<br>+<br>+/*<br>+ * SPDX-License-Identifier: BSD-2-Clause<br>+ *<br>+ * Copyright (C) 2023 Reflex Aerospace GmbH<br>+ *<br>+ * Written by Philip Kirkpatrick <<a href="mailto:p.kirkpatrick@reflexaerospace.com">p.kirkpatrick@reflexaerospace.com</a>><br>+ *<br>+ * Redistribution and use in source and binary forms, with or without<br>+ * modification, are permitted provided that the following conditions<br>+ * are met:<br>+ * 1. Redistributions of source code must retain the above copyright<br>+ *    notice, this list of conditions and the following disclaimer.<br>+ * 2. Redistributions in binary form must reproduce the above copyright<br>+ *    notice, this list of conditions and the following disclaimer in the<br>+ *    documentation and/or other materials provided with the distribution.<br>+ *<br>+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"<br>+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE<br>+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE<br>+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE<br>+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR<br>+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF<br>+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS<br>+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN<br>+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)<br>+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE<br>+ * POSSIBILITY OF SUCH DAMAGE.<br>+ */<br>+<br>+#ifndef LIBBSP_ARM_ZYNQMP<br>+#define LIBBSP_ARM_ZYNQMP<br>+<br>+/* Data derived from <a href="https://docs.xilinx.com/r/en-US/ug1085-zynq-ultrascale-trm/PS-I/O-Peripherals-Registers">https://docs.xilinx.com/r/en-US/ug1085-zynq-ultrascale-trm/PS-I/O-Peripherals-Registers</a> */<br>+<br>+/* LPD IO Peripherals */<br>+#define ZYNQMP_UART0 (0xFF000000)<br>+#define ZYNQMP_UART1 (0xFF010000)<br>+#define ZYNQMP_I2C0 (0xFF020000)<br>+#define ZYNQMP_I2C1 (0xFF030000)<br>+#define ZYNQMP_SPI0 (0xFF040000)<br>+#define ZYNQMP_SPI1 (0xFF050000)<br>+#define ZYNQMP_CAN0 (0xFF060000)<br>+#define ZYNQMP_CAN1 (0xFF070000)<br>+#define ZYNQMP_GPIO (0xFF0A0000)<br>+#define ZYNQMP_GEM0 (0xFF0B0000)<br>+#define ZYNQMP_GEM1 (0xFF0C0000)<br>+#define ZYNQMP_GEM2 (0xFF0D0000)<br>+#define ZYNQMP_GEM3 (0xFF0E0000)<br>+#define ZYNQMP_QSPI (0xFF0F0000)<br>+#define ZYNQMP_NAND (0xFF100000)<br>+#define ZYNQMP_SD0 (0xFF160000)<br>+#define ZYNQMP_SD1 (0xFF170000)<br>+#define ZYNQMP_IPI_MSG (0xFF990000)<br>+#define ZYNQMP_USB0 (0xFF9D0000)<br>+#define ZYNQMP_USB1 (0xFF9E0000)<br>+#define ZYNQMP_AMS (0xFFA50000)<br>+#define ZYNQMP_PSSYSMON (0xFFA50800)<br>+#define ZYNQMP_PLSYSMON (0xFFA50C00)<br>+#define ZYNQMP_CSU_SWDT (0xFFCB0000)<br>+<br>+/* FPD IO Peripherals */<br>+#define ZYNQMP_SATA (0xFD0C0000)<br>+#define ZYNQMP_PCIE (0xFD0E0000)<br>+#define ZYNQMP_PCIE_IN (0xFD0E0800)<br>+#define ZYNQMP_PCIE_EG (0xFD0E0C00)<br>+#define ZYNQMP_PCIE_DMA (0xFD0F0000)<br>+#define ZYNQMP_SIOU (0xFD3D0000)<br>+#define ZYNQMP_GTR (0xFD400000)<br>+#define ZYNQMP_PCIE_ATTR (0xFD480000)<br>+#define ZYNQMP_DP (0xFD4A0000)<br>+#define ZYNQMP_GPU (0xFD4B0000)<br>+#define ZYNQMP_DP_DMA (0xFD4C0000)<br>+<br>+/* LPD System Registers */<br>+#define ZYNQMP_IPI (0xFF300000)<br>+#define ZYNQMP_TTC0 (0xFF110000)<br>+#define ZYNQMP_TTC1 (0xFF120000)<br>+#define ZYNQMP_TTC2 (0xFF130000)<br>+#define ZYNQMP_TTC3 (0xFF140000)<br>+#define ZYNQMP_LPD_SWDT (0xFF150000)<br>+#define ZYNQMP_XPPU (0xFF980000)<br>+#define ZYNQMP_XPPU_SINK (0xFF9C0000)<br>+#define ZYNQMP_PL_LPD (0xFF9B0000)<br>+#define ZYNQMP_OCM (0xFFA00000)<br>+#define ZYNQMP_LPD_FPD (0xFFA10000)<br>+#define ZYNQMP_RTC (0xFFA60000)<br>+#define ZYNQMP_OCM_XMPU (0xFFA70000)<br>+#define ZYNQMP_LPD_DMA (0xFFA80000)<br>+#define ZYNQMP_CSU_DMA (0xFFC80000)<br>+#define ZYNQMP_CSU (0xFFCA0000)<br>+#define ZYNQMP_BBRAM (0xFFCD0000)<br>+<br>+#endif /* LIBBSP_ARM_ZYNQMP */<br>diff --git a/bsps/shared/dev/clock/xil-ttc.c b/bsps/shared/dev/clock/xil-ttc.c<br>new file mode 100644<br>index 0000000000..c6aaaa9f91<br>--- /dev/null<br>+++ b/bsps/shared/dev/clock/xil-ttc.c<br>@@ -0,0 +1,214 @@<br>+/**<br>+ * @file<br>+ *<br>+ * @ingroup RTEMSBSPsARMZynqMP<br>+ *<br>+ * @brief Triple Timer Counter clock functions definitions.<br>+ */<br>+<br>+/*<br>+ * SPDX-License-Identifier: BSD-2-Clause<br>+ *<br>+ * Copyright (C) 2023 Reflex Aerospace GmbH<br>+ *<br>+ * Written by Philip Kirkpatrick <<a href="mailto:p.kirkpatrick@reflexaerospace.com">p.kirkpatrick@reflexaerospace.com</a>><br>+ *<br>+ * Redistribution and use in source and binary forms, with or without<br>+ * modification, are permitted provided that the following conditions<br>+ * are met:<br>+ * 1. Redistributions of source code must retain the above copyright<br>+ *    notice, this list of conditions and the following disclaimer.<br>+ * 2. Redistributions in binary form must reproduce the above copyright<br>+ *    notice, this list of conditions and the following disclaimer in the<br>+ *    documentation and/or other materials provided with the distribution.<br>+ *<br>+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"<br>+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE<br>+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE<br>+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE<br>+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR<br>+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF<br>+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS<br>+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN<br>+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)<br>+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE<br>+ * POSSIBILITY OF SUCH DAMAGE.<br>+ */<br>+<br>+#include <stdlib.h><br>+<br>+#include <rtems.h><br>+#include <bsp.h><br>+#include <bsp/irq.h><br>+#include <zynqmp.h><br>+#include <xttcps_hw.h><br>+#include <rtems/timecounter.h><br>+<br>+static struct timecounter zynqmp_ttc_tc;<br>+<br>+#define TTC_REFERENCE_CLOCK 100000000<br>+<br>+/* This is defined in dev/clock/clockimpl.h */<br>+void Clock_isr(rtems_irq_hdl_param arg);<br>+<br>+static uint32_t irq_match_interval;<br>+<br>+static uint32_t zynqmp_ttc_get_timecount(struct timecounter *tc)<br>+{<br>+  uint32_t time;<br>+  time = XTtcPs_ReadReg(ZYNQMP_TTC0, XTTCPS_COUNT_VALUE_OFFSET);<br>+  return time;<br>+}<br>+<br>+/**<br>+ *  @brief Initialize the HW peripheral for clock driver<br>+ *<br>+ *  Clock driver is implemented by RTI module<br>+ *<br>+ * @retval Void<br>+ */<br>+static void zynqmp_ttc_clock_driver_support_initialize_hardware(void)<br>+{<br>+<br>+  uint32_t microsec_per_tick;<br>+  uint16_t clock_ratio;<br>+  uint8_t  index;<br>+  uint32_t frequency;<br>+  uint32_t prescaler;<br>+  uint32_t tmp_reg_val;<br>+<br>+  microsec_per_tick = rtems_configuration_get_microseconds_per_tick();<br>+<br>+  /* Check the TTC is OFF before reconfiguring */<br>+  XTtcPs_WriteReg(ZYNQMP_TTC0, XTTCPS_CNT_CNTRL_OFFSET, XTTCPS_CNT_CNTRL_DIS_MASK |<br>+        XTTCPS_CNT_CNTRL_EN_WAVE_MASK);  // Don't enable waveform output (active low)<br>+<br>+  /* Prescaler value is 2^(N + 1)<br>+   * Divide down the clock as much as possible while still retaining a<br>+   * frequency that is an integer multiple of 1MHz.  This maximizes time to<br>+   * overflow while minimizing rounding errors in 1us periods <br>+   */<br>+  clock_ratio = TTC_REFERENCE_CLOCK / 1000000;<br>+  /* Search for the highest set bit.  This is effectively min(log2(ratio))*/<br>+  for(index = sizeof(clock_ratio) * 8 - 1; index > 0; index--) {<br>+    if((clock_ratio >> (index)) & 0x01) {<br>+        break;<br>+    }<br>+  }<br>+  if(index == 0 && (clock_ratio & 0x01 == 0)) {<br>+    // No prescaler<br>+    frequency = TTC_REFERENCE_CLOCK;<br>+    XTtcPs_WriteReg(ZYNQMP_TTC0, XTTCPS_CLK_CNTRL_OFFSET, 0);<br>+  } else {<br>+    prescaler = index - 1;<br>+    frequency = TTC_REFERENCE_CLOCK / (1 << (prescaler + 1));<br>+    XTtcPs_WriteReg(ZYNQMP_TTC0, XTTCPS_CLK_CNTRL_OFFSET, <br>+        prescaler << XTTCPS_CLK_CNTRL_PS_VAL_SHIFT |<br>+        XTTCPS_CLK_CNTRL_PS_EN_MASK);<br>+  }<br>+<br>+  /* Max out the counter interval */<br>+  tmp_reg_val = XTTCPS_INTERVAL_VAL_MASK;<br>+  XTtcPs_WriteReg(ZYNQMP_TTC0, XTTCPS_INTERVAL_VAL_OFFSET, tmp_reg_val);<br>+<br>+  /* Setup match register to generate tick IRQ */<br>+  irq_match_interval = (uint32_t) ((frequency * microsec_per_tick) / 1000000);<br>+  XTtcPs_WriteReg(ZYNQMP_TTC0, XTTCPS_MATCH_0_OFFSET, irq_match_interval);<br>+  /* Clear interupts (clear on read) */<br>+  XTtcPs_ReadReg(ZYNQMP_TTC0, XTTCPS_ISR_OFFSET);<br>+  /* Enable interupt for match register */<br>+  XTtcPs_WriteReg(ZYNQMP_TTC0, XTTCPS_IER_OFFSET, XTTCPS_IXR_MATCH_0_MASK);<br>+  /* Configure, reset, and enable counter */<br>+  XTtcPs_WriteReg(ZYNQMP_TTC0, XTTCPS_CNT_CNTRL_OFFSET, <br>+        XTTCPS_CNT_CNTRL_EN_WAVE_MASK |  /* Don't enable waveform output (active low) */<br>+        XTTCPS_CNT_CNTRL_RST_MASK |      /* Reset count and start counter */<br>+        XTTCPS_CNT_CNTRL_MATCH_MASK      /* Enable match mode */<br>+        /* Increment mode */<br>+        /* Overflow mode */<br>+        /* Not disabled */<br>+        );<br>+<br>+  /* set timecounter */<br>+  zynqmp_ttc_tc.tc_get_timecount = zynqmp_ttc_get_timecount;<br>+  zynqmp_ttc_tc.tc_counter_mask = XTTCPS_COUNT_VALUE_MASK;<br>+  zynqmp_ttc_tc.tc_frequency = frequency;<br>+  zynqmp_ttc_tc.tc_quality = RTEMS_TIMECOUNTER_QUALITY_CLOCK_DRIVER;<br>+  rtems_timecounter_install(&zynqmp_ttc_tc);<br>+}<br>+<br>+/**<br>+ * @brief Clears interrupt source<br>+ *<br>+ * @retval Void<br>+ */<br>+static uint32_t tick_miss = 0;<br>+static void zynqmp_ttc_clock_driver_support_at_tick( void )<br>+{<br>+  uint32_t irq_flags;<br>+  uint32_t cval;<br>+  uint32_t now;<br>+  uint32_t delta;<br>+<br>+  /* Get and clear interupts (clear on read) */<br>+  irq_flags = XTtcPs_ReadReg(ZYNQMP_TTC0, XTTCPS_ISR_OFFSET);<br>+<br>+  if(irq_flags & XTTCPS_IXR_MATCH_0_MASK) {<br>+    /* Update match */<br>+    cval = XTtcPs_ReadReg(ZYNQMP_TTC0, XTTCPS_MATCH_0_OFFSET);<br>+    /* Check that the match for the next tick is in the future<br>+     * If no, then set the match for one irq interval from now<br>+     *   This will have the effect that your timebase will slip but<br>+     *   won't hang waiting for the counter to wrap around.<br>+     * If this happens durring normal opteration, there is a problem<br>+     *   causing this interrupt to not be serviced quickly enough<br>+     * If this happens during debugging, that is normal and expected<br>+     *   becaue the TTC does NOT pause when the CPU is halted on a breakpoint<br>+     */<br>+    now = XTtcPs_ReadReg(ZYNQMP_TTC0, XTTCPS_COUNT_VALUE_OFFSET);<br>+    delta = now - cval;<br>+    if(delta > irq_match_interval) {<br>+         cval = now;<br>+        tick_miss++;<br>+    }<br>+    cval += irq_match_interval;<br>+    XTtcPs_WriteReg(ZYNQMP_TTC0, XTTCPS_MATCH_0_OFFSET, cval);<br>+  }<br>+  /* Else, something is set up wrong, only match should be enabled */<br>+}<br>+<br>+/**<br>+ * @brief registers RTI interrupt handler<br>+ *<br>+ * @param[in] Clock_isr new ISR handler<br>+ * @param[in] Old_ticker old ISR handler (unused and type broken)<br>+ *<br>+ * @retval Void<br>+ */<br>+static void zynqmp_ttc_clock_driver_support_install_isr(<br>+  rtems_isr_entry Clock_isr<br>+)<br>+{<br>+  rtems_status_code sc = RTEMS_SUCCESSFUL;<br>+<br>+  sc = rtems_interrupt_handler_install(<br>+    ZYNQMP_IRQ_TTC_0_0,<br>+    "Clock",<br>+    RTEMS_INTERRUPT_UNIQUE,<br>+    (rtems_interrupt_handler) Clock_isr,<br>+    NULL<br>+  );<br>+  if ( sc != RTEMS_SUCCESSFUL ) {<br>+    rtems_fatal_error_occurred(0xdeadbeef);<br>+  }<br>+}<br>+<br>+#define Clock_driver_support_at_tick \<br>+                        zynqmp_ttc_clock_driver_support_at_tick<br>+<br>+#define Clock_driver_support_initialize_hardware \<br>+                        zynqmp_ttc_clock_driver_support_initialize_hardware<br>+                        <br>+#define Clock_driver_support_install_isr(Clock_isr) \<br>+              zynqmp_ttc_clock_driver_support_install_isr( Clock_isr )<br>+<br>+#include "../../../shared/dev/clock/clockimpl.h"<br>diff --git a/spec/build/bsps/arm/xilinx-zynqmp-rpu/abi.yml b/spec/build/bsps/arm/xilinx-zynqmp-rpu/abi.yml<br>new file mode 100644<br>index 0000000000..829e9c9297<br>--- /dev/null<br>+++ b/spec/build/bsps/arm/xilinx-zynqmp-rpu/abi.yml<br>@@ -0,0 +1,21 @@<br>+SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause<br>+actions:<br>+- get-string: null<br>+- split: null<br>+- env-append: null<br>+build-type: option<br>+copyrights:<br>+- Copyright (C) 2023 Reflex Aerospace GmbH (<a href="https://www.reflexaerospace.com/">https://www.reflexaerospace.com/</a>)<br>+default:<br>+- enabled-by: true<br>+  value:<br>+  - -march=armv7-r<br>+  - -mthumb<br>+  - -mfpu=vfpv3-d16<br>+  - -mfloat-abi=hard<br>+description: |<br>+  ABI flags<br>+enabled-by: true<br>+links: []<br>+name: ABI_FLAGS<br>+type: build<br>diff --git a/spec/build/bsps/arm/xilinx-zynqmp-rpu/bspmercureyxu5.yml b/spec/build/bsps/arm/xilinx-zynqmp-rpu/bspmercureyxu5.yml<br>new file mode 100644<br>index 0000000000..ec2d6ed158<br>--- /dev/null<br>+++ b/spec/build/bsps/arm/xilinx-zynqmp-rpu/bspmercureyxu5.yml<br>@@ -0,0 +1,92 @@<br>+SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause<br>+arch: arm<br>+bsp: xilinx_zynqmp_mercuryxu5_rpu<br>+build-type: bsp<br>+cflags: []<br>+copyrights:<br>+- Copyright (C) 2023 Reflex Aerospace GmbH (<a href="https://www.reflexaerospace.com/">https://www.reflexaerospace.com/</a>)<br>+cppflags: []<br>+enabled-by: true<br>+family: xilinx-zynqmp-rpu<br>+includes: <br>+- bsps/include/xil/<br>+install:<br>+- destination: ${BSP_INCLUDEDIR}<br>+  source:<br>+  - bsps/arm/xilinx-zynqmp-rpu/include/bsp.h<br>+  - bsps/include/xil/xil_types.h<br>+  - bsps/include/xil/xil_assert.h<br>+  - bsps/include/xil/xil_io.h<br>+  - bsps/include/xil/xttcps_hw.h<br>+  - bsps/include/xil/zynqmp.h<br>+- destination: ${BSP_INCLUDEDIR}/bsp<br>+  source:<br>+  - bsps/arm/xilinx-zynqmp-rpu/include/bsp/irq.h<br>+links:<br>+- role: build-dependency<br>+  uid: ../grp<br>+- role: build-dependency<br>+  uid: ../start<br>+- role: build-dependency<br>+  uid: abi<br>+- role: build-dependency<br>+  uid: optclkfastidle<br>+- role: build-dependency<br>+  uid: optclkuart<br>+- role: build-dependency<br>+  uid: optconirq<br>+- role: build-dependency<br>+  uid: ../../optconminor<br>+- role: build-dependency<br>+  uid: optint0len<br>+- role: build-dependency<br>+  uid: optint0ori<br>+- role: build-dependency<br>+  uid: optint1len<br>+- role: build-dependency<br>+  uid: optint1ori<br>+- role: build-dependency<br>+  uid: optramlen<br>+- role: build-dependency<br>+  uid: optramori<br>+- role: build-dependency<br>+  uid: optresetvec<br>+- role: build-dependency<br>+  uid: ../../obj<br>+- role: build-dependency<br>+  uid: ../../objirq<br>+- role: build-dependency<br>+  uid: ../../objdevserialzynq<br>+- role: build-dependency<br>+  uid: ../../objdevspizynq<br>+- role: build-dependency<br>+  uid: ../../objdevspixil<br>+- role: build-dependency<br>+  uid: ../../objmem<br>+- role: build-dependency<br>+  uid: ../../opto0<br>+- role: build-dependency<br>+  uid: linkcmds<br>+- role: build-dependency<br>+  uid: ../../bspopts<br>+source:<br>+- bsps/shared/cache/nocache.c<br>+- bsps/arm/shared/cp15/arm-cp15-set-exception-handler.c<br>+- bsps/arm/shared/cp15/arm-cp15-set-ttb-entries.c<br>+- bsps/arm/shared/start/bsp-start-memcpy.S<br>+- bsps/arm/xilinx-zynqmp-rpu/console/console-config.c<br>+- bsps/arm/xilinx-zynqmp-rpu/start/bspreset.c<br>+- bsps/arm/xilinx-zynqmp-rpu/start/bspstart.c<br>+- bsps/arm/xilinx-zynqmp-rpu/start/bspstarthooks.c<br>+- bsps/shared/dev/clock/xil-ttc.c<br>+- bsps/shared/dev/btimer/btimer-cpucounter.c<br>+- bsps/shared/dev/getentropy/getentropy-cpucounter.c<br>+- bsps/shared/dev/irq/arm-gicv2.c<br>+- bsps/shared/dev/irq/arm-gicv2-zynqmp.c<br>+- bsps/shared/dev/serial/console-termios.c<br>+- bsps/shared/irq/irq-default-handler.c<br>+- bsps/shared/start/bspfatal-default.c<br>+- bsps/shared/start/gettargethash-default.c<br>+- bsps/shared/start/sbrk.c<br>+- bsps/shared/start/stackalloc.c<br>+type: build<br>diff --git a/spec/build/bsps/arm/xilinx-zynqmp-rpu/linkcmds.yml b/spec/build/bsps/arm/xilinx-zynqmp-rpu/linkcmds.yml<br>new file mode 100644<br>index 0000000000..f5e6ff7822<br>--- /dev/null<br>+++ b/spec/build/bsps/arm/xilinx-zynqmp-rpu/linkcmds.yml<br>@@ -0,0 +1,41 @@<br>+SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause<br>+build-type: config-file<br>+content: |<br>+  MEMORY {<br>+    RAM_INT_0 : ORIGIN = ${ZYNQMP_RPU_RAM_INT_0_ORIGIN:#010x}, LENGTH = ${ZYNQMP_RPU_RAM_INT_0_LENGTH:#010x}<br>+    RAM_INT_1 : ORIGIN = ${ZYNQMP_RPU_RAM_INT_1_ORIGIN:#010x}, LENGTH = ${ZYNQMP_RPU_RAM_INT_1_LENGTH:#010x}<br>+    RAM       : ORIGIN = ${ZYNQMP_RPU_RAM_ORIGIN:#010x}, LENGTH = ${ZYNQMP_RPU_RAM_LENGTH:#010x} - ${ZYNQMP_RPU_RAM_ORIGIN:#010x}<br>+  }<br>+<br>+  REGION_ALIAS ("REGION_START",          RAM_INT_0);<br>+  REGION_ALIAS ("REGION_VECTOR",         RAM_INT_0);<br>+  REGION_ALIAS ("REGION_TEXT",           RAM);<br>+  REGION_ALIAS ("REGION_TEXT_LOAD",      RAM);<br>+  REGION_ALIAS ("REGION_RODATA",         RAM);<br>+  REGION_ALIAS ("REGION_RODATA_LOAD",    RAM);<br>+  REGION_ALIAS ("REGION_DATA",           RAM);<br>+  REGION_ALIAS ("REGION_DATA_LOAD",      RAM);<br>+  REGION_ALIAS ("REGION_FAST_TEXT",      RAM);<br>+  REGION_ALIAS ("REGION_FAST_TEXT_LOAD", RAM);<br>+  REGION_ALIAS ("REGION_FAST_DATA",      RAM);<br>+  REGION_ALIAS ("REGION_FAST_DATA_LOAD", RAM);<br>+  REGION_ALIAS ("REGION_BSS",            RAM);<br>+  REGION_ALIAS ("REGION_WORK",           RAM);<br>+  REGION_ALIAS ("REGION_STACK",          RAM);<br>+  REGION_ALIAS ("REGION_NOCACHE",        RAM);<br>+  REGION_ALIAS ("REGION_NOCACHE_LOAD",   RAM);<br>+<br>+  bsp_stack_abt_size = DEFINED (bsp_stack_abt_size) ? bsp_stack_abt_size : 1024;<br>+<br>+  bsp_section_rwbarrier_align = DEFINED (bsp_section_rwbarrier_align) ? bsp_section_rwbarrier_align : 1M;<br>+<br>+  bsp_vector_table_in_start_section = 1;<br>+<br>+  INCLUDE linkcmds.armv4<br>+copyrights:<br>+- Copyright (C) 2023 Reflex Aerospace GmbH (<a href="https://www.reflexaerospace.com/">https://www.reflexaerospace.com/</a>)<br>+enabled-by: true<br>+install-path: ${BSP_LIBDIR}<br>+links: []<br>+target: linkcmds<br>+type: build<br>diff --git a/spec/build/bsps/arm/xilinx-zynqmp-rpu/optclkfastidle.yml b/spec/build/bsps/arm/xilinx-zynqmp-rpu/optclkfastidle.yml<br>new file mode 100644<br>index 0000000000..e303a8bf9f<br>--- /dev/null<br>+++ b/spec/build/bsps/arm/xilinx-zynqmp-rpu/optclkfastidle.yml<br>@@ -0,0 +1,21 @@<br>+SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause<br>+actions:<br>+- get-boolean: null<br>+- define-condition: null<br>+build-type: option<br>+copyrights:<br>+- Copyright (C) 2020 embedded brains GmbH (<a href="http://www.embedded-brains.de">http://www.embedded-brains.de</a>)<br>+default:<br>+- enabled-by:<br>+  - arm/lm3s6965_qemu<br>+  - arm/realview_pbx_a9_qemu<br>+  - arm/xilinx_zynq_a9_qemu<br>+  value: true<br>+- enabled-by: true<br>+  value: false<br>+description: |<br>+  This sets a mode where the time runs as fast as possible when a clock ISR occurs while the IDLE thread is executing.  This can significantly reduce simulation times.<br>+enabled-by: true<br>+links: []<br>+name: CLOCK_DRIVER_USE_FAST_IDLE<br>+type: build<br>diff --git a/spec/build/bsps/arm/xilinx-zynqmp-rpu/optclkuart.yml b/spec/build/bsps/arm/xilinx-zynqmp-rpu/optclkuart.yml<br>new file mode 100644<br>index 0000000000..77c8f30fff<br>--- /dev/null<br>+++ b/spec/build/bsps/arm/xilinx-zynqmp-rpu/optclkuart.yml<br>@@ -0,0 +1,17 @@<br>+SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause<br>+actions:<br>+- get-integer: null<br>+- define: null<br>+build-type: option<br>+copyrights:<br>+- Copyright (C) 2020 embedded brains GmbH (<a href="http://www.embedded-brains.de">http://www.embedded-brains.de</a>)<br>+default:<br>+- enabled-by: true<br>+  value: 100000000<br>+description: |<br>+  Zynq UART clock frequency in Hz<br>+enabled-by: true<br>+format: '{}'<br>+links: []<br>+name: ZYNQ_CLOCK_UART<br>+type: build<br>diff --git a/spec/build/bsps/arm/xilinx-zynqmp-rpu/optconirq.yml b/spec/build/bsps/arm/xilinx-zynqmp-rpu/optconirq.yml<br>new file mode 100644<br>index 0000000000..ea13fa4561<br>--- /dev/null<br>+++ b/spec/build/bsps/arm/xilinx-zynqmp-rpu/optconirq.yml<br>@@ -0,0 +1,16 @@<br>+SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause<br>+actions:<br>+- get-boolean: null<br>+- define-condition: null<br>+build-type: option<br>+copyrights:<br>+- Copyright (C) 2020 embedded brains GmbH (<a href="http://www.embedded-brains.de">http://www.embedded-brains.de</a>)<br>+default:<br>+- enabled-by: true<br>+  value: true<br>+description: |<br>+  use interrupt driven mode for console devices (used by default)<br>+enabled-by: true<br>+links: []<br>+name: ZYNQ_CONSOLE_USE_INTERRUPTS<br>+type: build<br>diff --git a/spec/build/bsps/arm/xilinx-zynqmp-rpu/optint0len.yml b/spec/build/bsps/arm/xilinx-zynqmp-rpu/optint0len.yml<br>new file mode 100644<br>index 0000000000..13b436ad2e<br>--- /dev/null<br>+++ b/spec/build/bsps/arm/xilinx-zynqmp-rpu/optint0len.yml<br>@@ -0,0 +1,18 @@<br>+SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause<br>+actions:<br>+- get-integer: null<br>+- assert-uint32: null<br>+- env-assign: null<br>+- format-and-define: null<br>+build-type: option<br>+copyrights:<br>+- Copyright (C) 2020 embedded brains GmbH (<a href="http://www.embedded-brains.de">http://www.embedded-brains.de</a>)<br>+default:<br>+- enabled-by: true<br>+  value: 0x00010000<br>+description: ''<br>+enabled-by: true<br>+format: '{:#010x}'<br>+links: []<br>+name: ZYNQMP_RPU_RAM_INT_0_LENGTH<br>+type: build<br>diff --git a/spec/build/bsps/arm/xilinx-zynqmp-rpu/optint0ori.yml b/spec/build/bsps/arm/xilinx-zynqmp-rpu/optint0ori.yml<br>new file mode 100644<br>index 0000000000..b33306b28e<br>--- /dev/null<br>+++ b/spec/build/bsps/arm/xilinx-zynqmp-rpu/optint0ori.yml<br>@@ -0,0 +1,18 @@<br>+SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause<br>+actions:<br>+- get-integer: null<br>+- assert-uint32: null<br>+- env-assign: null<br>+- format-and-define: null<br>+build-type: option<br>+copyrights:<br>+- Copyright (C) 2020 embedded brains GmbH (<a href="http://www.embedded-brains.de">http://www.embedded-brains.de</a>)<br>+default:<br>+- enabled-by: true<br>+  value: 0x00000000<br>+description: ''<br>+enabled-by: true<br>+format: '{:#010x}'<br>+links: []<br>+name: ZYNQMP_RPU_RAM_INT_0_ORIGIN<br>+type: build<br>diff --git a/spec/build/bsps/arm/xilinx-zynqmp-rpu/optint1len.yml b/spec/build/bsps/arm/xilinx-zynqmp-rpu/optint1len.yml<br>new file mode 100644<br>index 0000000000..093aff6eb4<br>--- /dev/null<br>+++ b/spec/build/bsps/arm/xilinx-zynqmp-rpu/optint1len.yml<br>@@ -0,0 +1,18 @@<br>+SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause<br>+actions:<br>+- get-integer: null<br>+- assert-uint32: null<br>+- env-assign: null<br>+- format-and-define: null<br>+build-type: option<br>+copyrights:<br>+- Copyright (C) 2020 embedded brains GmbH (<a href="http://www.embedded-brains.de">http://www.embedded-brains.de</a>)<br>+default:<br>+- enabled-by: true<br>+  value: 0x00010000<br>+description: ''<br>+enabled-by: true<br>+format: '{:#010x}'<br>+links: []<br>+name: ZYNQMP_RPU_RAM_INT_1_LENGTH<br>+type: build<br>diff --git a/spec/build/bsps/arm/xilinx-zynqmp-rpu/optint1ori.yml b/spec/build/bsps/arm/xilinx-zynqmp-rpu/optint1ori.yml<br>new file mode 100644<br>index 0000000000..5574289975<br>--- /dev/null<br>+++ b/spec/build/bsps/arm/xilinx-zynqmp-rpu/optint1ori.yml<br>@@ -0,0 +1,18 @@<br>+SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause<br>+actions:<br>+- get-integer: null<br>+- assert-uint32: null<br>+- env-assign: null<br>+- format-and-define: null<br>+build-type: option<br>+copyrights:<br>+- Copyright (C) 2020 embedded brains GmbH (<a href="http://www.embedded-brains.de">http://www.embedded-brains.de</a>)<br>+default:<br>+- enabled-by: true<br>+  value: 0x00020000<br>+description: ''<br>+enabled-by: true<br>+format: '{:#010x}'<br>+links: []<br>+name: ZYNQMP_RPU_RAM_INT_1_ORIGIN<br>+type: build<br>diff --git a/spec/build/bsps/arm/xilinx-zynqmp-rpu/optprocunitrpu.yml b/spec/build/bsps/arm/xilinx-zynqmp-rpu/optprocunitrpu.yml<br>new file mode 100644<br>index 0000000000..9298808b2a<br>--- /dev/null<br>+++ b/spec/build/bsps/arm/xilinx-zynqmp-rpu/optprocunitrpu.yml<br>@@ -0,0 +1,17 @@<br>+SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause<br>+actions:<br>+- get-boolean: null<br>+- define-condition: null<br>+build-type: option<br>+copyrights:<br>+- Copyright (C) 2023 Reflex Aerospace GmbH (<a href="https://www.reflexaerospace.com/">https://www.reflexaerospace.com/</a>)<br>+default:<br>+- enabled-by: true<br>+  value: true<br>+description: |<br>+  Sets the target processing unit to the RPU (R5F) cores.<br>+enabled-by: true<br>+format: '{}'<br>+links: []<br>+name: ZYNQMP_PROC_UNIT_RPU<br>+type: build<br>diff --git a/spec/build/bsps/arm/xilinx-zynqmp-rpu/optramlen.yml b/spec/build/bsps/arm/xilinx-zynqmp-rpu/optramlen.yml<br>new file mode 100644<br>index 0000000000..966ae09b19<br>--- /dev/null<br>+++ b/spec/build/bsps/arm/xilinx-zynqmp-rpu/optramlen.yml<br>@@ -0,0 +1,21 @@<br>+SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause<br>+actions:<br>+- get-integer: null<br>+- assert-uint32: null<br>+- env-assign: null<br>+- format-and-define: null<br>+build-type: option<br>+copyrights:<br>+- Copyright (C) 2020 embedded brains GmbH (<a href="http://www.embedded-brains.de">http://www.embedded-brains.de</a>)<br>+default:<br>+- enabled-by: arm/xilinx_zynqmp_ultra96<br>+  value: 0x80000000<br>+- enabled-by: true<br>+  value: 0x10000000<br>+description: |<br>+  override a BSP's default RAM length<br>+enabled-by: true<br>+format: '{:#010x}'<br>+links: []<br>+name: ZYNQMP_RPU_RAM_LENGTH<br>+type: build<br>diff --git a/spec/build/bsps/arm/xilinx-zynqmp-rpu/optramori.yml b/spec/build/bsps/arm/xilinx-zynqmp-rpu/optramori.yml<br>new file mode 100644<br>index 0000000000..ceb8401c37<br>--- /dev/null<br>+++ b/spec/build/bsps/arm/xilinx-zynqmp-rpu/optramori.yml<br>@@ -0,0 +1,19 @@<br>+SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause<br>+actions:<br>+- get-integer: null<br>+- assert-uint32: null<br>+- assert-aligned: 1048576<br>+- env-assign: null<br>+- format-and-define: null<br>+build-type: option<br>+copyrights:<br>+- Copyright (C) 2020 embedded brains GmbH (<a href="http://www.embedded-brains.de">http://www.embedded-brains.de</a>)<br>+default:<br>+- enabled-by: true<br>+  value: 0x00100000<br>+description: ''<br>+enabled-by: true<br>+format: '{:#010x}'<br>+links: []<br>+name: ZYNQMP_RPU_RAM_ORIGIN<br>+type: build<br>diff --git a/spec/build/bsps/arm/xilinx-zynqmp-rpu/optresetvec.yml b/spec/build/bsps/arm/xilinx-zynqmp-rpu/optresetvec.yml<br>new file mode 100644<br>index 0000000000..bac5c79627<br>--- /dev/null<br>+++ b/spec/build/bsps/arm/xilinx-zynqmp-rpu/optresetvec.yml<br>@@ -0,0 +1,16 @@<br>+SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause<br>+actions:<br>+- get-boolean: null<br>+- define-condition: null<br>+build-type: option<br>+copyrights:<br>+- Copyright (C) 2020 embedded brains GmbH (<a href="http://www.embedded-brains.de">http://www.embedded-brains.de</a>)<br>+default:<br>+- enabled-by: true<br>+  value: false<br>+description: |<br>+  reset vector address for BSP start<br>+enabled-by: true<br>+links: []<br>+name: BSP_START_RESET_VECTOR<br>+type: build</div><div><br></div><div>---<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Jun 19, 2023 at 1:16 AM Chris Johns <<a href="mailto:chrisj@rtems.org">chrisj@rtems.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On 17/6/2023 5:14 am, Gedare Bloom wrote:<br>
> On Fri, Jun 16, 2023 at 2:17 AM Philip Kirkpatrick<br>
> <<a href="mailto:p.kirkpatrick@reflexaerospace.com" target="_blank">p.kirkpatrick@reflexaerospace.com</a>> wrote:<br>
>> On Fri, Jun 16, 2023 at 7:14 AM Chris Johns <<a href="mailto:chrisj@rtems.org" target="_blank">chrisj@rtems.org</a>> wrote:<br>
>>><br>
>>> On 15/6/2023 6:16 pm, Philip Kirkpatrick wrote:<br>
>>>> Thanks for all the good feedback.<br>
>>>><br>
>>>> RE Joel:<br>
>>>> I'll fix my sloppy formatting that you caught and submit a revised patch.  If<br>
>>>> I'm realistic about my schedule, I probably won't be able to get to it until<br>
>>>> next week.<br>
>>>> For xttcps_hw.h, there already is one #ifndef __rtems__ around the #includes,<br>
>>>> but on review there is another spot where I got lazy and used a #if 0.  I'll<br>
>>>> correct that too.  Other than that, the file is unmodified.<br>
>>>><br>
>>>> On the discussion about a shared space, I'll leave that decision up to you.<br>
>>>> Tell me what you want and I can adjust as needed, or it could be done in a<br>
>>>> follow-on patch.<br>
>>><br>
>>> Should the RPU BSP be located under bsps/arm/xilinx-rpu?<br>
>><br>
>><br>
>> I went back and forth on that decision and decided to keep them combined since the APU and RPU share a moderate amount of code.  However, I can definitely see an argument that they are different enough to split.  If you want it the other way, I can make that change when I address the other items.<br>
<br>
Thanks, I think this is worth while.<br>
<br>
> I think we should split it out. Shared code should likely be<br>
> refactored to arm/shared depending what that is.<br>
<br>
Agreed. I am fine with the code moving, leaving the arm/xilinx-zynqmp BSP as is<br>
because it may be removed (see below).<br>
<br>
> I'm not sure that carrying forward a 32-bit arm/xilinx-zynqmp makes<br>
> sense now that we have a functional aarch64 port. Splitting the RPU<br>
> out will make it easier to make that decision.<br>
<br>
I agree. I think it is confusing. I also think it should happen before 6.<br>
<br>
Chris<br>
</blockquote></div>