[U-Boot] MPC5200: possible to "reserve" embedded flash sectors ?

Hi,
is there any reasonable way to reserve some small flash sectors embedded inside U-Boot for other usage ?
Example :
2 sectors @ 0-16k U-boot start including initial code @ reset vector. 1 sector @ 16k-24k e.g. environment. 2 sectors @ 24k-40k reserved (small linux mtd partitions). ? sectors @ 40k+ remaining U-Boot code.
Back with U-Boot 1.1.4 I used the board's local u-boot.lds like this :
[snip]... .text : { cpu/mpc5xxx/start.o (.text) lib_ppc/board.o (.text) lib_ppc/interrupts.o (.text) lib_ppc/ticks.o (.text)
. = DEFINED(env_offset) ? env_offset : .; common/environment.o (.text)
. = DEFINED(CFG_ENV_ADD_SPACE) ? (. + CFG_ENV_ADD_SPACE) : .;
*(.text) *(.fixup) [snip]...
The primary goal is to create a dedicated sector holding the auto/boot script being available through a nested mtd partition.
Since the flash is completely used up there's no chance using sectors outside of U-Boot.
Any hints are welcome.
Regards, André
MATRIX VISION GmbH, Talstrasse 16, DE-71570 Oppenweiler Registergericht: Amtsgericht Stuttgart, HRB 271090 Geschaeftsfuehrer: Gerhard Thullner, Werner Armingeon, Uwe Furtner, Hans-Joachim Reich

Dear =?ISO-8859-1?Q?Andr=E9?= Schwarz,
In message 1268321602.4803.24.camel@swa-m460 you wrote:
is there any reasonable way to reserve some small flash sectors embedded inside U-Boot for other usage ?
Yes, of course there is. For example, in many board configurations we use such small sectors for the environment (then called "embedded environment").
Example :
2 sectors @ 0-16k U-boot start including initial code @ reset vector. 1 sector @ 16k-24k e.g. environment. 2 sectors @ 24k-40k reserved (small linux mtd partitions). ? sectors @ 40k+ remaining U-Boot code.
This can easily be done.
Back with U-Boot 1.1.4 I used the board's local u-boot.lds like this :
Right. The linker script is the pace that needs to be tweaked.
The primary goal is to create a dedicated sector holding the auto/boot script being available through a nested mtd partition.
Well, I think there might be more efficient ways to acchieve this, but YMMV.
Why are you asking? You wrote you have been doing this since 1.1.4, so where exactly is your problem?
Best regards,
Wolfgang Denk

Wolfgang,
Dear =?ISO-8859-1?Q?Andr=E9?= Schwarz,
In message 1268321602.4803.24.camel@swa-m460 you wrote:
is there any reasonable way to reserve some small flash sectors embedded inside U-Boot for other usage ?
Yes, of course there is. For example, in many board configurations we use such small sectors for the environment (then called "embedded environment").
Example :
2 sectors @ 0-16k U-boot start including initial code @ reset vector. 1 sector @ 16k-24k e.g. environment. 2 sectors @ 24k-40k reserved (small linux mtd partitions). ? sectors @ 40k+ remaining U-Boot code.
This can easily be done.
Back with U-Boot 1.1.4 I used the board's local u-boot.lds like this :
Right. The linker script is the pace that needs to be tweaked.
The primary goal is to create a dedicated sector holding the auto/boot script being available through a nested mtd partition.
Well, I think there might be more efficient ways to acchieve this, but YMMV.
hmm - I'm not *that* familiar with all that abbreviations ... have to ask someone : http://www.abbreviations.com/YMMV
Hopefully you didn't mean the worst one ;-)
Why are you asking? You wrote you have been doing this since 1.1.4, so where exactly is your problem?
The linker script has moved to the CPU directory, i.e. there's no local linker script anymore.
Since I want to submit the board files as soon as the merge window will open I'm asking for a reasonable way to implement this in current U-Boot.
What's your favorite way of doing this ? I'd be happy to implement it that way.
Best regards,
Wolfgang Denk
Regards, André
MATRIX VISION GmbH, Talstrasse 16, DE-71570 Oppenweiler Registergericht: Amtsgericht Stuttgart, HRB 271090 Geschaeftsfuehrer: Gerhard Thullner, Werner Armingeon, Uwe Furtner, Hans-Joachim Reich

Dear André Schwarz,
In message 1268325452.4803.34.camel@swa-m460 you wrote:
hmm - I'm not *that* familiar with all that abbreviations ... have to ask someone : http://www.abbreviations.com/YMMV
Hopefully you didn't mean the worst one ;-)
The common (and intended) interpretation is Your Mileage May Vary.
Why are you asking? You wrote you have been doing this since 1.1.4, so where exactly is your problem?
The linker script has moved to the CPU directory, i.e. there's no local linker script anymore.
This is because all boards used the same script anyway, so there was no use in keeping multiple copies of the same file. But please note that nothing prevents you to use a local, customized linker script. All you need to do is set it's name in you config.mk (add a line "LDSCRIPT=<your name>").
Since I want to submit the board files as soon as the merge window will open I'm asking for a reasonable way to implement this in current U-Boot.
Use a customized linker script.
Best regards,
Wolfgang Denk

Wolfgang,
Dear André Schwarz,
In message 1268325452.4803.34.camel@swa-m460 you wrote:
hmm - I'm not *that* familiar with all that abbreviations ... have to ask someone : http://www.abbreviations.com/YMMV
Hopefully you didn't mean the worst one ;-)
The common (and intended) interpretation is Your Mileage May Vary.
huh - *big* relief.
Why are you asking? You wrote you have been doing this since 1.1.4, so where exactly is your problem?
The linker script has moved to the CPU directory, i.e. there's no local linker script anymore.
This is because all boards used the same script anyway, so there was no use in keeping multiple copies of the same file. But please note that nothing prevents you to use a local, customized linker script. All you need to do is set it's name in you config.mk (add a line "LDSCRIPT=<your name>").
excellent - that's what I've been looking for. At first glance I'd expected custom linker scripts to be refused ...
Since I want to submit the board files as soon as the merge window will open I'm asking for a reasonable way to implement this in current U-Boot.
Use a customized linker script.
will do - thanks for the help.
Regards, André Schwarz
MATRIX VISION GmbH, Talstrasse 16, DE-71570 Oppenweiler Registergericht: Amtsgericht Stuttgart, HRB 271090 Geschaeftsfuehrer: Gerhard Thullner, Werner Armingeon, Uwe Furtner, Hans-Joachim Reich

Wolfgang,
...
This is because all boards used the same script anyway, so there was no use in keeping multiple copies of the same file. But please note that nothing prevents you to use a local, customized linker script. All you need to do is set it's name in you config.mk (add a line "LDSCRIPT=<your name>").
Created the board dir and added this line to config.mk:
LDSCRIPT := $(SRCTREE)/board/matrix-vision/mvsmr/u-boot.lds
which results in failure during make :
swa@swa-m460:~/u-boot.git$ CROSS_COMPILE=ppc_6xx- ARCH=powerpc make for dir in tools examples/standalone examples/api cpu/mpc5xxx /home/swa/u-boot.git/board/matrix-vision/mvsmr/ ; do \ make -C $dir _depend ; done make[1]: Entering directory `/home/swa/u-boot.git/tools' make[1]: Nothing to be done for `_depend'. ... make[1]: Leaving directory `/home/swa/u-boot.git/cpu/mpc5xxx' make: *** /home/swa/u-boot.git/board/matrix-vision/mvsmr/: No such file or directory. Stop. make: *** [depend] Error 2
At first glance I thought there's a make target missing. But looking at other boards doing the same thing showed no difference.
Using "LDSCRIPT := $(SRCTREE)/cpu/mpc5xxx/u-boot-customlayout.lds" withing config.mk compiles cleanly and results in working U-Boot.
What am I missing ?
excellent - that's what I've been looking for. At first glance I'd expected custom linker scripts to be refused ...
Since I want to submit the board files as soon as the merge window will open I'm asking for a reasonable way to implement this in current U-Boot.
Use a customized linker script.
will do - thanks for the help.
Regards, André
MATRIX VISION GmbH, Talstrasse 16, DE-71570 Oppenweiler Registergericht: Amtsgericht Stuttgart, HRB 271090 Geschaeftsfuehrer: Gerhard Thullner, Werner Armingeon, Uwe Furtner, Hans-Joachim Reich

Dear André,
In message 1268643615.4089.8.camel@swa-m460 you wrote:
Created the board dir and added this line to config.mk:
LDSCRIPT :$(SRCTREE)/board/matrix-vision/mvsmr/u-boot.lds
which results in failure during make :
swa@swa-m460:~/u-boot.git$ CROSS_COMPILEppc_6xx- ARCHpowerpc make for dir in tools examples/standalone examples/api cpu/mpc5xxx /home/swa/u-boot.git/board/matrix-vision/mvsmr/ ; do \
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
This comes from these lines in the Makefile:
407 for dir in $(SUBDIRS) cpu/$(CPU) $(dir $(LDSCRIPT)) ; do \ 408 $(MAKE) -C $$dir _depend ; done
make: *** /home/swa/u-boot.git/board/matrix-vision/mvsmr/: No such file or directory. Stop.
Well, did you check if there is eally a directory of this name in your source tree? There is none in mine...
Usually error messges mean what they say.
What am I missing ?
The directory /home/swa/u-boot.git/board/matrix-vision/mvsmr/ ?
Best regards,
Wolfgang Denk

Wolfgang,
Usually error messges mean what they say.
yes - of course. But I still couldn't see the difference between "-" and "_" after looking at it three times.
What am I missing ?
The directory /home/swa/u-boot.git/board/matrix-vision/mvsmr/ ?
ok - it's "matrix_vision" ... already put my worn out brown paper bag on again.
Thanks for pointing this out.
Regards, André
MATRIX VISION GmbH, Talstrasse 16, DE-71570 Oppenweiler Registergericht: Amtsgericht Stuttgart, HRB 271090 Geschaeftsfuehrer: Gerhard Thullner, Werner Armingeon, Uwe Furtner, Hans-Joachim Reich
participants (2)
-
André Schwarz
-
Wolfgang Denk