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.

Linux/PROCESSOR-SDK-AM335X: need help on testing i2c-controller driver I2c-timeout error seen

Part Number: PROCESSOR-SDK-AM335X
Other Parts Discussed in Thread: TPS65217

Tool/software: Linux

Hi

Team
I am trying to test my i2c-omap.c driver on the beagle bone black board

I am using the default driver present 

insmod   install
[techveda@BBBlack:]# insmod i2c-original.ko
[   24.326899] tps65217 0-0024: TPS65217 ID 0xe version 1.2
[   24.333257] omap_i2c 44e0b000.i2c: bus 0 rev0.11 at 400 kHz
[   24.356118] omap_i2c 4802a000.i2c: bus 1 rev0.11 at 100 kHz
[   24.373599] omap_i2c 4819c000.i2c: bus 2 rev0.11 at 100 kHz
I am using the following application for testing this
i am Sure the i2c-omap driver is inserted


But when i try to run my applcation i get a timeout error
as below
ERROR: write() failed
[techveda@BBBlack:]# ./i2c50

SUCCESS: open(3) passed

SUCCESS: ioctl(fd, I2C_SLAVE, 0x50>>1) passed

Performing EEPROM Write operation
[  172.058433] omap_i2c 4in my code in 819c000.i2c: controller timed out
[  173.098410] omap_i2c 4819c000.i2c: controller timed out
ERROR: write() failed
[techveda@BBBlack:]#
[techveda@BBBlack:]#

Not sure what is wrong as per the patch from the source link

patchwork.kernel.org/.../

i have modified the delay to 6*1000 
KIndly please help me out my application i have attached
Let me know if any another application to be used in case

I just wanna write the bytes to eeprom that is internally present and read back

as from the dtsi file i find the base_eeprom

