3 #include <asm/arch/ldo.h>
4 #include <asm/arch/sprd_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 #include <linux/gpio.h>
13 #include <asm/arch/gpio.h>
14 #include <asm/arch/pinmap.h>
15 DECLARE_GLOBAL_DATA_PTR;
17 extern void sprd_gpio_init(void);
18 extern void ADI_init (void);
19 extern int LDO_Init(void);
20 extern void ADC_Init(void);
21 extern int sound_init(void);
23 #ifdef CONFIG_GENERIC_MMC
24 int mv_sdh_init(u32 regbase, u32 max_clk, u32 min_clk, u32 quirks);
25 int mmc_sdcard_init();
27 int board_mmc_init(bd_t *bd)
32 mv_sdh_init(CONFIG_SYS_SD_BASE, SDIO_BASE_CLK_192M,
39 extern struct eic_gpio_resource sprd_gpio_resource[];
41 /*enable aon timer2 for udelay functions*/
42 void aon_26M_timer2_enable()
44 REG32(REG_AON_APB_APB_EB0) |= BIT_AON_TMR_EB;
47 unsigned int hw_revision = 0;
48 #define GPIO_HW_REV_COUNT 3
49 unsigned hw_rev_gpio[GPIO_HW_REV_COUNT] = {166, 169, 170};
57 for (i = 0 ; i < GPIO_HW_REV_COUNT ; i++) {
58 sprd_gpio_request(NULL, hw_rev_gpio[i]);
59 sprd_gpio_direction_input(NULL, hw_rev_gpio[i]);
60 hw_revision = (hw_revision << 1) | sprd_gpio_get(NULL, hw_rev_gpio[i]);
61 sprd_gpio_free(NULL, hw_rev_gpio[i]);
69 gd->bd->bi_arch_number = 0x7df;
70 gd->bd->bi_boot_params = PHYS_SDRAM_1 + 0x02000100;
84 // aon_26M_timer2_enable();
93 #ifdef CONFIG_SMPL_MODE
94 if(is_real_battery() == 0){
95 sci_adi_write_fast(ANA_REG_GLB_SMPL_CTRL0,0x0,1);
102 gd->ram_size = get_ram_size((volatile void *)PHYS_SDRAM_1,
107 void fdt_fixup_chosen_bootargs_board(char *buf, const char *boot_mode, int calibration_mode)
111 * Because of in u-boot, we can't find FDT chosen remove function
112 * and samsung only uses uart to do calibration,
113 * so in samsung board .dts, we remove the "console=ttyS1,115200n8" in chosen node by default.
114 * so in normal mode, we need to append console
116 if (!calibration_mode) {
117 p += sprintf(p, "console=ttyS1,115200n8 no_console_suspend");
119 p += sprintf(p, "console=null");