Skip to contentSkip to conversation

bin_dep.sh Support

PATCH New Prafulla Wadaskar 3 participants 8 messages Jul 13, 2009 – Jul 16, 2009 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 bin_dep.sh Support

From: prafulla_wadaskar <[email protected]>

In some cases the u-boot.bin need to be processed further to create bootable u-boot binary from boot device This processing may be cpu,soc and/or board spcific bin_dep.sh provides a mechanism to execute bin_dep.sh if present in above platform specific folders

---
 Makefile         |    2 +
 tools/bin_dep.sh |   79 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 81 insertions(+), 0 deletions(-)
 create mode 100755 tools/bin_dep.sh
Makefile +2 -0
index f857641..8bf36ce 100644
@@ -318,6 +318,7 @@ $(obj)u-boot.srec:	$(obj)u-boot
 
 $(obj)u-boot.bin:	$(obj)u-boot
 		$(OBJCOPY) ${OBJCFLAGS} -O binary $< $@
+		@./tools/bin_dep.sh $(CPU) $(BOARD) $(VENDOR) $(SOC) $@
 
 $(obj)u-boot.ldr:	$(obj)u-boot
 		$(LDR) -T $(CONFIG_BFIN_CPU) -c $@ $< $(LDR_FLAGS)
@@ -3506,6 +3507,7 @@ clean:
 	       $(obj)tools/gen_eth_addr    $(obj)tools/img2srec		  \
 	       $(obj)tools/mkimage	   $(obj)tools/mpc86x_clk	  \
 	       $(obj)tools/ncb		   $(obj)tools/ubsha1
+	@./tools/bin_dep.sh $(CPU) $(BOARD) $(VENDOR) $(SOC) $@
 	@rm -f $(obj)board/cray/L1/{bootscript.c,bootscript.image}	  \
 	       $(obj)board/netstar/{eeprom,crcek,crcit,*.srec,*.bin}	  \
 	       $(obj)board/trab/trab_fkt   $(obj)board/voiceblue/eeprom   \
tools/bin_dep.sh new file +79 -0

79 lines not on this page · raw message

Signature · 1 line
1.5.3.3
#1 lore raw

PATCH 1/1 bin_dep.sh Support

Dear Prafulla Wadaskar,

Quoted 20 lines · In message <[email protected]> you wrote:

From: prafulla_wadaskar <[email protected]>

In some cases the u-boot.bin need to be processed further to create bootable u-boot binary from boot device This processing may be cpu,soc and/or board spcific bin_dep.sh provides a mechanism to execute bin_dep.sh if present in above platform specific folders

---
 Makefile         |    2 +
 tools/bin_dep.sh |   79 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 81 insertions(+), 0 deletions(-)
 create mode 100755 tools/bin_dep.sh
Makefile +0 -0
index f857641..8bf36ce 100644

Makefile $(obj)u-boot.srec: $(obj)u-boot · line 321

Quoted 4 lines
Makefile +1 -0
@@ -318,6 +318,7 @@ $(obj)u-boot.srec:	$(obj)u-boot
 
 $(obj)u-boot.bin:	$(obj)u-boot
 		$(OBJCOPY) ${OBJCFLAGS} -O binary $< $@
+		@./tools/bin_dep.sh $(CPU) $(BOARD) $(VENDOR) $(SOC) $@

NAK. I reject this patch, and I will continue to reject all attempts to perform additional operations on the u-boot.bin image.

u-boot.bin is by definition the raw binary image of U-Boot. If you use additional tools to post-process this image, then you are creating a new image format, which must have it's own name.

Best regards,

Wolfgang Denk

Signature · 4 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Thought for the day: What if there were no hypothetical situations?
#2 lore raw

PATCH 1/1 bin_dep.sh Support

Quoted 44 lines

-----Original Message-----
From: Wolfgang Denk [mailto:wd at denx.de]
Sent: Monday, July 13, 2009 4:56 PM
To: Prafulla Wadaskar
Cc: u-boot at lists.denx.de; Manas Saksena; Ronen Shitrit; Nicolas Pitre; Ashish Karkare; Prabhanjan Sarnaik; Lennert Buijtenhek
Subject: Re: [U-Boot] [PATCH][repost] bin_dep.sh Support

