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.

Disable RTC in 3.14 kernel

Hi,

My custom hardware has an external RTC chip and I would like to disable the AM335X internal RTC. The kernel I am working on is 3.14 from TI's git.

I tried to add the following in device tree.

&rtc {
status= "disabled";
};

I got 

Error: arch/arm/boot/dts/am335x-smarc-common.dtsi:817.2-3 label or path, 'rtc', not found
FATAL ERROR: Syntax error parsing input tree
make[1]: *** [arch/arm/boot/dts/am335x-smarct335x.dtb] Error 1
make: *** [am335x-smarct335x.dtb] Error 2

I also tried to uncheck the "TI OMAP1" in defconfig file. I got  compiler error as following.

arch/arm/mach-omap2/built-in.o: In function `am33xx_rtc_only_idle':
/home/linux/smarct335x-work/smarc-ti-linux-kernel/arch/arm/mach-omap2/pm33xx.c:213: undefined reference to `omap_rtc_power_off_program'
arch/arm/mach-omap2/built-in.o: In function `am33xx_pm_init':
/home/linux/smarct335x-work/smarc-ti-linux-kernel/arch/arm/mach-omap2/pm33xx.c:720: undefined reference to `omap_rtc_get_base_addr'
make: *** [vmlinux] Error 1

My external RTC chip is from Seiko S35390a and I can see /dev/rtc1 work well. However, I would like to remove /dev/rtc0 from the internal RTC chip and make s35390a as /dev/rtc0.

Is there any way to do this? Thanks.

-Eric

  • Hi Eric,

    Kernel 3.14 is not an official TI release yet and at the moment isn't supported on this forum. Support will be available once it's officially released, approx. 1Q2015.

  • Biser,

    I learned that the AM335X SDK8 is released. Could you answer my previous question now?
    I used alternative Setko S35390A as RTC chip and would like to disable the internal CPU RTC function. When I disable the RTC at defconfig file (v3.14 kernel), I got compile error as:
    arch/arm/mach-omap2/built-in.o: In function `am33xx_rtc_only_idle':
    /home/linux/smarct335x-work/smarc-ti-linux-kernel/arch/arm/mach-omap2/pm33xx.c:213: undefined reference to `omap_rtc_power_off_program'
    arch/arm/mach-omap2/built-in.o: In function `am33xx_pm_init':
    /home/linux/smarct335x-work/smarc-ti-linux-kernel/arch/arm/mach-omap2/pm33xx.c:720: undefined reference to `omap_rtc_get_base_addr'
    make: *** [vmlinux] Error 1

    -Eric
  • Hi Eric,

    Based on the:
    e2e.ti.com/.../1298885
    I made only the following changes:
    @@ -432,7 +432,9 @@
    rtc@44e3e000 {
    compatible = "ti,am3352-rtc";
    reg = <0x44e3e000 0x1000>;
    interrupts = <75
    76>;
    - ti,hwmods = "rtc";
    + status = "disabled";
    + ti = "disabled";
    };

    spi0: spi@48030000 {

    and I hope that in the omap_hwmod.c file is not able to read the RTC registers and RTC is disabled. But you have to initialize your own external RTC chip.

    BR
    Ivan
  • Ivan,
    This is not working.
    When I disable the on-chip RTC config by
    # CONFIG_RTC_DRV_OMAP is not set
    I failed to compile kernel.
    arch/arm/mach-omap2/built-in.o: In function `am33xx_rtc_only_idle':
    /home/linux/smarct335x-work/ti-linux-kernel-3.14/arch/arm/mach-omap2/pm33xx.c:214: undefined reference to `omap_rtc_power_off_program'
    arch/arm/mach-omap2/built-in.o: In function `am33xx_pm_init':
    /home/linux/smarct335x-work/ti-linux-kernel-3.14/arch/arm/mach-omap2/pm33xx.c:715: undefined reference to `omap_rtc_get_base_addr'
    make: *** [vmlinux] Error 1

    If I enable the kernel config, my rtc device (SS35390A) will become /dev/rtc1 instead /dev/rtc0. This is not what I want. This only happen in 3.14 kernel.
    -Eric
  • Hi Eric,

    Just apply the changes do not change the CONFIG_RTC_DRV_OMAP. I successfully compile sdk8 with these changes.

    BR
    Ivan
  • Ivan,
    I knew without changing config file. The compilation is fine. However, I have external RTC chip and would like to disable the CONFIG_RTC_DRV_OMAP. Without doing this, the /dev/rtc0 will be still mapping to internal rtc. I can disable this option in 3.2 and 3.12.

    Have you tried to disabled this kernel config option??
  • Hi Eric,

    Yes, you are right. I have not seen in the pm33xx.c any reason if the ONFIG_RTC_DRV_OMAP is not defined to avoid these errors, because the rtc-omap.c is not included in build and there is no any ifdef in a pm33x.c file. For that reason you can added in these two line:
    #ifdef ONFIG_RTC_DRV_OMAP
    omap_rtc_power_off_program();
    #endif
    or comment the lines.
    I checked this and kernel works.

    BR
    Ivan
  • Ivan,

    This is not my case. See my log below.

    arch/arm/mach-omap2/built-in.o: In function `am33xx_pm_init':
    /home/linux/smarct335x-work/ti-linux-kernel-3.14/arch/arm/mach-omap2/pm33xx.c:717: undefined reference to `omap_rtc_get_base_addr'
    make: *** [vmlinux] Error 1

    -Eric

  • Hi Eric,

    You also have to add:
    #ifdef ONFIG_RTC_DRV_OMAP
    susp_params.rtc_base = omap_rtc_get_base_addr();
    #endif

    and now you can build successfully kernel.

    BR
    Ivan
  • Ivan,

    I knew that you will tell me that. Will it be safe to disable these two lines? What are the side effects?

    -Eric

  • Hi Eric,

    I checked this and my system works w/o any problem. I don't believe in a side effect.

    BR
    Ivan
  • Hi ,

       I am also facing the same problem. What is the solution for this ? Were you able to solve the build errors ?


    Regards,

    Sai