Re: mcp251x: read oscillator frequency?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Nov 12, 2019 at 12:44 AM Marc Kleine-Budde <mkl@xxxxxxxxxxxxxx> wrote:
> Can you send the output of
>
>     cat /sys/kernel/debug/clk/clk_summary
>
> Once before loading the module and once after loading it.

I moved the target for the mcp2515 clock from 'target-path = "/";' to
'target = <&scm_clocks>;' and 'clk_get_rate(clk) now returns 16MHz:

fragment@4 {
    target = <&scm_clocks>;
    __overlay__ {
        mcp2515_clock: mcp2515_clock {
            compatible = "fixed-clock";
            #clock-cells = <0>;
            clock-frequency = <16000000>;
        };
    };
};

Here is the current overlay:
https://gist.github.com/pdp7/56174646bb9d075b041f24de2bb01973

dmesg shows it is working correctly:
[   60.089957] mcp251x_can_probe: clk_get_rate(clk)=16000000

I guess the issue was I targeting the wrong node for the clock to be
found with clk_get_rate().

Here is the clk_summary with it working correctly:

debian@beaglebone:/opt/source/bb.org-overlays$ cat
/sys/kernel/debug/clk/clk_summary
   clock                         enable_cnt  prepare_cnt        rate
accuracy   phase
----------------------------------------------------------------------------------------
 mcp2515_clock                            1            1    16000000
       0 0


Thanks,
Drew



[Index of Archives]     [Automotive Discussions]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]     [CAN Bus]

  Powered by Linux