UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

Adam Taylor’s MicroZed Chronicles Part 53: Linux and SMP

by Xilinx Employee on ‎10-13-2014 10:09 AM (36,628 Views)

 

By Adam Taylor

 

Having spent the last few blogs looking at operating systems and AMP (asymmetric multiprocessing), a natural progression is to look at running Linux on the MicroZed. We’ve not yet discussed running Linux on the Xilinx Zynq SoC. Linux has become a major embedded operating system so by discussing it now, we’ll also be discussing symmetric multiprocessing, killing two birds with one stone—so to speak.

Since its creation by Linus Torvalds—who wrote Linux as a personal project in 1991 while he was a computer science student at the University of Helsinki—Linux has become one of the world’s most widely adopted operating systems and has become increasingly popular as an embedded OS. With a large number of software developers now familiar with both the Linux kernel and application development for Linux, it stands to reason that we would wish to run Linux on the PS side of the Zynq SoC.

 

Linux is capable of running on one ARM Cortex-A9 MPCore processor core or on both of the cores in the Zynq SoC. When we run the OS on both cores, a single operating system is in control and this makes it an SMP (symmetric multiprocessing) system.

 

We can use either of two methods to get Linux up and running on the MicroZed:

 

  • We can use an existing pre-built image like that available here. This is the fastest way but the OS image it may not include all the peripherals we require at the hardware level.
  • Alternatively we can build our own Linux distribution based around PetaLinux for our application. (You will need to develop this on a Linux based system not windows).

 

Developing our own distribution for a system on modules needs requires the following steps:

 

 

Developing a Linux Distribution.jpg 

 

The steps are:

 

  1. First Stage Boot Loader – To configure the processor and hardware. For example: DDR timings etc.
  2. Second Stage Boot Loader – Loads the operating system. U Boot is most commonly used for this.
  3. Root File System – For our distribution this will be a RAM Disk, which contains all of the files needed to boot the Linux system.
  4. Device Blob Tree – This defines the hardware configuration and allows for one distribution to be used across different hardware implementations.
  5. Linux Kernel – Recompilation of the kernel for our application.
  6. Development of the Linux application
  7. Creation of boot image

 

We will look at all of the above seven steps over the next few blogs.

 

It is also possible to use the prebuilt Linux image, which comes with the MicroZed, although this distribution is really just a demo.

 

The first thing we need to do is download the Zip file from the link above and extract it to a working directory. Then we copy these files to an SD Card and set the MicroZed configuration jumpers to boot from the SD card.

 

When the boot sequence completes, you will see an image just like the one below, in a terminal window.

 


Linux Boot Message sequence.jpg

 

 

Because this distribution was developed specifically for the MicroZed, it has limited functionality. However, it does support the GPIO in the Zynq PS. As such, we can use the terminal prompt to turn the led located on MIO 47 on and off. Also, the push button is on MIO51 so we can read its status.

 

Access to the drivers is available under the /sys/class/gpio/ within the terminal program. We can issue the command sequence below to control the LED. This command sequence exports the MIO47 to the sysfs file system, configures the IO as an output, and then turns on the LED.

 

 

Echo 47 > /sys/class/gpio/export

 

Echo out > /sys/class/gpio/gpio47

 

Echo 1 > /sys/class/gpio/gpio47

 

 

This command sequence shows that the basic Linux OS can be brought up and run pretty easily on the MicroZed. However, to really demonstrate the power of Linux, we need to have it run an application on a custom hardware definition. We’ll look at that in the next blog post.

 

 

Please see the previous entries in this MicroZed series by Adam Taylor:

 

Adam Taylor’s MicroZed Chronicles Part 52: One year and 151,000 views later. Big, Big Bonus PDF!

 

Adam Taylor’s MicroZed Chronicles Part 51: Interrupts and AMP

 

Adam Taylor’s MicroZed Chronicles Part 50: AMP and the Zynq SoC’s OCM (On-Chip Memory)

 

Adam Taylor’s MicroZed Chronicles Part 49: Using the Zynq SoC’s On-Chip Memory for AMP Communications

 

Adam Taylor’s MicroZed Chronicles Part 48: Bare-Metal AMP (Asymmetric Multiprocessing)

 

Adam Taylor’s MicroZed Chronicles Part 47: AMP—Asymmetric Multiprocessing on the Zynq SoC

 

Adam Taylor’s MicroZed Chronicles Part 46: Using both of the Zynq SoC’s ARM Cortex-A9 Cores

 

Adam Taylor’s MicroZed Chronicles Part 44: MicroZed Operating Systems—FreeRTOS

 

Adam Taylor’s MicroZed Chronicles Part 43: XADC Alarms and Interrupts 

 

Adam Taylor’s MicroZed Chronicles MicroZed Part 42: MicroZed Operating Systems Part 4

 

Adam Taylor’s MicroZed Chronicles MicroZed Part 41: MicroZed Operating Systems Part 3

 

Adam Taylor’s MicroZed Chronicles MicroZed Part 40: MicroZed Operating Systems Part Two

 

