AT91 u-boot lowlevel init Dataflash
Hi,
I am trying to use u-boot-1.1.4 with AT91RM9200 based board. Using Parallel flash all works perfectly, but if I try using u-boot stored in Dataflash i face to some problems and comparing two cases I see that CPU clock are different.
Seems that is required a RomBoot provided by Atmel which launch u-boot. Is it really necessary ?
Maybe I've miss an option that avoid RomBoot usage ? CONFIG_SKIP_LOWLEVEL_INIT seems used only with parallel flash, what when
using Dataflash ?
Boot from Dataflash : define CONFIG_SKIP_LOWLEVEL_INIT 1
Machine: Atmel AT91RM9200
Memory policy: ECC disabled, Data cache writeback
Clocks: CPU 59 MHz, master 59 MHz, main 18.432 MHz
^^^^^^^^^^
Boot from Parallel flash : undef CONFIG_SKIP_LOWLEVEL_INIT
Machine: Atmel AT91RM9200
Memory policy: ECC disabled, Data cache writeback
Clocks: CPU 179 MHz, master 59 MHz, main 18.432 MHz
^^^^^^^^^^
Every hint will be appreciated
TIA
Signature · 7 lines
Marco Cavallini Koan s.a.s. - Bergamo - ITALIA Embedded and Real-Time Software Engineering www.KoanSoftware.com | www.KaeilOS.com Informativa D.Lgs 196/2003 (Privacy) http://www.koansoftware.com/it/prf_privacy.htm
Dear Marco!
Quoted 8 lines · Marco Cavallini
Hi,
I am trying to use u-boot-1.1.4 with AT91RM9200 based board. Using Parallel flash all works perfectly, but if I try using u-boot stored in Dataflash i face to some problems and comparing two cases I see that CPU clock are different.
Seems that is required a RomBoot provided by Atmel which launch u-boot. Is it really necessary ?
Maybe I've miss an option that avoid RomBoot usage ?
You can omit the RomBoot step if you are able to build an U-Boot which fits into ~12KB of the internal SRAM.
RomBoot has to be adopted to your target hardware, especially for CPU clock and memory initialisation. The Atmel provided RomBoot can only be compiled with ARM ADS but there is also a GCC version available:
http://www.teest.com/at91/romboot.tar.gz
With best regards
Andreas Schweigstill
Signature · 5 lines
Dipl.-Phys. Andreas Schweigstill Schweigstill IT | Embedded Systems Schauenburgerstra?e 116, D-24118 Kiel, Germany Phone: (+49) 431 5606-435, Fax: (+49) 431 5606-436 Mobile: (+49) 171 6921973, Web: http://www.schweigstill.de/
Andreas Schweigstill ha scritto:
Quoted 12 lines
Dear Marco!
Quoted 8 lines · Marco Cavallini
Hi,
I am trying to use u-boot-1.1.4 with AT91RM9200 based board. Using Parallel flash all works perfectly, but if I try using u-boot stored in Dataflash i face to some problems and comparing two cases I see that CPU clock are different.
Seems that is required a RomBoot provided by Atmel which launch u-boot. Is it really necessary ?
Maybe I've miss an option that avoid RomBoot usage ?
Quoted 9 lines
You can omit the RomBoot step if you are able to build an U-Boot which fits into ~12KB of the internal SRAM.
RomBoot has to be adopted to your target hardware, especially for CPU clock and memory initialisation. The Atmel provided RomBoot can only be compiled with ARM ADS but there is also a GCC version available:
Andreas
thank you for answering.
I can't and I don't want to store anything into internal SRAM. I simply want to use Dataflash AT45xxx instead of Parallel AT49xxx
I digged and found that RomBoot leaves the CPU speed at its initial safe state (slow).
Clocks: CPU 59 MHz, master 59 MHz, main 18.432 MHz
^^^^^^^^^^
Then I added board_late_init into at91rm9200dk.c and there I've set PLLAR, PLLBR, MCKR like into lowlevel_init.S
Now my board boots with the desired clock speed.
Clocks: CPU 179 MHz, master 59 MHz, main 18.432 MHz
^^^^^^^^^^
BTW I wonder if could be useful (and appreciated) if I should merge RomBoot settings into u-boot allowing u-boot to be the one and only loader for Dataflash too.
Ciao
Signature · 4 lines
Marco Cavallini Koan s.a.s. - Bergamo - ITALIA Embedded and Real-Time Software Engineering www.KoanSoftware.com | www.KaeilOS.com
Andreas Schweigstill ha scritto:
Quoted 3 lines
BTW I wonder if could be useful (and appreciated) if I should merge RomBoot settings into u-boot allowing u-boot to be the one and only loader for Dataflash too.
Thanks to Andreas who clarified this procedure:
Quoted 8 lines
I can't and I don't want to store anything into internal SRAM. I simply want to use Dataflash AT45xxx instead of Parallel AT49xxx
Nope, that doesn't work. Read the AT91RM9200 manual. The internal SRAM is the only memory which is always available to the ROM boot code. When a Dataflash is your only external ROM/Flash it's first sectors are copied to the SRAM. It isn't possible to execute directly from Dataflash.
Reading AT91RM9200 datasheet
=====
7. Boot Program
7.1 Overview
The Boot Program is capable of downloading an application in an AT91RM9200-based system.
It integrates a Bootloader and a boot Uploader to assure correct information download.
The Bootloader is activated first. It looks for a sequence of eight valid ARM exception vectors in
a DataFlash connected to the SPI, an EEPROM connected to the Two-wire Interface (TWI) or
an 8-bit memory device connected to the external bus interface (EBI). All these vectors must be
Bbranch or LDR load register instructions except for the sixth instruction. This vector is used to
store information, such as the size of the image to download and the type of DataFlash device.
If a valid sequence is found, code is downloaded into the internal SRAM. This is followed by a remap and a jump to the first address of the SRAM.
=====
This boot program is executed ONLY if NRST signal is disconnected (Remove R159 on AT91RM9200-DK board)so RomBoot will be necessary if you have only a DataFlash.
Ciao
Signature · 4 lines
Marco Cavallini Koan s.a.s. - Bergamo - ITALIA Embedded and Real-Time Software Engineering www.KoanSoftware.com | www.KaeilOS.com
Quoted 6 lines · Marco Cavallini
BTW I wonder if could be useful (and appreciated) if I should merge RomBoot settings into u-boot allowing u-boot to be the one and only loader for Dataflash too.
Ciao
Hi,
this is *not* possible, if you want to use only dataflash. *No* code can be executed directly out of the dataflash, since the access is serial and therefore it is not directly adressable by the CPU.
So the boot sequence (slightly simplified) is as follows:
- The internal boot code in ROM within the CPU copies up to 12K of code from dataflash to internal SRAM (this is romboot) and starts it.
- romboot initializes CPU frequencies and sets up SDRAM (normally the CPU runs after this at 180 MHZ on the DK board, unless you got a buggy version of precompiled romboot.
- romboot now copies u-boot to SDRAM and starts it.
It use the romboot version from teest.com, which Andreas mentioned and this sequence works fine with the recent u-boot releases.
You will find more information about this in various documents related to the processor and the dk board on the atmel home page..
Best regards
Peter
Signature · 3 lines
Peter Menzebach Menzebach und Wolff IT-Consulting GbR Phone +49 751 355 387 1