Skip to content

Commit 0de4adf

Browse files
soniczvapier
authored andcommitted
Blackfin: fix accidental reset in some boot modes
We read the SWRST (Software Reset) register to get at the last reset state, and then we may configure the DOUBLE_FAULT bit to control behavior when a double fault occurs. But if the lower bits of the register is already set (like UART boot mode on a BF54x), we inadvertently make the system reset by writing to the SYSTEM_RESET field at the same time. So make sure the lower 4 bits are always cleared. Signed-off-by: Sonic Zhang <sonic.zhang@analog.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
1 parent 81b79c2 commit 0de4adf

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

‎arch/blackfin/kernel/setup.c‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -837,7 +837,8 @@ void __init setup_arch(char **cmdline_p)
837837
defined(CONFIG_BF538) || defined(CONFIG_BF539)
838838
_bfin_swrst = bfin_read_SWRST();
839839
#else
840-
_bfin_swrst = bfin_read_SYSCR();
840+
/* Clear boot mode field */
841+
_bfin_swrst = bfin_read_SYSCR() & ~0xf;
841842
#endif
842843

843844
#ifdef CONFIG_DEBUG_DOUBLEFAULT_PRINT

0 commit comments

Comments
 (0)