Commit 466675c2 authored by Soren Brinkmann's avatar Soren Brinkmann
Browse files

zynqmp: Read silicon ID register only once



The silicon ID does not change at runtime. Skip the IO access if the
ID has been read before.
Signed-off-by: default avatarSoren Brinkmann <soren.brinkmann@xilinx.com>
Acked-by: default avatarMichal Simek <michal.simek@xilinx.com>
parent 90d2956a
......@@ -49,11 +49,14 @@ const mmap_region_t plat_arm_mmap[] = {
static unsigned int zynqmp_get_silicon_ver(void)
{
unsigned int ver;
static unsigned int ver;
ver = mmio_read_32(ZYNQMP_CSU_BASEADDR + ZYNQMP_CSU_VERSION_OFFSET);
if (!ver) {
ver = mmio_read_32(ZYNQMP_CSU_BASEADDR +
ZYNQMP_CSU_VERSION_OFFSET);
ver &= ZYNQMP_SILICON_VER_MASK;
ver >>= ZYNQMP_SILICON_VER_SHIFT;
}
return ver;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment