Skip to content

Commit

Permalink
soc: zynqmp: Use new firmware APIs
Browse files Browse the repository at this point in the history
Existing firmware APIs would be deprecated so use firmware
interface APIs provided by new firmware.

Signed-off-by: Rajan Vaja <rajanv@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
  • Loading branch information
rajanv-xilinx authored and Michal Simek committed Mar 1, 2018
1 parent 8154c22 commit 0b7483c
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 18 deletions.
6 changes: 3 additions & 3 deletions drivers/fpga/zynqmp-fpga.c
Expand Up @@ -20,7 +20,7 @@
#include <linux/module.h>
#include <linux/of_address.h>
#include <linux/string.h>
#include <linux/soc/xilinx/zynqmp/firmware.h>
#include <linux/firmware/xilinx/zynqmp/firmware.h>

/* Constant Definitions */
#define IXR_FPGA_DONE_MASK 0X00000008U
Expand Down Expand Up @@ -52,7 +52,7 @@ static int zynqmp_fpga_ops_write(struct fpga_manager *mgr,
dma_addr_t dma_addr;
u32 transfer_length;
int ret;
const struct zynqmp_eemi_ops *eemi_ops = get_eemi_ops();
const struct zynqmp_eemi_ops *eemi_ops = zynqmp_pm_get_eemi_ops();

if (!eemi_ops || !eemi_ops->fpga_load)
return -ENXIO;
Expand Down Expand Up @@ -104,7 +104,7 @@ static int zynqmp_fpga_ops_write_complete(struct fpga_manager *mgr,
static enum fpga_mgr_states zynqmp_fpga_ops_state(struct fpga_manager *mgr)
{
u32 status;
const struct zynqmp_eemi_ops *eemi_ops = get_eemi_ops();
const struct zynqmp_eemi_ops *eemi_ops = zynqmp_pm_get_eemi_ops();

if (!eemi_ops || !eemi_ops->fpga_get_status)
return FPGA_MGR_STATE_UNKNOWN;
Expand Down
4 changes: 2 additions & 2 deletions drivers/nvmem/zynqmp_nvmem.c
Expand Up @@ -16,7 +16,7 @@
#include <linux/nvmem-provider.h>
#include <linux/of.h>
#include <linux/platform_device.h>
#include <linux/soc/xilinx/zynqmp/firmware.h>
#include <linux/firmware/xilinx/zynqmp/firmware.h>

#define SILICON_REVISION_MASK 0xF

Expand All @@ -25,7 +25,7 @@ static int zynqmp_nvmem_read(void *context, unsigned int offset,
{
int ret;
int idcode, version;
const struct zynqmp_eemi_ops *eemi_ops = get_eemi_ops();
const struct zynqmp_eemi_ops *eemi_ops = zynqmp_pm_get_eemi_ops();

if (!eemi_ops || !eemi_ops->get_chipid)
return -ENXIO;
Expand Down
12 changes: 6 additions & 6 deletions drivers/remoteproc/zynqmp_r5_remoteproc.c
Expand Up @@ -37,7 +37,7 @@
#include <linux/genalloc.h>
#include <linux/pfn.h>
#include <linux/idr.h>
#include <linux/soc/xilinx/zynqmp/firmware.h>
#include <linux/firmware/xilinx/zynqmp/firmware.h>

#include "remoteproc_internal.h"

Expand Down Expand Up @@ -209,7 +209,7 @@ static void r5_mode_config(struct zynqmp_r5_rproc_pdata *pdata)
static bool r5_is_running(struct zynqmp_r5_rproc_pdata *pdata)
{
u32 status, requirements, usage;
const struct zynqmp_eemi_ops *eemi_ops = get_eemi_ops();
const struct zynqmp_eemi_ops *eemi_ops = zynqmp_pm_get_eemi_ops();

pr_debug("%s: rpu id: %d\n", __func__, pdata->rpu_id);
if (!eemi_ops || !eemi_ops->get_node_status) {
Expand Down Expand Up @@ -241,7 +241,7 @@ static bool r5_is_running(struct zynqmp_r5_rproc_pdata *pdata)
static int r5_request_tcm(struct zynqmp_r5_rproc_pdata *pdata)
{
struct mem_pool_st *mem_node;
const struct zynqmp_eemi_ops *eemi_ops = get_eemi_ops();
const struct zynqmp_eemi_ops *eemi_ops = zynqmp_pm_get_eemi_ops();

if (!eemi_ops || !eemi_ops->request_node) {
pr_err("Failed to request TCM\n");
Expand Down Expand Up @@ -272,7 +272,7 @@ static int r5_request_tcm(struct zynqmp_r5_rproc_pdata *pdata)
static void r5_release_tcm(struct zynqmp_r5_rproc_pdata *pdata)
{
struct mem_pool_st *mem_node;
const struct zynqmp_eemi_ops *eemi_ops = get_eemi_ops();
const struct zynqmp_eemi_ops *eemi_ops = zynqmp_pm_get_eemi_ops();

if (!eemi_ops || !eemi_ops->release_node) {
pr_err("Failed to release TCM\n");
Expand Down Expand Up @@ -346,7 +346,7 @@ static int zynqmp_r5_rproc_start(struct rproc *rproc)
{
struct device *dev = rproc->dev.parent;
struct zynqmp_r5_rproc_pdata *local = rproc->priv;
const struct zynqmp_eemi_ops *eemi_ops = get_eemi_ops();
const struct zynqmp_eemi_ops *eemi_ops = zynqmp_pm_get_eemi_ops();

dev_dbg(dev, "%s\n", __func__);

Expand Down Expand Up @@ -412,7 +412,7 @@ static int zynqmp_r5_rproc_stop(struct rproc *rproc)
struct device *dev = rproc->dev.parent;
struct zynqmp_r5_rproc_pdata *local = rproc->priv;
struct rproc_mem_entry *mem, *nmem;
const struct zynqmp_eemi_ops *eemi_ops = get_eemi_ops();
const struct zynqmp_eemi_ops *eemi_ops = zynqmp_pm_get_eemi_ops();

dev_dbg(dev, "%s\n", __func__);

Expand Down
4 changes: 2 additions & 2 deletions drivers/reset/reset-zynqmp.c
Expand Up @@ -16,7 +16,7 @@
#include <linux/module.h>
#include <linux/platform_device.h>
#include <linux/reset-controller.h>
#include <linux/soc/xilinx/zynqmp/firmware.h>
#include <linux/firmware/xilinx/zynqmp/firmware.h>

#define ZYNQMP_NR_RESETS (ZYNQMP_PM_RESET_END - ZYNQMP_PM_RESET_START - 2)
#define ZYNQMP_RESET_ID (ZYNQMP_PM_RESET_START + 1)
Expand Down Expand Up @@ -74,7 +74,7 @@ static int zynqmp_reset_probe(struct platform_device *pdev)
if (!zynqmp_reset)
return -ENOMEM;

eemi_ops = get_eemi_ops();
eemi_ops = zynqmp_pm_get_eemi_ops();
if (!eemi_ops)
return -ENXIO;

Expand Down
11 changes: 6 additions & 5 deletions drivers/soc/xilinx/zynqmp/pm_domains.c
Expand Up @@ -16,7 +16,8 @@
#include <linux/pm_domain.h>
#include <linux/slab.h>
#include <linux/list.h>
#include <linux/soc/xilinx/zynqmp/pm.h>
#include <linux/firmware/xilinx/zynqmp/firmware.h>
#include <linux/soc/xilinx/zynqmp/power.h>

#define DRIVER_NAME "zynqmp_gpd"

Expand Down Expand Up @@ -84,7 +85,7 @@ static int zynqmp_gpd_power_on(struct generic_pm_domain *domain)
{
int i, status = 0;
struct zynqmp_pm_domain *pd;
const struct zynqmp_eemi_ops *eemi_ops = get_eemi_ops();
const struct zynqmp_eemi_ops *eemi_ops = zynqmp_pm_get_eemi_ops();

if (!eemi_ops || !eemi_ops->set_requirement)
return status;
Expand Down Expand Up @@ -117,7 +118,7 @@ static int zynqmp_gpd_power_off(struct generic_pm_domain *domain)
struct zynqmp_domain_device *zdev, *tmp;
u32 capabilities = 0;
bool may_wakeup = 0;
const struct zynqmp_eemi_ops *eemi_ops = get_eemi_ops();
const struct zynqmp_eemi_ops *eemi_ops = zynqmp_pm_get_eemi_ops();

if (!eemi_ops || !eemi_ops->set_requirement)
return status;
Expand Down Expand Up @@ -170,7 +171,7 @@ static int zynqmp_gpd_attach_dev(struct generic_pm_domain *domain,
int i, status;
struct zynqmp_pm_domain *pd;
struct zynqmp_domain_device *zdev;
const struct zynqmp_eemi_ops *eemi_ops = get_eemi_ops();
const struct zynqmp_eemi_ops *eemi_ops = zynqmp_pm_get_eemi_ops();

if (!eemi_ops || !eemi_ops->request_node)
return -ENXIO;
Expand Down Expand Up @@ -218,7 +219,7 @@ static void zynqmp_gpd_detach_dev(struct generic_pm_domain *domain,
int i, status;
struct zynqmp_pm_domain *pd;
struct zynqmp_domain_device *zdev, *tmp;
const struct zynqmp_eemi_ops *eemi_ops = get_eemi_ops();
const struct zynqmp_eemi_ops *eemi_ops = zynqmp_pm_get_eemi_ops();

if (!eemi_ops || !eemi_ops->release_node)
return;
Expand Down

0 comments on commit 0b7483c

Please sign in to comment.