[PATCH] bus: ocp2scp: SYNC2 value should be changed to 0x6

From: Kishon Vijay Abraham I
Date: Wed May 14 2014 - 04:50:02 EST


Read path of OCP2SCP is not working properly due to low reset value
of SYNC2 parameter in OCP2SCP. So changed the SYNC2 value to 0x6.

Signed-off-by: Kishon Vijay Abraham I <kishon@xxxxxx>
---
drivers/bus/omap-ocp2scp.c | 23 +++++++++++++++++++++++
1 file changed, 23 insertions(+)

diff --git a/drivers/bus/omap-ocp2scp.c b/drivers/bus/omap-ocp2scp.c
index 5511f98..0a974b2 100644
--- a/drivers/bus/omap-ocp2scp.c
+++ b/drivers/bus/omap-ocp2scp.c
@@ -16,6 +16,7 @@
*
*/

+#include <linux/io.h>
#include <linux/module.h>
#include <linux/platform_device.h>
#include <linux/err.h>
@@ -23,6 +24,9 @@
#include <linux/of.h>
#include <linux/of_platform.h>

+#define OCP2SCP_TIMING 0x18
+#define SYNC2_MASK 0xf
+
static int ocp2scp_remove_devices(struct device *dev, void *c)
{
struct platform_device *pdev = to_platform_device(dev);
@@ -35,6 +39,9 @@ static int ocp2scp_remove_devices(struct device *dev, void *c)
static int omap_ocp2scp_probe(struct platform_device *pdev)
{
int ret;
+ u32 reg;
+ void __iomem *regs;
+ struct resource *res;
struct device_node *np = pdev->dev.of_node;

if (np) {
@@ -46,8 +53,24 @@ static int omap_ocp2scp_probe(struct platform_device *pdev)
}
}

+ res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+ regs = devm_ioremap_resource(&pdev->dev, res);
+ if (IS_ERR(regs))
+ return PTR_ERR(regs);
+
pm_runtime_enable(&pdev->dev);

+ /*
+ * Read path of OCP2SCP is not working properly due to low reset value
+ * of SYNC2 parameter in OCP2SCP. Suggested reset value is 0x6.
+ */
+ pm_runtime_get_sync(&pdev->dev);
+ reg = readl(regs + OCP2SCP_TIMING);
+ reg &= ~(SYNC2_MASK);
+ reg |= 0x6;
+ writel(reg, regs + OCP2SCP_TIMING);
+ pm_runtime_put_sync(&pdev->dev);
+
return 0;

err0:
--
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/