]> git.sur5r.net Git - openocd/blobdiff - src/flash/s3c2410_nand.c
ocd_flash_banks now returns empty list when no flash banks are configured instead...
[openocd] / src / flash / s3c2410_nand.c
index 436eb156a66fe8ad9a82282d982141e09948cca7..fabcfbd54ba1a096103285cebb079c0edd78e3e0 100644 (file)
@@ -1,14 +1,26 @@
-/* src/flash/s3c2410_nand.c
- *
+/***************************************************************************
+ *   Copyright (C) 2007, 2008 by Ben Dooks                                 *
+ *   ben@fluff.org                                                         *
+ *                                                                         *
+ *   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.,                                       *
+ *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
+ ***************************************************************************/
+
+/*
  * S3C2410 OpenOCD NAND Flash controller support.
  *
- * Copyright 2007,2008 Ben Dooks <ben@fluff.org>
- *
- * 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.
- *
  * Many thanks to Simtec Electronics for sponsoring this work.
  */
 
@@ -87,7 +99,7 @@ int s3c2410_write_data(struct nand_device_s *device, u16 data)
        target_t *target = s3c24xx_info->target;
 
        if (target->state != TARGET_HALTED) {
-               ERROR("target must be halted to use S3C24XX NAND flash controller");
+               LOG_ERROR("target must be halted to use S3C24XX NAND flash controller");
                return ERROR_NAND_OPERATION_FAILED;
        }
        
@@ -101,7 +113,7 @@ int s3c2410_read_data(struct nand_device_s *device, void *data)
        target_t *target = s3c24xx_info->target;
        
        if (target->state != TARGET_HALTED) {
-               ERROR("target must be halted to use S3C24XX NAND flash controller");
+               LOG_ERROR("target must be halted to use S3C24XX NAND flash controller");
                return ERROR_NAND_OPERATION_FAILED;
        }
 
@@ -116,7 +128,7 @@ int s3c2410_nand_ready(struct nand_device_s *device, int timeout)
        u8 status;
 
        if (target->state != TARGET_HALTED) {
-               ERROR("target must be halted to use S3C24XX NAND flash controller");
+               LOG_ERROR("target must be halted to use S3C24XX NAND flash controller");
                return ERROR_NAND_OPERATION_FAILED;
        }
        
@@ -126,7 +138,7 @@ int s3c2410_nand_ready(struct nand_device_s *device, int timeout)
                if (status & S3C2410_NFSTAT_BUSY)
                        return 1;
 
-               usleep(1000);           
+               alive_sleep(1);         
        } while (timeout-- > 0);
 
        return 0;