Linux Add-In: User Guide
Total Page:16
File Type:pdf, Size:1020Kb
Linux Add-in: User Guide Linux Add-in: User Guide © 2019 Analog Devices, Inc. Version 1.3.1, May 2019 http://www.analog.com Contents 1 Introduction 8 2 Quick Start Guide 9 2.1 Feature list for Linux on sc5xx boards 9 2.2 SC5xx EZ-Kit Linux Quick Start Guide 12 2.2.1 Introduction 12 2.2.2 Environment set up 13 2.2.3 Flashing U-Boot for the First Time 17 2.2.4 Booting Linux Overview 20 2.2.5 Boot method 1: Copying the Linux image across the network 21 2.2.6 Boot method 2: Booting flashed Linux with persistent file system on SD Card 29 2.2.7 Boot Method 3: Booting the kernel from the SD Card (Quicker Boot) 33 2.2.8 Troubleshooting 34 2.3 Configure and build from source code 35 2.3.1 Introduction 35 2.3.2 Extract the source code 35 2.3.3 Configure and build u-boot 36 2.3.4 Configure and build Buildroot and Linux kernel 37 2.3.5 Customize the Buildroot and Linux kernel 37 2.3.6 Generate Kernel Image for Booting From Non-Volatile Storage 39 2.3.7 More tips about buildroot 39 2.4 SC589-MINI Linux Quick Start Guide 40 2.4.1 Introduction 40 2.4.2 Set up the Board and Console output 42 2.4.3 Booting the board Out of the Box 44 2.4.4 Recovering the board 50 2.4.5 Configuring and Building Source Code 56 2.4.6 Board Component Descriptions 56 3 Das U-boot 62 3.1 Ethernet Driver in U-Boot on SC5xx-EZKIT 62 3.1.1 Overview 62 3.1.2 Hardware Setup 62 3.1.3 Build U-Boot with emac0 or emac1 62 3.1.4 Using EMAC Driver 62 3.2 Creating and Booting Linux Using the New U-Boot "fitImage" 64 3.2.1 Introduction 64 3.2.2 Hardware Setup 64 3.2.3 Builroot and kernel Configuration 64 3.2.4 U-Boot Configuration 65 3.2.5 Create fitImage device tree 66 3.2.6 Boot Linux 69 3.3 Loading file from USB storage in u-boot 71 3.3.1 Overview 71 3.3.2 Hardware Setup 71 3.3.3 Test method 72 3.4 Mobile Storage Interface (MSI) 78 3.4.1 Overview 78 3.4.2 Hardware Setup 78 3.4.3 Software Configuration 79 3.4.4 Build and Load Uboot 79 3.4.5 Usage of MSI Driver 80 4 Linux buildroot distribution and applications 81 4.1 Bluetooth and headset audio example 81 4.1.1 Introduction 81 4.1.2 Hardware setup 81 4.1.3 Software configuration 82 4.1.4 Run headset audio example 83 4.2 Build application outside the buildroot framework 84 4.2.1 Introduction 84 4.2.2 Build Application outside Buildroot Framework 85 4.3 OProfile for performance benchmark 85 4.3.1 Introduction 85 4.3.2 Hardware Setup 86 4.3.3 Software Configuration 86 4.3.4 Simple OProfile usage 87 4.3.5 Examples 88 4.4 FTP Server (ftpd) 91 4.4.1 Introduction 91 4.4.2 Operation 91 4.5 Touchscreen Library 92 4.5.1 Introduction 93 4.5.2 Hardware Setup 93 4.5.3 Software Configuration 93 4.5.4 Example 94 4.6 MPlayer 98 4.6.1 Hardware Setup 98 4.6.2 Software Configuration 99 4.6.3 Build and Load Buildroot 100 4.6.4 Run MPlayer 100 4.7 IEEE 1588 and Linux PTP 101 4.7.1 PTP Introduction 101 4.7.2 PTP Configuration 102 4.7.3 Build 103 4.7.4 Example 103 4.7.5 More information 105 4.8 QT example for GUI 106 4.8.1 Introduction 106 4.8.2 Hardware Setup 106 4.8.3 Software Configuration 106 4.8.4 Build and Load Buildroot 109 4.8.5 Example 109 4.9 SQLite example for database 111 4.9.1 Introduction 111 4.9.2 Build and Load Buildroot 111 4.9.3 Run SQLite 112 4.10 Watchdog 112 4.10.1 Introduction 112 4.10.2 Software Configuration 113 4.10.3 Build and Load Buildroot 114 4.10.4 Test 114 5 Linux kernel and drivers 118 5.1 CAN Bus Data Transaction 118 5.1.1 Introduction 118 5.1.2 Hardware Setup 118 5.1.3 Software Configuration 118 5.1.4 Test Example 119 5.2 CPU Frequency utility 120 5.2.1 Introduction 120 5.2.2 Hardware Setup 120 5.2.3 Enabling CPU Frequency Driver in Linux Kernel 121 5.2.4 How to Change the CPU cpufreq 121 5.2.5 Change Core Clock Frequency via cpufreq-utils 124 5.3 CRC Crypto Driver Guide 125 5.3.1 Introduction 125 5.3.2 Hardware Setup 125 5.3.3 Software Configuration 126 5.3.4 Example 126 5.3.5 Linux Kernel Crypto API 127 5.4 Ethernet driver and performance 127 5.4.1 Introduction 127 5.4.2 Hardware Requirement 127 5.4.3 Software Configuration 127 5.4.4 Performance Benchmark Example 130 5.5 Linux LCD device driver 131 5.5.1 Introduction 131 5.5.2 Hardware Setup 131 5.5.3 Software Configuration 132 5.5.4 Example 133 5.6 Linux Sound Driver 134 5.6.1 Introduction 134 5.6.2 Hardware Setup 134 5.6.3 Software Configuration 135 5.6.4 Example 137 5.7 GPIO operation 142 5.7.1 Introduction 142 5.7.2 Hardware 142 5.7.3 Application space GPIO support 143 5.7.4 Paths in Sysfs 143 5.7.5 Dump the GPIO configuration 145 5.8 I2C Bus 145 5.8.1 Introduction 145 5.8.2 I2C in the Linux Kernel 146 5.8.3 I2C in User Space 148 5.9 Link Port driver 150 5.9.1 Introduction 150 5.9.2 Hardware Setup 150 5.9.3 Software configuration 151 5.9.4 Test Example 152 5.10 USB interface 152 5.10.1 Introduction 152 5.10.2 Hardware Setup 153 5.10.3 USB HOST Example 153 5.10.4 USB Device Example 155 5.10.5 USB OTG Example 158 5.11 General Bluetooth Dongle via USB 158 5.11.1 Introduction 158 5.11.2 Hardware Setup 159 5.11.3 Software Configuration 159 5.11.4 Example 160 5.12 Kernel API for DMA operation 163 5.12.1 Introduction 163 5.12.2 Linux DMA Framework 163 5.13 Linux MTD Driver 169 5.13.1 Introduction 169 5.13.2 Hardware Required 169 5.13.3 Software Configuration 170 5.13.4 Example 172 5.14 Linux PCIE device driver 173 5.14.1 Introduction 173 5.14.2 Hardware Setup 173 5.14.3 Software Configuration 173 5.14.4 Example 175 5.15 Linux Video Driver 176 5.15.1 Introduction 176 5.15.2 Hardware Required 176 5.15.3 Software Configuration 180 5.15.4 Example 185 5.16 Rotary driver 189 5.16.1 Introduction 189 5.16.2 Hardware Setup 189 5.16.3 Software Configuration 189 5.16.4 Example 193 5.17 SPI Driver 194 5.17.1 Introduction 194 5.17.2 Hardware Setup 196 5.17.3 Software Configuration 196 5.17.4 Example 199 5.18 Mobile Storage Interface for MMC/SD 199 5.18.1 Hardware Setup 199 5.18.2 Software Configuration 200 5.18.3 Build and Load Buildroot 201 5.18.4 Usage of MSI 202 5.19 Real Time Clock on ADSP-SC58x 205 5.19.1 Introduction 205 5.19.2 Hardware Required 205 5.19.3 Software Configuration 205 5.19.4 Build and Load Buildroot 206 5.19.5 Example 206 5.20 User manual for uart hardware flow control in linux kernel 207 5.20.1 Introduction 207 5.20.2 Hardware Setup 207 5.20.3 Software Configuration 207 5.20.4 Build and Load Buildroot 208 5.20.5 Example 208 5.21 USB Gadget Audio 209 5.21.1 Introduction 209 5.21.2 Hardware Setup 209 5.21.3 Software Configuration 210 5.21.4 Run the test 210 6 Multicore support 212 6.1 Multi-Core Communication 212 6.1.1 MCAPI Supported Functions 212 6.1.2 Multi-core Development 214 6.2 Run the MCAPI demo 214 6.2.1 Introduction 214 6.2.2 Hardware Requirement 215 6.2.3 Configure and build 215 6.2.4 Running MCAPI MSG Test Example 218 6.2.5 Troubleshooting 220 6.3 Enable and Disable SHARC Cores 221 6.3.1 Introduction 221 6.3.2 Method 1: Enable SHARC cores with u-boot ICC command 221 6.3.3 Method 2: Enable SHARC Cores with corecontrol Utility in Linux 222 6.4 Introduction of MCAPI examples 224 6.4.1 Introduction 224 6.4.2 Performance of MCAPI 226 6.5 Run Linux on ARM and bare-metal application on SHARC 227 6.5.1 Introduction 227 6.5.2 MCAPI Test Example 227 6.6 Reserve Pinmux Functions in Linux for SHARC Applications 236 6.6.1 Introduction 236 6.6.2 Linux Kernel Configuration 237 6.6.3 Pinmux Reservation Example 239 6.7 SEC driver and multicore development 242 6.7.1 Introduction 242 6.7.2 Linux kernel Configuration 243 6.7.3 Coordinate the SEC Initialization for multicore Development 243 7 Generic Linux Documents 246 7.1 Generic U-Boot Documents 246 7.2 Generic Linux Kernel Documents 246 7.3 Generic Buildroot Documents 246 8 Developing Linux Applications Using CrossCore Embedded Studio 247 8.1 Create and build a project using the Linux targeting toolchain 247 8.1.1 Install CCES and Linux Add-in on Linux host 247 8.1.2 Start CCES IDE on Linux Host 247 8.1.3 Creating a new project using CCES 247 8.2 Debug a Linux application from within the CCES IDE 252 8.2.1 Create a new Linux application from within the CCES IDE 252 8.2.2 Copy your newly built application to your Linux target and set-up debugging 252 8.2.3 Launch CCES and create a Debug configuration 253 8.2.4 Debugging your application with CCES 255 9 Appendix A: Hardware Used During Testing 258 1 Introduction The Analog Devices ADSP-SC5xx family is a series of heterogeneous multi-core processors.