From c579770e1db23e10f5156cecb77cd15b2d3af76e Mon Sep 17 00:00:00 2001 From: Jamie McCrae Date: Fri, 16 Feb 2024 09:06:30 +0000 Subject: [PATCH] soc: telink_tlsr: Port to HWMv2 Ports the SoC configuration to hardware model version 2 Signed-off-by: Jamie McCrae --- .../riscv/telink_tlsr/Kconfig.defconfig | 4 ---- soc/soc_legacy/riscv/telink_tlsr/Kconfig.soc | 4 ---- .../riscv/telink_tlsr/tlsr951x/Kconfig.soc | 23 ------------------- .../tlsr}/CMakeLists.txt | 0 .../tlsr/Kconfig} | 7 ++++-- .../Kconfig => telink/tlsr/Kconfig.defconfig} | 9 +------- soc/telink/tlsr/Kconfig.soc | 10 ++++++++ soc/telink/tlsr/soc.yml | 6 +++++ .../tlsr}/tlsr951x/CMakeLists.txt | 2 ++ .../tlsr/tlsr951x/Kconfig} | 20 ++++++++++++---- .../tlsr/tlsr951x/Kconfig.defconfig} | 10 ++------ soc/telink/tlsr/tlsr951x/Kconfig.soc | 20 ++++++++++++++++ .../tlsr}/tlsr951x/init.ld | 0 .../tlsr}/tlsr951x/linker.ld | 0 .../tlsr}/tlsr951x/pinctrl_soc.h | 0 .../tlsr}/tlsr951x/soc.c | 0 .../tlsr}/tlsr951x/soc.h | 0 .../tlsr}/tlsr951x/soc_context.h | 0 .../tlsr}/tlsr951x/soc_irq.S | 0 .../tlsr}/tlsr951x/soc_offsets.h | 0 .../tlsr}/tlsr951x/start.S | 0 21 files changed, 61 insertions(+), 54 deletions(-) delete mode 100644 soc/soc_legacy/riscv/telink_tlsr/Kconfig.defconfig delete mode 100644 soc/soc_legacy/riscv/telink_tlsr/Kconfig.soc delete mode 100644 soc/soc_legacy/riscv/telink_tlsr/tlsr951x/Kconfig.soc rename soc/{soc_legacy/riscv/telink_tlsr => telink/tlsr}/CMakeLists.txt (100%) rename soc/{soc_legacy/riscv/telink_tlsr/tlsr951x/Kconfig.defconfig.tlsr9518 => telink/tlsr/Kconfig} (51%) rename soc/{soc_legacy/riscv/telink_tlsr/Kconfig => telink/tlsr/Kconfig.defconfig} (50%) create mode 100644 soc/telink/tlsr/Kconfig.soc create mode 100644 soc/telink/tlsr/soc.yml rename soc/{soc_legacy/riscv/telink_tlsr => telink/tlsr}/tlsr951x/CMakeLists.txt (93%) rename soc/{soc_legacy/riscv/telink_tlsr/tlsr951x/Kconfig.series => telink/tlsr/tlsr951x/Kconfig} (59%) rename soc/{soc_legacy/riscv/telink_tlsr/tlsr951x/Kconfig.defconfig.series => telink/tlsr/tlsr951x/Kconfig.defconfig} (74%) create mode 100644 soc/telink/tlsr/tlsr951x/Kconfig.soc rename soc/{soc_legacy/riscv/telink_tlsr => telink/tlsr}/tlsr951x/init.ld (100%) rename soc/{soc_legacy/riscv/telink_tlsr => telink/tlsr}/tlsr951x/linker.ld (100%) rename soc/{soc_legacy/riscv/telink_tlsr => telink/tlsr}/tlsr951x/pinctrl_soc.h (100%) rename soc/{soc_legacy/riscv/telink_tlsr => telink/tlsr}/tlsr951x/soc.c (100%) rename soc/{soc_legacy/riscv/telink_tlsr => telink/tlsr}/tlsr951x/soc.h (100%) rename soc/{soc_legacy/riscv/telink_tlsr => telink/tlsr}/tlsr951x/soc_context.h (100%) rename soc/{soc_legacy/riscv/telink_tlsr => telink/tlsr}/tlsr951x/soc_irq.S (100%) rename soc/{soc_legacy/riscv/telink_tlsr => telink/tlsr}/tlsr951x/soc_offsets.h (100%) rename soc/{soc_legacy/riscv/telink_tlsr => telink/tlsr}/tlsr951x/start.S (100%) diff --git a/soc/soc_legacy/riscv/telink_tlsr/Kconfig.defconfig b/soc/soc_legacy/riscv/telink_tlsr/Kconfig.defconfig deleted file mode 100644 index 293171eb12a..00000000000 --- a/soc/soc_legacy/riscv/telink_tlsr/Kconfig.defconfig +++ /dev/null @@ -1,4 +0,0 @@ -# Copyright (c) 2024 Nordic Semiconductor ASA -# SPDX-License-Identifier: Apache-2.0 - -source "soc/soc_legacy/riscv/telink_tlsr/*/Kconfig.defconfig.series" diff --git a/soc/soc_legacy/riscv/telink_tlsr/Kconfig.soc b/soc/soc_legacy/riscv/telink_tlsr/Kconfig.soc deleted file mode 100644 index d7c176ecb98..00000000000 --- a/soc/soc_legacy/riscv/telink_tlsr/Kconfig.soc +++ /dev/null @@ -1,4 +0,0 @@ -# Copyright (c) 2024 Nordic Semiconductor ASA -# SPDX-License-Identifier: Apache-2.0 - -source "soc/soc_legacy/riscv/telink_tlsr/*/Kconfig.series" diff --git a/soc/soc_legacy/riscv/telink_tlsr/tlsr951x/Kconfig.soc b/soc/soc_legacy/riscv/telink_tlsr/tlsr951x/Kconfig.soc deleted file mode 100644 index 2abc12cc58c..00000000000 --- a/soc/soc_legacy/riscv/telink_tlsr/tlsr951x/Kconfig.soc +++ /dev/null @@ -1,23 +0,0 @@ -# Copyright (c) 2021 Telink Semiconductor -# SPDX-License-Identifier: Apache-2.0 - -if SOC_SERIES_TELINK_TLSR951X - -choice - prompt "Telink TLSR951X SoC implementation" - -config SOC_TELINK_TLSR9518 - bool "Telink TLSR9518" - -endchoice - -config TELINK_B91_HWDSP - bool "Support Hardware DSP" - select RISCV_SOC_CONTEXT_SAVE - -config TELINK_B91_PFT_ARCH - bool "Support performance throttling" - default y - select RISCV_SOC_CONTEXT_SAVE - -endif # SOC_SERIES_TELINK_TLSR951X diff --git a/soc/soc_legacy/riscv/telink_tlsr/CMakeLists.txt b/soc/telink/tlsr/CMakeLists.txt similarity index 100% rename from soc/soc_legacy/riscv/telink_tlsr/CMakeLists.txt rename to soc/telink/tlsr/CMakeLists.txt diff --git a/soc/soc_legacy/riscv/telink_tlsr/tlsr951x/Kconfig.defconfig.tlsr9518 b/soc/telink/tlsr/Kconfig similarity index 51% rename from soc/soc_legacy/riscv/telink_tlsr/tlsr951x/Kconfig.defconfig.tlsr9518 rename to soc/telink/tlsr/Kconfig index 4ffdebdaf6b..ffc4a398905 100644 --- a/soc/soc_legacy/riscv/telink_tlsr/tlsr951x/Kconfig.defconfig.tlsr9518 +++ b/soc/telink/tlsr/Kconfig @@ -1,5 +1,8 @@ # Copyright (c) 2024 Nordic Semiconductor ASA # SPDX-License-Identifier: Apache-2.0 -config SOC - default "tlsr9518" if SOC_TELINK_TLSR9518 +if SOC_FAMILY_TELINK_TLSR + +rsource "*/Kconfig" + +endif # SOC_FAMILY_TELINK_TLSR diff --git a/soc/soc_legacy/riscv/telink_tlsr/Kconfig b/soc/telink/tlsr/Kconfig.defconfig similarity index 50% rename from soc/soc_legacy/riscv/telink_tlsr/Kconfig rename to soc/telink/tlsr/Kconfig.defconfig index 68257b9983c..58492dd1ac9 100644 --- a/soc/soc_legacy/riscv/telink_tlsr/Kconfig +++ b/soc/telink/tlsr/Kconfig.defconfig @@ -1,15 +1,8 @@ # Copyright (c) 2024 Nordic Semiconductor ASA # SPDX-License-Identifier: Apache-2.0 -config SOC_FAMILY_TELINK_TLSR - bool - if SOC_FAMILY_TELINK_TLSR -config SOC_FAMILY - string - default "telink_tlsr" - -source "soc/soc_legacy/riscv/telink_tlsr/*/Kconfig.soc" +rsource "*/Kconfig.defconfig" endif # SOC_FAMILY_TELINK_TLSR diff --git a/soc/telink/tlsr/Kconfig.soc b/soc/telink/tlsr/Kconfig.soc new file mode 100644 index 00000000000..98f5cbf1b83 --- /dev/null +++ b/soc/telink/tlsr/Kconfig.soc @@ -0,0 +1,10 @@ +# Copyright (c) 2024 Nordic Semiconductor ASA +# SPDX-License-Identifier: Apache-2.0 + +config SOC_FAMILY_TELINK_TLSR + bool + +config SOC_FAMILY + default "telink_tlsr" if SOC_FAMILY_TELINK_TLSR + +rsource "*/Kconfig.soc" diff --git a/soc/telink/tlsr/soc.yml b/soc/telink/tlsr/soc.yml new file mode 100644 index 00000000000..e982d5e69dc --- /dev/null +++ b/soc/telink/tlsr/soc.yml @@ -0,0 +1,6 @@ +family: + - name: telink_tlsr + series: + - name: tlsr951x + socs: + - name: tlsr9518 diff --git a/soc/soc_legacy/riscv/telink_tlsr/tlsr951x/CMakeLists.txt b/soc/telink/tlsr/tlsr951x/CMakeLists.txt similarity index 93% rename from soc/soc_legacy/riscv/telink_tlsr/tlsr951x/CMakeLists.txt rename to soc/telink/tlsr/tlsr951x/CMakeLists.txt index 8c489ac6dd7..9e1dff40e4b 100644 --- a/soc/soc_legacy/riscv/telink_tlsr/tlsr951x/CMakeLists.txt +++ b/soc/telink/tlsr/tlsr951x/CMakeLists.txt @@ -7,6 +7,8 @@ zephyr_sources( soc.c ) +zephyr_include_directories(.) + # Force using BFD-LD zephyr_ld_options(-fuse-ld=bfd) diff --git a/soc/soc_legacy/riscv/telink_tlsr/tlsr951x/Kconfig.series b/soc/telink/tlsr/tlsr951x/Kconfig similarity index 59% rename from soc/soc_legacy/riscv/telink_tlsr/tlsr951x/Kconfig.series rename to soc/telink/tlsr/tlsr951x/Kconfig index 5d5fc3226e5..80fa44e6658 100644 --- a/soc/soc_legacy/riscv/telink_tlsr/tlsr951x/Kconfig.series +++ b/soc/telink/tlsr/tlsr951x/Kconfig @@ -1,8 +1,8 @@ # Copyright (c) 2021 Telink Semiconductor # SPDX-License-Identifier: Apache-2.0 -config SOC_SERIES_TELINK_TLSR951X - bool "Telink TLSR951X" +config SOC_SERIES_TLSR951X + bool select RISCV select RISCV_ISA_RV32I select RISCV_ISA_EXT_M @@ -16,6 +16,16 @@ config SOC_SERIES_TELINK_TLSR951X select ATOMIC_OPERATIONS_BUILTIN select CPU_HAS_FPU select INCLUDE_RESET_VECTOR - select SOC_FAMILY_TELINK_TLSR - help - Enable support for Telink TLSR951X + +if SOC_SERIES_TLSR951X + +config TELINK_B91_HWDSP + bool "Support Hardware DSP" + select RISCV_SOC_CONTEXT_SAVE + +config TELINK_B91_PFT_ARCH + bool "Support performance throttling" + default y + select RISCV_SOC_CONTEXT_SAVE + +endif # SOC_SERIES_TLSR951X diff --git a/soc/soc_legacy/riscv/telink_tlsr/tlsr951x/Kconfig.defconfig.series b/soc/telink/tlsr/tlsr951x/Kconfig.defconfig similarity index 74% rename from soc/soc_legacy/riscv/telink_tlsr/tlsr951x/Kconfig.defconfig.series rename to soc/telink/tlsr/tlsr951x/Kconfig.defconfig index a4f500fcc87..7ad94f13430 100644 --- a/soc/soc_legacy/riscv/telink_tlsr/tlsr951x/Kconfig.defconfig.series +++ b/soc/telink/tlsr/tlsr951x/Kconfig.defconfig @@ -1,11 +1,7 @@ # Copyright (c) 2021 Telink Semiconductor # SPDX-License-Identifier: Apache-2.0 -if SOC_SERIES_TELINK_TLSR951X - -config SOC_SERIES - string - default "tlsr951x" +if SOC_SERIES_TLSR951X config SYS_CLOCK_HW_CYCLES_PER_SEC int @@ -48,6 +44,4 @@ config 2ND_LVL_INTR_00_OFFSET config HAS_FLASH_LOAD_OFFSET default y if BOOTLOADER_MCUBOOT -source "soc/soc_legacy/riscv/telink_tlsr/tlsr951x/Kconfig.defconfig.tlsr*" - -endif # SOC_SERIES_TELINK_TLSR951X +endif # SOC_SERIES_TLSR951X diff --git a/soc/telink/tlsr/tlsr951x/Kconfig.soc b/soc/telink/tlsr/tlsr951x/Kconfig.soc new file mode 100644 index 00000000000..102ef4390a6 --- /dev/null +++ b/soc/telink/tlsr/tlsr951x/Kconfig.soc @@ -0,0 +1,20 @@ +# Copyright (c) 2021 Telink Semiconductor +# SPDX-License-Identifier: Apache-2.0 + +config SOC_SERIES_TLSR951X + bool + select SOC_FAMILY_TELINK_TLSR + help + Telink TLSR951X + +config SOC_TLSR9518 + bool + select SOC_SERIES_TLSR951X + help + Telink TLSR9518 + +config SOC_SERIES + default "tlsr951x" if SOC_SERIES_TLSR951X + +config SOC + default "tlsr9518" if SOC_TLSR9518 diff --git a/soc/soc_legacy/riscv/telink_tlsr/tlsr951x/init.ld b/soc/telink/tlsr/tlsr951x/init.ld similarity index 100% rename from soc/soc_legacy/riscv/telink_tlsr/tlsr951x/init.ld rename to soc/telink/tlsr/tlsr951x/init.ld diff --git a/soc/soc_legacy/riscv/telink_tlsr/tlsr951x/linker.ld b/soc/telink/tlsr/tlsr951x/linker.ld similarity index 100% rename from soc/soc_legacy/riscv/telink_tlsr/tlsr951x/linker.ld rename to soc/telink/tlsr/tlsr951x/linker.ld diff --git a/soc/soc_legacy/riscv/telink_tlsr/tlsr951x/pinctrl_soc.h b/soc/telink/tlsr/tlsr951x/pinctrl_soc.h similarity index 100% rename from soc/soc_legacy/riscv/telink_tlsr/tlsr951x/pinctrl_soc.h rename to soc/telink/tlsr/tlsr951x/pinctrl_soc.h diff --git a/soc/soc_legacy/riscv/telink_tlsr/tlsr951x/soc.c b/soc/telink/tlsr/tlsr951x/soc.c similarity index 100% rename from soc/soc_legacy/riscv/telink_tlsr/tlsr951x/soc.c rename to soc/telink/tlsr/tlsr951x/soc.c diff --git a/soc/soc_legacy/riscv/telink_tlsr/tlsr951x/soc.h b/soc/telink/tlsr/tlsr951x/soc.h similarity index 100% rename from soc/soc_legacy/riscv/telink_tlsr/tlsr951x/soc.h rename to soc/telink/tlsr/tlsr951x/soc.h diff --git a/soc/soc_legacy/riscv/telink_tlsr/tlsr951x/soc_context.h b/soc/telink/tlsr/tlsr951x/soc_context.h similarity index 100% rename from soc/soc_legacy/riscv/telink_tlsr/tlsr951x/soc_context.h rename to soc/telink/tlsr/tlsr951x/soc_context.h diff --git a/soc/soc_legacy/riscv/telink_tlsr/tlsr951x/soc_irq.S b/soc/telink/tlsr/tlsr951x/soc_irq.S similarity index 100% rename from soc/soc_legacy/riscv/telink_tlsr/tlsr951x/soc_irq.S rename to soc/telink/tlsr/tlsr951x/soc_irq.S diff --git a/soc/soc_legacy/riscv/telink_tlsr/tlsr951x/soc_offsets.h b/soc/telink/tlsr/tlsr951x/soc_offsets.h similarity index 100% rename from soc/soc_legacy/riscv/telink_tlsr/tlsr951x/soc_offsets.h rename to soc/telink/tlsr/tlsr951x/soc_offsets.h diff --git a/soc/soc_legacy/riscv/telink_tlsr/tlsr951x/start.S b/soc/telink/tlsr/tlsr951x/start.S similarity index 100% rename from soc/soc_legacy/riscv/telink_tlsr/tlsr951x/start.S rename to soc/telink/tlsr/tlsr951x/start.S