common: Drop linux/delay.h from common header
[oweals/u-boot.git] / board / freescale / mpc8323erdb / mpc8323erdb.c
index 0a0152ad9ea30969d8c4de54c5fcbe2a495a1c8a..1dc1c98ad67161186a02d0cee8d56a5a4d25fea2 100644 (file)
  */
 
 #include <common.h>
+#include <eeprom.h>
+#include <env.h>
+#include <fdt_support.h>
+#include <init.h>
 #include <ioports.h>
 #include <mpc83xx.h>
 #include <i2c.h>
 #include <miiphy.h>
 #include <command.h>
-#include <libfdt.h>
+#include <linux/delay.h>
+#include <linux/libfdt.h>
+#include <u-boot/crc.h>
 #if defined(CONFIG_PCI)
 #include <pci.h>
 #endif
 #include <asm/mmu.h>
 
+DECLARE_GLOBAL_DATA_PTR;
+
 const qe_iop_conf_t qe_iop_conf_tab[] = {
        /* UCC3 */
        {1,  0, 1, 0, 1}, /* TxD0 */
@@ -68,21 +76,23 @@ const qe_iop_conf_t qe_iop_conf_tab[] = {
 
 int fixed_sdram(void);
 
-phys_size_t initdram(int board_type)
+int dram_init(void)
 {
        volatile immap_t *im = (immap_t *) CONFIG_SYS_IMMR;
        u32 msize = 0;
 
        if ((im->sysconf.immrbar & IMMRBAR_BASE_ADDR) != (u32) im)
-               return -1;
+               return -ENXIO;
 
        /* DDR SDRAM - Main SODIMM */
-       im->sysconf.ddrlaw[0].bar = CONFIG_SYS_DDR_BASE & LAWBAR_BAR;
+       im->sysconf.ddrlaw[0].bar = CONFIG_SYS_SDRAM_BASE & LAWBAR_BAR;
 
        msize = fixed_sdram();
 
-       /* return total bus SDRAM size(bytes)  -- DDR */
-       return (msize * 1024 * 1024);
+       /* set total bus SDRAM size(bytes)  -- DDR */
+       gd->ram_size = msize * 1024 * 1024;
+
+       return 0;
 }
 
 /*************************************************************************
@@ -212,7 +222,7 @@ int mac_read_from_eeprom(void)
                                                buf[i * 6 + 4], buf[i * 6 + 5]);
                                        sprintf((char *)enetvar,
                                                i ? "eth%daddr" : "ethaddr", i);
-                                       setenv((char *)enetvar, str);
+                                       env_set((char *)enetvar, str);
                                }
                        }
                }