2 creating a boot prom, Overview, Mkprom2 – Aero-Flex GAISLER GR-LEON4-ITX User Manual

Page 27

Advertising
background image

27

GR-LEON4-ITX Development Board

Quick Start Guide

5.2 Creating a boot PROM

Overview

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 I

2

C. 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 I

2

C 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:

mkprom2 -v -freq 100 -stack 0x4ffffff0 -pnp 0xffeff800 -ddr2spa_cfg1 0x96a08616
-ddr2spa_cfg3 0x13650000 -ddr2spa_cfg4 0x0000017f -gpt 0xc0000300 -irqmp 0xc0800100
-uart 0xc0000100 -dsustart 0xd0000000 -dsutrace -bdinit -nomsg

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:

jan@jan:~/Linux$ sparc-elf-gcc -Wall -c -g -O2 -DDVI -o bdinit.o bdinit2.c

After this we can create an image using the SnapGear Linux kernel as input:

jan@jan:~/Linux$ /opt/mkprom2/mkprom2 -v -freq 100 -stack 0x4ffffff0 -pnp 0xffeff800
-irqmp 0xc0800100 -dsustart 0xd0000000 -dsutrace -bdinit -nomsg snapgear-2.6-
p41/images/image.dsu

LEON2/3/ERC32 MKPROM prom builder for BCC, ECOS, RTEMS and ThreadX v2.0.25
Copyright Gaisler Research 2004-2007, all rights reserved.

phead0: type: 1, off: 65536, vaddr: 40000000, paddr: 40000000, fsize: 2674944,
msize: 2833212
phead1: type: 6474e551, off: 0, vaddr: 0, paddr: 0, fsize: 0, msize: 0
section: .stage2 at 0x40000000, size 10240 bytes
Uncoded stream length: 10240 bytes
Coded stream length: 3374 bytes

© Aeroflex Gaisler AB

June 2010, Rev. 0.2

Advertising