The patch fixes EDMA crossbar mapping to actually
make it work. The patch has been tagged for stable. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) iQIcBAABAgAGBQJTX7HWAAoJEGFBu2jqvgRNJSQP/3zwkXJizhctwlr91OYwJyZ+ uN30iljZvVKf5i+qgp4syjznHOT/yFyS33lG3S9cSSjyjsdZcj5DbOOh2PTEzZd+ josb6bZ+Z6YQBmcYy8V6KuWyEV8UfTr/3wGDb+/cfGfFACD8uxHZo0K/s7p6LCCb LIo/yzI3DpgrkWYJ7S4kIjz3P+k0gCc3zy1QwbmyWFXYIwREHlgdRAz/M+vjEHyg tx7HZiewg++dGeSui2PHdxhyTANj6k5emBiGTCOUUBYQ0iI4cGsaT2orzxtgEFRx Cgd7+/p5Uih2XyC9+7aV6flJoOS2qhsBGvlunVmnd9b7hNxtAtV73I8CEzv3GxDN hu6WqPnF9ZIO9hPrj6HdrLtYNPJcmRzvaCT9LOCp3q+kxqjGI6QkrDP9hTT0xc4e 9R9/n380048CLsjarfrYgeA1PCDq84I3wbRUUf2Wtgr2vaZufgL6m4cDeZRtzk/s Ccz+zu4hhxK7NWIH+aze2wcc/8o+l35vaVp2GjGJnh47CAr2Wd65AplWLQhzM3EP XAiXh2PKAd5fenIlKBIShFI5j+EZ/dSmAqXgYFhXUI7QG35feXeAa8YdbiWSRscq jqOoDTmKX8eT5p/0i7Dkh9dvHOpiwoHimSHt3yVRQQXAOjj5fyQpjVXBHpHv6+YV 8eY2u5v16Off5qNT4EWH =eyxH -----END PGP SIGNATURE----- Merge tag 'davinci-fixes-for-v3.15-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/nsekhar/linux-davinci into fixes Pull "DaVinci fixes for v3.15" from Sekhar Nori: The patch fixes EDMA crossbar mapping to actually make it work. The patch has been tagged for stable. * tag 'davinci-fixes-for-v3.15-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/nsekhar/linux-davinci: ARM: common: edma: Fix xbar mapping Signed-off-by: Olof Johansson <olof@lixom.net>
This commit is contained in:
commit
3b27dcec92
|
@ -29,6 +29,6 @@ edma: edma@49000000 {
|
||||||
dma-channels = <64>;
|
dma-channels = <64>;
|
||||||
ti,edma-regions = <4>;
|
ti,edma-regions = <4>;
|
||||||
ti,edma-slots = <256>;
|
ti,edma-slots = <256>;
|
||||||
ti,edma-xbar-event-map = <1 12
|
ti,edma-xbar-event-map = /bits/ 16 <1 12
|
||||||
2 13>;
|
2 13>;
|
||||||
};
|
};
|
||||||
|
|
|
@ -144,7 +144,7 @@
|
||||||
compatible = "ti,edma3";
|
compatible = "ti,edma3";
|
||||||
ti,hwmods = "tpcc", "tptc0", "tptc1", "tptc2";
|
ti,hwmods = "tpcc", "tptc0", "tptc1", "tptc2";
|
||||||
reg = <0x49000000 0x10000>,
|
reg = <0x49000000 0x10000>,
|
||||||
<0x44e10f90 0x10>;
|
<0x44e10f90 0x40>;
|
||||||
interrupts = <12 13 14>;
|
interrupts = <12 13 14>;
|
||||||
#dma-cells = <1>;
|
#dma-cells = <1>;
|
||||||
dma-channels = <64>;
|
dma-channels = <64>;
|
||||||
|
|
|
@ -1423,55 +1423,38 @@ EXPORT_SYMBOL(edma_clear_event);
|
||||||
|
|
||||||
#if IS_ENABLED(CONFIG_OF) && IS_ENABLED(CONFIG_DMADEVICES)
|
#if IS_ENABLED(CONFIG_OF) && IS_ENABLED(CONFIG_DMADEVICES)
|
||||||
|
|
||||||
static int edma_of_read_u32_to_s16_array(const struct device_node *np,
|
static int edma_xbar_event_map(struct device *dev, struct device_node *node,
|
||||||
const char *propname, s16 *out_values,
|
struct edma_soc_info *pdata, size_t sz)
|
||||||
size_t sz)
|
|
||||||
{
|
{
|
||||||
int ret;
|
const char pname[] = "ti,edma-xbar-event-map";
|
||||||
|
|
||||||
ret = of_property_read_u16_array(np, propname, out_values, sz);
|
|
||||||
if (ret)
|
|
||||||
return ret;
|
|
||||||
|
|
||||||
/* Terminate it */
|
|
||||||
*out_values++ = -1;
|
|
||||||
*out_values++ = -1;
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int edma_xbar_event_map(struct device *dev,
|
|
||||||
struct device_node *node,
|
|
||||||
struct edma_soc_info *pdata, int len)
|
|
||||||
{
|
|
||||||
int ret, i;
|
|
||||||
struct resource res;
|
struct resource res;
|
||||||
void __iomem *xbar;
|
void __iomem *xbar;
|
||||||
const s16 (*xbar_chans)[2];
|
s16 (*xbar_chans)[2];
|
||||||
|
size_t nelm = sz / sizeof(s16);
|
||||||
u32 shift, offset, mux;
|
u32 shift, offset, mux;
|
||||||
|
int ret, i;
|
||||||
|
|
||||||
xbar_chans = devm_kzalloc(dev,
|
xbar_chans = devm_kzalloc(dev, (nelm + 2) * sizeof(s16), GFP_KERNEL);
|
||||||
len/sizeof(s16) + 2*sizeof(s16),
|
|
||||||
GFP_KERNEL);
|
|
||||||
if (!xbar_chans)
|
if (!xbar_chans)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
ret = of_address_to_resource(node, 1, &res);
|
ret = of_address_to_resource(node, 1, &res);
|
||||||
if (ret)
|
if (ret)
|
||||||
return -EIO;
|
return -ENOMEM;
|
||||||
|
|
||||||
xbar = devm_ioremap(dev, res.start, resource_size(&res));
|
xbar = devm_ioremap(dev, res.start, resource_size(&res));
|
||||||
if (!xbar)
|
if (!xbar)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
ret = edma_of_read_u32_to_s16_array(node,
|
ret = of_property_read_u16_array(node, pname, (u16 *)xbar_chans, nelm);
|
||||||
"ti,edma-xbar-event-map",
|
|
||||||
(s16 *)xbar_chans,
|
|
||||||
len/sizeof(u32));
|
|
||||||
if (ret)
|
if (ret)
|
||||||
return -EIO;
|
return -EIO;
|
||||||
|
|
||||||
for (i = 0; xbar_chans[i][0] != -1; i++) {
|
/* Invalidate last entry for the other user of this mess */
|
||||||
|
nelm >>= 1;
|
||||||
|
xbar_chans[nelm][0] = xbar_chans[nelm][1] = -1;
|
||||||
|
|
||||||
|
for (i = 0; i < nelm; i++) {
|
||||||
shift = (xbar_chans[i][1] & 0x03) << 3;
|
shift = (xbar_chans[i][1] & 0x03) << 3;
|
||||||
offset = xbar_chans[i][1] & 0xfffffffc;
|
offset = xbar_chans[i][1] & 0xfffffffc;
|
||||||
mux = readl(xbar + offset);
|
mux = readl(xbar + offset);
|
||||||
|
@ -1480,8 +1463,7 @@ static int edma_xbar_event_map(struct device *dev,
|
||||||
writel(mux, (xbar + offset));
|
writel(mux, (xbar + offset));
|
||||||
}
|
}
|
||||||
|
|
||||||
pdata->xbar_chans = xbar_chans;
|
pdata->xbar_chans = (const s16 (*)[2]) xbar_chans;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue