Skip to content

Commit

Permalink
riscv: sifive_u: Set the minimum number of cpus to 2
Browse files Browse the repository at this point in the history
It is not useful if we only have one management CPU.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
[Palmer: Set default CPUs to 2]
Reviewed-by: Palmer Dabbelt <palmer@sifive.com>
Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
  • Loading branch information
lbmeng authored and palmer-dabbelt committed Sep 17, 2019
1 parent e8c5678 commit f3d47d5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 4 additions & 1 deletion hw/riscv/sifive_u.c
Expand Up @@ -10,7 +10,8 @@
* 1) CLINT (Core Level Interruptor)
* 2) PLIC (Platform Level Interrupt Controller)
*
* This board currently uses a hardcoded devicetree that indicates one hart.
* This board currently generates devicetree dynamically that indicates at least
* two harts.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
Expand Down Expand Up @@ -433,6 +434,8 @@ static void riscv_sifive_u_machine_init(MachineClass *mc)
* management CPU.
*/
mc->max_cpus = 4;
mc->min_cpus = SIFIVE_U_MANAGEMENT_CPU_COUNT + 1;
mc->default_cpus = mc->min_cpus;
}

DEFINE_MACHINE("sifive_u", riscv_sifive_u_machine_init)
Expand Down
2 changes: 2 additions & 0 deletions include/hw/riscv/sifive_u.h
Expand Up @@ -69,6 +69,8 @@ enum {
SIFIVE_U_GEM_CLOCK_FREQ = 125000000
};

#define SIFIVE_U_MANAGEMENT_CPU_COUNT 1

#define SIFIVE_U_PLIC_HART_CONFIG "MS"
#define SIFIVE_U_PLIC_NUM_SOURCES 54
#define SIFIVE_U_PLIC_NUM_PRIORITIES 7
Expand Down

0 comments on commit f3d47d5

Please sign in to comment.