SlideShare a Scribd company logo
1 of 13
© 2010-17 SysPlay Workshops <workshop@sysplay.in>
All Rights Reserved.
Serial Drivers
2© 2010-17 SysPlay Workshops <workshop@sysplay.in>
All Rights Reserved.
What to Expect?
Serial Prologue
UART
TTY Driver Use Case
TTY Serial Subsystem
Low Level Driver API
UART Data Structures
3© 2010-17 SysPlay Workshops <workshop@sysplay.in>
All Rights Reserved.
Serial Prologue
Typically known as RS232 protocol
But, it covers many more. Namely,
Infrared (back bone is RS232)
RS485 (industry enhanced RS232)
Serial Modem
Console
…
From Linux kernel's perspective
Serial Drivers provides a generic abstract view to the user
for all of these
4© 2010-17 SysPlay Workshops <workshop@sysplay.in>
All Rights Reserved.
UART
UART - Universal Asynchronous receiver
transmitter
Converts the parallel data from the CPU to serial
data to be transmitted on lines
Data Frame contains 5 to 9 data bits, start bit, 1
or more stop bits, an option parity bit
5© 2010-17 SysPlay Workshops <workshop@sysplay.in>
All Rights Reserved.
TTY Driver Use Case
Terminal
Physical
Line
UART
UART
Driver
Line
Discipline
TTY
Driver
User
Process
User
Process
User
Process
KernelHardware
Software
6© 2010-17 SysPlay Workshops <workshop@sysplay.in>
All Rights Reserved.
TTY Serial Subsystem
N_TTY
(n_tty.c)
N_IRDA
(irtty_sir.c)
TTY Core
(tty_io.c)
serial_core.c
usb-serial.c
(Core Module)
omap-serial.c
USB-Serial
Converter
Driver
User Applications (System Call Interface)
Line Discipline Layer
TTY Layer
Low-level Driver Layer
Physical Devices like Infrared, UART, USB-Serial Converter
7© 2010-17 SysPlay Workshops <workshop@sysplay.in>
All Rights Reserved.
Low-level (UART) Driver related Data
Structures & APIs
Data Structures
struct uart_driver
struct uart_port
struct uart_ops
APIs
int uart_register_driver(struct uart_driver *);
int uart_unregister_driver(struct uart_driver *);
int uart_add_one_port(struct uart_driver *, struct uart_port);
int uart_remove_one_port(struct uart_driver *, struct uart_port);
Typically implemented as a platform driver
Header: <linux/serial_core.h>
8© 2010-17 SysPlay Workshops <workshop@sysplay.in>
All Rights Reserved.
UART Driver structure
struct uart_driver
struct module *owner;
const char *driver_name; /* Name */
const char *dev_name; /* dev node names */
int major; /* Major number */
int minor; /* Minor number */
struct tty_driver *tty_driver; /* tty driver */
9© 2010-17 SysPlay Workshops <workshop@sysplay.in>
All Rights Reserved.
UART Port structure
struct uart_port
spinlock_t lock; /* lock */
unsigned int iobase; /* in/out[bwl] */
unsigned char __iomem *membase; /* I/O membase */
unsigned int irq; /* irq number */
unsigned int uartclk; /* base uart clock */
unsigned char fifosize; /* tx fifo size */
unsigned char x_char; /* flow control */
10© 2010-17 SysPlay Workshops <workshop@sysplay.in>
All Rights Reserved.
UART Operations structure
struct uart_ops
uint (*tx_empty)(struct uart_port *); /* Is TX FIFO empty? */
void (*set_mctrl)(struct uart_port *, unsigned int mctrl); /* Set
modem control params */
uint (*get_mctrl)(struct uart_port *); /* Get modem control params */
void (*stop_tx)(struct uart_port *); /* Stop xmission */
void (*start_tx)(struct uart_port *); /* Start xmission */
void (*shutdown)(struct uart_port *); /* Disable the port */
void (*set_termios)(struct uart_port *, struct termios *new, struct
termios *old); /* Terminal interface parameters */
void (*config_port) (struct uart_port *, int);
11© 2010-17 SysPlay Workshops <workshop@sysplay.in>
All Rights Reserved.
TTY Driver related Data Structures &
APIs
Header: <linux/tty.h>
Data Structures
struct tty_struct
struct tty_flip_buffer
struct tty_driver
APIs
int tty_register_driver(struct tty_driver *);
int tty_unregister_driver(struct tty_driver *);
struct device *tty_register_device(struct tty_driver *, unsigned,
struct device);
void tty_unregister_device(struct tty_driver *, unsigned);
12© 2010-17 SysPlay Workshops <workshop@sysplay.in>
All Rights Reserved.
What all have we learnt?
Serial Prologue
UART
TTY Driver Use Case
TTY Serial Subsystem
Low Level Driver API
UART Data Structures
13© 2010-17 SysPlay Workshops <workshop@sysplay.in>
All Rights Reserved.
Any Queries?

More Related Content

What's hot

LCU14 302- How to port OP-TEE to another platform
LCU14 302- How to port OP-TEE to another platformLCU14 302- How to port OP-TEE to another platform
LCU14 302- How to port OP-TEE to another platformLinaro
 
Reliability, Availability, and Serviceability (RAS) on ARM64 status - SFO17-203
Reliability, Availability, and Serviceability (RAS) on ARM64 status - SFO17-203Reliability, Availability, and Serviceability (RAS) on ARM64 status - SFO17-203
Reliability, Availability, and Serviceability (RAS) on ARM64 status - SFO17-203Linaro
 
Lcu14 107- op-tee on ar mv8
Lcu14 107- op-tee on ar mv8Lcu14 107- op-tee on ar mv8
Lcu14 107- op-tee on ar mv8Linaro
 
Embedded TCP/IP stack for FreeRTOS
Embedded TCP/IP stack for FreeRTOSEmbedded TCP/IP stack for FreeRTOS
Embedded TCP/IP stack for FreeRTOS艾鍗科技
 
Lcu14 306 - OP-TEE Future Enhancements
Lcu14 306 - OP-TEE Future EnhancementsLcu14 306 - OP-TEE Future Enhancements
Lcu14 306 - OP-TEE Future EnhancementsLinaro
 
Let's Play STM32
Let's Play STM32Let's Play STM32
Let's Play STM32Jay Chen
 
HKG15-311: OP-TEE for Beginners and Porting Review
HKG15-311: OP-TEE for Beginners and Porting ReviewHKG15-311: OP-TEE for Beginners and Porting Review
HKG15-311: OP-TEE for Beginners and Porting ReviewLinaro
 
建構嵌入式Linux系統於SD Card
建構嵌入式Linux系統於SD Card建構嵌入式Linux系統於SD Card
建構嵌入式Linux系統於SD Card艾鍗科技
 
Trusted firmware deep_dive_v1.0_
Trusted firmware deep_dive_v1.0_Trusted firmware deep_dive_v1.0_
Trusted firmware deep_dive_v1.0_Linaro
 
ARM Trusted FirmwareのBL31を単体で使う!
ARM Trusted FirmwareのBL31を単体で使う!ARM Trusted FirmwareのBL31を単体で使う!
ARM Trusted FirmwareのBL31を単体で使う!Mr. Vengineer
 
Linux PCI device driver
Linux PCI device driverLinux PCI device driver
Linux PCI device driver艾鍗科技
 
LAS16-111: Easing Access to ARM TrustZone – OP-TEE and Raspberry Pi 3
LAS16-111: Easing Access to ARM TrustZone – OP-TEE and Raspberry Pi 3LAS16-111: Easing Access to ARM TrustZone – OP-TEE and Raspberry Pi 3
LAS16-111: Easing Access to ARM TrustZone – OP-TEE and Raspberry Pi 3Linaro
 
LCU14 500 ARM Trusted Firmware
LCU14 500 ARM Trusted FirmwareLCU14 500 ARM Trusted Firmware
LCU14 500 ARM Trusted FirmwareLinaro
 
Ch9 v70 multiproject_en
Ch9 v70 multiproject_enCh9 v70 multiproject_en
Ch9 v70 multiproject_enconfidencial
 
Learn How to Develop Embedded System for ARM @ 2014.12.22 JuluOSDev
Learn How to Develop Embedded System for ARM @ 2014.12.22 JuluOSDevLearn How to Develop Embedded System for ARM @ 2014.12.22 JuluOSDev
Learn How to Develop Embedded System for ARM @ 2014.12.22 JuluOSDevJian-Hong Pan
 

What's hot (20)

I2C Drivers
I2C DriversI2C Drivers
I2C Drivers
 
Timers
TimersTimers
Timers
 
Embedded Applications
Embedded ApplicationsEmbedded Applications
Embedded Applications
 
Linux Porting
Linux PortingLinux Porting
Linux Porting
 
Spi drivers
Spi driversSpi drivers
Spi drivers
 
LCU14 302- How to port OP-TEE to another platform
LCU14 302- How to port OP-TEE to another platformLCU14 302- How to port OP-TEE to another platform
LCU14 302- How to port OP-TEE to another platform
 
Reliability, Availability, and Serviceability (RAS) on ARM64 status - SFO17-203
Reliability, Availability, and Serviceability (RAS) on ARM64 status - SFO17-203Reliability, Availability, and Serviceability (RAS) on ARM64 status - SFO17-203
Reliability, Availability, and Serviceability (RAS) on ARM64 status - SFO17-203
 
Lcu14 107- op-tee on ar mv8
Lcu14 107- op-tee on ar mv8Lcu14 107- op-tee on ar mv8
Lcu14 107- op-tee on ar mv8
 
Embedded TCP/IP stack for FreeRTOS
Embedded TCP/IP stack for FreeRTOSEmbedded TCP/IP stack for FreeRTOS
Embedded TCP/IP stack for FreeRTOS
 
Lcu14 306 - OP-TEE Future Enhancements
Lcu14 306 - OP-TEE Future EnhancementsLcu14 306 - OP-TEE Future Enhancements
Lcu14 306 - OP-TEE Future Enhancements
 
Let's Play STM32
Let's Play STM32Let's Play STM32
Let's Play STM32
 
HKG15-311: OP-TEE for Beginners and Porting Review
HKG15-311: OP-TEE for Beginners and Porting ReviewHKG15-311: OP-TEE for Beginners and Porting Review
HKG15-311: OP-TEE for Beginners and Porting Review
 
建構嵌入式Linux系統於SD Card
建構嵌入式Linux系統於SD Card建構嵌入式Linux系統於SD Card
建構嵌入式Linux系統於SD Card
 
Trusted firmware deep_dive_v1.0_
Trusted firmware deep_dive_v1.0_Trusted firmware deep_dive_v1.0_
Trusted firmware deep_dive_v1.0_
 
ARM Trusted FirmwareのBL31を単体で使う!
ARM Trusted FirmwareのBL31を単体で使う!ARM Trusted FirmwareのBL31を単体で使う!
ARM Trusted FirmwareのBL31を単体で使う!
 
Linux PCI device driver
Linux PCI device driverLinux PCI device driver
Linux PCI device driver
 
LAS16-111: Easing Access to ARM TrustZone – OP-TEE and Raspberry Pi 3
LAS16-111: Easing Access to ARM TrustZone – OP-TEE and Raspberry Pi 3LAS16-111: Easing Access to ARM TrustZone – OP-TEE and Raspberry Pi 3
LAS16-111: Easing Access to ARM TrustZone – OP-TEE and Raspberry Pi 3
 
LCU14 500 ARM Trusted Firmware
LCU14 500 ARM Trusted FirmwareLCU14 500 ARM Trusted Firmware
LCU14 500 ARM Trusted Firmware
 
Ch9 v70 multiproject_en
Ch9 v70 multiproject_enCh9 v70 multiproject_en
Ch9 v70 multiproject_en
 
Learn How to Develop Embedded System for ARM @ 2014.12.22 JuluOSDev
Learn How to Develop Embedded System for ARM @ 2014.12.22 JuluOSDevLearn How to Develop Embedded System for ARM @ 2014.12.22 JuluOSDev
Learn How to Develop Embedded System for ARM @ 2014.12.22 JuluOSDev
 

Viewers also liked (16)

Block Drivers
Block DriversBlock Drivers
Block Drivers
 
File System Modules
File System ModulesFile System Modules
File System Modules
 
PCI Drivers
PCI DriversPCI Drivers
PCI Drivers
 
Introduction to Linux Drivers
Introduction to Linux DriversIntroduction to Linux Drivers
Introduction to Linux Drivers
 
USB Drivers
USB DriversUSB Drivers
USB Drivers
 
References
ReferencesReferences
References
 
Embedded C
Embedded CEmbedded C
Embedded C
 
Kernel Debugging & Profiling
Kernel Debugging & ProfilingKernel Debugging & Profiling
Kernel Debugging & Profiling
 
Character Drivers
Character DriversCharacter Drivers
Character Drivers
 
Platform Drivers
Platform DriversPlatform Drivers
Platform Drivers
 
Kernel Programming
Kernel ProgrammingKernel Programming
Kernel Programming
 
Low-level Accesses
Low-level AccessesLow-level Accesses
Low-level Accesses
 
Video Drivers
Video DriversVideo Drivers
Video Drivers
 
BeagleBone Black Bootloaders
BeagleBone Black BootloadersBeagleBone Black Bootloaders
BeagleBone Black Bootloaders
 
BeagleBoard-xM Bootloaders
BeagleBoard-xM BootloadersBeagleBoard-xM Bootloaders
BeagleBoard-xM Bootloaders
 
File Systems
File SystemsFile Systems
File Systems
 

Similar to Serial Drivers

Id. 01 router (computing)
Id. 01 router (computing)Id. 01 router (computing)
Id. 01 router (computing)Rawa KirKuKi
 
Linux Serial Driver
Linux Serial DriverLinux Serial Driver
Linux Serial Driver艾鍗科技
 
etherlink plus developers guide
etherlink plus developers guideetherlink plus developers guide
etherlink plus developers guidepanamjayait
 
MICROCONTROLLER PROGRAMMING.pdf
MICROCONTROLLER PROGRAMMING.pdfMICROCONTROLLER PROGRAMMING.pdf
MICROCONTROLLER PROGRAMMING.pdfKarthiA15
 
Mastering Microcontroller : TIMERS, PWM, CAN, RTC,LOW POWER
Mastering Microcontroller : TIMERS, PWM, CAN, RTC,LOW POWERMastering Microcontroller : TIMERS, PWM, CAN, RTC,LOW POWER
Mastering Microcontroller : TIMERS, PWM, CAN, RTC,LOW POWERFastBit Embedded Brain Academy
 
BRKRST-3068 Troubleshooting Catalyst 2K and 3K.pdf
BRKRST-3068  Troubleshooting Catalyst 2K and 3K.pdfBRKRST-3068  Troubleshooting Catalyst 2K and 3K.pdf
BRKRST-3068 Troubleshooting Catalyst 2K and 3K.pdfssusercbaa33
 
Ch4 v70 system_configuration_en
Ch4 v70 system_configuration_enCh4 v70 system_configuration_en
Ch4 v70 system_configuration_enconfidencial
 
Ae01 system overview
Ae01 system overviewAe01 system overview
Ae01 system overviewconfidencial
 
CCNA (R & S) Module 03 - Routing & Switching Essentials - Chapter 1
CCNA (R & S) Module 03 - Routing & Switching Essentials - Chapter 1CCNA (R & S) Module 03 - Routing & Switching Essentials - Chapter 1
CCNA (R & S) Module 03 - Routing & Switching Essentials - Chapter 1Waqas Ahmed Nawaz
 
Detailed explanation of Basic router configuration
Detailed explanation of Basic router configurationDetailed explanation of Basic router configuration
Detailed explanation of Basic router configurationsamreenghauri786
 
selfridge_alec_chipspec
selfridge_alec_chipspecselfridge_alec_chipspec
selfridge_alec_chipspecAlec Selfridge
 
8251
82518251
8251Aisu
 
Krzysztof Mazepa - Netflow/cflow - ulubionym narzędziem operatorów SP
Krzysztof Mazepa - Netflow/cflow - ulubionym narzędziem operatorów SPKrzysztof Mazepa - Netflow/cflow - ulubionym narzędziem operatorów SP
Krzysztof Mazepa - Netflow/cflow - ulubionym narzędziem operatorów SPPROIDEA
 

Similar to Serial Drivers (20)

Id. 01 router (computing)
Id. 01 router (computing)Id. 01 router (computing)
Id. 01 router (computing)
 
Intel Quark HSUART
Intel Quark HSUARTIntel Quark HSUART
Intel Quark HSUART
 
Linux Serial Driver
Linux Serial DriverLinux Serial Driver
Linux Serial Driver
 
etherlink plus developers guide
etherlink plus developers guideetherlink plus developers guide
etherlink plus developers guide
 
MICROCONTROLLER PROGRAMMING.pdf
MICROCONTROLLER PROGRAMMING.pdfMICROCONTROLLER PROGRAMMING.pdf
MICROCONTROLLER PROGRAMMING.pdf
 
Mastering Microcontroller : TIMERS, PWM, CAN, RTC,LOW POWER
Mastering Microcontroller : TIMERS, PWM, CAN, RTC,LOW POWERMastering Microcontroller : TIMERS, PWM, CAN, RTC,LOW POWER
Mastering Microcontroller : TIMERS, PWM, CAN, RTC,LOW POWER
 
CCNA CHAPTER 5 BY jetarvind kumar madhukar
CCNA CHAPTER 5 BY jetarvind kumar madhukarCCNA CHAPTER 5 BY jetarvind kumar madhukar
CCNA CHAPTER 5 BY jetarvind kumar madhukar
 
BRKRST-3068 Troubleshooting Catalyst 2K and 3K.pdf
BRKRST-3068  Troubleshooting Catalyst 2K and 3K.pdfBRKRST-3068  Troubleshooting Catalyst 2K and 3K.pdf
BRKRST-3068 Troubleshooting Catalyst 2K and 3K.pdf
 
Ch4 v70 system_configuration_en
Ch4 v70 system_configuration_enCh4 v70 system_configuration_en
Ch4 v70 system_configuration_en
 
Uart
UartUart
Uart
 
Ae01 system overview
Ae01 system overviewAe01 system overview
Ae01 system overview
 
CCNA (R & S) Module 03 - Routing & Switching Essentials - Chapter 1
CCNA (R & S) Module 03 - Routing & Switching Essentials - Chapter 1CCNA (R & S) Module 03 - Routing & Switching Essentials - Chapter 1
CCNA (R & S) Module 03 - Routing & Switching Essentials - Chapter 1
 
Detailed explanation of Basic router configuration
Detailed explanation of Basic router configurationDetailed explanation of Basic router configuration
Detailed explanation of Basic router configuration
 
Rfc768
Rfc768Rfc768
Rfc768
 
Modbus.ppt
Modbus.pptModbus.ppt
Modbus.ppt
 
modbus.ppt
modbus.pptmodbus.ppt
modbus.ppt
 
selfridge_alec_chipspec
selfridge_alec_chipspecselfridge_alec_chipspec
selfridge_alec_chipspec
 
8251
82518251
8251
 
Alcatel vm
Alcatel vmAlcatel vm
Alcatel vm
 
Krzysztof Mazepa - Netflow/cflow - ulubionym narzędziem operatorów SP
Krzysztof Mazepa - Netflow/cflow - ulubionym narzędziem operatorów SPKrzysztof Mazepa - Netflow/cflow - ulubionym narzędziem operatorów SP
Krzysztof Mazepa - Netflow/cflow - ulubionym narzędziem operatorów SP
 

More from SysPlay eLearning Academy for You (12)

Linux Internals Part - 3
Linux Internals Part - 3Linux Internals Part - 3
Linux Internals Part - 3
 
Linux Internals Part - 2
Linux Internals Part - 2Linux Internals Part - 2
Linux Internals Part - 2
 
Linux Internals Part - 1
Linux Internals Part - 1Linux Internals Part - 1
Linux Internals Part - 1
 
Understanding the BBB
Understanding the BBBUnderstanding the BBB
Understanding the BBB
 
POSIX Threads
POSIX ThreadsPOSIX Threads
POSIX Threads
 
Cache Management
Cache ManagementCache Management
Cache Management
 
BeagleBone Black Bootloaders
BeagleBone Black BootloadersBeagleBone Black Bootloaders
BeagleBone Black Bootloaders
 
Introduction to BeagleBone Black
Introduction to BeagleBone BlackIntroduction to BeagleBone Black
Introduction to BeagleBone Black
 
Introduction to BeagleBoard-xM
Introduction to BeagleBoard-xMIntroduction to BeagleBoard-xM
Introduction to BeagleBoard-xM
 
BeagleBone Black Booting Process
BeagleBone Black Booting ProcessBeagleBone Black Booting Process
BeagleBone Black Booting Process
 
BeagleBoard-xM Booting Process
BeagleBoard-xM Booting ProcessBeagleBoard-xM Booting Process
BeagleBoard-xM Booting Process
 
Linux System
Linux SystemLinux System
Linux System
 

Recently uploaded

The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?XfilesPro
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 

Recently uploaded (20)

The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 

