• Lokesh Vutla's avatar
    rtc: omap: Fix selecting external osc · 1f995573
    Lokesh Vutla authored
    commit 3984903a upstream.
    
    RTC can be clocked from an external 32KHz oscillator, or from the
    Peripheral PLL. The RTC has an internal oscillator buffer to support
    direct operation with a crystal.
    
                ----------------------------------------
                |       Device          ---------       |
                |                       |       |       |
                |                       | RTCSS |       |
                |       ---------       |       |       |
        OSC     |<------| RTC   |       |       |       |
                |------>| OSC   |---    |       |       |
                |       --------   |    |       |       |
                |                   ----|clk    |       |
                |       --------   |    |       |       |
                |       | PRCM  |---    |       |       |
                |       --------        --------        |
                ----------------------------------------
    
    The RTC functional clock is sourced by default from the clock derived
    from the Peripheral PLL. In order to select source as external osc clk
    the following changes needs to be done:
    - Enable the RTC OSC (RTC_OSC_REG[4]OSC32K_GZ = 0)
    - Enable the clock mux(RTC_OSC_REG[6]K32CLK_EN = 1)
    - Select the external clock source (RTC_OSC_REG[3]32KCLK_SEL = 1)
    
    Fixes: 399cf0f6 ("rtc: omap: Add external clock enabling support")
    Signed-off-by: default avatarKeerthy <j-keerthy@ti.com>
    Signed-off-by: default avatarLokesh Vutla <lokeshvutla@ti.com>
    Signed-off-by: default avatarDave Gerlach <d-gerlach@ti.com>
    Signed-off-by: default avatarAlexandre Belloni <alexandre.belloni@free-electrons.com>
    Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
    1f995573
rtc-omap.c 21 KB