]> git.sur5r.net Git - u-boot/blobdiff - board/bf533-ezkit/flash.c
Merge branch 'u-boot/master' into 'u-boot-arm/master'
[u-boot] / board / bf533-ezkit / flash.c
index a861e16a3df40790d25009840bc239b9f3d888b6..e4fcd1e39d2e6c455a4ca33804c693fcc5441f22 100644 (file)
 #include <asm/io.h>
 #include "flash-defines.h"
 
+int AFP_NumSectors = 40;
+long AFP_SectorSize1 = 0x10000;
+int AFP_SectorSize2 = 0x4000;
+
 void flash_reset(void)
 {
        reset_flash();
@@ -123,7 +127,7 @@ void flash_print_info(flash_info_t * info)
                printf("ST Microelectronics ");
                break;
        default:
-               printf("Unknown Vendor: (0x%08X) ", info->flash_id);
+               printf("Unknown Vendor: (0x%08lX) ", info->flash_id);
                break;
        }
        for (i = 0; i < info->sector_count; ++i) {
@@ -211,7 +215,7 @@ int write_data(long lStart, long lCount, uchar * pnData)
                read_flash(ulOffset, &d);
                if (d != 0xffff) {
                        printf
-                           ("Flash not erased at offset 0x%x Please erase to reprogram \n",
+                           ("Flash not erased at offset 0x%lx Please erase to reprogram\n",
                             ulOffset);
                        return FLASH_FAIL;
                }
@@ -230,7 +234,7 @@ int write_data(long lStart, long lCount, uchar * pnData)
                read_flash(ulOffset, &d);
                if (d != 0xffff) {
                        printf
-                           ("Flash not erased at offset 0x%x Please erase to reprogram \n",
+                           ("Flash not erased at offset 0x%lx Please erase to reprogram\n",
                             ulOffset);
                        return FLASH_FAIL;
                }
@@ -305,7 +309,7 @@ int read_flash(long nOffset, int *pnValue)
        nValue = *(volatile unsigned short *)addr;
        SSYNC();
        *pnValue = nValue;
-       return TRUE;
+       return true;
 }
 
 int poll_toggle_bit(long lOffset)
@@ -394,7 +398,7 @@ int erase_block_flash(int nBlock, unsigned long address)
        long ulSectorOff = 0x0;
 
        if ((nBlock < 0) || (nBlock > AFP_NumSectors))
-               return FALSE;
+               return false;
 
        ulSectorOff = (address - CONFIG_SYS_FLASH_BASE);