This is an automated email from the ASF dual-hosted git repository. acassis pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/nuttx.git
commit ed680c0242f5341b3ce7e54718af4e4dd8875162 Author: Emre Cecanpunar <[email protected]> AuthorDate: Fri Jul 17 20:41:09 2026 +0300 boards/arm64/rk3588s: add Orange Pi 5 Pro support Add NSH and OSTest configurations, the DRAM linker script, and the minimal board initialization and reset hooks for RK3588S. Signed-off-by: Emre Cecanpunar <[email protected]> --- boards/Kconfig | 11 ++ boards/arm64/rk3588/orangepi-5-pro/CMakeLists.txt | 23 ++++ boards/arm64/rk3588/orangepi-5-pro/Kconfig | 7 ++ .../rk3588/orangepi-5-pro/configs/nsh/defconfig | 59 ++++++++++ .../rk3588/orangepi-5-pro/configs/ostest/defconfig | 58 +++++++++ boards/arm64/rk3588/orangepi-5-pro/include/board.h | 32 +++++ .../arm64/rk3588/orangepi-5-pro/scripts/Make.defs | 42 +++++++ .../rk3588/orangepi-5-pro/scripts/dramboot.ld | 130 +++++++++++++++++++++ .../arm64/rk3588/orangepi-5-pro/src/CMakeLists.txt | 33 ++++++ boards/arm64/rk3588/orangepi-5-pro/src/Makefile | 31 +++++ .../arm64/rk3588/orangepi-5-pro/src/orangepi5pro.h | 38 ++++++ .../orangepi-5-pro/src/orangepi5pro_boardinit.c | 54 +++++++++ .../orangepi-5-pro/src/orangepi5pro_bringup.c | 53 +++++++++ .../rk3588/orangepi-5-pro/src/orangepi5pro_reset.c | 45 +++++++ 14 files changed, 616 insertions(+) diff --git a/boards/Kconfig b/boards/Kconfig index 1e7218a1c03..ef659615b34 100644 --- a/boards/Kconfig +++ b/boards/Kconfig @@ -2580,6 +2580,13 @@ config ARCH_BOARD_PINEPHONE_PRO This options selects support for NuttX on PINE64 PinePhone based on Rockchip RK3399 SoC with ARM Cortex-A53 +config ARCH_BOARD_ORANGEPI_5_PRO + bool "Orange Pi 5 Pro" + depends on ARCH_CHIP_RK3588 + ---help--- + This option selects support for NuttX on the Orange Pi 5 Pro + based on Rockchip RK3588S SoC with ARM Cortex-A76/Cortex-A55. + config ARCH_BOARD_NANOPI_M4 bool "FriendlyElec NanoPi M4" depends on ARCH_CHIP_RK3399 @@ -3963,6 +3970,7 @@ config ARCH_BOARD default "qemu-armv8a" if ARCH_BOARD_QEMU_ARMV8A default "pinephone" if ARCH_BOARD_PINEPHONE default "pinephonepro" if ARCH_BOARD_PINEPHONE_PRO + default "orangepi-5-pro" if ARCH_BOARD_ORANGEPI_5_PRO default "pocketbeagle2" if ARCH_BOARD_POCKETBEAGLE2 default "beagleplay" if ARCH_BOARD_BEAGLEPLAY default "nanopi_m4" if ARCH_BOARD_NANOPI_M4 @@ -4213,6 +4221,9 @@ endif if ARCH_BOARD_PINEPHONE_PRO source "boards/arm64/rk3399/pinephonepro/Kconfig" endif +if ARCH_BOARD_ORANGEPI_5_PRO +source "boards/arm64/rk3588/orangepi-5-pro/Kconfig" +endif if ARCH_BOARD_POCKETBEAGLE2 source "boards/arm64/am62x/pocketbeagle2/Kconfig" endif diff --git a/boards/arm64/rk3588/orangepi-5-pro/CMakeLists.txt b/boards/arm64/rk3588/orangepi-5-pro/CMakeLists.txt new file mode 100644 index 00000000000..cd2e35dc0c0 --- /dev/null +++ b/boards/arm64/rk3588/orangepi-5-pro/CMakeLists.txt @@ -0,0 +1,23 @@ +# ############################################################################## +# boards/arm64/rk3588/orangepi-5-pro/CMakeLists.txt +# +# SPDX-License-Identifier: Apache-2.0 +# +# 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. +# +# ############################################################################## + +add_subdirectory(src) diff --git a/boards/arm64/rk3588/orangepi-5-pro/Kconfig b/boards/arm64/rk3588/orangepi-5-pro/Kconfig new file mode 100644 index 00000000000..670414d6543 --- /dev/null +++ b/boards/arm64/rk3588/orangepi-5-pro/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_ORANGEPI_5_PRO +endif # ARCH_BOARD_ORANGEPI_5_PRO diff --git a/boards/arm64/rk3588/orangepi-5-pro/configs/nsh/defconfig b/boards/arm64/rk3588/orangepi-5-pro/configs/nsh/defconfig new file mode 100644 index 00000000000..295359971b2 --- /dev/null +++ b/boards/arm64/rk3588/orangepi-5-pro/configs/nsh/defconfig @@ -0,0 +1,59 @@ +# +# 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_16550_ADDRWIDTH=0 +CONFIG_16550_POLLING=y +CONFIG_16550_REGWIDTH=32 +CONFIG_16550_SET_MCR_OUT2=y +CONFIG_16550_SUPRESS_INITIAL_CONFIG=y +CONFIG_16550_UART0=y +CONFIG_16550_UART0_BASE=0xfeb50000 +CONFIG_16550_UART0_BAUD=1500000 +CONFIG_16550_UART0_CLOCK=24000000 +CONFIG_16550_UART0_IRQ=365 +CONFIG_16550_UART0_RX_TRIGGER=0 +CONFIG_16550_UART0_SERIAL_CONSOLE=y +CONFIG_16550_UART=y +CONFIG_ARCH="arm64" +CONFIG_ARCH_ARM64=y +CONFIG_ARCH_BOARD="orangepi-5-pro" +CONFIG_ARCH_BOARD_ORANGEPI_5_PRO=y +CONFIG_ARCH_CHIP="rk3588" +CONFIG_ARCH_CHIP_RK3588=y +CONFIG_ARCH_EARLY_PRINT=y +CONFIG_ARCH_INTERRUPTSTACK=4096 +CONFIG_ARCH_IRQPRIO=y +CONFIG_ARM64_PA_BITS=40 +CONFIG_BOARDCTL_RESET=y +CONFIG_BOARD_LOOPSPERMSEC=116422 +CONFIG_BUILTIN=y +CONFIG_DEBUG_ASSERTIONS=y +CONFIG_DEBUG_FEATURES=y +CONFIG_DEBUG_FULLOPT=y +CONFIG_DEBUG_SYMBOLS=y +CONFIG_DEFAULT_TASK_STACKSIZE=8192 +CONFIG_EXPERIMENTAL=y +CONFIG_FS_PROCFS=y +CONFIG_IDLETHREAD_STACKSIZE=8192 +CONFIG_INIT_ENTRYPOINT="nsh_main" +CONFIG_NSH_BUILTIN_APPS=y +CONFIG_NSH_FILEIOSIZE=512 +CONFIG_NSH_READLINE=y +CONFIG_PTHREAD_STACK_MIN=8192 +CONFIG_RAMLOG=y +CONFIG_RAM_SIZE=536870912 +CONFIG_RAM_START=0x02080000 +CONFIG_RAW_BINARY=y +CONFIG_RR_INTERVAL=200 +CONFIG_SCHED_HPWORK=y +CONFIG_SCHED_HPWORKPRIORITY=192 +CONFIG_SCHED_WAITPID=y +CONFIG_SERIAL_UART_ARCH_MMIO=y +CONFIG_SPINLOCK=y +CONFIG_STACK_COLORATION=y +CONFIG_SYSTEM_NSH=y +CONFIG_USEC_PER_TICK=1000 diff --git a/boards/arm64/rk3588/orangepi-5-pro/configs/ostest/defconfig b/boards/arm64/rk3588/orangepi-5-pro/configs/ostest/defconfig new file mode 100644 index 00000000000..d63d0b2a81a --- /dev/null +++ b/boards/arm64/rk3588/orangepi-5-pro/configs/ostest/defconfig @@ -0,0 +1,58 @@ +# +# 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_16550_ADDRWIDTH=0 +CONFIG_16550_POLLING=y +CONFIG_16550_REGWIDTH=32 +CONFIG_16550_SET_MCR_OUT2=y +CONFIG_16550_SUPRESS_INITIAL_CONFIG=y +CONFIG_16550_UART0=y +CONFIG_16550_UART0_BASE=0xfeb50000 +CONFIG_16550_UART0_BAUD=1500000 +CONFIG_16550_UART0_CLOCK=24000000 +CONFIG_16550_UART0_IRQ=365 +CONFIG_16550_UART0_RX_TRIGGER=0 +CONFIG_16550_UART0_SERIAL_CONSOLE=y +CONFIG_16550_UART=y +CONFIG_ARCH="arm64" +CONFIG_ARCH_ARM64=y +CONFIG_ARCH_BOARD="orangepi-5-pro" +CONFIG_ARCH_BOARD_ORANGEPI_5_PRO=y +CONFIG_ARCH_CHIP="rk3588" +CONFIG_ARCH_CHIP_RK3588=y +CONFIG_ARCH_EARLY_PRINT=y +CONFIG_ARCH_INTERRUPTSTACK=4096 +CONFIG_ARCH_IRQPRIO=y +CONFIG_ARM64_PA_BITS=40 +CONFIG_BOARDCTL=y +CONFIG_BOARDCTL_RESET=y +CONFIG_BOARD_LOOPSPERMSEC=116422 +CONFIG_BUILTIN=y +CONFIG_DEBUG_ASSERTIONS=y +CONFIG_DEBUG_FEATURES=y +CONFIG_DEBUG_FULLOPT=y +CONFIG_DEBUG_SYMBOLS=y +CONFIG_DEFAULT_TASK_STACKSIZE=8192 +CONFIG_EXPERIMENTAL=y +CONFIG_FS_PROCFS=y +CONFIG_IDLETHREAD_STACKSIZE=8192 +CONFIG_INIT_ENTRYPOINT="ostest_main" +CONFIG_PTHREAD_STACK_MIN=8192 +CONFIG_RAMLOG=y +CONFIG_RAM_SIZE=536870912 +CONFIG_RAM_START=0x02080000 +CONFIG_RAW_BINARY=y +CONFIG_RR_INTERVAL=200 +CONFIG_SCHED_HPWORK=y +CONFIG_SCHED_HPWORKPRIORITY=192 +CONFIG_SCHED_WAITPID=y +CONFIG_SERIAL_UART_ARCH_MMIO=y +CONFIG_SPINLOCK=y +CONFIG_STACK_COLORATION=y +CONFIG_TESTING_OSTEST=y +CONFIG_TESTING_OSTEST_STACKSIZE=16384 +CONFIG_USEC_PER_TICK=1000 diff --git a/boards/arm64/rk3588/orangepi-5-pro/include/board.h b/boards/arm64/rk3588/orangepi-5-pro/include/board.h new file mode 100644 index 00000000000..425b8ce5448 --- /dev/null +++ b/boards/arm64/rk3588/orangepi-5-pro/include/board.h @@ -0,0 +1,32 @@ +/**************************************************************************** + * boards/arm64/rk3588/orangepi-5-pro/include/board.h + * + * SPDX-License-Identifier: Apache-2.0 + * + * 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_RK3588_ORANGEPI_5_PRO_INCLUDE_BOARD_H +#define __BOARDS_ARM64_RK3588_ORANGEPI_5_PRO_INCLUDE_BOARD_H + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include <nuttx/config.h> + +#endif /* __BOARDS_ARM64_RK3588_ORANGEPI_5_PRO_INCLUDE_BOARD_H */ diff --git a/boards/arm64/rk3588/orangepi-5-pro/scripts/Make.defs b/boards/arm64/rk3588/orangepi-5-pro/scripts/Make.defs new file mode 100644 index 00000000000..86e98cd9fea --- /dev/null +++ b/boards/arm64/rk3588/orangepi-5-pro/scripts/Make.defs @@ -0,0 +1,42 @@ +############################################################################ +# boards/arm64/rk3588/orangepi-5-pro/scripts/Make.defs +# +# SPDX-License-Identifier: Apache-2.0 +# +# 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) +CPICFLAGS = $(ARCHPICFLAGS) $(CFLAGS) +CXXFLAGS := $(ARCHCXXFLAGS) $(ARCHOPTIMIZATION) $(ARCHCPUFLAGS) $(ARCHXXINCLUDES) $(ARCHDEFINES) $(EXTRAFLAGS) +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 diff --git a/boards/arm64/rk3588/orangepi-5-pro/scripts/dramboot.ld b/boards/arm64/rk3588/orangepi-5-pro/scripts/dramboot.ld new file mode 100644 index 00000000000..69150b50f60 --- /dev/null +++ b/boards/arm64/rk3588/orangepi-5-pro/scripts/dramboot.ld @@ -0,0 +1,130 @@ +/**************************************************************************** + * boards/arm64/rk3588/orangepi-5-pro/scripts/dramboot.ld + * + * SPDX-License-Identifier: Apache-2.0 + * + * 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. + * + * Orange Pi 5 Pro linker script for the initial boot image. The kernel is + * linked at the address selected by U-Boot after ARM64 Image relocation. + * + ****************************************************************************/ + +#include <nuttx/config.h> + +OUTPUT_ARCH(aarch64) +ENTRY(__start) + +PHDRS +{ + text PT_LOAD ; +} + +SECTIONS +{ + . = CONFIG_RAM_START; + _start = .; + + .text : + { + _stext = .; + *(.start .start.*) + *(.text) *(.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 EXCLUDE_FILE(*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o) .ctors)) + _einit = ABSOLUTE(.); + } :text + + . = ALIGN(4096); + + .vector : + { + _vector_start = .; + KEEP(*(.exc_vector_table)) + KEEP(*(".exc_vector_table.*")) + KEEP(*(.vectors)) + _vector_end = .; + } :text + + . = ALIGN(4096); + _etext = .; + _sztext = _etext - _stext; + + . = ALIGN(4096); + .rodata : + { + _srodata = .; + *(.rodata) + *(.rodata.*) + *(.data.rel.ro) + *(.data.rel.ro.*) + } :text + . = ALIGN(4096); + _erodata = .; + _szrodata = _erodata - _srodata; + _eronly = .; + + . = ALIGN(4096); + .data : + { + _sdata = .; + *(.data.page_aligned) + *(.data) *(.data.*) + . = ALIGN(8); + *(.data.rel) *(.data.rel.*) + CONSTRUCTORS + } :text + _edata = .; + + .bss : + { + . = ALIGN(8); + _sbss = .; + *(.bss) *(.bss.*) *(COMMON) + . = ALIGN(8); + } :text + . = ALIGN(4096); + _ebss = .; + _szbss = _ebss - _sbss; + + .initstack : + { + _s_initstack = .; + *(.initstack) + . = ALIGN(16); + } :text + . = ALIGN(4096); + _e_initstack = .; + g_idle_topstack = .; + _szdata = _e_initstack - _sdata; + + /DISCARD/ : + { + *(.exit.text) *(.exit.data) *(.exitcall.exit) *(.eh_frame) + } + + .stab 0 : { *(.stab) } + .stabstr 0 : { *(.stabstr) } + .comment 0 : { *(.comment) } +} diff --git a/boards/arm64/rk3588/orangepi-5-pro/src/CMakeLists.txt b/boards/arm64/rk3588/orangepi-5-pro/src/CMakeLists.txt new file mode 100644 index 00000000000..96efe9b427b --- /dev/null +++ b/boards/arm64/rk3588/orangepi-5-pro/src/CMakeLists.txt @@ -0,0 +1,33 @@ +# ############################################################################## +# boards/arm64/rk3588/orangepi-5-pro/src/CMakeLists.txt +# +# SPDX-License-Identifier: Apache-2.0 +# +# 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. +# +# ############################################################################## + +set(SRCS orangepi5pro_boardinit.c orangepi5pro_bringup.c) + +if(CONFIG_BOARDCTL) + if(CONFIG_BOARDCTL_RESET) + list(APPEND SRCS orangepi5pro_reset.c) + endif() +endif() + +target_sources(board PRIVATE ${SRCS}) + +set_property(GLOBAL PROPERTY LD_SCRIPT "${NUTTX_BOARD_DIR}/scripts/dramboot.ld") diff --git a/boards/arm64/rk3588/orangepi-5-pro/src/Makefile b/boards/arm64/rk3588/orangepi-5-pro/src/Makefile new file mode 100644 index 00000000000..07db4e2220e --- /dev/null +++ b/boards/arm64/rk3588/orangepi-5-pro/src/Makefile @@ -0,0 +1,31 @@ +############################################################################ +# boards/arm64/rk3588/orangepi-5-pro/src/Makefile +# +# SPDX-License-Identifier: Apache-2.0 +# +# 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 = orangepi5pro_boardinit.c orangepi5pro_bringup.c + +ifeq ($(CONFIG_BOARDCTL_RESET),y) +CSRCS += orangepi5pro_reset.c +endif + +include $(TOPDIR)/boards/Board.mk diff --git a/boards/arm64/rk3588/orangepi-5-pro/src/orangepi5pro.h b/boards/arm64/rk3588/orangepi-5-pro/src/orangepi5pro.h new file mode 100644 index 00000000000..dd68535dde7 --- /dev/null +++ b/boards/arm64/rk3588/orangepi-5-pro/src/orangepi5pro.h @@ -0,0 +1,38 @@ +/**************************************************************************** + * boards/arm64/rk3588/orangepi-5-pro/src/orangepi5pro.h + * + * SPDX-License-Identifier: Apache-2.0 + * + * 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_RK3588_ORANGEPI_5_PRO_SRC_ORANGEPI5PRO_H +#define __BOARDS_ARM64_RK3588_ORANGEPI_5_PRO_SRC_ORANGEPI5PRO_H + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include <nuttx/config.h> + +/**************************************************************************** + * Public Function Prototypes + ****************************************************************************/ + +int orangepi5pro_bringup(void); + +#endif /* __BOARDS_ARM64_RK3588_ORANGEPI_5_PRO_SRC_ORANGEPI5PRO_H */ diff --git a/boards/arm64/rk3588/orangepi-5-pro/src/orangepi5pro_boardinit.c b/boards/arm64/rk3588/orangepi-5-pro/src/orangepi5pro_boardinit.c new file mode 100644 index 00000000000..652d2c3e028 --- /dev/null +++ b/boards/arm64/rk3588/orangepi-5-pro/src/orangepi5pro_boardinit.c @@ -0,0 +1,54 @@ +/**************************************************************************** + * boards/arm64/rk3588/orangepi-5-pro/src/orangepi5pro_boardinit.c + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include <nuttx/config.h> + +#include <nuttx/board.h> + +#include "orangepi5pro.h" + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +void rk3588_memory_initialize(void) +{ + /* DRAM is trained and initialised by the boot firmware before NuttX + * receives control on the Orange Pi 5 Pro. + */ +} + +void rk3588_board_initialize(void) +{ + /* No early board initialization is needed for this configuration. */ +} + +#ifdef CONFIG_BOARD_LATE_INITIALIZE +void board_late_initialize(void) +{ + orangepi5pro_bringup(); +} +#endif diff --git a/boards/arm64/rk3588/orangepi-5-pro/src/orangepi5pro_bringup.c b/boards/arm64/rk3588/orangepi-5-pro/src/orangepi5pro_bringup.c new file mode 100644 index 00000000000..37f6003370a --- /dev/null +++ b/boards/arm64/rk3588/orangepi-5-pro/src/orangepi5pro_bringup.c @@ -0,0 +1,53 @@ +/**************************************************************************** + * boards/arm64/rk3588/orangepi-5-pro/src/orangepi5pro_bringup.c + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include <nuttx/config.h> + +#include <sys/types.h> +#include <syslog.h> + +#ifdef CONFIG_FS_PROCFS +# include <nuttx/fs/fs.h> +#endif + +#include "orangepi5pro.h" + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +int orangepi5pro_bringup(void) +{ +#ifdef CONFIG_FS_PROCFS + int 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 + + return 0; +} diff --git a/boards/arm64/rk3588/orangepi-5-pro/src/orangepi5pro_reset.c b/boards/arm64/rk3588/orangepi-5-pro/src/orangepi5pro_reset.c new file mode 100644 index 00000000000..ea6db90999b --- /dev/null +++ b/boards/arm64/rk3588/orangepi-5-pro/src/orangepi5pro_reset.c @@ -0,0 +1,45 @@ +/**************************************************************************** + * boards/arm64/rk3588/orangepi-5-pro/src/orangepi5pro_reset.c + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include <nuttx/config.h> + +#include <nuttx/arch.h> + +#ifdef CONFIG_BOARDCTL_RESET + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +int board_reset(int status) +{ + (void)status; + + up_systemreset(); + return 0; +} + +#endif /* CONFIG_BOARDCTL_RESET */
