Re: [U-Boot] [PATCH] spl: fix entry_point equal to load_addr

2020-01-16 Thread Tom Rini
On Thu, Jan 16, 2020 at 03:46:15PM +0100, Giulio Benetti wrote:
> Hi Tom,
> 
> +Stefano B.
> 
> On 1/16/20 3:40 PM, Tom Rini wrote:
> > On Mon, Nov 25, 2019 at 05:18:20PM +0100, Giulio Benetti wrote:
> > 
> > > At the moment entry_point is set to image_get_load(header) that sets it
> > > to "load address" instead of "entry point", assuming entry_point is
> > > equal to load_addr, but it's not true. Then load_addr is set to
> > > "entry_point - header_size", but this is wrong too since load_addr is
> > > not an entry point.
> > > 
> > > So use image_get_ep() for entry_point assignment and image_get_load()
> > > for load_addr assignment.
> > > 
> > > Signed-off-by: Giulio Benetti 
> > 
> > Applied to u-boot/master, thanks!
> 
> It's been already committed by Stefano Babic in imx and you've pulled from
> him.
> 
> Sorry that I've submitted it twice!

Ah, I missed git saying there was nothing to do while applying that part
of the mbox.  No worries.

-- 
Tom


signature.asc
Description: PGP signature


Re: [U-Boot] [PATCH] spl: fix entry_point equal to load_addr

2020-01-16 Thread Giulio Benetti

Hi Tom,

+Stefano B.

On 1/16/20 3:40 PM, Tom Rini wrote:

On Mon, Nov 25, 2019 at 05:18:20PM +0100, Giulio Benetti wrote:


At the moment entry_point is set to image_get_load(header) that sets it
to "load address" instead of "entry point", assuming entry_point is
equal to load_addr, but it's not true. Then load_addr is set to
"entry_point - header_size", but this is wrong too since load_addr is
not an entry point.

So use image_get_ep() for entry_point assignment and image_get_load()
for load_addr assignment.

Signed-off-by: Giulio Benetti 


Applied to u-boot/master, thanks!


It's been already committed by Stefano Babic in imx and you've pulled 
from him.


Sorry that I've submitted it twice!

Best regards
--
Giulio Benetti
Benetti Engineering sas


Re: [U-Boot] [PATCH] spl: fix entry_point equal to load_addr

2020-01-16 Thread Tom Rini
On Mon, Nov 25, 2019 at 05:18:20PM +0100, Giulio Benetti wrote:

> At the moment entry_point is set to image_get_load(header) that sets it
> to "load address" instead of "entry point", assuming entry_point is
> equal to load_addr, but it's not true. Then load_addr is set to
> "entry_point - header_size", but this is wrong too since load_addr is
> not an entry point.
> 
> So use image_get_ep() for entry_point assignment and image_get_load()
> for load_addr assignment.
> 
> Signed-off-by: Giulio Benetti 

Applied to u-boot/master, thanks!

-- 
Tom


signature.asc
Description: PGP signature


Re: [U-Boot] [PATCH] spl: fix entry_point equal to load_addr

