summaryrefslogtreecommitdiffstats
path: root/meta-rcar-gen3-adas/recipes-kernel/linux/linux-renesas/0074-MOST-dim2-add-R-Car3-related-initialization.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta-rcar-gen3-adas/recipes-kernel/linux/linux-renesas/0074-MOST-dim2-add-R-Car3-related-initialization.patch')
-rw-r--r--meta-rcar-gen3-adas/recipes-kernel/linux/linux-renesas/0074-MOST-dim2-add-R-Car3-related-initialization.patch63
1 files changed, 63 insertions, 0 deletions
diff --git a/meta-rcar-gen3-adas/recipes-kernel/linux/linux-renesas/0074-MOST-dim2-add-R-Car3-related-initialization.patch b/meta-rcar-gen3-adas/recipes-kernel/linux/linux-renesas/0074-MOST-dim2-add-R-Car3-related-initialization.patch
new file mode 100644
index 0000000..572da2a
--- /dev/null
+++ b/meta-rcar-gen3-adas/recipes-kernel/linux/linux-renesas/0074-MOST-dim2-add-R-Car3-related-initialization.patch
@@ -0,0 +1,63 @@
+From 41d15fa6003b65080f05d271bf495104013754f9 Mon Sep 17 00:00:00 2001
+From: Andrey Gusakov <andrey.gusakov@cogentembedded.com>
+Date: Fri, 7 Jul 2017 20:43:33 +0300
+Subject: [PATCH 112/114] MOST: dim2: add R-Car3 related initialization
+
+Signed-off-by: Andrey Gusakov <andrey.gusakov@cogentembedded.com>
+---
+ drivers/staging/most/hdm-dim2/dim2_hdm.c | 28 +++++++++++++++++++++++++++-
+ 1 file changed, 27 insertions(+), 1 deletion(-)
+
+diff --git a/drivers/staging/most/hdm-dim2/dim2_hdm.c b/drivers/staging/most/hdm-dim2/dim2_hdm.c
+index f28f169180fe..c1beabc28fa8 100644
+--- a/drivers/staging/most/hdm-dim2/dim2_hdm.c
++++ b/drivers/staging/most/hdm-dim2/dim2_hdm.c
+@@ -26,6 +26,7 @@
+ #include <linux/dma-mapping.h>
+ #include <linux/sched.h>
+ #include <linux/kthread.h>
++#include <linux/delay.h>
+
+ #include <mostcore.h>
+ #include <networking.h>
+@@ -189,6 +191,26 @@ static int dim_parce_speed(const char *clock_speed)
+ return -1;
+ }
+
++static int dim_rcar_init(struct dim2_hdm *dev)
++{
++ /* PLL */
++ __raw_writel(0x04, dev->io_base + 0x600);
++
++ /* 512FS Enable Register */
++ if (dev->clk_speed == CLK_512FS)
++ __raw_writel(0x01, dev->io_base + 0x604);
++ else
++ __raw_writel(0x00, dev->io_base + 0x604);
++
++ udelay(200);
++
++ /* BBCR = 0b11 */
++ __raw_writel(0x03, dev->io_base + 0x500);
++ __raw_writel(0x0002FF02, dev->io_base + 0x508);
++
++ return 0;
++}
++
+ /**
+ * startup_dim - initialize the dim2 interface
+ * @pdev: platform device
+@@ -216,6 +238,10 @@ static int startup_dim(struct platform_device *pdev)
+ return ret;
+ }
+
++ if (1 /* renesas */) {
++ dim_rcar_init(dev);
++ }
++
+ pr_info("sync: num of frames per sub-buffer: %u\n", fcnt);
+ hal_ret = dim_startup(dev->io_base, dev->clk_speed, fcnt);
+ if (hal_ret != DIM_NO_ERROR) {
+--
+2.13.0
+