September 8, 2009

DM355 EVM and DS1340 Realtime Clock

In this article i’ll talked about using DS1340 real-time clock on the DM355 EVM board.

TI DM355 EVM board has a rtc circuit that is formed by MSP430 uC but, it is not suitable for custom design especially cost restrictive applications. Therefore rtc circuit with DS1340 inserted into I2C bus on the evm board Data Connector (DC3). Details about i2c bus on the evm board can be obtain from TMS320DM355 Evaluation Module Technical Reference on page A-25

TI DM355 EVM

Fig:1 DM355 EVM Board

DM355 EVM board can be seen In fig 1.

In this application i have used linux kernel 2.6.31-rc7 on the DM355 evm board. Unfortunately kernel 2.6.10 and kernel 2.6.18 are maintained by MontaVista have no DS1340 RTC driver for Davinci DM355 platform. Be careful about ST M41T00 (DS1340 compliant) RTC is available on kernel 2.6.10 only for PowerPC (PPC32) architecture.

SM41T00 PPC Dependency

Our process has 4 steps:
1- Obtaining Kernel Source for linux-2.6.31-rc7.
2- Configuring kernel.
3- Editing dm355 board initialization file in the kernel.
4-Compiling the kernel.

1-Kernel source can be obtain:

   $ git clone  git://git.kernel.org/pub/scm/linux/kernel/git/khilman/linux-davinci.git

2- In order to configure kernel:

   $ make ARCH=arm CROSS_COMPILE=arm_v5t_le- menuconfig

As can be seen on the picture DS1340 RTC module should be selected as static module.
DS1340 Configuration

3- And then you should edit linux-2.6.31-rc7/arch/arm/mach-davinci/board_dm355_evm.c DM355 EVM board initialization file:

$ gedit linux.2.6.31-rc7/arch/arm/mach-davinci/board-dm355-evm.c

edit dm355

then you can compile the kernel in the linux 2.6.31-rc7 kernel directory

   $ make ARCH=arm CROSS_COMPILE=arm_v5t_le- -j4 uImage

parameter at the last of make command is for spawn make process (it is useful for multi core/processor systems)

Kernel boot message after the implementation.

Starting again


Abort
DM355 EVM # tftp 0x80700000 uImage.2.6.31-rc7
TFTP from server 192.168.1.36; our IP address is 192.168.1.37
Filename 'uImage.2.6.31-rc7'.
Load address: 0x80700000
Loading: #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         ##################
done
Bytes transferred = 1752812 (1abeec hex)
DM355 EVM # bootm 0x80700000
## Booting image at 80700000 ...
   Image Name:   Linux-2.6.31-rc7-davinci1-06212-
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    1752748 Bytes =  1.7 MB
   Load Address: 80008000
   Entry Point:  80008000
   Verifying Checksum ... OK
OK

Starting kernel ...

Uncompressing Linux................................................................................
............................... done, booting the kernel.
Linux version 2.6.31-rc7-davinci1-06212-gdcfd73d-dirty (bolat@bolat-desktop) 
(gcc version 4.2.0 (MontaVista 4.2.0-16.0.32.0801914 2008-08-30)) #7 PREEMPT 
Fri Sep 4 14:12:30 EEST 2009
CPU: ARM926EJ-S [41069265] revision 5 (ARMv5TEJ), cr=00053177
CPU: VIVT data cache, VIVT instruction cache
Machine: DaVinci DM355 EVM
Memory policy: ECC disabled, Data cache writeback
DaVinci dm355 variant 0x0
Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 29464
Kernel command line: console=ttyS0,115200n8 noinitrd rw ip=192.168.1.37 
root=/dev/nfs nfsroot=192.168.1.36:/home/bolat/embedded-linux/workdir/filesys,v3 mem=116M kgdboe=6443@192.168.1.37/,6442@192.168.1.36/
PID hash table entries: 512 (order: 9, 2048 bytes)
Dentry cache hash table entries: 16384 (order: 4, 65536 bytes)
Inode-cache hash table entries: 8192 (order: 3, 32768 bytes)
Memory: 116MB = 116MB total
Memory: 113976KB available (3084K code, 294K data, 116K init, 0K highmem)
SLUB: Genslabs=11, HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
NR_IRQS:245
Console: colour dummy device 80x30
Calibrating delay loop... 107.72 BogoMIPS (lpj=538624)
Mount-cache hash table entries: 512
CPU: Testing write buffer coherency: ok
DaVinci: 104 gpio irqs
NET: Registered protocol family 16
MUX: initialized INT_EDMA_CC
MUX: Setting register INT_EDMA_CC
           INTMUX (0x00000018) = 0x00000000 -> 0x00000004
