- int i;
- int cf_stat = 0;
-
- /* Check whether CF card is inserted */
- *pFIO_EDGE = FIO_EDGE_CF_BITS;
- *pFIO_POLAR = FIO_POLAR_CF_BITS;
- for (i = 0; i < 0x300; i++)
- asm("nop;");
-
- if ((*pFIO_FLAG_S) & CF_STAT_BITS) {
- cf_stat = 0;
- } else {
- cf_stat = 1;
- }
-
- *pFIO_EDGE = FIO_EDGE_BITS;
- *pFIO_POLAR = FIO_POLAR_BITS;
-
- if (cf_stat) {
- printf("Booting from COMPACT flash\n");
-
- /* Set cycle time for CF */
- *(volatile unsigned long *)ambctl1 = CF_AMBCTL1VAL;
-
- for (i = 0; i < 0x1000; i++)
- asm("nop;");
- for (i = 0; i < 0x1000; i++)
- asm("nop;");
- for (i = 0; i < 0x1000; i++)
- asm("nop;");
-
- serial_setbrg();
- ide_init();
-
- setenv("bootargs", "");
- setenv("bootcmd",
- "fatload ide 0:1 0x1000000 uImage-stamp;bootm 0x1000000;bootm 0x20100000");
- } else {
- printf("Booting from FLASH\n");
- }