Source
63
63
* under section 23.12.6.2.2, Table 23-1213 OCP2SCP TIMING Caution;
64
64
* As per OMAP543x TRM http://www.ti.com/lit/pdf/swpu249
65
65
* under section 27.3.2.2, Table 27-27 OCP2SCP TIMING Caution;
66
66
*
67
67
* Read path of OCP2SCP is not working properly due to low reset value
68
68
* of SYNC2 parameter in OCP2SCP. Suggested reset value is 0x6 or more.
69
69
*/
70
70
if (!of_device_is_compatible(np, "ti,am437x-ocp2scp")) {
71
71
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
72
72
regs = devm_ioremap_resource(&pdev->dev, res);
73
-
if (IS_ERR(regs))
74
-
goto err0;
73
+
if (IS_ERR(regs)) {
74
+
ret = PTR_ERR(regs);
75
+
goto err1;
76
+
}
75
77
76
78
pm_runtime_get_sync(&pdev->dev);
77
79
reg = readl_relaxed(regs + OCP2SCP_TIMING);
78
80
reg &= ~(SYNC2_MASK);
79
81
reg |= 0x6;
80
82
writel_relaxed(reg, regs + OCP2SCP_TIMING);
81
83
pm_runtime_put_sync(&pdev->dev);
82
84
}
83
85
84
86
return 0;
85
87
88
+
err1:
89
+
pm_runtime_disable(&pdev->dev);
90
+
86
91
err0:
87
92
device_for_each_child(&pdev->dev, NULL, ocp2scp_remove_devices);
88
93
89
94
return ret;
90
95
}
91
96
92
97
static int omap_ocp2scp_remove(struct platform_device *pdev)
93
98
{
94
99
pm_runtime_disable(&pdev->dev);
95
100
device_for_each_child(&pdev->dev, NULL, ocp2scp_remove_devices);