versal.c 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. /*
  2. * Copyright (c) 2023, Advanced Micro Devices, Inc. All rights reserved.
  3. *
  4. * SPDX-License-Identifier: BSD-3-Clause
  5. */
  6. #include <common/debug.h>
  7. #include <lib/mmio.h>
  8. #include <lib/smccc.h>
  9. #include <plat/common/platform.h>
  10. #include <services/arm_arch_svc.h>
  11. #include <plat_private.h>
  12. #include <plat_startup.h>
  13. #include <pm_api_sys.h>
  14. /**
  15. * plat_is_smccc_feature_available() - This function checks whether SMCCC
  16. * feature is availabile for platform.
  17. * @fid: SMCCC function id.
  18. *
  19. * Return: SMC_ARCH_CALL_SUCCESS - if SMCCC feature is available.
  20. * SMC_ARCH_CALL_NOT_SUPPORTED - Otherwise.
  21. *
  22. */
  23. int32_t plat_is_smccc_feature_available(u_register_t fid)
  24. {
  25. switch (fid) {
  26. case SMCCC_ARCH_SOC_ID:
  27. return SMC_ARCH_CALL_SUCCESS;
  28. default:
  29. return SMC_ARCH_CALL_NOT_SUPPORTED;
  30. }
  31. }
  32. /**
  33. * plat_get_soc_version() - Get the SOC version of the platform.
  34. *
  35. * Return: SiP defined SoC version in JEP-106.
  36. *
  37. * This function is called when the SoC_ID_type == 0.
  38. * For further details please refer to section 7.4 of SMC Calling Convention.
  39. */
  40. int32_t plat_get_soc_version(void)
  41. {
  42. uint32_t manfid;
  43. manfid = SOC_ID_SET_JEP_106(JEDEC_XILINX_BKID, JEDEC_XILINX_MFID);
  44. return (int32_t)(manfid | (platform_version & SOC_ID_IMPL_DEF_MASK));
  45. }
  46. /**
  47. * plat_get_soc_revision() - Get the SOC revision for the platform.
  48. *
  49. * Return: SiP defined SoC revision.
  50. *
  51. * This function is called when the SoC_ID_type == 1
  52. * For further details please refer to section 7.4 of SMC Calling Convention
  53. */
  54. int32_t plat_get_soc_revision(void)
  55. {
  56. return (platform_id & SOC_ID_REV_MASK);
  57. }