Browse Source

zynqmp: Add support to provide silicon id through SMC

Add support to provide silicon id to non-secure
software through SMC.

Signed-off-by: Siva Durga Prasad Paladugu <sivadur@xilinx.com>

[ sb
Move zynqmp_get_silicon_id outside of compile guards to avoid build
errors.
]

Signed-off-by: Soren Brinkmann <soren.brinkmann@xilinx.com>
Acked-by: Michal Simek <michal.simek@xilinx.com>
pull/709/head
Siva Durga Prasad Paladugu 8 years ago
committed by Soren Brinkmann
parent
commit
3104f2e78d
  1. 24
      plat/xilinx/zynqmp/aarch64/zynqmp_common.c
  2. 1
      plat/xilinx/zynqmp/pm_service/pm_defs.h
  3. 3
      plat/xilinx/zynqmp/pm_service/pm_svc_main.c
  4. 1
      plat/xilinx/zynqmp/zynqmp_private.h

24
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;

1
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
};

3
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);

1
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,

Loading…
Cancel
Save