Whose responsibility is it to enable FPU?
I built u-boot for a 440EPx board derived from the sequoia configuration.
I am using an FPU-enabled gcc cross compiler.
U-Boot runs fine and successfully boots my operating system (Linux and uClibc-based root filesystem).
However, I was having a problem running busybox that I traced to errors occurring executing setjmp, which attempts to save floating point registers.
Then I realized that the FPU was not enabled in the MSR or in the ccr0 register.
Have I misconfigured something, or should I go ahead and add code to u-boot to enable the FPU?
Thanks,
Gregg
Quoted 11 lines · gnemas at gmail.com
I built u-boot for a 440EPx board derived from the sequoia configuration.
I am using an FPU-enabled gcc cross compiler.
U-Boot runs fine and successfully boots my operating system (Linux and uClibc-based root filesystem).
However, I was having a problem running busybox that I traced to errors occurring executing setjmp, which attempts to save floating point registers.
Quoted 5 lines
Then I realized that the FPU was not enabled in the MSR or in the ccr0 register.
Have I misconfigured something, or should I go ahead and add code to u-boot to enable the FPU?
It is generally the responsibility of the kernel to enable the FPU for tasks which require it, allowing lazy save/restore of the FPU state on context switching. Enabling the FPU in u-boot might interfere with this.
Signature · 2 lines
M?ns Rullg?rd mans at mansr.com
Dear gnemas at gmail.com,
Quoted 2 lines · In message <[email protected]> you wrote:
I built u-boot for a 440EPx board derived from the sequoia configuration.
...
Quoted 2 lines
U-Boot runs fine and successfully boots my operating system (Linux and uClibc-based root filesystem).
...
Quoted 5 lines
Then I realized that the FPU was not enabled in the MSR or in the ccr0 register.
Have I misconfigured something, or should I go ahead and add code to u-boot to enable the FPU?
U-Boot does not need nor use the FPU, so enabling it would not help you in any way.
Linux will do it's own settings, so this is where you need to look for your incorrect configuration settings (incorrect CPU description in the DT?).
Best regards,
Wolfgang Denk
Signature · 5 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de "Confound these ancestors.... They've stolen our best ideas!" - Ben Jonson
Quoted 2 lines · Wolfgang Denk
U-Boot does not need nor use the FPU, so enabling it would not help you in any way.
It may not need it, but enabling it in u-boot did actually fix the problem. I just called the fpu_enable function in the u-boot post code.
Quoted 3 lines
Linux will do it's own settings, so this is where you need to look for your incorrect configuration settings (incorrect CPU description in the DT?).
Okay, thanks. I'll try to find out more about how Linux sets this up.
By the way, my dts file has
cpu at 0 {device_type = "cpu";
model = "PowerPC,440EPx";
Dear gnemas at gmail.com,
Quoted 6 lines · In message <[email protected]> you wrote:
Quoted 3 lines
U-Boot does not need nor use the FPU, so enabling it would not help you in any way.
It may not need it, but enabling it in u-boot did actually fix the problem. I just called the
fpu_enablefunction in the u-boot post code.
But this is utterly wrong. Please undo this change!
Best regards,
Wolfgang Denk
Signature · 4 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de Parkinson's Law: Work expands to fill the time alloted it.
Quoted 16 lines · gnemas at gmail.com
Quoted 4 lines · On Jun 14, 2010 4:30pm, Wolfgang Denk wd at denx.de> wrote:
U-Boot does not need nor use the FPU, so enabling it would not help you in any way.
It may not need it, but enabling it in u-boot did actually fix the problem. I just called the
fpu_enablefunction in the u-boot post code.Quoted 5 lines
Linux will do it's own settings, so this is where you need to look for your incorrect configuration settings (incorrect CPU description in the DT?).
Quoted 7 lines
Okay, thanks. I'll try to find out more about how Linux sets this up.
By the way, my dts file has
cpu at 0 {
device_type= "cpu";
model = "PowerPC,440EPx";
I discovered what was causing the FPU problem. Maybe this might help someone.
I noticed that my processor was being recognized by Linux as a 440GRX (which does not have FPU) rather than the correct 440EPx. It seems that these two processors have the same PVR value. The kernel differentiates these based on the value of the CPU model in the device tree.
Even though I had the correct entries in my device tree source, the kernel was not finding the correct model entry.
The problem was that I was using the device tree compiler from
git://git.kernel.org/pub/scm/linux/kernel/git/galak/dtc.git
instead of the one included with the kernel source. When I started working on this, it did not occur to me that the dtc was included in the kernel tree, so I had searched for it online and discovered that git repository. The galak dtc reports version 1.1.0, whereas the kernel dtc reports versio 1.2.0.
So it all works correctly now.
Thanks for the DT pointer.
Gregg
Quoted 4 lines
-----Original Message-----
From: u-boot-bounces at lists.denx.de
[mailto:u-boot-bounces at lists.denx.de]
Quoted 6 lines
On Behalf Of gnemas at gmail.com
Sent: Tuesday, June 15, 2010 12:32 AM
To: u-boot at lists.denx.de
Subject: [U-Boot] Whose responsibility is it to enable FPU?I built u-boot for a 440EPx board derived from the sequoia
configuration.
Quoted 7 lines
I am using an FPU-enabled gcc cross compiler.
U-Boot runs fine and successfully boots my operating system (Linux and uClibc-based root filesystem).
However, I was having a problem running busybox that I traced to
errors
Quoted 7 lines
occurring executing setjmp, which attempts to save floating point registers.
Then I realized that the FPU was not enabled in the MSR or in the ccr0 register.
Have I misconfigured something, or should I go ahead and add code to
u-
Quoted 1 line
boot to enable the FPU?
Ideally this must be done in kernel somewhere.
Quoted 4 lines
Thanks,
Gregg