arndale.c 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. // SPDX-License-Identifier: GPL-2.0+
  2. /*
  3. * Copyright (C) 2013 Samsung Electronics
  4. */
  5. #include <common.h>
  6. #include <cpu_func.h>
  7. #include <init.h>
  8. #include <log.h>
  9. #include <usb.h>
  10. #include <asm/gpio.h>
  11. #include <asm/arch/pinmux.h>
  12. #include <asm/arch/dwmmc.h>
  13. #include <asm/arch/power.h>
  14. DECLARE_GLOBAL_DATA_PTR;
  15. #ifdef CONFIG_USB_EHCI_EXYNOS
  16. int board_usb_init(int index, enum usb_init_type init)
  17. {
  18. /* Configure gpios for usb 3503 hub:
  19. * disconnect, toggle reset and connect
  20. */
  21. gpio_request(EXYNOS5_GPIO_D17, "usb_connect");
  22. gpio_request(EXYNOS5_GPIO_X35, "usb_reset");
  23. gpio_direction_output(EXYNOS5_GPIO_D17, 0);
  24. gpio_direction_output(EXYNOS5_GPIO_X35, 0);
  25. gpio_direction_output(EXYNOS5_GPIO_X35, 1);
  26. gpio_direction_output(EXYNOS5_GPIO_D17, 1);
  27. return 0;
  28. }
  29. #endif
  30. int board_init(void)
  31. {
  32. gd->bd->bi_boot_params = (PHYS_SDRAM_1 + 0x100UL);
  33. return 0;
  34. }
  35. int dram_init(void)
  36. {
  37. int i;
  38. u32 addr;
  39. for (i = 0; i < CONFIG_NR_DRAM_BANKS; i++) {
  40. addr = CONFIG_SYS_SDRAM_BASE + (i * SDRAM_BANK_SIZE);
  41. gd->ram_size += get_ram_size((long *)addr, SDRAM_BANK_SIZE);
  42. }
  43. return 0;
  44. }
  45. int power_init_board(void)
  46. {
  47. set_ps_hold_ctrl();
  48. return 0;
  49. }
  50. int dram_init_banksize(void)
  51. {
  52. int i;
  53. u32 addr, size;
  54. for (i = 0; i < CONFIG_NR_DRAM_BANKS; i++) {
  55. addr = CONFIG_SYS_SDRAM_BASE + (i * SDRAM_BANK_SIZE);
  56. size = get_ram_size((long *)addr, SDRAM_BANK_SIZE);
  57. gd->bd->bi_dram[i].start = addr;
  58. gd->bd->bi_dram[i].size = size;
  59. }
  60. return 0;
  61. }
  62. #ifdef CONFIG_MMC
  63. int board_mmc_init(struct bd_info *bis)
  64. {
  65. int ret;
  66. /* dwmmc initializattion for available channels */
  67. ret = exynos_dwmmc_init(gd->fdt_blob);
  68. if (ret)
  69. debug("dwmmc init failed\n");
  70. return ret;
  71. }
  72. #endif
  73. static int board_uart_init(void)
  74. {
  75. int err = 0, uart_id;
  76. for (uart_id = PERIPH_ID_UART0; uart_id <= PERIPH_ID_UART3; uart_id++) {
  77. err = exynos_pinmux_config(uart_id, PINMUX_FLAG_NONE);
  78. if (err) {
  79. debug("UART%d not configured\n",
  80. (uart_id - PERIPH_ID_UART0));
  81. return err;
  82. }
  83. }
  84. return err;
  85. }
  86. #ifdef CONFIG_BOARD_EARLY_INIT_F
  87. int board_early_init_f(void)
  88. {
  89. int err;
  90. err = board_uart_init();
  91. if (err) {
  92. debug("UART init failed\n");
  93. return err;
  94. }
  95. return err;
  96. }
  97. #endif
  98. #ifdef CONFIG_DISPLAY_BOARDINFO
  99. int checkboard(void)
  100. {
  101. printf("\nBoard: Arndale\n");
  102. return 0;
  103. }
  104. #endif
  105. #ifdef CONFIG_S5P_PA_SYSRAM
  106. void smp_set_core_boot_addr(unsigned long addr, int corenr)
  107. {
  108. writel(addr, CONFIG_S5P_PA_SYSRAM);
  109. /* make sure this write is really executed */
  110. __asm__ volatile ("dsb\n");
  111. }
  112. #endif