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.

AM6442: Using MCU_I2C in Linux

Part Number: AM6442

Hi,

used tools: processor_sdk_linux_am64x_07_03_00_02 on an AM64x Eval Board

I tried to add mcu_i2c to Linux in pinmux tool for AM64x

&wkup_pmx0 {
    mymcu_i2c1_pins_default: mymcu_i2c1_pins_default {
        pinctrl-single,pins = <
            AM64x_WKUP_IOPAD(0x0050, PIN_INPUT, 0) /* (A11) MCU_I2C1_SCL */
            AM64x_WKUP_IOPAD(0x0054, PIN_INPUT, 0) /* (B10) MCU_I2C1_SDA */
        >;
    }

}

But if i add this pin config in k3-am642-evm.dts i get this error:

processor_sdk_linux_am64x_07_03_00_02/board-support/linux-5.4.106+gitAUTOINC+023faefa70-g023faefa70$ make ARCH=arm64 CROSS_COMPILE=aarch64-none-linux-gnu- ti/k3-am642-evm.dtb
DTC arch/arm64/boot/dts/ti/k3-am642-evm.dtb
Error:   arch/arm64/boot/dts/ti/k3-am642-evm.dts:379.1-11 Label or path wkup_pmx0 not found

I don't know, why I get this error.

Thank you for your help.

Best regards,

Stefan

  • Hi Stefan,

    We don't enable the MCU domain peripherals by default in Linux. I will ask someone to look into this further as to how to add this to Linux and get back to you.

    It may take a couple of days to provide this guidance.

    Thanks.

  • EDITED 6/11/2021

    Hello Stefan,

    The mcu I2C devices are not currently defined in the AM64x device tree.

    Using AM65x as an example, wkup_i2c0 is defined in k3-am65-wakeup.dtsi, and given an alias of i2c0 in k3-am65.dtsi. The pinmuxing for the MCU I2C0 is applied in k3-am654-base-board.dts. AM64x does not have a k3-am64-wakeup.dtsi file as of AM64x Linux Processor SDK 7.3.1.6.

    You may be able to add the wakeup I2C instances by using AM65x as a template, but I am not sure how similar the process would be to AM65x.  See update below. I do not think Linux to MCU domain I2C is something our team has tested yet. Let me check to see what the plans are for adding wakeup domain peripherals to the Linux device tree file. Please ping the thread if I have not replied in another business day or so.

    Regards,

    Nick

  • Update: we will add the MCU domain peripherals to the AM64x linux device tree in the Processor SDK 8.0 release. You can find the current draft of our Linux kernel 5.10 release here: https://git.ti.com/cgit/ti-linux-kernel/ti-linux-kernel/tree/arch/arm64/boot/dts/ti?h=ti-linux-5.10.y

    Please note that this is a development branch. Everything is a work in progress, and some things may be untested or broken before the official SDK release. However, you could look at the am64x device tree files as a template to see if you can get something working on SDK 7.3.

    I am still checking on whether the team has tested wakeup I2C from Linux at this point. It looks like the dts files for the AM64x EVM and Starter kit both disable this peripheral by default to leave it available for the R5 cores to control.

    Regards,

    Nick

  • Final update: the development team has not tested the MCU domain I2C driver for the Processor SDK 8.0 release since there are no client devices on the base board they can test with. Let us know if you run into issues.

    Regards,

    Nick

  • Hi Nick,

    Thank you for your response.

    Okay i tried to set the device tree in my SDK 7.3 for Linux like it is implemented in the ti-linux-5.10.y.
    But the MCU_I2C doesn't recogniced from the kernel.
    So i set also the dfs in u-boot and check if the dfs setting is displayed in u-boot with memory display of 0x04084048 MCU_PADCONFIG_18 register for MCU_I2C0_SCL
    md 0x04084048 1 --> 00214007
    It seems that the Muxmode of MCU_PADCONFIG_18 is not set to MCU_I2C0_SCL how it is defined in the dfs files.
    Okay and so at least i tried to set in u-boot with memory write MCU_PADCONFIG_18 for MCU_I2C0_SCL.
    Here the commands in u-boot:
    => mw 0x04084048 00060000 1
    => md 0x04084048 1
    result: 04084048: 00054007
    the result is that i cannot set the MCU_I2C0_SCL in uboot!

    If try the same for a main register and it works:
    => md 0x000F42CC 1
    000f42cc: 00010000 ....
    => mw 0x000F42CC 00000000 1
    => md 0x000F42CC 1
    000f42cc: 00000000

    My question is now, is there a problem to set registers in the MCU domain (in u-boot or linux)?

    Best regards,
    Stefan

  • Hello Stefan,

    How are you setting up the device tree in SDK 7.3? Note that there are probably multiple changes that would need to be made (for example, there might be clocking changes, etc) in addition to adding the new SPI nodes.

    Are you seeing any terminal output that would be helpful? "MCU_I2C doesn't get recognized by the kernel" is too vague.

    Regards,

    Nick

  • Hi Nick,


    Thank you for your fast response.
    Sorry, i thought that the u-boot memory write, which seems not working for MCU_I2C0 could be the reason.

    Here now my changes in the device tree linux:
    - download k3-am64-mcu.dtsi from ti-linux-5.10.y
    - include it in k3-am64.dtsi
    - added in k3-am642-evm.dts:
    &mcu_i2c0 {
    pinctrl-names = "default";
    pinctrl-0 = <&mymcu_i2c0_pins_default>;
    status = "okay";
    clock-frequency = <2000000>;

    };

    &cbass_mcu {
    mymcu_i2c0_pins_default: mymcu-i2c0-pins-default {
    pinctrl-single,pins = <
    AM64X_MCU_IOPAD(0x0048, PIN_INPUT_PULLUP, 0) /* (E9) MCU_I2C0_SCL */
    AM64X_MCU_IOPAD(0x004c, PIN_INPUT_PULLUP, 0) /* (A10) MCU_I2C0_SDA */
    >;
    };
    };

    By side: I changed the output of the pinmux tool (AM64x_beta), because the macro AM64x_WKUP_IOPAD isn't defined for AM64x.
    This was the original output of the pinmux tool:
    &wkup_pmx0 {
    mymcu_i2c0_pins_default: mymcu_i2c0_pins_default {
    pinctrl-single,pins = <
    AM64x_WKUP_IOPAD(0x0048, PIN_INPUT, 0) /* (E9) MCU_I2C0_SCL */
    AM64x_WKUP_IOPAD(0x004c, PIN_INPUT, 0) /* (A10) MCU_I2C0_SDA */
    >;
    };
    };

    - after that i build the linux kernel and copy all on the SD card.
    - In dmesg of the kernel i only see the main i2c:
    root@am64xx-evm:~# dmesg | grep i2c
    [ 0.657863] i2c /dev entries driver
    [ 0.805930] omap_i2c 20000000.i2c: bus 1 rev0.12 at 100 kHz
    [ 0.846169] omap_i2c 20010000.i2c: bus 2 rev0.12 at 400 kHz
    [ 0.852809] omap_i2c 20020000.i2c: bus 3 rev0.12 at 100 kHz
    [ 0.859399] omap_i2c 20030000.i2c: bus 4 rev0.12 at 100 kHz

    Many thanks in advance.
    Best regards,
    Stefan

  • Hi Nick,

    Oh, I see a typo in my message before:

    I set the clock-frequency to 200000 not to 2MHz in the device tree.

    Regards,

    Stefan