Serial Drivers

  • 1. © 2010-17 SysPlay Workshops <workshop@sysplay.in> All Rights Reserved. Serial Drivers
  • 2. 2© 2010-17 SysPlay Workshops <workshop@sysplay.in> All Rights Reserved. What to Expect? Serial Prologue UART TTY Driver Use Case TTY Serial Subsystem Low Level Driver API UART Data Structures
  • 3. 3© 2010-17 SysPlay Workshops <workshop@sysplay.in> All Rights Reserved. Serial Prologue Typically known as RS232 protocol But, it covers many more. Namely, Infrared (back bone is RS232) RS485 (industry enhanced RS232) Serial Modem Console … From Linux kernel's perspective Serial Drivers provides a generic abstract view to the user for all of these
  • 4. 4© 2010-17 SysPlay Workshops <workshop@sysplay.in> All Rights Reserved. UART UART - Universal Asynchronous receiver transmitter Converts the parallel data from the CPU to serial data to be transmitted on lines Data Frame contains 5 to 9 data bits, start bit, 1 or more stop bits, an option parity bit
  • 5. 5© 2010-17 SysPlay Workshops <workshop@sysplay.in> All Rights Reserved. TTY Driver Use Case Terminal Physical Line UART UART Driver Line Discipline TTY Driver User Process User Process User Process KernelHardware Software
  • 6. 6© 2010-17 SysPlay Workshops <workshop@sysplay.in> All Rights Reserved. TTY Serial Subsystem N_TTY (n_tty.c) N_IRDA (irtty_sir.c) TTY Core (tty_io.c) serial_core.c usb-serial.c (Core Module) omap-serial.c USB-Serial Converter Driver User Applications (System Call Interface) Line Discipline Layer TTY Layer Low-level Driver Layer Physical Devices like Infrared, UART, USB-Serial Converter
  • 7. 7© 2010-17 SysPlay Workshops <workshop@sysplay.in> All Rights Reserved. Low-level (UART) Driver related Data Structures & APIs Data Structures struct uart_driver struct uart_port struct uart_ops APIs int uart_register_driver(struct uart_driver *); int uart_unregister_driver(struct uart_driver *); int uart_add_one_port(struct uart_driver *, struct uart_port); int uart_remove_one_port(struct uart_driver *, struct uart_port); Typically implemented as a platform driver Header: <linux/serial_core.h>
  • 8. 8© 2010-17 SysPlay Workshops <workshop@sysplay.in> All Rights Reserved. UART Driver structure struct uart_driver struct module *owner; const char *driver_name; /* Name */ const char *dev_name; /* dev node names */ int major; /* Major number */ int minor; /* Minor number */ struct tty_driver *tty_driver; /* tty driver */
  • 9. 9© 2010-17 SysPlay Workshops <workshop@sysplay.in> All Rights Reserved. UART Port structure struct uart_port spinlock_t lock; /* lock */ unsigned int iobase; /* in/out[bwl] */ unsigned char __iomem *membase; /* I/O membase */ unsigned int irq; /* irq number */ unsigned int uartclk; /* base uart clock */ unsigned char fifosize; /* tx fifo size */ unsigned char x_char; /* flow control */
  • 10. 10© 2010-17 SysPlay Workshops <workshop@sysplay.in> All Rights Reserved. UART Operations structure struct uart_ops uint (*tx_empty)(struct uart_port *); /* Is TX FIFO empty? */ void (*set_mctrl)(struct uart_port *, unsigned int mctrl); /* Set modem control params */ uint (*get_mctrl)(struct uart_port *); /* Get modem control params */ void (*stop_tx)(struct uart_port *); /* Stop xmission */ void (*start_tx)(struct uart_port *); /* Start xmission */ void (*shutdown)(struct uart_port *); /* Disable the port */ void (*set_termios)(struct uart_port *, struct termios *new, struct termios *old); /* Terminal interface parameters */ void (*config_port) (struct uart_port *, int);
  • 11. 11© 2010-17 SysPlay Workshops <workshop@sysplay.in> All Rights Reserved. TTY Driver related Data Structures & APIs Header: <linux/tty.h> Data Structures struct tty_struct struct tty_flip_buffer struct tty_driver APIs int tty_register_driver(struct tty_driver *); int tty_unregister_driver(struct tty_driver *); struct device *tty_register_device(struct tty_driver *, unsigned, struct device); void tty_unregister_device(struct tty_driver *, unsigned);
  • 12. 12© 2010-17 SysPlay Workshops <workshop@sysplay.in> All Rights Reserved. What all have we learnt? Serial Prologue UART TTY Driver Use Case TTY Serial Subsystem Low Level Driver API UART Data Structures
  • 13. 13© 2010-17 SysPlay Workshops <workshop@sysplay.in> All Rights Reserved. Any Queries?