Hi,
I’m trying to port mcp2515 on our TX2 custom board through SPI0.
Here is the code I added.
diff --git a/sources/hardware/nvidia/platform/t18x/common/kernel-dts/t18x-common-platforms/tegra186-cvb-prod-p2597-b00-p3310-1000-a00-00.dtsi b/sources/hardware/nvidia/platform/t18x/common/kernel-dts/t18x-common-platforms/tegra186-cvb-prod-p2597-b00-p3310-1000-a00-00.dtsi
index 972d701..8f34195 100644
--- a/sources/hardware/nvidia/platform/t18x/common/kernel-dts/t18x-common-platforms/tegra186-cvb-prod-p2597-b00-p3310-1000-a00-00.dtsi
+++ b/sources/hardware/nvidia/platform/t18x/common/kernel-dts/t18x-common-platforms/tegra186-cvb-prod-p2597-b00-p3310-1000-a00-00.dtsi
@@ -19,6 +19,20 @@
/ {
+ spi@c260000 {
+ can2: can@0 {
+ compatible = "microchip,mcp2515";
+ reg = <1>;
+ spi-max-frequency = <10000000>;
+ };
+ };
i2c@3160000 {
ina3221x@42 {
compatible = "ti,ina3221x";
I also enable CONFIG_CAN_MCP251X=y
But I got an error message “mcp251x: probe of spi1.1 failed with error -2”
Does anyone know how to port mcp2515?
Thx
Yen
Hi,
I saw someone said that mcp2515 driver only supports TX1(Auvidea J120 · Issue #38 · NVIDIA-AI-IOT/redtail · GitHub )
Is it true?
Thx
Yen
hello yenchao,
please check [Tegra X2 (Parker Series SoC) Technical Reference Manual] from Jetson Download Center
you could also refer to Topic 1037624 for more details.
thanks
Ltro
August 3, 2018, 3:15pm
5
Hi,
I can confirm mcp251x driver is working on TX2. Please be aware that SPI0 on dev board actually is SPI4 in software. See pinmux xls for details
Hi,
I’m still working on TX2 mcp2515.
Please see the code I added as below.
+ clocks {
+ /* 16MHz external crystal oscillator */
+ canclk: mcp251x_osc {
+ #clock-cells = <0>;
+ compatible = "fixed-clock";
+ clock-frequency = <20000000>;
+ };
+ };
+
+ spi@c260000 {
+ status = "okay";
+ spi-max-frequency = <2000000>;
+ spi-touch-sharp19x12@0 {
+ status = "disabled";
+ };
+
+ can2: can@0 {
+ status = "okay";
+ compatible = "microchip,mcp2515";
+ spi-max-frequency = <2000000>;
+ reg = <0>;
+ interrupt-parent = <&tegra_aon_gpio>;
+ interrupts = <TEGRA_AON_GPIO(AA, 2) 0x01>;
+ clocks = <&canclk>;
+ };
+ };
+////
Current situation is mcp2515 could send CAN MESSAGE, but only send one time.
I need to run “sudo ip link set down can2” and “sudo ip link set up can2” to send another CAN MESSAGE.
After sending CAN MESSAGE, I found some registers had changed.
CANSTAT:from 0 to 6
CANINTF:from 0 to 4
I also had tried to set CANSTAT and CANINTF to 0 after sending CAN MESSAGE, but it didn’t work.
Any advice and suggestions would be greatly appreciated.
Thx
Yen