summaryrefslogtreecommitdiff
path: root/recipes-kernel/linux
diff options
context:
space:
mode:
authorAndrii Pientsov <andrii.pientsov@globallogic.com>2021-11-30 17:40:50 +0200
committerAndrii Pientsov <andrii.pientsov@globallogic.com>2021-11-30 17:40:50 +0200
commit5e0e2a5bdcca315e79e0dab0fbdcfaa2c94ac445 (patch)
tree22f11df2d3887d486ffb0ede1f9e2475630ee2f7 /recipes-kernel/linux
parent52a369e5e4819acddbc5b5261133a7ed9e7e0c7d (diff)
downloadmeta-multitech-atmel-5e0e2a5bdcca315e79e0dab0fbdcfaa2c94ac445.tar.gz
meta-multitech-atmel-5e0e2a5bdcca315e79e0dab0fbdcfaa2c94ac445.tar.bz2
meta-multitech-atmel-5e0e2a5bdcca315e79e0dab0fbdcfaa2c94ac445.zip
Update mtcdt.dts for MTCDT-0.2
Diffstat (limited to 'recipes-kernel/linux')
-rw-r--r--recipes-kernel/linux/linux-at91-5.4.81/mt-at91.h19
-rw-r--r--recipes-kernel/linux/linux-at91-5.4.81/mts-dts/mtcdt.dts160
-rw-r--r--recipes-kernel/linux/linux-at91_5.4.81.bb2
3 files changed, 136 insertions, 45 deletions
diff --git a/recipes-kernel/linux/linux-at91-5.4.81/mt-at91.h b/recipes-kernel/linux/linux-at91-5.4.81/mt-at91.h
new file mode 100644
index 0000000..36fba62
--- /dev/null
+++ b/recipes-kernel/linux/linux-at91-5.4.81/mt-at91.h
@@ -0,0 +1,19 @@
+#ifndef _DT_BINDINGS_GPIO_MT_AT91_H
+#define _DT_BINDINGS_GPIO_MT_AT91_H
+/*
+ * Device tree explicit phandles
+ * for overlays. First four are AT91.
+ * Kernel must know about this to
+ * build the device tree. Overlay
+ * recipe needs this to find the
+ * GPIO stanza phandle.
+ */
+
+#define GPIO0_PH 0xffff0000
+#define GPIO1_PH 0xffff0001
+#define GPIO2_PH 0xffff0002
+#define GPIO3_PH 0xffff0003
+#define GPIO4_PCA9557_PH 0xffff0004
+#define GPIO5_PCA9557_PH 0xffff0005
+
+#endif
diff --git a/recipes-kernel/linux/linux-at91-5.4.81/mts-dts/mtcdt.dts b/recipes-kernel/linux/linux-at91-5.4.81/mts-dts/mtcdt.dts
index 31b4fab..b7f05c4 100644
--- a/recipes-kernel/linux/linux-at91-5.4.81/mts-dts/mtcdt.dts
+++ b/recipes-kernel/linux/linux-at91-5.4.81/mts-dts/mtcdt.dts
@@ -15,6 +15,7 @@
#include <dt-bindings/interrupt-controller/irq.h>
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/clock/at91.h>
+#include <dt-bindings/gpio/mt-at91.h>
/ {
@@ -26,9 +27,9 @@
aliases {
serial0 = &dbgu;
- serial1 = &usart0;
- serial2 = &usart1;
- serial3 = &usart2;
+ serial2 = &usart1; // AP1 serial on MTCDT-0.2
+ serial4 = &usart3; // AP2 serial on MTCDT-0.2
+ serial5 = &uart0; // GNSS on MTCDT-0.2
gpio0 = &pioA;
gpio1 = &pioB;
gpio2 = &pioC;
@@ -371,6 +372,21 @@
atmel,pins =
<AT91_PIOC 29 AT91_PERIPH_C AT91_PINCTRL_NONE>; /* PC29 periph C */
};
+
+ pinctrl_usart1_rng: usart1_rng-0 {
+ atmel,pins =
+ <AT91_PIOA 27 AT91_PERIPH_GPIO AT91_PINCTRL_NONE>;
+ };
+
+ pinctrl_usart1_dcd: usart1_dcd-0 {
+ atmel,pins =
+ <AT91_PIOA 26 AT91_PERIPH_GPIO AT91_PINCTRL_NONE>;
+ };
+
+ pinctrl_usart1_dtr: usart1_dtr-0 {
+ atmel,pins =
+ <AT91_PIOA 25 AT91_PERIPH_GPIO AT91_PINCTRL_NONE>;
+ };
};
usart2 {
@@ -417,6 +433,21 @@
atmel,pins =
<AT91_PIOC 26 AT91_PERIPH_B AT91_PINCTRL_NONE>; /* PC26 periph B */
};
+
+ pinctrl_usart3_rng: usart3_rng-0 {
+ atmel,pins =
+ <AT91_PIOC 14 AT91_PERIPH_GPIO AT91_PINCTRL_NONE>;
+ };
+
+ pinctrl_usart3_dcd: usart3_dcd-0 {
+ atmel,pins =
+ <AT91_PIOC 13 AT91_PERIPH_GPIO AT91_PINCTRL_NONE>;
+ };
+
+ pinctrl_usart3_dtr: usart3_dtr-0 {
+ atmel,pins =
+ <AT91_PIOC 12 AT91_PERIPH_GPIO AT91_PINCTRL_NONE>;
+ };
};
uart0 {
@@ -454,25 +485,27 @@
};
mts-io {
- pinctrl_mts_io_out: mts_io-0 {
+ pinctrl_mts_io_out: mts_io-0 {
+ // gpio4 and gpio5 are reset in at91bootstrap. They should not be touched in Linux.
atmel,pins =
- <AT91_PIOD 14 AT91_PERIPH_GPIO AT91_PINCTRL_PULL_UP /* PD14 WiFi BT reset */
- AT91_PIOD 16 AT91_PERIPH_GPIO AT91_PINCTRL_PULL_UP /* PD16 Secure reset */
- AT91_PIOD 17 AT91_PERIPH_GPIO AT91_PINCTRL_PULL_UP /* PD17 MTQ reset */
- AT91_PIOD 18 AT91_PERIPH_GPIO AT91_PINCTRL_PULL_UP>; /* PD18 USB Hub reset */
- output-high;
- };
- pinctrl_mts_io_in: mts_io-1 {
+ <AT91_PIOD 14 AT91_PERIPH_GPIO (AT91_PINCTRL_OUTPUT|AT91_PINCTRL_OUTPUT_VAL(1)) /* PD14 WiFi BT reset */
+ AT91_PIOD 16 AT91_PERIPH_GPIO (AT91_PINCTRL_OUTPUT|AT91_PINCTRL_OUTPUT_VAL(1)) /* PD16 Secure reset or gpio4 reset */
+ AT91_PIOD 17 AT91_PERIPH_GPIO (AT91_PINCTRL_OUTPUT|AT91_PINCTRL_OUTPUT_VAL(1)) /* PD17 MTQ reset */
+ AT91_PIOD 18 AT91_PERIPH_GPIO (AT91_PINCTRL_OUTPUT|AT91_PINCTRL_OUTPUT_VAL(1))>; /* PD18 USB Hub reset */
+ output-high; // ignored by at91_pinctrl
+ };
+ pinctrl_mts_io_in: mts_io-1 {
atmel,pins =
<AT91_PIOD 19 AT91_PERIPH_GPIO AT91_PINCTRL_PULL_UP /* PD19 GNSS Int */
AT91_PIOD 20 AT91_PERIPH_GPIO AT91_PINCTRL_PULL_UP>; /* PD20 WiFi_BT_LPMode Input */
- };
- pinctrl_mts_io_gnss: mts_io-2 {
+ };
+ // GNSS kept in reset to prevent EXAR from hanging
+ pinctrl_mts_io_gnss: mts_io-2 {
atmel,pins =
- <AT91_PIOC 4 AT91_PERIPH_GPIO AT91_PINCTRL_PULL_UP /* PC16 ETH_NRST */
- AT91_PIOD 15 AT91_PERIPH_GPIO AT91_PINCTRL_PULL_UP>; /* PD15 N_GNSS_RESET */
- output-low;
- };
+ <AT91_PIOC 4 AT91_PERIPH_GPIO (AT91_PINCTRL_OUTPUT|AT91_PINCTRL_OUTPUT_VAL(0)) /* PC16 ETH_NRST */
+ AT91_PIOD 15 AT91_PERIPH_GPIO (AT91_PINCTRL_OUTPUT|AT91_PINCTRL_OUTPUT_VAL(0))>; /* PD15 N_GNSS_RESET */
+ output-low; // ignored by at91_pinctrl
+ };
};
mmc0 {
@@ -738,6 +771,8 @@
interrupt-controller;
#interrupt-cells = <2>;
clocks = <&pmc PMC_TYPE_PERIPHERAL 2>;
+ phandle = <GPIO0_PH>;
+ phandle,linux = <GPIO0_PH>;
};
pioB: gpio@fffff600 {
@@ -750,6 +785,8 @@
interrupt-controller;
#interrupt-cells = <2>;
clocks = <&pmc PMC_TYPE_PERIPHERAL 2>;
+ phandle = <GPIO1_PH>;
+ phandle,linux = <GPIO1_PH>;
};
pioC: gpio@fffff800 {
@@ -761,6 +798,8 @@
interrupt-controller;
#interrupt-cells = <2>;
clocks = <&pmc PMC_TYPE_PERIPHERAL 3>;
+ phandle = <GPIO2_PH>;
+ phandle,linux = <GPIO2_PH>;
};
pioD: gpio@fffffa00 {
@@ -773,6 +812,8 @@
interrupt-controller;
#interrupt-cells = <2>;
clocks = <&pmc PMC_TYPE_PERIPHERAL 3>;
+ phandle = <GPIO3_PH>;
+ phandle,linux = <GPIO3_PH>;
};
};
@@ -900,6 +941,11 @@
clocks = <&pmc PMC_TYPE_PERIPHERAL 6>;
clock-names = "usart";
status = "disabled";
+ atmel,use-dma-rx;
+ atmel,use-dma-tx;
+ rng-gpios = <&pioA 27 GPIO_ACTIVE_LOW>;
+ dcd-gpios = <&pioA 26 GPIO_ACTIVE_LOW>;
+ dtr-gpios = <&pioA 25 GPIO_ACTIVE_LOW>;
};
usart2: serial@f8024000 {
@@ -928,6 +974,11 @@
clocks = <&pmc PMC_TYPE_PERIPHERAL 8>;
clock-names = "usart";
status = "disabled";
+ atmel,use-dma-rx;
+ atmel,use-dma-tx;
+ rng-gpios = <&pioC 14 GPIO_ACTIVE_LOW>;
+ dcd-gpios = <&pioC 13 GPIO_ACTIVE_LOW>;
+ dtr-gpios = <&pioC 12 GPIO_ACTIVE_LOW>;
};
uart0: serial@f8040000 {
@@ -936,11 +987,14 @@
interrupts = <15 IRQ_TYPE_LEVEL_HIGH 5>;
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_uart0>;
+ dmas = <&dma0 1 AT91_DMA_CFG_PER_ID(11)>,
+ <&dma0 1 (AT91_DMA_CFG_PER_ID(12) | AT91_DMA_CFG_FIFOCFG_ASAP)>;
+ dma-names = "tx", "rx";
clocks = <&pmc PMC_TYPE_PERIPHERAL 15>;
clock-names = "usart";
atmel,use-dma-rx;
atmel,use-dma-tx;
- status = "okay";
+ status = "disabled";
};
uart1: serial@f8044000 {
@@ -1294,6 +1348,36 @@
/* tempsensor_alert line running to pin PC19 on processor
set up an interrupt for this? */
};
+
+ /* gpio0 through gpio3 are integrated into the SAM9G25 and defined
+ * in at91sam9x5.dtsi
+ * pioA == gpio0
+ * pioB == gpio1
+ * pioC == gpio2
+ * pioC == gpio3
+ * gpio4 and gpio5 for MTCDT-0.2 follow:
+ */
+ gpio4: pca9557@18 {
+ compatible = "nxp,pca9557";
+ reg = <0x18>;
+ gpio-controller;
+ #gpio-cells = <2>;
+ vcc-supply = <&dummy_reg>;
+ phandle = <GPIO4_PCA9557_PH>;
+ phandle,linux = <GPIO4_PCA9557_PH>;
+ // gpio-base = <128>;
+ };
+
+ gpio5: pca9557@19 {
+ compatible = "nxp,pca9557";
+ reg = <0x19>;
+ gpio-controller;
+ #gpio-cells = <2>;
+ vcc-supply = <&dummy_reg>;
+ phandle = <GPIO5_PCA9557_PH>;
+ phandle,linux = <GPIO5_PCA9557_PH>;
+ // gpio-base = <136>;
+ };
};
i2c-gpio-1 {
@@ -1344,38 +1428,17 @@
status = "okay";
compatible = "mts,mts-io";
pinctrl-names = "default";
- pinctrl-0 = <&pinctrl_mts_io_out>;
- pinctrl-1 = <&pinctrl_mts_io_in>;
- pinctrl-2 = <&pinctrl_mts_io_gnss>;
+ pinctrl-0 = <&pinctrl_mts_io_out>, <&pinctrl_mts_io_in>, <&pinctrl_mts_io_gnss>;
};
leds {
compatible = "gpio-leds";
+ status = "disabled";
- pa24 {
- label = "led-status";
- gpios = <&pioA 24 GPIO_ACTIVE_LOW>;
- linux,default-trigger = "default-on";
- };
-
- pa25 {
- label = "led-a";
- gpios = <&pioA 25 GPIO_ACTIVE_LOW>;
- };
-
- pa26 {
- label = "led-b";
- gpios = <&pioA 26 GPIO_ACTIVE_LOW>;
- };
-
- pa27 {
- label = "led-c";
- gpios = <&pioA 27 GPIO_ACTIVE_LOW>;
- };
-
- pa28 {
- label = "led-d";
- gpios = <&pioA 28 GPIO_ACTIVE_LOW>;
+ led-status {
+ label = "led-status"; // LED2
+ gpios = <&pioA 24 GPIO_ACTIVE_LOW>; // All
+ linux,default-trigger = "default-on";
};
};
@@ -1395,4 +1458,11 @@
pinctrl-0 = <&pinctrl_1wire_cm>;
status = "disabled";
};
+
+ /* pca953x driver wants a regulator
+ * This dummy regulator prevents warnings */
+ dummy_reg: regulator@0 {
+ compatible = "regulator-fixed";
+ regulator-name = "dummy-supply";
+ };
};
diff --git a/recipes-kernel/linux/linux-at91_5.4.81.bb b/recipes-kernel/linux/linux-at91_5.4.81.bb
index f742ed7..f57d418 100644
--- a/recipes-kernel/linux/linux-at91_5.4.81.bb
+++ b/recipes-kernel/linux/linux-at91_5.4.81.bb
@@ -45,6 +45,7 @@ COMMON_PATCHES = " \
file://linux-5.4-OF-DT-Overlay-configfs-interface.patch \
file://linux-5.4-revert-net-macb-Properly-handle-phylink-on-at91rm9200.patch \
file://linux-5.4-bring-back-PAE-bit-and-fix-NCFGR-values-applicable-f.patch \
+ file://mt-at91.h \
"
SRC_URI_append_mtcdt = "\
@@ -77,6 +78,7 @@ python __anonymous () {
copy_mts_dts_files () {
# Install MTS device tree files
cp -f ${THISDIR}/linux-at91-5.4.81/mts-dts/${MACHINE}.dts ${S}/arch/${ARCH}/boot/dts/
+ cp -f ${THISDIR}/linux-at91-5.4.81/mt-at91.h ${S}/include/dt-bindings/gpio
}
python do_unpack_append () {