what are mapbase and membase members of UART 8250 port structure?

ぃ、小莉子 提交于 2019-12-12 02:23:15

问题


I am trying to understand the 8250 serial port on pci express bus of our board by going through the driver code and I am having hard time understanding the below two members of struct uart_8250_port

struct uart_8250_port x;
memset(&x, 0, sizeof(x));
....
....
x.port.regshift = 0;
x.port.iotype = UPIO_MEM;
x.port.flags = UPF_SHARE_IRQ | UPF_LOW_LATENCY;
x.port.membase = raw_address;
x.port.mapbase = ioremap(raw_address);

What are the members membase and mapbase? Also, why does membase take physical pci bar address whereas mapbase takes address returned from ioremap ?


回答1:


mapbase is basically a bus address of the port register space in the question. membase is the same address in CPU virtual address space for memory mapped IO (MMIO) and iobase is the similar for IO.

Yes, you may already notice that in your example you have a mistake, i.e. membase and mapbase should be exchanged.

mapbase address is needed to do, for example, DMA operations on top of UART hardware since DMA operates with bus addresses.



来源:https://stackoverflow.com/questions/38602052/what-are-mapbase-and-membase-members-of-uart-8250-port-structure

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!