X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=board%2Ffreescale%2Fmpc837xerdb%2Fmpc837xerdb.c;h=d9a47b90b2f270c35222afbf7d9498835a44ad87;hb=938e35e58f98ff2db46b4f40964a1c3b242b1295;hp=e0a10313808d519206eb5b0df1f827973cff4152;hpb=bd5053ffa5b8162257537bdb79ba829372423096;p=oweals%2Fu-boot.git diff --git a/board/freescale/mpc837xerdb/mpc837xerdb.c b/board/freescale/mpc837xerdb/mpc837xerdb.c index e0a1031380..d9a47b90b2 100644 --- a/board/freescale/mpc837xerdb/mpc837xerdb.c +++ b/board/freescale/mpc837xerdb/mpc837xerdb.c @@ -1,9 +1,8 @@ +// SPDX-License-Identifier: GPL-2.0+ /* * Copyright (C) 2007 Freescale Semiconductor, Inc. * Kevin Lam * Joe D'Abbraccio - * - * SPDX-License-Identifier: GPL-2.0+ */ #include @@ -16,6 +15,8 @@ #include #include +DECLARE_GLOBAL_DATA_PTR; + #if defined(CONFIG_SYS_DRAM_TEST) int testdram(void) @@ -60,13 +61,13 @@ void ddr_enable_ecc(unsigned int dram_size); #endif int fixed_sdram(void); -phys_size_t initdram(int board_type) +int dram_init(void) { immap_t *im = (immap_t *) CONFIG_SYS_IMMR; u32 msize = 0; if ((im->sysconf.immrbar & IMMRBAR_BASE_ADDR) != (u32) im) - return -1; + return -ENXIO; #if defined(CONFIG_SPD_EEPROM) msize = spd_sdram(); @@ -79,7 +80,9 @@ phys_size_t initdram(int board_type) ddr_enable_ecc(msize * 1024 * 1024); #endif /* return total bus DDR size(bytes) */ - return (msize * 1024 * 1024); + gd->ram_size = msize * 1024 * 1024; + + return 0; } #if !defined(CONFIG_SPD_EEPROM) @@ -166,8 +169,13 @@ int board_early_init_f(void) int board_mmc_init(bd_t *bd) { struct immap __iomem *im = (struct immap __iomem *)CONFIG_SYS_IMMR; + char buffer[HWCONFIG_BUFFER_SIZE] = {0}; + int esdhc_hwconfig_enabled = 0; + + if (env_get_f("hwconfig", buffer, sizeof(buffer)) > 0) + esdhc_hwconfig_enabled = hwconfig_f("esdhc", buffer); - if (!hwconfig("esdhc")) + if (esdhc_hwconfig_enabled == 0) return 0; clrsetbits_be32(&im->sysconf.sicrl, SICRL_USB_B, SICRL_USB_B_SD); @@ -205,7 +213,7 @@ int ft_board_setup(void *blob, bd_t *bd) ft_pci_setup(blob, bd); #endif ft_cpu_setup(blob, bd); - fdt_fixup_dr_usb(blob, bd); + fsl_fdt_fixup_dr_usb(blob, bd); fdt_fixup_esdhc(blob, bd); return 0;