smp: Support more clusters/CPUs properly

Signed-off-by: Hector Martin <marcan@marcan.st>
This commit is contained in:
Hector Martin 2021-11-01 19:17:09 +09:00
parent 9b6e5fbc52
commit 87613dc208
2 changed files with 2 additions and 6 deletions

View file

@ -88,11 +88,7 @@ static void smp_start_cpu(int index, int cluster, int core, u64 rvbar, u64 cpu_s
write32(cpu_start_base + 0x4, 1 << index);
// Actually start the core
if (cluster == 0) {
write32(cpu_start_base + 0x8, 1 << core);
} else {
write32(cpu_start_base + 0xc, 1 << core);
}
write32(cpu_start_base + 0x8 + 4 * cluster, 1 << core);
for (i = 0; i < 500; i++) {
sysop("dmb ld");

View file

@ -6,7 +6,7 @@
#include "types.h"
#include "utils.h"
#define MAX_CPUS 8
#define MAX_CPUS 20
#define SECONDARY_STACK_SIZE 0x10000
extern u8 secondary_stacks[MAX_CPUS][SECONDARY_STACK_SIZE];