rename CFG_ macros to CONFIG_SYS
[platform/kernel/u-boot.git] / board / bf533-stamp / bf533-stamp.c
index b9dff99..a113c40 100644 (file)
@@ -30,6 +30,8 @@
 #include <asm/io.h>
 #include "bf533-stamp.h"
 
+DECLARE_GLOBAL_DATA_PTR;
+
 #define STATUS_LED_OFF 0
 #define STATUS_LED_ON  1
 
 
 int checkboard(void)
 {
-#if (BFIN_CPU == ADSP_BF531)
-       printf("CPU:   ADSP BF531 Rev.: 0.%d\n", *pCHIPID >> 28);
-#elif (BFIN_CPU == ADSP_BF532)
-       printf("CPU:   ADSP BF532 Rev.: 0.%d\n", *pCHIPID >> 28);
-#else
-       printf("CPU:   ADSP BF533 Rev.: 0.%d\n", *pCHIPID >> 28);
-#endif
        printf("Board: ADI BF533 Stamp board\n");
        printf("       Support: http://blackfin.uclinux.org/\n");
        return 0;
 }
 
-long int initdram(int board_type)
+phys_size_t initdram(int board_type)
 {
-       DECLARE_GLOBAL_DATA_PTR;
 #ifdef DEBUG
        printf("SDRAM attributes:\n");
        printf
            ("  tRCD:%d Cycles; tRP:%d Cycles; tRAS:%d Cycles; tWR:%d Cycles; "
             "CAS Latency:%d cycles\n", (SDRAM_tRCD >> 15), (SDRAM_tRP >> 11),
             (SDRAM_tRAS >> 6), (SDRAM_tWR >> 19), (SDRAM_CL >> 2));
-       printf("SDRAM Begin: 0x%x\n", CFG_SDRAM_BASE);
+       printf("SDRAM Begin: 0x%x\n", CONFIG_SYS_SDRAM_BASE);
        printf("Bank size = %d MB\n", 128);
 #endif
-       gd->bd->bi_memstart = CFG_SDRAM_BASE;
-       gd->bd->bi_memsize = CFG_MAX_RAM_SIZE;
+       gd->bd->bi_memstart = CONFIG_SYS_SDRAM_BASE;
+       gd->bd->bi_memsize = CONFIG_SYS_MAX_RAM_SIZE;
        return (gd->bd->bi_memsize);
 }
 
@@ -75,9 +69,9 @@ void swap_to(int device_id)
 
        if (device_id == ETHERNET) {
                *pFIO_DIR = PF0;
-               sync();
+               SSYNC();
                *pFIO_FLAG_S = PF0;
-               sync();
+               SSYNC();
        } else if (device_id == FLASH) {
                *pFIO_DIR = (PF4 | PF3 | PF2 | PF1 | PF0);
                *pFIO_FLAG_S = (PF4 | PF3 | PF2);
@@ -87,7 +81,7 @@ void swap_to(int device_id)
                *pFIO_EDGE = (PF8 | PF7 | PF6 | PF5);
                *pFIO_INEN = (PF8 | PF7 | PF6 | PF5);
                *pFIO_FLAG_D = (PF4 | PF3 | PF2);
-               sync();
+               SSYNC();
        } else {
                printf("Unknown bank to switch\n");
        }
@@ -154,15 +148,15 @@ void cf_outb(unsigned char val, volatile unsigned char *addr)
         */
        *pFIO_FLAG_S = CF_PF0;
        *pFIO_FLAG_C = CF_PF1;
-       sync();
+       SSYNC();
 
        *(addr) = val;
-       sync();
+       SSYNC();
 
        /* Setback PF1 PF0 to 0 0 to address external
         * memory banks  */
        *(volatile unsigned short *)pFIO_FLAG_C = CF_PF1_PF0;
-       sync();
+       SSYNC();
 }
 
 unsigned char cf_inb(volatile unsigned char *addr)
@@ -171,13 +165,13 @@ unsigned char cf_inb(volatile unsigned char *addr)
 
        *pFIO_FLAG_S = CF_PF0;
        *pFIO_FLAG_C = CF_PF1;
-       sync();
+       SSYNC();
 
        c = *(addr);
-       sync();
+       SSYNC();
 
        *pFIO_FLAG_C = CF_PF1_PF0;
-       sync();
+       SSYNC();
 
        return c;
 }
@@ -188,15 +182,15 @@ void cf_insw(unsigned short *sect_buf, unsigned short *addr, int words)
 
        *pFIO_FLAG_S = CF_PF0;
        *pFIO_FLAG_C = CF_PF1;
-       sync();
+       SSYNC();
 
        for (i = 0; i < words; i++) {
                *(sect_buf + i) = *(addr);
-               sync();
+               SSYNC();
        }
 
        *pFIO_FLAG_C = CF_PF1_PF0;
-       sync();
+       SSYNC();
 }
 
 void cf_outsw(unsigned short *addr, unsigned short *sect_buf, int words)
@@ -205,15 +199,15 @@ void cf_outsw(unsigned short *addr, unsigned short *sect_buf, int words)
 
        *pFIO_FLAG_S = CF_PF0;
        *pFIO_FLAG_C = CF_PF1;
-       sync();
+       SSYNC();
 
        for (i = 0; i < words; i++) {
                *(addr) = *(sect_buf + i);
-               sync();
+               SSYNC();
        }
 
        *pFIO_FLAG_C = CF_PF1_PF0;
-       sync();
+       SSYNC();
 }
 #endif
 
@@ -234,7 +228,7 @@ void stamp_led_set(int LED1, int LED2, int LED3)
                *pFIO_FLAG_S = PF4;
        else
                *pFIO_FLAG_C = PF4;
-       sync();
+       SSYNC();
 }
 
 void show_boot_progress(int status)