Enabling MCP251X (SPI CAN) in r28.1

I’m trying to get my MCP2515 board working with the r28.1 kernel so I can update my guide (Guide to Enabling MCP251x (MCP2515) on the TX1 (SPI CAN) - Jetson TX1 - NVIDIA Developer Forums).

The old method (board file) is no longer valid, everything seems to work with the device tree now.

Here’s what I have so far for J23 SPI0 (bus number 3).

clocks {
	/* 16MHz external crystal oscillator */
	daxc03_clock: mcp251x_osc {
		#clock-cells = <0>;
		compatible = "fixed-clock";
		clock-frequency = <16000000>;
	};
}

/* J23 Expansion Connector SPI0 */
spi@7000da00 {
	status = "okay";
	spi-max-frequency = <2000000>;

	can@0 {
		#address-cells = <0x1>;
		#size-cells = <0x0>;
		compatible = "microchip,mcp2515";
		reg = <0x0>;

		clocks = <&daxc03_clock>;
		interrupt-parent = <&gpio>;
		interrupts = <TEGRA_GPIO(V, 6) IRQ_TYPE_EDGE_FALLING>;
		spi-max-frequency = <2000000>;

		vdd-supply = <&max77620_ldo5>;
		xceiver-supply = <&max77620_ldo5>;
	};
}

The MCP2515 probes and SPI is working properly, however interrupts aren’t being caught. Is there anything else I need to do to configure that pin as an interrupt?

cat /sys/kernel/debug/gpio doesn’t list those two gpio (170 and 174) which makes me think that they aren’t configured.

Had to set the pinmux, works now!

pinmux@700008d4 {
	common {
		lcd_rst_pv2 {
			nvidia,pins = "lcd_rst_pv2";
			nvidia,pull = <0x2>;
			nvidia,tristate = <0x0>;
			nvidia,enable-input = <TEGRA_PIN_ENABLE>;
		};

		touch_rst_pv6 {
			nvidia,pins = "touch_rst_pv6";
			nvidia,pull = <0x2>;
			nvidia,tristate = <0x0>;
			nvidia,enable-input = <TEGRA_PIN_ENABLE>;
		};
	};
};

Hi,

Did you try porting this to work on TX2?

Best regards,
Ltro