Hello Robert, > On Tue, Aug 05, 2008 at 11:07:43PM +0200, Remy Bohmer wrote: >> This bootstrap package is required on at91sam* boards where >> dataflash/nandflash is used to boot from. In these cases the internal >> bootROM of the AT91 core is used to boot the board with. > Can you elaborate, how exactly does this work?
Erwin already explained in his mail how this works. If you look at http://www.atmel.com/dyn/resources/prod_documents/doc6277.pdf there is an application note from Atmel that describes the bootstrap code. In short, the bootsequence is as follows: * The bootstrap code is loaded by the internal bootROM of the CPU from dataflash/nandflash, * The bootROM jumps to this bootstrap code. * The bootstrap code initialises SDram/data/nanadflash and copies U-boot from dataflash/nandflash to SDRAM * The bootstrap code jumps to U-boot. >> platforms/Kconfig | 1 >> platforms/at91bootstrap.in | 43 +++++++++++++++++++ >> rules/at91bootstrap.make | 111 >> ++++++++++++++++++++++++++++++++++++++++++++++++++ > > Note that this mechanism is still a little bit broken; we currently > discuss a patch by Sascha Hauer which makes it possible to generate the > platforms/ and rules/ files from a per-packet source; this patch would > make it possible to eliminate the inconsistencies we currently have > between platforms/ and rules. Okay, but this mechanism is derived from the way U-boot is currently implemented in Ptxdist. So, it is as good, or as bad as U-boot is right now... > Why do we need this when there is U-Boot? If you look at the mainline of U-boot (v1.3.4-rc) you will see that all Atmel SAM Cores are supported these days. The support of these cores in U-boot is based on this Bootstrap code. CONFIG_SKIP_RELOCATE_UBOOT is set for all these cores, this means that all low-level initialisation is skipped by U-boot. So, with ptxdist you can build U-boot for these cores, but you cannot use it on these cores without the bootstrap.(or you need to add full support for booting from NOR-flash in U-boot, but that is not supported by anyone at this time.) It is better to be capable to build the bootstrap also, especially if you want to add custom boards yourself to the bootstrap code. > Could this be integrated into U-Boot? If not, why? I never looked if it can be integrated. Similar things seem to happen if you look in the nand_spl tree. So, I think it is not impossible. But the _current_ status is that everybody (according to Atmel people on the LKML some time ago) uses dataflash/nandflash boot on these cores in combination with this bootstrap code. They are even still developing on it, and adding new Cores. Atmel had its own port of U-boot 1.1.5 for a long time, but the boards are finally mainlined now. > Great to see some documentation :-) Nevertheless, the help text does > probably need some whitespace cleanup. I copied it from some introduction to Bootstrap. I will look at that. >> +config AT91BOOTSTRAP_VERSION >> + string >> + depends on AT91BOOTSTRAP > > Please get rid of the "depends" statements; I'd prefer the > > if AT91BOOTSTRAP > > config AT91BOOTSTRAP_VERSION > string > ... > > config AT91BOOTSTRAP_FOOBAR > bool > ... > > endif > > variant which does the same, but in a cleaner way. OK. >> + @cp >> $(AT91BOOTSTRAP_DIR)/board/${PTXCONF_AT91BOOTSTRAP_CONFIG}/dataflash/dataflash_${PTXCONF_AT91BOOTSTRAP_CONFIG}.bin >> $(IMAGEDIR)/at91bootstrap.bin > > Could need some \ line breaks. OK > Please change the addressed topics and resubmit. OK, I will resubmit probably this evening. Kind Regards, Remy -- ptxdist mailing list ptxdist@pengutronix.de