&i2c2 {
	pinctrl-names = "default";
	pinctrl-0 = <&i2c2_pins>;

	status = "okay";
	clock-frequency = <100000>;
	
	cape_eeprom0: cape_eeprom0@54 {
		compatible = "at,24c256";
		reg = <0x54>;
		#address-cells = <1>;
		#size-cells = <1>;
		cape0_data: cape_data@0 {
			reg = <0 0x100>;
		};
	};

	cape_eeprom1: cape_eeprom1@55 {
		compatible = "at,24c256";
		reg = <0x55>;
		#address-cells = <1>;
		#size-cells = <1>;
		cape1_data: cape_data@0 {
			reg = <0 0x100>;
		};
	};

	cape_eeprom2: cape_eeprom2@56 {
		compatible = "at,24c256";
		reg = <0x56>;
		#address-cells = <1>;
		#size-cells = <1>;
		

and my application is like

#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/ioctl.h>
#include <fcntl.h>
#include <linux/fs.h>
#include <errno.h>
#include <string.h>
#include <linux/i2c-dev.h>
#include <linux/i2c.h>



/* chmod 666 /dev/i2c-0 */
int main(void)
{

	// Data to be written to eeprom
	unsigned char wbuf[17] = {0x00, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F };   
	unsigned char rbuf[16];
	int i2c_addr = 0x54;
	int status;
	unsigned short int i;

	// OPENING I2C DEVICE
	int fd = open("/dev/i2c-2", O_RDWR);
	if (fd < 0) {
		printf("ERROR: open(%d) failed\n", fd);
		return -1;
	}
	printf("\nSUCCESS: open(%d) passed\n", fd);
	// SETTING EEPROM ADDR
	status = ioctl(fd, I2C_SLAVE, i2c_addr);
	if (status < 0)
	{
		printf("ERROR: ioctl(fd, I2C_SLAVE, 0x%02X) failed\n", i2c_addr);
		close(fd);
		return -1;
	}
	printf("\nSUCCESS: ioctl(fd, I2C_SLAVE, 0x%02X>>1) passed\n", i2c_addr);
	// WRITING TO EEPROM
	printf ("\nPerforming EEPROM Write operation\n");
	write(fd,wbuf,16);
	sleep(10); //till eeprom completes writes
	if (write(fd,wbuf,16) != 16) {
		printf("ERROR: write() failed\n");
		close(fd);
		return -1;
	}
	printf("\nSUCCESS: Data written to the EEPROM\n");

	// READING FROM EEPROM
	printf ("\nPerforming EEPROM Read operation\n");
	wbuf[0]=0;
	if(write(fd,wbuf,1)!=1){

		printf("ERROR: buffer pointer initialization of read() failed\n");

	}
	if (read(fd,rbuf,16) != 16) {
		printf("ERROR: read() failed\n");
		close(fd);
		return -1;
	}
	for(i = 0; i< 16; i++)
	printf("ReadBuffer[%d] %d \r\n", i, rbuf[i]);
	printf("\nSUCCESS: Data READ from the EEPROM\n");
	printf("\neerprom test successfull \n");
	close(fd);

}

kindly let me know what i can try for doing this

Thank you
Deepak R

  • i2c150           i2capp55         mnt
    i2c1nxp50        i2capp5516       nxp
    [techveda@BBBlack:]# ./i2capp55
    [   92.828457] omap_i2c 4819c000.i2c: controller timed out
    write_to_device(): Connection timed out
    [   93.868437] omap_i2c 4819c000.i2c: controller timed out
    write_to_device(): Connection timed out
    read_from_device(): address reset did not work
    [techveda@BBBlack:]# 
    [techveda@BBBlack:]# 
    [techveda@BBBlack:]# ./i2capp5516 
    write_to_device(): Bad address
    write_to_device(): Bad address
    read_from_device(): address reset did not work
    [techveda@BBBlack:]# 
    [techveda@BBBlack:]# 
    [techveda@BBBlack:]# 
    [techveda@BBBlack:]# 
    [techveda@BBBlack:]# 
    [techveda@BBBlack:]# ./i2capp5516 [  132.498800] random: nonblocking pool is initialized
    

    code is as below

    #include <stdio.h>
    #include <stdlib.h>
    #include <linux/i2c-dev.h>
    #include <fcntl.h>
    #include <string.h>
    #include <sys/ioctl.h>
    #include <sys/types.h>
    #include <sys/stat.h>
    #include <unistd.h>
    #include <errno.h>
    #include <linux/i2c.h>
    
    #define DEVICE_PATH "/dev/i2c-2"
    
    #define PAGE_SIZE 64
    
    #define DEVICE_ADDR 0x54// 0b10101001
    //int addr=0b10101001;
    
    int file_desc;
    char buffer[PAGE_SIZE + 2]; // 64 bytes + 2 for the address
    
    void teardownI2C()
    {
        int result = close(file_desc);
    }
    
    void setupI2C()
    {
        file_desc = open(DEVICE_PATH, O_RDWR);
        if(file_desc < 0)
        {
        printf("%s\n", strerror(errno));
        exit(1);
        }
        if(ioctl(file_desc, I2C_SLAVE,DEVICE_ADDR) < 0)
        {
        printf("%s\n", strerror(errno));
        teardownI2C();
        exit(1);
    
        }
    }
    
    int write_to_device(char addr_hi, char addr_lo, char * buf, int len)
    {
         struct i2c_rdwr_ioctl_data msg_rdwr;
         struct i2c_msg i2cmsg;
         char my_buf[PAGE_SIZE + 2];
         if(len > PAGE_SIZE + 2)
         {
         printf("Can't write more than %d bytes at a time.\n", PAGE_SIZE);
         return -1;
         }
         int i;
         my_buf[0] = addr_hi;
         my_buf[1] = addr_lo;
    
         for(i= 0; i < len; i++)
         {
         my_buf[2+i] = buf[i];
         }
         msg_rdwr.msgs = &i2cmsg;
         msg_rdwr.nmsgs = 16;
         i2cmsg.addr  = DEVICE_ADDR;
         i2cmsg.flags = 0;
         i2cmsg.len   = 2+len;
         i2cmsg.buf   = my_buf;
    
        if(ioctl(file_desc,I2C_RDWR,&msg_rdwr)<0)
        {
        printf("write_to_device(): %s\n", strerror(errno));
        return -1;
        }
    
        return 0;
    
    }
    
    int read_from_device(char addr_hi, char addr_lo, char * buf, int len)
    {
        struct i2c_rdwr_ioctl_data msg_rdwr;
        struct i2c_msg             i2cmsg;
    
    
    
        if(write_to_device(addr_hi, addr_lo ,NULL,0)<0)
        {
        printf("read_from_device(): address reset did not work\n");
        return -1;
        }
    
        msg_rdwr.msgs = &i2cmsg;
        msg_rdwr.nmsgs = 16;
    
        i2cmsg.addr  = DEVICE_ADDR;
        i2cmsg.flags = I2C_M_RD;
        i2cmsg.len   = len;
        i2cmsg.buf   = buf;
    
        if(ioctl(file_desc,I2C_RDWR,&msg_rdwr)<0)
        {
        printf("read_from_device(): %s\n", strerror(errno));
        return -1;
        }
    
    
        return 0;
    }
    
    void fill_buffer(char *buf)
    {
        int i = 0;
        while(i < PAGE_SIZE && *buf)
        {
        buffer[i+2] = *buf++;
        }
        while(i++ < PAGE_SIZE-1)
        {
        buffer[i+2] = '*'; // fill the buffer with something
        }
    }
    
    
    int main()
    {
    
        setupI2C(); //setup
    
        fill_buffer("Here are some words.");
        write_to_device(0x01, 0x00, buffer, PAGE_SIZE);
        char newbuf[PAGE_SIZE];
    
        if(read_from_device(0x01, 0x00, newbuf, PAGE_SIZE)>0)
        {
        printf("%s\n", newbuf);
        }
    
    
        teardownI2C(); //cleanup
        return EXIT_SUCCESS;
    }

    Thank you

    Deepak R

    I have attached the other apllication being used

    I get the following error kindly help me on this

  • Hi team can you please let me know any solution ! hoping for a reply please let me know any possible solutions

    Thank you
    Deepak R
  • HI team
    waiting for updates
    can you please help on this

    Thnak you
    Deepak R
  • Hi Deepak,


    Do you use BeagleBoneBlack board or AM335x custom board which is based on BeagleBoneBlack?

    Do you use AM335x TI PSDK? If yes, which version is that?

    deepak r said:
    [techveda@BBBlack:]# insmod i2c-original.ko

    The I2C driver is kernel/drivers/i2c/busses/i2c-omap.c and is built-in kernel by default. Do you re-configure it as external kernel module? And what is i2c-original.ko? Please provide me full boot console log output.

    The I2C driver is generic and should not be modified unless new feature is added. For testing I2C module, you can start with the built-in default I2C driver and I2C user space tools, see below wiki for more info:

    http://processors.wiki.ti.com/index.php/Linux_Core_I2C_User's_Guide

    See also if the below wiki pages will be in help:

    Regards,
    Pavel

  • Hi

    Pavel Thanks for your support

    I have just renamed the driver from i2c-omap.c to i2c-original.c and built the .ko file and when I insert the driver and I find registration is fine

    and I have already tested a i2c- slave driver on his using an 24c256 EEPROM but  my point was to check the working of this adapter driver functionality by reading and writing to the base eeprom that is present internally on the board   as I have mentioned in the dtsi file

    as per my understanding I have attached an image on this

    and as per the note

    IOCTL  supported

    I2C_SLAVE_FORCE  Changes slave address. Slave address is 7 or 10 bits. This changes the address, even if it is already considered.  

    I2C_FUNCS  Gets the adapter functionality  

    I2C_RDWR

    and the application I am using is

    I2C_SLAVE_FORCE  Changes slave address. Slave address is 7 or 10 bits. This changes the address, even if it is already considered.  

    I2C_FUNCS  Gets the adapter functionality   ******I hope this is missing in my app**********  which is posted may be

    I2C_RDWR

    can you please help me on this I would test and update the results any thing w.r.t to pins to be enabled for base eeprom

    I have attached the image for letting you know my concept

    Let me know if this is correct

    Thank you

    Deepak R

  • Hi
    My point is like i2c_detect tools does internal eeprom base_caperom read and write
    like I want that to be tested simillarly from APP

    any other app to TEST I2C-OMAP.C without i2ctools and slave device
    Thank you
    Deepak R
  • attaching logs
    TIONS: I18n
    Compiled on Jan 1 2014, 17:13:19.
    Port /dev/ttyUSB0, 23:29:05

    Press CTRL-A Z for help on special keys


    Password:




    Login incorrect
    BBBlack login:
    U-Boot SPL 2015.01-00001-gb2412df (Jan 29 2015 - 15:01:06)


    U-Boot 2015.01-00001-gb2412df (Jan 29 2015 - 15:01:06), Build: jenkins-github_Bootloader-Builder-105

    Watchdog enabled
    I2C: ready
    DRAM: 512 MiB
    MMC: OMAP SD/MMC: 0, OMAP SD/MMC: 1
    Using default environment

    Net: <ethaddr> not set. Validating first E-fuse MAC
    cpsw
    Hit any key to stop autoboot: 0
    gpio: pin 53 (gpio 53) value is 1
    switch to partitions #0, OK
    mmc0 is current device
    gpio: pin 54 (gpio 54) value is 1
    Checking for: /uEnv.txt ...
    Checking for: /boot.scr ...
    gpio: pin 55 (gpio 55) value is 1
    reading boot.scr
    255 bytes read in 4 ms (61.5 KiB/s)
    Loaded script from boot.scr
    gpio: pin 56 (gpio 56) value is 1
    Running bootscript from mmc0:1 ...
    ## Executing script at 82000000
    reading uImage
    3654176 bytes read in 202 ms (17.3 MiB/s)
    reading am335x-boneblack.dtb
    32292 bytes read in 9 ms (3.4 MiB/s)
    ## Booting kernel from Legacy Image at 81000000 ...
    Image Name: Linux-4.4.43
    Created: 2017-07-09 10:17:18 UTC
    Image Type: ARM Linux Kernel Image (uncompressed)
    Data Size: 3654112 Bytes = 3.5 MiB
    Load Address: 80008000
    Entry Point: 80008000
    Verifying Checksum ... OK
    ## Flattened Device Tree blob at 82000000
    Booting using the fdt blob at 0x82000000
    Loading Kernel Image ... OK
    Loading Device Tree to 8fff5000, end 8ffffe23 ... OK

    Starting kernel ...

    [ 0.000000] Booting Linux on physical CPU 0x0
    [ 0.000000] Initializing cgroup subsys cpuset
    [ 0.000000] Initializing cgroup subsys cpu
    [ 0.000000] Initializing cgroup subsys cpuacct
    [ 0.000000] Linux version 4.4.43 (deepak@deepak-VGN-N31S-W) (gcc version 4.9.4 (Buildroot 2017.02) ) #3 SMP Mon Jun 26 15:01:56 IS7
    [ 0.000000] CPU: ARMv7 Processor [413fc082] revision 2 (ARMv7), cr=10c5387d
    [ 0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
    [ 0.000000] Machine model: TI AM335x BeagleBone Black
    [ 0.000000] cma: Reserved 16 MiB at 0x9e800000
    [ 0.000000] Memory policy: Data cache writeback
    [ 0.000000] CPU: All CPU(s) started in SVC mode.
    [ 0.000000] AM335X ES2.1 (sgx neon )
    [ 0.000000] PERCPU: Embedded 14 pages/cpu @df916000 s24936 r8192 d24216 u57344
    [ 0.000000] Built 1 zonelists in Zone order, mobility grouping on. Total pages: 129408
    [ 0.000000] Kernel command line: console=ttyO0,115200 rw root=/dev/mmcblk0p2 rootwait
    [ 0.000000] PID hash table entries: 2048 (order: 1, 8192 bytes)
    [ 0.000000] Dentry cache hash table entries: 65536 (order: 6, 262144 bytes)
    [ 0.000000] Inode-cache hash table entries: 32768 (order: 5, 131072 bytes)
    [ 0.000000] Memory: 481932K/522240K available (6739K kernel code, 747K rwdata, 2244K rodata, 452K init, 8263K bss, 23924K reserved)
    [ 0.000000] Virtual kernel memory layout:
    [ 0.000000] vector : 0xffff0000 - 0xffff1000 ( 4 kB)
    [ 0.000000] fixmap : 0xffc00000 - 0xfff00000 (3072 kB)
    [ 0.000000] vmalloc : 0xe0800000 - 0xff800000 ( 496 MB)
    [ 0.000000] lowmem : 0xc0000000 - 0xe0000000 ( 512 MB)
    [ 0.000000] pkmap : 0xbfe00000 - 0xc0000000 ( 2 MB)
    [ 0.000000] modules : 0xbf000000 - 0xbfe00000 ( 14 MB)
    [ 0.000000] .text : 0xc0008000 - 0xc08ce184 (8985 kB)
    [ 0.000000] .init : 0xc08cf000 - 0xc0940000 ( 452 kB)
    [ 0.000000] .data : 0xc0940000 - 0xc09faeb8 ( 748 kB)
    [ 0.000000] .bss : 0xc09fd000 - 0xc120ec30 (8264 kB)
    [ 0.000000] Running RCU self tests
    [ 0.000000] Hierarchical RCU implementation.
    [ 0.000000] RCU lockdep checking is enabled.
    [ 0.000000] Build-time adjustment of leaf fanout to 32.
    [ 0.000000] RCU restricting CPUs from NR_CPUS=2 to nr_cpu_ids=1.
    [ 0.000000] RCU: Adjusting geometry for rcu_fanout_leaf=32, nr_cpu_ids=1
    [ 0.000000] NR_IRQS:16 nr_irqs:16 16
    [ 0.000000] IRQ: Found an INTC at 0xfa200000 (revision 5.0) with 128 interrupts
    [ 0.000000] OMAP clockevent source: timer2 at 24000000 Hz
    [ 0.000013] sched_clock: 32 bits at 24MHz, resolution 41ns, wraps every 89478484971ns
    [ 0.000034] clocksource: timer1: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 79635851949 ns
    [ 0.000080] OMAP clocksource: timer1 at 24000000 Hz
    [ 0.000928] Console: colour dummy device 80x30
    [ 0.000986] Lock dependency validator: Copyright (c) 2006 Red Hat, Inc., Ingo Molnar
    [ 0.000994] ... MAX_LOCKDEP_SUBCLASSES: 8
    [ 0.001002] ... MAX_LOCK_DEPTH: 48
    [ 0.001009] ... MAX_LOCKDEP_KEYS: 8191
    [ 0.001017] ... CLASSHASH_SIZE: 4096
    [ 0.001024] ... MAX_LOCKDEP_ENTRIES: 32768
    [ 0.001031] ... MAX_LOCKDEP_CHAINS: 65536
    [ 0.001039] ... CHAINHASH_SIZE: 32768
    [ 0.001046] memory used by lock dependency info: 5167 kB
    [ 0.001054] per task-struct memory footprint: 1536 bytes
    [ 0.001080] Calibrating delay loop... 996.14 BogoMIPS (lpj=4980736)
    [ 0.078728] pid_max: default: 32768 minimum: 301
    [ 0.079129] Security Framework initialized
    [ 0.079246] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
    [ 0.079260] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
    [ 0.082287] Initializing cgroup subsys io
    [ 0.082389] Initializing cgroup subsys memory
    [ 0.082481] Initializing cgroup subsys devices
    [ 0.082608] Initializing cgroup subsys freezer
    [ 0.082686] Initializing cgroup subsys perf_event
    [ 0.082753] CPU: Testing write buffer coherency: ok
    [ 0.084228] CPU0: thread -1, cpu 0, socket -1, mpidr 0
    [ 0.084347] Setting up static identity map for 0x80008280 - 0x800082f0
    [ 0.088131] Brought up 1 CPUs
    [ 0.088153] SMP: Total of 1 processors activated (996.14 BogoMIPS).
    [ 0.088163] CPU: All CPU(s) started in SVC mode.
    [ 0.092274] devtmpfs: initialized
    [ 0.127089] VFP support v0.3: implementor 41 architecture 3 part 30 variant c rev 3
    [ 0.171219] omap_hwmod: tptc0 using broken dt data from edma
    [ 0.171698] omap_hwmod: tptc1 using broken dt data from edma
    [ 0.172156] omap_hwmod: tptc2 using broken dt data from edma
    [ 0.181241] omap_hwmod: debugss: _wait_target_disable failed
    [ 0.236570] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
    [ 0.239191] pinctrl core: initialized pinctrl subsystem
    [ 0.244423] NET: Registered protocol family 16
    [ 0.250242] DMA: preallocated 256 KiB pool for atomic coherent allocations
    [ 0.252309] cpuidle: using governor ladder
    [ 0.252337] cpuidle: using governor menu
    [ 0.262205] OMAP GPIO hardware version 0.1
    [ 0.285054] No ATAGs?
    [ 0.285092] hw-breakpoint: debug architecture 0x4 unsupported.
    [ 0.285670] omap4_sram_init:Unable to allocate sram needed to handle errata I688
    [ 0.285689] omap4_sram_init:Unable to get sram pool needed to handle errata I688
    [ 0.311405] edma 49000000.edma: Legacy memcpy is enabled, things might not work
    [ 0.328130] edma 49000000.edma: TI EDMA DMA engine driver
    [ 0.332514] SCSI subsystem initialized
    [ 0.334196] pps_core: LinuxPPS API ver. 1 registered
    [ 0.334208] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
    [ 0.334263] PTP clock support registered
    [ 0.338373] clocksource: Switched to clocksource timer1
    [ 0.481823] NET: Registered protocol family 2
    [ 0.483842] TCP established hash table entries: 4096 (order: 2, 16384 bytes)
    [ 0.483939] TCP bind hash table entries: 4096 (order: 5, 147456 bytes)
    [ 0.485130] TCP: Hash tables configured (established 4096 bind 4096)
    [ 0.485350] UDP hash table entries: 256 (order: 2, 20480 bytes)
    [ 0.485524] UDP-Lite hash table entries: 256 (order: 2, 20480 bytes)
    [ 0.486387] NET: Registered protocol family 1
    [ 0.488124] RPC: Registered named UNIX socket transport module.
    [ 0.488147] RPC: Registered udp transport module.
    [ 0.488157] RPC: Registered tcp transport module.
    [ 0.488167] RPC: Registered tcp NFSv4.1 backchannel transport module.
    [ 0.491078] hw perfevents: enabled with armv7_cortex_a8 PMU driver, 5 counters available
    [ 0.495580] futex hash table entries: 256 (order: 2, 16384 bytes)
    [ 0.495816] audit: initializing netlink subsys (disabled)
    [ 0.496060] audit: type=2000 audit(0.480:1): initialized
    [ 0.500962] VFS: Disk quotas dquot_6.6.0
    [ 0.501139] VFS: Dquot-cache hash table entries: 1024 (order 0, 4096 bytes)
    [ 0.503616] NFS: Registering the id_resolver key type
    [ 0.503990] Key type id_resolver registered
    [ 0.504005] Key type id_legacy registered
    [ 0.504218] jffs2: version 2.2. (NAND) (SUMMARY) �© 2001-2006 Red Hat, Inc.
    [ 0.510003] io scheduler noop registered
    [ 0.510043] io scheduler deadline registered
    [ 0.510102] io scheduler cfq registered (default)
    [ 0.512196] pinctrl-single 44e10800.pinmux: 142 pins at pa f9e10800 size 568
    [ 0.514752] Serial: 8250/16550 driver, 4 ports, IRQ sharing enabled
    [ 0.520813] omap_uart 44e09000.serial: no wakeirq for uart0
    [ 0.521440] 44e09000.serial: ttyO0 at MMIO 0x44e09000 (irq = 155, base_baud = 3000000) is a OMAP UART0
    [ 1.238012] console [ttyO0] enabled
    [ 1.279894] brd: module loaded
    [ 1.306160] loop: module loaded
    [ 1.312152] mtdoops: mtd device (mtddev=name/number) must be supplied
    [ 1.388397] davinci_mdio 4a101000.mdio: davinci mdio revision 1.6
    [ 1.394786] davinci_mdio 4a101000.mdio: detected phy mask fffffffe
    [ 1.405105] libphy: 4a101000.mdio: probed
    [ 1.409473] davinci_mdio 4a101000.mdio: phy[0]: device 4a101000.mdio:00, driver SMSC LAN8710/LAN8720
    [ 1.420310] cpsw 4a100000.ethernet: Detected MACID = 78:a5:04:fd:e2:d0
    [ 1.432415] mousedev: PS/2 mouse device common for all mice
    [ 1.438424] i2c /dev entries driver
    [ 1.443759] omap_hsmmc 48060000.mmc: Got CD GPIO
    [ 1.526117] mmc0: host does not support reading read-only switch, assuming write-enable
    [ 1.535123] ledtrig-cpu: registered to indicate activity on CPUs
    [ 1.542736] oprofile: using arm/armv7
    [ 1.547407] Initializing XFRM netlink socket
    [ 1.552376] NET: Registered protocol family 10
    [ 1.558962] mmc0: new high speed SDHC card at address 59b4
    [ 1.567536] mmcblk0: mmc0:59b4 MS 15.0 GiB
    [ 1.577257] sit: IPv6 over IPv4 tunneling driver
    [ 1.584556] NET: Registered protocol family 17
    [ 1.589424] NET: Registered protocol family 15
    [ 1.594480] Key type dns_resolver registered
    [ 1.599197] omap_voltage_late_init: Voltage driver support not added
    [ 1.605850] sr_dev_init: No voltage domain specified for smartreflex0. Cannot initialize
    [ 1.614346] sr_dev_init: No voltage domain specified for smartreflex1. Cannot initialize
    [ 1.623956] ThumbEE CPU extension supported.
    [ 1.628583] Registering SWP/SWPB emulation handler
    [ 1.633609] SmartReflex Class3 initialized
    [ 1.639561] mmcblk0: p1 p2
    [ 1.656416] hctosys: unable to open rtc device (rtc0)
    [ 1.661871] sr_init: No PMIC hook to init smartreflex
    [ 1.667385] sr_init: platform driver register failed for SR
    [ 1.703847] EXT4-fs (mmcblk0p2): mounting ext3 file system using the ext4 subsystem
    [ 1.732753] mmc1: MAN_BKOPS_EN bit is not set
    [ 1.742452] mmc1: new high speed MMC card at address 0001
    [ 1.753142] mmcblk1: mmc1:0001 MMC04G 3.66 GiB
    [ 1.759628] mmcblk1boot0: mmc1:0001 MMC04G partition 1 1.00 MiB
    [ 1.766781] mmcblk1boot1: mmc1:0001 MMC04G partition 2 1.00 MiB
    [ 1.776164] mmcblk1: p1 p2
    [ 1.903479] EXT4-fs (mmcblk0p2): recovery complete
    [ 1.922601] EXT4-fs (mmcblk0p2): mounted filesystem with ordered data mode. Opts: (null)
    [ 1.931339] VFS: Mounted root (ext3 filesystem) on device 179:2.
    [ 1.964759] devtmpfs: mounted
    [ 1.968837] Freeing unused kernel memory: 452K (c08cf000 - c0940000)
    [ 2.754071] net eth0: initializing cpsw version 1.12 (0)
    [ 2.762268] net eth0: phy found : id is : 0x7c0f1
    [ 2.767298] libphy: PHY 4a101000.mdio:01 not found
    [ 2.772396] net eth0: phy 4a101000.mdio:01 not found on slave 1
    [ 2.787283] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready

    BBBlack login: techveda
    login: can't change directory to '/root'
    Jan 1 00:00:10 login[89]: root login on 'ttyO0'
    [techveda@BBBlack:]#


    2c1nxp50 i2capp5516 nxp
    [techveda@BBBlack:]# insmod i2c-original.ko
    [ 103.609100] tps65217 0-0024: TPS65217 ID 0xe version 1.2
    [ 103.615332] omap_i2c 44e0b000.i2c: bus 0 rev0.11 at 400 kHz
    [ 103.637587] omap_i2c 4802a000.i2c: bus 1 rev0.11 at 100 kHz
    [ 103.655261] omap_i2c 4819c000.i2c: bus 2 rev0.11 at 100 kHz
    [techveda@BBBlack:]# dm[ 134.718629] random: nonblocking pool is initialized


    dmesg

    [ 2.772396] net eth0: phy 4a101000.mdio:01 not found on slave 1
    [ 2.787283] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
    [ 103.609100] tps65217 0-0024: TPS65217 ID 0xe version 1.2
    [ 103.615332] omap_i2c 44e0b000.i2c: bus 0 rev0.11 at 400 kHz
    [ 103.637587] omap_i2c 4802a000.i2c: bus 1 rev0.11 at 100 kHz
    [ 103.655261] omap_i2c 4819c000.i2c: bus 2 rev0.11 at 100 kHz
    [ 134.718629] random: nonblocking pool is initialized
  • Do you use BeagleBoneBlack board or AM335x custom board which is based on BeagleBoneBlack?

    Do you use AM335x TI PSDK? If yes, which version is that?

    deepak r said:

    I have just renamed the driver from i2c-omap.c to i2c-original.c and built the .ko file and when I insert the driver and I find registration is fine

    and I have already tested a i2c- slave driver on his using an 24c256 EEPROM but  my point was to check the working of this adapter driver functionality by reading and writing to the base eeprom that is present internally on the board   as I have mentioned in the dtsi file

    as per my understanding I have attached an image on this

    Why you are using I2C OMAP driver (i2c-omap.c) as external kernel module? By default it is built-in the kernel, this is configured in:

    linux-kernel/arch/arm/configs/tisdk_am335x-evm_defconfig

    CONFIG_I2C_OMAP=y

  • Hi

    Pavle

    Thanks for your support

    I am building the kernel and other rootfs using busybox and build root and Linux version being used is 4.4.43

    But my concern is on testing the adapter driver without the support of slave device/i2c-tools

    like even if I make the changes in makefile to enable and also in menuconfig

    what is the possible way to check i2c-omap.c from i2c app of user space

    OR

    Does it mean adapter driver functionality is tested using slave device/i2ctools  only

    Please help me on my understanding if I am missing something


    Hope i2c-tools also work on eeprom (cape_eeprom) which is present default

    Thank you

    Deepak R 

  • Hi I have made changes in make file present in i2c/bus/Makefile commenting I2C-OMAP.C so that I can load the driver and test this(i2c-omap.c)

    Thank you
    Deepak R
  • deepak r said:
    I am building the kernel and other rootfs using busybox and build root and Linux version being used is 4.4.43

    Seems like you are not using TI SDK. Do you still use Arago TI Linux? From where you get this 4.4.43 kernel?

    Regarding I2C C application, please refer to the below links:

    Regards,
    Pavel

  • deepak r said:

    But my concern is on testing the adapter driver without the support of slave device/i2c-tools

    like even if I make the changes in makefile to enable and also in menuconfig

    what is the possible way to check i2c-omap.c from i2c app of user space

    OR

    Does it mean adapter driver functionality is tested using slave device/i2ctools  only

    Yes, you can test your EEPROM from I2C C application also, not only from i2c-tools

    Regards,
    Pavel