7873
- 收藏
- 点赞
- 分享
- 举报
海思串口驱动
本帖最后由 ymir 于 2015-7-10 12:57 编辑
四个串口驱动diff文件
[code]diff --git a/arch/arm/mach-hi3520d/core.c b/arch/arm/mach-hi3520d/core.c
index f57a008..46462e1 100644
--- a/arch/arm/mach-hi3520d/core.c
+++ b/arch/arm/mach-hi3520d/core.c
@@ -309,16 +309,21 @@ struct sys_timer hi3520d_timer = {
HIL_AMBA_DEVICE(uart0, "uart:0", UART0, NULL);
HIL_AMBA_DEVICE(uart1, "uart:1", UART1, NULL);
-
+////dfl uart2 uart3////
+HIL_AMBA_DEVICE(uart2, "uart:2", UART2, NULL);
+HIL_AMBA_DEVICE(uart3, "uart:3", UART3, NULL);
+///dfl uart2 uart3////
static struct amba_device *amba_devs[] __initdata = {
&HIL_AMBADEV_NAME(uart0),
&HIL_AMBADEV_NAME(uart1),
+ &HIL_AMBADEV_NAME(uart2),
+ &HIL_AMBADEV_NAME(uart3),
};
static struct clk uart_clk;
-static struct clk_lookup lookups[2];
-
+//static struct clk_lookup lookups[2];
+static struct clk_lookup lookups[4];//4个串口
static void uart_clk_init(unsigned long clk)
{
uart_clk.rate = clk;
@@ -328,6 +333,12 @@ static void uart_clk_init(unsigned long clk)
lookups[1].dev_id = "uart:1";
lookups[1].clk = &uart_clk;
+
+ lookups[2].dev_id = "uart:2";
+ lookups[2].clk = &uart_clk;
+
+ lookups[3].dev_id = "uart:3";
+ lookups[3].clk = &uart_clk;
}
void __init hi3520d_init(void)
@@ -351,6 +362,16 @@ void __init hi3520d_init(void)
edb_trace();
amba_device_register(amba_devs, &iomem_resource);
}
+ //////dfl uart 2 uart3///////
+ // writel(1, IO_ADDRESS(REG_BASE_IO));
+ // writel(0x, IO_ADDRESS(GPIO1_BASE+0x400));
+
+ writel(1, IO_ADDRESS(IOCONFIG_BASE+0x060));//// UART2_TXD
+ writel(1, IO_ADDRESS(IOCONFIG_BASE+0x05c)); //// UART2_RXD
+
+ writel(1, IO_ADDRESS(IOCONFIG_BASE+0x0b8));//// UART3_TXD
+ writel(1, IO_ADDRESS(IOCONFIG_BASE+0x0bc)); //// UART3_RXD
+ //////dfl uart 2 uart3///////
}
MACHINE_START(HI3520D, "hi3520d")
diff --git a/arch/arm/mach-hi3520d/include/mach/irqs.h b/arch/arm/mach-hi3520d/include/mach/irqs.h
index 5f0a484..2610e17 100644
--- a/arch/arm/mach-hi3520d/include/mach/irqs.h
+++ b/arch/arm/mach-hi3520d/include/mach/irqs.h
@@ -8,6 +8,8 @@
#define UART0_IRQ (HI3520D_IRQ_START + 8)
#define UART1_IRQ (HI3520D_IRQ_START + 9)
+#define UART2_IRQ (HI3520D_IRQ_START + 10)
+#define UART3_IRQ (HI3520D_IRQ_START + 11)
#define INTNR_L2CACHE_CHK0_INT (HI3520D_IRQ_START + 29)
#define INTNR_L2CACHE_CHK1_INT (HI3520D_IRQ_START + 30)
[/code]
四个串口驱动diff文件
[code]diff --git a/arch/arm/mach-hi3520d/core.c b/arch/arm/mach-hi3520d/core.c
index f57a008..46462e1 100644
--- a/arch/arm/mach-hi3520d/core.c
+++ b/arch/arm/mach-hi3520d/core.c
@@ -309,16 +309,21 @@ struct sys_timer hi3520d_timer = {
HIL_AMBA_DEVICE(uart0, "uart:0", UART0, NULL);
HIL_AMBA_DEVICE(uart1, "uart:1", UART1, NULL);
-
+////dfl uart2 uart3////
+HIL_AMBA_DEVICE(uart2, "uart:2", UART2, NULL);
+HIL_AMBA_DEVICE(uart3, "uart:3", UART3, NULL);
+///dfl uart2 uart3////
static struct amba_device *amba_devs[] __initdata = {
&HIL_AMBADEV_NAME(uart0),
&HIL_AMBADEV_NAME(uart1),
+ &HIL_AMBADEV_NAME(uart2),
+ &HIL_AMBADEV_NAME(uart3),
};
static struct clk uart_clk;
-static struct clk_lookup lookups[2];
-
+//static struct clk_lookup lookups[2];
+static struct clk_lookup lookups[4];//4个串口
static void uart_clk_init(unsigned long clk)
{
uart_clk.rate = clk;
@@ -328,6 +333,12 @@ static void uart_clk_init(unsigned long clk)
lookups[1].dev_id = "uart:1";
lookups[1].clk = &uart_clk;
+
+ lookups[2].dev_id = "uart:2";
+ lookups[2].clk = &uart_clk;
+
+ lookups[3].dev_id = "uart:3";
+ lookups[3].clk = &uart_clk;
}
void __init hi3520d_init(void)
@@ -351,6 +362,16 @@ void __init hi3520d_init(void)
edb_trace();
amba_device_register(amba_devs, &iomem_resource);
}
+ //////dfl uart 2 uart3///////
+ // writel(1, IO_ADDRESS(REG_BASE_IO));
+ // writel(0x, IO_ADDRESS(GPIO1_BASE+0x400));
+
+ writel(1, IO_ADDRESS(IOCONFIG_BASE+0x060));//// UART2_TXD
+ writel(1, IO_ADDRESS(IOCONFIG_BASE+0x05c)); //// UART2_RXD
+
+ writel(1, IO_ADDRESS(IOCONFIG_BASE+0x0b8));//// UART3_TXD
+ writel(1, IO_ADDRESS(IOCONFIG_BASE+0x0bc)); //// UART3_RXD
+ //////dfl uart 2 uart3///////
}
MACHINE_START(HI3520D, "hi3520d")
diff --git a/arch/arm/mach-hi3520d/include/mach/irqs.h b/arch/arm/mach-hi3520d/include/mach/irqs.h
index 5f0a484..2610e17 100644
--- a/arch/arm/mach-hi3520d/include/mach/irqs.h
+++ b/arch/arm/mach-hi3520d/include/mach/irqs.h
@@ -8,6 +8,8 @@
#define UART0_IRQ (HI3520D_IRQ_START + 8)
#define UART1_IRQ (HI3520D_IRQ_START + 9)
+#define UART2_IRQ (HI3520D_IRQ_START + 10)
+#define UART3_IRQ (HI3520D_IRQ_START + 11)
#define INTNR_L2CACHE_CHK0_INT (HI3520D_IRQ_START + 29)
#define INTNR_L2CACHE_CHK1_INT (HI3520D_IRQ_START + 30)
[/code]
我来回答
回答14个
时间排序
认可量排序
认可0
认可0
认可0
认可0
认可0
认可0
认可0
认可0
认可0
认可0
认可0
认可0
认可0
认可0
或将文件直接拖到这里
悬赏:
E币
网盘
* 网盘链接:
* 提取码:
悬赏:
E币
Markdown 语法
- 加粗**内容**
- 斜体*内容*
- 删除线~~内容~~
- 引用> 引用内容
- 代码`代码`
- 代码块```编程语言↵代码```
- 链接[链接标题](url)
- 无序列表- 内容
- 有序列表1. 内容
- 缩进内容
- 图片![alt](url)
相关问答
-
2015-04-01 19:01:44
-
2016-11-04 13:37:08
-
2019-10-08 14:43:03
-
2016-11-03 18:45:10
-
2009-06-25 15:59:35
-
2018-01-22 17:59:17
-
2013-11-13 15:58:21
-
2017-06-16 15:04:40
-
2017-09-18 14:25:54
-
2018-12-18 14:57:37
-
2020-02-19 17:36:55
-
2019-12-06 16:31:58
-
2018-12-25 16:53:53
-
2020-08-19 14:52:01
-
2020-10-10 19:20:24
-
2020-06-17 10:38:44
-
2018-12-27 10:28:27
-
2019-02-21 10:48:10
-
2014-03-11 08:14:35
无更多相似问答 去提问
点击登录
-- 积分
-- E币
提问
—
收益
—
被采纳
—
我要提问
切换马甲
上一页
下一页
悬赏问答
-
5Hi3516CV610 如何使用SD卡升级固件
-
5cat /dev/logmpp 报错 <3>[ vi] [func]:vi_send_frame_node [line]:99 [info]:vi pic queue is full!
-
50如何获取vpss chn的图像修改后发送至vo
-
5FPGA通过Bt1120传YUV422数据过来,vi接收不到数据——3516dv500
-
50SS928 运行PQtools 拼接 推到设备里有一半画面会异常
-
53536AV100的sample_vdec输出到CVBS显示
-
10海思板子mpp怎么在vi阶段改变视频数据尺寸
-
10HI3559AV100 多摄像头同步模式
-
9海思ss928单路摄像头vio中加入opencv处理并显示
-
10EB-RV1126-BC-191板子运行自己编码的程序
举报反馈
举报类型
- 内容涉黄/赌/毒
- 内容侵权/抄袭
- 政治相关
- 涉嫌广告
- 侮辱谩骂
- 其他
详细说明
提醒
你的问题还没有最佳答案,是否结题,结题后将扣除20%的悬赏金
取消
确认
提醒
你的问题还没有最佳答案,是否结题,结题后将根据回答情况扣除相应悬赏金(1回答=1E币)
取消
确认