Commit 9dd24d4e authored by Herbert Xu's avatar Herbert Xu

Merge git://git.kernel.org/pub/scm/linux/kernel/git/leo/linux next

Pull changes from Freescale SoC drivers tree that are required by
subsequent caam/qi2 patches.
parents cf64e495 afb77422
...@@ -295,6 +295,14 @@ int __must_check fsl_mc_object_allocate(struct fsl_mc_device *mc_dev, ...@@ -295,6 +295,14 @@ int __must_check fsl_mc_object_allocate(struct fsl_mc_device *mc_dev,
if (!mc_adev) if (!mc_adev)
goto error; goto error;
mc_adev->consumer_link = device_link_add(&mc_dev->dev,
&mc_adev->dev,
DL_FLAG_AUTOREMOVE_CONSUMER);
if (!mc_adev->consumer_link) {
error = -EINVAL;
goto error;
}
*new_mc_adev = mc_adev; *new_mc_adev = mc_adev;
return 0; return 0;
error: error:
...@@ -321,6 +329,9 @@ void fsl_mc_object_free(struct fsl_mc_device *mc_adev) ...@@ -321,6 +329,9 @@ void fsl_mc_object_free(struct fsl_mc_device *mc_adev)
return; return;
fsl_mc_resource_free(resource); fsl_mc_resource_free(resource);
device_link_del(mc_adev->consumer_link);
mc_adev->consumer_link = NULL;
} }
EXPORT_SYMBOL_GPL(fsl_mc_object_free); EXPORT_SYMBOL_GPL(fsl_mc_object_free);
......
...@@ -209,9 +209,19 @@ int __must_check fsl_mc_portal_allocate(struct fsl_mc_device *mc_dev, ...@@ -209,9 +209,19 @@ int __must_check fsl_mc_portal_allocate(struct fsl_mc_device *mc_dev,
if (error < 0) if (error < 0)
goto error_cleanup_resource; goto error_cleanup_resource;
dpmcp_dev->consumer_link = device_link_add(&mc_dev->dev,
&dpmcp_dev->dev,
DL_FLAG_AUTOREMOVE_CONSUMER);
if (!dpmcp_dev->consumer_link) {
error = -EINVAL;
goto error_cleanup_mc_io;
}
*new_mc_io = mc_io; *new_mc_io = mc_io;
return 0; return 0;
error_cleanup_mc_io:
fsl_destroy_mc_io(mc_io);
error_cleanup_resource: error_cleanup_resource:
fsl_mc_resource_free(resource); fsl_mc_resource_free(resource);
return error; return error;
...@@ -244,6 +254,9 @@ void fsl_mc_portal_free(struct fsl_mc_io *mc_io) ...@@ -244,6 +254,9 @@ void fsl_mc_portal_free(struct fsl_mc_io *mc_io)
fsl_destroy_mc_io(mc_io); fsl_destroy_mc_io(mc_io);
fsl_mc_resource_free(resource); fsl_mc_resource_free(resource);
device_link_del(dpmcp_dev->consumer_link);
dpmcp_dev->consumer_link = NULL;
} }
EXPORT_SYMBOL_GPL(fsl_mc_portal_free); EXPORT_SYMBOL_GPL(fsl_mc_portal_free);
......
...@@ -4502,7 +4502,7 @@ static int __cold dpaa2_dpseci_dpio_setup(struct dpaa2_caam_priv *priv) ...@@ -4502,7 +4502,7 @@ static int __cold dpaa2_dpseci_dpio_setup(struct dpaa2_caam_priv *priv)
nctx->cb = dpaa2_caam_fqdan_cb; nctx->cb = dpaa2_caam_fqdan_cb;
/* Register notification callbacks */ /* Register notification callbacks */
err = dpaa2_io_service_register(NULL, nctx); err = dpaa2_io_service_register(NULL, nctx, dev);
if (unlikely(err)) { if (unlikely(err)) {
dev_dbg(dev, "No affine DPIO for cpu %d\n", cpu); dev_dbg(dev, "No affine DPIO for cpu %d\n", cpu);
nctx->cb = NULL; nctx->cb = NULL;
...@@ -4535,7 +4535,7 @@ static int __cold dpaa2_dpseci_dpio_setup(struct dpaa2_caam_priv *priv) ...@@ -4535,7 +4535,7 @@ static int __cold dpaa2_dpseci_dpio_setup(struct dpaa2_caam_priv *priv)
ppriv = per_cpu_ptr(priv->ppriv, cpu); ppriv = per_cpu_ptr(priv->ppriv, cpu);
if (!ppriv->nctx.cb) if (!ppriv->nctx.cb)
break; break;
dpaa2_io_service_deregister(NULL, &ppriv->nctx); dpaa2_io_service_deregister(NULL, &ppriv->nctx, dev);
} }
for_each_online_cpu(cpu) { for_each_online_cpu(cpu) {
...@@ -4555,7 +4555,7 @@ static void __cold dpaa2_dpseci_dpio_free(struct dpaa2_caam_priv *priv) ...@@ -4555,7 +4555,7 @@ static void __cold dpaa2_dpseci_dpio_free(struct dpaa2_caam_priv *priv)
for_each_online_cpu(cpu) { for_each_online_cpu(cpu) {
ppriv = per_cpu_ptr(priv->ppriv, cpu); ppriv = per_cpu_ptr(priv->ppriv, cpu);
dpaa2_io_service_deregister(NULL, &ppriv->nctx); dpaa2_io_service_deregister(NULL, &ppriv->nctx, priv->dev);
dpaa2_io_store_destroy(ppriv->store); dpaa2_io_store_destroy(ppriv->store);
if (++i == priv->num_pairs) if (++i == priv->num_pairs)
......
...@@ -1902,7 +1902,7 @@ static int setup_dpio(struct dpaa2_eth_priv *priv) ...@@ -1902,7 +1902,7 @@ static int setup_dpio(struct dpaa2_eth_priv *priv)
/* Register the new context */ /* Register the new context */
channel->dpio = dpaa2_io_service_select(i); channel->dpio = dpaa2_io_service_select(i);
err = dpaa2_io_service_register(channel->dpio, nctx); err = dpaa2_io_service_register(channel->dpio, nctx, dev);
if (err) { if (err) {
dev_dbg(dev, "No affine DPIO for cpu %d\n", i); dev_dbg(dev, "No affine DPIO for cpu %d\n", i);
/* If no affine DPIO for this core, there's probably /* If no affine DPIO for this core, there's probably
...@@ -1942,7 +1942,7 @@ static int setup_dpio(struct dpaa2_eth_priv *priv) ...@@ -1942,7 +1942,7 @@ static int setup_dpio(struct dpaa2_eth_priv *priv)
return 0; return 0;
err_set_cdan: err_set_cdan:
dpaa2_io_service_deregister(channel->dpio, nctx); dpaa2_io_service_deregister(channel->dpio, nctx, dev);
err_service_reg: err_service_reg:
free_channel(priv, channel); free_channel(priv, channel);
err_alloc_ch: err_alloc_ch:
...@@ -1962,13 +1962,14 @@ static int setup_dpio(struct dpaa2_eth_priv *priv) ...@@ -1962,13 +1962,14 @@ static int setup_dpio(struct dpaa2_eth_priv *priv)
static void free_dpio(struct dpaa2_eth_priv *priv) static void free_dpio(struct dpaa2_eth_priv *priv)
{ {
int i; struct device *dev = priv->net_dev->dev.parent;
struct dpaa2_eth_channel *ch; struct dpaa2_eth_channel *ch;
int i;
/* deregister CDAN notifications and free channels */ /* deregister CDAN notifications and free channels */
for (i = 0; i < priv->num_channels; i++) { for (i = 0; i < priv->num_channels; i++) {
ch = priv->channel[i]; ch = priv->channel[i];
dpaa2_io_service_deregister(ch->dpio, &ch->nctx); dpaa2_io_service_deregister(ch->dpio, &ch->nctx, dev);
free_channel(priv, ch); free_channel(priv, ch);
} }
} }
......
...@@ -25,6 +25,7 @@ ...@@ -25,6 +25,7 @@
#define DPIO_CMDID_ENABLE DPIO_CMD(0x002) #define DPIO_CMDID_ENABLE DPIO_CMD(0x002)
#define DPIO_CMDID_DISABLE DPIO_CMD(0x003) #define DPIO_CMDID_DISABLE DPIO_CMD(0x003)
#define DPIO_CMDID_GET_ATTR DPIO_CMD(0x004) #define DPIO_CMDID_GET_ATTR DPIO_CMD(0x004)
#define DPIO_CMDID_RESET DPIO_CMD(0x005)
struct dpio_cmd_open { struct dpio_cmd_open {
__le32 dpio_id; __le32 dpio_id;
......
...@@ -30,6 +30,8 @@ struct dpio_priv { ...@@ -30,6 +30,8 @@ struct dpio_priv {
struct dpaa2_io *io; struct dpaa2_io *io;
}; };
static cpumask_var_t cpus_unused_mask;
static irqreturn_t dpio_irq_handler(int irq_num, void *arg) static irqreturn_t dpio_irq_handler(int irq_num, void *arg)
{ {
struct device *dev = (struct device *)arg; struct device *dev = (struct device *)arg;
...@@ -86,7 +88,7 @@ static int dpaa2_dpio_probe(struct fsl_mc_device *dpio_dev) ...@@ -86,7 +88,7 @@ static int dpaa2_dpio_probe(struct fsl_mc_device *dpio_dev)
struct dpio_priv *priv; struct dpio_priv *priv;
int err = -ENOMEM; int err = -ENOMEM;
struct device *dev = &dpio_dev->dev; struct device *dev = &dpio_dev->dev;
static int next_cpu = -1; int possible_next_cpu;
priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL); priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
if (!priv) if (!priv)
...@@ -108,6 +110,12 @@ static int dpaa2_dpio_probe(struct fsl_mc_device *dpio_dev) ...@@ -108,6 +110,12 @@ static int dpaa2_dpio_probe(struct fsl_mc_device *dpio_dev)
goto err_open; goto err_open;
} }
err = dpio_reset(dpio_dev->mc_io, 0, dpio_dev->mc_handle);
if (err) {
dev_err(dev, "dpio_reset() failed\n");
goto err_reset;
}
err = dpio_get_attributes(dpio_dev->mc_io, 0, dpio_dev->mc_handle, err = dpio_get_attributes(dpio_dev->mc_io, 0, dpio_dev->mc_handle,
&dpio_attrs); &dpio_attrs);
if (err) { if (err) {
...@@ -128,17 +136,14 @@ static int dpaa2_dpio_probe(struct fsl_mc_device *dpio_dev) ...@@ -128,17 +136,14 @@ static int dpaa2_dpio_probe(struct fsl_mc_device *dpio_dev)
desc.dpio_id = dpio_dev->obj_desc.id; desc.dpio_id = dpio_dev->obj_desc.id;
/* get the cpu to use for the affinity hint */ /* get the cpu to use for the affinity hint */
if (next_cpu == -1) possible_next_cpu = cpumask_first(cpus_unused_mask);
next_cpu = cpumask_first(cpu_online_mask); if (possible_next_cpu >= nr_cpu_ids) {
else
next_cpu = cpumask_next(next_cpu, cpu_online_mask);
if (!cpu_possible(next_cpu)) {
dev_err(dev, "probe failed. Number of DPIOs exceeds NR_CPUS.\n"); dev_err(dev, "probe failed. Number of DPIOs exceeds NR_CPUS.\n");
err = -ERANGE; err = -ERANGE;
goto err_allocate_irqs; goto err_allocate_irqs;
} }
desc.cpu = next_cpu; desc.cpu = possible_next_cpu;
cpumask_clear_cpu(possible_next_cpu, cpus_unused_mask);
/* /*
* Set the CENA regs to be the cache inhibited area of the portal to * Set the CENA regs to be the cache inhibited area of the portal to
...@@ -171,7 +176,7 @@ static int dpaa2_dpio_probe(struct fsl_mc_device *dpio_dev) ...@@ -171,7 +176,7 @@ static int dpaa2_dpio_probe(struct fsl_mc_device *dpio_dev)
if (err) if (err)
goto err_register_dpio_irq; goto err_register_dpio_irq;
priv->io = dpaa2_io_create(&desc); priv->io = dpaa2_io_create(&desc, dev);
if (!priv->io) { if (!priv->io) {
dev_err(dev, "dpaa2_io_create failed\n"); dev_err(dev, "dpaa2_io_create failed\n");
err = -ENOMEM; err = -ENOMEM;
...@@ -182,7 +187,6 @@ static int dpaa2_dpio_probe(struct fsl_mc_device *dpio_dev) ...@@ -182,7 +187,6 @@ static int dpaa2_dpio_probe(struct fsl_mc_device *dpio_dev)
dev_dbg(dev, " receives_notifications = %d\n", dev_dbg(dev, " receives_notifications = %d\n",
desc.receives_notifications); desc.receives_notifications);
dpio_close(dpio_dev->mc_io, 0, dpio_dev->mc_handle); dpio_close(dpio_dev->mc_io, 0, dpio_dev->mc_handle);
fsl_mc_portal_free(dpio_dev->mc_io);
return 0; return 0;
...@@ -193,6 +197,7 @@ static int dpaa2_dpio_probe(struct fsl_mc_device *dpio_dev) ...@@ -193,6 +197,7 @@ static int dpaa2_dpio_probe(struct fsl_mc_device *dpio_dev)
err_allocate_irqs: err_allocate_irqs:
dpio_disable(dpio_dev->mc_io, 0, dpio_dev->mc_handle); dpio_disable(dpio_dev->mc_io, 0, dpio_dev->mc_handle);
err_get_attr: err_get_attr:
err_reset:
dpio_close(dpio_dev->mc_io, 0, dpio_dev->mc_handle); dpio_close(dpio_dev->mc_io, 0, dpio_dev->mc_handle);
err_open: err_open:
fsl_mc_portal_free(dpio_dev->mc_io); fsl_mc_portal_free(dpio_dev->mc_io);
...@@ -211,7 +216,7 @@ static int dpaa2_dpio_remove(struct fsl_mc_device *dpio_dev) ...@@ -211,7 +216,7 @@ static int dpaa2_dpio_remove(struct fsl_mc_device *dpio_dev)
{ {
struct device *dev; struct device *dev;
struct dpio_priv *priv; struct dpio_priv *priv;
int err; int err = 0, cpu;
dev = &dpio_dev->dev; dev = &dpio_dev->dev;
priv = dev_get_drvdata(dev); priv = dev_get_drvdata(dev);
...@@ -220,11 +225,8 @@ static int dpaa2_dpio_remove(struct fsl_mc_device *dpio_dev) ...@@ -220,11 +225,8 @@ static int dpaa2_dpio_remove(struct fsl_mc_device *dpio_dev)
dpio_teardown_irqs(dpio_dev); dpio_teardown_irqs(dpio_dev);
err = fsl_mc_portal_allocate(dpio_dev, 0, &dpio_dev->mc_io); cpu = dpaa2_io_get_cpu(priv->io);
if (err) { cpumask_set_cpu(cpu, cpus_unused_mask);
dev_err(dev, "MC portal allocation failed\n");
goto err_mcportal;
}
err = dpio_open(dpio_dev->mc_io, 0, dpio_dev->obj_desc.id, err = dpio_open(dpio_dev->mc_io, 0, dpio_dev->obj_desc.id,
&dpio_dev->mc_handle); &dpio_dev->mc_handle);
...@@ -243,7 +245,7 @@ static int dpaa2_dpio_remove(struct fsl_mc_device *dpio_dev) ...@@ -243,7 +245,7 @@ static int dpaa2_dpio_remove(struct fsl_mc_device *dpio_dev)
err_open: err_open:
fsl_mc_portal_free(dpio_dev->mc_io); fsl_mc_portal_free(dpio_dev->mc_io);
err_mcportal:
return err; return err;
} }
...@@ -267,11 +269,16 @@ static struct fsl_mc_driver dpaa2_dpio_driver = { ...@@ -267,11 +269,16 @@ static struct fsl_mc_driver dpaa2_dpio_driver = {
static int dpio_driver_init(void) static int dpio_driver_init(void)
{ {
if (!zalloc_cpumask_var(&cpus_unused_mask, GFP_KERNEL))
return -ENOMEM;
cpumask_copy(cpus_unused_mask, cpu_online_mask);
return fsl_mc_driver_register(&dpaa2_dpio_driver); return fsl_mc_driver_register(&dpaa2_dpio_driver);
} }
static void dpio_driver_exit(void) static void dpio_driver_exit(void)
{ {
free_cpumask_var(cpus_unused_mask);
fsl_mc_driver_unregister(&dpaa2_dpio_driver); fsl_mc_driver_unregister(&dpaa2_dpio_driver);
} }
module_init(dpio_driver_init); module_init(dpio_driver_init);
......
...@@ -27,6 +27,7 @@ struct dpaa2_io { ...@@ -27,6 +27,7 @@ struct dpaa2_io {
/* protect notifications list */ /* protect notifications list */
spinlock_t lock_notifications; spinlock_t lock_notifications;
struct list_head notifications; struct list_head notifications;
struct device *dev;
}; };
struct dpaa2_io_store { struct dpaa2_io_store {
...@@ -98,13 +99,15 @@ EXPORT_SYMBOL_GPL(dpaa2_io_service_select); ...@@ -98,13 +99,15 @@ EXPORT_SYMBOL_GPL(dpaa2_io_service_select);
/** /**
* dpaa2_io_create() - create a dpaa2_io object. * dpaa2_io_create() - create a dpaa2_io object.
* @desc: the dpaa2_io descriptor * @desc: the dpaa2_io descriptor
* @dev: the actual DPIO device
* *
* Activates a "struct dpaa2_io" corresponding to the given config of an actual * Activates a "struct dpaa2_io" corresponding to the given config of an actual
* DPIO object. * DPIO object.
* *
* Return a valid dpaa2_io object for success, or NULL for failure. * Return a valid dpaa2_io object for success, or NULL for failure.
*/ */
struct dpaa2_io *dpaa2_io_create(const struct dpaa2_io_desc *desc) struct dpaa2_io *dpaa2_io_create(const struct dpaa2_io_desc *desc,
struct device *dev)
{ {
struct dpaa2_io *obj = kmalloc(sizeof(*obj), GFP_KERNEL); struct dpaa2_io *obj = kmalloc(sizeof(*obj), GFP_KERNEL);
...@@ -146,6 +149,8 @@ struct dpaa2_io *dpaa2_io_create(const struct dpaa2_io_desc *desc) ...@@ -146,6 +149,8 @@ struct dpaa2_io *dpaa2_io_create(const struct dpaa2_io_desc *desc)
dpio_by_cpu[desc->cpu] = obj; dpio_by_cpu[desc->cpu] = obj;
spin_unlock(&dpio_list_lock); spin_unlock(&dpio_list_lock);
obj->dev = dev;
return obj; return obj;
} }
...@@ -160,6 +165,11 @@ struct dpaa2_io *dpaa2_io_create(const struct dpaa2_io_desc *desc) ...@@ -160,6 +165,11 @@ struct dpaa2_io *dpaa2_io_create(const struct dpaa2_io_desc *desc)
*/ */
void dpaa2_io_down(struct dpaa2_io *d) void dpaa2_io_down(struct dpaa2_io *d)
{ {
spin_lock(&dpio_list_lock);
dpio_by_cpu[d->dpio_desc.cpu] = NULL;
list_del(&d->node);
spin_unlock(&dpio_list_lock);
kfree(d); kfree(d);
} }
...@@ -209,11 +219,25 @@ irqreturn_t dpaa2_io_irq(struct dpaa2_io *obj) ...@@ -209,11 +219,25 @@ irqreturn_t dpaa2_io_irq(struct dpaa2_io *obj)
return IRQ_HANDLED; return IRQ_HANDLED;
} }
/**
* dpaa2_io_get_cpu() - get the cpu associated with a given DPIO object
*
* @d: the given DPIO object.
*
* Return the cpu associated with the DPIO object
*/
int dpaa2_io_get_cpu(struct dpaa2_io *d)
{
return d->dpio_desc.cpu;
}
EXPORT_SYMBOL(dpaa2_io_get_cpu);
/** /**
* dpaa2_io_service_register() - Prepare for servicing of FQDAN or CDAN * dpaa2_io_service_register() - Prepare for servicing of FQDAN or CDAN
* notifications on the given DPIO service. * notifications on the given DPIO service.
* @d: the given DPIO service. * @d: the given DPIO service.
* @ctx: the notification context. * @ctx: the notification context.
* @dev: the device that requests the register
* *
* The caller should make the MC command to attach a DPAA2 object to * The caller should make the MC command to attach a DPAA2 object to
* a DPIO after this function completes successfully. In that way: * a DPIO after this function completes successfully. In that way:
...@@ -228,14 +252,20 @@ irqreturn_t dpaa2_io_irq(struct dpaa2_io *obj) ...@@ -228,14 +252,20 @@ irqreturn_t dpaa2_io_irq(struct dpaa2_io *obj)
* Return 0 for success, or -ENODEV for failure. * Return 0 for success, or -ENODEV for failure.
*/ */
int dpaa2_io_service_register(struct dpaa2_io *d, int dpaa2_io_service_register(struct dpaa2_io *d,
struct dpaa2_io_notification_ctx *ctx) struct dpaa2_io_notification_ctx *ctx,
struct device *dev)
{ {
struct device_link *link;
unsigned long irqflags; unsigned long irqflags;
d = service_select_by_cpu(d, ctx->desired_cpu); d = service_select_by_cpu(d, ctx->desired_cpu);
if (!d) if (!d)
return -ENODEV; return -ENODEV;
link = device_link_add(dev, d->dev, DL_FLAG_AUTOREMOVE_CONSUMER);
if (!link)
return -EINVAL;
ctx->dpio_id = d->dpio_desc.dpio_id; ctx->dpio_id = d->dpio_desc.dpio_id;
ctx->qman64 = (u64)(uintptr_t)ctx; ctx->qman64 = (u64)(uintptr_t)ctx;
ctx->dpio_private = d; ctx->dpio_private = d;
...@@ -256,12 +286,14 @@ EXPORT_SYMBOL_GPL(dpaa2_io_service_register); ...@@ -256,12 +286,14 @@ EXPORT_SYMBOL_GPL(dpaa2_io_service_register);
* dpaa2_io_service_deregister - The opposite of 'register'. * dpaa2_io_service_deregister - The opposite of 'register'.
* @service: the given DPIO service. * @service: the given DPIO service.
* @ctx: the notification context. * @ctx: the notification context.
* @dev: the device that requests to be deregistered
* *
* This function should be called only after sending the MC command to * This function should be called only after sending the MC command to
* to detach the notification-producing device from the DPIO. * to detach the notification-producing device from the DPIO.
*/ */
void dpaa2_io_service_deregister(struct dpaa2_io *service, void dpaa2_io_service_deregister(struct dpaa2_io *service,
struct dpaa2_io_notification_ctx *ctx) struct dpaa2_io_notification_ctx *ctx,
struct device *dev)
{ {
struct dpaa2_io *d = ctx->dpio_private; struct dpaa2_io *d = ctx->dpio_private;
unsigned long irqflags; unsigned long irqflags;
...@@ -272,6 +304,9 @@ void dpaa2_io_service_deregister(struct dpaa2_io *service, ...@@ -272,6 +304,9 @@ void dpaa2_io_service_deregister(struct dpaa2_io *service,
spin_lock_irqsave(&d->lock_notifications, irqflags); spin_lock_irqsave(&d->lock_notifications, irqflags);
list_del(&ctx->node); list_del(&ctx->node);
spin_unlock_irqrestore(&d->lock_notifications, irqflags); spin_unlock_irqrestore(&d->lock_notifications, irqflags);
if (dev)
device_link_remove(dev, d->dev);
} }
EXPORT_SYMBOL_GPL(dpaa2_io_service_deregister); EXPORT_SYMBOL_GPL(dpaa2_io_service_deregister);
......
...@@ -196,3 +196,26 @@ int dpio_get_api_version(struct fsl_mc_io *mc_io, ...@@ -196,3 +196,26 @@ int dpio_get_api_version(struct fsl_mc_io *mc_io,
return 0; return 0;
} }
/**
* dpio_reset() - Reset the DPIO, returns the object to initial state.
* @mc_io: Pointer to MC portal's I/O object
* @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_'
* @token: Token of DPIO object
*
* Return: '0' on Success; Error code otherwise.
*/
int dpio_reset(struct fsl_mc_io *mc_io,
u32 cmd_flags,
u16 token)
{
struct fsl_mc_command cmd = { 0 };
/* prepare command */
cmd.header = mc_encode_cmd_header(DPIO_CMDID_RESET,
cmd_flags,
token);
/* send command to mc*/
return mc_send_command(mc_io, &cmd);
}
...@@ -80,4 +80,8 @@ int dpio_get_api_version(struct fsl_mc_io *mc_io, ...@@ -80,4 +80,8 @@ int dpio_get_api_version(struct fsl_mc_io *mc_io,
u16 *major_ver, u16 *major_ver,
u16 *minor_ver); u16 *minor_ver);
int dpio_reset(struct fsl_mc_io *mc_io,
u32 cmd_flags,
u16 token);
#endif /* __FSL_DPIO_H */ #endif /* __FSL_DPIO_H */
...@@ -193,6 +193,7 @@ struct fsl_mc_device { ...@@ -193,6 +193,7 @@ struct fsl_mc_device {
struct resource *regions; struct resource *regions;
struct fsl_mc_device_irq **irqs; struct fsl_mc_device_irq **irqs;
struct fsl_mc_resource *resource; struct fsl_mc_resource *resource;
struct device_link *consumer_link;
}; };
#define to_fsl_mc_device(_dev) \ #define to_fsl_mc_device(_dev) \
......
...@@ -57,7 +57,8 @@ struct dpaa2_io_desc { ...@@ -57,7 +57,8 @@ struct dpaa2_io_desc {
u32 qman_version; u32 qman_version;
}; };
struct dpaa2_io *dpaa2_io_create(const struct dpaa2_io_desc *desc); struct dpaa2_io *dpaa2_io_create(const struct dpaa2_io_desc *desc,
struct device *dev);
void dpaa2_io_down(struct dpaa2_io *d); void dpaa2_io_down(struct dpaa2_io *d);
...@@ -90,10 +91,14 @@ struct dpaa2_io_notification_ctx { ...@@ -90,10 +91,14 @@ struct dpaa2_io_notification_ctx {
void *dpio_private; void *dpio_private;
}; };
int dpaa2_io_get_cpu(struct dpaa2_io *d);
int dpaa2_io_service_register(struct dpaa2_io *service, int dpaa2_io_service_register(struct dpaa2_io *service,
struct dpaa2_io_notification_ctx *ctx); struct dpaa2_io_notification_ctx *ctx,
struct device *dev);
void dpaa2_io_service_deregister(struct dpaa2_io *service, void dpaa2_io_service_deregister(struct dpaa2_io *service,
struct dpaa2_io_notification_ctx *ctx); struct dpaa2_io_notification_ctx *ctx,
struct device *dev);
int dpaa2_io_service_rearm(struct dpaa2_io *service, int dpaa2_io_service_rearm(struct dpaa2_io *service,
struct dpaa2_io_notification_ctx *ctx); struct dpaa2_io_notification_ctx *ctx);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment