[琪琪雜貨舖]

2016年2月14日 星期日

【CHICHI ETUTOR@ARM/MIPS/PPC】install web camera in ARM PLATFORM S5pv210 _ ubuntu 13 _ video streaming





//sudo apt-get install guvcview 




//webcam video streaming

~> sudo apt-get install motion
Then create a config file:

~> mkdir ~/.motion
~> nano ~/.motion/motion.conf
In it, the bare minimum to run a web server and view it on other computers:

webcam_port 8081
webcam_localhost off
Then run motion:

~> motion

Now you can view the webcam at http://hostname:8081 If it doesn't work, try rebooting between steps or something.

【CHICHI ETUTOR@ARM/MIPS/PPC】install VLC on ARM platform (s5pv210) and play video  ubuntu



//apt-get install vlc browser-plugin-vlc  , cant not show video, only show first frame
//solved , only need to adjust the  preference   , 
tools > preferences > audio > ALSA audio output
tools > preferences > videos > output > X11 video output XCB
tooles > preferences> input&codecs > use gpu accerleareted decoding

//turn the audio off will make the movie smoothy



【CHICHI ETUTOR@ARM/MIPS/PPC】FILE SYSTEM _ guide to deploy ubuntu / Kbuntu on to ARM platform (S5pv210)





Here I wont give the real "steps" of how to install ubuntu onto ARM platform, instead, I will show the process of "how I tried to install ubuntu onto ARM platform which is "tiger board" that I always used"

before you starting doing anything below, make sure you that your system is bootable from uboot to any kind filesystem (even the simplest one)

and what we did here is download the ububtu filesystem from official,  qemu it, install anything we need, and NFS this file system ,and copy the file system to the flash/usb/SD card .


1. download "armhf raring ubuntu filessytem" in my laptop :
//Take a while for 20~30 minutes to download it.
//after download and qemu this filesystem , you will enter this ubuntu filesystem

sudo qemu-debootstrap --arch armhf raring ubuntu_arm_raring_armhf http://old-releases.ubuntu.com/ubuntu

//now I "qemu" the arm platform and enter the filesystem in my X86 laptop , and configure it for further usage in ARM platform , the first one is setting the right repository address

root@ubuntu:/# echo "deb [arch=armhf] http://old-releases.ubuntu.com/ubuntu raring main restricted universe" > /etc/apt/sources.list

apt-get update

//download the wireless tools you will need it to install anything when the filesystem is trasfered to ARM platform.

apt-get install wireless-tools



3. 
//add the filesystem a new user "lawrence" and password

sudo chroot ubuntu_arm_raring_armhf useradd -m lawrence
sudo chroot ubuntu_arm_raring_armhf passwd lawrence

//change the name "ubuntu_arm_raring_armhf" and "root_mkfs", easier to operate.
mv  ubuntu_arm_raring_armhf  root_mkfs

4. need to be root and change the passwd
lawrence@node1:~$ sudo chroot root_mkfs su
root@node1:/# passwd




5. ifconfig wlan0 up
5-2 iwconfig wlan0 essid 'lawrence4'
5-3 dhcpcd wlan0
5-4 ping -I wlan0 168.95.1.1  //try to connect outside
--------destination host unreachable
5-4-1 change the gateway 

route // show the route
route del default gw 192.168.0.0 eth0  //del the original gateway in eth0
route add default gw 192.168.1.1 wlan0 //change to wireless AP gw htc 192.168.1.1

5-4-2 try again ok
ping 168.95.1.1  

//do these still  in my laptop with qemu 

apt-get install --no-install-recommemds ubuntu-desktop //would take 2-3hours

//do these still  in my laptop with qemu 

apt-get install gnome-session-fallback   //ok the ubuntu screen is shown.


//NFS boot setting in "uboot" , set nfs_boot  set bootargs noinitrd root=/dev/nfs nfsroot=192.168.10.59:/home/lawrence/Downloads/LARRY_S5PV210/day6_20130920/root_mkfs,proto=tcp,nfsvers=3 ip=192.168.10.20::192.168.10.1:255.255.255.0:hello.com.tw:eth0:off console=ttySAC0 mem=512M


// add ," getty -L -n console 115200 vt100"  , to send message to UART1   , to /etc/rc.local to automatically enter UART login

>>>>>>>>>>then you should see the message like this >>>>>>>>
OK

U-Boot 1.3.4 (Mar 29 2012 - 16:23:09) for SMDKV210


CPU:  S5PV210@1000MHz(OK)
        APLL = 1000MHz, HclkMsys = 200MHz, PclkMsys = 100MHz
        MPLL = 667MHz, EPLL = 80MHz
                       HclkDsys = 166MHz, PclkDsys = 83MHz
                       HclkPsys = 133MHz, PclkPsys = 66MHz
                       SCLKA2M  = 200MHz
Serial = CLKUART 
Board:   SMDKV210
DRAM:     1 GB
Flash:   8 MB
SD/MMC:  29476MB
NAND:    256 MB 
In:      serial
Out:     serial
Err:     serial
checking mode for fastboot ...
Hit any key to stop autoboot:  0 

NAND read: device 0 offset 0x600000, size 0x400000
Main area read (32 blocks):
 4194304 bytes read: OK
Boot with zImage

Starting kernel ...

