레이블이 SoC-DM81xx인 게시물을 표시합니다. 모든 게시물 표시
레이블이 SoC-DM81xx인 게시물을 표시합니다. 모든 게시물 표시

12/19/2016

DM8148의 NAND 와 UBIFS 문제 (Power-Cut)

1. Background 

DM8148 Board를 고객에게 Board를 제작해주고, 1년 동안 잘동작이 되었지만, 1년이 지난후 갑자기 문제가 발생이 되어
아래와 같이 원인분석을 하기 시작하였다. 고객은 갑자기 그렇다고 하는데, 일단 사용보드 2개가 동일한 증상을 보여 문제사항을 분석하기로 하였다.


1.1 문제사항

Booting 할때마다 아래와 같이 Kernel에서 Mount할때 UBIFS의 Recovery Mode를 진입을하여,
이를 매번실패한 후 Booting이 되지 않고 에러 발생.

  • UBIFS 문제점 
UBI: attaching mtd4 to ubi0
UBI: physical eraseblock size:   131072 bytes (128 KiB)
UBI: logical eraseblock size:    126976 bytes
UBI: smallest flash I/O unit:    2048
UBI: sub-page size:              512
UBI: VID header offset:          2048 (aligned 2048)
UBI: data offset:                4096
UBI: max. sequence number:       240
UBI: attached mtd4 to ubi0
UBI: MTD device name:            "File System"
UBI: MTD device size:            505 MiB
UBI: number of good PEBs:        4040
UBI: number of bad PEBs:         2                        // bad block marking 잘 동작 
UBI: number of corrupted PEBs:   0
UBI: max. allowed volumes:       128
UBI: wear-leveling threshold:    4096
UBI: number of internal volumes: 1
UBI: number of user volumes:     1
UBI: available PEBs:             0
UBI: total number of reserved PEBs: 4040
UBI: number of PEBs reserved for bad PEB handling: 40
UBI: max/mean erase counter: 2/0
UBI: image sequence number:  214330113
UBI: background thread "ubi_bgt0d" started, PID 38
....
UBIFS: recovery needed
UBIFS error (pid 1): replay_log_leb: log error detected while replaying the log at LEB 3:0
List of all partitions:
1f00             128 mtdblock0  (driver?)
1f01            2304 mtdblock1  (driver?)
1f02             128 mtdblock2  (driver?)
1f03            4352 mtdblock3  (driver?)
1f04          517376 mtdblock4  (driver?)
No filesystem could mount root, tried:  ubifs
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)
Backtrace: 
[] (dump_backtrace+0x0/0x110) from [] (dump_stack+0x18/0x1c)
 r7:d6412000 r6:c006d928 r5:c002c4c4 r4:c0472b90
[] (dump_stack+0x0/0x1c) from [] (panic+0x60/0x17c)
[] (panic+0x0/0x17c) from [] (mount_block_root+0x1e0/0x220)
 r3:00000000 r2:00000020 r1:d643bf78 r0:c03cce1c
[] (mount_block_root+0x0/0x220) from [] (prepare_namespace+0x94/0x1d4)
[] (prepare_namespace+0x0/0x1d4) from [] (kernel_init+0x114/0x154)
 r5:c00086b0 r4:c0472340
[] (kernel_init+0x0/0x154) from [] (do_exit+0x0/0x5e4)
 r5:c00086b0 r4:00000000


2. UBOOT에서 기본 TEST 및 문제진단


uboot에서 기본적으로 tftp를 이용하여, kernel 및 filesystem을 download 후 이를 다시 NAND에 write 한 후 NAND Boot를 하면 한번은 제대로 동작이 된다.

처음과 같이 전원단에 갑자기 On/Off를 하면 상위와 동일한 증상이 발생한다.

2.1 UBOOT에서 Bad Block TEST

상위 테스트로 일단 Kernel Image와 Filesystem Image에는 문제가 없다고 판단이 되었다.

SLC Type의 NAND 이지만 Bad Block문제라고 생각이 되어 이를 UBOOT에서 Bad Block을 직접 설정하고 해결하려고 했다. (BBT설정 )

  • NAND의 bad block 검출방법
RAM의 Image와 NAND Image를 비교하여 틀린 곳을 발견  
  
U-Boot#  tftp 0x81000000 file_system.img
Bytes transferred = 140771328 (8640000 hex)  

U-Boot#  nand read 0xA0000000 0x6c0000 0x8640000
// 35192832 = 140771328/4 bytes 

U-Boot#  cmp 0x81000000 0xA0000000 35192832
word at 0x8100000c (0x00000000) != word at 0xa000000c (0x01000000)
Total of 3 words were the same 

  // 0x8100000c - 0x81000000 = 0xc + 0x6c0000 
  // 0xa000000c - 0xA0000000 = 0xc + 0x6c0000



  • NAND에  Bad block를 Marking
아래와 같이 문제가되는 Block을 Bad Block이라고 직접 Marking 을 한다 
  
U-Boot#  nand markbad 0x6c000C
U-Boot#  nand bad 
006c0000

// Nand bad block maring 2nd Test 

U-Boot#  nand read 0xA0000000 0x6c0000 0x8640000
U-Boot#  cmp 0x81000000 0xA0000000 35192832

word at 0x897423c4 (0xff7fffff) != word at 0xa87423c4 (0xffffffff)
Total of 35457265 words were the same

  // 0x897423c4 - 0x81000000 = 0x087423C4 + 0x006c0000 = 0x08E023C4 --> read size를 초과했다. 
  // 위 로그를 보면 나의 count 보다 초과 했다. 다른 곳 위치가 filesystem의 범위를 벗어났다. 

위와 같이 진행을 하여 Bad Block을 Marking을 여러번 한 후 TEST를 했으나, 결과는 동일하게 나타났으며, 그 원인을 Bad Block이 아닌 다른문제로 보기로 하였다.
( 물론 Uboot Loader와 Kernel 사이의 Bad block Table의 호환성도 확인해야한다)


2.2 UBIFS 설정변경 

원래 문제를 다시 분석을 해보면, 초반 한번은 제대로 Booting이 된다 , 그리고, 그 다음 Power on/off를 하면 이 문제가 다시 발생을 하는데, 이때 NAND에 무슨 문제가
발생한다고 생각해서 아래와 같이 Kernel의 Argument를 변경하였다.

현재 kernel argument이며, 현재 mtd4에 page size 2048로 설정되어있으며 rw이기때문에 이를 ro로 변경
 
set bootargs "console=ttyO0,115200n8 earlyprintk noinitrd rootwait=1 rw ubi.mtd=4,2048 rootfstype=ubifs root=ubi0:rootfs notifyk.vpssm3_sva=0xBF900000 mem=364M@0x80000000 mem=320M@0x9FC00000 mem=1023M@0xC0000000 vmalloc=500M ip=none vram=50M ti814xfb.vram=0:24M,1:16M,2:6M"

  • read only 변경후 해결 (임시방편)
read only로 하면 , 즉 ro , 변경하면 동작은 위 문제는 해결이 되었다. 
 
set bootargs "console=ttyO0,115200n8 earlyprintk noinitrd rootwait=1 ro ubi.mtd=4,2048 rootfstype=ubifs root=ubi0:rootfs notifyk.vpssm3_sva=0xBF900000 mem=364M@0x80000000 mem=320M@0x9FC00000 mem=1023M@0xC0000000 vmalloc=500M ip=none vram=50M ti814xfb.vram=0:24M,1:16M,2:6M"

  • UBIFS mount 및 kernel argument 
   http://processors.wiki.ti.com/index.php/UBIFS_Support

ro로 하면 문제는 해결이 되지만, UBIFS라는 것이 RW를 사용하기위해서 사용하는것이 목적일텐데, 이것은 해결이 아니고, 임시방편이라고 생각이 들어
다음과 같이 근본적인 원인을 더 분석하기로하였다.

2.3 UBIFS의 문제사항 파악 

UBIFS에서 왜 Recovery를 하는 지 정확한 원인을 알기 위해서 찾던도중 The unstable bits issue라는 것이있다는 것을 알게되었다.
원인은 잦은 Power Cut때문에 위와 같은 문제발생이 된다고 하는데, 예를들면 CPU는 NAND에게 CMD 주고 NAND가 이를 처리하는 도중
지속적으로 전원이 나가면 이런 문제가 발생이 된다고 한다.
현재 우리 보드가 Reset 버튼을 찾기 어려워서 자주 Power를 뽑게되어 있어, 이런문제가 발생한것 같다. (본인도, Reset보다는 Power on/off를 함)


현재 회로도를 보면, PMIC와 DM8148은 연결이 되어있고, PMIC는 SMPS가 지원이 되기때문에, Switch용으로 Capacitor 사용하지만, 현재 이부분과 연관이 있을 것 같다. (추측)
전원이 나가면, SOC에게는 CMD를 주는 여러번의 기회를 주지만, NAND에서 이를 처리할 시간이 없어서 발생하는 문제이니, HW적으로도
이부분은 문제일것이라고 생각이 들면 이부분은 더 살펴보아야 할 것 같다.

시간이 더 허락이 된다면, 추후 회로도와 관련사항을 더 봐야할 것 같다.

  • The unstable bits issue
   http://www.linux-mtd.infradead.org/doc/ubifs.html#L_unstable_bits

  • UBIFS 관련내용 
   http://www.linux-mtd.infradead.org/doc/ubifs.html

  UBIFS의 구조 및 동작원리
  https://bootlin.com/pub/conferences/2016/elce/brezillon-ubi-mlc/ubi-mlc.pdf

  • 구글링을 해서 나와 유사한 문제를 찾았다. 
   http://forum.doozan.com/read.php?2,907,919

 
3. 결론 


3.1 NAND Power-Cut의 문제사항


Power-cut이라는 것이 전원공급을 갑자기 중단하는 방법을 말한다.

  • Unstable bits issue란? 
이용어는 NAND가 write or erase 하는 도중  power-cut 으로 발생되는 불안정한 BIT오류를 말한다.

처음 튼튼한 SLC (robust SLC) 인 경우와 NOR Type에는 나온적이 아직은 없다고 하지만,
현재의 SLC와 MLC에 공통적으로 나오는 현상이라고 한다.
이 문제는 아직 해결이 되지 않았으며, 어느 flash건 나올 수 있다. (UBIFS에서도 해결이 안됨)

잦은 power-cut으로 인하여 NAND 안에는 unstable bits가 존재하며, 이 bit들이 증가하여,
ECC가 이를 보정 못했을 경우 문제가 확산이 되는 경우 발생한다.

UBIFS 경우 이 문제가 발생이되면 ECC Error가 발생이되고 recovery mode 들어가 복구를 시도 하지만 복구가 제대로 안되는 경우가 발생이 한다.
이 때 File system은 오류가 생기고 에러가 발생이된다.
인터넷 글을 읽어보면, 이것은 불안전한 bit이기 때문에 제대로 read가 될 경우도 있다.
그래서 제대로 동작이 될 경우도 있지만, 문제가 지속되는 경우도 발생한다.

결론은 항상 unstable bits는 NAND안에 존재하지만 이는 power-cut에 의해 발생이 되며,
그리고 기본적으로 ECC 알고리즘이 이를 복구를 해주지만, 이 unstalbe bit 가 증가하면 
이를 복구를 못해주어 문제가 발생한다.

* unstable bits : power cut으로 발생으로 되며, NAND안에서 존재하게된다.
* ECC (Error-correcting code) (1bit/4bit ECC)
* bit-flip: 외부의 요인으로 bit가 변경되는 현상, (heat or power cut or low voltage)

unstalbe bits란?
  http://www.linux-mtd.infradead.org/doc/ubifs.html#L_unstable_bits

  • Power Cut Off Interval 비교 (아래 논문참고)
Power Cut off interval은 아래의 논문을 보면,CPU에서 Command 가 NAND에 실행되는 시간부터 Power를 off하는 시간의 간격이다.
이에 따라 간단히 에러율을 볼수가 있는데,  (논문내용을 함부로 가져올수가 없어서)
간단히 정리해본다.

4.1 Program and power failure (논문)
SLC마다 다르지만, 대체적으로  Power cut off는 100ms기반으로 에러율이 많이 틀려지는 것 같다.

4.2 Erase and power failure (논문)
확실히 Erase Command가 실행시간이 오래걸리며, 생각을 해봐도, Block 단위로 할테니,
시간이 많이 걸리는 것 같다.
그래서, 위와 다르게 SLC type 마다 너무 다 다르다.

이는 개별 NAND datasheet에서 Command 실행시간을 확인을 해봐야 할 것같다.


  • 관련논문 
  https://cseweb.ucsd.edu/~swanson/papers/DAC2011PowerCut.pdf


  • Software 해결방안 (unstable bits)
UBIFS 사용할 경우 recovery mode로 인하여 잘못 복구되어서 문제가 확산이 된다.
하지만, yaffs의 구조가 어떻게 작동이 되는지는 정확히 모르겠지만, 이 부분에 있어서
UBIFS보다 낫다고 한다.
Yaffs로 변경이 되어다고 해서 완전히 해결이 되는 문제는 아니지만 발생빈도가 줄어드는것같다.

  위 내용은 아래 참조 (HW내용도 기술됨)
  http://yaffs.net/lurker/message/20140710.203207.b2255691.it.html


  • Hardware 해결방안 (unstable bits)
NAND의 Power 관련인 VCC에 Decoupling Capacitor 달아주는 거나 이에 관련된 부분을 검토하는 것이다.
그리고 가능하다면 회로도가 넓이 및 다른 것도 고려해야 하는 것 같다.

물론 근본적 원인은  power-cut이 될 경우 NAND Controller인 SOC는 먼저 종료가 되는 것 이지만,
Power-Cut 동안 이미 받은 NAND가 Command를 받아 처리하는 것을 완료될때까지 잠시지연시키는 것이 HW 최대 해결방안이다.





  • 상위회로도 아래와 동일
  https://e2e.ti.com/support/arm/sitara_arm/f/791/t/358906

  • NAND or DDR HW 설계시 알아야할 기본내용 
  bypass (decoupling) capacitor 관련내용
  http://magicom9.tistory.com/78

12/10/2016

HDMI 및 VPSS 설정

1. HDMI 와 VPSS 설정

아래설정은 기본적으로 DM8148로 SDK기준으로 작성했기때문에, TI BSP에 따라
달라질수 있겠다.
  • HDMI (DM816x AM389x DM814x AM387x)
  1. HDMI Kernel 설정 및  모듈
  2. sysfs 설정방법
  http://processors.wiki.ti.com/index.php/TI81XX_PSP_HDMI_Driver_User_Guide

  • VPSS (HDVPSS) (DM814X AM387X)  관련사항 설정
  HDVPSS의 경우 VIDEO IN/OUT을 담당해주는 Device로 현재 두개까지 지원이 가능하다.
  만약 Display0 or 1 ( VOUTx) 변경하고 싶다면, 아래와 같이 sysfs을 이용하여, 변경해주자.
  sysfs : display0
  아래와 같이 shell program을 수정을하여, LCD or HDMI Mode로 수정을 하자.

$ vi dm8148/targetfs/etc/rc5.d/S01load-hd-firmware.sh
#!/bin/sh
#
# manage HDVICP2 and HDVPSS Engine firmware

PATH=$PATH:/usr/share/ti/ti-media-controller-utils
HDVICP2_ID=1
HDVPSS_ID=2

configure_lcd()
{
    echo "Configuring fb0 to LCD"
    echo 1:dvo2 > /sys/devices/platform/vpss/graphics0/nodes
    echo 0 > /sys/devices/platform/vpss/display1/enabled
    echo 33500,800/164/89/10,480/10/23/10,1 > /sys/devices/platform/vpss/display1/timings
    echo triplediscrete,rgb888 > /sys/devices/platform/vpss/display1/output
    echo 1 > /sys/devices/platform/vpss/display1/enabled
    fbset -xres 800 -yres 480 -vxres 800 -vyres 480
}


case "$1" in
    start)
        echo "Loading HDVICP2 Firmware" 
        prcm_config_app s
        depmod -a
        modprobe syslink
        until [[ -e /dev/syslinkipc_ProcMgr && -e /dev/syslinkipc_ClientNotifyMgr ]]
        do
            sleep 0.5
        done
        firmware_loader $HDVICP2_ID /usr/share/ti/ti-media-controller-utils/dm814x_hdvicp.xem3 start
        echo "Loading HDVPSS Firmware"
        firmware_loader $HDVPSS_ID /usr/share/ti/ti-media-controller-utils/dm814x_hdvpss.xem3 start
        modprobe vpss sbufaddr=0xBFB00000 mode=hdmi:1080p-60 i2c_mode=1
        #modprobe vpss sbufaddr=0xBFB00000 mode=hdmi:720p-60 i2c_mode=1
        modprobe ti81xxfb vram=0:24M,1:16M,2:6M
        modprobe ti81xxhdmi
        modprobe tlc59108
      ;;
    stop)
        echo "Unloading HDVICP2 Firmware"
        firmware_loader $HDVICP2_ID /usr/share/ti/ti-media-controller-utils/dm814x_hdvicp.xem3 stop
        echo "Unloading HDVPSS Firmware"
        rmmod tlc59108
        rmmod ti81xxhdmi
        rmmod ti81xxfb
        rmmod vpss
        firmware_loader $HDVPSS_ID /usr/share/ti/ti-media-controller-utils/dm814x_hdvpss.xem3 stop
        rm /tmp/firmware.$HDVPSS_ID
        rmmod syslink
      ;;
    *)
        echo "Usage: /etc/init.d/load-hd-firmware.sh {start|stop}"
        exit 1
        ;;
esac

exit 0


  • 실제 수정 및 TEST
아래와 같이 HDVICP와 HDVPSS의 Firmware도 변경이 가능하며, HDMI 설정가능

$ cd etc/rc5.d
$ vi S01load-hd-firmware.sh

PATH=$PATH:/usr/share/ti/ti-media-controller-utils                              
HDVICP2_ID=1                                                                    
HDVPSS_ID=2 
....

case "$1" in                                                                    
   
    start)
 depmod -a
        echo "Loading HDVICP2 Firmware"
        prcm_config_app s
        depmod -a 
        modprobe syslink
        until [[ -e /dev/syslinkipc_ProcMgr && -e /dev/syslinkipc_ClientNotifyMgr ]]
        do                                                
            sleep 0.5
        done
        #firmware_loader $HDVICP2_ID /usr/share/ti/ti-media-controller-utils/dm814x_hdvicp.xem3 start
        firmware_loader $HDVICP2_ID /usr/share/ti/ti-media-controller-utils/dm814xbm_m3video_whole_program_debug.xem3 start
        echo "Loading HDVPSS Firmware"
        #firmware_loader $HDVPSS_ID /usr/share/ti/ti-media-controller-utils/dm814x_hdvpss.xem3 start
        firmware_loader $HDVPSS_ID /usr/share/ti/ti-media-controller-utils/dm814xbm_m3vpss_whole_program_debug.xem3 start
        #modprobe vpss sbufaddr=0xBFB00000 mode=hdmi:1080p-60 i2c_mode=1
        modprobe vpss sbufaddr=0xBFB00000 mode=hdmi:720p-60 i2c_mode=1
        modprobe ti81xxfb vram=0:24M,1:16M,2:6M
        modprobe ti81xxhdmi
      ;;
    stop)
        ....
    *)
        echo "Usage: /etc/init.d/load-hd-firmware.sh {start|stop}"
        exit 1
        ;;
esac


$ ls
S01load-hd-firmware.sh  S10telnetd              S99rmnologin
S02dbus-1               S20syslog
S10dropbear             S99gplv3-notice

/etc/rc5.d# ls -al
drwxr-sr-x    2 root     root          672 Dec 30  2015 .
drwxr-sr-x   35 root     root         5504 Dec 30  2015 ..
lrwxrwxrwx    1 root     root           29 Dec 31 05:23 S01load-hd-firmware.sh -> ../init.d/load-hd-firmware.sh
lrwxrwxrwx    1 root     root           16 Dec 30  2015 S02dbus-1 -> ../init.d/dbus-1
lrwxrwxrwx    1 root     root           18 Dec 31 05:23 S10dropbear -> ../init.d/dropbear
lrwxrwxrwx    1 root     root           17 Dec 31 05:22 S10telnetd -> ../init.d/telnetd
lrwxrwxrwx    1 root     root           16 Dec 31 05:23 S20syslog -> ../init.d/syslog
lrwxrwxrwx    1 root     root           22 Dec 31 05:22 S99gplv3-notice -> ../init.d/gplv3-notice
lrwxrwxrwx    1 root     root           19 Dec 31 05:22 S99rmnologin -> ../init.d/rmnologin


~/dm8148/targetfs/etc/rc5.d$ ll
합계 8
drwxr-sr-x  2 jhlee jhlee 4096 12월 15 16:27 ./
drwxr-sr-x 35 jhlee jhlee 4096 12월 15 14:47 ../
lrwxrwxrwx  1 jhlee jhlee   29 12월 31  2012 S01load-hd-firmware.sh -> ../init.d/load-hd-firmware.sh*
lrwxrwxrwx  1 root  jhlee   16 12월 13 14:42 S02dbus-1 -> ../init.d/dbus-1*
lrwxrwxrwx  1 jhlee jhlee   18 12월 31  2012 S10dropbear -> ../init.d/dropbear*
lrwxrwxrwx  1 jhlee jhlee   17 12월 31  2012 S10telnetd -> ../init.d/telnetd*
lrwxrwxrwx  1 jhlee jhlee   17 12월 31  2012 S20netperf -> ../init.d/netperf*
lrwxrwxrwx  1 jhlee jhlee   16 12월 31  2012 S20syslog -> ../init.d/syslog*
lrwxrwxrwx  1 jhlee jhlee   16 12월 31  2012 S20thttpd -> ../init.d/thttpd*
lrwxrwxrwx  1 jhlee jhlee   18 12월 31  2012 S30pvr-init -> ../init.d/pvr-init*
lrwxrwxrwx  1 jhlee jhlee   22 12월 31  2012 S99gplv3-notice -> ../init.d/gplv3-notice*
lrwxrwxrwx  1 jhlee jhlee   22 12월 31  2012 S99matrix-gui-e -> ../init.d/matrix-gui-e*
lrwxrwxrwx  1 jhlee jhlee   19 12월 31  2012 S99rmnologin -> ../init.d/rmnologin*

  • VPSS 설정방법
Video in/out 설정방법

  http://processors.wiki.ti.com/index.php/DM814X_AM387X_VPSS_Video_Driver_User_Guide_PSP_04.01.00.05#SYSFS_Software_Interfaces

  • VPSS와 VICP Firmware
VPSS와 VICP는 OS즉, BIOS6으로 기반으로한 Firmware를 사용한다.
다만, TI DSP가 C6xx 이 아닌 ARM의 Cortex-M3을 사용하여 TI용으로 별도로 Build 한 다음 Linux Booting 후에 이부분을 Loading 하는 방식으로 동작이 된다.

  http://processors.wiki.ti.com/index.php/EZSDK_Reducing_Size_Of_Media_Controller_Firmware
  • HDMI EDID 분석 
Device에서 아래와 같이 EDID를 분석을 하여 영상의 정보를 확인하자.

$ cat /sys/devices/platform/vpss/display0/edid

  https://en.wikipedia.org/wiki/Extended_Display_Identification_Data#Enhanced_EDID_.28E-EDID.29

  • HDMI 기본 VIDEO TEST 
아래 프로그램을 이용하여 frame buffer를 TEST 해보자.
이제 제대로 설정이 되었다면, /dev/fb0, /dev/fb1 /dev/fb2 test

/home/root/dm814x-evm/usr/share/ti/ti-psp-examples/saFbdevDisplayPan를 이용하여 TEST


$ cd ~/dm8148/targetfs   // device targetfs 이동 
$ cd home/root/dm814x-evm/usr/share/ti/ti-psp-examples
$ ls
ReadMe        minimal_capture   saFbdevDisplay     saFbdevHdmiDisplay    saFbdevScalingDisplay  saLoopBackFbdev  saMmapDisplay     saWatchdog
edma_test.ko  minimal_playback  saFbdevDisplayPan  saFbdevMovingDisplay  saLoopBack             saLoopBackScale  saUserptrDisplay

나머지 기능을 프로그램을 이용하여 다양한 TEST도 해보자.


2. DM8167 관련 경우

RDK 관련사항 수정

$ vi ./dvr_rdk/mcfw/src_linux/mcfw_api/ti_vdis.c
....
                enableConfigExtVideoEncoder = TRUE;
....


12/08/2016

DM814x SDK 설치 및 관련 설정

1. EZSDK 설치

수정중
Memory Map 과 구조도 및 Firmware 이해 필요,
Linux File system 부분 수정 부분

1.1 GCC Tool Chain and SDK Download 

  • arm-2009q1-203-arm-none-linux-gnueabi.bin (Code Sourcery ARM GCC Tool Chain)
  • ezsdk_dm814x-evm_5_05_02_00_setuplinux
  http://www.ti.com/tool/linuxezsdk-davinci

1.2 개발환경구성 

  • 환경변수 재설정
아래의 환경변수는 CROSS_COMPILE과 INSTALL_MOD_PATH 등 Makefile과 Rule.make를
보고 필요한부분을 넣었다.
기본정의 Rule.make에 정의가 되어있으면 동작이 제대로 되어야겠지만,
본인이 원하는 대로 동작이 안된다면, 두 파일을 비교하여 오동작되는 부분을 파악해서
환경변수 고치던지 하는것이 편할 것이다.
나는 source 를 이용하여 아래와 같이 그냥 외부에서 설정을 해놓았다.  

$ vi setPATH.sh
#!/bin/sh
# source setPATH.sh
# INSTALL_MOD_PATH : Kernel Module 
# SYSLINK_INSTALL_DIR : syslink.ko 

export PATH=$PATH:/home/jhlee/dm8148/CodeSourcery/Sourcery_G++_Lite/bin
export EZSDK="${HOME}/dm8148/ti-ezsdk_dm814x-evm_xx_xx_xx_xx" 
export CROSS_COMPILE=arm-none-linux-gnueabi-
export ARCH=arm

export INSTALL_MOD_PATH="${HOME}/dm8148/targetfs"     // Kernel module    

$ source setPATH.sh 

  • 개발환경구성설정 (TI에서 제공)
  1. NFS Server 환경구성 
  2. TFTP 설정 
$ cd ~/dm8148/ti-ezsdk_dm814x-evm_5_05_02_00 
$./setup.sh              // 자동으로 설정 NFS/TFTP 



1.3 EZSDK 설치시 구조 및 빌드방법



  • EZSDK 설치시 구조

$ cd ~/dm8148/ti-ezsdk_dm814x-evm_5_05_02_00 
$ tree -d -L 2 
.
├── bin
├── board-support
│   ├── docs
│   ├── external-linux-kernel-modules
│   ├── host-tools
│   ├── linux-2.6.37-psp04.04.00.01
│   ├── media-controller-utils_3_00_00_05
│   ├── prebuilt-images
│   └── u-boot-2010.06-psp04.04.00.01
├── component-sources
│   ├── bios_6_33_05_46
│   ├── c674x-aaclcdec_01_41_00_00_elf
│   ├── codec_engine_3_22_01_06
│   ├── edma3lld_02_11_05_02
│   ├── framework_components_3_22_01_07
│   ├── graphics-sdk_4.04.00.02
│   ├── gst-openmax_GST_DM81XX_00_07_00_00
│   ├── ipc_1_24_03_32
│   ├── linuxutils_3_22_00_02
│   ├── omx_05_02_00_48
│   ├── osal_1_22_01_09
│   ├── rpe_1_00_01_13
│   ├── slog_04_00_00_02
│   ├── syslink_2_20_02_20
│   ├── uia_1_01_01_14
│   ├── xdais_7_22_00_03
│   └── xdctools_3_23_03_53
├── docs
│   └── licenses
├── dsp-devkit
│   ├── cgt6x_7_3_4
│   ├── docs
│   └── packages
├── etc
├── example-applications
│   ├── am-benchmarks-1.1
│   ├── am-sysinfo-1.0
│   ├── linux-driver-examples-psp04.04.00.01
│   ├── matrix-gui-e-1.3
│   └── omtb_01_00_01_07
├── filesystem
├── linux-devkit
│   ├── arm-none-linux-gnueabi
│   ├── bin
│   ├── etc
│   ├── include
│   ├── lib
│   ├── mkspecs
│   ├── share
│   └── usr
└── usr
    ├── lib
    └── share


$ vi Rules.make  // 아래와 같이 수정 
....
#EXEC_DIR=/home/jhlee/dm8148/targetfs/home/root/dm814x-evm   // 기본으로 이것으로 설정하며, 진행한다. 
EXEC_DIR=/home/jhlee/dm8148/targetfs                         // 필요한 것이 있다면 그 때만 이것으로 설정 
                     // 위와 같이 진행하지 않으면 Filesystem이 필요없는것을 다 포함하게되어서 커진다. 

//예를들어 아래와 같이 진행하면, EXEC_DIR/usr/lib/....   설치되므로 필요할때만 위와 같이 변경 
$ make syslink
$ make syslink_install  

//전체 명령어 확인 및 Install 될 주소 확인                                                                
$ make help

Available build targets are  :

    components_linux               : Build the Linux components
    components_dsp                 : Build the DSP components
    components                     : Build the components for which a rebuild is necessary to enable all other build targets listed below. You must do this at least once upon installation prior to attempting the other targets.
    components_clean               : Remove files generated by the 'components' target

    apps                           : Build all Examples, Demos and Applications
    apps_clean                     : Remove all files generated by 'apps' target
    install                        : Install all Examples, Demos and Applications the targets in /home/jhlee/dm8148/targetfs/home/root/dm814x-evm

    linux-devkit                   : Populate the linux devkit
    dsp-devkit                     : Populate the dsp devkit

    cmem                           : Build the CMEM kernel module
    cmem_clean                     : Remove generated cmem files.
    cmem_install                   : Install cmemk module

    syslink                        : Configure and build SYS Link for HLOS and HLOS without sample examples
    syslink_clean                  : Remove generated SysLink files
    syslink_install                : Install HLOS and RTOS link files

    linux                          : Build Linux kernel uImage and module
    linux_clean                    : Remove generated Linux kernel files
    linux_install                  : Install kernel binary and  modules

    u-boot                         : Build the u-boot boot loader
    u-boot_clean                   : Remove generated u-boot files
    u-boot_install                 : Install the u-boot image

    psp-examples                   : Build the driver examples
    psp-examples_clean             : Remove generated driver example files
    psp-examples_install           : Install the psp examples

    osal                           : Build the OSAL
    osal_clean                     : Remove generated OSAL files

    matrix                         : Build matrix application launcher
    matrix_clean                   : Remove all matrix files
    matrix_install                 : Install matrix

    omx                            : Build OMX and OMX IL Clients
    omx_clean                      : Remove OMX generated files
    omx_install                    : Install OMX IL Clients

    omtb                           : Build OMTB IL Clients
    omtb_clean                     : Remove OMTB generated files
    omtb_install                   : Install OMTB IL Clients

    media-controller-utils         : Build media controller utils
    media-controller-utils_clean   : Remove media controller utils generated files
    media-controller-utils_install : Install media controller utils

    edma3lld                       : Build the EDMA3LLD Libraries
    edma3lld_clean                 : Remove generated EDMA3LLD files

    sgx-driver                     : Build SGX kernel module
    sgx-driver_clean               : Remove SGX generated files
    sgx-driver_install             : Install SGX kernel module

    gstomx                         : Build TI GST OpenMax Plugin
    gstomx_clean                   : Remove TI GST OpenMax generated files
    gstomx_install                 : Install TI GST OpenMax Plugin

    rpe                            : Build Remote Processor Execute
    rpe_clean                      : Remove Remote Processor Execute generated files
    rpe_install                    : Install Remote Processor Execute

    all                            : Rebuild everything
    clean                          : Remove all generated files

    install                        : Install all the targets in 
                            /home/jhlee/dm8148/targetfs/home/root/dm814x-evm // 중요: EXEC_DIR 수정 후 변경됨 


  • TI에서 제공하는 User Manual
  http://processors.wiki.ti.com/index.php/Category:EZSDK

  http://developer.ridgerun.com/wiki/index.php/Getting_Started_Guide_for_DM8148_EVM

  http://processors.wiki.ti.com/index.php/DM814x_AM387x_PSP_User_Guide

  http://processors.wiki.ti.com/index.php/DM814x_AM387x_PSP_User_Guide#Linux_Kernel

1.4 Video TEST

  • MPEG4 HDMI Decoding TEST 
$ gst-launch filesrc location= test1.mp4 ! qtdemux name=mux mux.video_00 ! queue  ! h264parse output-format=1 ! omx_h264dec ! omx_scaler ! omx_ctrl display-mode=OMX_DC_MODE_1080P_30 ! omx_videosink enable-last-buffer=false

  • IP Camera TEST
$ gst-launch -v rtspsrc location=rtsp://192.168.1.168:8556/PSIA/Streaming/channels/2?videoCodecType=H.264 caps="video/x-h264,mapping=/video " ! rtph264depay ! queue ! h264parse ! omx_h264dec ! omx_mdeiscaler name=d d.src_00 ! omx_ctrl display-mode=OMX_DC_MODE_1080P_30 ! omx_videosink enable-last-buffer=false 

$ gst-launch rtspsrc location=rtsp://192.168.1.168:8556/PSIA/Streaming/channels/2?videoCodecType=H.264 ! rtph264depay ! queue ! \
h264parse output-format=1 ! omx_h264dec ! omx_scaler ! omx_ctrl display-mode=OMX_DC_MODE_1080P_30 ! omx_videosink enable-last-buffer=false
  • IP Camera TEST (1080P Resize)
$ gst-launch rtspsrc location=rtsp://192.168.1.168:8556/PSIA/Streaming/channels/2?videoCodecType=H.264  ! rtph264depay ! queue ! h264parse access-unit=true ! queue ! omx_h264dec ! omx_mdeiscaler name=d d.src_00 ! 'video/x-raw-yuv, width=(int)1920, height=(int)1080' ! queue ! omx_ctrl \
display-mode=OMX_DC_MODE_1080P_30 ! gstperf print-fps=true print-arm-load=true ! omx_videosink sync=false enable-last-buffer=false

  • Gstreamer Examples
  https://developer.ridgerun.com/wiki/index.php/Gstreamer_pipelines_for_DM816x_and_DM814x
  https://developer.ridgerun.com/wiki/index.php/Gstreamer_pipelines_for_DM816x_and_DM814x#RTSP_-_Video_H264_1080.4030fps_2

  • DM8168 Firmware Debug
  https://developer.ridgerun.com/wiki/index.php?title=How_to_build_DM8168_M3_Firmware_and_debug_messages

3. KERNEL Config & Build 

위의 CROSS_COMPILE과 ARCH 환경변수가 설정이 되지 않을 경우 매번 설정하면서 실행.
미리 설정된 File은 아래 존재하며 이곳에서 보자.

$ cd ~/dm8148/
$ source setPATH.sh 
$ cd ti-ezsdk_dm814x-evm_5_05_02_00/board-support/linux-2.6.37-psp04.04.00.01
$ ls ./arch/arm/configs/       // 지원되는 Configs 확인    


$ make ti8148_evm_defconfig   // Kernel Config 설정 
$ make menuconfig             // 상위 setPATH.sh를 설정을 안했다면, ARCH=arm 선언하자.
$ make uImage                 // 상위 setPATH.sh를 설정을 안했다면  setARCH=arm 와 CROSS_COMPILE=arm-none-linux-gnueabi- 

$ cp /arch/arm/boot/uImage  /tftpboot/uImage

3.1 Kernel 분석 및 수정 

  • CTAGS와 CSCOPE 생성
vi 에서 소스분석을 더 용이하게 하기 위해서 아래와 같이 설치 및 사용하자.
  http://ahyuo.blogspot.kr/search?q=sudo+apt-get+install+ctags

  http://processors.wiki.ti.com/index.php/TI81xx_PSP_Porting_Guide


$ vi ./arch/arm/mach-omap2/board-ti8148evm.c
....
MACHINE_START(TI8148EVM, "ti8148evm")
        /* Maintainer: Texas Instruments */
        .boot_params    = 0x80000100,
        .map_io         = ti8148_evm_map_io,    // 변경된 device memory map check 
        .reserve         = ti81xx_reserve,
        .init_irq       = ti8148_evm_init_irq,   // 점검 
        .init_machine   = ti8148_evm_init,       // 변경된 device check , EVM과 현재보드와 사용하는 Device가 다름 (HDMI 변경 및 기타 IO및 사용안함)
        .timer          = &omap_timer,       
MACHINE_END


$ make uImage
  CHK     include/linux/version.h
  CHK     include/generated/utsrelease.h
make[1]: `include/generated/mach-types.h'는 이미 갱신되었습니다.
  CALL    scripts/checksyscalls.sh
  CHK     include/generated/compile.h
  LD      vmlinux.o

drivers/built-in.o: In function `pcf8575_ths7375_enable':
notify_shm_drv.c:(.text+0x15f14): multiple definition of `pcf8575_ths7375_enable'
arch/arm/mach-omap2/built-in.o:gpmc-nand.c:(.text+0x9ce8): first defined here
drivers/built-in.o: In function `vps_ti816x_set_tvp7002_filter':
notify_shm_drv.c:(.text+0x15f8c): multiple definition of `vps_ti816x_set_tvp7002_filter'
arch/arm/mach-omap2/built-in.o:gpmc-nand.c:(.text+0x9d60): first defined here
drivers/built-in.o: In function `vps_ti816x_select_video_decoder':
notify_shm_drv.c:(.text+0x15f78): multiple definition of `vps_ti816x_select_video_decoder'
arch/arm/mach-omap2/built-in.o:gpmc-nand.c:(.text+0x9d4c): first defined here
drivers/built-in.o: In function `ti816x_pcf8575_init':
notify_shm_drv.c:(.text+0x15f50): multiple definition of `ti816x_pcf8575_init'
arch/arm/mach-omap2/built-in.o:gpmc-nand.c:(.text+0x9d24): first defined here
drivers/built-in.o: In function `pcf8575_ths7360_sd_enable':
notify_shm_drv.c:(.text+0x15f28): multiple definition of `pcf8575_ths7360_sd_enable'
arch/arm/mach-omap2/built-in.o:gpmc-nand.c:(.text+0x9cfc): first defined here
drivers/built-in.o: In function `pcf8575_ths7360_hd_enable':
notify_shm_drv.c:(.text+0x15f3c): multiple definition of `pcf8575_ths7360_hd_enable'
arch/arm/mach-omap2/built-in.o:gpmc-nand.c:(.text+0x9d10): first defined here
drivers/built-in.o: In function `ti816x_pcf8575_exit':
notify_shm_drv.c:(.text+0x15f64): multiple definition of `ti816x_pcf8575_exit'
arch/arm/mach-omap2/built-in.o:gpmc-nand.c:(.text+0x9d38): first defined here
make: *** [vmlinux.o] 오류 1

$ arm-none-linux-gnueabi-readelf -s arch/arm/mach-omap2/built-in.o | grep -r pcf8575_ths7375_enable
  2521: 00009ce8    20 FUNC    GLOBAL DEFAULT    1 pcf8575_ths7375_enable

$ arm-none-linux-gnueabi-readelf -s drivers/built-in.o | grep -r pcf8575_ths7375_enable
 21182: 00015f14    20 FUNC    GLOBAL DEFAULT    1 pcf8575_ths7375_enable

$ find . -name '*.o' | sed -e 's/o$/c/g' | xargs grep -rs pcf8575_ths7375_enable
./drivers/video/ti81xx/vpss/dctrl.c:  r = pcf8575_ths7375_enable(TI816X_THSFILTER_ENABLE_MODULE);

$ grep -r pcf8575_ths7375_enable .
이진파일 ./drivers/built-in.o 와(과) 일치
이진파일 ./drivers/video/built-in.o 와(과) 일치
이진파일 ./drivers/video/ti81xx/built-in.o 와(과) 일치
./drivers/video/ti81xx/vpss/dctrl.c:  r = pcf8575_ths7375_enable(TI816X_THSFILTER_ENABLE_MODULE);
이진파일 ./drivers/video/ti81xx/vpss/dctrl.o 와(과) 일치
이진파일 ./drivers/video/ti81xx/vpss/built-in.o 와(과) 일치
이진파일 ./drivers/video/ti81xx/vpss/vpss.o 와(과) 일치
./tags:pcf8575_ths7375_enable arch/arm/mach-omap2/board-ti8168evm.c /^EXPORT_SYMBOL(pcf8575_ths7375_enable);$/;" v
./tags:pcf8575_ths7375_enable arch/arm/mach-omap2/board-ti8168evm.c /^int pcf8575_ths7375_enable(enum ti816x_ths_filter_ctrl ctrl)$/;" f
./tags:pcf8575_ths7375_enable arch/arm/mach-omap2/include/mach/board-ti816x.h /^int pcf8575_ths7375_enable(enum ti816x_ths_filter_ctrl ctrl)$/;" f
./arch/arm/mach-omap2/include/mach/board-ti816x.h:int pcf8575_ths7375_enable(enum ti816x_ths_filter_ctrl ctrl);
./arch/arm/mach-omap2/include/mach/board-ti816x.h:int pcf8575_ths7375_enable(enum ti816x_ths_filter_ctrl ctrl)
이진파일 ./arch/arm/mach-omap2/built-in.o 와(과) 일치
./arch/arm/mach-omap2/board-ti8168evm.c:int pcf8575_ths7375_enable(enum ti816x_ths_filter_ctrl ctrl)
./arch/arm/mach-omap2/board-ti8168evm.c:EXPORT_SYMBOL(pcf8575_ths7375_enable);
이진파일 ./arch/arm/mach-omap2/ti81xx_vpss.o 와(과) 일치


$ make menuconfig   // 필요 module을 yes로 변경 및 필요 없은 것들을 제거. 

$ make uImage
  CHK     include/linux/version.h
  CHK     include/generated/utsrelease.h
make[1]: `include/generated/mach-types.h'는 이미 갱신되었습니다.
  CALL    scripts/checksyscalls.sh
  CHK     include/generated/compile.h
  LD      drivers/built-in.o
