Skip to content

Commit 8c32a82

Browse files
nashifcarlescufi
authored andcommitted
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 <[email protected]>
1 parent 81cf870 commit 8c32a82

File tree

6 files changed

+24
-23
lines changed

6 files changed

+24
-23
lines changed

arch/arc/Kconfig

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,9 @@ config ARC_EXCEPTION_STACK_SIZE
374374
endmenu
375375

376376
config ARC_EARLY_SOC_INIT
377-
bool "Make early stage SoC-specific initialization"
377+
bool "Make early stage SoC-specific initialization [DEPRECATED]"
378+
select SOC_RESET_HOOK
379+
select DEPRECATED
378380
help
379381
Call SoC per-core setup code on early stage initialization
380382
(before C runtime initialization). Setup code is called in form of

arch/arc/core/reset.S

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,9 @@
1616
#include <zephyr/arch/cpu.h>
1717
#include <swap_macros.h>
1818
#include <zephyr/arch/arc/asm-compat/assembler.h>
19-
#ifdef CONFIG_ARC_EARLY_SOC_INIT
20-
#include <soc_ctrl.h>
19+
20+
#if defined(CONFIG_SOC_RESET_HOOK)
21+
GTEXT(soc_reset_hook)
2122
#endif
2223

2324
GDATA(z_interrupt_stacks)
@@ -112,8 +113,8 @@ done_icache_invalidate:
112113

113114
done_dcache_invalidate:
114115

115-
#ifdef CONFIG_ARC_EARLY_SOC_INIT
116-
soc_early_asm_init_percpu
116+
#ifdef CONFIG_SOC_RESET_HOOK
117+
bl soc_reset_hook
117118
#endif
118119

119120
_dsp_extension_probe

soc/snps/hsdk4xd/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,6 @@ else()
1616
endif()
1717

1818
zephyr_include_directories(.)
19+
zephyr_library_sources_ifdef(CONFIG_SOC_RESET_HOOK soc_ctrl.S)
1920

2021
set(SOC_LINKER_SCRIPT ${CMAKE_CURRENT_SOURCE_DIR}/linker.ld CACHE INTERNAL "")

soc/snps/hsdk4xd/Kconfig.defconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ config UART_NS16550_ACCESS_WORD_ONLY
4444
config ARC_HAS_ACCL_REGS
4545
default y
4646

47-
config ARC_EARLY_SOC_INIT
47+
config SOC_RESET_HOOK
4848
default y
4949

5050
config ARC_HAS_STACK_CHECKING

soc/snps/hsdk4xd/soc_ctrl.S

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
/*
2+
* Copyright (c) 2023 Synopsys, Inc. All rights reserved.
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
#include <zephyr/toolchain.h>
8+
#include <zephyr/linker/sections.h>
9+
#include <zephyr/arch/cpu.h>
10+
11+
GTEXT(soc_reset_hook)
12+
SECTION_FUNC(TEXT, soc_reset_hook)
13+
mov r0, 1 /* disable LPB for HS4XD */
14+
sr r0, [_ARC_V2_LPB_CTRL]

soc/snps/hsdk4xd/soc_ctrl.h

Lines changed: 0 additions & 17 deletions
This file was deleted.

0 commit comments

Comments
 (0)