本文主要是介绍hi3536使用single模式,在主CPU上启用uart2和uart3的内核修改方法!,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
在海思hi3536使用single模式,主CPU上启用UART2和UART3
使用单CPU模式下,在主CPU内中启用uart2和uart3,‘+’部分为新增内容
1、kernel/linux-3.10.y/arch/arm/mach-hi3536/core.c
HIL_AMBA_DEVICE(uart0, "uart:0", UART0, NULL);
HIL_AMBA_DEVICE(uart1, "uart:1", UART1, NULL);
+ HIL_AMBA_DEVICE(uart2, "uart:2", UART2, NULL);
+ HIL_AMBA_DEVICE(uart3, "uart:3", UART3, NULL);
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_lookup lookups[] = {
{
/* UART0 */
.dev_id = "uart:0",
.clk = &uart_clk,
},
{
/* UART1 */
.dev_id = "uart:1",
.clk = &uart_clk,
},
+ /新增
{
/* UART2 */
.dev_id = "uart:2",
.clk = &uart_clk,
},
{
/* UART3 */
.dev_id = "uart:3",
.clk = &uart_clk,
},
/
{ /* SP804 timers */
.dev_id = "sp804",
.clk = &sp804_clk,
},
kernel/linux-3.10.y/arch/arm/mach-hi3536/include/mach/platform.h
#define REG_BASE_UART0 0x12080000
#define REG_BASE_UART1 0x12090000
+ #define REG_BASE_UART2 0x120A0000
+ #define REG_BASE_UART3 0x120B0000
kernel/linux-3.10.y/include/linux/amba/bus.h
- #define AMBA_NR_IRQS 2
+ #define AMBA_NR_IRQS 4
#define AMBA_CID 0xb105f00d
struct clk;
struct amba_device {
struct device dev;
struct resource res;
struct clk *pclk;
u64 dma_mask;
unsigned int periphid;
unsigned int irq[AMBA_NR_IRQS];
};
转:http://bbs.ebaina.com/forum.php?mod=viewthread&tid=23671&highlight=UART2
在启动脚本/etc/init.d/S00devs中修改
#!/bin/sh
mknod /dev/console c 5 1
mknod /dev/ttyAMA0 c 204 64
mknod /dev/ttyAMA1 c 204 65
+mknod /dev/ttyAMA2 c 204 66
+mknod /dev/ttyAMA3 c 204 67
mknod /dev/ttyS000 c 204 64
mknod /dev/null c 1 3
注:之前忘记内核修改过其他部分,导致这部分修改后系统总是崩溃,要做记录,要做记录,要做记录重要的事说三遍。
这篇关于hi3536使用single模式,在主CPU上启用uart2和uart3的内核修改方法!的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!