Re: mcp251x: read oscillator frequency?

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

 



On 11/12/19 7:46 AM, Drew Fustini wrote:
>> Ok, then let's check if the device tree contains the correct value. Can
>> you send the output of:
>>
>>     dtc -I fs -O dts /proc/device-tree

> /dts-v1/;
> 
> / {
>         compatible = "ti,am335x-pocketbeagle", "ti,am335x-bone", "ti,am33xx";
>         serial-number = "1740GPB21127";
>         model = "TI AM335x PocketBeagle";
>         interrupt-parent = <0x1>;
>         #address-cells = <0x1>;
>         #size-cells = <0x1>;
> 
>         mcp2515_clock {
>                 compatible = "fixed-clock";
>                 #clock-cells = <0x0>;
>                 phandle = <0x21a>;
>                 clock-frequency = <0xf42400>;
>                 linux,phandle = <0x21a>;
>         };
> 
> <snip>
> 
>                         mcp2515@1 {
>                                 compatible = "microchip,mcp2515";
>                                 clocks = <0x21a>;
>                                 mcp251x,irq-gpios = <0x196 0x1c 0x0>;
>                                 mcp251x,stay-awake = <0x1>;
>                                 mcp251x,oscillator-frequency = <0xf42400>;
>                                 status = "okay";
>                                 interrupt-parent = <0x196>;
>                                 interrupts = <0x1c 0x2>;
>                                 mcp251x,enable-clkout = <0x1>;
>                                 phandle = <0x21b>;
>                                 reg = <0x1>;
>                                 pinctrl-0 = <0x219>;
>                                 linux,phandle = <0x21b>;
>                                 spi-max-frequency = <0x989680>;
>                                 pinctrl-names = "default";
>                         };

Several of these properties are not handled by the mainline driver
(mcp251x,irq-gpios, mcp251x,stay-awake, mcp251x,oscillator-frequency,
mcp251x,enable-clkout). This doesn't have any effect, it just bloats the
DT by some bytes.

Which kernel are you using?

> 0xf42400 is 16MHz so it does look like device tree has the correct value.
> 
> Maybe I am not defining the clock correctly?
> 
> It doesn't appear that the call clk_get_rate(clk) returns the value defined in DT.

Can you send the output of

    cat /sys/kernel/debug/clk/clk_summary

Once before loading the module and once after loading it.

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