2020-01-10 Thread Tom Rini
On Fri, Jan 10, 2020 at 03:57:47PM +0100, Giulio Benetti wrote:
> Hi All,
> 
> On 12/7/19 10:28 PM, Simon Goldschmidt wrote:
> > Hi Tom,
> > 
> > On Fri, Dec 6, 2019 at 3:55 PM Tom Rini  wrote:
> > > 
> > > On Fri, Dec 06, 2019 at 03:05:55PM +0100, Simon Goldschmidt wrote:
> > > > On Fri, Dec 6, 2019 at 2:49 PM Giulio Benetti
> > > >  wrote:
> > > > > 
> > > > > Hello Tom, all,
> > > > > 
> > > > > On 12/6/19 2:34 PM, Tom Rini wrote:
> > > > > > On Fri, Dec 06, 2019 at 01:58:46PM +0100, Simon Goldschmidt wrote:
> > > > > > > On Fri, Dec 6, 2019 at 1:46 PM Patrice CHOTARD 
> > > > > > >  wrote:
> > > > > > > > 
> > > > > > > > Hi
> > > > > > > > 
> > > > > > > > This patch is breaking the STM32MP15 basic boot (spl => u-boot).
> > > > > > > 
> > > > > > > Looking at socfpga gen5 u-boot.img, this is probably broken as 
> > > > > > > well.
> > > > > > > 
> > > > > > > And I don't even see any RB or TB tags here :-(
> > > > > > 
> > > > > > Ugh, what the heck?  I applied this because I looked over the 
> > > > > > changes
> > > > > > and they seemed correct.  I'm quite willing to just revert this but 
> > > > > > I
> > > > > > would like to know how it's breaking.  Sorry all!
> > > > > > 
> > > > > 
> > > > > IMHO this is due to wrong images creation with mkinage, especially 
> > > > > when
> > > > > passing parameters with -a and -e flags.
> > > > > 
> > > > > In my case I need them to be:
> > > > > -a 0x80002000 (load address) => CONFIG_SYS_TEXT_BASE
> > > > > -e 0x800023FD (entry point where SPL jumps to) => 
> > > > > CONFIG_SYS_UBOOT_START
> > > > 
> > > > Well, CONFIG_SYS_UBOOT_START is only set in 15 files in 
> > > > include/configs, so I
> > > > guess a lot more boards might be broken...
> > > > 
> > > > > 
> > > > > So *maybe* on STM32MP1 and other broken boards -e
> > > > > (CONFIG_SYS_UBOOT_START) is not equal to -a (CONFIG_SYS_TEXT_BASE) as
> > > > > was assumed before(but wrong).
> > > > > 
> > > > > Indeed CONFIG_SYS_UBOOT_START is set to 0 if not specified in
> > > > > u-boot/Makefile:
> > > > > `
> > > > > # U-Boot entry point, needed for booting of full-blown U-Boot
> > > > > # from the SPL U-Boot version.
> > > > > #
> > > > > ifndef CONFIG_SYS_UBOOT_START
> > > > > CONFIG_SYS_UBOOT_START := 0
> > > > > endif
> > > > > `
> > > > > 
> > > > > So probably broken boards try to jump to absolute 0.
> > > > > A solving patch would be:
> > > > > ifndef CONFIG_SYS_UBOOT_START
> > > > > CONFIG_SYS_UBOOT_START := CONFIG_SYS_TEXT_BASE
> > > > > endif
> > > > 
> > > > That might work, but I wonder if this is the correct time in the 
> > > > release to do
> > > > so.
> > > 
> > > Yes, at this point in the cycle the best option is to revert the
> > > original commit and for the next release bring it back after applying
> > > Patrice's series to fix the bogus default to CONFIG_SYS_UBOOT_START and
> > > cleaning up defconfigs.  Sorry again for all the troubles!
> > 
> > I just wanted to confirm socfpga_gen5 doesn't boot with this patch
> > but it's ok again now you reverted it.
> 
> Now that patches:
> https://patchwork.ozlabs.org/patch/1205064/
> https://patchwork.ozlabs.org/patch/1205063/
> 
> and 2020.01 has been released, can you please commit this patch?
> 
> I've re-submitted also on patchset to Add i.MXRT family since it's needed to
> boot Linux:
> https://patchwork.ozlabs.org/project/uboot/list/?series=152468

Yes, this is on my list of things to get back to as I clear out parts of
my queue, thanks for the reminder.

-- 
Tom


signature.asc
Description: PGP signature


Re: [U-Boot] [PATCH] spl: fix entry_point equal to load_addr

2020-01-10 Thread Giulio Benetti

Hi All,

On 12/7/19 10:28 PM, Simon Goldschmidt wrote:

Hi Tom,

On Fri, Dec 6, 2019 at 3:55 PM Tom Rini  wrote:


On Fri, Dec 06, 2019 at 03:05:55PM +0100, Simon Goldschmidt wrote:

On Fri, Dec 6, 2019 at 2:49 PM Giulio Benetti
 wrote:


Hello Tom, all,

On 12/6/19 2:34 PM, Tom Rini wrote:

On Fri, Dec 06, 2019 at 01:58:46PM +0100, Simon Goldschmidt wrote:

