public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot-Users] AT91 u-boot lowlevel init Dataflash
@ 2006-06-05 16:43 Marco Cavallini
  2006-06-06  8:10 ` Andreas Schweigstill
  0 siblings, 1 reply; 5+ messages in thread
From: Marco Cavallini @ 2006-06-05 16:43 UTC (permalink / raw)
  To: u-boot

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
-- 
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

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

* [U-Boot-Users] AT91 u-boot lowlevel init Dataflash
  2006-06-05 16:43 [U-Boot-Users] AT91 u-boot lowlevel init Dataflash Marco Cavallini
@ 2006-06-06  8:10 ` Andreas Schweigstill
  2006-06-06  8:38   ` Marco Cavallini
  0 siblings, 1 reply; 5+ messages in thread
From: Andreas Schweigstill @ 2006-06-06  8:10 UTC (permalink / raw)
  To: u-boot

Dear Marco!

Marco Cavallini schrieb:
> 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

-- 
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/

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

* [U-Boot-Users] AT91 u-boot lowlevel init Dataflash
  2006-06-06  8:10 ` Andreas Schweigstill
@ 2006-06-06  8:38   ` Marco Cavallini
  2006-06-06  9:42     ` Marco Cavallini
  2006-06-06 10:02     ` Peter Menzebach
  0 siblings, 2 replies; 5+ messages in thread
From: Marco Cavallini @ 2006-06-06  8:38 UTC (permalink / raw)
  To: u-boot

Andreas Schweigstill ha scritto:
> Dear Marco!
> 
> Marco Cavallini schrieb:
>> 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
> 

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
-- 
Marco Cavallini
Koan s.a.s. - Bergamo - ITALIA
Embedded and Real-Time Software Engineering
www.KoanSoftware.com   |    www.KaeilOS.com

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

* [U-Boot-Users] AT91 u-boot lowlevel init Dataflash
  2006-06-06  8:38   ` Marco Cavallini
@ 2006-06-06  9:42     ` Marco Cavallini
  2006-06-06 10:02     ` Peter Menzebach
  1 sibling, 0 replies; 5+ messages in thread
From: Marco Cavallini @ 2006-06-06  9:42 UTC (permalink / raw)
  To: u-boot

Andreas Schweigstill ha scritto:
> 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:

 > 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
-- 
Marco Cavallini
Koan s.a.s. - Bergamo - ITALIA
Embedded and Real-Time Software Engineering
www.KoanSoftware.com   |    www.KaeilOS.com

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

* [U-Boot-Users] AT91 u-boot lowlevel init Dataflash
  2006-06-06  8:38   ` Marco Cavallini
  2006-06-06  9:42     ` Marco Cavallini
@ 2006-06-06 10:02     ` Peter Menzebach
  1 sibling, 0 replies; 5+ messages in thread
From: Peter Menzebach @ 2006-06-06 10:02 UTC (permalink / raw)
  To: u-boot

Marco Cavallini wrote:
> 
> 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

-- 
Peter Menzebach
Menzebach und Wolff IT-Consulting GbR
Phone +49 751 355 387 1

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

end of thread, other threads:[~2006-06-06 10:02 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-06-05 16:43 [U-Boot-Users] AT91 u-boot lowlevel init Dataflash Marco Cavallini
2006-06-06  8:10 ` Andreas Schweigstill
2006-06-06  8:38   ` Marco Cavallini
2006-06-06  9:42     ` Marco Cavallini
2006-06-06 10:02     ` Peter Menzebach

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox