History

Merge tag 'zynqmp-soc-for-v5.2' of https://github.com/Xilinx/linux-xlnx into arm/drivers

arm64: zynqmp: SoC changes for v5.2 - Add support for ZynqMP fpga manager - Defer some probes which depends on firmware driver to be ready - Debugfs fix * tag 'zynqmp-soc-for-v5.2' of https://github.com/Xilinx/linux-xlnx: fpga manager: Adding FPGA Manager support for Xilinx zynqmp dt-bindings: fpga: Add bindings for ZynqMP fpga driver firmware: xilinx: Add fpga API's drivers: Defer probe if firmware is not ready firmware: xilinx: fix debugfs write handler

Olof Johansson committed 7 years ago

Commit b94d3ff2 parents 0065198 c09f74714 files · +302 −39Browse files

Unified · Split

14 files
  1. Documentation/devicetree/bindings/fpga/xlnx,zynqmp-pcap-fpga.txt +25 −0
  2. Documentation/xilinx/eemi.txt +2 −2
  3. drivers/clk/zynqmp/clkc.c +2 −2
  4. drivers/firmware/xilinx/zynqmp-debug.c +4 −14
  5. drivers/firmware/xilinx/zynqmp.c +55 −1
  6. drivers/fpga/Kconfig +9 −0
  7. drivers/fpga/Makefile +1 −0
  8. drivers/fpga/zynqmp-fpga.c +159 −0
  9. drivers/nvmem/zynqmp_nvmem.c +7 −3
  10. drivers/reset/reset-zynqmp.c +4 −4
  11. drivers/soc/xilinx/zynqmp_pm_domains.c +10 −8
  12. drivers/soc/xilinx/zynqmp_power.c +6 −4
  13. drivers/spi/spi-zynqmp-gqspi.c +5 −0
  14. include/linux/firmware/xlnx-zynqmp.h +13 −1
