All of lore.kernel.org
 help / color / mirror / Atom feed
From: york sun <york.sun@nxp.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [RFC PATCH v5 1/4] common: Convert ulong to phys_addr_t for image addresses
Date: Fri, 26 Feb 2016 18:09:15 +0000	[thread overview]
Message-ID: <AM4PR0401MB17324484B5943AED53FA9A049AA70@AM4PR0401MB1732.eurprd04.prod.outlook.com> (raw)
In-Reply-To: CAPnjgZ2GXy0NMHgzp-YOh994dW-7kmV1CrfmT_L109jeTXK+hw@mail.gmail.com

On 02/26/2016 10:05 AM, Simon Glass wrote:

<snip>

>>>>>
>>>>> All these double casts look somewhat wrong to me.  Why are they
>>>>> needed?
>>>>
>>>> Dear Wolfgang,
>>>>
>>>> I can use some serious help here. What I am really trying to achieve is the last
>>>> two patches in this set. I didn't want to use replace ulong with phys_addr_t. I
>>>> am not proud with the change I proposed, but I didn't come up with a smarter
>>>> solution. My specific trouble is to build ARMv8 targets on 32-bit Ubuntu host.
>>>> Some code is shared between the target and host tool (mkimage). I started from
>>>> small changes, but it gets wider and wider when I tried to get rid of the
>>>> compiling warnings.
>>>>
>>>> York
>>>>
>>>
>>> I suggest just documenting it better with comments and in the commit
>>> message. It's mostly the same comment I made.
>>>
>>> One concern is that if you cast to uintptr_t on a 32-bit host machine,
>>> won't you end up dropping the top 32 bits?
>>>
>>
>> Simon,
>>
>> Some code is shared between targets and hosts, but not all. The ugly casting is
>> used by targets only. Maybe I should take another look at the issue and back
>> away from converting ulong to phys_addr_t totally. It is only broken on 32-bit
>> host tool and seems nobody really cares. Sandbox is also broken on 32-bit host
>> (compiling warnings), and yet no one complains. Am I the only one living in old
>> age? I can upgrade to 64-bit Ubuntu and we all can forget about this mess I
>> created. (Getting exhausted here...)
> 
> Well maybe. You could instead just print an error and quit when trying
> to use 64-bit images on a 32-bit host machine. I think that would be
> acceptable these days.
> 

Sounds good to me. Let me try to rework the patch set.

York

  reply	other threads:[~2016-02-26 18:09 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-25 22:36 [U-Boot] [RFC PATCH v5 0/4] Enable FIT image to be loaded beyond 32-bit space York Sun
2016-02-25 22:36 ` [U-Boot] [RFC PATCH v5 1/4] common: Convert ulong to phys_addr_t for image addresses York Sun
2016-02-25 23:05   ` Wolfgang Denk
2016-02-26 17:22     ` york sun
2016-02-26 17:31       ` Simon Glass
2016-02-26 17:47         ` york sun
2016-02-26 18:05           ` Simon Glass
2016-02-26 18:09             ` york sun [this message]
2016-02-25 22:36 ` [U-Boot] [RFC PATCH v5 2/4] sandbox: Fix compiling warning York Sun
2016-02-25 22:36 ` [U-Boot] [RFC PATCH v5 3/4] common: image-fit: Use a common function to get address York Sun
2016-02-25 22:36 ` [U-Boot] [RFC PATCH v5 4/4] common: image-fit: Fix load and entry addresses in FIT image York Sun

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=AM4PR0401MB17324484B5943AED53FA9A049AA70@AM4PR0401MB1732.eurprd04.prod.outlook.com \
    --to=york.sun@nxp.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.