diff --git a/arch/arc/Kconfig b/arch/arc/Kconfig index e324c4064ab..3f5ef8543b4 100644 --- a/arch/arc/Kconfig +++ b/arch/arc/Kconfig @@ -383,9 +383,7 @@ config ARC_EXCEPTION_STACK_SIZE endmenu config ARC_EARLY_SOC_INIT - bool "Make early stage SoC-specific initialization [DEPRECATED]" - select SOC_RESET_HOOK - select DEPRECATED + bool "Make early stage SoC-specific initialization" help Call SoC per-core setup code on early stage initialization (before C runtime initialization). Setup code is called in form of diff --git a/arch/arc/core/reset.S b/arch/arc/core/reset.S index 63fa6438ce4..a2b038d387e 100644 --- a/arch/arc/core/reset.S +++ b/arch/arc/core/reset.S @@ -16,9 +16,8 @@ #include #include #include - -#if defined(CONFIG_SOC_RESET_HOOK) -GTEXT(soc_reset_hook) +#ifdef CONFIG_ARC_EARLY_SOC_INIT + #include #endif GDATA(z_interrupt_stacks) @@ -113,8 +112,8 @@ done_icache_invalidate: done_dcache_invalidate: -#ifdef CONFIG_SOC_RESET_HOOK - bl soc_reset_hook +#ifdef CONFIG_ARC_EARLY_SOC_INIT + soc_early_asm_init_percpu #endif _dsp_extension_probe diff --git a/soc/snps/hsdk4xd/CMakeLists.txt b/soc/snps/hsdk4xd/CMakeLists.txt index d29cb7e2e50..e1765fe1136 100644 --- a/soc/snps/hsdk4xd/CMakeLists.txt +++ b/soc/snps/hsdk4xd/CMakeLists.txt @@ -16,6 +16,5 @@ else() endif() zephyr_include_directories(.) -zephyr_library_sources_ifdef(CONFIG_SOC_RESET_HOOK soc_ctrl.S) set(SOC_LINKER_SCRIPT ${CMAKE_CURRENT_SOURCE_DIR}/linker.ld CACHE INTERNAL "") diff --git a/soc/snps/hsdk4xd/Kconfig.defconfig b/soc/snps/hsdk4xd/Kconfig.defconfig index 4adafa9b043..a47f25d09d0 100644 --- a/soc/snps/hsdk4xd/Kconfig.defconfig +++ b/soc/snps/hsdk4xd/Kconfig.defconfig @@ -44,7 +44,7 @@ config UART_NS16550_ACCESS_WORD_ONLY config ARC_HAS_ACCL_REGS default y -config SOC_RESET_HOOK +config ARC_EARLY_SOC_INIT default y config ARC_HAS_STACK_CHECKING diff --git a/soc/snps/hsdk4xd/soc_ctrl.S b/soc/snps/hsdk4xd/soc_ctrl.S deleted file mode 100644 index 0973b166564..00000000000 --- a/soc/snps/hsdk4xd/soc_ctrl.S +++ /dev/null @@ -1,14 +0,0 @@ -/* - * Copyright (c) 2023 Synopsys, Inc. All rights reserved. - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#include -#include -#include - -GTEXT(soc_reset_hook) -SECTION_FUNC(TEXT, soc_reset_hook) - mov r0, 1 /* disable LPB for HS4XD */ - sr r0, [_ARC_V2_LPB_CTRL] diff --git a/soc/snps/hsdk4xd/soc_ctrl.h b/soc/snps/hsdk4xd/soc_ctrl.h new file mode 100644 index 00000000000..93d50d3eb20 --- /dev/null +++ b/soc/snps/hsdk4xd/soc_ctrl.h @@ -0,0 +1,17 @@ +/* + * Copyright (c) 2023 Synopsys, Inc. All rights reserved. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#ifndef _ARC_HSDK4XD_SOC_CTRL_H_ +#define _ARC_HSDK4XD_SOC_CTRL_H_ + +#ifdef _ASMLANGUAGE +.macro soc_early_asm_init_percpu + mov r0, 1 /* disable LPB for HS4XD */ + sr r0, [_ARC_V2_LPB_CTRL] +.endm +#endif /* _ASMLANGUAGE */ + +#endif /* _ARC_HSDK4XD_SOC_CTRL_H_ */