TX2 4GB porting mcp2515 on R28.3

Hi,

I’m porting mcp2515 to R28.3 with TX2 4GB config package
(http://developer.nvidia.com/embedded/dlc/jetson-tx2-as-tx2-4gb-configuration-package).
The following patch is working on TX2 8GB config, but not working on TX2 4GB config.

diff --git a/sources/hardware/nvidia/platform/t18x/quill/kernel-dts/tegra186-quill-p3310-1000-as-0888-base.dts b/sources/hardware/nvidia/platform/t18x/quill/kernel-dts/tegra186-quill-p3310-1000-as-0888-base.dts
index 34aa86b..16cde3b 100644
--- a/sources/hardware/nvidia/platform/t18x/quill/kernel-dts/tegra186-quill-p3310-1000-as-0888-base.dts
+++ b/sources/hardware/nvidia/platform/t18x/quill/kernel-dts/tegra186-quill-p3310-1000-as-0888-base.dts
@@ -62,7 +62,23 @@

+
+	clocks {
+		/* 16MHz external crystal oscillator */
+		canclk: mcp251x_osc {
+			#clock-cells = <0>;
+			compatible = "fixed-clock";
+//			clock-frequency = <16000000>;
+			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>;
+			interrupt-parent = <&tegra_main_gpio>;
+			interrupts = <TEGRA_MAIN_GPIO(I, 4) 0x01>;
+			clocks = <&canclk>;
+		};
+	};
+////
 	memory@80000000 {
 		device_type = "memory";
 		reg = <0x0 0x80000000 0x0 0x70000000>;
diff --git a/sources/kernel/kernel-4.4/arch/arm64/configs/B400TX2_defconfig b/sources/kernel/kernel-4.4/arch/arm64/configs/B400TX2_defconfig
index 1ca8e68..27f5699 100644
--- a/sources/kernel/kernel-4.4/arch/arm64/configs/tegra18_defconfig
+++ b/sources/kernel/kernel-4.4/arch/arm64/configs/tegra18_defconfig
@@ -202,7 +202,11 @@ CONFIG_NET_ACT_POLICE=y
 CONFIG_NET_ACT_GACT=y
 CONFIG_NET_ACT_MIRRED=y
 CONFIG_CGROUP_NET_PRIO=y
-CONFIG_CAN=m
+# modified by Yen for enable can bus 
+#CONFIG_CAN=m
+CONFIG_CAN=y
+CONFIG_CAN_DEV=y
+####
 CONFIG_CAN_VCAN=m
 CONFIG_CAN_SLCAN=m
 CONFIG_CAN_GRCAN=m
@@ -218,7 +222,10 @@ CONFIG_CAN_M_CAN=m
 CONFIG_CAN_CC770=m
 CONFIG_CAN_CC770_ISA=m
 CONFIG_CAN_CC770_PLATFORM=m
-CONFIG_CAN_MCP251X=m
+# modified by Yen for enable mcp2515
+#CONFIG_CAN_MCP251X=m
+CONFIG_CAN_MCP251X=y
+####
 CONFIG_CAN_EMS_USB=m
 CONFIG_CAN_ESD_USB2=m
 CONFIG_CAN_GS_USB=m
@@ -226,7 +233,10 @@ CONFIG_CAN_KVASER_USB=m
 CONFIG_CAN_PEAK_USB=m
 CONFIG_CAN_8DEV_USB=m
 CONFIG_CAN_SOFTING=m
-CONFIG_MTTCAN=m
+# modified by Yen for enable can bus
+#CONFIG_MTTCAN=m
+CONFIG_MTTCAN=y
+####
 CONFIG_IRDA=m
 CONFIG_BT=y
 CONFIG_BT_RFCOMM=y

There is no error message about mcp2515 in dmesg.
When system boot up, I can see can0/can1(TX2 native) and can2(mcp2515) in “ifconfig -a”.

Test steps:
In first terminal
sudo ip link set can1 type can bitrate 500000 sudo ip link set up can1
$ candump can1

In second terminal
sudo ip link set can2 type can bitrate 500000 sudo ip link set up can2
$ cansend can2 1F334455#1122334455667788

After flashing R28.3 TX2 8GB config, I can see some messages in the first terminal.
But I can’t see anything by using R28.3 TX2 4GB config and the ifconfig is different between can1 and can2.

nvidia@jetson-0321917026260:~$ ifconfig
can1      Link encap:UNSPEC  HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
          UP <b><u>RUNNING</u> </b>NOARP  MTU:16  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:10
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
          Interrupt:177

can2      Link encap:UNSPEC  HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
          UP NOARP  MTU:16  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:10
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

Does anyone know how to let it work by using TX2 4GB config on R28.3?

Thx
Yen

Hi,

I found the problem.
After setting ATA6561 stby pin to low as default, mcp2515 works well.
Maybe it is our hardware design issue.

Thx
Yen