ARM-Linux s3c2440 UART Analysis (Part 4)

Publisher:GoldenDreamLatest update time:2016-06-12 Source: eefocusKeywords:ARM  Linux  s3c2440  UART Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
After registration is complete, how are the device and driver connected? It turns out that the device connection has been made during driver_register() registration.

The serial port is a platform device. The device registration is completed in the system framework setup_arch(), and the device registration precedes the driver registration. Finally, the connection between the serial port device and the driver is completed in driver_register() --> bus_add_driver().


 

  1. int bus_add_driver(struct device_driver *drv)  
  2. {  
  3.        enter;  
  4.        structdevice_driver *other;  
  5.    
  6.        …  
  7.    
  8.        if(drv->bus->p->drivers_autoprobe) { //platfrom_but_type == 1 automatically detects platfrom device  
  9.               error= driver_attach(drv);  
  10.               if(error)  
  11.                      goto out_unregister;  
  12.        }  
  13.               ….  
  14. }  

 

Finally, driver_attach()-->bus_for_each_dev() completes the connection between the serial port device and the driver

 

  1. int bus_for_each_dev(struct bus_type *bus,struct device *start,  
  2.                    void *data, int (*fn)(struct device *,void *))  
  3. {  
  4.        structklist_iter i;  
  5.        structdevice *dev;  
  6.        interror = 0;  
  7.    
  8.        if(!bus)  
  9.               return-SINGLE SELECT;  
  10.    
  11.        klist_iter_init_node(&bus->p->klist_devices,&i,  
  12.                           (start ? &start->p->knode_bus :NULL));  
  13.        while((dev = next_device(&i)) && !error) //Traverse all corresponding devices  
  14.               error= fn(dev, data);  
  15.        klist_iter_exit(&i);  
  16.        return error;  
  17. }  

 


Keywords:ARM  Linux  s3c2440  UART Reference address:ARM-Linux s3c2440 UART Analysis (Part 4)

Previous article:ARM-Linux s3c2440 UART Analysis (V)
Next article:ARM-Linux s3c2440 UART Analysis (Part 3)

Recommended ReadingLatest update time:2024-11-16 15:28

S3C2440-SDRAM connection analysis
A relatively detailed analysis of the connections between S3C2440 and SDRAM, Nandflash, and Norflash. Analysis of the address connection between S3C2440 and SDRAM S3C2440 has 27 address lines ADDR and 8 chip select signals ngcs0-ngcs7, corresponding to bank0-bank7. When accessing the address space of bankx, the
[Microcontroller]
S3C2440-SDRAM connection analysis
S3C2440 interrupt control register
1. SUBSRCPND register (SUB SOURCE PENDING) The SUBSRCPND register is used to identify whether interrupts such as INT_RXD0, INT_TXD0 (there are 11 such interrupts in S3C2410 and 15 in S3C2440) have occurred, and each bit corresponds to an interrupt. When these interrupts occur and are not masked by the INTSUBMSK regist
[Microcontroller]
S3C2440 interrupt control register
Talk about the use of ARM NEON SIMD architecture extensions in Zynq SoC
Inside all Zynq All Programmable SoCs, you'll find a dual-core ARM Cortex-A9 MPCore processor, and both processors in the Zynq SoC feature the ARM NEON SIMD architecture extensions. So why would you want to use the ARM NEON SIMD extensions? Because you can get a significant performance boost for your software. You may
[Microcontroller]
Talk about the use of ARM NEON SIMD architecture extensions in Zynq SoC
ARM startup and working mode switching
In the ARM system, there are usually three ways to control the execution flow of the program: During normal program execution, the value of the program counter register (PC) increases by 4 bytes for each ARM instruction executed; the value of the program counter register (PC) increases by 2 bytes for each Thumb inst
[Microcontroller]
ARM startup and working mode switching
ARM LCD and LCD controller
Since we mentioned LCD, the first thing we must understand is its types. CD (liquid crystal display) is a display that uses liquid crystal to control transmittance counting to achieve color. Compared with traditional CRT displays, it has many advantages: light and thin, low energy consumption, low radiation, etc., and
[Microcontroller]
ARM LCD and LCD controller
【ARM】s3c2440 gpio button control
Function Through GPIO, key 1 lights up LED 1, key 2 lights up LED 2... illustrate 1) Because the 2440 keys only involve rows, scanning keys is much simpler than the 2410 2) Before performing a shift operation, the data register must be initialized, otherwise an error will occur (hardware characteristics) Source
[Microcontroller]
Design of multifunctional integrated communication control system based on ARM9
    With the rapid development of computer technology, industrial data acquisition has evolved from traditional measurement and control circuits to modern data acquisition and control systems consisting of microcomputers, interface circuits, external general equipment, and industrial production objects. However, data a
[Microcontroller]
Design of multifunctional integrated communication control system based on ARM9
Learn ARM development(14)
Since it is still troublesome to develop under LINUX, is there a more convenient and simple development method under WINDOWS? The answer is yes. Of course, we cannot choose a development tool like ADS, because it is too expensive. Even if we use pirated software, we will not feel at ease, so we have to adopt other s
[Microcontroller]
Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号