ARC fixes for 5.10-rc3

- Unbork HSDKv1 platform (won't boot) due to memory map issue
 
  - Prevent stack unwinder from infinite looping
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEOXpuCuR6hedrdLCJadfx3eKKwl4FAl+kalAACgkQadfx3eKK
 wl7J0A//RC5YkvL+ERYG8S/N+tM+YetiHlMzFy5+/cZLUQqepcqvd105fQHH3rGu
 eGEWIlL5ez7kLisbrxMog3OnuFN8hGIlsU+9GzgxCGgFIxPXnRzkPo77fKgIG6zs
 9N5QDLoqhHNCNYuhYJtsPTK8gUwUwZMFcZYQ2NpMIxsxvr8CDz3YLDncZRieNpf8
 NAMNIARi41kuwe2x0svIv3PE4i6Wulz031UIC2F1wW+XlF21uBi7tmnkGgZs0ocF
 M7z3aqXRryjpZYiUtNLFqVU7uNvix08jKTUKJVycthEIuIQQN0hwN9VEwiaCoH6y
 j+DGzghtXH6gBeWX1pNz+kk4fFAT6FCP5gKHwzWSPlJvt4c+iA22MUOIumS5+fgY
 tFfmMTn3+9GAhGOOhFDx2GjyVaXONzh3mqQHQefGZSX11UDM1BNHqHudmowN54oQ
 Vur3Mpwob8xoCa4Zyexw2gLf9bpt3T5q2Fbdarxyqg/wAWNhF0I9xx99obpk1ELb
 ZnKXXRvYgilXqGIWeBFOs+mFR3d7tyh/r7PwFXrk+RO4wPWSSY6ZSBH7UM+Pcqhb
 UhrKzuZlI2wiZkQp+3rFPzw1cJndVpX7vRn0LHWY5CsI4DIYJvmLcJAcu8bwktnU
 s4no3zxk/iNEKNaZaBfsmZZLoIBptxdDQPddyZKQMVwCMD4cUYk=
 =Sgx8
 -----END PGP SIGNATURE-----

Merge tag 'arc-5.10-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/vgupta/arc

Pull ARC fixes from Vineet Gupta:

 - Unbork HSDKv1 platform (won't boot) due to memory map issue

 - Prevent stack unwinder from infinite looping

* tag 'arc-5.10-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/vgupta/arc:
  ARC: [plat-hsdk] Remap CCMs super early in asm boot trampoline
  ARC: stack unwinding: avoid indefinite looping
This commit is contained in:
Linus Torvalds 2020-11-06 12:29:08 -08:00
commit 4257087e8f
3 changed files with 22 additions and 19 deletions

View File

@ -67,7 +67,22 @@
sr r5, [ARC_REG_LPB_CTRL]
1:
#endif /* CONFIG_ARC_LPB_DISABLE */
#endif
/* On HSDK, CCMs need to remapped super early */
#ifdef CONFIG_ARC_SOC_HSDK
mov r6, 0x60000000
lr r5, [ARC_REG_ICCM_BUILD]
breq r5, 0, 1f
sr r6, [ARC_REG_AUX_ICCM]
1:
lr r5, [ARC_REG_DCCM_BUILD]
breq r5, 0, 2f
sr r6, [ARC_REG_AUX_DCCM]
2:
#endif /* CONFIG_ARC_SOC_HSDK */
#endif /* CONFIG_ISA_ARCV2 */
; Config DSP_CTRL properly, so kernel may use integer multiply,
; multiply-accumulate, and divide operations
DSP_EARLY_INIT

View File

@ -112,7 +112,7 @@ arc_unwind_core(struct task_struct *tsk, struct pt_regs *regs,
int (*consumer_fn) (unsigned int, void *), void *arg)
{
#ifdef CONFIG_ARC_DW2_UNWIND
int ret = 0;
int ret = 0, cnt = 0;
unsigned int address;
struct unwind_frame_info frame_info;
@ -132,6 +132,11 @@ arc_unwind_core(struct task_struct *tsk, struct pt_regs *regs,
break;
frame_info.regs.r63 = frame_info.regs.r31;
if (cnt++ > 128) {
printk("unwinder looping too long, aborting !\n");
return 0;
}
}
return address; /* return the last address it saw */

View File

@ -17,22 +17,6 @@ int arc_hsdk_axi_dmac_coherent __section(".data") = 0;
#define ARC_CCM_UNUSED_ADDR 0x60000000
static void __init hsdk_init_per_cpu(unsigned int cpu)
{
/*
* By default ICCM is mapped to 0x7z while this area is used for
* kernel virtual mappings, so move it to currently unused area.
*/
if (cpuinfo_arc700[cpu].iccm.sz)
write_aux_reg(ARC_REG_AUX_ICCM, ARC_CCM_UNUSED_ADDR);
/*
* By default DCCM is mapped to 0x8z while this area is used by kernel,
* so move it to currently unused area.
*/
if (cpuinfo_arc700[cpu].dccm.sz)
write_aux_reg(ARC_REG_AUX_DCCM, ARC_CCM_UNUSED_ADDR);
}
#define ARC_PERIPHERAL_BASE 0xf0000000
#define CREG_BASE (ARC_PERIPHERAL_BASE + 0x1000)
@ -339,5 +323,4 @@ static const char *hsdk_compat[] __initconst = {
MACHINE_START(SIMULATION, "hsdk")
.dt_compat = hsdk_compat,
.init_early = hsdk_init_early,
.init_per_cpu = hsdk_init_per_cpu,
MACHINE_END