A31 uQ7 User Manual
Transcription
A31 uQ7 User Manual
USER MANUAL µQseven System-on-Module 1.2GHz Quad-Core ARM Cortex-A7 featuring the Allwinner A31 application processor Document revision: Issue date: v1.2 July 31, 2015 CONTENTS 1 First Steps 1.1 About this Chapter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1.2 Required Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1.3 Steps for Setting up the EVK . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 Using the EVK 2.1 About this Chapter . . . . . . . . . 2.2 Board Layout Overview . . . . . . 2.3 Powering the Board . . . . . . . . . 2.4 Booting from an SD Card . . . . . 2.5 Connecting to the Board . . . . . . 2.6 Installing a Desktop Environment 2.7 Using the External Interfaces . . . 3 4 1 1 1 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 4 4 6 8 9 14 15 Software Guide 3.1 About this Chapter . . . . . . . . . . . . 3.2 Compiling Kernel and Bootloader . . . 3.3 Building the root filesystem . . . . . . . 3.4 Deploying on SD Card . . . . . . . . . . 3.5 Deploying on On-Board eMMC storage 3.6 Compiling Linux Applications . . . . . 3.7 Serial Number . . . . . . . . . . . . . . . 3.8 MAC Address . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26 26 26 28 30 33 34 34 35 Hardware Guide 4.1 About this Chapter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.2 Qseven Implementation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36 36 36 A31 uQ7 User Manual © Theobroma Systems Design und Consulting GmbH . . . . . . . . . . . . . . v1.2 Page i 4.3 4.4 4.5 4.6 4.7 5 Connector Description . . Signal Description . . . . On-board Devices . . . . Electrical Specification . . Mechanical Specification . Acronyms and Abbreviations 6 Revision History v1.2 Page ii . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38 41 48 53 53 55 56 CHAPTER ONE FIRST STEPS Note: The latest version of this manual and related resources can always be found on our website at the following address: https://www.theobroma-systems.com/a31-uq7 1.1 About this Chapter This chapter provides instructions for getting the the A31 µQ7 EVK running after opening the box. 1.2 Required Tools • PZ1 (Pozidriv) screwdriver 1.3 Steps for Setting up the EVK 1.3.1 Mount the Thermal Pad Peel off the protective foil on one side and mount the thermal pad as shown below on the heatsink. Place it close to the holes on the left without overlapping them. A31 uQ7 User Manual © Theobroma Systems Design und Consulting GmbH v1.2 Page 1 Fig. 1.1: Thermal pad mounting Now, peel off the protective foil off the other side. 1.3.2 Mount Module and Heatsink Insert the A31 µQ7 module at a 45 degree angle into the connector in the base board. Once fully inserted, push it down until it rests on the standoffs. Place the heatsink on the module and screw it down very gently using four screws of 10mm length. Fig. 1.2: Screws used for mounting heatsink and A31 µQ7 module 1.3.3 Mount the Fan (optional) Note: The fan is only neccessary in exceptionally high ambient temperatures. Under normal conditions, the A31 µQ7 operates passively cooled. Place the fan on the heatsink and screw it down using two 19 mm long screws on two diagonal corners. v1.2 Page 2 Fig. 1.3: Screws used for mounting the fan 1.3.4 Insert SD Card & Power Up Insert the enclosed SD card into the slot on the base board. The slot is marked with the SD logo. Connect the power supply base board. Press the “Power” button on the base board. The module will boot up. You will see the boot progress and get a login prompt on the RS232 interface and on an HDMI monitor (if connected). For further details, see the sections 2.4 Booting from an SD Card, 2.3 Powering the Board and 2.2 Board Layout Overview. A31 uQ7 User Manual © Theobroma Systems Design und Consulting GmbH v1.2 Page 3 CHAPTER TWO USING THE EVK 2.1 About this Chapter This chapter provides instructions for using the Evaluation Kit, such as booting and how to configure and use I/O peripheals (serial console, Ethernet). 2.2 Board Layout Overview The board provides connectors for external I/O devices (top row in the image below), for data storage (top-left corner) and for internal connections (bottom row). Two means of supplying the board are provided (right row), as well as power control functionality, both on-board and extendable (via the CTRL connector) (bottom-left corner). v1.2 Page 4 12V Power HDMI USB Host USB Device 4x USB Host Audio Ethernet RS232 SD-Card Slot Buzzer Boot SW Lid SW µQ7 Module JTAG Battery Power SW 24-pin ATX Power SATA FAN LVDS Power Sleep Reset Wake USB Audio SMBUS/ THERM CAN GPIO I²C/SPI/ 1WIRE Fig. 2.1: The base board for to A31 µQ7 module A31 uQ7 User Manual © Theobroma Systems Design und Consulting GmbH v1.2 Page 5 2.3 Powering the Board The baseboard can operate with a single 12V DC power supply. Fig. 2.2: 12V power connector Alternatively, the baseboard also provides an 24-pin ATX connector. The DC connector takes precendence if both are connected. Note: When using ATX power, the A31 uQ7 module can only boot from the on-board eMMC memory as the ATX power supply does not supply the SD card while booting. v1.2 Page 6 Fig. 2.3: ATX power connector Power can be controlled manually from the board using the power control buttons and switches, located on the left side of the board (see 2.2 Board Layout Overview). 2.3.1 Control Buttons The control buttons provide Power, Reset, Sleep and Wake functionality. The Power button can be disabled by setting the Power Switch to Force On. This means the board will boot as soon as it receives power. 2.3.2 The Control Connector The control connector provides an interface for accessing the control features of the board from outside (for example, from buttons placed conveniently on the frond-side of a box). A31 uQ7 User Manual © Theobroma Systems Design und Consulting GmbH v1.2 Page 7 PWRLED- PWRBTN+ PWRBTN- HDDLED- RESET+ RESET- 5V PWRLED+ HDDLED+ Fig. 2.4: CTRL conncetor The connector provides Power and Reset functionality, as well as pins for the power LED and HDD activity LED. 2.3.3 Connecting the CPU Fan Operation in high environmental temperatures may require a CPU fan. The fan connector is located next to the bottomright corner of the uQ7 expansion area (see board overview). Note: The fan is only neccessary in exceptionally high ambient temperatures. Under normal conditions, the A31 µQ7 operates passively cooled. 2.4 Booting from an SD Card For information on preparing an SD card for the A31 µQ7 board, have a look at the Software Guide. v1.2 Page 8 The SD card has to be inserted in the card slot on the baseboard (see image below). Fig. 2.5: SD Card slot On power up, A31 µQ7 module will normally try to boot from the internal flash. If this fails, it will attempt to boot from the SD card. If this fails as well, it will go in USB recovery mode. The board can be forced to boot from the SD card by setting the slider labeled SW2 on the board to the BIOS Disable position. This will tell the A31 µQ7 module to skip booting from the internal flash and boot from the SD card. 2.5 Connecting to the Board The A31 µQ7 module supports both serial/ssh connections and local connections of user input devices and HDMI output. The following sections explain how to use them. A31 uQ7 User Manual © Theobroma Systems Design und Consulting GmbH v1.2 Page 9 2.5.1 Connecting to the Board via RS232 To connect via RS232, plug the included USB-serial cable into the RS232 connector on the Hainan board and connect it to a USB port of your host. Note: The USB-RS232 cable that comes bundled with the EVK is works without installing drivers on on Windows and Linux. Mac OS X users find the driver (PL2303) on the included USB stick. Fig. 2.6: RS232 connector Picocom can be used to connect to the serial (considering the USB is connected to USB0 on the host machine): picocom -b 115200 /dev/ttyUSB0 After successful system bootup, the login console appears on the terminal: a31-uq7 login: You can login with user root, password root. v1.2 Page 10 2.5.2 Connecting and Configuring Ethernet The board has Gigabit Ethernet support. You can use either the on-board Ethernet adapter or one (or more) external USB Ethernet adapters. Fig. 2.7: Ethernet port Using DHCP For convenience, the board can be configured to use DHCP (if not already done when you have set up your filesystem). Open the file /etc/network/interfaces in your editor of choice and add the following lines: auto eth0 allow-hotplug eth0 iface eth0 inet dhcp And restart networking and check that the settings applied: service networking restart ifconfig eth0 Link encap:Ethernet HWaddr 00:71:00:ff:8c:42 A31 uQ7 User Manual © Theobroma Systems Design und Consulting GmbH v1.2 Page 11 .... inet addr:10.3.9.61 Bcast:10.3.255.255 Mask:255.255.0.0 inet6 addr: fe80::271:ff:feff:8c42/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:329 errors:0 dropped:0 overruns:0 frame:0 If you plug in a USB adapter, it will be mapped to some other name (eth1, for instance), so you have to change these lines accordingly (or add new configuration lines in the interfaces file). To see all your network adapters, use: ifconfig -a Using a Static IP If you want a static IP instead of DHCP, use this configuration in /etc/network/interfaces: auto eth0 iface eth0 inet static address 192.0.2.7 netmask 255.255.255.0 gateway 192.0.2.254 And restart networking: service networking restart 2.5.3 Connecting to the Board via SSH If the network interface is running and there is a network cable plugged in, you should be able to connect to the board via ssh: ssh [email protected] [email protected]'s password: Where xx.xx.xx.xx is your board’s IP address. Note that root login via ssh might be disabled (or only available with an ssh key, not with a password). If you want to change this, open the sshd_config file (/etc/ssh/sshd_config) and set PermitRootLogin to yes: PermitRootLogin yes Then restart the sshd service: v1.2 Page 12 service ssh restart 2.5.4 Connecting USB Devices USB keyboard, mouse and data sticks should work out of the box, just connect them to one of USB ports. Fig. 2.8: USB host ports 2.5.5 Connecting an HDMI Monitor Before powering the board up, connect the monitor to the HDMI port. The monitor should be automatically discovered by the u-boot and you should see output both from u-boot and from the Linux kernel. You will be able to use a mouse with a desktop environment if it is already installed. See the next chapter for how to install a desktop environment. A31 uQ7 User Manual © Theobroma Systems Design und Consulting GmbH v1.2 Page 13 Fig. 2.9: HDMI port 2.6 Installing a Desktop Environment Note: The SD card that is packaged with the EVK already has Xfce preinstalled. Xfce is a lightweight desktop environment recommended for use on the A31 µQ7. To install Xfce, do the following: tasksel install xfce-desktop --new-install The option --new-install ensures that we end up with what Debian Installer would have installed. v1.2 Page 14 2.7 Using the External Interfaces The board supports I2C, SPI and SATA, and provides a real time clock (RTC). This section explains how to use these capabilities. 2.7.1 Connecting an External USB Drive To connect a USB drive, plug it into the desired USB port. The system should recognize the drive imediatelly. Check the kernel log to find the device name: dmesg | tail You will be able to mount its partitions (assuming mapping to /dev/sdb1): mkdir /mnt/pendrive mount /dev/sdb1 /mnt/pendrive cd /mnt/pendrive ls 2.7.2 Connecting a SATA Drive Plug the SATA drive into the SATA connector and power it from the power connector which is adjacent. A31 uQ7 User Manual © Theobroma Systems Design und Consulting GmbH v1.2 Page 15 Fig. 2.10: SATA data and power connectors The system should recognise the drive imediatelly (just like a USB drive) and you will be able to mount its partitions: mkdir /mnt/drive1 mount /dev/sda1 /mnt/drive1 cd /mnt/drive1 ls In this example, it is assumed the drive will be mapped to /dev/sda1. This is because the SD card is mapped to some device of the form /dev/mmc1blk1, so the hard drive should be automatically assigned the name sdax. Any new devices will be assigned names such as sdbx and so on, but you can check this with dmesg: dmesg | tail ... [417845.765419] sd 7:0:0:0: [sda] Attached SCSI removable disk ... 2.7.3 Setting the RTC The RTC is read by the kernel on bootup and used to set the system clock. To check the RTC value, use hwclock: v1.2 Page 16 hwclock Thu 30 Apr 2015 03:51:20 PM CEST -0.826662 seconds The RTC will be set automatically to the system clock on shutdown, so you can set the system clock using the date command and reboot to update the RTC: date --set 2015-04-20 date --set 03:51:30 You can also update the RTC immediately, again with hwclock: hwclock -v You can set up an NTP client so the time will always be updated from the Internet. Install the client first: apt-get install ntp Feel free to change the /etc/ntp.conf file to use more local time sources (change servers from pool.ntp.org to use a server from your country, such as at.pool.ntp.org). 2.7.4 Using I2C and SPI The first I2C (i2c-0) and SPI interfaces are both available on the baseboard (on the same connector). The following table contains the pinout (which is also printed on the board, next to the I2C/SPI/1WIRE connector): PIN 1 2 3 4 5 Function SPI_CS0# SPI_SCK SPI_MOSI I2C_CLK 3V3 Function SPI_CS1# SPI_MISO 1WIRE I2C_DATA GND PIN 10 9 8 7 6 The second I2C (i2c-1) connector is located on the SMBUS/TERM connector on the baseboard (SMB_DAT and SMB_CLK pins): PIN 1 2 3 4 5 Function SMB_ALERT# SMB_DAT SMB_CLK 3V3 3V3 Function THERM# NC THERMTRIP# GND GND PIN 10 9 8 7 6 For I2C, there is the package i2c-tools available in debian: A31 uQ7 User Manual © Theobroma Systems Design und Consulting GmbH v1.2 Page 17 apt-get install i2c-tools For more information on the package, have a look at the Debian page on i2c-tools. I2C Connectors DATA 3V3 GND CLK 3V3 GND I2C1 Fig. 2.11: I2C headers v1.2 Page 18 ALERTn DATA 3V3 GND CLK 3V3 GND The image below shows the exact location of the I2C pins. I2C2 SPI connectors SCK CS0 MISO CS1 GND 3V3 MOSI The image below shows the location of the SPI pins. Fig. 2.12: SPI header I2C Example - Using a Touch Keyboard This example uses the Atmel AT42QT2160 touch keyboard (see datasheet). First, make sure the I2C is active in the device tree. In pangolin-linux edit the device tree source (arch/arm/boot/dts/sun61a31-pangolin.dts) and look for the entry for first I2C device (&i2c0) and set status to okay: &i2c0 { }; pinctrl-names = "default"; pinctrl-0 = <&i2c0_pins_a>; /* pull-ups and devices require AXP221 DLDO3 */ status = "okay"; Next, make sure the driver is installed via menuconfig: A31 uQ7 User Manual © Theobroma Systems Design und Consulting GmbH v1.2 Page 19 make menuconfig Navigate to Device Drivers -> Input device support -> Keyboards and check the ATMEL AT42QT2160 Touch Sensor Chip. We must compile the kernel again and deploy it to the SD card (see Software Guide). 2.7.5 Connecting the 1-Wire Bus 1WIRE GND 3V3 The 1-Wire connector is located in the same group with the first I2C (labeled I2C/SPI/1WIRE. Fig. 2.13: 1-Wire header 2.7.6 Using the GPIOs The GPIO interface is available on the Hainan board and provides the following pins: v1.2 Page 20 Pin 1 2 3 4 5 Qseven signal GPIO0 GPIO2 GPIO4 GPIO7 3V3 Qseven signal GPIO1 GPIO3 GPIO5 GPIO6 GND Pin 10 9 8 7 6 GPIO2 GPIO3 GPIO0 GPIO4 GPIO5 GPIO1 GPIO7 3V3 GND GPIO6 The exact location on the board is displayed below: Fig. 2.14: GPIO header The GPIO numbers displayed printed on the board (and on the table above) are not the same as the ones used in Linux i.e. /sys/class/gpio. You can find the Linux GPIO # in the following table: A31 uQ7 User Manual © Theobroma Systems Design und Consulting GmbH v1.2 Page 21 Qseven sginal GPIO0 GPIO1 GPIO2 GPIO3 GPIO4 GPIO5 GPIO6 GPIO7 CPU pin PG0 PG1 PG2 PG3 PG4 PG17 PG18 PG5 Linux GPIO # 192 193 194 195 196 209 210 197 To calculate the GPIO # from the chip pin, use the following formula: offset = block_number * 32 + index Where: • block_number: the alphabetincal index of the block name, minus 1 • index: the pin number within the block For example, for GPIO_1 the pin is PG1. G has an alphabetical index of 7, so the block number is 6. Since the pin is PG1, the index is 1 so we add 1 to the offset: offset = 32 * 6 + 1 = 193 To enable a GPIO, echo the GPIO number (“offset”) to export: echo 192 > /sys/class/gpio/export ls /sys/class/gpio/gpio192 cat /sys/class/gpio/gpio192/direction in cat /sys/class/gpio/gpio192/value 0 To set the direction to output, write out in the GPIO’s direction file: echo out > /sys/class/gpio/gpio192/direction echo 1 > /sys/class/gpio/gpio192/value The GPIO will be set to a value of 1 (high at 3.3V). 2.7.7 Connecting Audio The board provides two jack audio connectors for input and output. v1.2 Page 22 Fig. 2.15: Audio input/output port 3V3 GND HP LEFT HP RIGHT 3V3 IN3 LEFT IN3 RIGHT GND IN2 LEFT IN2 RIGHT Aditionally, an expansion connector for audio is available on the bottom row of the board: Fig. 2.16: Connecting to the audio expansion connector A31 uQ7 User Manual © Theobroma Systems Design und Consulting GmbH v1.2 Page 23 2.7.8 Connecting Additional USB Ports 5V USB3 DUSB2 D- 5V USB3 D+ GND GND USB2 D+ The USB expansion connector is available on the bottom row of the board. Fig. 2.17: USB expansion header Fig. 2.18: SMBUS/THERM header v1.2 Page 24 DATA ALERTn THERMn THERM TRIPn 3V3 GND CLK 3V3 GND 2.7.9 Connecting the SMBUS/THERM Connector 2.7.10 Connecting the CAN Bus GND CANL CANH The board provides a CAN connector on the bottom row. Fig. 2.19: CAN header A31 uQ7 User Manual © Theobroma Systems Design und Consulting GmbH v1.2 Page 25 CHAPTER THREE SOFTWARE GUIDE 3.1 About this Chapter This Software Guide provides instructions for building and deploying the BSP software: the U-Boot bootloader and the Linux operating system to the µQ7 board. The section “Compiling Linux Applications” provides guidance for compiling applications for the Pangolin. 3.2 Compiling Kernel and Bootloader 3.2.1 Prerequisites You need a recent x86_64 Linux installation to run the cross-compiler on. The cross-compiler requires libc version 2.19. Distributions shipping this version are, among others: • Ubuntu 14.04 “Trusty” • Debian 8 “Jessie” We recommend Debian 8. Please install the following packages to set up the generic build infrastructure: sudo apt-get install device-tree-compiler u-boot-tools build-essential git bc 3.2.2 Compiler Setup For both the U-Boot bootloader and the Linux kernel, a bare-metal arm cross-compiler is required. Note that a bare-metal compiler is only suitable for compiling kernel and bootloader. It will not generate applications that run under Linux. v1.2 Page 26 You can download precompiled binaries from Linaro: http://releases.linaro.org/14.11/components/toolchain/binaries/armnone-eabi/gcc-linaro-4.9-2014.11-x86_64_arm-eabi.tar.xz Extract the archive in /opt . Then, set up environment variables to make use of the new compiler: export ARCH=arm export CROSS_COMPILE=/opt/gcc-linaro-4.9-2014.11-x86_64_arm-eabi/bin/arm-none-eabi- 3.2.3 Building U-Boot U-Boot (Universal Bootloader) is an open source, primary boot loader used in embedded devices to package the instructions to boot the device’s operating system kernel. The boot loader source code can be cloned from https://git.theobroma-systems.com/pangolin-u-boot.git/: git clone https://git.theobroma-systems.com/pangolin-u-boot.git Compile using: cd pangolin-u-boot make pangolin_defconfig make The resulting u-boot image will be saved as u-boot-sunxi-with-spl.bin in the pangolin-u-boot directory. 3.2.4 Building the Boot Script The U-Boot boot sequence is controlled by a file called boot.scr. This file is generated from a plain-text file called boot.cmd. You can clone this file from https://git.theobroma-systems.com/pangolin-tools.git: git clone https://git.theobroma-systems.com/pangolin-tools.git Generate boot.scr using: cd pangolin-tools make A31 uQ7 User Manual © Theobroma Systems Design und Consulting GmbH v1.2 Page 27 3.2.5 Building the Linux Kernel The kernel source code can be cloned from https://git.theobroma-systems.com/pangolin-linux.git/: git clone https://git.theobroma-systems.com/pangolin-linux.git Compile using: cd pangolin-linux make pangolin_defconfig make ARCH=arm uImage sun6i-a31-pangolin.dtb LOADADDR=0x40008000 This will create the two files needed for booting with U-Boot (paths are relative to the pangolin-linux directory): • The device tree: arch/arm/boot/dts/sun6i-a31-pangolin.dtb • The u-boot image: arch/arm/boot/uImage 3.3 Building the root filesystem A filesystem can be created using Debootstrap, specifying armhf as architecture in the command line. Install support packages on the x86_64 Debian: sudo apt-get install qemu-user-static debootstrap binfmt-support Supposing the target dir is called a31-uq7-rootfs and the chosen distro is jessie (recommended): export targetdir=/opt/a31-uq7-rootfs export distro=jessie mkdir -p $targetdir sudo debootstrap --arch=armhf --foreign $distro $targetdir Next, copy the qemu-arm-static binary into the right place for the binfmt packages to find it and copy the resolf.conf file from the host system: sudo cp /usr/bin/qemu-arm-static $targetdir/usr/bin/ sudo cp /etc/resolv.conf $targetdir/etc This will provide a very basic armhf rootfs in the targetdir. For the next stages, we chroot to the target dir and set up the environment again: v1.2 Page 28 sudo chroot $targetdir export distro=jessie export LANG=C Second stage of debootstrap inside the new root dir: /debootstrap/debootstrap --second-stage Setting up apt sources: cat << EOT > /etc/apt/sources.list deb http://httpredir.debian.org/debian $distro main contrib non-free deb-src http://httpredir.debian.org/debian $distro main contrib non-free deb http://httpredir.debian.org/debian $distro-updates main contrib non-free deb-src http://httpredir.debian.org/debian $distro-updates main contrib non-free deb http://security.debian.org/debian-security $distro/updates main contrib non-free deb-src http://security.debian.org/debian-security $distro/updates main contrib non-free EOT cat << EOT > /etc/apt/apt.conf.d/71-no-recommends APT::Install-Recommends "0"; APT::Install-Suggests "0"; EOT We can now pull the latest apt database from the Debian mirrors and install the locales package (in jessie the dialog package might be needed as well): apt-get update apt-get install locales dialog dpkg-reconfigure locales Install any additional packages inside the chroot. An ssh server and sudo are recommended: apt-get install openssh-server sudo Set the root password for logging in via console or ssh: passwd root login over ssh is not permitted by default (set to no), or permitted only with public key (set to without-password). To verify that, run: cat /etc/ssh/sshd_config | grep "PermitRootLogin" PermitRootLogin without-password A31 uQ7 User Manual © Theobroma Systems Design und Consulting GmbH v1.2 Page 29 Open the file /etc/ssh/sshd_config in your editor of choice and set PermitRootLogin to yes. A better option would be to create a user besides root: adduser user Optionally, you can add it to the sudo list: adduser user sudo Set up a basic network configuration file with DHCP via eth0: cat << EOT >> /etc/systemd/network/eth.network [Match] Name=eth0 [Network] DHCP=yes EOT systemctl enable systemd-networkd systemctl enable systemd-resolved Set the hostname: echo a31-uq7 > /etc/hostname For distros older than jessie (wheezy and earlier), the serial console has to be enabled manually. In jessie, this is handled automatically.: echo T0:2345:respawn:/sbin/getty -L ttyS1 115200 vt100 >> /etc/inittab We can now exit and cleanup the support files: exit sudo rm $targetdir/etc/resolv.conf sudo rm $targetdir/usr/bin/qemu-arm-static We now have a root filesystem which can be deployed to the SD card. 3.4 Deploying on SD Card 3.4.1 Partition Setup Both U-Boot and Linux will be located on the same SD card. The layout of the card is as follows: v1.2 Page 30 Offset 0 8kiB 544kiB 1MiB Contents Partition table U-Boot bootloader U-Boot environment variables Partition 1 (ext4 - Linux root fs) Partitions can be created using fdisk (assuming the SD card is mapped to /dev/sdX) and has no partitions (this can be checked using the p command): sudo fdisk /dev/sdX > p This should show an empty partition table, for example: Disk /dev/sdX: 3980 MB, 3980394496 bytes 123 heads, 62 sectors/track, 1019 cylinders, total 7774208 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0xdbbd45c7 Device Boot Start End Blocks Id System If there are partitions on the sdcard, they can be deleted with d. The required partition can be created with the command n, then accepting the defaults: > n Partition type: p primary (0 primary, 0 extended, 4 free) e extended Select (default p): <ENTER> Partition number (1-4, default 1): <ENTER> First sector (2048-7774207, default 2048): <ENTER> Last sector, +sectors or +size{K,M,G} (...): <ENTER> > w The partition table has been altered! Calling ioctl() to re-read partition table. Syncing disks. This will create a primary partition at offset 1MiB. Now, to format the partition as ext4: A31 uQ7 User Manual © Theobroma Systems Design und Consulting GmbH v1.2 Page 31 sudo /sbin/mkfs.ext4 -E lazy_itable_init=0 /dev/sdX1 The option lazy_itable_init=0 speeds up the first boot because it initializes the inode tables in advance. The SD card is now ready to have the U-Boot bootloader and Linux deployed. 3.4.2 Deploying U-Boot The U-Boot image u-boot-sunxi-with-spl.bin is written to the SD card. Assuming the SD card is mapped to /dev/sdX: sudo dd if=pangolin-u-boot/u-boot-sunxi-with-spl.bin of=/dev/sdX bs=8K seek=1 conv=fsync 3.4.3 Deploying the Linux Kernel and the Root Filesystem Mount the SD card partition and copy the rootfs (assuming that the rootfs is located at /opt/a31-uq7-rootfs and the sd card at /dev/sdX1): sudo mkdir -p /mnt/sdcard sudo mount /dev/sdX1 /mnt/sdcard sudo cp -av /opt/a31-uq7-rootfs/* /mnt/sdcard Copy kernel image, device tree and boot script into the boot directory: sudo cp pangolin-linux/arch/arm/boot/dts/sun6i-a31-pangolin.dtb \ pangolin-linux/arch/arm/boot/uImage pangolin-tools/boot.scr \ /mnt/sdcard/boot Finally, unmount the SD card: sudo umount /mnt/sdcard The SD card is ready for booting. 3.4.4 U-Boot Environment The boot sequence is handled by the boot script /boot/boot.scr. Unless you want to customize the sequence, no further action is required. If you want to step through the sequence manually or customize it, you can execute the following commands on the U-Boot prompt: v1.2 Page 32 setenv bootargs console=tty0 console=ttyS2,115200 root=/dev/mmcblk1p1 rw rootwait ext4load mmc 0:1 0x40008000 boot/uImage ext4load mmc 0:1 0x40000000 boot/sun6i-a31-pangolin.dtb bootm 0x40008000 - 0x40000000 Optionally, these commands can be compiled together in a single command and saved so it is performed on every subsequent boot: setenv boot_sd "ext4load mmc 0:1 0x40008000 boot/uImage ext4load mmc 0:1 0x40000000 boot/sun6i-a31-pangolin.dtb bootm 0x40008000 - 0x40000000" setenv bootcmd "run boot_sd" saveenv To reset the U-Boot settings to default, execute: env default -f -a saveenv 3.5 Deploying on On-Board eMMC storage As the eMMC storage is only accessible from the module itself, you must first boot the A31 µQ7 from SD card. Partion and format the eMMC storage as described in 3.4.1 Partition Setup, but using the device /dev/mmcblk0. Mount the eMMC partition and copy the contents of the SD card to the eMMC storage. The copy process will take about 30 seconds: sudo sudo sudo sudo mkdir -p /mnt/emmc mount /dev/mmcblk0p1 /mnt/emmc cp -ax / /mnt/emmc umount /mnt/emmc The final step is copying the bootloader from the SD card to the eMMC: sudo dd if=/dev/mmcblk1 of=/dev/mmcblk0 bs=8K skip=1 seek=1 count=64 conv=fsync Shut down the board (poweroff command) and remove the SD card. Make sure the boot selector switch Boot SW is set to “Normal Boot”. The next boot will run U-Boot off the internal eMMC storage. The final step is informing the kernel to load the root filesystem from eMMC instead of sd card. Power up the board and interrupt the automatic boot to get the U-Boot prompt. A31 uQ7 User Manual © Theobroma Systems Design und Consulting GmbH v1.2 Page 33 On the U-Boot prompt, execute: setenv bootargs console=tty0 console=ttyS2,115200 root=/dev/mmcblk0p1 rw rootwait saveenv boot The parameter is now saved to the eMMC storage. Future boots are fully automatic. 3.6 Compiling Linux Applications The easiest option is to compile your applications directly on a running A31 µQ7 module. Just install the gcc package and related utilities and you are good to go: sudo apt-get install build-essential The second option is to cross-compile your applications. That means running a cross-compiler on an x86_64 Linux installation. You can download precompiled binaries of the cross-compile toolchain from Linaro: http://releases.linaro.org/14.11/components/toolchain/binaries/arm-linux-gnueabihf/gcc-linaro-4.9-2014.11-x86_64_armlinux-gnueabihf.tar.xz Note that this toolchain is only suitable for compiling Linux user-space applications. It will not compile the Linux kernel itself or the bootloader. 3.7 Serial Number Each A31 µQ7 module has a unique serial number that can be read by software. In U-Boot, the serial number is contained in the environment variable serial#. You can print it using the command: printenv serial# Under Linux, it is represented by a simple text file in /sys: cat /sys/firmware/devicetree/base/serial-number The serial number is fixed in hardware (derived from the eMMC Product Serial Number) and can not be modified. v1.2 Page 34 3.8 MAC Address By default, the MAC address of each A31 µQ7 module is a random value derived from the serial number. The properties of this default MAC address are: • It is a Locally Administered Address: The U/L bit of the MAC address is set to 1 • It is not guaranteed to be globally unique • The address is fixed for each A31 µQ7 module. It stays constant across reboots as it is deterministically derived from the serial number To set your own Universally Administered Address, you overwrite the U-Boot environment variable ethaddr. On the UBoot prompt, with XX:XX:XX:XX:XX:XX replaced by your MAC address: setenv ethaddr XX:XX:XX:XX:XX:XX saveenv The MAC address can be queried from the U-Boot prompt using: printenv ethaddr To reset the MAC address to the default value, run: env delete ethaddr saveenv A31 uQ7 User Manual © Theobroma Systems Design und Consulting GmbH v1.2 Page 35 CHAPTER FOUR HARDWARE GUIDE 4.1 About this Chapter This Hardware Guide provides information about the features, connectors and signals available on the A31 µQ7 module. Note: This chapter describes the µQ7 module itself. See chapter 2 Using the EVK for details on the baseboard. 4.2 Qseven Implementation Qseven has mandatory and optional features. Following table shows the feature set of the A31 µQ7 module compared to the minimum ARM/RISC based and maximum configuration. v1.2 Page 36 System I/O Interface PCI Express lanes Serial ATA channels USB 2.0 ports USB 3.0 ports LVDS channels embedded DisplayPort DisplayPort, TMDS High Definition Audio / AC‘97 / I2S Ethernet 10/100 Mbit/Gigabit UART Low Pin Count bus / GPIO Secure Digital I/O 8-bit for SD/MMC cards System Management Bus I2C Bus SPI Bus CAN Bus Watchdog Trigger Power Button Power Good Reset Button LID Button Sleep Button Suspend To RAM (S3 mode) Wake Battery low alarm Thermal control FAN control ARM/RISC Based Minimum Configuration 0 0 3 0 0 0 0 0 0 0 0 0 1 0 0 1 1 1 1 0 0 0 0 0 0 0 A31 µQ7 0 1 8 0 Dual Channel LVDS 1 (HDMI) 0/0/1 1 (Gigabit) 1 0/8 (GPIO) 1 (4-bit SD-Card) 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Maximum Configuration 4 2 8 2 Dual Channel 2 1 1 1 (Gigabit) 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Note: The A31 µQ7 module is available in different variants. This document describes the maximum configuration. For details about orderable variants please refer to the the order-code document. A31 uQ7 User Manual © Theobroma Systems Design und Consulting GmbH v1.2 Page 37 4.3 Connector Description The following table shows the signals on the edge connector of the A31 µQ7 module. Empty cells are not connected (NC) pins. Pin 1 3 5 7 9 11 13 15 17 19 21 23 25 27 29 31 33 35 37 39 41 43 45 47 49 51 53 55 57 59 61 v1.2 Page 38 Signal GND GBE_MDI3GBE_MDI3+ GBE_LINK100# GBE_MDI1GBE_MDI1+ GBE_LINK# GBE_CTREF WAKE# SUS_STAT# SLP_BTN# GND GND BATLOW# SATA0_TX+ SATA0_TXSATA_ACT# SATA0_RX+ SATA0_RXGND BIOS_DISABLE# / BOOT_ALT# SDIO_CD# SDIO_CMD SDIO_PWR# SDIO_DAT0 SDIO_DAT2 GND I2S_WS I2S_RST# Pin 2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32 34 36 38 40 42 44 46 48 50 52 54 56 58 60 62 Signal GND GBE_MDI2GBE_MDI2+ GBE_LINK1000# GBE_MDIO0GBE_MDIO0+ GBE_ACT# SUS_S5# SUS_S3# PWRBTN# LID_BTN# GND PWGIN RSTBTN# GND GND SDIO_CLK# SDIO_LED SDIO_WP SDIO_DAT1 SDIO_DAT3 GND SMB_CLK / GP1_I2C_CLK SMB_DAT / GP1_I2C_DAT Continued on next page Pin 63 65 67 69 71 73 75 77 79 81 83 85 87 89 91 93 95 97 99 101 103 105 107 109 111 113 115 117 119 121 123 125 127 129 131 Table 4.1 – continued from previous page Signal Pin Signal I2S_CLK 64 SMB_ALERT# I2S_SDI 66 GP0_I2C_CLK I2S_SDO 68 GP0_I2C_DAT THRM# 70 WDTRIG# THRMTRIP# 72 WDOUT GND 74 GND USB_P776 USB_P6USB_P7+ 78 USB_P6+ USB_6_7_OC# 80 USB_4_5_OC# USB_P582 USB_P4USB_P5+ 84 USB_P4+ USB_2_3_OC# 86 USB_0_1_OC# USB_P388 USB_P2USB_P3+ 90 USB_P2+ USB_CC 92 USB_ID USB_P194 USB_P0USB_P1+ 96 USB_P0+ GND 98 GND LVDS_A0+ 100 LVDS_B0+ LVDS_A0102 LVDS_B0LVDS_A1+ 104 LVDS_B1+ LVDS_A1106 LVDS_B1LVDS_A2+ 108 LVDS_B2+ LVDS_A2110 LVDS_B2LVDS_PPEN 112 LVDS_BLEN LVDS_A3+ 114 LVDS_B3+ LVDS_A3116 LVDS_B3GND 118 GND LVDS_A_CLK+ 120 LVDS_B_CLK+ LVDS_A_CLK122 LVDS_B_CLKLVDS_BLT_CTRL / GP_PWM_OUT0 124 GP_1-Wire_Bus GP2_I2C_DAT / LVDS_DID_DAT 126 LVDS_BLC_DAT GP2_I2C_CLK / LVDS_DID_CLK 128 LVDS_BLC_CLK CAN0_TX 130 CAN0_RX TMDS_CLK+ 132 Continued on next page A31 uQ7 User Manual © Theobroma Systems Design und Consulting GmbH v1.2 Page 39 Pin 133 135 137 139 141 143 145 147 149 151 153 155 157 159 161 163 165 167 169 171 173 175 177 179 181 183 185 187 189 191 193 195 197 199 201 v1.2 Page 40 Table 4.1 – continued from previous page Signal Pin Signal TMDS_CLK134 GND 136 GND TMDS_LANE1+ 138 TMDS_LANE1140 GND 142 GND TMDS_LANE0+ 144 TMDS_LANE0146 GND 148 GND TMDS_LANE2+ 150 HDMI_CTRL_DAT TMDS_LANE2152 HDMI_CTRL_CLK DP_HDMI_HPD# 154 RSVD 156 158 GND 160 GND 162 164 GND 166 GND 168 170 UART0_TX 172 UART0_RTS# 174 176 UART0_RX 178 UART0_CTS# 180 182 GND 184 GND GPIO0 186 LPC_AD1 / GPIO1 GPIO2 188 LPC_AD3 / GPIO3 GPIO4 190 LPC_FRAME# / GPIO5 GPIO6 192 LPC_LDRQ# / GPIO7 VCC_RTC 194 SPKR / GP_PWM_OUT2 FAN_TACHOIN / GP_TIMER_IN 196 FAN_PWMOUT / GP_PWM_OUT1 GND 198 GND SPI_MOSI 200 SPI_CS0# SPI_MISO 202 SPI_CS1# Continued on next page Pin 203 205 207 209 211 213 215 217 219 221 223 225 227 229 Signal SPI_SCK VCC_5V_SB JTAG_TCK JTAG_TDO VCC VCC VCC VCC VCC VCC VCC VCC VCC VCC Table 4.1 – continued from previous page Pin Signal 204 206 VCC_5V_SB 208 JTAG_TDI 210 JTAG_TMS 212 VCC 214 VCC 216 VCC 218 VCC 220 VCC 222 VCC 224 VCC 226 VCC 228 VCC 230 VCC 4.4 Signal Description 4.4.1 Ethernet Signal Type GBE_MDI[0:3]+ GBE_MDI[0:3]GBE_ACT# GBE_LINK# GBE_LINK100# GBE_LINK1000# GBE_CTREF I/O Signal Level Analog OC OC OC OC REF 3.3V 3.3V 3.3V 3.3V Analog A31 uQ7 User Manual © Theobroma Systems Design und Consulting GmbH Description Gigabit Ethernet Controller: Media Dependent Interface Differential Pairs 0,1,2,3. The MDI can operate in 1000, 100 and 10 Mbit/sec modes Gigabit Ethernet Controller activity indicator, active low Gigabit Ethernet Controller link indicator, active low Internaly connected to GBE_LINK# Internaly connected to GBE_LINK# Center Tap Voltage v1.2 Page 41 4.4.2 SATA Signal Type Description O Signal Level SATA SATA0_TX+ SATA0_TX SATA0_RX+ SATA0_RX SATA_ACT# I SATA Serial ATA Channel 0 differential receive pair O 3.3V Serial ATA Activity LED Signal Type Description USB_P0+ USB_P0USB_P1+ USB_P1USB_P2+ USB_P2USB_P3+ USB_P3USB_P4+ USB_P4USB_P5+ USB_P5USB_P6+ USB_P6USB_P7+ USB_P7USB_0_1_OC# I/O I/O I/O I/O I/O I/O I/O I/O I Signal Level USB USB USB USB USB USB USB USB 3.3V USB_2_3_OC# I 3.3V USB_4_5_OC# I 3.3V USB_6_7_OC# I 3.3V USB_ID I 3.3V USB_CC I 3.3V Serial ATA Channel 0 differential transmit pair 4.4.3 USB v1.2 Page 42 Universal Serial Bus Port 0 differential pair Universal Serial Bus Port 1 differential pair Universal Serial Bus Port 2 differential pair Universal Serial Bus Port 3 differential pair Universal Serial Bus Port 4 differential pair Universal Serial Bus Port 5 differential pair Universal Serial Bus Port 6 differential pair Universal Serial Bus Port 7 differential pair Over current detect input 1. This pin is used to monitor the USB power over current of the USB Ports 0 and 1 Over current detect input 1. This pin is used to monitor the USB power over current of the USB Ports 2 and 3 Over current detect input 1. This pin is used to monitor the USB power over current of the USB Ports 4 and 5 Over current detect input 1. This pin is used to monitor the USB power over current of the USB Ports 6 and 7 Configures the mode of the USB Port 1. If the signal is active high the Port will be configured as USB Client 4.4.4 SDIO Signal Type SDIO_CD# I Signal Level 3.3V SDIO_CLK SDIO_CMD SDIO_LED O I/O O 3.3V 3.3V 3.3V SDIO_WP SDIO_PWR# I O 3.3V 3.3V SDIO_DAT0-4 I/O 3.3V Signal Type I2S_RST# I2S_WS I2S_CLK I2S_SDO I2S_SDI O O O O I Signal Level 3.3V 3.3V 3.3V 3.3V 3.3V Description SDIO Card Detect. This signal indicates when a SDIO/MMC card is present SDIO Clock SDIO Command/Response SDIO LED. Used to drive an external LED to indicate transfers on the bus SDIO Write Protect SDIO Power Enable. This signal is used to enable the power being supplied to a SD/MMC card device SDIO Data lines 4.4.5 I2S A31 uQ7 User Manual © Theobroma Systems Design und Consulting GmbH Description I2S Codec Reset I2S Word Select I2S Serial Data Clock I2S Serial Data Output I2S Serial Data Input v1.2 Page 43 4.4.6 LVDS Signal Type LVDS_PPEN LVDS_BLEN LVDS_BLT_CTRL /GP_PWM_OUT0 O O O Signal Level 3.3V 3.3V 3.3V LVDS_A0+ LVDS_A0LVDS_A1+ LVDS_A1LVDS_A2+ LVDS_A2LVDS_A3+ LVDS_A3LVDS_A_CLK+ LVDS_A_CLKLVDS_B0+ LVDS_B0LVDS_B1+ LVDS_B1LVDS_B2+ LVDS_B2LVDS_B3+ LVDS_B3LVDS_B_CLK+ LVDS_B_CLKLVDS_DID_CLK /GP2_I2C_CLK O LVDS Controls panel power enable Controls panel backlight enable Primary functionality is to control the panel backlight brightness via pulse width modulation (PWM). When not in use for this primary purpose it can be used as General Purpose PWM Output LVDS primary channel differential pair 0 O LVDS LVDS primary channel differential pair 1 O LVDS LVDS primary channel differential pair 2 O LVDS LVDS primary channel differential pair 3 O LVDS LVDS primary channel differential pair clock lines O LVDS LVDS secondary channel differential pair 0 O LVDS LVDS secondary channel differential pair 1 O LVDS LVDS secondary channel differential pair 2 O LVDS LVDS secondary channel differential pair 3 O LVDS LVDS secondary channel differential pair clock lines O 3.3V LVDS_DID_CLK /GP2_I2C_CLK O 3.3V Primary functionality is DisplayID DDC clock line used for LVDS flat panel detection. If the primary functionality is not used, it can be used as a General Purpose I2C bus clock line Primary functionality is DisplayID DDC data line used for LVDS flat panel detection. If the primary functionality is not used, it can be used as a General Purpose I2C bus data line v1.2 Page 44 Description 4.4.7 HDMI Signal Type Description O Signal Level TMDS TMDS_CLK+ TMDS_CLKTMDS_LANE0+ TMDS_LANE0TMDS_LANE1+ TMDS_LANE1TMDS_LANE2+ TMDS_LANE2HDMI_CTRL_CLK HDMI_CTRL_DAT DP_HDMI_HPD# O TMDS TMDS differential pair lane 0 O TMDS TMDS differential pair lane 1 O TMDS TMDS differential pair lane 2 O I/O I 3.3V 3.3V 3.3V DDC based control signal (clock) for HDMI device DDC based control signal (data) for HDMI device Hot plug detection signal that serves as an interrupt request Signal Type Description GPIO0-7 I/O Signal Level 3.3V Signal Level 3.3V 3.3V Description TMDS differential pair clock lines 4.4.8 GPIO General purpose input/output 0-7 4.4.9 CAN Signal Type CAN0_TX CAN0_RX O I A31 uQ7 User Manual © Theobroma Systems Design und Consulting GmbH CAN (Controller Area Network) TX output for CAN Bus channel 0 CAN (Controller Area Network) RX inpufor CAN Bus channel 0 v1.2 Page 45 4.4.10 SPI Signal Type SPI_MOSI SPI_MISO SPI_SCK SPI_CS0# SPI_CS1# O I O O O Signal Level 3.3V 3.3V 3.3V 3.3V 3.3V Description Signal Level 3.3V 3.3V 3.3V 3.3V Description Signal Level 3.3V 3.3V 3.3V 3.3V Description Master serial output/Slave serial input signal Master serial input/Slave serial output signal SPI clock output SPI chip select 0 output SPI chip select 1 output (used when two devices are connected) 4.4.11 UART Signal Type UART0_TX UART0_RX UART0_CTS# UART0_RTS# O I I O Serial data transmit Serial data recieve Handshake signal: ready to send data Handshake signal: ready to receive data 4.4.12 JTAG Signal Type JTAG_TCK JTAG_TDO JTAG_TDI JTAG_TMS I O I I v1.2 Page 46 Test clock Test data out Test data in Test mode select 4.4.13 Misc Signal Type WDTRIG# WDOUT GP0_I2C_CLK GP0_I2C_DAT SMB_CLK GP1_I2C_CLK SMB_DAT GP1_I2C_DAT SMB_ALERT# SPKR GP_PWM_OUT2 BIOS_DISABLE# /BOOT_ALT# I O O I/O O Signal Level 3.3V 3.3V 3.3V 3.3V 3.3V I/O 3.3V I O 3.3V 3.3V I 3.3V GP_1-Wire_Bus THRM# I/O I 3.3V 3.3V THRMTRIP# O 3.3V FAN_PWMOUT /GP_PWM_OUT1 FAN_TACHOIN /GP_TIMER_IN O 3.3V I 3.3V A31 uQ7 User Manual © Theobroma Systems Design und Consulting GmbH Description Watchdog trigger signal Watchdog event indicator I2C Bus 0 clock line I2C Bus 0 data line Clock line of System Management Bus. Alternate function I2C Bus 1 clock line Data line of System Management Bus. Alternate function I2C Bus 1 data line System Management Bus Alert input Audio enunciator output. Alternate function general purpose PWM output Disables the onboard bootloader and uses the one the SD card instead. If no bootloader is available on the SD card it falls back to USB recovery mode General Purpose 1-Wire bus interface Thermal Alarm active low signal generated by the external hardware to indicate an over temperature situation. This signal can be used to initiate thermal throttling Thermal Trip indicates an overheating condition of the processor. If ‘THRMTRIP#’ goes active the system immediately transitions to the S5 State (Soft Off) PWM output for fan speed control. Alternate function general purpose PWM output. Function based on microcontroller firmware Fan tachometer input. Alternate function general purpose timer input. Function based on microcontroller firmware v1.2 Page 47 4.4.14 Power Managment Signal Type RSTBTN# BATLOW# WAKE# I I I Signal Level 3.3V 3.3V 3.3V SUS_STAT# O 3.3V SUS_S3# SUS_S5# SLP_BTN# O O I 3.3V 3.3V 3.3V LID_BTN# I 3.3V Description Reset button input. An active low signal resets the module Battery low input External system wake event. An active low signal wakes the module from a sleep state Suspend Status: indicates that the system will be entering a low power state soon Indicated that the system is in suspend to ram (S3) Indicated that the system is in soft-off state (S5) Sleep button. Signals the system with an falling edge to transition into sleep or wake from a sleep state LID button. Low active signal to detect a LID switch to transition into sleep or wake from a sleep state 4.4.15 Power Signal VCC VCC_5V_SB Nominal Input 5V 5V VCC_RTC 3V Description Main supply for the module Additional supply rail for standby functionality. If standby functionality is not needed connect to VCC Backup supply for the RTC. If not used it can be left unconnected 4.5 On-board Devices 4.5.1 Power-Manager The X-Powers AXP221 is connected to the CPU via I2C and an interrupt line: AXP221 Pin 44 45 11 v1.2 Page 48 Function SCL SDA IRQ CPU Pin PL0 PL1 NMI (ball P24) 4.5.2 DDR3 • 1GB of DDR3 RAM 4.5.3 eMMC • eMMC connected through 8-bit wide SDIO interface Signal RESET Connected to CPU PC24 Linux GPIO # 88 4.5.4 NOR • 512 kiB serial NOR flash • Connected to the CPU via SPI: Signal CLK MOSI MISO CS CPU Pin PC2 PC0 PC1 PC27 4.5.5 Cortex-M0 The on-board microcontroller provides additional features to the CPU, exposed via I2C and USB. It emulates standard ICs and does not need custom drivers in Linux. Feature RTC Temperature sensor and fan controller CAN CPU Connection I2C I2C USB Emulated IC ISL1208 AMC6821 TBD Qseven Pins none FAN_TACHOIN, FAN_PWMOUT CAN0_TX, CAN0_RX The microcontroller can be flashed from the CPU by taking it into DFU mode (USB recovery). Pull BOOT0 high and cycle reset (GPIOs listed below). The microcontroller will appear as a new USB device in Linux. Function NRST BOOT0 Connected to CPU PC26 CPU PC3 Linux GPIO # 122 99 A31 uQ7 User Manual © Theobroma Systems Design und Consulting GmbH v1.2 Page 49 4.5.6 USB The SMSC USB2517 provides seven additional USB 2.0 high-speed ports. The routing of Qseven signals to CPU and/or hub ports is shown below. Qseven Port # USB_P0 Speed USB 2.0 Hi-Speed USB 2.0 Hi-Speed USB 2.0 Hi-Speed USB 2.0 Hi-Speed USB 2.0 Hi-Speed USB 2.0 Hi-Speed USB 2.0 Hi-Speed USB 2.0 Hi-Speed USB_P1 USB_P2 USB_P3 USB_P4 USB_P5 USB_P6 USB_P7 Connected to CPU Port # 2 Notes CPU 0 OTG Hub / CPU 1 If the hub is not placed, USB_P2 connects directly to CPU port 1 Hub 7 Hub 6 Hub 3 Hub 4 Hub 5 Because of the significant power consumption of the USB2517 (tabulated below) it should be held in reset whenever it is not needed. Note that this will also disable the SATA controller’s USB connection. Active ports 1 2 4 7 0 (held in reset) Typical hub power consumption 760mW 890mW 1090mW 1380mW 0.3mW The routing of the reset signal is shown below. Hub signal RESET v1.2 Page 50 Connected to CPU PC21 Linux GPIO # 85 4.5.7 SATA The Genesys Logic GL830 provides the SATA interface. It interfaces to Linux as a USB mass-storage device and does not need a special driver. The signal routing is shown in the following table. SATA controller signal SATA TX/RX SATA activity USB 2.0 Hi-Speed RESET Connected to Qseven SATA0 Qseven SATA_ACT SB217 hub port 2 CPU PC20 Linux GPIO # 84 4.5.8 Ethernet-PHY The Micrel KSZ9031RNX is connected to the CPU via RGMII and MDIO. Further connections are shown below. PHY signal RESET MDIO MDC LED1 LED2 Connected to CPU PA7 CPU PA27 CPU PA26 Qseven GBE_LINK1000 and GBE_LINK100 and GBE_LINK (tied together) Qseven GBE_ACT A31 uQ7 User Manual © Theobroma Systems Design und Consulting GmbH Linux GPIO # 7 v1.2 Page 51 TP16 TP17 TP14 TP15 4.5.9 Testpoints TP4 TP3 TP1 TP2 TP11 TP12 TP7 TP8 TP13 TP5 TP6 Fig. 4.1: Testpoints on the module v1.2 Page 52 Testpoint TP1 TP2 TP3 TP4 TP5 TP6 TP7 TP8 TP9 TP10 TP11 TP12 TP13 TP14 TP15 TP16 TP17 Name S_JTAG_MS S_JTAG_CK S_JTAG_DO S_JTAG_DI UART_DBG_TX UART_DBG_RX STM32_DBG_TX STM32_DBG_RX STM32_USB_N STM32_USB_P SWDIO SWCLK CLK_OUTA RISC_TX RISC_RX VCC_PMIC GND Description CPU PL5 (OpenRISC JTAG) CPU PL6 CPU PL7 CPU PL8 CPU PH20 (CPU UART) CPU PH21 Cortex-M0 extra UART Cortex-M0 extra UART Internal Full-Speed USB connection Internal Full-Speed USB connection Cortex-M0 SWDIO Cortex-M0 SWCLK CPU PA15 CPU PL2 (OpenRISC UART) CPU PL3 PMIC always-on voltage Ground 4.6 Electrical Specification 4.6.1 Power Supply The power supply requirements are listed in the table below and are identical to the Qseven specification. If the base board does not provide standby power, VCC_5V_SB must be tied to VCC. Rail VCC VCC_5V_SB VCC_RTC Description Main power supply Standby power supply Backup battery Nominal voltage 5V 5V 3V Tolerance 4.75 ... 5.25V 4.75 ... 5.25V 2.4 ... 3.3V 4.7 Mechanical Specification 4.7.1 Module Dimensions The mechanical dimensions of the module are shown below. A31 uQ7 User Manual © Theobroma Systems Design und Consulting GmbH v1.2 Page 53 Fig. 4.2: Module dimensions (all values in mm) v1.2 Page 54 CHAPTER FIVE ACRONYMS AND ABBREVIATIONS ARM Advanced RISC Machine CAN Controller Area Network GCC GNU Compiler Collection HDMI High Definition Multimedia Interface I2C Inter-Integrated Circuit Bus JTAG Joint Test Action Group NTP Network Time Protocol SATA Serial ATA SPI Serial Parallel Interface U-Boot Universal Bootloader USB Universal Serial Bus A31 uQ7 User Manual © Theobroma Systems Design und Consulting GmbH v1.2 Page 55 CHAPTER SIX REVISION HISTORY Date July 31, 2015 Revision v1.2 July 24, 2015 May 21, 2015 v1.1 v1 v1.2 Page 56 Changes Add sections 3.7 Serial Number and 3.8 MAC Address; Move section 5 Acronyms and Abbreviations to the end; Remove empty sections Add chapter 1 First Steps; Add section 3.5 Deploying on On-Board eMMC storage Initial release