fvp_ve_common.c 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. /*
  2. * Copyright (c) 2019, Arm Limited. All rights reserved.
  3. *
  4. * SPDX-License-Identifier: BSD-3-Clause
  5. */
  6. #include <assert.h>
  7. #include <common/debug.h>
  8. #include <lib/mmio.h>
  9. #include <platform_def.h>
  10. #include <plat/arm/common/arm_config.h>
  11. #include <plat/arm/common/plat_arm.h>
  12. #define MAP_DEVICE0 MAP_REGION_FLAT(DEVICE0_BASE, \
  13. DEVICE0_SIZE, \
  14. MT_DEVICE | MT_RW | MT_SECURE)
  15. #ifdef IMAGE_BL1
  16. const mmap_region_t plat_arm_mmap[] = {
  17. ARM_MAP_SHARED_RAM,
  18. V2M_MAP_FLASH1_RW,
  19. V2M_MAP_IOFPGA,
  20. {0}
  21. };
  22. #endif
  23. #ifdef IMAGE_BL2
  24. const mmap_region_t plat_arm_mmap[] = {
  25. ARM_MAP_SHARED_RAM,
  26. V2M_MAP_FLASH1_RW,
  27. V2M_MAP_IOFPGA,
  28. ARM_MAP_NS_DRAM1,
  29. {0}
  30. };
  31. #endif
  32. #ifdef IMAGE_BL32
  33. const mmap_region_t plat_arm_mmap[] = {
  34. ARM_MAP_SHARED_RAM,
  35. V2M_MAP_IOFPGA,
  36. MAP_DEVICE0,
  37. {0}
  38. };
  39. #endif
  40. ARM_CASSERT_MMAP
  41. void __init fvp_ve_config_setup(void)
  42. {
  43. unsigned int sys_id, arch;
  44. sys_id = mmio_read_32(V2M_SYSREGS_BASE + V2M_SYS_ID);
  45. arch = (sys_id >> V2M_SYS_ID_ARCH_SHIFT) & V2M_SYS_ID_ARCH_MASK;
  46. if (arch != ARCH_MODEL_VE) {
  47. ERROR("This firmware is for FVP VE models\n");
  48. panic();
  49. }
  50. }
  51. unsigned int plat_get_syscnt_freq2(void)
  52. {
  53. return FVP_VE_TIMER_BASE_FREQUENCY;
  54. }