On Fri, Dec 6, 2019 at 1:46 PM Patrice CHOTARD  wrote:


Hi

This patch is breaking the STM32MP15 basic boot (spl => u-boot).


Looking at socfpga gen5 u-boot.img, this is probably broken as well.

And I don't even see any RB or TB tags here :-(


Ugh, what the heck?  I applied this because I looked over the changes
and they seemed correct.  I'm quite willing to just revert this but I
would like to know how it's breaking.  Sorry all!



IMHO this is due to wrong images creation with mkinage, especially when
passing parameters with -a and -e flags.

In my case I need them to be:
-a 0x80002000 (load address) => CONFIG_SYS_TEXT_BASE
-e 0x800023FD (entry point where SPL jumps to) => CONFIG_SYS_UBOOT_START


Well, CONFIG_SYS_UBOOT_START is only set in 15 files in include/configs, so I
guess a lot more boards might be broken...



So *maybe* on STM32MP1 and other broken boards -e
(CONFIG_SYS_UBOOT_START) is not equal to -a (CONFIG_SYS_TEXT_BASE) as
was assumed before(but wrong).

Indeed CONFIG_SYS_UBOOT_START is set to 0 if not specified in
u-boot/Makefile:
`
# U-Boot entry point, needed for booting of full-blown U-Boot
# from the SPL U-Boot version.
#
ifndef CONFIG_SYS_UBOOT_START
CONFIG_SYS_UBOOT_START := 0
endif
`

So probably broken boards try to jump to absolute 0.
A solving patch would be:
ifndef CONFIG_SYS_UBOOT_START
CONFIG_SYS_UBOOT_START := CONFIG_SYS_TEXT_BASE
endif


That might work, but I wonder if this is the correct time in the release to do
so.


Yes, at this point in the cycle the best option is to revert the
original commit and for the next release bring it back after applying
Patrice's series to fix the bogus default to CONFIG_SYS_UBOOT_START and
cleaning up defconfigs.  Sorry again for all the troubles!


I just wanted to confirm socfpga_gen5 doesn't boot with this patch
but it's ok again now you reverted it.


Now that patches:
https://patchwork.ozlabs.org/patch/1205064/
https://patchwork.ozlabs.org/patch/1205063/

and 2020.01 has been released, can you please commit this patch?

I've re-submitted also on patchset to Add i.MXRT family since it's 
needed to boot Linux:

https://patchwork.ozlabs.org/project/uboot/list/?series=152468

Kind regards
--
Giulio Benetti
Benetti Engineering sas


Re: [U-Boot] [PATCH] spl: fix entry_point equal to load_addr

2019-12-07 Thread Simon Goldschmidt
Hi Tom,