bio: create slab  at 0
SCSI subsystem initialized
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
musb_hdrc: version 6.0, pio, host, debug=0
musb_hdrc: USB Host mode controller at fec64000 using PIO, IRQ 12
musb_hdrc musb_hdrc: MUSB HDRC host driver
musb_hdrc musb_hdrc: new USB bus registered, assigned bus number 1
usb usb1: configuration #1 chosen from 1 choice
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 1 port detected
NET: Registered protocol family 2
IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
TCP established hash table entries: 4096 (order: 3, 32768 bytes)
TCP bind hash table entries: 4096 (order: 2, 16384 bytes)
TCP: Hash tables configured (established 4096 bind 4096)
TCP reno registered
NET: Registered protocol family 1
msgmni has been set to 222
io scheduler noop registered
io scheduler anticipatory registered (default)
Serial: 8250/16550 driver, 3 ports, IRQ sharing disabled
serial8250.0: ttyS0 at MMIO 0x1c20000 (irq = 40) is a 16550A
console [ttyS0] enabled
serial8250 serial8250.0: unable to register port at index 1 (IO0 MEM1c20400 IRQ41): -22
serial8250 serial8250.0: unable to register port at index 2 (IO0 MEM1e06000 IRQ14): -22
brd: module loaded
kgdb: Registered I/O driver kgdbts.
kgdbts:RUN plant and detach test
kgdbts:RUN sw breakpoint test
kgdbts:RUN bad memory access test
kgdbts:RUN singlestep test 1000 iterations
kgdbts:RUN singlestep [0/1000]
kgdbts:RUN singlestep [100/1000]
kgdbts:RUN singlestep [200/1000]
kgdbts:RUN singlestep [300/1000]
kgdbts:RUN singlestep [400/1000]
kgdbts:RUN singlestep [500/1000]
kgdbts:RUN singlestep [600/1000]
kgdbts:RUN singlestep [700/1000]
kgdbts:RUN singlestep [800/1000]
kgdbts:RUN singlestep [900/1000]
kgdbts:RUN do_fork for 100 breakpoints
dm9000 Ethernet Driver, V1.31
eth0: dm9000a at c7808000,c780c002 IRQ 65 MAC: 00:0e:99:02:c4:d4 (eeprom)
console [netcon0] enabled
netconsole: network logging started
116x: driver isp116x-hcd, 03 Nov 2005
sl811: driver sl811-hcd, 19 May 2005
r8a66597_hcd: driver r8a66597_hcd, 2009-05-26
Initializing USB Mass Storage driver...
usbcore: registered new interface driver usb-storage
USB Mass Storage support registered.
usbcore: registered new interface driver ums-alauda
usbcore: registered new interface driver ums-cypress
usbcore: registered new interface driver ums-datafab
usbcore: registered new interface driver ums-freecom
usbcore: registered new interface driver ums-isd200
usbcore: registered new interface driver ums-jumpshot
usbcore: registered new interface driver ums-karma
usbcore: registered new interface driver ums-onetouch
usbcore: registered new interface driver ums-sddr09
usbcore: registered new interface driver ums-sddr55
usbcore: registered new interface driver ums-usbat
rtc-ds1307 1-0068: rtc core: registered ds1340 as rtc0
rtc-test rtc-test.0: rtc core: registered test as rtc1
rtc-test rtc-test.1: rtc core: registered test as rtc2
i2c /dev entries driver
watchdog watchdog: heartbeat 60 sec
TCP cubic registered
NET: Registered protocol family 17
RPC: Registered udp transport module.
RPC: Registered tcp transport module.
Clocks: disable unused vpss_master
Clocks: disable unused vpss_slave
Clocks: disable unused mjcp
Clocks: disable unused uart1
Clocks: disable unused uart2
Clocks: disable unused asp0
Clocks: disable unused asp1
Clocks: disable unused mmcsd0
Clocks: disable unused mmcsd1
Clocks: disable unused spi0
Clocks: disable unused spi1
Clocks: disable unused spi2
Clocks: disable unused pwm0
Clocks: disable unused pwm1
Clocks: disable unused pwm2
Clocks: disable unused pwm3
Clocks: disable unused timer1
Clocks: disable unused timer3
Clocks: disable unused rto
rtc-ds1307 1-0068: setting system clock to 2009-09-09 09:39:05 UTC (1252489145)
eth0: link down
eth0: link up, 100Mbps, full-duplex, lpa 0x45E1
IP-Config: Guessing netmask 255.255.255.0
IP-Config: Complete:
     device=eth0, addr=192.168.1.37, mask=255.255.255.0, gw=255.255.255.255,
     host=192.168.1.37, domain=, nis-domain=(none),
     bootserver=255.255.255.255, rootserver=192.168.1.36, rootpath=
