init.c 947 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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 <init.h>
  9. #include <asm/armv8/mmu.h>
  10. #include <asm/cache.h>
  11. int print_cpuinfo(void)
  12. {
  13. printf("CPU: MediaTek MT7622\n");
  14. return 0;
  15. }
  16. int dram_init(void)
  17. {
  18. int ret;
  19. ret = fdtdec_setup_memory_banksize();
  20. if (ret)
  21. return ret;
  22. return fdtdec_setup_mem_size_base();
  23. }
  24. void reset_cpu(ulong addr)
  25. {
  26. psci_system_reset();
  27. }
  28. static struct mm_region mt7622_mem_map[] = {
  29. {
  30. /* DDR */
  31. .virt = 0x40000000UL,
  32. .phys = 0x40000000UL,
  33. .size = 0x40000000UL,
  34. .attrs = PTE_BLOCK_MEMTYPE(MT_NORMAL) | PTE_BLOCK_OUTER_SHARE,
  35. }, {
  36. .virt = 0x00000000UL,
  37. .phys = 0x00000000UL,
  38. .size = 0x40000000UL,
  39. .attrs = PTE_BLOCK_MEMTYPE(MT_DEVICE_NGNRNE) |
  40. PTE_BLOCK_NON_SHARE |
  41. PTE_BLOCK_PXN | PTE_BLOCK_UXN
  42. }, {
  43. 0,
  44. }
  45. };
  46. struct mm_region *mem_map = mt7622_mem_map;