1 /* 2 * Copyright (C) 2013 Samsung Electronics 3 * 4 * SPDX-License-Identifier: GPL-2.0+ 5 */ 6 7 #include <common.h> 8 #include <asm/arch/pinmux.h> 9 #include <asm/arch/dwmmc.h> 10 #include <asm/arch/power.h> 11 12 DECLARE_GLOBAL_DATA_PTR; 13 14 int board_init(void) 15 { 16 gd->bd->bi_boot_params = (PHYS_SDRAM_1 + 0x100UL); 17 return 0; 18 } 19 20 int dram_init(void) 21 { 22 int i; 23 u32 addr; 24 25 for (i = 0; i < CONFIG_NR_DRAM_BANKS; i++) { 26 addr = CONFIG_SYS_SDRAM_BASE + (i * SDRAM_BANK_SIZE); 27 gd->ram_size += get_ram_size((long *)addr, SDRAM_BANK_SIZE); 28 } 29 return 0; 30 } 31 32 int power_init_board(void) 33 { 34 set_ps_hold_ctrl(); 35 return 0; 36 } 37 38 void dram_init_banksize(void) 39 { 40 int i; 41 u32 addr, size; 42 43 for (i = 0; i < CONFIG_NR_DRAM_BANKS; i++) { 44 addr = CONFIG_SYS_SDRAM_BASE + (i * SDRAM_BANK_SIZE); 45 size = get_ram_size((long *)addr, SDRAM_BANK_SIZE); 46 47 gd->bd->bi_dram[i].start = addr; 48 gd->bd->bi_dram[i].size = size; 49 } 50 } 51 52 #ifdef CONFIG_GENERIC_MMC 53 int board_mmc_init(bd_t *bis) 54 { 55 int ret; 56 /* dwmmc initializattion for available channels */ 57 ret = exynos_dwmmc_init(gd->fdt_blob); 58 if (ret) 59 debug("dwmmc init failed\n"); 60 61 return ret; 62 } 63 #endif 64 65 static int board_uart_init(void) 66 { 67 int err = 0, uart_id; 68 69 for (uart_id = PERIPH_ID_UART0; uart_id <= PERIPH_ID_UART3; uart_id++) { 70 err = exynos_pinmux_config(uart_id, PINMUX_FLAG_NONE); 71 if (err) { 72 debug("UART%d not configured\n", 73 (uart_id - PERIPH_ID_UART0)); 74 return err; 75 } 76 } 77 return err; 78 } 79 80 #ifdef CONFIG_BOARD_EARLY_INIT_F 81 int board_early_init_f(void) 82 { 83 int err; 84 85 err = board_uart_init(); 86 if (err) { 87 debug("UART init failed\n"); 88 return err; 89 } 90 return err; 91 } 92 #endif 93 94 #ifdef CONFIG_DISPLAY_BOARDINFO 95 int checkboard(void) 96 { 97 printf("\nBoard: Arndale\n"); 98 99 return 0; 100 } 101 #endif 102