Commit c9646ed758804fa1fa6c1425369a4eee5d618b1d

Authored by Anton Vorontsov
Committed by Wolfgang Denk
1 parent b33433a63f

mpc83xx: MPC837XERDB: Add support for FSL eSDHC

This patch adds support for eSDHC on MPC837XERDB boards. The WP
switch doesn't seem to work on RDB boards though, the WP pin is
always asserted (can see the pin state when it's in GPIO mode).

FSL DR USB and FSL eSDHC are mutually exclusive because of pins
multiplexing, so user should specify 'esdhc' or 'dr_usb' options
in the hwconfig environment variable to choose between the
devices.

p.s.
Now we're very close to a monitor len limit (196 bytes left using
gcc-4.2.0), so also increase the monitor len by one sector (64 KB).

Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
Acked-by: Kim Phillips <kim.phillips@freescale.com>

Showing 2 changed files with 35 additions and 0 deletions Side-by-side Diff

board/freescale/mpc837xerdb/mpc837xerdb.c
... ... @@ -13,12 +13,14 @@
13 13 */
14 14  
15 15 #include <common.h>
  16 +#include <hwconfig.h>
16 17 #include <i2c.h>
17 18 #include <asm/io.h>
18 19 #include <asm/fsl_serdes.h>
19 20 #include <fdt_support.h>
20 21 #include <spd_sdram.h>
21 22 #include <vsc7385.h>
  23 +#include <fsl_esdhc.h>
22 24  
23 25 #if defined(CONFIG_SYS_DRAM_TEST)
24 26 int
... ... @@ -166,6 +168,21 @@
166 168 return 0;
167 169 }
168 170  
  171 +#ifdef CONFIG_FSL_ESDHC
  172 +int board_mmc_init(bd_t *bd)
  173 +{
  174 + struct immap __iomem *im = (struct immap __iomem *)CONFIG_SYS_IMMR;
  175 +
  176 + if (!hwconfig("esdhc"))
  177 + return 0;
  178 +
  179 + clrsetbits_be32(&im->sysconf.sicrl, SICRL_USB_B, SICRL_USB_B_SD);
  180 + clrsetbits_be32(&im->sysconf.sicrh, SICRH_SPI, SICRH_SPI_SD);
  181 +
  182 + return fsl_esdhc_mmc_init(bd);
  183 +}
  184 +#endif
  185 +
169 186 /*
170 187 * Miscellaneous late-boot configurations
171 188 *
... ... @@ -195,6 +212,7 @@
195 212 #endif
196 213 ft_cpu_setup(blob, bd);
197 214 fdt_fixup_dr_usb(blob, bd);
  215 + fdt_fixup_esdhc(blob, bd);
198 216 }
199 217 #endif /* CONFIG_OF_BOARD_SETUP */
include/configs/MPC837XERDB.h
... ... @@ -34,6 +34,7 @@
34 34  
35 35 #define CONFIG_BOARD_EARLY_INIT_F
36 36 #define CONFIG_MISC_INIT_R
  37 +#define CONFIG_HWCONFIG
37 38  
38 39 /*
39 40 * On-board devices
... ... @@ -229,6 +230,7 @@
229 230 #endif
230 231  
231 232 #define CONFIG_SYS_MONITOR_LEN (384 * 1024) /* Reserve 384 kB for Mon */
  233 +#define CONFIG_SYS_MONITOR_LEN (320 * 1024) /* Reserve 320 kB for Mon */
232 234 #define CONFIG_SYS_MALLOC_LEN (512 * 1024) /* Reserved for malloc */
233 235  
234 236 /*
... ... @@ -342,6 +344,9 @@
342 344 #define CONFIG_OF_BOARD_SETUP 1
343 345 #define CONFIG_OF_STDOUT_VIA_ALIAS 1
344 346  
  347 +#define CONFIG_SYS_64BIT_STRTOUL 1
  348 +#define CONFIG_SYS_64BIT_VSPRINTF 1
  349 +
345 350 /* I2C */
346 351 #define CONFIG_HARD_I2C /* I2C with hardware support */
347 352 #undef CONFIG_SOFT_I2C /* I2C bit-banged */
... ... @@ -509,6 +514,18 @@
509 514 #define CONFIG_CMDLINE_EDITING 1 /* add command line history */
510 515  
511 516 #undef CONFIG_WATCHDOG /* watchdog disabled */
  517 +
  518 +#define CONFIG_MMC 1
  519 +
  520 +#ifdef CONFIG_MMC
  521 +#define CONFIG_FSL_ESDHC
  522 +#define CONFIG_SYS_FSL_ESDHC_ADDR CONFIG_SYS_MPC83xx_ESDHC_ADDR
  523 +#define CONFIG_CMD_MMC
  524 +#define CONFIG_GENERIC_MMC
  525 +#define CONFIG_CMD_EXT2
  526 +#define CONFIG_CMD_FAT
  527 +#define CONFIG_DOS_PARTITION
  528 +#endif
512 529  
513 530 /*
514 531 * Miscellaneous configurable options