Mapping from physical address to kernel virtual address—Analyze the driver of the LCD controller that comes with the 9261 chip on the AT91SAM9261EK board
This paper analyzes the LCD controller that comes with the 9261 chip on the AT91SAM9261EK board. How the mapping from the physical address to the kernel virtual address is implemented in the driver. When the system executes atmel_lcdfb_init() in /drivers/video/atmel_lcdfb.c, the platform_driver_probe(&atmel_lcdfb_driver, atmel_lcdfb_probe) function is called, first searching for the system registered device based on the name "atmel_lcdfb" in atmel_lcdfb_driver() Is there any platform_device, if there is this device, the driver of the device is registered with the system. Static struct platform_driver atmel_lcdfb_driver = {.remove =__exit_p(atmel_lcdfb_remove),.driver = {.name ="atmel_lcdfb",.owner = THIS_MODULE,},}; since in /arch/arm/mach-at91/at91sam9261_devices.c The following platform_device at91_lcdc_device, static struct platform_device at91_lcdc_device = {.name ="atmel_lcdfb",.id = 0,.dev = {.dma_mask = &lcdc_dmamask,.coherent_dma_mask = 0xffffffff,.platform_data = &lcdc_data,}, .resource = lcdc_resources,.num_resources =ARRAY_SIZE(lcdc_resources),}; its name is also "atmel_lcdfb", and the device has been registered with the system in the at91_add_device_lcdc() function, so when executing the map in the atmel_lcdfb_probe() function = platform_get_resource(pdev, IORESOURCE_MEM, 1), you can get the lcdc_resources parameter defined below, where AT91SAM9261_LCDC_BASE is the starting address of the LCD User Interface 0x600000, which is the physical address; AT91SAM9261_LCDC_BASE + SZ_4K-1 is the end address. Static struct resource lcdc_resources[] = {[0] = {.start =AT91SAM9261_LCDC_BASE,.end =AT91SAM9261_LCDC_BASE + SZ_4K - 1,.flags =IORESOURCE_MEM,},[1] = {.start = AT91SAM9261_ID_LCDC,.end =AT91SAM9261_ID_LCDC,. Flags=IORESOURCE_IRQ,},#if defined(CONFIG_FB_INTSRAM)[2] = {.start =AT91SAM9261_SRAM_BASE,.end =AT91SAM9261_SRAM_BASE + AT91SAM9261_SRAM_SIZE - 1,.flags =IORESOURCE_MEM,},#endif}; Then implement it from the ioremap() function The mapping of the physical address to the kernel virtual address, ie sinfo->mmio=ioremap(info->fix.mmio_start, info->fix.mmio_len); where info->fix.mmio_start = regs-> Start (ie AT91SAM9261_LCDC_BASE); info->fix.mmio_len = regs->end (ie AT91SAM9261_LCDC_BASE + SZ_4K - 1)- regs->start + 1;
Currently, a very serious Bash vulnerability has been exposed on the Internet. It
Controlling access to files under Linux is a very important issue. Chmod is a method for modifying f
Think about it, what if you want to change the size of an image to a smaller size? Of course, I will
In Windows, Sogou Pinyin input method has a large number of users because of its large vocabulary an
Rm delete the file or directory at the beginning of the dash
About the start of the embedded system (SHARE FOR ALL)
Windows 7 and Fedora dual system installation method
Linux RAC OCFS file system and INODES
Redis Installation and Configuration Tutorial
Shell automatic interaction method
Solaris restart syslog configure separate authentication log
Several ways to run linux process background
Linux installation ImageMagick and JMagick complete process and configuration tutorial
Win8.1 App Store ushers in Performance Optimization Patch
Win7 system can not open the solution to the zero-hanging assistance problem
IE10 Flash plugin cannot be used under Win8 system
How to deal with the monitor after WinXP starts?
Can't find the solution of network adapter in win10 system device manager
How to display the specific time and the number of weeks in the win7 computer taskbar
How does Win10 system input method become Win7