init.c 929 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. // SPDX-License-Identifier: GPL-2.0
  2. /*
  3. * Copyright (C) 2019 MediaTek Inc.
  4. * Author: Sam Shih <sam.shih@mediatek.com>
  5. */
  6. #include <common.h>
  7. #include <fdtdec.h>
  8. #include <asm/armv8/mmu.h>
  9. #include <asm/cache.h>
  10. int print_cpuinfo(void)
  11. {
  12. printf("CPU: MediaTek MT7622\n");
  13. return 0;
  14. }
  15. int dram_init(void)
  16. {
  17. int ret;
  18. ret = fdtdec_setup_memory_banksize();
  19. if (ret)
  20. return ret;
  21. return fdtdec_setup_mem_size_base();
  22. }
  23. void reset_cpu(ulong addr)
  24. {
  25. psci_system_reset();
  26. }
  27. static struct mm_region mt7622_mem_map[] = {
  28. {
  29. /* DDR */
  30. .virt = 0x40000000UL,
  31. .phys = 0x40000000UL,
  32. .size = 0x40000000UL,
  33. .attrs = PTE_BLOCK_MEMTYPE(MT_NORMAL) | PTE_BLOCK_OUTER_SHARE,
  34. }, {
  35. .virt = 0x00000000UL,
  36. .phys = 0x00000000UL,
  37. .size = 0x40000000UL,
  38. .attrs = PTE_BLOCK_MEMTYPE(MT_DEVICE_NGNRNE) |
  39. PTE_BLOCK_NON_SHARE |
  40. PTE_BLOCK_PXN | PTE_BLOCK_UXN
  41. }, {
  42. 0,
  43. }
  44. };
  45. struct mm_region *mem_map = mt7622_mem_map;