2 * Copyright (C) 2008-2009 Samsung Electronics
6 * SPDX-License-Identifier: GPL-2.0+
10 #include <asm/arch/gpio.h>
11 #include <asm/arch/mmc.h>
12 #include <power/pmic.h>
13 #include <usb/s3c_udc.h>
14 #include <asm/arch/cpu.h>
15 #include <power/max8998_pmic.h>
16 DECLARE_GLOBAL_DATA_PTR;
18 static struct s5pc110_gpio *s5pc110_gpio;
22 /* Set Initial global variables */
23 s5pc110_gpio = (struct s5pc110_gpio *)S5PC110_GPIO_BASE;
25 gd->bd->bi_arch_number = MACH_TYPE_GONI;
26 gd->bd->bi_boot_params = PHYS_SDRAM_1 + 0x100;
31 int power_init_board(void)
35 ret = pmic_init(I2C_5);
44 gd->ram_size = PHYS_SDRAM_1_SIZE + PHYS_SDRAM_2_SIZE +
50 void dram_init_banksize(void)
52 gd->bd->bi_dram[0].start = PHYS_SDRAM_1;
53 gd->bd->bi_dram[0].size = PHYS_SDRAM_1_SIZE;
54 gd->bd->bi_dram[1].start = PHYS_SDRAM_2;
55 gd->bd->bi_dram[1].size = PHYS_SDRAM_2_SIZE;
56 gd->bd->bi_dram[2].start = PHYS_SDRAM_3;
57 gd->bd->bi_dram[2].size = PHYS_SDRAM_3_SIZE;
60 #ifdef CONFIG_DISPLAY_BOARDINFO
63 puts("Board:\tGoni\n");
68 #ifdef CONFIG_GENERIC_MMC
69 int board_mmc_init(bd_t *bis)
73 /* MASSMEMORY_EN: XMSMDATA7: GPJ2[7] output high */
74 s5p_gpio_direction_output(&s5pc110_gpio->j2, 7, 1);
80 * GPG0[2] SD_0_CDn -> Not used
81 * GPG0[3:6] SD_0_DATA[0:3]
83 for (i = 0; i < 7; i++) {
86 /* GPG0[0:6] special function 2 */
87 s5p_gpio_cfg_pin(&s5pc110_gpio->g0, i, 0x2);
88 /* GPG0[0:6] pull disable */
89 s5p_gpio_set_pull(&s5pc110_gpio->g0, i, GPIO_PULL_NONE);
90 /* GPG0[0:6] drv 4x */
91 s5p_gpio_set_drv(&s5pc110_gpio->g0, i, GPIO_DRV_4X);
94 return s5p_mmc_init(0, 4);
98 #ifdef CONFIG_USB_GADGET
99 static int s5pc1xx_phy_control(int on)
103 struct pmic *p = pmic_get("MAX8998_PMIC");
111 ret = pmic_set_output(p, MAX8998_REG_ONOFF1,
112 MAX8998_LDO3, LDO_ON);
113 ret = pmic_set_output(p, MAX8998_REG_ONOFF2,
114 MAX8998_LDO8, LDO_ON);
116 puts("MAX8998 LDO setting error!\n");
120 } else if (!on && status) {
121 ret = pmic_set_output(p, MAX8998_REG_ONOFF1,
122 MAX8998_LDO3, LDO_OFF);
123 ret = pmic_set_output(p, MAX8998_REG_ONOFF2,
124 MAX8998_LDO8, LDO_OFF);
126 puts("MAX8998 LDO setting error!\n");
136 struct s3c_plat_otg_data s5pc110_otg_data = {
137 .phy_control = s5pc1xx_phy_control,
138 .regs_phy = S5PC110_PHY_BASE,
139 .regs_otg = S5PC110_OTG_BASE,
140 .usb_phy_ctrl = S5PC110_USB_PHY_CONTROL,