Commit cdf61240 authored by Kishon Vijay Abraham I's avatar Kishon Vijay Abraham I Committed by Tony Lindgren

bus: ocp2scp: SYNC2 value should be changed to 0x6

As per the TRMs of AM572x, OMAP4430, OMAP4460, OMAP543x, the value of
SYNC2 must be set to 0x6 in order to ensure correct operation.

So modified the SYNC2 value of OCP2SCP TIMING register to 0x6 in all the
platforms that use OCP2SCP driver except AM437x. Also introduced a new
compatible property since we don't want to modify the OCP2SCP TIMING
register for AM437x.

The sections in TRM where the above caution can be found is mentioned below.
AM572x TRM SPRUHZ6 ( under
section, table 26-26.

under section , Table 23-1213.

under section, Table 23-1213.

OMAP543x TRM SWPU249 (
under section, Table 27-27.

Cc: Arnd Bergmann <>
Cc: Greg Kroah-Hartman <>
Signed-off-by: default avatarKishon Vijay Abraham I <>
Signed-off-by: default avatarPraneeth Bajjuri <>
Signed-off-by: default avatarTony Lindgren <>
parent 20431db9
......@@ -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) {
......@@ -47,6 +54,32 @@ static int omap_ocp2scp_probe(struct platform_device *pdev)
* As per AM572x TRM:
* under section, table 26-26 OCP2SCP TIMING Caution;
* As per OMAP4430 TRM:
* under section , Table 23-1213 OCP2SCP TIMING Caution;
* As per OMAP4460 TRM:
* under section, Table 23-1213 OCP2SCP TIMING Caution;
* As per OMAP543x TRM
* under section, Table 27-27 OCP2SCP TIMING Caution;
* Read path of OCP2SCP is not working properly due to low reset value
* of SYNC2 parameter in OCP2SCP. Suggested reset value is 0x6 or more.
if (!of_device_is_compatible(np, "ti,am437x-ocp2scp")) {
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
regs = devm_ioremap_resource(&pdev->dev, res);
if (IS_ERR(regs))
goto err0;
reg = readl_relaxed(regs + OCP2SCP_TIMING);
reg &= ~(SYNC2_MASK);
reg |= 0x6;
writel_relaxed(reg, regs + OCP2SCP_TIMING);
return 0;
......@@ -67,6 +100,7 @@ static int omap_ocp2scp_remove(struct platform_device *pdev)
#ifdef CONFIG_OF
static const struct of_device_id omap_ocp2scp_id_table[] = {
{ .compatible = "ti,omap-ocp2scp" },
{ .compatible = "ti,am437x-ocp2scp" },
MODULE_DEVICE_TABLE(of, omap_ocp2scp_id_table);
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