drivers/media/built-in.o: In function `vps_ti816x_set_tvp7002_filter':        // 이곳에서 에러가 나서 현재 complier가 혼동하는 것 같음 
ti81xxvin_lib.c:(.text+0x30eac): multiple definition of `vps_ti816x_set_tvp7002_filter'
drivers/video/built-in.o:sii9022a_drv.c:(.text+0x72d0): first defined here
drivers/media/built-in.o: In function `pcf8575_ths7375_enable':
ti81xxvin_lib.c:(.text+0x30e34): multiple definition of `pcf8575_ths7375_enable'
drivers/video/built-in.o:sii9022a_drv.c:(.text+0x7258): first defined here
drivers/media/built-in.o: In function `ti816x_pcf8575_init':
ti81xxvin_lib.c:(.text+0x30e70): multiple definition of `ti816x_pcf8575_init'
drivers/video/built-in.o:sii9022a_drv.c:(.text+0x7294): first defined here
drivers/media/built-in.o: In function `ti816x_pcf8575_exit':
ti81xxvin_lib.c:(.text+0x30e84): multiple definition of `ti816x_pcf8575_exit'
drivers/video/built-in.o:sii9022a_drv.c:(.text+0x72a8): first defined here
drivers/media/built-in.o: In function `pcf8575_ths7360_sd_enable':
ti81xxvin_lib.c:(.text+0x30e48): multiple definition of `pcf8575_ths7360_sd_enable'
drivers/video/built-in.o:sii9022a_drv.c:(.text+0x726c): first defined here
drivers/media/built-in.o: In function `vps_ti816x_select_video_decoder':
ti81xxvin_lib.c:(.text+0x30e98): multiple definition of `vps_ti816x_select_video_decoder'
drivers/video/built-in.o:sii9022a_drv.c:(.text+0x72bc): first defined here
drivers/media/built-in.o: In function `pcf8575_ths7360_hd_enable':
ti81xxvin_lib.c:(.text+0x30e5c): multiple definition of `pcf8575_ths7360_hd_enable'
drivers/video/built-in.o:sii9022a_drv.c:(.text+0x7280): first defined here
make[1]: *** [drivers/built-in.o] 오류 1
make: *** [drivers] 오류 2

$ vi drivers/media/.built-in.o.cmd  // compile되어 만들어지는 build-in.o를 다시 분석  (video 가 dm8168로 인식)

$ find . -name plat   //             plat/cpu.h 찾아 설정이 제대로 있는지 확인 
./drivers/dsp/syslink/omap_notify/plat
./arch/arm/plat-pxa/include/plat
./arch/arm/plat-s5p/include/plat
./arch/arm/plat-versatile/include/plat
./arch/arm/plat-samsung/include/plat
./arch/arm/plat-omap/include/plat
./arch/arm/plat-nomadik/include/plat
./arch/arm/plat-spear/include/plat
./arch/arm/plat-s3c24xx/include/plat
./arch/arm/plat-orion/include/plat


$ vi ./arch/arm/mach-omap2/ti81xx_vpss.c 

$ vi ./arch/arm/mach-omap2/devices.c

$ vi arch/arm/mach-omap2/board-flash.c

  • 문제점 분석 및 해결
아래와 같이 빌드된 된 source만 찾아 grep으로 이를 검색

$ find . -name '*.o' | sed -e 's/o$/c/g' | xargs grep -rs omap_mux_init

  http://ahyuo.blogspot.kr/search?q=xargs

상위문제 Linux Kernel 사용이 되는 필요없는 Config를 제거하여 문제해결

현재 나의 Board가 EVM이 아니기 때문에 Kernel config를 점검해가면서 수정해서
필요 없는 부분을 제거하고 변경하고 TEST 하자.

3.2 NAND 변경시 관련설정

Device Drivers -> Memory Technology Devices

  http://processors.wiki.ti.com/index.php/Flash_configuration_in_the_Kernel#Enabling_NAND_Support

  http://e2e.ti.com/support/dsp/davinci_digital_media_processors/f/716/p/177166/641847#641847

12/07/2016

Uboot Nand Command 와 설정확인

1. Uboot env 설정 확인 및 설정 

TI-Davinci Series를 다시 사용할줄을 몰랐으며, 이 오래된 모델을 대학원 교육용으로 팔기위해서 간단히 설정정리하고자 한다.

  • Board Information (RAM Info)
U-Boot# bdinfo
arch_number = 0x00000BBC
env_t       = 0x00000000
boot_params = 0x80000100
DRAM bank   = 0x00000000
-> start    = 0x80000000
-> size     = 0x40000000
DRAM bank   = 0x00000001
-> start    = 0xC0000000
-> size     = 0x40000000
ethaddr     = d0:ff:50:af:35:52
ip_addr     = 192.168.1.78
baudrate    = 115200 bps

  • NAND info 
U-Boot# nand info
Device 0: nand0, sector size 128 KiB

  • Uboot default env info
U-Boot# pri
bootdelay=3
baudrate=115200
autoload=yes
verify=yes
bootfile=uImage
ramdisk_file=ramdisk.gz
loadaddr=0x81000000
script_addr=0x80900000
loadbootscript=fatload mmc 0 ${script_addr} boot.scr
bootscript= echo Running bootscript from MMC/SD to set the ENV...; source ${script_addr}
ethaddr=d0:ff:50:af:35:52
ethact=cpsw
ipaddr=192.168.219.201
serverip=192.168.219.112
bootcmd=nand read 0x81000000 0x00280000 0x300000;bootm 0x81000000
bootargs=console=ttyO0,115200n8 earlyprintk noinitrd rootwait=1 rw ubi.mtd=4,2048 rootfstype=ubifs root=ubi0:rootfs notifyk.vpssm3_sva=0xBF900000 mem=364M@0x80000000 mem=320M@0x9FC00000 mem=1023M@0xC0000000 vmalloc=500M ip=none vram=50M ti814xfb.vram=0:24M,1:16M,2:6M

DM368 IPNC :>pri
bootdelay=4
baudrate=115200
bootfile="uImage"
setboot=setenv bootargs $(bootargs)
broadcast=192.168.0.255
gateway=192.168.0.1
ethaddr=00:0C:0C:A0:04:22
verify=no
filesize=2100000
fileaddr=82000000
netmask=255.255.255.0
ipaddr=192.168.0.207
serverip=192.168.0.210
bootcmd=nboot 0x80700000 0 0x500000;bootm 0x80700000
bootargs=mem=48M console=ttyS1,115200n8 noinitrd ip=192.168.1.168:192.168.1.210:192.168.1.1:255.255.255.0:::off rw ubi.mtd=3,2048 rootfstype=ubifs root=ubi0:rootfs cmemk.phys_start=0x83000000 cmemk.phys_end=0x88000000 cmemk.phys_start_1=0x00001000 cmemk.phys_end_1=0x00008000 cmemk.pools_1=1x28672 cmemk.allowOverlap=1 cmemk.useHeapIfPoolUnavailable=1 nohz=off highres=off clocksource=acpi_pm lpj=1077248 eth=00:0C:0C:A0:04:22
stdin=serial
stdout=serial
stderr=serial
ver=U-Boot 1.3.4 (Jun  5 2013 - 12:45:48) DM368-IPNC-5.1.0

Environment size: 843/131068 bytes


CPSW관련
  http://processors.wiki.ti.com/index.php/AM335x_CPSW_(Ethernet)_Driver's_Guide

  • Uboot Config 
U-BOOT는 환경설정은 Device의 의존적인 환경변수존재하며, Uboot도 Kernel Config처럼 Config를 설정하여 추가하고 싶을 설정,
즉 Command를 추가가능하다. 또한 Config 설정에서 각각의 프롬프트 이름을 비롯하여 default env 설정부분을 Uboot Source에서 직접 변경가능하다.

아래는 기본적인 테스트이며, 최종으로 본인의 default env 설정확정되면, Uboot Source에서 default env 관련 부분을 수정하도록 하자.

1.1. Uboot 에서 Kernel 부팅시 문제사항 정리 

  • U-BOOT에서 uncompressing 한 후 바로 멈춤경우
Bytes transferred = 2720236 (2981ec hex)
## Booting kernel from Legacy Image at 81000000 ...
   Image Name:   Linux-2.6.37
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    2720172 Bytes = 2.6 MiB
   Load Address: 80008000
   Entry Point:  80008000
   Verifying Checksum ... OK
   Loading Kernel Image ... OK
OK

Starting kernel ...

Uncompressing Linux... done, booting the kernel.  


  • 기본Boot 문제해결방법 (이외방법은 아래 사이트 참조)
Serial 설정 문제확인
bootargs 설정문제 해결하기위해서 uboot에 rootwait를 추가.

printenv bootargs
bootargs=console=ttyS2,115200n8 root=/dev/mmcblk0p2 rw rootwait

세부사항은 kernel argument 참조
  https://linux-sunxi.org/Kernel_arguments

  • 일반적인 Boot 문제사항들 (아래사이트 확인) 
일반적으로 boot 시 발생하는 문제사항 정리
  http://processors.wiki.ti.com/index.php/Kernel_-_Common_Problems_Booting_Linux
bootmem 에러나서 관련내용
  http://jake.dothome.co.kr/bootmem/

  • U-BOOT NAND 문제사항
   jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at
   https://e2e.ti.com/support/dsp/davinci_digital_media_processors/f/716/t/244611
   http://naito.tistory.com/entry/jffs2scaneraseblock-Magic-bitmask-0x1985-not-found-at-0x0000fcac-0x0b45-instead

  • NXP에서 제공하고 U-Boot Quick Reference
IMX6을 하면서 읽게되었지만, 역시 문서가 쉽고 이해하기가 쉬운거 같다
  http://www.nxp.com/files/32bit/doc/quick_ref_guide/MEDIA5200UBPG/MEDIA5200UBPG.pdf


1.2. Uboot 기본환경변수로 테스트  

Uboot가 booting 한 후 Uboot의 bootdelay 설정시간이후에 Uboot의 bootcmd는 자동실행되어 Uboot의 bootargs를 kernel에 전달하여 Kernel Boot를 진행한다.


  • DM368 설정 (bootcmd)
DM368 IPNC :> setenv verify no                                  // CRC에러 
DM368 IPNC :> setenv bootcmd 'nboot 0x80700000 0 0x500000;bootm 0x80700000'

  • DM8147 설정(bootargs)
아래와 같이 ${} 본인이 원하는 환경변수 별도로 이용하여 각 설정을 변경

U-Boot# setenv bootargs_ubifsrw "console=ttyO0,115200n8 earlyprintk noinitrd rootwait=1 rw ubi.mtd=4,2048 rootfstype=ubifs root=ubi0:rootfs notifyk.vpssm3_sva=0xBF900000 mem=364M@0x80000000 mem=320M@0x9FC00000 mem=1023M@0xC0000000 vmalloc=500M ip=none vram=50M ti814xfb.vram=0:24M,1:16M,2:6M"
U-Boot# setenv bootargs_ubifsro "console=ttyO0,115200n8 earlyprintk noinitrd rootwait=1 ro ubi.mtd=4,2048 rootfstype=ubifs root=ubi0:rootfs notifyk.vpssm3_sva=0xBF900000 mem=364M@0x80000000 mem=320M@0x9FC00000 mem=1023M@0xC0000000 vmalloc=500M ip=none vram=50M ti814xfb.vram=0:24M,1:16M,2:6M"
U-Boot# setenv bootargs "${bootargs_ubifsro}" 
U-Boot# setenv bootargs "${bootargs_ubifsro} ${serverip}"  

bootcmd 인 경우 좀 특별한데 명령어들을 자동으로 실행해주는 환경변수이므로 보다 주의해서 작성하자.
Uboot는 기본적인 Shell 처럼 간단한 Uboot Script도 작성가능하므로 이를 최대이용
  1. 기본적으로 다른 환경변수는 표시는다음과 같이 한다.    ${ name }
  2. Command 구분자 ';' 세미콜론을 사용한다. 
  3. bootcmd에는 run 명령어로 다른 환경변수를 실행가능하다. 
  4. bootcmd에는 기본명령어인 setenv 비롯하여 uboot command가 실행가능
  5. 이외 외부 script 및 if 문도 사용가능        

* 주의사항  setenv or set 할 경우 "" or '' 권하며, 하지 않아도 설정은 되지만 간혹 제대로 설정이 되지 스페이스문제로 설정이 안되는 경우가 발생한다. 

1.3. Uboot Network/Video 기본설정 

bootargs 설정을 NFS로 변경하기 위해서 아래와 같이 각각 변경을 해주고 최후에 bootargs의 root를 network로 설정

NFS설정을 위해 아래와 같이 Uboot에 Network 기본설정 아래와 같이 해준다.
  • Network 환경설정 및 확인 
U-Boot# set serverip 192.168.1.100
U-Boot# set ipaddr 192.168.1.39
U-Boot# set gatewayip 192.168.1.1
U-Boot# set netmask 255.255.255.0
U-Boot# set hostname "jhlee-VirtualBox"
U-Boot# set nfspath "/home/jhlee/dm8148/targetfs"

DM368 IPNC :> setenv ethaddr 00:0C:0C:A0:04:22
DM368 IPNC :> setenv ipaddr 192.168.1.20
DM368 IPNC :> setenv gateway 192.168.1.1
DM368 IPNC :> setenv serverip 192.168.1.100
DM368 IPNC :> setenv netmask 255.255.255.0


  • Host에서 Hostname 확인 
 jhlee@jhlee-VirtualBox:~/dm8148$ hostname
jhlee-VirtualBox


* 주의사항 
  1. set은 setenv와 동일 (가끔씩 set이 동작이 안될때는 setenv로 변경)
  2. hostname 가급적 server이름을 설정해야겠지만, 아무거나 설정해도 무방하다.
  3. nfs mount test는 server에서 반드시 TEST 해보자. 

  • DM814x Video 설정 (2G M설정)
  1. mem =xxx : linux memory 설정
  2. vpssm3

set videoset "notifyk.vpssm3_sva=0xBF900000 mem=364M@0x80000000 mem=320M@0x9FC00000 mem=1023M@0xC0000000 vmalloc=500M vram=50M ti814xfb.vram=0:24M,1:16M,2:6M"

  1. 기본설정확인 (Start 0x80000000  : Size : 512M or 1024M or 2048M) 
  2. 현재 2GM사용하지만, 512M와 1024M 만 지원 (1024 Memory Map 선택)
  3. 0xC0000000 이후 부터 Linux로 모두 할당 
  4. Memory를 연속적으로 설정하지 않았기때문에, 이부분 설정을 따로 해야할 것 같다.
설정시 아래의 Memory Map을 반드시 참조.
  http://processors.wiki.ti.com/index.php/EZSDK_Memory_Map
  http://lxr.linux.no/linux/mm/Kconfig


1.4 Uboot의 bootargs 와 bootcmd 

  • UBIFS 와 NFS Boot Mode (bootargs의 분할)
현재 UBIFS를 RW모드와 RO모드 두개 설정하며, NFS도 일반모드 설정과 뒤에 다시 MEM 설정하기에 이를 지운다.


  • bootargs를 여러개 옵션으로 분할
U-Boot# set bootarg_consol "console=ttyO0,115200n8"
U-Boot# set bootarg_debug  "earlyprintk rootwait=1"
U-Boot# set bootarg_etc    "noinitrd"  
U-Boot# set bootarg_ubifsro  "ro ubi.mtd=4,2048 rootfstype=ubifs root=ubi0:rootfs"
U-Boot# set bootarg_ubifsrw "rw ubi.mtd=4,2048 rootfstype=ubifs root=ubi0:rootfs"
U-Boot# set bootarg_nfs "rw root=/dev/nfs nfsroot=${serverip}:${nfspath},nolock"
U-Boot# set bootarg_net "ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:${hostname}:eth0:off"
U-Boot# set bootarg_netnone "ip=none" 

  • bootargs를 조합하여 설정진행 
setnenv bootargs를 상위 변수들을 조합하여 재설정

U-Boot# setenv args_nfs 'setenv bootargs ${bootarg_consol} ${bootarg_debug} ${bootarg_etc}  ${bootarg_nfs} ${bootarg_net} ${videoset}'
U-Boot# setenv args_ubiro 'setenv bootargs ${bootarg_consol} ${bootarg_debug} ${bootarg_etc}  ${bootarg_ubifsro} ${bootarg_netnone} ${videoset}'
U-Boot# setenv args_ubirw 'setenv bootargs ${bootarg_consol} ${bootarg_debug} ${bootarg_etc}  ${bootarg_ubifsrw} ${bootarg_netnone} ${videoset}'

  • bootargs를 UBIFS로 직접설정
DM368 IPNC :> setenv bootargs mem=48M console=ttyS1,115200n8 noinitrd ip=192.168.1.168:192.168.1.210:192.168.1.1:255.255.255.0:::off rw ubi.mtd=3,2048 rootfstype=ubifs root=ubi0:rootfs cmemk.phys_start=0x83000000 cmemk.phys_end=0x88000000 cmemk.phys_start_1=0x00001000 cmemk.phys_end_1=0x00008000 cmemk.pools_1=1x28672 cmemk.allowOverlap=1 cmemk.useHeapIfPoolUnavailable=1 nohz=off highres=off clocksource=acpi_pm lpj=1077248 eth=00:0C:0C:A0:04:22

  • bootargs를 NFS로 직접설정
  1. nfsrootdebug: nfs debug 가능
  2. rootdelay=4: filesystem mount 시점을 조절가능
  3. earlyprintk: KERNEL 의 CONFIG_EARLY_PRINTK=y 설정후 가능
  4. quiet: 에러 이외의 메세지를 보고 싶지 않다면 사용

DM368 IPNC :> setenv bootargs 'console=ttyS1,115200n8 rw mem=48M root=/dev/nfs nfsrootdebug rootdelay=4 nfsroot=192.168.1.100:/home/jhlee/dm368/mt5/Source/ipnc_rdk/target/filesys_dm368,nolock mem=48M cmemk.phys_start="0x83000000" cmemk.phys_end="0x88000000" cmemk.phys_start_1="0x00001000" cmemk.phys_end_1="0x00008000" cmemk.pools_1="1x28672" cmemk.allowOverlap=1 eth=00:0C:0C:A0:04:22 ip=192.168.1.168 nohz=off highres=off clocksource=acpi_pm lpj=1077248 earlyprintk'

NFS Boot Mode
  https://www.kernel.org/doc/Documentation/filesystems/nfs/nfsroot.txt
Kernel Argument (bootargs)
  https://www.kernel.org/doc/Documentation/kernel-parameters.txt

  • bootcmd의 분할과 bootargs 설정 
  1. dhcp : dhcp client로 동작 tftp로 uImage가져온다.
  2. autoload: dhcp에서 자동으로 tftp로 uImage 가져오는 작업을 막는다.
  3. loadaddr: tftp 할 경우 loadaddr주소
  4. tftp or tftpboot: tftp로 data를 가져온다.

아래와 같이 다양한 bootcmd를 지원가능하도록  분할하여 쉽게 구성하도록하자

U-Boot# set autoload no
U-Boot# set loadaddr 0x81000000

U-Boot# set bootcmd_nfs1 'dhcp;run args_nfs; tftp uImage-dm814x-evm.bin;bootm'
U-Boot# set bootcmd_nfs2 'dhcp;run args_nfs; tftp 0x81000000 uImage;bootm'
U-Boot# set bootcmd_nfs3 "dhcp;run args_nfs; tftpboot uImage-dm814x-evm.bin;bootm"

U-Boot# set bootcmd_nfs  'run args_nfs; tftp uImage;bootm'
U-Boot# set bootcmd_ubi  "run args_ubirw;nand read 0x81000000 0x00280000 0x300000;bootm 0x81000000"
U-Boot# set bootcmd_ubi_me  'run args_ubirw; tftp uImage;bootm'

  •  bootcmd의 NFS/UBI_ME/UBI 설정
U-Boot# set bootcmd "run bootcmd_nfs"
U-Boot# set bootcmd "run bootcmd_ubi_me"
U-Boot# set bootcmd "run bootcmd_ubi"

  • U-BOOT의 환경변수 설명 (반드시 확인)
  http://www.denx.de/wiki/DULG/UBootEnvVariables
  http://www.denx.de/wiki/view/DULG/UBootEnvVariables

  • U-BOOT NFS 환경설정 
  http://processors.wiki.ti.com/index.php/DM814x_AM387x_PSP_U-Boot#Environment_Settings_for_NFS_Filesystem
  http://www.denx.de/wiki/publish/DULG/to-delete/LinuxNfsRoot.html


2. Board 의 정보파악 후 검증

  • Memory info 
Memory Start Address 와 Memory Size를 bdinfo로 파악하자.
이 정보가 잘못되었다면, datasheet를 이용하여 파악하자. (Memory Map)

  • NAND info 
Nand의 Memory Map 주소와 각 영역의 Size를 파악하자.
제대로 동작한다면, Kernel에서 mtd에서 알려준다.

 
NAND device: Manufacturer ID: 0x2c, Chip ID: 0xcc (Micron )
Creating 5 MTD partitions on "omap2-nand.0":
0x000000000000-0x000000020000 : "U-Boot-min"
0x000000020000-0x000000260000 : "U-Boot"
0x000000260000-0x000000280000 : "U-Boot Env"
0x000000280000-0x0000006c0000 : "Kernel"
0x0000006c0000-0x000020000000 : "File System"

Kernel command line: console=ttyO0,115200n8 earlyprintk noinitrd rootwait=1 rw ubi.mtd=4,2048 rootfstype=ubifs root=ubi0:rootfs notifyk.vpssm3_sva=0xBF900000 mem=364M@0x80000000 mem=320M@0x9FC00000 mem=1023M@0xC0000000 vmalloc=500M ip=none vram=50M ti814xfb.vram=0:24M,1:16M,2:6M

nand page size : 2048


  • 기본검증방법 
Memory Size를 정확히 파악한 후 Image의 size를 생각하여, 두 Memory 주소를 얻는다.
본인은 1G Memory이며, 0x8000 0000 : DDR START ADDR
                                0x4000 0000 : 1 G

0x81000000  부터 U-BOOT Application을 사용가능하다고, U-BOOT msg에서 파악.
0xA0000000  Size : 0x20000000 : 256M

위의 nand address를 파악해서 이제 검증시작하자.

  https://processors.wiki.ti.com/index.php/Booting_Linux_kernel_using_U-Boot

2.1 Uboot의 Memory TEST

Uboot에서 사용해보니, 너무느리며, 비효율적이다. 만약 시간이 많다면, 사용하고, 시간이 없다면, tftpboot kernel을 이용하여 DRAM을 검증하자.
그리고, NFS System도 같이 이용한다면 더욱 좋을 것 같다.

  • Uboot의 memory test 
U-Boot#  mtest 0x81000000 
U-Boot#  mtest 0x81000000  0x82000000


2.2 Uboot의 NAND TEST

NAND의 Test의 목적은 bad block문제로 인하여 nand boot가 제대로 안되는 것인지 파악하고, NAND의 read/write가 제대로 동작이 되는지를 확인하는 것이다.
일단 nand info를 통해 nand 기본정보를 파악하고, bad block이 scrub 이 되었는지  확인해보자.

nand bad를 해보면 bad block 정보를 읽어 표시해준다.
nand createbbt 명령어가 없을 경우 최근 version uboot는 이 명령어가 사라져 버리고 자동으로 scan해서 만들어 버리는 것 같다.
Uboot version마다 다를수 있으므로, 주의하자

2.3 NAND Image 기본검증

일단 tftpboot를 통해서 kernel의 Image 검증한 후 각각의 NAND Read/Write를 하여 문제없는지 확인하자.

  • TFTPBOOT TEST
DM368 IPNC :> tftpboot 0x80007FC0 dm368ipnc/uImage_ipnc_dm368
DM368 IPNC :> bootm 0x80007FC0;

  • How To update KERNEL & Filesystem
DM368 IPNC :> tftpboot 0x80700000 dm368ipnc/uImage_ipnc_dm368
DM368 IPNC :> tftpboot 0x82000000 dm368ipnc/ipnc_dm368_ubifs

DM368 IPNC :> nand erase 0x500000 0x400000               // NAND ERASE 4MB  
DM368 IPNC :> nand write 0x80700000 0x500000 0x400000    // KERNEL WRITE 4MB

DM368 IPNC :> nand erase 0x900000 0x2800000              //NAND ERASE 4MB
DM368 IPNC :> nand write 0x82000000 0x900000 0x2800000   //FS  WRITE 40MB


  • NAND Image 검증
DM368 IPNC :> tftpboot 0x80700000 dm368ipnc/uImage_ipnc_dm368
DM368 IPNC :> nand read 0x82000000 0x500000 0x400000   // KERNEL READ 4MB
DM368 IPNC :> cmp 0x80700000 0x82000000  0x38a420      // check tftpboot 