Uncompressing Linux... done, booting the kernel.
[    0.000000] Initializing cgroup subsys cpu
[    0.000000] Linux version 2.6.35.7 (lawrence@ubuntu) (gcc version 4.4.1 (Sourcery G++ Lite 2009q3-67) ) #19 PREEMPT M5
[    0.000000] CPU: ARMv7 Processor [412fc082] revision 2 (ARMv7), cr=10c53c7f
[    0.000000] CPU: VIPT nonaliasing data cache, VIPT nonaliasing instruction cache
[    0.000000] Machine: SMDKV210
[    0.000000] Ignoring unrecognised tag 0x41001099
[    0.000000] Memory policy: ECC disabled, Data cache writeback
[    0.000000] Truncating RAM at 40000000-5fffffff to -53ffffff (vmalloc region overlap).
[    0.000000] CPU S5PV210/S5PC110 (id 0x43110220)
[    0.000000] S3C24XX Clocks, Copyright 2004 Simtec Electronics
[    0.000000] S5PV210: PLL settings, A=1000000000, M=667000000, E=80000000 V=54000000
[    0.000000] S5PV210: ARMCLK=1000000000, HCLKM=200000000, HCLKD=166750000
[    0.000000] HCLKP=133400000, PCLKM=100000000, PCLKD=83375000, PCLKP=66700000
[    0.000000] sclk_dmc: source is sclk_a2m (0), rate is 200000000
[    0.000000] sclk_onenand: sourc   0.000000] sclk: source is mout_mpll (6), rate is 66700000
[    0.000000] sclk: source is mout_mpll (6), rate is 66700000
[    0.000000] sclk: source is mout_mpll (6), rate is 66700000
[    0.000000] sclk: source is mout_mpll (6), rate is 66700000
[    0.000000] sclk_mixer: source is sclk_dac (0), rate is 54000000
[    0.000000] sclk_spdif: source is sclk_audio (0), rate is 24000000
[    0.000000] sclk_fic: source is ext_xtal (0), rate is 24000000
[    0.000000] sclk_fimc: source is ext_xtal (0), rate is 24000000
[    0.000000] sclk_cam0: source is ext_xtal (0), rate is 24000000
[    0.000000] sclk_cam1: source is ext_xtal (0), rate is 24000000
[    0.0xtal (0), rate is 24000000
[    0.000000] sclk_mmc: source is mout_mpll (6), rate is 47642857
[    0.000000] sclk_mmc: source is mout_epll (7), rate is 80000000
[    0.000000] sclk_mmc: source is mout_mpll (6), rate is 47642857
[    0.000000] sclk_mmc: source is mout_epl    0.000000] sclk_mfc: source is sclk_a2m (0), rate is 200000000
[    0.000000] sclk_g2d: source is sclk_a2m (0), rate is 200000000
[    0.000000] sclk: source is sclk_a2m (0), rate is 200000000
[    0.000000] sclk_csis: source is ext_xtal (0), rate is 24000000
[    0.000000] sclk_spi: source is ext_xtal (0), rate is 24000000
[    0.000000] sclk_spi: sour 0.000000] sclk_pwi: source is ext_xtal (0), rate is 24000000
[    0.000000] sclk_pwm: source is ext_xtal (0), rate is 24000000
[    0.000000] sclk_mdnie: source is ext_xtal (0), rate is 24000000
[    0.000000] sclk_mdnie_pwm: source is ext_xtal (0), rate is 24000000
[    0.000000] s5pv210: 37748736 bytes system memory reserved for mfc at 0x20eef000
[    0. reserved for mfc at 0x40000000
[    0.000000] s5pv210: 25165824 bytes system memory reserved for fimc0 at 0x42400000
[    0.000000] s5pv210: 10137600 bytes system memory reserved for fimc1 at 0x43c00000
[    0.000000] s5pv210: 25165824 bytes system memory reserved for fimc2 at 0x445ab000
[    0.000000] s5pv210: 8388608 bytes system memory reserved for jpeg at 0x45dab000
[    0.000000] s5pv210: 6144000 bytes system memory reserved for fimd at 0x465ab000
[    0.000000] s5pv210: 3072000 bytes system memory reserved for texstream at 0x46b87000
[    0.000000] s5pv210: 3379200 bytes system memory reserved for pmem_gpu1 at 0x46e75000
[    0.000000] s5pv210: 8388608 bytes system memory reserved for g2d at 0x471ae000
[    0.000000] Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 211328
[    0.000000] Kernel command line: noinitrd root=/dev/nfs nfsroot=192.168.10.59:/home/lawrence/Downloads/LARRY_S5PV210/e
[    0.000000] PID hash table entries: 4096 (order: 2, 16384 bytes)
[    0.000000] Dentry cache hash table entries: 131072 (order: 7, 524288 bytes)
[    0.000000] Inode-cache hash table entries: 65536 (order: 6, 262144 bytes)
[    0.000000] Memory: 512M56k/674456k available, 177512k reserved, 0K highmem
[    0.000000] Virtual kernel memory layout:
[    0.000000]     vector  : 0xffff0000 - 0xffff1000   (   4 kB)
[    0.000000]     fixmap  : 0xfff00000 - 0xfffe0000   ( 896 kB)
[    0.000000]     DMA     : 0xff000000 - 0xffe00000   (  14 MB)
[    0.000000]     vmalloc : 0xf4800000 - 0xfc000000   ( 120 MB)
[    0.000000]     modules : 0xbf000000 - 0xc0000000   (  16 MB)
[    0.000000]       .init : 0xc0008000 - 0xc002c000   ( 144 kB)
[    0.000000]       .text : 0xc002c000 - 0xc05df000   (5836 kB)
[    0.000000]       .data : 0xc05e0000 - 0xc0626120   ( 281 kB)
[    0.000000] SLUB: Genslabs=9, HWalign=64, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[    0.000000] Hierarchical RCU implementation.
[    0.000000]  RCU-based detection of stalled CPUs is disabled.
[    0.000000]  Verbose stalled-CPUs detection is disabled.
[    0.000000] NR_IRQS:393
[    0.000000] VIC @fd000000: id 0x00041192, vendor 0x41
[    0.000000] VIC @fd010000: id 0x00041192, vendor 0x41
[    0.000000] VIC @fd020000: id 0x00041192, vendor 0x41
[    0.000000] VIC @fd030000: id 0x00041192, vendor 0x41
[    0.000000] Console: colour dummy device 80x30
[    0.000000] console [ttySAC0] enabled
rating delay loop... 996.14 BogoMIPS (lpj=2490368)
[    0.145000] pid_max: default: 32768 minimum: 301
[    0.145000] Mount-cache hash table entries: 512
[    0.145000] Initializing cgroup subsys debug
[    0.145000] Initializing cgroup subsys cpuacct
[    0.145000] Initializing cgroup subsys freezer
[    0.145000] CPU: Testing write buffer coherency: ok
[    0.150000] devtmpfs: initialized
[    0.155000] regulator: core version 0.5
[    0.155000] regulator: dummy: 
[    0.160000] NET: Registered protocol family 16
[    0.170000] S3C Power Management, Copyright 2004 Simtec Electronics
[    0.170000] pmstats at 00000000
[    0.175000] smdkc110_setup_clocks: sclk_mmc: source is mout_mpll, rate is 47642857
[    0.180000] smdkc110_setup_clocks: sclk_mmc: source is mout_mpll, rate is 47642857
[    0.185000] smdkc110_setup_clocks: sclk_mmc: source is mout_mpll, rate is 47642857
[    0.190000] smdkc110_setup_clocks: sclk_mmc: source is mout_mpll, rate is 47642857
[    0.195000] S5PV210: Initializing architecture
[    0.200000] s3c24xx-pwm s3c24xx-pwm.0: tin at 66700000, tdiv at 66700000, tin=divclk, base 0
[    0.205000] s3c24xx-pwm s3c24xx-pwm.1: tin at 66700000, tdiv at 66700000, tin=divclk, base 8
[    0.210000] s3c24xx-pwm s3c24xx-pwm.2: tin at 22233333, tdiv at 22233333, tin=divclk, base 12
[    0.215000] s3c24xx-pwm s3c24xx-pwm.3: tin at 22233333, tdiv at 22233333, tin=divclk, base 16
[    0.220000] regulator: pd_audio_supply: 5000 mV normal 
[    0.230000] regulator: pd_cam_supply: 5000 mV normal 
[    0.235000] regulator: pd_tv_supply: 5000 mV normal 
[    0.240000] regulator: pd_lcd_supply: 5000 mV normal 
[    0.245000] regulator: pd_g3d_supply: 5000 mV normal 
[    0.250000] regulator: pd_mfc_supply: 5000 mV normal 
[    0.255000] bio: create slab <bio-0> at 0
[    0.255000] SCSI subsystem initialized
[    0.260000] usbcore: registered new interface driver usbfs
[    0.265000] usbcore: registered new interface driver hub
[    0.270000] usbcore: registered new device driver usb
[    0.275000] s3c-i2c s3c2440-i2c.0: i2c-0: S3C I2C adapter
[    0.280000] s3c-i2c s3c2440-i2c.1: i2c-1: S3C I2C adapter
[    0.285000] s3c-i2c s3c2440-i2c.2: i2c-2: S3C I2C adapter
[    0.290000] Advanced Linux Sound Architecture Driver Version 1.0.23.
[    0.295000] cfg80211: Calling CRDA to update world regulatory domain
[    0.305000] NET: Registered protocol family 2
[    0.305000] IP route cache hash table entries: 32768 (order: 5, 131072 bytes)
[    0.310000] TCP established hash table entries: 131072 (order: 8, 1048576 bytes)
[    0.315000] TCP bind hash table entries: 65536 (order: 8, 1310720 bytes)
[    0.320000] TCP: Hash tables configured (established 131072 bind 65536)
[    0.325000] TCP reno registered
[    0.330000] UDP hash table entries: 512 (order: 2, 24576 bytes)
[    0.335000] UDP-Lite hash table entries: 512 (order: 2, 24576 bytes)
[    0.340000] NET: Registered protocol family 1
[    0.345000] RPC: Registered udp transport module.
[    0.350000] RPC: Registered tcp transport module.
[    0.355000] RPC: Registered tcp NFSv4.1 backchannel transport module.
[    0.365000] PMU: registered new PMU device of type 0
[    0.365000] SMDKC110/V210 RTC, (c) 201010-rtc smdkc110-rtc: rtc disabled, re-enabling
[    0.375000] smdkc110-rtc smdkc110-rtc: rtc core: registered s3c as rtc0
[    0.380000] S5PV210 ADC driver, (c) 2010 Samsung Electronics
[    0.385000] cpuidle: phy_regs_save:0x53fff000
[    0.390000] Loaded driver for PL330 DMAC-0 s3c-pl330
[    0.395000]  DBUFF-64x8bytes Num_Chans-8 Num_Peri-2 Num_Events-32
[    0.400000] Loaded driver for PL330 DMAC-1 s3c-pl330
[    0.405000]  DBUFF-8x4bytes Num_Chans-8 Num_Peri-32 Num_Events-32
[    0.410000] Loaded driver for PL330 DMAC-2 s3c-pl330
[    0.415000]  DBUFF-8x4bytes Num_Chans-8 Num_Peri-32 Num_Events-32
[    0.425000] ashmem: initialized
[    0.425000] ROMFS MTD (C) 2007 Red Hat, Inc.
[    0.425000] msgmni has been set to 1317
[    0.430000] alg: No test for stdrng (krng)
[    0.430000] io scheduler noop registered
[    0.430000] io scheduler deadline registered
[    0.435000] io scheduler cfq registered (default)
[    0.440000] s3cfb s3cfb: [fb2] dma: 0000000, size: 0x005dc000
[    0.455000] Console: switching to colour frame buffer device 100x30
[    0.460000] FIMD src sclk = 166750000
[    0.580000] s3cfb s3cfb: registered successfully
[    0.655000] PA FB = 0x465AB000, bits per pixel = 32
[    0.655000] screen width=800 height=480 va=0xe65ab000 pa=0x465ab000
[    0.655000] xres_virtual = 800, yres_virtual = 1920, xoffset = 0, yoffset = 0
[    0.655000] fb_size=6144000
[    0.655000] Back frameBuffer[0].VAddr=e6722000 PAddr=46722000 size=1536000
[    0.660000] Back frameBuffer[1].VAddr=e6899000 PAddr=46899000 size=1536000
[    0.665000] Back frameBuffer[2].VAddr=e6a10000 PAddr=46a10000 size=1536000
[    0.670000] s5pv210-uart.0: s3c2410_serial0 at MMIO 0xe2900000 (irq = 16) is a S3C6400/10
[    0.680000] s5pv210-uart.1: s3c2410_serial1 at MMIO 0xe2900400 (irq = 20) is a S3C6400/10
[    0.685000] s5pv210-uart.2: s3c2410_serial2 at MMIO 0xe2900800 (irq = 24) is a S3C6400/10
[    0.690000] s5pv210-uart.3: s3c2410_serial3 at MMIO 0xe2900c00 (irq = 28) is a S3C6400/10
[    0.700000] brd: module loaded
[    0.705000] loop: module loaded
[    0.705000] S3C NAND Driver, (c) 2008 Samsung Electronics
[    0.710000] S3C NAND Driver is using hardware ECC.
[    0.715000] NAND device: Manufacturer ID: 0xec, Chip ID: 0xda (Samsung NAND 256MiB 3,3V 8-bit)
[    0.720000] Creating 7 MTD partitions on "s5pv210-nand":
[    0.725000] 0x0000000c0000-0x000000100000 : "misc"
[    0.735000] 0x000000100000-0x000000600000 : "recovery"
[    0.740000] 0x000000600000-0x000000b00000 : "kernel"
[    0.745000] 0x000000b00000-0x000000e00000 : "ramdisk"
[    0.750000] 0x000000e00000-0x000007c00000 : "system"
[    0.770000] 0x000007c00000-0x00000cc00000 : "cache"
[    0.790000] 0x00000cc00000-0x000010000000 : "userdata"
[    0.800000] smsc911x: Driver version 2008-10-21.
[    0.800000] smsc911x: Driver version A2008-10-21.
[    0.800000] smsc911x: Driver version AA 2008-10-21.
[    0.800000] smsc911x: Driver version AAA 2008-10-21.
[    0.800000] LAN base phy in probe: 0xA8000000
[    0.800000] LAN base virt in probe: 0xF4892000
[    0.805000] smsc911x-mdio: probed
[    0.805000] eth0: attached PHY driver [Generic PHY] (mii_bus:phy_addr=0:01, irq=-1)
[    0.810000] net eth0: MAC Address: 00:09:c0:ff:ec:48
[    0.815000] usbcore: registered new interface driver rt73usb
[    0.820000] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[    0.825000] s5p-ehci s5p-ehci: s5pv210 EHCI
[    0.830000] s5p-ehci s5p-ehci: new USB bus registered, assigned bus number 1
[    0.835000] s5p-ehci s5p-ehci: irq 87, io mem 0xec200000
[    0.850000] s5p-ehci s5p-ehci: USB 0.0 started, EHCI 1.00
[    0.850000] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002
[    0.850000] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    0.855000] usb usb1: Product: s5pv210 EHCI
[    0.855000] usb usb1: Manufacturer: Linux 2.6.35.7 ehci_hcd
[    0.860000] usb usb1: SerialNumber: s5pv210
[    0.865000] hub 1-0:1.0: USB hub found
[    0.870000] hub 1-0:1.0: 1 port detected
[    0.875000] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
[    0.880000] s5p-ohci s5p-ohci: s5pv210 OHCI
[    0.885000] s5p-ohci s5p-ohci: new USB bus registered, assigned bus number 2
[    0.890000] s5p-ohci s5p-ohci: irq 87, io mem 0xec300000
[    0.950000] usb usb2: New USB device found, idVendor=1d6b, idProduct=0001
[    0.950000] usb usb2: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    0.950000] usb usb2: Product: s5pv210 OHCI
[    0.950000] usb usb2: Manufacturer: Linux 2.6.35.7 ohci_hcd
[    0.955000] usb usb2: SerialNumber: s5pv210
[    0.960000] hub 2-0:1.0: USB hub found
[    0.960000] hub 2-0:1.0: 1 port detected
[    0.965000] Initializing USB Mass Storage driver...
[    0.970000] usbcore: registered new interface driver usb-storage
[    0.975000] USB Mass Storage support registered.
[    0.980000] s3c-udc : S3C HS USB Device Controller Driver, (c) 2008-2009 Samsung Electronics
[    0.980000] s3c-udc : version 15 March 2009 (DMA Mode)
[    0.985000] android init
[    0.985000] android_probe pdata: c05ed758
[    0.990000] android_bind
[    0.995000] android_usb gadget: android_usb ready
[    1.020000] f_acm init
[    1.020000] android_register_function acm
[    1.020000] f_adb init
[    1.020000] android_register_function adb
[    1.020000] f_mass_storage init
[    1.020000] fsg_probe pdev: c05ec6d8, pdata: c05ed77c
[    1.020000] android_register_function usb_mass_storage
[    1.025000] f_mtp init
[    1.025000] android_register_function mtp
[    1.030000] f_rndis init
[    1.030000] android_register_function rndis
[    1.035000] rndis_function_bind_config MAC: 02:02:45:46:4F:48
[    1.040000] android_usb gadget: using random self ethernet address
[    1.045000] android_usb gadget: using random host ethernet address
[    1.050000] usb0: MAC ea:e4:0e:09:76:0c
[    1.055000] usb0: HOST MAC 56:cd:1b:bc:c0:f6
[    1.060000] android_usb gadget: Mass Storage Function, version: 2009/09/11
[    1.065000] android_usb gadget: Number of LUNs=1
[    1.070000]  lun0: LUN: removable file: (no medium)
[    1.075000] adb_bind_config
[    1.075000] mtp_bind_config
[    1.080000] mice: PS/2 mouse device common for all mice
[    1.085000] bma150 2-0038: bma150 found
[    1.090000] bma150 2-0038: al_version=2, ml_version=1
[    1.125000] input: bma150 as /devices/virtual/input/input0
[    1.125000] using rtc device, s3c, for alarmsS3C24XX RTC, (c) 2004,2006 Simtec Electronics
[    1.125000] i2c /dev entries driver
[    1.125000] Linux video capture interface: v2.00
[    1.125000] s3c-csis: Samsung MIPI-CSI2 driver probed successfully
[    1.130000] mfc_init: <6>S5PC110 MFC Driver, (c) 2009 Samsung Electronics
[    1.130000] 
[    1.135000] S3C JPEG Driver, (c) 2007 Samsung Electronics
[    1.140000] JPEG driver for S5PV210
[    1.145000] i2c i2c-1: attached s5p_ddc into i2c adapter successfully
[    1.150000] S5PC11X HPD Driver, (c) 2009 Samsung Electronics
[    1.155000] S5PC11X CEC Driver, (c) 2009 Samsung Electronics
[    1.160000] s3c_bat_init
[    1.160000] sec-fake-battery sec-fake-battery: s3c_bat_probe
[    1.165000] device-mapper: uevent: version 1.0.3
[    1.175000] device-mapper: ioctl: 4.17.0-ioctl (2010-03-05) initialised: dm-devel@redhat.com
[    1.180000] cpuidle: using governor ladder
[    1.185000] sdhci: Secure Digital Host Controller Interface driver
[    1.190000] sdhci: Copyright(c) Pierre Ossman
[    1.195000] s3c-sdhci s3c-sdhci.0: clock source 0: hsmmc (133400000 Hz)
[    1.200000] s3c-sdhci s3c-sdhci.0: clock source 1: hsmmc (133400000 Hz)
[    1.205000] s3c-sdhci s3c-sdhci.0: clock source 2: sclk_mmc (47642857 Hz)
[    1.210000] mmc0: SDHCI controller on samsung-hsmmc [s3c-sdhci.0] using ADMA
[    1.215000] s3c-sdhci s3c-sdhci.1: clock source 0: hsmmc (133400000 Hz)
[    1.220000] s3c-sdhci s3c-sdhci.1: clock source 1: hsmmc (133400000 Hz)
[    1.225000] s3c-sdhci s3c-sdhci.1: clock source 2: sclk_mmc (47642857 Hz)
[    1.230000] mmc1: SDHCI controller on samsung-hsmmc [s3c-sdhci.1] using ADMA
[    1.235000] s3c-sdhci s3c-sdhci.2: clock source 0: hsmmc (133400000 Hz)
[    1.240000] s3c-sdhci s3c-sdhci.2: clock source 1: hsmmc (133400000 Hz)
[    1.245000] s3c-sdhci s3c-sdhci.2: clock source 2: sclk_mmc (47642857 Hz)
[    1.250000] mmc2: SDHCI controller on samsung-hsmmc [s3c-sdhci.2] using ADMA
[    1.255000] s3c-sdhci s3c-sdhci.3: clock source 0: hsmmc (133400000 Hz)
[    1.260000] s3c-sdhci s3c-sdhci.3: clock source 1: hsmmc (133400000 Hz)
[    1.265000] s3c-sdhci s3c-sdhci.3: clock source 2: sclk_mmc (47642857 Hz)
[    1.270000] mmc3: SDHCI controller on samsung-hsmmc [s3c-sdhci.3] using ADMA
[    1.275000] usb 1-1: new high speed USB device using s5p-ehci and address 2
[    1.280000] usbcore: registered new interface driver usbhid
[    1.285000] usbhid: USB HID core driver
[    1.290000] logger: created 64K log 'log_main'
[    1.295000] logger: created 256K log 'log_events'
[    1.300000] logger: created 64K log 'log_radio'
[    1.300000] logger: created 64K log 'log_system'
[    1.310000] asoc: AC97 HiFi <-> s3c-ac97 mapping ok
[    1.310000] asoc: AC97 HiFi <-> s3c-ac97 mapping ok
[    1.365000] mmc0: new high speed SDHC card at address aaaa
[    1.365000] mmcblk0: mmc0:aaaa SL32G 28.7 GiB 
[    1.365000]  mmcblk0: p1 p2 p3
[    1.420000] usb 1-1: New USB device found, idVendor=05e3, idProduct=0608
[    1.420000] usb 1-1: New USB device strings: Mfr=0, Product=1, SerialNumber=0
[    1.420000] usb 1-1: Product: USB2.0 Hub
[    1.420000] hub 1-1:1.0: USB hub found
[    1.420000] hub 1-1:1.0: 4 ports detected
[    1.695000] usb 1-1.3: new high speed USB device using s5p-ehci and address 3
[    1.945000] usb 1-1.3: New USB device found, idVendor=148f, idProduct=2573
[    1.945000] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[    1.945000] usb 1-1.3: Product: 802.11 bg WLAN
[    1.945000] usb 1-1.3: Manufacturer: Ralink
[    2.280000] usb 1-1.4: new full speed USB device using s5p-ehci and address 4
[    2.335000] AC97: Unable to activate!
[    2.370000] usb 1-1.4: New USB device found, idVendor=046d, idProduct=c52e
[    2.370000] usb 1-1.4: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[    2.370000] usb 1-1.4: Product: USB Receiver
[    2.370000] usb 1-1.4: Manufacturer: Logitech
[    2.375000] input: Logitech USB Receiver as /devices/platform/s5p-ehci/usb1/1-1/1-1.4/1-1.4:1.0/input/input1
[    2.380000] generic-usb 0003:046D:C52E.0001: input: USB HID v1.11 Keyboard [Logitech USB Receiver] on usb-s5pv210-1.40
[    2.390000] input: Logitech USB Receiver as /devices/platform/s5p-ehci/usb1/1-1/1-1.4/1-1.4:1.1/input/input2
[    2.395000] generic-usb 0003:046D:C52E.0002: input: USB HID v1.11 Mouse [Logitech USB Receiver] on usb-s5pv210-1.4/in1
[    3.335000] AC97: Unable to read!
[    3.375000] ALSA device list:
[    3.375000]   #0: SMDK (WM9713)
[    3.375000] GACT probability NOT on
[    3.375000] Mirror/redirect action on
[    3.375000] u32 classifier
[    3.375000]     Actions configured
[    3.375000] TCP cubic registered
[    3.375000] NET: Registered protocol family 17
[    3.380000] NET: Registered protocol family 15
[    3.385000] lib80211: common routines for IEEE802.11 drivers
[    3.390000] ThumbEE CPU extension supported.
[    3.395000] VFP support v0.3: implementor 41 architecture 3 part 30 variant c rev 2
[    3.405000] regulator_init_complete: disabling pd_mfc_supply
[    3.410000] regulator_init_complete: disabling pd_tv_supply
[    3.415000] regulator_init_complete: disabling pd_cam_supply
[    3.420000] smdkc110-rtc smdkc110-rtc: rtc disabled, re-enabling
[    3.425000] smdkc110-rtc smdkc110-rtc: hctosys: invalid date/time
[    3.435000] FIMC0 registered successfully
[    3.435000] FIMC1 registered successfully
[    3.440000] FIMC2 registered successfully
[    3.445000] <6>S5PC1XX TVOUT Driver, (c) 2009 Samsung Electronics
[    3.450000] s5p-tvout s5p-tvout: hpd status is cable inserted
[    3.975000] net eth0: SMSC911x/921x identified at 0xf4892000, IRQ: 41
[    4.980000] IP-Config: Complete:
[    4.980000]      device=eth0, addr=192.168.10.20, mask=255.255.255.0, gw=192.168.10.1,
[    4.980000]      host=hello, domain=, nis-domain=com.tw,
[    4.980000]      bootserver=255.255.255.255, rootserver=192.168.10.59, rootpath=
[    4.980000] DBUG_PORT must not use AFC!
[    4.985000] Looking up port of RPC 100003/3 on 192.168.10.59
[    6.995000] Looking up port of RPC 100005/3 on 192.168.10.59
[    7.020000] VFS: Mounted root (nfs filesystem) on device 0:14.
[    7.025000] devtmpfs: mounted
[    7.025000] Freeing init memory: 144K
[   15.330000] init: ureadahead main process (60) terminated with status 5
[   16.620000] init: mounted-proc main process (67) terminated with status 1
[   35.420000] readl S5P_VP_ENABLE for VP_POWER_DOWN_RDY fail
[   35.420000] s5p_vlayer_stop::s5p_vp_stop() fail

