diff --git a/boards/arm/nrf53/nrf5340-dk/configs/rptun_cpuapp/defconfig b/boards/arm/nrf53/nrf5340-dk/configs/rptun_cpuapp/defconfig new file mode 100644 index 0000000000..027a2bb699 --- /dev/null +++ b/boards/arm/nrf53/nrf5340-dk/configs/rptun_cpuapp/defconfig @@ -0,0 +1,46 @@ +# +# 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_NSH_DISABLE_IFCONFIG is not set +# CONFIG_NSH_DISABLE_PS is not set +# CONFIG_STANDARD_SERIAL is not set +CONFIG_ARCH="arm" +CONFIG_ARCH_BOARD="nrf5340-dk" +CONFIG_ARCH_BOARD_NRF5340_DK=y +CONFIG_ARCH_CHIP="nrf53" +CONFIG_ARCH_CHIP_NRF5340=y +CONFIG_ARCH_CHIP_NRF5340_CPUAPP=y +CONFIG_ARCH_CHIP_NRF53=y +CONFIG_ARCH_STACKDUMP=y +CONFIG_ARCH_STDARG_H=y +CONFIG_BOARD_LOOPSPERMSEC=5500 +CONFIG_DEV_SIMPLE_ADDRENV=y +CONFIG_EXPERIMENTAL=y +CONFIG_INIT_ENTRYPOINT="nsh_main" +CONFIG_INTELHEX_BINARY=y +CONFIG_MM_REGIONS=2 +CONFIG_NRF53_UART0=y +CONFIG_NSH_ARCHINIT=y +CONFIG_NSH_FILEIOSIZE=512 +CONFIG_NSH_LINELEN=64 +CONFIG_NSH_READLINE=y +CONFIG_OPENAMP=y +CONFIG_PREALLOC_TIMERS=4 +CONFIG_RAM_SIZE=524288 +CONFIG_RAM_START=0x20000000 +CONFIG_RAW_BINARY=y +CONFIG_RPTUN=y +CONFIG_RPTUN_LOCAL_CPUNAME="cpuapp" +CONFIG_RPTUN_PING=y +CONFIG_RR_INTERVAL=200 +CONFIG_SCHED_WAITPID=y +CONFIG_START_DAY=26 +CONFIG_START_MONTH=3 +CONFIG_SYMTAB_ORDEREDBYNAME=y +CONFIG_SYSTEM_NSH=y +CONFIG_TASK_NAME_SIZE=0 +CONFIG_UART0_SERIAL_CONSOLE=y diff --git a/boards/arm/nrf53/nrf5340-dk/configs/rptun_cpunet/defconfig b/boards/arm/nrf53/nrf5340-dk/configs/rptun_cpunet/defconfig new file mode 100644 index 0000000000..df5404ae67 --- /dev/null +++ b/boards/arm/nrf53/nrf5340-dk/configs/rptun_cpunet/defconfig @@ -0,0 +1,47 @@ +# +# 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_NSH_DISABLE_IFCONFIG is not set +# CONFIG_NSH_DISABLE_PS is not set +# CONFIG_STANDARD_SERIAL is not set +CONFIG_ARCH="arm" +CONFIG_ARCH_BOARD="nrf5340-dk" +CONFIG_ARCH_BOARD_NRF5340_DK=y +CONFIG_ARCH_CHIP="nrf53" +CONFIG_ARCH_CHIP_NRF5340=y +CONFIG_ARCH_CHIP_NRF5340_CPUNET=y +CONFIG_ARCH_CHIP_NRF53=y +CONFIG_ARCH_STACKDUMP=y +CONFIG_ARCH_STDARG_H=y +CONFIG_BOARD_LOOPSPERMSEC=5500 +CONFIG_DEV_SIMPLE_ADDRENV=y +CONFIG_EXPERIMENTAL=y +CONFIG_INIT_ENTRYPOINT="nsh_main" +CONFIG_INTELHEX_BINARY=y +CONFIG_MM_REGIONS=2 +CONFIG_NRF53_UART0=y +CONFIG_NSH_ARCHINIT=y +CONFIG_NSH_FILEIOSIZE=512 +CONFIG_NSH_LINELEN=64 +CONFIG_NSH_READLINE=y +CONFIG_OPENAMP=y +CONFIG_PREALLOC_TIMERS=4 +CONFIG_RAM_SIZE=65535 +CONFIG_RAM_START=0x21000000 +CONFIG_RAW_BINARY=y +CONFIG_RPTUN=y +CONFIG_RPTUN_LOCAL_CPUNAME="cpunet" +CONFIG_RPTUN_PING=y +CONFIG_RPTUN_STACKSIZE=2048 +CONFIG_RR_INTERVAL=200 +CONFIG_SCHED_WAITPID=y +CONFIG_START_DAY=26 +CONFIG_START_MONTH=3 +CONFIG_SYMTAB_ORDEREDBYNAME=y +CONFIG_SYSTEM_NSH=y +CONFIG_TASK_NAME_SIZE=0 +CONFIG_UART0_SERIAL_CONSOLE=y diff --git a/boards/arm/nrf53/nrf5340-dk/scripts/Make.defs b/boards/arm/nrf53/nrf5340-dk/scripts/Make.defs index 549f0eed24..25088516b9 100644 --- a/boards/arm/nrf53/nrf5340-dk/scripts/Make.defs +++ b/boards/arm/nrf53/nrf5340-dk/scripts/Make.defs @@ -23,11 +23,19 @@ include $(TOPDIR)/tools/Config.mk include $(TOPDIR)/arch/arm/src/armv8-m/Toolchain.defs ifeq ($(CONFIG_ARCH_CHIP_NRF5340_CPUAPP),y) -LDSCRIPT = flash_config_app.ld +ifeq ($(CONFIG_RPTUN),y) +LDSCRIPT = flash_rptun_app.ld +else +LDSCRIPT = flash_app.ld +endif endif ifeq ($(CONFIG_ARCH_CHIP_NRF5340_CPUNET),y) -LDSCRIPT = flash_config_net.ld +ifeq ($(CONFIG_RPTUN),y) +LDSCRIPT = flash_rptun_net.ld +else +LDSCRIPT = flash_net.ld +endif endif ARCHSCRIPT += $(BOARD_DIR)$(DELIM)scripts$(DELIM)$(LDSCRIPT) diff --git a/boards/arm/nrf53/nrf5340-dk/scripts/flash_config_app.ld b/boards/arm/nrf53/nrf5340-dk/scripts/flash_app.ld similarity index 98% rename from boards/arm/nrf53/nrf5340-dk/scripts/flash_config_app.ld rename to boards/arm/nrf53/nrf5340-dk/scripts/flash_app.ld index 9a99768679..4b60e8c816 100644 --- a/boards/arm/nrf53/nrf5340-dk/scripts/flash_config_app.ld +++ b/boards/arm/nrf53/nrf5340-dk/scripts/flash_app.ld @@ -1,5 +1,5 @@ /**************************************************************************** -* boards/arm/nrf53/nrf5340-dk/scripts/flash_config_net.ld + * boards/arm/nrf53/nrf5340-dk/scripts/flash_app.ld * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with diff --git a/boards/arm/nrf53/nrf5340-dk/scripts/flash_config_net.ld b/boards/arm/nrf53/nrf5340-dk/scripts/flash_net.ld similarity index 98% rename from boards/arm/nrf53/nrf5340-dk/scripts/flash_config_net.ld rename to boards/arm/nrf53/nrf5340-dk/scripts/flash_net.ld index 7465f7bb7b..e040fa14a6 100644 --- a/boards/arm/nrf53/nrf5340-dk/scripts/flash_config_net.ld +++ b/boards/arm/nrf53/nrf5340-dk/scripts/flash_net.ld @@ -1,5 +1,5 @@ /**************************************************************************** -* boards/arm/nrf53/nrf5340-dk/scripts/flash_config_net.ld + * boards/arm/nrf53/nrf5340-dk/scripts/flash_net.ld * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with diff --git a/boards/arm/nrf53/nrf5340-dk/scripts/flash_rptun_app.ld b/boards/arm/nrf53/nrf5340-dk/scripts/flash_rptun_app.ld new file mode 100644 index 0000000000..c47e11993c --- /dev/null +++ b/boards/arm/nrf53/nrf5340-dk/scripts/flash_rptun_app.ld @@ -0,0 +1,114 @@ +/**************************************************************************** + * boards/arm/nrf53/nrf5340-dk/scripts/flash_rptun_app.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. + * + ****************************************************************************/ + +MEMORY +{ + progmem (rx) : ORIGIN = 0x00000000, LENGTH = 1024K + datamem (rwx) : ORIGIN = 0x20000000, LENGTH = 512K-32K + shared (rwx) : ORIGIN = 0x20078000, LENGTH = 32K +} + +OUTPUT_ARCH(arm) +ENTRY(__start) /* Treat __start as the anchor for dead code stripping */ +EXTERN(_vectors) /* Force the vectors to be included in the output */ +SECTIONS +{ + .text : + { + _stext = ABSOLUTE(.); + *(.vectors) + *(.text .text.*) + *(.fixup) + *(.gnu.warning) + *(.rodata .rodata.*) + *(.gnu.linkonce.t.*) + *(.glue_7) + *(.glue_7t) + *(.got) + *(.gcc_except_table) + *(.gnu.linkonce.r.*) + _etext = ABSOLUTE(.); + } > progmem + + .init_section : + { + _sinit = ABSOLUTE(.); + *(.init_array .init_array.*) + _einit = ABSOLUTE(.); + } > progmem + + .ARM.extab : + { + *(.ARM.extab*) + } > progmem + + __exidx_start = ABSOLUTE(.); + .ARM.exidx : + { + *(.ARM.exidx*) + } > progmem + __exidx_end = ABSOLUTE(.); + + _eronly = ABSOLUTE(.); + + .data : + { + _sdata = ABSOLUTE(.); + *(.data .data.*) + *(.gnu.linkonce.d.*) + CONSTRUCTORS + . = ALIGN(4); + _edata = ABSOLUTE(.); + } > datamem AT > progmem + + /* BSS */ + + .bss : + { + _sbss = ABSOLUTE(.); + *(.bss .bss.*) + *(.gnu.linkonce.b.*) + *(COMMON) + . = ALIGN(4); + _ebss = ABSOLUTE(.); + } > datamem + + /* Shared memory */ + + .shmem : + { + *(.shmem) + } > shared + + /* 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) } + .debug_abbrev 0 : { *(.debug_abbrev) } + .debug_info 0 : { *(.debug_info) } + .debug_line 0 : { *(.debug_line) } + .debug_pubnames 0 : { *(.debug_pubnames) } + .debug_aranges 0 : { *(.debug_aranges) } +} diff --git a/boards/arm/nrf53/nrf5340-dk/scripts/flash_rptun_net.ld b/boards/arm/nrf53/nrf5340-dk/scripts/flash_rptun_net.ld new file mode 100644 index 0000000000..1bb1d734e9 --- /dev/null +++ b/boards/arm/nrf53/nrf5340-dk/scripts/flash_rptun_net.ld @@ -0,0 +1,109 @@ +/**************************************************************************** + * boards/arm/nrf53/nrf5340-dk/scripts/flash_rptun_net.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. + * + ****************************************************************************/ + +MEMORY +{ + app_progmem (rx) : ORIGIN = 0x00000000, LENGTH = 1024K + app_datamem (rwx) : ORIGIN = 0x20000000, LENGTH = 512K-32K + shared (rwx) : ORIGIN = 0x20078000, LENGTH = 32K + progmem (rx) : ORIGIN = 0x01000000, LENGTH = 256K + datamem (rwx) : ORIGIN = 0x21000000, LENGTH = 64K +} + +OUTPUT_ARCH(arm) +ENTRY(__start) /* Treat __start as the anchor for dead code stripping */ +EXTERN(_vectors) /* Force the vectors to be included in the output */ +SECTIONS +{ + .text : + { + _stext = ABSOLUTE(.); + *(.vectors) + *(.text .text.*) + *(.fixup) + *(.gnu.warning) + *(.rodata .rodata.*) + *(.gnu.linkonce.t.*) + *(.glue_7) + *(.glue_7t) + *(.got) + *(.gcc_except_table) + *(.gnu.linkonce.r.*) + _etext = ABSOLUTE(.); + } > progmem + + .init_section : + { + _sinit = ABSOLUTE(.); + *(.init_array .init_array.*) + _einit = ABSOLUTE(.); + } > progmem + + .ARM.extab : + { + *(.ARM.extab*) + } > progmem + + __exidx_start = ABSOLUTE(.); + .ARM.exidx : + { + *(.ARM.exidx*) + } > progmem + __exidx_end = ABSOLUTE(.); + + _eronly = ABSOLUTE(.); + + .data : + { + _sdata = ABSOLUTE(.); + *(.data .data.*) + *(.gnu.linkonce.d.*) + CONSTRUCTORS + . = ALIGN(4); + _edata = ABSOLUTE(.); + } > datamem AT > progmem + + /* BSS */ + + .bss : + { + _sbss = ABSOLUTE(.); + *(.bss .bss.*) + *(.gnu.linkonce.b.*) + *(COMMON) + . = ALIGN(4); + _ebss = ABSOLUTE(.); + } > datamem + + /* 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) } + .debug_abbrev 0 : { *(.debug_abbrev) } + .debug_info 0 : { *(.debug_info) } + .debug_line 0 : { *(.debug_line) } + .debug_pubnames 0 : { *(.debug_pubnames) } + .debug_aranges 0 : { *(.debug_aranges) } +} diff --git a/boards/arm/nrf53/nrf5340-dk/src/nrf53_bringup.c b/boards/arm/nrf53/nrf5340-dk/src/nrf53_bringup.c index 4dcf6c0142..a7db7f5cf3 100644 --- a/boards/arm/nrf53/nrf5340-dk/src/nrf53_bringup.c +++ b/boards/arm/nrf53/nrf5340-dk/src/nrf53_bringup.c @@ -35,6 +35,10 @@ # include "nrf53_sdc.h" #endif +#ifdef CONFIG_RPTUN +# include "nrf53_rptun.h" +#endif + /**************************************************************************** * Public Functions ****************************************************************************/ @@ -67,6 +71,14 @@ int nrf53_bringup(void) } #endif +#ifdef CONFIG_RPTUN +#ifdef CONFIG_NRF53_APPCORE + nrf53_rptun_init("nrf53-shmem", "appcore"); +#else + nrf53_rptun_init("nrf53-shmem", "netcore"); +#endif +#endif + #ifdef CONFIG_NRF53_SOFTDEVICE_CONTROLLER ret = nrf53_sdc_initialize();