Port-mips archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Question about a comment



On Tue, Jul 05, 2016 at 12:40:56AM +0000, coypu%SDF.ORG@localhost wrote:
> I'm curious about what is the reason for the following comment
> in sys/arch/mips/mips/locore.S:
> 
> #ifdef MIPS64_OCTEON
> 	//
> 	// U-boot on the erlite starts all cpus at the kernel entry point.
> 	// Use EBASE to find our CPU number and if it's not 0, call
> 	// octeon_cpu_spinup if MP or loop using the wait instruction since
> 	// non-primary CPUs can't do anything useful.
> 	//
> 	mfc0	a0, MIPS_COP_0_EBASE		# EBASE
> 	COP0_SYNC
> 	ext	a1, a0, 0, 10			# get CPU number
> 	beqz	a1, 2f				# normal startup if 0
> 	 nop
> #ifdef MULTIPROCESSOR
> 	j	_C_LABEL(octeon_cpu_spinup)
> 	 nop
> #else
> 1:	wait
> 	b	1b
> 	 nop
> #endif /* MIPS64_OCTEON */
> 
> What makes octeon special, why are we unable to use the other CPU?

We're already running on all the CPUs thanks to U-boot.  If we're not
MULTIPROCESSOR we can't do anything with more than one CPU.  But those
CPUs are already executing this code too, so they must be stopped before
they get in the way.

	Jonathan Kollasch


Home | Main Index | Thread Index | Old Index