hc
2024-08-12 233ab1bd4c5697f5cdec94e60206e8c6ac609b4c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
/dts-v1/;
/plugin/;
 
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/pinctrl/rockchip.h>
#include <dt-bindings/interrupt-controller/irq.h>
 
/ {
   metadata {
       title = "Enable MCP2515 with 8MHz external clock on SPI1-M1 over CS1";
       compatible = "unknown";
       category = "misc";
       description = "Provide support for Microchip MCP2515 SPI CAN controller.\nAssumes 8MHz external clock.\nUses Pin 19 (GPIOI1_B2) for INT.";
   };
 
   fragment@0 {
       target = <&spi1>;
       __overlay__ {
           status = "okay";
           pinctrl-names = "default";
           pinctrl-0 = <&spi1m1_pins &spi1m1_cs0 &spi1m1_cs1>;
 
           can0: mcp2515@1 {
               compatible = "microchip,mcp2515";
               reg = <1>;
               spi-max-frequency = <10000000>;
 
               pinctrl-names = "default";
               pinctrl-0 = <&mcp2515_int_pins>;
 
               interrupt-parent = <&gpio1>;
               interrupts = <RK_PB2 IRQ_TYPE_EDGE_FALLING>;
 
               clocks = <&can0_osc>;
           };
       };
   };
 
   fragment@1 {
       target = <&pinctrl>;
       __overlay__ {
           mcp2515 {
               mcp2515_int_pins: mcp2515-int-pins {
                   rockchip,pins = <1 RK_PB2 RK_FUNC_GPIO &pcfg_pull_up>;
               };
           };
       };
   };
 
   fragment@2 {
       target-path = "/";
       __overlay__ {
           can0_osc: can0-osc {
               compatible = "fixed-clock";
               #clock-cells = <0>;
               clock-frequency  = <8000000>;
           };
       };
   };
};