2 * Copyright (C) 2011 Samsung Electronics
4 * SPDX-License-Identifier: GPL-2.0+
11 #include <asm/arch/cpu.h>
12 #include <asm/arch/mmc.h>
13 #include <asm/arch/periph.h>
14 #include <asm/arch/pinmux.h>
15 #include <asm/arch/sromc.h>
17 DECLARE_GLOBAL_DATA_PTR;
19 static void smc9115_pre_init(void)
21 u32 smc_bw_conf, smc_bc_conf;
23 /* gpio configuration GPK0CON */
24 gpio_cfg_pin(EXYNOS4_GPIO_Y00 + CONFIG_ENV_SROM_BANK, S5P_GPIO_FUNC(2));
26 /* Ethernet needs bus width of 16 bits */
27 smc_bw_conf = SROMC_DATA16_WIDTH(CONFIG_ENV_SROM_BANK);
28 smc_bc_conf = SROMC_BC_TACS(0x0F) | SROMC_BC_TCOS(0x0F)
29 | SROMC_BC_TACC(0x0F) | SROMC_BC_TCOH(0x0F)
30 | SROMC_BC_TAH(0x0F) | SROMC_BC_TACP(0x0F)
33 /* Select and configure the SROMC bank */
34 s5p_config_sromc(CONFIG_ENV_SROM_BANK, smc_bw_conf, smc_bc_conf);
41 gd->bd->bi_boot_params = (PHYS_SDRAM_1 + 0x100UL);
47 gd->ram_size = get_ram_size((long *)PHYS_SDRAM_1, PHYS_SDRAM_1_SIZE)
48 + get_ram_size((long *)PHYS_SDRAM_2, PHYS_SDRAM_2_SIZE)
49 + get_ram_size((long *)PHYS_SDRAM_3, PHYS_SDRAM_3_SIZE)
50 + get_ram_size((long *)PHYS_SDRAM_4, PHYS_SDRAM_4_SIZE);
55 int dram_init_banksize(void)
57 gd->bd->bi_dram[0].start = PHYS_SDRAM_1;
58 gd->bd->bi_dram[0].size = get_ram_size((long *)PHYS_SDRAM_1,
60 gd->bd->bi_dram[1].start = PHYS_SDRAM_2;
61 gd->bd->bi_dram[1].size = get_ram_size((long *)PHYS_SDRAM_2,
63 gd->bd->bi_dram[2].start = PHYS_SDRAM_3;
64 gd->bd->bi_dram[2].size = get_ram_size((long *)PHYS_SDRAM_3,
66 gd->bd->bi_dram[3].start = PHYS_SDRAM_4;
67 gd->bd->bi_dram[3].size = get_ram_size((long *)PHYS_SDRAM_4,
73 int board_eth_init(bd_t *bis)
77 rc = smc911x_initialize(0, CONFIG_SMC911X_BASE);
82 #ifdef CONFIG_DISPLAY_BOARDINFO
85 printf("\nBoard: SMDKV310\n");
90 #ifdef CONFIG_GENERIC_MMC
91 int board_mmc_init(bd_t *bis)
101 * GPK2[3:6] SD_2_DATA[0:3](2)
103 for (i = EXYNOS4_GPIO_K20; i < EXYNOS4_GPIO_K27; i++) {
104 /* GPK2[0:6] special function 2 */
105 gpio_cfg_pin(i, S5P_GPIO_FUNC(0x2));
107 /* GPK2[0:6] drv 4x */
108 gpio_set_drv(i, S5P_GPIO_DRV_4X);
110 /* GPK2[0:1] pull disable */
111 if (i == EXYNOS4_GPIO_K20 || i == EXYNOS4_GPIO_K21) {
112 gpio_set_pull(i, S5P_GPIO_PULL_NONE);
116 /* GPK2[2:6] pull up */
117 gpio_set_pull(i, S5P_GPIO_PULL_UP);
119 err = s5p_mmc_init(2, 4);
124 static int board_uart_init(void)
128 err = exynos_pinmux_config(PERIPH_ID_UART0, PINMUX_FLAG_NONE);
130 debug("UART0 not configured\n");
134 err = exynos_pinmux_config(PERIPH_ID_UART1, PINMUX_FLAG_NONE);
136 debug("UART1 not configured\n");
140 err = exynos_pinmux_config(PERIPH_ID_UART2, PINMUX_FLAG_NONE);
142 debug("UART2 not configured\n");
146 err = exynos_pinmux_config(PERIPH_ID_UART3, PINMUX_FLAG_NONE);
148 debug("UART3 not configured\n");
155 #ifdef CONFIG_BOARD_EARLY_INIT_F
156 int board_early_init_f(void)
159 err = board_uart_init();
161 debug("UART init failed\n");