ubuntu login: 
Password: 

Login incorrect
ubuntu login: root
Password: 2udiogul
Last login: Thu Jan  1 00:02:08 UTC 1970 on console
Welcome to Ubuntu 13.04 (GNU/Linux 2.6.35.7 armv7l)

 * Documentation:  https://help.ubuntu.com/

Your Ubuntu release is not supported anymore.
For upgrade information, please visit:
http://www.ubuntu.com/releaseendoflife

New release '13.10' available.
Run 'do-release-upgrade' to upgrade to it.

-bash: no job control in this shell
root@ubuntu:~# 
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

//and in the screen, the ubuntu welcome and login should be displayed like this




//you can copy "root_mkfs" files to the sd card partition and do boot without NFS but with SD card
,here is the uboot parameter for boot file system from SD card 
//bootargs, sd_boot=set bootargs noinitrd root=/dev/mmcblk0p1 rootfstype=ext3 mem=512M console=ttySAC0




//you can even install other version OS

apt-get install kubuntu-desktop





【CHICHI ETUTOR@ARM/MIPS/PPC】TEMPERATURE MOnitoring _ SHT20 _ HWMON



1. Introduction : Adding temperature monitoring function into boards with SHT20 humidity and temperature sensor.

2. SHT20 : Datasheet

