Linux Add-in for CrossCore Embedded Studio Linux Add-in for CrossCore Embedded Studio User's Guide 1.1.0 © 2016 Analog Devices, Inc. Linux Add-in for CrossCore Embedded Studio http://www.analog.com Version 1.1.0, November 2016 [email protected] Contents 1 Introduction 8 2 A quick start guide 9 2.1 Configure and build from source code 9 2.1.1 1 Introduction 9 2.1.2 2 Extract the source code 9 2.1.3 3 Configure and build u-boot 10 2.1.4 4 Configure and build Buildroot and Linux kernel 10 2.1.5 5 Customize the Buildroot and Linux kernel 11 2.1.6 6 More tips about buildroot 11 2.2 SC58x EZ-Kit Linux Quick Start Guide 12 2.2.1 1 Introduction 12 2.2.2 2 Environment set up 12 2.2.3 3 Flashing U-Boot for the First Time 14 2.2.4 4 Booting Linux up with uImage 18 2.2.5 5 Booting Linux Standalone From Non-Volatile Storage 25 2.2.6 6 Quicker Boot From Non-Volatile Storage 33 3 Das U-boot 35 3.1 Ethernet Driver in U-Boot on sc58x-ezkit-hpc 35 3.1.1 1. Hardware 35 3.1.2 2. Build U-Boot with emac0 or emac1 35 3.1.3 3. Using EMAC Driver 35 3.2 Creating and Booting Linux Using the New U-Boot "fitImage" 37 3.2.1 1.Introduction 37 3.2.2 3.U-Boot Configuration 38 3.2.3 4.Create fitImage device tree 39 3.2.4 5.Boot Linux 41 3.3 Mobile Storage Interface (MSI) 43 3.3.1 1. Hardware 44 3.3.2 44 3.3.3 2. Software Configuration 44 3.3.4 3. Build and Load Uboot 44 3.3.5 4. Usage of MSI Driver 44 4 Linux buildroot distribution and applications 46 4.1 Build Linux application for sc58x manually outside the buildroot framework 46 4.2 Monitor the performance of the Linux applications and kernel on sc58x using OProfile 46 4.2.1 1. Introduction 46 4.2.2 2. Configuration 46 4.2.3 3. Simple OProfile usage 47 4.2.4 4. Examples 49 4.3 FTP Server (ftpd) 52 4.3.1 Introduction 52 4.3.2 Operation 52 4.4 Touchscreen Library 53 4.4.1 1. Introduction 54 4.4.2 2. Hardware requirement 54 4.4.3 3. Configuration 54 4.4.4 4. Example 55 4.5 User Manual for MPlayer 58 4.5.1 1. Hardware Setup 59 4.5.2 2. Software Configuration 59 4.5.3 3. Build and Load Buildroot 61 4.5.4 4. Run MPlayer 61 4.6 User Manual for Bluetooth ALSA lib and Voice Headset service 61 4.6.1 1. Introduction 61 4.6.2 2. Configuration 62 4.6.3 3. Bluetooth ALSA and Voice Headset Service Example 63 4.7 User Manual for IEEE 1588 Linux PTP 64 4.7.1 1. PTP Introduction 64 4.7.2 2. PTP Configuration 65 4.7.3 3. Build 66 4.7.4 4. PTP Test 66 4.7.5 5. More information 69 4.8 User manual for QT with WVGA/LCD EI3 Extender Board 70 4.8.1 1. Introduction 70 4.8.2 2. Hardware 70 4.8.3 3. Software Configuration 70 4.8.4 4. Build and Load Buildroot 73 4.8.5 5. Example 73 4.9 User Manual for SQLite database 75 4.9.1 1.Introduction 75 4.9.2 3. Build and Load Buildroot 75 4.9.3 4. Run SQLite 75 5 Linux kernel and drivers 77 5.1 CAN Bus Data Transaction 77 5.1.1 1 Introduction 77 5.1.2 2 Required Hardware 77 5.1.3 3 Operations 77 5.2 Change ARM Core Clock via the CPU Frequency Driver 79 5.2.1 1. Introduction 79 5.2.2 2. Hardware Requirement 79 5.2.3 3. Enabling CPU Frequency Driver in Linux Kernel 79 5.2.4 4. How to Change the CPU cpufreq 80 5.2.5 5. Change Core Clock Frequency via cpufreq-utils 82 5.3 ADV7842 V4L2 Driver 83 5.3.1 1. Introduction 83 5.3.2 2. Hardware Setup 83 5.3.3 3.Software Configuration 83 5.3.4 4. Build and Load Buildroot 85 5.3.5 5. Example 85 5.4 CRC Crypto Driver Guide 86 5.4.1 1. Introduction 86 5.4.2 2. Linux Kernel Configuration 86 5.4.3 3. Example 87 5.4.4 4. Linux Kernel Crypto API 87 5.5 Ethernet driver and performance 88 5.5.1 1. Introduction 88 5.5.2 2. Hardware Requirement 88 5.5.3 3. Configuration 88 5.5.4 4. Performance Benchmark Example 90 5.6 Linux LCD device driver 91 5.6.1 1. Introduction 91 5.6.2 2. Hardware Required 91 5.6.3 3. Configuration 91 5.6.4 4. Example 92 5.7 Linux Sound Driver 93 5.7.1 1. Introduction 93 5.7.2 2. Hardware required 94 5.7.3 3. Configuration 94 5.7.4 4. Example 96 5.8 How to access GPIO in a Linux driver 100 5.8.1 1. Introduction 100 5.8.2 2. Hardware 101 5.8.3 3. Application space GPIO support 101 5.8.4 4. Paths in Sysfs 101 5.8.5 5. Dump the GPIO configuration 103 5.9 I2C Bus 104 5.9.1 1. Introduction 104 5.9.2 2. I2C in the Linux Kernel 104 5.9.3 3. I2C in User Space 106 5.10 Linux Bluetooth USB Dongle Guide 108 5.10.1 1. Introduction 108 5.10.2 2. Configuration 108 5.10.3 3. Example 109 5.11 Linux Kernel API for ADSP-SC58x On-Chip DMA Controller 112 5.11.1 1. Introduction 112 5.11.2 2. Linux DMA Framework 113 5.12 Linux MTD Driver 119 5.12.1 1. Introduction 119 5.12.2 2. Hardware Required 119 5.12.3 3. Configuration 119 5.12.4 4. Example 121 5.13 Linux PCIE device driver 122 5.13.1 1. Introduction 122 5.13.2 2. Hardware Required 122 5.13.3 3. Configuration 123 5.13.4 4. Example 124 5.14 Linux Video Driver 126 5.14.1 1. Introduction 126 5.14.2 2. Hardware Required 126 5.14.3 3. Configuration 126 5.14.4 4. Example 130 5.15 Rotary driver 132 5.15.1 1. Introduction 132 5.15.2 2. Hardware configuration 132 5.15.3 4. Example 134 5.16 SPI Driver 135 5.16.1 1. Introduction 135 5.16.2 2. Hardware Required 137 5.16.3 3. Configuration 137 5.16.4 4. Example 139 5.17 ADV7511 and ADV7343 V4L2 Driver 140 5.17.1 1. Introduction 140 5.17.2 2. Hardware 140 5.17.3 3. Configuration 141 5.17.4 4. Build and Load Buildroot 143 5.17.5 5. Example 143 5.18 Mobile Storage Interface (MSI) 144 5.18.1 1. Hardware 144 5.18.2 144 5.18.3 2. Software Configuration 145 5.18.4 2.2 Configure Buildroot 146 5.18.5 3. Build and Load Buildroot 146 5.18.6 4. Usage of MSI 146 5.19 Real Time Clock on ADSP-SC58x 149 5.19.1 1. Introduction 149 5.19.2 2. Software Configuration 149 5.19.3 3. Build and Load Buildroot 150 5.19.4 4. Example 150 5.20 User manual for UART hardware flow control in linux kernel 151 5.20.1 1. Introduction 151 5.20.2 2. Hardware 151 5.20.3 3. Software Configuration 151 5.20.4 4. Build and Load Buildroot 152 5.20.5 5. Example 152 5.21 User Manual for USB in Linux Kernel 152 5.21.1 1. Hardware Setup 152 5.21.2 2. Software Configuration 153 5.21.3 3. Build and Load Buildroot 155 5.21.4 4. Example 155 6 Multicore support 162 6.1 Enable and Disable SHARC Cores in Linux 162 6.1.1 1. Introduction 162 6.1.2 2. Linux core control driver implementation 162 6.1.3 3. Control SHARC cores1 and 2 with corecontrol utility 163 6.2 Loading of multicore apps by the boot ROM 164 6.2.1 1. Introduction 164 6.2.2 2. Generate LDR image 164 6.2.3 3. Example 165 6.3 MCAPI inter-operability test between arm and sharc 167 6.3.1 1. Introduction 167 6.3.2 3. Configure MCAPI in Linux 167 6.3.3 3.1 Linux kernel 168 6.3.4 3.2 Buildroot 168 6.3.5 4. Example 168 6.4 Reserve Pinmux Functions in Linux for Peripherals Used by SHARC Applications 172 6.4.1 1. Introduction 172 6.4.2 2. Linux Kernel Configuration 172 6.4.3 3. Pinmux Reservation Example 174 6.5 Run both Linux and Sharc application in CCES 176 6.5.1 1. How to Enable Sharc cores 176 6.5.2 1.1 Enable Sharc cores with u-boot ICC command 176 6.5.3 1.1.1 Configure u-boot to enable slave cores in sc58x 176 6.5.4 1.1.2 U-boot ICC command usage 177 6.5.5 1.2 Enable Sharc cores with corecontrol utility in Linux 177 6.5.6 Enable and Disable SHARC Cores in Linux 177 6.5.7 2. Run both Linux and Sharc applications in CCES 178 6.5.8 2.5 Resume core1 and core2 application running in CCES 179 6.6 SEC driver and multicore development 180 6.6.1 1. Introduction 180 6.6.2 2. Linux kernel Configuration 181 6.6.3 3. Coordinate the SEC Initialization for multicore Development 181 7 Generic Linux Documents 184 7.1 1. Generic U-Boot Documents 184 7.2 2. Generic Linux Kernel Documents 184 7.3 3. Generic Buildroot Documents 184 Copyright Information © 2016 Analog Devices, Inc., ALL RIGHTS RESERVED. This document may not be reproduced in any form without prior, express written consent from Analog Devices, Inc. Disclaimer Analog Devices, Inc. reserves the right to change this product without prior notice. Information furnished by Analog Devices is believed to be accurate and reliable. However, no responsibility is assumed by Analog Devices for its use; nor for any infringement of patents or other rights of third parties which may result from its use. No license is granted by implication or otherwise under the patent rights of Analog Devices, Inc. Trademark and Service Mark Notice The Analog Devices logo, CrossCore, A2B, EngineerZone, EZ-Board, EZ-KIT Lite and VisualDSP++ are registered trademarks of Analog Devices, Inc. Blackfin, Blackfin+, SHARC, SHARC+ and SigmaStudio are trademarks of Analog Devices, Inc. All other brand and product names are trademarks or service marks of their respective owners. Linux Add-in for CrossCore Embedded Studio 7 1 Introduction The Analog Devices ADSP-SC58x family is a series of heterogeneous multi-core processors. These systems-on-a-chip contain a single ARM Cortex-A5 processor core accompanied by one or two Analog Devices SHARC+ digital signal processor cores and a wide variety of memory and peripheral interfaces. The ADSP-SC58x family provides ADI customers with rich and flexible software stacks on ARM and high performance DSP audio processing codecs on SHARC. The Linux Add-In for CrossCore Embedded Studio provides users with a full development environment allowing them to target Linux running on the Cortex-A5 core of the ADSP-SC58x processor. The Linux Add-In is only available for Linux hosts. It is not available for Windows host systems. The Linux Add-In provides the following features: Analog Devices enhanced Linaro GCC compiler toolchain GDB debugger for Linux applications Eclipse-based CrossCore Embedded Studio integrated development and debugging environment for Linux applications Pre-configured Linux images for the ADSP-SC584 and ADSP-SC589 Ez-Kits (including u- Boot, Kernel and filesystem) Sources and build environment for U-Boot bootloader Sources and 'Buildroot' build environment for Linux kernel and filesystem Documentation specific to Linux on the ADSP-SC58x family Linux Add-in for CrossCore Embedded Studio 8 2 A quick start guide 2.1 Configure and build from source code 2.1.1 1 Introduction This document describes how to extract the source code for u-boot and for Linux and build each of them using the default configuration. It also shows how to customize features of the Linux kernel and of applications and libraries in Buildroot. At first follow the quick start guide document to set up the Ubuntu host environment and the toolchain, and to install CCES and the CCES Linux add in. After that we will copy the source code for u-boot and Buildroot to a working location. 2.1.2 2 Extract the source code In this document we use ~/sc58x_dev as the working path: $ mkdir ~/sc58x_dev 2.1 Extract the u-boot source code Run the following commands in sequence to copy the u-boot source code tarfile to the working directory and unpack it: $ cd ~/sc58x_dev $ cp /opt/analog/cces-linux-add-in/1.1.0/uboot-sc58x-1.1.0/src/uboot-sc58x-1.1.0.tar.gz . $ tar zxvf uboot-sc58x-1.1.0.tar.gz Now you have the source code for u-boot in ~/sc58x_dev/uboot. 2.2 Extract the buildroot and Linux kernel source code Run the following commands in sequence to copy the Buildroot and Linux source code tarfile to the working directory and unpack it: $ cp /opt/analog/cces-linux-add-in/1.1.0/buildroot-sc58x-1.1.0/src/buildroot-sc58x-1.1.0.tar.gz ~/sc58x_dev/ $ cd ~/sc58x_dev $ tar zxvf buildroot-sc58x-1.1.0.tar.gz Now you have the source code for Buildroot and the Linux kernel in ~/sc58x_dev/buildroot. Linux Add-in for CrossCore Embedded Studio 9 2.1.3 3 Configure and build u-boot Follow the steps below to configure and build the u-boot, here we take the SC589 Ezboard as an example. 3.1 Configure the u-boot $ cd ~/sc58x_dev/uboot $ make sc58x-ezkit-hpc_defconfig 3.2 Build the u-boot $ make 2.1.4 4 Configure and build Buildroot and Linux kernel Follow below steps to use the default configuration to configure and build the buildroot and Linux kernel, here we take the SC589 Ezboard as an example. 4.1 Configure $ cd ~/sc58x_dev/buildroot $ make sc58x-ezkit-hpc_defconfig 4.2 Build $ make It may take many minutes to build for the first time, as buildroot will try to download all the source code for packages from the internet in the initial building. 4.3 List of generated files Here is a list of generated files that are frequently used after building output/images/uImage ---- generated Linux boot image output/images/vmImage ---- Linux kernel image output/images/sc58x-ezkit-hpc.dtb ---- compiled device tree data file output/images/rootfs.ext3 ---- ext3 format filesystemn image of the root filesystem Linux Add-in for CrossCore Embedded Studio 10
Description: