Hi,
I am trying to port IMX035 sensor driver from IPNC version 2.6 software release to IPNC version 3.0.
I followed AV server design guide to do same.
Now I am facing issue with the SPI driver (IMX035 need SPI driver for configuration).
Surprisngly in the IPNC Version 2.6 i could not see SPI driver configuration for IMX035 (But release binary files are working with IMX035).
From the reference of few posts on the forum I tried some changes in the code as listed below.
1) In the Board-dm365- ipnc.c file, in structure dm365_ipnc_devices i added "&spi_device "
static struct platform_device *dm365_ipnc_devices[] __initdata = {
&serial_device,
&mmc0_device,
&nand_device,
&spi_device,
&rtc_device,
};
2) Along with this I added below required structure definations
static struct davinci_spi_platform_data dm365_spi_pdata = {
.version = DAVINCI_SPI_VERSION_1,
.num_chipselect = 2,
.clk_name = "SPICLK",
};
static struct resource dm3xx_spi_resources[] = {
[0] = {
.start = DM3XX_SPI0_BASE,
.end = DM3XX_SPI0_BASE + (SZ_4K/2) - 1,
.flags = IORESOURCE_MEM,
},
[1] = {
.start = IRQ_DM3XX_SPINT0_0,
.end = IRQ_DM3XX_SPINT0_0,
.flags = IORESOURCE_IRQ,
},
/* No DMA for SPI on DM355 */
};
static struct platform_device spi_device = {
.name = "dm_spi",
.id = 0,
.resource = dm3xx_spi_resources,
.num_resources = ARRAY_SIZE(dm3xx_spi_resources),
.dev = {
.platform_data = &dm365_spi_pdata,
},
};
In davinci_spi_platform_data structure below are the member variables, of which clk_info i have not initialized. And because of this my software gets hangs at clk_enable(pdata->clk_info) function in davinci_spi_master.c file.
struct davinci_spi_platform_data {
u8 version;
u16 num_chipselect;
u8 *chip_sel;
char *clk_name;
struct clk *clk_info;
};
----------------------------------------------------------------------------------------------------------------------
For debug purpose when i commented clk_enable i get below boot log,
DM36x initialization passed!
TI UBL Base Version: 1.50
Boot Loader BootMode = NAND
Starting NAND Copy...
Valid magicnum, 0xA1ACED66, found in block 0x00000008.
Boot Mode Task Completed
IPNC UBL Version: 2.0.0
Platform: DM365
Reset RTC Fail..
Jumping to entry point at 0x81080000
U-Boot 1.3.4 (Feb 28 2012 - 15:01:39) DM365-IPNC-2.0.0
I2C: ready
DRAM: 128 MB
NAND: NAND device: Manufacturer ID: 0xec, Chip ID: 0x75 (Samsung NAND 32MiB 3,)
Bad block table found at page 65504, version 0x00
Bad block table found at page 65472, version 0x00
32 MiB
In: serial
Out: serial
Err: serial
ARM Clock :- 297MHz
DDR Clock :- 270MHz
Ethernet PHY: GENERIC @ 0x01
Hit any key to stop autoboot: 0
Loading from NAND 32MiB 3,3V 8-bit, offset 0x200000
Image Name: Linux-2.6.18_pro500-davinci_IPNC
Image Type: ARM Linux Kernel Image (uncompressed)
Data Size: 3976736 Bytes = 3.8 MB
Load Address: 80008000
Entry Point: 80008000
## Booting kernel from Legacy Image at 80700000 ...
Image Name: Linux-2.6.18_pro500-davinci_IPNC
Image Type: ARM Linux Kernel Image (uncompressed)
Data Size: 3976736 Bytes = 3.8 MB
Load Address: 80008000
Entry Point: 80008000
Loading Kernel Image ... OK
OK
Starting kernel ...
Linux version 2.6.18_pro500-davinci_IPNC_DM368_2.6.0 (root@pandurang-desktop) (2
CPU: ARM926EJ-S [41069265] revision 5 (ARMv5TEJ), cr=00053177
Machine: DaVinci DM365 IPNC
Memory policy: ECC disabled, Data cache writeback
DaVinci DM0365 variant 0x8
PLL0: fixedrate: 24000000, commonrate: 135000000, vpssrate: 270000000
PLL0: vencrate_sd: 27000000, ddrrate: 270000000 mmcsdrate: 49090909
PLL1: armrate: 297000000, voicerate: 118800000, vencrate_hd: 74250000
CPU0: D VIVT write-back cache
CPU0: I cache: 16384 bytes, associativity 4, 32 byte lines, 128 sets
CPU0: D cache: 8192 bytes, associativity 4, 32 byte lines, 64 sets
Built 1 zonelists. Total pages: 12288
Kernel command line: mem=48M console=ttyS0,115200n8 root=/dev/mtdblock3 rootfst"
PID hash table entries: 256 (order: 8, 1024 bytes)
Clock event device timer0_0 configured with caps set: 07
Console: colour dummy device 80x30
Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)
Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)
Memory: 48MB = 48MB total
Memory: 44544KB available (3213K code, 682K data, 180K init)
Calibrating delay loop (skipped)... 148.27 BogoMIPS preset
Security Framework v1.0.0 initialized
Capability LSM initialized
Mount-cache hash table entries: 512
CPU: Testing write buffer coherency: ok
NET: Registered protocol family 16
DaVinci: 104 gpio irqs
MUX: initialized GPIO20
MUX: initialized I2C_SCL
Generic PHY: Registered new driver
ch0 default output "COMPOSITE", mode "NTSC"
VPBE Encoder Initialized
SCSI subsystem initialized
NET: Registered protocol family 2
IP route cache hash table entries: 512 (order: -1, 2048 bytes)
TCP established hash table entries: 2048 (order: 1, 8192 bytes)
TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
TCP: Hash tables configured (established 2048 bind 1024)
TCP reno registered
VFS: Disk quotas dquot_6.5.1
Dquot-cache hash table entries: 1024 (order 0, 4096 bytes)
squashfs: version 3.1 (2006/08/19) Phillip Lougher
JFFS2 version 2.2. (NAND) (C) 2001-2006 Red Hat, Inc.
yaffs May 22 2012 16:21:22 Installing.
SGI XFS with no debug enabled
Initializing Cryptographic API
io scheduler noop registered
io scheduler anticipatory registered (default)
LTT : ltt-facilities init
LTT : ltt-facility-core init in kernel
CSL: Module install successful, device major num = 253
CSL: Module version 0.10.00, built on May 22 2012 16:14:24
I2C: Module install successful, device major num = 252
DMA: Module install successful, device major num = 251
DRV: Module install successful
DRV: Module built on May 22 2012 16:14:26
DRV: EDMACC.QUEPRI = 00002777
DRV: SYSTEM.MSTPRI0 = 00440011
DRV: SYSTEM.MSTPRI1 = 00000444
DRV: ISP.BCR = 00000002
DRV: SYSTEM.MISC = 00000399
EDMAK module: built on May 22 2012 at 16:14:11
Reference Linux version 2.6.18
File /home/pandurang/IP_CAMERA/IPNetCam_3_0/dvsdk_ipnctools/linuxutils_2_24_0c
IRQK module: built on May 22 2012 at 16:14:12
Reference Linux version 2.6.18
File /home/pandurang/IP_CAMERA/IPNetCam_3_0/dvsdk_ipnctools/linuxutils_2_24_0c
irqk initialized
CMEMK module: built on May 22 2012 at 16:14:10
Reference Linux version 2.6.18
File /home/pandurang/IP_CAMERA/IPNetCam_3_0/dvsdk_ipnctools/linuxutils_2_24_0c
allocated heap buffer 0xc4000000 of size 0x5000000
CMEM Range Overlaps Kernel Physical - allowing overlap
CMEM phys_start (0x1000) overlaps kernel (0x80000000 -> 0x83000000)
cmemk initialized
DAVINCI-WDT: DaVinci Watchdog Timer: heartbeat 60 sec
Serial: 8250/16550 driver $Revision: 1.90 $ 2 ports, IRQ sharing disabled
serial8250.0: ttyS0 at MMIO map 0x1d06000 mem 0xfbd06000 (irq = 41) is a 16550A
RAMDISK driver initialized: 1 RAM disks of 32768K size 1024 blocksize
Linux video capture interface: v2.00
Trying to register davinci display video device.
layer=c0622800,layer->video_dev=c0622960
Trying to register davinci display video device.
layer=c0622600,layer->video_dev=c0622760
davinci_init:DaVinci V4L2 Display Driver V1.0 loaded
i2c /dev entries driver
nand_davinci nand_davinci.0: Using 4-bit hardware ECC
NAND device: Manufacturer ID: 0xec, Chip ID: 0x75 (Samsung NAND 32MiB 3,3V 8-bi)
Creating 6 MTD partitions on "nand_davinci.0":
0x00000000-0x00080000 : "bootloader"
0x00080000-0x00200000 : "params"
0x00200000-0x00600000 : "kernel"
0x00600000-0x01e00000 : "filesystem"
0x01e00000-0x02000000 : "data1"
0x02000000-0x02000000 : "data2"
mtd: partition "data2" is out of reach -- disabled
nand_davinci nand_davinci.0: hardware revision: 2.3
dm_spi.0: davinci SPI Controller driver at 0xc386e000 (irq = 42) use_dma=0
rtc_davinci_dm365 rtc_davinci_dm365.0: rtc intf: proc
rtc_davinci_dm365 rtc_davinci_dm365.0: rtc intf: dev (254:0)
rtc_davinci_dm365 rtc_davinci_dm365.0: rtc core: registered rtc_davinci_dm365 a0
rtc wait time out !!!!!
rtc wait time out !!!!!
rtc wait time out !!!!!
rtc wait time out !!!!!
rtc wait time out !!!!!
rtc wait time out !!!!!
rtc wait time out !!!!!
rtc wait time out !!!!!
Advanced Linux Sound Architecture Driver Version 1.0.12rc1 (Thu Jun 22 13:55:50.
ASoC version 0.13.1
CQ0093 Voice Codec 0.1
asoc: cq93vc <-> davinci-vcif mapping ok
ALSA device list:
#0: On-chip voice codec (cq93vc)
IPv4 over IPv4 tunneling driver
TCP bic registered
NET: Registered protocol family 1
NET: Registered protocol family 17
rtc wait time out !!!!!
rtc wait time out !!!!!
rtc wait time out !!!!!
rtc wait time out !!!!!
rtc wait time out !!!!!
rtc wait time out !!!!!
rtc wait time out !!!!!
rtc wait time out !!!!!
rtc wait time out !!!!!
rtc wait time out !!!!!
rtc wait time out !!!!!
rtc wait time out !!!!!
rtc wait time out !!!!!
rtc wait time out !!!!!
rtc wait time out !!!!!
rtc wait time out !!!!!
rtc wait time out !!!!!
rtc wait time out !!!!!
rtc wait time out !!!!!
rtc wait time out !!!!!
rtc wait time out !!!!!
rtc wait time out !!!!!
rtc wait time out !!!!!
rtc wait time out !!!!!
rtc wait time out !!!!!
rtc wait time out !!!!!
Time: timer0_1 clocksource has been installed.
Clock event device timer0_0 configured with caps set: 08
Switched to high resolution mode on CPU 0
rtc_davinci_dm365 rtc_davinci_dm365.0: setting the system clock to 2000-09-14 0)
VFS: Mounted root (squashfs filesystem) readonly.
Freeing init memory: 180K
INIT: version 2.86 booting
jffs2_scan_dirent_node(): Name CRC failed on node at 0x0010c3d4: Read 0x144e50c7
Creat queue id:0
queue id:0
FileMngThread created
Creat queue id:32769
queue id:32769
AlramThread created
Share memory init success
queue id:32769
Creat queue id:65538
queue id:65538
Creat queue id:98307
queue id:98307
IPNC_DM368_2.6.0 (root@pandurang-desktop) (gcc version 4.2.0 (M
queue id:65538
Setting up networking ...rm: unable to remove `/etc/network/run': Read-only film
CPU is DM365
*****************************************************************
IPNC BUILD VERSION: DM365 IPNC REF DESIGN VERSION 3.00.00.10
*****************************************************************
./av_server.out DM365 NTSC APPRO2A AEWB 720P H264 4000000 VBR AUTO MENUOFF &
Check_device_version : DEVICE VER = 0 !!
log status
Starting portmap daemon: CPU CurrentStatus is = 0
log status
portmapApproDrvInit: 7
Creat queue id:131076
queue id:131076
start_daemon
ApproDrvInit: 9
queue id:131076
ApproDrvInit: 8
queue id:131076
ApproDrvInit: 2
queue id:131076
ApproDrvInit: 6
queue id:131076
ApproDrvInit: 10
queue id:131076
Selected sensor is 720P
AVSERVER UI: Initializing.
CLK Hz,
ARM Hz = 297000000
DDR Hz = 270000000
VPSS Hz = 270000000
IMCOP Hz = 270000000
DRV LDC: GetConfig 0004 0x0
ldcInFrameWidth:0
[OSA_FILE ] Reading file [/mnt/nand/IMG_Paramset.bin] ... ERROR
IMAGE TUNE: Paramset File is not available..... Setting DEFAULT parameter
SYSTEM.MSTPRI0 value changed to 00440011
CONFIGURING MY AVSERVER FOR DM365 .....
queue id:65538
$$$$$$$$$$$$ 1280X1024 $$$$$$$$$$$$
$$$$$$$$$$$$ DRV_imgsOpen sxga $$$$$$$$$$$$
########## 1584X1119 ############
$$$$$$$$$$$$$$ VID0:1000
ERROR (drv_imgs_IMX035_1_3MP.c|DRV_imgsOpen|132): DRV_spiOpen()
ERROR (drv_capture.c|DRV_captureOpen|63): Open failed
ERROR (videoCaptureThr.c|VIDEO_captureTskCreate|87): DRV_captureOpen()
ERROR (videoCaptureThr.c|VIDEO_captureTskMain|745): VIDEO_captureTskCreate()
/opt/ipnc/modules/init.d_ins/portmap: /opt/ipnc/modules/init.d_ins/portmap: 162m
log success
.
log status
log status
Starting mounting local filesystems: log status
mount none on /dev/shm type tmpfs (rw,size=5M)
none on /var/run type tmpfs (rw)
none on /tmp type tmpfs (rw,sync)
log success
log status
Starting hotplug subsystem:
usb
usb [success]
input
input [success]
done.
loop: loaded (max 8 devices)
tun: Universal TUN/TAP device driver, 1.6
tun: (C) 1999-2004 Max Krasnyansky <maxk@qualcomm.com>
CSLIP: code copyright 1989 Regents of the University of California
netconsole: not configured, aborting
PPP generic driver version 2.4.2
PPP Deflate Compression module registered
Starting internet superserver: inetd.
sbulla: unknown partition table
davinci-mmc davinci-mmc.0: Supporting 4-bit mode
davinci-mmc davinci-mmc.0: Using DMA mode
MontaVista(R) Linux(R) Professional Edition 5.0.0 (0702774)
usbcore: registered new driver hub
DM365_IPNC login: root (automatic login)eral, debug=0
musb_hdrc musb_hdrc: No DMA interrupt line
musb_hdrc: USB Peripheral mode controller at c3906000 using DMA, IRQ 12
Welcome to MontaVista(R) Linux(R) Professional Edition 5.0.0 (0702774).tcp)
sbulla: unknown partition table
login[674]: root login on `ttyS0'
unable to get drive geometry, using default 255/63
# ev/sbulla has 255 heads and 63 sectors per track,
logical sector size is 512,
using 0xf8 media descriptor, with 1024 sectors;
file system has 2 12-bit FATs and 4 sectors per cluster.
FAT size is 1 sector, and provides 247 clusters.
Root directory contains 512 slots.
Volume ID is 35cc7ab5, no volume label.
queue id:0
TimeOut occure in boot_proc.
Program exit.
Failed to get index for interface name 'eth0': No such device
ApproDrvInit: 3
queue id:131076
At this stage I need help on initialization of spi relevant data structures i.e. davinci_spi_platform_data.
I would appreciate if some one can share relevant references for the same.
Regards,
panshi