3. SHT20 modules:  (from CYESS)



4.  SHT20 drivers :  compile it to SHT20.ko (modified the original one and could be loaded as a HWMON) 




5. Run in filesystem and  monitoring the temperature : 

//load the driver
root@ubuntu:/home/lawrence# insmod  sht20.ko 

//check if the temperature can be read
root@ubuntu:/home/lawrence# sensors
sht20-i2c-1-40
Adapter: s3c2410-i2c
temp1:         +26.10 C  


6. Graphic monitoring in ubuntu:
root@ubuntu:/home/lawrence# sudo apt-get install hardinfo   , show the temperature in ubuntu "system profiler and benchmark"






【CHICHI ETUTOR@ARM/MIPS/PPC】MINIGUI 





Introduction

MiniGUI is a GUI system with support for real-time and embedded operating systems,
and aims to be fast, stable, light-weight and cross-platform.
It was first released under the GNU GPL in 1999, and
has since offered a commercial version with more features,
including support for operating systems other than Linux and eCos.
MiniGUI has been widely used in handheld terminals, portable media players, and industry instruments.




1. download relevant files

you can download from day7

libminigui-1.6.10.tar.gz  , the minugui library

mg-samples-1.6.10.tar.gz , the demo examples

minigui-res-1.6.10.tar.gz , the resource need by minigui like images, cursor, .....


