]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - board/freescale/mpc837xerdb/mpc837xerdb.c
Merge branch 'master' of git://git.denx.de/u-boot-usb
[karo-tx-uboot.git] / board / freescale / mpc837xerdb / mpc837xerdb.c
index 318a3dce710052410440f2d6e3d38d4338e2b17c..e0a10313808d519206eb5b0df1f827973cff4152 100644 (file)
@@ -3,22 +3,18 @@
  * Kevin Lam <kevin.lam@freescale.com>
  * Joe D'Abbraccio <joe.d'abbraccio@freescale.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.
+ * SPDX-License-Identifier:    GPL-2.0+
  */
 
 #include <common.h>
+#include <hwconfig.h>
 #include <i2c.h>
 #include <asm/io.h>
-#include <asm/fsl_serdes.h>
+#include <asm/fsl_mpc83xx_serdes.h>
 #include <fdt_support.h>
 #include <spd_sdram.h>
 #include <vsc7385.h>
+#include <fsl_esdhc.h>
 
 #if defined(CONFIG_SYS_DRAM_TEST)
 int
@@ -59,7 +55,7 @@ testdram(void)
 }
 #endif
 
-#if defined(CONFIG_DDR_ECC) && !defined(CONFIG_ECC_INIT_VIA_DDRC)
+#if defined(CONFIG_DDR_ECC) && !defined(CONFIG_ECC_INIT_VIA_DDRCONTROLLER)
 void ddr_enable_ecc(unsigned int dram_size);
 #endif
 int fixed_sdram(void);
@@ -78,7 +74,7 @@ phys_size_t initdram(int board_type)
        msize = fixed_sdram();
 #endif
 
-#if defined(CONFIG_DDR_ECC) && !defined(CONFIG_ECC_INIT_VIA_DDRC)
+#if defined(CONFIG_DDR_ECC) && !defined(CONFIG_ECC_INIT_VIA_DDRCONTROLLER)
        /* Initialize DDR ECC byte */
        ddr_enable_ecc(msize * 1024 * 1024);
 #endif
@@ -166,6 +162,21 @@ int board_early_init_f(void)
        return 0;
 }
 
+#ifdef CONFIG_FSL_ESDHC
+int board_mmc_init(bd_t *bd)
+{
+       struct immap __iomem *im = (struct immap __iomem *)CONFIG_SYS_IMMR;
+
+       if (!hwconfig("esdhc"))
+               return 0;
+
+       clrsetbits_be32(&im->sysconf.sicrl, SICRL_USB_B, SICRL_USB_B_SD);
+       clrsetbits_be32(&im->sysconf.sicrh, SICRH_SPI, SICRH_SPI_SD);
+
+       return fsl_esdhc_mmc_init(bd);
+}
+#endif
+
 /*
  * Miscellaneous late-boot configurations
  *
@@ -188,12 +199,15 @@ int misc_init_r(void)
 
 #if defined(CONFIG_OF_BOARD_SETUP)
 
-void ft_board_setup(void *blob, bd_t *bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
 #ifdef CONFIG_PCI
        ft_pci_setup(blob, bd);
 #endif
        ft_cpu_setup(blob, bd);
        fdt_fixup_dr_usb(blob, bd);
+       fdt_fixup_esdhc(blob, bd);
+
+       return 0;
 }
 #endif /* CONFIG_OF_BOARD_SETUP */