* [U-Boot] u-boot FIT image support
@ 2015-08-07 20:48 York Sun
2015-08-07 22:47 ` Simon Glass
0 siblings, 1 reply; 5+ messages in thread
From: York Sun @ 2015-08-07 20:48 UTC (permalink / raw)
To: u-boot
Simon,
I was doing an experiment to put the load address and entry address of Linux to
higher than 32-bit address. I found it is broken to process more than 32-bit
addresses. When I attempted to fix it, I was troubled by those code used for
both host and target, like common/image-fit.c. For example, to process 64-bit
address, the function
int fit_image_get_load(const void *fit, int noffset, ulong *load)
should be converted to
int fit_image_get_load(const void *fit, int noffset, uint64_t *load)
ulong is 64-bit for 64-bit target such as ARMv8, but it can be 32-bit on host.
If I use uint64_t, all related code in bootm and others need to change. Before I
go too far, I'd like to check if anyone has tried to enable this in FIT image.
#address-cells = <2>;
I can try to use uint64_t in place of ulong for all related code if that's
right. That will be a lot of change.
York
^ permalink raw reply [flat|nested] 5+ messages in thread
* [U-Boot] u-boot FIT image support
2015-08-07 20:48 [U-Boot] u-boot FIT image support York Sun
@ 2015-08-07 22:47 ` Simon Glass
2015-08-07 23:12 ` York Sun
0 siblings, 1 reply; 5+ messages in thread
From: Simon Glass @ 2015-08-07 22:47 UTC (permalink / raw)
To: u-boot
Hi York,
On 7 August 2015 at 14:48, York Sun <yorksun@freescale.com> wrote:
>
> Simon,
>
> I was doing an experiment to put the load address and entry address of Linux to
> higher than 32-bit address. I found it is broken to process more than 32-bit
> addresses. When I attempted to fix it, I was troubled by those code used for
> both host and target, like common/image-fit.c. For example, to process 64-bit
> address, the function
>
> int fit_image_get_load(const void *fit, int noffset, ulong *load)
>
> should be converted to
>
> int fit_image_get_load(const void *fit, int noffset, uint64_t *load)
>
> ulong is 64-bit for 64-bit target such as ARMv8, but it can be 32-bit on host.
> If I use uint64_t, all related code in bootm and others need to change. Before I
> go too far, I'd like to check if anyone has tried to enable this in FIT image.
>
> #address-cells = <2>;
>
> I can try to use uint64_t in place of ulong for all related code if that's
> right. That will be a lot of change.
Perhaps I misunderstand something, but I think ulong should be OK on
the host. I just needs to hold a machine address. On a 32-bit host
this cannot be 64-bit. Can you explain the problem a bit more?
I have not need #address-cells in a FIT.
It would be better to use ulong for addresses in U-Boot I think. It is
safe and efficient on both 32- and 64-bit machines.
Regards,
Simon
^ permalink raw reply [flat|nested] 5+ messages in thread
* [U-Boot] u-boot FIT image support
2015-08-07 22:47 ` Simon Glass
@ 2015-08-07 23:12 ` York Sun
2015-08-10 18:40 ` Simon Glass
0 siblings, 1 reply; 5+ messages in thread
From: York Sun @ 2015-08-07 23:12 UTC (permalink / raw)
To: u-boot
On 08/07/2015 03:47 PM, Simon Glass wrote:
> Hi York,
>
> On 7 August 2015 at 14:48, York Sun <yorksun@freescale.com> wrote:
>>
>> Simon,
>>
>> I was doing an experiment to put the load address and entry address of Linux to
>> higher than 32-bit address. I found it is broken to process more than 32-bit
>> addresses. When I attempted to fix it, I was troubled by those code used for
>> both host and target, like common/image-fit.c. For example, to process 64-bit
>> address, the function
>>
>> int fit_image_get_load(const void *fit, int noffset, ulong *load)
>>
>> should be converted to
>>
>> int fit_image_get_load(const void *fit, int noffset, uint64_t *load)
>>
>> ulong is 64-bit for 64-bit target such as ARMv8, but it can be 32-bit on host.
>> If I use uint64_t, all related code in bootm and others need to change. Before I
>> go too far, I'd like to check if anyone has tried to enable this in FIT image.
>>
>> #address-cells = <2>;
>>
>> I can try to use uint64_t in place of ulong for all related code if that's
>> right. That will be a lot of change.
>
> Perhaps I misunderstand something, but I think ulong should be OK on
> the host. I just needs to hold a machine address. On a 32-bit host
> this cannot be 64-bit. Can you explain the problem a bit more?
>
> I have not need #address-cells in a FIT.
>
> It would be better to use ulong for addresses in U-Boot I think. It is
> safe and efficient on both 32- and 64-bit machines.
>
Simon,
Considering this situation, building FIT image on an ubuntu 12.04 32-bit host,
for ARMv8 target. I believe ulong is OK on 64-bit target. But it is not for the
host mkimage. To proper deal with address cell = 2, the function
fit_image_get_load() and fit_image_get_entry() need to make 64-bit address from
FIT image. mkimage runs on 32-bit host doesn't take ulong as 64-bit, does it? So
I can generate a FIT image with the address cell and load/entry address I need,
but I cannot display it correctly with mkimage. I think I can use the image on
64-bit target after fixing some parsing code as I mentioned.
The background for this experiment is I am trying to shift DDR to a continuous
space. For ARMv8, DDR can have three regions, with only 2GB under 32-bit address
space.
York
^ permalink raw reply [flat|nested] 5+ messages in thread
* [U-Boot] u-boot FIT image support
2015-08-07 23:12 ` York Sun
@ 2015-08-10 18:40 ` Simon Glass
2015-08-10 19:14 ` York Sun
0 siblings, 1 reply; 5+ messages in thread
From: Simon Glass @ 2015-08-10 18:40 UTC (permalink / raw)
To: u-boot
Hi York,
On 7 August 2015 at 17:12, York Sun <yorksun@freescale.com> wrote:
>
>
> On 08/07/2015 03:47 PM, Simon Glass wrote:
>> Hi York,
>>
>> On 7 August 2015 at 14:48, York Sun <yorksun@freescale.com> wrote:
>>>
>>> Simon,
>>>
>>> I was doing an experiment to put the load address and entry address of Linux to
>>> higher than 32-bit address. I found it is broken to process more than 32-bit
>>> addresses. When I attempted to fix it, I was troubled by those code used for
>>> both host and target, like common/image-fit.c. For example, to process 64-bit
>>> address, the function
>>>
>>> int fit_image_get_load(const void *fit, int noffset, ulong *load)
>>>
>>> should be converted to
>>>
>>> int fit_image_get_load(const void *fit, int noffset, uint64_t *load)
>>>
>>> ulong is 64-bit for 64-bit target such as ARMv8, but it can be 32-bit on host.
>>> If I use uint64_t, all related code in bootm and others need to change. Before I
>>> go too far, I'd like to check if anyone has tried to enable this in FIT image.
>>>
>>> #address-cells = <2>;
>>>
>>> I can try to use uint64_t in place of ulong for all related code if that's
>>> right. That will be a lot of change.
>>
>> Perhaps I misunderstand something, but I think ulong should be OK on
>> the host. I just needs to hold a machine address. On a 32-bit host
>> this cannot be 64-bit. Can you explain the problem a bit more?
>>
>> I have not need #address-cells in a FIT.
>>
>> It would be better to use ulong for addresses in U-Boot I think. It is
>> safe and efficient on both 32- and 64-bit machines.
>>
>
> Simon,
>
> Considering this situation, building FIT image on an ubuntu 12.04 32-bit host,
> for ARMv8 target. I believe ulong is OK on 64-bit target. But it is not for the
> host mkimage. To proper deal with address cell = 2, the function
> fit_image_get_load() and fit_image_get_entry() need to make 64-bit address from
> FIT image. mkimage runs on 32-bit host doesn't take ulong as 64-bit, does it? So
> I can generate a FIT image with the address cell and load/entry address I need,
> but I cannot display it correctly with mkimage. I think I can use the image on
> 64-bit target after fixing some parsing code as I mentioned.
>
> The background for this experiment is I am trying to shift DDR to a continuous
> space. For ARMv8, DDR can have three regions, with only 2GB under 32-bit address
> space.
We really don't want to end up with everything being 64-bit just
because the tools need to work correctly. I wonder if phys_addr_t
might help here? We could define that to be 64-bit for the host,
perhaps?
Regards,
Simon
^ permalink raw reply [flat|nested] 5+ messages in thread
* [U-Boot] u-boot FIT image support
2015-08-10 18:40 ` Simon Glass
@ 2015-08-10 19:14 ` York Sun
0 siblings, 0 replies; 5+ messages in thread
From: York Sun @ 2015-08-10 19:14 UTC (permalink / raw)
To: u-boot
On 08/10/2015 11:40 AM, Simon Glass wrote:
> Hi York,
>
> On 7 August 2015 at 17:12, York Sun <yorksun@freescale.com> wrote:
>>
>>
>> On 08/07/2015 03:47 PM, Simon Glass wrote:
>>> Hi York,
>>>
>>> On 7 August 2015 at 14:48, York Sun <yorksun@freescale.com> wrote:
>>>>
>>>> Simon,
>>>>
>>>> I was doing an experiment to put the load address and entry address of Linux to
>>>> higher than 32-bit address. I found it is broken to process more than 32-bit
>>>> addresses. When I attempted to fix it, I was troubled by those code used for
>>>> both host and target, like common/image-fit.c. For example, to process 64-bit
>>>> address, the function
>>>>
>>>> int fit_image_get_load(const void *fit, int noffset, ulong *load)
>>>>
>>>> should be converted to
>>>>
>>>> int fit_image_get_load(const void *fit, int noffset, uint64_t *load)
>>>>
>>>> ulong is 64-bit for 64-bit target such as ARMv8, but it can be 32-bit on host.
>>>> If I use uint64_t, all related code in bootm and others need to change. Before I
>>>> go too far, I'd like to check if anyone has tried to enable this in FIT image.
>>>>
>>>> #address-cells = <2>;
>>>>
>>>> I can try to use uint64_t in place of ulong for all related code if that's
>>>> right. That will be a lot of change.
>>>
>>> Perhaps I misunderstand something, but I think ulong should be OK on
>>> the host. I just needs to hold a machine address. On a 32-bit host
>>> this cannot be 64-bit. Can you explain the problem a bit more?
>>>
>>> I have not need #address-cells in a FIT.
>>>
>>> It would be better to use ulong for addresses in U-Boot I think. It is
>>> safe and efficient on both 32- and 64-bit machines.
>>>
>>
>> Simon,
>>
>> Considering this situation, building FIT image on an ubuntu 12.04 32-bit host,
>> for ARMv8 target. I believe ulong is OK on 64-bit target. But it is not for the
>> host mkimage. To proper deal with address cell = 2, the function
>> fit_image_get_load() and fit_image_get_entry() need to make 64-bit address from
>> FIT image. mkimage runs on 32-bit host doesn't take ulong as 64-bit, does it? So
>> I can generate a FIT image with the address cell and load/entry address I need,
>> but I cannot display it correctly with mkimage. I think I can use the image on
>> 64-bit target after fixing some parsing code as I mentioned.
>>
>> The background for this experiment is I am trying to shift DDR to a continuous
>> space. For ARMv8, DDR can have three regions, with only 2GB under 32-bit address
>> space.
>
> We really don't want to end up with everything being 64-bit just
> because the tools need to work correctly. I wonder if phys_addr_t
> might help here? We could define that to be 64-bit for the host,
> perhaps?
I see. Let me try more.
York
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2015-08-10 19:14 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-08-07 20:48 [U-Boot] u-boot FIT image support York Sun
2015-08-07 22:47 ` Simon Glass
2015-08-07 23:12 ` York Sun
2015-08-10 18:40 ` Simon Glass
2015-08-10 19:14 ` York Sun
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox