You are on page 1of 95

Soc3210 Linux

SOC3210 Linux

20086

V1.3

107 86-010-85584809
www.longxinzhijian.cn

Page 1 of 95

Soc3210 Linux

V1.0

20086

V1.1

200811

V1.2

20101

V1.3

20107

107 86-010-85584809
www.longxinzhijian.cn

Page 2 of 95

Soc3210 Linux

................................................................................................................................................................. 6
1.1 ................................................................................................................................................. 6
1.2 ............................................................................................................................................................. 6
......................................................................................................................................................................... 6
BSP.............................................................................................................................................................................. 6
DBM.............................................................................................................................................................................. 6
Debug Machine3210 ..................................................................................................... 6
iPid............................................................................................................................................................................ 6
......................................................................................................................... 6
SOC3210-DEV ....................................................................................................................................... 7
2.1 ............................................................................................................................................................. 7
2.2 SOC3210-DEV ............................................................................................................................................ 7
2.2.1 ..................................................................................................................................... 7
2.3 ........................................................................................................................................................... 11
2.4 ........................................................................................................................................................... 14
............................................................................................................................................... 15
3.1 Step1 ............................................................................................................................................... 15
3.2 Step2 ............................................................................................................................................... 15
3.3 Step3 LCD........................................................................................................................ 15
3.4 Step4 ............................................................................................................................................... 15
SOC3210-DEV ................................................................................................................................. 17
4.1 SOC3210-DEV .......................................................................................................................................... 17
4.2 SOC3210-DEV ................................................................................................................................... 19
Linux .................................................................................................................................................. 21
5.1 Linux ............................................................................................................................................... 21
5.1.1 ls....................................................................................................................................... 21
5.1.2 cd....................................................................................................................................... 21
5.1.3 cp............................................................................................................................................... 21
5.1.4 rm............................................................................................................................................... 21
5.1.5 mv............................................................................................................................................... 21
5.1.6 diff........................................................................................................................................... 21
5.1.7 ech0........................................................................................................................................... 21
5.1.8 du....................................................................................................................................... 22
5.1.9 cat............................................................................................................................. 22
5.1.10 more................................................................................................................................. 22
5.1.11 date................................................................................................................................. 22
5.1.12 find......................................................................................................................................... 22
5.1.13 grep......................................................................................................................................... 22
5.1.14 export..................................................................................................................... 22
5.1.15 vi............................................................................................................................................. 22
5.1.16 tar............................................................................................................................... 22

107 86-010-85584809
www.longxinzhijian.cn

Page 3 of 95

Soc3210 Linux

5.1.17 mount....................................................................................................................................... 23
5.1.18 dmesg....................................................................................................................... 23
5.1.19 chmod....................................................................................................................... 23
5.1.20 mknod............................................................................................................................... 23
5.1.21 ps..................................................................................................................................... 23
5.1.22 kill................................................................................................................................. 23
5.2 ....................................................................................................................................... 23
5.2.1 ifconfig ..................................................................................................................................... 23
5.2.2 route ........................................................................................................................................... 23
5.2.3 ping ............................................................................................................................................. 24
5.2.4 traceroute ................................................................................................................................. 24
5.2.5 telnet............................................................................................................................... 24
5.2.6 Telnet inetd..................................................................................................................... 24
SOC3210-DEV Linux ........................................................................................................ 26
6.1 ................................................................................................................................................... 26
6.2 ....................................................................................................................................................... 27
6.3 ....................................................................................................................................................... 27
6.4 ........................................................................................................................................................... 31
6.4.1 JTAG....................................................................................................................................................... 31
6.4.2 minicom................................................................................................................................................. 32
6.4.3 cutecom................................................................................................................................................. 35
6.5 Bootloader ............................................................................................................................................ 37
6.5.1Pmon ........................................................................................................................................... 38
6.5.2Pmon ........................................................................................................................... 39
6.5.3 pmon ......................................................................................................................................... 42
6.5.4 soc-boot ................................................................................................................................. 49
6.5.4.1 soc-boot ..................................................................................................................... 49
6.6 ............................................................................................................................................... 56
6.6.1 ................................................................................................................................................ 56
6.6.2 ............................................................................................................................... 58
6.7 ........................................................................................................................................... 59
6.8 ........................................................................................................................................... 61
6.8.1 Helloworld....................................................................................................................................... 61
6.8.2 ............................................................................................................................... 62
6.9 ........................................................................................................................................... 63
6.9.1 Linux ................................................................................................................... 63
6.9.2 ....................................................................................................................... 63
6.9.2.1 ....................................................................................................................... 64
6.9.2.2 ................................................................................................................... 66
6.9.3 ....................................................................................................................................... 68
6.10 linux ............................................................................................................................. 74
................................................................................................................................................... 76
7.1 ............................................................................................................................................... 76

107 86-010-85584809
www.longxinzhijian.cn

Page 4 of 95

Soc3210 Linux

7.2 ........................................................................................................................................................... 76
7.3 ftp/telnet ................................................................................................................ 77
7.4 ................................................................................................................................................... 78
7.5 NFS ........................................................................................................................... 78
7.6 webserver ................................................................................................................................... 78
7.7 ipid ......................................................................................................................................... 79
7.8 qtopia ............................................................................................................................................. 81
Qt.............................................................................................................................................. 82
8.1 QTE3.......................................................................................................................................................... 82
8.2 QTE2.......................................................................................................................................................... 82
....................................................................................................................................................... 89
9.1 ................................................................................................................................................... 89
9.2 ................................................................................................................................................... 90
9.3 u ................................................................................................................................................... 91
9.4 SD ................................................................................................................................................. 92
9.5 ................................................................................................................................................... 92
9.6 ................................................................................................................................................... 94

107 86-010-85584809
www.longxinzhijian.cn

Page 5 of 95

Soc3210 Linux

1.1

SOC3210

SOC3210-DEV
LINUX
SOC3210-DEV LINUX

QT

1.2

BSP

Board Support Package

DBM

Debug Machine3210

iPid

107 86-010-85584809
www.longxinzhijian.cn

Page 6 of 95

Soc3210 Linux

SOC3210-DEV
2.1
SOC3210-DEV
SOC3210-DEV LinuxiPid
1 jtag Linux
DB9
RJ-45
JTAG

2.2 SOC3210-DEV
SOC3210-DEV SOC3210 4 SOC3210 SOC3210
(System-On-Chip)32RISC CPU MIPSII
266MHzMACMII SDRAM NOR
FLASH/ROMNAND FLASH HPI VOIP CODEC
I2C UART SPI AC97 GPIO +

Linux SOC3210
MP3 Web

2.2.1
SOC3210-DEV

SOC3210 266MHz MIPS

Cache

16KB Cache8KB Cache

64MB SDRAM (32 )

NANDFLASH

128MB NAND Flash

Boot ROM

2MB NOR Flash

107 86-010-85584809
www.longxinzhijian.cn

Page 7 of 95

Soc3210 Linux

SPI

SDSD

2 10/100M RJ45 , WIFI

RS232

2 DB9

CAN

CAN-BUS 1Mbps

I2C

1 I2C FM/AM module


LCD DSTN TFT (3.3V/5V)1024

768
VGA SVGA1024768
64 IO3.3V 2.00
:

A)(3.3V);

B)(3.3V);
I/O
C)PWM ,/,0-4MHz;
D)
ADC

8 A/D,12bits ,100KSPS 2.00

DAC

8 D/A,12bits ,100KSPS 2.00

1AC97 1 MIC 1 1

Watchdog

watchdog
: DC +5+12V/3A

: 1: DC5V/3A 2: DC3.3V/3A 3: DC1.8V/800mA 4:


DC1.2V/800mA

8 /LED

SOC3210-DEV

JTAG

Jtag Debug Tool

BIOS

PMON

Jtag

Bootloader

107 86-010-85584809
www.longxinzhijian.cn

Page 8 of 95

Soc3210 Linux

Xmodem,ymodem
Netconfig

,ifaddr

tftp

Tftp

Flash Driver & Flash Tool


Flash update
BIOS

PMON

XmodemYmodem

Nor Nand
Flash

Set Kernel Parameter


FAT & Ext2 Support

FAT Ext2

SD Card Driver

SD

LCD Driver

LCD

Gzip

Gzip

Etc

Bootloader

Set Kernel Parameter

SOC-BOOT
Flash Driver & Flash Tool
Gzip
Etc
Linux kernel 2.6.18 & 2.4.18

Nor Nand
Gzip

2.4.18 2.6.18

ROM/CRAM/EXT2/SQUASH/YAFFS/J2FFS/NFS file
ROM/CRAM/EXT2/SQUASH/YAFFS/J2FFS

system
/NFS
etc.
System Interrupt & Timer Driver

Serial device Driver

Block device Driver

Nor Flash Driver

Nor Flash

Nand Flash Driver

Nand Flash

107 86-010-85584809
www.longxinzhijian.cn

Page 9 of 95

Soc3210 Linux

10/100MBase-T external Ethernet Device Driver

10/100M

RTC (Real Time Clock) Driver

USB Host Driver

USB Host

USB Slave Driver

USB Slave

LEDS

LEDS

Buttons

Many Country Language Support

LCD

(LCD)

Frame Buffer Driver

Frame Buffer

Infrared remote control

AC97 OSS Driver

AC97

Watch Dog Driver

SD card Driver

SD

TCP/IP
ICMP
ARP/RARP

TCP/IP
ICMP
ARP/RARP

UDP

UDP

PPP

PPP

IGMP

IGMP

SMTP

SMTP

SNMP

SNMP

SIP

SIP

NFS

NFS

Remote login (telnet) Telnet


Web server
Web base management suite (Sample only)

Console & FTP

Online

107 86-010-85584809
www.longxinzhijian.cn

Web

FTP

Page 10 of 95

Soc3210 Linux

Local console through RS232 and remote telnet


configuration and management(Sample Only)

WEB configuration and management(Sample Only)

Network ping

telnet

ping
ifconfig,route,inetd

Ifconfig,route,inetd

Login,sh,eth0,discard

Cat,chmod,discard,ech0,flashfsd,flashwrite,fre

e,genhtml,hostname,init,kill,loader,Is,mkdir,m

ount,ps,reboot,rm,smanaged,sysconf,yes,insmod,

Linux
Ismod,rmmod
SOCplayer

mp3

Wma Decode Lib

Wma

Sqlite DataBase

Sqlite

Qt3.3Embedded Lib

QT

Ncurses Lib

Leds

LED

SOC3210_button

U Disk

USB
USB Camera

USB

2.3
Tools
-JTAG
-SOC3210 JTAG
-Toolchian
-SOC3210 gcc

107 86-010-85584809
www.longxinzhijian.cn

Page 11 of 95

Soc3210 Linux

-mkfs_tool
-
-tools
-ftp
Documents
-SOC3210_BSP
-CF DBM
-qtopia
-ramdisk
-
- drivers manual.pdf
- SOC3210
-datasheet
-3210i
-3210M
-3210W
-3210
-featurelist
-3210i
-3210M
-3210W
-3210

-usermanual
Miscellaneous
-SOC3210-DEV
-DEV
-DEV3210
-EIC100
-pc104

107 86-010-85584809
www.longxinzhijian.cn

Page 12 of 95

Soc3210 Linux

Software
-Bootloader
-SOC3210-DEV bootloader
-Busybox
-Busybox
-linux
-SOC3210 linux
-application
-ipid
-ipid pmon,
-GUI
- SOC3210 QTE3QTE2,qtopia_bin
-
-
-mp3
-mp3
-
-
-QQ
-QQ
-webserver
-webserver
Other
-ncurses
-
-Database
-SOC3210
Examples
-SOC3210

107 86-010-85584809
www.longxinzhijian.cn

Page 13 of 95

Soc3210 Linux

2.4
SOC3210-DEV JTAG PC
2.0GPC
Fedora core 8.0 PMON
Red Hat (TFTPNFS)
512M
40GB
CD-ROM DVD-ROM

USB

107 86-010-85584809
www.longxinzhijian.cn

Page 14 of 95

Soc3210 Linux

3.1 Step1

3.2 Step2
3.3 Step3 LCD
3.4 Step4
Demo iPid

107 86-010-85584809
www.longxinzhijian.cn

Page 15 of 95

Soc3210 Linux

107 86-010-85584809
www.longxinzhijian.cn

Page 16 of 95

Soc3210 Linux

SOC3210-DEV
4.1 SOC3210-DEV

107 86-010-85584809
www.longxinzhijian.cn

Page 17 of 95

Soc3210 Linux

107 86-010-85584809
www.longxinzhijian.cn

Page 18 of 95

Soc3210 Linux

4.2 SOC3210-DEV
SOC3210-DEV SDRAMNand FlashRJ-45
MIC SD-CARD Jtag USB WIFILCD ,PS/2

1.
2.
3. 1 USB U (USB )
4. mic
5. line out
6. HP out
7. SD
8. LCD 25*2/2mm
9. video port:
10. VGA

107 86-010-85584809
www.longxinzhijian.cn

Page 19 of 95

Soc3210 Linux

11. COM 9
12. LNALocal Area Network

13. 12V/5A
14.. 14 JTAG

15.NAND FLASH
16.NOR FLASH
17.CPU

107 86-010-85584809
www.longxinzhijian.cn

Page 20 of 95

Soc3210 Linux

Linux
5.1 Linux
5.1.1 ls
#ls

#lsa

#ls l

5.1.2 cd
#cd dir

#dir

#cd /

#cd ..

5.1.3 cp
#cp source target

#source target

#cp /root/source .

#/root source

#cp av soure_dir target_dir

#cp fr source_dir target_dir

#source

5.1.4 rm
#rm file

#rm -fr dir

#dir

5.1.5 mv
#mv source target

#source target

5.1.6 diff
#diff dir1 dir2

#1 2

#diff file1 file2

#1 2

5.1.7 ech0
#ech0 message

107 86-010-85584809
www.longxinzhijian.cn

Page 21 of 95

Soc3210 Linux

#echo "message message2"

5.1.8 du
#du

#du -sm /root

#/root M

5.1.9 cat
#cat file

#DOS type

#cat file | more

#more lessfile

5.1.10 more
#more

#ls | more

5.1.11 date
#date

#date -s 20:30:30

#20:30:30

#date -s 2002-3-5

#2002-3-5

5.1.12 find
#find -name /path file

#/path file

5.1.13 grep
#grep -ir chars

#chars-i
#-r

5.1.14 export
#export LC_ALL=zh_CN.GB2312

#LC_ALL zh_CN.GB2312

5.1.15 vi
#vi file

#file

vi
ctrl+c :x(),:x!() :w(),:w!(
) :r file (file) ,:%s/oldchars/newchars/g(oldchars newchars)

5.1.16 tar
#tar xfzv file.tgz

#file.tgz

107 86-010-85584809
www.longxinzhijian.cn

Page 22 of 95

Soc3210 Linux

#tar cfzv file.tgz source_path

#source_path file.tgz

5.1.17 mount
#mount -t yaffs /dev/mtdblock/0 /mnt

#/dev/mtdblock/0 /mnt

#mount -t nfs 192.168.0.1:/friendly-arm/root /mnt

#nfs
/friendlyarm/root /mnt

5.1.18 dmesg
#dmesg

#kernle

5.1.19 chmod
#chmod a+x file

#file
bash file

#chmod 666 file

#file

5.1.20 mknod
#mknod /dev/tty1 c 4 1

#tty1,41tty

5.1.21 ps
#ps

#ps ef

5.1.22 kill
#kill -9 500

#500

5.2
5.2.1 ifconfig
ifconfig SOC3210-DEV
loloopback
ifconfig
#ifconfig eth0 192.168.1.100 255.255.255.0 netmask 255.255.255.0
SOC3210-DEV IP 192.168.1.100ifconfig
#ifconfig eth0 down
5.2.2 route
route linux

107 86-010-85584809
www.longxinzhijian.cn

Page 23 of 95

Soc3210 Linux

#route

#route add default gw 192.168.1.1

#192.168.1.1

#route del default

5.2.3 ping
ping ip ip
#ping c 3 192.168.3.1

#192.168.3.1 3

5.2.4 traceroute
traceroute
5.2.5 telnet
telnet telnet telnet
SOC3210-DEV telnet SOC3210-DEV telnet
telent IP 192.168.1.20

#telnet 192.168.1.20

5.2.6 Telnet inetd


SOC3210-DEV IP inetd inetd
telnet
SOC3210-DEV IP 192.168.1.100Linux

107 86-010-85584809
www.longxinzhijian.cn

Page 24 of 95

Soc3210 Linux

#telnet 192.168.1.100

107 86-010-85584809
www.longxinzhijian.cn

Page 25 of 95

Soc3210 Linux

SOC3210-DEV Linux
6.1
X86 fedora core 8 1GB
root
Step1
Step1

#cd /media
#mkdir cdrom
#mount /dev/sr0 /media/cdrom
Step2/SOC3210 /SOC3210
/home/dev/SOC3210 ,
/home/dev/develop

#cp a /media/cdrom/* /home/dev /SOC3210/


Step3Linux
#cd /home/dev/develop
#tar xvzf ../SOC3210/Software/linux/soc3210_linux-2.6.18_v1.1.tgz
Step4 Linux
/home/dev/develop/gcc-3.4.6
#cd /home/dev/develop
#tar xvzf ../SOC3210/Tools/Toolchain/x86/gcc-3.4.6.tgz C /home/dev/develop
Step5dbm x86

#export PATH=/home/dev/develop /gcc-3.4.6/bin:$PATH


Step6

#eject
mipsel-linux-gcc mipsel-linux
PATH /etc/profile

107 86-010-85584809
www.longxinzhijian.cn

Page 26 of 95

Soc3210 Linux

6.2
Linux Linux
DBM DBMx86
x86
/Tool/Toolchain/x86/ SOC3210/Tools/Toolchain/dbm SOC3210/Tools/Toolchain/x86
gcc-3.4.6.tgz
Step1
Step1

#cd /home/dev/develop
#tar xvzf ../SOC3210/Tool/Toolchain/x86/gcc-src-3.4.6.tgz -C /home/dev/develop
#cd / home/dev/develop/gcc
p2

Step2
#./autobuild-3.4.6 all
/home/dev/develop

6.3
/home/dev/SOC3210
/SOC3210/Software
|__Bootloader

SOC3210 Bootloader

107 86-010-85584809
www.longxinzhijian.cn

Page 27 of 95

Soc3210 Linux

|__soc-boot-v1.0.tgz

bootloader

|__Gzrom-16.bin

pmon

|__ pmon_3210

pmon

|__Busybox
|__busybox-1.00.tar.gz

busybox

|__busybox-1.1.0.tar.gz

busybox

|__busybox-1.1.3.tar.gz

busybox

|__linux
|__soc3210_linux_2.6.18_v1.1.tgz
|__webserver webserver

SOC3210 linux-2.6.18

|__application
|__ipid

ipid pmon

|__MP3

mp3

|__

|__

|__QQ

QQ

|__GUI
|__qtopia_bin qtopia
|__QT3
|__qt-x11-free-3.3.7.tar.gz

QT (X11 )

|__qt-embedded-free-3.3.7.tar.gz

QT ()

|__QT2
|__tmake-1.11.tar.gz

tmake

|__qt-x11-2.3.2.tar.gz

QT (X11 )

|__qt-embedded-2.3.7.tar.gz

QT ()

|__ e2fsprogs-1.38.tar.

QT uuid

|__ qtopia-free-1.7.0.tar

qtopia

|__ramdisk.tgz

/SOC3210/Tool

107 86-010-85584809
www.longxinzhijian.cn

Page 28 of 95

Soc3210 Linux

|__JTAG/x86
|__ejtag-2.6.23-42.fc8.tar.gz

fedora 8 jtag

|__ejtag-ubuntu-2.6.24.16.tar.gz

ubuntu jtag

|__JTAG/dbm
|__ejtag-v1.tgz

DBM

|__Toolchain/X86
|__ gcc-3.4.6.tgz

(X86 )

|__ toolchain-pmon.tgz

pmon

|__gcc-src-3.4.6

|__Cross.tar.gz

qt

|__Toolchain/dbm
|__ toolchain_dbm.tar.

DBM

|__tools
|__lrzs z-0.12.20.tar srzlz

,xmodem,ymodem

|__cutecom-0.13.2.tar

Linux

|__minicom Linux

|__tftpboot

windows tftp-server

|__Xlight_FTP_serve_2.86_HH_GN

Windows FTP

|__DNW

windows

|__mkfs_tool

/SOC3210/Documents
|__SOC3210_BSP.pdf

SOC3210 BSP

|__CFDBM .pdf

DBM CF

|__qtopia .pdf

qtopia

|__ramdisk

ramdisk

|__

|__ drivers manual.pdf

|__ SOC3210
|__datasheet

107 86-010-85584809
www.longxinzhijian.cn

Page 29 of 95

Soc3210 Linux

|__3210i
|__SOC3210i_datasheet_V1.4.pdf

SOC3210i_datasheet

|__3210M
|__SOC3210M_datasheet_V1.5.pdf

SOC3210M_datasheet

|__3210W
|__SOC3210W_datasheet_V1.6.pdf

SOC3210W_datasheet

|__3210
|__SOC3210 _datasheet_V1.6.pdf
|__featurelist
|__3210i
|__SOC3210I-featurelist_V1.2.pdf

SOC3210I-featurelist

|__3210M
|__SOC3210M-featurelist_V1.2.pdf

SOC3210M-featurelist

|__3210W
|__SOC3210W-featurelist_V1.3.pdf

SOC3210W-featurelist

|__3210
|__SOC3210 _featurelist_V1.4.pdf

SOC3210 _featurelist

|__SOC3210 _featurelistCN_V1.4.pdf

SOC3210 _featurelistCN

|__usermanual
|__SOC3210 _UserManual-V1.3.pdf

SOC3210 _UserManual

/SOC3210/Miscellaneous
|__SOC3210

SOC3210

|__DEV .pdf

DEV

|__DEV3210

DEV3210

|__EIC100
|__pc104
|__PC104 (EIC100).pdf
/SOC3210/other
|__Database

107 86-010-85584809
www.longxinzhijian.cn

sqlite-3.5.9.tgz

Page 30 of 95

Soc3210 Linux

Linux
|__ncurses

ncurses-5.6.tar.gz

/SOC3210/examples
|__demo_math.tgz

demo

|__demo_sqlite.tgz

demo

|__driver_test.tgz

demo

|__demo_ac97.tgz

ac97 demo

|__demo_watchdog.tgz

demo

|__demo_canbus.tgz

can demo

|__demo_ts.tgz

iic demo

|__demo_keyboard.tgz

keyboard demo

|__demo_lcd.tgz

lcd demo

|__demo_ncurses.tgz

ncurses demo

|__demo_qt_lib.tgz qt

demo

|__demo_ramdisk.tgz

ramdisk demo

|__demo_sqlite.tgz

sqlite demo

|__demo_hello.tgz

demo

6.4
6.4.1 JTAG
JTAG Linux JTAG Bootloader Flash /Tools
JTAG JTAG(
)JTAG
#cd /home/dev/develop
X86
#tar zxvf /home/dev/SOC3210/Tools/JTAG/x86/ejtag-2.6.23-42.fc8.tar.gz
#cd ejtag-2.6.23-42.fc8
DBM
#tar zxvf /home/dev/SOC3210/Tools/JTAG/dbm/ejtag-v1.tgz

107 86-010-85584809
www.longxinzhijian.cn

Page 31 of 95

Soc3210 Linux

#cd ejtag-v1
#./ejtag-build.sh
#./ejtag_client
JTAG ./ejtag_build.sh JTAG
./ejtag_client JTAG

ejtag-build.sh ejtag_client JATG ipL


jtag flash

6.4.2 minicom
minicom Linux Windows
Linux minicom

107 86-010-85584809
www.longxinzhijian.cn

Page 32 of 95

Soc3210 Linux

Serial port setup

107 86-010-85584809
www.longxinzhijian.cn

Page 33 of 95

Soc3210 Linux

A AA/dev/ttyS0, windows
COM1
F FNO
E EE

minicom
minicom

107 86-010-85584809
www.longxinzhijian.cn

Page 34 of 95

Soc3210 Linux

minicom ctrl+Actrl+A Q
Yes

6.4.3 cutecom
Cutecom Linux Jtag Bootloader
Cutecom,cutecomcutecomcutecom
cutecom/Tools/tools/

107 86-010-85584809
www.longxinzhijian.cn

Page 35 of 95

Soc3210 Linux

Cutecom

107 86-010-85584809
www.longxinzhijian.cn

Page 36 of 95

Soc3210 Linux

Cutecom

Cutecom

6.5 Bootloader
BootloaderPmon soc-BootPmon

107 86-010-85584809
www.longxinzhijian.cn

Page 37 of 95

Soc3210 Linux

soc-Boot Boot
Pmon soc-Boot Pmon soc-Boot

6.5.1Pmon
1pmon
Pmon Software/Bootloader/pmon_3210.tgzPmon
Tools/Toolchain/x86/toolchain-pmon.tgz
/home/dev/develop
#cd /home/dev/develop/
#tar xvzf ../SOC3210/Tools/Toolchain/x86/toolchain-pmon.tgz C /

/usr/local/comp/mips-elf/gcc-2.95.3/
/usr/local/comp/mips-elf/gcc-2.95.3/
/usr/local/comp/mips-elf/gcc-2.95.3/path
path
export PATH=/usr/local/comp/mips-elf/gcc-2.95.3/bin:$PATH

2pmon
#cd /home/dev/develop
#tar xvzf /home/dev/SOC3210/Software/Bootloader/pmon_3210.tgz
#cd pmon_3210

flash
flash
pmon
pmon
#vi Targets/soc_soc/conf/gc

option APB_CLK=100000000
option CPU_CLK=250000000 CPU

option CONS_BAUD=B115200

norflash
norflash
88
option NORF16BIT=1 #16bitsflash

#option NORF16BIT=1 #16bitsflash

16bits
16bits

107 86-010-85584809
www.longxinzhijian.cn

Page 38 of 95

Soc3210 Linux

3bin pmon
#cd ./zloader.soc
#make cfg all tgt=rom
pmon_3210/zloader/gzrom.bin6.3.3
flash
4elf pmon
#cd pmon_3210/zloader.soc
#make cfg all tgt=ram
pmon_3210/zloader/gzram.bin

6.3.3 flash

6.5.2Pmon
Pmon
1. h:
;
:PMON>h

-----------------

PMON>h ping

-----------------ping

2d1:
(byte);
:PMON>d1 0x80300000

------0x80300000

3d2:
(halt word);
:PMON>d2 0x80300000

------0x80300000

107 86-010-85584809
www.longxinzhijian.cn

Page 39 of 95

Soc3210 Linux

4.d4:
(word);
:PMON>d4 0x80300000

------0x80300000

5m1:
(byte );
:PMON>m1 0x80300000 0x12

-----0x80300000 0x12

6m2:
(halt word );
:PMON>m2 0x80300000 0x1234

-----0x80300000 0x1234

7m4:
(word );
:PMON>m4 0x80300000 0x12345678

-----0x80300000 0x12345678

,PMON>d4 0x80300000;0x12345678
8set:

set .,norflash ,
pmon .:
#set()
#set ifconfig dmfe0:192.168.3.88(ip )
#set ethaddr 11:22:33:44:55:66(mac )
#set al /dev/mtd0(load ,load nandflash
mtd0 .)
#set append console=ttyS0()
#set delay 3(load .3s ,pmon load linux.
PMON>.
#set loopdev /dev/sdcard(sdcard )
#set memsize 64(64M64M)
#set cpuclock 200000000 (cpu 200 M)
#set busclock 100000000 (100M)
9ymodem:

107 86-010-85584809
www.longxinzhijian.cn

Page 40 of 95

Soc3210 Linux

ymodem ;
PMON>ymodem base=0x81800000 ----0x81800000 .
10ifaddr:
ip (,);
PMON>ifaddr dmfe0 192.168.3.25 -----ip 25.
11load :
linux ;
PMON>load tftp://192.168.3.18/vmlinux -----ip 18 vmlinx
.
12mt:
;
PMON>mt ------
13env
;
PMON>env -------
14devcp
Pmon vmlinux nandflash
PMON>devcp tftp://192.168.3.18/vmlinux /dev/mtd0 ---vmlinux
nandflash .
15gunzip
norflash ;
PMON>gunzip 0xbc080000 0x80300000 ---norflash 0xbc080000
0x80300000 .
bfc00000 norflash .
16ac97_read
ac97,ac97_read ac97 .
PMON>ac97_read ---5s .
17ac97_test
ac97,ac97_read

107 86-010-85584809
www.longxinzhijian.cn

Page 41 of 95

Soc3210 Linux

PMON>ac97_test ---.
18ping
linux ping ;
PMON>ping 192.168.3.1 ---ping ______
19.reboot
pmon;
PMON>reboot ---pmon

6.5.3 pmon
Pmon JTAG Jtag
Bootloader Norflash pmonpmon
pmon
. JTAG PMON
NorFlash Pmon Nor Flash Pmon
1 JTAG
#cd /home/dev/develop/ejtag-2.6.23-42.fc8
#ejtag-build.sh
#./ejtag_client
jtag :
Jtag>jtag>
2 jtag ipLipL Jtag :i Jtag p
cpu L jtag Flash

Jtag>jtag>ipL
3. cutecom xmodem SOCjtagwflash-8bit.bin SOC-jtag-wflash-16bit.bin
SOC-jtag-wflash-8bit.bin 8 norflash
SOC-jtag-wflash-16bit.bin 16 norflash
16 norflashSOC-jtag-wflash-16bit.bin
cutecom:

107 86-010-85584809
www.longxinzhijian.cn

Page 42 of 95

Soc3210 Linux

#cutecom
Cutecom

4cutecom /dev/ttyS0
115200,xmodem Open device
5Send file16 flash SOC-jtag-wflash-16bit.bin

6Open

107 86-010-85584809
www.longxinzhijian.cn

Page 43 of 95

Soc3210 Linux

7cutecom

8 5 6 Pmon pmon
Software/Bootloader/gzrom.bin,5 pmon

107 86-010-85584809
www.longxinzhijian.cn

Page 44 of 95

Soc3210 Linux

.PMON
1. minicom minicomminicom
minicom
#minicom
2. pmon
PMON>
3. ymodem Pmon
PMON>ymodem base=0x81800000
ymodem PmonPmon
0x80800000
4ymodem pmon Ctrl+A SCtrl A
S

107 86-010-85584809
www.longxinzhijian.cn

Page 45 of 95

Soc3210 Linux

5pmon 12

107 86-010-85584809
www.longxinzhijian.cn

Page 46 of 95

Soc3210 Linux

5. :
PMON>load -r -f bfc00000 /dev/ram/ymodem

107 86-010-85584809
www.longxinzhijian.cn

Page 47 of 95

Soc3210 Linux

pmon ,pmon
.pmon
Pmon tftp tftp pmon tftp
tftp linux tftp tftp server
linux (fc8)
1. tftp server
# yum install tftp tftp-server

2. :
# vim /etc/xinetd.d/tftp
3

4. .
#mkdir /tftpboot()
5.

107 86-010-85584809
www.longxinzhijian.cn

Page 48 of 95

Soc3210 Linux

6. tftpserver tftp
# service xinetd restart
tftp pmon
1. pmon tftproot
#cp /home/dev/develop/SOC3210/Software/Bootloader/Gzrom-16.bin /tftproot/
2. pmon ip IP
PMON>ifaddr dmfe0 192.168.1.3
3. pmon:
PMON>load r f bfc00000 tftp://192.168.1.10/Gzrom-16.bin
pmon.

6.5.4 soc-boot
6.5.4.1 soc-boot
1#make clean()
2soc-boot Rules ,
3soc-boot make
4: soc-boot build/bin boot_3210.bin

#cd /home/dev/develop/SOC3210/Software/Bootloader
#tar zxvf /home/dev/ SOC3210/Software/Bootloader/soc-boot.tar.gz
#cd ./boot_3210
#make clean
#vim Rules