2. create folder named "minigui" and copy all compressed file to it


~/minigui# ls
libminigui-1.6.10.tar.gz  mg-samples-1.6.10.tar.gz  minigui-res-1.6.10.tar.gz


3. create folder named "miniguitmp" for future files storage

~/minigui# mkdir miniguitmp

~/minigui# ls
  libminigui-1.6.10.tar.gz  mg-samples-1.6.10.tar.gz  minigui-res-1.6.10.tar.gz  miniguitmp


4. decompress all files in folder "minigui"

~/minigui# tar zxvf libminigui-1.6.10.tar.gz

~/minigui# tar zxvf mg-samples-1.6.10.tar.gz

~/minigui# tar zxvf minigui-res-1.6.10.tar.gz

~/minigui# ls
        libminigui-1.6.10  libminigui-1.6.10.tar.gz  mg-samples-1.6.10  mg-samples-1.6.10.tar.gz  minigui-res-1.6.10  minigui-res-1.6.10.tar.gz  miniguitmp





5. ./configure ,make and make install "minigui" library


~/minigui/libminigui-1.6.10# ./configure --build=arm --host=arm-linux --target=arm-linux --prefix=/root/minigui/miniguitmp

~/minigui/libminigui-1.6.10# make -j4

~/minigui/libminigui-1.6.10# make install

*chekc the files in miniguitmp

~/minigui/miniguitmp# ls
etc  include  lib




6. install "minigui resource"

~/minigui# cd minigui-res-1.6.10

~/minigui/minigui-res-1.6.10# vim config.linux

*find the TOPDIR= and modify as below (to store the res files to miniguitmp)
=========================================
# NOTE: This directory must exist when you start the install.
# NOTE: Don't modify TOPDIR.
TOPDIR= /root/minigui/miniguitmp
=========================================

~/minigui/minigui-res-1.6.10#make install

*check if there is "usr" folder generated here

~/minigui/miniguitmp# ls
                etc  include  lib usr




7. change the /miniguitmp/etc MiniGUI.cfg and then copy to ~/root_mkfs/etc

[system]
# GAL engine and default options
gal_engine=fbcon
defaultmode=800x480-16bpp

# IAL engine
ial_engine=console
mdev=/dev/input/mice
mtype=IMPS2

[fbcon]
defaultmode=800x480-16bpp

[qvfb]
defaultmode=640x480-16bpp
display=0


~/minigui/miniguitmp/etc# cp MiniGUI.cfg ~/root_mkfs/etc



8.copy the library/header files to ~/root_mkfs/lib and toolchain
       
~/minigui/miniguitmp/lib# cp -rf * ~/root_mkfs/lib

~/minigui/miniguitmp/lib# cp -rf * /usr/local/arm/arm-2009q3/arm-none-linux-gnueabi/libc/usr/lib

~/minigui/miniguitmp/include# cp -rf * /usr/local/arm/arm-2009q3/arm-none-linux-gnueabi/libc/usr/include


9 To Generate MINIGUI demo examples

~/minigui# cd mg-samples-1.6.10


~/minigui/mg-samples-1.6.10# ./configure --build=arm --host=arm-linux --target=arm-linux --prefix=/root/minigui/miniguitmp



~/minigui/mg-samples-1.6.10/src# vim Makefile


change

CC = arm-linux-gcc

to
CC = arm-linux-gcc -I/root/minigui/miniguitmp/include -L/root/minigui/miniguitmp/lib
================================

change
CFLAGS = -O2 -Wall -Wstrict-prototypes -pipe -D_REENTRANT

to

CFLAGS = -O2
================================

change

LIBOBJS =

to
LIBOBJS = -lminigui -lmgext -lm -lpthread -ljpeg
================================

change
LIBS = -lpthread -lminigui -lm

to

LIBS = -lminigui -lmgext -lm -lpthread -ljpeg
================================

change
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
       $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)

to

COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
       $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -lminigui -lmgext -lm -lpthread -ljpeg
================================




~/minigui/mg-samples-1.6.10/src# make clean

~/minigui/mg-samples-1.6.10/src# make -j4

*then , there are demo example files like "helloworld" shown in the foldes

~/minigui/mg-samples-1.6.10/src# cp helloworld ~/root_mkfs

[Qt210 side]

*boot to console then execute "helloworld"

[root@QT210 /]# ./helloworld
[ 1682.370000] wm97xx-ts 0-0:WM9713: No IRQ specified

*then , there should be windows-like helloworld message shonw on the screen


