arch: riscv: introduce CONFIG_RISCV_GP_PURPOSE choice

Introduce `CONFIG_RISCV_GP_PURPOSE` choice to make sure that only
one of `CONFIG_RISCV_GP` or `CONFIG_RISCV_CURRENT_VIA_GP` can be
enabled, instead of relying of dependencies.

To do that, introduce a new
`CONFIG_RISCV_SOC_HAS_GP_RELATIVE_ADDRESSING` that can be selected
by SoC when it implemented global pointer (GP) initialization for
relative addressing in its linker.

`CONFIG_RISCV_GP` will be the default choice when
`CONFIG_RISCV_SOC_HAS_GP_RELATIVE_ADDRESSING=y`

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
This commit is contained in:
Yong Cong Sin 2024-11-25 12:54:01 +08:00 committed by Benjamin Cabé
commit e6dd68ec89
37 changed files with 33 additions and 56 deletions

View file

@ -13,6 +13,7 @@ config SOC_SERIES_GD32VF103
select RISCV_ISA_EXT_ZICSR
select RISCV_ISA_EXT_ZIFENCEI
select RISCV_HAS_CLIC
select RISCV_SOC_HAS_GP_RELATIVE_ADDRESSING
select ATOMIC_OPERATIONS_C
select INCLUDE_RESET_VECTOR
select GD32_HAS_AFIO_PINMUX

View file

@ -17,9 +17,6 @@ config RISCV_MCAUSE_EXCEPTION_MASK
config RISCV_SOC_INTERRUPT_INIT
default y
config RISCV_GP
default y
config NUM_IRQS
default 87 if NUCLEI_ECLIC
default 16 if !NUCLEI_ECLIC