Linux Driver Development for Embedded Processors, 2nd Edition.pdf

3星(超过75%的资源)
所需积分/C币:50 2019-08-23 16:32:06 8.74MB PDF
92
收藏 收藏
举报

Embedded systems have become an integral part of our daily life. They are deployed in mobile devices, networking infrastructure, home and consumer devices, digital signage, medical imaging, automotive infotainment and many other industrial applications. The use of embedded systems is growing exponentially. Today´s proccesors are made from silicon, which itself is fashioned from one of the most abundant materials on earth: sand. Processor technology has moved from 90nm fabrication in the year 2000 to 14nm today, and it is expected to shrink to 7nm or 5nm by 2021.
about the author Alberto Liberal is a Field Application Engineer at Arrow Electronics withover 15 years of experience in embedded systems. For the last few years at Arrow he has been supporting high-end processors and FPGAs. Alberto is a Linux fan and has presented numerous technical seminars and practical workshops about Embedded Linux and linux device drivers during the past few years. Albertos other fields of expertise include multimedia Socs and real-time operating systems (RTOS). He currently lives in Madrid, Spain, and his great passion is taking long walks with his daughter through the center of madrid. He also enjoys reading about cinema and watching sci-fi movies WOW! ebook www.wowebook.org WOW! ebook www.wowebook.org Table of contents Preface…13 Chapter 1: Building the System Bootloader 20 Linux Kernel 22 System Call Interface and C Runtime Library ∴25 System Shared Libraries 26 Root Filesystem 27 Linux Boot process 28 Building a Linux Embedded system .30 Setting up Ethernet Communication Building a Linux Embedded System for the NXP i. MX7D Processor.......32 Introduction 32 Host Packages… 33 Setting up the Repo Utility 33 Yocto Project Setup and Image Building 33 Working Outside of Yocto 36 Building the Linux Kernel 38 Installing a tftP server .41 Installing a NFS Server .42 Setting the U-Boot Environment Variables 42 Building a Linux Embedded System for the Microchip SAMA5D2 Processor 43 Introduction 43 Host Packages 44 Yocto Project Setup and Image Building 44 Working Outside of Yocto 46 Building the linux Kerne .47 Installing a tftP server .49 Installing a nfs server .49 Setting the U-Boot Environment Variables 50 [3] WOW! ebook www.wowebook.org Table of Contents Building a Linux Embedded System for the Broadcom BCM2837 Processor .50 Raspbian 50 Building the Linux Kernel 51 Copying Files to your Raspberry P 54 Working with Eclipse 55 Eclipse Configuration for Working with Kernel Sources 56 Eclipse Configuration for Developing Linux Drivers 67 Chapter 2: The Linux Device and Driver Model ∴73 Bus Core drivers∴ 74 Bus Controller drivers 76 Device drivers 77 Introduction to the device tree .78 Chapter 3: The Simplest Drivers 83 Licensing 84 LAB 3. 1: helloworld" Module .84 Listing 3-1: helloworld_imx.c 85 Listing 3-2: Makefile .86 helloworld imx ko demonstration ∴.86 LAB 3.2: helloworld with parameters"Module 87 Listing 3-3: helloworld_imx_with_parametersc 88 helloworld_imx_with_parameters. ko Demonstration 88 LAB 3.3: helloworld timing" Module 88 Listing3-4: helloworld_imx_with_timing.c…… .89 helloworld imx with timing. ko Demonstration 90 Chapter4: Character drivers…… 91 LAB 4.1: helloworld character" Module 93 Registration and Unregistration of Character Devices .94 Listing 4-1: helloworld imx char driver.c 98 Listing 4-2: Makefile 102 Listing 4-3: ioctl test. c 102 helloworld imx char driver ko demonstration .102 Add the module to the Kernel build 103 WOW! ebook www.wowebook.org Table of Contents Creating Device Files with devtmpfs 104 LAB 4.2: class character" Module .105 Listing 4-4: helloworld_imx_class_driver.c 107 helloworld imx class driver ko Demonstration .109 Miscellaneous character driver 109 Registering a Minor Number 110 LAB 43: miscellaneous character" module .111 Listing 4-5: misc_imx_driver.c .111 misc imx driver ko demonstration .113 Chapter5: Platform drivers.……,…,…………………115 LAB 5.1: " platform device"Module .117 Listing5-1: hellokeys_imx.c.…… 120 hellokeys_imx ko Demonstration .122 Documentation to interact with the hardware 123 Hardware Naming Convention .123 Pin controller,…… 124 Pin Control Subsystem 127 Device Tree Pin Controller Bindings 134 GPIO Controller driver 138 GPlO Descriptor Consumer Interface 140 Obtaining and Disposing GPIOs 141 Using GPlOs.… 141 GPIOs Mapped to IRQs 1413 GPIOs in device tree 1413 Exchanging data between Kernel and User space .144 MMIO(Memory-Mapped l/ O)Device Access .1445 LAB 5.2: "RGB LED platform device"Module 147 LAB 5.2 Hardware Description for the i. MX7D Processor 147 LAB 5.2 Hardware Description for the SAMA5D2 Processor 149 LAB 5.2 Hardware Description for the bcm2837 Processor 151 LAB 5.2 Device tree for the imX7D Processor 153 LAB 5.2 Device tree for the sama5d2 Processor 156 LAB 5.2 Device Tree for the bcm2837 Processor 159 LAB 5.2 Code Description of the " RGB LED platform device"Module 16 [5] WOW! ebook www.wowebook.org Table of Contents Listing 5-2: ledRGB_sam_platform.c 166 ledRGB_sam_platform. ko Demonstration 171 Platform driver resources 172 Linux led class 174 LaB 5.3: RGB LED class" Module .176 LAB 5.3 dt for the i. mX7D, SaMA5D2 and bcm2837 Processors .176 LAB 5.3 Code Description of the"RGB led class"Module .180 Listing 5-3: ledRGB_sam_class_platform.c .184 ledRGB_sam_class_platform. ko Demonstration 188 Platform Device Drivers in the User Space..........................188 User Defined 1/0: UIO 190 How Ulo Works .192 Kernel UIo aPl 193 LAB 5.4: " LED UIO platform"Module 195 LaB 5 4DT for the imX7D, sama5d2 and bcm2837 Processors 195 LAB 5.4 Code Description of the"LED UlO platform"Module 197 Listing 5-4: led_sam_Ulo_platform. c .199 Listing 5-5: UIO_app.c 201 led_sam_ UIo_platform. ko with Ulo_app demonstration .203 Chapter 6: 12C client Drivers …205 The Linux 12C Subsystem .206 Writing 12C Client Drivers .210 12C Client Driver Registration 210 Declaration of 12C devices in device Tree 212 LAB 6.1: 12C 10 expander device"Module .214 LAB 6.1 Hardware Description for the i. MX7D Processor .214 LAB 6.1 Hardware Description for the sAMA5D2 Processor .214 LAB 6.1 Hardware description for the bcm2837 Processor 216 LAB 6.1 Device tree for the imX7D Processor 216 LAB 6.1 Device tree for the sama5d2 processor 218 LAB 6.1 Device tree for the bcm2837 Processor 220 LAB 6. 1 Code Description of the 12C 1/0 expander device"Module...... 221 Listing 6-1: io imx expander. c .224 io_imx_expander. ko Demonstration .228 WOW! ebook www.wowebook.org Table of Contents The Sysfs filesystem 229 The Kobject Infrastructure 230 LAB 6.2: 12C multidisplay LED"Module 233 LAB 6.2 Hardware description for the i. MX7D Processor 235 LAB 6.2 Hardware Description for the sama5d2 Processor 235 LAB 6.2 Hardware Description for the bcm2837 Processor 235 LAB 6.2 Device Tree for the i. mX7D Processor 235 LAB 6.2 Device tree for the sama5d2 Processor 237 LAB 6.2 Device tree for the bcm2837 Processor 239 Unified Device Properties Interface for ACPi and Device Tree 240 LAB 6.2 Code Description of the 12c multidisplay LED"Module 242 Listing 6-2: Itc3206_imx_led_classc 246 Itc3206 imx led class. ko demonstration 254 Chapter 7: Handling Interrupts in Device Drivers 257 Linux Kernel irQ Domain for pLo controllers .260 Device Tree Interrupt Handling…… 268 Requesting Interrupts in Linux Device Drivers 272 LAB 7.1: button interrupt device"Module .274 LAB 7.1 Hardware Description for the i. MX7D Processor 274 LAB 7.1 Hardware Description for the sama5 d2 Processor 274 LAB 7.1 Hardware Description for the bcm2837 Processor 274 LAB 7. 1 Device Tree for the l mXd Processor 274 LAB 7. 1 Device Tree for the sama5d2 Processor 276 LAB 7. 1 Device Tree for the bcm2837 Processor 277 LAB 7.1 Code Description of the" button interrupt device"Module.......278 Listing 7-1: int_imx_key.c 280 int_imx_key. ko Demonstration .282 Deferred work 283 Softing 284 Tasklets 286 Timers 286 Threaded Interrupts 290 Workqueues 292 [7] WOW! ebook www.wowebook.org Table of Contents Locking in the Kernel 296 Locks and Uniprocessor Kernels 297 Sharing Spinlocks between Interrupt and Process Context 297 Locking in User Context 298 Sleeping in the Kernel 298 LAB 7.2: sleeping device"Module .300 LAB 7.2 Device Tree for the i. mX7D Processor 301 LAB 7.2 Device Tree for the sama5 d2 Processor .302 LAB 7.2 Device tree for the bcm2837 Processor .303 LAB 7.2 Code Description of the"sleeping device"Module .305 Listing 7-2: int_imx_key_wait.c 308 int_imx_ key_wait. ko Demonstration 312 Kernel threads 312 LAB 7.3: keyed class"Module 313 LAB 7.3 Hardware Description for the i. MX7D Processor 314 LAB 7.3 Hardware Description for the SAmA5D2 Processor 314 LAB 7. 3 Hardware description for the bcm2837 Processor 315 laB 7.3 Device tree for the imX7D Processor 316 LaB 7.3 Device Tree for the sama5 d2 Processor 319 LAB 73 Device tree for the bcm2837 Processor 322 LAB 7.3 Code Description of the "keyed class"Module 324 Listing 7-3: keyed imx class c .331 keyed_imx_class. ko Demonstration 343 Chapter 8: Allocating Memory with Linux Drivers 345 Walking ARM MMU Translation Tables 346 Linux Address Types∴ 353 User Process virtual to Physical Memory Mapping…………354 Kernel virtual to Physical Memory Mapping .355 Kernel Memory Allocators ..357 PAGE Allocator 357 Page Allocator AF|… 358 SLAB Allocator 358 SLAB Allocator aPi 361 Kmalloc allocator 362 [8] WOW! ebook www.wowebook.org

