Skip to content

Commit

Permalink
arch: arc: replace ARC_EARLY_SOC_INIT with PLATFORM_RESET_HOOK
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
nashif authored and carlescufi committed Sep 9, 2024
1 parent 81cf870 commit 8c32a82
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 23 deletions.
4 changes: 3 additions & 1 deletion arch/arc/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 5 additions & 4 deletions arch/arc/core/reset.S
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions soc/snps/hsdk4xd/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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 changes: 1 addition & 1 deletion soc/snps/hsdk4xd/Kconfig.defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
14 changes: 14 additions & 0 deletions soc/snps/hsdk4xd/soc_ctrl.S
Original file line number Diff line number Diff line change
@@ -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 changes: 0 additions & 17 deletions soc/snps/hsdk4xd/soc_ctrl.h

This file was deleted.

0 comments on commit 8c32a82

Please sign in to comment.