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.

How to read and write SPI RTC DS1390 on DM6467 platform ???

Hi all,

I have SPI RTC chip DS1390 on DM6467 platform.

In /dev/, there is rtc in there, then I open "/dev/rtc" is OK.

when I  start read time from ioctl cmd:

if ( ioctl ( fd, RTC_RD_TIME, &tm1 ) < 0 )

then the console show:

Unable to handle kernel NULL pointer dereference at virtual address 00000070
pgd = c4d84000
[00000070] *pgd=84e18031, *pte=00000000, *ppte=00000000
Internal error: Oops: 817 [#1]
Modules linked in: ipv6 autofs4
CPU: 0
PC is at rtc_get_rtc_time+0x3c/0x1d8
LR is at rtc_ioctl+0x208/0x690
pc : [<c0152e2c>]    lr : [<c01531d0>]    Not tainted
sp : c4d81e50  ip : c4d81e80  fp : c4d81e7c
r10: 00900036  r9 : c4d81ee0  r8 : c0033154
r7 : befffc00  r6 : 80247009  r5 : c4d80000  r4 : 00000000
r3 : 0000000a  r2 : 00000000  r1 : ffffffe4  r0 : c4d81ee0
Flags: nZcv  IRQs off  FIQs on  Mode SVC_32  Segment user
Control: 5317F  Table: 84D84000  DAC: 00000015
Process spi_rtc_ds1390 (pid: 1237, stack limit = 0xc4d801a0)
Stack: (0xc4d81e50 to 0xc4d82000)
1e40:                                     c012df1c c4d81ee0 befffc00 80247009
1e60: befffc00 c0033154 c4d80000 00900036 c4d81f34 c4d81e80 c01531d0 c0152e00
1e80: c4d81e9c c4d81e90 c04457a0 00000000 c4d81ed4 c02a3d34 c4d81ed4 c4d81ea8
1ea0: c0146a2c c0153668 c47b6448 c4d80000 c04457a0 c47b3ea0 00000000 00000001
1ec0: c4d80000 c44fcaa0 c4d81f04 c4d81ed8 c009384c c0249e58 c4d81f04 00000087
1ee0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
1f00: 00000000 c006fe84 00000000 c44fcaa0 ffffffe7 80247009 befffc00 c0033154
1f20: c4d80000 00900036 c4d81f54 c4d81f38 c009d634 c0152fd8 c44fcaa0 befffc00
1f40: 00000000 00000003 c4d81f7c c4d81f58 c009d948 c009d5c8 c4d81f84 c4d81f68
1f60: fffffff7 befffc00 80247009 c44fcaa0 c4d81fa4 c4d81f80 c009d9ac c009d658
1f80: c0088c6c 00000000 00000000 4001ee10 0000916c 00000036 00000000 c4d81fa8
1fa0: c00329c0 c009d978 00000000 4001ee10 00000003 80247009 befffc00 befffc00
1fc0: 00000000 4001ee10 0000916c 00000000 00000000 00000000 40143000 befffc34
1fe0: 400e3290 befffbf0 00008f64 400e3294 60000010 00000003 e2833001 e5853004
Backtrace:
[<c0152df0>] (rtc_get_rtc_time+0x0/0x1d8) from [<c01531d0>] (rtc_ioctl+0x208/0x690)
[<c0152fc8>] (rtc_ioctl+0x0/0x690) from [<c009d634>] (do_ioctl+0x7c/0x90)
[<c009d5b8>] (do_ioctl+0x0/0x90) from [<c009d948>] (vfs_ioctl+0x300/0x320)
 r7 = 00000003  r6 = 00000000  r5 = BEFFFC00  r4 = C44FCAA0
[<c009d648>] (vfs_ioctl+0x0/0x320) from [<c009d9ac>] (sys_ioctl+0x44/0x68)
 r7 = C44FCAA0  r6 = 80247009  r5 = BEFFFC00  r4 = FFFFFFF7
[<c009d968>] (sys_ioctl+0x0/0x68) from [<c00329c0>] (ret_fast_syscall+0x0/0x2c)
 r7 = 00000036  r6 = 0000916C  r5 = 4001EE10  r4 = 00000000
Code: e2833001 e5853004 e3a04000 e3a0300a (e5c43070)
 <6>note: spi_rtc_ds1390[1237] exited with preempt_count 1
BUG: scheduling while atomic: spi_rtc_ds1390/0x40000001/1237
caller is __cond_resched+0x60/0x80
BUG: scheduling while atomic: spi_rtc_ds1390/0x00000001/1237
caller is do_exit+0xd3c/0xda0
Segmentation fault

 

what can I do ???

 Is there any document about the SPI-RTC driver ? or SPI driver?

Thanks,

Tai Chang