...展开详情
试读 127P Linux Driver Development for Embedded Processors, 2nd Edition.pdf
立即下载 身份认证VIP会员低至7折
一个资源只可评论一次,评论内容不能少于5个字
ZHUXIAOTIAN thinks your share .i like it.
2020-11-24
回复
smstong 有签名,书签不好用。
2020-04-27
回复
您会向同学/朋友/同事推荐我们的CSDN下载吗?
谢谢参与!您的真实评价是我们改进的动力~
上传资源赚钱or赚积分
最新推荐
Linux Driver Development for Embedded Processors, 2nd Edition.pdf 50积分/C币 立即下载
1/127
Linux Driver Development for Embedded Processors, 2nd Edition.pdf第1页
Linux Driver Development for Embedded Processors, 2nd Edition.pdf第2页
Linux Driver Development for Embedded Processors, 2nd Edition.pdf第3页
Linux Driver Development for Embedded Processors, 2nd Edition.pdf第4页
Linux Driver Development for Embedded Processors, 2nd Edition.pdf第5页
Linux Driver Development for Embedded Processors, 2nd Edition.pdf第6页
Linux Driver Development for Embedded Processors, 2nd Edition.pdf第7页
Linux Driver Development for Embedded Processors, 2nd Edition.pdf第8页
Linux Driver Development for Embedded Processors, 2nd Edition.pdf第9页
Linux Driver Development for Embedded Processors, 2nd Edition.pdf第10页
Linux Driver Development for Embedded Processors, 2nd Edition.pdf第11页
Linux Driver Development for Embedded Processors, 2nd Edition.pdf第12页
Linux Driver Development for Embedded Processors, 2nd Edition.pdf第13页
Linux Driver Development for Embedded Processors, 2nd Edition.pdf第14页
Linux Driver Development for Embedded Processors, 2nd Edition.pdf第15页
Linux Driver Development for Embedded Processors, 2nd Edition.pdf第16页
Linux Driver Development for Embedded Processors, 2nd Edition.pdf第17页
Linux Driver Development for Embedded Processors, 2nd Edition.pdf第18页
Linux Driver Development for Embedded Processors, 2nd Edition.pdf第19页
Linux Driver Development for Embedded Processors, 2nd Edition.pdf第20页

试读结束, 可继续阅读

50积分/C币 立即下载