How to use SPE on MPC8541

Andy Fleming afleming at
Wed Sep 28 01:56:36 EST 2005

On Sep 27, 2005, at 10:30, Gérard Guével wrote:

> Hi,
> I am running a Linux 2.6.9 on a MPC8541 custom board.
> I would like to run a user application which contains
> some SPE code extracted from a freescale library.
> I compiled the kernel with the CONFIG_SPE set to yes.
> The application also compiles and I can run it on the
> board.
> But it seems the SPE bit from the MSR register
> is not set when the process runs.
> I tried to use a call to the enable_kernel_spe function
> to force the bit, but it is always erased by the kernel (??)
> when scheduling task and never set again.
> Must I compile the application with some special flags
> to instruct the kernel I want to use SPE ?

You say the application runs, right?  So what made you check the SPE  
bit state?  The kernel keeps SPE disabled by default so it doesn't  
have to save the upper 32 bits of the registers every context  
switch.  When a process uses SPE for the first time, an exception is  
triggered, the kernel enables SPE for that process, and then that  
process should be able to use SPE every time it gets cpu time.

How are you determining that the SPE bit is not set?  Is your  
application not executing the SPE instructions?


More information about the Linuxppc-embedded mailing list