Commit c63298ea authored by Wayne Ren's avatar Wayne Ren Committed by Maureen Helm
Browse files

arch: arc: improve the reset code

This commit improves the reset of arc:
* make the processor in the correct status
* clear interrupt related regs

this may improve or fix #6515

Signed-off-by: default avatarWayne Ren <wei.ren@synopsys.com>
parent fb3d2d37
Loading
Loading
Loading
Loading
+12 −2
Changes for arch/arc/core/reset.S: 12 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -44,8 +44,18 @@ GTEXT(__start)
SECTION_FUNC(TEXT,__reset)
SECTION_FUNC(TEXT,__start)

	/* lock interrupts: will get unlocked when switch to main task */
	clri
	/* lock interrupts: will get unlocked when switch to main task
	 * also make sure the processor in the correct status
	 */
	mov r0, 0
	kflag r0

	/* interrupt related init */
	sr r0, [_ARC_V2_AUX_IRQ_ACT]
	sr r0, [_ARC_V2_AUX_IRQ_CTRL]
	sr r0, [_ARC_V2_AUX_IRQ_HINT]

	/* \todo: MPU init, gp for small data? */

#if CONFIG_USERSPACE
	lr r0, [_ARC_V2_STATUS32]