smdkc100.c 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  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 <asm/gpio.h>
  9. #include <asm/io.h>
  10. #include <asm/arch/sromc.h>
  11. #include <netdev.h>
  12. #include <asm/mach-types.h>
  13. DECLARE_GLOBAL_DATA_PTR;
  14. /*
  15. * Miscellaneous platform dependent initialisations
  16. */
  17. static void smc9115_pre_init(void)
  18. {
  19. u32 smc_bw_conf, smc_bc_conf;
  20. /* gpio configuration GPK0CON */
  21. gpio_cfg_pin(S5PC100_GPIO_K00 + CONFIG_ENV_SROM_BANK, S5P_GPIO_FUNC(2));
  22. /* Ethernet needs bus width of 16 bits */
  23. smc_bw_conf = SMC_DATA16_WIDTH(CONFIG_ENV_SROM_BANK);
  24. smc_bc_conf = SMC_BC_TACS(0x0) | SMC_BC_TCOS(0x4) | SMC_BC_TACC(0xe)
  25. | SMC_BC_TCOH(0x1) | SMC_BC_TAH(0x4)
  26. | SMC_BC_TACP(0x6) | SMC_BC_PMC(0x0);
  27. /* Select and configure the SROMC bank */
  28. s5p_config_sromc(CONFIG_ENV_SROM_BANK, smc_bw_conf, smc_bc_conf);
  29. }
  30. int board_init(void)
  31. {
  32. smc9115_pre_init();
  33. gd->bd->bi_arch_number = MACH_TYPE_SMDKC100;
  34. gd->bd->bi_boot_params = PHYS_SDRAM_1 + 0x100;
  35. return 0;
  36. }
  37. int dram_init(void)
  38. {
  39. gd->ram_size = get_ram_size((long *)PHYS_SDRAM_1, PHYS_SDRAM_1_SIZE);
  40. return 0;
  41. }
  42. int dram_init_banksize(void)
  43. {
  44. gd->bd->bi_dram[0].start = PHYS_SDRAM_1;
  45. gd->bd->bi_dram[0].size = PHYS_SDRAM_1_SIZE;
  46. return 0;
  47. }
  48. #ifdef CONFIG_DISPLAY_BOARDINFO
  49. int checkboard(void)
  50. {
  51. printf("Board:\tSMDKC100\n");
  52. return 0;
  53. }
  54. #endif
  55. int board_eth_init(bd_t *bis)
  56. {
  57. int rc = 0;
  58. #ifdef CONFIG_SMC911X
  59. rc = smc911x_initialize(0, CONFIG_SMC911X_BASE);
  60. #endif
  61. return rc;
  62. }