]> git.sur5r.net Git - u-boot/blobdiff - board/hymod/flash.c
ARM: mxs: Add Creative ZEN XFi3 board
[u-boot] / board / hymod / flash.c
index ad0a229d9f07d35fe71b2fa92a12eb3dfbd36446..02e519c695e7b5fc7977c94ac0e59ee8b41a4e8f 100644 (file)
@@ -2,23 +2,7 @@
  * (C) Copyright 2000
  * 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., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
+ * SPDX-License-Identifier:    GPL-2.0+
  *
  * Hacked for the Hymod board by Murray.Jensen@csiro.au, 20-Oct-00
  */
@@ -27,7 +11,7 @@
 #include <mpc8260.h>
 #include <board/hymod/flash.h>
 
-flash_info_t flash_info[CFG_MAX_FLASH_BANKS];  /* info for FLASH chips */
+flash_info_t flash_info[CONFIG_SYS_MAX_FLASH_BANKS];   /* info for FLASH chips */
 
 /*-----------------------------------------------------------------------
  * Protection Flags:
@@ -95,7 +79,7 @@ bank_probe (flash_info_t *fip, volatile bank_addr_t base)
                        (unsigned long)word, (unsigned long)base);
        }
 
-       if (fip->sector_count >= CFG_MAX_FLASH_SECT)
+       if (fip->sector_count >= CONFIG_SYS_MAX_FLASH_SECT)
                panic ("\ntoo many sectors (%d) in flash at address 0x%08lx",
                        fip->sector_count, (unsigned long)base);
 
@@ -198,7 +182,7 @@ bank_write_word (volatile bank_addr_t addr, bank_word_t value)
        /* data polling for D7 */
        start = get_timer (0);
        do {
-               if (get_timer (start) > CFG_FLASH_WRITE_TOUT) {
+               if (get_timer (start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
                        retval = 1;
                        goto done;
                }
@@ -228,30 +212,30 @@ flash_init (void)
        int i;
 
        /* Init: no FLASHes known */
-       for (i=0; i<CFG_MAX_FLASH_BANKS; ++i) {
+       for (i=0; i<CONFIG_SYS_MAX_FLASH_BANKS; ++i) {
                flash_info[i].flash_id = FLASH_UNKNOWN;
        }
 
-       bank_probe (&flash_info[0], (bank_addr_t)CFG_FLASH_BASE);
+       bank_probe (&flash_info[0], (bank_addr_t)CONFIG_SYS_FLASH_BASE);
 
        /*
         * protect monitor and environment sectors
         */
 
-#if CFG_MONITOR_BASE == CFG_FLASH_BASE
+#if CONFIG_SYS_MONITOR_BASE == CONFIG_SYS_FLASH_BASE
        (void)flash_protect (FLAG_PROTECT_SET,
-                     CFG_MONITOR_BASE,
-                     CFG_MONITOR_BASE+monitor_flash_len-1,
+                     CONFIG_SYS_MONITOR_BASE,
+                     CONFIG_SYS_MONITOR_BASE+monitor_flash_len-1,
                      &flash_info[0]);
 #endif
 
-#if defined(CFG_FLASH_ENV_ADDR)
+#if defined(CONFIG_SYS_FLASH_ENV_ADDR)
        (void)flash_protect (FLAG_PROTECT_SET,
-                     CFG_FLASH_ENV_ADDR,
-#if defined(CFG_FLASH_ENV_BUF)
-                     CFG_FLASH_ENV_ADDR + CFG_FLASH_ENV_BUF - 1,
+                     CONFIG_SYS_FLASH_ENV_ADDR,
+#if defined(CONFIG_SYS_FLASH_ENV_BUF)
+                     CONFIG_SYS_FLASH_ENV_ADDR + CONFIG_SYS_FLASH_ENV_BUF - 1,
 #else
-                     CFG_FLASH_ENV_ADDR + CFG_FLASH_ENV_SIZE - 1,
+                     CONFIG_SYS_FLASH_ENV_ADDR + CONFIG_SYS_FLASH_ENV_SIZE - 1,
 #endif
                      &flash_info[0]);
 #endif
@@ -368,7 +352,7 @@ flash_erase (flash_info_t *info, int s_first, int s_last)
                        do {
                                now = get_timer (start);
 
-                               if (now - estart > CFG_FLASH_ERASE_TOUT) {
+                               if (now - estart > CONFIG_SYS_FLASH_ERASE_TOUT) {
                                        printf ("Timeout (sect %d)\n", sect);
                                        haderr = 1;
                                        rcode = 1;