vexpress64.c 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. // SPDX-License-Identifier: GPL-2.0+
  2. /*
  3. * (C) Copyright 2013
  4. * David Feng <fenghua@phytium.com.cn>
  5. * Sharma Bhupesh <bhupesh.sharma@freescale.com>
  6. */
  7. #include <common.h>
  8. #include <dm.h>
  9. #include <malloc.h>
  10. #include <errno.h>
  11. #include <netdev.h>
  12. #include <asm/io.h>
  13. #include <linux/compiler.h>
  14. #include <dm/platform_data/serial_pl01x.h>
  15. #include "pcie.h"
  16. #include <asm/armv8/mmu.h>
  17. DECLARE_GLOBAL_DATA_PTR;
  18. static const struct pl01x_serial_platdata serial_platdata = {
  19. .base = V2M_UART0,
  20. .type = TYPE_PL011,
  21. .clock = CONFIG_PL011_CLOCK,
  22. };
  23. U_BOOT_DEVICE(vexpress_serials) = {
  24. .name = "serial_pl01x",
  25. .platdata = &serial_platdata,
  26. };
  27. static struct mm_region vexpress64_mem_map[] = {
  28. {
  29. .virt = 0x0UL,
  30. .phys = 0x0UL,
  31. .size = 0x80000000UL,
  32. .attrs = PTE_BLOCK_MEMTYPE(MT_DEVICE_NGNRNE) |
  33. PTE_BLOCK_NON_SHARE |
  34. PTE_BLOCK_PXN | PTE_BLOCK_UXN
  35. }, {
  36. .virt = 0x80000000UL,
  37. .phys = 0x80000000UL,
  38. .size = 0xff80000000UL,
  39. .attrs = PTE_BLOCK_MEMTYPE(MT_NORMAL) |
  40. PTE_BLOCK_INNER_SHARE
  41. }, {
  42. /* List terminator */
  43. 0,
  44. }
  45. };
  46. struct mm_region *mem_map = vexpress64_mem_map;
  47. /* This function gets replaced by platforms supporting PCIe.
  48. * The replacement function, eg. on Juno, initialises the PCIe bus.
  49. */
  50. __weak void vexpress64_pcie_init(void)
  51. {
  52. }
  53. int board_init(void)
  54. {
  55. vexpress64_pcie_init();
  56. return 0;
  57. }
  58. int dram_init(void)
  59. {
  60. gd->ram_size = PHYS_SDRAM_1_SIZE;
  61. return 0;
  62. }
  63. int dram_init_banksize(void)
  64. {
  65. gd->bd->bi_dram[0].start = PHYS_SDRAM_1;
  66. gd->bd->bi_dram[0].size = PHYS_SDRAM_1_SIZE;
  67. #ifdef PHYS_SDRAM_2
  68. gd->bd->bi_dram[1].start = PHYS_SDRAM_2;
  69. gd->bd->bi_dram[1].size = PHYS_SDRAM_2_SIZE;
  70. #endif
  71. return 0;
  72. }
  73. /*
  74. * Board specific reset that is system reset.
  75. */
  76. void reset_cpu(ulong addr)
  77. {
  78. }
  79. /*
  80. * Board specific ethernet initialization routine.
  81. */
  82. int board_eth_init(bd_t *bis)
  83. {
  84. int rc = 0;
  85. #ifdef CONFIG_SMC91111
  86. rc = smc91111_initialize(0, CONFIG_SMC91111_BASE);
  87. #endif
  88. #ifdef CONFIG_SMC911X
  89. rc = smc911x_initialize(0, CONFIG_SMC911X_BASE);
  90. #endif
  91. return rc;
  92. }