Atmel website | ARM Community | AVR freaks | Technical Support
Banner
 FAQ •  Search •  Register •  Login 

All times are UTC + 1 hour [ DST ]




Post new topic Reply to topic  [ 57 posts ]  Go to page Previous  1, 2, 3, 4
Author Message
 Post subject: Re: AT91SAM9G20 - Bootstrap with SerialFlash - how do you do it?
PostPosted: Fri Aug 06, 2010 6:09 pm 
Offline

Joined: Thu Feb 11, 2010 7:47 pm
Posts: 29
Now it worked using the GCC+ version which is named in the readme. Finally...


Top
 Profile  
 
 Post subject: Re: AT91SAM9G20 - Bootstrap with SerialFlash - how do you do it?
PostPosted: Mon Aug 09, 2010 11:29 am 
Offline

Joined: Wed Feb 18, 2004 5:53 pm
Posts: 132
Location: Sweden
TKL wrote:
Our design is already through prototype testings and we will have to write the boot code for the serial flash ourselves. It is possible to implement it and we will have to do it. Unfortunately it is ~1 week of work which was not planned.

I do not understand why Atmel sells some serial flashes as dataflash, this started the confusion and the whole problem.


The AT45 was the original SPI flash.
This had a lot of features not present in SPI EEPROM
and it was not designed to be compatible with the SPI EEPROM.
Since then some people have designed reduced functionality
flash memories with SPI interface which are called "serial flash".
These have an SPI EEPROM pinout and is based on the same
instruction set as the SPI EEPROM.
They are slightly cheaper, but are not that suitable for data
storage.

_________________
Best Regards
Ulf Samuelsson


Top
 Profile  
 
 Post subject: Re: AT91SAM9G20 - Bootstrap with SerialFlash - how do you do it?
PostPosted: Mon Aug 09, 2010 11:52 am 
Offline

Joined: Thu Feb 11, 2010 7:47 pm
Posts: 29
I would really like to use a AT45 Dataflash. The problem is that it is not available on the market. And there is no "working out of the box" alternative. I think this is a no go.


Top
 Profile  
 
 Post subject: Re: AT91SAM9G20 - Bootstrap with SerialFlash - how do you do it?
PostPosted: Tue Aug 10, 2010 4:36 pm 
Offline

Joined: Mon Jul 05, 2010 8:10 am
Posts: 38
Quote:
They are slightly cheaper, but are not that suitable for data
storage.

What do you mean with not suitable for data
storage. Why?


Top
 Profile  
 
 Post subject: Re: AT91SAM9G20 - Bootstrap with SerialFlash - how do you do it?
PostPosted: Wed Nov 10, 2010 11:40 pm 
Offline

Joined: Thu Aug 27, 2009 4:15 pm
Posts: 12
Hi,

I was able to boot Linux directly from Serial Flash
thanks to http://free-electrons.com/blog/at91bootstrap-linux/
with AT91bootstrap Project 3.0.
http://www.atmel.com/dyn/products/tools ... ol_id=4343


But now I have another problem...
Linux is complaining about: IRQ 1: too many spurious IRQs. and then it hangs...

---------------------------screen capture--------------------------------

-- AT91bootstrap Project 3.0 --
-- AT91SAM9G20-EK
-- Compiled: Nov 10 2010 14:46:43 --
Setting: MCK = 132MHz
Init SDRAM
Init AT26 Serialflash
SerialFlash detected : M25P128
Copy Image from SerialFlash 0x00040000 (20 bytes) to 020000000
Jump to 0x20008000
Uncompressing Linux... done, booting the kernel.
Linux version 2.6.34 (root@spica) (gcc version 4.3.3 (GCC) ) #58 Tue Nov 9 15:03:36 SAST 2010
CPU: ARM926EJ-S [41069265] revision 5 (ARMv5TEJ), cr=00053177
CPU: VIVT data cache, VIVT instruction cache
Machine: Atmel AT91SAM9G20 Installers Friend
Warning: bad configuration page, trying to continue
Memory policy: ECC disabled, Data cache writeback
Clocks: CPU 396 MHz, master 132 MHz, main 18.432 MHz
Built 1 zonelists in Zone order, mobility grouping on. Total pages: 16256
Kernel command line: mem=64M console=ttyS0,115200 root=/dev/mtdblock1 rw rootfstype=jffs2
PID hash table entries: 256 (order: -2, 1024 bytes)
Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)
Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)
Memory: 64MB = 64MB total
Memory: 62500k/62500k available, 3036k reserved, 0K highmem
Virtual kernel memory layout:
vector : 0xffff0000 - 0xffff1000 ( 4 kB)
fixmap : 0xfff00000 - 0xfffe0000 ( 896 kB)
DMA : 0xffc00000 - 0xffe00000 ( 2 MB)
vmalloc : 0xc4800000 - 0xfee00000 ( 934 MB)
lowmem : 0xc0000000 - 0xc4000000 ( 64 MB)
pkmap : 0xbfe00000 - 0xc0000000 ( 2 MB)
modules : 0xbf000000 - 0xbfe00000 ( 14 MB)
.init : 0xc0008000 - 0xc001e000 ( 88 kB)
.text : 0xc001e000 - 0xc023a000 (2160 kB)
.data : 0xc023a000 - 0xc0250da0 ( 92 kB)
NR_IRQS:192
AT91: 96 gpio irqs in 3 banks
IRQ 1: too many spurious IRQs, disabling and polling for 10k 10msec intervals.
IRQ 1: system performance may be affected
handlers:
[<c00281b8>]
console [ttyS0] enabled
Calibrating delay loop...

