diff --git a/plat/xilinx/zynqmp/aarch64/zynqmp_common.c b/plat/xilinx/zynqmp/aarch64/zynqmp_common.c index d1b52e1a5db9ba80c233ce2d7d9b0fa5d0b6cfb1..60a16058f0ec09fdd2ce57a4c093656fca1578f4 100644 --- a/plat/xilinx/zynqmp/aarch64/zynqmp_common.c +++ b/plat/xilinx/zynqmp/aarch64/zynqmp_common.c @@ -90,6 +90,18 @@ static unsigned int zynqmp_get_system_timer_freq(void) return 100000000; } +unsigned int zynqmp_get_silicon_id(void) +{ + uint32_t id; + + id = mmio_read_32(ZYNQMP_CSU_BASEADDR + ZYNQMP_CSU_IDCODE_OFFSET); + + id &= ZYNQMP_CSU_IDCODE_DEVICE_CODE_MASK | ZYNQMP_CSU_IDCODE_SVD_MASK; + id >>= ZYNQMP_CSU_IDCODE_SVD_SHIFT; + + return id; +} + #if LOG_LEVEL >= LOG_LEVEL_NOTICE static const struct { unsigned int id; @@ -141,18 +153,6 @@ static const struct { }, }; -static unsigned int zynqmp_get_silicon_id(void) -{ - uint32_t id; - - id = mmio_read_32(ZYNQMP_CSU_BASEADDR + ZYNQMP_CSU_IDCODE_OFFSET); - - id &= ZYNQMP_CSU_IDCODE_DEVICE_CODE_MASK | ZYNQMP_CSU_IDCODE_SVD_MASK; - id >>= ZYNQMP_CSU_IDCODE_SVD_SHIFT; - - return id; -} - static char *zynqmp_get_silicon_idcode_name(void) { unsigned int id; diff --git a/plat/xilinx/zynqmp/pm_service/pm_defs.h b/plat/xilinx/zynqmp/pm_service/pm_defs.h index 7fe5d37d301d7f656378f7c196d7df8c1010a180..aec335a5e73f24d18ca6a5588944fd6b6a5f7873 100644 --- a/plat/xilinx/zynqmp/pm_service/pm_defs.h +++ b/plat/xilinx/zynqmp/pm_service/pm_defs.h @@ -89,6 +89,7 @@ enum pm_api_id { PM_INIT, PM_FPGA_LOAD, PM_FPGA_GET_STATUS, + PM_GET_CHIPID, PM_API_MAX }; diff --git a/plat/xilinx/zynqmp/pm_service/pm_svc_main.c b/plat/xilinx/zynqmp/pm_service/pm_svc_main.c index ccb4df8cdf812e694a77beebd4d238cabb930349..9c08ffb9a34f029c4f21699cc82f500cd12b15b6 100644 --- a/plat/xilinx/zynqmp/pm_service/pm_svc_main.c +++ b/plat/xilinx/zynqmp/pm_service/pm_svc_main.c @@ -241,6 +241,9 @@ uint64_t pm_smc_handler(uint32_t smc_fid, uint64_t x1, uint64_t x2, uint64_t x3, SMC_RET1(handle, (uint64_t)ret | ((uint64_t)value) << 32); } + case PM_GET_CHIPID: + SMC_RET1(handle, zynqmp_get_silicon_id()); + default: WARN("Unimplemented PM Service Call: 0x%x\n", smc_fid); SMC_RET1(handle, SMC_UNK); diff --git a/plat/xilinx/zynqmp/zynqmp_private.h b/plat/xilinx/zynqmp/zynqmp_private.h index ddef37b8f3730d57e659a90d3c622e13fed56fc2..abcdebc39fb59a935dc9b8eecb49a57d95818077 100644 --- a/plat/xilinx/zynqmp/zynqmp_private.h +++ b/plat/xilinx/zynqmp/zynqmp_private.h @@ -39,6 +39,7 @@ void zynqmp_config_setup(void); unsigned int zynqmp_get_uart_clk(void); int zynqmp_is_pmu_up(void); unsigned int zynqmp_get_bootmode(void); +unsigned int zynqmp_get_silicon_id(void); /* For FSBL handover */ void fsbl_atf_handover(entry_point_info_t *bl32_image_ep_info,