This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

RTC reset after power cycle - DM368 IPNC - Version 4.0

Dear All,

I noticed that on my DM368 IPNC with SW release 4.0 and after setting clock time in the web pages, the date goes back to the beginning of time (1-1-1970) avec reset/power cycle.

I suspected at first a HW problem, but my cam works fine with 2.6.0 SW release.

So i dug a little deeper and found that 2.6.37 kernel provided with 4.0 release do not integrate RTC support. I also noticed that "TI DaVinci DM365 RTC" driver was not available too, whereas it was available on 2.6.18 kernel provided with 2.6.0 release.

Is there anybody that can tell me how to make work RTC with this new Kernel (Patch / Configuration)

I found here : http://processors.wiki.ti.com/index.php/DaVinci_PSP_03.21.00.04_Release_Notes that RTC should be supported with 2.6.37

Any idea would be really appreciated, i'm a quite lost.

Thanks for advance for your help

Best regards

ADB

  • Antonie,

    Have you enabled CONFIG_RTC_DRV_DAVINCI in your configuration and tried?

  • Dear Renjith Thomas,

    Thanks for your feedback

    I tried this but after setting CONFIG_RTC_DRV_DAVINCI in the davinci_dm368_ipnc_defconfig_nfs, as far as TI DAVINCI RTC do not appear in the make menuconfig RTC section, I assumed that i was going in the wrong way.

    Anyway, i build a new kernel with this config for RTC : 

    CONFIG_RTC_LIB=y
    CONFIG_RTC_CLASS=y
    CONFIG_RTC_INTF_SYSFS=y
    CONFIG_RTC_INTF_PROC=y
    CONFIG_RTC_INTF_DEV=y
    CONFIG_RTC_DRV_DAVINCI=y

    I also create both rtc and rtc0 special files with mknod in /dev

    mknod rtc c 254 0 

    mknod rtc0 c 0 1  

    With this configuration, during boot, CSL driver init fail, but at the end of boot i'm able to call hwclock and see RTC current time.

    I assume the conflict is due to that both RTC and CSL driver have the same driver MAJOR number (254). What is your opinion ?

    Does anyone know how to change RTC MAJOR number to remove this conflict and make CSL and RTC work together ?

    Regards

    ADB

  • Dear Antoine,

    Can you print the contents of /proc/devices and see rtc is present and major number of rtc?

  • Dear Renjith Thomas

    Thanks for your quick reply

    Here is the result of cat /proc/devices : 

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

    root@192:/dev# cat /proc/devices
    Character devices:
    1 mem
    4 /dev/vc/0
    4 tty
    4 ttyS
    5 /dev/tty
    5 /dev/console
    5 /dev/ptmx
    7 vcs
    10 misc
    13 input
    21 sg
    81 video4linux
    89 i2c
    90 mtd
    108 ppp
    116 alsa
    128 ptm
    136 pts
    180 usb
    189 usb_device
    245 usbmon
    246 media
    247 cmem
    248 dm365mmap
    249 irqk
    250 edma
    251 dev_dma
    252 dev_i2c
    253 csl
    254 rtc

    Block devices:
    1 ramdisk
    259 blkext
    7 loop
    8 sd
    31 mtdblock
    65 sd
    66 sd
    67 sd
    68 sd
    69 sd
    70 sd
    71 sd
    128 sd
    129 sd
    130 sd
    131 sd
    132 sd
    133 sd
    134 sd
    135 sd
    179 mmc

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

    Here is the result of ls -l /dev : 

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

    root@192:/dev# ls -l
    crwxr-xr-x 1 1000 root 10, 134 Apr 24 2012 apm_bios
    crwxr-xr-x 1 1000 root 248, 0 Apr 24 2012 cmem
    crw------- 1 1000 root 5, 1 Apr 24 2012 console
    crwxr-xr-x 1 1000 root 254, 0 Apr 24 2012 csl0
    crwxr-xr-x 1 1000 root 254, 1 Apr 24 2012 csl1
    crwxr-xr-x 1 1000 root 254, 2 Apr 24 2012 csl2
    crwxr-xr-x 1 1000 root 254, 3 Apr 24 2012 csl3
    crwxr-xr-x 1 1000 root 254, 4 Apr 24 2012 csl4
    crwxr-xr-x 1 1000 root 254, 5 Apr 24 2012 csl5
    crwxr-xr-x 1 1000 root 254, 6 Apr 24 2012 csl6
    crwxr-xr-x 1 1000 root 254, 7 Apr 24 2012 csl7
    crwxr-xr-x 1 1000 root 254, 8 Apr 24 2012 csl8
    crwxr-xr-x 1 1000 root 254, 9 Apr 24 2012 csl9
    crwxr-xr-x 1 1000 root 252, 0 Apr 24 2012 dev_dma
    crwxr-xr-x 1 1000 root 253, 0 Apr 24 2012 dev_i2c
    crwxr-xr-x 1 1000 root 249, 0 Apr 24 2012 dm365mmap
    crwxr-xr-x 1 1000 root 251, 0 Apr 24 2012 edma
    crwxr-xr-x 1 1000 root 29, 0 Apr 24 2012 fb0
    -rwxr-xr-x 1 1000 root 0 Jun 1 2012 fb1
    brwxr-xr-x 1 1000 root 3, 0 Apr 24 2012 hda
    brwxr-xr-x 1 1000 root 3, 1 Apr 24 2012 hda1
    brwxr-xr-x 1 1000 root 3, 10 Apr 24 2012 hda10
    brwxr-xr-x 1 1000 root 3, 11 Apr 24 2012 hda11
    brwxr-xr-x 1 1000 root 3, 12 Apr 24 2012 hda12
    brwxr-xr-x 1 1000 root 3, 13 Apr 24 2012 hda13
    brwxr-xr-x 1 1000 root 3, 14 Apr 24 2012 hda14
    brwxr-xr-x 1 1000 root 3, 15 Apr 24 2012 hda15
    brwxr-xr-x 1 1000 root 3, 16 Apr 24 2012 hda16
    brwxr-xr-x 1 1000 root 3, 17 Apr 24 2012 hda17
    brwxr-xr-x 1 1000 root 3, 18 Apr 24 2012 hda18
    brwxr-xr-x 1 1000 root 3, 19 Apr 24 2012 hda19
    brwxr-xr-x 1 1000 root 3, 2 Apr 24 2012 hda2
    brwxr-xr-x 1 1000 root 3, 3 Apr 24 2012 hda3
    brwxr-xr-x 1 1000 root 3, 4 Apr 24 2012 hda4
    brwxr-xr-x 1 1000 root 3, 5 Apr 24 2012 hda5
    brwxr-xr-x 1 1000 root 3, 6 Apr 24 2012 hda6
    brwxr-xr-x 1 1000 root 3, 7 Apr 24 2012 hda7
    brwxr-xr-x 1 1000 root 3, 8 Apr 24 2012 hda8
    brwxr-xr-x 1 1000 root 3, 9 Apr 24 2012 hda9
    prwxr-xr-x 1 1000 root 0 Apr 24 2012 initctl
    drwxr-xr-x 2 1000 root 4096 Apr 24 2012 input
    crwxr-xr-x 1 1000 root 250, 0 Apr 24 2012 irqk
    crwxr-xr-x 1 1000 root 1, 2 Apr 24 2012 kmem
    crwxr-xr-x 1 1000 root 1, 1 Apr 24 2012 mem
    brwxr-xr-x 1 1000 root 179, 0 Apr 24 2012 mmcblk0
    brwxr-xr-x 1 1000 root 179, 1 Apr 24 2012 mmcblk0p1
    brwxr-xr-x 1 1000 root 179, 2 Apr 24 2012 mmcblk0p2
    brwxr-xr-x 1 1000 root 179, 3 Apr 24 2012 mmcblk0p3
    brwxr-xr-x 1 1000 root 179, 4 Apr 24 2012 mmcblk0p4
    brwxr-xr-x 1 1000 root 179, 5 Apr 24 2012 mmcblk0p5
    brwxr-xr-x 1 1000 root 179, 6 Apr 24 2012 mmcblk0p6
    brwxr-xr-x 1 1000 root 179, 7 Apr 24 2012 mmcblk0p7
    crwxr-xr-x 1 1000 root 90, 0 Apr 24 2012 mtd0
    crwxr-xr-x 1 1000 root 90, 2 Apr 24 2012 mtd1
    crwxr-xr-x 1 1000 root 90, 4 Apr 24 2012 mtd2
    crwxr-xr-x 1 1000 root 90, 6 Apr 24 2012 mtd3
    crwxr-xr-x 1 1000 root 90, 8 Apr 24 2012 mtd4
    crwxr-xr-x 1 1000 root 90, 10 Apr 24 2012 mtd5
    crwxr-xr-x 1 1000 root 90, 12 Apr 24 2012 mtd6
    crwxr-xr-x 1 1000 root 90, 14 Apr 24 2012 mtd7
    brwxr-xr-x 1 1000 root 31, 0 Apr 24 2012 mtdblock0
    brwxr-xr-x 1 1000 root 31, 1 Apr 24 2012 mtdblock1
    brwxr-xr-x 1 1000 root 31, 2 Apr 24 2012 mtdblock2
    brwxr-xr-x 1 1000 root 31, 3 Apr 24 2012 mtdblock3
    brwxr-xr-x 1 1000 root 31, 4 Apr 24 2012 mtdblock4
    brwxr-xr-x 1 1000 root 31, 5 Apr 24 2012 mtdblock5
    brwxr-xr-x 1 1000 root 31, 6 Apr 24 2012 mtdblock6
    brwxr-xr-x 1 1000 root 31, 7 Apr 24 2012 mtdblock7
    crwxr-xr-x 1 1000 root 1, 3 Apr 24 2012 null
    crwxr-xr-x 1 1000 root 5, 2 Apr 24 2012 ptmx
    drwxr-xr-x 2 root root 0 Jan 1 1970 pts
    brwxr-xr-x 1 1000 root 1, 0 Apr 24 2012 ram0
    brwxr-xr-x 1 1000 root 1, 1 Apr 24 2012 ram1
    brwxr-xr-x 1 1000 root 1, 2 Apr 24 2012 ram2
    brwxr-xr-x 1 1000 root 1, 3 Apr 24 2012 ram3
    crwxr-xr-x 1 1000 root 1, 8 Apr 24 2012 random
    crw-r--r-- 1 root root 254, 0 Sep 26 2012 rtc
    crw-r--r-- 1 root root 0, 1 Sep 26 2012 rtc0
    drwxrwxrwt 2 root root 40 Jan 1 06:31 shm
    drwxr-xr-x 2 1000 root 4096 Apr 24 2012 snd
    drwxr-xr-x 2 1000 root 4096 Apr 24 2012 sound
    crwxr-xr-x 1 1000 root 5, 0 Apr 24 2012 tty
    crwxr-xr-x 1 1000 root 4, 0 Apr 24 2012 tty0
    crwxr-xr-x 1 1000 root 4, 1 Apr 24 2012 tty1
    crwxr-xr-x 1 1000 root 4, 2 Apr 24 2012 tty2
    crwxr-xr-x 1 1000 root 4, 3 Apr 24 2012 tty3
    crwxr-xr-x 1 1000 root 4, 4 Apr 24 2012 tty4
    crwxr-xr-x 1 1000 root 4, 5 Apr 24 2012 tty5
    crwxr-xr-x 1 1000 root 4, 6 Apr 24 2012 tty6
    crwxr-xr-x 1 1000 root 4, 7 Apr 24 2012 tty7
    crwxr-xr-x 1 1000 root 4, 8 Apr 24 2012 tty8
    crwxr-xr-x 1 1000 root 4, 64 Apr 24 2012 ttyS0
    crwxr-xr-x 1 1000 root 204, 5 Apr 24 2012 ttySA0
    crwxr-xr-x 1 1000 root 1, 9 Apr 24 2012 urandom
    crwxr-xr-x 1 1000 root 81, 0 Apr 24 2012 video2
    crwxr-xr-x 1 1000 root 1, 5 Apr 24 2012 zero

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

    Is it normal that is find 254 for csl in /dev ls and 253 in /proc/devices ?

    Both Major number shouldn't be the same ?

    Here is the bootlog of my system, maybe i'm wrong on the real problem and this will help you to see something : 

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

    Starting kernel ...

    [ 0.529915] Error: Driver 'davinci-mcbsp' is already registered, aborting...
    [ 2.592570] VFS: mounted rootfs
    INIT: version 2.86 booting
    Starting mounting local filesystems: mount Creat queue id:0
    queue id:0
    FileMngThread created
    Creat queue id:32769
    queue id:32769
    AlramThread created
    Share memory init success
    IPNC_DM365_4.0.0 (antoine@antoine-desktop) (gcc version 4.3.3 (GCC) ) #10 PREE
    Creat queue id:65538
    queue id:65538
    queue id:65538
    Creat queue id:98307
    queue id:98307
    queue id:32769
    mount: mounting /dev/root on / failed: No such file or directory
    failed (1: ).
    net_search_gateway:eth0, 1A8C0, 0, 1

    CPU is DM368
    Check_device_version : DEVICE VER = 1 !!

    ./av_server.out DM368 NTSC WIN NONE2A 1080P H264 5000000 VBR AUTO MENUOFF &
    Starting internet superserver: inetd.
    Unable to connect with server
    ApproDrvInit: 7[ 4.136462] DM365MMAP Error: Unknown ioctl received = 65032.

    CMEM Error: getVersion: Failed to retrieve version from driver: -1.
    CMEM Error: init: major version mismatch between interface and driver.
    CMEM Error: needs driver version 0x3000100, got 0xffffffff
    Error: ApproDrvInit fail
    Error: SemWait: Invalid Semaphore handler
    Error: SemRelease: Invalid Semaphore handler
    ethuartbr -p 2000 -m 100 -s "9600 raw" /dev/ttyS0 &
    SystemInit success
    Schedule manager init success
    insmod: can't read '/opt/ipnc/modules/deflate.ko': No such file or directory
    insmod: can't read '/opt/ipnc/modules/des_generic.ko': No such file or directory
    insmod: can't read '/opt/ipnc/modules/md5.ko': No such file or directory

    DM365MM Init Successful
    AVSERVER UI: Initializing.
    ERROR (drv.c|DRV_init|31): CSL init
    ERROR (drv.c|DRV_init|102): DRV_init()
    ERROR (avServerApi.c|AVSERVER_init|574): DRV_init()
    ERROR (avServerUi.c|UI_start|64): AVSERVER_init()
    ApproDrvInit: 10
    ApproDrvInit: 8[ 6.397295] DM365MMAP Error: Unknown ioctl received = 65032.

    ApproDrvInit: 9[ 6.404659] DM365MMAP Error: Unknown ioctl received = 65032.

    ApproDrvInit: 2[ 6.411911] DM365MMAP Error: Unknown ioctl received = 65032.

    CMEM Error: getVersion: Failed to retrieve versi[ 6.421615] DM365MMAP Error: Unknown ioctl received = 65032.
    on from driver: -1.
    CMEM Error:[ 6.430590] DM365MMAP Error: Unknown ioctl received = 65032.
    init: major version mismatch between interface and driver.
    CMEM Error: needs driver version 0x3000100, got 0xffffffff
    ApproDrvInit: 6
    CMEM Error: getVersion: Failed to retrieve version from driver: -1.
    CMEM Error: init: major version mismatch between interface and driver.
    CMEM Error: needs driver version 0x3000100, got 0xffffffff
    CMEM Error: getVersion: Failed to retrieve version from driver: -1.
    CMEM Error: init: major version mismatch between interface and driver.
    CMEM Error: needs driver version 0x3000100, got 0xffffffff
    CMEM Error: getVersion: Failed to retrieve version from driver: -1.
    CMEM Error: init: major version mismatch between interface and driver.
    CMEM Error: needs driver version 0x3000100, got 0xffffffff
    CMEM Error: getVersion: Failed to retrieve version from driver: -1.
    CMEM Error: init: major version mismatch between interface and driver.
    CMEM Error: needs driver version 0x3000100, got 0xffffffff
    mkdosfs 2.11 (12 Mar 2005)
    unable to get drive geometry, using default 255/63/dev/ram0 has 255 heads and 63 sectors per track,
    logical sector size is 512,
    using 0xf8 media descriptor, with 8192 sectors;
    file system has 2 12-bit FATs and 4 sectors per cluster.
    FAT size is 6 sectors, and provides 2036 clusters.
    Root directory contains 512 slots.
    Volume ID is 386dae06, no volume label.
    queue id:0
    umount: /mnt/mmc: not mounted
    dns=192.168.1.1
    net_search_gateway:eth0, 1A8C0, 0, 1
    net_search_gateway:eth0, 0, FE01A8C0, 3
    dns=192.168.1.1
    ERROR: Module g_file_storage does not exist in /proc/modules
    ApproDrvInit: 3
    [ 8.528825] DM365MMAP Error: Unknown ioctl received = 65032.
    CMEM Error: getVersion: Failed to retrieve version from driver: -1.
    CMEM Error: init: major version mismatch between interface and driver.
    CMEM Error: needs driver version 0x3000100, got 0xffffffff
    INIT: Entering runlevel: 5
    Starting telnet daemon.
    Starting syslogd/klogd: done
    getty: Error: SemWait: Invalid Semaphore handler
    Error System server receive msg fail
    ERROR:: Argument list too long
    Recieved Quit event
    Kill queue id:65538
    Error: SemRelease: Invalid Semaphore handler
    Kill queue id:98307
    Kill queue id:32769
    killall: wis-streamer: no process killed

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

    Please note that without enabling CONFIG_RTC_INTF_DEV=y in the config file, my system boot up just fine and i'm able to cat /proc/drivers/rtc.

    To allow me to access to RTC through /dev, i want to enable CONFIG_RTC_INTF_DEV, but this cause my system boot up wring like above

    Regards

    ADB

  • Antoine,

    If you compare the /dev/ entries and the /proc/devices entry for CSL, it is mismatching. Basically you've to change the csl devices major number to 253 instead of 254.

  • Dear Renjith Thomas,

    Thanks again for your reactivity !

    You are right, the CSL Major Number in the dev entry is not the same that the CSL Major number in the /proc/devices.

    Setting the CSL to 253 do not make the things work as far I noticed there is a shift with other peripherals.

    So i recreate the nodes as follow 

    Peripheral - Wrong major number - New right major number

    csl                          254                                        253

    dev_i2c                 253                                        252         

    dev_dma              252                                        251 

    edma                    251                                        250 

    irqk                        250                                        249 

    dm365mmap       249                                        248 

    cmem                    248                                        247

    With this, all is working fine.

    Best Regards

    ADB