Changeset View
Changeset View
Standalone View
Standalone View
sys/arm64/arm64/mp_machdep.c
Show First 20 Lines • Show All 663 Lines • ▼ Show 20 Lines | |||||
cpu_mp_start(void) | cpu_mp_start(void) | ||||
{ | { | ||||
mtx_init(&ap_boot_mtx, "ap boot", NULL, MTX_SPIN); | mtx_init(&ap_boot_mtx, "ap boot", NULL, MTX_SPIN); | ||||
/* CPU 0 is always boot CPU. */ | /* CPU 0 is always boot CPU. */ | ||||
CPU_SET(0, &all_cpus); | CPU_SET(0, &all_cpus); | ||||
__pcpu[0].pc_mpidr = READ_SPECIALREG(mpidr_el1) & CPU_AFF_MASK; | __pcpu[0].pc_mpidr = READ_SPECIALREG(mpidr_el1) & CPU_AFF_MASK; | ||||
switch(arm64_bus_method) { | switch(firmware_type) { | ||||
imp: I'm not so sure on this....
UEFI is orthogonal to DEVTREE vs ACPI for bus enumeration.
We can… | |||||
#ifdef DEV_ACPI | #ifdef DEV_ACPI | ||||
case ARM64_BUS_ACPI: | case FW_UEFI: | ||||
mp_quirks = MP_QUIRK_CPULIST; | mp_quirks = MP_QUIRK_CPULIST; | ||||
cpu_init_acpi(); | cpu_init_acpi(); | ||||
break; | break; | ||||
#endif | #endif | ||||
#ifdef FDT | #ifdef FDT | ||||
case ARM64_BUS_FDT: | case FW_DEVTREE: | ||||
cpu_init_fdt(); | cpu_init_fdt(); | ||||
break; | break; | ||||
#endif | #endif | ||||
default: | default: | ||||
break; | break; | ||||
} | } | ||||
} | } | ||||
▲ Show 20 Lines • Show All 50 Lines • ▼ Show 20 Lines | |||||
void | void | ||||
cpu_mp_setmaxid(void) | cpu_mp_setmaxid(void) | ||||
{ | { | ||||
int cores; | int cores; | ||||
mp_ncpus = 1; | mp_ncpus = 1; | ||||
mp_maxid = 0; | mp_maxid = 0; | ||||
switch(arm64_bus_method) { | switch(firmware_type) { | ||||
#ifdef DEV_ACPI | #ifdef DEV_ACPI | ||||
case ARM64_BUS_ACPI: | case FW_UEFI: | ||||
cores = cpu_count_acpi(); | cores = cpu_count_acpi(); | ||||
if (cores > 0) { | if (cores > 0) { | ||||
cores = MIN(cores, MAXCPU); | cores = MIN(cores, MAXCPU); | ||||
if (bootverbose) | if (bootverbose) | ||||
printf("Found %d CPUs in the ACPI tables\n", | printf("Found %d CPUs in the ACPI tables\n", | ||||
cores); | cores); | ||||
mp_ncpus = cores; | mp_ncpus = cores; | ||||
mp_maxid = cores - 1; | mp_maxid = cores - 1; | ||||
} | } | ||||
break; | break; | ||||
#endif | #endif | ||||
#ifdef FDT | #ifdef FDT | ||||
case ARM64_BUS_FDT: | case FW_DEVTREE: | ||||
cores = ofw_cpu_early_foreach(NULL, false); | cores = ofw_cpu_early_foreach(NULL, false); | ||||
if (cores > 0) { | if (cores > 0) { | ||||
cores = MIN(cores, MAXCPU); | cores = MIN(cores, MAXCPU); | ||||
if (bootverbose) | if (bootverbose) | ||||
printf("Found %d CPUs in the device tree\n", | printf("Found %d CPUs in the device tree\n", | ||||
cores); | cores); | ||||
mp_ncpus = cores; | mp_ncpus = cores; | ||||
mp_maxid = cores - 1; | mp_maxid = cores - 1; | ||||
▲ Show 20 Lines • Show All 160 Lines • Show Last 20 Lines |
I'm not so sure on this....
UEFI is orthogonal to DEVTREE vs ACPI for bus enumeration.
We can make UEFI callbacks for both. These part of the change seem wrong.