Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add rk3308-spi1-mcp2515-8mhz #393

Merged
merged 2 commits into from
Feb 6, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions arch/arm64/boot/dts/rockchip/overlays/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ dtb-$(CONFIG_CLK_RK3308) += \
rk3308-spi0-spidev.dtbo \
rk3308-spi1-m1-spidev.dtbo \
rk3308-spi1-spidev.dtbo \
rk3308-spi2-mcp2515-8mhz.dtbo \
rk3308-spi2-spidev.dtbo \
rk3308-uart0.dtbo \
rk3308-uart1-full.dtbo \
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
/dts-v1/;
/plugin/;

#include <dt-bindings/pinctrl/rockchip.h>
#include <dt-bindings/interrupt-controller/irq.h>

/ {
metadata {
title = "Enable MCP2515 with 8MHz external clock on SPI2";
compatible = "radxa,rock-s0";
category = "misc";
exclusive = "GPIO1_C6", "GPIO1_C7", "GPIO1_D0", "GPIO1_D1", "GPIO2_B3", "spi2", "uart1", "uart2";
description = "Provide support for Microchip MCP2515 SPI CAN controller.
Assumes 8MHz external clock.
Uses Pin 22 (GPIO2_B3) for INT.";
};
};

&pinctrl {
mcp2515_int_pins {
mcp2515_int_pins: mcp2515_int_pin {
rockchip,pins = <2 RK_PB3 RK_FUNC_GPIO &pcfg_pull_none>;
};
};
};

&{/} {
can_mcp2515_osc: can-mcp2515-osc {
compatible = "fixed-clock";
clock-frequency = <8000000>;
#clock-cells = <0>;
};
};

&spi2 {
status = "okay";
pinctrl-names = "default";
pinctrl-0 = <&spi2_clk &spi2_csn0 &spi2_miso &spi2_mosi>;
#address-cells = <1>;
#size-cells = <0>;
max-freq = <10000000>;

can_mcp2515: can-mcp2515@0 {
status = "okay";
compatible = "microchip,mcp2515";
reg = <0>;
interrupt-parent = <&gpio2>;
interrupts = <RK_PB3 IRQ_TYPE_EDGE_FALLING>;
spi-max-frequency = <10000000>;
clocks = <&can_mcp2515_osc>;
vdd-supply = <&vcc_io>;
xceiver-supply = <&vcc_io>;
pinctrl-names = "default";
pinctrl-0 = <&mcp2515_int_pins>;
};
};

&uart1 {
status = "disabled";
};

&uart2 {
status = "disabled";
};
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Uses Pin 22 (GPIO4_D5) for INT.";
&{/} {
can_mcp2515_osc: can-mcp2515-osc {
compatible = "fixed-clock";
clock-frequency = <12000000>;
clock-frequency = <8000000>;
#clock-cells = <0>;
};
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ INT=15";
&{/} {
can_mcp2515_osc: can-mcp2515-osc {
compatible = "fixed-clock";
clock-frequency = <12000000>;
clock-frequency = <8000000>;
#clock-cells = <0>;
};
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ INT=26";
&{/} {
can_mcp2515_osc: can-mcp2515-osc {
compatible = "fixed-clock";
clock-frequency = <12000000>;
clock-frequency = <8000000>;
#clock-cells = <0>;
};
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ INT=26";
&{/} {
can_mcp2515_osc: can-mcp2515-osc {
compatible = "fixed-clock";
clock-frequency = <12000000>;
clock-frequency = <8000000>;
#clock-cells = <0>;
};
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ INT=22";
&{/} {
can_mcp2515_osc: can-mcp2515-osc {
compatible = "fixed-clock";
clock-frequency = <12000000>;
clock-frequency = <8000000>;
#clock-cells = <0>;
};
};
Expand Down