Merge tag 'u-boot-atmel-fixes-2020.07-a' of https://gitlab.denx.de/u-boot/custodians...
[oweals/u-boot.git] / board / esd / vme8349 / vme8349.c
index 0e7f8b130a34f602cca5bfe98727b957d00e5d6d..f54c89d154b41ce23b5de21d925b9a10e8d3bd9b 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0+
 /*
  * vme8349.c -- esd VME8349 board support
  *
@@ -8,16 +9,17 @@
  *
  * Reinhard Arlt <reinhard.arlt@esd-electronics.com>
  * Based on board/mpc8349emds/mpc8349emds.c (and previous 834x releases.)
- *
- * SPDX-License-Identifier:    GPL-2.0+
  */
 
 #include <common.h>
+#include <fdt_support.h>
+#include <init.h>
 #include <ioports.h>
 #include <mpc83xx.h>
+#include <net.h>
 #include <asm/mpc8349_pci.h>
 #if defined(CONFIG_OF_LIBFDT)
-#include <libfdt.h>
+#include <linux/libfdt.h>
 #endif
 #include <asm/io.h>
 #include <asm/mmu.h>
@@ -30,7 +32,7 @@ DECLARE_GLOBAL_DATA_PTR;
 
 void ddr_enable_ecc(unsigned int dram_size);
 
-int initdram(void)
+int dram_init(void)
 {
        volatile immap_t *im = (immap_t *)CONFIG_SYS_IMMR;
        u32 msize = 0;
@@ -39,7 +41,7 @@ int initdram(void)
                return -ENXIO;
 
        /* DDR SDRAM - Main memory */
-       im->sysconf.ddrlaw[0].bar = CONFIG_SYS_DDR_BASE & LAWBAR_BAR;
+       im->sysconf.ddrlaw[0].bar = CONFIG_SYS_SDRAM_BASE & LAWBAR_BAR;
 
        msize = spd_sdram();
 
@@ -61,7 +63,7 @@ int initdram(void)
 
 int checkboard(void)
 {
-#ifdef VME_CADDY2
+#ifdef CONFIG_TARGET_CADDY2
        puts("Board: esd VME-CADDY/2\n");
 #else
        puts("Board: esd VME-CPU/8349\n");
@@ -70,7 +72,7 @@ int checkboard(void)
        return 0;
 }
 
-#ifdef VME_CADDY2
+#ifdef CONFIG_TARGET_CADDY2
 int board_eth_init(bd_t *bis)
 {
        return pci_eth_init(bis);
@@ -103,7 +105,7 @@ int misc_init_r()
  * Provide SPD values for spd_sdram(). Both boards (VME-CADDY/2
  * and VME-CADDY/2) have different SDRAM configurations.
  */
-#ifdef VME_CADDY2
+#ifdef CONFIG_TARGET_CADDY2
 #define SMALL_RAM      0xff
 #define LARGE_RAM      0x00
 #else
@@ -166,7 +168,7 @@ static spd_eeprom_t default_spd_eeprom = {
        SPD_VAL(0x7e, 0x1d),    /* 63 */
        { 'e', 's', 'd', '-', 'g', 'm', 'b', 'h' },
        SPD_VAL(0x00, 0x00),    /* 72 */
-#ifdef VME_CADDY2
+#ifdef CONFIG_TARGET_CADDY2
        { "vme-caddy/2 ram   " }
 #else
        { "vme-cpu/2 ram     " }