From 0510b1eeb739112e57d65de084562d80ce73d73e Mon Sep 17 00:00:00 2001 From: zouboan Date: Fri, 12 Jul 2024 22:49:23 +0800 Subject: [PATCH] boards/arm64: add initial support for Zynq Mpsoc ZCU111 Evaluation Kit --- boards/Kconfig | 13 ++ boards/arm64/zynq-mpsoc/zcu111/.gitignore | 3 + boards/arm64/zynq-mpsoc/zcu111/Kconfig | 7 + .../zynq-mpsoc/zcu111/configs/nsh/defconfig | 75 ++++++++++ .../arm64/zynq-mpsoc/zcu111/include/board.h | 34 +++++ .../arm64/zynq-mpsoc/zcu111/scripts/Make.defs | 50 +++++++ .../zynq-mpsoc/zcu111/scripts/dramboot.ld | 129 ++++++++++++++++++ boards/arm64/zynq-mpsoc/zcu111/src/Makefile | 30 ++++ .../zcu111/src/etc/init.d/rc.sysinit | 25 ++++ .../zynq-mpsoc/zcu111/src/etc/init.d/rcS | 22 +++ boards/arm64/zynq-mpsoc/zcu111/src/zcu111.h | 37 +++++ .../zynq-mpsoc/zcu111/src/zcu111_appinit.c | 64 +++++++++ .../zynq-mpsoc/zcu111/src/zcu111_boardinit.c | 104 ++++++++++++++ 13 files changed, 593 insertions(+) create mode 100644 boards/arm64/zynq-mpsoc/zcu111/.gitignore create mode 100644 boards/arm64/zynq-mpsoc/zcu111/Kconfig create mode 100644 boards/arm64/zynq-mpsoc/zcu111/configs/nsh/defconfig create mode 100644 boards/arm64/zynq-mpsoc/zcu111/include/board.h create mode 100644 boards/arm64/zynq-mpsoc/zcu111/scripts/Make.defs create mode 100644 boards/arm64/zynq-mpsoc/zcu111/scripts/dramboot.ld create mode 100644 boards/arm64/zynq-mpsoc/zcu111/src/Makefile create mode 100644 boards/arm64/zynq-mpsoc/zcu111/src/etc/init.d/rc.sysinit create mode 100644 boards/arm64/zynq-mpsoc/zcu111/src/etc/init.d/rcS create mode 100644 boards/arm64/zynq-mpsoc/zcu111/src/zcu111.h create mode 100644 boards/arm64/zynq-mpsoc/zcu111/src/zcu111_appinit.c create mode 100644 boards/arm64/zynq-mpsoc/zcu111/src/zcu111_boardinit.c diff --git a/boards/Kconfig b/boards/Kconfig index 49dcb4b655..82619b3a42 100644 --- a/boards/Kconfig +++ b/boards/Kconfig @@ -2193,6 +2193,15 @@ config ARCH_BOARD_IMX93_EVK This options selects support for NuttX on the NXP i.MX93 CPUs EVK board with ARM Cortex-A55. +config ARCH_BOARD_ZCU111 + bool "XilinX ZCU111 development board" + depends on ARCH_CHIP_ZYNQ_MPSOC + select ARCH_HAVE_LEDS + select ARCH_HAVE_IRQBUTTONS + ---help--- + This options selects support for NuttX on XilinX ZCU111 board + based on XCZU28DR SoC with ARM Cortex-A53 + config ARCH_BOARD_SAMA5D2_XULT bool "Atmel SAMA5D2 Xplained Ultra development board" depends on ARCH_CHIP_ATSAMA5D27 @@ -3389,6 +3398,7 @@ config ARCH_BOARD default "fvp-armv8r-aarch32" if ARCH_BOARD_FVP_ARMV8R_AARCH32 default "imx8qm-mek" if ARCH_BOARD_IMX8QM_MEK default "imx93-evk" if ARCH_BOARD_IMX93_EVK + default "zcu111" if ARCH_BOARD_ZCU111 default "sama5d2-xult" if ARCH_BOARD_SAMA5D2_XULT default "giant-board" if ARCH_BOARD_GIANT_BOARD default "jupiter-nano" if ARCH_BOARD_JUPITER_NANO @@ -3613,6 +3623,9 @@ endif if ARCH_BOARD_IMX93_EVK source "boards/arm64/imx9/imx93-evk/Kconfig" endif +if ARCH_BOARD_ZCU111 +source "boards/arm64/zynq-mpsoc/zcu111/Kconfig" +endif if ARCH_BOARD_IMXRT1020_EVK source "boards/arm/imxrt/imxrt1020-evk/Kconfig" endif diff --git a/boards/arm64/zynq-mpsoc/zcu111/.gitignore b/boards/arm64/zynq-mpsoc/zcu111/.gitignore new file mode 100644 index 0000000000..ab90683ff4 --- /dev/null +++ b/boards/arm64/zynq-mpsoc/zcu111/.gitignore @@ -0,0 +1,3 @@ +etctmp.c +src/etctmp +tags diff --git a/boards/arm64/zynq-mpsoc/zcu111/Kconfig b/boards/arm64/zynq-mpsoc/zcu111/Kconfig new file mode 100644 index 0000000000..0cb28977e8 --- /dev/null +++ b/boards/arm64/zynq-mpsoc/zcu111/Kconfig @@ -0,0 +1,7 @@ +# +# For a description of the syntax of this configuration file, +# see the file kconfig-language.txt in the NuttX tools repository. +# + +if ARCH_BOARD_ZCU111 +endif # ARCH_BOARD_ZCU111 diff --git a/boards/arm64/zynq-mpsoc/zcu111/configs/nsh/defconfig b/boards/arm64/zynq-mpsoc/zcu111/configs/nsh/defconfig new file mode 100644 index 0000000000..2eafe59f17 --- /dev/null +++ b/boards/arm64/zynq-mpsoc/zcu111/configs/nsh/defconfig @@ -0,0 +1,75 @@ +# +# This file is autogenerated: PLEASE DO NOT EDIT IT. +# +# You can use "make menuconfig" to make any modifications to the installed .config file. +# You can then do "make savedefconfig" to generate a new defconfig file that includes your +# modifications. +# +# CONFIG_ARCH_LEDS is not set +# CONFIG_DEBUG_OPT_UNUSED_SECTIONS is not set +CONFIG_ARCH="arm64" +CONFIG_ARCH_ARM64=y +CONFIG_ARCH_ARM64_EXCEPTION_LEVEL=3 +CONFIG_ARCH_BOARD="zcu111" +CONFIG_ARCH_BOARD_ZCU111=y +CONFIG_ARCH_CHIP="zynq-mpsoc" +CONFIG_ARCH_CHIP_ZYNQ_MPSOC=y +CONFIG_ARCH_EARLY_PRINT=y +CONFIG_ARCH_INTERRUPTSTACK=4096 +CONFIG_ARM64_DCACHE_DISABLE=y +CONFIG_ARM64_GIC_VERSION=2 +CONFIG_ARM64_ICACHE_DISABLE=y +CONFIG_BOARD_LOOPSPERMSEC=116524 +CONFIG_BOOT_RUNFROMSDRAM=y +CONFIG_BUILTIN=y +CONFIG_DEBUG_ASSERTIONS=y +CONFIG_DEBUG_FEATURES=y +CONFIG_DEBUG_IRQ=y +CONFIG_DEBUG_IRQ_INFO=y +CONFIG_DEBUG_SCHED=y +CONFIG_DEBUG_SCHED_ERROR=y +CONFIG_DEBUG_SCHED_INFO=y +CONFIG_DEBUG_SCHED_WARN=y +CONFIG_DEBUG_SYMBOLS=y +CONFIG_DEFAULT_TASK_STACKSIZE=8192 +CONFIG_DEV_ZERO=y +CONFIG_ETC_ROMFS=y +CONFIG_EXAMPLES_HELLO=y +CONFIG_EXAMPLES_LEDS=y +CONFIG_EXPERIMENTAL=y +CONFIG_FRAME_POINTER=y +CONFIG_FS_PROCFS=y +CONFIG_FS_ROMFS=y +CONFIG_HAVE_CXX=y +CONFIG_HAVE_CXXINITIALIZE=y +CONFIG_IDLETHREAD_STACKSIZE=8192 +CONFIG_INIT_ENTRYPOINT="nsh_main" +CONFIG_INIT_STACKSIZE=9192 +CONFIG_NSH_ARCHINIT=y +CONFIG_NSH_BUILTIN_APPS=y +CONFIG_NSH_FILEIOSIZE=512 +CONFIG_NSH_READLINE=y +CONFIG_PREALLOC_TIMERS=4 +CONFIG_PTHREAD_STACK_MIN=8192 +CONFIG_RAMLOG=y +CONFIG_RAM_SIZE=2146435072 +CONFIG_RAM_START=0x00000000 +CONFIG_RAW_BINARY=y +CONFIG_READLINE_CMD_HISTORY=y +CONFIG_RR_INTERVAL=200 +CONFIG_SCHED_BACKTRACE=y +CONFIG_SCHED_HPWORK=y +CONFIG_SCHED_HPWORKPRIORITY=192 +CONFIG_SPINLOCK=y +CONFIG_STACK_COLORATION=y +CONFIG_START_MONTH=11 +CONFIG_START_YEAR=2022 +CONFIG_SYMTAB_ORDEREDBYNAME=y +CONFIG_SYSTEM_NSH=y +CONFIG_SYSTEM_SYSTEM=y +CONFIG_SYSTEM_TIME64=y +CONFIG_TESTING_GETPRIME=y +CONFIG_TESTING_OSTEST=y +CONFIG_UART0_SERIAL_CONSOLE=y +CONFIG_USEC_PER_TICK=1000 +CONFIG_USERLED=y diff --git a/boards/arm64/zynq-mpsoc/zcu111/include/board.h b/boards/arm64/zynq-mpsoc/zcu111/include/board.h new file mode 100644 index 0000000000..a652b6e4ef --- /dev/null +++ b/boards/arm64/zynq-mpsoc/zcu111/include/board.h @@ -0,0 +1,34 @@ +/**************************************************************************** + * boards/arm64/zynq-mpsoc/zcu111/include/board.h + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + * + ****************************************************************************/ + +#ifndef __BOARDS_ARM64_ZYNQ_MPSOC_ZCU111_INCLUDE_BOARD_H +#define __BOARDS_ARM64_ZYNQ_MPSOC_ZCU111_INCLUDE_BOARD_H + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ + +#endif /* __BOARDS_ARM64_ZYNQ_MPSOC_ZCU111_INCLUDE_BOARD_H */ diff --git a/boards/arm64/zynq-mpsoc/zcu111/scripts/Make.defs b/boards/arm64/zynq-mpsoc/zcu111/scripts/Make.defs new file mode 100644 index 0000000000..26a64eb35c --- /dev/null +++ b/boards/arm64/zynq-mpsoc/zcu111/scripts/Make.defs @@ -0,0 +1,50 @@ +############################################################################ +# boards/arm64/zynq-mpsoc/zcu111/scripts/Make.defs +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. The +# ASF licenses this file to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance with the +# License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +# +############################################################################ + +include $(TOPDIR)/.config +include $(TOPDIR)/tools/Config.mk +include $(TOPDIR)/arch/arm64/src/Toolchain.defs + +LDSCRIPT = dramboot.ld + +ARCHSCRIPT += $(BOARD_DIR)$(DELIM)scripts$(DELIM)$(LDSCRIPT) + +CFLAGS := $(ARCHCFLAGS) $(ARCHOPTIMIZATION) $(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRAFLAGS) -pipe +CPICFLAGS = $(ARCHPICFLAGS) $(CFLAGS) +CXXFLAGS := $(ARCHCXXFLAGS) $(ARCHOPTIMIZATION) $(ARCHCPUFLAGS) $(ARCHXXINCLUDES) $(ARCHDEFINES) $(EXTRAFLAGS) -pipe +CXXPICFLAGS = $(ARCHPICFLAGS) $(CXXFLAGS) +CPPFLAGS := $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRAFLAGS) +AFLAGS := $(CFLAGS) -D__ASSEMBLY__ + +# NXFLAT module definitions + +NXFLATLDFLAGS1 = -r -d -warn-common +NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)$(DELIM)binfmt$(DELIM)libnxflat$(DELIM)gnu-nxflat-pcrel.ld -no-check-sections +LDNXFLATFLAGS = -e main -s 2048 + +EXEEXT = .elf + +# ELF module definitions + +CELFFLAGS = $(CFLAGS) -mlong-calls # --target1-abs +CXXELFFLAGS = $(CXXFLAGS) -mlong-calls # --target1-abs + +LDELFFLAGS = -r -e main +LDELFFLAGS += -T $(call CONVERT_PATH,$(TOPDIR)/binfmt/libelf/gnu-elf.ld) diff --git a/boards/arm64/zynq-mpsoc/zcu111/scripts/dramboot.ld b/boards/arm64/zynq-mpsoc/zcu111/scripts/dramboot.ld new file mode 100644 index 0000000000..3ec4fdd29a --- /dev/null +++ b/boards/arm64/zynq-mpsoc/zcu111/scripts/dramboot.ld @@ -0,0 +1,129 @@ +/**************************************************************************** + * boards/arm64/zynq-mpsoc/zcu111/scripts/dramboot.ld + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + * + ****************************************************************************/ + +OUTPUT_ARCH(aarch64) + +ENTRY(__start) + +PHDRS +{ + text PT_LOAD ; +} + +SECTIONS +{ + . = 0x00000000; /* U-Boot loads NuttX at this address (kernel_addr_r) */ + _start = .; + .text : { + _stext = .; /* Text section */ + *(.start .start.*) /* Place __start here */ + *(.text) + *(.text.cold) + *(.text.unlikely) + *(.fixup) + *(.gnu.warning) + } :text = 0x9090 + + . = ALIGN(4096); + + .init_section : { + _sinit = ABSOLUTE(.); + KEEP(*(SORT_BY_INIT_PRIORITY(.init_array.*) SORT_BY_INIT_PRIORITY(.ctors.*))) + KEEP(*(.init_array .ctors)) + _einit = ABSOLUTE(.); + } + + . = ALIGN(4096); + + .vector : { + _vector_start = .; + KEEP(*(.exc_vector_table)) + KEEP(*(".exc_vector_table.*")) + KEEP(*(.vectors)) + _vector_end = .; + } :text + . = ALIGN(4096); + _etext = .; /* End_1 of .text */ + _sztext = _etext - _stext; + + . = ALIGN(4096); + .rodata : { + _srodata = .; /* Read-only data */ + *(.rodata) + *(.rodata.*) + *(.data.rel.ro) + *(.data.rel.ro.*) + } :text + . = ALIGN(4096); + _erodata = .; /* End of read-only data */ + _szrodata = _erodata - _srodata; + _eronly = .; /* End of read-only data */ + + . = ALIGN(4096); + .data : { /* Data */ + _sdata = .; + *(.data.page_aligned) + *(.data) + . = ALIGN(8); + *(.data.rel) + *(.data.rel.*) + CONSTRUCTORS + } :text + _edata = .; /* End+1 of .data */ + + .bss : { /* BSS */ + . = ALIGN(8); + _sbss = .; + *(.bss) + . = ALIGN(8); + } :text + . = ALIGN(4096); + _ebss = .; + _szbss = _ebss - _sbss; + + .initstack : { /* INIT STACK */ + _s_initstack = .; + *(.initstack) + . = ALIGN(16); + } :text + . = ALIGN(4096); + _e_initstack = . ; + g_idle_topstack = . ; + + _szdata = _e_initstack - _sdata; + + /* Sections to be discarded */ + /DISCARD/ : { + *(.exit.text) + *(.exit.data) + *(.exitcall.exit) + *(.eh_frame) + } + + /* Stabs debugging sections. */ + .stab 0 : { *(.stab) } + .stabstr 0 : { *(.stabstr) } + .stab.excl 0 : { *(.stab.excl) } + .stab.exclstr 0 : { *(.stab.exclstr) } + .stab.index 0 : { *(.stab.index) } + .stab.indexstr 0 : { *(.stab.indexstr) } + .comment 0 : { *(.comment) } +} + diff --git a/boards/arm64/zynq-mpsoc/zcu111/src/Makefile b/boards/arm64/zynq-mpsoc/zcu111/src/Makefile new file mode 100644 index 0000000000..efa6c65ab4 --- /dev/null +++ b/boards/arm64/zynq-mpsoc/zcu111/src/Makefile @@ -0,0 +1,30 @@ +############################################################################ +# boards/arm64/zynq-mpsoc/zcu111/src/Makefile +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. The +# ASF licenses this file to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance with the +# License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +# +############################################################################ + +include $(TOPDIR)/Make.defs + +CSRCS = zcu111_boardinit.c +CSRCS += zcu111_appinit.c + +ifeq ($(CONFIG_ETC_ROMFS),y) + RCSRCS = etc/init.d/rc.sysinit etc/init.d/rcS +endif + +include $(TOPDIR)/boards/Board.mk diff --git a/boards/arm64/zynq-mpsoc/zcu111/src/etc/init.d/rc.sysinit b/boards/arm64/zynq-mpsoc/zcu111/src/etc/init.d/rc.sysinit new file mode 100644 index 0000000000..e5f967c6fa --- /dev/null +++ b/boards/arm64/zynq-mpsoc/zcu111/src/etc/init.d/rc.sysinit @@ -0,0 +1,25 @@ +/**************************************************************************** + * boards/arm64/zynq-mpsoc/zcu111/src/etc/init.d/rc.sysinit + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + * + ****************************************************************************/ + +#include + +#ifdef CONFIG_FS_PROCFS +mount -t procfs CONFIG_NSH_PROC_MOUNTPOINT +#endif diff --git a/boards/arm64/zynq-mpsoc/zcu111/src/etc/init.d/rcS b/boards/arm64/zynq-mpsoc/zcu111/src/etc/init.d/rcS new file mode 100644 index 0000000000..d57c92d5ed --- /dev/null +++ b/boards/arm64/zynq-mpsoc/zcu111/src/etc/init.d/rcS @@ -0,0 +1,22 @@ +/**************************************************************************** + * boards/arm64/zynq-mpsoc/zcu111/src/etc/init.d/rcS + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + * + ****************************************************************************/ + +#include + diff --git a/boards/arm64/zynq-mpsoc/zcu111/src/zcu111.h b/boards/arm64/zynq-mpsoc/zcu111/src/zcu111.h new file mode 100644 index 0000000000..7f5445e288 --- /dev/null +++ b/boards/arm64/zynq-mpsoc/zcu111/src/zcu111.h @@ -0,0 +1,37 @@ +/**************************************************************************** + * boards/arm64/zynq-mpsoc/zcu111/src/zcu111.h + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + * + ****************************************************************************/ + +#ifndef __BOARDS_ARM64_ZYNQ_MPSOC_ZCU111_SRC_ZCU111_H +#define __BOARDS_ARM64_ZYNQ_MPSOC_ZCU111_SRC_ZCU111_H + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include +#include +#ifndef __ASSEMBLY__ + +/**************************************************************************** + * Public Functions Definitions + ****************************************************************************/ + +#endif /* __ASSEMBLY__ */ +#endif /* __BOARDS_ARM64_ZYNQ_MPSOC_ZCU111_SRC_ZCU111_H */ diff --git a/boards/arm64/zynq-mpsoc/zcu111/src/zcu111_appinit.c b/boards/arm64/zynq-mpsoc/zcu111/src/zcu111_appinit.c new file mode 100644 index 0000000000..4a281ac10d --- /dev/null +++ b/boards/arm64/zynq-mpsoc/zcu111/src/zcu111_appinit.c @@ -0,0 +1,64 @@ +/**************************************************************************** + * boards/arm64/zynq-mpsoc/zcu111/src/zcu111_appinit.c + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include +#include +#include +#include "zcu111.h" + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: board_app_initialize + * + * Description: + * Perform application specific initialization. This function is never + * called directly from application code, but only indirectly via the + * (non-standard) boardctl() interface using the command BOARDIOC_INIT. + * + * Input Parameters: + * arg - The boardctl() argument is passed to the board_app_initialize() + * implementation without modification. The argument has no + * meaning to NuttX; the meaning of the argument is a contract + * between the board-specific initialization logic and the + * matching application logic. The value could be such things as a + * mode enumeration value, a set of DIP switch switch settings, a + * pointer to configuration data read from a file or serial FLASH, + * or whatever you would like to do with it. Every implementation + * should accept zero/NULL as a default configuration. + * + * Returned Value: + * Zero (OK) is returned on success; a negated errno value is returned on + * any failure to indicate the nature of the failure. + * + ****************************************************************************/ + +int board_app_initialize(uintptr_t arg) +{ + /* Perform board initialization */ + + return OK; +} diff --git a/boards/arm64/zynq-mpsoc/zcu111/src/zcu111_boardinit.c b/boards/arm64/zynq-mpsoc/zcu111/src/zcu111_boardinit.c new file mode 100644 index 0000000000..957a897737 --- /dev/null +++ b/boards/arm64/zynq-mpsoc/zcu111/src/zcu111_boardinit.c @@ -0,0 +1,104 @@ +/**************************************************************************** + * boards/arm64/zynq-mpsoc/zcu111/src/zcu111_boardinit.c + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include +#include +#include +#include "zcu111.h" + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: zynq_memory_initialize + * + * Description: + * All ZYNQ MPSOC architectures must provide the following entry point. + * This entry point is called early in the initialization before memory has + * been configured. This board-specific function is responsible for + * configuring any on-board memories. + * + * Logic in zynq_memory_initialize must be careful to avoid using any + * global variables because those will be uninitialized at the time this + * function is called. + * + * Input Parameters: + * None + * + * Returned Value: + * None + * + ****************************************************************************/ + +void zynq_memory_initialize(void) +{ + /* SDRAM was already init by bootloader in supported configuration */ +} + +/**************************************************************************** + * Name: zynq_board_initialize + * + * Description: + * All ZYNQ MPSOC architectures must provide the following entry point. + * This entry point is called in the initialization phase -- after + * zynq_memory_initialize and after all memory has been configured and + * mapped but before any devices have been initialized. + * + * Input Parameters: + * None + * + * Returned Value: + * None + * + ****************************************************************************/ + +void zynq_board_initialize(void) +{ +#ifdef CONFIG_ARCH_LEDS + /* Configure on-board LEDs if LED support has been selected. */ + + /* board_autoled_initialize(); */ +#endif +} + +/**************************************************************************** + * 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) +{ + /* Perform board initialization */ +} +#endif /* CONFIG_BOARD_LATE_INITIALIZE */