plat: xilinx: zynqmp: Get chipid from registers for BL32
authorSiva Durga Prasad Paladugu <[email protected]>
Wed, 20 Jun 2018 11:33:57 +0000 (17:03 +0530)
committerSiva Durga Prasad Paladugu <[email protected]>
Thu, 21 Jun 2018 04:53:21 +0000 (10:23 +0530)
This patch reads the chipid registers directly instead of making
pm call when running at BL32. User should ensure that these registers
should always be accessed from APU in their system configuration.

Signed-off-by: Siva Durga Prasad Paladugu <[email protected]>
plat/xilinx/zynqmp/aarch64/zynqmp_common.c

index b144c84bd4998200e9fa3a082291ec6d846e079b..c3612706a011392f8f65189c764049d8530f6563 100644 (file)
@@ -205,12 +205,21 @@ static char *zynqmp_get_silicon_idcode_name(void)
 {
        uint32_t id, ver, chipid[2];
        size_t i, j, len;
-       enum pm_ret_status ret;
        const char *name = "EG/EV";
 
-       ret = pm_get_chipid(chipid);
-       if (ret)
+#ifdef IMAGE_BL32
+       /*
+        * For BL32, get the chip id info directly by reading corresponding
+        * registers instead of making pm call. This has limitation
+        * that these registers should be configured to have access
+        * from APU which is default case.
+        */
+       chipid[0] = mmio_read_32(ZYNQMP_CSU_BASEADDR + ZYNQMP_CSU_IDCODE_OFFSET);
+       chipid[1] = mmio_read_32(EFUSE_BASEADDR + EFUSE_IPDISABLE_OFFSET);
+#else
+       if (pm_get_chipid(chipid) != PM_RET_SUCCESS)
                return "UNKN";
+#endif
 
        id = chipid[0] & (ZYNQMP_CSU_IDCODE_DEVICE_CODE_MASK |
                          ZYNQMP_CSU_IDCODE_SVD_MASK);