상위와 동일함
U-Boot#  tftp 0x81000000 uImage
Bytes transferred = 2215324 (21cd9c hex) 

U-Boot#  nand read 0xA0000000 0x280000 0x21cd9c 

// 553831 = 2215324/4 bytes 

U-Boot#  cmp   0x81000000 0xA0000000 553831
U-Boot#  cmp.l 0x81000000 0xA0000000 553831
 
word at 0x8121cd9c (0x605f9029) != word at 0x8221cd9c (0xffffffff)
Total of 553831 words were the same 

1/17/2016

DM81xx Gstreamer-PlugIns (3rd Party PlugIn)

1. DM81xx 에서 제공하는 Gstream 기본구조  

TI에서 제공하는 3rd Party PlugIns들이며 이를 이해하기위해서는 DM81xx의 기본구조를 알아야한다.
DM81xx의 기본구조는 OMX (Open Max API)에 SysLink Driver에 연결이 되어 아래와 같이
Control 한다.
그리고, Frame buffer와 Video for Linux로 Display와 Video Capture를 Linux에서 진행을 한다.

아래와 같이 중요한 Video Encode와 Display에 관한 중요한 Driver들이다.
만약 Video Display를 LCD or HDMI를 할 경우에 따라 관련 Driver 역시 중요할 것이다.
  1. SYSLINK : HDVPSS와 HDVICP 및 DSP Interface 
  2. HDVPSS : Video Capture 와 Display 담당 
  3. HDVICP2 : HDVICP Version2 로  Video Encode와 Decode를 담당.



1.2 DISPLAY 선택 작업 

미리 VPSS의 DISPLAY를 정한다음에 Gstreamer를 이용하여 하는 것이 좋다.
물론 TI는 Gstreamer에서 DISPLAY 선택이 되는 것 같은데 완벽하지 않은 것 같다.

이 부분은 sys file를 이용하여 변경하며.
/etc/init.d/load-hd-firmware.sh  부분에서 초기에 다 설정을 한다.


  1. HDMI일 경우 dipsplay0을 사용 ( 이 부분 Datasheet 참고 DM814x) 
  2. LCD일 경우 display1을 사용 


$ echo 0 > /sys/devices/platform/vpss/display0/enabled 
$ echo 1080i-60 > /sys/devices/platform/vpss/display0/mode 
$ echo 1 > /sys/devices/platform/vpss/display0/enabled


1.3 DM81xx Gstream MPEG4 Decoding 기본예제



Gstream의 MPEG4 File의 Decoding 의 Pipeline을 보자.

  • 아래는 현재 HDMI로 MPEG4를 재생을 했다. 


$ gst-launch filesrc location= test1.mp4 ! qtdemux name=mux mux.video_00 ! queue  ! \
h264parse output-format=1 ! omx_h264dec ! omx_scaler !\ 
omx_ctrl display-mode=OMX_DC_MODE_1080P_30 ! omx_videosink enable-last-buffer=false



간단히 분석해보면,  (OMX는 SYSLINK를 통하여 HDVICP2 or HDVPSS로 연결된다)

  1. test1.mp4 읽어  qtdemux 에 전달 
  2. qtdemux에서 mov file을 구조를 분석하여 video 추출 하여 h264parse 전달 
  3. h264parse 이를 outformat을 설정 omx_h264dec전달 (HDVICP2) 
  4. omx_h264dec는 decoding을 한후 omx_scaler 전달 
  5. omx_scaler는 이를 화면을 resize하고 omx_ctrl에 전달. 
  6. omx_ctrl은 display모드 설정 ( LCD or HDMI 해상도) 하고 omx_videosink에 전달

아래의 사이트에서 TI에서 제공하는 3rd Party Plug-In의 Elements 자세히 알아보자.
중요하게 볼것이 Input과 output이다. 화면이 변경이 되기도 한다.

  http://wiki.tiprocessors.com/index.php/DM81xx_Gstreamer_Plugin
  http://processors.wiki.ti.com/index.php/DM81xx_Gstreamer_Plugin

  일반적인 질문사항
  http://wiki.tiprocessors.com/index.php/DM81xx_Gstreamer_FAQ

  추가 확장된 Driver
  http://processors.wiki.ti.com/index.php/DM81xx_AM38xx_Adding_External_Decoders_to_V4L2_Capture_Driver


1.4 Gstreamer 기본 MPEG TS 예제 

DM81xx가 Booting 후 설정되어야 환경변수이지만, 현재 불필요한 것 같다.
gstreamer가 전체 /usr/bin으로 포함되어져 있어 불필요하다.
만약 분리되었을 경우 아래와 같은 주소로 있는지 확인하자

export GST_REGISTRY=/tmp/gst_registry.bin
export LD_LIBRARY_PATH=/opt/gstreamer/lib
export GST_PLUGIN_PATH=/opt/gstreamer/lib/gstreamer-0.10
export PATH=/opt/gstreamer/bin:$PATH
export GST_PLUGIN_SCANNER=/opt/gstreamer/libexec/gstreamer-0.10/gst-plugin-scanner =


  http://processors.wiki.ti.com/index.php/DM81xx_Gstreamer_Pipelines

1.5 Gstreamer RTSP 적용 예제 

IP Camera 혹은 Settopbox라든지 다른 Device와 연동을 할 경우 많이 필요하다.
처음 VLC로 TEST를 하면 좋다.


  • RTSP Client로 사용할 경우 
  https://developer.ridgerun.com/wiki/index.php/Gstreamer_pipelines_for_DM816x_and_DM814x


  • RTSP Server로 사용할 경우 
  https://developer.ridgerun.com/wiki/index.php/DM81xx_GStreamer_Pipelines_-_SDK_Turrialba


RTSP Default TEST

$ gst-launch rtspsrc location=rtsp://172.24.136.242:5544/test \
! rtph264depay ! h264parse access-unit=true ! omx_h264dec ! omx_scaler \
! omx_ctrl display-mode=OMX_DC_MODE_1080P_60 ! omx_videosink sync=false 


1.6 Gstreamer Video Crop and Scaling 예제 

조금 복잡한 기능이며, Scaling 즉 Resizing까지 지원이 되며, 이것을 이용하며,
4Channel Video Mux도 가능하다.

  https://developer.ridgerun.com/wiki/index.php/Video_crop_and_scaling_with_DM816x_and_DM814x

8/17/2015

Uboot DRAM 설정 (DM812x)

1. DM8128 의 EVM의 구성 

  • EVM Board 구성
  1. BOARD-NAME: DM8128-IPNC
  2. BOARD-VER   :
  3. RAM Type     : K4B1G1646E
  4. RAM Size      :  2 x (16x 64M, 1Gb) = 2Gb = 256MB 

이 오래된 모델을 대학원 교육용으로 팔기위해서 간단히 설정정리한다.

2. RAM의 기본이해 및 다른 SOC Setting 

TI의 Sitara 기준으로 간단히 설명
  https://ahyuo79.blogspot.com/search/label/RAM-DRAM

2.1 Uboot 설정 및 CCS TEST

아래사이트의 두 항목을 보고 쉽게 수정이 가능하며, CCS TEST 가능하다

  1. Modifying U-Boot
  2. Register to U-Boot Macro Definition Mapping Table
  http://processors.wiki.ti.com/index.php/TI814x-DDR3-Init-U-Boot

2.2 DRAM의 SW Leveling 

만약, DDR의 선로의 길이 확장으로 인해 SW-Leveling 사용해야한다면, 아래부분 참조
Leveling은 대해 좀더 알고 싶다면 상위 RAM부분을 읽어보고 파악하자

  http://processors.wiki.ti.com/index.php/TI814x-DDR3-Init-U-Boot_Wordwise_SWleveling

2.3 DDR Power Optimization

  Docs/Application_Notes/IPNC_RDK_Power_Optimization.pdf

  • DM8127 전체 Power 조절에 관한 내용이 있음
       1. Interleaving 문제로 16bit로 두개연결이 성능이 가장 뛰어남.
       2. DeepSleep과 IO Power optimization 부분 및 VTP 조절

 
3. DDR 관련 설정 


$ cd ~/dm8127/work/Source/ti_tools/ipnc_psp_04_04_00_01/u-boot 
  • DM8127 CONFIG 

$ vi include/config.h
$ vi include/configs/ti8148_ipnc.h

  • DDR관련소스 

$ vi ./board/ti/ti8148_ipnc/evm.c


3.1 Uboot의 DRAM SOURCE


  • DDR 설정 관련소스
$ vi board/ti/ti8148_ipnc/evm.c
                dram_init                  // 확장시 확인 필요
                is_ddr3()                  // ddr3 동작 , return 1
                config_ti814x_ddr()        // 이 부분 설정
                ddr_pll_config()           // CLOCK 변경 ,DDR_PLL_533

  • 설정부분 
arch/arm/include/asm/arch-ti81xx/ddr_defs_ti814x.h      // 설정값 변경
arch/arm/include/asm/arch-ti81xx/clocks_ti814x.h        // DDR_M


3.2 Uboot DDR Timing 설정 및 Clock 설정

  • DDR TIMING 및 CONFIG 부분

$ vi arch/arm/include/asm/arch-ti81xx/ddr_defs_ti814x.h 
....
#else //CONFIG_DM385_DDR3_533

/* TI814X DDR3 EMIF CFG Registers values 400MHz */
#define DDR3_EMIF_READ_LATENCY          0x00170208   //RD_ODT=0x2, IDLE_ODT=0x0, Dynamic power_down enabled
#define DDR3_EMIF_TIM1                  0x0AAAD4DB
#define DDR3_EMIF_TIM2                  0x682F7FDA
#define DDR3_EMIF_TIM3                  0x501F82BF
#define DDR3_EMIF_REF_CTRL              0x00000C30
#define DDR3_EMIF_SDRAM_CONFIG          0x61C011B2
#define DDR3_EMIF_SDRAM_ZQCR            0x50074BE1

#endif

        아래는 U-BOOT Name과 Reg-Name 및 OFFSet을 간단히 Mapping 하였습니다.

#define EMIF4_0_CFG_BASE                0x4C000000
#define EMIF4_1_CFG_BASE                0x4D000000
          U-BOOT Name                   Reg-Name     OFFSET
#define DDR3_EMIF_READ_LATENCY          DDRPHYCR      (E4h)
#define DDR3_EMIF_TIM1                  SDRTIM1       (18h)
#define DDR3_EMIF_TIM2                  SDRTIM2       (20h)
#define DDR3_EMIF_TIM3                  SDRTIM3       (28h) 
#define DDR3_EMIF_REF_CTRL              SDRRCR        (10h)
#define DDR3_EMIF_SDRAM_CONFIG          SDRCR         (08h) 
#define DDR3_EMIF_SDRAM_ZQCR            ZQCR          (C8h)

  • DDR CLOCK 설정 
현재 DDR_PLL_533 정의되어있으나, 400MHz 동작됨 


$ vi arch/arm/include/asm/arch-ti81xx/clocks_ti814x.h

#define DDR_PLL_533     /* Values supported 400,533 */
.....
#define DDR_N           19
#ifdef CONFIG_DM385
/* DDR PLL */
/* For 400 MHz */
#if defined(DDR_PLL_400)
#define DDR_M           (opp_val_dm385(800, 800))
#endif

/* For 533 MHz */
#if defined(DDR_PLL_533)
#define DDR_M       (opp_val_dm385(1066, 1066))
#endif
#else
#define DDR_M           (pg_val_ti814x(666, 800))
#endif
#define DDR_M2          2
#define DDR_CLKCTRL     0x801
$ vi ./board/ti/ti8148_ipnc/evm.c

static void ddr_pll_config()
{
        pll_config(DDR_PLL_BASE,
                        DDR_N, DDR_M,
                        DDR_M2, DDR_CLKCTRL);
}


 AM437x 와 유사하며, maxium frequecies를 확인을 반드시 확인하자.
 일반적은 Maximum Clock 400MHz이며, overclock해서 533MHz를 사용가능

  • 확인사항들 
         위 부분은 TI DM814x의 SPRUGZ8F와 회로도를 참고하여, 위 설정값을 변경하자.
         DDR_M: CPU의 Version에 따라 666 or 800 되지만, PG2_1 이기에,  800 사용
         1. DEVOSC_MX0 : APPRO 회로도에서 20MHz 확인 (DEVOSC_MX0=CLKINP)
         2. CLKOUT    : [M /(N+1)] * CLKINP * [1/M2]
                            **    800/20 * 20*1/2 = 400 MHz   최종 CLOCK
         3. CLKOUT: DDR0_PHY Clock, DDR1_PHYClock, DMM clock and EMIFmclk.

  • 관련내용 (SPRUGZ8F.pdf)

             2.3.5 DDR PLL Clock
             2.5.3 DPLLS Clock Function 참조
             8.4.10 Module Clock (Maximum Clock 확인)
             8.2.2.1 DVFS ( Maximum Clock 확인)
           

3.3 DDR3 Datasheet Timing 


  • K4B1G1646E 의 TIMING 

  • DDR3로 16bit로 연결시 




TI에서는 손쉽게 Timing 설정이 가능하도록 Tool을 제공을 한다.

  • DM8127 관련 설정 
AM43xx 용을 고쳐서 DM8127용으로 내가 새로 만들었다.
  https://docs.google.com/spreadsheets/d/1ZXFmWqTe1SLkZ-KmxYmUkfUR1GQwOV-Pms0-Fj7J1xA/edit?usp=sharing


  • AM43xx용 
  https://drive.google.com/open?id=0B_ehveuLi8MVV1lXaW0zLTZ1ZVE


4. DDR설정 및 확인

DM8127는 EMIF에 현재 16bit 모드로 연결되어 있기때문에 아래와 같이 EMIF를 개별로 각각 설정을 해줘야 한다. (EMIF0, EMIF1)

$ vi arch/arm/include/asm/arch-ti81xx/cpu.h

#define EMIF4_0_CFG_BASE                0x4C000000
#define EMIF4_1_CFG_BASE                0x4D000000

.....

#define EMIF4_0_SDRAM_ZQCR              (EMIF4_0_CFG_BASE + 0xC8)
#define EMIF4_0_SDRAM_CONFIG            (EMIF4_0_CFG_BASE + 0x08)
#define EMIF4_0_SDRAM_CONFIG2           (EMIF4_0_CFG_BASE + 0x0C)
#define EMIF4_0_SDRAM_REF_CTRL          (EMIF4_0_CFG_BASE + 0x10)
#define EMIF4_0_SDRAM_REF_CTRL_SHADOW   (EMIF4_0_CFG_BASE + 0x14)
#define EMIF4_0_SDRAM_TIM_1             (EMIF4_0_CFG_BASE + 0x18)
#define EMIF4_0_SDRAM_TIM_1_SHADOW      (EMIF4_0_CFG_BASE + 0x1C)
#define EMIF4_0_SDRAM_TIM_2             (EMIF4_0_CFG_BASE + 0x20)
#define EMIF4_0_SDRAM_TIM_2_SHADOW      (EMIF4_0_CFG_BASE + 0x24)
#define EMIF4_0_SDRAM_TIM_3             (EMIF4_0_CFG_BASE + 0x28)
#define EMIF4_0_SDRAM_TIM_3_SHADOW      (EMIF4_0_CFG_BASE + 0x2C)
#define EMIF4_0_DDR_PHY_CTRL_1          (EMIF4_0_CFG_BASE + 0xE4)
#define EMIF4_0_DDR_PHY_CTRL_1_SHADOW   (EMIF4_0_CFG_BASE + 0xE8)
#define EMIF4_0_IODFT_TLGC              (EMIF4_0_CFG_BASE + 0x60)

#ifndef CONFIG_DM385
#define EMIF4_1_SDRAM_ZQCR              (EMIF4_1_CFG_BASE + 0xC8)
#define EMIF4_1_SDRAM_CONFIG            (EMIF4_1_CFG_BASE + 0x08)
#define EMIF4_1_SDRAM_CONFIG2           (EMIF4_1_CFG_BASE + 0x0C)
#define EMIF4_1_SDRAM_REF_CTRL          (EMIF4_1_CFG_BASE + 0x10)
#define EMIF4_1_SDRAM_REF_CTRL_SHADOW   (EMIF4_1_CFG_BASE + 0x14)
#define EMIF4_1_SDRAM_TIM_1             (EMIF4_1_CFG_BASE + 0x18)
#define EMIF4_1_SDRAM_TIM_1_SHADOW      (EMIF4_1_CFG_BASE + 0x1C)
#define EMIF4_1_SDRAM_TIM_2             (EMIF4_1_CFG_BASE + 0x20)
#define EMIF4_1_SDRAM_TIM_2_SHADOW      (EMIF4_1_CFG_BASE + 0x24)
#define EMIF4_1_SDRAM_TIM_3             (EMIF4_1_CFG_BASE + 0x28)
#define EMIF4_1_SDRAM_TIM_3_SHADOW      (EMIF4_1_CFG_BASE + 0x2C)
#define EMIF4_1_DDR_PHY_CTRL_1          (EMIF4_1_CFG_BASE + 0xE4)
#define EMIF4_1_DDR_PHY_CTRL_1_SHADOW   (EMIF4_1_CFG_BASE + 0xE8)
#define EMIF4_1_IODFT_TLGC              (EMIF4_1_CFG_BASE + 0x60)
#endif
$ vi board/ti/ti8148_ipnc/evm.c

static void config_ti814x_ddr(void)
{
....

 /*Program EMIF0 CFG Registers*/
                __raw_writel(DDR3_EMIF_READ_LATENCY, EMIF4_0_DDR_PHY_CTRL_1);
                __raw_writel(DDR3_EMIF_READ_LATENCY, EMIF4_0_DDR_PHY_CTRL_1_SHADOW);
                __raw_writel(DDR3_EMIF_TIM1, EMIF4_0_SDRAM_TIM_1);
                __raw_writel(DDR3_EMIF_TIM1, EMIF4_0_SDRAM_TIM_1_SHADOW);
                __raw_writel(DDR3_EMIF_TIM2, EMIF4_0_SDRAM_TIM_2);
                __raw_writel(DDR3_EMIF_TIM2, EMIF4_0_SDRAM_TIM_2_SHADOW);
                __raw_writel(DDR3_EMIF_TIM3, EMIF4_0_SDRAM_TIM_3);
                __raw_writel(DDR3_EMIF_TIM3, EMIF4_0_SDRAM_TIM_3_SHADOW);
                __raw_writel(DDR3_EMIF_SDRAM_CONFIG, EMIF4_0_SDRAM_CONFIG);

....

/*Program EMIF1 CFG Registers*/
                __raw_writel(DDR3_EMIF_READ_LATENCY, EMIF4_1_DDR_PHY_CTRL_1);
                __raw_writel(DDR3_EMIF_READ_LATENCY, EMIF4_1_DDR_PHY_CTRL_1_SHADOW);
                __raw_writel(DDR3_EMIF_TIM1, EMIF4_1_SDRAM_TIM_1);
                __raw_writel(DDR3_EMIF_TIM1, EMIF4_1_SDRAM_TIM_1_SHADOW);
                __raw_writel(DDR3_EMIF_TIM2, EMIF4_1_SDRAM_TIM_2);
                __raw_writel(DDR3_EMIF_TIM2, EMIF4_1_SDRAM_TIM_2_SHADOW);
                __raw_writel(DDR3_EMIF_TIM3, EMIF4_1_SDRAM_TIM_3);
                __raw_writel(DDR3_EMIF_TIM3, EMIF4_1_SDRAM_TIM_3_SHADOW);
                __raw_writel(DDR3_EMIF_SDRAM_CONFIG, EMIF4_1_SDRAM_CONFIG);

....

}

위와 같이 변경후, DDR 설정은 SPL에서 진행이 되므로, SPL 변경 후, TEST를 진행하자.

SPL 파일:  u-boot.min.sd을 MLO 변경후 SDIMAGE 생성후 TEST   각 REGISTER 확인은 아래와 같이, md 명령으로 확인 (boot가 될 경우)

* SPL도 기본 U-BOOT 명령은 동작한다.
TI-MIN# md 0x4C000018
TI8148_IPNC# md 0x4C000018 


AM437x DDR 의 AC Timing 설정 TOOL을 DM8127에 맞게 수정하고 SDBOOT로 변경하고 이값으로 기본적으로 TEST를 함.

8/16/2015

DM8127-IPNC 개발환경설정

1. 개발환경설정

참조 http://ahyuo.blogspot.kr/2015/08/dm8127.html

1.1 CROSS COMPILE 설정

  • 아래와 같이 Rules.make에서 수정 (이미 CROSS COMPILE을 이곳에 설치) 

$ cd ~/dm8127/work/Source/ipnc_rdk
$ ls 
Makefile  Rules.make  ipnc_app  ipnc_mcfw  target  tftp  ubinize.cfg

$ vi Rules.make
BUILD_TOOL_DIR          := /opt/codesourcery/arm-2009q1


1.1  FILE SYSTEM 구축 및 NFS 설치

기본으로 File System 압축이 풀려있지 않으므로, 압축을 풀고, NFS을 구축하자.
압축을 푼후, 전체빌드를 해야 file system 안에 모듈들이 들어가고 필요앱들이 설치된다.

*주의: 기본적으로 압축을 풀면 NFS가 동작이 되지 않는다.


$ cd work/Source/ipnc_rdk/target
$ sudo tar zxvf filesys_ipnc_rdk.tar.gz 
$ sudo chown -R : ./*


2.  BUILD 설정

  • IPNC_RDK_InstallGuide_Version3.0.0.pdf (설치 및 빌드)

       2.1 IPNC Application Build Procedure
       이부분 부터 정독 (아래부분 그 부분 간단히 정리)

2.1 설정확인 및 변경 

아래와 같이 실제 디렉토리로 이동 후,  Rules.make를 설정후  빌드를 시작한다.
* 빌드시 PATH의 설정을 반드시 설정

환경변수 CROSS_COMPILE 과 ARCH를 별도로 외부에서 설정하지 않아도 된다.
이를 설정하면 오히려 에러가 발생
  • Rules.make  : 기본설정 -> 원하는 설정을 여기서 변경 
  • Makefile      : 빌드하고 싶은 Target을 찾아 빌드 





현재 dm8127/work 아래에 모든것이 설치되어 있고 아래와 같이 기본적인것들을 확인한다.

 $ cd ~/dm8127/work/Source/ipnc_rdk
 
 $ vi Makefile // 각각 target 확인
 
 $ Rules.Make  // 설정 확인 아래와 같이 SD로 사용하면, SD로 변경 
...
# Binary to boot from NAND or SDCARD
#BINARY_MODE    := nand
BINARY_MODE     := sd
..
 
2.2 How To Build It

 $ cd ~/dm8127/work/Source/ipnc_rdk
아래와 같이 빌드를 실행을 한다.
빌드를 실행전 반드시 CROSS_COMPILE 포함을 확인한다.


  • Host에서 빌드 중 에러가 발생할 경우 설치해야할 PKG


$ apt-get install bison   //bison error 
$ apt-get install flex //yyparse



  • 세부 Build 설정 

아래를 하기 전에 Rule.make를 확인을 다시 확인하자. -s는 silent의 의미이다.

//Basic  
 $ make -s sysall      // clean and rebuild IPNC RDK as well as all packages , all of things. 
 $ make -s sysclean    // clean all of the packages 
 $ make -s ubifs       // create ubifs filesystem and install it in TFTP home 
 $ make -s jffs2       // work it same as above 
//U-BOOT  
 $ make -s ubootmin    // uboot.min.xxx  only
 $ make -s ubootbin    // uboot.bin      only
 $ make -s uboot       // uboot both of them,min bin
//CMEM
 $ make -s cmem         // 
 $ make -s cmemclean    //
//LINUX AND UBOOT
 $ make -s lsp   // linux and uboot 
//FILE SYSTEM
 $ make -s ubifs 
 $ make -s jffs2
 //APP
 $ make -s ipncapp

8/15/2015

DM8127-IPNC 설정 과 SDBOOT 설정 및 IMAGE생성

1. DM8127-IPNC 구조 



1.1 DM8127-IPNC 기본 Camera 구조




1.2 DM8127-IPNC Sub Board 구조 


         

            처음  Connector를 삽입시 검정부분을 살짝 빼고 삽입하자.
     
현재설정

  • J3   : 20PIN JTAG 연결 - XDS510-USB
  • JP1 : CLOSE ,  
  • JP2 : CLOSE  ,SD BOOT
  • JP3 : CLOSE  ,UART IC ENABLE 
  • J4  :  UART Cable 연결 


1.3 UART 관련 설정 








2. SD BOOT 변경 및 Image 생성


2.1 SD-IMAGE 생성방법

아래와 같이 백업을 위해 DM8127와 동일한 TST0 생성하고 진행을 하고,
이곳에서 아래와 같이 script로 SD-IMAGE를 생성하자.

( */dev/sdd  SD-IMAGE 전용 VDI 새로 생성해서 mount되어있음, 실제 mmc가 아님)
*아래방법은 항상 조심해서 사용해야 하며, 본인인 경우, 여러개의 VDI를 사용하고 해서
  /dev/sdx가 이름이 수시로 변경이 되어, mount로 확인안하고 사용하여 VDI data를 지워버렸다.


  • Linux 에서 SD Image 생성 

$ cd  ~/dm8127/work/Binaries
$ ls 
DM385  DM8127  update.txt  
$ cp -a DM8127  DM8127-TST0

$ cp ../Utils/sd-script/mksd-ti814x.sh DM8127-TST0/sd/
$ cd DM8127-TST0/sd/
$ ls
MLO  filesys_full_feature.tar.gz  filesys_low_power.tar.gz  mksd-ti814x.sh  u-boot.bin  uImage

$ sudo ./mksd-ti814x.sh /dev/sdd MLO u-boot.bin uImage filesys_full_feature.tar.gz
or
$ sudo ./mksd-ti814x.sh /dev/sdd ./MLO ./u-boot.bin ./uImage ./filesys_full_feature.tar.gz


*SD-IMAGE 전용 빈 공간의 VDI를 생성해서  Virtual box 추가한 사항 (8G-Byte VDI)


  • VDI 관련 사항

위사항을 하기전에
우선적 SD IMAGE용 VDI 8G or 16G  고정크기만들어 연결해야한다.
  http://ahyuo.blogspot.kr/2013/12/virtual-box-ubuntu-1204.html

관련 Script:
  http://processors.wiki.ti.com/index.php/TI81XX_PSP_UBOOT_User_Guide#U-Boot_SD_.28Secured_Digital_card.29_Support


  http://elinux.org/Panda_How_to_MLO_%26_u-boot

  https://github.com/linux-sunxi/u-boot-sunxi/wiki

  • WINDOW에 복사 및 WRITE 