107 86-010-85584809
www.longxinzhijian.cn

Page 49 of 95

Soc3210 Linux

#make

6.5.4.2 soc-Boot
pmon soc-Boot,JTAG .
.JTAG soc-boot
ejtag
#cd /home/dev/develop/ ejtag-2.6.23-42.fc8
jtag ./ejtag-build.sh
#./ejtag-build.sh

#./ejtag_client
flash:
1.JTAG ipL
2.cutecom xmodem soc-jtag-wflash-8bit.bin
soc-jtag-wflash-16bit.bin
soc-jtag-wflash-8bit.bin 8bit norflash
soc-jtag-wflash-16bit.bin 16bit norflash
3.xmodem soc-bootnorflash
JTAG pmon
.soc-boot

107 86-010-85584809
www.longxinzhijian.cn

Page 50 of 95

Soc3210 Linux

1.soc-boot soc-boot
#cutecom

2.nsload

3.

107 86-010-85584809
www.longxinzhijian.cn

Page 51 of 95

Soc3210 Linux

4.xModem :

5.

107 86-010-85584809
www.longxinzhijian.cn

Page 52 of 95

Soc3210 Linux

6.y

7.

107 86-010-85584809
www.longxinzhijian.cn

Page 53 of 95

Soc3210 Linux

8.reboot

nload c=ip sip k

107 86-010-85584809
www.longxinzhijian.cn

Page 54 of 95

Soc3210 Linux

nwflash bnorflash s=s=


.soc-boot
1. nload :tftp
nload c=ip sip k
2. go:
go
3. nloadvm : tftp norflash
nload c=ip sip k
4. help
help ]
5. nwflashbios bin flash
nwflash bnorflash s=s=
NET-SOC>nwflash b 0xbfc00000 s=0x80300000 s=0x2000 (
0x80300000 0x2000 norflash 0xbfc00000 )
6. fload :nand flash
fload
7. fwritenand flash
fwrite
8. pcs d[1-4],m[1-4]
pcs 1 d,m
pcs bus device fuction pci
9. reboot
reboot
10. erasenandnand flash ,
erasenand
11. d44
d4 (d4 pcs -1)
:NET-SOC>pcs -1
NET-SOC>d4 0x80300000 4

107 86-010-85584809
www.longxinzhijian.cn

Page 55 of 95

Soc3210 Linux

12. m4: 4
m4 (m4 pcs -1)
:NET-SOC>pcs -1

NET-SOC>m4 0x80300000 1

6.6
BSP 2.6 Linux Linux2.6.18Software/linux Linux

Linux2.6.18 Linux

6.6.1
1Linux
#cd /home/dev/develop/linux26_3210/
2make menuconfig
#make menuconfig

3210

107 86-010-85584809
www.longxinzhijian.cn

Page 56 of 95

Soc3210 Linux

1.

2. Nandflash:

3. LCD:

4. AC97:

5. GPIO:

6. SD

linux-2.6
#make
vmlinux

107 86-010-85584809
www.longxinzhijian.cn

Page 57 of 95

Soc3210 Linux

linux2.6 sdcard ,linux2.6 sdcard sdcard,linux2.6


sdcard ,,sdcard
sd
kernel make menuconfig

6.6.2
1nandflash
(1)
PMON>ifaddr dmfe0 192.168.x.xxx
PMON>devcp tftp://192.168.x.xxx/vmlinux /dev/mtd0 tftp
nandflash
PMON>load /dev/mtd0
PMON>g root=/dev/mtdblock1 console=ttyS0,115200 noinitrd rootfstype=cramfs init=/linuxrc
lcd (lcd 320x240 )
PMON>g root=/dev/mtdblock1 console=ttyS0,115200 noinitrd rootfstype=cramfs init=/linuxrc display=truly320

display=truly320 320x240
display=vga800 VGA 800x600
(2)
ymodem base=0x80800000
PMON> ymodem base=0x80800000 Ctrl+A SCtrl A S
ymodem

107 86-010-85584809
www.longxinzhijian.cn

Page 58 of 95

Soc3210 Linux

nandflash
PMON> load /dev/ram/ymodem
PMON> g rdinit=/sbin/init console=ttyS0,115200 display=truly320
nandflash
PMON>devcp /dev/ram/ymodem /dev/mtd0

6.7

107 86-010-85584809
www.longxinzhijian.cn

Page 59 of 95

Soc3210 Linux

/Ducoment ramdisk
1.
1 gcc-3.4.6.tgz kernel
2 mtd-snapshot-20050519.tar mtd jffs2

3 squashfs3.3.tar squashfs
4 cramfs-1.1.tar cramfs
5 busybox-1.00.tar ramdisk
2. gcc

3.
Ramdisk
ramdisk linux
<1># cd /home/dev/develop/linux26_3210/
<2># make menuconfig
<3>General Setup ===>
<4>Initramfs source file ramdisk
<5>Device Drivers ===>
<6>Block devices
>>Loopback device support
>>RAM disk support
>>Default number of RAM disks
>>Default RAM disk size kbytes
>>Default RAM disk block sizebytes
>>Initial RAM filesystem and RAM disk support
make
Cramfs:
#mkfs.cramfs ramdisk ramdisk-cramfs.img
Squashfs:

107 86-010-85584809
www.longxinzhijian.cn

Page 60 of 95

Soc3210 Linux

#mkfs.squashfs ramdisk ramdisk-squashfs.img


Yaffs:
#mkfs.yaffs ramdisk ramdisk-yaffs.img
Jffs:
#mkfs.jffs2 ramdisk ramdisk-jffs.img
4. (ramdisk)mkdir software
#mkdir software
#mount t cramfs /dev/mtdblock3 software

6.8
6.8.1 Helloworld
Step1
/SOC3210/examples demo_hello.tgz
hello.tgz
#tar zxvf hello.tgz

#include<stdio.h>
int main(void)
{
printf("He llo, worldn");
return 0;
}
Step2hello

#mipsel-linux-gcc o hello hello.c


hello
Step3

(1) (U )

107 86-010-85584809
www.longxinzhijian.cn

Page 61 of 95

Soc3210 Linux

U PC USBhello U
#mount /dev/sda1 /mnt
#cp hello /mnt
#umount /mnt
U USB HOST
#mount /dev/sda1 /mnt //U
#cp /mnt/hello /bin //hello bin
#./hello //hello
(2)
tftp

PC
tftp hello tftp tftpboot

#ping tftp IP

//

#tftp r -g tftp IP

//tftp
hello

#chmod u+x hello

//hello

#./hello

//hello

6.8.2
/SOC3210/examples/demo_math
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
int main(void)
{
double a=8.733243;
printf("sqrt(%f)=%fn", a, sqrt(a));

107 86-010-85584809
www.longxinzhijian.cn

Page 62 of 95

Soc3210 Linux

return 0;
}

#mipsel-linux-gcc o mtest mathtest.c lm


mathtest -lm

6.9
6.9.1 Linux
Linux

open()

read()write()ioctl()

Linux /
()/

(c/b)

6.9.2
Linux

107 86-010-85584809
www.longxinzhijian.cn

Page 63 of 95

Soc3210 Linux

Linux Linux
open()read()write()ioctl()close()
open()

6.9.2.1
Linux 3
(1)

(2)I/O

sleep()

(3)Linux
Linux

107 86-010-85584809
www.longxinzhijian.cn

Page 64 of 95

Soc3210 Linux

I/O
/Linux
file_operations
linux/fs.h file_operations

struct file_operations {
struct module *owner;
loff_t (*llseek) (struct file *, loff_t, int);
ssize_t (*read) (struct file *, char *, size_t, loff_t *);
ssize_t (*write) (struct file *, const char *, size_t, loff_t *);
int (*readdir) (struct file *, void *, filldir_t);
unsigned int (*poll) (struct file *, struct poll_table_struct *);
int (*ioctl) (struct inode *, struct file *, unsigned int, unsigned long);
int (*mmap) (struct file *, struct vm_area_struct *);
int (*open) (struct inode *, struct file *);
int (*flush) (struct file *);
int (*release) (struct inode *, struct file *);
int (*fsync) (struct file *, struct dentry *, int datasync);
int (*fasync) (int, struct file *, int);
int (*lock) (struct file *, int, struct file_lock *);
ssize_t (*readv) (struct file *, const struct iovec *, unsigned long, loff_t *);
ssize_t (*writev) (struct file *, const struct iovec *, unsigned long, loff_t *);
ssize_t (*sendpage) (struct file *, struct page *, int, size_t, loff_t *, int);
unsigned long (*get_unmapped_area)(struct file *, unsigned long, unsigned long, unsigned
long,
unsigned long);
};
file_operations
majorminor file_operations

