[PATCH] fpga: zynqmp: Get rid of ZYNQMP_SIP_SVC* macros

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[PATCH] fpga: zynqmp: Get rid of ZYNQMP_SIP_SVC* macros

Michal Simek-3
There is no need to use these macros because enum pm_api_id can be used
instead.

Signed-off-by: Michal Simek <[hidden email]>
---

 drivers/fpga/zynqmppl.c | 8 ++++----
 include/zynqmppl.h      | 3 ---
 2 files changed, 4 insertions(+), 7 deletions(-)

diff --git a/drivers/fpga/zynqmppl.c b/drivers/fpga/zynqmppl.c
index 5b103cfeaf18..03878d32ec1c 100644
--- a/drivers/fpga/zynqmppl.c
+++ b/drivers/fpga/zynqmppl.c
@@ -231,11 +231,11 @@ static int zynqmp_load(xilinx_desc *desc, const void *buf, size_t bsize,
  buf_hi = upper_32_bits(bin_buf);
 
  if (xilfpga_old)
- ret = xilinx_pm_request(ZYNQMP_SIP_SVC_PM_FPGA_LOAD, buf_lo,
+ ret = xilinx_pm_request(PM_FPGA_LOAD, buf_lo,
  buf_hi, (u32)(uintptr_t)bsizeptr,
  bstype, ret_payload);
  else
- ret = xilinx_pm_request(ZYNQMP_SIP_SVC_PM_FPGA_LOAD, buf_lo,
+ ret = xilinx_pm_request(PM_FPGA_LOAD, buf_lo,
  buf_hi, (u32)bsize, 0, ret_payload);
 
  if (ret)
@@ -277,7 +277,7 @@ static int zynqmp_loads(xilinx_desc *desc, const void *buf, size_t bsize,
  buf_lo = lower_32_bits((ulong)buf);
  buf_hi = upper_32_bits((ulong)buf);
 
- ret = xilinx_pm_request(ZYNQMP_SIP_SVC_PM_FPGA_LOAD, buf_lo,
+ ret = xilinx_pm_request(PM_FPGA_LOAD, buf_lo,
  buf_hi,
  (u32)(uintptr_t)fpga_sec_info->userkey_addr,
  flag, ret_payload);
@@ -295,7 +295,7 @@ static int zynqmp_pcap_info(xilinx_desc *desc)
  int ret;
  u32 ret_payload[PAYLOAD_ARG_CNT];
 
- ret = xilinx_pm_request(ZYNQMP_SIP_SVC_PM_FPGA_STATUS, 0, 0, 0,
+ ret = xilinx_pm_request(PM_FPGA_GET_STATUS, 0, 0, 0,
  0, ret_payload);
  if (!ret)
  printf("PCAP status\t0x%x\n", ret_payload[1]);
diff --git a/include/zynqmppl.h b/include/zynqmppl.h
index a0a52ec4c1d3..35cfe17d4441 100644
--- a/include/zynqmppl.h
+++ b/include/zynqmppl.h
@@ -10,9 +10,6 @@
 #include <xilinx.h>
 #include <linux/bitops.h>
 
-#define ZYNQMP_SIP_SVC_CSU_DMA_CHIPID 0xC2000018
-#define ZYNQMP_SIP_SVC_PM_FPGA_LOAD 0xC2000016
-#define ZYNQMP_SIP_SVC_PM_FPGA_STATUS 0xC2000017
 #define ZYNQMP_FPGA_OP_INIT (1 << 0)
 #define ZYNQMP_FPGA_OP_LOAD (1 << 1)
 #define ZYNQMP_FPGA_OP_DONE (1 << 2)
--
2.28.0

Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] fpga: zynqmp: Get rid of ZYNQMP_SIP_SVC* macros

Michal Simek-4
čt 10. 9. 2020 v 12:41 odesílatel Michal Simek <[hidden email]> napsal:

>
> There is no need to use these macros because enum pm_api_id can be used
> instead.
>
> Signed-off-by: Michal Simek <[hidden email]>
> ---
>
>  drivers/fpga/zynqmppl.c | 8 ++++----
>  include/zynqmppl.h      | 3 ---
>  2 files changed, 4 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/fpga/zynqmppl.c b/drivers/fpga/zynqmppl.c
> index 5b103cfeaf18..03878d32ec1c 100644
> --- a/drivers/fpga/zynqmppl.c
> +++ b/drivers/fpga/zynqmppl.c
> @@ -231,11 +231,11 @@ static int zynqmp_load(xilinx_desc *desc, const void *buf, size_t bsize,
>         buf_hi = upper_32_bits(bin_buf);
>
>         if (xilfpga_old)
> -               ret = xilinx_pm_request(ZYNQMP_SIP_SVC_PM_FPGA_LOAD, buf_lo,
> +               ret = xilinx_pm_request(PM_FPGA_LOAD, buf_lo,
>                                         buf_hi, (u32)(uintptr_t)bsizeptr,
>                                         bstype, ret_payload);
>         else
> -               ret = xilinx_pm_request(ZYNQMP_SIP_SVC_PM_FPGA_LOAD, buf_lo,
> +               ret = xilinx_pm_request(PM_FPGA_LOAD, buf_lo,
>                                         buf_hi, (u32)bsize, 0, ret_payload);
>
>         if (ret)
> @@ -277,7 +277,7 @@ static int zynqmp_loads(xilinx_desc *desc, const void *buf, size_t bsize,
>         buf_lo = lower_32_bits((ulong)buf);
>         buf_hi = upper_32_bits((ulong)buf);
>
> -       ret = xilinx_pm_request(ZYNQMP_SIP_SVC_PM_FPGA_LOAD, buf_lo,
> +       ret = xilinx_pm_request(PM_FPGA_LOAD, buf_lo,
>                                 buf_hi,
>                          (u32)(uintptr_t)fpga_sec_info->userkey_addr,
>                          flag, ret_payload);
> @@ -295,7 +295,7 @@ static int zynqmp_pcap_info(xilinx_desc *desc)
>         int ret;
>         u32 ret_payload[PAYLOAD_ARG_CNT];
>
> -       ret = xilinx_pm_request(ZYNQMP_SIP_SVC_PM_FPGA_STATUS, 0, 0, 0,
> +       ret = xilinx_pm_request(PM_FPGA_GET_STATUS, 0, 0, 0,
>                                 0, ret_payload);
>         if (!ret)
>                 printf("PCAP status\t0x%x\n", ret_payload[1]);
> diff --git a/include/zynqmppl.h b/include/zynqmppl.h
> index a0a52ec4c1d3..35cfe17d4441 100644
> --- a/include/zynqmppl.h
> +++ b/include/zynqmppl.h
> @@ -10,9 +10,6 @@
>  #include <xilinx.h>
>  #include <linux/bitops.h>
>
> -#define ZYNQMP_SIP_SVC_CSU_DMA_CHIPID          0xC2000018
> -#define ZYNQMP_SIP_SVC_PM_FPGA_LOAD            0xC2000016
> -#define ZYNQMP_SIP_SVC_PM_FPGA_STATUS          0xC2000017
>  #define ZYNQMP_FPGA_OP_INIT                    (1 << 0)
>  #define ZYNQMP_FPGA_OP_LOAD                    (1 << 1)
>  #define ZYNQMP_FPGA_OP_DONE                    (1 << 2)
> --
> 2.28.0
>

Applied.
M

--
Michal Simek, Ing. (M.Eng), OpenPGP -> KeyID: FE3D1F91
w: www.monstr.eu p: +42-0-721842854
Maintainer of Linux kernel - Xilinx Microblaze
Maintainer of Linux kernel - Xilinx Zynq ARM and ZynqMP ARM64 SoCs
U-Boot custodian - Xilinx Microblaze/Zynq/ZynqMP/Versal SoCs