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.

AM3352: Configuring TPS65910 RTC in AM3352 Device Tree

Other Parts Discussed in Thread: TPS65910, AM3352

Currently, I'm using the AM3352 platform and the TPS65910 PMIC for development. I want to automatically load the tps65910-rtc driver during system boot.
During the boot process, I encountered the following issue:
# dmesg | grep rtc
[ 3.928888] tps65910-rtc tps65910-rtc: IRQ is not free.
[ 3.934367] tps65910-rtc: probe of tps65910-rtc failed with error -22
[ 3.955576] hctosys: unable to open rtc device (rtc0)
[ 4.775031] omap_rtc 44e3e000.rtc: already running
[ 4.780437] omap_rtc 44e3e000.rtc: rtc core: registered 44e3e000.rtc as rtc0
[ 5.119240] PM: bootloader does not support rtc-only!

# dmesg | grep 65910
[ 3.888277] tps65910 0-002d: No interrupt support, no core IRQ
[ 3.894590] tps65910-gpio tps65910-gpio: ti,en-gpio-sleep not specified
[ 3.894744] gpiochip_add: registered GPIOs 504 to 509 on device: tps65910
[ 3.928888] tps65910-rtc tps65910-rtc: IRQ is not free.
[ 3.934367] tps65910-rtc: probe of tps65910-rtc failed with error -22

Based on the error message, it seems like the interrupt number for tps65910-rtc is being used by another device. How can I resolve this issue?

Other related messages:
Platform:Linux
Kernel Version:Linux-4.1.18

# CONFIG_RTC_DRV_OMAP is not set
CONFIG_GPIO_TPS65910=y
CONFIG_MFD_TPS65910=y
CONFIG_REGULATOR_TPS65910=y
CONFIG_RTC_DRV_TPS65910=y

&i2c0 {
pinctrl-names = "default";
pinctrl-0 = <&i2c0_pins>;

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

tps: tps@2d {
reg = <0x2d>;
interrupts = <&gpio3 0>;
}
};