Dear Prafulla Wadaskar,

In message

Quoted 4 lines · <[email protected]> you wrote:

From: prafulla_wadaskar <[email protected]>

In some cases the u-boot.bin need to be processed further to create bootable u-boot binary from boot device This processing may

be cpu,soc

Quoted 7 lines

and/or board spcific bin_dep.sh provides a mechanism to execute bin_dep.sh if present in above platform specific folders

---
 Makefile         |    2 +
 tools/bin_dep.sh |   79 

++++++++++++++++++++++++++++++++++++++++++++++++++++++

Quoted 1 line
 2 files changed, 81 insertions(+), 0 deletions(-)  create 

mode 100755

Makefile $(obj)u-boot.srec: $(obj)u-boot · line 321

Quoted 11 lines

tools/bin_dep.sh

Makefile +1 -0
index f857641..8bf36ce 100644
@@ -318,6 +318,7 @@ $(obj)u-boot.srec:	$(obj)u-boot
 
 $(obj)u-boot.bin:	$(obj)u-boot
 		$(OBJCOPY) ${OBJCFLAGS} -O binary $< $@
+		@./tools/bin_dep.sh $(CPU) $(BOARD) $(VENDOR) $(SOC) $@

NAK. I reject this patch, and I will continue to reject all attempts to perform additional operations on the u-boot.bin image.

Quoted 4 lines

u-boot.bin is by definition the raw binary image of U-Boot. If you use additional tools to post-process this image, then you are creating a new image format, which must have it's own name.g

Then I feel what Jean has suggested is the only way to go ahead with kirkwood use case I will go ahead with this.

Ref:

Quoted 7 lines
Quoted 7 lines

we can simply add a new target
u-boot.kwd
which will do somthing like this

$(obj)u-boot.kwd: $(obj)u-boot.bin

	$(do_image) $(obj)u-boot.kwd $(obj)u-boot.bin 

$(obj)board/$(BOARDDIR)/sdramregs.txt

