2 * Copyright (C) 2012 Samsung Electronics
4 * See file CREDITS for list of people who contributed to this
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License as
9 * published by the Free Software Foundation; either version 2 of
10 * the License, or (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
26 #include <asm/arch/cpu.h>
27 #include <asm/arch/gpio.h>
28 #include <asm/arch/mmc.h>
29 #include <asm/arch/sromc.h>
31 DECLARE_GLOBAL_DATA_PTR;
32 struct exynos5_gpio_part1 *gpio1;
36 gpio1 = (struct exynos5_gpio_part1 *) samsung_get_base_gpio_part1();
38 gd->bd->bi_boot_params = (PHYS_SDRAM_1 + 0x100UL);
44 gd->ram_size = get_ram_size((long *)PHYS_SDRAM_1, PHYS_SDRAM_1_SIZE)
45 + get_ram_size((long *)PHYS_SDRAM_2, PHYS_SDRAM_2_SIZE)
46 + get_ram_size((long *)PHYS_SDRAM_3, PHYS_SDRAM_3_SIZE)
47 + get_ram_size((long *)PHYS_SDRAM_4, PHYS_SDRAM_4_SIZE)
48 + get_ram_size((long *)PHYS_SDRAM_5, PHYS_SDRAM_7_SIZE)
49 + get_ram_size((long *)PHYS_SDRAM_6, PHYS_SDRAM_7_SIZE)
50 + get_ram_size((long *)PHYS_SDRAM_7, PHYS_SDRAM_7_SIZE)
51 + get_ram_size((long *)PHYS_SDRAM_8, PHYS_SDRAM_8_SIZE);
55 void 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,
69 gd->bd->bi_dram[4].start = PHYS_SDRAM_5;
70 gd->bd->bi_dram[4].size = get_ram_size((long *)PHYS_SDRAM_5,
72 gd->bd->bi_dram[5].start = PHYS_SDRAM_6;
73 gd->bd->bi_dram[5].size = get_ram_size((long *)PHYS_SDRAM_6,
75 gd->bd->bi_dram[6].start = PHYS_SDRAM_7;
76 gd->bd->bi_dram[6].size = get_ram_size((long *)PHYS_SDRAM_7,
78 gd->bd->bi_dram[7].start = PHYS_SDRAM_8;
79 gd->bd->bi_dram[7].size = get_ram_size((long *)PHYS_SDRAM_8,
83 #ifdef CONFIG_DISPLAY_BOARDINFO
86 printf("\nBoard: SMDK5250\n");
92 #ifdef CONFIG_GENERIC_MMC
93 int board_mmc_init(bd_t *bis)
100 * GPC2[0] SD_2_CLK(2)
101 * GPC2[1] SD_2_CMD(2)
103 * GPC2[3:6] SD_2_DATA[0:3](2)
105 for (i = 0; i < 7; i++) {
106 /* GPC2[0:6] special function 2 */
107 s5p_gpio_cfg_pin(&gpio1->c2, i, GPIO_FUNC(0x2));
109 /* GPK2[0:6] drv 4x */
110 s5p_gpio_set_drv(&gpio1->c2, i, GPIO_DRV_4X);
112 /* GPK2[0:1] pull disable */
113 if (i == 0 || i == 1) {
114 s5p_gpio_set_pull(&gpio1->c2, i, GPIO_PULL_NONE);
118 /* GPK2[2:6] pull up */
119 s5p_gpio_set_pull(&gpio1->c2, i, GPIO_PULL_UP);
122 err = s5p_mmc_init(2, 4);
127 static void board_uart_init(void)
129 struct exynos5_gpio_part1 *gpio1 =
130 (struct exynos5_gpio_part1 *) samsung_get_base_gpio_part1();
133 /* UART1 GPIOs (part1) : GPA0CON[7:4] 0x2222 */
134 for (i = 4; i < 8; i++) {
135 s5p_gpio_set_pull(&gpio1->a0, i, GPIO_PULL_NONE);
136 s5p_gpio_cfg_pin(&gpio1->a0, i, GPIO_FUNC(0x2));
140 #ifdef CONFIG_BOARD_EARLY_INIT_F
141 int board_early_init_f(void)