* [U-Boot] Whose responsibility is it to enable FPU?
@ 2010-06-14 19:02 gnemas at gmail.com
2010-06-14 20:10 ` Måns Rullgård
` (2 more replies)
0 siblings, 3 replies; 7+ messages in thread
From: gnemas at gmail.com @ 2010-06-14 19:02 UTC (permalink / raw)
To: u-boot
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
^ permalink raw reply [flat|nested] 7+ messages in thread* [U-Boot] Whose responsibility is it to enable FPU?
2010-06-14 19:02 [U-Boot] Whose responsibility is it to enable FPU? gnemas at gmail.com
@ 2010-06-14 20:10 ` Måns Rullgård
2010-06-14 20:30 ` Wolfgang Denk
2010-06-18 4:17 ` Aggrwal Poonam-B10812
2 siblings, 0 replies; 7+ messages in thread
From: Måns Rullgård @ 2010-06-14 20:10 UTC (permalink / raw)
To: u-boot
gnemas at 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.
--
M?ns Rullg?rd
mans at mansr.com
^ permalink raw reply [flat|nested] 7+ messages in thread
* [U-Boot] Whose responsibility is it to enable FPU?
2010-06-14 19:02 [U-Boot] Whose responsibility is it to enable FPU? gnemas at gmail.com
2010-06-14 20:10 ` Måns Rullgård
@ 2010-06-14 20:30 ` Wolfgang Denk
2010-06-14 21:08 ` gnemas at gmail.com
2010-06-18 4:17 ` Aggrwal Poonam-B10812
2 siblings, 1 reply; 7+ messages in thread
From: Wolfgang Denk @ 2010-06-14 20:30 UTC (permalink / raw)
To: u-boot
Dear gnemas at 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
--
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
^ permalink raw reply [flat|nested] 7+ messages in thread
* [U-Boot] Whose responsibility is it to enable FPU?
2010-06-14 20:30 ` Wolfgang Denk
@ 2010-06-14 21:08 ` gnemas at gmail.com
2010-06-14 21:23 ` Wolfgang Denk
2010-06-15 18:12 ` gnemas at gmail.com
0 siblings, 2 replies; 7+ messages in thread
From: gnemas at gmail.com @ 2010-06-14 21:08 UTC (permalink / raw)
To: u-boot
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 at 0 {
device_type = "cpu";
model = "PowerPC,440EPx";
^ permalink raw reply [flat|nested] 7+ messages in thread* [U-Boot] Whose responsibility is it to enable FPU?
2010-06-14 21:08 ` gnemas at gmail.com
@ 2010-06-14 21:23 ` Wolfgang Denk
2010-06-15 18:12 ` gnemas at gmail.com
1 sibling, 0 replies; 7+ messages in thread
From: Wolfgang Denk @ 2010-06-14 21:23 UTC (permalink / raw)
To: u-boot
Dear gnemas at 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
--
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.
^ permalink raw reply [flat|nested] 7+ messages in thread
* [U-Boot] Whose responsibility is it to enable FPU?
2010-06-14 21:08 ` gnemas at gmail.com
2010-06-14 21:23 ` Wolfgang Denk
@ 2010-06-15 18:12 ` gnemas at gmail.com
1 sibling, 0 replies; 7+ messages in thread
From: gnemas at gmail.com @ 2010-06-15 18:12 UTC (permalink / raw)
To: u-boot
On Jun 14, 2010 5:08pm, gnemas at gmail.com wrote:
> 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_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 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
^ permalink raw reply [flat|nested] 7+ messages in thread
* [U-Boot] Whose responsibility is it to enable FPU?
2010-06-14 19:02 [U-Boot] Whose responsibility is it to enable FPU? gnemas at gmail.com
2010-06-14 20:10 ` Måns Rullgård
2010-06-14 20:30 ` Wolfgang Denk
@ 2010-06-18 4:17 ` Aggrwal Poonam-B10812
2 siblings, 0 replies; 7+ messages in thread
From: Aggrwal Poonam-B10812 @ 2010-06-18 4:17 UTC (permalink / raw)
To: u-boot
> -----Original Message-----
> From: u-boot-bounces at lists.denx.de
[mailto:u-boot-bounces at lists.denx.de]
> 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.
>
> 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
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2010-06-18 4:17 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-06-14 19:02 [U-Boot] Whose responsibility is it to enable FPU? gnemas at gmail.com
2010-06-14 20:10 ` Måns Rullgård
2010-06-14 20:30 ` Wolfgang Denk
2010-06-14 21:08 ` gnemas at gmail.com
2010-06-14 21:23 ` Wolfgang Denk
2010-06-15 18:12 ` gnemas at gmail.com
2010-06-18 4:17 ` Aggrwal Poonam-B10812
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox