Information furnished by Aeroflex Gaisler AB is believed to be accurate and reliable.
However, no responsibility is assumed by Aeroflex Gaisler AB for its use, nor for any infringements
of patents or other rights of third parties which may result from its use.
No license is granted by implication or otherwise under any patent or patent rights of Aeroflex
Gaisler AB.
Figure 2-1: GR-LEON4-ITX Development Board.............................................................................7
Figure 2-2: User JTAG headers.......................................................................................................8
Figure 2-3: Setting the EDCL IP address.........................................................................................9
Figure 2-4: GRMON after connect.................................................................................................10
Figure 5-1: Selecting a SnapGear template configuration..............................................................21
REVISION HISTORY
RevisionDatePageDescription
0.12010-03-17 AllNew document
0.22010-06-16 29, 30, 32Fixed minor errors and omissions in U-boot image creation. Added
information on how to change the EDCL IP address used by U-boot.
This document is a quick start guide for the GR-LEON4-ITX Development Board.
The purpose of this document is to get users quickly started using the board. For a complete
description of the board please refer to the GR-LEON4-ITX Development Board User
Manual, the LEON4 system-on-chip is described in the LEON4-ASIC-DEMO Data sheet and
User's Manual. This quick start guide does not contain as much technical details and is
instead how-to oriented. However, to make the most of the guide the user should have
glanced through the two aforementioned documents and should ideally also be familiar with
the GRMON debug monitor.
The GR-LEON4-ITX data package and this document (including possibly newer revisions)
are available from the GR-LEON4-ITX product page at http://www.gaisler.com
1.2 References
RD-1LEON4-ASIC-DEMO Data sheet and User's Manual, Aeroflex Gaisler, 2010
RD-2GR-LEON4-ITX Development Board User Manual, Aeroflex Gaisler, 2010
RD-3GRMON User Manual
RD-4SnapGear Linux for LEON
The referenced documents can be downloaded from http://www.gaisler.com or be found on
the USB Flash stick accompanying the board.
1.3 Abbreviations
ASICApplication Specific Integrated Circuit.
DILDual In-Line
DDRDouble Data Rate
DSUDebug Support Unit
GPIOGeneral Purpose Input / Output
I/OInput/Output
I2CIIC, Inter integrated circuit, a 2 wire bus
IPIntellectual Property
MUXMultiplexer
PCBPrinted Circuit Board
RMIIReduced Media Independent Interface
SOCSystem On a Chip
SPISerial Peripheral Interface
The board is delivered with a power supply, JTAG adapter, USB and Ethernet cables.
Quick Start Guide
Figure 2-1: GR-LEON4-ITX Development Board
After unpacking the board, two routes can be taken. Either the preprogrammed Linux system
can be booted, or you can connect to the board using the GRMON debug monitor. If you
wish to start the bundled Linux system, please proceed to section 2.2 , to work with the
board through the GRMON debug monitor skip to section 2.3 .
2.2 Running the bundled Linux system
Overview
The GR-LEON4-ITX board's SPI boot PROM has been programmed with boot loader that
loads an image of the Linux kernel into main memory and then boots the kernel. The Linux
kernel then mounts its root file system, containing initialization scripts and software, from a
USB Flash stick. The Linux console is available both over the DVI video interface and over
the serial terminal.
Pre-requisites
The Linux kernel mounts the root filesystem from the USB stick included in the delivery.
Therefore the USB stick must be attached to the board. As previously stated, the Linux
console is available both over the video interface and over the serial terminal. As the board
only provides PIN headers with the receive and transmit lines for the serial terminal it is
recommended that a monitor, keyboard and mouse is attached to the board. According the
normal conventions for the PS/2 interface, the top connector (green) is the Mouse interface
and the bottom connector (purple) is the Keyboard interface. If using a USB keyboard and
mouse the devices should be connected via a USB hub and the USB memory stick should
be directly connected to one of the board's USB ports.
The connected monitor must support DVI-A output, the board can also be connected to a
monitor using a DVI-to-VGA adapter.
It is recommended, but not required, to connect the board to a Ethernet network where it can
receive an IP address via DHCP and access the Internet. This will allow system software to
automatically set the system date and time. If an Ethernet cable is attached it should be
connected to the first Ethernet port (the lower port).
Booting Linux
The bootloader will start Linux when the power adapter is attached to the board. Please skip
to section 3 for usage instructions. Section 5.1 contains transcripts of the output that should
be shown on the monitor during the boot process.
2.3 Connecting with the GRMON debug monitor
Overview
GRMON is a competent debug monitor that is used to debug GRLIB/LEON systems. The
GR-LEON4-ITX board has a number of debug interfaces that are all supported by GRMON.
Note: If you intend to use GRMON to work with the board it is recommended to clear the SPI
boot PROM as described in section 4.5 .
Pre-requisites
The board is delivered with a JTAG adapter that can be used to connect to the board. For a
description of how to set up the JTAG device, or for other JTAG adapters please see the
GRMON User's Manual. The documentation and a evaluation version of GRMON is
available from http://www.gaisler.com. Unless you will be loading software that will use the
USB Flash stick, it is recommended to not connect the USB Flash stick to the board.
The JTAG adapter shall be connected to the board using the JTAG pin header shown in the
middle bottom of Figure 2-2. Please ensure that the JTAG cable/adapter is connected with
the correct polarity, to prevent unintended damage to the board or cable.
To connect to the board using the JTAG adapter delivered with the board, issue the
command:
grmon -jtag
Connecting with a Xilinx USB JTAG adapter
The JTAG adapter shall be connected to the board using the JTAG pin header, or ribbon
connector, shown in the middle bottom of Figure 2-2. Please ensure that the JTAG
cable/adapter is connected with the correct polarity, to prevent unintended damage to the
board or cable.
To connect to the board using a Xilinx USB adapter, issue the command:
grmon -xilusb
Connecting via the USB interface
Please see the GRMON User's Manual for how to set up the required USB driver software.
Then connect to the board using the command:
grmon -usb
Connecting via serial UART
Please refer to the GR-LEON4-ITX Development Board User Manual and the GRMON
User's Manual for instructions on how to connect via the serial debug interface.
Connecting via Ethernet
Before connecting via Ethernet the host computer (the computer running GRMON) must be
connected to the same network as the GR-LEON4-ITX board. After that the IP address of
the Ethernet Debug Communication Link (EDCL) must be set up. This address can be set up
either by PROM software or by using another debug link. After connecting with an alternate
debug link, issue the command edcl <ip address>. Figure 2-3 below shows a session where
an IP address is set and the expected output:
Figure 2-3: Setting the EDCL IP address
After the EDCL IP address has been set, connect to the target with
grmon -eth -ip <ip address>
In the example above, the command would be: grmon -eth -ip 192.168.0.54
The GRMON User's Manual describes the capabilities of GRMON. Section 4 of this
document describes some usage scenarios for GRMON on the GR-LEON4-ITX board.
When the system is powered on the processor will load the Linux kernel from flash into main
memory. The kernel will then mount a Debian root file system system from the USB Flash
stick.
The sections below describe the system and the available user interfaces. The reader is
encouraged to read the full documentation before using the system for the first time.
3.2 Debian Operating System
The USB Flash stick contains an installation of Debian 4.0 (Etch). Debian is a well-known
GNU/Linux distribution which comes with extensive documentation and a large set of
precompiled applications. A good starting point for Debian documentation is
http://www.debian.org/doc/
Precompiled applications can easily be added using Debian's package management system.
To search for an application the command apt-cache can be used. To search for the
application `less', issue the command:
apt-cache search less
The output will show a large amount of packages, in this case the package we searched for
is simply named less:
less - Pager program similar to more
To install this application we now issue (to install applications you must be logged in as the
super-user):
apt-get install less
This will fetch the application from a public repository specified in the file /etc/apt/sources.list,
which at delivery is specified to a public repository that can be accessed over the Internet.
More documentation about the package management system is available at the Debian
website mentioned above.
3.3 Logging in to the system
There are three ways of logging in to the system,
•Serial terminal connected to the RS232 port (or GRMON with -u flag)
•Keyboard, mouse and computer screen directly attached the system
The recommended interface for system interaction is to attach a keyboard, a mouse and a
computer monitor and use the command line interface. This setup will be no different from
working with a normal Linux desktop system.
The serial terminal provides an alternative way of access. To access the system via the
serial port the terminal emulator should be configured for 38400 8N1. The system boot
messages will be displayed on the frame buffer device. The serial terminal will display a login
prompt when the system has completed its boot process.
rootrootSuper-user account. Should only be used for system administration.
Table 3-1: System accounts
3.4 Shutting down the System
To protect the integrity of the file system, the system software should be properly shut down
before powering down the board. The correctly shut down the system, issue the command:
shutdown -h now
This command must be issued as the super-user (root). After the system has reported that is
going down for system halt there will be no more output on the serial terminal. The system
will report Halt on the frame buffer console when it is safe to power-off the board. If an
external screen is not connected, it can be assumed safe to power-off the system 90
seconds after the The system is going down for system halt NOW! message has been
displayed on the serial terminal.
3.5 Graphical Interface (X Window System)
The X window system graphical interface can be started from the command line by using the
command startx. This will launch a session using the BlackBox window manager, right-click
on the mouse will bring up the menu.
Other window managers can be started by editing the .xsession file in the home directory
(for the user account, /home/user/.xsession). If the file is changed to exec fvwm2, startx will
launch an X session using the FVWM window manager (http://www.fvwm.org).
The graphical interface has a menu option to shut down the system, but this is not supported
by the hardware. Instead, X should be exited back to the shell before the system is shut
down.
The X window system may show some instabilities, particularly when exiting the graphical
interface. If this leads to the system being inaccessible from the keyboard and mouse it is
typically still possible to connect to the system via another interface, such as the serial
terminal or network.
3.6 Network Interface
The network interface is configured during system start-up with the information contained in
the file /etc/network/interfaces. The default content of this file is:
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
auto eth0
iface eth0 inet dhcp
To assign a static IP address the file contents could be changed to, for instance:
# The loopback network interface
auto lo
iface lo inet loopback
It is recommended that the system is attached to a network which allows access to the
Internet.
3.7 System Time Keeping
System software that is currently delivered with the board does have support for reading out
the board's real time clock and is therefore not able to keep the system time after the system
has been shut down. To avoid problems, such as irregularities caused by file time stamps
being in the future, it is strongly recommended that the system time is set at each boot. If the
system is connected to a network this can be automated by configuring the software to set
the time from a Network Time Protocol (NTP) server.
The delivered system is configured to set the time from the NTP server ntp1.chalmers.se.
Another NTP server can be selected by editing the file /etc/default/ntpdate.
If the board cannot be connected to a network with an NTP server, the time can be set
manually with the commands:
date --set 2008-10-10
date --set 14:00:00
The commands must be run as the super-user (root) and this must be done each time the
system has been restarted, unless the system has access to an NTP server.
3.8 Changing the Keyboard Layout
The system is configured to use a keyboard with a US American layout. If a keyboard with
another layout is to be used the keymap should be changed. For the console keyboard
layout issue the command below as the super-user (root):
dpkg-reconfigure console-data
In the package configuration, choose Select keymap from full list. The keymap that should
be chosen is likely prefixed with “pc /”. The system is delivered with the setting:
pc / qwerty / US american / Standard / Standard
The keymap for the graphical X Window system will also need to be changed if a keyboard
with a non-american layout is connected. This can be done by editing the /etc/X11/xorg.conf
file and modifying the line:
Option “XkbLayout”“us”
To the layout choice corresponding to the new keyboard, for example by exchanging “us” to
“fr”.
The subsections below assume that GRMON, the host computer and the GR-LEON4-ITX
board have been set up so that GRMON can connect to the board. The transcripts with
courier font below are from a shell session invoking the command line version of GRMON.
The same commands can be used when the debugger is used with a GUI.
grmon -eth -ip 192.168.0.54
GRMON LEON debug monitor v1.1.39 professional version
Copyright (C) 2004-2008 Aeroflex Gaisler - all rights reserved.
Component Vendor
LEON4 SPARC V8 Processor Gaisler Research
LEON4 SPARC V8 Processor Gaisler Research
SVGA Controller Gaisler Research
AHB-to-AHB Bridge Gaisler Research
AHB Debug UART Gaisler Research
AHB Debug JTAG TAP Gaisler Research
GR Ethernet MAC Gaisler Research
GR Ethernet MAC Gaisler Research
USB EHCI controller Gaisler Research
USB UHCI controller Gaisler Research
GR USB 2.0 Device Controller Gaisler Research
USB Debug Comm. Link Gaisler Research
Gaisler CAN with DMA Gaisler Research
Fast 32-bit PCI Bridge Gaisler Research
PCI/AHB DMA controller Gaisler Research
AHB-to-AHB Bridge Gaisler Research
LEON4 Debug Support Unit Gaisler Research
DDR2 Controller Gaisler Research
AHB/APB Bridge Gaisler Research
SPI Memory Controller Gaisler Research
AHB/APB Bridge Gaisler Research
AHB/APB Bridge Gaisler Research
Multi-processor Interrupt Ctrl Gaisler Research
Generic APB UART Gaisler Research
Generic APB UART Gaisler Research
Modular Timer Unit Gaisler Research
PS/2 interface Gaisler Research
PS/2 interface Gaisler Research
I2C slave Gaisler Research
AMBA Wrapper for OC I2C-master Gaisler Research
AMBA Wrapper for OC I2C-master Gaisler Research
AMBA Wrapper for OC I2C-master Gaisler Research
SPI Controller Gaisler Research
General purpose I/O port Gaisler Research
General purpose I/O port Gaisler Research
AHB status register Gaisler Research
PCI Arbiter European Space Agency
PCI trace buffer Gaisler Research
Use command 'info sys' to print a detailed report of attached cores
grlib>
At this point GRMON has successfully connected to the system. In this case we used the
Ethernet Debug Communications Link (EDCL). However any of the other debug links would
be fine. The first listing shows all cores available in the design. Giving the command info sys
prints a detailed report of the system. The output is too long to include here, however as a
sample with some most of the output cut out:
The above shows a sample of the cores connected. In the sample we can see that the EDCL
IP address has been set and that the EDCL has 2 kbyte hardware buffer, we can also see
that GRMON has identified, and configured the DDR2 controller to use, 256 MiB of DDR2
SDRAM memory.
4.2 Running an application
In this example we will compile and run an application of our own. The procedure for
downloading other applications is the same as shown below.
In order to cross-compile a stand-alone C application the host computer must have the BCC
toolchain installed. The toolchain can be downloaded from http://www.gaisler.com and is
also included on the USB Flash stick (software/toolchains/BCC).
Below is a transcript of a terminal with comments inserted:
Show contents of file hello.c:
user@host:~$ cat hello.c
#include <stdio.h>
int main(void)
{
printf("Hello world\n");
return 0;
}
Compile and link application, place resulting machine code in file hello:
user@host:~$ sparc-elf-gcc -Wall hello.c -o hello
Connect with GRMON and load the application. Note that the flag -u is given to GRMON.
This flag places the first UART in debug mode which means that GRMON will echo the
characters written to the UART and the user does not need to attach a dedicated serial
terminal to the board. Without -u switch, no output would come from the program. Please
see the GRMON User's Manual for more information.
GRMON LEON debug monitor v1.1.39 professional version
… output removed ….
Use command 'info sys' to print a detailed report of attached cores
Download application to RAM:
grlib> load hello
section: .text at 0x40000000, size 39584 bytes
section: .data at 0x40009aa0, size 2764 bytes
total size: 42348 bytes (70.4 Mbit/s)
read 201 symbols
entry point: 0x40000000
Run the application that was just downloaded:
grlib> run
Hello world
Program exited normally.
grlib>
After this the application can be downloaded and run again. Please also try commands such
as inst or hist after running an application and refer to the GRMON User's Manual for their
meaning.
4.3 Initializing the DVI transmitter
The DVI transmitter on the board must be initialized before it can pass video data from the
LEON4-ASIC-DEMO device to a monitor. There are several GRMON commands tailored for
initializing the DVI transmitter with values suitable for the GR-LEON4-ITX board.
CommandDescription
i2c 3 dvi init l4itx_dvi Initialize the DVI transmitter for IDF 2 input data (16-bit color depth) and
monitor connected via digital DVI.
i2c 3 dvi init l4itx_vgaInitialize the DVI transmitter for IDF 2 input data (16-bit color depth) and
monitor connected via analog interface (or DVI-to-VGA adapter).
i2c 3 dvi init l4itx_dvi 0Initialize the DVI transmitter for IDF 0 input data (24-bit color depth) and
monitor connected via digital DVI.
i2c 3 dvi init l4itx_vga 0Initialize the DVI transmitter for IDF 0 input data (24-bit color depth) and
monitor connected via analog interface (or DVI-to-VGA adapter).
Table 4-1: GRMON DVI transmitter initialization
The transcript below shows the GRMON output:
grlib> i2c 3 dvi init_l4itx_dvi
Transmitter was not set to Chrontel CH7301C (AS=0), changing..
DVI transmitter set to Chrontel CH7301C (AS=0)
Initializing CH7301 for LEON/GRLIB design..
Initialization done..
grlib>
After initializing the transmitter, the command i2c 3 dvi showreg will show the values of the
DVI transmitter's registers.
GRMON has support for drawing both test screens and images in PPM ASCII format. The
transcript below show commands that draw the built-in test screen in different modes. Note
that the DVI transmitter must be initialized for the correct bit depth.
grlib> i2c 3 dvi init_l4itx_dvi
Transmitter was not set to Chrontel CH7301C (AS=0), changing..
The test screen consists of a framed white cross on black background.
4.5 Interacting with the SPI boot PROM
GRMON provides support for interacting with SPI memory devices via its SPI Flash layer.
SPI memory devices can be controlled both over SPICTRL and SPIMCTRL cores. In the
examples below we will use the SPI memory controller core (SPIMCTRL) since it is attached
to the SPI boot PROM on the GR-LEON4-ITX board. The first step in communicating with
the SPI memory device is to allow the SPI Flash layer to detect the device:
grlib> spim flash detect
Got manufacturer ID 0x20 and Device ID 0x2017
No device match for READ ID instruction, trying RES instruction..
Found matching device: ST/Numonyx M25P64
grlib>
Since the SPIMCTRL core maps the memory device into AMBA address space we can read
the memory device using GRMON's mem command:
In the read out above the device is empty. We can now try to load a file to the device. First
we give a shell command that lists the contents of the small S-REC file we will use for this
example (do not issue the shell cat command on large or non-text files)
GRMON also has support for dumping the contents of the memory device into a S-REC file,
see the GRMON User's Manual for details.
Finally, we can erase the device, this should always be done before attempting to load data
into the memory. Erasing is quite slow and will take a little over sixty seconds:
The LEON4 ASIC device provides three I2C interfaces, two master interfaces (I2CM0 &
I2CM1) and one slave interface (I2CS).
As a demonstration I2C circuit, an on-board DS1672 Real-Time Clock circuit is connected on
the board to the I2CM0 interface of the ASIC.
The I2CM1 and I2CS interfaces of the ASIC are connected to 4 pin 0.1” headers on the
board, to allow an external circuit to be hooked-up. If required, 10kOhm pull-up resistors on
the SCL and SDA signals can be installed if the appropriate jumpers JP9 and JP10 are
installed.
One way to interact with multiple I2C devices on the board is to connect one of the I2C
masters to the I2C slave. This can be done by attaching J18:1 to J17:1 and J18:3 to J17:3.
Pull-ups also need to be enabled (JP9:1-2,3-4 or JP10:1-2,3-4).
The following GRMON command will initialize the slave:
The meaning of these write operations can be found by reading the I2C slave manual. The
connections made above connected I2CM1 to the slave. GRMON enumerates I2CM1 as I2C
core 2. To read data from the slave, issue:
grlib> i2c 2 read 0x50
Another way to interact with devices over I2C is to communicate with the DS1672 real time
clock (RTC). The RTC is connected to the bus if I2C M0, this master is enumerated as I2C
core 1 by GRMON. To detect any (7-bit addressable) devices on a bus the following
command can be used:
grlib> i2c 1 scan
Scanning 7-bit address space on I2C bus:
Detected I2C device at address 0x68
Scan of I2C bus completed. 1 device found
Aeroflex Gaisler provides a Linux distribution named SnapGear Linux. A release of
SnapGear Linux has been included on the first partition of the USB stick delivered with the
board (software/Linux contains the distribution and software/toolchains/Linux contains the
toolchain). SnapGear Linux can also be downloaded from http://www.gaisler.com
To be able to easily create a Linux configuration to run on the GR-LEON4-ITX board,
SnapGear Linux includes three template configurations that can be selected to quickly
compile a new Linux configuration:
Configuration nameDescription
gr_l4itx_videoMain console is DVI video. Mounts root filesystem from second partition on
USB Flash stick.
gr_l4itx_serialNo video support, main console is serial terminal. Mounts root filesystem
from second partition on USB Flash stick.
gr_l4itx_busyboxNo video support, main console is serial terminal. Root filesystem is a
memory image containing a Busybox system, does not mount USB Flash
stick.
Table 5-1: SnapGear template configurations
To be able to easily create a Linux configuration to run on the GR-LEON4-ITX board,
SnapGear Linux includes three template configurations that can be selected to quickly
compile a new Linux configuration.
First extract the SnapGear distribution:
jan@jan:~/Linux$ tar jxf snapgear-2.6-p41.tar.bz2
Enter the SnapGear directory and issue the command make xconfig. In the menu system
click Template Configurations and select the wanted configuration in the new window, also
check the box below the selection, as shown in Figure 5-1.
After the selection has been made, click the Main Menu button and in the remaining window
click Save and Exit.
The configuration of the SnapGear system and Linux kernel have now been updated to
predefined values. The system can now be compiled by issuing make at the system prompt.
The updated configuration can also be tailored as for normal SnapGear configurations. For
further information on SnapGear please see the SnapGear Linux for LEON manual.
Figure 5-1: Selecting a SnapGear template configuration
Downloading an image with GRMON
Quick Start Guide
After the new image has been compiled it can be downloaded to the board using GRMON.
In the transcript below we connect to the board using the EDCL, the flag -nb must be given
to GRMON in order to not break on page faults, the -u flag is also given in order to see the
serial console in GRMON:
grlib> load images/image.dsu
section: .stage2 at 0x40000000, size 10240 bytes
section: .vmlinux at 0x40004000, size 2782144 bytes
total size: 2792384 bytes (79.0 Mbit/s)
read 6260 symbols
entry point: 0x40000000
grlib> run
Booting Linux
Booting Linux...
pkbase: 0xfc800000 pkend: 0xfcc00000 fixstart 0xfcfe4000
Debian GNU/Linux 4.0 gr-leon4-itx ttyS0
gr-leon4-itx login:
The above transcript loaded an image built from the the gr_l4itx_video configuration. In that
case the boot messages are passed to the graphical console. The Linux boot takes some
time and you may need to wait a minute before reaching the login prompt on the serial
console. The video output will show the boot messages as the system starts up.
If we instead load an image built from the gr_l4itx_serial configuration, all output will be
directed to the serial console:
grlib> load images/image.dsu
section: .stage2 at 0x40000000, size 10240 bytes
section: .vmlinux at 0x40004000, size 2642880 bytes
total size: 2653120 bytes (79.1 Mbit/s)
read 6159 symbols
entry point: 0x40000000
grlib> run
Booting Linux
Booting Linux...
PROMLIB: Sun Boot Prom Version 0 Revision 0
Linux version 2.6.21.1 (jan@jan) (gcc version 3.4.4) #17 SMP Tue Mar 16 15:28:21 CET
2010
ARCH: LEON
TYPE: Leon2/3 System-on-a-Chip
Ethernet address: 0:0:0:0:0:0
CACHE: 2-way associative cache, set size 4k
Boot time fixup v1.6. 4/Mar/98 Jakub Jelinek (jj@ultra.linux.cz). Patching kernel
for srmmu[Leon2]/iommu
64MB HIGHMEM available.
Nocache: 0xfc000000-0xfc400000, 1024 pages [128-1280]
node 2: /cpu00 (type:cpu) (props:.node device_type mid mmu-nctx clock-frequency
uart1_baud uart2_baud )
node 3: /a: (type:serial) (props:.node device_type name )
node 4: /ambapp0 (type:ambapp) (props:.node device_type name )
node 5: /cpu01 (type:cpu) (props:.node device_type mid clock-frequency )
PROM: Built device tree from rootnode 1 with 1813 bytes of memory.
DEBUG: psr.impl = 0xf fsr.vers = 0x7
Built 1 zonelists. Total pages: 64338
Kernel command line: console=ttyS0,38400 root=8:2 rootdelay=10 init=/sbin/init
PID hash table entries: 1024 (order: 10, 4096 bytes)
Todo: init master_l10_counter
Attaching grlib apbuart serial drivers (clk:100hz):
Console: colour dummy device 80x25
Dentry cache hash table entries: 32768 (order: 5, 131072 bytes)
Inode-cache hash table entries: 16384 (order: 4, 65536 bytes)
pkbase: 0xfc800000 pkend: 0xfcc00000 fixstart 0xfcfe4000
Configuring network interfaces...Internet Systems Consortium DHCP Client V3.0.4
Copyright 2004-2006 Internet Systems Consortium.
All rights reserved.
For info, please visit http://www.isc.org/sw/dhcp/
Listening on LPF/eth0/00:00:7a:cc:43:12
Sending on LPF/eth0/00:00:7a:cc:43:12
Sending on Socket/fallback
DHCPREQUEST on eth0 to 255.255.255.255 port 67
DHCPACK from 192.168.0.1
bound to 192.168.0.114 -- renewal in 299105 seconds.
done.
INIT: Entering runlevel: 2
Starting system log daemon: syslogd.
Starting kernel log daemon: klogd.
Starting system message bus: dbus.
Starting mouse interface server: gpm/etc/rc2.d/S20gpm: line 65: /dev/input/mice: No
such device
/etc/rc2.d/S20gpm: line 65: /dev/input/mice: No such device
/etc/rc2.d/S20gpm: line 65: /dev/input/mice: No such device
.
* Not starting internet superserver: no services enabled.
Starting periodic command scheduler: crond.
Last login: Thu Jan 1 01:03:40 1970 on ttyS0
Linux gr-leon4-itx 2.6.21.1 #17 SMP Tue Mar 16 15:28:21 CET 2010 sparc
The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.
Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
user@gr-leon4-itx:~$ echo "Linux input via GRMON"
Linux input via GRMON
user@gr-leon4-itx:~$
Finally, we load the gr_l4itx_busybox configuration:
grlib> run
Booting Linux
Booting Linux...
PROMLIB: Sun Boot Prom Version 0 Revision 0
Linux version 2.6.21.1 (jan@jan) (gcc version 3.4.4) #18 SMP Tue Mar 16 15:36:57 CET
2010
ARCH: LEON
TYPE: Leon2/3 System-on-a-Chip
Ethernet address: 0:0:0:0:0:0
CACHE: 2-way associative cache, set size 4k
Boot time fixup v1.6. 4/Mar/98 Jakub Jelinek (jj@ultra.linux.cz). Patching kernel
for srmmu[Leon2]/iommu
64MB HIGHMEM available.
Nocache: 0xfc000000-0xfc400000, 1024 pages [128-1280]
node 2: /cpu00 (type:cpu) (props:.node device_type mid mmu-nctx clock-frequency
uart1_baud uart2_baud )
node 3: /a: (type:serial) (props:.node device_type name )
node 4: /ambapp0 (type:ambapp) (props:.node device_type name )
node 5: /cpu01 (type:cpu) (props:.node device_type mid clock-frequency )
PROM: Built device tree from rootnode 1 with 1813 bytes of memory.
DEBUG: psr.impl = 0xf fsr.vers = 0x7
Built 1 zonelists. Total pages: 63934
Kernel command line: console=ttyS0,38400 root=8:2 rootdelay=10 rdinit=/sbin/init
PID hash table entries: 1024 (order: 10, 4096 bytes)
Todo: init master_l10_counter
Attaching grlib apbuart serial drivers (clk:100hz):
Console: colour dummy device 80x25
Dentry cache hash table entries: 32768 (order: 5, 131072 bytes)
Inode-cache hash table entries: 16384 (order: 4, 65536 bytes)
pkbase: 0xfc800000 pkend: 0xfcc00000 fixstart 0xfcfe4000
Memory: 251328k/262144k available (2120k kernel code, 10728k reserved, 292k data,
1776k init, 65536k highmem)
Mount-cache hash table entries: 512
Entering SMP Mode...
0:(2:2) cpus mpirq at 0xc0800110
Starting CPU 1 : (irqmp: 0xc0800110)
DEBUG: psr.impl = 0xf fsr.vers = 0x7
Started CPU 1
Brought up 2 CPUs
Total of 2 processors activated (399.36 BogoMIPS).
migration_cost=10000
NET: Registered protocol family 16
Found GRPCI controller - ahb mem,io: 0x80000000, 0xfff20000 - apb 0xc0100800 - irq:
25
Assigning PCI BARs.
SCSI subsystem initialized
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
NET: Registered protocol family 2
Creating a boot PROM allows the system to boot software after power-up without the need
to connect with GRMON. There are several boot loaders available for LEON/GRLIB
systems. This document contains descriptions on how to use two of them, MKPROM2 and
U-boot, with the GR-LEON4-ITX board.
MKPROM2
Note: MKPROM2 does not support creating PROM images of SMP Linux images. To create
a bootable Linux image with MKPROM2 disable SMP support in the kernel configuration.
Please see the MKPROM2 documentation for a general description of the application. This
sections deals with specifics of the GR-LEON4-ITX board. The MKPROM2 package is
included on the USB Flash stick in the directory software/bootloaders/mkprom2.
MKPROM2 does not include support for initializing the DVI transmitter. In order to do this
MKPROM can be instructed to include software provided by the user. The data package
included with the board contains the file gr-l4itx-pack/mkprom2/bdinit.c that contains code for
initializing the DVI transmitter via I2C. To compile bdinit.c so that it can be included in the
boot ROM issue the command:
sparc-elf-gcc -Wall -c -g -O2 bdinit.c
Add the switch -DBPP24 if you will use 24-bit color and add -DDVI if you want to use digital
DVI output (to autodetect the type of screen connected via I2C and select the correct
initialisation parameters is left as an exercise for the reader). The command line options for
MKPROM2 to be used with the GR-LEON4-ITX are:
However, at the time of writing MKPROM2 contains some hard coded values for addresses
in the system that makes it unsuitable for creating boot ROMs for the GR-LEON4-ITX board.
A workaround is to skip much of the built-in initialization provided by MKPROM and instead
perform the initialisation with the bdinit(..) calls. The file gr-l4itx-pack/mkprom2/bdinit2.c
contains initialisation code for the DDR2 memory controller, APBUART and timer unit.
In order to build a boot ROM for a system that will use video output, first compile bdinit2.c:
creating LEON3 boot prom: prom.out
Searching for compiler to use (sparc-elf, sparc-rtems or sparc-linux):
sparc-elf-gcc (GCC) 3.4.4
Copyright (C) 2004 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
The SPI Flash memory device can now be programmed with the PROM contents in the
prom.out file generated by MKPROM2 (it is recommended to use the Ethernet debug link
when programming the flash), start GRMON and issue the following commands:
grlib> spim flash detect
Got manufacturer ID 0x20 and Device ID 0x2017
No device match for READ ID instruction, trying RES instruction..
Found matching device: ST/Numonyx M25P64
The flash contents can now also be verified, either by spim flash verify prom.out or by the
faster verify prom.out:
grlib> verify prom.out
section: .text at 0x0, size 1575824 bytes
section: .data at 0x180b90, size 32 bytes
total size: 1575856 bytes (12.0 Mbit/s)
entry point: 0x00000000
grlib>
The PROM has now been successfully programmed. The software located in PROM can
now be booted by power cycling the board or by pushing the reset button.
U-boot
U-Boot (Das Universal Boot loader) is boot loader for embedded systems developed by
http://www.denx.de and a port exists for SPARC/LEON. The LEON U-Boot can boot
RTEMS, VxWorks and Linux 2.6. Building the u-boot boot loader can be done with the
sparc-elf-gcc (BCC) crosscompiler.
The GR-LEON4-ITX data package contains a pre-built U-Boot image with a configuration
suitable for the board. The image is available in different formats in the directory gr-l4itx-
pack/u-boot/prebuilt this directory also contains a pre-built version of the mkimage tool. The
source for U-boot is on the USB Flash stick in the directory software/bootloaders/u-boot. To
re-build u-boot, enter the U-boot source directory and issue the command make gr_leon4_itx_config followed by make.
To load the image onto the board, issue the following commands:
grlib> spim flash detect
Got manufacturer ID 0x20 and Device ID 0x2017
No device match for READ ID instruction, trying RES instruction..
Found matching device: ST/Numonyx M25P64
grlib> spim flash erase
grlib> spim flash load u-boot
section: .text at 0x0, size 208150 bytes
section: .u_boot_cmd at 0x32d18, size 1272 bytes
section: .data at 0x33210, size 34816 bytes
section: .got at 0x3ba10, size 4688 bytes
total size: 248926 bytes (116.9 kbit/s)
read 736 symbols
entry point: 0x00000000
grlib> verify u-boot
section: .text at 0x0, size 208150 bytes
section: .u_boot_cmd at 0x32d18, size 1272 bytes
section: .data at 0x33210, size 34816 bytes
section: .got at 0x3ba10, size 4688 bytes
total size: 248926 bytes (10.6 Mbit/s)
entry point: 0x00000000
grlib>
Next we need to build a Linux kernel image that U-boot can handle. U-Boot needs a header
to know how to interpret the binary images. The images support compression and CRC
verifying. To create an image, the mkimage tool must be in the system path. The Linux
kernel has a prepared build target for generating u-boot images (uImage):
jan@jan:~/Linux/snapgear-2.6-p41$ cd linux-2.6.21.1/
jan@jan:~/Linux/snapgear-2.6-p41/linux-2.6.21.1$ make ARCH=sparc \
In order to interact with the pre-built version of U-boot the board must be connected to a
monitor and a USB keyboard. The uImage created above should be placed in the root of a
TFTP sever and a Ethernet cable should be connected to the GR-LEON4-ITX board's
second (top) Ethernet port.
After the necessary preparations have been made reset the board and press a key on the
USB keyboard to stop the U-boot boot process. When presented with the U-boot prompt
issue the following commands (see the U-boot documentation for more commands and the
meaning of the commands below):
=> setenv severip <ip address of tftp server>
=> saveenv
=> run getkernel
The performance of the system is less compared to what is advertised for LEON4
The advertised LEON4 performance figures typically come from systems that include a
Level-2 cache core. The GR-LEON4-ITX board and LEON4-ASIC-DEMO device were
constructed using a pre-release version of the LEON4 processor and the L2 cache core was
not available at this time. If you need to benchmark a system with a Level-2 cache, please
contact Aeroflex Gaisler.
I lost the contents of the USB Flash stick
Contact Aeroflex Gaisler for a possible download of the original stick contents, or a
replacement stick.
How do I restore the original PROM contents?
A copy of the original PROM contents is available in the GR-LEON4-ITX data package under
the directory gr-l4itx-pack/prom. The file l4itx_prom.srec can be written to the SPI boot
PROM using the GRMON commands: spim flash detect, spim flash erase, spim flash load l4itx_prom.srec.
GRMON reports a system frequency of 100 MHz, should it not be 200 MHz?
The bus with most of the peripherals (AHB bus 1) runs at 100 MHz and the bus with the
LEON4 processors (AHB bus 0) runs at 200 MHz. GRMON connects bus 1 and also finds
the timer unit there, therefore GRMON reports the system frequency as 100 MHz, the
processor cores still run at 200 MHz.
6.2 Interfaces
Software freezes when initializing the Ethernet Interface
Software that relies on the MDIO interrupt for Ethernet PHY initialization may time out when
bringing up the Ethernet interface. This is an issue with some version of the Linux kernel
included in the SnapGear GNU/Linux distribution provided by Aeroflex Gaisler. A general
quick fix is to attach a network cable to each Ethernet port that is being initialized. The long
term fix is to contact the software vendor and ask for an update.
I have problem X when using the USB Debug Communication Link
The USB Debug Communication Link has a bug that leads to repeated accesses. This is a
problem when accessing register interfaces that are FIFOs, that is the interfaces are
affected by being read or written more than once with the same value. Therefore the USB
Debug communication link must not be used when interacting with a UART (for instance
when using the -u flag to GRMON) or using the SPIMCTRL or SPICTRL cores.
Also, jumper J10 17-18 (GPIO 43) must be installed at power-on for the USB DCL interface
to work.
The system freezes when using it together with my PCI device
The GRPCI core's PCI target interface included in the design has a bug that causes it to
perform bursts of infinite length if a PCI master performs a burst of eight or more words.
There is no known workaround for this issue and the LEON4-ASIC-DEMO device cannot be
used in a system where it will be accessed by a master performing bursts over eight words in
length.
I2C communication does not work
Please make sure that the bus has pull-ups (see the GR-LEON4-ITX Board User Manual for
how to enable pull-ups).
My USB disk is not detected / does not work
The board may not be able to provide enough power for drives connected via USB. Try
connecting the device via a USB hub that has a power source.
How do I change the Ethernet Debug Link IP address in the delivered system?
The system is delivered pre-programmed with the bootloader U-boot. After system reset, Uboot will initialize the system, which includes setting the Ethernet Debug Communication
Link's (EDCL) IP address. The address used by U-boot can be changed by attaching a USB
keyboard and pressing any key during the first seconds of system boot. U-boot will then
interrupt the boot process and show a prompt.
The IP address that U-boot will assign to the EDCL is stored in the variable greth_edcl_ip0.
To show the systems variables, issue the command:
=> printenv
To change the EDCL IP address to 172.16.0.24, issue the command:
=> setenv greth_edcl_ip0 172.16.0.24
To preserve the value after system reset the variable needs to be saved to SPI flash, this is
done with the command:
=> saveenv
It is also possible to change the EDCL IP address via GRMON, using the edcl command.
However, this will not affect the address used by U-boot after system reset.
6.3 Additional support
For customers with a support contract, or for issues where the board or device seem faulty,
please contact support@gaisler.com.