On Fri, Dec 6, 2019 at 3:55 PM Tom Rini  wrote:
>
> On Fri, Dec 06, 2019 at 03:05:55PM +0100, Simon Goldschmidt wrote:
> > On Fri, Dec 6, 2019 at 2:49 PM Giulio Benetti
> >  wrote:
> > >
> > > Hello Tom, all,
> > >
> > > On 12/6/19 2:34 PM, Tom Rini wrote:
> > > > On Fri, Dec 06, 2019 at 01:58:46PM +0100, Simon Goldschmidt wrote:
> > > >> On Fri, Dec 6, 2019 at 1:46 PM Patrice CHOTARD 
> > > >>  wrote:
> > > >>>
> > > >>> Hi
> > > >>>
> > > >>> This patch is breaking the STM32MP15 basic boot (spl => u-boot).
> > > >>
> > > >> Looking at socfpga gen5 u-boot.img, this is probably broken as well.
> > > >>
> > > >> And I don't even see any RB or TB tags here :-(
> > > >
> > > > Ugh, what the heck?  I applied this because I looked over the changes
> > > > and they seemed correct.  I'm quite willing to just revert this but I
> > > > would like to know how it's breaking.  Sorry all!
> > > >
> > >
> > > IMHO this is due to wrong images creation with mkinage, especially when
> > > passing parameters with -a and -e flags.
> > >
> > > In my case I need them to be:
> > > -a 0x80002000 (load address) => CONFIG_SYS_TEXT_BASE
> > > -e 0x800023FD (entry point where SPL jumps to) => CONFIG_SYS_UBOOT_START
> >
> > Well, CONFIG_SYS_UBOOT_START is only set in 15 files in include/configs, so 
> > I
> > guess a lot more boards might be broken...
> >
> > >
> > > So *maybe* on STM32MP1 and other broken boards -e
> > > (CONFIG_SYS_UBOOT_START) is not equal to -a (CONFIG_SYS_TEXT_BASE) as
> > > was assumed before(but wrong).
> > >
> > > Indeed CONFIG_SYS_UBOOT_START is set to 0 if not specified in
> > > u-boot/Makefile:
> > > `
> > > # U-Boot entry point, needed for booting of full-blown U-Boot
> > > # from the SPL U-Boot version.
> > > #
> > > ifndef CONFIG_SYS_UBOOT_START
> > > CONFIG_SYS_UBOOT_START := 0
> > > endif
> > > `
> > >
> > > So probably broken boards try to jump to absolute 0.
> > > A solving patch would be:
> > > ifndef CONFIG_SYS_UBOOT_START
> > > CONFIG_SYS_UBOOT_START := CONFIG_SYS_TEXT_BASE
> > > endif
> >
> > That might work, but I wonder if this is the correct time in the release to 
> > do
> > so.
>
> Yes, at this point in the cycle the best option is to revert the
> original commit and for the next release bring it back after applying
> Patrice's series to fix the bogus default to CONFIG_SYS_UBOOT_START and
> cleaning up defconfigs.  Sorry again for all the troubles!

I just wanted to confirm socfpga_gen5 doesn't boot with this patch
but it's ok again now you reverted it.

Regards,
Simon


Re: [U-Boot] [PATCH] spl: fix entry_point equal to load_addr

2019-12-06 Thread Giulio Benetti

Hi Patrice,

On 12/6/19 3:04 PM, Patrice CHOTARD wrote:

So probably broken boards try to jump to absolute 0.
A solving patch would be:
ifndef CONFIG_SYS_UBOOT_START
CONFIG_SYS_UBOOT_START := CONFIG_SYS_TEXT_BASE
endif

What do you think?


This is what i implemented to fix this issue. Here is my proposal [1], but i 
need some


Yes, I've missed it for few minutes.
Thanks for solving this.

Best regards
--
Giulio Benetti
Benetti Engineering sas


feedback from some boards maintainers.

[1] https://patchwork.ozlabs.org/project/uboot/list/?series=146876

Thanks

Patrice



Sorry for this mess!

Best regards




Re: [U-Boot] [PATCH] spl: fix entry_point equal to load_addr

2019-12-06 Thread Tom Rini
On Fri, Dec 06, 2019 at 03:05:55PM +0100, Simon Goldschmidt wrote:
> On Fri, Dec 6, 2019 at 2:49 PM Giulio Benetti
>  wrote:
> >
> > Hello Tom, all,
> >
> > On 12/6/19 2:34 PM, Tom Rini wrote:
> > > On Fri, Dec 06, 2019 at 01:58:46PM +0100, Simon Goldschmidt wrote:
> > >> On Fri, Dec 6, 2019 at 1:46 PM Patrice CHOTARD  
> > >> wrote:
> > >>>
> > >>> Hi
> > >>>
> > >>> This patch is breaking the STM32MP15 basic boot (spl => u-boot).
> > >>
> > >> Looking at socfpga gen5 u-boot.img, this is probably broken as well.
> > >>
> > >> And I don't even see any RB or TB tags here :-(
> > >
> > > Ugh, what the heck?  I applied this because I looked over the changes
> > > and they seemed correct.  I'm quite willing to just revert this but I
> > > would like to know how it's breaking.  Sorry all!
> > >
> >
> > IMHO this is due to wrong images creation with mkinage, especially when
> > passing parameters with -a and -e flags.
> >
> > In my case I need them to be:
> > -a 0x80002000 (load address) => CONFIG_SYS_TEXT_BASE
> > -e 0x800023FD (entry point where SPL jumps to) => CONFIG_SYS_UBOOT_START
> 
> Well, CONFIG_SYS_UBOOT_START is only set in 15 files in include/configs, so I
> guess a lot more boards might be broken...
> 
> >
> > So *maybe* on STM32MP1 and other broken boards -e
> > (CONFIG_SYS_UBOOT_START) is not equal to -a (CONFIG_SYS_TEXT_BASE) as
> > was assumed before(but wrong).
> >
> > Indeed CONFIG_SYS_UBOOT_START is set to 0 if not specified in
> > u-boot/Makefile:
> > `
> > # U-Boot entry point, needed for booting of full-blown U-Boot
> > # from the SPL U-Boot version.
> > #
> > ifndef CONFIG_SYS_UBOOT_START
> > CONFIG_SYS_UBOOT_START := 0
> > endif
> > `
> >
> > So probably broken boards try to jump to absolute 0.
> > A solving patch would be:
> > ifndef CONFIG_SYS_UBOOT_START
> > CONFIG_SYS_UBOOT_START := CONFIG_SYS_TEXT_BASE
> > endif
> 
> That might work, but I wonder if this is the correct time in the release to do
> so.

Yes, at this point in the cycle the best option is to revert the
original commit and for the next release bring it back after applying
Patrice's series to fix the bogus default to CONFIG_SYS_UBOOT_START and
cleaning up defconfigs.  Sorry again for all the troubles!

-- 
Tom


signature.asc
Description: PGP signature


Re: [U-Boot] [PATCH] spl: fix entry_point equal to load_addr

2019-12-06 Thread Simon Goldschmidt
On Fri, Dec 6, 2019 at 2:49 PM Giulio Benetti
 wrote:
>
> Hello Tom, all,
>
> On 12/6/19 2:34 PM, Tom Rini wrote:
> > On Fri, Dec 06, 2019 at 01:58:46PM +0100, Simon Goldschmidt wrote:
> >> On Fri, Dec 6, 2019 at 1:46 PM Patrice CHOTARD  
> >> wrote:
> >>>
> >>> Hi
> >>>
> >>> This patch is breaking the STM32MP15 basic boot (spl => u-boot).
> >>
> >> Looking at socfpga gen5 u-boot.img, this is probably broken as well.
> >>
> >> And I don't even see any RB or TB tags here :-(
> >
> > Ugh, what the heck?  I applied this because I looked over the changes
> > and they seemed correct.  I'm quite willing to just revert this but I
> > would like to know how it's breaking.  Sorry all!
> >
>
> IMHO this is due to wrong images creation with mkinage, especially when
> passing parameters with -a and -e flags.
>
> In my case I need them to be:
> -a 0x80002000 (load address) => CONFIG_SYS_TEXT_BASE
> -e 0x800023FD (entry point where SPL jumps to) => CONFIG_SYS_UBOOT_START

Well, CONFIG_SYS_UBOOT_START is only set in 15 files in include/configs, so I
guess a lot more boards might be broken...

>
> So *maybe* on STM32MP1 and other broken boards -e
> (CONFIG_SYS_UBOOT_START) is not equal to -a (CONFIG_SYS_TEXT_BASE) as
> was assumed before(but wrong).
>
> Indeed CONFIG_SYS_UBOOT_START is set to 0 if not specified in
> u-boot/Makefile:
> `
> # U-Boot entry point, needed for booting of full-blown U-Boot
> # from the SPL U-Boot version.
> #
> ifndef CONFIG_SYS_UBOOT_START
> CONFIG_SYS_UBOOT_START := 0
> endif
> `
>
> So probably broken boards try to jump to absolute 0.
> A solving patch would be:
> ifndef CONFIG_SYS_UBOOT_START
> CONFIG_SYS_UBOOT_START := CONFIG_SYS_TEXT_BASE
> endif

That might work, but I wonder if this is the correct time in the release to do
so.

Regards,
Simon

>
> What do you think?
>
> Sorry for this mess!
>
> Best regards
> --
> Giulio Benetti
> Benetti Engineering sas


Re: [U-Boot] [PATCH] spl: fix entry_point equal to load_addr

2019-12-06 Thread Patrice CHOTARD
Hi All

On 12/6/19 2:48 PM, Giulio Benetti wrote:
> Hello Tom, all,
>
> On 12/6/19 2:34 PM, Tom Rini wrote:
>> On Fri, Dec 06, 2019 at 01:58:46PM +0100, Simon Goldschmidt wrote:
>>> On Fri, Dec 6, 2019 at 1:46 PM Patrice CHOTARD  
>>> wrote:

 Hi

 This patch is breaking the STM32MP15 basic boot (spl => u-boot).
>>>
>>> Looking at socfpga gen5 u-boot.img, this is probably broken as well.
>>>
>>> And I don't even see any RB or TB tags here :-(
>>
>> Ugh, what the heck?  I applied this because I looked over the changes
>> and they seemed correct.  I'm quite willing to just revert this but I
>> would like to know how it's breaking.  Sorry all!
>>
>
> IMHO this is due to wrong images creation with mkinage, especially when 
> passing parameters with -a and -e flags.
>
> In my case I need them to be:
> -a 0x80002000 (load address) => CONFIG_SYS_TEXT_BASE
> -e 0x800023FD (entry point where SPL jumps to) => CONFIG_SYS_UBOOT_START
>
> So *maybe* on STM32MP1 and other broken boards -e (CONFIG_SYS_UBOOT_START) is 
> not equal to -a (CONFIG_SYS_TEXT_BASE) as was assumed before(but wrong).
>
> Indeed CONFIG_SYS_UBOOT_START is set to 0 if not specified in u-boot/Makefile:
> `
> # U-Boot entry point, needed for booting of full-blown U-Boot
> # from the SPL U-Boot version.
> #
> ifndef CONFIG_SYS_UBOOT_START
> CONFIG_SYS_UBOOT_START := 0
> endif
> `
>
> So probably broken boards try to jump to absolute 0.
> A solving patch would be:
> ifndef CONFIG_SYS_UBOOT_START
> CONFIG_SYS_UBOOT_START := CONFIG_SYS_TEXT_BASE
> endif
>
> What do you think?

This is what i implemented to fix this issue. Here is my proposal [1], but i 
need some

feedback from some boards maintainers.

[1] https://patchwork.ozlabs.org/project/uboot/list/?series=146876

Thanks

Patrice

>
> Sorry for this mess!
>
> Best regards

Re: [U-Boot] [PATCH] spl: fix entry_point equal to load_addr

2019-12-06 Thread Giulio Benetti

Hello Tom, all,

On 12/6/19 2:34 PM, Tom Rini wrote:

On Fri, Dec 06, 2019 at 01:58:46PM +0100, Simon Goldschmidt wrote:

On Fri, Dec 6, 2019 at 1:46 PM Patrice CHOTARD  wrote:


Hi

This patch is breaking the STM32MP15 basic boot (spl => u-boot).


Looking at socfpga gen5 u-boot.img, this is probably broken as well.

And I don't even see any RB or TB tags here :-(


Ugh, what the heck?  I applied this because I looked over the changes
and they seemed correct.  I'm quite willing to just revert this but I
would like to know how it's breaking.  Sorry all!



IMHO this is due to wrong images creation with mkinage, especially when 
passing parameters with -a and -e flags.


In my case I need them to be:
-a 0x80002000 (load address) => CONFIG_SYS_TEXT_BASE
-e 0x800023FD (entry point where SPL jumps to) => CONFIG_SYS_UBOOT_START

So *maybe* on STM32MP1 and other broken boards -e 
(CONFIG_SYS_UBOOT_START) is not equal to -a (CONFIG_SYS_TEXT_BASE) as 
was assumed before(but wrong).


Indeed CONFIG_SYS_UBOOT_START is set to 0 if not specified in 
u-boot/Makefile:

`
# U-Boot entry point, needed for booting of full-blown U-Boot
# from the SPL U-Boot version.
#
ifndef CONFIG_SYS_UBOOT_START
CONFIG_SYS_UBOOT_START := 0
endif
`

So probably broken boards try to jump to absolute 0.
A solving patch would be:
ifndef CONFIG_SYS_UBOOT_START
CONFIG_SYS_UBOOT_START := CONFIG_SYS_TEXT_BASE
endif

What do you think?

Sorry for this mess!

Best regards
--
Giulio Benetti
Benetti Engineering sas


Re: [U-Boot] [PATCH] spl: fix entry_point equal to load_addr

2019-12-06 Thread Tom Rini
On Fri, Dec 06, 2019 at 02:37:52PM +0100, Simon Goldschmidt wrote:
> On Fri, Dec 6, 2019 at 2:34 PM Tom Rini  wrote:
> >
> > On Fri, Dec 06, 2019 at 01:58:46PM +0100, Simon Goldschmidt wrote:
> > > On Fri, Dec 6, 2019 at 1:46 PM Patrice CHOTARD  
> > > wrote:
> > > >
> > > > Hi
> > > >
> > > > This patch is breaking the STM32MP15 basic boot (spl => u-boot).
> > >
> > > Looking at socfpga gen5 u-boot.img, this is probably broken as well.
> > >
> > > And I don't even see any RB or TB tags here :-(
> >
> > Ugh, what the heck?  I applied this because I looked over the changes
> > and they seemed correct.  I'm quite willing to just revert this but I
> > would like to know how it's breaking.  Sorry all!
> 
> Looking at the branch a few lines up I can understand why this seemed
> like a small change. I hadn't seen this before Patrice's mail, either.
> 
> Let me test this on socfpga_socrates tomorrow, I could still be wrong since
> this is from reading the code and binary only. But entry_point should be 0
> in my u-boot.img if I'm not mistaken, and that should break it.

Maybe I just haven't had enough coffee or time to think, but that sounds
like entry_point being set wrong somewhere.  Of course, if it's being
set wrong somewhere and it's not self-contained within U-Boot to correct
it (iow external scripts/docs), we have to deal with that reality.

-- 
Tom


signature.asc
Description: PGP signature


Re: [U-Boot] [PATCH] spl: fix entry_point equal to load_addr

2019-12-06 Thread Simon Goldschmidt
On Fri, Dec 6, 2019 at 2:34 PM Tom Rini  wrote:
>
> On Fri, Dec 06, 2019 at 01:58:46PM +0100, Simon Goldschmidt wrote:
> > On Fri, Dec 6, 2019 at 1:46 PM Patrice CHOTARD  
> > wrote:
> > >
> > > Hi
> > >
> > > This patch is breaking the STM32MP15 basic boot (spl => u-boot).
> >
> > Looking at socfpga gen5 u-boot.img, this is probably broken as well.
> >
> > And I don't even see any RB or TB tags here :-(
>
> Ugh, what the heck?  I applied this because I looked over the changes
> and they seemed correct.  I'm quite willing to just revert this but I
> would like to know how it's breaking.  Sorry all!

Looking at the branch a few lines up I can understand why this seemed
like a small change. I hadn't seen this before Patrice's mail, either.

Let me test this on socfpga_socrates tomorrow, I could still be wrong since
this is from reading the code and binary only. But entry_point should be 0
in my u-boot.img if I'm not mistaken, and that should break it.

Regards,
Simon


Re: [U-Boot] [PATCH] spl: fix entry_point equal to load_addr

2019-12-06 Thread Tom Rini
On Fri, Dec 06, 2019 at 01:58:46PM +0100, Simon Goldschmidt wrote:
> On Fri, Dec 6, 2019 at 1:46 PM Patrice CHOTARD  wrote:
> >
> > Hi
> >
> > This patch is breaking the STM32MP15 basic boot (spl => u-boot).
> 
> Looking at socfpga gen5 u-boot.img, this is probably broken as well.
> 
> And I don't even see any RB or TB tags here :-(

Ugh, what the heck?  I applied this because I looked over the changes
and they seemed correct.  I'm quite willing to just revert this but I
would like to know how it's breaking.  Sorry all!

-- 
Tom


signature.asc
Description: PGP signature


Re: [U-Boot] [PATCH] spl: fix entry_point equal to load_addr

