Forums » Software Development »
I2C Board Support Package
Added by John Mladenik about 14 years ago
Our software guy is trying to use your I2C board support to drive the I2C devices we have connected to the OMAP's I2C bis. Is this for the I2C on the OMAP or for the I2C driver in the FPGA? We have our hardware connected to the I2C port on the OMAP and do not have an I2C in our FPGA.
Replies (37)
RE: I2C Board Support Package - Added by Michael Williamson about 14 years ago
Which I2C port are you trying to use, I2C0 or I2C1? If you are trying to use I2C0, then you should be able to use the i2c-tools (i2cset, i2cdump, etc) and direct access to bus 1. If you are using I2C1, then the kernel will need to be modified to disable the UART (2 I believe) and enable the I2C peripheral driver for the port.
root@mityomapl138:~# i2cdump 1 0x37
(the above example would dump I2c device at address 0x37)
If you don't have the commands then do an "opkg install i2c-tools".
-Mike
RE: I2C Board Support Package - Added by Thomas Catalino about 14 years ago
Hi John -
I believe you are looking at using the I2C driver we provide under the FPGA directory. This driver is indeed used for an FPGA based I2C core and not the I2C provided on the OMAP itself.
See Mike's post about how to get to the I2C driver for the onboard OMAP I2C driver ...
Tom
RE: I2C Board Support Package - Added by John Mladenik about 14 years ago
Mike
We are using the TI I2C tools and our hardware uses I2C0 but we get all X's when doing a dump from the I2C address of one of our devices on the I2C0 bus.
I have not been able to get the TI tool onto my system so I can instrument the hardware to see if the I2C buss is even toggling at all. I get this when I run the install commands:
root@john2:~# opkg upgrade
root@john2:~# opkg install i2c-tools
Collected errors:
* opkg_install_cmd: Cannot install package i2c-tools.
I am on a PC and the board is connected to my switch.
John
RE: I2C Board Support Package - Added by Michael Williamson about 14 years ago
Ok. Sounds like you have i2cdump, right? What is the device you are using? The address is sometimes non-obvious to pass to the i2c utilities. My guess is that the address field is not what the tools/driver is looking for.
-Mike
RE: I2C Board Support Package - Added by John Mladenik about 14 years ago
Well our software guy has the i2cdump, I have not been able to get it loaded on m system yet as I indicated in my previous post.
We are trying to talk to the TI Audio chip the TLV320DAC3120 which has an I2C address of 0011 000. The I2C address is a 7 bit address and the LSB bit is the read/write bit to fill in the 8 bit field. The I2Cdump limits the address from 0x3-0x77 so I think that it wants the 7 bit address which makes it 0x18. When doing a dump from 0x18 the software returns all X's.
I want to instrument the I2C bus but I can not get the tools to load on my platform.
RE: I2C Board Support Package - Added by John Mladenik about 14 years ago
Ok I got the I2C tools loaded and working. Out issue is that the SYS_RESET_N ( GP514 )signal that comes from the OMAP is always lowing holding the Audio chip in reset. I connected this to our audio chip only because you connected it to your audio chip. Does your audio driver pull this high?
It seems like you would want this to be pulled high immediately after power-up.
John
RE: I2C Board Support Package - Added by Michael Williamson about 14 years ago
If you look in the most recent version of the kernel in the arch/arm/mach-davinci/board-mityomapl138.c, the gpio pin is being asserted and then pulled high in the mityomapl138_set_mcasp() routine.
Look for the text "SYSTEM_RESET" and you should see the pin setup and gpio calls. You will need these calls in your port.
-Mike
RE: I2C Board Support Package - Added by Dennis Volper about 14 years ago
Tried to patch the changes from that file into the kernel posted under Files on this site. Syntax errors on DA850_GPI05_14 and SYSTEM_RESET. Since I still can't "git" could you post a copy of the "most recent version of the kernel". I'll patch our changes for the LCDC into the new version.
RE: I2C Board Support Package - Added by Thomas Catalino about 14 years ago
Hi Simon -
The latest version of our kernel is included in the tarball on the BSP wiki page located here:
http://support.criticallink.com/redmine/projects/arm9-platforms/wiki/Board_Support_Package
Tom
RE: I2C Board Support Package - Added by Dennis Volper about 14 years ago
Got the new kernel. Compiled and loaded it onto the board. Most things work, but i2cdump seems to have changed. My hardware person (aka John) indicates that his analyzer no longer sees the bus toggle when the dump command is run. /sys/devices/platform/i2c_davinci.1 is there. Any hints on what we've done wrong?
RE: I2C Board Support Package - Added by Dennis Volper almost 14 years ago
I tried the following experiment. On an Industrial I/O board I replaced the Rev A OMAP card with a fresh out of the package card with a white tag "L138F". Verified the existance of /dev/i2c-1, enabled the network, opkg'd in the i2c-tools, ran "i2cdump 1 0x38" (we dumped this address when working on getting the LCD running). The dump gave me all X's; no timeout messages. Any hints where I should be looking?
RE: I2C Board Support Package - Added by Michael Williamson almost 14 years ago
Hi Dennis,
Which Revision of the Industrial I/O are you using? Rev A Industrial I/O boards have the I2C port of the video hooked through the FPGA, not I2C0 on the OMAP, so you won't get a valid response if you are using a Rev A industrial I/O board.
When u-Boot loads up (on power up or on reset), the I2C0 bus is read to get the factory configuration data (serial number, MAC address, etc.) from a small onboard prom. You can dump this information out in u-boot ("factoryconfig") as well as use the i2c utilities in u-Boot to forcibly probe i2c0 ("i2c probe") to find local addresses attached to the bus (48-57 show up due to the onboard prom and the on-board power controller). You can also use this to query devices on the bus. This might shed some light as to what the i2c0 device thinks it can see (and John can look at the bus lines as well).
If you have success using u-Boot, then at least we know it's a software problem (the kernel). I haven't seen this behavior with any other board sets here, so I'm not entirely sure yet how to trouble shoot it.
-Mike
RE: I2C Board Support Package - Added by Dennis Volper almost 14 years ago
factoryconfig Our (John's board) I I/O board Config version 0.0 1.1 Mac Addr 00:00:00:00:00:00 00:50:c2:BF:84:4D Serial# 0 100280 FPGA Type 0 2 [XC6SUX16] Part # 80-000258RC-1 Rev B i2c probe 48, 50,...57 48,50...57
Looks like we don't have an onboard prom on the board. The MAC our board shows to other systems is 0E:4A:ED:65:F7:F9, which is probably coming out of the chip controller. The old kernel (circa July) John was seeing activity on the bus lines and had determined that the reset line was being held high. I switched to the new kernel because it had the reset stuff in it, but the new kernel shows no activity on any of the i2c lines. Could it be something like pinmux used to be done in the kernel and is now supposed to be done in uboot?
RE: I2C Board Support Package - Added by Michael Williamson almost 14 years ago
My guess is that the MAC is a random MAC generated by the kernel because all zeros is an illegal MAC (check the kernel messages with `dmesg`, there may be a message about using a random MAC address).
The factory configuration is stored on the MityDSP-L138 part itself (on the I2C PROM). Can you switch the two MityDSP's and see if you can dump out the configuration data on the other MityDSP on the Industrial I/O board? If you can, then something on the other board must be contending either with the I2C lines (driving the low) or with the EPROM address. If the values are still zero, then something more sinister has happened as the factory config PROM would appear to have been corrupted.
For the other board, can you dump the entire uBoot startup text?
Also, for formatting on the forums, if you enclose your output with the pre html tags like:
<pre> Your Formatted Code here </pre>
it will look right on the site.
-Mike
RE: I2C Board Support Package - Added by Michael Williamson almost 14 years ago
Oh... and as far as the pinmux, the u-Boot should be configuring the pinmux for I2C0. It will always do that as it needs to read the I2C for the factory configuration, so the kernel should not need to mess with the I2C pins for pinmux.
-Mike
RE: I2C Board Support Package - Added by Dennis Volper almost 14 years ago
Odd:
Old card in Our board New card in IIO board Retry of New card in our board Config version 1.1 1.1 1.1 MAC addr 00:50:c2:BF:DF:FF 00:50:C2:BF:83:28 00:50:C2:BF:83:28 Serial 100001 100230 100230 FPGA 2 [XC6SUX16] 2 [XC6SUX16] 2 [XC6SUX16] Part # 80-000258RC-1 Rev B 80-000258RC-1 Rev B 80-000258RC-1 Rev B
So I swapped the card's back and forth a couple times. The numbers followed the card (not the board). I clueless as to why I got the first set of numbers, possibly power-cycling to swap the cards around reset something. The i2c probe still shows the same as the first try, no matter what card is in what board. Yes, there was a message about random MAC address in dmesg.
What uboot text do you want dumped. IIO board, our board, new card old card? (If that's the rev # of the card they are both the
same rev, but the connectors on them are quite different.) Do you want the dump just of the few lines before the countdown or do you want a dump of the entire boot sequence until the Linux prompt?
RE: I2C Board Support Package - Added by Michael Williamson almost 14 years ago
Hello Mr. Volper,
Are you still stuck on this issue, or did reseating the card resolve the I2C problems?
-Mike
RE: I2C Board Support Package - Added by Dennis Volper almost 14 years ago
Still stuck. The dump of the entire set of boot messages is attached. There are only two i2c messages in the boot (1) indicating the /dev entries have been set up and another indicating the Clock is disabled because it is unused. The manual says the entries for the i2c should be in PINMUX 4, I don't entries for that PINMUX in the boot. Is there a utility to check what the PINMUX settings are? Possibly I've missed something else.
OMAP-L138 initialization passed! Booting TI User Boot Loader UBL Version: 1.65 UBL Flashtype: SPI Starting SPI Memory Copy... Valid magicnum, 0x55424CBB, found at offset 0x00010000. DONE Jumping to entry point at 0xC1080000. U-Boot 2009.11-00162-g649c446 (Jun 28 2010 - 08:12:30) I2C: ready DRAM: 128 MB NAND: 256 MiB In: serial Out: serial Err: serial ARM Clock : 300000000 Hz DDR Clock : 132000000 Hz EMIFA CLock : 100000000 Hz DSP Clock : 300000000 Hz ASYNC3 Clock : 150000000 Hz Enet config : 2 Resetting ethernet phy Net: Ethernet PHY: GENERIC @ 0x03 [0x8] Hit any key to stop autoboot: 3 2 1 0 8192 KiB M25P64 at 0:0 is now current device ## Booting kernel from Legacy Image at c0700000 ... Image Name: Linux-2.6.34-rc1 Image Type: ARM Linux Kernel Image (uncompressed) Data Size: 1818168 Bytes = 1.7 MB Load Address: c0008000 Entry Point: c0008000 Verifying Checksum ... OK Loading Kernel Image ... OK OK Starting kernel ... Linux version 2.6.34-rc1 (root@cianna) (gcc version 4.3.3 (GCC) ) #32 PREEMPT Tue Oct 26 17:51:28 PDT 2010 CPU: ARM926EJ-S [41069265] revision 5 (ARMv5TEJ), cr=00053177 CPU: VIVT data cache, VIVT instruction cache Machine: MityDSP-L138 Peripheral Config Block Found Enet_Config = 2 EMAC = 00:50:C2:BF:83:28 PHYMask = 0x8 LCD Configured : COM57H5M06XRC UART[0] = 0, 0, 0, 115200 UART[1] = 1, 1, 0, 115200 UART[2] = 0, 0, 0, 115200 SPI[0] = 0, 0, 00, 0, 0 SPI[1] = 1, 1, 01, 0, 30000000 Memory policy: ECC disabled, Data cache writethrough DaVinci da850/omap-l138 variant 0x0 Built 1 zonelists in Zone order, mobility grouping on. Total pages: 24384 Kernel command line: mem=96M console=ttyS1,115200n8 mtdparts=nand:128M(rootfs),-(userfs) root=/dev/mtdblock0 rw rootfstype=jffs2 PID hash table entries: 512 (order: -1, 2048 bytes) Dentry cache hash table entries: 16384 (order: 4, 65536 bytes) Inode-cache hash table entries: 8192 (order: 3, 32768 bytes) Memory: 96MB = 96MB total Memory: 93652k/93652k available, 4652k reserved, 0K highmem Virtual kernel memory layout: vector : 0xffff0000 - 0xffff1000 ( 4 kB) fixmap : 0xfff00000 - 0xfffe0000 ( 896 kB) DMA : 0xff000000 - 0xffe00000 ( 14 MB) vmalloc : 0xc6800000 - 0xfea00000 ( 898 MB) lowmem : 0xc0000000 - 0xc6000000 ( 96 MB) modules : 0xbf000000 - 0xc0000000 ( 16 MB) .init : 0xc0008000 - 0xc0028000 ( 128 kB) .text : 0xc0028000 - 0xc034d000 (3220 kB) .data : 0xc0364000 - 0xc0385020 ( 133 kB) SLUB: Genslabs=11, HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1 Hierarchical RCU implementation. NR_IRQS:245 start_kernel(): bug: interrupts were enabled early Console: colour dummy device 80x30 Calibrating delay loop... 149.50 BogoMIPS (lpj=747520) Mount-cache hash table entries: 512 CPU: Testing write buffer coherency: ok DaVinci: 144 gpio irqs regulator: core version 0.5 NET: Registered protocol family 16 mityomapl138_init... MUX: initialized LCD_D_0 MUX: Setting register LCD_D_0 PINMUX17 (0x00000044) = 0x00000000 -> 0x00000020 MUX: initialized LCD_D_1 MUX: Setting register LCD_D_1 PINMUX17 (0x00000044) = 0x00000020 -> 0x00000022 MUX: initialized LCD_D_2 MUX: Setting register LCD_D_2 PINMUX16 (0x00000040) = 0x00000000 -> 0x20000000 MUX: initialized LCD_D_3 MUX: Setting register LCD_D_3 PINMUX16 (0x00000040) = 0x20000000 -> 0x22000000 MUX: initialized LCD_D_4 MUX: Setting register LCD_D_4 PINMUX16 (0x00000040) = 0x22000000 -> 0x22200000 MUX: initialized LCD_D_5 MUX: Setting register LCD_D_5 PINMUX16 (0x00000040) = 0x22200000 -> 0x22220000 MUX: initialized LCD_D_6 MUX: Setting register LCD_D_6 PINMUX16 (0x00000040) = 0x22220000 -> 0x22222000 MUX: initialized LCD_D_7 MUX: Setting register LCD_D_7 PINMUX16 (0x00000040) = 0x22222000 -> 0x22222200 MUX: initialized LCD_D_8 MUX: Setting register LCD_D_8 PINMUX18 (0x00000048) = 0x00000000 -> 0x00000020 MUX: initialized LCD_D_9 MUX: Setting register LCD_D_9 PINMUX18 (0x00000048) = 0x00000020 -> 0x00000022 MUX: initialized LCD_D_10 MUX: Setting register LCD_D_10 PINMUX17 (0x00000044) = 0x00000022 -> 0x20000022 MUX: initialized LCD_D_11 MUX: Setting register LCD_D_11 PINMUX17 (0x00000044) = 0x20000022 -> 0x22000022 MUX: initialized LCD_D_12 MUX: Setting register LCD_D_12 PINMUX17 (0x00000044) = 0x22000022 -> 0x22200022 MUX: initialized LCD_D_13 MUX: Setting register LCD_D_13 PINMUX17 (0x00000044) = 0x22200022 -> 0x22220022 MUX: initialized LCD_D_14 MUX: Setting register LCD_D_14 PINMUX17 (0x00000044) = 0x22220022 -> 0x22222022 MUX: initialized LCD_D_15 MUX: Setting register LCD_D_15 PINMUX17 (0x00000044) = 0x22222022 -> 0x22222222 MUX: initialized LCD_PCLK MUX: Setting register LCD_PCLK PINMUX18 (0x00000048) = 0x00000022 -> 0x02000022 MUX: initialized LCD_MCLK MUX: Setting register LCD_MCLK PINMUX18 (0x00000048) = 0x02000022 -> 0x22000022 MUX: initialized LCD_HSYNC MUX: Setting register LCD_HSYNC PINMUX19 (0x0000004c) = 0x00000000 -> 0x00000002 MUX: initialized LCD_VSYNC MUX: Setting register LCD_VSYNC PINMUX19 (0x0000004c) = 0x00000002 -> 0x00000022 MUX: initialized NLCD_AC_ENB_CS MUX: Setting register NLCD_AC_ENB_CS PINMUX19 (0x0000004c) = 0x00000022 -> 0x02000022 MUX: initialized MMCSD0_DAT_0 MUX: Setting register MMCSD0_DAT_0 PINMUX10 (0x00000028) = 0x00000000 -> 0x00000200 MUX: initialized MMCSD0_DAT_1 MUX: Setting register MMCSD0_DAT_1 PINMUX10 (0x00000028) = 0x00000200 -> 0x00002200 MUX: initialized MMCSD0_DAT_2 MUX: Setting register MMCSD0_DAT_2 PINMUX10 (0x00000028) = 0x00002200 -> 0x00022200 MUX: initialized MMCSD0_DAT_3 MUX: Setting register MMCSD0_DAT_3 PINMUX10 (0x00000028) = 0x00022200 -> 0x00222200 MUX: initialized MMCSD0_CLK MUX: Setting register MMCSD0_CLK PINMUX10 (0x00000028) = 0x00222200 -> 0x00222202 MUX: initialized MMCSD0_CMD MUX: Setting register MMCSD0_CMD PINMUX10 (0x00000028) = 0x00222202 -> 0x00222222 MUX: initialized GPIO4_0 MUX: Setting register GPIO4_0 PINMUX10 (0x00000028) = 0x00222222 -> 0x80222222 MUX: initialized GPIO4_1 MUX: Setting register GPIO4_1 PINMUX10 (0x00000028) = 0x80222222 -> 0x88222222 MUX: initialized AHCLKX MUX: Setting register AHCLKX PINMUX0 (0x00000000) = 0x00440000 -> 0x00140000 MUX: initialized ACLKX MUX: Setting register ACLKX PINMUX0 (0x00000000) = 0x00140000 -> 0x00140010 MUX: initialized AFSX MUX: Setting register AFSX PINMUX0 (0x00000000) = 0x00140010 -> 0x00141010 MUX: initialized AHCLKR MUX: Setting register AHCLKR PINMUX0 (0x00000000) = 0x00141010 -> 0x00111010 MUX: initialized ACLKR MUX: Setting register ACLKR PINMUX0 (0x00000000) = 0x00111010 -> 0x00111011 MUX: initialized AFSR MUX: Setting register AFSR PINMUX0 (0x00000000) = 0x00111011 -> 0x00111111 MUX: initialized AMUTE MUX: Setting register AMUTE PINMUX0 (0x00000000) = 0x00111111 -> 0x01111111 MUX: initialized AXR_13 MUX: Setting register AXR_13 PINMUX1 (0x00000004) = 0x00000000 -> 0x00000100 bio: create slab <bio-0> at 0 usbcore: registered new interface driver usbfs usbcore: registered new interface driver hub usbcore: registered new device driver usb regulator: VDCDC1: 1150 <--> 1350 mV at 1200 mV regulator: VDCDC2: 1710 <--> 1910 mV at 3300 mV regulator: VDCDC3: 1120 <--> 1320 mV at 1800 mV regulator: LDO1: 1800 mV regulator: LDO2: 3300 mV Switching to clocksource timer0_1 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 UDP hash table entries: 256 (order: 0, 4096 bytes) UDP-Lite hash table entries: 256 (order: 0, 4096 bytes) NET: Registered protocol family 1 RPC: Registered udp transport module. RPC: Registered tcp transport module. RPC: Registered tcp NFSv4.1 backchannel transport module. EMAC: MII PHY configured, RMII PHY will not be functional mityomapl138_init: setting phy_mask to 8 JFFS2 version 2.2. (NAND) © 2001-2006 Red Hat, Inc. msgmni has been set to 182 io scheduler noop registered (default) da8xx_lcdc da8xx_lcdc.0: GLCD: Found COM57H5M06XRC panel Console: switching to colour frame buffer device 40x30 Serial: 8250/16550 driver, 3 ports, IRQ sharing disabled serial8250.0: ttyS0 at MMIO 0x1c42000 (irq = 25) is a 16550A serial8250.0: ttyS1 at MMIO 0x1d0c000 (irq = 53) is a 16550A console [ttyS1] enabled serial8250.0: ttyS2 at MMIO 0x1d0d000 (irq = 61) is a 16550A brd: module loaded at24 1-0050: 256 byte 24c02 EEPROM (writable) NAND device: Manufacturer ID: 0x2c, Chip ID: 0xca (Micron NAND 256MiB 3,3V 16-bit) Creating 2 MTD partitions on "davinci_nand.0": 0x000000000000-0x000008000000 : "rootfs" mtd: Giving out device 0 to rootfs ftl_cs: FTL header not found. 0x000008000000-0x000010000000 : "homefs" mtd: Giving out device 1 to homefs ftl_cs: FTL header not found. davinci_nand davinci_nand.0: controller rev. 2.5 m25p80 spi1.0: m25p64 (8192 Kbytes) Creating 3 MTD partitions on "m25p80": 0x000000000000-0x000000010000 : "UBL" mtd: Giving out device 2 to UBL ftl_cs: FTL header not found. 0x000000010000-0x000000090000 : "U-Boot" mtd: Giving out device 3 to U-Boot ftl_cs: FTL header not found. 0x000000090000-0x000000800000 : "Spare" mtd: Giving out device 4 to Spare ftl_cs: FTL header not found. spi_davinci spi_davinci.1: Controller at 0xfef0e000 console [netcon0] enabled netconsole: network logging started ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver ohci ohci.0: DA8xx OHCI ohci ohci.0: new USB bus registered, assigned bus number 1 Waiting for USB PHY clock good... ohci ohci.0: irq 59, io mem 0x01e25000 usb usb1: New USB device found, idVendor=1d6b, idProduct=0001 usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1 usb usb1: Product: DA8xx OHCI usb usb1: Manufacturer: Linux 2.6.34-rc1 ohci_hcd usb usb1: SerialNumber: ohci.0 hub 1-0:1.0: USB hub found hub 1-0:1.0: 1 port detected mice: PS/2 mouse device common for all mice omap_rtc omap_rtc: rtc core: registered omap_rtc as rtc0 omap_rtc: RTC power up reset detected omap_rtc: already running i2c /dev entries driver watchdog watchdog: heartbeat 60 sec cpuidle: using governor ladder cpuidle: using governor menu usbcore: registered new interface driver usbhid usbhid: USB HID core driver TCP cubic registered NET: Registered protocol family 17 Clocks: disable unused i2c1 Clocks: disable unused emac Clocks: disable unused mcasp Clocks: disable unused mmcsd Clocks: disable unused spi0 Clocks: disable unused mcbsp0 Clocks: disable unused mcbsp1 Clocks: disable unused vpif regulator_init_complete: incomplete constraints, leaving LDO2 on regulator_init_complete: incomplete constraints, leaving LDO1 on regulator_init_complete: incomplete constraints, leaving VDCDC3 on regulator_init_complete: incomplete constraints, leaving VDCDC2 on regulator_init_complete: incomplete constraints, leaving VDCDC1 on emac-mii: probed omap_rtc omap_rtc: setting system clock to 2000-01-01 00:40:16 UTC (946687216) Empty flash at 0x02cbd8ac ends at 0x02cbe000 VFS: Mounted root (jffs2 filesystem) on device 31:0. Freeing init memory: 128K INIT: version 2.86 booting Please wait: booting... Starting udev udev: starting version 151 Remounting root file system... Caching udev devnodes Populating dev cache root: mount: mount point /proc/bus/usb does not exist Configuring network interfaces... eth0: attached PHY driver [Generic PHY] (mii_bus:phy_addr=1:03, id=40005201) done. Starting portmap daemon: portmap. net.ipv4.conf.default.rp_filter = 1 net.ipv4.conf.all.rp_filter = 1 Thu Jun 3 22:25:00 UTC 2010 INIT: Entering runlevel: 5 Starting system message bus: dbus. Starting Dropbear SSH server: dropbear. Starting syslogd/klogd: done PHY: 1:03 - Link is Up - 100/Half * Starting Avahi mDNS/DNS-SD Daemon: avahi-daemon ...done. .-------. | | .-. | | |-----.-----.-----.| | .----..-----.-----. | | | __ | ---'| '--.| .-'| | | | | | | | |--- || --'| | | ' | | | | '---'---'--'--'--. |-----''----''--' '-----'-'-'-' -' | '---' The Angstrom Distribution cianna3 ttyS1 Angstrom 2010.4-test-20100508 cianna3 ttyS1 cianna3 login:
RE: I2C Board Support Package - Added by Michael Williamson almost 14 years ago
There are 2 I2C devices on the OMAP. I2C0 and I2C1. Both are brought out to the edge connector, Which are you using?
If you are getting valid factory configuration data, then u-Boot used I2C0 successfully to read the on board EPROM and the pinmuxing is fine for the I2C0 port. If you have a scope hooked on the SDAT or SCLK lines for I2C0 during boot up (when u-Boot is starting) you should see activity on the lines.
I2C1 clocks will get shut down if the I2C1 device is not used in the kernel. That is the message you are seeing. You won't see any other messages related to i2c unless you configure a specific device for it and add it to the kernel (see the board-mityomapl138.c file for details about this, there is a regulator also attached to the I2C0 that is connected to the bus in this file).
I'll try to add more information shortly.
-Mike
RE: I2C Board Support Package - Added by John Mladenik almost 14 years ago
We are using I2C0 for both the Audio Chip and the Touch Screen Controller both of which have different I2C addresses than the EPROM
RE: I2C Board Support Package - Added by Dennis Volper almost 14 years ago
So my problem is I'm only seeing /dev/i2c-1 after the boot.
RE: I2C Board Support Package - Added by Michael Williamson almost 14 years ago
I2C0 is actually /dev/i2c-1 (bus numbering for i2c starts at 1 in the kernel, it's a bit arbitrary actually).
There should be 2 devices connected to i2c-1. One is at address 48. That is the voltage regulator. The second one is at address 50. That is the EEPROM containing factory config.
Let's try these commands (the output may be lengthy) which crawl through the /sys fs, which has a lot more detail than what shows up in /dev.
root@mitydsp # find /sys/devices/platform/i2c_davinci.1 root@mitydsp # dd if=/sys/devices/platform/i2c_davinci.1/i2c-1/1-0050/eeprom bs=1 count=128 | od -c
Below are the outputs that I get on my unit on an Indi board (though that should not matter). If your results are similar, then the i2c device has been installed by the kernel and it is capable of seeing the voltage regulator and the eeprom on board. You then need to add your audio chip and touch screen controller to the board-mityomapl138.c file in the kernel and rebuild to have your devices show up.
Please post what you get from the two commands above. Thanks.
root@mityomapl138:/sys/devices/platform/i2c_davinci.1/i2c-1/1-0050# find /sys/de vices/platform/i2c_davinci.1 /sys/devices/platform/i2c_davinci.1 /sys/devices/platform/i2c_davinci.1/uevent /sys/devices/platform/i2c_davinci.1/modalias /sys/devices/platform/i2c_davinci.1/subsystem /sys/devices/platform/i2c_davinci.1/driver /sys/devices/platform/i2c_davinci.1/i2c-1 /sys/devices/platform/i2c_davinci.1/i2c-1/uevent /sys/devices/platform/i2c_davinci.1/i2c-1/name /sys/devices/platform/i2c_davinci.1/i2c-1/new_device /sys/devices/platform/i2c_davinci.1/i2c-1/delete_device /sys/devices/platform/i2c_davinci.1/i2c-1/subsystem /sys/devices/platform/i2c_davinci.1/i2c-1/device /sys/devices/platform/i2c_davinci.1/i2c-1/1-0048 /sys/devices/platform/i2c_davinci.1/i2c-1/1-0048/uevent /sys/devices/platform/i2c_davinci.1/i2c-1/1-0048/name /sys/devices/platform/i2c_davinci.1/i2c-1/1-0048/modalias /sys/devices/platform/i2c_davinci.1/i2c-1/1-0048/subsystem /sys/devices/platform/i2c_davinci.1/i2c-1/1-0048/driver /sys/devices/platform/i2c_davinci.1/i2c-1/1-0048/regulator /sys/devices/platform/i2c_davinci.1/i2c-1/1-0048/regulator/regulator.0 /sys/devices/platform/i2c_davinci.1/i2c-1/1-0048/regulator/regulator.0/uevent /sys/devices/platform/i2c_davinci.1/i2c-1/1-0048/regulator/regulator.0/subsystem /sys/devices/platform/i2c_davinci.1/i2c-1/1-0048/regulator/regulator.0/device /sys/devices/platform/i2c_davinci.1/i2c-1/1-0048/regulator/regulator.0/name /sys/devices/platform/i2c_davinci.1/i2c-1/1-0048/regulator/regulator.0/num_users /sys/devices/platform/i2c_davinci.1/i2c-1/1-0048/regulator/regulator.0/type /sys/devices/platform/i2c_davinci.1/i2c-1/1-0048/regulator/regulator.0/microvolts /sys/devices/platform/i2c_davinci.1/i2c-1/1-0048/regulator/regulator.0/state /sys/devices/platform/i2c_davinci.1/i2c-1/1-0048/regulator/regulator.0/min_microvolts /sys/devices/platform/i2c_davinci.1/i2c-1/1-0048/regulator/regulator.0/max_microvolts /sys/devices/platform/i2c_davinci.1/i2c-1/1-0048/regulator/regulator.1 /sys/devices/platform/i2c_davinci.1/i2c-1/1-0048/regulator/regulator.1/uevent /sys/devices/platform/i2c_davinci.1/i2c-1/1-0048/regulator/regulator.1/subsystem /sys/devices/platform/i2c_davinci.1/i2c-1/1-0048/regulator/regulator.1/device /sys/devices/platform/i2c_davinci.1/i2c-1/1-0048/regulator/regulator.1/name /sys/devices/platform/i2c_davinci.1/i2c-1/1-0048/regulator/regulator.1/num_users /sys/devices/platform/i2c_davinci.1/i2c-1/1-0048/regulator/regulator.1/type /sys/devices/platform/i2c_davinci.1/i2c-1/1-0048/regulator/regulator.1/microvolts /sys/devices/platform/i2c_davinci.1/i2c-1/1-0048/regulator/regulator.1/state /sys/devices/platform/i2c_davinci.1/i2c-1/1-0048/regulator/regulator.1/min_microvolts /sys/devices/platform/i2c_davinci.1/i2c-1/1-0048/regulator/regulator.1/max_microvolts /sys/devices/platform/i2c_davinci.1/i2c-1/1-0048/regulator/regulator.2 /sys/devices/platform/i2c_davinci.1/i2c-1/1-0048/regulator/regulator.2/uevent /sys/devices/platform/i2c_davinci.1/i2c-1/1-0048/regulator/regulator.2/subsystem /sys/devices/platform/i2c_davinci.1/i2c-1/1-0048/regulator/regulator.2/device /sys/devices/platform/i2c_davinci.1/i2c-1/1-0048/regulator/regulator.2/name /sys/devices/platform/i2c_davinci.1/i2c-1/1-0048/regulator/regulator.2/num_users /sys/devices/platform/i2c_davinci.1/i2c-1/1-0048/regulator/regulator.2/type /sys/devices/platform/i2c_davinci.1/i2c-1/1-0048/regulator/regulator.2/microvolts /sys/devices/platform/i2c_davinci.1/i2c-1/1-0048/regulator/regulator.2/state /sys/devices/platform/i2c_davinci.1/i2c-1/1-0048/regulator/regulator.2/min_microvolts /sys/devices/platform/i2c_davinci.1/i2c-1/1-0048/regulator/regulator.2/max_microvolts /sys/devices/platform/i2c_davinci.1/i2c-1/1-0048/regulator/regulator.3 /sys/devices/platform/i2c_davinci.1/i2c-1/1-0048/regulator/regulator.3/uevent /sys/devices/platform/i2c_davinci.1/i2c-1/1-0048/regulator/regulator.3/subsystem /sys/devices/platform/i2c_davinci.1/i2c-1/1-0048/regulator/regulator.3/device /sys/devices/platform/i2c_davinci.1/i2c-1/1-0048/regulator/regulator.3/name /sys/devices/platform/i2c_davinci.1/i2c-1/1-0048/regulator/regulator.3/num_users /sys/devices/platform/i2c_davinci.1/i2c-1/1-0048/regulator/regulator.3/type /sys/devices/platform/i2c_davinci.1/i2c-1/1-0048/regulator/regulator.3/microvolts /sys/devices/platform/i2c_davinci.1/i2c-1/1-0048/regulator/regulator.3/state /sys/devices/platform/i2c_davinci.1/i2c-1/1-0048/regulator/regulator.3/min_microvolts /sys/devices/platform/i2c_davinci.1/i2c-1/1-0048/regulator/regulator.3/max_microvolts /sys/devices/platform/i2c_davinci.1/i2c-1/1-0048/regulator/regulator.4 /sys/devices/platform/i2c_davinci.1/i2c-1/1-0048/regulator/regulator.4/uevent /sys/devices/platform/i2c_davinci.1/i2c-1/1-0048/regulator/regulator.4/subsystem /sys/devices/platform/i2c_davinci.1/i2c-1/1-0048/regulator/regulator.4/device /sys/devices/platform/i2c_davinci.1/i2c-1/1-0048/regulator/regulator.4/name /sys/devices/platform/i2c_davinci.1/i2c-1/1-0048/regulator/regulator.4/num_users /sys/devices/platform/i2c_davinci.1/i2c-1/1-0048/regulator/regulator.4/type /sys/devices/platform/i2c_davinci.1/i2c-1/1-0048/regulator/regulator.4/microvolts /sys/devices/platform/i2c_davinci.1/i2c-1/1-0048/regulator/regulator.4/state /sys/devices/platform/i2c_davinci.1/i2c-1/1-0048/regulator/regulator.4/min_microvolts /sys/devices/platform/i2c_davinci.1/i2c-1/1-0048/regulator/regulator.4/max_microvolts /sys/devices/platform/i2c_davinci.1/i2c-1/1-0050 /sys/devices/platform/i2c_davinci.1/i2c-1/1-0050/uevent /sys/devices/platform/i2c_davinci.1/i2c-1/1-0050/name /sys/devices/platform/i2c_davinci.1/i2c-1/1-0050/modalias /sys/devices/platform/i2c_davinci.1/i2c-1/1-0050/subsystem /sys/devices/platform/i2c_davinci.1/i2c-1/1-0050/driver /sys/devices/platform/i2c_davinci.1/i2c-1/1-0050/eeprom /sys/devices/platform/i2c_davinci.1/i2c-1/i2c-dev /sys/devices/platform/i2c_davinci.1/i2c-1/i2c-dev/i2c-1 /sys/devices/platform/i2c_davinci.1/i2c-1/i2c-dev/i2c-1/uevent /sys/devices/platform/i2c_davinci.1/i2c-1/i2c-dev/i2c-1/dev /sys/devices/platform/i2c_davinci.1/i2c-1/i2c-dev/i2c-1/subsystem /sys/devices/platform/i2c_davinci.1/i2c-1/i2c-dev/i2c-1/device /sys/devices/platform/i2c_davinci.1/i2c-1/i2c-dev/i2c-1/name root@mityomapl138:/sys/devices/platform/i2c_davinci.1/i2c-1/1-0050# dd if=/sys/d evices/platform/i2c_davinci.1/i2c-1/1-0050/eeprom bs=1 count=128 | od -c 0000000 8 001 , 001 001 \0 001 \0 \0 P 302 277 203 \0 \0 0000020 002 \0 \0 \0 \0 \0 \0 \0 266 206 001 \0 8 0 - 0 0000040 0 0 2 5 8 R C - 1 R e v B \0 0000060 005 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 206 \b 377 377 0000100 377 377 377 377 377 377 377 377 377 377 377 377 377 377 377 377 * 0000200 128+0 records in 128+0 records out
RE: I2C Board Support Package - Added by Dennis Volper almost 14 years ago
Here it is:
root@cianna2:~# find /sys/devices/platform/i2c_davinci.1 /sys/devices/platform/i2c_davinci.1 /sys/devices/platform/i2c_davinci.1/uevent /sys/devices/platform/i2c_davinci.1/modalias /sys/devices/platform/i2c_davinci.1/subsystem /sys/devices/platform/i2c_davinci.1/driver /sys/devices/platform/i2c_davinci.1/i2c-1 /sys/devices/platform/i2c_davinci.1/i2c-1/uevent /sys/devices/platform/i2c_davinci.1/i2c-1/name /sys/devices/platform/i2c_davinci.1/i2c-1/new_device /sys/devices/platform/i2c_davinci.1/i2c-1/delete_device /sys/devices/platform/i2c_davinci.1/i2c-1/subsystem /sys/devices/platform/i2c_davinci.1/i2c-1/device /sys/devices/platform/i2c_davinci.1/i2c-1/1-0048 /sys/devices/platform/i2c_davinci.1/i2c-1/1-0048/uevent /sys/devices/platform/i2c_davinci.1/i2c-1/1-0048/name /sys/devices/platform/i2c_davinci.1/i2c-1/1-0048/modalias /sys/devices/platform/i2c_davinci.1/i2c-1/1-0048/subsystem /sys/devices/platform/i2c_davinci.1/i2c-1/1-0048/driver /sys/devices/platform/i2c_davinci.1/i2c-1/1-0048/regulator /sys/devices/platform/i2c_davinci.1/i2c-1/1-0048/regulator/regulator.0 /sys/devices/platform/i2c_davinci.1/i2c-1/1-0048/regulator/regulator.0/uevent /sys/devices/platform/i2c_davinci.1/i2c-1/1-0048/regulator/regulator.0/subsystem /sys/devices/platform/i2c_davinci.1/i2c-1/1-0048/regulator/regulator.0/device /sys/devices/platform/i2c_davinci.1/i2c-1/1-0048/regulator/regulator.0/name /sys/devices/platform/i2c_davinci.1/i2c-1/1-0048/regulator/regulator.0/num_users /sys/devices/platform/i2c_davinci.1/i2c-1/1-0048/regulator/regulator.0/type /sys/devices/platform/i2c_davinci.1/i2c-1/1-0048/regulator/regulator.0/microvolts /sys/devices/platform/i2c_davinci.1/i2c-1/1-0048/regulator/regulator.0/state /sys/devices/platform/i2c_davinci.1/i2c-1/1-0048/regulator/regulator.0/min_microvolts /sys/devices/platform/i2c_davinci.1/i2c-1/1-0048/regulator/regulator.0/max_microvolts /sys/devices/platform/i2c_davinci.1/i2c-1/1-0048/regulator/regulator.1 /sys/devices/platform/i2c_davinci.1/i2c-1/1-0048/regulator/regulator.1/uevent /sys/devices/platform/i2c_davinci.1/i2c-1/1-0048/regulator/regulator.1/subsystem /sys/devices/platform/i2c_davinci.1/i2c-1/1-0048/regulator/regulator.1/device /sys/devices/platform/i2c_davinci.1/i2c-1/1-0048/regulator/regulator.1/name /sys/devices/platform/i2c_davinci.1/i2c-1/1-0048/regulator/regulator.1/num_users /sys/devices/platform/i2c_davinci.1/i2c-1/1-0048/regulator/regulator.1/type /sys/devices/platform/i2c_davinci.1/i2c-1/1-0048/regulator/regulator.1/microvolts /sys/devices/platform/i2c_davinci.1/i2c-1/1-0048/regulator/regulator.1/state /sys/devices/platform/i2c_davinci.1/i2c-1/1-0048/regulator/regulator.1/min_microvolts /sys/devices/platform/i2c_davinci.1/i2c-1/1-0048/regulator/regulator.1/max_microvolts /sys/devices/platform/i2c_davinci.1/i2c-1/1-0048/regulator/regulator.2 /sys/devices/platform/i2c_davinci.1/i2c-1/1-0048/regulator/regulator.2/uevent /sys/devices/platform/i2c_davinci.1/i2c-1/1-0048/regulator/regulator.2/subsystem /sys/devices/platform/i2c_davinci.1/i2c-1/1-0048/regulator/regulator.2/device /sys/devices/platform/i2c_davinci.1/i2c-1/1-0048/regulator/regulator.2/name /sys/devices/platform/i2c_davinci.1/i2c-1/1-0048/regulator/regulator.2/num_users /sys/devices/platform/i2c_davinci.1/i2c-1/1-0048/regulator/regulator.2/type /sys/devices/platform/i2c_davinci.1/i2c-1/1-0048/regulator/regulator.2/microvolts /sys/devices/platform/i2c_davinci.1/i2c-1/1-0048/regulator/regulator.2/state /sys/devices/platform/i2c_davinci.1/i2c-1/1-0048/regulator/regulator.2/min_microvolts /sys/devices/platform/i2c_davinci.1/i2c-1/1-0048/regulator/regulator.2/max_microvolts /sys/devices/platform/i2c_davinci.1/i2c-1/1-0048/regulator/regulator.3 /sys/devices/platform/i2c_davinci.1/i2c-1/1-0048/regulator/regulator.3/uevent /sys/devices/platform/i2c_davinci.1/i2c-1/1-0048/regulator/regulator.3/subsystem /sys/devices/platform/i2c_davinci.1/i2c-1/1-0048/regulator/regulator.3/device /sys/devices/platform/i2c_davinci.1/i2c-1/1-0048/regulator/regulator.3/name /sys/devices/platform/i2c_davinci.1/i2c-1/1-0048/regulator/regulator.3/num_users /sys/devices/platform/i2c_davinci.1/i2c-1/1-0048/regulator/regulator.3/type /sys/devices/platform/i2c_davinci.1/i2c-1/1-0048/regulator/regulator.3/microvolts /sys/devices/platform/i2c_davinci.1/i2c-1/1-0048/regulator/regulator.3/state /sys/devices/platform/i2c_davinci.1/i2c-1/1-0048/regulator/regulator.3/min_microvolts /sys/devices/platform/i2c_davinci.1/i2c-1/1-0048/regulator/regulator.3/max_microvolts /sys/devices/platform/i2c_davinci.1/i2c-1/1-0048/regulator/regulator.4 /sys/devices/platform/i2c_davinci.1/i2c-1/1-0048/regulator/regulator.4/uevent /sys/devices/platform/i2c_davinci.1/i2c-1/1-0048/regulator/regulator.4/subsystem /sys/devices/platform/i2c_davinci.1/i2c-1/1-0048/regulator/regulator.4/device /sys/devices/platform/i2c_davinci.1/i2c-1/1-0048/regulator/regulator.4/name /sys/devices/platform/i2c_davinci.1/i2c-1/1-0048/regulator/regulator.4/num_users /sys/devices/platform/i2c_davinci.1/i2c-1/1-0048/regulator/regulator.4/type /sys/devices/platform/i2c_davinci.1/i2c-1/1-0048/regulator/regulator.4/microvolts /sys/devices/platform/i2c_davinci.1/i2c-1/1-0048/regulator/regulator.4/state /sys/devices/platform/i2c_davinci.1/i2c-1/1-0048/regulator/regulator.4/min_microvolts /sys/devices/platform/i2c_davinci.1/i2c-1/1-0048/regulator/regulator.4/max_microvolts /sys/devices/platform/i2c_davinci.1/i2c-1/1-0050 /sys/devices/platform/i2c_davinci.1/i2c-1/1-0050/uevent /sys/devices/platform/i2c_davinci.1/i2c-1/1-0050/name /sys/devices/platform/i2c_davinci.1/i2c-1/1-0050/modalias /sys/devices/platform/i2c_davinci.1/i2c-1/1-0050/subsystem /sys/devices/platform/i2c_davinci.1/i2c-1/1-0050/driver /sys/devices/platform/i2c_davinci.1/i2c-1/1-0050/eeprom /sys/devices/platform/i2c_davinci.1/i2c-1/i2c-dev /sys/devices/platform/i2c_davinci.1/i2c-1/i2c-dev/i2c-1 /sys/devices/platform/i2c_davinci.1/i2c-1/i2c-dev/i2c-1/uevent /sys/devices/platform/i2c_davinci.1/i2c-1/i2c-dev/i2c-1/dev /sys/devices/platform/i2c_davinci.1/i2c-1/i2c-dev/i2c-1/subsystem /sys/devices/platform/i2c_davinci.1/i2c-1/i2c-dev/i2c-1/device /sys/devices/platform/i2c_davinci.1/i2c-1/i2c-dev/i2c-1/name root@cianna2:~# dd if=/sys/devices/platform/i2c_davinci.1/i2c-1/1-0050/eeprom bs =1 count=128 | od -c 0000000 8 001 , 001 001 \0 001 \0 \0 P 302 277 205 M \0 \0 0000020 002 \0 \0 \0 \0 \0 \0 \0 270 207 001 \0 8 0 - 0 0000040 0 0 2 5 8 R C - 1 R e v B \0 0000060 \0 \0 ( \0 3 376 366 300 ( 027 370 \0 371 \b 377 377 0000100 377 377 377 377 377 377 377 377 377 377 377 377 377 377 377 377 * 0000200 128+0 records in 128+0 records out <\pre>
RE: I2C Board Support Package - Added by Michael Williamson almost 14 years ago
OK. Looks like your I2C0 port is up and running and is communicating with the on-board devices in the kernel.
Try running:
root@mitydsp # i2cdump -y 1 0x51
You should see data and the board part number of revision in the ascii text at the right (see below).
If that works (and it should, because it's doing the same thing as the "dd" command in the last post), then the I2C0 bus lines should be toggling, and John should be able to see them on his analyzer, and you should be able to use your external device addresses to debug / see the devices on your mainboard. You should also have someone verify that the reset line is toggling to ensure your devices are being properly reset.
I'm not sure how else to help at this point. Is the issue with the reset, or the communication of the I2C port using i2cdump?
root@mityomapl138:/sys/devices/platform/i2c_davinci.1/i2c-1/1-0050# i2cdump -y 1 0x51 No size specified (using byte-data access) 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef 00: 38 01 2c 01 01 00 01 00 00 50 c2 bf 83 20 00 00 8?,??.?..P??? .. 10: 02 00 00 00 00 00 00 00 b6 86 01 00 38 30 2d 30 ?.......???.80-0 20: 30 30 32 35 38 52 43 2d 31 20 52 65 76 20 42 00 00258RC-1 Rev B. 30: 05 00 00 00 00 00 00 00 00 00 00 00 86 08 ff ff ?...........??.. 40: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ................ 50: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ................ 60: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ................ 70: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ................ 80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ................ 90: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ................ a0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ................ b0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ................ c0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ................ d0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ................ e0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ................ f0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ................
RE: I2C Board Support Package - Added by Dennis Volper almost 14 years ago
The board rev is the same, a few differences with some of the hex codes. But doesn't the 1 in that command indicate which bus should be probed? Wouldn't that probe i2c1 instead of i2c0?