public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Hans de Goede <hdegoede@redhat.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] Cannot compile arm u-boot with hardfloat toolchain
Date: Mon, 05 Jan 2015 15:58:48 +0100	[thread overview]
Message-ID: <54AAA6A8.7010105@redhat.com> (raw)
In-Reply-To: <54AA826D.9080806@openmailbox.org>

Hi,

On 05-01-15 13:24, B.R. Oake wrote:
> On 05/01/15 10:51, Hans de Goede wrote:
>> Ah, ok, thanks for figuring that out, so this only happens to people
>> following my sunxi-wip branch, because that commit is not upstream yet.
>>
>> So I guess I will need to fix this somehow without using 64 bit math,
>> any suggestions?
>
> EDID_DETAILED_TIMING_PIXEL_CLOCK() always returns a uint32 that is
> 10,000 times a uint16, so one way of avoiding 64-bit arithmetic would
> be to cancel out the 10,000 before the division:
>
> --- a/drivers/video/videomodes.c	2015-01-05 10:18:58.745985034 +0000
> +++ b/drivers/video/videomodes.c	2015-01-05 12:15:27.484150964 +0000
> @@ -411,7 +411,8 @@
>   	mode->refresh = EDID_DETAILED_TIMING_PIXEL_CLOCK(*t) /
>   			(h_total * v_total);
>
> -	mode->pixclock = 1000000000000LL / EDID_DETAILED_TIMING_PIXEL_CLOCK(*t);
> +	mode->pixclock = 100000000L /
> +                         (EDID_DETAILED_TIMING_PIXEL_CLOCK(*t) / 10000);
>   	mode->pixclock_khz = (EDID_DETAILED_TIMING_PIXEL_CLOCK(*t) + 500) /
>   				1000;
>
>
> I still wonder though whether a nicer way would be for the configs to be
> refactored so that -msoft-float was not set on platforms where it wasn't
> appropriate.

Ah I did not realize that the EDID_DETAILED_TIMING_PIXEL_CLOCK did * 10000,
that indeed makes things easier, I've done this instead (somewhat cleaner) :

-   mode->pixclock = 1000000000000LL / EDID_DETAILED_TIMING_PIXEL_CLOCK(*t);
-   mode->pixclock_khz = (EDID_DETAILED_TIMING_PIXEL_CLOCK(*t) + 500) /
-                           1000;
+ mode->pixclock_khz = EDID_DETAILED_TIMING_PIXEL_CLOCK(*t) / 1000;
+ mode->pixclock = 1000000000L / mode->pixclock_khz;

I've squashed this fix into my personal tree, sunxi-wip branch, so people
building from there should not longer see those compile errors, and I'll
preserve the fix when the patches move to u-boot-sunxi/next :)

Regards,

Hans

      parent reply	other threads:[~2015-01-05 14:58 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-04 22:23 [U-Boot] Cannot compile arm u-boot with hardfloat toolchain Michal Suchanek
2015-01-05  1:28 ` Tom Rini
2015-01-05  9:46   ` Michal Suchanek
2015-01-05 10:46   ` B.R. Oake
2015-01-05 10:51     ` Hans de Goede
2015-01-05 12:08       ` Michael Trimarchi
2015-01-05 12:24       ` B.R. Oake
2015-01-05 13:37         ` Tom Rini
2015-01-05 15:30           ` B.R. Oake
2015-01-05 14:58         ` Hans de Goede [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=54AAA6A8.7010105@redhat.com \
    --to=hdegoede@redhat.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox