summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjason <jason.jin@freescale.com>2015-07-20 04:16:36 (GMT)
committerjason <jason.jin@freescale.com>2015-07-20 04:16:36 (GMT)
commitaaa395f27e077f51c75c6aefc7bbec44732e9742 (patch)
treeaae6de1e7a36dcfdc9c00e048c3c5da8d0d1d2c6
parentec78b412ad8fab85d14ec0d692d1bd6b79561a58 (diff)
parentf488de6741d5ba805b9fe813d2ddf32368d3a888 (diff)
downloadlinux-fsl-qoriq-aaa395f27e077f51c75c6aefc7bbec44732e9742.tar.xz
Merge branch 'qoriq-sdk' into LS1-SDK-Rev2.0
-rw-r--r--arch/powerpc/sysdev/fsl_lbc.c2
-rw-r--r--drivers/crypto/caam/qi.c38
-rw-r--r--drivers/spi/spi-fsl-espi.c33
-rw-r--r--drivers/staging/fsl_qbman/fsl_usdpaa.c18
-rw-r--r--drivers/staging/fsl_qbman/qman_high.c5
-rw-r--r--drivers/usb/gadget/fsl_udc_core.c2
-rw-r--r--drivers/vfio/vfio_iommu_fsl_pamu.c3
-rw-r--r--include/linux/fsl_qman.h6
8 files changed, 65 insertions, 42 deletions
diff --git a/arch/powerpc/sysdev/fsl_lbc.c b/arch/powerpc/sysdev/fsl_lbc.c
index 473f3b8..e924daa 100644
--- a/arch/powerpc/sysdev/fsl_lbc.c
+++ b/arch/powerpc/sysdev/fsl_lbc.c
@@ -245,8 +245,6 @@ static irqreturn_t fsl_lbc_ctrl_irq(int irqno, void *data)
if (status & LTESR_CS)
dev_err(ctrl->dev, "Chip select error: "
"LTESR 0x%08X\n", status);
- if (status & LTESR_UPM)
- ;
if (status & LTESR_FCT) {
dev_err(ctrl->dev, "FCM command time-out: "
"LTESR 0x%08X\n", status);
diff --git a/drivers/crypto/caam/qi.c b/drivers/crypto/caam/qi.c
index 9937cd4..e6911b2a 100644
--- a/drivers/crypto/caam/qi.c
+++ b/drivers/crypto/caam/qi.c
@@ -49,8 +49,6 @@ struct caam_qi_pcpu_priv {
struct napi_struct irqtask; /* IRQ task for QI backend */
struct net_device net_dev; /* netdev used by NAPI */
struct qman_fq rsp_fq; /* Response FQ from CAAM */
- u32 pool; /* Pool channel used by all from-SEC
- queues */
} ____cacheline_aligned;
static DEFINE_PER_CPU(struct caam_qi_pcpu_priv, pcpu_qipriv);
@@ -550,9 +548,6 @@ int caam_qi_shutdown(struct device *qidev)
else
qman_release_cgrid(priv->rsp_cgr.cgrid);
- /* Delete the pool channel */
- qman_release_pool(*this_cpu_ptr(&pcpu_qipriv.pool));
-
if (qi_cache)
kmem_cache_destroy(qi_cache);
@@ -631,7 +626,7 @@ static enum qman_cb_dqrr_result caam_rsp_fq_dqrr_cb(struct qman_portal *p,
return qman_cb_dqrr_consume;
}
-static int alloc_rsp_fq_cpu(struct device *qidev, unsigned int cpu, u32 pool)
+static int alloc_rsp_fq_cpu(struct device *qidev, unsigned int cpu)
{
struct qm_mcc_initfq opts;
struct qman_fq *fq;
@@ -654,13 +649,13 @@ static int alloc_rsp_fq_cpu(struct device *qidev, unsigned int cpu, u32 pool)
opts.we_mask = QM_INITFQ_WE_FQCTRL | QM_INITFQ_WE_DESTWQ |
QM_INITFQ_WE_CONTEXTB | QM_INITFQ_WE_CONTEXTA |
- QM_INITFQ_WE_CGID;
+ QM_INITFQ_WE_CGID | QMAN_INITFQ_FLAG_LOCAL;
opts.fqd.fq_ctrl = QM_FQCTRL_CTXASTASHING |
QM_FQCTRL_CPCSTASH |
QM_FQCTRL_CGE;
- opts.fqd.dest.channel = (u16)pool;
+ opts.fqd.dest.channel = qman_affine_channel(cpu);
opts.fqd.cgid = qipriv.rsp_cgr.cgrid;
opts.fqd.dest.wq = 0;
opts.fqd.context_a.stashing.exclusive =
@@ -707,7 +702,7 @@ static int alloc_cgrs(struct device *qidev)
/*
* This effectively sets the to-CPU threshold equal to half of the
* number of buffers available to dpa_eth driver. It means that at most
- * half of the buffers can be in the pool channel from SEC, waiting
+ * half of the buffers can be in the queues from SEC, waiting
* to be transmitted to the core (and then on the TX queues).
* NOTE: This is an arbitrary division; the factor '2' below could
* also be '3' or '4'. It also depends on the number of devices
@@ -733,43 +728,20 @@ static int alloc_cgrs(struct device *qidev)
return 0;
}
-static inline void add_cpu2pool(int cpu, u32 pool)
-{
- struct qman_portal *portal =
- (struct qman_portal *)qman_get_affine_portal(cpu);
- qman_p_static_dequeue_add(portal,
- QM_SDQCR_CHANNELS_POOL_CONV((u16)pool));
-}
-
static int alloc_rsp_fqs(struct device *qidev)
{
const cpumask_t *cpus = qman_affine_cpus();
int ret, i;
- u32 pool;
-
- ret = qman_alloc_pool(&pool);
- if (ret) {
- dev_err(qidev, "CAAM pool alloc failed: %d\n", ret);
- return ret;
- }
- dev_info(qidev, "Allocated pool %d\n", pool);
/*Now create response FQs*/
for_each_cpu(i, cpus) {
- ret = alloc_rsp_fq_cpu(qidev, i, pool);
+ ret = alloc_rsp_fq_cpu(qidev, i);
if (ret) {
dev_err(qidev, "CAAM rsp FQ alloc failed, cpu: %u", i);
return ret;
}
- add_cpu2pool(i, pool);
}
- /*
- * The pool will be used (i.e. set as destination only from this CPU
- * (the CPU performing the initialization).
- */
- *this_cpu_ptr(&pcpu_qipriv.pool) = pool;
-
return 0;
}
diff --git a/drivers/spi/spi-fsl-espi.c b/drivers/spi/spi-fsl-espi.c
index a7fdb87..0b03ae3 100644
--- a/drivers/spi/spi-fsl-espi.c
+++ b/drivers/spi/spi-fsl-espi.c
@@ -739,6 +739,35 @@ static int of_fsl_espi_remove(struct platform_device *dev)
}
#ifdef CONFIG_PM_SLEEP
+#define DCFG_CCSR_DEVDISR4_OFF 0x7c
+#define ESPI_BIT (1 << 27)
+
+static int hw_disable_espi(int disable)
+{
+ struct device_node *np;
+ void __iomem *gut_addr = NULL; /* Local Access Control registers */
+ u32 regval;
+
+ np = of_find_compatible_node(NULL, NULL, "fsl,t1040-device-config");
+ if (!np) {
+ pr_err("could not find a guts node\n");
+ return -ENODEV;
+ }
+ gut_addr = of_iomap(np, 0);
+ if (!gut_addr)
+ return -ENODEV;
+
+ regval = in_be32(gut_addr + DCFG_CCSR_DEVDISR4_OFF);
+ if (disable == true)
+ regval |= ESPI_BIT;
+ else
+ regval &= ~ESPI_BIT;
+
+ out_be32(gut_addr + DCFG_CCSR_DEVDISR4_OFF, regval);
+
+ return 0;
+}
+
static int of_fsl_espi_suspend(struct device *dev)
{
struct spi_master *master = dev_get_drvdata(dev);
@@ -760,6 +789,8 @@ static int of_fsl_espi_suspend(struct device *dev)
regval &= ~SPMODE_ENABLE;
mpc8xxx_spi_write_reg(&reg_base->mode, regval);
+ hw_disable_espi(true);
+
return 0;
}
@@ -772,6 +803,8 @@ static int of_fsl_espi_resume(struct device *dev)
u32 regval;
int i;
+ hw_disable_espi(false);
+
mpc8xxx_spi = spi_master_get_devdata(master);
reg_base = mpc8xxx_spi->reg_base;
diff --git a/drivers/staging/fsl_qbman/fsl_usdpaa.c b/drivers/staging/fsl_qbman/fsl_usdpaa.c
index e2e3308..55223cd 100644
--- a/drivers/staging/fsl_qbman/fsl_usdpaa.c
+++ b/drivers/staging/fsl_qbman/fsl_usdpaa.c
@@ -230,6 +230,7 @@ static struct mem_fragment *split_frag(struct mem_fragment *frag)
x[0]->refs = x[1]->refs = x[2]->refs = 0;
x[0]->root_len = x[1]->root_len = x[2]->root_len = frag->root_len;
x[0]->root_pfn = x[1]->root_pfn = x[2]->root_pfn = frag->root_pfn;
+ x[0]->name[0] = x[1]->name[0] = x[2]->name[0] = 0;
list_add_tail(&x[0]->list, &frag->list);
list_add_tail(&x[1]->list, &x[0]->list);
list_add_tail(&x[2]->list, &x[1]->list);
@@ -241,9 +242,10 @@ static __maybe_unused void dump_frags(void)
struct mem_fragment *frag;
int i = 0;
list_for_each_entry(frag, &mem_list, list) {
- pr_info("FRAG %d: base 0x%llx pfn_base 0x%lx len 0x%llx root_len 0x%llx root_pfn 0x%lx refs %d\n",
+ pr_info("FRAG %d: base 0x%llx pfn_base 0x%lx len 0x%llx root_len 0x%llx root_pfn 0x%lx refs %d name %s\n",
i, frag->base, frag->pfn_base,
- frag->len, frag->root_len, frag->root_pfn, frag->refs);
+ frag->len, frag->root_len, frag->root_pfn,
+ frag->refs, frag->name);
++i;
}
}
@@ -922,7 +924,7 @@ static long ioctl_dma_map(struct file *fp, struct ctx *ctx,
unsigned long next_addr = PAGE_SIZE, populate;
/* error checking to ensure values copied from user space are valid */
- if (!i->len || (i->len % PAGE_SIZE))
+ if (i->len % PAGE_SIZE)
return -EINVAL;
map = kmalloc(sizeof(*map), GFP_KERNEL);
@@ -942,6 +944,13 @@ static long ioctl_dma_map(struct file *fp, struct ctx *ctx,
ret = -EBUSY;
goto out;
}
+
+ /* Check to ensure size matches record */
+ if (i->len != frag->map_len && i->len) {
+ pr_err("ioctl_dma_map() Size requested does not match %s and is none zero. This usage will be disallowed in future release\n",
+ frag->name);
+ }
+
/* Check if this has already been mapped
to this process */
list_for_each_entry(tmp, &ctx->maps, list)
@@ -1147,6 +1156,7 @@ map_match:
current_frag = list_entry(current_frag->list.prev,
struct mem_fragment, list);
}
+ map->root_frag->name[0] = 0;
list_del(&map->list);
compress_frags();
spin_unlock(&mem_lock);
@@ -1669,6 +1679,8 @@ static long usdpaa_ioctl_compat(struct file *fp, unsigned int cmd,
ret = ioctl_dma_map(fp, ctx, &converted);
input.ptr = ptr_to_compat(converted.ptr);
input.phys_addr = converted.phys_addr;
+ input.len = converted.len;
+ input.flags = converted.flags;
strncpy(input.name, converted.name, USDPAA_DMA_NAME_MAX);
input.has_locking = converted.has_locking;
input.did_create = converted.did_create;
diff --git a/drivers/staging/fsl_qbman/qman_high.c b/drivers/staging/fsl_qbman/qman_high.c
index b94bfb4..334d9ed 100644
--- a/drivers/staging/fsl_qbman/qman_high.c
+++ b/drivers/staging/fsl_qbman/qman_high.c
@@ -3517,6 +3517,7 @@ int qman_ceetm_lni_enable_shaper(struct qm_ceetm_lni *lni, int coupled,
lni->er_token_rate.fraction;
config_opts.shaper_config.crtbl = lni->cr_token_bucket_limit;
config_opts.shaper_config.ertbl = lni->er_token_bucket_limit;
+ config_opts.shaper_config.mps = 60;
return qman_ceetm_configure_mapping_shaper_tcfc(&config_opts);
}
EXPORT_SYMBOL(qman_ceetm_lni_enable_shaper);
@@ -3540,6 +3541,7 @@ int qman_ceetm_lni_disable_shaper(struct qm_ceetm_lni *lni)
*/
config_opts.shaper_config.crtcr = 0xFFFFFF;
config_opts.shaper_config.ertcr = 0xFFFFFF;
+ config_opts.shaper_config.mps = 60;
lni->shaper_enable = 0;
return qman_ceetm_configure_mapping_shaper_tcfc(&config_opts);
}
@@ -3583,6 +3585,7 @@ int qman_ceetm_lni_set_commit_rate(struct qm_ceetm_lni *lni,
query_result.shaper_query.ertcr;
config_opts.shaper_config.ertbl =
query_result.shaper_query.ertbl;
+ config_opts.shaper_config.mps = query_result.shaper_query.mps;
return qman_ceetm_configure_mapping_shaper_tcfc(&config_opts);
} else {
return 0;
@@ -3678,7 +3681,7 @@ int qman_ceetm_lni_set_excess_rate(struct qm_ceetm_lni *lni,
query_result.shaper_query.crtcr;
config_opts.shaper_config.crtbl =
query_result.shaper_query.crtbl;
-
+ config_opts.shaper_config.mps = query_result.shaper_query.mps;
return qman_ceetm_configure_mapping_shaper_tcfc(&config_opts);
} else {
return 0;
diff --git a/drivers/usb/gadget/fsl_udc_core.c b/drivers/usb/gadget/fsl_udc_core.c
index 638a345..2068625 100644
--- a/drivers/usb/gadget/fsl_udc_core.c
+++ b/drivers/usb/gadget/fsl_udc_core.c
@@ -1059,7 +1059,7 @@ static int fsl_ep_fifo_status(struct usb_ep *_ep)
struct ep_queue_head *qh;
ep = container_of(_ep, struct fsl_ep, ep);
- if (!_ep || (!ep->ep.desc && ep_index(ep) != 0))
+ if (!_ep || !ep->ep.desc || (ep_index(ep) == 0))
return -ENODEV;
udc = (struct fsl_udc *)ep->udc;
diff --git a/drivers/vfio/vfio_iommu_fsl_pamu.c b/drivers/vfio/vfio_iommu_fsl_pamu.c
index d049edc..4d300da 100644
--- a/drivers/vfio/vfio_iommu_fsl_pamu.c
+++ b/drivers/vfio/vfio_iommu_fsl_pamu.c
@@ -200,6 +200,9 @@ static int vaddr_get_pfn(unsigned long vaddr, int prot, unsigned long *pfn,
int i;
pages = kzalloc(sizeof(*pages) * nr_pages, GFP_KERNEL);
+ if (!pages)
+ return -ENOMEM;
+
ret = get_user_pages_fast(vaddr, nr_pages, !!(prot & IOMMU_WRITE), pages);
if (ret != nr_pages)
goto error;
diff --git a/include/linux/fsl_qman.h b/include/linux/fsl_qman.h
index 2909cc5..991729e 100644
--- a/include/linux/fsl_qman.h
+++ b/include/linux/fsl_qman.h
@@ -789,7 +789,8 @@ struct qm_mcc_ceetm_mapping_shaper_tcfc_config {
u32 ertcr:24;
u16 crtbl;
u16 ertbl;
- u8 __reserved2[48];
+ u8 mps; /* This will be hardcoded by driver with 60 */
+ u8 __reserved2[47];
} __packed shaper_config;
struct {
u8 __reserved2[11];
@@ -1203,7 +1204,8 @@ struct qm_mcr_ceetm_mapping_shaper_tcfc_query {
u32 ertcr:24;
u16 crtbl;
u16 ertbl;
- u8 __reserved2[16];
+ u8 mps;
+ u8 __reserved2[15];
u32 crat;
u32 erat;
u8 __reserved3[24];