Second issue:
I will have to add a tool i.e. do_image (to be renamed) which will create u-boot.kwd. this tool is specific to Kirkwood only,
I am going to add this in ./tools/ folder (as per Jean's feedback earlier), is this okay?

Regards..
Prafulla . .

#3 lore raw

PATCH 1/1 bin_dep.sh Support

Hi Prafulla,

Quoted 11 lines

Then I feel what Jean has suggested is the only way to go ahead with kirkwood use case I will go ahead with this.

Ref:

Quoted 7 lines
Quoted 7 lines

we can simply add a new target
u-boot.kwd
which will do somthing like this

$(obj)u-boot.kwd: $(obj)u-boot.bin

	$(do_image) $(obj)u-boot.kwd $(obj)u-boot.bin 

$(obj)board/$(BOARDDIR)/sdramregs.txt

I think this looks good.

Quoted 4 lines

Second issue:
I will have to add a tool i.e. do_image (to be renamed) which will create u-boot.kwd. this tool is specific to Kirkwood only,
I am going to add this in ./tools/ folder (as per Jean's feedback earlier), is this okay?

The plan as such is ok, although you will probably need to rewrite the latest version of do_image posted to this ML[1] completely. Starting out to read the code, I was tempted to post some specific remarks about the code, but quickly realized that this is not a good attempt to move further here.

The code really needs to be rewritten in a clean fashion using common programming metaphors, style and library functions (i.e. use getopt(3), etc.).

Cheers
Detlev

[1] http://article.gmane.org/gmane.comp.boot-loaders.u-boot/57251

Signature · 7 lines
Of course my password is the same as my pet's name
My macaw's name was Q47pY!3 and I change it every 90 days
                        -- Trevor Linton
--
DENX Software Engineering GmbH,      MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich,  Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-40 Fax: (+49)-8142-66989-80 Email: dzu at denx.de
#4 lore raw

PATCH 1/1 bin_dep.sh Support

Quoted 40 lines

-----Original Message-----
From: Detlev Zundel [mailto:dzu at denx.de]
Sent: Tuesday, July 14, 2009 5:09 PM
To: Prafulla Wadaskar
Cc: Wolfgang Denk; Manas Saksena; Ronen Shitrit; Nicolas Pitre; u-boot at lists.denx.de; Ashish Karkare; Prabhanjan Sarnaik; Lennert Buijtenhek
Subject: Re: [U-Boot] [PATCH][repost] bin_dep.sh Support

Hi Prafulla,

Quoted 1 line

Then I feel what Jean has suggested is the only way to go

ahead with

Quoted 10 lines

kirkwood use case I will go ahead with this.

Ref:

Quoted 7 lines
Quoted 7 lines

we can simply add a new target
u-boot.kwd
which will do somthing like this

$(obj)u-boot.kwd: $(obj)u-boot.bin

	$(do_image) $(obj)u-boot.kwd $(obj)u-boot.bin 

$(obj)board/$(BOARDDIR)/sdramregs.txt

I think this looks good.

Quoted 2 lines

Second issue:
I will have to add a tool i.e. do_image (to be renamed)

which will create u-boot.kwd.

Quoted 2 lines

this tool is specific to Kirkwood only, I am going to add this in ./tools/ folder (as per Jean's feedback earlier), is this okay?

The plan as such is ok, although you will probably need to rewrite the latest version of do_image posted to this ML[1] completely. Starting out to read the code, I was tempted to post some specific remarks about the code, but quickly realized that this is not a good attempt to move further here.

Quoted 4 lines

The code really needs to be rewritten in a clean fashion using common programming metaphors, style and library functions (i.e. use getopt(3), etc.).

Dear Detlev
Thanks for your feedback
Yes I am doing the same code cleanup.
I am planning to remove all command line interface and the configuration needed will be provided using CONFIGs. This will make code size smaller and sdramregs.txt a standard c header file. What do you think?

If you have further inputs those are welcomed... :-)

Thanks and regards..
Prafulla . . .

Quoted 12 lines

[1] http://article.gmane.org/gmane.comp.boot-loaders.u-boot/57251

--
Of course my password is the same as my pet's name My macaw's name was Q47pY!3 and I change it every 90 days
-- Trevor Linton
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-40 Fax: (+49)-8142-66989-80 Email: dzu at denx.de

#5 lore raw

PATCH 1/1 mkimage support ( bin_dep.sh Support)

Quoted 48 lines

-----Original Message-----
From: u-boot-bounces at lists.denx.de
[mailto:u-boot-bounces at lists.denx.de] On Behalf Of Prafulla Wadaskar
Sent: Tuesday, July 14, 2009 10:34 PM
To: Detlev Zundel
Cc: Ronen Shitrit; Nicolas Pitre; u-boot at lists.denx.de; Ashish Karkare; Prabhanjan Sarnaik; Lennert Buijtenhek; Manas Saksena
Subject: Re: [U-Boot] [PATCH][repost] bin_dep.sh Support

Quoted 26 lines

-----Original Message-----
From: Detlev Zundel [mailto:dzu at denx.de]
Sent: Tuesday, July 14, 2009 5:09 PM
To: Prafulla Wadaskar
Cc: Wolfgang Denk; Manas Saksena; Ronen Shitrit; Nicolas Pitre; u-boot at lists.denx.de; Ashish Karkare; Prabhanjan Sarnaik; Lennert Buijtenhek
Subject: Re: [U-Boot] [PATCH][repost] bin_dep.sh Support

Hi Prafulla,

Quoted 1 line

Then I feel what Jean has suggested is the only way to go

ahead with

Quoted 10 lines

kirkwood use case I will go ahead with this.

Ref:

Quoted 7 lines
Quoted 7 lines

we can simply add a new target
u-boot.kwd
which will do somthing like this

$(obj)u-boot.kwd: $(obj)u-boot.bin

	$(do_image) $(obj)u-boot.kwd $(obj)u-boot.bin 

$(obj)board/$(BOARDDIR)/sdramregs.txt

I think this looks good.

Quoted 7 lines
Quoted 2 lines

Second issue:
I will have to add a tool i.e. do_image (to be renamed)

which will create u-boot.kwd.

Quoted 2 lines

this tool is specific to Kirkwood only, I am going to add this in ./tools/ folder (as per Jean's feedback earlier), is this okay?

The plan as such is ok, although you will probably need to

rewrite the

Quoted 1 line

latest version of do_image posted to this ML[1] completely.

Quoted 10 lines

Starting

Quoted 2 lines

out to read the code, I was tempted to post some specific remarks about the code, but quickly realized that this is not a

good attempt

Quoted 3 lines

to move further here.

The code really needs to be rewritten in a clean fashion

using common

Quoted 2 lines

programming metaphors, style and library functions (i.e. use getopt(3), etc.).

Hi Wolfgang
During restructuring activity for this utility,
I found that most of the code and algorithm is common between mkimage and kwimage (old name doimage).
I have studied mkimage code.
kwimage requirements can be well supported by adding one more type support to the mkimage (i.e. "bootrom").
The bootrom image file generation generic abstraction can be provided with new file ./common/bootrom.c internally supported by Arch specific macros/code.

With this-
1. mkimage can be reused for kwimage generation.
2. Kwimage generation can be supported in a generic way under "bootrom" image type
3. In future the same interface can be used by other Marvell and non Marvell socs for similar kind of requirements.

Shall I go ahead with this approach?
or I should not disturb mkimage at all?
What is your opinion?

Regards..
Prafulla . .

Quoted 36 lines
Quoted 1 line

Dear Detlev
Thanks for your feedback
Yes I am doing the same code cleanup.
I am planning to remove all command line interface and the configuration needed will be provided using CONFIGs. This will make code size smaller and sdramregs.txt a standard c header file.
What do you think?

If you have further inputs those are welcomed... :-)

Thanks and regards..
Prafulla . . .

Quoted 5 lines

[1] http://article.gmane.org/gmane.comp.boot-loaders.u-boot/57251

--
Of course my password is the same as my pet's name My

macaw's name was

Quoted 4 lines

Q47pY!3 and I change it every 90 days
-- Trevor Linton
--
DENX Software Engineering GmbH, MD: Wolfgang Denk &

Detlev Zundel

Quoted 1 line

HRB 165235 Munich, Office: Kirchenstr.5, D-82194

Groebenzell, Germany

Quoted 1 line

Phone: (+49)-8142-66989-40 Fax: (+49)-8142-66989-80 Email:

dzu at denx.de

Quoted 1 line

_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot

#6 lore raw

PATCH 1/1 mkimage support ( bin_dep.sh Support)

Dear Prafulla Wadaskar,

Quoted 7 lines · In message <[email protected]>…
Quoted 4 lines
Quoted 4 lines

The code really needs to be rewritten in a clean fashion using common programming metaphors, style and library functions (i.e. use getopt(3), etc.).

During restructuring activity for this utility,
I found that most of the code and algorithm is common between mkimage and kwimage (old name doimage).

I'm not really surprised.

Quoted 2 lines

I have studied mkimage code.
kwimage requirements can be well supported by adding one more type support to the mkimage (i.e. "bootrom").

"bootrom" is a way to generic name. You have a specific data format in mind, so please use a more specific name.

Quoted 1 line

The bootrom image file generation generic abstraction can be provided with new file ./common/bootrom.c internally supported by Arch specific macros/code.

Hm... I guess this would make it even more complicated to separate the mkimage tool from the rest of the U-Boot code. There have been repeated requests to make it more independent or even integrate in into the Linux kernel code tree. We should keep this in mind.

Note that this is not an argument against your proposal - just a note that we should keep this aspect in mind when implementing and reviewing the new code.

Quoted 2 lines

With this-
1. mkimage can be reused for kwimage generation.

Sounds good to me.

Quoted 1 line

2. Kwimage generation can be supported in a generic way under "bootrom" image type

This doesn't sound such a good idea to me. As mentioned above, "bootrom" is a very generic name which can be anything - but if you assign this name to a specific format, it should be exactly _one_ speific format.

Quoted 5 lines

3. In future the same interface can be used by other Marvell and non Marvell socs for similar kind of requirements.

Shall I go ahead with this approach?
or I should not disturb mkimage at all? What is your opinion?

I think this is a pretty good plan. Please go ahead.

Best regards,

Wolfgang Denk

Signature · 7 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
After a heated argument on some trivial matter Nancy [Astor]  .  .  .
shouted,  ``If  I were your wife I would put poison in your coffee!''
Whereupon Winston Churchill with equal heat and  sincerity  answered,
``And if I were your husband I would drink it.''
#7 lore raw

PATCH 1/1 mkimage support ( bin_dep.sh Support)

Quoted 25 lines

-----Original Message-----
From: Wolfgang Denk [mailto:wd at denx.de]
Sent: Thursday, July 16, 2009 4:55 PM
To: Prafulla Wadaskar
Cc: u-boot at lists.denx.de
Subject: Re: [U-Boot] [PATCH][repost] mkimage support ( bin_dep.sh Support)

Dear Prafulla Wadaskar,

In message <[email protected].

Quoted 6 lines · com> you wrote:
Quoted 4 lines
Quoted 4 lines

The code really needs to be rewritten in a clean fashion using common programming metaphors, style and library functions (i.e. use getopt(3), etc.).

During restructuring activity for this utility, I found

that most of

Quoted 1 line

the code and algorithm is common between mkimage and

kwimage (old name doimage).

Quoted 8 lines

I'm not really surprised.

Quoted 2 lines

I have studied mkimage code.
kwimage requirements can be well supported by adding one

more type support to the mkimage (i.e. "bootrom").

"bootrom" is a way to generic name. You have a specific data format in mind, so please use a more specific name.

Kirkwood Specs call it as "boot image" which is a post processed binary bundled with BootRom header and optional header extension so that Kirkwood's internal bootRom loads it from specific media to DRAM and starts execution.
Ref: (Section 24.2.4) http://www.marvell.com/files/products/embedded_processors/kirkwood/FS_88F6180_9x_6281_OpenSource.pdf

So I will name this as "kwbimage" and target will be u-boot.kwb

Further boot image could be different for "boot from SF/NANDF/UART/SATA" etc... This information will be abstracted form board specific config.mk.

Quoted 10 lines
Quoted 2 lines

The bootrom image file generation generic abstraction can

be provided with new file ./common/bootrom.c internally supported by Arch specific macros/code.

Hm... I guess this would make it even more complicated to separate the mkimage tool from the rest of the U-Boot code. There have been repeated requests to make it more independent or even integrate in into the Linux kernel code tree. We should keep this in mind.

So I will limit my self not to disturb current mkimage architecture.
I will add additional kwbimage type support the related code will be abstracted to ./tools/kwbimage.c

Quoted 4 lines

Note that this is not an argument against your proposal - just a note that we should keep this aspect in mind when implementing and reviewing the new code.

Thanks...If this find useful for others we can think of expanding it latter. For ex. Type = <SOC>bimage and abstraction in <SOC>bimage.c/h

Quoted 6 lines
Quoted 3 lines

With this-
1. mkimage can be reused for kwimage generation.

Sounds good to me.

Quoted 7 lines
Quoted 2 lines

2. Kwimage generation can be supported in a generic way under "bootrom" image type

This doesn't sound such a good idea to me. As mentioned
above, "bootrom" is a very generic name which can be
anything - but if you assign this name to a specific format, it should be exactly _one_ speific format.

Cool. In sync... Type renamed "kwbimage", abstraction in ./tools/kwbimage.c/h

Quoted 9 lines
Quoted 2 lines

3. In future the same interface can be used by other

Marvell and non Marvell socs for similar kind of requirements.

Quoted 4 lines

Shall I go ahead with this approach? or I should not disturb mkimage at all? What is your opinion?

I think this is a pretty good plan. Please go ahead.

Thanks a lot.... :-D

Regards..
Prafulla . .

Quoted 15 lines

Best regards,

Wolfgang Denk

Signature · 8 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: 
wd at denx.de After a heated argument on some trivial matter 
Nancy [Astor]  .  .  .
shouted,  ``If  I were your wife I would put poison in your coffee!''
Whereupon Winston Churchill with equal heat and  sincerity  
answered, ``And if I were your husband I would drink it.''