a complete Linux driver consists mainly of internal processing and interaction with hardware. The internal processing mainly refers to the Linux driver loading, unloading, and device file-related action processing (read and write device files, send I/O commands to the device file), as well as business logic. The interaction with hardware is mainly through the functions of iowrite32, IOREAD32, etc., and the registers in the hardware.
In the experiment of controlling led flicker of LEDs, the realization principle of LED driver is clearly understood: The Linux driver uses the IOWRITE32 function to write data to I/O memory first, and I/O memory interacts with the hardware device through the memory management module. The Linux driver then uses the IOREAD32 function to read the data to I/O memory again, enabling the flashing of the Linux drive control LEDs.
Also, in this section I learned that when Linux drivers are applied to different platforms, The transplant method is generally divided into two parts: 1. If the migration between different Linux kernel versions is primarily for Linux-driven internal processing, 2. If you migrate on different hardware platforms, you typically interact with the registers in the hardware by using functions such as IOWRITE32, IOREAD32, and so on.
on the LED flicker experiment, let me have a very deep understanding of the Linux driver, just lack of practical exercise, there is time I must be in the book of the experiment to implement, uncover the true veil of Linux driver!
Android Deep Explore.