开机的log中打印下面的log,那怎么根据这个log找到对应的驱动呢?
00:01: ttyS0 at MMIO 0x3f00002f8 (irq = 15, base_baud = 115200) is a 16550A
这段对应的源码如下:
static inline void
uart_report_port(struct uart_driver *drv, struct uart_port *port)
{
char address[64];
switch (port->iotype) {
case UPIO_PORT:
snprintf(address, sizeof(address), "I/O 0x%lx", port->iobase);
break;
case UPIO_HUB6:
snprintf(address, sizeof(address),
"I/O 0x%lx offset 0x%x", port->iobase, port->hub6);
break;
case UPIO_MEM:
case UPIO_MEM16:
case UPIO_MEM32:
case UPIO_MEM32BE:
case UPIO_AU:
case UPIO_TSI:
snprintf(address, sizeof(address),
"MMIO 0x%llx", (unsigned long long)port->mapbase);
break;
default:
strlcpy(address, "*unknown*", sizeof(address));
break;
}
#可以知道这里的00:01 对应的是dev_name
pr_info("%s%s%s at %s (irq = %d, base_baud = %d) is a %s\n",
port->dev ? dev_name(port->dev) : "",
port->dev ? ": " : "",
port->name,
address, port->irq, port->uartclk / 16, uart_type(port));
}
那么我们在/sys/devices 中找到对应的devname 如下:
[root@localhost ~]# cat /sys/devices/pnp0/
00:00/ 00:01/ power/ uevent
[root@localhost 00:01]# ls
driver firmware_node id options power resources subsystem tty uevent
[root@localhost 00:01]# cat resources
state = active
mem 0x3f00002f8-0x3f00002ff
irq 15
在结合makefile可以知道用的驱动是8250_pnp.c
根据dev_name 找到对应的驱动文件
猜你喜欢
转载自blog.csdn.net/tiantao2012/article/details/105208570
今日推荐
周排行