firmware: xilinx: Remove eemi ops for get_chipid
authorRajan Vaja <rajan.vaja@xilinx.com>
Fri, 24 Apr 2020 20:57:44 +0000 (13:57 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 28 Apr 2020 13:45:06 +0000 (15:45 +0200)
Use direct function call instead of eemi ops for get_chipid.

Signed-off-by: Rajan Vaja <rajan.vaja@xilinx.com>
Signed-off-by: Jolly Shah <jolly.shah@xilinx.com>
Link: https://lore.kernel.org/r/1587761887-4279-3-git-send-email-jolly.shah@xilinx.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/firmware/xilinx/zynqmp.c
drivers/nvmem/zynqmp_nvmem.c
include/linux/firmware/xlnx-zynqmp.h

index 36dab68344df5b168abec9c2b1ffb639ab4d6615..36ab9ac1729a29d4e5a2db75c6073e32009925a3 100644 (file)
@@ -247,7 +247,7 @@ EXPORT_SYMBOL_GPL(zynqmp_pm_get_api_version);
  * Return:      Returns the status of the operation and the idcode and version
  *              registers in @idcode and @version.
  */
-static int zynqmp_pm_get_chipid(u32 *idcode, u32 *version)
+int zynqmp_pm_get_chipid(u32 *idcode, u32 *version)
 {
        u32 ret_payload[PAYLOAD_ARG_CNT];
        int ret;
@@ -261,6 +261,7 @@ static int zynqmp_pm_get_chipid(u32 *idcode, u32 *version)
 
        return ret;
 }
+EXPORT_SYMBOL_GPL(zynqmp_pm_get_chipid);
 
 /**
  * zynqmp_pm_get_trustzone_version() - Get secure trustzone firmware version
@@ -735,7 +736,6 @@ static int zynqmp_pm_aes_engine(const u64 address, u32 *out)
 }
 
 static const struct zynqmp_eemi_ops eemi_ops = {
-       .get_chipid = zynqmp_pm_get_chipid,
        .query_data = zynqmp_pm_query_data,
        .clock_enable = zynqmp_pm_clock_enable,
        .clock_disable = zynqmp_pm_clock_disable,
index 5893543918c8dc1d570b0b8ce743536c8b5c95b0..e28d7b133e11b07bd0f0277b9d6e1d85d9ee5b62 100644 (file)
@@ -16,8 +16,6 @@ struct zynqmp_nvmem_data {
        struct nvmem_device *nvmem;
 };
 
-static const struct zynqmp_eemi_ops *eemi_ops;
-
 static int zynqmp_nvmem_read(void *context, unsigned int offset,
                             void *val, size_t bytes)
 {
@@ -25,10 +23,7 @@ static int zynqmp_nvmem_read(void *context, unsigned int offset,
        int idcode, version;
        struct zynqmp_nvmem_data *priv = context;
 
-       if (!eemi_ops->get_chipid)
-               return -ENXIO;
-
-       ret = eemi_ops->get_chipid(&idcode, &version);
+       ret = zynqmp_pm_get_chipid(&idcode, &version);
        if (ret < 0)
                return ret;
 
@@ -61,10 +56,6 @@ static int zynqmp_nvmem_probe(struct platform_device *pdev)
        if (!priv)
                return -ENOMEM;
 
-       eemi_ops = zynqmp_pm_get_eemi_ops();
-       if (IS_ERR(eemi_ops))
-               return PTR_ERR(eemi_ops);
-
        priv->dev = dev;
        econfig.dev = dev;
        econfig.reg_read = zynqmp_nvmem_read;
index a21abcdb1020285994941f8ac181b41af7a56fc3..89f6a5394a658979bf274219d130bb22d2815e41 100644 (file)
@@ -294,7 +294,6 @@ struct zynqmp_pm_query_data {
 };
 
 struct zynqmp_eemi_ops {
-       int (*get_chipid)(u32 *idcode, u32 *version);
        int (*fpga_load)(const u64 address, const u32 size, const u32 flags);
        int (*fpga_get_status)(u32 *value);
        int (*query_data)(struct zynqmp_pm_query_data qdata, u32 *out);
@@ -331,6 +330,7 @@ int zynqmp_pm_invoke_fn(u32 pm_api_id, u32 arg0, u32 arg1,
 #if IS_REACHABLE(CONFIG_ZYNQMP_FIRMWARE)
 const struct zynqmp_eemi_ops *zynqmp_pm_get_eemi_ops(void);
 int zynqmp_pm_get_api_version(u32 *version);
+int zynqmp_pm_get_chipid(u32 *idcode, u32 *version);
 #else
 static inline struct zynqmp_eemi_ops *zynqmp_pm_get_eemi_ops(void)
 {
@@ -340,6 +340,10 @@ static inline int zynqmp_pm_get_api_version(u32 *version)
 {
        return -ENODEV;
 }
+static inline int zynqmp_pm_get_chipid(u32 *idcode, u32 *version)
+{
+       return -ENODEV;
+}
 #endif
 
 #endif /* __FIRMWARE_ZYNQMP_H__ */