AP3300(AP-325RXA) Linux manual 1. Specification cpu = SH7723 kernel = 2.6.27 boot loader = uboot 2009.01 tool chain GCC 4.1.2 glibc 2.7-rc1 binutils 2.7-rc1 kernel-headers 2.6.23-rc2 userland (rootfs) = Choosen and cross compiled from gentoo packages 2. Supported Device scif mtd (NOR/NAND) usb host i2c rtc sound ether (SMSC911x) touch panel (The A version boards does not support) lcdc uio (VPU5/VEU2H/VEU2H) camera driver (omnivision ov7725) 3. NAND Interface NAND I/F is different by a board version. A,(B),C version : GBDriver B version : FLCTL 4. BSP quick starter Host cross enviroment setup < How to install > PC# tar zxf toolchain-gcc-4.1.2.tar.gz PC# cd toolchain PC# ls cross-sh4-unknown-linux-gnu/ installer/ PC# cd installer/ PC# ./install.sh You can confirm your installation by following command [root@localhost home]# sh4-unknown-linux-gnu-gcc -v Using built-in specs. Target: sh4-unknown-linux-gnu Configured with: /var/tmp/cross/sh4-unknown-linux-gnu/portage/cross-sh4-unknown-linux-gnu/gcc-4.1.2/work/gcc-4.1.2/configure --prefix=/usr --bindir=/usr/i486-pc-linux-gnu/sh4-unknown-linux-gnu/gcc-bin/4.1.2 --includedir=/usr/lib/gcc/sh4-unknown-linux-gnu/4.1.2/include --datadir=/usr/share/gcc-data/sh4-unknown-linux-gnu/4.1.2 --mandir=/usr/share/gcc-data/sh4-unknown-linux-gnu/4.1.2/man --infodir=/usr/share/gcc-data/sh4-unknown-linux-gnu/4.1.2/info --with-gxx-include-dir=/usr/lib/gcc/sh4-unknown-linux-gnu/4.1.2/include/g++-v4 --host=i486-pc-linux-gnu --target=sh4-unknown-linux-gnu --build=i486-pc-linux-gnu --disable-altivec --enable-nls --without-included-gettext --with-system-zlib --disable-checking --disable-werror --enable-secureplt --disable-libunwind-exceptions --disable-multilib --disable-libmudflap --disable-libssp --disable-libgcj --enable-languages=c,c++ --with-sysroot=/usr/sh4-unknown-linux-gnu --enable-__cxa_atexit --enable-clocale=gnu Thread model: posix gcc version 4.1.2 (Gentoo 4.1.2 p1.0.2) 5. How to build from source 5.1 U-boot [hoge@localhost src]$ tar ../zxf u-boot-ap3300rxax2-20090423.tar.gz [hoge@localhost src]$ cd u-boot [hoge@localhost u-boot]$ make ap325rxa_config Configuring for ap325rxa board... [hoge@localhost u-boot]$ make CROSS_COMPILE=sh4-unknown-linux-gnu- (snip) 5.2 Kernel [hoge@localhost src]$ tar zxf ../linux-2.6.27-ap3300rxax2-20090423.tar.gz [hoge@localhost src]$ cd linux-2.6.27 [hoge@localhost linux-2.6.27]$ cp arch/sh/configs/ap325rxa_defconfig .config [hoge@localhost linux-2.6.27]$ make menuconfig [hoge@localhost linux-2.6.27]$ make (snip) [hoge@localhost linux-2.6.27]$ cp arch/sh/boot/zImage /tftpboot/rootfs_gentoo(*1)/ (snip) (*1) Please match it with your rootfs-path. 5.3 Libshcodecs libshcodecs is a library for controlling SH-Mobile hardware codecs. The [SH-Mobile][0] processor series includes a hardware video processing unit that supports MPEG-4 and H.264 encoding and decoding. libshcodecs is available under the terms of the GNU LGPL. [hoge@localhost hoge]$ tar zxf ../libshcodecs-ap3300rxax2-20090423.tar.gz [hoge@localhost hoge]$ cd libshcodecs/ [hoge@localhost libshcodecs]$ ./autogen.sh (*2) checking for autoconf... checking for automake... yes checking for libtool... libtoolize I am going to run ./configure with no arguments - if you wish to pass any to it, please specify them on the ./autogen.sh command line. Generating configuration files for libshcodecs, please wait.... aclocal -I ./m4 libtoolize --automake autoheader automake --add-missing autoconf [hoge@localhost libshcodecs]$ ./configure CC=sh4-unknown-linux-gnu-gcc --host=sh4-linux --prefix=/tftpboot/rootfs_gentoo/usr [hoge@localhost hoge]$ make [hoge@localhost hoge]$ make install (*2) When you use UBUNTU, you have need the following possibilities. # sudo apt-get install libtool # sudo apt-get install autoconf As for the libshcodecs, development is on the way. You can acquire the latest edition from the following. http://linux-sh.org/cgi-bin/moin.cgi/libshcodecs # git clone git://github.com/kfish/libshcodecs.git # cd libshcodecs # ./autogen.sh # ./configure CC=sh4-unknown-linux-gnu-gcc --host=sh4-linux --prefix=/tftpboot/rootfs_gentoo/usr/ # make # make install 6. Host bootp / NFS setup AP3300 requires bootp and NFS capablities on host machine . 6.1 /etc/dhcpd.conf (Fedora 8 sample) ddns-update-style ad-hoc; default-lease-time 600; max-lease-time 7200; log-facility local7; option domain-name-servers 192.168.10.230; next-server 192.168.10.30; server-identifier 192.168.10.30; allow booting; allow bootp; subnet 192.168.10.0 netmask 255.255.255.0{ } host ap3300 { hardware ethernet xx:xx:xx:xx:xx:xx; fixed-address 192.168.10.233; filename"/rootfs_gentoo/zImage"; # filename"/rootfs_gentoo/uImage"; option root-path "/tftpboot/rootfs_gentoo"; } 6.2 /etc/exports (Fedora 8 sample) /tftpboot/ 192.168.10.0/255.255.255.0(rw,sync,no_root_squash) 6.3 /etc/xinetd.d/tftp (Fedora 8 sample) # default: off # description: The tftp server serves files using the trivial file transfer \ # protocol. The tftp protocol is often used to boot diskless \ # workstations, download configuration files to network-aware printers, \ # and to start the installation process for some operating systems. service tftp { socket_type = dgram protocol = udp wait = yes user = root server = /usr/sbin/in.tftpd server_args = -s /tftpboot disable = no per_source = 11 cps = 100 2 flags = IPv4 } 6.4 startup network (Fedora 8 sample) Then startup network servece on your host machine. [root@localhost ~]# exportfs -a [root@localhost ~]# /etc/rc.d/init.d/rpcbind restart Stopping portmap: [ OK ] Starting portmap: [ OK ] [root@localhost ~]# /etc/rc.d/init.d/nfs restart Shutting down NFS mountd: [ OK ] Shutting down NFS daemon: [ OK ] Shutting down NFS quotas: [ OK ] Shutting down NFS services: [ OK ] Starting NFS services: [ OK ] Starting NFS quotas: [ OK ] Starting NFS daemon: [ OK ] Starting NFS mountd: [ OK ] [root@localhost ~]# /etc/rc.d/init.d/nfslock restart Stopping NFS locking: [ OK ] Stopping NFS statd: [ OK ] Starting NFS statd: [ OK ] [root@localhost ~]# /etc/rc.d/init.d/dhcpd restart Shutting down dhcpd: [ OK ] Starting dhcpd: [ OK ] [root@localhost ~]# service xinetd restart Stopping xinetd: [ OK ] Starting xinetd: [ OK ] 7. console connection bitrate 38400 bps data length 8bit parity none stop bit 1bit 8. boot log U-Boot 2009.01 (Mar 16 2009 - 16:56:07) CPU: SH4 BOARD: AP325RXA DRAM: 128MB FLASH: 16MB In: serial Out: serial Err: serial => bootp smc911x: initializing smc911x: detected LAN9118 controller smc911x: phy initialized smc911x: MAC xx:xx:xx:xx:xx:xx BOOTP broadcast 1 TFTP from server 192.168.10.30; our IP address is 192.168.10.233 Filename '/rootfs_gentoo/zImage'. Load address: 0x89000000 Loading: ################################################################# ####################################################### done Bytes transferred = 1756352 (1accc0 hex) => go 89000000 ## Starting application at 0x89000000 ... Linux version 2.6.27 (hoge@localhost.localdomain) (gcc version 4.1.2 (Gentoo 4.1.2 p1.0.2)) #1 PREEMPT Wed Apr 22 11:59:48 JST 2009 Boot params: ... MOUNT_ROOT_RDONLY - ffffffff ... RAMDISK_FLAGS - ffffffff ... ORIG_ROOT_DEV - ffffffff ... LOADER_TYPE - ffffffff ... INITRD_START - ffffffff ... INITRD_SIZE - ffffffff Booting machvec: AP-325RXA NAND interface : GBDriver (PATA device) Node 0: start_pfn = 0x8000, low = 0xf800 Zone PFN ranges: Normal 0x00008000 -> 0x0000f800 Movable zone start PFN for each node early_node_map[1] active PFN ranges 0: 0x00008000 -> 0x0000f800 Built 1 zonelists in Zone order, mobility grouping on. Total pages: 30480 Kernel command line: console=tty1 console=ttySC5,38400 root=/dev/nfs ip=dhcp mem=120M memchunk.vpu=4m PID hash table entries: 512 (order: 9, 2048 bytes) Using tmu for system timer Using 8.333 MHz high precision timer. Console: colour dummy device 80x25 console [tty1] enabled Dentry cache hash table entries: 16384 (order: 4, 65536 bytes) Inode-cache hash table entries: 8192 (order: 3, 32768 bytes) Memory: 118016k/122880k available (2234k kernel code, 634k data, 108k init) PVR=10300801 CVR=7144040d PRR=00001510 I-cache : n_ways=4 n_sets=256 way_incr=8192 I-cache : entry_mask=0x00001fe0 alias_mask=0x00001000 n_aliases=2 D-cache : n_ways=4 n_sets=256 way_incr=8192 D-cache : entry_mask=0x00001fe0 alias_mask=0x00001000 n_aliases=2 S-cache : n_ways=4 n_sets=2048 way_incr=65536 S-cache : entry_mask=0x0000ffe0 alias_mask=0x0000f000 n_aliases=16 Calibrating delay loop... 159.23 BogoMIPS (lpj=318464) Mount-cache hash table entries: 512 CPU: SH7723 net_namespace: 288 bytes NET: Registered protocol family 16 SCSI subsystem initialized usbcore: registered new interface driver usbfs usbcore: registered new interface driver hub usbcore: registered new device driver usb DMA: Registering DMA API. DMA: Registering sh_dmac handler (6 channels). NET: Registered protocol family 2 IP route cache hash table entries: 1024 (order: 0, 4096 bytes) TCP established hash table entries: 4096 (order: 3, 32768 bytes) TCP bind hash table entries: 4096 (order: 2, 16384 bytes) TCP: Hash tables configured (established 4096 bind 4096) TCP reno registered NET: Registered protocol family 1 vpu: forcing memory chunk size to 0x00400000 Installing knfsd (copyright (C) 1996 okir@monad.swb.de). JFFS2 version 2.2. (NAND) c 2001-2006 Red Hat, Inc. msgmni has been set to 230 io scheduler noop registered io scheduler anticipatory registered io scheduler deadline registered io scheduler cfq registered (default) Console: switching to colour frame buffer device 200x80 graphics fb0: registered sh_mobile_lcdc_fb/mainlcd as 800x480 16bpp. SuperH SCI(F) driver initialized sh-sci: ttySC0 at MMIO 0xffe00000 (irq = 80) is a scif sh-sci: ttySC1 at MMIO 0xffe10000 (irq = 81) is a scif sh-sci: ttySC2 at MMIO 0xffe20000 (irq = 82) is a scif sh-sci: ttySC3 at MMIO 0xa4e30000 (irq = 56) is a sci sh-sci: ttySC4 at MMIO 0xa4e40000 (irq = 88) is a sci sh-sci: ttySC5 at MMIO 0xa4e50000 (irq = 109) is a sci console [ttySC5] enabled brd: module loaded smsc911x: Driver version 2008-10-21. smsc911x-mdio: probed eth0: attached PHY driver [Generic PHY] (mii_bus:phy_addr=ffffffff:01, irq=-1) net eth0: MAC Address: 00:13:a0:08:00:8c Linux video capture interface: v2.00 Driver 'sd' needs updating - please use bus_type methods scsi0 : pata_platform ata1: PATA max PIO0 mmio cmd 0xb4180200 ctl 0xb418021c irq 36 ata1.00: ATA-4: SA DANDNLFSA, xr02.00a, max PIO4 ata1.00: 998928 sectors, multi 0, CHS 991/16/63 ata1.00: configured for PIO ata1.00: configured for PIO ata1: EH complete scsi 0:0:0:0: Direct-Access ATA SA DANDNLFSA xr02 PQ: 0 ANSI: 5 sd 0:0:0:0: [sda] 998928 512-byte hardware sectors (511 MB) sd 0:0:0:0: [sda] Write Protect is off sd 0:0:0:0: [sda] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA sd 0:0:0:0: [sda] 998928 512-byte hardware sectors (511 MB) sd 0:0:0:0: [sda] Write Protect is off sd 0:0:0:0: [sda] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA sda: sda1 sd 0:0:0:0: [sda] Attached SCSI disk physmap platform flash device: 01000000 at 00000000 physmap-flash.0: Found 1 x16 devices at 0x0 in 16-bit bank Amd/Fujitsu Extended Query Table at 0x0040 physmap-flash.0: CFI does not contain boot bank location. Assuming top. number of CFI chips: 1 cfi_cmdset_0002: Disabling erase-suspend-program due to code brokenness. RedBoot partition parsing not available Using physmap partition information Creating 5 MTD partitions on "physmap-flash.0": 0x00000000-0x00100000 : "uboot" 0x00100000-0x00300000 : "kernel" 0x00300000-0x00a80000 : "free-area0" 0x00a80000-0x00ac0000 : "CPLD-Data" 0x00ac0000-0x01000000 : "free-area1" No NAND device found!!! r8a66597_hcd: driver r8a66597_hcd, 10 Apr 2008 r8a66597_hcd r8a66597_hcd.0: USB Host Controller r8a66597_hcd r8a66597_hcd.0: new USB bus registered, assigned bus number 1 r8a66597_hcd r8a66597_hcd.0: irq 65, io base 0xa4d80000 usb usb1: configuration #1 chosen from 1 choice hub 1-0:1.0: USB hub found hub 1-0:1.0: 1 port detected Initializing USB Mass Storage driver... usb 1-1: new high speed USB device using r8a66597_hcd and address 2 usb 1-1: configuration #1 chosen from 1 choice scsi1 : SCSI emulation for USB Mass Storage devices usbcore: registered new interface driver usb-storage USB Mass Storage support registered. mice: PS/2 mouse device common for all mice AP-325RXA touchscreen drive i2c /dev entries driver rtc-pcf8563 0-0051: chip found, driver version 0.4.3 rtc-pcf8563 0-0051: rtc core: registered rtc-pcf8563 as rtc0 camera 0-0: SuperH Mobile CEU driver attached to camera 0 camera 0-0: ov7725 Product ID 77:21 Manufacturer ID 7f:a2 camera 0-0: SuperH Mobile CEU driver detached from camera 0 usbcore: registered new interface driver usbhid usbhid: v2.6:USB HID core driver Advanced Linux Sound Architecture Driver Version 1.0.17. ak4644_codec 0-0012: chip found, driver version 0.1.0 ALSA device list: #0: SUPERH SH7723-MSIOF ALSA Driver TCP cubic registered NET: Registered protocol family 17 RPC: Registered udp transport module. RPC: Registered tcp transport module. rtc-pcf8563 0-0051: setting system clock to 2009-04-23 06:47:32 UTC (1240469252) net eth0: SMSC911x/921x identified at 0xb6080000, IRQ: 35 Sending DHCP requests .., OK IP-Config: Got DHCP answer from 192.168.10.30, my address is 192.168.10.233 IP-Config: Complete: device=eth0, addr=192.168.10.233, mask=255.255.255.0, gw=192.168.10.30, host=192.168.10.233, domain=rso, nis-domain=(none), bootserver=192.168.10.30, rootserver=192.168.10.30, rootpath=/tftpboot/rootfs_gentoo Looking up port of RPC 100003/2 on 192.168.10.30 Looking up port of RPC 100005/1 on 192.168.10.30 VFS: Mounted root (nfs filesystem) readonly. Freeing unused kernel memory: 108k freed INIT: version 2.86 booting scsi 1:0:0:0: Direct-Access BUFFALO ClipDrive 2.00 PQ: 0 ANSI: 2 ready sd 1:0:0:0: [sdb] 512000 512-byte hardware sectors (262 MB) sd 1:0:0:0: [sdb] Write Protect is off sd 1:0:0:0: [sdb] Assuming drive cache: write through sd 1:0:0:0: [sdb] 512000 512-byte hardware sectors (262 MB) sd 1:0:0:0: [sdb] Write Protect is off sd 1:0:0:0: [sdb] Assuming drive cache: write through sdb: sdb1 sd 1:0:0:0: [sdb] Attached SCSI removable disk Gentoo Linux; http://www.gentoo.org/ Copyright 1999-2007 Gentoo Foundation; Distributed under the GPLv2 Press I to enter interactive boot mode * Mounting proc at /proc ... [ ok ] * Mounting sysfs at /sys ... [ ok ] * Mounting /dev for udev ... [ ok ] * Seeding /dev with needed nodes ... [ ok ] * Starting udevd ... [ ok ] Major number is 0. * Populating /dev with existing devices through uevents ... [ ok ] * Letting udev process events ...udevd-event[1058]: rename_netif: error changing netif name eth0 to eth6: Device or resource busy [ ok ] * Finalizing udev configuration ... [ ok ] * Mounting devpts at /dev/pts ... [ ok ] * Remounting root filesystem read/write ... [ ok ] * Checking all filesystems ... [ ok ] * Mounting local filesystems ... [ ok ] * Activating (possible) swap ... [ ok ] * Setting system clock using the hardware clock [UTC] ... [ ok ] * Configuring kernel parameters ... [ ok ] * Updating environment ... [ ok ] * Cleaning /var/lock, /var/run ... [ ok ] * Cleaning /tmp directory ... [ ok ] INIT: Entering runlevel: 3 This is 192.168.10.233.168.10.233 (Linux sh4a 2.6.27) 15:48:17 192.168.10.233 login: 9. other 9.1 touchpanel # /home/tsattach & # /home/evtest /dev/input/event0 9.2 directfb Please refer to the following for the details in the "DirectFB". http://www.directfb.org/ 9.2.1 A practice method # insmod /usr/local/sh4-linux/lib/modules/2.6.27/drivers/char/fusion/fusion.ko # insmod /usr/local/sh4-linux/lib/modules/2.6.27/renesas/sh772x_gfx.ko # /usr/local/sh4-linux/bin/df_xx (Only "df_andi" and "df_dok" and "df_input" are finished with operation check) 9.2.2 df_andi Penguin Population 200 , 46.5 FPS 9.2.3 df_dok log # /usr/local/sh4-linux/bin/df_dok ~~~~~~~~~~~~~~~~~~~~~~~~~~| DirectFB 1.3.0 |~~~~~~~~~~~~~~~~~~~~~~~~~~ (c) 2001-2008 The world wide DirectFB Open Source Community (c) 2000-2004 Convergence (integrated media) GmbH ---------------------------------------------------------------- (*) DirectFB/Core: Multi Application Core. (2008-12-03 11:21) (*) Fusion/SHM: Using MADV_REMOVE (2.6.27.0 >= 2.6.19.2) (*) Direct/Thread: Started 'Fusion Dispatch' (2029) [MESSAGING OTHER/OTHER 0/0] <8388608>... (*) Direct/Thread: Started 'Keyboard Input' (2031) [INPUT OTHER/OTHER 0/0] <8388608>... (*) DirectFB/Input: Keyboard 0.9 (directfb.org) (*) SH7722/LCD: Allocated 800x480 RGB16 Buffer (768000 bytes) at 0x0e600000 ((nil)) (*) DirectFB/Graphics: Renesas SH7723 0.9 (Denis & Janine Kropp) (*) DirectFB/Core/WM: Default 0.3 (directfb.org) (*) Direct/Interface: Loaded 'PNG' implementation of 'IDirectFBImageProvider'. (*) Direct/Interface: Loaded 'FT2' implementation of 'IDirectFBFont'. (*) Direct/Interface: Loaded 'GIF' implementation of 'IDirectFBImageProvider'. Benchmarking 256x256 on 800x464 RGB16 (16bit)... Anti-aliased Text 3.033 secs ( 39.169 KChars/sec) [100.0%] Anti-aliased Text (blend) 3.001 secs ( 11.996 KChars/sec) [100.0%] Fill Rectangle 6.645 secs (* 172.592 MPixel/sec) [ 12.3%] Fill Rectangle (blend) 8.196 secs (* 75.962 MPixel/sec) [ 6.3%] Fill Rectangles [10] 6.064 secs (* 172.918 MPixel/sec) [ 1.6%] Fill Rectangles [10] (blend) 10.340 secs (* 76.057 MPixel/sec) [ 0.8%] Fill Triangles 13.169 secs (* 20.901 MPixel/sec) [ 2.8%] Fill Triangles (blend) 28.279 secs (* 8.342 MPixel/sec) [ 1.1%] Draw Rectangle 3.004 secs (* 13.382 KRects/sec) [100.0%] Draw Rectangle (blend) 3.181 secs ( 8.299 KRects/sec) [ 59.1%] Draw Lines [10] 3.063 secs (* 100.228 KLines/sec) [ 55.5%] Draw Lines [10] (blend) 3.036 secs ( 2.964 KLines/sec) [100.0%] Fill Spans 3.031 secs (* 166.488 MPixel/sec) [ 59.4%] Fill Spans (blend) 3.099 secs (* 74.016 MPixel/sec) [ 28.8%] Blit 10.482 secs (* 53.144 MPixel/sec) [ 4.1%] Blit 180 3.200 secs ( 26.624 MPixel/sec) [100.0%] Blit colorkeyed 12.713 secs (* 56.705 MPixel/sec) [ 4.4%] Blit destination colorkeyed 3.047 secs ( 8.603 MPixel/sec) [100.3%] Blit with format conversion 3.403 secs ( 15.406 MPixel/sec) [100.0%] Blit with colorizing 3.328 secs ( 3.938 MPixel/sec) [100.3%] Blit from 32bit (blend) 3.206 secs ( 4.088 MPixel/sec) [100.0%] Blit from 32bit (blend) with colorizing 3.763 secs ( 1.741 MPixel/sec) [100.0%] Stretch Blit 3.096 secs ( 26.260 MPixel/sec) [100.0%] Stretch Blit colorkeyed 3.086 secs ( 19.724 MPixel/sec) [100.3%] 9.3 default flash memory mapping 0x00000000-0x00100000 : "uboot" 0x00100000-0x00300000 : "kernel" 0x00300000-0x00a80000 : "free-area0" 0x00a80000-0x00ac0000 : "CPLD-Data" (*3) 0x00ac0000-0x01000000 : "free-area1" 0x00000000-0x20000000 : "nand_data" (*3) The "CPLD-Data" is a binary of the initialization cord of FPGA. Therefore, please do not erase it. 10. source code Please contact to the following e-mail address when you want to obtain a source code. info (at) superh-linux (dot) org -- This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (http://www.openssl.org/)