common: Drop linux/delay.h from common header
[oweals/u-boot.git] / board / freescale / mpc837xerdb / mpc837xerdb.c
index 2f5431ee21d7b097fb6d7c12ab1deeed5a5da3c5..3fd2c5e84943e96a11881debe40161df66017cee 100644 (file)
@@ -1,20 +1,22 @@
+// SPDX-License-Identifier: GPL-2.0+
 /*
  * Copyright (C) 2007 Freescale Semiconductor, Inc.
  * Kevin Lam <kevin.lam@freescale.com>
  * Joe D'Abbraccio <joe.d'abbraccio@freescale.com>
- *
- * SPDX-License-Identifier:    GPL-2.0+
  */
 
 #include <common.h>
+#include <env.h>
 #include <hwconfig.h>
 #include <i2c.h>
+#include <init.h>
 #include <asm/io.h>
 #include <asm/fsl_mpc83xx_serdes.h>
 #include <fdt_support.h>
 #include <spd_sdram.h>
 #include <vsc7385.h>
 #include <fsl_esdhc.h>
+#include <linux/delay.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -62,7 +64,7 @@ void ddr_enable_ecc(unsigned int dram_size);
 #endif
 int fixed_sdram(void);
 
-int initdram(void)
+int dram_init(void)
 {
        immap_t *im = (immap_t *) CONFIG_SYS_IMMR;
        u32 msize = 0;
@@ -96,7 +98,7 @@ int fixed_sdram(void)
        u32 msize = CONFIG_SYS_DDR_SIZE * 1024 * 1024;
        u32 msize_log2 = __ilog2(msize);
 
-       im->sysconf.ddrlaw[0].bar = CONFIG_SYS_DDR_SDRAM_BASE & 0xfffff000;
+       im->sysconf.ddrlaw[0].bar = CONFIG_SYS_SDRAM_BASE & 0xfffff000;
        im->sysconf.ddrlaw[0].ar = LBLAWAR_EN | (msize_log2 - 1);
 
        im->sysconf.ddrcdr = CONFIG_SYS_DDRCDR_VALUE;
@@ -173,7 +175,7 @@ int board_mmc_init(bd_t *bd)
        char buffer[HWCONFIG_BUFFER_SIZE] = {0};
        int esdhc_hwconfig_enabled = 0;
 
-       if (getenv_f("hwconfig", buffer, sizeof(buffer)) > 0)
+       if (env_get_f("hwconfig", buffer, sizeof(buffer)) > 0)
                esdhc_hwconfig_enabled = hwconfig_f("esdhc", buffer);
 
        if (esdhc_hwconfig_enabled == 0)