From 1e8a600f17ed36e73e69e82bb615a07ac33f8709 Mon Sep 17 00:00:00 2001 From: Nanxin Qin Date: Tue, 22 Aug 2017 13:45:03 +0800 Subject: [PATCH] rdma: fixed issure of crash on boot. PD#149681: removed the operation of registers in the rdma_init Change-Id: Iecf12be123952d0a5eb91b77e433d3fb67378d4e Signed-off-by: Nanxin Qin --- drivers/amlogic/media/common/rdma/rdma.c | 16 +++++++++++----- drivers/amlogic/media/common/rdma/rdma.h | 3 +++ drivers/amlogic/media/common/rdma/rdma_mgr.c | 8 ++++++++ 3 files changed, 22 insertions(+), 5 deletions(-) diff --git a/drivers/amlogic/media/common/rdma/rdma.c b/drivers/amlogic/media/common/rdma/rdma.c index f31374d..83d3420 100644 --- a/drivers/amlogic/media/common/rdma/rdma.c +++ b/drivers/amlogic/media/common/rdma/rdma.c @@ -47,7 +47,6 @@ #define Wr_reg_bits(adr, val, start, len) \ WRITE_VCBUS_REG_BITS(adr, val, start, len) -#define RDMA_TABLE_SIZE (8 * (PAGE_SIZE)) static int vsync_rdma_handle; static int irq_count; static int enable; @@ -246,14 +245,21 @@ void enable_rdma(int enable_flag) } EXPORT_SYMBOL(enable_rdma); -static int __init rdma_init(void) +struct rdma_op_s *get_rdma_ops(void) +{ + return &vsync_rdma_op; +} +void set_rdma_handle(int handle) { - vsync_rdma_handle = - rdma_register(&vsync_rdma_op, - NULL, RDMA_TABLE_SIZE); + vsync_rdma_handle = handle; pr_info("%s video rdma handle = %d.\n", __func__, vsync_rdma_handle); +} + +static int __init rdma_init(void) + +{ cur_enable = 0; enable = 1; force_rdma_config = 1; diff --git a/drivers/amlogic/media/common/rdma/rdma.h b/drivers/amlogic/media/common/rdma/rdma.h index a0bb886..8c98077 100644 --- a/drivers/amlogic/media/common/rdma/rdma.h +++ b/drivers/amlogic/media/common/rdma/rdma.h @@ -25,4 +25,7 @@ void enable_rdma_log(int flag); void enable_rdma(int enable_flag); extern int rdma_watchdog_setting(int flag); int rdma_init2(void); +struct rdma_op_s *get_rdma_ops(void); +void set_rdma_handle(int handle); + #endif diff --git a/drivers/amlogic/media/common/rdma/rdma_mgr.c b/drivers/amlogic/media/common/rdma/rdma_mgr.c index 3b626e5..01e7065 100644 --- a/drivers/amlogic/media/common/rdma/rdma_mgr.c +++ b/drivers/amlogic/media/common/rdma/rdma_mgr.c @@ -39,6 +39,7 @@ #include #include +#include "rdma.h" #define DRIVER_NAME "amlogic-rdma" #define MODULE_NAME "amlogic-rdma" @@ -67,6 +68,8 @@ static int rdma_force_reset = -1; static u16 trace_reg; #define RDMA_NUM 8 +#define RDMA_TABLE_SIZE (8 * (PAGE_SIZE)) + struct rdma_regadr_s { u32 rdma_ahb_start_addr; u32 rdma_ahb_end_addr; @@ -762,6 +765,7 @@ static int rdma_probe(struct platform_device *pdev) int i; u32 data32; int int_rdma; + int handle; struct rdma_device_info *info = &rdma_info; int_rdma = platform_get_irq_byname(pdev, "rdma"); @@ -809,6 +813,10 @@ static int rdma_probe(struct platform_device *pdev) WRITE_VCBUS_REG(RDMA_CTRL, data32); info->rdma_dev = pdev; + + handle = rdma_register(get_rdma_ops(), NULL, RDMA_TABLE_SIZE); + set_rdma_handle(handle); + return 0; } -- 2.7.4