sdx 안에 새로 생성된 Image를 window으로 가져와 SD/MMC에 굽는다.
VDI를 새로 추가한 위치에 따라 sdx의 이름은 변경될 수 있으며, mount로 항상확인 하자.
  1. 아래와 같이 /dev/sdd 에서 Image를 dump를 생성 
  2. 새로 생성한 Image를  Window의 Win32DiskImager로 SD Card Image Write

  $ cd /media/sf_SHARED   
  $ sudo cat /dev/sdd > sdcard.img 
     or 
  $ sudo dd if=/dev/sdd of=./sdcard.img   // slow version 
     or
  $ sudo dd if=/dev/sdd of=./sdcard.img bs=64M  // fast version 
     or
  $ sudo dd if=/dev/sdd of=./sdcard.img bs=256M  // fast version 
     or
  $ sudo dd if=/dev/sdd of=./sdcard.img bs=512M  // fast version 



2.2 U-BOOT 환경설정

위 생성대로 boot 했을 경우, 문제사항이 UBOOT의 환경설정
bootcmd와 bootargs가 발생이 하며, 이를 해결하기 위해서 아래와 같이 설정을 해준다.

이를 쉽게 해결하기 위해서 SD 카드 boot 영역에 FAT에 boot.scr을 만들어주어
해결해줘도 되고 아래와 같이 UBOOT에서 아래와 같이 직접 설정해줘도 된다.

  • U-BOOT의 환경설정 

TI8148_IPNC#pri
...
loadbootscript=fatload mmc 0 ${script_addr} boot.scr
bootscript= echo Running bootscript from MMC/SD to set the ENV...; source ${script_addr}
.....
bootcmd=ipnc_ff_init 1; mmc rescan 0; fatload mmc 0 0x81000000 uImage; bootm 0x81000000
bootargs=console=ttyO0,115200n8 noinitrd mem=80M rootwait vram=4M notifyk.vpssm3_sva=0xBFD00000 root=/dev/mmcblk0p2 rw eth=00:0C:0C:02:30:FB ip=192.168.1.168 cmemk.phys_start=0x85000000 cmemk.phys_end=0x89000000 cmemk.allowOverlap=1 earlyprintk

  • boot.scr 만드는 방법

$ vi boot.txt
setenv bootcmd 'ipnc_ff_init 1; mmc rescan 0; fatload mmc 0 0x81000000 uImage; bootm 0x81000000'
setenv bootargs 'console=ttyO0,115200n8 noinitrd mem=80M rootwait vram=4M notifyk.vpssm3_sva=0xBFD00000 root=/dev/mmcblk0p2 rw eth=00:0C:0C:02:30:FB ip=192.168.1.168 cmemk.phys_start=0x85000000 cmemk.phys_end=0x89000000 cmemk.allowOverlap=1 earlyprintk'
boot

$ mkimage -A arm -O linux -T script -C none -n TI_script -d boot.txt boot.scr


  • SPL      : TI-MIN# 
  • U-BOOT: TI8148_IPNC#

A. SD BOOT 환경설정

  SDBOOT에는 IMAGE 저장장소는 FAT를 사용하고, FILESYS를 EXT3를 사용한다


  • bootcmd for full feature 
TI8148_IPNC# setenv bootcmd 'ipnc_ff_init 1; mmc rescan 0; fatload mmc 0 0x81000000 uImage; bootm 0x81000000';saveenv 

  • bootcmd for low power filesys 

TI8148_IPNC# setenv bootcmd 'ipnc_ff_init 0; mmc rescan 0; fatload mmc 0 0x81000000 uImage; bootm 0x81000000';saveenv 


  •    아래과 같이 bootargs 기본설정  (network 정보 및 memory )
    IP는 본인 설정대로, dhcp로 변경가능

TI8148_IPNC# setenv bootargs 'console=ttyO0,115200n8 noinitrd mem=80M rootwait vram=4M notifyk.vpssm3_sva=0xBFD00000 root=/dev/mmcblk0p2 rw eth=00:0C:0C:02:30:FB ip=172.24.191.14 cmemk.phys_start=0x85000000 cmemk.phys_end=0x89000000 cmemk.allowOverlap=1 earlyprintk';saveenv


B. NFS 환경설정

NFS BOOT는 현재 문제가 생긴것을 확인 원인 추후 파악


  • HOST 에서 해야할일 

uImage 복사

$ make -s lsp
$ cp ../ti_tools/ipnc_psp_04_04_00_01/kernel/arch/arm/boot/uImage /tftpboot/uImage-dm8127_rdk 

File System Mount TEST

$ cd ~/dm8127/work/Source/ipnc_rdk/target/filesys
$ ls  // host에서 filesystem 확인 
$ cd ..
$ mkdir test
$ sudo mount -t nfs 192.168.1.100:/home/jhlee/dm8127/work/Source/ipnc_rdk/target/filesys test
$ ll ./test
$ sudo umount ./test

  • Device 에서 설정 
TI8148_IPNC# 생략 save는 본인의 선택

set serverip '192.168.1.100';set ipaddr '192.168.1.39'; set gatewayip '192.168.1.1';set netmask '255.255.255.0'
set hostname "jhlee-VirtualBox"


setenv bootargs 'console=ttyO0,115200n8 root=/dev/nfs nfsrootdebug rw rootdelay=10 mem=80M vram=4M notifyk.vpssm3_sva=0xBFD00000 nfsroot=192.168.1.100:/home/jhlee/dm8127/work/Source/ipnc_rdk/target/filesys,nolock eth=32:30:3a:63:64:3a ip=192.168.1.168 cmemk.phys_start=0x85000000 cmemk.phys_end=0x89000000 cmemk.allowOverlap=1 earlyprintk'
setenv bootcmd tftp uImage-dm8127_rdk;bootm


RAM 512로 했을 경우, Memory Map , 문서 IPNC_RDK MemoryMap 참조

  - cmemk.phys_start="0x85000000"  cmemk.phys_end="0x89000000"
      CMEM 64M

  - notifyk.vpssm3_sva=0xBFD00000
             VPSS M3 Notify (For FB Dev) :2M


2.3 SD BOOT 후 확인사항

  • U-BOOT의 PROMPT  (TI8148_IPNC -> TI-MIN)
  • IPNC의 NETWORK 설정: STATIC IP : 192.168.1.68로 설정됨 - 이는 172.24.191.14 상관없음 
  • Web 접속 후 각 연결 사항 확인 및 동작확인 (확인)
  • Web - Histogram도 지원 및 각 GUI 지원 각 기능 확인 ( 확인결과 별 문제없음)
  • 2A기능 확인  (확인)
  • 렌즈 줌인 줌아웃 테스트 (확인)
  • VLC 동작확인 못함 (카메라 RTSP 동작확인) )
  • 기타 카메라 테스트 진행 


  • VLC 로 RTSP 동작 확인
  1. SD BOOT후 로그에서 아래와 같이 RTSP 주소 확인 
  2. 화면재생시 VLC 도구->코덱정보 해상도 정보확인 

..... 
Play this stream using the URL:
 rtsp://192.168.1.168:8553/PSIA/Streaming/channels/1?videoCodecType=MPEG4

Play this stream using the URL:
 rtsp://192.168.1.168:8554/PSIA/Streaming/channels/1?videoCodecType=MPEG4

Play this stream using the URL:  
        // 1600x900  60HZ   VLC 에서 확인
 rtsp://192.168.1.168:8557/PSIA/Streaming/channels/2?videoCodecType=H.264

Play this stream using the URL:
 rtsp://192.168.1.168:8555/PSIA/Streaming/channels/0?videoCodecType=MJPEG

Play this stream using the URL:
        // 720x482     30HZ  VLC에서 확인 
 rtsp://192.168.1.168:8556/PSIA/Streaming/channels/2?videoCodecType=H.264




8/13/2015

DM8127-IPNC-RDK 기본구조 및 봐야할 문서

1. DM8127 IP Camera 기본특징

현재 TI사에서 제공하는 CHIP이며, APPRO 사에서 TI Platform을 사용하여 IP Camera 을 제작하여 팔고 있다.
DM8127 IPNC는 DM814x 시리즈와 기능이 유사하며,기존의 DM385의 기능에 DSP에 좀 더나은 비디오 분석기능을 추가했다.
더 자세한 부분은 TI사의 IPNC( IP Network Camera) History를 보면 어느정도 이해가 되겠다.

  • TI사 IPNC HISTORY
TI에서 제공하는 IP Camera 이며, 개별을 비교가능가능
  http://www.ti.com/tool/ipcamerard

  • DM8127에 관련한 기사
  http://www.newswire.co.kr/newsRead.php?no=744886
  https://www.immervisionenables.com/2014/04/02/first-ever-immervision-enables-2-0-compatibility-onboard-with-texas-instruments-davinci-dm8127-video-processor/
 


1.1 IP Camera의 기본구조





TI사의 IP Camera의 기본구조는 크게 변경되지 않으며, 진화되고 추가는 형식으로 가고 있다.


3. DM8127-IPNC 구조 


3.1 DM8127 Tool Chain 설치 및 설정

  http://ahyuo.blogspot.kr/2015/11/arm-tool-chain.html


3.2 RDK  기본구조 

APPRO사에서 DVD로 제공

  • Download File
  1. GA_Release_3.0.0.zip  ( RDK 전체구성)
  2. IPNC_RDK_Docs_Patch_v3.0.0.tar.gz  (추가 문서)

  • GA_3.0.0_release.zip
  1. GUI_VideoPlayer_SDK_Version2.0.30.zip
  2. ImageTuningTool_Version1.0.0.zip
  3. IPNC_RDK_DM812x_DM385_Version3.0.0.tar.gz 

* GUI_VideoPlayer_SDK_Version2.0.30  // 만약 Web이나, Player작업을 한다면 확인
* ImageTuningTool_Version1.0.0        // 이 TOOL이 2A기능과 관련있는지 확인
  • IPNC_RDK_DM812x_DM385_Version3.0.0.tar.gz 
  1. Appro_IPNC_RDK_DM812x_DM385_v3.0.0.tar.gz    // ti-tools->iss
  2. OpenSrc_IPNC_RDK_DM812x_DM385_v3.0.0.tar.gz // ipnc_rdk and ti-tools->ipncxxx
  3. PrivateTI_IPNC_RDK_DM812x_DM385_v3.0.0-Linux-x86-Install.bin  
위 세 파일을 설치하면 아래와 같은 RDK 전체 기본구조로 구성이 된다.

관련참고파일:
IPNC_RDK_InstallGuide_Version3.0.0.pdf   // 가장 중요한 문서 

밑에 빠져있지만, source/ti_tools/ipnc_psp_04_04_00_01 안에
kernel과 uboot가 포함되어있다.


  • RDK-전체기본구조 






  • SYSLINK

  http://processors.wiki.ti.com/index.php/SysLink_UserGuide
  http://processors.wiki.ti.com/index.php/SysLink_Overview


  • xDM(eXpress DSP Digital Media)
  • XDAIS(eXpressDSP Algorithm Interface Standard)
TI에서 제공하는 xDM의 확장판이며, 관련 알고리즘 Package를 제공해준다.
예를들면, Codec 및 관련 부분 다른 Interface

  https://en.wikipedia.org/wiki/XDAIS_algorithms
  http://software-dl.ti.com/dsps/dsps_public_sw/sdo_sb/targetcontent/xdais/index.html
  http://processors.wiki.ti.com/index.php/Category:XDAIS


  • XDCTOOLS

  http://processors.wiki.ti.com/index.php/How_is_SYS/BIOS_related_to_XDCtools_and_RTSC%3F

3.3 DM8127-IPNC 중요문서


  • RDK를 제외한 문서들 
  1. IPNC_RDK_InstallGuide_Version3.0.0.pdf
  2. IPNC_RDK_Release_Notes_Version3.0.0.pdf ( 반드시 확인)

  • IPNC_RDK_Docs_Patch_v3.0.0.tar.gz   (안에 포함된 문서) 
  1. IPNC_RDK_McFW_UserGuide.pdf  
  2. IPNC_RDK_MemoryMapAnalysis.pdf
McFW(Multi Channel Framework) 약어로 가 Interface와 Framework를 설명해준다.
DM8127의 ARM의 syslink로 연결되는 DSP ,VPSS , HDVICP2(version2)구조
전체 Memory Map 확인

  • 상위 Doc 안에 문서들 



  • 기타 주요 문서 및 확인사항 

TEST Program 작동방법 
    IPNC_RDK_Diagnostic_Program.pdf  ( TEST Program 제공, RAM 및 NAND (autotest)

설치된 TOOL 부분 확인
    IPNC_RDK_Software_Manifest
    TI_Tools_Software_Manifest

API GUIDE
    IPNC_RDK_ApiGuide.chm               ( API GUIDE)
     
기타로 Power Optimization 혹은 Test 결과 , BooT Time optimization 등 많은 문서제공



3.4 VPSS와 HDVICP Firmware

별도의 Cortex M3가 두개가 존재하며, 이는 비디오 입/출력 과 동영상 Encode/Decode를 담당한다.

./opt/ipnc/bin/fw_load.out  // 아래의 두 모듈을 올려준다.

./opt/ipnc/firmware/ipnc_rdk_fw_m3video.xem3
./opt/ipnc/firmware/ipnc_rdk_fw_m3vpss.xem3  




  • IVA : Image Video Accelerator

실제적으로 HDVICP2이라고 생각하며 되며,  IVA_HD 모듈이라고 도 한다.

spruhi7a
spruhl6a