Re: mcp251x: read oscillator frequency?

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

 



On 11/12/19 7:42 PM, Drew Fustini wrote:
> 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:

\o/ yeay \o/

> 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().

I should definitely learn something about DT overlays. I just used
ready-to-use raspi mcp2515 overlay.

> 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

This is after module loading?

Marc

-- 
Pengutronix e.K.                 | Marc Kleine-Budde           |
Embedded Linux                   | https://www.pengutronix.de  |
Vertretung West/Dortmund         | Phone: +49-231-2826-924     |
Amtsgericht Hildesheim, HRA 2686 | Fax:   +49-5121-206917-5555 |

Attachment: signature.asc
Description: OpenPGP digital signature


[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