vexpress64.c 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. /*
  2. * (C) Copyright 2013
  3. * David Feng <fenghua@phytium.com.cn>
  4. * Sharma Bhupesh <bhupesh.sharma@freescale.com>
  5. *
  6. * SPDX-License-Identifier: GPL-2.0+
  7. */
  8. #include <common.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/platdata.h>
  15. #include <dm/platform_data/serial_pl01x.h>
  16. #include "pcie.h"
  17. #include <asm/armv8/mmu.h>
  18. DECLARE_GLOBAL_DATA_PTR;
  19. static const struct pl01x_serial_platdata serial_platdata = {
  20. .base = V2M_UART0,
  21. .type = TYPE_PL011,
  22. .clock = CONFIG_PL011_CLOCK,
  23. };
  24. U_BOOT_DEVICE(vexpress_serials) = {
  25. .name = "serial_pl01x",
  26. .platdata = &serial_platdata,
  27. };
  28. static struct mm_region vexpress64_mem_map[] = {
  29. {
  30. .virt = 0x0UL,
  31. .phys = 0x0UL,
  32. .size = 0x80000000UL,
  33. .attrs = PTE_BLOCK_MEMTYPE(MT_DEVICE_NGNRNE) |
  34. PTE_BLOCK_NON_SHARE |
  35. PTE_BLOCK_PXN | PTE_BLOCK_UXN
  36. }, {
  37. .virt = 0x80000000UL,
  38. .phys = 0x80000000UL,
  39. .size = 0xff80000000UL,
  40. .attrs = PTE_BLOCK_MEMTYPE(MT_NORMAL) |
  41. PTE_BLOCK_INNER_SHARE
  42. }, {
  43. /* List terminator */
  44. 0,
  45. }
  46. };
  47. struct mm_region *mem_map = vexpress64_mem_map;
  48. /* This function gets replaced by platforms supporting PCIe.
  49. * The replacement function, eg. on Juno, initialises the PCIe bus.
  50. */
  51. __weak void vexpress64_pcie_init(void)
  52. {
  53. }
  54. int board_init(void)
  55. {
  56. vexpress64_pcie_init();
  57. return 0;
  58. }
  59. int dram_init(void)
  60. {
  61. gd->ram_size = PHYS_SDRAM_1_SIZE;
  62. return 0;
  63. }
  64. void dram_init_banksize(void)
  65. {
  66. gd->bd->bi_dram[0].start = PHYS_SDRAM_1;
  67. gd->bd->bi_dram[0].size = PHYS_SDRAM_1_SIZE;
  68. #ifdef PHYS_SDRAM_2
  69. gd->bd->bi_dram[1].start = PHYS_SDRAM_2;
  70. gd->bd->bi_dram[1].size = PHYS_SDRAM_2_SIZE;
  71. #endif
  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. }