summaryrefslogtreecommitdiff
path: root/arch/arm/mach-ux500/cpu-db8500.c
diff options
context:
space:
mode:
authorShreshtha Kumar Sahu <shreshthakumar.sahu@stericsson.com>2012-01-19 14:31:36 +0530
committerPhilippe Langlais <philippe.langlais@linaro.org>2012-03-19 08:55:38 +0100
commit45657370fb79b310501f6d2592a76e12660290d8 (patch)
tree5f575ad15e5042979d64cf0b20a5219473733898 /arch/arm/mach-ux500/cpu-db8500.c
parent81795dca17b5b92605f9187cb2097eb1bc6e7b43 (diff)
pl011: add soft reset routine for each uart instance
This patch provides generic IP reset routine for CPU which is also used to do uart soft reset for each uart instance. As soft reset is platform dependent hence each uart's platform data reset() function pointer is updated with the same. ST-Ericsson ID: 411803 ST-Ericsson FOSS-OUT ID: Trivial ST-Ericsson Linux next: NA Change-Id: Idde32d3ca8f241f40c1071ecb580e43f14a3c6d1 Signed-off-by: Shreshtha Kumar Sahu <shreshthakumar.sahu@stericsson.com> Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/45918 Reviewed-by: Rabin VINCENT <rabin.vincent@stericsson.com>
Diffstat (limited to 'arch/arm/mach-ux500/cpu-db8500.c')
-rw-r--r--arch/arm/mach-ux500/cpu-db8500.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/arch/arm/mach-ux500/cpu-db8500.c b/arch/arm/mach-ux500/cpu-db8500.c
index a163e1fbf37..f6341ba91bd 100644
--- a/arch/arm/mach-ux500/cpu-db8500.c
+++ b/arch/arm/mach-ux500/cpu-db8500.c
@@ -19,6 +19,7 @@
#include <linux/io.h>
#include <linux/dma-mapping.h>
#include <linux/sys_soc.h>
+#include <linux/delay.h>
#include <asm/pmu.h>
#include <asm/mach/map.h>
@@ -31,6 +32,7 @@
#include <mach/ste-dma40-db8500.h>
#include "devices-db8500.h"
+#include "prcc.h"
/* minimum static i/o mapping required to boot U8500 platforms */
static struct map_desc u8500_uart_io_desc[] __initdata = {
@@ -133,6 +135,35 @@ static struct platform_device db8500_prcmu_device = {
.name = "db8500-prcmu",
};
+static unsigned int per_clkrst_base[7] = {
+ 0,
+ U8500_CLKRST1_BASE,
+ U8500_CLKRST2_BASE,
+ U8500_CLKRST3_BASE,
+ 0,
+ 0,
+ U8500_CLKRST6_BASE,
+};
+
+void u8500_reset_ip(unsigned char per, unsigned int ip_mask)
+{
+ void __iomem *prcc_rst_set, *prcc_rst_clr;
+
+ if (per == 0 || per == 4 || per == 5 || per > 6)
+ return;
+
+ prcc_rst_set = __io_address(per_clkrst_base[per] + PRCC_K_SOFTRST_SET);
+ prcc_rst_clr = __io_address(per_clkrst_base[per] + PRCC_K_SOFTRST_CLR);
+
+ /* Activate soft reset PRCC_K_SOFTRST_CLR */
+ writel(ip_mask, prcc_rst_clr);
+ udelay(1);
+
+ /* Release soft reset PRCC_K_SOFTRST_SET */
+ writel(ip_mask, prcc_rst_set);
+ udelay(1);
+}
+
static struct platform_device *platform_devs[] __initdata = {
&u8500_gpio_devs[0],
&u8500_gpio_devs[1],