smdkc100.c 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. // SPDX-License-Identifier: GPL-2.0+
  2. /*
  3. * Copyright (C) 2008-2009 Samsung Electronics
  4. * Minkyu Kang <mk7.kang@samsung.com>
  5. * Kyungmin Park <kyungmin.park@samsung.com>
  6. */
  7. #include <common.h>
  8. #include <init.h>
  9. #include <net.h>
  10. #include <asm/global_data.h>
  11. #include <asm/gpio.h>
  12. #include <asm/io.h>
  13. #include <asm/arch/sromc.h>
  14. #include <netdev.h>
  15. #include <asm/mach-types.h>
  16. DECLARE_GLOBAL_DATA_PTR;
  17. /*
  18. * Miscellaneous platform dependent initialisations
  19. */
  20. static void smc9115_pre_init(void)
  21. {
  22. u32 smc_bw_conf, smc_bc_conf;
  23. /* gpio configuration GPK0CON */
  24. gpio_cfg_pin(S5PC100_GPIO_K00 + CONFIG_ENV_SROM_BANK, S5P_GPIO_FUNC(2));
  25. /* Ethernet needs bus width of 16 bits */
  26. smc_bw_conf = SMC_DATA16_WIDTH(CONFIG_ENV_SROM_BANK);
  27. smc_bc_conf = SMC_BC_TACS(0x0) | SMC_BC_TCOS(0x4) | SMC_BC_TACC(0xe)
  28. | SMC_BC_TCOH(0x1) | SMC_BC_TAH(0x4)
  29. | SMC_BC_TACP(0x6) | SMC_BC_PMC(0x0);
  30. /* Select and configure the SROMC bank */
  31. s5p_config_sromc(CONFIG_ENV_SROM_BANK, smc_bw_conf, smc_bc_conf);
  32. }
  33. int board_init(void)
  34. {
  35. smc9115_pre_init();
  36. gd->bd->bi_arch_number = MACH_TYPE_SMDKC100;
  37. gd->bd->bi_boot_params = PHYS_SDRAM_1 + 0x100;
  38. return 0;
  39. }
  40. int dram_init(void)
  41. {
  42. gd->ram_size = get_ram_size((long *)PHYS_SDRAM_1, PHYS_SDRAM_1_SIZE);
  43. return 0;
  44. }
  45. int dram_init_banksize(void)
  46. {
  47. gd->bd->bi_dram[0].start = PHYS_SDRAM_1;
  48. gd->bd->bi_dram[0].size = PHYS_SDRAM_1_SIZE;
  49. return 0;
  50. }
  51. #ifdef CONFIG_DISPLAY_BOARDINFO
  52. int checkboard(void)
  53. {
  54. printf("Board:\tSMDKC100\n");
  55. return 0;
  56. }
  57. #endif
  58. int board_eth_init(struct bd_info *bis)
  59. {
  60. int rc = 0;
  61. #ifdef CONFIG_SMC911X
  62. rc = smc911x_initialize(0, CONFIG_SMC911X_BASE);
  63. #endif
  64. return rc;
  65. }