|
|
|
|
|
Xilinx User Community Forums :
Embedded Solutions :
Embedded Linux :
Re: Using FPU under Linux on ML507 fails
|
|
|
|
|

|
Using FPU under Linux on ML507 fails
|
|
andn
Visitor
Posts: 4
Registered: 04-02-2009

Message 1 of 15

Viewed 2,535 times
|

|
|
Hi, I have a ML507 board running a project with the FPU instantiated. Works fine for standalone floating point apps created via xps. However, any fp calculation will return 'Illegal Instruction' if run in a 2.6.28 linux kernel. I have tried the tricks mentioned in other posts, especially hopeful on changing MSR_USER to |=MSR_FP in reg.h, but that only caused the kernel to crash on bootup, because again, fp opcodes are not usable. I now found out that if I load the kernel via xmd, the FPU does actually work, but have no clue why that is. Are there any registers that XMD changes for this to be possible? How can I control them (e.g. how can I find the APU control register to make sure bit31 is set)? Is there any tweaking of the first stage bootloader or u-boot necessary? thanks a lot for any help! regards, Andi
|
Solved!
 Go to Solution
|
|
|
04-02-2009 01:42 AM
|
|
|
|
|

|
Re: Using FPU under Linux on ML507 fails
|
|
linnj
Expert Contributor
Posts: 354
Registered: 09-10-2008

Message 2 of 15

Viewed 2,524 times
|

|
|
What tools are you using, are they FPU enabled tools? In other words, the ELDK has 2 sets of tools for the 4xx processors, the FP enabled and the non-FP tools. I have not done testing with the FP tools to take advantage of the FPU. -- John John Linn
|
|
|
|
04-02-2009 06:58 AM
|
|
|
|
|

|
Re: Using FPU under Linux on ML507 fails
|
|
linnj
Expert Contributor
Posts: 354
Registered: 09-10-2008

Message 3 of 15

Viewed 2,523 times
|

|
|
A little more digging on the subject..... We had code in to select the FPU but we ended up taking it out when the code went into the mainline. It had code to select the FPU in the kernel configuration and some code for some strange exceptions which I think were on early Xilinx hardware. To select the FPU in the kernel configuration, the arch/powerpc/platforms/44x/Kconfig would need to be altered to turn on the FPU for the Xilinx 440. select PPC_FPU Since I don't have the 4XX FP tools setup I don't have a quick way to test this. -- John
John Linn
|
|
|
|
04-02-2009 07:14 AM
|
|
|
|
|
|
|

|
Re: Using FPU under Linux on ML507 fails
|
|
chaplin
Xilinx Employee
Posts: 77
Registered: 08-07-2007

Message 5 of 15

Viewed 2,520 times
|

|
|
Hello, I have had a go with the FPU recently, please see attached a Kconfig file that I modified (/arch/powerpc/platforms/44x/Kconfig). Then in menuconfig, under platform support select Enable Xilinx Soft FPU. I ran some tests using the ppc_4xxFP ELDK toolchain, and all seemed to go well for me. Hope that helps Kris Kris Chaplin Xilinx UK
|
 Accepted Solution
|
|
|
04-02-2009 07:24 AM
|
|
|
|
|

|
Re: Using FPU under Linux on ML507 fails
|
|
bones10
Visitor
Posts: 11
Registered: 10-28-2008

Message 6 of 15

Viewed 2,511 times
|

|
|
The Virtex5 floating point unit needs a few workarounds. It issues spurrious illegal instruction exceptions. The code that was removed handled these spurrious exceptions. - John
|
|
|
|
04-02-2009 08:00 AM
|
|
|
|
|

|
Re: Using FPU under Linux on ML507 fails
|
|
linnj
Expert Contributor
Posts: 354
Registered: 09-10-2008

Message 7 of 15

Viewed 2,500 times
|

|
|
I am doing a quick test now, but I was able to grab that commit that we had in the tree previously and apply it to the top of tree using GIT. >git cherry-pick 4ace854b8 The kernel builds and runs with the FPU enabled and the exceptions using the non-FPU GNU tools from ELDK. I'm hearing from others in Xilinx other than John B the same thing, that the exceptions can still occur on production hardware and this commit was the code that handles those exceptions. -- John John Linn
|
|
|
|
04-02-2009 08:07 AM
|
|
|
|
|
|
|

|
Re: Using FPU under Linux on ML507 fails
|
|
andn
Visitor
Posts: 4
Registered: 04-02-2009

Message 9 of 15

Viewed 2,485 times
|

|
|
Thank you very much for your input on that! I solved one problem today, that is the CCR0 register was set in the U-Boot start.S file for ppc4xx to some value which disables broadcast of Instructions to the APU (bit 11). Once I changed this my FPU does actually do something, but at the moment the calculations are wrong since I have not fully converted to ppc_4xxFP toolchain. The problems you're already mentioning are my next step, to be followed up with in the next days. I'll keep you posted on this. @Kris: Does the 'Enable Xilinx Soft FPU' use only the floating point emulation? Actually I really need the processing power of the real FPU. cheers, Andi
|
|
|
|
04-02-2009 08:51 AM
|
|
|
|
|

|
Re: Using FPU under Linux on ML507 fails
|
|
linnj
Expert Contributor
Posts: 354
Registered: 09-10-2008

Message 10 of 15

Viewed 2,480 times
|

|
|
The soft FPU does FP operations in hardware, it's just named soft as the logic in the hardware is soft rather than hard. -- John John Linn
|
|
|
|
04-02-2009 08:57 AM
|
|
|
|
|
|
|
|
|