Browse Source

arch: arc: replace ARC_EARLY_SOC_INIT with PLATFORM_RESET_HOOK

Use generic hook infrastrucutre instead of custom Kconfig and hooks for
ARC.

Replace soc_early_asm_init_percpu() with platform_reset()

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
pull/78152/head
Anas Nashif 11 months ago committed by Carles Cufí
parent
commit
8c32a82e47
  1. 4
      arch/arc/Kconfig
  2. 9
      arch/arc/core/reset.S
  3. 1
      soc/snps/hsdk4xd/CMakeLists.txt
  4. 2
      soc/snps/hsdk4xd/Kconfig.defconfig
  5. 14
      soc/snps/hsdk4xd/soc_ctrl.S
  6. 17
      soc/snps/hsdk4xd/soc_ctrl.h

4
arch/arc/Kconfig

@ -374,7 +374,9 @@ config ARC_EXCEPTION_STACK_SIZE @@ -374,7 +374,9 @@ config ARC_EXCEPTION_STACK_SIZE
endmenu
config ARC_EARLY_SOC_INIT
bool "Make early stage SoC-specific initialization"
bool "Make early stage SoC-specific initialization [DEPRECATED]"
select SOC_RESET_HOOK
select DEPRECATED
help
Call SoC per-core setup code on early stage initialization
(before C runtime initialization). Setup code is called in form of

9
arch/arc/core/reset.S

@ -16,8 +16,9 @@ @@ -16,8 +16,9 @@
#include <zephyr/arch/cpu.h>
#include <swap_macros.h>
#include <zephyr/arch/arc/asm-compat/assembler.h>
#ifdef CONFIG_ARC_EARLY_SOC_INIT
#include <soc_ctrl.h>
#if defined(CONFIG_SOC_RESET_HOOK)
GTEXT(soc_reset_hook)
#endif
GDATA(z_interrupt_stacks)
@ -112,8 +113,8 @@ done_icache_invalidate: @@ -112,8 +113,8 @@ done_icache_invalidate:
done_dcache_invalidate:
#ifdef CONFIG_ARC_EARLY_SOC_INIT
soc_early_asm_init_percpu
#ifdef CONFIG_SOC_RESET_HOOK
bl soc_reset_hook
#endif
_dsp_extension_probe

1
soc/snps/hsdk4xd/CMakeLists.txt

@ -16,5 +16,6 @@ else() @@ -16,5 +16,6 @@ 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 "")

2
soc/snps/hsdk4xd/Kconfig.defconfig

@ -44,7 +44,7 @@ config UART_NS16550_ACCESS_WORD_ONLY @@ -44,7 +44,7 @@ config UART_NS16550_ACCESS_WORD_ONLY
config ARC_HAS_ACCL_REGS
default y
config ARC_EARLY_SOC_INIT
config SOC_RESET_HOOK
default y
config ARC_HAS_STACK_CHECKING

14
soc/snps/hsdk4xd/soc_ctrl.S

@ -0,0 +1,14 @@ @@ -0,0 +1,14 @@
/*
* Copyright (c) 2023 Synopsys, Inc. All rights reserved.
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <zephyr/toolchain.h>
#include <zephyr/linker/sections.h>
#include <zephyr/arch/cpu.h>
GTEXT(soc_reset_hook)
SECTION_FUNC(TEXT, soc_reset_hook)
mov r0, 1 /* disable LPB for HS4XD */
sr r0, [_ARC_V2_LPB_CTRL]

17
soc/snps/hsdk4xd/soc_ctrl.h

@ -1,17 +0,0 @@ @@ -1,17 +0,0 @@
/*
* 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_ */
Loading…
Cancel
Save