blob: d034f53d68b5f6c33141dd51fc65a28830a19409 [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001// SPDX-License-Identifier: GPL-2.0+
Minkyu Kang29325572009-10-01 17:20:40 +09002/*
3 * Copyright (C) 2008-2009 Samsung Electronics
4 * Minkyu Kang <mk7.kang@samsung.com>
5 * Kyungmin Park <kyungmin.park@samsung.com>
Minkyu Kang29325572009-10-01 17:20:40 +09006 */
7
8#include <common.h>
Simon Glass8e16b1e2019-12-28 10:45:05 -07009#include <init.h>
Simon Glass274e0b02020-05-10 11:39:56 -060010#include <net.h>
Simon Glass37f11622014-10-20 19:48:37 -060011#include <asm/gpio.h>
Naveen Krishna CH45101ce2010-03-05 17:16:05 +090012#include <asm/io.h>
Chander Kashyap9c88fb82011-04-14 19:05:18 +000013#include <asm/arch/sromc.h>
Naveen Krishna CH45101ce2010-03-05 17:16:05 +090014#include <netdev.h>
Simon Glass0ffb9d62017-05-31 19:47:48 -060015#include <asm/mach-types.h>
Naveen Krishna CH45101ce2010-03-05 17:16:05 +090016
Minkyu Kang29325572009-10-01 17:20:40 +090017DECLARE_GLOBAL_DATA_PTR;
18
Naveen Krishna CH45101ce2010-03-05 17:16:05 +090019/*
20 * Miscellaneous platform dependent initialisations
21 */
22static void smc9115_pre_init(void)
23{
24 u32 smc_bw_conf, smc_bc_conf;
25
Naveen Krishna CH45101ce2010-03-05 17:16:05 +090026 /* gpio configuration GPK0CON */
Akshay Saraswat1376cdd2014-05-13 10:30:14 +053027 gpio_cfg_pin(S5PC100_GPIO_K00 + CONFIG_ENV_SROM_BANK, S5P_GPIO_FUNC(2));
Naveen Krishna CH45101ce2010-03-05 17:16:05 +090028
29 /* Ethernet needs bus width of 16 bits */
30 smc_bw_conf = SMC_DATA16_WIDTH(CONFIG_ENV_SROM_BANK);
31 smc_bc_conf = SMC_BC_TACS(0x0) | SMC_BC_TCOS(0x4) | SMC_BC_TACC(0xe)
32 | SMC_BC_TCOH(0x1) | SMC_BC_TAH(0x4)
33 | SMC_BC_TACP(0x6) | SMC_BC_PMC(0x0);
34
35 /* Select and configure the SROMC bank */
Chander Kashyap9c88fb82011-04-14 19:05:18 +000036 s5p_config_sromc(CONFIG_ENV_SROM_BANK, smc_bw_conf, smc_bc_conf);
Naveen Krishna CH45101ce2010-03-05 17:16:05 +090037}
38
Minkyu Kang29325572009-10-01 17:20:40 +090039int board_init(void)
40{
Naveen Krishna CH45101ce2010-03-05 17:16:05 +090041 smc9115_pre_init();
42
Minkyu Kang29325572009-10-01 17:20:40 +090043 gd->bd->bi_arch_number = MACH_TYPE_SMDKC100;
44 gd->bd->bi_boot_params = PHYS_SDRAM_1 + 0x100;
45
46 return 0;
47}
48
49int dram_init(void)
50{
Minkyu Kang5dd10542010-11-22 20:26:46 +090051 gd->ram_size = get_ram_size((long *)PHYS_SDRAM_1, PHYS_SDRAM_1_SIZE);
Minkyu Kang29325572009-10-01 17:20:40 +090052
53 return 0;
54}
55
Simon Glass2f949c32017-03-31 08:40:32 -060056int dram_init_banksize(void)
Minkyu Kang5dd10542010-11-22 20:26:46 +090057{
58 gd->bd->bi_dram[0].start = PHYS_SDRAM_1;
59 gd->bd->bi_dram[0].size = PHYS_SDRAM_1_SIZE;
Simon Glass2f949c32017-03-31 08:40:32 -060060
61 return 0;
Minkyu Kang5dd10542010-11-22 20:26:46 +090062}
63
Minkyu Kang29325572009-10-01 17:20:40 +090064#ifdef CONFIG_DISPLAY_BOARDINFO
65int checkboard(void)
66{
67 printf("Board:\tSMDKC100\n");
68 return 0;
69}
70#endif
Naveen Krishna CH45101ce2010-03-05 17:16:05 +090071
Masahiro Yamadaf7ed78b2020-06-26 15:13:33 +090072int board_eth_init(struct bd_info *bis)
Naveen Krishna CH45101ce2010-03-05 17:16:05 +090073{
74 int rc = 0;
75#ifdef CONFIG_SMC911X
76 rc = smc911x_initialize(0, CONFIG_SMC911X_BASE);
77#endif
78 return rc;
79}