Skip to content

Instantly share code, notes, and snippets.

@wilkinsw
Last active March 12, 2018 20:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wilkinsw/14596abb75073acae392f7d9c29a7e8f to your computer and use it in GitHub Desktop.
Save wilkinsw/14596abb75073acae392f7d9c29a7e8f to your computer and use it in GitHub Desktop.
Enabling MCP251x SPI CAN Controller Driver in Jetson TX1 (J23 SPI0)
/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/*
* Valid for Linux4Tegra v28.1
*
* J21 Header SPI1 == bus_num 0
* Expansion SPI0 == bus_num 3
* Expansion SPI2 == bus_num 1
*/
/ {
clocks {
/* 16MHz external crystal oscillator */
clk16m: mcp251x_osc {
#clock-cells = <0>;
compatible = "fixed-clock";
clock-frequency = <16000000>;
};
};
pinmux@700008d4 {
common {
touch_rst_pv6 {
nvidia,pins = "touch_rst_pv6";
nvidia,pull = <0x2>;
nvidia,tristate = <0x0>;
nvidia,enable-input = <TEGRA_PIN_ENABLE>;
};
};
};
/* J23 Expansion Connector SPI0 */
/* Note the difference in numbering between the connector and device */
spi@7000da00 {
status = "okay";
spi-max-frequency = <2000000>;
can@0 {
#address-cells = <0x1>;
#size-cells = <0x0>;
compatible = "microchip,mcp2515";
reg = <0x0>;
clocks = <&clk16m>;
interrupt-parent = <&gpio>;
interrupts = <TEGRA_GPIO(V, 6) IRQ_TYPE_EDGE_FALLING>;
spi-max-frequency = <2000000>;
vdd-supply = <&max77620_ldo5>;
xceiver-supply = <&max77620_ldo5>;
};
};
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment