In my board, I used two SDRAM chip (MT48LC16M16A2). This chip was used in at91sam9260-ek too.
The 18.432 MHZ oscillator was used also in my board.
But when I connected the board to pc via USB and run the SAM-BA. The sam-ba send a message that couldn't initialized the RAM.
after searching in the google, I found that if I change the bus width to 16bit, the problem maybe solved.
So, I change the bus width in the tcl file in samba.
Quote:
sam-ba 2.9\applets\isp-project\tcl_lib\at91sam9260-ek
After this modification, the samba could initialized the sdram, and I could upload the files (bootloader,bootstrap,kernel, RFS) to the NAND Flash.
But the serial console not worked after programming.
With these descriptions, Do I change or modify any code in bootstrap?
SDRAM and Xtal in my board and 9260ek are similar to each other.
I see the section in bootstrap codes:
1- I change the AT91C_SDRAMC_DBW_32_BITS to AT91C_SDRAMC_DBW_16_BITS
Code:
/* Configure SDRAM Controller */
sdram_init( AT91C_SDRAMC_NC_9 |
AT91C_SDRAMC_NR_13 |
AT91C_SDRAMC_CAS_2 |
AT91C_SDRAMC_NB_4_BANKS |
AT91C_SDRAMC_DBW_16_BITS |
AT91C_SDRAMC_TWR_2 |
AT91C_SDRAMC_TRC_7 |
AT91C_SDRAMC_TRP_2 |
AT91C_SDRAMC_TRCD_2 |
AT91C_SDRAMC_TRAS_5 |
AT91C_SDRAMC_TXSR_8, /* Control Register */
(MASTER_CLOCK * 7)/1000000, /* Refresh Timer Register */
AT91C_SDRAMC_MD_SDRAM); /* SDRAM (no low power) */
I don't know any modification for col and row in the upper lines?
MT48LC16M16A2 in datasheet:
Quote:
16 Meg x 16 (4 Meg x 16 x 4 banks)
Refresh count = 8k
Row addressing =8K A[12:0]
Bank addressing =4 BA[1:0]
Column addressing =512 A[8:0]
Any other modification needed in codes?
2- I comment the following lines in sdramc_hw_init()
Code:
writel(0xFFFF0000, AT91C_BASE_PIOC + PIO_ASR(0));
writel(0xFFFF0000, AT91C_BASE_PIOC + PIO_PDR(0));
3- In the hw_init() is a comment
Code:
/* At this stage the main oscillator is supposed to be enabled
* PCK = MCK = MOSC */
Any code should be placed here or no?
4- A compiler switch used in bootstrap with name of "CFG_DEBUG".
I define it in "at91sam9260.h". Is it true?
5- And one question that is remain for me is that why I should change the BusWitdh in tcl file in samba for my board? Is this normal modification? or My hardware has a problem?
Thank you for your attention.
Regards