107 86-010-85584809
www.longxinzhijian.cn

Page 65 of 95

Soc3210 Linux

lseek
readbuf count

inode-I_blksize
writeread
selectselect select
I/O
ioctlcmd
mmap
openI/O 0 open
/dev/device
releaseclose
file_operations
file_operations NULLfile_operations
file_operations

6.9.2.2

Linux register_chrdev register_chrdev
#include <linux/fs.h>
#include <linux/errno.h>
int register_chrdev(unsigned int major, const char *name, struct file_operations *fops);
major 0
Name Fops 0-EINVAL
-EBUSY

register_chrdev /proc/dvices
Linux /dev ls l 0
0 0

107 86-010-85584809
www.longxinzhijian.cn

Page 66 of 95

Soc3210 Linux

Linux kernel 2.0 128 Linux kernel 2.2 2.4 256 (0 255)
Linux / Linux
/
Linux cleanup_module()

int unregister_chrdev(unsigned int major, const char *name);


major nameLinux name major
-EINVALmajor -EINVAL
I/O
open

(1)

(2)

(3)
Linux

Linux /proc devices

int register_chrdev(unsigned int, const char *, struct filr_operations *)


filr_operation
/linux/include/linux/fs.h
(4)
IRQ
in request_irq(unsigned int irq,
void (*handler)(int, void *, struct pt_regs *),
unsigned long flags,

107 86-010-85584809
www.longxinzhijian.cn

Page 67 of 95

Soc3210 Linux

const char *device,


void *dev_id);
(5)
I/ODMA

int __init chr_driver_init(void);


__initchr_driver_init

int init_module(void)
insmod init_module

6.9.3
/SOC3210/Software/linux/linux26_3210/drivers/char/74HC165 _button.c
1

107 86-010-85584809
www.longxinzhijian.cn

Page 68 of 95

Soc3210 Linux

74HC165 GPIOGPIO 8
74HC165
74HC165 8

(2)
#include<linux/module.h>
#include<linux/config.h>
#include<linux/init.h>
#include<linux/fs.h>
#include<linux/timer.h>
#include<linux/ioctl.h>
#include<linux/io.h>
#include<linux/types.h>
#include<linux/kernel.h>
#include<linux/ioport.h>
#include<linux/errno.h>
#include<asm/uaccess.h>
#include "74HC165_button.h"
#define BUF_MAXSIZE 16
#define TIMER_DELAY 5
static unsigned char BReadBuf = 0;
static int head;
static int tail;
static int delay(int time)
{
while(--time);
return 0;
}

107 86-010-85584809
www.longxinzhijian.cn

Page 69 of 95

Soc3210 Linux

static void button_read(void){


int time;
int val = 0,reg;
//printk("button_readn");
/* CLK =0 */
SOC3210_74HC165_READ(reg, SOC3210_74HC165_CLK);
SOC3210_74HC165_WRITE(SOC3210_74HC165_CLK, reg & (~(1 << 0)));
/* PL = 0 */
SOC3210_74HC165_READ(reg, SOC3210_74HC165_PL);
SOC3210_74HC165_WRITE(SOC3210_74HC165_PL, reg & ~(1 << 2));
/* delay 100 */
delay(10000);
/* PL = 1 */
SOC3210_74HC165_READ(reg, SOC3210_74HC165_PL);
SOC3210_74HC165_WRITE(SOC3210_74HC165_PL, reg | (1 << 2));
/* scanf keyboard */
for(time = 0; time < 8; time ++){
/* CLK = 1 */
SOC3210_74HC165_READ(reg, SOC3210_74HC165_CLK);
SOC3210_74HC165_WRITE(SOC3210_74HC165_CLK, reg | (1 << 0));
SOC3210_74HC165_READ(reg, SOC3210_74HC165_DATA);
val = ((~reg) & (1 << 1));
if(val){
msleep(30);
val = ((~reg) & (1 << 1));
}
val = val >> 1;
BReadBuf |= val << time;
/* delay 10ms */

107 86-010-85584809
www.longxinzhijian.cn

Page 70 of 95

Soc3210 Linux

//delay(1000);
msleep(50);
/* CLK = 0 */
SOC3210_74HC165_READ(reg, SOC3210_74HC165_CLK);
SOC3210_74HC165_WRITE(SOC3210_74HC165_CLK, reg & (~(1 << 0)));
}
}
static int SOC3210_74HC165_button_open(struct inode *inode, struct file *filp){
int reg;
head = tail = 0;
printk("Welcome to use 74HC165 drivern");
outb(0x3f,SOC3210_LPB_MISC_BASE + REG_LPB_MISC_CTL);
outb(0x05,SOC3210_LPB_MISC_BASE + REG_LPB_GPIO_OE);
printk("init 74HC165 is donen");
return 0;
}
static ssize_t SOC3210_74HC165_button_read(struct file *filp, char __user *buf, size _t count,
loff_t *oppos){
button_read();
if(BReadBuf){
copy_to_user(buf,&BReadBuf,count);
BReadBuf = 0;
}
return count;
}
static int SOC3210_74HC165_button_ioctl(struct inode *inode, struct file *filp, unsigned int
cmd,
unsigned long arg){
return 0;

107 86-010-85584809
www.longxinzhijian.cn

Page 71 of 95

Soc3210 Linux

}
static struct file_operations SOC3210_button_fops = {
.open = SOC3210_74HC165_button_open,
.read = SOC3210_74HC165_button_read,
.ioctl = SOC3210_74HC165_button_ioctl,
};
static int __init SOC3210_74HC165_button_init(void){
int ret;
ret = register_chrdev(0,"SOC3210_button",&SOC3210_button_fops);
if(ret < 0){
printk("74HC165_button can't get major number !n");
return ret;
}
#ifdef CONFIG_DEVFS_FS
devfs_button_dir = devfs_mk_dir(NULL,"SOC3210_button",NULL);
devfs_buttonraw
devfs_register(devfs_kbd_dir,"0raw",DEVFS_FL_DEFAULT,kbdMajor,KBDRAW_MINOR,S_IFCHR|S_IR
USR|S_IWUSR,&SOC3210_button_fops,NULL);
#endif
return 0;
}
static void __exit SOC3210_74HC165_button_exit(void){
}
module_init(SOC3210_74HC165_button_init);
module_exit(SOC3210_74HC165_button_exit);
(3)

linux
#cd /home/dev/develop/ linux26_3210

107 86-010-85584809
www.longxinzhijian.cn

Page 72 of 95

Soc3210 Linux

driver/char/Makefile
#vi driver/char/Makefile
Makefile obj-y$(CONFIG_SOC3210_BUTTON) +=74HC165_buttons.o
driver/char/Kconfig
#vi driver/char/Kconfig
Kconfig
config SOC3210_GPIO
tristate "SOC3210 gpio support"
help
the driver of 3210 gpio. Enable it if you want to use it.

#cd /home/dev/develop/linux26_3210

#make menuconfigDevice driver ===>

Character deivces===>SOC3210 gpio support

107 86-010-85584809
www.longxinzhijian.cn

Page 73 of 95

Soc3210 Linux

make
(4)
/drivers/char/button_test.c74HC165

#cd /home/dev/develop /linux26_3210/drivers/char/


#mipsel-linux-gcc o button_test 74HC165_test.c
button_testlinux
tftp button_test linux /temp
#mknod /dev/SOC3210_74HC165_button c 253 0
#./button_test

6.10 linux
:/sound/soc_ac97.c
SD :/drivers/block/socsd.c
CAN :/drivers/char/soc3210canbus.c

107 86-010-85584809
www.longxinzhijian.cn

