Changeset View
Changeset View
Standalone View
Standalone View
head/sys/powerpc/ps3/platform_ps3.c
Show First 20 Lines • Show All 122 Lines • ▼ Show 20 Lines | |||||
static int | static int | ||||
ps3_attach(platform_t plat) | ps3_attach(platform_t plat) | ||||
{ | { | ||||
pmap_mmu_install("mmu_ps3", BUS_PROBE_SPECIFIC); | pmap_mmu_install("mmu_ps3", BUS_PROBE_SPECIFIC); | ||||
cpu_idle_hook = ps3_cpu_idle; | cpu_idle_hook = ps3_cpu_idle; | ||||
/* Set a breakpoint to make NULL an invalid address */ | |||||
lv1_set_dabr(0x7 /* read and write, MMU on */, 2 /* kernel accesses */); | |||||
/* Record our PIR at boot for later */ | /* Record our PIR at boot for later */ | ||||
ps3_boot_pir = mfspr(SPR_PIR); | ps3_boot_pir = mfspr(SPR_PIR); | ||||
return (0); | return (0); | ||||
} | } | ||||
void | void | ||||
ps3_mem_regions(platform_t plat, struct mem_region *phys, int *physsz, | ps3_mem_regions(platform_t plat, struct mem_region *phys, int *physsz, | ||||
▲ Show 20 Lines • Show All 80 Lines • ▼ Show 20 Lines | ps3_smp_get_bsp(platform_t plat, struct cpuref *cpuref) | ||||
return (0); | return (0); | ||||
} | } | ||||
static int | static int | ||||
ps3_smp_start_cpu(platform_t plat, struct pcpu *pc) | ps3_smp_start_cpu(platform_t plat, struct pcpu *pc) | ||||
{ | { | ||||
/* kernel is spinning on 0x40 == -1 right now */ | /* kernel is spinning on 0x40 == -1 right now */ | ||||
volatile uint32_t *secondary_spin_sem = (uint32_t *)PHYS_TO_DMAP(0x40); | volatile uint32_t *secondary_spin_sem = | ||||
(uint32_t *)PHYS_TO_DMAP((uintptr_t)0x40); | |||||
int remote_pir = pc->pc_hwref; | int remote_pir = pc->pc_hwref; | ||||
int timeout; | int timeout; | ||||
ap_pcpu = pc; | ap_pcpu = pc; | ||||
/* Try both PIR values, looping a few times: the HV likes moving us */ | /* Try both PIR values, looping a few times: the HV likes moving us */ | ||||
timeout = 10000; | timeout = 10000; | ||||
while (!pc->pc_awake && timeout--) { | while (!pc->pc_awake && timeout--) { | ||||
▲ Show 20 Lines • Show All 49 Lines • Show Last 20 Lines |