Merge branch 'master' of git://www.denx.de/git/u-boot-cfi-flash
[platform/kernel/u-boot.git] / board / snmc / qs850 / qs850.c
index 2fbe8ae..dc4a476 100644 (file)
@@ -8,23 +8,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+
  */
 
 #include <common.h>
@@ -100,7 +84,7 @@ int checkboard (void)
        char buf[64];
        int i;
 
-       i = getenv_r("serial#", buf, sizeof(buf));
+       i = getenv_f("serial#", buf, sizeof(buf));
        s = (i>0) ? buf : NULL;
 
        if (!s || strncmp(s, BOARD_IDENTITY, 5)) {
@@ -146,7 +130,7 @@ int checkboard (void)
 
 phys_size_t initdram (int board_type)
 {
-       volatile immap_t     *immap  = (immap_t *)CFG_IMMR;
+       volatile immap_t     *immap  = (immap_t *)CONFIG_SYS_IMMR;
        volatile memctl8xx_t *memctl = &immap->im_memctl;
        long int size;
 
@@ -155,17 +139,17 @@ phys_size_t initdram (int board_type)
        /*
        * Prescaler for refresh
        */
-       memctl->memc_mptpr = CFG_MPTPR;
+       memctl->memc_mptpr = CONFIG_SYS_MPTPR;
 
        /*
        * Map controller bank 1 to the SDRAM address
        */
-       memctl->memc_or1 = CFG_OR1;
-       memctl->memc_br1 = CFG_BR1;
+       memctl->memc_or1 = CONFIG_SYS_OR1;
+       memctl->memc_br1 = CONFIG_SYS_BR1;
        udelay(1000);
 
        /* perform SDRAM initialization sequence */
-       memctl->memc_mamr = CFG_16M_MAMR;
+       memctl->memc_mamr = CONFIG_SYS_16M_MAMR;
        udelay(100);
 
        /* Program the SDRAM's Mode Register */
@@ -192,7 +176,7 @@ phys_size_t initdram (int board_type)
        /*
        * Check for 32M SDRAM Memory Size
        */
-       size = dram_size(CFG_32M_MAMR|MAMR_PTAE,
+       size = dram_size(CONFIG_SYS_32M_MAMR|MAMR_PTAE,
        (long *)SDRAM_BASE, SDRAM_32M_MAX_SIZE);
        udelay (1000);
 
@@ -200,7 +184,7 @@ phys_size_t initdram (int board_type)
        * Check for 16M SDRAM Memory Size
        */
        if (size != SDRAM_32M_MAX_SIZE) {
-       size = dram_size(CFG_16M_MAMR|MAMR_PTAE,
+       size = dram_size(CONFIG_SYS_16M_MAMR|MAMR_PTAE,
        (long *)SDRAM_BASE, SDRAM_16M_MAX_SIZE);
        udelay (1000);
        }
@@ -221,7 +205,7 @@ phys_size_t initdram (int board_type)
 
 static long int dram_size (long int mamr_value, long int *base, long int maxsize)
 {
-       volatile immap_t *immap = (immap_t *)CFG_IMMR;
+       volatile immap_t *immap = (immap_t *)CONFIG_SYS_IMMR;
        volatile memctl8xx_t *memctl = &immap->im_memctl;
 
        memctl->memc_mamr = mamr_value;