
Hi Marek,
On Mon, Oct 3, 2011 at 6:44 PM, Marek Vasut marek.vasut@gmail.com wrote:
On Monday, October 03, 2011 11:02:24 AM Lei Wen wrote:
Signed-off-by: Lei Wen leiwen@marvell.com
board/Marvell/dkb/dkb.c | 37 +++++++++++++++++++++++++++++++++++++ include/configs/dkb.h | 1 + 2 files changed, 38 insertions(+), 0 deletions(-)
Dear Lei Wen,
[...]
@@ -56,3 +74,22 @@ int board_init(void) gd->bd->bi_boot_params = panth_sdram_base(0) + 0x100; return 0; }
+#ifdef CONFIG_GENERIC_MMC +int board_mmc_init(bd_t *bd) +{
- ulong mmc_base_address[CONFIG_SYS_MMC_NUM] = CONFIG_SYS_MMC_BASE;
- u8 i, data;
- data = 0xd;
Magic value ?
- i2c_write(0x34, 0x28, 1, &data, 1);
More magic values ?
The magic number stand for the pmic chip address and its corresponding register address. Since we don't want to add a complex pmic driver here... How about just define those magic number with macro?
- for (i = 0; i < CONFIG_SYS_MMC_NUM; i++) {
- if (mv_sdh_init(mmc_base_address[i], 0, 0,
- SDHCI_QUIRK_32BIT_DMA_ADDR))
- return 1;
- }
- *(unsigned int *)0xd4282854 = 0x1b;
- *(unsigned int *)0xd42828e0 = 0x1b;
Magic value and not using writel() ?
Opps, this should move to the cpu_init as a part of apmu clock enabling.
- return 0;
+} +#endif diff --git a/include/configs/dkb.h b/include/configs/dkb.h index 3d27c58..fb02d92 100644 --- a/include/configs/dkb.h +++ b/include/configs/dkb.h @@ -47,6 +47,7 @@ #define CONFIG_SYS_NO_FLASH /* Declare no flash (NOR/SPI) */ #include <config_cmd_default.h> #define CONFIG_CMD_I2C +#define CONFIG_CMD_MMC #undef CONFIG_CMD_NET #undef CONFIG_CMD_NFS /*
This should be in a separate patch maybe ?
Ok, would do in the next patch.
Thanks, Lei