Documentation/devicetree/bindings/fpga/xlnx,zynqmp-pcap-fpga.txt+25−0
@@ -0,0 +1,25 @@
1+Devicetree bindings for Zynq Ultrascale MPSoC FPGA Manager.
2+The ZynqMP SoC uses the PCAP (Processor configuration Port) to configure the
3+Programmable Logic (PL). The configuration uses the firmware interface.
4+
5+Required properties:
6+- compatible: should contain "xlnx,zynqmp-pcap-fpga"
7+
8+Example for full FPGA configuration:
9+
10+ fpga-region0 {
11+ compatible = "fpga-region";
12+ fpga-mgr = <&zynqmp_pcap>;
13+ #address-cells = <0x1>;
14+ #size-cells = <0x1>;
15+ };
16+
17+ firmware {
18+ zynqmp_firmware: zynqmp-firmware {
19+ compatible = "xlnx,zynqmp-firmware";
20+ method = "smc";
21+ zynqmp_pcap: pcap {
22+ compatible = "xlnx,zynqmp-pcap-fpga";
23+ };
24+ };
25+ };
Documentation/xilinx/eemi.txt+2−2
@@ -41,8 +41,8 @@ Example of EEMI ops usage: · 40 unmodified lines
4141 int ret;
4242
4343 eemi_ops = zynqmp_pm_get_eemi_ops();
44− if (!eemi_ops)
45− return -ENXIO;
44+ if (IS_ERR(eemi_ops))
45+ return PTR_ERR(eemi_ops);
4646
4747 ret = eemi_ops->query_data(qdata, ret_payload);
4848
drivers/clk/zynqmp/clkc.c+2−2
@@ -695,8 +695,8 @@ static int zynqmp_clock_probe(struct platform_device *pdev) · 694 unmodified lines
695695 struct device *dev = &pdev->dev;
696696
697697 eemi_ops = zynqmp_pm_get_eemi_ops();
698− if (!eemi_ops)
699− return -ENXIO;
698+ if (IS_ERR(eemi_ops))
699+ return PTR_ERR(eemi_ops);
700700
701701 ret = zynqmp_clk_setup(dev->of_node);
702702
drivers/firmware/xilinx/zynqmp-debug.c+4−14
@@ -90,9 +90,6 @@ static int process_api_request(u32 pm_id, u64 *pm_api_arg, u32 *pm_api_ret) · 89 unmodified lines
9090 int ret;
9191 struct zynqmp_pm_query_data qdata = {0};
9292
93− if (!eemi_ops)
94− return -ENXIO;
95−
9693 switch (pm_id) {
9794 case PM_GET_API_VERSION:
9895 ret = eemi_ops->get_api_version(&pm_api_version);
@@ -163,21 +160,14 @@ static ssize_t zynqmp_pm_debugfs_api_write(struct file *file, · 64 unmodified lines
163160
164161 strcpy(debugfs_buf, "");
165162
166− if (*off != 0 || len == 0)
163+ if (*off != 0 || len <= 1 || len > PAGE_SIZE - 1)
167164 return -EINVAL;
168165
169− kern_buff = kzalloc(len, GFP_KERNEL);
170− if (!kern_buff)
171− return -ENOMEM;
172−
166+ kern_buff = memdup_user_nul(ptr, len);
167+ if (IS_ERR(kern_buff))
168+ return PTR_ERR(kern_buff);
173169 tmp_buff = kern_buff;
174170
175− ret = strncpy_from_user(kern_buff, ptr, len);
176− if (ret < 0) {
177− ret = -EFAULT;
178− goto err;
179− }
180−
181171 /* Read the API name from a user request */
182172 pm_api_req = strsep(&kern_buff, " ");
183173
drivers/firmware/xilinx/zynqmp.c+55−1
@@ -24,6 +24,8 @@ · 23 unmodified lines
2424 #include <linux/firmware/xlnx-zynqmp.h>
2525 #include "zynqmp-debug.h"
2626
27+static const struct zynqmp_eemi_ops *eemi_ops_tbl;
28+
2729 static const struct mfd_cell firmware_devs[] = {
2830 {
2931 .name = "zynqmp_power_controller",
@@ -537,6 +539,49 @@ static int zynqmp_pm_reset_get_status(const enum zynqmp_pm_reset reset, · 507 unmodified lines
537539 return ret;
538540 }
539541
542+/**
543+ * zynqmp_pm_fpga_load - Perform the fpga load
544+ * @address: Address to write to
545+ * @size: pl bitstream size
546+ * @flags: Bitstream type
547+ * -XILINX_ZYNQMP_PM_FPGA_FULL: FPGA full reconfiguration
548+ * -XILINX_ZYNQMP_PM_FPGA_PARTIAL: FPGA partial reconfiguration
549+ *
550+ * This function provides access to pmufw. To transfer
551+ * the required bitstream into PL.
552+ *
553+ * Return: Returns status, either success or error+reason
554+ */
555+static int zynqmp_pm_fpga_load(const u64 address, const u32 size,
556+ const u32 flags)
557+{
558+ return zynqmp_pm_invoke_fn(PM_FPGA_LOAD, lower_32_bits(address),
559+ upper_32_bits(address), size, flags, NULL);
560+}
561+
562+/**
563+ * zynqmp_pm_fpga_get_status - Read value from PCAP status register
564+ * @value: Value to read
565+ *
566+ * This function provides access to the pmufw to get the PCAP
567+ * status
568+ *
569+ * Return: Returns status, either success or error+reason
570+ */
571+static int zynqmp_pm_fpga_get_status(u32 *value)
572+{
573+ u32 ret_payload[PAYLOAD_ARG_CNT];
574+ int ret;
575+
576+ if (!value)
577+ return -EINVAL;
578+
579+ ret = zynqmp_pm_invoke_fn(PM_FPGA_GET_STATUS, 0, 0, 0, 0, ret_payload);
580+ *value = ret_payload[1];
581+
582+ return ret;
583+}
584+
540585 /**
541586 * zynqmp_pm_init_finalize() - PM call to inform firmware that the caller
542587 * master has initialized its own power management
@@ -640,6 +685,8 @@ static const struct zynqmp_eemi_ops eemi_ops = { · 97 unmodified lines
640685 .request_node = zynqmp_pm_request_node,
641686 .release_node = zynqmp_pm_release_node,
642687 .set_requirement = zynqmp_pm_set_requirement,
688+ .fpga_load = zynqmp_pm_fpga_load,
689+ .fpga_get_status = zynqmp_pm_fpga_get_status,
643690 };
644691
645692 /**
@@ -649,7 +696,11 @@ static const struct zynqmp_eemi_ops eemi_ops = { · 3 unmodified lines
649696 */
650697 const struct zynqmp_eemi_ops *zynqmp_pm_get_eemi_ops(void)
651698 {
652− return &eemi_ops;
699+ if (eemi_ops_tbl)
700+ return eemi_ops_tbl;
701+ else
702+ return ERR_PTR(-EPROBE_DEFER);
703+
653704 }
654705 EXPORT_SYMBOL_GPL(zynqmp_pm_get_eemi_ops);
655706
@@ -694,6 +745,9 @@ static int zynqmp_firmware_probe(struct platform_device *pdev) · 38 unmodified lines
694745 pr_info("%s Trustzone version v%d.%d\n", __func__,
695746 pm_tz_version >> 16, pm_tz_version & 0xFFFF);
696747
748+ /* Assign eemi_ops_table */
749+ eemi_ops_tbl = &eemi_ops;
750+
697751 zynqmp_pm_api_debugfs_init();
698752
699753 ret = mfd_add_devices(&pdev->dev, PLATFORM_DEVID_NONE, firmware_devs,
drivers/fpga/Kconfig+9−0
@@ -204,4 +204,13 @@ config FPGA_DFL_PCI · 203 unmodified lines
204204
205205 To compile this as a module, choose M here.
206206
207+config FPGA_MGR_ZYNQMP_FPGA
208+ tristate "Xilinx ZynqMP FPGA"
209+ depends on ARCH_ZYNQMP || COMPILE_TEST
210+ help
211+ FPGA manager driver support for Xilinx ZynqMP FPGAs.
212+ This driver uses the processor configuration port(PCAP)
213+ to configure the programmable logic(PL) through PS
214+ on ZynqMP SoC.
215+
207216 endif # FPGA
drivers/fpga/Makefile+1−0
@@ -17,6 +17,7 @@ obj-$(CONFIG_FPGA_MGR_STRATIX10_SOC) += stratix10-soc.o · 16 unmodified lines
1717 obj-$(CONFIG_FPGA_MGR_TS73XX) += ts73xx-fpga.o
1818 obj-$(CONFIG_FPGA_MGR_XILINX_SPI) += xilinx-spi.o
1919 obj-$(CONFIG_FPGA_MGR_ZYNQ_FPGA) += zynq-fpga.o
20+obj-$(CONFIG_FPGA_MGR_ZYNQMP_FPGA) += zynqmp-fpga.o
2021 obj-$(CONFIG_ALTERA_PR_IP_CORE) += altera-pr-ip-core.o
2122 obj-$(CONFIG_ALTERA_PR_IP_CORE_PLAT) += altera-pr-ip-core-plat.o
2223
drivers/fpga/zynqmp-fpga.c+159−0
@@ -0,0 +1,159 @@
1+// SPDX-License-Identifier: GPL-2.0+
2+/*
3+ * Copyright (C) 2019 Xilinx, Inc.
4+ */
5+
6+#include <linux/dma-mapping.h>
7+#include <linux/fpga/fpga-mgr.h>
8+#include <linux/io.h>
9+#include <linux/kernel.h>
10+#include <linux/module.h>
11+#include <linux/of_address.h>
12+#include <linux/string.h>
13+#include <linux/firmware/xlnx-zynqmp.h>
14+
15+/* Constant Definitions */
16+#define IXR_FPGA_DONE_MASK BIT(3)
17+
18+/**
19+ * struct zynqmp_fpga_priv - Private data structure
20+ * @dev: Device data structure
21+ * @flags: flags which is used to identify the bitfile type
22+ */
23+struct zynqmp_fpga_priv {
24+ struct device *dev;
25+ u32 flags;
26+};
27+
28+static int zynqmp_fpga_ops_write_init(struct fpga_manager *mgr,
29+ struct fpga_image_info *info,
30+ const char *buf, size_t size)
31+{
32+ struct zynqmp_fpga_priv *priv;
33+
34+ priv = mgr->priv;
35+ priv->flags = info->flags;
36+
37+ return 0;
38+}
39+
40+static int zynqmp_fpga_ops_write(struct fpga_manager *mgr,
41+ const char *buf, size_t size)
42+{
43+ const struct zynqmp_eemi_ops *eemi_ops = zynqmp_pm_get_eemi_ops();
44+ struct zynqmp_fpga_priv *priv;
45+ dma_addr_t dma_addr;
46+ u32 eemi_flags = 0;
47+ char *kbuf;
48+ int ret;
49+
50+ if (!eemi_ops || !eemi_ops->fpga_load)
51+ return -ENXIO;
52+
53+ priv = mgr->priv;
54+
55+ kbuf = dma_alloc_coherent(priv->dev, size, &dma_addr, GFP_KERNEL);
56+ if (!kbuf)
57+ return -ENOMEM;
58+
59+ memcpy(kbuf, buf, size);
60+
61+ wmb(); /* ensure all writes are done before initiate FW call */
62+
63+ if (priv->flags & FPGA_MGR_PARTIAL_RECONFIG)
64+ eemi_flags |= XILINX_ZYNQMP_PM_FPGA_PARTIAL;
65+
66+ ret = eemi_ops->fpga_load(dma_addr, size, eemi_flags);
67+
68+ dma_free_coherent(priv->dev, size, kbuf, dma_addr);
69+
70+ return ret;
71+}
72+
73+static int zynqmp_fpga_ops_write_complete(struct fpga_manager *mgr,
74+ struct fpga_image_info *info)
75+{
76+ return 0;
77+}
78+
79+static enum fpga_mgr_states zynqmp_fpga_ops_state(struct fpga_manager *mgr)
80+{
81+ const struct zynqmp_eemi_ops *eemi_ops = zynqmp_pm_get_eemi_ops();
82+ u32 status;
83+
84+ if (!eemi_ops || !eemi_ops->fpga_get_status)
85+ return FPGA_MGR_STATE_UNKNOWN;
86+
87+ eemi_ops->fpga_get_status(&status);
88+ if (status & IXR_FPGA_DONE_MASK)
89+ return FPGA_MGR_STATE_OPERATING;
90+
91+ return FPGA_MGR_STATE_UNKNOWN;
92+}
93+
94+static const struct fpga_manager_ops zynqmp_fpga_ops = {
95+ .state = zynqmp_fpga_ops_state,
96+ .write_init = zynqmp_fpga_ops_write_init,
97+ .write = zynqmp_fpga_ops_write,
98+ .write_complete = zynqmp_fpga_ops_write_complete,
99+};
100+
101+static int zynqmp_fpga_probe(struct platform_device *pdev)
102+{
103+ struct device *dev = &pdev->dev;
104+ struct zynqmp_fpga_priv *priv;
105+ struct fpga_manager *mgr;
106+ int ret;
107+
108+ priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
109+ if (!priv)
110+ return -ENOMEM;
111+
112+ priv->dev = dev;
113+
114+ mgr = devm_fpga_mgr_create(dev, "Xilinx ZynqMP FPGA Manager",
115+ &zynqmp_fpga_ops, priv);
116+ if (!mgr)
117+ return -ENOMEM;
118+
119+ platform_set_drvdata(pdev, mgr);
120+
121+ ret = fpga_mgr_register(mgr);
122+ if (ret) {
123+ dev_err(dev, "unable to register FPGA manager");
124+ return ret;
125+ }
126+
127+ return 0;
128+}
129+
130+static int zynqmp_fpga_remove(struct platform_device *pdev)
131+{
132+ struct fpga_manager *mgr = platform_get_drvdata(pdev);
133+
134+ fpga_mgr_unregister(mgr);
135+
136+ return 0;
137+}
138+
139+static const struct of_device_id zynqmp_fpga_of_match[] = {
140+ { .compatible = "xlnx,zynqmp-pcap-fpga", },
141+ {},
142+};
143+
144+MODULE_DEVICE_TABLE(of, zynqmp_fpga_of_match);
145+
146+static struct platform_driver zynqmp_fpga_driver = {
147+ .probe = zynqmp_fpga_probe,
148+ .remove = zynqmp_fpga_remove,
149+ .driver = {
150+ .name = "zynqmp_fpga_manager",
151+ .of_match_table = of_match_ptr(zynqmp_fpga_of_match),
152+ },
153+};
154+
155+module_platform_driver(zynqmp_fpga_driver);
156+
157+MODULE_AUTHOR("Nava kishore Manne <navam@xilinx.com>");
158+MODULE_DESCRIPTION("Xilinx ZynqMp FPGA Manager");
159+MODULE_LICENSE("GPL");
drivers/nvmem/zynqmp_nvmem.c+7−3
@@ -16,6 +16,8 @@ struct zynqmp_nvmem_data { · 15 unmodified lines
1616 struct nvmem_device *nvmem;
1717 };
1818
19+static const struct zynqmp_eemi_ops *eemi_ops;
20+
1921 static int zynqmp_nvmem_read(void *context, unsigned int offset,
2022 void *val, size_t bytes)
2123 {
@@ -23,9 +25,7 @@ static int zynqmp_nvmem_read(void *context, unsigned int offset, · 1 unmodified line
2325 int idcode, version;
2426 struct zynqmp_nvmem_data *priv = context;
2527
26− const struct zynqmp_eemi_ops *eemi_ops = zynqmp_pm_get_eemi_ops();
27−
28− if (!eemi_ops || !eemi_ops->get_chipid)
28+ if (!eemi_ops->get_chipid)
2929 return -ENXIO;
3030
3131 ret = eemi_ops->get_chipid(&idcode, &version);
@@ -61,6 +61,10 @@ static int zynqmp_nvmem_probe(struct platform_device *pdev) · 29 unmodified lines
6161 if (!priv)
6262 return -ENOMEM;
6363
64+ eemi_ops = zynqmp_pm_get_eemi_ops();
65+ if (IS_ERR(eemi_ops))
66+ return PTR_ERR(eemi_ops);
67+
6468 priv->dev = dev;
6569 econfig.dev = dev;
6670 econfig.reg_read = zynqmp_nvmem_read;
drivers/reset/reset-zynqmp.c+4−4
@@ -79,11 +79,11 @@ static int zynqmp_reset_probe(struct platform_device *pdev) · 78 unmodified lines
7979 if (!priv)
8080 return -ENOMEM;
8181
82− platform_set_drvdata(pdev, priv);
83−
8482 priv->eemi_ops = zynqmp_pm_get_eemi_ops();
85− if (!priv->eemi_ops)
86− return -ENXIO;
83+ if (IS_ERR(priv->eemi_ops))
84+ return PTR_ERR(priv->eemi_ops);
85+
86+ platform_set_drvdata(pdev, priv);
8787
8888 priv->rcdev.ops = &zynqmp_reset_ops;
8989 priv->rcdev.owner = THIS_MODULE;
drivers/soc/xilinx/zynqmp_pm_domains.c+10−8
@@ -23,6 +23,8 @@ · 22 unmodified lines
2323 /* Flag stating if PM nodes mapped to the PM domain has been requested */
2424 #define ZYNQMP_PM_DOMAIN_REQUESTED BIT(0)
2525
26+static const struct zynqmp_eemi_ops *eemi_ops;
27+
2628 /**
2729 * struct zynqmp_pm_domain - Wrapper around struct generic_pm_domain
2830 * @gpd: Generic power domain
@@ -71,9 +73,8 @@ static int zynqmp_gpd_power_on(struct generic_pm_domain *domain) · 42 unmodified lines
7173 {
7274 int ret;
7375 struct zynqmp_pm_domain *pd;
74− const struct zynqmp_eemi_ops *eemi_ops = zynqmp_pm_get_eemi_ops();
7576
76− if (!eemi_ops || !eemi_ops->set_requirement)
77+ if (!eemi_ops->set_requirement)
7778 return -ENXIO;
7879
7980 pd = container_of(domain, struct zynqmp_pm_domain, gpd);
@@ -107,9 +108,8 @@ static int zynqmp_gpd_power_off(struct generic_pm_domain *domain) · 27 unmodified lines
107108 struct zynqmp_pm_domain *pd;
108109 u32 capabilities = 0;
109110 bool may_wakeup;
110− const struct zynqmp_eemi_ops *eemi_ops = zynqmp_pm_get_eemi_ops();
111111
112− if (!eemi_ops || !eemi_ops->set_requirement)
112+ if (!eemi_ops->set_requirement)
113113 return -ENXIO;
114114
115115 pd = container_of(domain, struct zynqmp_pm_domain, gpd);
@@ -160,9 +160,8 @@ static int zynqmp_gpd_attach_dev(struct generic_pm_domain *domain, · 44 unmodified lines
160160 {
161161 int ret;
162162 struct zynqmp_pm_domain *pd;
163− const struct zynqmp_eemi_ops *eemi_ops = zynqmp_pm_get_eemi_ops();
164163
165− if (!eemi_ops || !eemi_ops->request_node)
164+ if (!eemi_ops->request_node)
166165 return -ENXIO;
167166
168167 pd = container_of(domain, struct zynqmp_pm_domain, gpd);
@@ -197,9 +196,8 @@ static void zynqmp_gpd_detach_dev(struct generic_pm_domain *domain, · 28 unmodified lines
197196 {
198197 int ret;
199198 struct zynqmp_pm_domain *pd;
200− const struct zynqmp_eemi_ops *eemi_ops = zynqmp_pm_get_eemi_ops();
201199
202− if (!eemi_ops || !eemi_ops->release_node)
200+ if (!eemi_ops->release_node)
203201 return;
204202
205203 pd = container_of(domain, struct zynqmp_pm_domain, gpd);
@@ -266,6 +264,10 @@ static int zynqmp_gpd_probe(struct platform_device *pdev) · 60 unmodified lines
266264 struct zynqmp_pm_domain *pd;
267265 struct device *dev = &pdev->dev;
268266
267+ eemi_ops = zynqmp_pm_get_eemi_ops();
268+ if (IS_ERR(eemi_ops))
269+ return PTR_ERR(eemi_ops);
270+
269271 pd = devm_kcalloc(dev, ZYNQMP_NUM_DOMAINS, sizeof(*pd), GFP_KERNEL);
270272 if (!pd)
271273 return -ENOMEM;
drivers/soc/xilinx/zynqmp_power.c+6−4
@@ -31,6 +31,7 @@ static const char *const suspend_modes[] = { · 30 unmodified lines
3131 };
3232
3333 static enum pm_suspend_mode suspend_mode = PM_SUSPEND_MODE_STD;
34+static const struct zynqmp_eemi_ops *eemi_ops;
3435
3536 enum pm_api_cb_id {
3637 PM_INIT_SUSPEND_CB = 30,
@@ -92,9 +93,8 @@ static ssize_t suspend_mode_store(struct device *dev, · 55 unmodified lines
9293 const char *buf, size_t count)
9394 {
9495 int md, ret = -EINVAL;
95− const struct zynqmp_eemi_ops *eemi_ops = zynqmp_pm_get_eemi_ops();
9696
97− if (!eemi_ops || !eemi_ops->set_suspend_mode)
97+ if (!eemi_ops->set_suspend_mode)
9898 return ret;
9999
100100 for (md = PM_SUSPEND_MODE_FIRST; md < ARRAY_SIZE(suspend_modes); md++)
@@ -120,9 +120,11 @@ static int zynqmp_pm_probe(struct platform_device *pdev) · 19 unmodified lines
120120 int ret, irq;
121121 u32 pm_api_version;
122122
123− const struct zynqmp_eemi_ops *eemi_ops = zynqmp_pm_get_eemi_ops();
123+ eemi_ops = zynqmp_pm_get_eemi_ops();
124+ if (IS_ERR(eemi_ops))
125+ return PTR_ERR(eemi_ops);
124126
125− if (!eemi_ops || !eemi_ops->get_api_version || !eemi_ops->init_finalize)
127+ if (!eemi_ops->get_api_version || !eemi_ops->init_finalize)
126128 return -ENXIO;
127129
128130 eemi_ops->init_finalize();
drivers/spi/spi-zynqmp-gqspi.c+5−0
@@ -138,6 +138,7 @@ · 137 unmodified lines
138138
139139 #define SPI_AUTOSUSPEND_TIMEOUT 3000
140140 enum mode_type {GQSPI_MODE_IO, GQSPI_MODE_DMA};
141+static const struct zynqmp_eemi_ops *eemi_ops;
141142
142143 /**
143144 * struct zynqmp_qspi - Defines qspi driver instance
@@ -1021,6 +1022,10 @@ static int zynqmp_qspi_probe(struct platform_device *pdev) · 877 unmodified lines
10211022 struct resource *res;
10221023 struct device *dev = &pdev->dev;
10231024
1025+ eemi_ops = zynqmp_pm_get_eemi_ops();
1026+ if (IS_ERR(eemi_ops))
1027+ return PTR_ERR(eemi_ops);
1028+
10241029 master = spi_alloc_master(&pdev->dev, sizeof(*xqspi));
10251030 if (!master)
10261031 return -ENOMEM;
include/linux/firmware/xlnx-zynqmp.h+13−1
@@ -48,6 +48,14 @@ · 47 unmodified lines
4848 #define ZYNQMP_PM_CAPABILITY_WAKEUP 0x4U
4949 #define ZYNQMP_PM_CAPABILITY_POWER 0x8U
5050
51+/*
52+ * Firmware FPGA Manager flags
53+ * XILINX_ZYNQMP_PM_FPGA_FULL: FPGA full reconfiguration
54+ * XILINX_ZYNQMP_PM_FPGA_PARTIAL: FPGA partial reconfiguration
55+ */
56+#define XILINX_ZYNQMP_PM_FPGA_FULL 0x0U
57+#define XILINX_ZYNQMP_PM_FPGA_PARTIAL BIT(0)
58+
5159 enum pm_api_id {
5260 PM_GET_API_VERSION = 1,
5361 PM_REQUEST_NODE = 13,
@@ -56,6 +64,8 @@ enum pm_api_id { · 2 unmodified lines
5664 PM_RESET_ASSERT = 17,
5765 PM_RESET_GET_STATUS,
5866 PM_PM_INIT_FINALIZE = 21,
67+ PM_FPGA_LOAD,
68+ PM_FPGA_GET_STATUS,
5969 PM_GET_CHIPID = 24,
6070 PM_IOCTL = 34,
6171 PM_QUERY_DATA,
@@ -258,6 +268,8 @@ struct zynqmp_pm_query_data { · 196 unmodified lines
258268 struct zynqmp_eemi_ops {
259269 int (*get_api_version)(u32 *version);
260270 int (*get_chipid)(u32 *idcode, u32 *version);
271+ int (*fpga_load)(const u64 address, const u32 size, const u32 flags);
272+ int (*fpga_get_status)(u32 *value);
261273 int (*query_data)(struct zynqmp_pm_query_data qdata, u32 *out);
262274 int (*clock_enable)(u32 clock_id);
263275 int (*clock_disable)(u32 clock_id);
@@ -293,7 +305,7 @@ const struct zynqmp_eemi_ops *zynqmp_pm_get_eemi_ops(void); · 29 unmodified lines
293305 #else
294306 static inline struct zynqmp_eemi_ops *zynqmp_pm_get_eemi_ops(void)
295307 {
296− return NULL;
308+ return ERR_PTR(-ENODEV);
297309 }
298310 #endif
299311

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t