&tps {
vcc1-supply = <&vbat>;
vcc2-supply = <&vbat>;
vcc3-supply = <&vbat>;
vcc4-supply = <&vbat>;
vcc5-supply = <&vbat>;
vcc6-supply = <&vbat>;
vcc7-supply = <&vbat>;
vccio-supply = <&vbat>;

regulators {
vrtc_reg: regulator@0 {
regulator-always-on;
};

vio_reg: regulator@1 {
regulator-always-on;
};

vdd1_reg: regulator@2 {
/* VDD_MPU voltage limits 0.95V - 1.26V with +/-4% tolerance */
regulator-name = "vdd_mpu";
regulator-min-microvolt = <912500>;
regulator-max-microvolt = <1351500>;
regulator-boot-on;
regulator-always-on;
};

vdd2_reg: regulator@3 {
/* VDD_CORE voltage limits 0.95V - 1.1V with +/-4% tolerance */
regulator-name = "vdd_core";
regulator-min-microvolt = <912500>;
regulator-max-microvolt = <1150000>;
regulator-boot-on;
regulator-always-on;
};

vdd3_reg: regulator@4 {
regulator-always-on;
};

vdig1_reg: regulator@5 {
regulator-always-on;
};

vdig2_reg: regulator@6 {
regulator-always-on;
};

vpll_reg: regulator@7 {
regulator-always-on;
};

vdac_reg: regulator@8 {
regulator-always-on;
};

vaux1_reg: regulator@9 {
regulator-always-on;
};

vaux2_reg: regulator@10 {
regulator-always-on;
};

vaux33_reg: regulator@11 {
regulator-always-on;
};

vmmc_reg: regulator@12 {
regulator-min-microvolt = <1800000>;
regulator-max-microvolt = <3300000>;
regulator-always-on;
};
};
};

  • Hello,

    The RTC expert is out of office until the end of the week. Please ping this thread if you don't get a response by July 17th.

  • Hi Anshu:

    Thank you for the update on the RTC expert's availability. I understand that they are currently out of office and I appreciate the notice. I will certainly keep an eye on this thread and ping it if I haven't received a response by July 17th. I appreciate your assistance in ensuring that my inquiry is addressed as soon as possible.

    In the meantime, if there's any other information I can provide or steps I can take to expedite the process, please don't hesitate to let me know. I am looking forward to hearing back from the RTC expert as soon as they return.

    Thank you again for your attention to this matter.

  • Hello,

    It would be helpful to know following:

    • Which SDK version you are using?
    • Are you using custom hardware or a TI EVM/Beagle Bone Product?
    • What ways you've tried to debug this?

    If you make any progress while the expert is Out of Office, feel free to post it on this thread.

    Thanks,

    Anshu

  • Hello,

    1. The SDKwe are using is buildroot 2017.02. 

    2. We are utilizing TI's AM335X-EVM.

    3. We have attempted to modify the device tree, amended the rtc-tps65910 driver, and inspected the hardware circuitry. However, none of these efforts have resolved the issue.

    Apart from the issues mentioned above, is there anything else you require me to provide?

    Thanks!

  • Hello,

    I think I might have found the problem. Here are some phenomena during the debugging process:

    1) If I set the interrupt number to 96(interrupts=<96>;) in the device tree (because we use GPIO3_0 as the interrupt pin for TPS65910), the irq obtained from the tps65910_i2c_probe() function in drivers/mfd/tps65910.c is 26, which does not match the setting. And it cannot start the kernel normally, it keeps restarting. The system interrupt information and kernel startup exception information are shown in the following figure:

    2) If I directly set the irq to 96 in the tps65910_i2c_probe() function in drivers/mfd/tps65910.c, it can normally register the interrupt of TPS65910 and register TPS65920-RTC, but it cannot start the kernel and keeps restarting repeatedly.

    From the above two situations, it seems that the inability to use the RTC of TPS65910 normally is caused by the device tree not setting the interrupt number. However, if I set the interrupt number to 96, it seems to conflict with 44e07000.gpio, causing the kernel to keep restarting. Is interrupt number 96 a necessary interrupt? Can it be disabled? If so, how can I disable it? If it cannot be disabled, is there any good way to solve the problem I am currently facing?

  • Hi Anshu!

    Has the RTC expert returned yet? The issue with the tps65910-rtc has been troubling us for quite some time now. I'd like to summarize our current debugging status and we are eagerly looking forward to your assistance.

    1.When we set the address of the tps65910 PMIC to 0x12, the kernel boots up normally, and it successfully registers the interrupts and drivers for the tps65910 with the system. We can also find the interrupt numbers related to the tps65910 within the interrupts. However, when we use the commands hwclock -w or hwclock -r, we encounter an error message stating "hwclock: ioctl(RTC_RD_TIME) to /dev/rtc to read the time failed: Invalid argument".

    tps: tps@12 {
        reg = <0x12>;
        interrupts = <96>;
    };

    # hwclock -w
    hwclock: ioctl(RTC_RD_TIME) to /dev/rtc to read the time failed: Invalid argument
    # hwclock -r
    hwclock: ioctl(RTC_RD_TIME) to /dev/rtc to read the time failed: Invalid argument

    Other relevant kernel boot-up information:

    # dmesg | grep rtc
    [ 1.875324] tps65910-rtc tps65910-rtc: rtc core: registered tps65910-rtc as rtc0
    [ 2.871301] tps65910-rtc tps65910-rtc: hctosys: unable to read the hardware clock
    [ 7.216956] omap_rtc 44e3e000.rtc: rtc core: registered 44e3e000.rtc as rtc1
    [ 7.343871] PM: bootloader does not support rtc-only!

    # cat /proc/interrupts
    CPU0
    16: 8845 INTC 68 Level gp_timer
    19: 1 INTC 78 Level wkup_m3_txev
    20: 0 INTC 12 Level 49000000.edma_ccint
    22: 0 INTC 14 Level 49000000.edma_ccerrint
    26: 0 INTC 48 Level 44e07000.gpio
    56: 0 44e07000.gpio 29 Edge volume-down
    59: 0 INTC 98 Level 4804c000.gpio
    92: 0 INTC 32 Level 481ac000.gpio
    125: 0 INTC 62 Level 481ae000.gpio
    126: 0 481ae000.gpio 0 Edge volume-up
    147: 0 481ae000.gpio 21 Edge 48060000.mmc cd
    158: 481 INTC 72 Level OMAP UART0
    161: 412 INTC 70 Level 44e0b000.i2c
    162: 4 INTC 71 Level 4802a000.i2c
    163: 13 INTC 64 Level mmc0
    164: 13 INTC 29 Level mmc1
    168: 0 INTC 77 Level wkup_m3
    174: 0 INTC 75 Level rtc1
    175: 0 INTC 76 Level rtc1
    177: 0 INTC 41 Level 4a100000.ethernet
    178: 0 INTC 42 Level 4a100000.ethernet
    188: 0 INTC 4 Level 48080000.elm
    189: 14041 INTC 36 Level tilcdc
    190: 0 INTC 16 Level TI-am335x-tsc, TI-am335x-adc
    191: 0 INTC 100 Level gpmc
    192: 0 INTC 109 Level 53100000.sham
    194: 0 INTC 80 Level 48038000.mcasp_tx

    195: 0 INTC 81 Level 48038000.mcasp_rx

    196: 0 INTC 111 Level 48310000.rng
    199: 0 INTC 96 Level tps65910
    206: 0 tps65910 6 Edge tps65910-rtc
    210: 0 INTC 18 Level musb-hdrc.0.auto
    211: 8 INTC 19 Level musb-hdrc.1.auto
    212: 0 INTC 17 Level 47400000.dma-controller
    Err: 0

    2.If we set the address of the tps65910 PMIC to 0x2d, the kernel fails to boot properly. The partial boot-up information is as follows:

    tps: tps@2d {
        reg = <0x2d>;
        interrupts = <96>;
    };

    [ 3.379014] tps65910 0-002d: Linxu:flags=0,addr=45,name=tps65910,irq=199
    [ 3.406607] vdd_mpu: Failed to create debugfs directory
    [ 3.413822] vdd_core: Failed to create debugfs directory
    [ 3.440715] tps65910-rtc tps65910-rtc: rtc core: registered tps65910-rtc as rtc0
    [ 3.448729] omap_i2c 44e0b000.i2c: bus 0 rev0.11 at 400 kHz
    [ 3.456038] omap_i2c 4802a000.i2c: bus 1 rev0.11 at 100 kHz
    [ 3.463098] remoteproc0: powering up wkup_m3
    [ 3.467757] remoteproc0: Booting fw image am335x-pm-firmware.elf, size 219803
    [ 3.475663] remoteproc0: remote processor wkup_m3 is now up
    [ 3.481581] wkup_m3_ipc 44e11324.wkup_m3_ipc: CM3 Firmware Version = 0x191
    [ 3.488918] tps65910-rtc tps65910-rtc: setting system clock to 2000-01-01 00:00:00 UTC (946684800)
    [ 3.502408] ALSA device list:
    [ 3.505523] No soundcards found.
    [ 3.510056] Freeing unused kernel memory: 268K (c08ad000 - c08f0000)
    INIT: version 2.88 booting
    INIT: Entering runlevel: 3
    Starting logging: OK
    modprobe: module bc_example not found in modules.dep
    modprobe: module cryptodev not found in modules.dep
    modprobe: module pvrsrvkm not found in modules.dep
    Populating /dev using udev: [ 4.293252] 47401300.usb-phy supply vcc not found, using dummy regulator
    [ 4.370119] 47401b00.usb-phy supply vcc not found, using dummy regulator
    [ 4.377673] sgtl5000: probe of 1-000a failed with error -121
    [ 4.405845] tp reset gpio=-2
    [ 4.410462] msg ft5x0x_i2c_rxdata i2c read error: -121
    [ 4.415835] ft5x0x read ID error!
    [ 4.464361] ft5x06_ts: probe of 1-0038 failed with error 161
    [ 4.496644] ft5x0x_ts_init successful
    [ 4.625811] PM: bootloader does not support rtc-only!
    [ 4.667791] davinci_evm sound: ASoC: CODEC DAI sgtl5000 not registered
    [ 4.701344] davinci_evm sound: snd_soc_register_card failed (-517)
    [ 4.710918] davinci_evm sound: ASoC: CODEC DAI sgtl5000 not registered
    [ 4.732006] davinci_evm sound: snd_soc_register_card failed (-517)
    [ 5.088527] davinci_evm sound: ASoC: CODEC DAI sgtl5000 not registered
    [ 5.095368] davinci_evm sound: snd_soc_register_card failed (-517)
    [ 5.198558] davinci_evm sound: ASoC: CODEC DAI sgtl5000 not registered
    [ 5.205389] davinci_evm sound: snd_soc_register_card failed (-517)
    [ 5.249015] davinci_evm sound: ASoC: CODEC DAI sgtl5000 not registered
    [ 5.255856] davinci_evm sound: snd_soc_register_card failed (-517)
    [ 5.286407] davinci_evm sound: ASoC: CODEC DAI sgtl5000 not registered
    [ 5.293667] davinci_evm sound: snd_soc_register_card failed (-517)
    [ 5.313348] davinci_evm sound: ASoC: CODEC DAI sgtl5000 not registered
    [ 5.321996] davinci_evm sound: snd_soc_register_card failed (-517)
    done
    Initializing random number generator... done.
    Starting network: udhcpc: started, v1.25.1
    udhcpc: sending discover
    [ 5.887623] musb-hdrc musb-hdrc.1.auto: VBUS_ERROR in a_wait_vrise (80, <SessEnd), retry #3, port1 0008010c
    udhcpc: sending discover

    And at this point, the kernel gets stuck. 

    3.If I don't set the interrupt number for the tps65910, the kernel can boot up normally.

    tps: tps@2d {
        reg = <0x2d>;
    };

    Please let me know if you need any additional information from me.

    Thanks!

  • Hello,

    First off, please note that this is a very old version of Linux that we can no longer support on the forums, and this version of Linux isn't even distributed by TI. I will try to offer some guidance, but we will be limited in what we can do.

    I found this thread where another customer got RTC working on a similar version of Linux to you. Perhaps their devicetree settings can be a useful template:
    https://e2e.ti.com/support/processors-group/processors/f/processors-forum/659761/linux-am3352-device-tree-settings-for-tps65910-rtc

    By the way, it looks like the kernel bindings documentation has a bug in it where it shows using the address of 0xd2 instead of 0x2d. I have filed a ticket to get that fixed in a later SW release: Documentation/devicetree/bindings/mfd/tps65910.txt

    Regards,

    Nick