*you might meet problem like these. plesae make sure the file "MiniGUI.cfg" is configured correctly
=======================================================
[root@QT210 /]# ./helloworld
NEWGAL: Video mode smaller than requested.
NEWGAL: Set video mode failure.
InitGUI: Can not initialize graphics engine!
========================================================
=======================================================
[root@QT210 /]# ./helloworld
QVFB IAL engine: can not open mouse pipe.
IAL: Init IAL engine failure.
InitGUI: Low level event initialization failure!
InitGUI failure when using /etc/MiniGUI.cfg as cfg file.
======================================================

【CHICHI ETUTOR@ARM/MIPS/PPC】FILE SYSTEM 6 _ create Partitions on FLASH




1. planned partition formation




2. modification of kernel code (partition.h) to let kernel recongnize the partition


drivers/mtd/nand$ vim s3c_nand.c

*edit/add the partition_info as below
=========================================================

        {
                .name           = "Bootloader",
                .offset         = 0,
                .size           = 0x00100000,
        },
        {
                .name           = "Kernel",
                .offset         = 0x00600000,
                .size           = 0x00500000,
        },
        {
                .name           = "cramfs",
                .offset         = 0x00B00000,
                .size           = 0x00300000,
        },
         {
                .name           = "DATA",
                .offset         = 0x00E00000,
                .size           = 0x04000000,
        },
        {
                .name           = "Jffs2",
                .offset         = 0x04E00000,
                .size           = 0x00f00000,
        },
        {
                .name           = "RAMDISK",
                .offset         = 0x0C640000,
                .size           = 0x00300000,
        },
        {
                .name           = "UBIFS",
                .offset         = 0x0CA00000,
                .size           = MTDPART_SIZ_FULL,
        }

============================================================


3. check the necessary option items in kernel menuconfig

Device Drivers  --->
<*> Memory Technology Device (MTD) support  ---> 
      [*]   MTD partitioning support

File systems  --->
Miscellaneous filesystems  ---> 
<*> YAFFS2 file system support
<*> Journalling Flash File System v2 (JFFS2) support
<*> Compressed ROM file system support (cramfs)



4. make , upload zImage to QT210 and check the KERNEL POST message

$make -j4
$cd ../arch/arm/boot
$sudo dnw zImage

*There should be a message during POST show you the MTD partition formation
===============================================================
[    0.735000] Creating 7 MTD partitions on "s5pv210-nand":
[    0.740000] 0x000000000000-0x000000100000 : "Bootloader"
[    0.745000] 0x000000600000-0x000000b00000 : "Kernel"
[    0.750000] 0x000000b00000-0x000000e00000 : "cramfs"
[    0.755000] 0x000000e00000-0x000004e00000 : "DATA"
[    0.770000] 0x000004e00000-0x000005d00000 : "Jffs2"
[    0.775000] 0x00000c640000-0x00000c940000 : "RAMDISK"
[    0.775000] 0x00000ca00000-0x000010000000 : "UBIFS"
==============================================================


*boot NFS and check the /dev have added these MTD device

[root@QT210 /]# ls /dev/mtd*
/dev/mtd0       /dev/mtd2ro     /dev/mtd5       /dev/mtdblock1  /dev/mtdblock6
/dev/mtd0ro     /dev/mtd3       /dev/mtd5ro     /dev/mtdblock2
/dev/mtd1       /dev/mtd3ro     /dev/mtd6       /dev/mtdblock3
/dev/mtd1ro     /dev/mtd4       /dev/mtd6ro     /dev/mtdblock4
/dev/mtd2       /dev/mtd4ro     /dev/mtdblock0  /dev/mtdblock5



5. upload the cramfs/data/jffs2/ramdisc image you made earlier to QT210 flash rom (refer to NOTE_fs_rootfs_build)
*cramfs
*QT210 side
==============================
LARRY6410>>set cramfs dnw\;nand erase b00000 300000\;nand write c0008000 b00000 300000
//update20151030 for tftpboot
set cramfs tftpboot 0xc0008000 192.168.10.59:rootfs.cramfs\;nand erase b00000 300000\;nand write c0008000 b00000 300000  
LARRY6410>>run cramfs
*HOST side
                ==============================
                $sudo dnw rootfs.cramfs

*QT210 side
                ==============================
LARRY6410>>set cramfs_boot set bootargs root=/dev/mtdblock2 rootfstype=cramfs console=ttySAC0 mem=512M
LARRY6410>>run cramfs_boot

*There should a boot message shown that cramfs work correctlly
==============================
[    3.530000] VFS: Mounted root (cramfs filesystem) readonly on device 31:2.
[    3.530000] Freeing init memory: 148K
[    5.680000] smdkc110-rtc smdkc110-rtc: rtc disabled, re-enabling
Please press Enter to activate this console.
==============================

*DATA ,create a data area for storage purpose or so.....

*boot to NFS.


*to make sure the device name of "data" 
[root@QT210 /]# cat /proc/mtd 
dev:    size   erasesize  name
mtd0: 00100000 00020000 "Bootloader"
mtd1: 00500000 00020000 "Kernel"
mtd2: 00300000 00020000 "cramfs"
mtd3: 04000000 00020000 "DATA"
mtd4: 00f00000 00020000 "Jffs2"
mtd5: 00300000 00020000 "RAMDISK"
mtd6: 03600000 00020000 "UBIFS"

*format "DATA" as FS Jfss2
[root@QT210 /]# flash_eraseall -j /dev/mtd3
Erasing 128 Kibyte @ 1260000 -- 28 % complete. Cleanmarker written at 1260000.
Skipping bad block at 0x01280000
Erasing 128 Kibyte @ 3e80000 -- 97 % complete. Cleanmarker written at 3e80000.
Skipping bad block at 0x03ea0000
Erasing 128 Kibyte @ 3fe0000 -- 99 % complete. Cleanmarker written at 3fe0000.


*create a folder "/mnt/datatmp" for DATA to mount

[root@QT210 /]# mkdir /mnt/datatmp

*mount the FS to 6410 /mnt
[root@QT210 /]# mount -t jffs2 /dev/mtdblock3  /mnt/datatmp

[root@QT210 /]# df
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/root             26651712  24847996    449888  98% /
/dev/mmcblk0p1         3139600        72   3139528   0% /mnt/sdcard
tmpfs                   337028         0    337028   0% /dev/shm
/dev/mtdblock3           65536      1920     63616   3% /mnt/datatmp

*then you can try to access data via /mnt

*you might meet problem like these
[root@QT210 /]# mount -t jffs2 /dev/mtdblock3 /mnt/datatmp
mount: mounting /dev/mtdblock3 on /mnt failed: No such device
*check the item of jffs2 support in kernel has checked or not
File systems  ---> 
Miscellaneous filesystems  ---> 
<*> Journalling Flash File System v2 (JFFS2) support


*you can add these action into /etc/init.d/rcS let the system do it earilyand automatically..

*add these to rcS
=================================
flash_eraseall -j /dev/mtd3
mkdir /mnt/datatmp
mount -t jffs2 /dev/mtdblock3 /mnt/datatmp

*JFSS2 
*boot NFS 


                *to make sure the device name of "JFSS2"
[root@QT210 /]# cat /proc/mtd*
dev:    size   erasesize  name
mtd0: 00100000 00020000 "Bootloader"
mtd1: 00500000 00020000 "Kernel"
mtd2: 00300000 00020000 "cramfs"
mtd3: 04000000 00020000 "DATA"
mtd4: 00f00000 00020000 "Jffs2"
mtd5: 00300000 00020000 "RAMDISK"
mtd6: 03600000 00020000 "UBIFS"


*format "mtd4" in which we will upload JFSS2 FS 
[root@QT210 /]# flash_eraseall -j /dev/mtd4
Erasing 128 Kibyte @ ee0000 -- 99 % complete. Cleanmarker written at ee0000.



*upload the jffs2 image to mtd4

*QT210 side
                ==============================
                SMDKV210#set jffs2 dnw\;nand erase 4e00000 f00000\;nand write c0008000 4e00000 f00000
         //update20151030 for tftpboot
