HI3559AV100串口中断不够的解决方案---共享中断

这篇博客讨论了在Linux内核中,针对HI3559AV100平台的PL011 UART驱动,如何实现shub_uart5和shub_uart6的中断共享模式。在代码中可以看到,对于特定的UART线路,如6、7、10和11,它们使用了IRQF_SHARED标志,与其他UART共用中断号,从而节省资源并简化中断处理逻辑。
摘要由CSDN通过智能技术生成

shub_uart5, shub_uart6逻辑设计时没有独立的中断上报到soc测,是和shub_uart1,shub_uart2共用中断号的,采用共享中断模式:

diff --git a/drivers/tty/serial/amba-pl011.c b/drivers/tty/serial/amba-pl011.c
index e242371..68b27c5 100644
--- a/drivers/tty/serial/amba-pl011.c
+++ b/drivers/tty/serial/amba-pl011.c
@@ -1726,8 +1726,17 @@ static void pl011_write_lcr_h(struct uart_amba_port *uap, unsigned int lcr_h)
static int pl011_allocate_irq(struct uart_amba_port *uap)
{
    pl011_write(uap->im, uap, REG_IMSC);
#ifdef CONFIG_ARCH_HI3559AV100
    if((uap->port.line == 6) || (uap->port.line == 7) || (uap->port.line == 10) || (uap->port.line == 11))
    	return request_irq(uap->port.irq, pl011_int, IRQF_SHARED, "uart-pl011", uap);
    else
     	return request_irq(uap->port.irq, pl011_int, 0, "uart-pl011", uap);
#else
    return request_irq(uap->port.irq, pl011_int, 0, "uart-pl011", uap);
#endif                                                                
}

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值