[U-Boot] 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

gnemas@gmail.com writes:
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?
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.

Dear gnemas@gmail.com,
In message 0016e6480e82187a72048902213a@google.com you wrote:
I built u-boot for a 440EPx board derived from the sequoia configuration.
...
U-Boot runs fine and successfully boots my operating system (Linux and uClibc-based root filesystem).
...
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

On Jun 14, 2010 4:30pm, Wolfgang Denk wd@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_enable function in the u-boot post code.
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@0 { device_type = "cpu"; model = "PowerPC,440EPx";

Dear gnemas@gmail.com,
In message 0016e646536657d603048903e5b2@google.com you 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_enable function in the u-boot post code.
But this is utterly wrong. Please undo this change!
Best regards,
Wolfgang Denk

On Jun 14, 2010 5:08pm, gnemas@gmail.com wrote:
On Jun 14, 2010 4:30pm, Wolfgang Denk wd@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_enable function in the u-boot post code.
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@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

-----Original Message----- From: u-boot-bounces@lists.denx.de
[mailto:u-boot-bounces@lists.denx.de]
On Behalf Of gnemas@gmail.com Sent: Tuesday, June 15, 2010 12:32 AM To: u-boot@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.
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?
Ideally this must be done in kernel somewhere.
Thanks,
Gregg
participants (4)
-
Aggrwal Poonam-B10812
-
gnemas@gmail.com
-
Måns Rullgård
-
Wolfgang Denk