set jffs2 tftpboot 0xc0008000 192.168.10.59:rootfs.jffs2\;nand erase 4e00000 f00000\;nand write c0008000 4e00000 f00000 
      SMDKV210#run jffs2

                *HOST side
                ==============================
                $sudo dnw rootfs.jffs2

                *QT210 side
                ==============================
                SMDKV210#set jffs2_boot set bootargs root=/dev/mtdblock4 rootfstype=jffs2 console=ttySAC0 mem=512M
                SMDKV210#run jffs2_boot


                *There might be a boot message shown like these.
                * the "Empty xxxxx" message is not a problem .
This message is generated if a block of data is partially written. 
It is generally not a sign of any problem. 
==============================
[    9.225000] Empty flash at 0x00297ffc ends at 0x00298000
[    9.235000] Empty flash at 0x0029bffc ends at 0x0029c000
[    9.355000] Empty flash at 0x002a3fec ends at 0x002a4000
[    9.405000] Empty flash at 0x002a7fc0 ends at 0x002a8000
[    9.565000] VFS: Mounted root (jffs2 filesystem) on device 31:4.
[    9.565000] Freeing init memory: 148K
[   13.250000] smdkc110-rtc smdkc110-rtc: rtc disabled, re-enabling

Please press Enter to activate this console.
==============================



*RAMdisc

*make sure the relavent items in kernel have been choosen
General setup  --->
[*] Initial RAM filesystem and RAM disk (initramfs/initrd) support 
Device Drivers  --->
 [*] Block devices  --->
(8192)  Default RAM disk size (kbytes)

File systems  --->
<*> Second extended fs support 

*edit the file "mk_ramdisk.sh" to change the disk size match the setting in kernel

$ vim mk_ramdisk.sh 

change to 
===============
RAMDISKSIZE=8192
==============


*Qt210 side (older tigerboard)
                ==============================
SMDKV210#set ramdisk dnw\;nand erase c640000 300000\;nand write c0008000 c640000 300000
//update20151030 for tftpboot
set ramdisk tftpboot 0xc0008000 192.168.10.59:initrd.gz\;nand erase c640000 300000\;nand write c0008000 c640000 300000         
       SMDKV210#run ramdisk

                *HOST side
                ==============================
                $sudo dnw initrd.img

                *QT210 side   (for previous vesion tigerboard which with the black/white keypad)
                ==============================
SMDKV210#nand read 30a00000 c640000 300000

*QT210 side   (for the new board tigerboard2 ramdisk corrupt issue, only find the address that wont
                                                be corrupt by kernel would fixed that issue which is why 3C00_0000)
               ==============================
               SMDKV210#nand read 3C000000 c640000 300000


*for older tigerboard
       SMDKV210#set ramdisk_boot set bootargs root=/dev/ram0 rootfstype=ext2 ramdisk=8192 initrd=0x30a00000,8M console=ttySAC0 mem=512M
        *for new tigerboard 2
       SMDKV210#set ramdisk_boot set bootargs root=/dev/ram0 rootfstype=ext2 ramdisk=8192 initrd=0x3c000000,8M console=ttySAC0 mem=512M
                SMDKV210#run ramdisk_boot


                *There should a boot message shown that ramdisk work correctlly
                ==============================
[    0.370000] Trying to unpack rootfs image as initramfs...
[    0.375000] rootfs image is not initramfs (no cpio magic); looks like an initrd
[    0.400000] Freeing initrd memory: 8192K

[    3.535000] s5p-tvout s5p-tvout: hpd status is cable removed
[    3.545000] DBUG_PORT must not use AFC!
[    3.545000] RAMDISK: gzip image found at block 0
[    3.740000] EXT2-fs (ram0): warning: checktime reached, running e2fsck is recommended
[    3.740000] VFS: Mounted root (ext2 filesystem) on device 1:0.
[    3.740000] Freeing init memory: 148K
[    5.085000] smdkc110-rtc smdkc110-rtc: rtc disabled, re-enabling
[    5.105000] net eth0: SMSC911x/921x identified at 0xf48e2000, IRQ: 41



Please press Enter to activate this console.
                ==============================


*UBIFS
*boot NFS 

**make sure the relavent items in kernel have been choosen
Device Drivers -->
Memory Technology Device (MTD) support--->
UBI - Unsorted block images-->
<*> Enable UBI 
File systems  ---> 
Miscellaneous filesystems -->
  <*>   UBIFS file system support  
[*]     Extended attributes support
[*]     Advanced compression options  
[*]       LZO compression support  
[*]       ZLIB compression support





             *to make sure the device name of "UBIFS"
[root@QT210 /]# cat /proc/mtd*
dev:    size   erasesize  name
mtd0: 00100000 00020000 "Bootloader"
mtd1: 00500000 00020000 "Kernel"
mtd2: 00300000 00020000 "cramfs"
mtd3: 04000000 00020000 "DATA"
mtd4: 00f00000 00020000 "Jffs2"
mtd5: 00300000 00020000 "RAMDISK"
mtd6: 03600000 00020000 "UBIFS"               
*format "mtd6" in which we will upload UBI FS

[root@QT210 /]# flash_eraseall  /dev/mtd6
Erasing 128 Kibyte @ 35e0000 -- 99 % complete.
*ubi_ctrl
[root@QT210 /]# ls /dev/ubi*
/dev/ubi_ctr

       *attach ubi_ctrl with mtd6