Looking up port of RPC 100003/3 on 192.168.1.36
Looking up port of RPC 100005/3 on 192.168.1.36
VFS: Mounted root (nfs filesystem) on device 0:14.
Freeing init memory: 116K
INIT: version 2.86 booting
Starting the hotplug events dispatcher: udevd.
Synthesizing the initial hotplug events...kgdb: Unregistered I/O driver kgdbts, debugger disabled.
done.
Waiting for /dev to be fully populated...done.
Activating swap...done.
Remounting root filesystem...done.
Calculating module dependencies
WARNING: Couldn't open directory /lib/modules/2.6.31-rc7-davinci1-06212-gdcfd73d-dirty: No such file or directory
FATAL: Could not open /lib/modules/2.6.31-rc7-davinci1-06212-gdcfd73d-dirty/modules.dep.temp for writing: No such file or directory
Loading modules:
Checking all file systems: fsck
fsck 1.40 (29-Jun-2007)
Mounting local filesystems: mount nothing was mounted
umount.nfs: /dev/root: not found or not mounted
Setting up networking ....
/etc/network/options is deprecated.
Setting up IP spoofing protection: rp_filter done.
Disabling IPv4 packet forwarding: done.
Disabling TCP/IP Explicit Congestion Notification: done.
Starting network interfaces: done.
Starting hotplug subsystem:
   pci
   pci      [success]
   usb
   usb      [success]
   isapnp
   isapnp   [success]
   ide
   ide      [success]
   input
   input    [success]
   scsi
   scsi     [success]
done.
Starting portmap daemon....
Cleaning: /tmp /var/lock /var/run done.
Setting pseudo-terminal access permissions...done.
Updating /etc/motd...done.
INIT: Entering runlevel: 3
Starting system log daemon: syslogd klogd.
Starting NFS common utilities: statd.
Starting internet superserver: inetd.
Starting OpenBSD Secure Shell server: sshd.

MontaVista(R) Linux(R) Professional Edition 5.0.0 (0801921)

192.168.1.37 login: root
Password:
Last login: Fri Sep  4 14:15:21 2009 on console
Linux 192.168.1.37 2.6.31-rc7-davinci1-06212-gdcfd73d-dirty #7 PREEMPT Fri Sep 4 14:12:30 EEST 2009 armv5tejl GNU/Linux

Welcome to MontaVista(R) Linux(R) Professional Edition 5.0.0 (0801921).

root@192.168.1.37:~#

Incidentally, in order to set RTC time and date

   # hwclock --set --date="09/09/2009 09:46:05" 
« Newer Posts

Powered by WordPress