From ac4b9f2c1f9151b0a08a9723015f0e753f379c47 Mon Sep 17 00:00:00 2001
From: guowenxue <guowenxue@gmail.com>
Date: Tue, 16 Jul 2024 21:03:07 +0800
Subject: [PATCH] Patch:IGKBoard-IMX8MP: Add RS485/CAN support

---
 kernel/patches/igkboard-imx8mp/linux-imx-lf-6.1.36-2.1.0.patch |   60 +++++++++++++++++++++++++++++++++++++++++++++++++++---------
 1 files changed, 51 insertions(+), 9 deletions(-)

diff --git a/kernel/patches/igkboard-imx8mp/linux-imx-lf-6.1.36-2.1.0.patch b/kernel/patches/igkboard-imx8mp/linux-imx-lf-6.1.36-2.1.0.patch
index aa84b67..35b1422 100644
--- a/kernel/patches/igkboard-imx8mp/linux-imx-lf-6.1.36-2.1.0.patch
+++ b/kernel/patches/igkboard-imx8mp/linux-imx-lf-6.1.36-2.1.0.patch
@@ -10,10 +10,10 @@
 +dtb-$(CONFIG_ARCH_MXC) += igkboard-imx8mp.dtb
 diff --git a/arch/arm64/boot/dts/freescale/igkboard-imx8mp.dts b/arch/arm64/boot/dts/freescale/igkboard-imx8mp.dts
 new file mode 100644
-index 000000000..7f3e9a74a
+index 000000000..fa0ecba89
 --- /dev/null
 +++ b/arch/arm64/boot/dts/freescale/igkboard-imx8mp.dts
-@@ -0,0 +1,613 @@
+@@ -0,0 +1,657 @@
 +// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
 +/* 
 + * Device Tree Source for LingYun IGKBoard(IoT Gateway Kits Board) - imx8mp
@@ -267,6 +267,29 @@
 +};
 +
 +/*+------------------------+
++  |  CAN/RS485 interface   |
++  +------------------------+*/
++/* RS485 */
++&uart3 {
++    pinctrl-names = "default";
++    pinctrl-0 = <&pinctrl_uart3>;
++    status = "okay";
++};
++
++/* CAN */
++&flexcan1 {
++    pinctrl-names = "default";
++    pinctrl-0 = <&pinctrl_flexcan1>;
++    status = "okay";
++};
++
++&flexcan2 {
++    pinctrl-names = "default";
++    pinctrl-0 = <&pinctrl_flexcan2>;
++    status = "okay";
++};
++
++/*+------------------------+
 +  |   MikroBUS interface   |
 +  +------------------------+*/
 +
@@ -470,6 +493,27 @@
 +        >;
 +    };
 +
++    pinctrl_uart3: uart3grp {
++        fsl,pins = <
++            MX8MP_IOMUXC_ECSPI1_SCLK__UART3_DCE_RX                      0x82
++            MX8MP_IOMUXC_ECSPI1_MOSI__UART3_DCE_TX                      0x82
++        >;
++    };
++
++    pinctrl_flexcan1: flexcan1grp {
++        fsl,pins = <
++            MX8MP_IOMUXC_SPDIF_TX__CAN1_TX                              0x154
++            MX8MP_IOMUXC_SPDIF_RX__CAN1_RX                              0x154
++        >;
++    };
++
++    pinctrl_flexcan2: flexcan2grp {
++        fsl,pins = <
++            MX8MP_IOMUXC_SAI5_MCLK__CAN2_RX                             0x154
++            MX8MP_IOMUXC_SAI5_RXD3__CAN2_TX                             0x154
++        >;
++    };
++
 +    pinctrl_ecspi2: ecspi2grp {
 +        fsl,pins = <
 +            MX8MP_IOMUXC_ECSPI2_SCLK__ECSPI2_SCLK                       0x82
@@ -629,10 +673,10 @@
 +};
 diff --git a/arch/arm64/configs/igkboard-imx8mp_defconfig b/arch/arm64/configs/igkboard-imx8mp_defconfig
 new file mode 100644
-index 000000000..d6d6206f2
+index 000000000..c0bf7a7f4
 --- /dev/null
 +++ b/arch/arm64/configs/igkboard-imx8mp_defconfig
-@@ -0,0 +1,1129 @@
+@@ -0,0 +1,1127 @@
 +CONFIG_SYSVIPC=y
 +CONFIG_POSIX_MQUEUE=y
 +CONFIG_AUDIT=y
@@ -796,7 +840,8 @@
 +CONFIG_QRTR_SMD=m
 +CONFIG_QRTR_TUN=m
 +CONFIG_NET_PKTGEN=m
-+CONFIG_CAN=m
++CONFIG_CAN=y
++CONFIG_CAN_ISOTP=y
 +CONFIG_BT=y
 +CONFIG_BT_RFCOMM=y
 +CONFIG_BT_RFCOMM_TTY=y
@@ -821,8 +866,6 @@
 +CONFIG_CFG80211_WEXT=y
 +CONFIG_MAC80211=y
 +CONFIG_MAC80211_LEDS=y
-+CONFIG_NET_9P=y
-+CONFIG_NET_9P_VIRTIO=y
 +CONFIG_NFC=m
 +CONFIG_NFC_NCI=m
 +CONFIG_NFC_S3FWRN5_I2C=m
@@ -980,7 +1023,7 @@
 +CONFIG_REALTEK_PHY=y
 +CONFIG_ROCKCHIP_PHY=y
 +CONFIG_VITESSE_PHY=y
-+CONFIG_CAN_FLEXCAN=m
++CONFIG_CAN_FLEXCAN=y
 +CONFIG_MDIO_BITBANG=y
 +CONFIG_MDIO_BUS_MUX_MULTIPLEXER=y
 +CONFIG_MDIO_BUS_MUX_MMIOREG=y
@@ -1669,7 +1712,6 @@
 +CONFIG_NFS_V4_1=y
 +CONFIG_NFS_V4_2=y
 +CONFIG_ROOT_NFS=y
-+CONFIG_9P_FS=y
 +CONFIG_NLS_CODEPAGE_437=y
 +CONFIG_NLS_CODEPAGE_936=y
 +CONFIG_NLS_CODEPAGE_950=y

--
Gitblit v1.9.1