[root@QT210 /]# ubiattach /dev/ubi_ctrl -m 6
[  169.115000] UBI: attaching mtd6 to ubi0
[  169.115000] UBI: physical eraseblock size:   131072 bytes (128 KiB)
[  169.115000] UBI: logical eraseblock size:    129024 bytes
[  169.115000] UBI: smallest flash I/O unit:    2048
[  169.115000] UBI: sub-page size:              512
[  169.115000] UBI: VID header offset:          512 (aligned 512)
[  169.120000] UBI: data offset:                2048
[  169.580000] UBI: empty MTD device detected
[  169.580000] UBI: create volume table (copy #1)
[  169.590000] UBI: create volume table (copy #2)
[  169.610000] UBI: attached mtd6 to ubi0
[  169.610000] UBI: MTD device name:            "UBIFS"
[  169.610000] UBI: MTD device size:            54 MiB
[  169.610000] UBI: number of good PEBs:        432
[  169.610000] UBI: number of bad PEBs:         0
[  169.610000] UBI: max. allowed volumes:       128
[  169.615000] UBI: wear-leveling threshold:    4096
[  169.620000] UBI: number of internal volumes: 1
[  169.625000] UBI: number of user volumes:     0
[  169.625000] UBI: available PEBs:             424
[  169.635000] UBI: total number of reserved PEBs: 8
[  169.635000] UBI: number of PEBs reserved for bad PEB handling: 4
[  169.645000] UBI: max/mean erase counter: 0/0
[  169.645000] UBI: image sequence number: 0
[  169.650000] UBI: background thread "ubi_bgt0d" started, PID 92
UBI device number 0, total 432 LEBs (55738368 bytes, 53.2 MiB), available 424 LEBs (54706176 bytes, 52.2 MiB), LEB size 129024 bytes (126.0 KiB)

*there is a ubi0 generated and connected to /dev/mtd6

[root@QT210 /]# ls /dev/ubi*
/dev/ubi0      /dev/ubi_ctr

*give a label to ubi0 and ubi0_0 generate

[root@QT210 /]# ubimkvol /dev/ubi0 -N larryubifs -m
Set volume size to 54706176
Volume ID 0, size 424 LEBs (54706176 bytes, 52.2 MiB), LEB size 129024 bytes (126.0 KiB), dynamic, name "larryubifs", alignment 1

*there is a ubi0_0 generated and this is exactly one we used to mount to /mnt

[root@QT210 /]# ls  /dev/ubi*
/dev/ubi0      /dev/ubi0_0    /dev/ubi_ctrl



*create a folder "ubitmp" for ubi device to mount

[root@QT210 /]# mkdir /mnt/ubitmp


*mount the ubifs to /mnt
[root@QT210 /]# mount -t ubifs ubi0_0 /mnt/ubitmp
[  371.920000] UBIFS: default file-system created
[  372.115000] UBIFS: mounted UBI device 0, volume 0, name "larryubifs"
[  372.115000] UBIFS: file system size:   53544960 bytes (52290 KiB, 51 MiB, 415 LEBs)
[  372.115000] UBIFS: journal size:       2709504 bytes (2646 KiB, 2 MiB, 21 LEBs)
[  372.115000] UBIFS: media format:       w4/r0 (latest is w4/r0)
[  372.120000] UBIFS: default compressor: lzo
[  372.125000] UBIFS: reserved for root:  2529060 bytes (2469 KiB)

*setup a  file system (/day7/root_mkfs.tar.gz) on mtd6 
$cp root_mkfs20120215.tar.gz ~/root_mkfs
*then decompress it on 6410 to /mnt 
[root@QT210 /]# tar zxvf root_mkfs20120215.tar.gz -C /mnt/ubitmp

*umount device

[root@QT210 /]# umount /mnt/ubitmp/
[  569.885000] UBIFS: un-mount UBI device 0, volume 0

*reboot qt210 and set bootargs to boot from mtd6

SMDKV210# set ubi_boot set bootargs ubi.mtd=6 root=ubi0:larryubifs rootfstype=ubifs console=ttySAC0 mem=512M



*There should be message shown as below
UBIFS: recovery needed
UBIFS: recovery completed
UBIFS: mounted UBI device 0, volume 0, name "larryubifs"
UBIFS: file system size:   303206400 bytes (296100 KiB, 289 MiB, 1175 LEBs)
UBIFS: journal size:       15224832 bytes (14868 KiB, 14 MiB, 59 LEBs)
UBIFS: media format:       4 (latest is 4)
UBIFS: default compressor: LZO
UBIFS: reserved for root:  5182151 bytes (5060 KiB)
VFS: Mounted root (ubifs filesystem).
Freeing init memory: 280K
eth0: link down
Please press Enter to activate this console. 

*setup QTOPIA (day7/qtopia.tar.gz) as a FS into mtd6 and then boot to it 


*re-compile the kernel coz the capacity of flash is not bigger enough for the segments we made earlier


/drivers/mtd/nand/s3c_nand.h

  {
               .name           = "Bootloader",
               .offset         = 0,
               .size           = 0x00100000,
       },
       {
               .name           = "Kernel",
               .offset         = 0x00100000,
               .size           = 0x00500000,
       },
       {
               .name           = "UBIFS",
               .offset         = 0x00600000,
               .size           = MTDPART_SIZ_FULL,
       }


QT210 side
==========
SMDKV210# set bootargs noinitrd root=/dev/nfs nfsroot=192.168.0.1:/home/cdpda/root_mkfs,proto=tcp,nfsvers=3 ip=192.168.0.20::192.168.0.1:255.255.255.0:hello.com.tw:eth0:off console=ttySAC0


QT210 side
===========
SMDKV210# dnw    
OTG cable Connected!
Now, Waiting for DNW to transmit data
Download Done!! Download Address: 0xc0008000, Download Filesize:0x35b1e8
Checksum is being calculated....
Checksum O.K.


HOST side
==========
dnw zImage


QT210 side  (boot kernel that store in 0xc0008000)
==========
SMDKV210# bootm c0008000


*then boot NFS to console
*repeated the step as above 
*flash_eraseall  /dev/mtd2
*ubiattach /dev/ubi_ctrl -m 2
*ubimkvol /dev/ubi0 -N larryubifs -m
*mkdir /mnt/ubitmp
*mount -t ubifs ubi0_0 /mnt/ubitmp

$cp qtopia10.tar.gz  ~/root_mkfs

*then decompress it on 6410 to /mnt
                       [root@QT210 /]#tar zxvf qtopia10.tar.gz -C /mnt/ubitmp

*umount /mnt/ubitmp

*reboot QT210
QT210 side (set bootargs to boot from mtd6)
==========
SMDKV210#set bootargs ubi.mtd=2 root=ubi0:larryubifs rootfstype=ubifs console=ttySAC0 mem=512M


QT210 side
                ===========
                SMDKV210# dnw
                OTG cable Connected!
                Now, Waiting for DNW to transmit data
                Download Done!! Download Address: 0xc0008000, Download Filesize:0x35b1e8
                Checksum is being calculated....
                Checksum O.K.



HOST side
                ==========
                dnw zImage


QT210 side  (boot kernel that store in 0xc0008000)
                ==========
                SMDKV210# bootm c0008000


*then boot to QTOPIA you should see  the "windows" on the LCD

===================================
[    5.950000] UBIFS: reserved for root:  4952683 bytes (4836 KiB)
[    5.960000] VFS: Mounted root (ubifs filesystem) on device 0:13.
[    5.960000] Freeing init memory: 152K
mount: mounting /dev/mmcblk0p1 on /mnt/sdcard failed: Device or resource busy
[    8.550000] smdkc110-rtc smdkc110-rtc: rtc disabled, re-enabling
hwclock: settimeofday() failed: Invalid argument
Try to bring eth0 interface up......[    8.615000] net eth0: MAC Address: 00:22:12:34:56:90
[    8.630000] net eth0: SMSC911x/921x identified at 0xf4948000, IRQ: 41
Done
Starting Qtopia, please waiting...

Please press Enter to activate this console.

====================================



*Andoird (FASTBOOT)


Host side
--------
1. download "fastboot.tar.gz from /day7 and decompressed it.

#tar zxvf fastboot_image.tar.gz 



QT210 side (with the USB cable connected between QT210 and HOST)
-------
2. Stop at uboot console and run "fastboot"

SMDKV210 # fastboot
Fastboot: employ default partition information
[Partition table on NAND]
ptn 0 name='bootloader' start=0x0 len=0x100000(~1024KB) 
ptn 1 name='recovery' start=0x100000 len=0x500000(~5120KB) 
ptn 2 name='kernel' start=0x600000 len=0x500000(~5120KB) 
ptn 3 name='ramdisk' start=0xB00000 len=0x300000(~3072KB) 
ptn 4 name='system' start=0xE00000 len=0x6E00000(~112640KB) (Yaffs)
ptn 5 name='cache' start=0x7C00000 len=0x5000000(~81920KB) (Yaffs)
ptn 6 name='userdata' start=0xCC00000 len=N/A (Yaffs)

Host side
---------
3. run the fastboot.sh in the fastboot folder (the while process might take 2~3 minutes)
fastboot_image#sudo ./fastboot.sh 
sending 'bootloader' (272 KB)...
OKAY [  0.215s]
writing 'bootloader'...
OKAY [  0.476s]
finished. total time: 0.691s
sending 'kernel' (3011 KB)...
OKAY [  0.939s]
writing 'kernel'...
OKAY [  2.583s]
finished. total time: 3.522s
sending 'system' (110077 KB)...
OKAY [ 31.147s]
writing 'system'...
OKAY [ 94.093s]
finished. total time: 125.241s
sending 'userdata' (1470 KB)...
OKAY [  0.529s]
writing 'userdata'...
OKAY [  2.358s]
finished. total time: 2.887s
sending 'ramdisk' (1314 KB)...
OKAY [  0.502s]
writing 'ramdisk'...
OKAY [  1.303s]
finished. total time: 1.805s
erasing 'cache'...
OKAY [  0.591s]
finished. total time: 0.591s


QT210 side
---------
4. reset the system and let it go freely unitl enter "android 2.3"

5. copy the "pointercal" in your sdcard to system /data (conduct this when the full android screen is displayed)

cp /mnt/sdcard/pointercal /data/

6.enjoy your first android system

[琪琪雜貨舖]