Hai
We have just enabled the gpio_sensor_active/inactive as in ADS GPIO settings
After this we are loading the kernel and trying to run motion application for detecting , even though it is saying detected , it giving I2C ACK not received error
mx31# motion
[0] Processing thread 0 - config file /usr/etc/motion.conf
[0] Unknown config option "ffmpeg_cap_new"
[0] Unknown config option "ffmpeg_video_codec"
[0] Thread 1 is from /usr/etc/motion.conf
[1] Thread started
[1] cap.driver: "mxc_v4l2"
[1] cap.card: ""
[1] cap.bus_info: ""
[1] cap.capabilities=0x05000005
[1] - VIDEO_CAPTURE
[1] - VIDEO_OVERLAY
[1] - READWRITE
[1] - STREAMING
[1] Unable to query input 0.
[1] VIDIOC_ENUMINPUT: Invalid argument
[1] ioctl (VIDIOCGCAP): Invalid argument
[1] Capture error calling vid_start
[1] Thread finishing...
mxc_v4l_close: release resource
mx31# dmesg
ipu: Warning: channel already initialized
Console: switching to colour frame buffer device 22x27
MXCFB_EPSON MXCFB_EPSON.0: MXCFB_EPSON registered
fb1: Virtual frame buffer device, using 1024K of video memory
Real TIme clock Driver v1.0
MXC WatchDog Driver 2.0
MXC Watchdog # 0 Timer: initial timeout 60 sec
Serial: MXC Internal UART driver
mxcintuart.0: ttymxc0 at MMIO 0x43f90000 (irq = 45) is a Freescale MXC
mxcintuart.1: ttymxc1 at MMIO 0x43f94000 (irq = 32) is a Freescale MXC
mxcintuart.2: ttymxc2 at MMIO 0x5000c000 (irq = 18) is a Freescale MXC
mxcintuart.4: ttymxc4 at MMIO 0x43fb4000 (irq = 47) is a Freescale MXC
RAMDISK driver initialized: 16 RAM disks of 16384K size 1024 blocksize
loop: loaded (max 8 devices)
Linux video capture interface: v2.00
sensor_active
sensor_select 0
i2c-core: driver [MT9V111 Client] registered
i2c_adapter i2c-0: client [mt9v111 I2C dev] registered with bus id 0-0090
MXC Video Output MXC Video Output.0: Registered device video16
MXC MTD nor Driver 2.0
mxc_nor_flash.0: Found 1 x16 devices at 0x0 in 16-bit bank
mxc_nor_flash.0: Found an alias at 0x200000 for the chip at 0x0
mxc_nor_flash.0: Found an alias at 0x400000 for the chip at 0x0
mxc_nor_flash.0: Found an alias at 0x600000 for the chip at 0x0
mxc_nor_flash.0: Found an alias at 0x800000 for the chip at 0x0
mxc_nor_flash.0: Found an alias at 0xa00000 for the chip at 0x0
mxc_nor_flash.0: Found an alias at 0xc00000 for the chip at 0x0
mxc_nor_flash.0: Found an alias at 0xe00000 for the chip at 0x0
mxc_nor_flash.0: Found an alias at 0x1000000 for the chip at 0x0
mxc_nor_flash.0: Found an alias at 0x1200000 for the chip at 0x0
mxc_nor_flash.0: Found an alias at 0x1400000 for the chip at 0x0
mxc_nor_flash.0: Found an alias at 0x1600000 for the chip at 0x0
mxc_nor_flash.0: Found an alias at 0x1800000 for the chip at 0x0
mxc_nor_flash.0: Found an alias at 0x1a00000 for the chip at 0x0
mxc_nor_flash.0: Found an alias at 0x1c00000 for the chip at 0x0
mxc_nor_flash.0: Found an alias at 0x1e00000 for the chip at 0x0
Support for command set 0003 not present
gen_probe: No supported Vendor Command Set found
mxc_nor_flash: probe of mxc_nor_flash.0 failed with error -5
MXC MTD nand Driver 2.0
NAND device: Manufacturer ID: 0x20, Chip ID: 0x76 (ST Micro NAND 64MiB 3,3V 8-bit)
Scanning device for bad blocks
Bad eraseblock 0 at 0x00000000
Creating 4 MTD partitions on "NAND 64MiB 3,3V 8-bit":
0x00000000-0x00200000 : "nand.kernel"
0x00200000-0x04000000 : "nand.rootfs"
0x00000000-0x04000000 : "<NULL>"
0x00000000-0x04000000 : "<NULL>"
usbmon: debugfs is not available
Initializing USB Mass Storage driver...
usbcore: registered new interface driver usb-storage
USB Mass Storage support registered.
mice: PS/2 mouse device common for all mice
i2c /dev entries driver
i2c-core: driver [dev_driver] registered
i2c-dev: adapter [MXC I2C Adapter] registered as minor 0
Driver for 1-wire Dallas network protocol.
Serial: MXC OWire driver
IPU Post-filter loading
SSI module loaded successfully
PMIC Audio driver loading...
PMIC Battery successfully probed
PMIC Connectivity driver loading..
DVFS & DPTC: using 27MHz CKIH table
DPTC controller initialized
DVFS controller initialized
DVFS frequency #0: 532000000
DVFS frequency #1: 266000000
DVFS frequency #2: 133000000
DVFS frequency #3: 133000000
RNG Driver: Loading
SEC: mxc_sec_mod_init() called
MXC MMC/SD driver
mxcmci-0 found
Advanced Linux Sound Architecture Driver Version 1.0.13 (Tue Nov 28 14:07:24 2006 UTC).
Control ALSA component registered
ALSA device list:
#0: MXC Freescale with PMIC
oprofile: using arm/arm11
TCP cubic registered
NET: Registered protocol family 1
NET: Registered protocol family 17
ieee80211: 802.11 data/management/control stack, git-1.1.13
ieee80211: Copyright (C) 2004-2005 Intel Corporation <jketreno@linux.intel.com>
ieee80211_crypt: registered algorithm 'NULL'
Power Management for Freescale MX31
VFP support v0.3: implementor 41 architecture 1 part 20 variant b rev 2
input: mxc_ts as /class/input/input0
mxc input touchscreen loaded
eth0: SMSC911x/921x identified at 0xc7a00000, IRQ: 90
eth0: SMSC911x MAC Address: 00:08:ee:01:86:71
eth0: link down
IP-Config: Complete:
device=eth0, addr=192.168.50.172, mask=255.255.255.0, gw=192.168.50.1,
host=192.168.50.172, domain=, nis-domain=(none),
bootserver=192.168.50.1, rootserver=192.168.50.247, rootpath=
Looking up port of RPC 100003/2 on 192.168.50.247
eth0: link up, 100Mbps, full-duplex, lpa 0x05E1
Looking up port of RPC 100005/1 on 192.168.50.247
VFS: Mounted root (nfs filesystem).
Freeing init memory: 120K
driver isp1504_arc, Revision: 1.0
XXXXXXXXXXXXXXXXXXXX pll = 197640000, usb_pdf = 1, usb_prepdf = 1, retval = 49410000
USB_CLK=49410000, should be 60MHz
i2c_adapter i2c-0: master_xfer[0] W, addr=0x90, len=1
i2c_adapter i2c-0: master_xfer[1] W, addr=0x90, len=2
/*!
* Switch to the specified sensor - MX31 SOM has none
*
*/
void gpio_sensor_select(int sensor)
{
printk("\r\n sensor_select %d \r\n", sensor);
u16 temp;
switch (sensor) {
case 0:
#ifdef CONFIG_MXC_CAMERA_MC521DA
temp = 0x100;
__raw_writew(temp, PBC_BASE_ADDRESS + PBC_BCTRL1_SET);
#else
temp = PBC_BCTRL1_SENSOR2_ON;
__raw_writew(temp, PBC_BASE_ADDRESS + PBC_BCTRL1_CLEAR);
temp = PBC_BCTRL1_SENSOR1_ON;
__raw_writew(temp, PBC_BASE_ADDRESS + PBC_BCTRL1_SET);
#endif
break;
case 1:
temp = PBC_BCTRL1_SENSOR1_ON;
__raw_writew(temp, PBC_BASE_ADDRESS + PBC_BCTRL1_CLEAR);
temp = PBC_BCTRL1_SENSOR2_ON;
__raw_writew(temp, PBC_BASE_ADDRESS + PBC_BCTRL1_SET);
break;
default:
break;
}
}
/*!
* Setup GPIO for sensor to be active
*
*/
void gpio_sensor_active(void)
{
printk("\r\n sensor_active \r\n");
gpio_sensor_select(0);
/*
* * Configure the iomuxen for the CSI.
* */
mxc_request_iomux(MX31_PIN_CSI_D4, OUTPUTCONFIG_FUNC, INPUTCONFIG_FUNC);
mxc_request_iomux(MX31_PIN_CSI_D5, OUTPUTCONFIG_FUNC, INPUTCONFIG_FUNC);
mxc_request_iomux(MX31_PIN_CSI_D6, OUTPUTCONFIG_FUNC, INPUTCONFIG_FUNC);
mxc_request_iomux(MX31_PIN_CSI_D7, OUTPUTCONFIG_FUNC, INPUTCONFIG_FUNC);
mxc_request_iomux(MX31_PIN_CSI_D8, OUTPUTCONFIG_FUNC, INPUTCONFIG_FUNC);
mxc_request_iomux(MX31_PIN_CSI_D9, OUTPUTCONFIG_FUNC, INPUTCONFIG_FUNC);
mxc_request_iomux(MX31_PIN_CSI_D10, OUTPUTCONFIG_FUNC,
INPUTCONFIG_FUNC);
mxc_request_iomux(MX31_PIN_CSI_D11, OUTPUTCONFIG_FUNC,
INPUTCONFIG_FUNC);
mxc_request_iomux(MX31_PIN_CSI_D12, OUTPUTCONFIG_FUNC,
INPUTCONFIG_FUNC);
mxc_request_iomux(MX31_PIN_CSI_D13, OUTPUTCONFIG_FUNC,
INPUTCONFIG_FUNC);
mxc_request_iomux(MX31_PIN_CSI_D14, OUTPUTCONFIG_FUNC,
INPUTCONFIG_FUNC);
mxc_request_iomux(MX31_PIN_CSI_D15, OUTPUTCONFIG_FUNC,
INPUTCONFIG_FUNC);
mxc_request_iomux(MX31_PIN_CSI_HSYNC, OUTPUTCONFIG_FUNC,
INPUTCONFIG_FUNC);
mxc_request_iomux(MX31_PIN_CSI_MCLK, OUTPUTCONFIG_FUNC,
INPUTCONFIG_FUNC);
mxc_request_iomux(MX31_PIN_CSI_PIXCLK, OUTPUTCONFIG_FUNC,
INPUTCONFIG_FUNC);
mxc_request_iomux(MX31_PIN_CSI_VSYNC, OUTPUTCONFIG_FUNC,
INPUTCONFIG_FUNC);
#ifdef CONFIG_MXC_IPU_CAMERA_16BIT
/*
* * The other 4 data bits are multiplexed on MX31.
* */
mxc_request_iomux(MX31_PIN_ATA_CS0, OUTPUTCONFIG_ALT2,
INPUTCONFIG_ALT2);
mxc_request_iomux(MX31_PIN_ATA_CS1, OUTPUTCONFIG_ALT2,
INPUTCONFIG_ALT2);
mxc_request_iomux(MX31_PIN_ATA_DIOR, OUTPUTCONFIG_ALT2,
INPUTCONFIG_ALT2);
mxc_request_iomux(MX31_PIN_ATA_DIOW, OUTPUTCONFIG_ALT2,
INPUTCONFIG_ALT2);
#endif
/*
* * Now enable the CSI buffers
* */
__raw_writew(PBC_BCTRL2_CSI_EN, PBC_BASE_ADDRESS + PBC_BCTRL2_CLEAR);
#ifdef CONFIG_MXC_IPU_CAMERA_16BIT
/*
* * Enable the other buffer for the additional 4 data bits.
* */
__raw_writew(PBC_BCTRL4_CSI_MSB_EN,
PBC_BASE_ADDRESS + PBC_BCTRL4_CLEAR);
#endif
}
EXPORT_SYMBOL(gpio_sensor_active);
/*!
* Setup GPIO for sensor to be inactive
*
*/
void gpio_sensor_inactive(void)
{
printk("\r\n sensor_inactive\r\n");
mxc_free_iomux(MX31_PIN_CSI_D4, OUTPUTCONFIG_FUNC, INPUTCONFIG_FUNC);
mxc_free_iomux(MX31_PIN_CSI_D5, OUTPUTCONFIG_FUNC, INPUTCONFIG_FUNC);
mxc_free_iomux(MX31_PIN_CSI_D6, OUTPUTCONFIG_FUNC, INPUTCONFIG_FUNC);
mxc_free_iomux(MX31_PIN_CSI_D7, OUTPUTCONFIG_FUNC, INPUTCONFIG_FUNC);
mxc_free_iomux(MX31_PIN_CSI_D8, OUTPUTCONFIG_FUNC, INPUTCONFIG_FUNC);
mxc_free_iomux(MX31_PIN_CSI_D9, OUTPUTCONFIG_FUNC, INPUTCONFIG_FUNC);
mxc_free_iomux(MX31_PIN_CSI_D10, OUTPUTCONFIG_FUNC, INPUTCONFIG_FUNC);
mxc_free_iomux(MX31_PIN_CSI_D11, OUTPUTCONFIG_FUNC, INPUTCONFIG_FUNC);
mxc_free_iomux(MX31_PIN_CSI_D12, OUTPUTCONFIG_FUNC, INPUTCONFIG_FUNC);
mxc_free_iomux(MX31_PIN_CSI_D13, OUTPUTCONFIG_FUNC, INPUTCONFIG_FUNC);
mxc_free_iomux(MX31_PIN_CSI_D14, OUTPUTCONFIG_FUNC, INPUTCONFIG_FUNC);
mxc_free_iomux(MX31_PIN_CSI_D15, OUTPUTCONFIG_FUNC, INPUTCONFIG_FUNC);
mxc_free_iomux(MX31_PIN_CSI_HSYNC, OUTPUTCONFIG_FUNC, INPUTCONFIG_FUNC);
mxc_free_iomux(MX31_PIN_CSI_MCLK, OUTPUTCONFIG_FUNC, INPUTCONFIG_FUNC);
mxc_free_iomux(MX31_PIN_CSI_PIXCLK, OUTPUTCONFIG_FUNC,
INPUTCONFIG_FUNC);
mxc_free_iomux(MX31_PIN_CSI_VSYNC, OUTPUTCONFIG_FUNC, INPUTCONFIG_FUNC);
}
EXPORT_SYMBOL(gpio_sensor_inactive);
Posted By davek on 7 Jan 2008 8:26 AM
What is the error you''re getting? I assume you have things connected to the appropriate I2C interface? There are a few changes that need to be made to the sensor_active( ) logic, since there is no mux on the lower 4 bits like on the ADS board.