Adam Taylor’s MicroZed Chronicles MicroZed Part 39: MicroZed Operating Systems Part One

 

Adam Taylor’s MicroZed Chronicles MicroZed Part 38 – Answering a question on Interrupts

 

Adam Taylor’s MicroZed Chronicles Part 37: Driving Adafruit RGB NeoPixel LED arrays with MicroZed Part 8

 

Adam Taylor’s MicroZed Chronicles Part 36: Driving Adafruit RGB NeoPixel LED arrays with MicroZed Part 7

 

Adam Taylor’s MicroZed Chronicles Part 35: Driving Adafruit RGB NeoPixel LED arrays with MicroZed Part 6

 

Adam Taylor’s MicroZed Chronicles Part 34: Driving Adafruit RGB NeoPixel LED arrays with MicroZed Part 5

 

Adam Taylor’s MicroZed Chronicles Part 33: Driving Adafruit RGB NeoPixel LED arrays with the Zynq SoC

 

Adam Taylor’s MicroZed Chronicles Part 32: Driving Adafruit RGB NeoPixel LED arrays

 

Adam Taylor’s MicroZed Chronicles Part 31: Systems of Modules, Driving RGB NeoPixel LED arrays

 

 Adam Taylor’s MicroZed Chronicles Part 30: The MicroZed I/O Carrier Card

 

Zynq DMA Part Two – Adam Taylor’s MicroZed Chronicles Part 29

 

The Zynq PS/PL, Part Eight: Zynq DMA – Adam Taylor’s MicroZed Chronicles Part 28  

 

The Zynq PS/PL, Part Seven: Adam Taylor’s MicroZed Chronicles Part 27

 

The Zynq PS/PL, Part Six: Adam Taylor’s MicroZed Chronicles Part 26

 

The Zynq PS/PL, Part Five: Adam Taylor’s MicroZed Chronicles Part 25

 

The Zynq PS/PL, Part Four: Adam Taylor’s MicroZed Chronicles Part 24

 

The Zynq PS/PL, Part Three: Adam Taylor’s MicroZed Chronicles Part 23

 

The Zynq PS/PL, Part Two: Adam Taylor’s MicroZed Chronicles Part 22

 

The Zynq PS/PL, Part One: Adam Taylor’s MicroZed Chronicles Part 21

 

Introduction to the Zynq Triple Timer Counter Part Four: Adam Taylor’s MicroZed Chronicles Part 20

 

Introduction to the Zynq Triple Timer Counter Part Three: Adam Taylor’s MicroZed Chronicles Part 19

 

Introduction to the Zynq Triple Timer Counter Part Two: Adam Taylor’s MicroZed Chronicles Part 18

 

Introduction to the Zynq Triple Timer Counter Part One: Adam Taylor’s MicroZed Chronicles Part 17

 

The Zynq SoC’s Private Watchdog: Adam Taylor’s MicroZed Chronicles Part 16

 

Implementing the Zynq SoC’s Private Timer: Adam Taylor’s MicroZed Chronicles Part 15

 

MicroZed Timers, Clocks and Watchdogs: Adam Taylor’s MicroZed Chronicles Part 14

 

More About MicroZed Interrupts: Adam Taylor’s MicroZed Chronicles Part 13

 

MicroZed Interrupts: Adam Taylor’s MicroZed Chronicles Part 12

 

Using the MicroZed Button for Input: Adam Taylor’s MicroZed Chronicles Part 11

 

Driving the Zynq SoC's GPIO: Adam Taylor’s MicroZed Chronicles Part 10

 

Meet the Zynq MIO: Adam Taylor’s MicroZed Chronicles Part 9

 

MicroZed XADC Software: Adam Taylor’s MicroZed Chronicles Part 8

 

Getting the XADC Running on the MicroZed: Adam Taylor’s MicroZed Chronicles Part 7

 

A Boot Loader for MicroZed. Adam Taylor’s MicroZed Chronicles, Part 6 

 

Figuring out the MicroZed Boot Loader – Adam Taylor’s MicroZed Chronicles, Part 5

 

Running your programs on the MicroZed – Adam Taylor’s MicroZed Chronicles, Part 4

 

Zynq and MicroZed say “Hello World”-- Adam Taylor’s MicroZed Chronicles, Part 3

 

Adam Taylor’s MicroZed Chronicles: Setting the SW Scene

 

Bringing up the Avnet MicroZed with Vivado

 

 

 

 

 

 

 

Labels
About the Author
  • Be sure to join the Xilinx LinkedIn group to get an update for every new Xcell Daily post! ******************** Steve Leibson is the Director of Strategic Marketing and Business Planning at Xilinx. He started as a system design engineer at HP in the early days of desktop computing, then switched to EDA at Cadnetix, and subsequently became a technical editor for EDN Magazine. He's served as Editor in Chief of EDN Magazine, Embedded Developers Journal, and Microprocessor Report. He has extensive experience in computing, microprocessors, microcontrollers, embedded systems design, design IP, EDA, and programmable logic.