Плата SK-MAT91SAM9XE512 с процессором AT91SAM9260.
Образ бутстрап с диска заработал! Я посмотрел, чем отличаются исходники бутстрапов (моего и с диска), получилось вот, что:
- Bootstrap 1.6, взятый из образа VMWare
+ Bootstrap 1.6 с CD
at91sam9260ek.c
...
- AT91C_SDRAMC_DBW_32_BITS |
+ AT91C_SDRAMC_DBW_16_BITS |
...
- writel(0xFFFF0000, AT91C_BASE_PIOC + PIO_ASR(0));
- writel(0xFFFF0000, AT91C_BASE_PIOC + PIO_PDR(0));
+// writel(0xFFFF0000, AT91C_BASE_PIOC + PIO_ASR(0));
+// writel(0xFFFF0000, AT91C_BASE_PIOC + PIO_PDR(0));
+ writel(0x00000000, AT91C_BASE_PIOC + PIO_ASR(0));
+ writel(0x00000000, AT91C_BASE_PIOC + PIO_PDR(0));
at91sam9260ek.h:
...
-#define MASTER_CLOCK (198656000/2)
+//pi#define MASTER_CLOCK (198656000/2)
+#define MASTER_CLOCK (200000000/2)
+//#define MASTER_CLOCK (48000000)
...
-#define PLLA_SETTINGS 0x2060BF09
-#define PLLB_SETTINGS 0x10483F0E
+//#define PLLA_SETTINGS 0x2060BF09
+//#define PLLB_SETTINGS 0x10483F0E
+
+#define PLLA_SETTINGS 0x2031BF03
+//#define PLLB_SETTINGS 0x10483F0E
+#define PLLB_SETTINGS 0x10073F01
...
-#define AT91C_SPI_CLK 33000000
+//pi#define AT91C_SPI_CLK 33000000
+#define AT91C_SPI_CLK 4800000
...
+//pi#define DATAFLASH_TCSS (0x1a << 16) /* 250ns min (tCSS) <=> 12/48000000 = 250ns */
+//pi#define DATAFLASH_TCHS (0x1 << 24) /* 250ns min (tCSH) <=> (64*1+SCBR)/(2
![](images/smilies/48.gif)
000000) */
...
-#define AT91C_SPI_PCS_DATAFLASH AT91C_SPI_PCS1_DATAFLASH /* Boot on SPI NCS0 */
+//pi#define AT91C_SPI_PCS_DATAFLASH AT91C_SPI_PCS1_DATAFLASH /* Boot on SPI NCS0 */
+#define AT91C_SPI_PCS_DATAFLASH AT91C_SPI_PCS0_DATAFLASH /* Boot on SPI NCS0 */
...
-#define JUMP_ADDR 0x23F00000 /* Final Jump Address */
+//pi#define JUMP_ADDR 0x23F00000 /* Final Jump Address */
+#define JUMP_ADDR 0x21D00000 /* Final Jump Address */
...
-#undef CFG_DEBUG
+//pi#undef CFG_DEBUG
+#define CFG_DEBUG
...
dataflash.c
...
- if (!df_init(pDf))
- return -1;
+ if (!df_init(pDf))
+ {
+ dbg_print("Init error\n\r");
+ return -1;
+ }
...
- df_recovery(pDf);
+// df_recovery(pDf);
...
- if (df_is_boot_valid((unsigned char*)rxBuffer))
- return -1;
+ if (df_is_boot_valid((unsigned char*)rxBuffer))
+ {
+ dbg_print("Can't find application\n\r");
+ return -1;
+ }
+ dbg_print("Copy application ...\n\r");
sdramc.c
...
write_sdramc(SDRAMC_CR, sdramc_cr);
+ write_sdramc(SDRAMC_HSR, 1); //pi add
main.c:
...
+ dbg_print("Run ...\n\r");
+// while(1) ;
setenv.bat:
...
-set CROSS_COMPILE=arm-none-eabi-
+set CROSS_COMPILE=arm-elf-
...
-echo CROSS_COMPILE=arm-none-eabi-
-echo ERASE_FCT=del /F
+echo CROSS_COMPILE=arm-elf- ERASE_FCT=del /F