void amon_cpu_start(int cpu, unsigned long pc, unsigned long sp, unsigned long gp, unsigned long a0) { #ifdef CONFIG_RTL_8198C if (!amon_cpu_avail(cpu)) return; if (cpu == smp_processor_id()) { pr_debug("SMP-amon: I am cpu%d!\n", cpu); return; } pr_debug("SMP-amon: starting cpu%d\n", cpu); REG32(((unsigned int )&smpboot_pc)|0xa0000000)=pc; REG32(((unsigned int )&smpboot_gp)|0xa0000000)=gp; REG32(((unsigned int )&smpboot_sp)|0xa0000000)=sp; REG32(((unsigned int )&smpboot_a0)|0xa0000000)=a0; //REG32(LAUNCH_REG)=pc|0xa0000000; REG32(LAUNCH_REG)=pc; smp_wmb(); /* Target must see parameters before go */ REG32(POLLING_REG)=PATT_MAGIC; smp_wmb(); /* Target must see go before we poll */ //while (REG32(POLLING_REG) == PATT_MAGIC) {}; smp_rmb(); /* Target will be updating flags soon */ pr_debug("SMP-amon: cpu%d gone!\n", cpu); #else volatile struct smp_boot *smpboot = (struct smp_boot *) SMPBOOT; if (!amon_cpu_avail(cpu)) return; if (cpu == smp_processor_id()) { pr_debug("SMP-amon: I am cpu%d!\n", cpu); return; } smpboot += cpu; pr_debug("SMP-amon: starting cpu%d\n", cpu); smpboot->pc = pc; smpboot->gp = gp; smpboot->sp = sp; smpboot->a0 = a0; smp_wmb(); /* Target must see parameters before go */ smpboot->flags |= SMP_LAUNCH_FGO; smp_wmb(); /* Target must see go before we poll */ while ((smpboot->flags & SMP_LAUNCH_FGONE) == 0) ; smp_rmb(); /* Target will be updating flags soon */ pr_debug("SMP-amon: cpu%d gone!\n", cpu); #endif }
void amon_cpu_start(int cpu, unsigned long pc, unsigned long sp, unsigned long gp, unsigned long a0) { volatile struct cpulaunch *launch = (struct cpulaunch *)CKSEG0ADDR(CPULAUNCH); if (!amon_cpu_avail(cpu)) return; if (cpu == smp_processor_id()) { pr_debug("launch: I am cpu%d!\n", cpu); return; } launch += cpu; pr_debug("launch: starting cpu%d\n", cpu); launch->pc = pc; launch->gp = gp; launch->sp = sp; launch->a0 = a0; /* Make sure target sees parameters before the go bit */ smp_mb(); launch->flags |= LAUNCH_FGO; while ((launch->flags & LAUNCH_FGONE) == 0) ; pr_debug("launch: cpu%d gone!\n", cpu); }
int amon_cpu_start(int cpu, unsigned long pc, unsigned long sp, unsigned long gp, unsigned long a0) { volatile struct cpulaunch *launch = (struct cpulaunch *)CKSEG0ADDR(CPULAUNCH); if (!amon_cpu_avail(cpu)) return -1; if (cpu == smp_processor_id()) { pr_debug("launch: I am cpu%d!\n", cpu); return -1; } launch += cpu; pr_debug("launch: starting cpu%d\n", cpu); launch->pc = pc; launch->gp = gp; launch->sp = sp; launch->a0 = a0; smp_wmb(); /* Target must see parameters before go */ launch->flags |= LAUNCH_FGO; smp_wmb(); /* Target must see go before we poll */ while ((launch->flags & LAUNCH_FGONE) == 0) ; smp_rmb(); /* Target will be updating flags soon */ pr_debug("launch: cpu%d gone!\n", cpu); return 0; }