]> git.baikalelectronics.ru Git - arm-tf.git/commitdiff
zynqmp:pm: Adds new zynqmp-pm api SMC call for efuse
authorVNSL Durga <vnsl.durga.challa@xilinx.com>
Mon, 23 Nov 2020 12:46:04 +0000 (04:46 -0800)
committerManish Pandey <manish.pandey2@arm.com>
Mon, 4 Jan 2021 11:50:07 +0000 (11:50 +0000)
This patch adds new api to access zynqmp efuse memory

Signed-off-by: VNSL Durga <vnsl.durga.challa@xilinx.com>
Signed-off-by: Rajan Vaja <rajan.vaja@xilinx.com>
Change-Id: I0971ab6549552a6f96412431388d19b822db00ab

plat/xilinx/zynqmp/pm_service/pm_api_sys.c
plat/xilinx/zynqmp/pm_service/pm_api_sys.h
plat/xilinx/zynqmp/pm_service/pm_defs.h
plat/xilinx/zynqmp/pm_service/pm_svc_main.c

index 9a1f1b486c2fa320f1c726ce3b29b8bcee60a00e..3427149353966c6c6f788fbd00115a9cd91d5a62 100644 (file)
@@ -1591,3 +1591,29 @@ enum pm_ret_status pm_register_access(unsigned int register_access_id,
        }
        return ret;
 }
+
+/**
+ * pm_efuse_access() - To program or read efuse bits.
+ *
+ * This function provides access to the xilskey library to program/read
+ * efuse bits.
+ *
+ * address_low: lower 32-bit Linear memory space address
+ * address_high: higher 32-bit Linear memory space address
+ *
+ * value: Returned output value
+ *
+ * @return  Returns status, either success or error+reason
+ *
+ */
+enum pm_ret_status pm_efuse_access(uint32_t address_high,
+                                  uint32_t address_low,
+                                  uint32_t *value)
+{
+       uint32_t payload[PAYLOAD_ARG_CNT];
+
+       /* Send request to the PMU */
+       PM_PACK_PAYLOAD3(payload, PM_EFUSE_ACCESS, address_high, address_low);
+
+       return pm_ipi_send_sync(primary_proc, payload, value, 1);
+}
index 60fc303fe707a77335f26d892d2493b1fba3c363..b3ebb275258953bc5f70ee48fc9771045e7f1fde 100644 (file)
@@ -196,5 +196,7 @@ enum pm_ret_status pm_pll_get_parameter(enum pm_node_id nid,
 
 enum pm_ret_status pm_pll_set_mode(enum pm_node_id nid, enum pm_pll_mode mode);
 enum pm_ret_status pm_pll_get_mode(enum pm_node_id nid, enum pm_pll_mode *mode);
+enum pm_ret_status pm_efuse_access(uint32_t address_high,
+                                  uint32_t address_low, uint32_t *value);
 
 #endif /* PM_API_SYS_H */
index 8b28807b7ea2414754296d331487f2fbf7ee346a..da8789301a6c1b5081508b8a1677d8b1a1df7e09 100644 (file)
@@ -99,6 +99,7 @@ enum pm_api_id {
        PM_PLL_GET_MODE,
        /* PM Register Access API */
        PM_REGISTER_ACCESS,
+       PM_EFUSE_ACCESS,
        PM_API_MAX
 };
 
index bf608dbd3d9fc0e8c7397f9d93656266be7d7778..5b3e73724de2005c187960a19868e922519f1b9d 100644 (file)
@@ -615,6 +615,14 @@ 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_EFUSE_ACCESS:
+       {
+               uint32_t value;
+
+               ret = pm_efuse_access(pm_arg[0], pm_arg[1], &value);
+               SMC_RET1(handle, (uint64_t)ret | ((uint64_t)value) << 32);
+       }
+
        default:
                WARN("Unimplemented PM Service Call: 0x%x\n", smc_fid);
                SMC_RET1(handle, SMC_UNK);