2019-12-06 Thread Simon Goldschmidt
On Fri, Dec 6, 2019 at 1:46 PM Patrice CHOTARD  wrote:
>
> Hi
>
> This patch is breaking the STM32MP15 basic boot (spl => u-boot).

Looking at socfpga gen5 u-boot.img, this is probably broken as well.

And I don't even see any RB or TB tags here :-(

Regards,
Simon

>
> I will send a fix proposal.
>
> Thanks
>
> Patrice
>
> On 12/5/19 11:09 PM, Tom Rini wrote:
> > On Mon, Nov 25, 2019 at 05:18:20PM +0100, Giulio Benetti wrote:
> >
> >> At the moment entry_point is set to image_get_load(header) that sets it
> >> to "load address" instead of "entry point", assuming entry_point is
> >> equal to load_addr, but it's not true. Then load_addr is set to
> >> "entry_point - header_size", but this is wrong too since load_addr is
> >> not an entry point.
> >>
> >> So use image_get_ep() for entry_point assignment and image_get_load()
> >> for load_addr assignment.
> >>
> >> Signed-off-by: Giulio Benetti 
> > Applied to u-boot/master, thanks!
> >


Re: [U-Boot] [PATCH] spl: fix entry_point equal to load_addr

2019-12-06 Thread Patrice CHOTARD
Hi

This patch is breaking the STM32MP15 basic boot (spl => u-boot).

I will send a fix proposal.

Thanks

Patrice

On 12/5/19 11:09 PM, Tom Rini wrote:
> On Mon, Nov 25, 2019 at 05:18:20PM +0100, Giulio Benetti wrote:
>
>> At the moment entry_point is set to image_get_load(header) that sets it
>> to "load address" instead of "entry point", assuming entry_point is
>> equal to load_addr, but it's not true. Then load_addr is set to
>> "entry_point - header_size", but this is wrong too since load_addr is
>> not an entry point.
>>
>> So use image_get_ep() for entry_point assignment and image_get_load()
>> for load_addr assignment.
>>
>> Signed-off-by: Giulio Benetti 
> Applied to u-boot/master, thanks!
>

Re: [U-Boot] [PATCH] spl: fix entry_point equal to load_addr

2019-12-05 Thread Tom Rini
On Mon, Nov 25, 2019 at 05:18:20PM +0100, Giulio Benetti wrote:

> At the moment entry_point is set to image_get_load(header) that sets it
> to "load address" instead of "entry point", assuming entry_point is
> equal to load_addr, but it's not true. Then load_addr is set to
> "entry_point - header_size", but this is wrong too since load_addr is
> not an entry point.
> 
> So use image_get_ep() for entry_point assignment and image_get_load()
> for load_addr assignment.
> 
> Signed-off-by: Giulio Benetti 

Applied to u-boot/master, thanks!

-- 
Tom


signature.asc
Description: PGP signature


[U-Boot] [PATCH] spl: fix entry_point equal to load_addr

2019-11-25 Thread Giulio Benetti
At the moment entry_point is set to image_get_load(header) that sets it
to "load address" instead of "entry point", assuming entry_point is
equal to load_addr, but it's not true. Then load_addr is set to
"entry_point - header_size", but this is wrong too since load_addr is
not an entry point.

So use image_get_ep() for entry_point assignment and image_get_load()
for load_addr assignment.

Signed-off-by: Giulio Benetti 
---
 common/spl/spl.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/common/spl/spl.c b/common/spl/spl.c
index f1ad8dc9da..cdae346753 100644
--- a/common/spl/spl.c
+++ b/common/spl/spl.c
@@ -261,9 +261,9 @@ int spl_parse_image_header(struct spl_image_info *spl_image,
spl_image->entry_point = image_get_ep(header);
spl_image->size = image_get_data_size(header);
} else {
-   spl_image->entry_point = image_get_load(header);
+   spl_image->entry_point = image_get_ep(header);
/* Load including the header */
-   spl_image->load_addr = spl_image->entry_point -
+   spl_image->load_addr = image_get_load(header) -
header_size;
spl_image->size = image_get_data_size(header) +
header_size;
-- 
2.20.1

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot