RTS7751R2D Handling Manual

 Linux software handling manual (CELF 040126 kernel version)



Table of Contents:

Technology Adopted in this release
.

Download and Install tool chain
Download tool chain (RPM) for SH-3/4 processor from http://tree.celinuxforum.org/pubwiki/moin.cgi/ToolChains

SH toolchain tools_sh4_RPMS.tar.gz

It contains gcc 3.2.3, binutil 2.13.90.0.18 for compiling SH-Linux code.

To install this tool chain.


 * 1) tar xvzf tools_sh4_RPMS.tar.gz
 * 2) rpm -i binutils-sh4-2.13.90.0.18-1.i686.rpm
 * 3) rpm -i gcc-sh4-3.2.3-2.i686.rpm

And you can also obtain libraries for compiling some applications as user-space packages. Userland_sh4_RPMS.tar.gz


 * 1) rpm -i --force --ignorearch glibc-devel-sh4-2.3.1-3u.sh4.rpm

'' <> Note - You would like to use these packages on Windows, you need to install *cygwin* packages to Cygwin. ''

It will automatically copy each file to proper location. If not defined please add “/usr/local/bin” to your search path. If everything successfully installed, you can start gcc compiler using following command


 * 1) sh4-linux-gcc –v

you can see version info.

Board Hardware manual
You can download Hardware manual of rts7751r2d platform from [[Media:R2DHWmanual.pdf]]

Update your own kernel
Download kernel source code (SRPM) from from http://tree.celinuxforum.org/pubwiki/moin.cgi/ToolChains


 * 1) cd (your working location)
 * 2) tar xzvf celinux-040126.tgz

It will create directory named “celinux-040126”

Then config your kernel using “menuconfig” tool.

 <> Note - You CAN NOT use “xconfig” tool to current CE-Linux-040126 kernel code


 * 1) make menuconfig
 * 2) make dep
 * 3) make zImage

If there is no error, you can see “vmlinx” created in project root and “zImage” in ./arch/sh/boot directory. Use “zImage” file as a compressed kernel image to copy to CF card.

Initializing CF card for Linux (ext2/swap format & create partition)
CF card must be formatted “ext2”. You can format and initialize CF card using following command


 * 1) mount -t ext2 /dev/(your CF device name) /mnt/cf (depends on your environment)
 * 2) /sbin/fdisk /dev/(your CF device name)

SH IPL+eth version 1.0, Copyright (C) 2000 Free Software Foundation, Inc.   ? --- Show this message (HELP) b --- Boot the system g --- Invoke GDB stub l --- Show about license w --- Show about (no)warranty m --- Serial load n --- Ether Boot z --- JMP zImage j --- JMP 0x8c002000 i --- Board Infomation d --- memory display db,dw,dl e --- memory edit eb,ew,el v --- Show version infomation

<- ex “/dev/sda1” not “/dev/sda” <- ex. “/dev/sda2”
 * 1) /sbin/mkfs –t ext2 /dev/(your CF device normal partition name)
 * 1) /sbin/mkswap /dev/(your CF device swap partition name)

If you are using USB CF card adaptor, your CF device name would be /dev/sda1 If you are using CF slot built in your notebook PC, it would be /dev/hde1

Copy root file image to ext2 formatted CF card
You can use root_file binary image (RPM) from from Userland_sh4_RPMS.tar.gz


 * 1) tar xvzf Userland_sh4_RPMS.tar.gz
 * 2) mount /dev/(your CF device name) /mnt/cf (depends on your environment)
 * 3) cd /mnt/cf
 * 4) rpm2cpio .sh4.rpm | cpio -id

 <> Note - You need to resolve package conflict by yourself

See appendix A in detail

Linux kernel update on CF card
Compressed Linux kernel image “zImage” is stored in /boot directory of CF card. So you need to overwrite “zImage” to update kernel. And also you need to execute “lilo” command on host machine to update kernel information. You may find “lilo” command in your host environment even you are not using “lilo” as a boot loader. You may be using GRUB as a boot loader in your host environment. You have to add “-r” option to “lilo” command so that “lilo” can refer external kernel information named “lilo.conf”.


 * DANGEROUS** If you missed to add “-r” option, you may corrupt your host kernel environment. Before executing “lilo” command, you need to check “lilo.conf” file saved in /etc directory of CF card and “boot.b” file in /boot directory of CF card. Due to your CF location in host environment, you may need to update “lilo.conf” description. The root file image provided from us contains “lilo.conf” file that defines “boot=/dev/sda, disk=/dev/sda”. It expect CF card can be accessed as /dev/sda, it may be expecting USB CF card adopter is used for CF card access. If your CF card can be accessed as “/dev/hde”, you need to update “boot=/dev/hde, disk=/dev/hde” in “lilo.conf” file.

To copy kernel image CF card

mount /dev/(your CF device name) /mnt/cf (depends on your environment) cp (your working location)/arch/sh/boot/zImage /mnt/cf/boot /sbin/lilo –r /mnt/cf

If “Append sh-linux *” displayed at “lilo” command, your kernel was successfully updated on CF card

Console connection
RTS 7751R2D (R2D) support serial console terminal connected to CN7 (upper Dsub connector) using cross cable. Serial communication setting is

- Baud rate = 115200 - Data    = 8bit - Parity   = none - Stop    = 1 bit - Flow control = none

You can modify console setting defined in boot parameter to support USB keyboard as a input device. Also you can re-assign console screen to LCD/VGA output managed by SM501 display controller.

Linux kernel start from CF
RTS 7751R2D (R2D) platform support is shipped with IPL (boot loader) program that is burned on FROM. We adopt IPL named "ipl+g" developed by Mr.Niibe he is a maintainer of Linux-SH, and we add some futures to original "ipl+g" to support various kind of boot method as follows.


 * CF boot (boot compressed kernel image saved in CF card)
 * Network boot (boot kernel from host machine connected via LAN)
 * XIP boot (boot executable kernel image saved in FROM expansion card)
 * JTAG debugger boot (start kernel already loaded into SD-RAM using JTAG debugger)

These boot method depends on SW6 setting. You can find SW6 near ALTERA FPGA.

So please confirm SW6 is correctly set due to your boot requirement. 

Kernel start from network
When downloading the kernel from network, use BOOTP/DHCP server (on the host machine) and obtain an IP address and file name to be downloaded.

Host side setting


 * NFS Server
 * DHCP/BOOTP Server

Setting example for the following host machine is described in the Appendix C.

R2D IP Address: 192.168.10.72 Host IP Address: 192.168.10.70 R2D MAC Address: 00:00:e1:6b:33:5d Kernel Download Directory: /tftpboot NFS Root Directory: /tftpboot/rootfs

Kernel Configrarion

Kernel Commandline and kernel option for NFS root mount as follows.


 * "mem=64M console=ttySC0,115200 root=/dev/nfs ip=boopt"
 * CONFIG_NFS_FS
 * CONFIG_ROOT_NFS

You can also use r2d_nfs.config under arch/sh directory.

After building a kernel, copy arch/sh/boot/zImage to /tftpboot which is specified in the setting file of BOOTP/DHCP server on host machine. Enter "n" command for network booting on the prompt.

Boot Log > n n Booting from network! - ioaddr 0xfe242000, addr 00:00:e1:6b:33:5d 100Mbps full-duplex Searching for server (BOOTP/DHCP)... IP Address: 192.168.192.190　　　　<- R2D IP Address Server: 192.168.192.189           <- Host IP Address Kernel to load: "/tftpboot/zImage"    <- File to be downloaded Loading Kernel: /tftpboot/zImage ..............................................

Kernel start from FROM extension card (Kernel space XIP)
Build XIP kernel

Build XIP kernel according to the following procedure. The XIP kernel will be configured at CONFIG_XIP_KERNEL.


 * 1) cd celinux-040126
 * 2) cp arch/sh/r2d_xip.config .config
 * 3) make ARCH=sh CROSS_COMPILE=sh4-linux- oldconfig
 * 4) make ARCH=sh CROSS_COMPILE=sh4-linux- dep
 * 5) make ARCH=sh CROSS_COMPILE=sh4-linux- xImage

xImage.bin file will be created under celinux-040126 directory. Copy this file to CF or NFS root.

Copy XIP kernel on CF to FROM extension card

Bootloader jumps to the 0x00020000 (mtd1 area). XIP kernel image uses regular kernel (zImage) that MTD is usable and writes in mtd1 area.

#eraseall /dev/mtd1 #dd if=xImage.bin of=/dev/mtd1

In the same way, cramfs image can be written in mtd2/mtd3.

SW6 setting for XIP

When having the SW6-2 "ON" and turn on R2D, serial console shows the message "booting XIP Kernel at 80020000" and XIP kernel will start.

Flash ROM Mapping

Currently, MTD device mapping on Flash ROM is set as below.

RUN demo program (SM501 multi-frame graphics demo)
In CELF SDK CD-ROM, you can find a demo application “demo.tgz” that is designed runs on this platform. We wrote some sample code for SM501 multi-frame operation.

[ SM501 debug command ]

Some study on SM501 frame architecture SM501 has 5 frame buffer and 2 H/W cursor plane. Each frame has following functions.

/dev/fb0 voyager_video_fb  0xb0000000

Display plane for Panel(LCD) and parent frame for all other display frame. Currently fb0 size is set to 640 x 480. Have scroll capability.

/dev/fb1 voyager_video_fb  0xb00a0000 & 0xb0140000

