MPC8309 boot from SPI Flash

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

MPC8309 boot from SPI Flash

2,651 Views
Huzhu1984
Contributor I

Hi:
There is a problem we met when the MPC8309 on our dev board trying to boot from a SPI Flash. We configure the MPC8309 to read reset configuration word from I2C EEPROM. The configuration word is: RCWLR=0x4405_0008 RCWHR=0xA430_0000. So MPC8309 is to boot from SPI Flash as described in the datasheet. The SPI CLK activates to read data. It goes well in reading all the data specific in Table5-5 until we try to configure the internal registers by using "Config Address/Data" pairs. That is, when we try to give a value to 0xFF40_nnnn, the SPI controller stop to read and the CPU is hanged!

If we don't configure any internal register and just end configuration with EC instruction(Described in Table5-7), The SPI start to read "User's Code". But after several bytes the process is down, too. In this case, we think the cause is that no local access window is enabled for DDR SDRAM controller. So, it seems that 0xFF40_nnnn is not a legal address, but the default value of IMMRBAR is indicated to be 0xFF40_0000 in the datasheet.
Any suggestion? Thank you.

7 Replies

987 Views
usingbothmuxand
Contributor II

Hi,

 

i am facing the same problem. My MPC8309 TWR board not booting .i am using MPC TWR board. i am trying to boot the TWr board from SPI. i have interfaced an spi device to the connector and routed the spi signals.  ihave routed SPI _boot sel to CS of slave device.
i have done the following modification in the MPC8309 TWR board

1)  i have modified the reset conf words to '1111' to boot from SPI.
2)  SPI signals
3) SYS_CLK is 33MHz

i have followed AN3659 to create an SPI image and loaded in the SPI device through a third party tool.

i have also read the flash locations. i read same values. is there anything to be changed in uboot? i am using the default uboot provided with twr board.
I have monitored the DDR clock on the MPC8309 TWR board. i could see 131MHZ clock on those pins.
means that i am able to read the data from serial flash. if i modify the BOOT signature my DDR clock is not generated.
this is how i confirmed that SPI boot is ok. my u-boot is present @0x400 location in the serial flash. but still my system is not booting.  i could not use a debugger as JTAG is not working in my TWR board. following is my .dat file
40:424f4f54
44:00000000
48:00077EE0    
4c:00000000
50:00000400    
54:00000000
58:01000000             
5c:00000000
60:01000100    
64:00000000
68:00000013


80:fff0211C
84:8000C000
88:fff02000  
8c:00000007  

90:fff02080  
94:80840102

98:fff02100  
9c:00000000

a0:fff02104  
a4:00220802

a8:fff02108  
ac:26256222

b0:fff0210c  
b4:0f9028c7

b8:fff02114  
bc:00401000

c0:fff02118  
c4:44400232

c8:fff02124  
cc:03200064

d0:fff02130  
d4:02000000

d8:40000001  
dc:00000100

e0:fff02128  
e4:73000002

e8:fff02110  
ec:C3080008

f0:fff000A0  
f4:00000000

f8:fff000A4  
fc:8000001b

100:20000001
104:21172210

108:40000001  
10C:00000300

110:efefefef
0 Kudos

987 Views
kimmoli
Contributor I

I'm having excatly this same issue, booting from SPI.

When i have only one config word, END OF CONFIG 0x8000_0001 it reads that and starts to copy data from SPI flash to somewhere,

but what ever other config word i have, the process is halted.

(also the number of config words value seems to have no meaning)

I have tried to write to 0xff40_2000 (DDR controller) - halts

I have tried to write to 0xff40_0c00 (GPIO) - halts

Did anyone found a solution for this?


Actually the IMMRBAR  0xFFF0_0000 works for me. Writing to 0xFFF0_0c00 (GPIO) works,. i can toggle GPIO with config word.

Using MPC8306 here btw.

987 Views
evgeniytabakov
Contributor I

Hello. Have you been able to boot u-boot from SPI Flash?

0 Kudos

987 Views
AlexP
NXP Employee
NXP Employee

I'm not sure if you managed to get your board working in the meantime, but here is a piece of data that isn't easily available:

For SD or SPI boot, IMMRBAR is modified from the reset default of 0xff400000 to 0xfff00000 by the 8309 ROM boot loader.

 

So you should appropriately change the addresses you are trying to write to, taking the new base address into account.

 

0 Kudos

987 Views
ruizhengxin
Contributor II

Hi all,

I want to boot from TF card, and the BOOT_CFG[0:3] is configured to 1101, I can watch the SD_CLK wave at the TF connector pin, but it seems to halted, didn't go further. In AN3659 and MPC8309RM, the configuration file need to define some addresses, I'm not very sure about how to set the address, and how to modify in U-Boot. Alexandru Popa said the IMMAR is modified to 0xfff00000 by 8309 ROM bootloader, I tried to modify in configursation data, but still no use.

My question is 8309 how to define the Target address and Execution address, and what is the difference between Execution address and RESET_VECTOR_ADDRESS?

0 Kudos

987 Views
TomE
Specialist II

Make sure the least significant bit (bit 31) of the configuration word address is CLEAR to signify addresses.

 

> local access window is enabled for DDR SDRAM controller.

 

Can you initialise the DDR controller using this mechanism? I thought you'd need to do that from code loaded into SRAM.

It might be easier to load code into SRAM that configures the peripherals and DDR and then have it load the main code. Except this CPU doesn't have internal SRAM, does it?

 

Does Freescale provide any working examples with the development board or elsewhere?

 

Could this be relevant?

 

>> 4.3.3.2.3 EEPROM Data Format in Reset Configuration Mode

>> IMMRBAR value is prepended to the EEPROM address to generate the complete

>> memory-mapped register’s address.

You shouldn't attach huge Reference Manuals or Data Sheets to your posts. That's a waste of space. We know where to get these from anyway. Just post LINKS to the documents on Freescale's web site instead.

 

Tom

 

 

0 Kudos

987 Views
Huzhu1984
Contributor I

Tom: 

I'm sure I have cleared bit31 of configuration word address and there is no SRAM internal or external.

 

Freescale does provide an example on some chips with similar implementation of boot. See http://cache.freescale.com/files/32bit/doc/app_note/AN3659.pdf

 

 I have checked the datasheet many time, I just don't understand why MPC8309 does not accept any of the Config Address/Data pair burned in the SPI Flash.

 

About the attachment, I am a rookie here and I will never do that again :smileyhappy:

 

Thank you for help.

0 Kudos