All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH RESEND] tools/imximage: set DCD pointer to NULL when its length is 0
@ 2015-07-09 15:19 Baruch Siach
  2015-07-09 16:04 ` Stefano Babic
  0 siblings, 1 reply; 6+ messages in thread
From: Baruch Siach @ 2015-07-09 15:19 UTC (permalink / raw)
  To: u-boot

When dcd_len is 0 the Write Data command that the set_dcd_rst_v2() routine
generates is empty. This causes HAB to complain that the command is invalid.

--------- HAB Event 1 -----------------
event data:
	0xdb 0x00 0x0c 0x41 0x33 0x06 0xc0 0x00
	0xcc 0x00 0x04 0x04

To fix this set the DCD pointer in the IVT to NULL in this case. The DCD header
itself is still needed for detect_imximage_version() to determine the image
version.

Signed-off-by: Baruch Siach <baruch@tkos.co.il>
---
Resending with a proper To: header.

 tools/imximage.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/tools/imximage.c b/tools/imximage.c
index 6f469ae6336c..7b91d09699ad 100644
--- a/tools/imximage.c
+++ b/tools/imximage.c
@@ -250,7 +250,11 @@ static void set_imx_hdr_v2(struct imx_header *imxhdr, uint32_t dcd_len,
 	hdr_base = entry_point - imximage_init_loadsize +
 		flash_offset;
 	fhdr_v2->self = hdr_base;
-	fhdr_v2->dcd_ptr = hdr_base + offsetof(imx_header_v2_t, dcd_table);
+	if (dcd_len > 0)
+		fhdr_v2->dcd_ptr = hdr_base
+			+ offsetof(imx_header_v2_t, dcd_table);
+	else
+		fhdr_v2->dcd_ptr = 0;
 	fhdr_v2->boot_data_ptr = hdr_base
 			+ offsetof(imx_header_v2_t, boot_data);
 	hdr_v2->boot_data.start = entry_point - imximage_init_loadsize;
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [U-Boot] [PATCH RESEND] tools/imximage: set DCD pointer to NULL when its length is 0
  2015-07-09 15:19 [U-Boot] [PATCH RESEND] tools/imximage: set DCD pointer to NULL when its length is 0 Baruch Siach
@ 2015-07-09 16:04 ` Stefano Babic
  2015-07-14 19:05   ` Baruch Siach
  0 siblings, 1 reply; 6+ messages in thread
From: Stefano Babic @ 2015-07-09 16:04 UTC (permalink / raw)
  To: u-boot

Hi Baruch,

On 09/07/2015 17:19, Baruch Siach wrote:
> When dcd_len is 0 the Write Data command that the set_dcd_rst_v2() routine
> generates is empty. This causes HAB to complain that the command is invalid.
> 
> --------- HAB Event 1 -----------------
> event data:
> 	0xdb 0x00 0x0c 0x41 0x33 0x06 0xc0 0x00
> 	0xcc 0x00 0x04 0x04
> 
> To fix this set the DCD pointer in the IVT to NULL in this case. The DCD header
> itself is still needed for detect_imximage_version() to determine the image
> version.
> 
> Signed-off-by: Baruch Siach <baruch@tkos.co.il>
> ---
> Resending with a proper To: header.
> 
>  tools/imximage.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/tools/imximage.c b/tools/imximage.c
> index 6f469ae6336c..7b91d09699ad 100644
> --- a/tools/imximage.c
> +++ b/tools/imximage.c
> @@ -250,7 +250,11 @@ static void set_imx_hdr_v2(struct imx_header *imxhdr, uint32_t dcd_len,
>  	hdr_base = entry_point - imximage_init_loadsize +
>  		flash_offset;
>  	fhdr_v2->self = hdr_base;
> -	fhdr_v2->dcd_ptr = hdr_base + offsetof(imx_header_v2_t, dcd_table);
> +	if (dcd_len > 0)
> +		fhdr_v2->dcd_ptr = hdr_base
> +			+ offsetof(imx_header_v2_t, dcd_table);
> +	else
> +		fhdr_v2->dcd_ptr = 0;
>  	fhdr_v2->boot_data_ptr = hdr_base
>  			+ offsetof(imx_header_v2_t, boot_data);
>  	hdr_v2->boot_data.start = entry_point - imximage_init_loadsize;
> 

It looks ok for me.

Acked-by: Stefano Babic <sbabic@denx.de>

Best regards,
Stefano Babic

-- 
=====================================================================
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de
=====================================================================

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [U-Boot] [PATCH RESEND] tools/imximage: set DCD pointer to NULL when its length is 0
  2015-07-09 16:04 ` Stefano Babic
