arch: common: dedicated SEMIHOST symbol

Control the usage of semihosting with a dedicated symbol, instead of
implying semihosting from the usage of `SEMIHOST_CONSOLE`. This allows
semihosting to be used without the semihost console.

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
This commit is contained in:
Jordan Yates 2022-03-30 17:51:54 +10:00 committed by Carles Cufí
commit 070422db46
5 changed files with 23 additions and 10 deletions

View file

@ -148,6 +148,8 @@ config ARCH_IS_SET
menu "General Architecture Options"
source "$(ARCH_DIR)/common/Kconfig"
module = ARCH
module-str = arch
source "subsys/logging/Kconfig.template.log_config"

17
arch/common/Kconfig Normal file
View file

@ -0,0 +1,17 @@
# Common architecture configuration options
# Copyright (c) 2022, CSIRO.
# SPDX-License-Identifier: Apache-2.0
config SEMIHOST
bool "Semihosting support for ARM and RISC-V targets"
depends on ARM || ARM64 || RISCV
help
Semihosting is a mechanism that enables code running on an ARM or
RISC-V target to communicate and use the Input/Output facilities on
a host computer that is running a debugger.
Additional information can be found in:
https://developer.arm.com/documentation/dui0471/m/what-is-semihosting-
https://github.com/riscv/riscv-semihosting-spec/blob/main/riscv-semihosting-spec.adoc
This option is compatible with hardware and with QEMU, through the
(automatic) use of the -semihosting-config switch when invoking it.

View file

@ -70,7 +70,7 @@ endif()
list(APPEND QEMU_FLAGS -serial chardev:con)
# Connect semihosting console to the console chardev if configured.
if(CONFIG_SEMIHOST_CONSOLE)
if(CONFIG_SEMIHOST)
list(APPEND QEMU_FLAGS
-semihosting-config enable=on,target=auto,chardev=con
)

View file

@ -298,17 +298,10 @@ config NATIVE_POSIX_CONSOLE_INIT_PRIORITY
config SEMIHOST_CONSOLE
bool "Use semihosting for console"
select CONSOLE_HAS_DRIVER
depends on CPU_CORTEX_M || ARM64 || RISCV
depends on SEMIHOST
help
Enable this option to use semihosting for console.
Semihosting is a mechanism that enables code running on an ARM or
RISC-V target to communicate and use the Input/Output facilities
on a host computer that is running a debugger.
Additional information can be found in:
https://developer.arm.com/docs/dui0471/k/what-is-semihosting/what-is-semihosting
https://github.com/riscv/riscv-semihosting-spec/blob/main/riscv-semihosting-spec.adoc
This option is compatible with hardware and with QEMU, through the
(automatic) use of the -semihosting-config switch when invoking it.
See SEMIHOST for a more complete description of semihosting.
module = UART_CONSOLE
module-str = UART console

View file

@ -2,4 +2,5 @@ CONFIG_TEST=y
CONFIG_CONSOLE=y
CONFIG_SERIAL=n
CONFIG_UART_CONSOLE=n
CONFIG_SEMIHOST=y
CONFIG_SEMIHOST_CONSOLE=y