I was not be able to configure a MCP251x (SPI-CAN interface and Voltage Buffer) driver properly to have the can0 as a device. I did some modifications to the kernel in arch/arm/mach-tegra/board-ardbeg.c I took the https://devtalk.nvidia.com/default/topic/883673 as a base but the interruption pin was difficult to find, i was set the INT_MOTION pin from the J21 connector that is TEGRA_GPIO_PX2 but after replace the kernel the can0 device seems not to be present.
I also try do a modifications to the device tree but i have no success, seems that this way does not work in the TK1 too. https://turlucode.com/nvidia-jetson-tk1-spi-to-can-interface-mcp251x-mcp25625/ the kernel modifications are pretty much the same as the post.
Acording to the http://www.jetsonhacks.com/nvidia-jetson-tx1-j21-header-pinout/ information of this post i tokc the GPIO186 with seems to be the TEGRA_GPIO_PX2 accordig to the arch/arm/mach-tegra/gpio-names.h file, but iḿ not sure about this mapping.
On branch tegra-l4t-r24.2 i do almost the same modifications but change the interruption
diff --git a/arch/arm/mach-tegra/board-ardbeg.c b/arch/arm/mach-tegra/board-ardbeg.c
index 2f75e7c..de0e552 100644
--- a/arch/arm/mach-tegra/board-ardbeg.c
+++ b/arch/arm/mach-tegra/board-ardbeg.c
@@ -1007,6 +1007,35 @@ static struct spi_board_info rm31080a_e2141_spi_board[1] = {
},
};
+#define CAN_GPIO_IRQ_MCP251x_SPI TEGRA_GPIO_PX2
+
+static struct mcp251x_platform_data mcp251x_info = {
+ .oscillator_frequency = 8 * 1000 * 1000, /* CAN SPI click 5V has a 8MHz crystal */
+ .irq_flags = IRQF_TRIGGER_FALLING|IRQF_ONESHOT, /* This is also defined in the mcp251x driver: can be ommited */
+ .board_specific_setup = NULL, /* We don't have a board specific setup */
+ .power_enable = NULL, /* We don't want any power enable function */
+ .transceiver_enable = NULL, /* We don't want any transceiver enable function */
+};
+
+struct spi_board_info mcp251x_spi_board[1] = {
+ {
+ .modalias = "mcp2515", /* (or mcp2510) used chip controller */
+ .platform_data = &mcp251x_info, /* reference to the mcp251x_platform_data mcp251x_info */
+ .max_speed_hz = 8 * 1000 * 1000, /* max speed of the used chip */
+ .chip_select = 0, /* the spi cs usage*/
+ .bus_num = 0,
+ .mode = SPI_MODE_0,
+ },
+};
+
+static int __init mcp251x_init(void)
+{
+ mcp251x_spi_board[0].irq = gpio_to_irq(CAN_GPIO_IRQ_MCP251x_SPI); // #define CAN_GPIO_IRQ_MCP251x_SPI TEGRA_GPIO_PK2
+ spi_register_board_info(mcp251x_spi_board, ARRAY_SIZE(mcp251x_spi_board));
+ pr_info("mcp251x_init\n");
+ return 0;
+}
+
static int __init ardbeg_touch_init(void)
{
tegra_get_board_info(&board_info);
@@ -1254,6 +1283,10 @@ static void __init tegra_ardbeg_late_init(void)
isomgr_init();
+#ifdef MCP251x
+ mcp251x_init();
+#endif
+
if (!of_machine_is_compatible("nvidia,green-arrow" ))
ardbeg_touch_init();
And patch this compilation issues too.
diff --git a/arch/arm64/kernel/vdso32/Makefile b/arch/arm64/kernel/vdso32/Makefile
index 0c2bc73..0ef7c9a 100644
--- a/arch/arm64/kernel/vdso32/Makefile
+++ b/arch/arm64/kernel/vdso32/Makefile
@@ -11,7 +11,7 @@ obj-vdso32 := $(addprefix $(obj)/, $(obj-vdso32))
GCOV_PROFILE := n
-ccflags-y := -shared -fPIC -fno-common -fno-builtin -march=armv7-a
+ccflags-y := -shared -fPIC -fomit-frame-pointer -fno-common -fno-builtin -march=armv7-a
ccflags-y += -nostdlib -Wl,-soname=linux-vdso32.so.1 \
$(call cc-ldoption, -Wl$(comma)--hash-style=sysv)
asflags-y := -D__VDSO32__ -s
diff --git a/drivers/platform/tegra/tegra21_clocks.c b/drivers/platform/tegra/tegra21_clocks.c
index f539d42..f31cdc6 100644
--- a/drivers/platform/tegra/tegra21_clocks.c
+++ b/drivers/platform/tegra/tegra21_clocks.c
@@ -1061,7 +1061,7 @@ static struct clk_ops tegra_super_ops = {
*/
static void tegra21_cpu_clk_init(struct clk *c)
{
- c->state = (!is_lp_cluster() == (c->u.cpu.mode == MODE_G)) ? ON : OFF;
+ c->state = ((!is_lp_cluster()) == (c->u.cpu.mode == MODE_G)) ? ON : OFF;
}