Page 74 of 95

Soc3210 Linux

NAND FLASH :/drivers/mtd/nand/soc-nand.c


RTC /drivers/i2c/rtc-ISL1208.c
:/drivers/serial/8250.c
:/drivers/net/dmfe.c
LCD :/drivers/video/soc-lcd.c
USB HOST :/drivers/usb/host/sl811-hcd.c
LED :/driver/leds/ lml2232c.c /driver/leds/lm6063.c
/drivers/char/74HC165 _button.c
: /drivers/i2c/TSC2003.c
/drivers/char/watchdog/wdt3210.c

107 86-010-85584809
www.longxinzhijian.cn

Page 75 of 95

Soc3210 Linux

7.1
date 2006-8-22 11:40
#date -s 082211402006
hwclock
#hwclock w

7.2
Windows
Autobat /etc/init.d/rcS(
)
#! /bin/sh
PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin:
runlevel=S

prevlevel=N
umask 022
export PATH runlevel prevlevel
# Trap CTRL-C &c only in this shell so we can interrupt subprocesses.
#trap ":" INT QUIT TSTP
#SCSI modules
#Input modulesUSB
/sbin/insmod /lib/input.o
/sbin/insmod /lib/keybdev.o
/sbin/insmod /lib/mousedev.o
/sbin/insmod /lib/evdev.o
#Charactor modules
ln -s /dev/fb/0 /dev/fb0

#FrameBuffer

ln -s /dev/vc/0 /dev/tty1
ln -s /dev/sound/dsp /dev/dsp

107 86-010-85584809
www.longxinzhijian.cn

Page 76 of 95

Soc3210 Linux

ln -s /dev/sound/mixer /dev/mixer

ln -s /dev/scsi/host1/bus0/target0/lun0/part1 /dev/sda1

/bin/mount -t proc none /proc


/bin/mount -t tmpfs none /tmp
/bin/mount -t tmpfs none /var
#
/bin/mkdir -p /var/lib
/bin/mkdir -p /var/run
/bin/mkdir -p /var/log
#Usb devices
/sbin/insmod /lib/hid-core.o
/sbin/insmod /lib/usbmouse.o
/sbin/insmod /lib/usbkbd.o
#SD/MMC
/sbin/insmod /lib/mmcsd_core.o
/sbin/insmod /lib/mmcsd_slot.o
/sbin/insmod /lib/mmcsd_disk.o
#
/etc/rc.d/init.d/netd start

#telnet/ftp

/etc/rc.d/init.d/httpd start
/etc/rc.d/init.d/leds start

#web server
#led

/sbin/ifconfig lo 127.0.0.1
/sbin/ifconfig eth0 192.168.0.230

#ip
#ip

/bin/hostname -F /etc/sysconfig/HOSTNAME

7.3 ftp/telnet
adduser
#adduser dbm
/home

107 86-010-85584809
www.longxinzhijian.cn

Page 77 of 95

Soc3210 Linux

passwd
telnet/ftp

7.4
/etc/host.conf
order hosts,bin
/etc/resolv.conf
nameserver 202.96.128.86
ping www.163.com

7.5 NFS
nfs linux
(mount)
NFS

TFTPNFS

7.6 webserver
/SOC3210/Software/webserver webserver
webserver readme.txt
Webserver
|__org.c
|__www

#cgi

#cgi 2 html

|__cgi-bin
|__images
|__config
|__sip
|__usr

#cgi
#

#
#

# writedhcpc dhcp ip,dns

cgi c

107 86-010-85584809
www.longxinzhijian.cn

Page 78 of 95

Soc3210 Linux

7.7 ipid
ipid pmongzrom-kbd.bin,vmlinux-wifi
rdfm.imgsf.img /soc3210/Software/ application /ipid/

JATG ipid pmon.


x86
#cd /home/dev/develop/ejtag-2.6.23-42.fc8/
#./ejtag-build.sh
#./ejtag_client
>jtag>ipL

cutecom
#cutecom
pmon ipid pmonjtag

107 86-010-85584809
www.longxinzhijian.cn

Page 79 of 95

Soc3210 Linux

jtag pmon

open

107 86-010-85584809
www.longxinzhijian.cn

Page 80 of 95

Soc3210 Linux

ipid pmon .tftp


tftpboot pmon
PMON>ifaddr dmfe0 192.168.x.xxx #ip tftp ip
PMON >devcp tftp://192.168.x.xxx/vmlinux-wifi /dev/mtd0

PMON> devcp tftp://192.168.x.xxx/ rdfm.img /dev/mtd1


PMON> devcp tftp://192.168.x.xxx/ sf.img /dev/mtd2

7.8 qtopia
/SOC3210/Software/application/GUI/qtopia_bin/
qtopia tftp
1. pmon(lcd 320x240 )
Pmon > set al /dev/mtd0

Pmon > set append g console=ttyS0,115200 root=/dev/mtdblock1 noinitrd rootfstype=cramfs


init=/linuxrc display=truly320
2. tftp qtopia_bin vmlinux-qtopia /dev/mtd0
Pmon > devcp tftp://192.168.x.xxx/vmlinux-qtopia /dev/mtd0
3. tftp qtopia_bin ramdisk.img /dev/mtd1
Pmon > devcp tftp://192.168.x.xxx/ramdisk.img /dev/mtd1
192.168.x.xxx IP

107 86-010-85584809
www.longxinzhijian.cn

Page 81 of 95

Soc3210 Linux

Qt

QT3 QT2 /SOC3210/Other/GUI/


QT3:

qt-embedded-free-3.3.7.tar.gz
qt-x11-free-3.3.7.tar.gz
install.sh

QT2 tmake-1.11.tar.gz
qt-x11-2.3.2.tar.gz
qt-embedded-2.3.7.tar.gz
e2fsprogs-1.38.tar.gz
qtopia-free-1.7.0.tar.gz

8.1 QTE3
QT3 install
/Tools/Tooolchain/x86 Cross.tar.gz /SOC3210/
Software/application/GUI/QT3/
#cd /home/dev/develop
#mkdir QT3
#cp /home/dev/SOC3210/Software/ application /GUI/QT3/* ./QT3/
#tar zxvf /home/dev/SOC3210/Tools/Toolchain/x86/Cross.tar.gz C /home/dev/develop
#export PATH=/home/dev/develop/Cross/target/local/bin:$PATH
#cd ./QT3
#chmod 777 install.sh
#./install.sh

8.2 QTE2
QT2 QT3 /Tools/Tooolchain/x86
Cross.tar.gz

#cd /home/dev/develop

107 86-010-85584809
www.longxinzhijian.cn

Page 82 of 95

Soc3210 Linux

#tar zxvf /home/dev/SOC3210/Tools/Toolchain/x86/Cross.tar.gz C /home/dev/develop


#export PATH=/home/dev/develop/Cross/target/local/bin:$PATH

#cd /home/dev/develop
#mkdir QT2
#cp /home/dev/SOC3210/ Software/application /GUI/QT2/* ./QT2/
#cd ./QT2
#tar zxvf qt-x11-2.3.2.tar.gz
#tar jxvf qt-embedded-2.3.7.tar.bz
#tar zxvf e2fsprogs-1.38.tar.gz
#tar zxvf qtopia-free-1.7.0.tar.gz
1. tmake
#cd /home/dev/develop/QT2
# tar zxvf tmake-1.11.tar.gz
2. qt-x11-2.3.2
bin uic/home/dev/develop /QT2/
#cd /home/dev/develop/QT2/
# export TMAKEDIR=$PWD/tmake-1.11
# export TMAKEPATH=$PWD/lib/qws/linux-x86-g++
# export QTDIR=$PWD/qt-2.3.2
# export LD_LIBR ARY_PATH=$QTDIR/lib:$LD_LIBR ARY_PATH
# export PATH=$TMAKEDIR/bin:$QTDIR/bin:$PATH
/home/dev/develop/QT2/qt-2.3.2/include/qvaluestack.h 57 this ->
remove(this -> fromLast()),
# cd /home/dev/develop/QT2/qt-2.3.2
# ./configure thread system-jpeg no-opengl no-xft platform linux-g++
yes:

107 86-010-85584809
www.longxinzhijian.cn

