]> git.sur5r.net Git - u-boot/blobdiff - board/bf533-ezkit/flash.c
Fix spelling of "occurred".
[u-boot] / board / bf533-ezkit / flash.c
index a861e16a3df40790d25009840bc239b9f3d888b6..a7b3519d95057b68f8fbe23dc5203f3809af585e 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * U-boot - flash.c Flash driver for PSD4256GV
+ * U-Boot - flash.c Flash driver for PSD4256GV
  *
  * Copyright (c) 2005-2007 Analog Devices Inc.
  * This file is based on BF533EzFlash.c originally written by Analog Devices, Inc.
@@ -7,28 +7,16 @@
  * (C) Copyright 2000-2004
  * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
  *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
- * MA 02110-1301 USA
+ * SPDX-License-Identifier:    GPL-2.0+
  */
 
 #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 +111,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 +199,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 +218,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 +293,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)
@@ -332,7 +320,7 @@ int poll_toggle_bit(long lOffset)
                }
                timeout--;
        }
-       printf("Time out occured \n");
+       printf("Time out occurred \n");
        if (timeout < 0)
                return FLASH_FAIL;
 }
@@ -394,7 +382,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);