-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This adds support for qemu-armv7r board with flat mode sample config for using with QEMU emulated Cortex-R5 processor. Signed-off-by: Yanfeng Liu <[email protected]>
- Loading branch information
Showing
13 changed files
with
809 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# ############################################################################## | ||
# boards/arm/qemu/qemu-armv7r/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_property(GLOBAL PROPERTY LD_SCRIPT "${NUTTX_BOARD_DIR}/scripts/dramboot.ld") | ||
|
||
add_subdirectory(src) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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_QEMU_ARMV7R | ||
endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
# | ||
# 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_ALARM_ARCH=y | ||
CONFIG_ARCH="arm" | ||
CONFIG_ARCH_BOARD="qemu-armv7r" | ||
CONFIG_ARCH_BOARD_QEMU_ARMV7R=y | ||
CONFIG_ARCH_CHIP="qemu" | ||
CONFIG_ARCH_CHIP_QEMU_ARM=y | ||
CONFIG_ARCH_CHIP_QEMU_CORTEXR5=y | ||
CONFIG_ARCH_INTERRUPTSTACK=2048 | ||
CONFIG_ARCH_LOWVECTORS=y | ||
CONFIG_BOARDCTL_POWEROFF=y | ||
CONFIG_BUILTIN=y | ||
CONFIG_DEBUG_ASSERTIONS=y | ||
CONFIG_DEBUG_FEATURES=y | ||
CONFIG_DEBUG_FULLOPT=y | ||
CONFIG_DEBUG_SYMBOLS=y | ||
CONFIG_DEFAULT_TASK_STACKSIZE=4096 | ||
CONFIG_EXAMPLES_HELLO=y | ||
CONFIG_FLASH_SIZE=1048576 | ||
CONFIG_FS_PROCFS=y | ||
CONFIG_FS_ROMFS=y | ||
CONFIG_HAVE_CXX=y | ||
CONFIG_HAVE_CXXINITIALIZE=y | ||
CONFIG_IDLETHREAD_STACKSIZE=4096 | ||
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_ONESHOT=y | ||
CONFIG_PREALLOC_TIMERS=4 | ||
CONFIG_RAM_SIZE=16777216 | ||
CONFIG_RAM_START=0x40000000 | ||
CONFIG_RAW_BINARY=y | ||
CONFIG_READLINE_CMD_HISTORY=y | ||
CONFIG_RR_INTERVAL=200 | ||
CONFIG_SCHED_HAVE_PARENT=y | ||
CONFIG_SCHED_HPWORK=y | ||
CONFIG_SCHED_HPWORKPRIORITY=192 | ||
CONFIG_STACK_COLORATION=y | ||
CONFIG_START_DAY=25 | ||
CONFIG_START_YEAR=2025 | ||
CONFIG_SYMTAB_ORDEREDBYNAME=y | ||
CONFIG_SYSTEM_NSH=y | ||
CONFIG_SYSTEM_SYSTEM=y | ||
CONFIG_TESTING_GETPRIME=y | ||
CONFIG_TESTING_LEAKS=y | ||
CONFIG_TESTING_OSTEST=y | ||
CONFIG_UART1_BASE=0x9000000 | ||
CONFIG_UART1_IRQ=33 | ||
CONFIG_UART1_PL011=y | ||
CONFIG_UART1_SERIAL_CONSOLE=y | ||
CONFIG_UART_PL011=y | ||
CONFIG_USEC_PER_TICK=1000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
/**************************************************************************** | ||
* boards/arm/qemu/qemu-armv7r/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_ARM_QEMU_QEMU_ARMV7R_INCLUDE_BOARD_H | ||
#define __BOARDS_ARM_QEMU_QEMU_ARMV7R_INCLUDE_BOARD_H | ||
|
||
/**************************************************************************** | ||
* Included Files | ||
****************************************************************************/ | ||
|
||
#include <nuttx/config.h> | ||
|
||
/**************************************************************************** | ||
* 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_QEMU_QEMU_ARMV7R_INCLUDE_BOARD_H */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
############################################################################ | ||
# boards/arm/qemu/qemu-armv7r/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/arm/src/armv7-r/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,138 @@ | ||
/**************************************************************************** | ||
* boards/arm/qemu/qemu-armv7a/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. | ||
* | ||
****************************************************************************/ | ||
|
||
#include <nuttx/config.h> | ||
|
||
OUTPUT_ARCH(arm) | ||
ENTRY(__start) | ||
|
||
MEMORY | ||
{ | ||
ROM (rx) : ORIGIN = CONFIG_FLASH_START, LENGTH = CONFIG_FLASH_SIZE | ||
RAM (rwx): ORIGIN = CONFIG_RAM_START, LENGTH = CONFIG_RAM_SIZE | ||
} | ||
|
||
SECTIONS | ||
{ | ||
|
||
/* where the global variable out-of-bounds detection information located */ | ||
|
||
#ifdef CONFIG_MM_KASAN_GLOBAL | ||
.kasan.unused : { | ||
*(.data..LASANLOC*) | ||
} | ||
.kasan.global : { | ||
KEEP (*(.data..LASAN0)) | ||
KEEP (*(.data.rel.local..LASAN0)) | ||
} | ||
.kasan.shadows : { | ||
*(.kasan.shadows) | ||
} | ||
#endif | ||
|
||
.text : { | ||
_stext = .; /* Text section */ | ||
__text_start = .; | ||
*(.vectors) | ||
*(.text*) | ||
*(.fixup) | ||
*(.gnu.warning) | ||
} > ROM | ||
|
||
. = 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(.); | ||
. = ALIGN(4096); | ||
_etext = .; /* End_1 of .text */ | ||
_sztext = _etext - _stext; | ||
} > ROM | ||
|
||
.ARM.extab : | ||
{ | ||
*(.ARM.extab*) | ||
} > ROM | ||
|
||
/* .ARM.exidx is sorted, so has to go in its own output section. */ | ||
|
||
PROVIDE_HIDDEN (__exidx_start = .); | ||
.ARM.exidx : | ||
{ | ||
*(.ARM.exidx* .gnu.linkonce.armexidx.*) | ||
} > ROM | ||
PROVIDE_HIDDEN (__exidx_end = .); | ||
|
||
.rodata : { | ||
_srodata = .; /* Read-only data */ | ||
*(.rodata*) | ||
*(.data.rel.ro*) | ||
KEEP(*(SORT(.scattered_array*))); | ||
. = ALIGN(4096); | ||
_erodata = .; | ||
} > ROM | ||
|
||
_eronly = LOADADDR(.data); | ||
.data : { /* Data */ | ||
_sdata = .; | ||
*(.data*) | ||
. = ALIGN(8); | ||
__start_impls = .; | ||
*(.impls) | ||
KEEP(*(.impls)) | ||
. = ALIGN(4); | ||
__stop_impls = .; | ||
_edata = .; | ||
} > RAM AT > ROM | ||
|
||
.noinit : { | ||
_snoinit = ABSOLUTE(.); | ||
*(.noinit*) | ||
_enoinit = ABSOLUTE(.); | ||
} > RAM | ||
|
||
.bss : { /* BSS */ | ||
_sbss = .; | ||
*(.bss*) | ||
. = ALIGN(4096); | ||
_ebss = .; | ||
} > RAM | ||
|
||
/* Sections to be discarded */ | ||
/DISCARD/ : { | ||
*(.exit.text) | ||
*(.exit.data) | ||
*(.exitcall.exit) | ||
} | ||
|
||
/* 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) } | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# ############################################################################## | ||
# boards/arm/qemu/qemu-armv7r/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 qemu_boardinit.c qemu_bringup.c) | ||
|
||
if(CONFIG_BOARDCTL) | ||
list(APPEND SRCS qemu_appinit.c) | ||
endif() | ||
|
||
if(CONFIG_LIBC_FDT) | ||
target_include_directories(board | ||
PRIVATE ${NUTTX_DIR}/libs/libc/fdt/dtc/libfdt) | ||
endif() | ||
|
||
target_sources(board PRIVATE ${SRCS}) |
Oops, something went wrong.