From mboxrd@z Thu Jan 1 00:00:00 1970 From: York Sun Date: Fri, 4 Sep 2015 09:33:35 -0500 Subject: [U-Boot] [PATCH v2] common: Fix load and entry addresses in FIT image In-Reply-To: References: <1441292858-11005-1-git-send-email-yorksun@freescale.com> <55E9A3A4.4010907@freescale.com> Message-ID: <55E9ABBF.6000605@freescale.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 09/04/2015 09:12 AM, Simon Glass wrote: > Hi York, > > On 4 September 2015 at 07:59, York Sun wrote: >> >> >> On 09/03/2015 10:55 PM, Simon Glass wrote: >>> 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