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/DM388: i2c2 and i2c3 configuartion

Part Number: DM388

Tool/software: Linux

Hello all,

I am using DM388 evm with IPNC 3.9.1 rdk.

I want to configure i2c2 and i2c3 by default its not configured.

Below i added in t181xx.dtsi

i2c3: i2c@19c000 {
                                compatible = "ti,omap4-i2c";
                                #address-cells = <1>;
                                #size-cells = <0>;
                                ti,hwmods = "i2c3";
                                reg = <0x19c000 0x1000>;
                                interrupts = <30>;
                        };
                        i2c4: i2c@19e000 {
                                compatible = "ti,omap4-i2c";
                                #address-cells = <1>;
                                #size-cells = <0>;
                                ti,hwmods = "i2c4";
                                reg = <0x19e000 0x1000>;
                                interrupts = <31>;
                        };

I got error like

                         platform 4819c000.i2c: Cannot lookup hwmod 'i2c3'
[    0.279043] platform 4819e000.i2c: Cannot lookup hwmod 'i2c4'
[    0.404691] omap_i2c 4819c000.i2c: _od_fail_runtime_resume: FIXME: missing hwmod/omap_dev info
[    0.413820] omap_i2c 4819e000.i2c: _od_fail_runtime_resume: FIXME: missing hwmod/omap_dev info

Regards,

RAJ M

  • Raj,

    I2C2 is connected to camera sensor & hence it is controlled by M3 core & not A8.
    It is ideal to keep I2C2 untouched from Linux side unless you write a special piece of software to manage multiple masters (hosts).

    Thanks
  • Hi Ravikiran,

    I understand we cant use i2c by M3 core & A8 simultaneously.
    We dnot want to use camera on i2c2. We want to control the i2c2 &i2c3 on A8 side only.
    In the above post i cant even register the i2c bus ?

    what is the ti,hwmod for 'i2c2' & 'i2c3' controller?

    Regards,
    RAJ M
  • HI,

    I add ti_tools/ipnc_psp_arago/kernel/arch/arm/mach-omap2/omap_hwmod_81xx_data.c

    i add the structure in ti81xx_hwmod_ocp_ifs_dm38x , dm814x_hwmod_ocp_ifs

    static struct omap_hwmod dm81xx_i2c3_hwmod = {
    .name = "i2c3",
    .clkdm_name = "alwon_l3s_clkdm",
    .main_clk = "i2c3_fck",
    .prcm = {
    .omap4 = {
    .clkctrl_offs = DM81XX_CM_ALWON_I2C_0_CLKCTRL,
    .modulemode = MODULEMODE_SWCTRL,
    },
    },
    .class = &i2c_class,
    };

    static struct omap_hwmod_ocp_if dm81xx_l4_ls__i2c3 = {
    .master = &dm81xx_l4_ls_hwmod,
    .slave = &dm81xx_i2c3_hwmod,
    .clk = "sysclk6_ck",
    .user = OCP_USER_MPU,
    };

    An also i add ti_tools/ipnc_psp_arago/kernel/drivers/clk/ti/clk-814x.c
    DT_CLK(NULL, "i2c3_fck", "i2c3_fck"),


    Log:
    [ 0.382004] omap_i2c 48028000.i2c: bus 0 rev0.11 at 400 kHz
    [ 0.388613] omap_i2c 4802a000.i2c: bus 1 rev0.11 at 100 kHz
    [ 0.395084] omap_i2c 4819c000.i2c: bus 2 rev0.11 at 400 kHz


    Its crash on
    Welcome to Arago 2016.05!

    [ 1.861454] systemd[1]: Set hostname to <ti81xx>.
    [ 2.047787] Unhandled fault: external abort on non-linefetch (0x1028) at 0xf902a02c
    [ 2.055498] pgd = c0004000
    [ 2.058218] [f902a02c] *pgd=48011452(bad)
    [ 2.062265] Internal error: : 1028 [#1] ARM
    [ 2.066465] Modules linked in:
    [ 2.069545] CPU: 0 PID: 9 Comm: kworker/0:1 Not tainted 4.4.12 #7
    [ 2.075664] Hardware name: Generic TI81xx (Flattened Device Tree)
    [ 2.081800] Workqueue: pm pm_runtime_work
    [ 2.085834] task: c493e000 ti: c4940000 task.ti: c4940000
    [ 2.091266] PC is at omap_i2c_runtime_suspend+0x24/0x9c
    [ 2.096514] LR is at 0xf902a02c
    [ 2.099671] pc : [<c033828c>] lr : [<f902a02c>] psr: a00e0013
    [ 2.099671] sp : c4941e38 ip : c0507578 fp : c4941e4c
    [ 2.111199] r10: c06d9ac0 r9 : 00000008 r8 : 00000000
    [ 2.116446] r7 : c06d9ac0 r6 : 0000000a r5 : c00202a4 r4 : c4919210
    [ 2.123002] r3 : c49a2410 r2 : f902a000 r1 : 00000000 r0 : c4919210
    [ 2.129560] Flags: NzCv IRQs on FIQs on Mode SVC_32 ISA ARM Segment kernel
    [ 2.136902] Control: 10c5387d Table: 8257c019 DAC: 00000055
    [ 2.142673] Process kworker/0:1 (pid: 9, stack limit = 0xc4940208)
    [ 2.148880] Stack: (0xc4941e38 to 0xc4942000)

    Regards,
    RAJ M

  • Hello All,

    When we make "status=disabled" for i2c1 and i2c2
    Now i can access i2c3 and i2c4

    [ 0.328938] omap_i2c 4819c000.i2c: bus 2 rev0.11 at 400 kHz
    [ 0.335587] omap_i2c 4819e000.i2c: bus 3 rev0.11 at 400 kHz

    Is there any restriction to use all 4 i2c controller in A8 side?

    Regards,
    RAJ M
  • Hi all,

    Any update?

    Regards,
    RAJ M