ECE699 Lecture 10 Linux On Zynq
ECE699 Lecture 10 Linux On Zynq
Jeremy Trimble
Linux
A clone of the Unix operating system.
Started by Linus Torvalds in 1991.
Originally for i386 architecture.
Now supports 20 different architectures.
Including ARM.
Open-source
GNU General Public License (GPL)
Arguably the world's largest software project.
>3700 developers around the world.
1 code change accepted every 7.5 minutes.
~359 lines of code added each hour.
Source: https://github.com/gregkh/kernel-history
A few technicalities
Linux is a kernel.
Not an operating system.
Typically run with GNU Operating System
So the correct name is actually GNU/Linux
But most folks just say Linux.
GNU project
Started by Richard Stallman
Provides common userspace utilities:
ls, make, gcc, emacs
Advantages of Linux on Zynq
Flexibility
More like a general-purpose computer.
Multitasking, filesystems, networking, hardware support.
Ease of development
Kernel protects against certain types of software errors.
Vast ecosystem of open-source tools and languages.
Faster time-to-market.
Graphics support
X Windows
Disadvantages
Complexity
More hoops to jump through for some tasks.
Memory management makes interacting with PL cores
more involved.
Overhead
For very simple programs, bare metal can be faster.
Key parts of a (Zynq) Linux System
Bootloader
Zynq FSBL First Stage Bootloader
U-Boot
Kernel
PL Image
Device Tree File
A file describing the computer where Linux will run.
Root Filesystem
Linux Distributions
How to boot the Zynq
Zynq supports multiple boot sources:
NAND/NOR Flash, SD Card, Quad-SPI, JTAG.
SD boot supports FAT16/FAT32.
BOOT.BIN, first partition
Refer to TRM (UG-585) Chapter 6.
Zybo ZedBoard
Boot Mode Jumper MIO2-6 Jumpers
JP5 JP7-11
Built into Zynq.
(You can't change it.)
BOOT.BIN
(Generate in SDK)
Application Code
(Or U-Boot & Linux)
Zynq FSBL
(fuzzball, anyone?)
Linux Kernel
ezdma should work with them all Zynq PLZynq PS Hardware
AXI VDMA
PL330 DMA
Released as GPL: https://github.com/jeremytrimble/ezdma
I hope to contribute this to the Linux kernel.
ezdma
Usage:
See the README:
https://github.com/jeremytrimble/ezdma
ezdma Caveats
May need some DMA core-specific tweaks,
depending on which driver you're using.
For my project, I had to set the DelayIRQ register in the
AXI DMA. This is device-specific.
As of 4/30/2015:
xilinx_axidma.ko has a few bugs:
Doesn't register with of_dma system.
Early callbacks cause data corruption
https://github.com/Xilinx/linux-xlnx/issues/54
I've submitted a fix for this but Xilinx hasn't accepted yet.
Run with my fork and you should be good:
https://github.com/jeremytrimble/linux-xlnx
Resources
Tutorial on device trees:
http://xillybus.com/tutorials/device-tree-zynq-1
Linux kernel documentation:
https://github.com/torvalds/linux/tree/master/D
ocumentation
Linux Weekly News: http://lwn.net/
Linux Device Drivers, 3rd Ed. (LDD3):
https://lwn.net/Kernel/LDD3/
Haifa Linux Club: http://haifux.org/index.html
Resources
Xilinx Linux tree:
https://github.com/Xilinx/linux-xlnx
With my bugfixes:
https://github.com/jeremytrimble/linux-xlnx
Analog Devices Linux tree:
https://github.com/analogdevicesinc/linux