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/AM3351: USB Hub configuration

Part Number: AM3351
Other Parts Discussed in Thread: AM3352, TPS65217

Tool/software: Linux

Hi, i am trying to configure USB HUB(USB2517) using SMBus protocol but read, write is failing , below settings i am using in dts file,

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

    status = "okay";
    clock-frequency = <100000>;

       lm75@48 {
            compatible = "lm75";
            reg = <0x48>;
            status = "okay";
        };
        usb2517@58 {
            compatible = "microchip,usb2517";
            reg = <0x58>;
            tatus = "okay";
        };
 
};

//application to read data:

    rc = ioctl(file, I2C_SLAVE, 0x58);
    if (rc < 0)
        err(errno, "Tried to set device address '0x%02x'", addr);

        data = i2c_smbus_read_byte_data(file, 0x00);
        printf("%s: device 0x%02x at address 0x%02x: 0x%02x\n",    path, addr, reg, data);

thankyou,

  • Please post the Linux version you are using.
  • Hi Khageswararao,

    From what I understand, your code fail at i2c_smbus_read_byte_data() functions. In I2C kernel driver, the SMBus is not fully supported. Can you try with I2C read (instead of smbus read)? See also the below e2e thread and link:

    e2e.ti.com/.../560852

    www.ti.com/.../sloa132.pdf

    Another option is using PRU-ICSS (instead of I2C) module, where SMBus seems to be fully supported:

    e2e.ti.com/.../585366

    Regards,
    Pavel
  • I made a search, and it seems that I2C SMBUS commands (read/write) are available only inside the Linux kernel. We can not use these commands in userspace. See the links below:

    "Functions like i2c_smbus_read_byte() are usually called from within kernel code such drivers. User space code is limited to file operations like open(), ioctl(), read(), write() and close(). Everything is a file in Linux."

    e2e.ti.com/.../704348.aspx

    See also the below pointers:

    e2e.ti.com/.../400400
    e2e.ti.com/.../308787

    Regards,
    Pavel
  • hi pavel,
    i am using below below application to read smbus.

    static inline __s32 i2c_smbus_access(int file, char read_write, __u8 command,
    int size, union i2c_smbus_data *data)
    {
    struct i2c_smbus_ioctl_data args;

    args.read_write = read_write;
    args.command = command;
    args.size = size;
    args.data = data;
    return ioctl(file,I2C_SMBUS,&args);
    }


    static inline __s32 i2c_smbus_read_byte_data(int file, __u8 command)
    {
    union i2c_smbus_data data;
    if (i2c_smbus_access(file,I2C_SMBUS_READ,command,
    I2C_SMBUS_BYTE_DATA,&data))
    return -1;
    else
    return 0x0FF & data.byte;
    }



    int main(int argc, char **argv)
    {
    uint8_t data, addr = 0x58;
    int reg = 0x00;
    const char *path = argv[1];
    int file, rc;

    if (argc == 1)
    errx(-1, "path [i2c address] [register]");

    if (argc > 2)
    addr = strtoul(argv[2], NULL, 0);
    if (argc > 3)
    reg = strtoul(argv[3], NULL, 0);

    file = open(path, O_RDWR);
    if (file < 0)
    err(errno, "Tried to open '%s'", path);

    rc = ioctl(file, I2C_SLAVE, addr);
    if (rc < 0)
    err(errno, "Tried to set device address '0x%02x'", addr);

    printf("Enter read REG value \n");
    scanf("%x",&reg);
    data = i2c_smbus_read_byte_data(file, reg);
    printf("%s: device 0x%02x at address 0x%02x: 0x%02x\n", path, addr, reg, data);


    }
  • hi, i am using
    ti-processor-sdk-linux-am335x-evm-03.00.00.04
    linux-4.4.12+gitAUTOINC+3639bea54a-g3639bea54a

    /////////////////Boot Log////////////////////

    Starting kernel ...

    [    0.000000] Booting Linux on physical CPU 0x0
    [    0.000000] Initializing cgroup subsys cpu
    [    0.000000] Initializing cgroup subsys cpuacct
    [    0.000000] Linux version 4.4.12-g3639bea54a (root@khagesh-ThinkCentre-M70e) (gcc version 5.3.1 20160113 (Linaro GCC 5.3-2016.02) ) #12 PREEMPT Thu Nov 30 18:25:10 IST 2017
    [    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 24 MiB at 0x8d000000
    [    0.000000] Memory policy: Data cache writeback
    [    0.000000] CPU: All CPU(s) started in SVC mode.
    [    0.000000] AM335X ES2.1 (neon )
    [    0.000000] Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 64960
    [    0.000000] Kernel command line: console=ttyO0,115200n8 root=PARTUUID=00000faf-02 rw rootfstype=ext4 rootwait
    [    0.000000] PID hash table entries: 1024 (order: 0, 4096 bytes)
    [    0.000000] Dentry cache hash table entries: 32768 (order: 5, 131072 bytes)
    [    0.000000] Inode-cache hash table entries: 16384 (order: 4, 65536 bytes)
    [    0.000000] Memory: 226528K/262144K available (5635K kernel code, 212K rwdata, 1896K rodata, 252K init, 240K bss, 11040K reserved, 24576K cma-reserved, 0K highmem)
    [    0.000000] Virtual kernel memory layout:
    [    0.000000]     vector  : 0xffff0000 - 0xffff1000   (   4 kB)
    [    0.000000]     fixmap  : 0xffc00000 - 0xfff00000   (3072 kB)
    [    0.000000]     vmalloc : 0xd0800000 - 0xff800000   ( 752 MB)
    [    0.000000]     lowmem  : 0xc0000000 - 0xd0000000   ( 256 MB)
    [    0.000000]     pkmap   : 0xbfe00000 - 0xc0000000   (   2 MB)
    [    0.000000]     modules : 0xbf000000 - 0xbfe00000   (  14 MB)
    [    0.000000]       .text : 0xc0008000 - 0xc0762f74   (7532 kB)
    [    0.000000]       .init : 0xc0763000 - 0xc07a2000   ( 252 kB)
    [    0.000000]       .data : 0xc07a2000 - 0xc07d7290   ( 213 kB)
    [    0.000000]        .bss : 0xc07d9000 - 0xc0815224   ( 241 kB)
    [    0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
    [    0.000000] Preemptible hierarchical RCU implementation.
    [    0.000000]     Build-time adjustment of leaf fanout to 32.
    [    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 19200000 Hz
    [    0.000033] sched_clock: 32 bits at 19MHz, resolution 52ns, wraps every 111848106981ns
    [    0.000087] clocksource: timer1: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 99544814920 ns
    [    0.000111] OMAP clocksource: timer1 at 19200000 Hz
    [    0.001217] clocksource_probe: no matching clocksources found
    [    0.001590] Console: colour dummy device 80x30
    [    0.001646] WARNING: Your 'console=ttyO0' has been replaced by 'ttyS0'
    [    0.001663] This ensures that you still see kernel messages. Please
    [    0.001676] update your kernel commandline.
    [    0.001712] Calibrating delay loop... 302.28 BogoMIPS (lpj=1511424)
    [    0.057620] pid_max: default: 32768 minimum: 301
    [    0.057898] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
    [    0.057930] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
    [    0.059466] Initializing cgroup subsys io
    [    0.059535] Initializing cgroup subsys memory
    [    0.059609] Initializing cgroup subsys devices
    [    0.059644] Initializing cgroup subsys freezer
    [    0.059677] Initializing cgroup subsys perf_event
    [    0.059709] Initializing cgroup subsys pids
    [    0.059773] CPU: Testing write buffer coherency: ok
    [    0.060549] Setting up static identity map for 0x80008200 - 0x80008258
    [    0.065732] devtmpfs: initialized
    [    0.093864] VFP support v0.3: implementor 41 architecture 3 part 30 variant c rev 3
    [    0.126642] omap_hwmod: debugss: _wait_target_disable failed
    [    0.131673] omap_hwmod: d_can0: _wait_target_ready failed: -16
    [    0.131697] omap_hwmod: d_can0: cannot be enabled for reset (3)
    [    0.135584] omap_hwmod: d_can1: _wait_target_ready failed: -16
    [    0.135602] omap_hwmod: d_can1: cannot be enabled for reset (3)
    [    0.204785] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
    [    0.209533] pinctrl core: initialized pinctrl subsystem
    [    0.212381] NET: Registered protocol family 16
    [    0.217448] DMA: preallocated 256 KiB pool for atomic coherent allocations
    [    0.247641] cpuidle: using governor ladder
    [    0.277614] cpuidle: using governor menu
    [    0.289108] OMAP GPIO hardware version 0.1
    [    0.292188] omap_gpio 481ac000.gpio: could not find pctldev for node /ocp/l4_wkup@44c00000/scm@210000/pinmux@800/pinmux_gpio2_pins, deferring probe
    [    0.292973] omap_gpio 481ae000.gpio: could not find pctldev for node /ocp/l4_wkup@44c00000/scm@210000/pinmux@800/pinmux_gpio3_pins, deferring probe
    [    0.305710] omap-gpmc 50000000.gpmc: could not find pctldev for node /ocp/l4_wkup@44c00000/scm@210000/pinmux@800/nandflash_pins_s0, deferring probe
    [    0.312339] hw-breakpoint: debug architecture 0x4 unsupported.
    [    0.368173] edma 49000000.edma: TI EDMA DMA engine driver
    [    0.376079] usbcore: registered new interface driver usbfs
    [    0.376309] usbcore: registered new interface driver hub
    [    0.376560] usbcore: registered new device driver usb
    [    0.377473] omap_i2c 44e0b000.i2c: could not find pctldev for node /ocp/l4_wkup@44c00000/scm@210000/pinmux@800/pinmux_i2c0_pins, deferring probe
    [    0.377717] omap_i2c 4819c000.i2c: could not find pctldev for node /ocp/l4_wkup@44c00000/scm@210000/pinmux@800/pinmux_i2c2_pins, deferring probe
    [    0.378115] pps_core: LinuxPPS API ver. 1 registered
    [    0.378139] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
    [    0.378215] PTP clock support registered
    [    0.380557] omap-mailbox 480c8000.mailbox: omap mailbox rev 0x400
    [    0.382971] clocksource: Switched to clocksource timer1
    [    0.410496] NET: Registered protocol family 2
    [    0.412226] TCP established hash table entries: 2048 (order: 1, 8192 bytes)
    [    0.412315] TCP bind hash table entries: 2048 (order: 1, 8192 bytes)
    [    0.412387] TCP: Hash tables configured (established 2048 bind 2048)
    [    0.412552] UDP hash table entries: 256 (order: 0, 4096 bytes)
    [    0.412601] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
    [    0.413094] NET: Registered protocol family 1
    [    0.415053] hw perfevents: enabled with armv7_cortex_a8 PMU driver, 5 counters available
    [    0.419501] futex hash table entries: 256 (order: -1, 3072 bytes)
    [    0.444591] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 250)
    [    0.444663] io scheduler noop registered
    [    0.444696] io scheduler deadline registered
    [    0.445125] io scheduler cfq registered (default)
    [    0.448771] pinctrl-single 44e10800.pinmux: 142 pins at pa f9e10800 size 568
    [    0.454464] backlight supply power not found, using dummy regulator
    [    0.455159] pwm-backlight backlight: invalid default brightness level: 53, using 8
    [    0.612797] Serial: 8250/16550 driver, 10 ports, IRQ sharing disabled
    [    0.622327] 44e09000.serial: ttyS0 at MMIO 0x44e09000 (irq = 94, base_baud = 3000000) is a 8250
    [    1.255441] console [ttyS0] enabled
    [    1.261420] [drm] Initialized drm 1.1.0 20060810
    [    1.269293] of_graph_get_next_endpoint(): no port node found in /ocp/lcdc@4830e000
    [    1.278514] of_graph_get_next_endpoint(): no port node found in /ocp/lcdc@4830e000
    [    1.287200] [drm] Supports vblank timestamp caching Rev 2 (21.10.2013).
    [    1.293954] [drm] No driver support for vblank timestamp query.
    [    1.379595] Console: switching to colour frame buffer device 160x50
    [    1.447236] tilcdc 4830e000.lcdc: fb0:  frame buffer device
    [    1.473037] [drm] Initialized tilcdc 1.0.0 20121205 on minor 0
    [    1.497241] loop: module loaded
    [    1.504916] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
    [    1.511454] ehci-platform: EHCI generic platform driver
    [    1.517196] ehci-omap: OMAP-EHCI Host Controller driver
    [    1.522788] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
    [    1.529068] ohci-platform: OHCI generic platform driver
    [    1.536246] mousedev: PS/2 mouse device common for all mice
    [    1.543790] GTP driver installing...
    [    1.547668] i2c /dev entries driver
    [    1.554931] cpuidle: enable-method property 'ti,am3352' found operations
    [    1.562066] sdhci: Secure Digital Host Controller Interface driver
    [    1.568360] sdhci: Copyright(c) Pierre Ossman
    [    1.574188] omap_hsmmc 48060000.mmc: Got CD GPIO
    [    1.613764] pinctrl-single 44e10800.pinmux: bad data for mux pinmux_emmc_pins
    [    1.621220] pinctrl-single 44e10800.pinmux: no pins entries for pinmux_emmc_pins
    [    1.673624] Synopsys Designware Multimedia Card Interface Driver
    [    1.680794] sdhci-pltfm: SDHCI platform and OF driver helper
    [    1.687911] ledtrig-cpu: registered to indicate activity on CPUs
    [    1.694569] usbcore: registered new interface driver usbhid
    [    1.700126] usbhid: USB HID core driver
    [    1.707868] NET: Registered protocol family 10
    [    1.715449] sit: IPv6 over IPv4 tunneling driver
    [    1.720218] mmc0: host does not support reading read-only switch, assuming write-enable
    [    1.730313] NET: Registered protocol family 17
    [    1.735301] omap_voltage_late_init: Voltage driver support not added
    [    1.741947] mmc0: new high speed SDHC card at address aaaa
    [    1.749786] ThumbEE CPU extension supported.
    [    1.755588] mmcblk0: mmc0:aaaa SS08G 7.40 GiB
    [    1.761023] Registering SWP/SWPB emulation handler
    [    1.767849]  mmcblk0: p1 p2
    [    1.787879] omap-gpmc 50000000.gpmc: GPMC revision 6.0
    [    1.803069] gpmc_mem_init: disabling cs 0 mapped at 0x0-0x1000000
    [    1.811711] nand: second ID read did not match 4f,4e against 46,49
    [    1.832995] nand: No NAND device found
    [    1.836763] omap2-nand 8000000.nand: scan failed, may be bus-width mismatch
    [    1.887679] tps65217 0-0024: TPS65217 ID 0xe version 1.2
    [    1.903817] 0-0014 supply vdd_ana not found, using dummy regulator
    [    1.920911] 0-0014 supply vcc_i2c not found, using dummy regulator
    [    2.053344] <<-GTP-ERROR->> I2C Read: 0x8047, 1 bytes failed, errcode: -121! Process reset.
    [    2.182983] <<-GTP-ERROR->> GTP i2c test failed time 1.
    [    2.203328] <<-GTP-ERROR->> I2C Read: 0x8047, 1 bytes failed, errcode: -121! Process reset.
    [    2.332984] <<-GTP-ERROR->> GTP i2c test failed time 2.
    [    2.353326] <<-GTP-ERROR->> I2C Read: 0x8047, 1 bytes failed, errcode: -121! Process reset.
    [    2.492984] <<-GTP-ERROR->> GTP i2c test failed time 3.
    [    2.513334] <<-GTP-ERROR->> I2C Read: 0x8047, 1 bytes failed, errcode: -121! Process reset.
    [    2.632983] <<-GTP-ERROR->> GTP i2c test failed time 4.
    [    2.653333] <<-GTP-ERROR->> I2C Read: 0x8047, 1 bytes failed, errcode: -121! Process reset.
    [    2.792985] <<-GTP-ERROR->> GTP i2c test failed time 5.
    [    2.812983] <<-GTP-ERROR->> I2C communication ERROR!
    [    2.823272] <<-GTP-ERROR->> I2C Read: 0x8140, 6 bytes failed, errcode: -121! Process reset.
    [    2.963007] <<-GTP-ERROR->> GTP read version failed
    [    2.967877] <<-GTP-ERROR->> Read version failed.
    [    2.972826] <<-GTP-ERROR->> I2C Read: 0x41E4, 1 bytes failed, errcode: -121! Process reset.
    [    3.093347] <<-GTP-ERROR->> I2C Read: 0x41E4, 1 bytes failed, errcode: -121! Process reset.
    [    3.213351] <<-GTP-ERROR->> I2C Read: 0x41E4, 1 bytes failed, errcode: -121! Process reset.
    [    3.333335] <<-GTP-ERROR->> I2C Read: 0x41E4, 1 bytes failed, errcode: -121! Process reset.
    [    3.453344] <<-GTP-ERROR->> I2C Read: 0x41E4, 1 bytes failed, errcode: -121! Process reset.
    [    3.573341] <<-GTP-ERROR->> I2C Read: 0x41E4, 1 bytes failed, errcode: -121! Process reset.
    [    3.693007] <<-GTP-ERROR->> I2C read 0x41E4, 1 bytes, double check failed!
    [    3.700240] <<-GTP-ERROR->> I2C Read: 0x814A, 1 bytes failed, errcode: -121! Process reset.
    [    3.823343] <<-GTP-ERROR->> I2C Read: 0x814A, 1 bytes failed, errcode: -121! Process reset.
    [    3.943338] <<-GTP-ERROR->> I2C Read: 0x814A, 1 bytes failed, errcode: -121! Process reset.
    [    4.063338] <<-GTP-ERROR->> I2C Read: 0x814A, 1 bytes failed, errcode: -121! Process reset.
    [    4.183348] <<-GTP-ERROR->> I2C Read: 0x814A, 1 bytes failed, errcode: -121! Process reset.
    [    4.303386] <<-GTP-ERROR->> I2C Read: 0x814A, 1 bytes failed, errcode: -121! Process reset.
    [    4.423001] <<-GTP-ERROR->> I2C read 0x814A, 1 bytes, double check failed!
    [    4.429850] <<-GTP-ERROR->> Failed to get sensor_id, No config sent!
    [    4.436250] <<-GTP-ERROR->> GTP init panel failed.
    [    4.441742] input: goodix-ts as /devices/virtual/input/input0
    [    4.448361] i2c i2c-0: Failed to register i2c client tps65217 at 0x24 (-16)
    [    4.455470] i2c i2c-0: of_i2c: Failure registering /ocp/i2c@44e0b000/tps65217@24
    [    4.462901] omap_i2c 44e0b000.i2c: bus 0 rev0.11 at 400 kHz
    [    4.471573] omap_i2c 4819c000.i2c: bus 2 rev0.11 at 100 kHz
    [    4.479767] cpufreq: cpufreq_online: CPU0: Running at unlisted freq: 303157 KHz
    [    4.487410] cpu cpu0: dev_pm_opp_domain_set_rate: failed to find current OPP for freq 303157894 (-34)
    [    4.504456] cpufreq: cpufreq_online: CPU0: Unlisted initial frequency changed to: 300000 KHz
    [    4.569459] EXT4-fs (mmcblk0p2): recovery complete
    [    4.576861] EXT4-fs (mmcblk0p2): mounted filesystem with ordered data mode. Opts: (null)
    [    4.585118] VFS: Mounted root (ext4 filesystem) on device 179:2.
    [    4.595561] devtmpfs: mounted
    [    4.599612] Freeing unused kernel memory: 252K (c0763000 - c07a2000)
    [    4.606550] This architecture does not have kernel memory protection.
    [    4.973840] systemd[1]: System time before build time, advancing clock.
    [    5.066116] random: systemd urandom read with 28 bits of entropy available
    [    5.112861] systemd[1]: systemd 229 running in system mode. (+PAM -AUDIT -SELINUX +IMA -APPARMOR +SMACK +SYSVINIT +UTMP -LIBCRYPTSETUP -GCRYPT +GNUTLS +ACL +XZ -LZ4 -SECCOMP +BLKID -ELFUTILS +KMOD -IDN)
    [    5.132780] systemd[1]: Detected architecture arm.

    Welcome to Arago 2016.05!

    [    5.165951] systemd[1]: Set hostname to <am335x-evm>.
    [    5.890735] systemd[1]: Configuration file /lib/systemd/system/gpio_init.service is marked executable. Please remove executable permission bits. Proceeding anyway.
    [    5.905828] systemd[1]: Configuration file /lib/systemd/system/gpio_init.service is marked world-writable. Please remove world writability permission bits. Proceeding anyway.
    [    5.927796] systemd[1]: [/lib/systemd/system/gadget-init.service:15] Unknown lvalue 'ExecStopPre' in section 'Service'
    [    6.504722] systemd[1]: sysinit.target: Found ordering cycle on sysinit.target/start
    [    6.512542] systemd[1]: sysinit.target: Found dependency on alignment.service/start
    [    6.520555] systemd[1]: sysinit.target: Found dependency on sysinit.target/start
    [    6.528035] systemd[1]: sysinit.target: Breaking ordering cycle by deleting job alignment.service/start
    [    6.537539] systemd[1]: alignment.service: Job alignment.service/start deleted to break ordering cycle starting with sysinit.target/start
    [ SKIP ] Ordering cycle found, skipping alignment.service
    [    6.594400] systemd[1]: Created slice System Slice.
    [  OK  ] Created slice System Slice.
    [    6.624544] systemd[1]: Listening on udev Kernel Socket.
    [  OK  ] Listening on udev Kernel Socket.
    [    6.654417] systemd[1]: Listening on Journal Socket (/dev/log).
    [  OK  ] Listening on Journal Socket (/dev/log).
    [    6.717826] systemd[1]: Listening on Journal Socket.
    [  OK  ] Listening on Journal Socket.
    [    6.754312] systemd[1]: Mounting Debug File System...
             Mounting Debug File System...
    [    6.834367] systemd[1]: Starting Setup Virtual Console...
             Starting Setup Virtual Console...
    [    6.887158] systemd[1]: Started Dispatch Password Requests to Console Directory Watch.
    [  OK  ] Started Dispatch Password Requests to Console Directory Watch.
    [    6.954662] systemd[1]: Listening on udev Control Socket.
    [  OK  ] Listening on udev Control Socket.
    [    6.984569] systemd[1]: Listening on /dev/initctl Compatibility Named Pipe.
    [  OK  ] Listening on /dev/initctl Compatibility Named Pipe.
    [    7.017128] systemd[1]: Created slice system-serial\x2dgetty.slice.
    [  OK  ] Created slice system-serial\x2dgetty.slice.
    [    7.043832] systemd[1]: Reached target Swap.
    [  OK  ] Reached target Swap.
    [    7.076555] systemd[1]: Created slice User and Session Slice.
    [  OK  ] Created slice User and Session Slice.
    [    7.103957] systemd[1]: Reached target Slices.
    [  OK  ] Reached target Slices.
    [    7.137170] systemd[1]: Created slice system-getty.slice.
    [  OK  ] Created slice system-getty.slice.
    [    7.164723] systemd[1]: Started Forward Password Requests to Wall Directory Watch.
    [  OK  ] Started Forward Password Requests to Wall Directory Watch.
    [    7.193822] systemd[1]: Reached target Paths.
    [  OK  ] Reached target Paths.
    [    7.249395] systemd[1]: Starting Load Kernel Modules...
             Starting Load Kernel Modules...
    [    7.284722] systemd[1]: Listening on Syslog Socket.
    [  OK  ] Listening on Syslog Socket.
    [    7.337757] cryptodev: disagrees about version of symbol module_layout
    [    7.374965] systemd[1]: Starting Journal Service...
             Starting Journal Service...
    [    7.462369] systemd[1]: Mounting POSIX Message Queue File System...
             Mounting POSIX Message Queue File System...
    [    7.524002] systemd[1]: Reached target Remote File Systems.
    [  OK  ] Reached target Remote File Systems.
    [    7.633936] systemd[1]: Mounting Temporary Directory...
             Mounting Temporary Directory...
    [    7.685261] systemd[1]: Listening on Network Service Netlink Socket.
    [  OK  ] Listening on Network Service Netlink Socket.
    [    7.762278] systemd[1]: Starting Remount Root and Kernel File Systems...
             Starting Remount Root and Kernel File Systems...
    [    7.869265] systemd[1]: Starting Create list of required static device nodes for the current kernel...
             Starting Create list of required st... nodes for the current kernel...
    [    8.050961] EXT4-fs (mmcblk0p2): re-mounted. Opts: (null)
    [    8.200283] systemd[1]: Mounted POSIX Message Queue File System.
    [  OK  ] Mounted POSIX Message Queue File System.
    [    8.244251] systemd[1]: Mounted Debug File System.
    [  OK  ] Mounted Debug File System.
    [    8.274135] systemd[1]: Mounted Temporary Directory.
    [  OK  ] Mounted Temporary Directory.
    [    8.305514] systemd[1]: Started Journal Service.
    [  OK  ] Started Journal Service.
    [  OK  ] Started Setup Virtual Console.
    [FAILED] Failed to start Load Kernel Modules.
    See 'systemctl status systemd-modules-load.service' for details.
    [  OK  ] Started Remount Root and Kernel File Systems.
    [  OK  ] Started Create list of required sta...ce nodes for the current kernel.
             Starting Create Static Device Nodes in /dev...
             Starting udev Coldplug all Devices...
             Starting Apply Kernel Variables...
             Starting Flush Journal to Persistent Storage...
    [  OK  ] Started Create Static Device Nodes in /dev.
    [  OK  ] Started Apply Kernel Variables.
    [   12.150253] systemd-journald[74]: Received request to flush runtime journal from PID 1
    [  OK  ] Started Flush Journal to Persistent Storage.
    [  OK  ] Reached target Local File Systems (Pre).
             Mounting /media/ram...
             Mounting /var/volatile...
             Starting udev Kernel Device Manager...
    [  OK  ] Mounted /var/volatile.
    [  OK  ] Mounted /media/ram.
    [  OK  ] Started udev Kernel Device Manager.
    [  OK  ] Started udev Coldplug all Devices.
    [   15.506623] omap_wdt: OMAP Watchdog Timer Rev 0x01: initial timeout 60 sec
    [   15.788087] 47401300.usb-phy supply vcc not found, using dummy regulator
    [   15.938120] 47401b00.usb-phy supply vcc not found, using dummy regulator
    [  OK  ] Found device /dev/ttyS0.
    [   16.841790] omap_rng 48310000.rng: OMAP Random Number Generator ver. 20
    [  OK  ] Created slice system-systemd\x2dbacklight.slice.
             Starting Load/Save Screen Backlight...htness of backlight:backlight...
    [  OK  ] Reached target Local File Systems.
             Starting Create Volatile Files and Directories...
    [   17.947822] omap-sham 53100000.sham: hw accel on OMAP rev 4.3
             Starting Load/Save Random Seed...
    [   18.258373] omap-aes 53500000.aes: OMAP AES hw accel rev: 3.2
    [   18.423550] omap_hwmod: pruss: _wait_target_ready failed: -16
    [   18.456024]  remoteproc0: wkup_m3 is available
    [  OK  ] Started Load/Save Screen Backlight Brightness of backlight:backlight.
    [   18.558620] ti-pruss 4a300000.pruss: couldn't enable pruss
    [   18.593327]  remoteproc0: Note: remoteproc is still under development and considered experimental.
    [   18.602322]  remoteproc0: THE BINARY FORMAT IS NOT YET FINALIZED, and backward compatibility isn't yet guaranteed.
    [   18.668363] ti-pruss: probe of 4a300000.pruss failed with error -16
    [   19.083346]  remoteproc0: powering up wkup_m3
    [   19.089931]  remoteproc0: Booting fw image am335x-pm-firmware.elf, size 216252
    [   19.259291]  remoteproc0: remote processor wkup_m3 is now up
    [   19.259354] wkup_m3_ipc 44e11324.wkup_m3_ipc: CM3 Firmware Version = 0x191
    [  OK  ] Started Create Volatile Files and Directories.
    [  OK  ] Started Load/Save Random Seed.
    [  OK  ] Found device /dev/ttyS3.
    [   22.554202] random: nonblocking pool is initialized
    [   23.205050] FAT-fs (mmcblk0p1): codepage cp437 not found
             Starting Network Time Synchronization...
             Starting Update UTMP about System Boot/Shutdown...
    [   25.846710] FAT-fs (mmcblk0p1): codepage cp437 not found
    [  OK  ] Started Network Time Synchronization.
    [  OK  ] Started Update UTMP about System Boot/Shutdown.
    [   28.389915] musb-hdrc musb-hdrc.0.auto: MUSB HDRC host driver
    [   28.472363] musb-hdrc musb-hdrc.0.auto: new USB bus registered, assigned bus number 1
    [   28.569244] hub 1-0:1.0: USB hub found
    [   28.602350] hub 1-0:1.0: 1 port detected
    [   28.728116] musb-hdrc musb-hdrc.1.auto: MUSB HDRC host driver
    [   28.793459] musb-hdrc musb-hdrc.1.auto: new USB bus registered, assigned bus number 2
    [   28.852546] hub 2-0:1.0: USB hub found
    [   28.873476] hub 2-0:1.0: 1 port detected
    [   29.497293] musb-hdrc musb-hdrc.1.auto: VBUS_ERROR in a_wait_vrise (80, <SessEnd), retry #3, port1 0008010c
    [  OK  ] Found device /dev/mmcblk0p1.
             Starting Synchronize System and HW clocks...
    [  OK  ] Reached target System Time Synchronized.
    [FAILED] Failed to start Synchronize System and HW clocks.
    See 'systemctl status sync-clocks.service' for details.
    [  OK  ] Reached target System Initialization.
    [  OK  ] Listening on D-Bus System Message Bus Socket.
    [  OK  ] Listening on dropbear.socket.
    [  OK  ] Started Daily Cleanup of Temporary Directories.
    [  OK  ] Reached target Timers.
    [  OK  ] Listening on Avahi mDNS/DNS-SD Stack Activation Socket.
    [  OK  ] Listening on RPCbind Server Activation Socket.
    [  OK  ] Reached target Sockets.
    [  OK  ] Reached target Basic System.
    [  OK  ] Started System Logging Service.
    [  OK  ] Started strongSwan IPsec IKEv1/IKEv2 daemon using ipsec.conf.
             Starting Start USB gadget...
             Starting uim-sysfs.service...
    [  OK  ] Started Start gpio_init script.
    [  OK  ] Started Kernel Logging Service.
    [  OK  ] Started D-Bus System Message Bus.
    [   32.542427] gpio3_3.sh[396]: /etc/init.d/gpio3_3.sh: line 10: echo: write error: Invalid argument
    [   33.003861] gpio3_3.sh[396]: *******LCD POWER ENABLED*********
    [   33.112227] gpio3_3.sh[396]: Set register 7: 12 (c)
    [   33.183258] Mass Storage Function, version: 2009/09/11
    [   33.188465] LUN: removable file: (no medium)
    [   33.236442] gpio3_3.sh[396]: Set register 8: 97 (61)[   33.263496] LUN: removable read only file: /dev/mmcblk0p1

    [   33.343587] Number of LUNs=1
    [   33.352661] g_multi gadget: Multifunction Composite Gadget
    [   33.352681] g_multi gadget: g_multi ready
    [   33.746356] tilcdc 4830e000.lcdc: tilcdc_crtc_irq(0x00000020): FIFO underfow
    [   33.750689] tilcdc 4830e000.lcdc: tilcdc_crtc_irq(0x00000004): Sync lost
    [   33.750877] tilcdc 4830e000.lcdc: tilcdc_crtc_irq(0x00000004): Sync lost
    [   33.765219] NET: Registered protocol family 15
             Starting Network Service...
             Starting Login Service...
             Starting Permit User Sessions...
             Starting Telephony service...
             Starting Avahi mDNS/DNS-SD Stack...
    [  OK  ] Started Network Service.
    [  OK  ] Started Permit User Sessions.
    [   35.651609] Initializing XFRM netlink socket
    [FAILED] Failed to start Start USB gadget.
    See 'systemctl status gadget-init.service' for details.
    [  OK  ] Found device /dev/ttyGS0.
    [  OK  ] Started Telephony service.
    [  OK  ] Started Avahi mDNS/DNS-SD Stack.
    [  OK  ] Started Login Service.
             Mounting Configuration File System...
    [  OK  ] Started Getty on tty1.
    [  OK  ] Started Serial Getty on ttyS3.
    [  OK  ] Started Serial Getty on ttyGS0.
    [  OK  ] Started Serial Getty on ttyS0.
    [  OK  ] Reached target Network.
             Starting Lightning Fast Webserver With Light System Requirements...
             Starting Network Name Resolution...
    [  OK  ] Mounted Configuration File System.
    [  OK  ] Started Lightning Fast Webserver With Light System Requirements.
    [  OK  ] Started Network Name Resolution.
    [  OK  ] Started uim-sysfs.service.
             Starting rc.pvr.service...
    [   46.005284] pvrsrvkm: disagrees about version of symbol module_layout
    [   48.814687] pvrsrvkm: disagrees about version of symbol module_layout

     _____                    _____           _         _   
    |  _  |___ ___ ___ ___   |  _  |___ ___  |_|___ ___| |_
    |     |  _| .'| . | . |  |   __|  _| . | | | -_|  _|  _|
    |__|__|_| |__,|_  |___|  |__|  |_| |___|_| |___|___|_|  
                  |___|                    |___|            

    Arago Project http://arago-project.org am335x-evm ttyS0

    Arago 2016.05 am335x-evm ttyS0

  • khageswararao bongu said:
    usb2517@58 {
                compatible = "microchip,usb2517";
                reg = <0x58>;
                tatus = "okay";
            };

    You has a type error, should be status (not tatus).

    You should also check if that USB hub is detected successful by the i2cdetect tool. You can also use other i2c tools (i2cdump, i2cset, i2cget), these testing helps if the slave address clocks are enabled and you can use these tools to quickly get/set the value to just sanity check the i2c functionality. 

    I would recommend you to check your I2C chip (usb hub) with these tools, after successful validation, you can proceed with user space application development.

    Regarding I2C tools usage, you can check the below wiki pages:

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

    linux-kernel/Documentation/i2c/dev-interface

    linux-kernel/Documentation/i2c/functionality

  • khageswararao bongu said:
    i am using below below application to read smbus.

    Regarding the I2C smbus application, first note that i2c driver (omap4-i2c in DTS file) (drivers/i2c/busses/i2c-omap.c) has limited SMBus support.

    In I2C application, first you need to open I2C device (/dev/i2c), which I see you are not doing. Refer to the below docs for example I2C Smbus applications:

    linux-kernel/Documentation/i2c/dev-interface

    /Documentation/i2c/smbus-protocol

    /Documentation/i2c/functionality

    /Documentation/i2c/writing-clients