usb: dwc3: add dis_del_phy_power_chg_quirk
[oweals/u-boot.git] / drivers / fpga / zynqmppl.c
index c095d5ecaa85b80e9149136da2509ddf867f9828..4a826e4a71ab452467d3e4b8d2ae92cda74ab638 100644 (file)
@@ -7,7 +7,9 @@
 
 #include <console.h>
 #include <common.h>
+#include <cpu_func.h>
 #include <zynqmppl.h>
+#include <zynqmp_firmware.h>
 #include <linux/sizes.h>
 #include <asm/arch/sys_proto.h>
 #include <memalign.h>
@@ -151,9 +153,9 @@ static ulong zynqmp_align_dma_buffer(u32 *buf, u32 len, u32 swap)
 
                buf = new_buf;
        } else if ((swap != SWAP_DONE) &&
-                  (zynqmp_pmufw_version() <= PMUFW_V1_0)) {
+                  (zynqmp_firmware_version() <= PMUFW_V1_0)) {
                /* For bitstream which are aligned */
-               u32 *new_buf = (u32 *)buf;
+               new_buf = buf;
 
                printf("%s: Bitstream is not swapped(%d) - swap it\n", __func__,
                       swap);
@@ -204,7 +206,7 @@ static int zynqmp_load(xilinx_desc *desc, const void *buf, size_t bsize,
        u32 ret_payload[PAYLOAD_ARG_CNT];
        bool xilfpga_old = false;
 
-       if (zynqmp_pmufw_version() <= PMUFW_V1_0) {
+       if (zynqmp_firmware_version() <= PMUFW_V1_0) {
                puts("WARN: PMUFW v1.0 or less is detected\n");
                puts("WARN: Not all bitstream formats are supported\n");
                puts("WARN: Please upgrade PMUFW\n");
@@ -226,14 +228,15 @@ static int zynqmp_load(xilinx_desc *desc, const void *buf, size_t bsize,
        buf_hi = upper_32_bits(bin_buf);
 
        if (xilfpga_old)
-               ret = invoke_smc(ZYNQMP_SIP_SVC_PM_FPGA_LOAD, buf_lo, buf_hi,
-                                (u32)(uintptr_t)bsizeptr, bstype, ret_payload);
+               ret = xilinx_pm_request(ZYNQMP_SIP_SVC_PM_FPGA_LOAD, buf_lo,
+                                       buf_hi, (u32)(uintptr_t)bsizeptr,
+                                       bstype, ret_payload);
        else
-               ret = invoke_smc(ZYNQMP_SIP_SVC_PM_FPGA_LOAD, buf_lo, buf_hi,
-                                (u32)bsize, 0, ret_payload);
+               ret = xilinx_pm_request(ZYNQMP_SIP_SVC_PM_FPGA_LOAD, buf_lo,
+                                       buf_hi, (u32)bsize, 0, ret_payload);
 
        if (ret)
-               debug("PL FPGA LOAD fail\n");
+               puts("PL FPGA LOAD fail\n");
 
        return ret;
 }
@@ -271,7 +274,8 @@ 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 = invoke_smc(ZYNQMP_SIP_SVC_PM_FPGA_LOAD, buf_lo, buf_hi,
+       ret = xilinx_pm_request(ZYNQMP_SIP_SVC_PM_FPGA_LOAD, buf_lo,
+                               buf_hi,
                         (u32)(uintptr_t)fpga_sec_info->userkey_addr,
                         flag, ret_payload);
        if (ret)
@@ -288,8 +292,8 @@ static int zynqmp_pcap_info(xilinx_desc *desc)
        int ret;
        u32 ret_payload[PAYLOAD_ARG_CNT];
 
-       ret = invoke_smc(ZYNQMP_SIP_SVC_PM_FPGA_STATUS, 0, 0, 0,
-                        0, ret_payload);
+       ret = xilinx_pm_request(ZYNQMP_SIP_SVC_PM_FPGA_STATUS, 0, 0, 0,
+                               0, ret_payload);
        if (!ret)
                printf("PCAP status\t0x%x\n", ret_payload[1]);