Home
snapgear Manual
Contents
1. 39 8 5 R nning on hardWate isrener R pa e aa dha tha EEE aae 40 9 ROOT FILE SYSTEM OVER ETHERNET USING ATA OVER ETHERNEIT 41 9 1 Setting tip ATAOE Servet aont Zeg EERSTEN 41 9 2 Configuring the boot loader and main SnapGear opttonmg 4 9 3 Configuring the Linux kernel sssini 42 9 4 Configuring the vendor user applications 42 9 5 Building kernel boot loader and kamt 43 9 6 Running on barduware 43 10 ROOT FILE SYSTEM ON COMPACTFLASH USING XILINX SYSTEM 44 10 1 Setting up the root filesystem 44 10 2 Configuring the boot loader and main SnapGear opttomg 44 10 3 Configuring the Linux 44 10 4 Ruining ot ard Ware 45 11 RUNNING GRLINUX SPLACK FROM AN ATA HARD DISK 46 EROFLEX LINUX SNAPGEAR 4 GAISLER 11 1 Installing tbe kernel Onto seh tssevedcabnavvegiterses steed 46 11 2 Preparing the harddrive een sek eels i ites te Gee ieee 46 11 3 RUNING E E E 47 12 INSTALLING DEBIAN 3 1 ON LEON LINUN eeececesseseeseeee
2. 10 2 Configuring the boot loader and main SnapGear options An example configuration is outlined in the following table The root file system is mounted from the device with major number 254 which is the Xilinx System ACE block device and partition 1 To mount the root file system from the second partition the root argument on the kernel command line should be changed to root 254 2 Name Value Vendor Product Selection Vendor Gaisler Gaisler Product Leon3mmu Gaisler Leon2 3 mmu options SPARC v8 Yes FPU support Yes Clock frequency 40MHz Baudrate 38400 In memory root filesystem none Init pathname sbin init Kernel command line console ttySO 38400 root 254 1 rw Kernel Library Defaults Section Kernel Version Linux 2 6 x Customize Kernel Settings Yes Customize Vendor User Settings No Libc version None Table 10 1 SnapGear options 10 3 Configuring the Linux kernel In addition to the default settings of the Linux 2 6 x kernel add the features described by the following table EROFLEX LINUX SNAPGEAR 45 GAISLER Name Function General Setup BLK_DEV_INITRD Disable INITRD support Device Drivers Block Devices XILINX_SYSACE Enable Xilinx SystemACE support File systems Network file systems Select the file systems that needs to be supported Table 10 2 Linux kernel configuration 10 4 Running on hardware The si
3. EROFLEX GAISLER SnapGear Linux for LEON Manual SnapGear Linux for LEON Written by Daniel Hellstr m LINUX SNAPGEAR Version 1 39 0 April 2009 46 31 7758650 Kungsgatan 12 tel 411 19 G teborg fax 4 Sweden www aeroflex com gaisler 46 31 421407 EROFLEX LINUX SNAPGEAR 2 GAISLER Table of Contents INTRODUC TION 5 TSO Fame egies dds ve ee Ee E 5 Snap Gear ERC 5 Boot loader fot LEON Lag cieee neonata e 5 LEON simulator to speed up the development Drocesg 5 Obtaining EE 6 Stipported hardware 6 SUTER 6 INSTALLING GNU TOOLCHAIN AND LEON 1 7 Selecting POOH E EE 7 Installing the toolcham 7 Installing SnapGear for LEON Linux 20 8 Installing SnapGear for LEON Linux 28 8 9 Processor type and MMU sssrinin seneta eaea aE Ae EE EErEE AEAEE EA EdE 9 GMT ANY goretan esse casucs teers teens r EA E E rE E E T E Rae See 10 Static vs Dynamic hnkin gi eeng steesceviedea seats gege E EEE ieee a RRi 10 Moolehains tor LINUX eegene 10 Toolehains for Linux 2 0 siran einne e aay Eege 10 e 10 3 11 Symmetric mmlt proceseing 12 Configuring the
4. for example NFS or ATA disk Custom initramfs source The text file used to create an custom filesystem not necessarily based on SnapGear See linux 2 6 x Documentation filesystems ramfs rootfs initramfs txt for details Kernel command line The kernel parameters is specified by a string The string is interpreted by Linux during the boot sequence See linux 2 6 x Documentation kernel parameters txt for details Default console ttyS0 34800 Note When using Linux 2 0 x the kernel command line is set from within the kernel configuration tool under General setup ROM bank size Bank size of flash ROM rws Number of ROM Flash read wait states ROM wws Number of ROM Flash write wait states Enable write cycles to PROM Boot loader makes it possible to write to FLASH without tampering with memory configuration registers RAM type RAM type to be used SRAM or SDRAM Alternative physical kernel address It is possible to manually select an address where the kernel will be started from The base address of the stack can be changed as well One can this way make room for a custom data area the Linux kernel will only use the memory between the kernel base address and the stack base Table 3 3 Boot loader parameters 3 4 1 Symmetric multi processing Multi LEON3 processor systems is supported by the boot loader The multi processor support is controlled from within the Linux 2 6
5. scope of this document it is described how to set up Linux with other distributions via NFS 1 2 SnapGear Linux SnapGear Linux is a full source package containing kernel libraries and application code for rapid development of embedded Linux systems It is configured from a graphical interface similar to the Linux 2 4 kernel configuration utility 1 3 Boot loader for LEON Linux A small boot loader has been incorporated into the SnapGear Linux software distribution it is designed especially for the LEON processors both SMP and uniprocessor systems It is capable of passing arguments to any of the Linux kernels and initialize low level hardware The main purpose of the boot loader should be to initialize basic hardware such as memory controllers and console output for debugging before launching LEON Linux The SnapGear graphical interface as been extended to allow users to set boot loader parameters in an easy fashion The boot loader is stored in a non volatile memory at the address where the LEON processor reads its first instructions to be executed usually stored in flash at address 0 During the development process GRMON may be used to load the resulting image into RAM directly thus bypassing the flash This shortens the development time drastically Using this method only the last part of the boot loader is executed it is often referred to as stage 2 Instead GRMON initializes the hardware before running stage 2 1 4 LEON si
6. write file configtable iJ 2 2 printf error i2c register write d failed n i exit 1 return 0 13 4 Building the application The application can be compiled with natively with to cross compile use sparc linux gec and add the static flag for portability gcc Wall o i2c_dvi_init i2c_dvi_init c The required define I2C_SLAVE is defined in the kernel header file i2c dev h Since this file may be missing on the build system it can be convenient to work around the missing define with gcc Wall DI2C_SLAVE 0x0703 o i2c_dvi_init i2c_dvi_init c EROFLEX LINUX SNAPGEAR 54 GAISLER 14 SUPPORT For support contact the Gaisler Research support team at support gaisler com
7. 2 42 5 62 G 0 45 00000000 Sun Boot Prom V EROFLEX LINUX SNAPGEAR 29 GAISLER 6 3 Debugging userspace applications Debugging user space applications is different from kernel debugging One can still use GRMON the same way as for kernel debugging but is only effective in simpler debugging cases When debugging userspace applications a native GDB debugger executing on the LEON target may be used to debug applications using the serial console for input This is similar to debugging PC applications and not described here The CPU may be heavily loaded since GDB share the CPU with the application also application sources and debug binaries are required at the target when debugging natively For targets having a serial port or a network connection it is possible to debug Linux applications remote The debugging interface is presented on a PC offloading the target CPU The most common solution is to use a GDB TCP IP server gdbserver exporting control to a remote PC running GDB sparc linux gdb compiled for target binaries SPARC GRMON must be started with the flag nswb in order to instruct GRMON not to interfere with the debugging process or else software breakpoints result in GRMON taking over CPU note that this is only needed when debugging userspace applications not when debugging the kernel 6 3 1 Setting up a debugging environment Together with the sparc linux toolchain version 1 0 1 and onwards comes bin sparc li
8. 2 6 x lt 2 0 13 IERCH 0 13 Symmetric multi processing support 13 Gaisler AMBA Plug amp Play procfs support 13 GRLIB APBUART LEON3 DEE 14 IS Re CAE D BEE 14 GREIB GRETH 10 1 00 1 OOO ssi ees eseu ts ae deeg 14 GRLIB OpenCores Ethernet MAC 14 SMC 91x Bthermet MESSER 14 GRLIB GRETH 10 100 1000 over BCL 15 GREIB OpenG ores 2G Master eege ed rege deeg geed 15 VE ET PCL GE 15 GRIB GRPS2 eiia nenni es A eege eae ee eR 15 ORLID SPIC NEE 15 GRLIB E e NEE 15 GRLID e EE 16 GRLIB GRUSBDG iu aici iis eat ahead a EA came EE EE 16 GRIGIB GR VG Aeree ontesnndeapravs fess teal tak EEN AOE 16 GRLIB ATA Controller earst rit Or ER ra EE oa Er Tao EEIE Ei ipes oei EriiS ta 17 Non standard PAGESIZE support 18 Configuring the 2 0 a Rear a i a ara aera a set a E aapi 18 LEON processor type 700 EEN AAA A TE EENE 18 GRLIB APBUART LEON 3 Jessener aE EEE E A e 19 LEON Seral CEON Jeania ha ees e EN AEREE EEA EAE EEA 19 GRLIB GRETH 10 100 Ethernet MAC 19 GRLIB OpenCores 10 100 Ethernet MAL 19 SMC 91C111 10 100 Ethernet MAC 19 GRLIB VGA text frame buffer support 20 GRLIB GRPS2 PS 2 1 80 00 1 20 Applications included in ROMES AA 20 Template configurations c cccceccesses
9. CUSTOM APPLICATIONS Custom applications can be added into the SnapGear projects in several ways the simplest ways is to add the source code to the already prepared custom directory snapgear pxx user custom It is also rather easy to modify the menu of the SnapGear Application menu and add a new application to the GUI It also possible to copy a binary compiled outside of the SnapGear distribution folders This chapter shows the simplest possible alternative adding an application to the user custom directory 5 1 Creating an application A simple application that print out the number of arguments it was invoked is saved to user custom args c include lt stdio h gt int main int argc char argv printf s you passed SO arguments n argv 0 argc return 0z 5 2 Setting up compilation directives For the application to be compiled one must add it to user custom Makefile The Makefile may be edited as follows Add these 4 lines EXEC9 args OBJS9 args o S EXEC9 S OBJS9 CC S LDFLAGS o 46 S OBJS9 S LDLIBSS LDLIBS_S Add EXECY9 to the end of the all statement all EXEC1 S EXEC5 S EXEC6 EXEC8 EXEC9 INSMODEXE 5 3 Including application to file system From the Core Applications it is possible to enable custom applications the make utilities will enter the user custom directory and compile it as described by user custom Makefile a Co
10. Name Function Graphics Support FB Frame buffer sub system FB_GRVGA Frame buffer driver for GRVGA controller FRAMEBUFFER_CONSOLE Frame buffer console support FONTS Compiled in fonts FONT_8x16 8x16 Font support LOGO Add boot logo support LOGO_LINUX_CLUT224 Include a coloured Linux logo Input devices SERIO_LEON3 Driver for Gaisler PS 2 controller SERIO_LEON3_KEYB_IRQ The IRQ number of assigned to the PS 2 controller connected to the keyboard INPUT_KEYBOARD Keyboard sub system KEYBOARD_ATKBD AT keyboard driver Table 7 3 Kernel configuration 7 4 Configuring SnapGear Applications Below is a description of how the SnapGear ROMFS can be configured EROFLEX GAISLER Name Function BusyBox Init First application that gets started after boot Init use inittab Make init read etc inittab for settings Table 7 4 SnapGear configuration 7 5 Building the kernel and applications Building the kernel libraries and applications can be done as follows make 7 6 Setting up etc inittab Init reads the etc inittab line after line at start up and launches the etc rc sh system initialization script and spawns applications on each console as set up nittab can be created by typing EROFLEX LINUX SNAPGEAR 37 GAISLER cat lt lt EOM gt romfs etc inittab System initialization script isysinit etc rc
11. SBUS and UPA framebuffers FB_SBUS Sound USB support oO Epson 1D13XXX framebuffer support FB_S1D13XXX Virtual Frame Buffer support ONLY FOR TESTING FB_VIRTUAL Illustration 3 10 Adding Frame Buffer driver When using the SVGA controller to provide console interface to the system the resolution bit depth and other parameters can be set from the kernel parameters Table 3 4 lists available arguments to the driver The Mem size parameter can be calculated as resolution times bit depth in bytes For example 614400 bytes video EROFLEX LINUX SNAPGEAR 17 GAISLER buffer makes a resolution of 640x480 8 bit 640x480 16 bit and 800x600 8 bit resolution possible however 800x600 16 bit would not fit into the memory as that would need 960000 bytes The last argument fb_addr can be utilized to control where in the memory the framebuffer should be placed This is useful for systems that have been designed with a dedicated memory for the framebuffer Normally this argument does not have to be specified in which case the driver will allocate space from the main memory to use for the framebuffer Order Value Custom All Description 0 video grvga All Needed to select frame buffer driver 1 Custom All Select one of the values to the left When full control is 1024x768 60 Vee oe ened 2 10 are 800x600 72 needed in addition to 11 and 12 800x600 60 800x
12. float sin f sf n i v 2 main argc 1 argv Oxefbdled4 at printf float sin f f n i v 2 main argc 1 argv Oxefbdled4 at printf float sin f f n i v 2 main argc 1 argv Oxefbdled4 at printf float sin f sf n i v 2 main argc 1 argv Oxefbdled4 at printf float sin f f n i v al The output on the LEON target terminal is now Sash command shell gt gdbserve version 1 1 1 r 1223 bin testsin Process bin testsin created pid 26 Remote debugging using 1223 testsin float sin 0 000000 0 000000 float sin 1 000000 0 841471 float sin 2 000000 0 909297 float sin 3 000000 0 141120 float sin 4 000000 0 756802 testsin testsin testsin testsin testsin 10 10 10 10 10 EROFLEX GAISLER One can change the execution flow by manipulating variables within the loop The integer i set to 90 the breakpoints are removed and the application are continued to is endpoint Delete all breakpoints set variable i 90 y or n y gdb gdb delete gdb cont Continuing Program exited normally Finally the LEON target s console output was EROFLEX LINUX SNAPGEAR 33 GAISLER Sash command shell version 1 1 1 gt gdbserver 1223 bin testsin Process bin testsin created pid 26 Remote debugging using 1223 testsin Float sin 0 000000 0 000000 Float sin 1 000000 0 841471 Float sin 2 000000 0 90
13. gt 30 6 3 4 Connecting with GDB to gdbeerver 30 6 3 5 GDB example Usa gecici iie 30 6 3 6 DDD 678 EEN 33 6 3 7 Insight rarene S E E E E E E 33 6 4 Using NFS to simplify application updates 33 6 5 Console output 34 6 5 1 Redirecting output to NFS ebare 34 6 5 2 TELNE Tiover 34 7 PS 2 KEYBOARD AND VGA CONSOLE 35 7 1 Hardware Conf guraton 2 saccccsecsest 35 7 2 Configuring the boot loader and main SnapGear opttomg 35 7 3 Configuring the Linux 35 7 4 Configuring SnapGear Applceatons gt 36 7 5 Building the kernel and 0168 0 36 7 6 ee EE He 7 7 Building again with inittab and re ah 37 7 8 Rumming op Hard Wares 37 8 ROOT FILE SYSTEM OVER ETHERNET USING NES 38 8 1 Setting tip NFS server On 38 8 2 Configuring the boot loader and main SnapGear opttons 38 8 3 Configuring the Linux kernelre nnan EERSTEN teas 39 8 4 Building kernel and boot Ioader
14. in the string A watchpoint it set to OxF0227519 S As the execution continues it can be observed that the processor is stopped at the space character the character just before S this is because watchpoints must be aligned to a 32 bit boundary GRMON does this for us The GRMON command bt short for backtrace show the current call history from it one can see that prom_init called printk which called vprintk and so on LINUX SNAPGEAR grmon jtag grlib gt tm both combined instruction AHB tracing grlib gt lo image dsu section stage2 at 0x40000000 size 10240 bytes section vmlinux at 0x40004000 size 3670272 bytes total size 3680512 bytes 226 5 kbit s read 5814 symbols entry point 0x40000000 grlib gt symbol image read 5805 symbols entry point 0xf0004000 grlib gt hbreak printk grlib gt run breakpoint 1 printk 0xf003lelc grlib gt reg INS LOCALS OUTS GLOBALS 0 F0227510 F0399000 FO2275E0 00000000 1 00000000 40000400 00000000 00000002 2 00000000 00000000 00000000 F31010E3 3 FOOOOCTC 00000000 00000140 F0000D94 4 00000000 00000000 00000000 F0237000 5 00000000 00000000 00000001 00000000 6 FOOOFF38 00000000 FOOOFEDO F000E000 7 F0266124 00000000 F02666BC F0000C7C psr F3401FE6 wim 00000001 tbr F0004050 y pc fO03lelc mov i0 Sot npc f0031e20 st il Sfp 0x48 grlib gt dis 0xf0031e10 f0031e10 81c3e008 reti FOO31e14 01000000 nop FOO31le18 Y9de3bf98 save sp 104 Zap FOO31lelc 90100018 mov
15. interface dev ttySx This driver uses hard coded addresses instead of probing the AMBA bus for Plug amp Play information This driver is E Vendor Gaisler BEE Vendor Gaisler v NI n APBUart support Help ei Platform dependant setup lt Help ges e E Platform dependant setup w YGA support Help 0xc0000000 Base address of Videomem Help Moan _tein Ir lv ll GREIN Ethernet support Help penom PA Help vyj LEON over TSIM the remote SPARC simulator Help lt lt 53 ROM Kemel executes from Help Help RB Help Main Menu Next Prev Help l Illustration 3 14 Platform set up Help Help PS drivers 7 oK Next Prev Illustration 3 13 LEON3 AMBA device configuration intended for use with LEON2 only LEON3 uses the AMBA Plug amp Play information 3 6 4 GRLIB GRETH 10 100 Ethernet MAC Select GRLIB_GAISLER_GRETH to enable the 10 100 Ethernet MAC The Ethernet MAC address of the GRETH MAC can be edited directly from the GUI The address is made out of an unique 6 byte sequence Byte 0 is the most significant byte The Ethernet hardware address can be found by running sbin ifconfig on a UNIX machine 3 6 5 GRLIB OpenCores 10 100 Ethernet MAC OpenCores 10 100 Ethernet MAC modified for the AMBA bus included in GRLIB can be used by enabling the driver under Leo
16. path Using a hardware controlling debugger gives the user a completely new way of controlling and monitoring the execution Hardware debuggers such as GRMON vastly accelerates the development process It is possible to read and manipulate both processor and core registers walk the MMU page set up view cache content list previous instructions instruction trace just to list a few The kernel s addresses are static and can be known on before hand whereas multiple user space applications threads may have the same virtual address making it impractical in many cases to use hardware debuggers Using a software debugger like GDB run natively or a GDB server acting as a server for remote GDB connections is preferred when debugging userspace applications EROFLEX LINUX SNAPGEAR 25 GAISLER 6 2 1 Configuring GRLIB for kernel debugging It is assumed that hardware breakpoints watchpoints and the instruction trace buffer have been enabled in the GRLIB xconfig during system configuration Depending on the complexity of the problem to be debugged the number of breakpoints and the trace buffer length to select may vary In the template design of the GRXC3S 1500 board the trace buffer can be enabled from Processor Debug Support Unit Instruction trace buffer and hardware breakpoints from Processor Integer Unit Hardware watchpoints in GRLIB xconfig cd designs leon3 grxc3s 1500 make xconfig GRMON can verify the debugging support available by running t
17. prototype we know that the first argument must hold a pointer to a format string thus i0 register holds a pointer to a string AEROFLEX LINUX SNAPGEAR 26 GAISLER The register content can be viewed by the command reg From the output of reg one can see that i0 is 0xF0227510 Listing the memory with vmem around the virtual address 0xF0227510 reveals that the argument passed to printk was PROMLIB Sun Boot Prom Version d Revision d A virtual address can easily be translated to a physical address by doing a MMU page table walk with the GRMON command walk In the example below the virtual address 0xF0227510 is translated into 0x40227510 by the MMU Listing the memory content this time with mem instead of vmem confirms that the memory content is the same for the physical address as the virtual address By looking at the previous 20 instructions of the trace buffer it 15 easy to see that the instruction call is executed two instructions before entering printk As expected the call address is the address of printk In the delay slot or is executed Searching for Oxf0031e18 in image dis tells us that the caller 15 prom_init from the string passed to printk is seems reasonable As printk processes the string for output it must access the characters at some point or another that point can be found be setting a watchpoint at a character address To demonstrate the watchpoint functionality the processor is stopped when accessing the character S
18. setting up the X server properly it is possible to start the server with extra debug output by adding the option verbose level X verbose 3 EROFLEX LINUX SNAPGEAR 52 GAISLER 13 USING THE I2C DEVICE INTERFACE TO INITIALIZE A DVI TRANSMITTER This section describes how to use the DC device interface to initialize a Chrontel 7301C DVI transmitter The description is relevant if running a design with an external DVI transmitter that needs to be initialized and it is also relevant as an example on how to interact directly with DC devices 13 1 Kernel configuration The Linux kernel distributed with SnapGear does not contain support for initializing a CH7301C DVI transmitter and the transmitter often needs to be initialized before the correct video output can be obtained To resolve this issue a user space program which talks directly to the transmitter can be used To be able to communicate directly with the DVI transmitter the following selections must be made in the Linux kernel configuration Name Function Device Drivers 12C support DC DC support I2C_CHARDEV I2C device interface IP_PNP IP settings can be set from kernel command line Device Drivers 12C support 12C Hardware Bus support I2C_OCORES OpenCores DC Controller Table 13 1 Linux kernel configuration selections for UC device interface support After the kernel has been rebuilt the system has support for accessing I2C devices via
19. sh Make serial terminal have a console ttyS0O respawn bin sh F Make consoles appear via frame buffer ttyl respawn bin sh tty2 respawn bin sh tty3 askfirst bin sh EOM rc sh can be typed in as follows cat lt lt EOM gt romfs etc rc sh bin sh mount t proc none proc mount t sysfs none sys mount t devpts devpts dev pts hostname sparky sbin ifconfig lo up 127 0 0 1 netmask 255 0 0 0 route add 127 0 0 1 dev lo EOM For the new script to be able to run one must add execution permission to it chmod x romfs etc rc sh 7 7 Building again with inittab and re eh Since changes has been made only to the file system one can rebuild the images without having to recompile kernel libraries and applications make image After building the images the image can be found at images image dsu Note that image flashbz does not function correctly since the boot loader s SDRAM and flash settings hasn t been set up properly 7 8 Running on hardware The far most simplest method of testing the image is to run it using GRMON as follows Depending on what debug interface is available the parameters to GRMON may differ see GRMON documentation for details cd images grmon jtag nb grmon gt load image dsu grmon gt run When everything is working as planned the connected monitor will first display a small penguin kernel messages and then launch a shell on ttyl tty2 and the serial te
20. the dev i2c lt devnum gt files The device files are created by the SnapGear scripts if an external root file system is used the devices may have to be created 13 2 DVI transmitter initialization The listing in section 13 3 contains a program that will initialize a Chrontel 7301C DVI transmitter This transmitter is placed on among others the Xilinx ML50x development boards The application s default values are suitable for the ML505 ML506 and ML507 boards The ML501 may require a change in the sample delays It is recommended to put the application in your distribution s init scripts so that it is run on each boot Please consult your distribution s documentation for a description on how to do this The application always opens dev i2c 0 Depending on the system configuration and start sequence this may not be the PC adapter that connects to the DVI transmitter To dynamically select the correct transmitter an application should first probe the contents under sys class i2c dev The register addresses and their values are kept in pairs address value in the configtable array Some of the affected registers are listed in table 13 2 below Please refer to the DVI transmitter datasheet for a complete description of the registers Register address Register name Comment Ox1d Input clock register The four least significant bits in this register contains a field to adjust the delay used when latching data Oxf Input data form
21. to an excellent choice when running or debugging new applications The easiest way of installing applications in Debian is using the apt get utility The apt get utility can be setup to fetch binaries from close mirror servers by editing etc apt sources list Setting it up on the LEON target echo deb ftp ftp se debian org debian stable main contrib non free gt etc apt sources list apt get update Installing telnet server can be done as follows apt get install telnetd It is generally an good idea to have a look in the etc inetd conf and verifying that telnetd is correctly configured To make the telnet server appear on the network inetd may need to be restarted to reread it s configuration file sometimes it is enough sending inetd it the SIGHUP signal EROFLEX LINUX SNAPGEAR 51 GAISLER 12 8 Installing X org X11 Server The graphical X server is normally operated using keyboard and mouse See the chapter PS 2 and VGA on how to setup the monitor and PS 2 keyboard The peripherals and monitor GRVGA is setup in etc X11 xorg conf installed with apt get Installing the graphical X server fbset a frame buffer utility X fonts and xterm terminal emulator is similar to installing the telnet server in the previous section apt get install xserver xorg apt get install xfonts base apt get install fbset apt get install xterm Configure the X server by editing etc X11 xorg conf After
22. toolchain s C Library isn t used but the wClibC Library included in the SnapGear release See installation instructions in previous chapter 3 3 Kernel version Linux kernel version can be selected from the Kernel Library sub menu As described earlier in the introduction there are two variants of the Linux kernel within the SnapGear LEON Linux distribution One is intended to be used with MMU less systems and the other is based on an older version of the Linux kernel 2 0 For MMU based systems Linux 2 6 x is available LERCOHESN LINUX SNAPGEAR 1 GAISLER Kernel Library Defaults Selection Kemel Library Defaults Selection linux 2 6 18 1 Kernel Version glibc from compiler Libe Version fault all settings lose changes glibc from compiler A microLibe stomize Kernel Settings uClibc stomize Vendor User Settings vy Update Default Vendor Settings Main Menu Next Illustration 3 3 Kernel LibC and application selection menu 3 4 Configuring the boot loader The boot loader sets up low level hardware before entering the Linux kernel The parameters of the boot loader can be set using the main SnapGear GUI Below is a description of available boot loader parameters LINUX SNAPGEAR EROFLEX 12 GAISLER Name Description SPARC v8 MUL DIV When Yes the compiler emits hardware integer multiplier instruction If the LEON pr
23. warranty for GDB Type show warranty for details This GDB was configured as host i686 pc linux gnu target sparc LINUX aai gdb list include lt math h gt include lt stdlib h gt int main int argc char argv double i 0 00 int j 0 printf testsin n while i lt 100 0 double v sin i 0 printf float sin f sf n i v FPO MATA AIH Connecting GDB to the remote gdbserver gdb tar rem 192 168 0 80 1223 Remote debugging using 192 168 0 80 1223 0x50001c20 in Setting breakpoints gdb break 7 Breakpoint 1 at 0x10440 file testsin c line 7 gdb break 10 Breakpoint 2 at 0x10494 file testsin c line 10 Running application with cont instead of run since application already has been started and paused on the target side gdb cont Continuing Breakpoint 1 main argc 1 argv Oxefbdled4 at testsin c 7 7 printf testsin n Stepping one C line with next as the printf call is executed the output appears on the target console gdb next 8 while i lt 100 0 Running the loop four times LINUX SNAPGEAR 32 gdb con Continuin Breakpoint 10 gdb con Continuin ct Q Breakpoint 10 ct gdb con Continuin Q Breakpoint 10 gdb con Continuin Breakpoin 10 ct gdb con Continuin ct Q Breakpoint 10 print 2 main argc 1 argv Oxefbdled4 at printf
24. 10 00 FOO31e20 227a048 st il fp 0x48 FOO31le24 427a04c st 12 Sfp 0x4c FOO31e28 627a050 st 13 fp 0x50 FOO3le2c 827a054 st 14 Sfp 0x54 FOO31e30 fa27a058 st Sib Sfp 0x58 f0031e34 40000004 call Oxf0031e44 f0031e38 9207a048 add fp 72 Sol FOO31le3c 81c7e008 ret FOO31e40 91e80008 restore 00 00 FOO31e44 9de3bf58 save sp 168 Zap FO031e48 113c0e2d sethi hi 0xf038b400 00 FOO31le4c d2022000 ld 00 Sol grlib gt vmem 0xF0227510 40227510 50524f4d 4c49423a 2053756e 20426f6f 40227520 74205072 6f6d2056 65727369 6f6e2025 40227530 64205265 76697369 6f6e2025 640a0000 40227540 61766169 6c61626c 65000000 00000000 27 00000000 PROMLIB t Prom Ve d Revisio available EROFLEX GAISLER Sun Boo rsion Sd LINUX SNAPGEAR 28 grlib gt walk 0OxF0227510 Tablewalk 0 8 27 ctx 0 40002000 ctx gt 4000241 t region f0 400027c0 region gt 400007e segment gt 400007e page gt 400007e 40227510 pte 400007e y grlib gt mem 0x40227510 40227510 50524f4d 4c49423a 2053756e 20426f6f 40227520 74205072 6f6d2056 65727369 6f6e2025 40227530 64205265 76697369 6f6e2025 640a0000 40227540 61766169 6c61626c 65000000 00000000 grlib gt inst 20 time address instruction 9303794 02666d4 cmp 00 9303806 02666d8 bne Oxf0266700 9303807 02666dc mov 320 03 9303808 02666e0 sethi hi 0xf0399000 00 9303819 02666e4 ld 00 0x3c0 0
25. 2 9303820 02666e8 sethi hi 0xf0227400 00 9303833 02666ec orcc 02 Sol 9303845 f 02666f0 be Oxf0266724 9303850 02666f4 or 00 Oxle0 00 9303851 0266724 nop 9303861 0266728 ret 9303862 026672c restore 9303900 0266114 ld 10 0x34c Sot 9303925 0266118 ld 00 0x4 Sol 9303944 02661l1lc ld 11 0x354 02 9303955 0266120 sethi hi 0xf0227400 00 9303965 0266124 call 0Oxf0031e18 9303973 0266128 or 00 0x110 00 9303983 f 0031e18 save sp 104 sp 9303990 f 003lelc mov 510 Sot grlib gt watch 0xF0227519 grlib gt cont watchpoint 1 vsnprintf 0x68 0xf010edb0 grlib gt reg INS LOCALS OUTS GLOBALS 0 FO38B000 00000000 00000031 00000000 1 00000400 FO38B3F8 0000003A 00000002 2 F0O227518 00000000 FFFFFFFF F3401FE5 3 FOOOFF80 FO38AFF8 F00001D4 F0000D94 4 00000000 00000000 00000000 F0237000 5 00000000 00000000 00000000 00000000 6 FOOOFDCO 00000000 FOOOFD48 FOOOEOOO 7 FO1OF348 00000000 F01109B8 FOOOOCTC psr F3901FE3 wim 00000001 tbr F0004050 pe 010edb0 Ildub 512 Sol npc f010edb4 sll Sol 24 00 grlib gt vmem 0xF0227518 0x10 40227518 2053756e 20426f6f 74205072 6 f6d2056 EROFLEX GAISLER PROMLIB Sun Boo t Prom Version d Revision available result 0000000 0000000 0000014 039900 0000000 022740 0000000 0000000 FO2275e 0000000 FO26672 0000000 F0000c7c 00000000 00000000 f0227400 f0266124 0227510 000fed0 trapped OOS 6
26. 2 INPUT _MOUSEDEV and INPUT KEYBOARD Token Ring devices Serial I O support SERIO wieter GE non ham i8042 PC Keyboard controller SERIO 18042 Serial port line discipline SERIO_SERPORT Telephony Support eam grlib ps2 keyboard controller SERIO_LEON3 4 Input device support 5 Default keyboard IRQ number SERIO_LEON3 KEYB_IRQ PS 2 driver library SERIO_LIBPS2 o ORaw access to serio ports SERIO_RAW Character devices DGameport support GAMEPORT Serial drivers Illustration 3 8 Adding support for GRPS2 controller To separate keyboard and mouse PS 2 devices from each other the IRQ number of the keyboard must be specified This is because the PS 2 controllers are identical to the kernel PS 2 controllers found with an IRQ not matching the keyboard IRQ number are assumed to be a PS 2 controller connected to a mouse The default keyboard IRQ number may be overridden by the kernel command line option grps2 kbdirq irqno irqno 0 15 3 5 13 GRLIB SPICTRL The Gaisler SPI controller is enabled by selecting SPI support and SPI support Gaisler Research SPI Controller The driver automatically detects the number of available slave select lines Adding support for specific SPI devices requires editing of the SPI initialization code found in Jinux 2 6 21 1 arch sparc kernel leon_spic c This is necessary since the available SPI devices are normally hard coded in platform specific code and GRLIB is used i
27. 480 640x480 60 2 Pixelclock Custom Pixelclock in ns 3 xres Custom Horizontal resolution in pixels 4 rmargin Custom Horizontal Front porch in pixels 5 hsync_len Custom Horizontal Sync length in pixels 6 Imargin Custom Horizontal Back porch in pixels 7 yres Custom Vertical resolution in lines 8 Ilmargin Custom Vertical Front porch in lines 9 vsync_len Custom Vertical Sync length in lines 10 umargin Custom Vertical Back porch in lines 11 bit_per_pixel All Pixel depth in bits 8 16 32 bits 12 Mem_size All Frame buffer memory size in bytes 13 fb_addr All Specify a physical address for the framebuffer This argument is optional Table 3 4 GRVGA kernel parameter arguments Below is an example how to configure the GRSVGA using 1024x768 resolution 60Hz vertical refresh rate 8 bits pixel depth and 800kb video buffer The system console will be displayed on virtual terminal zero dev ttyO which is connected to the framebuffer dev b0 instead of a serial terminal console tty0 video grvga 1024x768 60 8 786432 1024x768 60 is a predefined mode by the driver however a custom mode can be entered see the table above and kernel documentation for more details When using the GRLIB SVGA controller with a DVI transmitter additional initialization of the transmitter may be required Please see section 13 for an example on how to initialize a DVI transmitter over DC 3 5 18 GRLIB ATA Controller Gaisler ATA co
28. 9297 Float sin 3 000000 0 141120 Float sin 4 000000 0 756802 Float sin 90 000000 0 958924 Float sin 91 000000 0 105988 fFloat sin 92 000000 0 779466 Float sin 93 000000 0 948282 Float sin 94 000000 0 245252 Float sin 95 000000 0 683262 fFloat sin 96 000000 0 983588 Float sin 97 000000 0 379608 Float sin 98 000000 0 573382 Float sin 99 000000 0 999207 exit testsin Child exited with retcode 0 Child exited with status 0 GDBserver exiting gt 6 3 6 DDD and GDB DDD is a graphical frontend run alongside with GDB DDD launches GDB and provides us with direct access to the GDB console and the ability to display information about the debugged application DDD is compiled for PC Linux and uses a socket protocol to connect to the local GDB sparc linux gdb GDB is responsible for SPARC specific operations and therefore DDD needs not to be recompiled for SPARC binaries 865 ddd debugger sparc linux gdb app_debug ddd gdb target remote target port ddd gdb b main ddd gdb cont Most Linux distributions distribute DDD as a precompiled binary package in many cases it is installed by default See http www gnu org software ddd for more information about DDD 6 3 7 Insight Insight comes with version 1 0 1 or later of sparc linux toolchains Insight is a graphical debugging interface on top of GDB It is started by running sparc linux insight See http sourceware org insight for more informatio
29. Gaisler Ethernet MAC connected via PCI Usually GRETH is connected via the AMBA interface and is included as previously described PCI support must also be enabled see the sub section GRLIB PCI support below 3 5 10 GRLIB OpenCores C master Enable I2C support and I2C support DC Hardware Bus support OpenCores DC Controller The driver will use the GRLIB wrapper s interface when the kernel is configured to run on a Leon SoC To use the DC bus selections should also be made under I2C support DC Algorithms and I2C support Miscellaneous DC Chip support depending on which peripherals that are present in the system Section 13 contains an example that utilizes the DC character interface to write directly to an DC device 3 5 11 GRLIB PCI support GRPCI is a bridge between the AMBA bus and the PCI bus The GRPCI core is mainly used to connect off chip controllers to the LEON system It can be enabled by selecting PCI support under General machine setup Once the GRPCI driver detects the GRPCI core by probing the AMBA Plug amp Play bus it initializes the core and starts scanning the PCI bus for additional controllers 3 5 12 GRLIB GRPS2 Keyboard and mouse drivers are available for the Gaisler PS 2 controller One can enable GRPS2 under input device Hardware I O ports Input devices that use the PS 2 driver such as keyboard and mouse drivers are enabled under Input device support MOUSE 83
30. L model Loadable module support Block layer OSupport for PCI and PS 2 keyboard mouse IO Schedulers DOpenprom tree appears in proc openprom o aSundm LED driver Grlib Amba device driver configuration Kernel support for ELF binaries Vendor Gaisler OKernel support for a out and ECOFF binaries Vendor Opencores OKernel support for MISC binaries Networking OSunOS binary emulation Device Drivers Generic Driver Options Connector unified userspace lt gt kernelspace linker Memory Technology Devices MTD Parallel port support Plug and Play support Block devices ATA ATAPI MFM RLL support SCSI device support Multi device support RAID and LVM Fusion MPT device support IEEE 1394 FireWire support 120 device support a Network device support PHY device support Ethernet 10 or 100Mbit Ethernet 1000 Mbit Ethernet 10000 Mbit Token Ring devices D epp Illustration 3 4 Linux 2 6 x GUI configuration utility Memory model Flat Memory 564 bit Memory and IO resources EXPERIMENTAL m I Running on grlib s Leon3 LEON 3 Say Y here if you are running on a Leon3 from grlib download from www gaisler com CR 3 5 1 LEON processor type The configuration of the processor type is done separately for the Linux boot loader and the kernel itself This is done to eliminate the kernel s dependency on SnapGear LEON Linux can be used without SnapGear LEON must a
31. NAPGEAR 50 GAISLER usr sbin debootstrap sarge debian 12 5 Adding a serial console to Debian Even though the system console may be the serial terminal no shell is given unless explicitly telling init to launch one This can be done as previously described by editing the etc inittab in the Debian root file system Add or uncomment T0 234 respawn sbin getty L ttyS0O 38400 vt100 Getty will present us with a login prompt at serial channel 0 One must make sure there is a valid serial terminal device node for getty to open in dev ttyS0 If the device is missing it can be created by mknod cd SINSTDIR dev mknod ttyS0O c 4 64 In case of trouble booting Debian it may be of good practice to change the run level to 1 or 2 in inittab before booting The default runlevel id 2 initdefault 12 6 Changing root directory and booting Debian Before booting the kernel command line needs to be updated to reflect the new root file system Enter the make xconfig GUI and update the kernel command line to include the debian directory nfsroot 192 168 0 20 export busybox_rootfs debian Make the configuration rebuild the image and run the image make xconfig make image grmon jtag nb load images image dsu run 2 U nm uM 12 7 Adding a telnet server to Debian During the development process it often comes in handy with a telnet terminal The telnet terminal isn t limited by the bandwidth as the serial terminal making it
32. TCP IP Name Value Vendor Product Selection Vendor Gaisler Gaisler Product Leon3mmu Gaisler Leon2 3 mmu options SPARC v8 Yes FPU support Yes Clock frequency 40MHz Baudrate 38400 In memory root filesystem Initramfs Init pathname bin kinit Kernel command line console ttySO 38400 root dev etherd e0 0 ip 192 168 0 203 192 168 0 20 192 168 0 1 255 255 255 0 grxc3 s_daniel eth0 Kernel Library Defaults Section Kernel Version Linux 2 6 x Customize Kernel Settings Yes Customize Vendor User Settings Yes Libc version None 9 3 Configuring the Linux kernel In addition to the default settings of the Linux 2 6 x kernel add the features described by the following table Name Function Networking NET Networking support INET TCP IP protocol IP_PNP Disable IP PnP kinit will provide this functionality for us Device Drivers Network device support NETDEVICES Enables the network device driver interface General machine setup GRLIB AMBA Gaisler GRLIB_GAISLER_GRETH Add Gaisler Ethernet 10 100 1000 driver Select a unique Ethernet address in the MSB and LSB fields Device Drivers Block Devices BLK_DEV_INITRD Disable INITRD support ATA_OVER_ETH Add ATA Over Ethernet block device support File systems Network file systems EXT3_FS Ext3 journalling filesystem support 9 4 Configuring the vendo
33. U A single cross compilation tool chain is provided which is capable of compiling the kernel and applications for any configuration LEON Linux has support for symmetric multi processing SMP it has not been extensively tested yet but work is in progress 1 1 LEON Linux There are two different versions of the Linux kernel in the Gaisler SnapGear distribution namely 2 6 x and 2 0 x The 2 0 version is modified for use with MMU less LEON systems it is called micro controller Linux uCLinux 2 6 x has support for MMU systems only the kernel is from kernel org with LEON specific patches and additional drivers mainly for GRLIB hardware The Linux kernel can be configured using a graphical interface One can remove drivers and features to save space On LEON3 systems the AMBA plug amp play information is used to detect devices and load their respective software drivers LEON uses hard coded addresses to find its devices During configuration the processor type is selected LEON2 or LEON3 it is done from the Linux kernel configuration GUI and in the main SnapGear GUI Multi processor LEON3 systems are supported by Linux 2 6 21 1 symmetric multi processing support SMP can be enabled through the Linux kernel configuration The Linux kernel can be used for other projects that need not be based on SnapGear The boot loader will still be needed but it is possible to create custom projects with custom file systems Even though it is out of the
34. USB_EHCI_HCD DC support OFull speed ISO transactions EXPERIMENTAL USB_EHCI_SPLIT_ISO P support ORoot Hub Transaction Translators EXPERIMENTAL USB_EHCI_ROOT_HUB_TT allas s 1 wire bus Olmproved Transaction Translator scheduling EXPERIMENTAL USB_EHCI_TT_NEWSCHED ardware Monitoring suppo OISP116X HCD support USB_ISP116X _HCD ultifunction device drivers UHC HCD most Intel and VIA support USB_UHCI_HCD Multimedia devices OSL811HS HCD support USB_SL811_HCD Digital Video Broadcastin USB Device Class drivers Graphics support USB Modem CDC ACM support USB_ACM OBacklight amp LCD devici USB Printer support USB_PRINTER Console display driver s NOTE USB_STORAGE enables SCSI and 563 disk support ound p may also be needed see USB_STORAGE Help for more information HID Devices USB Mass Storage support USB_STORAGE OUSB Mass Storage verbose debug USB_STORAGE_DEBUG eebe eal Datafab Compact Flash Reader support EXPERIMENTAL USB_STORAGE_DATAFAB Illustration 3 9 Adding support for USB 2 0 host controller To enable support for USB storage devices SCSI SCSI device support and SCSI SCSI disk support must first be enabled USB connected human interface devices such as mice and keyboards are also supported Enable USB USB Human Interface Device full HID support and INPUT KEYBOARD and INPUT MOUSE under Input device support 3 5 16 GRLIB GRUSBDC Support for GRUSBDC is enabled under USB supp
35. ade by GCC sparc linux gcc during compile time when at least one of the flags g g3 ggdb gstabs are given The debug symbols enlarges the output binary but the debug symbols can be removed stripped with the sparc linux strip utility prior to usage An example of how the debugging information can be created viewed and removed sparc linux gcc g3 userapp c 0o userapp create app and syms sparc linux objdump S userapp gt userapp S deasm binary sparc linux objdump x userapp gt userapp x list sections sparc linux strip s userapp remove syms less userapp S view output Debuggers can read the debug information directly from the binary making some of the steps above unnecessary The GDB server run on the target later discussed does not need debug information to save space the binary is stripped with sparc linux strip Debugging information can be enabled in SnapGear from the Application Configuration Debug Builds build debugable applications 6 2 Debugging the kernel In practice hardware debug support of some kind is needed when debugging the kernel It is possible to debug the kernel using various other methods such as inserting printk calls in the kernel code or using the proc filesystem See the chapter Debugging Techniques in Linux Device Drivers for more information about debugging techniques However these methods are rather time consuming and may change the behaviour and the execution
36. age will be available for download to the target board from images image dsu 8 5 Running on hardware The far most simplest method of testing the image is to run it using GRMON as follows Depending on what debug interface is available the parameters to GRMON may differ see GRMON documentation for details cd images grmon jtag nb grmon gt load image dsu grmon gt run The NFS share can be tested by changing or adding files at the PC side and watch as they appear on the LEON Linux target LIERBCHEN LINUX SNAPGEAR 41 GAISLER 9 ROOT FILE SYSTEM OVER ETHERNET USING ATA OVER ETHERNET A network root filesystem can also be provided using ATA Over Ethernet on Linux 2 6 This setup requires two steps creating an ATAoE server that exports a block device containing the root filesystem and configuring the LEON to boot using the exported ATAoE root block device ATAoE block devices may be formatted with an arbitrary filesystem For example well supported Linux filesystems such as ext3 or xfs may be used The ATAoE server must be on the same Ethernet Local Area Network as the LEON 9 1 Setting up ATAOE Server The ATAoE server vblade can be run on any supported Unix system including Linux and FreeBSD Vblade can be obtained at http aoetools sourceforge net Installation documentation is included with vblade although typing make followed by make install as root should be sufficient for Linux systems With vblade installe
37. ariable Below is an example of how to install the sparc linux 3 2 2 toolchain Install by extracting the toolchain into opt 5 mkdir opt cd opt tar jxf path to toolchain sparc linux 1 0 0 tar bz2 Add the toolchain to the PATH variable preferably in a shell start up script For bash shells the following is added to profile export PATH SPATH opt sparc linux bin After installing the toolchain it is possible to cross compile applications for SPARC LEON Linux args c int main int argc char argv printf s you passed d argument s n argv 0 argc 1 return 0 Compile args by running LINUX SNAPGEAR 8 sparc linux gcc o args args c or sparc uclinux gcc o args args c From the ELF header it can be read that the output binary is a SPARC binary file args args ELF 32 bit MSB executable SPARC version 1 SYSV linked uses shared libs not stripped Running the binary on a SPARC Linux host results in args Gaisler args you passed 1 argument s 2 3 Installing SnapGear for LEON Linux 2 0 Install the SnapGear distribution by extracting it mkdir linux cd linux tar xjf path to dist snapgear 2 0 p36 tar bz2 ls snapgear 2 0 p36 2 4 Installing SnapGear for LEON Linux 2 6 Install the SnapGear distribution by extracting it 2 mkdir linux cd linux tar xjf path to dist snapgear 2 6 p36 tar bz2 3 18 snapgear 2 6 p36 EROFLEX GAISLER
38. at register Default value is suitable for leon3 xilinx ml50x designs This value may need to be changed if another colour depth is desirable 0x21 DAC control register Note that the define DVI in the application selects if the device should be initialized for a VGA or DVI output Table 13 2 Chrontel CH7301C registers affected by example application LIERBCHEN LINUX SNAPGEAR 53 GAISLER 13 3 Example application include lt stdio h gt include lt stdlib h gt include lt errno h gt include lt string h gt include lt sys ioctl h gt include lt sys types h gt include lt sys stat h gt include lt fcentl h gt include lt unistd h gt include lt linux i2c dev h gt Define DVI if you want DVI output define DVI static char configtable 11 2 Oxlc 0x04 Oxld 0x45 Oxle Oxc0O Ox1f Ox9a ifdef DVI 0x21 0x00 else 0x21 0x09 endif 0x33 0x08 0x34 0x16 0x36 0x60 0x48 0x18 0x49 0 60 0x56 0x0 77 int main void int i file adapter_nr 0 char filename 20 int i2c_addr 0x76 DVI transmitter address sprintf filename dev i2c d adapter_nr if file open filename O_RDWR lt 0 printf Could not open device s n strerror errno exit 1 if ioctl file I2C_SLAVE i2c_addr lt 0 printf Could not set slave address s n strerror errno exit 1 for i 0 i lt 11 i if
39. ation 3 7 Serial support for LEON2 arbitrary protocol The serial lines can be accessed from dev ttySx 3 5 6 GRLIB GRETH 10 100 1000 Select GRLIB_GAISLER_GRETH to enable the 10 100 Ethernet MAC or for GRLIB professional users the 10 100 1000 Ethernet MAC The Ethernet MAC address of the GRETH MAC can also be edited directly from the GUI The address is made out of an unique 6 byte sequence One can edit the 24 most significant bits MSB and the 24 least significant bits LSB from GRLIB_GAISLER_GRETH_MACXSB Networking Network devices and TCP IP must be selected for standard network communication to be available 3 5 7 GRLIB OpenCores Ethernet MAC In the same way as the GRETH is configured the OpenCores MAC can be selected and it s MAC address can be edited The OpenCores MAC is found under General machine setup Vendor OpenCores 3 5 8 SMC 91x Ethernet MAC The SMC91x driver can be found under Network device support Ethernet 10 100 The Ethernet MAC address must be configured to an unique address as previous MAC controllers The chip is not a Plug amp Play AMBA device and can therefore not be automatically detected by the driver Both address and IRQ number must be given to the driver for it to operate correctly EROFLEX LINUX SNAPGEAR 15 GAISLER 3 5 9 GRLIB GRETH 10 100 1000 over PCI Select GRETH_PCI from Network device support Ethernet 10 100 to include a driver for
40. cesseeceeseeeeecseceseeseeaecseeeseesecaecsceaeeseeeaeceesaeseeeeaeseeesaeeeeeneeenees 21 BUILDING SNAPGBAR TE 22 EROFLEX LINUX SNAPGEAR 3 GAISLER 5 ADDING CUSTOM APPLICATIONS 23 5 1 Creating an application 23 5 2 Setting up compilation drectves 23 5 3 Including application to file swstem 23 6 DEBUGGING LINUX 2 6 AND 411014 24 6 1 Debugging Symbols ier 24 6 2 DMebueeme the Kerne 24 6 2 1 Configuring GRLIB for kernel dchugeng 25 6 2 2 te dee ENEE BESSEREN 25 6 2 3 GRMON Example debugging the Linux kene 25 6 3 Debugging userspace 16 0 29 6 3 Setting up a debugging enviromnment 29 6 3 2 GDB intoducton ni 29 6 3 3 Starting GDB server op 1 6
41. chapter From the main SnapGear GUI one can make a third GUI pop up after the main SnapGear GUI closes This is similar to what was earlier described for the Linux kernel One simply selects y at Customize Vendor User Settings under Kernel Library Defs Selection and press Quit and Save BusyBox is a small footprint replacement for traditional UNIX core applications such as ls find mount etc BusyBox is highly configurable and can be configured from the BusyBox sub menu as shown below LERCOHESN LINUX SNAPGEAR 21 GAISLER SnapGear Embedded Linux Application Configuration Core Applications Busy Box Library Configuration Tinylogin Flash Tools MicroWindows Save and Exit Filesystem Applications Games Quit Without Saving Network Applications Miscellaneous Configuration Load Configuration from File Miscellaneous Applications Debug Builds Store Configuration to File Illustration 3 17 SnapGear application configuration main menu Since SnapGear supports both the 2 0 x and the 2 6 x kernels and some of the applications needs certain kernel interfaces they may only be compiled for one of the kernels A typical example of this is the flash support in Linux from Linux 2 4 and onwards a new interface called MTD memory technology devices has been introduced Linux 2 0 lacks the MTD interface and therefore cannot run applications that depend upon the MTD interface Flash utilities can be f
42. d the next step is to configure the block device that will be exported by vblade The block device may be in one of two formats a flat file or an actual block device We will first show how to configure a block device for vblade as this is the easier of the two options This example formats the block device dev hdb using ext3 and then copies a SnapGear root filesystem to dev hdb mke2fs j dev hdb mount dev hdb mnt tmp cp rpd daniel snapgear pxx romfs mnt tmp umount mnt tmp Now we will show how to configure a flat file to be used as a vblade exported block device In this example we create a 4GB flat file rootfs img formatted with ext3 containing a SnapGear root filesystem dd if dev zero of rootfs img bs 1024 count 4000000 losetup dev loop0 rootfs img mount dev loopO mnt tmp cp rpd daniel snapgear pxx romfs mnt tmp umount mnt tmp losetup d dev loop0 Make sure that the vblade exported root block device has been unmounted and in the case of a flat file that losetup d has detached the file from any loopback devices before running vblade Now run vblade vbladed eth0 0 0 eth0 path to root device In this example vblade is run with shelf 0 slot 0 over Ethernet network interface eth0 exporting the device at path to root device To use the devices set up by our examples we could replace path to root device with dev hdb or rootfs img respectively The shelf and slot number
43. d hardware integer multiplier to be available For further installation information refer to the installation manual at Debian s homepage Normally when installing Debian installation diskettes or compact discs are used to boot Debian Installation program However installing Debian on LEON involves a different approach where it is installed from an UNIX host directly onto a disk or a NFS share The Installation procedure is split in two stages first Debian binaries are downloaded and verified from the internet the second stage involves running the binaries on a LEON target board doing the real installation and configuration In this example Debian is installed onto a NFS share that will later become the root file system of the LEON board The LEON board is a low cost GR XC3S 1500 board from www gaisler com 12 1 Preparing LEON target Preparing the LEON target to run the installation binaries is done similar to a NFS root file system set up as described previous the important applications and kernel configuration is listed in two tables below The LEON system consist of a kernel that is using a NFS share with BusyBox as it s root file system The BusyBox root file system is exported from a PC as export busybox and the Debian root file system is placed in export busybox debian Name Function Networking NET Networking support INET TCP IP protocol IP_PNP IP settings can be set from kernel command line Device Dri
44. describe some of the Linux kernel s settings specific to LEON Linux 3 6 1 LEON processor type The configuration of the processor type is done separately for the Linux boot loader and the kernel itself This is done to eliminate the kernel s dependency on SnapGear LEON Linux can be used without SnapGear Certain hardware is only available for LEON3 their drivers will be invisible when LEON2 is selected uClinux Sparc w o MMU Kernel Configuration ENE Code maturity level options Controller Area Network Cards Chips Loadable module support Networking options Platform dependant setup Network device support Save and Exit General setup Filesystems Quit Without Saving Floppy IDE and other block devices Character devices Load Configuration from File Leon3 Amba configuration Store Configuration to File Illustration 3 12 Linux 2 0 x kernel configuration utility EROFLEX LINUX SNAPGEAR 19 GAISLER 3 6 2 GRLIB APBUART LEON3 Select GRLIB_GAISLER_APBUART to include a UART driver for APBUART One of the serial terminals can be set up as the system console via the kernel boot parameter ex console ttyS0 38400 selects the first serial channel to act as the system console The serial terminals will be available by accessing dev ttySx 3 6 3 LEON Serial LEON2 From Character devices sub menu the LEON2 UART driver can be enabled It allows user space to communicate with an arbitrary protocol over the serial line terminal
45. dynamically EROFLEX LINUX SNAPGEAR 9 GAISLER 3 CONFIGURING LINUX SnapGear comes with an easy to use graphical interface similar to the Linux kernel s configuration utility From the GUI it is possible to select processor Linux version C library and what applications will be included into the root file system ROMFS image accessed by Linux during runtime It is also possible to configure the boot loader parameters and configure the Linux kernel The GUI can be launched by doing a make xconfig The main configuration menu should appear a Gaisler Leon2 3 mmu options S ite lit Vendor Product Selection Save and Exit Kermel Library Defaults Selection Quit Without Saving Template Configurations Load Configuration from File Store Configuration to File Illustration 3 1 SnapGear main configuration GUI 3 1 Processor type and MMU Selecting processor is mandatory the boot loader needs to know how to initialize low level hardware which in some cases are processor dependant It is also important to select MMU support if memory protection hardware is available for use MMU provides memory protection between kernel and user space and also in between user space processes With MMU a faulty process cannot affect another process memory in a destructive manner as may be the case without MMU Linux 2 6 cannot run without MMU whereas pCLinux runs without MMU indicated in the table below Version MMU MMU MMU le
46. e search paths Sometimes GDB can not list the C code that may be due to missing debug information not even searching for C LIERBCHEN LINUX SNAPGEAR 30 GAISLER code or it can not find the source files mentioned in the debug information It is not recommended to change the source files after the debug binary has been created If the binary is compiled on the same computer running sparc linux gdb one need not to add additional paths normally The path information is coded into the binary however when running GDB on a different computer than the build host the path information is invalid and it may be needed to add additional search paths Search paths can be added with the d dir dir2 dir3 flag passed to GDB 6 3 3 Starting GDB server on target Assuming that the compilation of gdbserver has been successful and that GRMON has been started with the flag nswb the GDB server can be started with the following command at the target target gdbserver 1234 app argl arg2 Where 1234 is the TCP IP port app is the application to be debugged and arg and arg2 are the arguments to app Note The debugged application does not have to include any debugging information It can be stripped 6 3 4 Connecting with GDB to gdbserver Below is an example of how to start GDB on the PC and connecting to the target the target board IP address is assumed to be 192 168 0 52 the TCP port 1234 pc cd sources pc sparc linux gdb app_with_debug_info
47. el needs to know what partition on the disk to search for the file system that can be provided through the kernel command line root dew hdal The example boot line above make the kernel search the first partition on the first disk for a valid file system In principle the configuration is similar to a NFS root file system as described earlier instead of telling the kernel the IP address of the server and the location of the share on that server the kernel is fed with hard disk and partition number 11 2 Preparing the hard drive The preparation of the hard drive can be made using a PC computer or as described below by using the target hardware Another image besides the flash image has been create for a single purpose preparing the hard drive from the target hardware using NFS to access the splack distribution This image is called image nomount dsu Booting the Linux kernel can be done as follows grmon jtag nb grmon gt load image nomount dsu grmon gt run In order to copy the splack distribution onto the disk one must be able to access it In this example NFS is used to access the splack distribution mount t nfs 192 168 0 32 home daniel mnt nfs In order for the kernel to read from the hard disk one should create a partition table and a partition on the hard drive with a file system which the kernel can read the root file system from EXT2 typically type 0x83 One can edit the partition table and create new partitions w
48. eseesceseeseeeeececeeeeeesecneeneeaesaneseaeents 48 12 1 Preparing LEON tar sy arreteeris ea EE E E ETE A NRS E EEEa 48 12 2 Installing Debian installation utility to PC and LEON 49 12 3 Downloading Debian binaries using DC 49 12 4 Installing Debain binaries from LEON orget 4 49 12 5 Adding a serial console to Deban 50 12 6 Changing root directory and booting Debuan 50 12 7 Adding a telnet server to Deban 50 12 8 Installing Xorg XVI Serv t 51 13 USING THE I2C DEVICE INTERFACE TO INITIALIZE A DNIUTRANSMIITIER eee 52 13 1 Kernel configuratii isenana nee aE E 52 13 2 DVI transmitter imitiali Zao EE 52 13 3 Example application 20 53 13 4 Building 53 14 9 2 54 LIERBCHEN LINUX SNAPGEAR 5 GAISLER 1 INTRODUCTION LINUX support for LEON2 and LEON3 is provided through a special version of the SnapGear Embedded Linux distribution SnapGear Linux is a full source package containing kernel libraries and application code for rapid development of embedded Linux systems The LEON port of SnapGear supports both MMU and non MMU LEON configurations as well as the optional V8 mul div instructions and floating point unit FP
49. gdb target remote 192 168 0 52 1234 6 3 5 GDB example usage Configuring SnapGear with glibc from compiler linux 2 6 21 1 with gdbserver pc make xconfig Building SnapGear pcs make The binary application is recompiled manually with debugging symbols 565 file romfs bin testsin romfs bin testsin ELF 32 bit MSB executable SPARC version 1 SYSV dynamically linked uses shared libs stripped 565 cd user custom DCH sparc linux gcec lm g3 testsin c o testsin g pc file testsin g testsin g ELF 32 bit MSB executable SPARC version 1 SYSV dynamically linked uses shared libs not stripped The serial console is connected to a terminal emulator such as minicom or hyper terminal with 38400baud 8N1 Running the image images image dsu from RAM on target LEON board using GRMON 5065 grmon jtag nb nswb grmon gt lo images images dsu grmon gt run On the terminal emulator connected to LEON Linux target target gdbserver 1223 bin testsin Process bin testsin created pid 28 Starting GDB on the PC and testing that GDB finds the sources LIERBCHEN LINUX SNAPGEAR 31 GAISLER sparc linux gdb testsin g GNU gdb 6 4 0 20051202 cvs Copyright 2005 Free Software Foundation Inc GDB is free software covered by the GNU General Public License and you are welcome to change it and or distribute copies of it under certain conditions Type show copying to see the conditions There is absolutely no
50. he GNU GCC compiler and linker The toolchain is a cross compiler toolchain making it possible to compile LEON SPARC Linux binaries on an ordinary PC running Linux The toolchains are distributed as a binary package freely available at www gaisler com 2 1 Selecting Toolchain For Linux 2 0 selecting toolchain is simple as only one is available the sparc linux 3 2 2 For Linux 2 6 however one select toolchain based on what C Library is going to be used installing multiple toolchains cause no harm The two toolchains available for Linux 2 6 are sparc linux 3 4 4 and sparc uclinux as indicated by the table below The next chapter gives a short introduction to the two different C Libraries Name Description Location sparc linux 3 2 2 Linux 2 0 and 2 6 GNU LibC toolchain linux linux 2 0 toolchains sparc linux 3 2 2 sparc linux 3 4 4 Linux 2 6 GNU LibC toolchain linux linux 2 6 toolchains sparc linux 3 4 4 sparc uclinux 3 4 4 Linux 2 6 uClibC toolchain linux linux 2 6 toolchains sparc uclinux 3 4 4 Table 2 1 Toolchain description The locations described in table 2 1 are all relative to the Gaisler FTP site ftp ftp gaisler com gaisler com 2 2 Installing the toolchain The installation process for the different toolchains is the same it is only the names and paths that differ All toolchains must be installed to opt and the path to the toolchain binary directory opt sparc uc linux 3 x x bin added to the shell PATH v
51. he command info sys below is a design with 2 hardware breakpoints 2 hwbp and a 128 instruction deep trace buffer itrace 128 grmon jtag grmon gt info sys 02 01 004 Gaisler Research LEON3 Debug Support Unit ver 0x1 ahb 90000000 0000000 AHB trace 128 lines stack pointer 0x43fffff0 CPU 0 win 8 hwbp 2 itrace 128 V8 mul div srmmu lddel 1 GRFPU lite icache 1 1 kbyte 32 byte line dcache 1 1 kbyte 32 byte line 6 2 2 Using GRMON GRMON can be used to debug the Linux kernel it is primarily an assembler debugger but it is C symbol aware Symbols created by gcc when compiling C code with the g flag are automatically loaded by GRMON after a successful load file command but is also possible to load symbols manually by issuing the command symbol file The symbols last loaded are matched first During the image creating process in SnapGear make the image directory is populated with various images image image dis image dsu The image dsu is to be loaded into RAM and run image contain the debug information of the Linux kernel s virtual addresses and image dis is a plain text file containing the disassembly of image Starting GRMON with the nb flag is essential so that Linux can handle traps correctly The trace buffer can be enabled by the command tm both and later listed by inst Breakpoints trigger when the processor fetches an instruction at the given breakpoint address Hardware breakpoin
52. ies static will make the same code appear in multiple locations in each binary that uses it both in the file system and in main memory during execution Dynamic linking however runs a dynamic linker during the start of the application on the target hardware this results in smaller main memory usage as code is shared between applications Since the same code may appear in different addresses in different applications the code must be position independent Generating position independent machine code makes the code a bit slower and slightly bigger it is done by passing the argument fPIC to the GNU compiler The more applications a file system has the more space can be saved using dynamically linked binaries Depending on needs and resources different embedded systems choose different linking strategies 3 2 2 Toolchains for Linux 2 6 The available SPARC LEON toolchains for Linux 2 6 both contains a precompiled C Library The library has been built four times for CPUs with different combinations of FPU and mul div hardware Two different toolchains are available the sparc linux toolchain includes the GNU C library whereas the sparc uclinux toolchain has wClibC built in The two toolchains are based on GCC 3 4 4 Installing both toolchains will not conflict See previous chapter for installation instructions 3 2 3 Toolchains for Linux 2 0 For Linux 2 0 there are one toolchain available based on GCC 3 2 2 For Linux 2 0 SnapGear projects the
53. ith fdisk it can be started as follows EROFLEX LINUX SNAPGEAR 47 GAISLER 6 B fdisk dev hda add a new partition print the partition table create a new empty DOS partition table write table to disk and exit When a partition has been created it is possible to format it using the mke2fs utility and copy the splack distribution to the newly created file system i i 11 3 mke2fs dev hdal mount t dev hdal mnt hd cd mnt hd tar zxpf mnt nfs splack 1 0 tar gz cd t umount mnt hd umount mnt nfs Running splack If not already connected connect the hard drive to the target board Make sure a terminal emulator is connected to the serial port at 38400 baud The first boot after power up will fail on the lattice board because the DDR RAM needs to be manually reset Push the reset button and the kernel should boot and mount the CF disk The root password is set to qwerqwer One must always terminate the system using the shutdown h command before switching of the power This will sync the file systems otherwise data can get corrupted or lost Before it is okay to turn power off or reset it a message will be printed at the console Shutdown hda Power down EROFLEX LINUX SNAPGEAR 48 GAISLER 12 INSTALLING DEBIAN 3 1 ON LEON LINUX Debian is a widely used Linux distribution freely available at www debian org Debian is available platforms including SPARC Debian binaries expect FPU an
54. late configurations from the SnapGear main menu are provided as an source of examples It contains prepared Linux kernel boot loader and SnapGear application configurations However it does not include setting and script files such as inittab and rcS Some of the prepared configuration files has been created for a certain template design The template designs can be found in the design directory in GRLIB These configuration files has been used to generate the images found in ftp ftp gaisler com gaisler com anonftp linux images It is also possible to add custom configurations easily by creating a directory under vendor gaisler target templates config_dir and putting the snapgear pxx config into the config dir named vendor config and snapgear pxx linux x x x config named inux config The configuration files will automatically be copied into their respective directory upon selection The template name config dir may not contain characters EROFLEX LINUX SNAPGEAR 22 GAISLER 4 BUILDING SNAPGEAR After configuring the kernel and the applications it is possible to compile and build the SnapGear LEON Linux distribution There are two very important options passed to the build scripts the FPU and SPARCV8 options found in Gaisler Leon2 3 MMU options Disabling the FPU makes the compiler replace the FPU instructions with software routines that calculates the answer without needing a FPU The compiler is run with the argument msoft fl
55. lways be selected but LEON_3 is only selected for LEON3 targets Selecting LEON 3 will result in binary unable to run on LEON processors and vice versa Certain hardware is only available for LEON3 their drivers will be invisible when LEON2 is selected 3 5 2 Symmetric multi processing support LEON Linux has support for multi processor systems SMP can be enabled for LEON3 systems under General machine setup The LEON Linux boot loader is updated to initialize the SMP system correctly automatically when enabling SMP from the Linux kernel configuration GUI SMP is only available for LEON3 processors 3 5 3 Gaisler AMBA Plug amp Play procfs support Procfs is a pseudo file system that is normally mounted onto proc The procfs is directly linked to the kernel s internals and can display information relevant to the system s operation Enabling AMBA_ PROC makes a directory EROFLEX LINUX SNAPGEAR 14 GAISLER proc bus amba appear that can display information about devices on the AMBA bus Option General machine setup es Grlib Amba device driver configuration Vendor Gaisler Vendor Opencores Illustration 3 5AMBA procfs support 3 5 4 GRLIB APBUART LEON3 If a serial UART is to be used select GAISLER APBUART be sure to select GRLIB_GAISLER_APBUART CONSOLE if one of the serial controllers are interfaced to a console One of the serial terminals can be set up as the system console via the kernel boo
56. mplest method of testing the image is to run it using GRMON as follows Depending on what debug interface is available the parameters to GRMON may differ see GRMON documentation for details cd images grmon jtag nb grmon gt load image dsu grmon gt run The CompactFlash device driver will not finish its initialization if a CompactFlash card is not inserted or detected during boot up EROFLEX LINUX SNAPGEAR 46 GAISLER 11 RUNNING GRLINUX SPLACK FROM AN ATA HARD DISK Splack is a distribution based on the SPARC version of slackware it is prepared especially for demonstrating the ATA interface The GRLinux include tested bitfiles for various boards a precompiled kernel with the appropriate features to run the root file system from a hard drive and a temporary image for preparing the hard drive with splack The splack distribution was compiled with support for FPU and integer multiplier The kernel needs support for Gaisler ATA controller when accessing the root file system from an ATA disk or compact flash 11 1 Installing the kernel onto flash The precompiled kernel is loaded onto the boot PROM of the board GRMON can be used to program the PROM Flash grmon jtag grmon gt flash erase all grmon gt flash load image flashbz The boot loader is the first to be executed it copies the kernel into main memory and before it starts the execution of the kernel the kernel command line string is made available The kern
57. mulator to speed up the development process There are simulators available for LEON and most of its peripherals TSIM and the multiprocessor simulator GRSIM See www gaisler com for more information about simulators EROFLEX LINUX SNAPGEAR 6 GAISLER 1 5 Obtaining the software The Software is free of charge and distributed under the GPL licence The software bundle can be downloaded from Gaisler s homepage www gaisler com under the downloads section 1 6 Supported hardware Below is a list of supported hardware in addition to the standard kernel LEON2 with or without MMU FPU MUL DIV LEON3 with or without MMU FPU MUL DIV LEON3 multi processor systems SMP Non standard page size larger that 4K Bytes APBUART GPTIMER GRETH 10 100 and Gbit OpenCores 10 100 Ethernet MAC SMC91x 10 100 Ethernet MAC APBPS2 APBVGA GRACECTRL GRUSBHC GRUSBDC GRVGA ATACTRL GRPCI GRETH over PCI GR OpenCores DCMST SPICTRL Note that new hardware is being added constantly 1 7 Support For support contact the Gaisler Research support team at support gaisler com EROFLEX LINUX SNAPGEAR T GAISLER 2 INSTALLING GNU TOOLCHAIN AND LEON LINUX SnapGear has been split up into two different distributions one for Linux 2 6 development and one for Linux 2 0 development The toolchain is a composition of several utilities used in the compilation process It is intended to be used with Linux only the most important utilities are t
58. n a wide range of systems The current initialization code contains an example where a M25P05 SPI Flash memory is connected to the first slave select line on SPI bus 1 To enable support for this specific memory device select Memory Technology Devices Self contained MTD device drivers Support for M25 SPI Flash To add support for another type of SPI device modify the example and configure support for the SPI device in question 3 5 14 GRLIB GRACECTRL Support for the System ACE Interface Controller is enabled under Device Drivers Block devices Xilinx SystemACE Support This driver enables interaction with CompactFlash memory devices A device can be accessed via dev xsysace with the first partition at dev xsysacel EROFLEX LINUX SNAPGEAR 16 GAISLER 3 5 15 GRLIB GRUSBHC Support for GRUSBHC is enabled under USB support Support for Host side USB Depending on the core s configuration the applicable host controller drivers are EHCI HCD 2 0 support and UHCI HCD most Intel and VIA support EP INPUL GEVIGE support Support for Host side USB USB Hardware VO ports HOUSB verbose debug messages USB_DEBUG Character devices Miscellaneous USB options Serial drivers COUSB device filesystem USB_DEVICEFS PM ODynamic USB minor allocation EXPERIMENTAL USB_DYNAMIC_MINORS Watchdog Cards SB Host Controller Drivers TPM devices HCI HCD USB 2 0 support
59. n on how to use insight 6 4 Using NFS to simplify application updates During development one i often needed to update the application and rerun it Using the standard procedure is very inefficient rebuild the image reprogram the flash and reboot With GRMON the flash i not needed to be updated the image can be run directly from RAM saving a great deal of time However there are occasions where even rebooting may be troublesome Sharing the files over NFS may be a good alternative to rebooting and rebuilding all SnapGear Only the development files binaries need to updated not all SnapGear LIERBCHEN LINUX SNAPGEAR 34 GAISLER Perhaps the easiest way is to create a script file in the SnapGear image which mounts NFS after boot yet another way is to edit the rcS file in vendors leon3mmu rcS to mount automatically on start up See your distribution manual how to set up an NFS sharer normally you edit etc exports and run exportfs r The same problem is faced in the chapter Root Filesystem over Ethernet using NFS Good practice is to mount the exported directory on to the server PC to verify that the NFS share is set up correctly even if this works it may be wrong After network and NFS server has been set up on the target one can simply mount the NFS share into an empty local directory with target mkdir nfs target mount t nfs o rw nolock workstation export leonshare 6 5 Console output when debugging The console is of grea
60. n3 AMBA Vendor Opencores The Ethernet address must be set to an unique 6 byte network identifier The driver can force the Ethernet MAC to operate on a 100MHz signalling frequency by setting Set MII to 100mb 3 6 6 SMC 91C111 10 100 Ethernet MAC After enabling Networking support from the General setup sub menu the SMC driver can be enabled under Network device support The base address IRQ and Ethernet address is configurable The Ethernet address must be unique on the network The base address and the IRQ number can be found by examining the hardware set up of the target board typically LIERBCHEN LINUX SNAPGEAR 20 GAISLER found in the user manual or the schematics 3 6 7 GRLIB VGA text frame buffer support The VGA text frame buffer make it possible to output text onto a standard monitor The programming interface used to access the AMBA VGA graphics controller is called frame buffer The frame buffer has hardware device drivers called frame buffer drivers the Gaisler VGA controller has a frame buffer driver that can be included into the kernel from the AMBA configuration menu but first frame buffer support needs to be enabled Enable Console support and Frame buffer under General setup this makes the VGA support able to select 3 6 8 GRLIB GRPS2 PS 2 interface keyboard a General setup L l llsl General setup NU 7 n PCI bios s
61. ntroller can interface a hard disk or a compact flash card Devices can be accessed from dev hda The ATACTRL can be selected from ATA support menu The ATA controller depend upon the PCI subsystem to function correctly PCI can be included from General Machine Setup LIERBCHEN LINUX SNAPGEAR 18 GAISLER Generic Driver Options a Enhanced IDE MFM RLL disk cdrom tape floppy support Connector unified userspace lt gt ke Please see Documentation ide txt for help info on IDE drives Memory Technology Devices MTD C Support for SATA deprecated conflicts with libata SATA dr Parallel port support o Include IDE ATA 2 DISK support NEW Plug and Play support Use multi mode by default NEW Block devices o Include IDE ATAPI CDROM support NEW SATA ATAPI MFM RLL support Include IDE ATAPI TAPE support EXPERIMENTAL NEW SCSI device support Include IDE ATAPI FLOPPY support NEW Multi device support RAID and LVM IDE Taskfile Access NEW Fusion MPT device support IDE chipset support bugfixes IEEE 1394 FireWire support fageneric default IDE chipset support NEW 120 device support LS ATACTRL driver ATA Controlle 000 Rlatwaarl davien comnanet Ee 3 11 Enabling ATACTRL Device Drivers ATA ATAPI MEM RLL support Ul Once the ATA controller is enabled the IDE devices that needs to be supp
62. nux gdb and bin sparc linux insight sparc linux gdb is GDB built for PC Linux able to read debug SPARC Linux binaries The Data Display Debugger DDD is a graphical front end for GDB it is available in any standard distribution DDD is optional as GDB can be used effectively in text mode The GDB TCP IP server can be built within SnapGear by enabling it from the Application Configuration Utility under Miscellaneous Applications gdbserver With GRMON version 1 1 23 the flag nswb was added it clears bit 3 BS in the DSU control register so that GRMON won t interfere with the software breakpoints ta 0x1 6 3 2 GDB introduction GDB is a debugger able to debug multiple languages including C and SPARC assembly In this text GDB is used to access a GDB server running on the target board debugging GDB needs Binaries of the application and optionally the used libraries Sources used to compile the binaries The IP number of the target can be found with target sbin ifconfig gdbserver running on the target part of SnapGear The gdbserver also need the binary but with or without debug information Debug information is not needed by the GDB server depending on what to debug The libraries and their source code may not be needed When debugging LibC the sources and libraries are of course needed See the previous section Debugging symbols on how to create binaries with debugging information 6 3 2 1 Adding additional sourc
63. oat SPARC v8 processors have support for hardware integer multiplier divider through the instructions MUL and DIV instructions whereas SPARC v7 hasn t LEON is a highly configurable processor it can be compiled with or without hardware integer multiplier support To make the compiler generate code without MUL and DIV instruction select n for the v8 option The compiler will generate code compatible with SPARC v7 if started with mcpu v7 SnapGear is configured and compiled with make xconfig config GUI make dep only Linux 2 0 x needs this make compile kernel libraries boot loader applications and make images The resulting image produced during the build stage is put in snapgear pxx images Image Function image dsu RAM image with partial boot loader grmon nb grmon gt load image dsu grmon gt run image flashbz Compressed Flash PROM Image with complete boot loader grmon nb grmon gt flash erase 0 0x00300000 grmon gt flash load image flashbz grmon gt run 0 image tsim TSIM LEON simulator image if MMU is used TSIM must also support MMU tsim leon3 tsim gt load image tsim tsim gt run Table 4 1 Images available The images can be downloaded and run using GRMON as shown in table 4 1 Be sure to invoke GRMON with the nb option so that Linux can take care of traps instead of having GRMON stop the execution EROFLEX LINUX SNAPGEAR 23 GAISLER 5 ADDING
64. ocessor has been configured without hardware multiplier select No the compiler will then generate SPARC v7 compatible code instead without any MUL or DIV instructions FPU support Select Yes if LEON has a Floating point unit FPU Clock frequency The frequency is needed for the boot loader to calculate timing values Value is in KHz Baudrate The baud rate of the first serial terminal Typically 38400 baud It is favourable to use the same baud rate for the Linux kernel UART Loopback on Enables the loopback mode of the UART every character sent will be recieved UART hardware flowctrl Hardware flow control will be used In memory root file system Romfs Read only root file system Created from snapgear pxx romfs This option is valid for Linux 2 0 x Initramfs A read and write root file system put in main memory See linux 2 6 x Documentation filesystems ramfs rootfs initramfs txt for more information Custom an initramfs is created similar to initramfs The difference is that with this option one can make an file system externally and provide a description how it is created The description is a text file as described in the Linux kernel documentation at linux 2 6 x Documentation filesystems ramfs rootfs initramfs txt None When specified the linker doesn t include the any root file system This means that Linux must read the root file system from an alternative location
65. on a non debian machine as root BUSYBOXLINUX export busybox_rootfs DEBOOT debootstrap_0 2 45 0 2_i386 deb TMPDIR tmp debinst ARCH sparc INSTDIR SBUSYBOXLINUX debian DISTNAME sarge MIRROR ftp ftp se debian org debian mkdir p STMPDIR work cd STMPDIR wget http ftp se debian org debian pool main d debootstrap DEBOOT cd work ar xf STMPDIR S SDEBOOT cd tar zxvf STMPDIR work data tar gz Uy in UW i in nh in h nn np mn Dm nn Download and install debootstrap to LEON BusyBox root file system DEBOOT debootstrap_0 2 45 0 2_sparc deb mkdir p STMPDIR work_sparc cd STMPDIR wget http ftp se debian org debian pool main d debootstrap DEBOOT cd work_sparc ar xf STMPDIR DEBOOT cd SBUSYBOXLINUX tar zxvf STMPDIR work_sparc data tar gz Uy in UW nm in In U The two debootstrap applications should now be working both for the LEON target and the PC 12 3 Downloading Debian binaries using PC Downloading Debian binaries to PC mkdir p INSTDIR usr sbin debootstrap download only arch ARCH DISTNAME INSTDIR SMIRROR 12 4 Installing Debain binaries from LEON target The LEON target is able to access the binaries downloaded by the PC in the previous step by entering the debian directory Invoking the Debian installation utility debootstrap with the correct parameters makes it continue the installation process this step may take some time to complete EROFLEX LINUX S
66. ort USB Gadget Support USB Peripheral Controller The driver only supports the core s DMA mode so if this is not enabled in the core in the current system the driver will not work To be able to use the driver a gadget driver also has to be enabled This is done in USB support USB Gadget Support USB Gadget Drivers The core has been tested with Gadget Zero GadgetFs and EthernetGadget 3 5 17 GRLIB GRVGA GRLIB SVGA controller can be used in Linux using the frame buffer video driver written for GRVGA X Windows and or a frame buffer console can be run on top of the frame buffer driver Normally one want mouse or at least a keyboard together with the graphical interface GRPS2 can be used to connect keyboard and mouse devices One may need to consider bus bandwidth when selecting resolution and bit depth The GRVGA controller will cause heavy bus loads for high resolution on slower buses Each word in the frame buffer will be read 60 times on a system with 60 Hertz vertical refresh rate From the Graphics support menu one can enable the GRVGA frame buffer driver o Enable firmware EDID FIRMWARE_EDID Support for frame buffer devices FB u Enable Video Mode Handling Helpers FB_MODE_HELPERS i itti FB_TILEBLITTING B_GRVGA Multimedia devices Digital Video Broadcasting Devices Graphics support Console display driver support Logo configuration O Backlight LCD device support
67. orted are to be selected most commonly the IDE ATA 2 DISK support is selected 3 5 18 1 DMA Extension The DMA extension of the GRLIB ATA controller can be enabled by selecting BLK DEV IDEPCI BLK_DEV_IDEDMA PCT in addition to the options described for the standard ATA controller Note that enabling the DMA extension does not disable the standard ATA controller driver 3 5 19 Non standard PAGESIZE support Support to MMU hardware that supports PAGESIZE other than the default 4k is enabled via option General machine setup Running on SoC Leon Pagesize extra bits The default is the standard 4kb page size but can be changed to 8k and 16k Note that special hardware is needed for page sizes different than 4kb It is possible to check whether if a system has non standard page size or not by typing mmu in GRMON If the system support a non standard page size the active page size will be printed out 3 6 Configuring the 2 0 x kernel 3 From the graphical interface it is possible to configure the selected kernel by selecting y at Customize Kernel Settings and saving the new settings After the main GUI has been closed and settings been saved a second GUI will appear that is specific for the kernel selected The kernel configuration GUI for Linux 2 0 is shown below Details on how to configure the kernel can be found in the linux 2 0 x Documentation directory The following sections will be used to
68. ound under Flash Tools Illustration 3 19 Flash Tools MTD utilities 3 8 Template configurations Illustration 3 18 BusyBox configuration a BusyBox 0 Xx m Flash Tools SEE Busy Box Flash Tools D BusyBox Help netflash uses HMAC MD5 signature Help Applets ptflash HMAC MD5 key Hell dee ue e adjtimex Help Wl sw wn recover bios only Help wv N Il nl gt Help v NI zw bootloader uses server config from flash Help j w n basename _ Help v Y w DI recover Help v Hl cat _ Help ethl recover ethemet interface Help Hei zw NI we Il recover uses static server Help SAA NZ Cham Hep l 0 recover static server Help var vi EE Help v iiv llvan recover preserves existing config Help 7 7 chown Heip Hl flashloader Help 7 pl chroot _Help Ni himemloader Help v NI clear _ Help MTD utils wyl UE nl cmp _ Help w y v 1 D mta utils Help gl Hl cp Help NI v erase Help w WI se DI cut Help v WI we eraseall Help o NI n date Help Main Menu Next Prev Main Menu Next Prev The Temp
69. parameters and the kernel command line The software can be run on a GR XC3S 1500 Spartan 1500 board available at www gaisler com 7 1 Hardware configuration The hardware set up is based on the template design of GR XC3S 1500 and modified as in table 7 1 Hardware Controller Function LEON3 with MMU HW MUL DIV and FPU SPARC v8 Processor with memory protection logic and floating point unit GRVGA SVGA controller GRPS2 PS 2 controller connected to keyboard Table 7 1 Hardware in addition to GR XC3S 1500 template design 7 2 Configuring the boot loader and main SnapGear options Start SnapGear main GUI and configure as in table 7 2 make xconfig Name Value Vendor Product Selection Vendor Gaisler Gaisler Product Leon3mmu Gaisler Leon2 3 mmu options SPARC v8 Yes FPU support Yes Clock frequency 40MHz Baudrate 38400 In memory root filesystem initramfs Kernel command line console ttyO video grvga 640x480 60 8 307200 Kernel Library Defaults Section Kernel Version Linux 2 6 x Libc Version Glibc from compiler Customize Kernel Settings Yes Customize Vendor User Settings Yes Table 7 2 Boot loader configuration 7 3 Configuring the Linux kernel Apart from the default configuration support for frame buffer on Gaisler VGA controller and input driver for Gaisler PS 2 controller is enabled as in table 7 3 LINUX SNAPGEAR 36
70. r user applications At a bare minimum klibc kinit support must be enabled for ATAOE root to work Furthermore we recommend EROFLEX LINUX SNAPGEAR 43 GAISLER disabling all other applications as there will be no need for them This is because kinit immediately switches the root filesystem to the ATAoE block device at startup and does not invoke or require any other applications or libraries Configuring a root filesystem with only klibc kinit while not strictly required will result in a much shorter build time and a much smaller initial root filesystem Name Function Core Applications Custom tests app Disable custom tests app Shell Program Other Network Applications arp Disable arp portmap Disable portmap tcpd Disable tcpd Busybox Busybox Disable Busybox Miscellaneous Configuration RAMFS Image None klibc build klibc Enable klibc support kinit Enable kinit Statically link all binaries Optional Should result in a slightly smaller size for kinit there s only one binary so static linking actually doesn t waste space in this case 9 5 Building kernel boot loader and kinit As previously described make The image will be available for download to the target board from images image dsu 9 6 Running on hardware The simplest method of testing the image is to run it using GRMON as follows Depending on what debug interface is available
71. re Applications 0x Core Applications zy custom tests app Help v Y v nl canatinux test apps Help NI v Module_init_tools Help zw Wl UE Rn init Help v Yj en enable console shell Help v Y n execute firewall rules Help Sash Shell Program Help Illustration 5 1 Custom applications EROFLEX LINUX SNAPGEAR 24 GAISLER 6 DEBUGGING LINUX 2 6 AND APPLICATIONS This section discusses different debugging methods used when debugging Linux 2 6 x userspace applications and the kernel itself GRMON is documented in detail in the GRMON manual available at http www gaisler com doc grmon pdf When debugging with GRMON the SPARC v8 Architecture manual may come in handy for instruction definition and the SPARC assembler conventions used by the C compiler The SPARC v8 manual is available at http gaisler com doc sparcv8 pdf GRLIB IP core documentation is very use full when debugging the kernel and writing new drivers it can be found at http gaisler com products grlib grip pdf GDB documentation is available at http sourceware org gdb documentation 6 1 Debugging symbols In order to translate assembler instructions into C code debugging symbols and an application that can read debugging symbols are needed The application sparc linux objdump part of the binutils package provided with the toolchain can provide us with information about compiled applications ELF binaries Debug symbols is m
72. rminal ttyS0 It is possible to switch between tty1 3 by pressing ALT F1 F2 F3 at the connected PS 2 keyboard LIERBCHEN LINUX SNAPGEAR 38 GAISLER 8 ROOT FILE SYSTEM OVER ETHERNET USING NFS Often during development it is favourable to use NFS as root file system as it is a tedious process reprogramming the flash each time a change is made and also there is no need in rebuilding the romfs image Settings can be preserved after system reboot Setting up root over NFS involves two steps installing the NFS server on the PC and configuring the LEON Linux image The NFS server is assumed to be installed and therefore not described other than with an example entry applied to etc exports it make the NFS server export the root file system to the LEON board 8 1 Setting up NFS server on PC As previously mentioned the NFS server is assumed already to be installed however an entry to efc exports sharing the root file system should be added similar to what described Adding the following line to the etc exports makes the server share the export rootfs directory The NFS server is forced to reread the settings file by invoking exportfs r export rootfs 192 168 0 0 255 255 255 0 rw async no_root_squash insecure In this example we export export rootfs which is a SnapGear ROMFS file system The directory is exported to any computer using the IP address 192 168 0 X su mkdir export cp rpd daniel snapgear pxx romfs export
73. rootfs echo export rootfs 192 168 0 0 255 255 255 0 rw async no_root_squash insecure gt gt tmp exports exportfs r exit It is also possible to base the root file system on other distributions for example on splack or creating one from scratch A common source of failure is that the initialization scripts run during boot assumes that the file system is of ext2 or ext3 type but it s not This can usually easily be removed 8 2 Configuring the boot loader and main SnapGear options The important thing when running the root file system over NFS is to set up the kernel boot parameter to point to the NFS share to be used as root and the network settings such as IP address netmask and gateway To avoid building the image with the unused ROMFS root file system the In memory root filesystem option from the Gaisler Leon2 3 mmu options is set to none The settings in the SnapGear application GUI does not effect the build process once In memory root filesystem is set to none An example configuration is outlined in table 8 1 the PC NFS server has the IP address 192 168 0 20 and the target LEON board is configured to 192 168 0 203 EROFLEX LINUX SNAPGEAR 39 GAISLER Name Value Vendor Product Selection Vendor Gaisler Gaisler Product Leon3mmu Gaisler Leon2 3 mmu options SPARC v8 Yes FPU support Yes Clock frequency 40MHz Baudra
74. s are used for naming purposes they allow the server to run multiple vblades As long as each block device is exported with a different shelf or slot number the client can select which of the exported block devices it wishes to access In our examples we will use shelf 0 slot 0 as we are not using multiple vblade servers The ATAoE server is now operational and its output will be sent via syslog to var log messages Note that because vblade operates over Ethernet and not TCP IP it does not bind to a port nor is it accessible from any machine outside of the local LAN For more information on ATA over Ethernet see linux 2 6 x Documentation aoe aoe txt 9 2 Configuring the boot loader and main SnapGear options To mount a root filesystem using ATAoE we must use Linux 2 6 x with an initramfs initial root filesystem This filesystem should contain only the klibe utility kinit This utility will automatically parse the options we pass to the Linux kernel mount the ATAoE block device and switch the root filesystem over to the filesystem on the ATAoE mount EROFLEX LINUX SNAPGEAR 42 GAISLER An example configuration is outlined in the following table The ATAOE server has slot and shelf number 0 and the target LEON board is configured to 192 168 0 203 Note that the ip option may be omitted as ATAoE requires only Ethernet and will function even if the LEON does not have a valid IP address However LEON system using ATAoE typically enable
75. ss 2 0 x N A uCLinux 2 0 x 2 6 x Linux 2 6 N A Table 3 1 Linux and MMU EI Vendor Product Selection 0 Vendor Product Selection Select the Vendor you wish to target gaisler Vendor Help Select the Product you wish to target ure Snap Gear Products Help leon3mmu gaisler Products Help Select the options for a selected Product A leon A leon2mmu Gaisler Leon2 3 mmu options A leon3 Next Prev Illustration 3 2 Vendor Product Selection leon3mmu EROFLEX LINUX SNAPGEAR 10 GAISLER 3 2 C library Two different C libraries are available for selection from the graphical xconfig utility The libraries differ in binary size and one of them wClibC supports MMU less systems Table 3 2 outlines which C library is available for which version of Linux For configurations that supply their own root filesystem outside of SnapGear such as via NFS a none option is also provided to entirely omit the compilation of a C system library Version LibC LibC GNU uController LibC pCLinux 2 0 x N A Small footprint Linux 2 6 x Normal footprint Small footprint Table 3 2 LibC selection possibilities 3 2 1 Static vs Dynamic linking When linking an application static all code used from libraries are included into the output binary This makes the binary bigger Linking all binar
76. t help when debugging applications but often it limits the execution speed or put in another way the console can not output enough information There are ways to speed up the console output two techniques are discussed here 6 5 1 Redirecting output to NFS share The console output can be redirected to a file by the shell The shell simply connects the application s stdout to a file For this to work the shell needs to support redirection only tiny shells doesn t support redirection It is also possible to redirect stderr to file See man stdin and man bash for more info Embedded storage is often limited in size and speed and would fill up the flash device rapidly Instead a NFS server can be used to place the execution log over the network mount t nfs rw logserver export logs nfslogs app gt 2 gt amp 1 nfslogs out_10sep2007 1log 6 5 2 TELNET over TCP IP network Logging onto the target with telnet is an easier solution all that has to be done is to set up a telnet server on the target A telnet server telnetd is available in SnapGear from the SnapGear Application configuration utility under Network Applications pes telnet target username root pass KKKKK Welcome to SPARC LEON3 Linux root target app EROFLEX LINUX SNAPGEAR 35 GAISLER 7 PS 2 KEYBOARD AND VGA CONSOLE This is an example of how to configure the Linux 2 6 x kernel set up init and it s settings file inittab the boot loader s
77. t parameter ex console ttyS0 38400 selects the first serial channel to act as the system console The serial terminals will be available under dev ttySx Option Name rs Option General machine setup gt Amba device driver configuration f 2 Vendor Gaisler i Vendor Opencores Networking apbuart serial console Grlib s ethermac driver Grlib apbuart driver GRLIB_GAISLER_APBUART GRLIB_GAISLER_APBUART_CONSOLE GRLIB_GAISLER_GRETH i 00007A MSB 24 bits of ethern number hex GRLIB_GAISLER_GRETH_MACMSB Device Drivers CC0012 LSB 24 bits of ethern number hex GRLIB_GAISLER_GRETH_MACLSB Illustration 3 6 APBUART and GRETH Linux configuration 3 5 5 LEON Serial LEON2 For LEON2 systems the serial driver can be found under Character devices Serial drivers Selecting SERIAL _ LEON enables the serial driver the serial devices can be used to communicate over the serial line with an ISDN subsystem Telephony Support Input device support Hardware UO ports Character devices Serial drivers IPMI a Non 8250 serial port support O Sun Zilog8530 serial support OSun SU serial support OSun Siemens SAB82532 serial support ODigi International NEO PCI Support oLeon SoC serial support NEW SERIAL_SUNZILOG SERIAL_SUNSU SERIAL_SUNSAB SERIAL JSM SERIAL_LEON Watchdog Cards Ftape the floppy tape device driver Illustr
78. te 38400 In memory root filesystem NONE Kernel command line console ttySO 38400 root dev nfs nfsroot 192 168 0 20 export rootfs nfsvers 3 ip 192 168 0 203 192 168 0 20 192 168 0 1 255 255 255 0 grxc3 s_daniel eth0 Kernel Library Defaults Section Kernel Version Linux 2 6 x Customize Kernel Settings Yes Table 8 1 SnapGear main configuration 8 3 Configuring the Linux kernel In addition to the default settings of the Linux 2 6 x kernel add the features described by table 8 2 Name Function Networking NET Networking support INET TCP IP protocol IP_PNP IP settings can be set from kernel command line UNIX UNIX domain sockets needed by Debian s logging facilities Device Drivers Network device support NETDEVICES Enables the network device driver interface General machine setup GRLIB AMBA Gaisler GRLIB_GAISLER_GRETH Add Gaisler Ethernet 10 100 1000 driver Select a unique Ethernet address in the MSB and LSB fields Device Drivers Block Devices BLK_DEV_INITRD Disable ROMFS RAM root file system File systems Network file systems NFS_FS Network file system support NFS_V3 Support for version 3 of the NFS protocol ROOT_NFS Add support for root file system over NFS Table 8 2 Kernel configuration for NFS root FS 8 4 Building kernel and boot loader As previously described EROFLEX LINUX SNAPGEAR 40 GAISLER make The im
79. the parameters to GRMON may differ see GRMON documentation for details 3 cd images grmon jtag nb grmon gt load image dsu grmon gt run EROFLEX LINUX SNAPGEAR 44 GAISLER 10 ROOT FILE SYSTEM ON COMPACTFLASH USING XILINX SYSTEM ACE A root file system can be provided using a CompactFlash card and Xilinx System ACE Compact Flash solution To access the System ACE controller the Leon3 GRLIB system needs to contain the GRACECTRL core and the Linux kernel needs to include the Xilinx System ACE block device driver 10 1 Setting up the root filesystem The CompactFlash device may be arranged as any normal root file system and the device may be formatted with an arbitrary filesystem For example well supported Linux filesystems such as ext3 or xfs may be used When building the system the user should make sure that devices under the dev directory are properly created and that etc fstab is set up correctly At the time of writing the Xilinx System ACE block device has not been assigned a number by LANANA and is accessed via a major number 254 which is allocated for experimental use To be able to access a CompactFlash device and its three first partitions it is recommended that the following devices are created mknod lt rootfs mount point gt dev xsysace b 254 0 mknod lt rootfs mount point gt dev xsysacel b 254 1 mknod lt rootfs mount point gt dev xsysace2 b 254 2 mknod lt rootfs mount point gt dev xsysace3 b 254 3
80. ts are inserted with hbreak address or hbreak symbol Inserting breakpoints with break instead hbreak causes GRMON to insert an instruction ta 1 Hardware breakpoints is preferred when working with virtual addresses or debugging non writeable areas GRMON stop the processor from executing further when a breakpoint is reached the exact state can be observed and manipulated Breakpoints triggers on addresses the processor executes in this case virtual addresses The watchpoints implemented in GRLIB have support for stopping the processor when an address is being accessed by the software all variants if the instructions d or st are supported As with hardware breakpoints watchpoints trigger on the address the processor accesses before MMU translation thus virtual addresses is to be used when debugging the Linux kernel and its applications with GRMON Watchpoints need hardware assistance to work this cannot be done in software The architecture independent starting point of the kernel is at start_kernel at this point the kernel is executing in virtual address space 6 2 3 GRMON Example debugging the Linux kernel Below is an example of how the first call to printk can be debugged By setting a hardware breakpoint on printk the processor halts after the save instruction has been executed Viewing the INS registers one can inspect the arguments passed to the printk function See SPARC v8 manual for SPARC calling conventions From the printk C
81. upport Heip D lV gt Help vy n Use linux memcpy memmovel bcopy et al Help gi v n Networking support Help v yl En system IC Help v Hl yv n Reduced memory footprint Help 7 7 D Kernel support for flat binaries Help ZU y NI Console support Help Frame buffer nen 7 Main Menu Next Illustration 3 15 General setup console on frame buffer The PS 2 driver is dependent on the VGA driver see the section above on how to include the VGA driver The main purpose of the PS 2 driver is to provide the ability to interface a keyboard Both the PS 2 driver and the PS 2 keyboard driver must be enabled to be able to use the keyboard The keyboard supported is an AT keyboard a PS 2 drivers EER PS2 drivers way lv n P572 support Help i sr nl PS 2 keyboard Help OK Next Prev Illustration 3 16 AMBA PS 2 driver 3 7 Applications included in ROMFS Apart from the Linux kernel the SnapGear RAD environment consist of applications in the snapgear pxx user directory that can be included into the root file system The root file system is a read only file system that will be copied and decompressed into RAM during the boot process Custom applications can be easily integrated into the directory structure and SnapGear The steps involving adding custom applications is described in a separate
82. vers Network device support NETDEVICES Enables the network device driver interface General machine setup GRLIB AMBA Gaisler GRLIB_GAISLER_GRETH Add Gaisler Ethernet 10 100 1000 driver Select a unique Ethernet address in the MSB and LSB fields Device Drivers Block Devices BLK_DEV_INITRD Disable ROMFS RAM root file system File systems Network file systems NFS_FS Network file system support NFS_V3 Support for version 3 of the NFS protocol ROOT_NFS Add support for root file system over NFS Table 12 1 Kernel configuration for Debian and install program Name Function Core Applications Bash Shell to parse Debian scripts BusyBox ar cat chmod chown chroot find grep gunzip head init In md5sum mkdir mv printf rm sed sleep sort sync tar touch tr umount wc Table 12 2 Root file system mounted via NFS EROFLEX LINUX SNAPGEAR 49 GAISLER 12 2 Installing Debian installation utility to PC and LEON target The utility that is able to download extract and install Debian is called debootstrap It can be downloaded from Debian s homepage Since debootstrap is run from the PC as well as the LEON target two versions are needed to be downloaded the SPARC version for the LEON and the 1380 version for the PC Unless of course running on Solaris It is assumed that the Debian package manager is not available Download and install debootstrap
83. x kernel configuration GUI once SMP is enabled the boot loader s SMP support is also LIERBCHEN LINUX SNAPGEAR 13 GAISLER included when built the next time See 2 6 x configuration section 3 5 Configuring the 2 6 x kernel From the graphical interface it is possible to configure the selected kernel by selecting y at Customize Kernel Settings and saving the new settings After the main GUI has been closed and settings have been saved a second GUI will appear that is specific for the kernel selected The kernel configuration GUI for Linux 2 6 is shown below Details on how to configure the kernel can be found in the linux 2 6 x Documentation directory In later chapters some common configurations will be presented The following sections will be used to describe some of the Linux kernel s settings specific to LEON Linux Features and drivers often depend on other features the dependencies is sometimes not trivial The dependencies can be seen in a C programming similar syntax by enabling Show debug info from the Option menu The dependency can be seen down to the right by selecting the feature in question File Option Help ola lE Option Option Code maturity level options OSymmetric multi processing support does not work on sun4 gt General setup O Support for SUN4 machines disables SUN4 CDM support Configure standard kernel features for small systems f Running on SoC Leon the open source sparc VHD
Download Pdf Manuals
Related Search
Related Contents
Avaya 5620 Telephone User Manual “bio”climatique - CAUE 03 Allier Fluidmaster 501R3P8 Installation Guide Dicota BacPac Wave Peerless SA761P flat panel wall mount Extracteur – mode d`emploi Copyright © All rights reserved.
Failed to retrieve file