forked from raspberrypi/linux
-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
can: mcp2517fd: added can0/can1 overlays
Signed-off-by: Martin Sperl <[email protected]>
- Loading branch information
Showing
3 changed files
with
158 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
/* | ||
* Device tree overlay for mcp2517fd/can0 on spi0.0 | ||
*/ | ||
|
||
/dts-v1/; | ||
/plugin/; | ||
|
||
/ { | ||
compatible = "brcm,bcm2835", "brcm,bcm2836", "brcm,bcm2708", "brcm,bcm2709"; | ||
/* disable spi-dev for spi0.0 */ | ||
fragment@0 { | ||
target = <&spi0>; | ||
__overlay__ { | ||
status = "okay"; | ||
}; | ||
}; | ||
|
||
fragment@1 { | ||
target = <&spidev0>; | ||
__overlay__ { | ||
status = "disabled"; | ||
}; | ||
}; | ||
|
||
/* the interrupt pin of the can-controller */ | ||
fragment@2 { | ||
target = <&gpio>; | ||
__overlay__ { | ||
can0_pins: can0_pins { | ||
brcm,pins = <25>; | ||
brcm,function = <0>; /* input */ | ||
}; | ||
}; | ||
}; | ||
|
||
/* the clock/oscillator of the can-controller */ | ||
fragment@3 { | ||
target-path = "/clocks"; | ||
__overlay__ { | ||
/* external oscillator of mcp2517fd on SPI0.0 */ | ||
can0_osc: can0_osc { | ||
compatible = "fixed-clock"; | ||
#clock-cells = <0>; | ||
clock-frequency = <40000000>; | ||
}; | ||
}; | ||
}; | ||
|
||
/* the spi config of the can-controller itself binding everything together */ | ||
fragment@4 { | ||
target = <&spi0>; | ||
__overlay__ { | ||
/* needed to avoid dtc warning */ | ||
#address-cells = <1>; | ||
#size-cells = <0>; | ||
can0: mcp2517fd@0 { | ||
reg = <0>; | ||
compatible = "microchip,mcp2517fd"; | ||
pinctrl-names = "default"; | ||
pinctrl-0 = <&can0_pins>; | ||
spi-max-frequency = <20000000>; | ||
interrupt-parent = <&gpio>; | ||
interrupts = <25 0x8>; | ||
clocks = <&can0_osc>; | ||
microchip,clock-out-div = <10>; | ||
}; | ||
}; | ||
}; | ||
|
||
__overrides__ { | ||
oscillator = <&can0_osc>,"clock-frequency:0"; | ||
spimaxfrequency = <&can0>,"spi-max-frequency:0"; | ||
interrupt = <&can0_pins>,"brcm,pins:0",<&can0>,"interrupts:0"; | ||
clockdiv = <&can0>,"microchip,clock-div?"; | ||
clockoutdiv = <&can0>,"microchip,clock-out-div:0"; | ||
opendrain = <&can0>, "gpio-open-drain?"; | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
/* | ||
* Device tree overlay for mcp2517fd/can1 on spi0.1 | ||
*/ | ||
|
||
/dts-v1/; | ||
/plugin/; | ||
|
||
/ { | ||
compatible = "brcm,bcm2835", "brcm,bcm2836", "brcm,bcm2708", "brcm,bcm2709"; | ||
/* disable spi-dev for spi0.1 */ | ||
fragment@0 { | ||
target = <&spi0>; | ||
__overlay__ { | ||
status = "okay"; | ||
}; | ||
}; | ||
|
||
fragment@1 { | ||
target = <&spidev1>; | ||
__overlay__ { | ||
status = "disabled"; | ||
}; | ||
}; | ||
|
||
/* the interrupt pin of the can-controller */ | ||
fragment@2 { | ||
target = <&gpio>; | ||
__overlay__ { | ||
can1_pins: can1_pins { | ||
brcm,pins = <26>; | ||
brcm,function = <0>; /* input */ | ||
}; | ||
}; | ||
}; | ||
|
||
/* the clock/oscillator of the can-controller */ | ||
fragment@3 { | ||
target-path = "/clocks"; | ||
__overlay__ { | ||
/* external oscillator of mcp2517fd on SPI0.0 */ | ||
can1_osc: can1_osc { | ||
compatible = "fixed-clock"; | ||
#clock-cells = <0>; | ||
clock-frequency = <40000000>; | ||
}; | ||
}; | ||
}; | ||
|
||
/* the spi config of the can-controller itself binding everything together */ | ||
fragment@4 { | ||
target = <&spi0>; | ||
__overlay__ { | ||
/* needed to avoid dtc warning */ | ||
#address-cells = <1>; | ||
#size-cells = <0>; | ||
can1: mcp2517fd@1 { | ||
reg = <1>; | ||
compatible = "microchip,mcp2517fd"; | ||
pinctrl-names = "default"; | ||
pinctrl-0 = <&can1_pins>; | ||
spi-max-frequency = <20000000>; | ||
interrupt-parent = <&gpio>; | ||
interrupts = <26 0x8>; | ||
clocks = <&can1_osc>; | ||
microchip,clock-out-div = <10>; | ||
}; | ||
}; | ||
}; | ||
|
||
__overrides__ { | ||
oscillator = <&can1_osc>,"clock-frequency:0"; | ||
spimaxfrequency = <&can1>,"spi-max-frequency:0"; | ||
interrupt = <&can1_pins>,"brcm,pins:0",<&can1>,"interrupts:0"; | ||
clockdiv = <&can1>,"microchip,clock-div?"; | ||
clockoutdiv = <&can1>,"microchip,clock-out-div:0"; | ||
opendrain = <&can1>, "gpio-open-drain?"; | ||
}; | ||
}; |