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.
dt: overlay: added overlay for several variants of mcp25xxfd
This includes overlays for individual can devices but also support for the quadcan-fd hat Signed-off-by: Martin Sperl <[email protected]>
- Loading branch information
Showing
7 changed files
with
490 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
79 changes: 79 additions & 0 deletions
79
arch/arm/boot/dts/overlays/mcp2517fd-spi0.0-can0-overlay.dts
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,79 @@ | ||
/* | ||
* Device tree overlay for mcp2517fd/can0 on spi0.0 | ||
*/ | ||
|
||
/dts-v1/; | ||
/plugin/; | ||
|
||
/ { | ||
compatible = "brcm,bcm2835", "brcm,bcm2836", "brcm,bcm2837", "brcm,bcm2708", "brcm,bcm2709", "brcm,bcm2710"; | ||
/* 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>, "microchip,gpio-open-drain?"; | ||
xstandby = <&can0>, "microchip,gpio0-xstandby?"; | ||
}; | ||
}; |
79 changes: 79 additions & 0 deletions
79
arch/arm/boot/dts/overlays/mcp2517fd-spi0.1-can1-overlay.dts
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,79 @@ | ||
/* | ||
* Device tree overlay for mcp2517fd/can1 on spi0.1 | ||
*/ | ||
|
||
/dts-v1/; | ||
/plugin/; | ||
|
||
/ { | ||
compatible = "brcm,bcm2835", "brcm,bcm2836", "brcm,bcm2837", "brcm,bcm2708", "brcm,bcm2709", "brcm,bcm2710"; | ||
/* 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>, "microchip,gpio-open-drain?"; | ||
xstandby = <&can1>, "microchip,gpio0-xstandby?"; | ||
}; | ||
}; |
79 changes: 79 additions & 0 deletions
79
arch/arm/boot/dts/overlays/mcp2517fd-spi1.0-can2-overlay.dts
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,79 @@ | ||
/* | ||
* Device tree overlay for mcp2517fd/can2 on spi0.0 | ||
*/ | ||
|
||
/dts-v1/; | ||
/plugin/; | ||
|
||
/ { | ||
compatible = "brcm,bcm2835", "brcm,bcm2836", "brcm,bcm2837", "brcm,bcm2708", "brcm,bcm2709", "brcm,bcm2710"; | ||
/* 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__ { | ||
can2_pins: can2_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 */ | ||
can2_osc: can2_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>; | ||
can2: mcp2517fd@0 { | ||
reg = <0>; | ||
compatible = "microchip,mcp2517fd"; | ||
pinctrl-names = "default"; | ||
pinctrl-0 = <&can2_pins>; | ||
spi-max-frequency = <20000000>; | ||
interrupt-parent = <&gpio>; | ||
interrupts = <25 0x8>; | ||
clocks = <&can2_osc>; | ||
microchip,clock-out-div = <10>; | ||
}; | ||
}; | ||
}; | ||
|
||
__overrides__ { | ||
oscillator = <&can2_osc>,"clock-frequency:0"; | ||
spimaxfrequency = <&can2>,"spi-max-frequency:0"; | ||
interrupt = <&can2_pins>,"brcm,pins:0",<&can2>,"interrupts:0"; | ||
clockdiv = <&can2>,"microchip,clock-div?"; | ||
clockoutdiv = <&can2>,"microchip,clock-out-div:0"; | ||
opendrain = <&can2>, "microchip,gpio-open-drain?"; | ||
xstandby = <&can2>, "microchip,gpio0-xstandby?"; | ||
}; | ||
}; |
79 changes: 79 additions & 0 deletions
79
arch/arm/boot/dts/overlays/mcp2517fd-spi1.1-can3-overlay.dts
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,79 @@ | ||
/* | ||
* Device tree overlay for mcp2517fd/can3 on spi0.0 | ||
*/ | ||
|
||
/dts-v1/; | ||
/plugin/; | ||
|
||
/ { | ||
compatible = "brcm,bcm2835", "brcm,bcm2836", "brcm,bcm2837", "brcm,bcm2708", "brcm,bcm2709", "brcm,bcm2710"; | ||
/* 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__ { | ||
can3_pins: can3_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 */ | ||
can3_osc: can3_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>; | ||
can3: mcp2517fd@0 { | ||
reg = <0>; | ||
compatible = "microchip,mcp2517fd"; | ||
pinctrl-names = "default"; | ||
pinctrl-0 = <&can3_pins>; | ||
spi-max-frequency = <20000000>; | ||
interrupt-parent = <&gpio>; | ||
interrupts = <25 0x8>; | ||
clocks = <&can3_osc>; | ||
microchip,clock-out-div = <10>; | ||
}; | ||
}; | ||
}; | ||
|
||
__overrides__ { | ||
oscillator = <&can3_osc>,"clock-frequency:0"; | ||
spimaxfrequency = <&can3>,"spi-max-frequency:0"; | ||
interrupt = <&can3_pins>,"brcm,pins:0",<&can3>,"interrupts:0"; | ||
clockdiv = <&can3>,"microchip,clock-div?"; | ||
clockoutdiv = <&can3>,"microchip,clock-out-div:0"; | ||
opendrain = <&can3>, "microchip,gpio-open-drain?"; | ||
xstandby = <&can3>, "microchip,gpio0-xstandby?"; | ||
}; | ||
}; |
Oops, something went wrong.