Page 83 of 95

Soc3210 Linux

# make

3. qt-embedded-2.3.7
/home/dev/develop/QT2/
/qtopia-free-1.7.0/src/qt/qconfig-qpe.h

107 86-010-85584809
www.longxinzhijian.cn

Page 84 of 95

Soc3210 Linux

#define QT_QWS_IPAQ
#cd /home/dev/develop/QT2/
# cp ./qt-2.3.2/bin/uic ./qt-2.3.7/bin
# cp ./qtopia-free-1.7.0/src/qt/qconfig-qpe.h ./qt-2.3.7/src/tools
# export QTDIR=$PWD/qt-2.3.7
# export QPEDIR=$PWD/qtopia-free-1.7.0
# export TMAKEDIR=$PWD/tmake-1.11
# export TMAKEPATH=$TMAKEDIR/lib/qws/linux-mips-g++
# export PATH=$QTDIR/bin:$QPEDIR/bin:$TMAKEDIR/bin:$PATH
# export LD_LIBR ARY_PATH=$QTDIR/lib:$QPEDIR/lib:$LD_LIBR ARY_PATH

# cd /home/dev/develop/QT2/qt-2.3.7
# ./configure xplatform linux-mips-g++ -qconfig qpe depths 8,16,24,32

Makefile
# make

107 86-010-85584809
www.longxinzhijian.cn

Page 85 of 95

Soc3210 Linux

configure
-release ........... Compile and link Qt with debugging turned off.
-debug ............. Compile and link Qt with debugging turned on.
-shared ............ Create and use a shared Qt library (libqt.so)
-static ............ Create and use a static Qt library (libqt.a)
-no-gif ............ Do not compile in GIF reading support.
-gif ............... Compile in GIF reading support. See src/kernel/qgif.h
-no-sm ............. Do not support X Session Management.
-sm ................ Support X Session Management, links in -lSM -lICE.
-no-thread ......... Do not compile with Threading Support
-thread ............ Compile with Threading Support
-qt-zlib ........... Use the zlib bundled with Qt. system
-zlib ....... Use a zlib from the operating system
-qt-libpng ......... Use the libpng bundled with Qt.
-system-libpng ..... Use a libpng from the operating system. See
-no-mng ............ Do not compile in MNG I/O support.
-system-libmng ..... Use libmng from the operating system.See
-no-jpeg ........... Do not compile in JPEG I/O support.
-system-jpeg ....... Use jpeglib from the operating system.See
-no-nas-sound ...... Do not compile in NAS sound support.
-system-nas-sound .. Use NAS libaudio from the operating system.see
-no-g++-exceptions . Disable exceptions on platforms using the GNU

107 86-010-85584809
www.longxinzhijian.cn

Page 86 of 95

Soc3210 Linux

-no-xft ............ Disable support forAnti-Aliased fonts through the


-xft ............... Enable support forAnti-Aliased fonts.
-platform target ... The platform you are building on (linux-g++)
-xplatform target .. The platform when cross-compiling.
-Rstring ........... Add an explicit dynamic library runtime search path.
-lstring ........... Add an explicit library.
-qconfig local ..... Use src/tools/qconfig-local.h rather than the default
-depths list ....... Comma-separated list of supported bit-per-pixel depths,
-accel-voodoo3 ..... Enable Voodoo3 acceleration.
-accel-mach64 ...... Enable Mach64 acceleration.
-accel-matrox ...... Enable Matrox MGA acceleration.
-qvfb .............. Enable X11-based Qt Virtual Frame Buffer.
-vnc ............... Enable VNC server (requires network module).
4.e2fsprogs-1.38
uuid
# cd ../e2fsprog-1.38
# ./configure
# make
# make check
# cp rf ./lib/uuid ../qtopia-free-1.7.0/include
# cp ./lib/uuid/libuuid.a ../qtopia-free-1.7.0/lib
# cd ..
5. qtopia-free-1.7.0
# cd /home/dev/develop/QT2/qtopia-free-1.7.0/src

# ./configure xplatform linux-mips-g++

107 86-010-85584809
www.longxinzhijian.cn

Page 87 of 95

Soc3210 Linux

# make
qtopia-free-1.7.0
1
# make menuconfig
Device Drivers
I2C support -
<*> TSC2003 support
2
3pointercal etc
/ Software/application /GUI/QT2/ramdisk.tar.gz

qtopia-free-1.7.0 bin lib


qtopia qtopia-free-1.7.0 example src qtopia
/ Software/application /GUI/QT2/ramdisk.tar.gz lib
export LD_LIBR ARY_PATH=/qtopia/lib:$LD_LIBR
ARY_PATH /usr/local/qt-embedded/lib/ qt-embedded fonts
/usr/local/qtembedded/lib//qtopia/lib qpe
/qtopia-free-1.7.0/etc/zone info /usr/share
/home/dev/SOC3210/Software/application/GUI/pointercal etc
cramfs /tmp
/tmp :
# mkfs.ext2 -m 0 /dev/mtdblock3
#mount /dev/mtdblock3 /tmp

107 86-010-85584809
www.longxinzhijian.cn

Page 88 of 95

Soc3210 Linux

example Driver_test makefile


Driver_test makefile
/Driver_test/bin
#cd /home/dev/SOC3210/exmaple
#tar zxvf Driver_test.tgz
#cd /Driver_test
#make
#cd /bin
Driver_test
Linux

9.1
RS-232
10
5 67 8 ASCII
1
1
1 1.5 2 exmaple/Driver_test/serial/serial.c

typedef struct{
char prompt;

#prompt after reciving data

int baudrate;

#baudrate

char databit;

#data bits, 5, 6, 7, 8

char debug;

#debug mode, 0: none, 1: debug

char echo;

#echo mode, 0: none, 1: echo

char fctl;

#flow control, 0: none, 1: hardware, 2: software

char tty;

#tty: 0, 1, 2, 3, 4, 5, 6, 7

107 86-010-85584809
www.longxinzhijian.cn

Page 89 of 95

Soc3210 Linux

char parity;

#parity 0: none, 1: odd, 2: even

char stopbit;

#stop bits, 1, 2

const int reserved;

#reserved, must be zero

}
{ '0',115200,8'0','0', '0', '1','0','1',0}

#cd /Driver_test/test/bin
#./serial 0 [helloworld]
[] minicom
:

0 10

9.2
Linux socket Socket i/o
socket {}
{}
socket exmaple/Driver_test/socket

1.
2. ip
#ifconfig eth0 192.168.3.60

//ip

#cd /Driver_test/test/bin
#./server

107 86-010-85584809
www.longxinzhijian.cn

Page 90 of 95

Soc3210 Linux

3. ,

9.3 u
Universal Serial BusUSB ,
USB PCI PC USB

USB (frame),1ms
,USB host
,USB exmaple/Driver_test/usbtest

1. u /mnt

2. U

#cd /Driver_test/test/bin
#./usbtest

107 86-010-85584809
www.longxinzhijian.cn

Page 91 of 95

Soc3210 Linux

u .c hello world!usb

9.4 SD
SD Secure Digital Memory CardSD
MMC SD MMC MMC SD
SD MMC SD
exmaple/Driver_test/sdtest
1. sd /mnt

# mount t ext2 /dev/socsd /mnt


2.

# cd /Driver_test/test/bin
#./sdtest
u /mnt sd_linux.txt hello linux!
sd_linux

9.5
PS/2 PS/2 Clock
DATA Clock
PS/2

107 86-010-85584809
www.longxinzhijian.cn

Page 92 of 95

Soc3210 Linux

X X
Y Y 01Mouse status
byteXS YS X Y
exmaple/Driver_test/usbtest
1.
#./mouse

2. 4

107 86-010-85584809
www.longxinzhijian.cn

Page 93 of 95

Soc3210 Linux

9.6
cm m0~15

,;
exmaple/Driver_test/ir-remote/stud

1.
#cd /Driver_test/test/bin
#./study

2.

107 86-010-85584809
www.longxinzhijian.cn

Page 94 of 95

Soc3210 Linux

3. :study_file study_num

107 86-010-85584809
www.longxinzhijian.cn

Page 95 of 95

You might also like