]> git.ipfire.org Git - people/ms/u-boot.git/blobdiff - board/esd/cpci405/flash.c
Add GPL-2.0+ SPDX-License-Identifier to source files
[people/ms/u-boot.git] / board / esd / cpci405 / flash.c
index 02de050b742db02691667ed71f855dd88a7ce92c..091652b6232c452259f2e6be6c2044a469400b49 100644 (file)
@@ -2,27 +2,11 @@
  * (C) Copyright 2001-2003
  * Stefan Roese, esd gmbh germany, stefan.roese@esd-electronics.com
  *
- * 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+
  */
 
 #include <common.h>
-#include <ppc4xx.h>
+#include <asm/ppc4xx.h>
 #include <asm/processor.h>
 
 /*
@@ -66,7 +50,7 @@ unsigned long flash_init (void)
        unsigned long base_b0, base_b1;
 
        /* 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;
        }
 
@@ -91,13 +75,13 @@ unsigned long flash_init (void)
                        size_b1 = 1 << 20;
                }
                base_b1 = -size_b1;
-               mtdcr (ebccfga, pb0cr);
-               pbcr = mfdcr (ebccfgd);
-               mtdcr (ebccfga, pb0cr);
+               mtdcr (EBC0_CFGADDR, PB0CR);
+               pbcr = mfdcr (EBC0_CFGDATA);
+               mtdcr (EBC0_CFGADDR, PB0CR);
                pbcr = (pbcr & 0x0001ffff) | base_b1 | (calc_size(size_b1) << 17);
-               mtdcr (ebccfgd, pbcr);
+               mtdcr (EBC0_CFGDATA, pbcr);
 #if 0 /* test-only */
-               printf("size_b1=%x base_b1=%x pb1cr = %x\n",
+               printf("size_b1=%x base_b1=%x PB1CR = %x\n",
                       size_b1, base_b1, pbcr); /* test-only */
 #endif
        }
@@ -108,13 +92,13 @@ unsigned long flash_init (void)
                        size_b0 = 1 << 20;
                }
                base_b0 = base_b1 - size_b0;
-               mtdcr (ebccfga, pb1cr);
-               pbcr = mfdcr (ebccfgd);
-               mtdcr (ebccfga, pb1cr);
+               mtdcr (EBC0_CFGADDR, PB1CR);
+               pbcr = mfdcr (EBC0_CFGDATA);
+               mtdcr (EBC0_CFGADDR, PB1CR);
                pbcr = (pbcr & 0x0001ffff) | base_b0 | (calc_size(size_b0) << 17);
-               mtdcr (ebccfgd, pbcr);
+               mtdcr (EBC0_CFGDATA, pbcr);
 #if 0 /* test-only */
-               printf("size_b0=%x base_b0=%x pb0cr = %x\n",
+               printf("size_b0=%x base_b0=%x PB0CR = %x\n",
                       size_b0, base_b0, pbcr); /* test-only */
 #endif
        }
@@ -125,7 +109,7 @@ unsigned long flash_init (void)
 
        /* monitor protection ON by default */
        flash_protect (FLAG_PROTECT_SET,
-                       base_b0 + size_b0 - CFG_MONITOR_LEN,
+                       base_b0 + size_b0 - monitor_flash_len,
                        base_b0 + size_b0 - 1, &flash_info[0]);
 
        if (size_b1) {
@@ -136,11 +120,11 @@ unsigned long flash_init (void)
 
                /* monitor protection ON by default */
                flash_protect (FLAG_PROTECT_SET,
-                               base_b1 + size_b1 - CFG_MONITOR_LEN,
+                               base_b1 + size_b1 - monitor_flash_len,
                                base_b1 + size_b1 - 1, &flash_info[1]);
                /* monitor protection OFF by default (one is enough) */
                flash_protect (FLAG_PROTECT_CLEAR,
-                               base_b0 + size_b0 - CFG_MONITOR_LEN,
+                               base_b0 + size_b0 - monitor_flash_len,
                                base_b0 + size_b0 - 1, &flash_info[0]);
        } else {
                flash_info[1].flash_id = FLASH_UNKNOWN;