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.

AM335x Linux driver for PMIC TPS65218

Guru 10235 points
Other Parts Discussed in Thread: AM3352, TPS65218, TPS65090, TPS65217, TPS65910, PROCESSOR-SDK-AM335X

Hello, TI Experts,

 

Our customer start to product design with AM3352 and PMIC(TPS65218B1PHPT).

Can we use TPS65218B1PHPT with "PROCESSOR-SDK-LINUX-AM335X"?

We found the document "Powering the AM335x/AM437x with TPS65218" from http://www.ti.com/lit/ug/slvuaa9/slvuaa9.pdf

So our understanding is as follows;

  - TPS65218 can be used with the AM3352.

  - "PROCESSOR-SDK-LINUX-AM335X" contains driver software which can support PMIC(TPS65218).

 

Is this understanding correct?

 

I would appreciate if you tell us how to use PMIC(TPS65218B1PHPT) and AM3352 with "PROCESSOR-SDK-LINUX-AM335X".

 

Best regards,

  • Hi,

    Yes you should be able to use TPS65218 with AM335x devices. The linux kernel driver is drivers/mfd/tps65218.c and by default is included in the kernel build (driver is enabled in tisdk_am335x-evm_defconfig):
    CONFIG_MFD_TPS65090=y
    CONFIG_MFD_TPS65217=y
    CONFIG_MFD_TPS65218=y
    CONFIG_MFD_TPS6586X=y
    CONFIG_MFD_TPS65910=y
    Best Regards,
    Yordan
  • Hi,

    Thank you for your detailed explanation.
    I really appreciate your help.
    This information is very helpful!

    Our customer sent us an additional question about sample-code for TPS65218 with AM335x.
    Is there any sample code for PMIC(TPS65218) control ?

    Best regards,

  • Hi,

    What do you mean by sample code? I pointed the driver source.

    Besides that there is the regulator function managed by:
    drivers/regulator/tps65218-regulator.c  

    You can download and install the kernel sources from the bellow link: 
      http://www.ti.com/tool/PROCESSOR-SDK-AM335X

    Hope this helps. 


    Best Regards,
    Yordan

  • Hi,

    Thank you for your kindness.
    I really appreciate your help.

    Our customer want to know how to use PMIC(TPS65218) and how to write the c-code.
    So we are looking for the sample c-code.

    From your information, we were investigating about power management more.
    And our understanding is as follows;
    - Sample c-code for PMIC(TPS65218) control doesn't exist.
    - The operating frequency can be changed by general Linux command like below E2E thread.
    e2e.ti.com/.../1890563
    example:
    $target> echo "userspace" > scaling_governor
    $target> echo 600000/300000 > scaling_setspeed
    (I also found the frequency change by " cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed")
    -> Then Linux kernel controls the TPS65218 via the linux kernel driver "tps65218.c".
    - So user don't have to use and touch the linux kernel driver "tps65218.c".

    Is this understanding correct?

    Best regards,
  • Hello Yordan,

    Our customer is waiting for the answer.
    So I'd like to answer to the customer as below.
    - Sample c-code for PMIC(TPS65218) control doesn't exist.
    - Because the operating frequency can be changed by general Linux command as follows.
    example: change to 600MHz operation
    $target> echo 600000 > scaling_setspeed
    - Wiki as below is also helpful.
    processors.wiki.ti.com/.../AM335x_Linux_Power_Management_User_Guide

    If you have some comment/recommendation, please tell us.

    Best regards,
  • Hi Matusan,

    [/quote]- Sample c-code for PMIC(TPS65218) control doesn't exist. [/quote]

    This is not true. As I said there is a linux driver located in drivers/mfd/tps65218.c. The AM437x GP EVM & AM437x StarterKit use this PMIC (tps65218) and if you see at their dts files, they call the exact same driver:
    am437x-gp-evm.dts:
    &i2c0 {
    status = "okay";
    pinctrl-names = "default";
    pinctrl-0 = <&i2c0_pins>;
    clock-frequency = <100000>;

    tps65218: tps65218@24 {
    reg = <0x24>;
    compatible = "ti,tps65218";

    am437x-sk-evm.dts:
    &i2c0 {
    status = "okay";
    pinctrl-names = "default";
    pinctrl-0 = <&i2c0_pins>;
    clock-frequency = <100000>;

    tps@24 {
    compatible = "ti,tps65218";

    - Because the operating frequency can be changed by general Linux command as follows.
    example: change to 600MHz operation
    $target> echo 600000 > scaling_setspeed
    - Wiki as below is also helpful.
    processors.wiki.ti.com/.../AM335x_Linux_Power_Management_User_Guide


    This is correct. You can use the user space framework to control the cpu frequency.

    Best Regards,
    Yordan
  • Hello Yordan,

     

    Thank you for your kindness.

    This information is very helpful!

     

    For the cpu frequency control,

    I'd like to send the answer to the customer.

     

    For  Sample c-code,

      If you know the exact sample code file name like "xxx.c", please tell us.

     (In my understanding, tps65218.c is a driver fie. Not the sample code.)

     

    Best regards,

  • Hi,

    (In my understanding, tps65218.c is a driver fie. Not the sample code.)


    Yes this is the kernel file. There isn't other linux sample code.
    You could see if the RTOS will help (PROCESSOR-SDK-RTOS-AM335X), refer to ti/pdk_<version>/packages/ti/board/diag/pmic/src/pmic_test.c

    Best Regards,
    Yordan
  • Hi Yordan,

    Thank you for your kindness.
    I really appreciate your help.
    This information is very helpful!

    Best regards