3 #include <asm/arch/ldo.h>
4 #include <asm/arch/sc8810_reg_ahb.h>
5 #include <asm/arch/regs_ahb.h>
6 #include <asm/arch/common.h>
7 #include <asm/arch/adi_hal_internal.h>
8 #include <asm/u-boot.h>
11 #include <asm/arch/mfp.h>
12 DECLARE_GLOBAL_DATA_PTR;
14 extern void sprd_gpio_init(void);
15 extern void ADI_init (void);
16 extern int LDO_Init(void);
20 #define PIN_CTL_REG 0x8C000000
21 static void chip_init(void)
23 //ANA_REG_SET(ANA_ADIE_CHIP_ID,0);
24 /* setup pins configration when LDO shutdown*/
25 //__raw_writel(0x1fff00, PIN_CTL_REG);
26 *(volatile unsigned int *)PIN_CTL_REG = 0x1fff00;
28 #ifdef CONFIG_GENERIC_MMC
29 static unsigned long sdio_func_cfg[] = {
30 MFP_CFG_X(SD0_CLK, AF0, DS3, F_PULL_NONE, S_PULL_NONE, IO_Z),
31 MFP_CFG_X(SD_CMD, AF0, DS0, F_PULL_UP, S_PULL_NONE, IO_Z),
32 MFP_CFG_X(SD_D0, AF0, DS0, F_PULL_UP, S_PULL_NONE, IO_Z),
33 MFP_CFG_X(SD_D1, AF0, DS0, F_PULL_DOWN, S_PULL_NONE, IO_Z),
34 MFP_CFG_X(SD_D2, AF0, DS0, F_PULL_DOWN, S_PULL_NONE, IO_Z),
35 MFP_CFG_X(SD_D3, AF0, DS0, F_PULL_DOWN, S_PULL_NONE, IO_Z),
38 static unsigned long sdcard_detect_gpio_cfg =
39 MFP_CFG_X(RFCTL11, AF3, DS1, F_PULL_UP,S_PULL_NONE, IO_Z);
41 void sprd_config_sdio_pins(void)
43 sprd_mfp_config(sdio_func_cfg, ARRAY_SIZE(sdio_func_cfg));
44 sprd_mfp_config(&sdcard_detect_gpio_cfg, 1);
46 int mv_sdh_init(u32 regbase, u32 max_clk, u32 min_clk, u32 quirks);
47 int board_mmc_init(bd_t *bd)
49 ulong mmc_base_address[CONFIG_SYS_MMC_NUM] = CONFIG_SYS_MMC_BASE;
52 REG32(AHB_CTL0) |= BIT_4;
53 REG32(AHB_SOFT_RST) |= BIT_12;
54 REG32(AHB_SOFT_RST) &= ~BIT_12;
55 LDO_SetVoltLevel(LDO_LDO_SDIO0, LDO_VOLT_LEVEL1);
56 LDO_TurnOnLDO(LDO_LDO_SDIO0);
57 sprd_config_sdio_pins();
59 for (i = 0; i < CONFIG_SYS_MMC_NUM; i++) {
60 if (mv_sdh_init(mmc_base_address[i], SDIO_BASE_CLK_96M,
71 gd->bd->bi_arch_number = MACH_TYPE_OPENPHONE;
72 gd->bd->bi_boot_params = PHYS_SDRAM_1 + 0x100;
84 gd->ram_size = get_ram_size((volatile void *)PHYS_SDRAM_1,