Skip to content

Commit

Permalink
csky: Add cpu feature register hint for smp
Browse files Browse the repository at this point in the history
CPU features registers are setup by customers' bootloader, but
Linux must help transfer them from the primary to secondary cores.
This patch add hint2 CPU feature register supported.

Signed-off-by: Guo Ren <guoren@linux.alibaba.com>
Cc: Arnd Bergmann <arnd@arndb.de>
  • Loading branch information
guoren83 committed Jul 31, 2020
1 parent e95a4f8 commit 8077e66
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions arch/csky/kernel/smp.c
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ void __init setup_smp(void)
extern void _start_smp_secondary(void);

volatile unsigned int secondary_hint;
volatile unsigned int secondary_hint2;
volatile unsigned int secondary_ccr;
volatile unsigned int secondary_stack;

Expand All @@ -168,6 +169,7 @@ int __cpu_up(unsigned int cpu, struct task_struct *tidle)
secondary_stack =
(unsigned int) task_stack_page(tidle) + THREAD_SIZE - 8;
secondary_hint = mfcr("cr31");
secondary_hint2 = mfcr("cr<21, 1>");
secondary_ccr = mfcr("cr18");
secondary_msa1 = read_mmu_msa1();

Expand Down Expand Up @@ -209,6 +211,7 @@ void csky_start_secondary(void)
unsigned int cpu = smp_processor_id();

mtcr("cr31", secondary_hint);
mtcr("cr<21, 1>", secondary_hint2);
mtcr("cr18", secondary_ccr);

mtcr("vbr", vec_base);
Expand Down

0 comments on commit 8077e66

Please sign in to comment.