Frame for video screen and parent of “video_alpha” frame flexible resolution, video capture function, H/W scaller function, accept YUV data Can use double buffer architecture ( fb1 has two separate memory space)

/dev/fb2 voyager_valpha_fb 0xb01e0000

Frame for video_alpha screen, son of video (fb1) flexible resolution, chroma key function, H/W scaller function, accept YUV data This frame can be displaied only upon video frame (fb1), so if video frame is disabled, this frame also disabled automatically.

/dev/fb3 voyager_alpha_fb   0xb0280000

Frame for alpha screen. flexible resolution, chroma key function, accept YUV data This chroma key can be enable on whole frame including fb0. No H/W scaller capability, can not accept YUV format

/dev/fb4 voyager_cursor_fb 0xb0320000

H/W cursor frame. Size is only 64 x 64 and 2 bit color setting (you can choose 3 color from 16 bit color) rest of 1 color must be transparent color.

/dev/tty0

console input for /dev/fb0. Screen saver function supported in H/W. You can display text data using re-direct function “cat /dev/tty0 > /dev/tty0” to show LCD character. Initial setting for fb0 is 640 x 480 16bit color RGB screen.

Swap console device
Original Linux code for this board is expecting serial console device as a system console that is terminal connected to CN7 (upper Dsub connector). This setting is defined as a kernel boot parameter in “lilo.conf”. As this R2D board has a VGA output and USB host interface, you can use CRT as a console monitor and USB keyboard as a system keyboard. This part is introducing how to activate these alternative console devices.

< How to use VGA monitor as a system console >

To use VGA monitor as a system display, you have to declare following sentence in “lilo.conf” append line.

video=voyager_crt_fb:mode:640x480x16

After you modify “lilo.conf”, you need to run “lilo –r” command to activate this neww setting. Then /dev/fb0 is assigned to “voyager_crt_fb” device, so you can see booting message on VGA monitor screen.

< How to use USB keyboard as a system keyboard >

You can use USB keyboard as input device which name is /dev/input/mice as following kernel configration.

CONFIG_USB=y CONFIG_USB_OHCI_VOYAGERGX=y CONFIG_USB_USE_INTERNAL_MEMORY=y CONFIG_USB_KBD=y CONFIG_USB_MOUSE=y CONFIG_INPUT=y CONFIG_INPUT_KEYBDEV=y CONFIG_INPUT_MOUSEDEV=y

< CRT output switching >

Following figure shows SM501 frame buffer architecture. If you switch “merge” setting between CRT and Panel (red circled position) you can switch CRT output even If you assigned CRT as a console device. This “merge” control is managed by 9th bit of “CRT display register”. I attached small program “vc”Media:vc.zipthat just reverse this bit.

Also I attached two file “.inputrc” and “inittab” for activating USB hot key to switch this bit. So copy “.inputrc” to /root directory and modify “initrc” as attched so that system login automatically after boot and accept hot key. Due to setting defined in “.inputrc” current hot ket is “CTRL+F” to switch CRT output.

Appendix A (root_fs information)
Pre defined user accounts

Network setting --- modify following script to fit your environment

/etc/sysconfig/network-scripts/ifcfg-eth0 BROADCAST=192.168.10.255 IPADDR=192.168.10.76 NETMASK=255.255.255.0 NETWORK=192.168.10.0 ONBOOT=yes

Pre installed package list

Appendix B (default “lilo.conf” in /etc directory)
linear boot = /dev/sda disk = /dev/sda
 * 1) You must appoint your CF mounting device name on following lines.
 * 2) Default CF mounting device is /dev/hdc.

bios = 0x80 delay = 30 image = /boot/zImage label = linux root = /dev/hda1 read-only
 * 1) vga = normal

If you use USB CF card adaptor in Linux host environment, CF device can be accessed as “/dev/sda”. This “lilo.conf” is expecting CF card can be there. If your CF device name is different, you need to modity”boot=” and “disk=” portion in this “lilo.conf” file.

To update kernel, you have to do “lilo –r” command in host environment. “-r” option is mandatory. Also you have to use “boot.b” file, that can be copy from root_fs/boot directory.

Appendix C
Example of /etc/dhcpd.conf

ddns-update-style ad-hoc;

subnet 192.168.10.0 netmask 255.255.255.0 { range 192.168.10.76 192.168.10.76; default-lease-time 600; max-lease-time 7200; } host r2d { hardware ethernet 0000e16b335d; fixed-address 192.168.10.76; filename "/tftpboot/zImage"; option root-path "192.168.10.70:/tftpboot/rootfs ; }

Example of /etc/bootptab

r2d:sm=255.255.255.0:ha=0000e16b335d:ip=192.168.10.76:hd=/tftpboot:bf=zImage: rp=/tftpboot/rootfs

Example of /etc/exports

/tftpboot    192.168.10.76(rw,no_root_squash)