diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 9e1d311382..faca9c9fd4 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -80,6 +80,15 @@ config ARCH_CHIP_AM335X ---help--- TI AM335X family: AM3356, AM3357, AM3358, AM3359 (ARM Cortex-A8) +config ARCH_CHIP_FVP_ARMV8R_AARCH32 + bool "ARM FVP virt platform (ARMv8r AARCH32)" + select ARCH_ARMV8R + select ARCH_HAVE_LOWVECTORS + select ARCH_HAVE_FETCHADD + select ARMV8R_HAVE_DECODEFIQ + ---help--- + ARM FVP virt platform (ARMv8r) + config ARCH_CHIP_C5471 bool "TMS320 C5471" select ARCH_ARM7TDMI @@ -952,11 +961,13 @@ config ARCH_FAMILY default "armv7-m" if ARCH_ARMV7M default "armv7-r" if ARCH_ARMV7R default "armv8-m" if ARCH_ARMV8M + default "armv8-r" if ARCH_ARMV8R config ARCH_CHIP string default "a1x" if ARCH_CHIP_A1X default "am335x" if ARCH_CHIP_AM335X + default "fvp-v8r-aarch32" if ARCH_CHIP_FVP_ARMV8R_AARCH32 default "c5471" if ARCH_CHIP_C5471 default "dm320" if ARCH_CHIP_DM320 default "efm32" if ARCH_CHIP_EFM32 @@ -1341,6 +1352,9 @@ endif if ARCH_CHIP_AM335X source "arch/arm/src/am335x/Kconfig" endif +if ARCH_CHIP_FVP_ARMV8R_AARCH32 +source "arch/arm/src/fvp-v8r-aarch32/Kconfig" +endif if ARCH_CHIP_C5471 source "arch/arm/src/c5471/Kconfig" endif diff --git a/arch/arm/include/fvp-v8r-aarch32/chip.h b/arch/arm/include/fvp-v8r-aarch32/chip.h new file mode 100644 index 0000000000..937063d400 --- /dev/null +++ b/arch/arm/include/fvp-v8r-aarch32/chip.h @@ -0,0 +1,63 @@ +/**************************************************************************** + * arch/arm/include/fvp-v8r-aarch32/chip.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 __ARCH_ARM_INCLUDE_FVP_V8R_CHIP_H +#define __ARCH_ARM_INCLUDE_FVP_V8R_CHIP_H + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +/* Number of bytes in @p x kibibytes/mebibytes/gibibytes */ + +#define KB(x) ((x) << 10) +#define MB(x) (KB(x) << 10) +#define GB(x) (MB(UINT64_C(x)) << 10) + +#if defined(CONFIG_ARCH_CHIP_FVP_ARMV8R_AARCH32) + +#define CONFIG_GICD_BASE 0xAF000000 +#define CONFIG_GICR_BASE 0xAF100000 +#define CONFIG_GICR_OFFSET 0x20000 + +#define CONFIG_RAMBANK_ADDR 0x00000000 +#define CONFIG_RAMBANK_SIZE MB(128) +#define CONFIG_RAMBANK_END \ + (CONFIG_RAMBANK_ADDR + CONFIG_RAMBANK_SIZE) + +#define CONFIG_DEVICEIO1_BASEADDR 0xAF000000 +#define CONFIG_DEVICEIO1_SIZE MB(128) +#define CONFIG_DEVICEIO1_END \ + (CONFIG_DEVICEIO1_BASEADDR + CONFIG_DEVICEIO1_SIZE) + +#define CONFIG_DEVICEIO2_BASEADDR 0x9C000000 +#define CONFIG_DEVICEIO2_SIZE MB(128) +#define CONFIG_DEVICEIO2_END \ + (CONFIG_DEVICEIO2_BASEADDR + CONFIG_DEVICEIO2_SIZE) + +#define CONFIG_LOAD_BASE 0x00000000 + +#define MPID_TO_CLUSTER_ID(mpid) ((mpid) & ~0xff) + +#endif + +#endif /* __ARCH_ARM_INCLUDE_FVP_V8R_CHIP_H */ diff --git a/arch/arm/include/fvp-v8r-aarch32/irq.h b/arch/arm/include/fvp-v8r-aarch32/irq.h new file mode 100644 index 0000000000..c5ab6e8a44 --- /dev/null +++ b/arch/arm/include/fvp-v8r-aarch32/irq.h @@ -0,0 +1,34 @@ +/**************************************************************************** + * arch/arm/include/fvp-v8r-aarch32/irq.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. + * + ****************************************************************************/ + +/* This file should never be included directly but, rather, + * only indirectly through nuttx/irq.h + */ + +#ifndef __ARCH_ARM64_INCLUDE_FVP_V8R_IRQ_H +#define __ARCH_ARM64_INCLUDE_FVP_V8R_IRQ_H + +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ + +#define NR_IRQS 220 /* Total number of interrupts */ + +#endif /* __ARCH_ARM64_INCLUDE_FVP_V8R_IRQ_H */ diff --git a/arch/arm/src/armv8-r/arm_arch_timer.h b/arch/arm/src/armv8-r/arm_arch_timer.h index 19eda8d578..342bda7baa 100644 --- a/arch/arm/src/armv8-r/arm_arch_timer.h +++ b/arch/arm/src/armv8-r/arm_arch_timer.h @@ -1,5 +1,5 @@ /**************************************************************************** - * arch/arm64/src/common/arm64_arch_timer.h + * arch/arm/src/armv8-r/arm_arch_timer.h * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with diff --git a/arch/arm/src/fvp-v8r-aarch32/Kconfig b/arch/arm/src/fvp-v8r-aarch32/Kconfig new file mode 100644 index 0000000000..11748da20c --- /dev/null +++ b/arch/arm/src/fvp-v8r-aarch32/Kconfig @@ -0,0 +1,22 @@ +# +# For a description of the syntax of this configuration file, +# see the file kconfig-language.txt in the NuttX tools repository. +# + +if ARCH_CHIP_FVP_ARMV8R_AARCH32 + +menu "FVP ARMv8-R Virt Chip Selection" + +choice + prompt "FVP Core Configuration" + default ARCH_CHIP_FVP_R52 + +config ARCH_CHIP_FVP_R52 + bool "FVP virtual Processor (Cortex-r52)" + select ARMV8R_HAVE_GICv3 + +endchoice # FVP Chip Selection + +endmenu # "FVP Chip Selection" + +endif # ARCH_CHIP_FVP_ARMV8R_AARCH32 diff --git a/arch/arm/src/fvp-v8r-aarch32/Make.defs b/arch/arm/src/fvp-v8r-aarch32/Make.defs new file mode 100644 index 0000000000..f27c3aa36d --- /dev/null +++ b/arch/arm/src/fvp-v8r-aarch32/Make.defs @@ -0,0 +1,24 @@ +############################################################################ +# arch/arm/src/fvp-v8r/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 armv8-r/Make.defs + +# fvp-specific C source files +CHIP_CSRCS = fvp_boot.c fvp_serial.c diff --git a/arch/arm/src/fvp-v8r-aarch32/chip.h b/arch/arm/src/fvp-v8r-aarch32/chip.h new file mode 100644 index 0000000000..fe51d4e664 --- /dev/null +++ b/arch/arm/src/fvp-v8r-aarch32/chip.h @@ -0,0 +1,42 @@ +/**************************************************************************** + * arch/arm/src/fvp-v8r-aarch32/chip.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 __ARCH_ARM_SRC_FVP_V8R_CHIP_H +#define __ARCH_ARM_SRC_FVP_V8R_CHIP_H + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#ifndef __ASSEMBLY__ +# include +#endif + +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * Macro Definitions + ****************************************************************************/ + +#endif /* __ARCH_ARM_SRC_FVP_V8R_CHIP_H */ diff --git a/arch/arm/src/fvp-v8r-aarch32/fvp_boot.c b/arch/arm/src/fvp-v8r-aarch32/fvp_boot.c new file mode 100644 index 0000000000..cd90415731 --- /dev/null +++ b/arch/arm/src/fvp-v8r-aarch32/fvp_boot.c @@ -0,0 +1,95 @@ +/**************************************************************************** + * arch/arm/src/fvp-v8r-aarch32/fvp_boot.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 + +#include + +#include "barriers.h" +#include "cp15.h" +#include "arm_gic.h" +#include "chip.h" +#include "fvp_boot.h" +#include "serial_pl011.h" + +/**************************************************************************** + * Private Data + ****************************************************************************/ + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: arm_el_init + * + * Description: + * The function called from arm_head.S at very early stage for these + * platform, it's use to: + * - Handling special hardware initialize routine which is need to + * run at high ELs + * - Initialize system software such as hypervisor or security firmware + * which is need to run at high ELs + * + ****************************************************************************/ + +void arm_el_init(void) +{ + CP15_SET(CNTFRQ, CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC); + CP15_SET(ICC_HSRE, ICC_SRE_ELX_SRE_BIT | ICC_SRE_ELX_DFB_BIT | + ICC_SRE_ELX_DIB_BIT | ICC_SRE_EL3_EN_BIT); + + ARM_ISB(); +} + +/**************************************************************************** + * Name: arm_boot + * + * Description: + * Complete boot operations started in arm_head.S + * + ****************************************************************************/ + +void arm_boot(void) +{ + /* MAP IO and DRAM, enable MPU. */ + + /* Perform board-specific device initialization. This would include + * configuration of board specific resources such as GPIOs, LEDs, etc. + */ + + fvp_board_initialize(); + +#ifdef USE_EARLYSERIALINIT + /* Perform early serial initialization if we are going to use the serial + * driver. + */ + + arm_earlyserialinit(); +#endif +} diff --git a/arch/arm/src/fvp-v8r-aarch32/fvp_boot.h b/arch/arm/src/fvp-v8r-aarch32/fvp_boot.h new file mode 100644 index 0000000000..0cbdcc04c0 --- /dev/null +++ b/arch/arm/src/fvp-v8r-aarch32/fvp_boot.h @@ -0,0 +1,80 @@ +/**************************************************************************** + * arch/arm/src/fvp-v8r-aarch32/fvp_boot.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 __ARCH_ARM_SRC_FVP_V8R_FVP_BOOT_H +#define __ARCH_ARM_SRC_FVP_V8R_FVP_BOOT_H + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include +#include +#include +#include +#include +#include + +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ +#define CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC 100000000 + +/**************************************************************************** + * Public Function Prototypes + ****************************************************************************/ + +#ifndef __ASSEMBLY__ + +#undef EXTERN +#if defined(__cplusplus) +#define EXTERN extern "C" +extern "C" +{ +#else +#define EXTERN extern +#endif + +/**************************************************************************** + * Name: fvp_board_initialize + * + * Description: + * All fvp architectures must provide the following entry point. This + * entry point is called in the initialization phase -- after + * imx_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 fvp_board_initialize(void); + +#undef EXTERN +#if defined(__cplusplus) +} +#endif + +#endif /* __ASSEMBLY__ */ +#endif /* __ARCH_ARM_SRC_FVP_V8R_FVP_BOOT_H */ diff --git a/arch/arm/src/fvp-v8r-aarch32/fvp_serial.c b/arch/arm/src/fvp-v8r-aarch32/fvp_serial.c new file mode 100644 index 0000000000..2b1355850b --- /dev/null +++ b/arch/arm/src/fvp-v8r-aarch32/fvp_serial.c @@ -0,0 +1,75 @@ +/*************************************************************************** + * arch/arm/src/fvp-v8r-aarch32/fvp_serial.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 +#include +#include +#include +#include +#include + +#include + +#include "arm_internal.h" + +#ifdef USE_SERIALDRIVER + +/*************************************************************************** + * Public Functions + ***************************************************************************/ + +/*************************************************************************** + * Name: arm_earlyserialinit + * + * Description: + * see arm_internal.h + * + ***************************************************************************/ + +void arm_earlyserialinit(void) +{ + /* Enable the console UART. The other UARTs will be initialized if and + * when they are first opened. + */ + + pl011_earlyserialinit(); +} + +/*************************************************************************** + * Name: arm_serialinit + * + * Description: + * see arm_internal.h + * + ***************************************************************************/ + +void arm_serialinit(void) +{ + pl011_serialinit(); +} + +#endif /* USE_SERIALDRIVER */ diff --git a/arch/arm/src/fvp-v8r-aarch32/serial_pl011.h b/arch/arm/src/fvp-v8r-aarch32/serial_pl011.h new file mode 100644 index 0000000000..1c91902a28 --- /dev/null +++ b/arch/arm/src/fvp-v8r-aarch32/serial_pl011.h @@ -0,0 +1,53 @@ +/**************************************************************************** + * arch/arm/src/fvp-v8r-aarch32/serial_pl011.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 __ARCH_ARM_SRC_FVP_V8R_SERIAL_PL011_H +#define __ARCH_ARM_SRC_FVP_V8R_SERIAL_PL011_H + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * Public Types + ****************************************************************************/ + +/**************************************************************************** + * Inline Functions + ****************************************************************************/ + +#ifndef __ASSEMBLY__ + +/**************************************************************************** + * Public Data + ****************************************************************************/ + +/**************************************************************************** + * Public Function Prototypes + ****************************************************************************/ + +#endif /* __ASSEMBLY__ */ +#endif /* __ARCH_ARM_SRC_FVP_V8R_SERIAL_PL011_H */ diff --git a/boards/Kconfig b/boards/Kconfig index c7b66681f1..df5fa945e6 100644 --- a/boards/Kconfig +++ b/boards/Kconfig @@ -1890,6 +1890,14 @@ config ARCH_BOARD_FVP_ARMV8R This options selects support for NuttX on the Armv8-R AEM FVP configure board with ARM Cortex-R82. +config ARCH_BOARD_FVP_ARMV8R_AARCH32 + bool "FVP ARM-v8r AARCH32 CPUs board" + depends on ARCH_CHIP_FVP_ARMV8R_AARCH32 + select ARCH_HAVE_IRQBUTTONS + ---help--- + This options selects support for NuttX on the Armv8-R AEM FVP + configure board with ARM Cortex-R52. + config ARCH_BOARD_SAMA5D2_XULT bool "Atmel SAMA5D2 Xplained Ultra development board" depends on ARCH_CHIP_ATSAMA5D27 @@ -3009,6 +3017,7 @@ config ARCH_BOARD default "qemu-armv8a" if ARCH_BOARD_QEMU_ARMV8A default "pinephone" if ARCH_BOARD_PINEPHONE default "fvp-armv8r" if ARCH_BOARD_FVP_ARMV8R + default "fvp-armv8r-aarch32" if ARCH_BOARD_FVP_ARMV8R_AARCH32 default "sama5d2-xult" if ARCH_BOARD_SAMA5D2_XULT default "giant-board" if ARCH_BOARD_GIANT_BOARD default "jupiter-nano" if ARCH_BOARD_JUPITER_NANO @@ -3207,6 +3216,9 @@ endif if ARCH_BOARD_FVP_ARMV8R source "boards/arm64/fvp-v8r/fvp-armv8r/Kconfig" endif +if ARCH_BOARD_FVP_ARMV8R_AARCH32 +source "boards/arm/fvp-v8r-aarch32/fvp-armv8r-aarch32/Kconfig" +endif if ARCH_BOARD_IMXRT1020_EVK source "boards/arm/imxrt/imxrt1020-evk/Kconfig" endif diff --git a/boards/arm/fvp-v8r-aarch32/fvp-armv8r-aarch32/Kconfig b/boards/arm/fvp-v8r-aarch32/fvp-armv8r-aarch32/Kconfig new file mode 100644 index 0000000000..4a7ad9054f --- /dev/null +++ b/boards/arm/fvp-v8r-aarch32/fvp-armv8r-aarch32/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_FVP_ARMV8R_AARCH32 +endif diff --git a/boards/arm/fvp-v8r-aarch32/fvp-armv8r-aarch32/README.txt b/boards/arm/fvp-v8r-aarch32/fvp-armv8r-aarch32/README.txt new file mode 100644 index 0000000000..49dbde200a --- /dev/null +++ b/boards/arm/fvp-v8r-aarch32/fvp-armv8r-aarch32/README.txt @@ -0,0 +1,103 @@ +README.txt +========== + +This board configuration will use FVP_BaseR_AEMv8R to emulate +generic ARMv8-R (Cortex-R52) series hardware platform and +provides support for these devices: + + - GICv3 interrupt controllers for ARMv8-r + - PL011 UART controller(FVP) + +Contents +======== + - Getting Started + - Status + - Platform Features + - References + +Getting Started +=============== + +1. Compile Toolchain + I recommend to use the docker based CI image + /tools/ci/docker + +2. Getting Armv8-R AEM FVP + The Armv8-R AEM FVP is a free of charge Armv8-R Fixed Virtual Platform. + It supports the latest Armv8-R feature set. we can get it from: + https://developer.arm.com/downloads/-/arm-ecosystem-models + + Please select to download Armv8-R AEM FVP product, extract the tool package + the FVP tool is locate at: + /AEMv8R_FVP/AEMv8R_base_pkg/models/Linux64_GCC-9.3/FVP_BaseR_AEMv8R + Version 11.20 is tested fine. + +3. Configuring and building + 3.1 FVP Overview + Just like QEMU, Fixed Virtual Platforms (FVP) are complete simulations of an Arm system, + including processor, memory and peripherals. These are set out in a "programmer's view", + which gives you a comprehensive model on which to build and test your software. + + The FVP tools simulate 4 serial port and implement them to wait on local socket port: + + $ /AEMv8R_FVP/AEMv8R_base_pkg/models/Linux64_GCC-9.3/FVP_BaseR_AEMv8R \ + -f boards/arm/fvp-v8r-aarch32/fvp-armv8r/scripts/fvp_cfg.txt -a ./nuttx + terminal_0: Listening for serial connection on port 5000 + terminal_1: Listening for serial connection on port 5001 + terminal_2: Listening for serial connection on port 5002 + terminal_3: Listening for serial connection on port 5003 + + FVP has four UART port and I choice UART1 as tty, so just telnet to port 5001 + will enter nsh: + telnet localhost 5001 + + 3.2 Single Core + Configuring NuttX and compile: + $ ./tools/configure.sh -l fvp-armv8r-aarch32:nsh + $ make + +4. Running + + 4.1 Single Core + + Step1: Booting NuttX + + $ AEMv8R_FVP/AEMv8R_base_pkg/models/Linux64_GCC-9.3/FVP_BaseR_AEMv8R \ + -f boards/arm/fvp-v8r-aarch32/fvp-armv8r-aarch32/scripts/fvp_cfg.txt \ + -a ./nuttx + terminal_0: Listening for serial connection on port 5000 + terminal_1: Listening for serial connection on port 5001 + terminal_2: Listening for serial connection on port 5002 + terminal_3: Listening for serial connection on port 5003 + + Step2: telnet to UART1 + Starting another terminal and enter: + $ telnet localhost 5001 + Trying 127.0.0.1... + Connected to localhost. + Escape character is '^]'. + nsh: mkfatfs: command not found + NuttShell (NSH) NuttX-12.1.0 + nsh> + + +Status +====== + +2023-5-31: +1. Initial version for ARMv8-R AARCH32, Single Core, noMPU, noFPU, noCache using GCC Toolchain + +Platform Features +================= + +The following hardware features are supported: ++--------------+------------+----------------------+ +| Interface | Controller | Driver/Component | ++==============+============+======================+ +| GICv3 | on-chip | interrupt controller | ++--------------+------------+----------------------+ +| PL011 UART | on-chip | serial port | ++--------------+------------+----------------------+ +| ARM TIMER | on-chip | system clock | ++--------------+------------+----------------------+ + diff --git a/boards/arm/fvp-v8r-aarch32/fvp-armv8r-aarch32/configs/nsh/defconfig b/boards/arm/fvp-v8r-aarch32/fvp-armv8r-aarch32/configs/nsh/defconfig new file mode 100644 index 0000000000..acbcd5b505 --- /dev/null +++ b/boards/arm/fvp-v8r-aarch32/fvp-armv8r-aarch32/configs/nsh/defconfig @@ -0,0 +1,80 @@ +# +# 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_DEBUG_OPT_UNUSED_SECTIONS is not set +CONFIG_ARCH="arm" +CONFIG_ARCH_BOARD="fvp-armv8r-aarch32" +CONFIG_ARCH_BOARD_FVP_ARMV8R_AARCH32=y +CONFIG_ARCH_CHIP="fvp-v8r-aarch32" +CONFIG_ARCH_CHIP_FVP_ARMV8R_AARCH32=y +CONFIG_ARCH_CHIP_FVP_R52=y +CONFIG_ARCH_INTERRUPTSTACK=4096 +CONFIG_BUILTIN=y +CONFIG_DEBUG_ASSERTIONS=y +CONFIG_DEBUG_ERROR=y +CONFIG_DEBUG_FEATURES=y +CONFIG_DEBUG_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_DEBUG_TCBINFO=y +CONFIG_DEBUG_WARN=y +CONFIG_DEFAULT_TASK_STACKSIZE=8192 +CONFIG_DEV_ZERO=y +CONFIG_EXAMPLES_HELLO=y +CONFIG_EXPERIMENTAL=y +CONFIG_FS_PROCFS=y +CONFIG_FS_PROCFS_REGISTER=y +CONFIG_FS_ROMFS=y +CONFIG_IDLETHREAD_STACKSIZE=8192 +CONFIG_INIT_ENTRYPOINT="nsh_main" +CONFIG_INTELHEX_BINARY=y +CONFIG_NSH_ARCHINIT=y +CONFIG_NSH_BUILTIN_APPS=y +CONFIG_NSH_FILEIOSIZE=512 +CONFIG_NSH_READLINE=y +CONFIG_NSH_ROMFSETC=y +CONFIG_PREALLOC_TIMERS=4 +CONFIG_PTHREAD_STACK_MIN=8192 +CONFIG_RAMLOG=y +CONFIG_RAM_SIZE=134217728 +CONFIG_RAM_START=0x20000000 +CONFIG_RAW_BINARY=y +CONFIG_READLINE_CMD_HISTORY=y +CONFIG_RR_INTERVAL=200 +CONFIG_SCHED_HPWORK=y +CONFIG_SCHED_HPWORKPRIORITY=192 +CONFIG_SPINLOCK=y +CONFIG_STACK_COLORATION=y +CONFIG_START_MONTH=3 +CONFIG_START_YEAR=2022 +CONFIG_SYMTAB_ORDEREDBYNAME=y +CONFIG_SYSLOG_BUFFER=y +CONFIG_SYSLOG_PROCESSID=y +CONFIG_SYSLOG_PROCESS_NAME=y +CONFIG_SYSTEM_NSH=y +CONFIG_SYSTEM_SYSTEM=y +CONFIG_SYSTEM_TIME64=y +CONFIG_TESTING_GETPRIME=y +CONFIG_TESTING_OSTEST=y +CONFIG_UART0_BASE=0x9c090000 +CONFIG_UART0_IRQ=37 +CONFIG_UART0_PL011=y +CONFIG_UART1_BASE=0x9c0a0000 +CONFIG_UART1_IRQ=38 +CONFIG_UART1_PL011=y +CONFIG_UART1_SERIAL_CONSOLE=y +CONFIG_UART2_BASE=0x9c0b0000 +CONFIG_UART2_IRQ=39 +CONFIG_UART2_PL011=y +CONFIG_UART3_BASE=0x9c0c0000 +CONFIG_UART3_IRQ=40 +CONFIG_UART3_PL011=y +CONFIG_UART_PL011=y +CONFIG_USEC_PER_TICK=1000 diff --git a/boards/arm/fvp-v8r-aarch32/fvp-armv8r-aarch32/include/board.h b/boards/arm/fvp-v8r-aarch32/fvp-armv8r-aarch32/include/board.h new file mode 100644 index 0000000000..c87e33d79c --- /dev/null +++ b/boards/arm/fvp-v8r-aarch32/fvp-armv8r-aarch32/include/board.h @@ -0,0 +1,34 @@ +/**************************************************************************** + * boards/arm/fvp-v8r-aarch32/fvp-armv8r-aarch32/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_ARM_FVP_V8R_FVP_ARMV8R_INCLUDE_BOARD_H +#define __BOARDS_ARM_FVP_V8R_FVP_ARMV8R_INCLUDE_BOARD_H + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ + +#endif /* __BOARDS_ARM_FVP_V8R_FVP_ARMV8R_INCLUDE_BOARD_H */ diff --git a/boards/arm/fvp-v8r-aarch32/fvp-armv8r-aarch32/include/board_memorymap.h b/boards/arm/fvp-v8r-aarch32/fvp-armv8r-aarch32/include/board_memorymap.h new file mode 100644 index 0000000000..84fcae467d --- /dev/null +++ b/boards/arm/fvp-v8r-aarch32/fvp-armv8r-aarch32/include/board_memorymap.h @@ -0,0 +1,59 @@ +/**************************************************************************** + * boards/arm/fvp-v8r-aarch32/fvp-armv8r-aarch32/include/board_memorymap.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_ARM_FVP_V8R_FVP_ARMV8R_INCLUDE_BOARD_MEMORYMAP_H +#define __BOARDS_ARM_FVP_V8R_FVP_ARMV8R_INCLUDE_BOARD_MEMORYMAP_H + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * Public Data + ****************************************************************************/ + +#ifndef __ASSEMBLY__ + +#undef EXTERN +#if defined(__cplusplus) +#define EXTERN extern "C" +extern "C" +{ +#else +#define EXTERN extern +#endif + +/**************************************************************************** + * Public Function Prototypes + ****************************************************************************/ + +#undef EXTERN +#if defined(__cplusplus) +} +#endif + +#endif /* __ASSEMBLY__ */ +#endif /* __BOARDS_ARM_VDK_ARMV8R_BASE_INCLUDE_BOARD_MEMORYMAP_H */ diff --git a/boards/arm/fvp-v8r-aarch32/fvp-armv8r-aarch32/scripts/Make.defs b/boards/arm/fvp-v8r-aarch32/fvp-armv8r-aarch32/scripts/Make.defs new file mode 100644 index 0000000000..681c6411ee --- /dev/null +++ b/boards/arm/fvp-v8r-aarch32/fvp-armv8r-aarch32/scripts/Make.defs @@ -0,0 +1,48 @@ +############################################################################ +# boards/arm/fvp-v8r-aarch32/fvp-armv8r-aarch32/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/arm/src/armv8-r/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 + +# 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/arm/fvp-v8r-aarch32/fvp-armv8r-aarch32/scripts/dramboot.ld b/boards/arm/fvp-v8r-aarch32/fvp-armv8r-aarch32/scripts/dramboot.ld new file mode 100644 index 0000000000..43d5a50499 --- /dev/null +++ b/boards/arm/fvp-v8r-aarch32/fvp-armv8r-aarch32/scripts/dramboot.ld @@ -0,0 +1,115 @@ +/**************************************************************************** + * boards/arm/fvp-v8r-aarch32/fvp-armv8r-aarch32/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(arm) + +MEMORY +{ + FLASH (RX): ORIGIN = 0x00000000, LENGTH = 64M + RAM (RWX): ORIGIN = 0x20000000, LENGTH = 64M +} + +ENTRY(__start) + +SECTIONS +{ + .text : + { + _stext = ABSOLUTE(.); + KEEP(*(.hyp_vectors)) + . = ALIGN(32); + KEEP(*(.sys_vectors)) + *(.text .text.*) + *(.fixup) + *(.gnu.warning) + *(.rodata .rodata.*) + *(.gnu.linkonce.t.*) + *(.glue_7) + *(.glue_7t) + *(.got) + *(.gcc_except_table) + *(.gnu.linkonce.r.*) + *(.ARM.extab*) + *(.gnu.linkonce.armextab.*) + _etext = ABSOLUTE(.); + } > FLASH + + .init_section : + { + _sinit = ABSOLUTE(.); + *(.init_array .init_array.*) + _einit = ABSOLUTE(.); + } > FLASH + + .ARM.extab : + { + *(.ARM.extab*) + } > FLASH + + /* .ARM.exidx is sorted, so has to go in its own output section. */ + + PROVIDE_HIDDEN (__exidx_start = .); + .ARM.exidx : + { + *(.ARM.exidx* .gnu.linkonce.armexidx.*) + } > FLASH + PROVIDE_HIDDEN (__exidx_end = .); + + _eronly = ABSOLUTE(.); + + .data : + { + _sdata = ABSOLUTE(.); + *(.data .data.*) + *(.gnu.linkonce.d.*) + CONSTRUCTORS + . = ALIGN(4); + _edata = ABSOLUTE(.); + } > RAM AT > FLASH + + .bss : + { + _sbss = ABSOLUTE(.); + *(.bss .bss.*) + *(.gnu.linkonce.b.*) + *(COMMON) + . = ALIGN(4); + _ebss = ABSOLUTE(.); + } > RAM + + /* Uninitialized data */ + + .noinit : + { + _snoinit = ABSOLUTE(.); + *(.noinit*) + _enoinit = ABSOLUTE(.); + } > RAM + + /* 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) } +} \ No newline at end of file diff --git a/boards/arm/fvp-v8r-aarch32/fvp-armv8r-aarch32/scripts/fvp_cfg.txt b/boards/arm/fvp-v8r-aarch32/fvp-armv8r-aarch32/scripts/fvp_cfg.txt new file mode 100644 index 0000000000..82f42d8ca1 --- /dev/null +++ b/boards/arm/fvp-v8r-aarch32/fvp-armv8r-aarch32/scripts/fvp_cfg.txt @@ -0,0 +1,21 @@ +cluster0.has_aarch64=0 +cluster0.VMSA_supported=0 +cluster0.NUM_CORES=1 +gic_distributor.GICD_CTLR-DS-1-means-secure-only=1 +gic_distributor.has-two-security-states=0 +bp.refcounter.non_arch_start_at_default=1 +bp.pl011_uart0.out_file=- +bp.pl011_uart0.unbuffered_output=1 +bp.terminal_0.start_telnet=0 +bp.pl011_uart1.out_file=- +bp.pl011_uart1.unbuffered_output=1 +bp.terminal_1.start_telnet=0 +bp.pl011_uart2.out_file=- +bp.pl011_uart2.unbuffered_output=1 +bp.terminal_2.start_telnet=0 +bp.pl011_uart3.out_file=- +bp.pl011_uart3.unbuffered_output=1 +bp.terminal_3.start_telnet=0 +bp.vis.disable_visualisation=1 +bp.vis.rate_limit-enable=0 +cache_state_modelled=0 diff --git a/boards/arm/fvp-v8r-aarch32/fvp-armv8r-aarch32/src/Makefile b/boards/arm/fvp-v8r-aarch32/fvp-armv8r-aarch32/src/Makefile new file mode 100644 index 0000000000..dfa2749996 --- /dev/null +++ b/boards/arm/fvp-v8r-aarch32/fvp-armv8r-aarch32/src/Makefile @@ -0,0 +1,29 @@ +############################################################################ +# boards/arm/fvp-v8r-aarch32/fvp-armv8r-aarch32/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 = fvp_boardinit.c fvp_bringup.c + +ifeq ($(CONFIG_BOARDCTL),y) +CSRCS += fvp_appinit.c +endif + +include $(TOPDIR)/boards/Board.mk diff --git a/boards/arm/fvp-v8r-aarch32/fvp-armv8r-aarch32/src/fvp-armv8r.h b/boards/arm/fvp-v8r-aarch32/fvp-armv8r-aarch32/src/fvp-armv8r.h new file mode 100644 index 0000000000..4867669570 --- /dev/null +++ b/boards/arm/fvp-v8r-aarch32/fvp-armv8r-aarch32/src/fvp-armv8r.h @@ -0,0 +1,59 @@ +/**************************************************************************** + * boards/arm/fvp-v8r-aarch32/fvp-armv8r-aarch32/src/fvp-armv8r.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_ARM_VDK_ARMV8R_BASE_SRC_VDK_ARMV8R_H__ +#define __BOARDS_ARM_VDK_ARMV8R_BASE_SRC_VDK_ARMV8R_H__ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include + +/**************************************************************************** + * Public Types + ****************************************************************************/ + +/**************************************************************************** + * Public Data + ****************************************************************************/ + +#ifndef __ASSEMBLY__ + +/**************************************************************************** + * Public Functions Definitions + ****************************************************************************/ + +/**************************************************************************** + * Name: vdk_bringup + * + * Description: + * Bring up board features + * + ****************************************************************************/ + +#if defined(CONFIG_BOARDCTL) || defined(CONFIG_BOARD_LATE_INITIALIZE) +int fvp_bringup(void); +#endif + +#endif /* __ASSEMBLY__ */ +#endif /* __BOARDS_ARM_VDK_ARMV8R_BASE_SRC_VDK_ARMV8R_H__ */ diff --git a/boards/arm/fvp-v8r-aarch32/fvp-armv8r-aarch32/src/fvp_appinit.c b/boards/arm/fvp-v8r-aarch32/fvp-armv8r-aarch32/src/fvp_appinit.c new file mode 100644 index 0000000000..c86000d93e --- /dev/null +++ b/boards/arm/fvp-v8r-aarch32/fvp-armv8r-aarch32/src/fvp_appinit.c @@ -0,0 +1,73 @@ +/**************************************************************************** + * boards/arm/fvp-v8r-aarch32/fvp-armv8r-aarch32/src/fvp_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 "fvp-armv8r.h" + +#ifdef CONFIG_BOARDCTL + +/**************************************************************************** + * 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) +{ + UNUSED(arg); +#ifndef CONFIG_BOARD_LATE_INITIALIZE + /* Perform board initialization */ + + return fvp_bringup(); +#else + return OK; +#endif +} + +#endif /* CONFIG_BOARDCTL */ diff --git a/boards/arm/fvp-v8r-aarch32/fvp-armv8r-aarch32/src/fvp_boardinit.c b/boards/arm/fvp-v8r-aarch32/fvp-armv8r-aarch32/src/fvp_boardinit.c new file mode 100644 index 0000000000..a1f18304b2 --- /dev/null +++ b/boards/arm/fvp-v8r-aarch32/fvp-armv8r-aarch32/src/fvp_boardinit.c @@ -0,0 +1,113 @@ +/**************************************************************************** + * boards/arm/fvp-v8r-aarch32/fvp-armv8r-aarch32/src/fvp_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 "fvp-armv8r.h" + +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * Private Functions + ****************************************************************************/ + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: fvp_memory_initialize + * + * Description: + * All vdk 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 vdk_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 fvp_memory_initialize(void) +{ + /* SDRAM was initialized by a bootloader in the supported configurations. */ +} + +/**************************************************************************** + * Name: vdk_board_initialize + * + * Description: + * All vdk architectures must provide the following entry point. This + * entry point is called in the initialization phase -- after + * vdk_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 fvp_board_initialize(void) +{ +#ifdef CONFIG_ARCH_LEDS + /* Configure on-board LEDs if LED support has been selected. */ + +#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_intitialize() 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 */ + + fvp_bringup(); +} +#endif /* CONFIG_BOARD_LATE_INITIALIZE */ diff --git a/boards/arm/fvp-v8r-aarch32/fvp-armv8r-aarch32/src/fvp_bringup.c b/boards/arm/fvp-v8r-aarch32/fvp-armv8r-aarch32/src/fvp_bringup.c new file mode 100644 index 0000000000..06e2c64b5d --- /dev/null +++ b/boards/arm/fvp-v8r-aarch32/fvp-armv8r-aarch32/src/fvp_bringup.c @@ -0,0 +1,60 @@ +/**************************************************************************** + * boards/arm/fvp-v8r-aarch32/fvp-armv8r-aarch32/src/fvp_bringup.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 + +#include "fvp-armv8r.h" + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: fvp_bringup + * + * Description: + * Bring up board features + * + ****************************************************************************/ + +int fvp_bringup(void) +{ + int ret; + +#ifdef CONFIG_FS_PROCFS + /* Mount the procfs file system */ + + ret = nx_mount(NULL, "/proc", "procfs", 0, NULL); + if (ret < 0) + { + syslog(LOG_ERR, "ERROR: Failed to mount procfs at /proc: %d\n", ret); + } +#endif + + UNUSED(ret); + return OK; +}