Commit 2528dc52361bea49e6bd4a95ce2374d0004ca56f

Authored by Naveen Krishna CH
Committed by trix
1 parent 01802e0d22

SAMSUNG: SMDKC100: Adds ethernet support.

Add setup for ethernet on SMDKC100, allowing kernel/ramdisk to be
loaded over tftp.

The preinit function will configure GPIO (GPK0CON) & SROMC to look
for environment in SROM Bank 3.

Signed-off-by: Naveen Krishna Ch <ch.naveen@samsung.com>
Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>

Showing 2 changed files with 50 additions and 1 deletions Side-by-side Diff

board/samsung/smdkc100/smdkc100.c
... ... @@ -23,10 +23,40 @@
23 23 */
24 24  
25 25 #include <common.h>
  26 +#include <asm/io.h>
  27 +#include <asm/arch/smc.h>
  28 +#include <asm/arch/gpio.h>
  29 +#include <netdev.h>
  30 +
26 31 DECLARE_GLOBAL_DATA_PTR;
27 32  
  33 +/*
  34 + * Miscellaneous platform dependent initialisations
  35 + */
  36 +static void smc9115_pre_init(void)
  37 +{
  38 + u32 smc_bw_conf, smc_bc_conf;
  39 +
  40 + struct s5pc100_gpio *const gpio =
  41 + (struct s5pc100_gpio *)S5PC100_GPIO_BASE;
  42 +
  43 + /* gpio configuration GPK0CON */
  44 + gpio_cfg_pin(&gpio->gpio_k0, CONFIG_ENV_SROM_BANK, GPIO_FUNC(2));
  45 +
  46 + /* Ethernet needs bus width of 16 bits */
  47 + smc_bw_conf = SMC_DATA16_WIDTH(CONFIG_ENV_SROM_BANK);
  48 + smc_bc_conf = SMC_BC_TACS(0x0) | SMC_BC_TCOS(0x4) | SMC_BC_TACC(0xe)
  49 + | SMC_BC_TCOH(0x1) | SMC_BC_TAH(0x4)
  50 + | SMC_BC_TACP(0x6) | SMC_BC_PMC(0x0);
  51 +
  52 + /* Select and configure the SROMC bank */
  53 + s5pc1xx_config_sromc(CONFIG_ENV_SROM_BANK, smc_bw_conf, smc_bc_conf);
  54 +}
  55 +
28 56 int board_init(void)
29 57 {
  58 + smc9115_pre_init();
  59 +
30 60 gd->bd->bi_arch_number = MACH_TYPE_SMDKC100;
31 61 gd->bd->bi_boot_params = PHYS_SDRAM_1 + 0x100;
32 62  
... ... @@ -49,4 +79,13 @@
49 79 return 0;
50 80 }
51 81 #endif
  82 +
  83 +int board_eth_init(bd_t *bis)
  84 +{
  85 + int rc = 0;
  86 +#ifdef CONFIG_SMC911X
  87 + rc = smc911x_initialize(0, CONFIG_SMC911X_BASE);
  88 +#endif
  89 + return rc;
  90 +}
include/configs/smdkc100.h
... ... @@ -83,7 +83,6 @@
83 83 #undef CONFIG_CMD_FLASH
84 84 #undef CONFIG_CMD_IMLS
85 85 #undef CONFIG_CMD_NAND
86   -#undef CONFIG_CMD_NET
87 86  
88 87 #define CONFIG_CMD_CACHE
89 88 #define CONFIG_CMD_REGINFO
... ... @@ -234,6 +233,17 @@
234 233 #define CONFIG_SYS_ONENAND_BASE 0xE7100000
235 234  
236 235 #define CONFIG_DOS_PARTITION 1
  236 +
  237 +/*
  238 + * Ethernet Contoller driver
  239 + */
  240 +#ifdef CONFIG_CMD_NET
  241 +#define CONFIG_NET_MULTI
  242 +#define CONFIG_SMC911X 1 /* we have a SMC9115 on-board */
  243 +#define CONFIG_SMC911X_16_BIT 1 /* SMC911X_16_BIT Mode */
  244 +#define CONFIG_SMC911X_BASE 0x98800300 /* SMC911X Drive Base */
  245 +#define CONFIG_ENV_SROM_BANK 3 /* Select SROM Bank-3 for Ethernet*/
  246 +#endif /* CONFIG_CMD_NET */
237 247  
238 248 #endif /* __CONFIG_H */