@ 2015-07-14 19:05   ` Baruch Siach
  2015-07-15  7:13     ` Stefano Babic
  0 siblings, 1 reply; 6+ messages in thread
From: Baruch Siach @ 2015-07-14 19:05 UTC (permalink / raw)
  To: u-boot

Hi Stefano,

On Thu, Jul 09, 2015 at 06:04:17PM +0200, Stefano Babic wrote:
> On 09/07/2015 17:19, Baruch Siach wrote:
> > When dcd_len is 0 the Write Data command that the set_dcd_rst_v2() routine
> > generates is empty. This causes HAB to complain that the command is invalid.
> > 
> > --------- HAB Event 1 -----------------
> > event data:
> > 	0xdb 0x00 0x0c 0x41 0x33 0x06 0xc0 0x00
> > 	0xcc 0x00 0x04 0x04
> > 
> > To fix this set the DCD pointer in the IVT to NULL in this case. The DCD header
> > itself is still needed for detect_imximage_version() to determine the image
> > version.
> > 
> > Signed-off-by: Baruch Siach <baruch@tkos.co.il>
> > ---
> > Resending with a proper To: header.
> > 
> >  tools/imximage.c | 6 +++++-
> >  1 file changed, 5 insertions(+), 1 deletion(-)
> > 
> > diff --git a/tools/imximage.c b/tools/imximage.c
> > index 6f469ae6336c..7b91d09699ad 100644
> > --- a/tools/imximage.c
> > +++ b/tools/imximage.c
> > @@ -250,7 +250,11 @@ static void set_imx_hdr_v2(struct imx_header *imxhdr, uint32_t dcd_len,
> >  	hdr_base = entry_point - imximage_init_loadsize +
> >  		flash_offset;
> >  	fhdr_v2->self = hdr_base;
> > -	fhdr_v2->dcd_ptr = hdr_base + offsetof(imx_header_v2_t, dcd_table);
> > +	if (dcd_len > 0)
> > +		fhdr_v2->dcd_ptr = hdr_base
> > +			+ offsetof(imx_header_v2_t, dcd_table);
> > +	else
> > +		fhdr_v2->dcd_ptr = 0;
> >  	fhdr_v2->boot_data_ptr = hdr_base
> >  			+ offsetof(imx_header_v2_t, boot_data);
> >  	hdr_v2->boot_data.start = entry_point - imximage_init_loadsize;
> > 
> 
> It looks ok for me.
> 
> Acked-by: Stefano Babic <sbabic@denx.de>

Thanks.

Which tree is this patch going through?

baruch

-- 
     http://baruch.siach.name/blog/                  ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
   - baruch at tkos.co.il - tel: +972.2.679.5364, http://www.tkos.co.il -

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [U-Boot] [PATCH RESEND] tools/imximage: set DCD pointer to NULL when its length is 0
  2015-07-14 19:05   ` Baruch Siach
@ 2015-07-15  7:13     ` Stefano Babic
  2015-08-02 18:45       ` Baruch Siach
  0 siblings, 1 reply; 6+ messages in thread
From: Stefano Babic @ 2015-07-15  7:13 UTC (permalink / raw)
  To: u-boot

On 14/07/2015 21:05, Baruch Siach wrote:
> Hi Stefano,
> 
> On Thu, Jul 09, 2015 at 06:04:17PM +0200, Stefano Babic wrote:
>> On 09/07/2015 17:19, Baruch Siach wrote:
>>> When dcd_len is 0 the Write Data command that the set_dcd_rst_v2() routine
>>> generates is empty. This causes HAB to complain that the command is invalid.
>>>
>>> --------- HAB Event 1 -----------------
>>> event data:
>>> 	0xdb 0x00 0x0c 0x41 0x33 0x06 0xc0 0x00
>>> 	0xcc 0x00 0x04 0x04
>>>
>>> To fix this set the DCD pointer in the IVT to NULL in this case. The DCD header
>>> itself is still needed for detect_imximage_version() to determine the image
>>> version.
>>>
>>> Signed-off-by: Baruch Siach <baruch@tkos.co.il>
>>> ---
>>> Resending with a proper To: header.
>>>
>>>  tools/imximage.c | 6 +++++-
>>>  1 file changed, 5 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/tools/imximage.c b/tools/imximage.c
>>> index 6f469ae6336c..7b91d09699ad 100644
>>> --- a/tools/imximage.c
>>> +++ b/tools/imximage.c
>>> @@ -250,7 +250,11 @@ static void set_imx_hdr_v2(struct imx_header *imxhdr, uint32_t dcd_len,
>>>  	hdr_base = entry_point - imximage_init_loadsize +
>>>  		flash_offset;
>>>  	fhdr_v2->self = hdr_base;
>>> -	fhdr_v2->dcd_ptr = hdr_base + offsetof(imx_header_v2_t, dcd_table);
>>> +	if (dcd_len > 0)
>>> +		fhdr_v2->dcd_ptr = hdr_base
>>> +			+ offsetof(imx_header_v2_t, dcd_table);
>>> +	else
>>> +		fhdr_v2->dcd_ptr = 0;
>>>  	fhdr_v2->boot_data_ptr = hdr_base
>>>  			+ offsetof(imx_header_v2_t, boot_data);
>>>  	hdr_v2->boot_data.start = entry_point - imximage_init_loadsize;
>>>
>>
>> It looks ok for me.
>>
>> Acked-by: Stefano Babic <sbabic@denx.de>
> 
> Thanks.
> 
> Which tree is this patch going through?

This goes first into u-boot-imx, until I'll send a PR to Tom for
inclusion in his tree,

Best regards,
Stefano Babic

-- 
=====================================================================
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de
=====================================================================

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [U-Boot] [PATCH RESEND] tools/imximage: set DCD pointer to NULL when its length is 0
  2015-07-15  7:13     ` Stefano Babic
@ 2015-08-02 18:45       ` Baruch Siach
  2015-08-03  6:50         ` Stefano Babic
  0 siblings, 1 reply; 6+ messages in thread
From: Baruch Siach @ 2015-08-02 18:45 UTC (permalink / raw)
  To: u-boot

Hi Stefano,

On Wed, Jul 15, 2015 at 09:13:33AM +0200, Stefano Babic wrote:
> On 14/07/2015 21:05, Baruch Siach wrote:
> > On Thu, Jul 09, 2015 at 06:04:17PM +0200, Stefano Babic wrote:
> >> On 09/07/2015 17:19, Baruch Siach wrote:
> >>> When dcd_len is 0 the Write Data command that the set_dcd_rst_v2() routine
> >>> generates is empty. This causes HAB to complain that the command is invalid.
> >>>
> >>> --------- HAB Event 1 -----------------
> >>> event data:
> >>> 	0xdb 0x00 0x0c 0x41 0x33 0x06 0xc0 0x00
> >>> 	0xcc 0x00 0x04 0x04
> >>>
> >>> To fix this set the DCD pointer in the IVT to NULL in this case. The DCD header
> >>> itself is still needed for detect_imximage_version() to determine the image
> >>> version.
> >>>
> >>> Signed-off-by: Baruch Siach <baruch@tkos.co.il>
> >>> ---
> >>> Resending with a proper To: header.
> >>>
> >>>  tools/imximage.c | 6 +++++-
> >>>  1 file changed, 5 insertions(+), 1 deletion(-)
> >>>
> >>> diff --git a/tools/imximage.c b/tools/imximage.c
> >>> index 6f469ae6336c..7b91d09699ad 100644
> >>> --- a/tools/imximage.c
> >>> +++ b/tools/imximage.c
> >>> @@ -250,7 +250,11 @@ static void set_imx_hdr_v2(struct imx_header *imxhdr, uint32_t dcd_len,
> >>>  	hdr_base = entry_point - imximage_init_loadsize +
> >>>  		flash_offset;
> >>>  	fhdr_v2->self = hdr_base;
> >>> -	fhdr_v2->dcd_ptr = hdr_base + offsetof(imx_header_v2_t, dcd_table);
> >>> +	if (dcd_len > 0)
> >>> +		fhdr_v2->dcd_ptr = hdr_base
> >>> +			+ offsetof(imx_header_v2_t, dcd_table);
> >>> +	else
> >>> +		fhdr_v2->dcd_ptr = 0;
> >>>  	fhdr_v2->boot_data_ptr = hdr_base
> >>>  			+ offsetof(imx_header_v2_t, boot_data);
> >>>  	hdr_v2->boot_data.start = entry_point - imximage_init_loadsize;
> >>
> >> It looks ok for me.
> >>
> >> Acked-by: Stefano Babic <sbabic@denx.de>
> > 
> > Which tree is this patch going through?
> 
> This goes first into u-boot-imx, until I'll send a PR to Tom for
> inclusion in his tree,

Thanks again. Is there a reason this patch is not in the u-boot-imx git tree?

baruch

-- 
     http://baruch.siach.name/blog/                  ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
   - baruch at tkos.co.il - tel: +972.2.679.5364, http://www.tkos.co.il -

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [U-Boot] [PATCH RESEND] tools/imximage: set DCD pointer to NULL when its length is 0
  2015-08-02 18:45       ` Baruch Siach
@ 2015-08-03  6:50         ` Stefano Babic
  0 siblings, 0 replies; 6+ messages in thread
From: Stefano Babic @ 2015-08-03  6:50 UTC (permalink / raw)
  To: u-boot

Hi Baruch,

On 02/08/2015 20:45, Baruch Siach wrote:
> Hi Stefano,
> 
> On Wed, Jul 15, 2015 at 09:13:33AM +0200, Stefano Babic wrote:
>> On 14/07/2015 21:05, Baruch Siach wrote:
>>> On Thu, Jul 09, 2015 at 06:04:17PM +0200, Stefano Babic wrote:
>>>> On 09/07/2015 17:19, Baruch Siach wrote:
>>>>> When dcd_len is 0 the Write Data command that the set_dcd_rst_v2() routine
>>>>> generates is empty. This causes HAB to complain that the command is invalid.
>>>>>
>>>>> --------- HAB Event 1 -----------------
>>>>> event data:
>>>>> 	0xdb 0x00 0x0c 0x41 0x33 0x06 0xc0 0x00
>>>>> 	0xcc 0x00 0x04 0x04
>>>>>
>>>>> To fix this set the DCD pointer in the IVT to NULL in this case. The DCD header
>>>>> itself is still needed for detect_imximage_version() to determine the image
>>>>> version.
>>>>>
>>>>> Signed-off-by: Baruch Siach <baruch@tkos.co.il>
>>>>> ---
>>>>> Resending with a proper To: header.
>>>>>
>>>>>  tools/imximage.c | 6 +++++-
>>>>>  1 file changed, 5 insertions(+), 1 deletion(-)
>>>>>
>>>>> diff --git a/tools/imximage.c b/tools/imximage.c
>>>>> index 6f469ae6336c..7b91d09699ad 100644
>>>>> --- a/tools/imximage.c
>>>>> +++ b/tools/imximage.c
>>>>> @@ -250,7 +250,11 @@ static void set_imx_hdr_v2(struct imx_header *imxhdr, uint32_t dcd_len,
>>>>>  	hdr_base = entry_point - imximage_init_loadsize +
>>>>>  		flash_offset;
>>>>>  	fhdr_v2->self = hdr_base;
>>>>> -	fhdr_v2->dcd_ptr = hdr_base + offsetof(imx_header_v2_t, dcd_table);
>>>>> +	if (dcd_len > 0)
>>>>> +		fhdr_v2->dcd_ptr = hdr_base
>>>>> +			+ offsetof(imx_header_v2_t, dcd_table);
>>>>> +	else
>>>>> +		fhdr_v2->dcd_ptr = 0;
>>>>>  	fhdr_v2->boot_data_ptr = hdr_base
>>>>>  			+ offsetof(imx_header_v2_t, boot_data);
>>>>>  	hdr_v2->boot_data.start = entry_point - imximage_init_loadsize;
>>>>
>>>> It looks ok for me.
>>>>
>>>> Acked-by: Stefano Babic <sbabic@denx.de>
>>>
>>> Which tree is this patch going through?
>>
>> This goes first into u-boot-imx, until I'll send a PR to Tom for
>> inclusion in his tree,
> 
> Thanks again. Is there a reason this patch is not in the u-boot-imx git tree?

The reason is that it was not assigned in patchwork as I supposed and
this leads to forget it when I rework u-boot-imx - thanks for pointing out !

Applied to u-boot-imx, thanks !

Best regards,
Stefano Babic

-- 
=====================================================================
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de
=====================================================================

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2015-08-03  6:50 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-07-09 15:19 [U-Boot] [PATCH RESEND] tools/imximage: set DCD pointer to NULL when its length is 0 Baruch Siach
2015-07-09 16:04 ` Stefano Babic
2015-07-14 19:05   ` Baruch Siach
2015-07-15  7:13     ` Stefano Babic
2015-08-02 18:45       ` Baruch Siach
2015-08-03  6:50         ` Stefano Babic

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.