------------------------------------------------------------------------------

I noticed in the AT91bootstrap Project 3.0 there is a AIC initialization code in the low_level init, where as in the boostrap-v1.16 there is none and the drivers are not even included.

on another project I used nand with the boostrap-v1.16
http://www.atmel.com/dyn/products/tools ... ol_id=4093
and I did not encounter this issue

Any help or suggestions would be appreciated.

thanks,
Lucas


Top
 Profile  
 
 Post subject: Re: AT91SAM9G20 - Bootstrap with SerialFlash - how do you do it?
PostPosted: Thu Nov 11, 2010 1:06 am 
Offline

Joined: Sat Oct 30, 2010 6:04 pm
Posts: 482
Determine which GPIO's or Peripherals are generating these interrupts on your board.


Top
 Profile  
 
 Post subject: Re: AT91SAM9G20 - Bootstrap with SerialFlash - how do you do it?
PostPosted: Thu Nov 11, 2010 9:44 pm 
Offline

Joined: Wed Jan 09, 2008 5:09 pm
Posts: 182
Location: Mounds View, MN
I had a similar issue because the RTTINCIEN bit in the RTT_MR register was set and not cleared on power up because the register is battery backed up. If you have a battery powered VDDBU, remove the battery and see if the error goes away. We had to modify the kernel code to clear this bit on kernel initialization before any interrupts were initialized.

_________________
Tim Barr
Multitech Inc.


Top
 Profile  
 
 Post subject: Re: AT91SAM9G20 - Bootstrap with SerialFlash - how do you do it?
PostPosted: Fri Nov 12, 2010 4:38 am 
Offline

Joined: Sat Oct 30, 2010 6:04 pm
Posts: 482
Good to know. Sounds like something that could be addressed by the boot loader.


Top
 Profile  
 
 Post subject: Re: AT91SAM9G20 - Bootstrap with SerialFlash - how do you do it?
PostPosted: Fri Nov 12, 2010 9:41 am 
Offline

Joined: Thu Aug 27, 2009 4:15 pm
Posts: 12
Hi,

Thanks for the suggestions.

I did what you said Tim but the problem is still present, it helped me though on another project using Nand.

Like CptTitanic suggested: "Determine which GPIO's or Peripherals are generating these interrupts on your board"

I took my AT91SAM9G20-EK Rev.B board and added a M25P128 Serial Flash, the problem is present, but if I execute the kernel from Nand then it it is not present...

So it must be the SPI peripheral that causes this interrupt??

Thanks,
Lucas.


Top
 Profile  
 
 Post subject: Re: AT91SAM9G20 - Bootstrap with SerialFlash - how do you do it?
PostPosted: Mon Nov 15, 2010 9:45 pm 
Offline

Joined: Thu Aug 27, 2009 4:15 pm
Posts: 12
Hi,

I am still struggling with this one...
I added some debug messages and as soon as the at91sam926x_pit_init is setup and the interrupt handler is assigned the spurious interrupts is picked up by the kernel.
I added debug in there to read the SPI status register (AT91_SPI_SR) at the time the spurious interrupts occur but it staid at 0.
I also cleared the RTTINCIEN bit in the RTT_MR register before the AIC and interrupts are initialised.

I Also did a test with NAND when booting with u-boot the kernel boots fine and my SPI interface also works fine adding 3 partitions on the M25P128.

I will try to compile u-boot with spi support to execute the kernel instead of booting it directly.

I know it is just one bit that must be set or cleared but to find this bit is busy making me a old and grumpy person...


Top
 Profile  
 
 Post subject: Re: AT91SAM9G20 - Bootstrap with SerialFlash - how do you do it?
PostPosted: Mon Nov 15, 2010 10:38 pm 
Offline

Joined: Sat Oct 30, 2010 6:04 pm
Posts: 482
Sounds like either RomBoot or AT91BootStrap, or u-boot is leaving something amiss on Serial Flash boot. Can't say I've seen this on NAND 9260/9G20 booting either.

If not the SPI, perhaps an interrupt driven by a toggling GPIO. At this point I'd probably start dumping out the peripheral space and diff'ing the working vs not-working. The 9260 has 16KB of space for AT91BootStrap, so diagnostics can be added in there. Don't see much in there that would enable interrupts, or GPIO's oddly. RomBoot's another matter, no source, and only a rough disassembly.

You could put AT91BootStrap and/or u-boot into NAND, and have them subsequently load out of SPI. This would let you bisect the problem and find which is to blame.

It would make me old and grumpy too, but I'm both already.


Top
 Profile  
 
 Post subject: Re: AT91SAM9G20 - Bootstrap with SerialFlash - how do you do it?
PostPosted: Tue Nov 16, 2010 1:30 pm 
Offline

Joined: Thu Aug 27, 2009 4:15 pm
Posts: 12
Hi,

U-boot solved my problem...

I compiled u-boot to support my spi flash, and then used u-boot to boot my kernel.

I would still like to know what register is causing this and will post a answer as soon as I've got one.

But at least for now I can continue with my work...

--------------------------------------------------------------------------------

U-Boot> bootcmd=sf probe 0 15000000 0; sf read 0x20000000 0x80000 0x220000; bootm 0x20000000
Unknown command 'bootcmd=sf' - try 'help'
## Booting kernel from Legacy Image at 20000000 ...
Image Name: Linux-2.6.34
Image Type: ARM Linux Kernel Image (uncompressed)
Data Size: 899200 Bytes = 878.1 KiB
Load Address: 20008000
Entry Point: 20008000
Verifying Checksum ... OK
Loading Kernel Image ... OK
OK

Starting kernel ...

Uncompressing Linux... done, booting the kernel.
<5>Linux version 2.6.34 (root@spica) (gcc version 4.3.3 (GCC) ) #92 Mon Nov 15 16:27:04 SAST 2010
CPU: ARM926EJ-S [41069265] revision 5 (ARMv5TEJ), cr=00053177
CPU: VIVT data cache, VIVT instruction cache
Machine: Atmel AT91SAM9G20
Memory policy: ECC disabled, Data cache writeback
Clocks: CPU 396 MHz, master 132 MHz, main 18.432 MHz
Built 1 zonelists in Zone order, mobility grouping on. Total pages: 16256
Kernel command line: console=ttyS0,115200 root=/dev/mtdblock0 mtdparts=atmel_nand:-(root) rw rootfstype=jffs2
PID hash table entries: 256 (order: -2, 1024 bytes)
Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)
Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)
Memory: 64MB = 64MB total
Memory: 62408k/62408k available, 3128k reserved, 0K highmem
Virtual kernel memory layout:
vector : 0xffff0000 - 0xffff1000 ( 4 kB)
fixmap : 0xfff00000 - 0xfffe0000 ( 896 kB)
DMA : 0xffc00000 - 0xffe00000 ( 2 MB)
vmalloc : 0xc4800000 - 0xfee00000 ( 934 MB)
lowmem : 0xc0000000 - 0xc4000000 ( 64 MB)
pkmap : 0xbfe00000 - 0xc0000000 ( 2 MB)
modules : 0xbf000000 - 0xbfe00000 ( 14 MB)
.init : 0xc0008000 - 0xc001f000 ( 92 kB)
.text : 0xc001f000 - 0xc024f000 (2240 kB)
.data : 0xc0250000 - 0xc0268080 ( 97 kB)
NR_IRQS:192
AT91: 96 gpio irqs in 3 banks
console [ttyS0] enabled
Calibrating delay loop... 197.83 BogoMIPS (lpj=989184)
Mount-cache hash table entries: 512
CPU: Testing write buffer coherency: ok
NET: Registered protocol family 16
pwm_init
bio: create slab <bio-0> at 0
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
Switching to clocksource pit
NET: Registered protocol family 2
IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
TCP established hash table entries: 2048 (order: 2, 16384 bytes)
TCP bind hash table entries: 2048 (order: 1, 8192 bytes)
TCP: Hash tables configured (established 2048 bind 2048)
TCP reno registered
UDP hash table entries: 256 (order: 0, 4096 bytes)
UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
NET: Registered protocol family 1
squashfs: version 4.0 (2009/01/31) Phillip Lougher
Registering mini_fo version $Id$
JFFS2 version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc.
msgmni has been set to 121
io scheduler noop registered
io scheduler deadline registered (default)
gpiodev: gpio device registered with major 253
atmel_usart.0: ttyS0 at MMIO 0xfefff200 (irq = 1) is a ATMEL_SERIAL
nand_get_flash_type: second ID read did not match 00,a0 against ff,00
No NAND device found.
atmel_spi atmel_spi.0: Atmel SPI Controller at 0xfffc8000 (irq 12)
m25p80 spi0.0: m25p128 (16384 Kbytes)
Creating 3 MTD partitions on "spi_flash":
0x000000000000-0x000000003000 : "partition 1"
mtd: Giving out device 0 to partition 1
0x000000040000-0x000000130000 : "partition 2"
mtd: partition "partition 2" must either start or end on erase block boundary or be smaller than an erase block -- forcing read-only
mtd: Giving out device 1 to partition 2
0x000000140000-0x000000940000 : "partition 3"
mtd: Giving out device 2 to partition 3

-----------------------------------------------------------------------------------

Thanks CptTitanic, at least I am not grumpy anymore :-)


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 57 posts ]  Go to page Previous  1, 2, 3, 4

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: Google [Bot] and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: