From: York Sun <yorksun@freescale.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v2] common: Fix load and entry addresses in FIT image
Date: Fri, 4 Sep 2015 09:33:35 -0500 [thread overview]
Message-ID: <55E9ABBF.6000605@freescale.com> (raw)
In-Reply-To: <CAPnjgZ3zYSPK_CpC_vwZDBaGeJYMf9xPWAZ-x+9VECeNoSauKQ@mail.gmail.com>
On 09/04/2015 09:12 AM, Simon Glass wrote:
> Hi York,
>
> On 4 September 2015 at 07:59, York Sun <yorksun@freescale.com> wrote:
>>
>>
>> On 09/03/2015 10:55 PM, Simon Glass wrote:
<snip>
>>> Yes of course %pa does not work on the host - I didn't think of that.
>>>
>>> I'm still not thrilled with everything being promoted to 64-bit. Do
>>> you think using a #define in inttypes.h or similar might work, similar
>>> to how LBAF works in ide.h?
>>>
>>> #if BITS_PER_LONG == 64
>>> #define PRIpa "%08l"
>>> #else
>>> #define PRIpa "%08l"
>>> #endif
>>>
>>> The odd thing is that they are both the same for ARM (unsigned long).
>>> What arch are you using?
>>
>> This one works for me
>>
>> #if BITS_PER_LONG == 64
>> #define PRIpa "lx"
>> #else
>> #define PRIpa "llx"
>> #endif
>>
>> The trick here is host tool. I was testing on armv8.
>
> I'm hoping that we can use a 32-bit parameter for 32-bit machines and
> 64-bit for 64-bit machines (and host).
>
I see what you mean. We can use 32-bit parameters for 32-bit targets, and 64-bit
for 64-bit targets. "%08lx" takes care of that. However, the host may have
32-bit or 64-bit, which has nothing to do with the "#address-cell" or load/entry
address in the image. mkimage should be able to deal with them all the time.
That's why I use "unsigned long long" for the host.
I think this works
#ifdef USE_HOSTCC
#define PRIpa "%08llx"
#else
#define PRIpa "%08lx"
#endif
York
next prev parent reply other threads:[~2015-09-04 14:33 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-03 15:07 [U-Boot] [PATCH v2] common: Fix load and entry addresses in FIT image York Sun
2015-09-04 3:55 ` Simon Glass
2015-09-04 13:59 ` York Sun
2015-09-04 14:12 ` Simon Glass
2015-09-04 14:33 ` York Sun [this message]
2015-09-04 14:35 ` Simon Glass
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=55E9ABBF.6000605@freescale.com \
--to=yorksun@freescale.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.