From 1eb228fc4091c54af34547270f8e4aac806092c4 Mon Sep 17 00:00:00 2001 From: John Klug Date: Mon, 1 Nov 2021 08:05:40 -0500 Subject: Resets for new GPIO controllers --- .../0005-at91bootstrap-3.8-mtcdt.patch | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/recipes-bsp/at91bootstrap/at91bootstrap-3.8.12/0005-at91bootstrap-3.8-mtcdt.patch b/recipes-bsp/at91bootstrap/at91bootstrap-3.8.12/0005-at91bootstrap-3.8-mtcdt.patch index 14f01eb..117f4be 100644 --- a/recipes-bsp/at91bootstrap/at91bootstrap-3.8.12/0005-at91bootstrap-3.8-mtcdt.patch +++ b/recipes-bsp/at91bootstrap/at91bootstrap-3.8.12/0005-at91bootstrap-3.8-mtcdt.patch @@ -1,7 +1,7 @@ diff -Naru orig/board/at91sam9x5ek/at91sam9x5ek.c new/board/at91sam9x5ek/at91sam9x5ek.c --- orig/board/at91sam9x5ek/at91sam9x5ek.c 2020-09-10 16:30:43.653327254 -0500 +++ new/board/at91sam9x5ek/at91sam9x5ek.c 2020-09-10 16:16:38.597352272 -0500 -@@ -56,6 +56,37 @@ +@@ -56,6 +56,47 @@ writel(0xFF, RTC_SCCR + AT91C_BASE_RTC); } @@ -22,13 +22,23 @@ diff -Naru orig/board/at91sam9x5ek/at91sam9x5ek.c new/board/at91sam9x5ek/at91sam + * from loading. Once the VID/PID is bad, a + * reboot will preserve the bad VID/PID, so + * a power cycle is then required. ++ * PD16 and PD15 are the GPIO expander reset pins ++ * for MTCDT 0.2, and Secure Element Reset and ++ * AP2_TBD3 in MTCDT 0.1 and 0.0. No one should be using ++ * AP2_TBD3 in prior designs, and Secure Element ++ * was never used/populated. ++ * For the PCA9557, tw(rst) is listed as 6nS on page ++ * 16 of Product Data Sheet Revision 7, 10 December 2013. + */ ++ {"N_GPIO_EXP1_RESET",AT91C_PIN_PD(16), 0, PIO_DEFAULT, PIO_OUTPUT}, ++ {"N_GPIO_EXP2_RESET",AT91C_PIN_PC(26), 0, PIO_DEFAULT, PIO_OUTPUT}, + {"GNSS-RESET",AT91C_PIN_PD(15), 0, PIO_PULLUP, PIO_OUTPUT}, -+ {"SECURE-RESET",AT91C_PIN_PD(16), 1, PIO_PULLUP, PIO_OUTPUT}, + {"MTQ-RESET",AT91C_PIN_PD(17), 1, PIO_PULLUP, PIO_OUTPUT}, + {"USBHUB-RESET",AT91C_PIN_PD(18), 1, PIO_PULLUP, PIO_OUTPUT}, + {"GNSS-INT",AT91C_PIN_PD(19), 1, PIO_PULLUP, PIO_OUTPUT}, + {"WIFI-BT-LPMODE",AT91C_PIN_PD(20), 0, PIO_PULLUP, PIO_INPUT}, ++ {"N_GPIO_EXP1_RESET",AT91C_PIN_PD(16), 1, PIO_DEFAULT, PIO_OUTPUT}, ++ {"N_GPIO_EXP2_RESET",AT91C_PIN_PC(26), 1, PIO_DEFAULT, PIO_OUTPUT}, + {(char *)0, 0, 0, PIO_DEFAULT, PIO_PERIPH_A}, + }; + -- cgit v1.2.3 From 0bc48dea08bd5a4776f2dd170621c272733d2a18 Mon Sep 17 00:00:00 2001 From: John Klug Date: Thu, 23 Sep 2021 09:05:10 -0500 Subject: Fix DMA for external serial port on MTRV1-0.4 --- .../mtrv1/linux-4.9-mtrv1-device-tree.patch | 12 +++++++----- recipes-kernel/linux/linux-at91_4.9.87.bb | 2 +- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/recipes-kernel/linux/linux-at91-4.9.87/mtrv1/linux-4.9-mtrv1-device-tree.patch b/recipes-kernel/linux/linux-at91-4.9.87/mtrv1/linux-4.9-mtrv1-device-tree.patch index e84e6ff..cc7ad86 100644 --- a/recipes-kernel/linux/linux-at91-4.9.87/mtrv1/linux-4.9-mtrv1-device-tree.patch +++ b/recipes-kernel/linux/linux-at91-4.9.87/mtrv1/linux-4.9-mtrv1-device-tree.patch @@ -1,7 +1,7 @@ diff -Naru orig/arch/arm/boot/dts/mtrv1.dts new/arch/arm/boot/dts/mtrv1.dts --- orig/arch/arm/boot/dts/mtrv1.dts 1969-12-31 18:00:00.000000000 -0600 -+++ new/arch/arm/boot/dts/mtrv1.dts 2021-09-10 09:30:24.760466509 -0500 -@@ -0,0 +1,296 @@ ++++ new/arch/arm/boot/dts/mtrv1.dts 2021-09-23 08:27:46.971030415 -0500 +@@ -0,0 +1,299 @@ +/* + * DTS file for Multi-Tech Systems MTRv1 Hardware + * @@ -42,6 +42,7 @@ diff -Naru orig/arch/arm/boot/dts/mtrv1.dts new/arch/arm/boot/dts/mtrv1.dts + + ahb { + apb { ++ + /delete-node/ spi@f0004000; + macb0: ethernet@f802c000 { + phy-mode = "rmii"; @@ -50,6 +51,9 @@ diff -Naru orig/arch/arm/boot/dts/mtrv1.dts new/arch/arm/boot/dts/mtrv1.dts + + + pinctrl@fffff400 { ++ usart3 { ++ /delete-node/ usart3_sck-0; ++ }; + nand { + pinctrl_nand: nand-0 { + atmel,pins = @@ -292,13 +296,11 @@ diff -Naru orig/arch/arm/boot/dts/mtrv1.dts new/arch/arm/boot/dts/mtrv1.dts + +&usart3 { + status = "okay"; -+ atmel,use-dma-rx; -+ atmel,use-dma-tx; ++ pinctrl-0 = <&pinctrl_usart3 &pinctrl_usart3_rts &pinctrl_usart3_cts>; + dmas = <&dma0 1 AT91_DMA_CFG_PER_ID(14)>, + <&dma0 1 (AT91_DMA_CFG_PER_ID(15) | AT91_DMA_CFG_FIFOCFG_ASAP)>; + dma-names = "tx", "rx"; +}; - diff -Naru linux-4.9.87.orig/arch/arm/boot/dts/at91sam9x5cm.dtsi linux-4.9.87/arch/arm/boot/dts/at91sam9x5cm.dtsi --- linux-4.9.87.orig/arch/arm/boot/dts/at91sam9x5cm.dtsi 2019-01-03 15:21:25.339570341 -0600 +++ linux-4.9.87/arch/arm/boot/dts/at91sam9x5cm.dtsi 2019-01-03 15:17:51.911576659 -0600 diff --git a/recipes-kernel/linux/linux-at91_4.9.87.bb b/recipes-kernel/linux/linux-at91_4.9.87.bb index 4f035b5..023155c 100644 --- a/recipes-kernel/linux/linux-at91_4.9.87.bb +++ b/recipes-kernel/linux/linux-at91_4.9.87.bb @@ -19,7 +19,7 @@ RDEPENDS_kernel-modules_remove = "kernel-module-softdog" FILESEXTRAPATHS_prepend := "${THISDIR}/${P}:" KERNEL_EXTRA_ARGS ="LOADADDR=0x20008000" -PR = "r14" +PR = "r15" PKGR_kernel-module-i2c-at91 = "${PR}a${EXTENDPRAUTO}" PKGR_kernel-module-atmel-mci = "${PR}a${EXTENDPRAUTO}" KERNEL_VERSION = "${PV}" -- cgit v1.2.3 From 6fbfeb39a1e5700e24a55c0cb631141b315ec23a Mon Sep 17 00:00:00 2001 From: John Klug Date: Thu, 23 Sep 2021 09:20:58 -0500 Subject: ttyS4, external serial port, must be by default disabled --- .../linux/linux-at91-4.9.87/mtrv1/linux-4.9-mtrv1-device-tree.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes-kernel/linux/linux-at91-4.9.87/mtrv1/linux-4.9-mtrv1-device-tree.patch b/recipes-kernel/linux/linux-at91-4.9.87/mtrv1/linux-4.9-mtrv1-device-tree.patch index cc7ad86..e6014c2 100644 --- a/recipes-kernel/linux/linux-at91-4.9.87/mtrv1/linux-4.9-mtrv1-device-tree.patch +++ b/recipes-kernel/linux/linux-at91-4.9.87/mtrv1/linux-4.9-mtrv1-device-tree.patch @@ -295,7 +295,7 @@ diff -Naru orig/arch/arm/boot/dts/mtrv1.dts new/arch/arm/boot/dts/mtrv1.dts +}; + +&usart3 { -+ status = "okay"; ++ status = "disabled"; + pinctrl-0 = <&pinctrl_usart3 &pinctrl_usart3_rts &pinctrl_usart3_cts>; + dmas = <&dma0 1 AT91_DMA_CFG_PER_ID(14)>, + <&dma0 1 (AT91_DMA_CFG_PER_ID(15) | AT91_DMA_CFG_FIFOCFG_ASAP)>; -- cgit v1.2.3 From a4c599253159ea5de3d1c655e413ab32c4be17c5 Mon Sep 17 00:00:00 2001 From: John Klug Date: Tue, 28 Sep 2021 09:56:06 -0500 Subject: Have the Atmel serial driver pick the dma channel --- .../linux/linux-at91-4.9.87/mtrv1/linux-4.9-mtrv1-device-tree.patch | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/recipes-kernel/linux/linux-at91-4.9.87/mtrv1/linux-4.9-mtrv1-device-tree.patch b/recipes-kernel/linux/linux-at91-4.9.87/mtrv1/linux-4.9-mtrv1-device-tree.patch index e6014c2..b720488 100644 --- a/recipes-kernel/linux/linux-at91-4.9.87/mtrv1/linux-4.9-mtrv1-device-tree.patch +++ b/recipes-kernel/linux/linux-at91-4.9.87/mtrv1/linux-4.9-mtrv1-device-tree.patch @@ -296,9 +296,9 @@ diff -Naru orig/arch/arm/boot/dts/mtrv1.dts new/arch/arm/boot/dts/mtrv1.dts + +&usart3 { + status = "disabled"; ++ atmel,use-dma-rx; ++ atmel,use-dma-tx; + pinctrl-0 = <&pinctrl_usart3 &pinctrl_usart3_rts &pinctrl_usart3_cts>; -+ dmas = <&dma0 1 AT91_DMA_CFG_PER_ID(14)>, -+ <&dma0 1 (AT91_DMA_CFG_PER_ID(15) | AT91_DMA_CFG_FIFOCFG_ASAP)>; + dma-names = "tx", "rx"; +}; diff -Naru linux-4.9.87.orig/arch/arm/boot/dts/at91sam9x5cm.dtsi linux-4.9.87/arch/arm/boot/dts/at91sam9x5cm.dtsi -- cgit v1.2.3 From 7ae2e53e97b46482f3e7df74c14f5865b4d4a140 Mon Sep 17 00:00:00 2001 From: John Klug Date: Wed, 20 Oct 2021 06:05:27 -0500 Subject: Add PCA953X driver to kernel for MTCDT-0.2 --- recipes-kernel/linux/linux-at91-4.9.87/defconfig | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/recipes-kernel/linux/linux-at91-4.9.87/defconfig b/recipes-kernel/linux/linux-at91-4.9.87/defconfig index 10aae27..0490771 100644 --- a/recipes-kernel/linux/linux-at91-4.9.87/defconfig +++ b/recipes-kernel/linux/linux-at91-4.9.87/defconfig @@ -1988,7 +1988,8 @@ CONFIG_GPIO_SYSFS=y # CONFIG_GPIO_ADNP is not set # CONFIG_GPIO_MAX7300 is not set # CONFIG_GPIO_MAX732X is not set -# CONFIG_GPIO_PCA953X is not set +CONFIG_GPIO_PCA953X=y +CONFIG_GPIO_PCA953X_IRQ=y # CONFIG_GPIO_PCF857X is not set # CONFIG_GPIO_SX150X is not set # CONFIG_GPIO_TPIC2810 is not set -- cgit v1.2.3 From e1ca9ed430ca6dee461ffd1f6b596cf70b62e14b Mon Sep 17 00:00:00 2001 From: John Klug Date: Wed, 20 Oct 2021 06:41:21 -0500 Subject: Add new GPIO expander --- .../mtcdt/linux-4.9-mtcdt-device-tree.patch | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/recipes-kernel/linux/linux-at91-4.9.87/mtcdt/linux-4.9-mtcdt-device-tree.patch b/recipes-kernel/linux/linux-at91-4.9.87/mtcdt/linux-4.9-mtcdt-device-tree.patch index 4da2559..f551ff0 100644 --- a/recipes-kernel/linux/linux-at91-4.9.87/mtcdt/linux-4.9-mtcdt-device-tree.patch +++ b/recipes-kernel/linux/linux-at91-4.9.87/mtcdt/linux-4.9-mtcdt-device-tree.patch @@ -1,7 +1,7 @@ diff -Naru orig/arch/arm/boot/dts/mtcdt.dts new/arch/arm/boot/dts/mtcdt.dts --- orig/arch/arm/boot/dts/mtcdt.dts 1969-12-31 18:00:00.000000000 -0600 -+++ new/arch/arm/boot/dts/mtcdt.dts 2020-09-03 16:04:52.223278145 -0500 -@@ -0,0 +1,292 @@ ++++ new/arch/arm/boot/dts/mtcdt.dts 2021-10-20 06:26:38.745904725 -0500 +@@ -0,0 +1,304 @@ +/* + * DTS file for Multi-Tech Systems MTCDT Hardware + */ @@ -268,6 +268,18 @@ diff -Naru orig/arch/arm/boot/dts/mtcdt.dts new/arch/arm/boot/dts/mtcdt.dts + /* tempsensor_alert line running to pin PC19 on processor + set up an interrupt for this? */ + }; ++ pca9557@18 { ++ compatible = "nxp,pca9557"; ++ reg = <0x18>; ++ gpio-controller; ++ #gpio-cells = <2>; ++ }; ++ pca9557@19 { ++ compatible = "nxp,pca9557"; ++ reg = <0x19>; ++ gpio-controller; ++ #gpio-cells = <2>; ++ }; + }; + i2c-gpio-1 { + status = "okay"; -- cgit v1.2.3 From 434f91829c4228bb33019cb481da2a335bb12ded Mon Sep 17 00:00:00 2001 From: John Klug Date: Wed, 20 Oct 2021 06:42:33 -0500 Subject: Reserve 5 bit serial for multidrop in Atmel Serial driver --- .../mtcdt/linux-4.9-mtcdt-atmel-multidrop.patch | 48 ++++++++++++++++++++++ recipes-kernel/linux/linux-at91_4.9.87.bb | 9 ++-- 2 files changed, 53 insertions(+), 4 deletions(-) create mode 100644 recipes-kernel/linux/linux-at91-4.9.87/mtcdt/linux-4.9-mtcdt-atmel-multidrop.patch diff --git a/recipes-kernel/linux/linux-at91-4.9.87/mtcdt/linux-4.9-mtcdt-atmel-multidrop.patch b/recipes-kernel/linux/linux-at91-4.9.87/mtcdt/linux-4.9-mtcdt-atmel-multidrop.patch new file mode 100644 index 0000000..188c5cf --- /dev/null +++ b/recipes-kernel/linux/linux-at91-4.9.87/mtcdt/linux-4.9-mtcdt-atmel-multidrop.patch @@ -0,0 +1,48 @@ + This patch was derived from the Vizzini driver and this patch: + + https://www.spinics.net/lists/linux-serial/msg25999.html + + Since all prior versions of MTCDT used the Vizzini driver, + the mapping of 5 bit serial to multidrop (9 bit serial) was + used. + + The purpose of this patch is to reserve the Atmel 5 bit mode + for 9 bit usage on MTCDT MTAC-MFSER. +=========================================================================================== +diff --git orig/drivers/tty/serial/atmel_serial.c new/drivers/tty/serial/atmel_serial.c +index 1297853..cd7987b 100644 +--- orig/drivers/tty/serial/atmel_serial.c ++++ new/drivers/tty/serial/atmel_serial.c +@@ -2073,7 +2073,7 @@ static void atmel_set_termios(struct uart_port *port, struct ktermios *termios, + { + struct atmel_uart_port *atmel_port = to_atmel_uart_port(port); + unsigned long flags; +- unsigned int old_mode, mode, imr, quot, baud, div, cd, fp = 0; ++ unsigned int old_mode, mode, mdrop, imr, quot, baud, div, cd, fp = 0; + + /* save the current mode register */ + mode = old_mode = atmel_uart_readl(port, ATMEL_US_MR); +@@ -2084,10 +2084,12 @@ static void atmel_set_termios(struct uart_port *port, struct ktermios *termios, + + baud = uart_get_baud_rate(port, termios, old, 0, port->uartclk / 16); + ++ mdrop = 0; + /* byte size */ + switch (termios->c_cflag & CSIZE) { + case CS5: +- mode |= ATMEL_US_CHRL_5; ++ mode |= ATMEL_US_PAR_MULTI_DROP; ++ mdrop = ATMEL_US_SENDA; + break; + case CS6: + mode |= ATMEL_US_CHRL_6; +@@ -2246,7 +2248,8 @@ static void atmel_set_termios(struct uart_port *port, struct ktermios *termios, + + atmel_uart_writel(port, ATMEL_US_BRGR, quot); + atmel_uart_writel(port, ATMEL_US_CR, ATMEL_US_RSTSTA | ATMEL_US_RSTRX); +- atmel_uart_writel(port, ATMEL_US_CR, ATMEL_US_TXEN | ATMEL_US_RXEN); ++ atmel_uart_writel(port, ATMEL_US_CR, ++ mdrop | ATMEL_US_TXEN | ATMEL_US_RXEN); + atmel_port->tx_stopped = false; + + /* restore interrupts */ diff --git a/recipes-kernel/linux/linux-at91_4.9.87.bb b/recipes-kernel/linux/linux-at91_4.9.87.bb index 023155c..9ce7f05 100644 --- a/recipes-kernel/linux/linux-at91_4.9.87.bb +++ b/recipes-kernel/linux/linux-at91_4.9.87.bb @@ -19,7 +19,7 @@ RDEPENDS_kernel-modules_remove = "kernel-module-softdog" FILESEXTRAPATHS_prepend := "${THISDIR}/${P}:" KERNEL_EXTRA_ARGS ="LOADADDR=0x20008000" -PR = "r15" +PR = "r16" PKGR_kernel-module-i2c-at91 = "${PR}a${EXTENDPRAUTO}" PKGR_kernel-module-atmel-mci = "${PR}a${EXTENDPRAUTO}" KERNEL_VERSION = "${PV}" @@ -41,9 +41,9 @@ COMMON_PATCHES = " \ file://defconfig \ file://linux-4.9-pps-gpio.patch \ file://linux-4.9-at91sam9_wdt-10second-timeout.patch \ - file://linux-4.9-spidev_squack.patch \ - file://linux-4.9-add-num_accessory_ports-config-option.patch \ - file://linux-4.9-cdc-acm-ignore-exar-devices.patch \ + file://linux-4.9-spidev_squack.patch \ + file://linux-4.9-add-num_accessory_ports-config-option.patch \ + file://linux-4.9-cdc-acm-ignore-exar-devices.patch \ file://EXTRAVERSION.patch \ file://linux-4.9-ledtrig-netdev.patch \ file://linux-4.9-addl-time-for-pmeccerrloc.patch \ @@ -54,6 +54,7 @@ COMMON_PATCHES = " \ file://0002-linux-4.9-telit_print_qmi_wwan.patch \ file://make-kernel-reproducible.patch \ file://linux-4.9-atmel-mci-end.patch \ + file://linux-4.9-mtcdt-atmel-multidrop.patch \ file://i2c-at91.conf \ " -- cgit v1.2.3 From ac7e8e9592d0e57bf774e9850707a6fc9f5a3483 Mon Sep 17 00:00:00 2001 From: John Klug Date: Wed, 20 Oct 2021 06:47:38 -0500 Subject: r15 kernel was not yet released, so use r15 --- recipes-kernel/linux/linux-at91_4.9.87.bb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes-kernel/linux/linux-at91_4.9.87.bb b/recipes-kernel/linux/linux-at91_4.9.87.bb index 9ce7f05..98a5f30 100644 --- a/recipes-kernel/linux/linux-at91_4.9.87.bb +++ b/recipes-kernel/linux/linux-at91_4.9.87.bb @@ -19,7 +19,7 @@ RDEPENDS_kernel-modules_remove = "kernel-module-softdog" FILESEXTRAPATHS_prepend := "${THISDIR}/${P}:" KERNEL_EXTRA_ARGS ="LOADADDR=0x20008000" -PR = "r16" +PR = "r15" PKGR_kernel-module-i2c-at91 = "${PR}a${EXTENDPRAUTO}" PKGR_kernel-module-atmel-mci = "${PR}a${EXTENDPRAUTO}" KERNEL_VERSION = "${PV}" -- cgit v1.2.3 From bb18a6d3ce1d2f4cef991e465d74ba135f37726c Mon Sep 17 00:00:00 2001 From: John Klug Date: Wed, 20 Oct 2021 07:02:40 -0500 Subject: Print a message to the log when setting multidrop --- .../linux-at91-4.9.87/mtcdt/linux-4.9-mtcdt-atmel-multidrop.patch | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/recipes-kernel/linux/linux-at91-4.9.87/mtcdt/linux-4.9-mtcdt-atmel-multidrop.patch b/recipes-kernel/linux/linux-at91-4.9.87/mtcdt/linux-4.9-mtcdt-atmel-multidrop.patch index 188c5cf..d04b13c 100644 --- a/recipes-kernel/linux/linux-at91-4.9.87/mtcdt/linux-4.9-mtcdt-atmel-multidrop.patch +++ b/recipes-kernel/linux/linux-at91-4.9.87/mtcdt/linux-4.9-mtcdt-atmel-multidrop.patch @@ -22,7 +22,7 @@ index 1297853..cd7987b 100644 /* save the current mode register */ mode = old_mode = atmel_uart_readl(port, ATMEL_US_MR); -@@ -2084,10 +2084,12 @@ static void atmel_set_termios(struct uart_port *port, struct ktermios *termios, +@@ -2084,10 +2084,13 @@ static void atmel_set_termios(struct uart_port *port, struct ktermios *termios, baud = uart_get_baud_rate(port, termios, old, 0, port->uartclk / 16); @@ -33,10 +33,11 @@ index 1297853..cd7987b 100644 - mode |= ATMEL_US_CHRL_5; + mode |= ATMEL_US_PAR_MULTI_DROP; + mdrop = ATMEL_US_SENDA; ++ printk(KERN_INFO "termios: Setting Atmel Multi-Drop serial"); break; case CS6: mode |= ATMEL_US_CHRL_6; -@@ -2246,7 +2248,8 @@ static void atmel_set_termios(struct uart_port *port, struct ktermios *termios, +@@ -2246,7 +2249,8 @@ static void atmel_set_termios(struct uart_port *port, struct ktermios *termios, atmel_uart_writel(port, ATMEL_US_BRGR, quot); atmel_uart_writel(port, ATMEL_US_CR, ATMEL_US_RSTSTA | ATMEL_US_RSTRX); -- cgit v1.2.3 From b2997626a2f2f81268fb48aa7791c81c086293b1 Mon Sep 17 00:00:00 2001 From: John Klug Date: Thu, 21 Oct 2021 05:10:31 -0500 Subject: Call the new PCA9557 parts gpio4 and gpio5 --- .../linux-at91-4.9.87/mtcdt/linux-4.9-mtcdt-device-tree.patch | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/recipes-kernel/linux/linux-at91-4.9.87/mtcdt/linux-4.9-mtcdt-device-tree.patch b/recipes-kernel/linux/linux-at91-4.9.87/mtcdt/linux-4.9-mtcdt-device-tree.patch index f551ff0..0ddf35c 100644 --- a/recipes-kernel/linux/linux-at91-4.9.87/mtcdt/linux-4.9-mtcdt-device-tree.patch +++ b/recipes-kernel/linux/linux-at91-4.9.87/mtcdt/linux-4.9-mtcdt-device-tree.patch @@ -1,7 +1,7 @@ diff -Naru orig/arch/arm/boot/dts/mtcdt.dts new/arch/arm/boot/dts/mtcdt.dts --- orig/arch/arm/boot/dts/mtcdt.dts 1969-12-31 18:00:00.000000000 -0600 -+++ new/arch/arm/boot/dts/mtcdt.dts 2021-10-20 06:26:38.745904725 -0500 -@@ -0,0 +1,304 @@ ++++ new/arch/arm/boot/dts/mtcdt.dts 2021-10-21 04:58:51.743540072 -0500 +@@ -0,0 +1,306 @@ +/* + * DTS file for Multi-Tech Systems MTCDT Hardware + */ @@ -268,13 +268,15 @@ diff -Naru orig/arch/arm/boot/dts/mtcdt.dts new/arch/arm/boot/dts/mtcdt.dts + /* tempsensor_alert line running to pin PC19 on processor + set up an interrupt for this? */ + }; -+ pca9557@18 { ++ /* gpio0 through gpio3 are integrated into the SAM9G25 and defined ++ in at91sam9x5.dtsi */ ++ gpio4: pca9557@18 { + compatible = "nxp,pca9557"; + reg = <0x18>; + gpio-controller; + #gpio-cells = <2>; + }; -+ pca9557@19 { ++ gpio5: pca9557@19 { + compatible = "nxp,pca9557"; + reg = <0x19>; + gpio-controller; -- cgit v1.2.3 From f80e633cddfb629766e4a6c02bf375b256cd8457 Mon Sep 17 00:00:00 2001 From: John Klug Date: Thu, 21 Oct 2021 07:00:53 -0500 Subject: Add dummy regulator to make gpio expander driver happy --- .../mtcdt/linux-4.9-mtcdt-device-tree.patch | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/recipes-kernel/linux/linux-at91-4.9.87/mtcdt/linux-4.9-mtcdt-device-tree.patch b/recipes-kernel/linux/linux-at91-4.9.87/mtcdt/linux-4.9-mtcdt-device-tree.patch index 0ddf35c..fff3d85 100644 --- a/recipes-kernel/linux/linux-at91-4.9.87/mtcdt/linux-4.9-mtcdt-device-tree.patch +++ b/recipes-kernel/linux/linux-at91-4.9.87/mtcdt/linux-4.9-mtcdt-device-tree.patch @@ -1,7 +1,7 @@ diff -Naru orig/arch/arm/boot/dts/mtcdt.dts new/arch/arm/boot/dts/mtcdt.dts --- orig/arch/arm/boot/dts/mtcdt.dts 1969-12-31 18:00:00.000000000 -0600 -+++ new/arch/arm/boot/dts/mtcdt.dts 2021-10-21 04:58:51.743540072 -0500 -@@ -0,0 +1,306 @@ ++++ new/arch/arm/boot/dts/mtcdt.dts 2021-10-21 06:40:53.695663469 -0500 +@@ -0,0 +1,315 @@ +/* + * DTS file for Multi-Tech Systems MTCDT Hardware + */ @@ -251,6 +251,13 @@ diff -Naru orig/arch/arm/boot/dts/mtcdt.dts new/arch/arm/boot/dts/mtcdt.dts + status = "okay"; + }; + ++ /* pca953x driver wants a regulator ++ * This dummy regulator prevents warnings */ ++ dummy_reg: regulator@0 { ++ compatible = "regulator-fixed"; ++ reg = <0>; ++ regulator-name = "dummy-supply"; ++ }; + + i2c-gpio-0 { + status = "okay"; @@ -275,12 +282,14 @@ diff -Naru orig/arch/arm/boot/dts/mtcdt.dts new/arch/arm/boot/dts/mtcdt.dts + reg = <0x18>; + gpio-controller; + #gpio-cells = <2>; ++ vcc-supply = <&dummy_reg>; + }; + gpio5: pca9557@19 { + compatible = "nxp,pca9557"; + reg = <0x19>; + gpio-controller; + #gpio-cells = <2>; ++ vcc-supply = <&dummy_reg>; + }; + }; + i2c-gpio-1 { -- cgit v1.2.3 From 5e363ebddbb2b891d89d52f001e565a62e2732d8 Mon Sep 17 00:00:00 2001 From: John Klug Date: Wed, 27 Oct 2021 03:35:47 -0500 Subject: Add patch for multidrop serial to match Vizzini driver --- recipes-kernel/linux/linux-at91_4.9.87.bb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes-kernel/linux/linux-at91_4.9.87.bb b/recipes-kernel/linux/linux-at91_4.9.87.bb index 98a5f30..6e66b00 100644 --- a/recipes-kernel/linux/linux-at91_4.9.87.bb +++ b/recipes-kernel/linux/linux-at91_4.9.87.bb @@ -54,7 +54,6 @@ COMMON_PATCHES = " \ file://0002-linux-4.9-telit_print_qmi_wwan.patch \ file://make-kernel-reproducible.patch \ file://linux-4.9-atmel-mci-end.patch \ - file://linux-4.9-mtcdt-atmel-multidrop.patch \ file://i2c-at91.conf \ " @@ -62,6 +61,7 @@ COMMON_PATCHES = " \ SRC_URI_append_mtcdt = "\ ${COMMON_PATCHES} \ file://linux-4.9-mtcdt-device-tree.patch \ + file://linux-4.9-mtcdt-atmel-multidrop.patch \ " SRC_URI_append_mtrv1 = "\ ${COMMON_PATCHES} \ -- cgit v1.2.3 From 7e041a3236986d26f8174df5063ec5523a3f952a Mon Sep 17 00:00:00 2001 From: John Klug Date: Mon, 1 Nov 2021 11:43:12 -0500 Subject: output-high and output-low are ignored by pinctrl_at91 driver --- .../mtcdt/linux-4.9-mtcdt-device-tree.patch | 24 +++++++++++----------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/recipes-kernel/linux/linux-at91-4.9.87/mtcdt/linux-4.9-mtcdt-device-tree.patch b/recipes-kernel/linux/linux-at91-4.9.87/mtcdt/linux-4.9-mtcdt-device-tree.patch index fff3d85..481ab6d 100644 --- a/recipes-kernel/linux/linux-at91-4.9.87/mtcdt/linux-4.9-mtcdt-device-tree.patch +++ b/recipes-kernel/linux/linux-at91-4.9.87/mtcdt/linux-4.9-mtcdt-device-tree.patch @@ -1,6 +1,6 @@ diff -Naru orig/arch/arm/boot/dts/mtcdt.dts new/arch/arm/boot/dts/mtcdt.dts --- orig/arch/arm/boot/dts/mtcdt.dts 1969-12-31 18:00:00.000000000 -0600 -+++ new/arch/arm/boot/dts/mtcdt.dts 2021-10-21 06:40:53.695663469 -0500 ++++ new/arch/arm/boot/dts/mtcdt.dts 2021-11-01 11:34:34.531175268 -0500 @@ -0,0 +1,315 @@ +/* + * DTS file for Multi-Tech Systems MTCDT Hardware @@ -54,23 +54,25 @@ diff -Naru orig/arch/arm/boot/dts/mtcdt.dts new/arch/arm/boot/dts/mtcdt.dts + }; + mts-io { + pinctrl_mts_io_out: mts_io-0 { ++ // gpio4 and gpio5 are reset in at91bootstrap. They should not be touched in Linux. + atmel,pins = -+ ; /* PD18 USB Hub reset */ -+ output-high; ++ ; /* PD18 USB Hub reset */ ++ output-high; // ignored by at91_pinctrl + }; + pinctrl_mts_io_in: mts_io-1 { + atmel,pins = + ; /* PD20 WiFi_BT_LPMode Input */ + }; ++ // GNSS kept in reset to prevent EXAR from hanging + pinctrl_mts_io_gnss: mts_io-2 { + atmel,pins = -+ ; /* PD15 N_GNSS_RESET */ -+ output-low; ++ ; /* PD15 N_GNSS_RESET */ ++ output-low; // ignored by at91_pinctrl + }; + }; + @@ -312,9 +314,7 @@ diff -Naru orig/arch/arm/boot/dts/mtcdt.dts new/arch/arm/boot/dts/mtcdt.dts + 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>; + }; +}; Index: linux-4.9/arch/arm/boot/dts/at91sam9x5cm.dtsi -- cgit v1.2.3 From 1782a7c121964fae19649ae29e073fd872222001 Mon Sep 17 00:00:00 2001 From: John Klug Date: Mon, 8 Nov 2021 03:47:28 -0600 Subject: Device tree updates for MTCDT-0.2 and Overlay --- .../mtcdt/linux-4.9-mtcdt-device-tree.patch | 568 --------------------- .../linux/linux-at91-4.9.87/mtcdt/mt-at91.h | 19 + .../linux/linux-at91-4.9.87/mtcdt/mtcdt.dts | 435 ++++++++++++++++ recipes-kernel/linux/linux-at91_4.9.87.bb | 6 + 4 files changed, 460 insertions(+), 568 deletions(-) create mode 100644 recipes-kernel/linux/linux-at91-4.9.87/mtcdt/mt-at91.h create mode 100644 recipes-kernel/linux/linux-at91-4.9.87/mtcdt/mtcdt.dts diff --git a/recipes-kernel/linux/linux-at91-4.9.87/mtcdt/linux-4.9-mtcdt-device-tree.patch b/recipes-kernel/linux/linux-at91-4.9.87/mtcdt/linux-4.9-mtcdt-device-tree.patch index 481ab6d..d68cd0e 100644 --- a/recipes-kernel/linux/linux-at91-4.9.87/mtcdt/linux-4.9-mtcdt-device-tree.patch +++ b/recipes-kernel/linux/linux-at91-4.9.87/mtcdt/linux-4.9-mtcdt-device-tree.patch @@ -1,504 +1,3 @@ -diff -Naru orig/arch/arm/boot/dts/mtcdt.dts new/arch/arm/boot/dts/mtcdt.dts ---- orig/arch/arm/boot/dts/mtcdt.dts 1969-12-31 18:00:00.000000000 -0600 -+++ new/arch/arm/boot/dts/mtcdt.dts 2021-11-01 11:34:34.531175268 -0500 -@@ -0,0 +1,315 @@ -+/* -+ * DTS file for Multi-Tech Systems MTCDT Hardware -+ */ -+ -+/dts-v1/; -+#include "at91sam9g25.dtsi" -+#include "at91sam9x5ek.dtsi" -+ -+ -+/ { -+ model = "Multi-Tech Systems MTCDT"; -+ compatible = "atmel,at91sam9g25ek", "atmel,at91sam9x5ek", "atmel,at91sam9x5", "atmel,at91sam9"; -+ -+ ahb { -+ apb { -+ -+ -+ macb0: ethernet@f802c000 { -+ phy-mode = "rmii"; -+ status = "okay"; -+ }; -+ -+ pinctrl@fffff400 { -+ mmc0 { -+ pinctrl_board_mmc0: mmc0-board { -+ atmel,pins = -+ ; /* PA1 gpio SD card pin pull up and deglitch */ -+ }; -+ }; -+ nand { -+ pinctrl_nand: nand-0 { -+ atmel,pins = -+ ; /* PD13 periph A Data bit 7 */ -+ }; -+ -+ /delete-node/ nand_16bits-0; -+ }; -+ mts-io { -+ pinctrl_mts_io_out: mts_io-0 { -+ // gpio4 and gpio5 are reset in at91bootstrap. They should not be touched in Linux. -+ atmel,pins = -+ ; /* PD18 USB Hub reset */ -+ output-high; // ignored by at91_pinctrl -+ }; -+ pinctrl_mts_io_in: mts_io-1 { -+ atmel,pins = -+ ; /* PD20 WiFi_BT_LPMode Input */ -+ }; -+ // GNSS kept in reset to prevent EXAR from hanging -+ pinctrl_mts_io_gnss: mts_io-2 { -+ atmel,pins = -+ ; /* PD15 N_GNSS_RESET */ -+ output-low; // ignored by at91_pinctrl -+ }; -+ }; -+ -+ mmc1 { -+ pinctrl_mmc1_slot0_clk_cmd_dat0: mmc1_slot0_clk_cmd_dat0-0 { -+ atmel,pins = -+ ; /* PA11 periph B with pullup */ -+ }; -+ -+ pinctrl_mmc1_slot0_dat1_3: mmc1_slot0_dat1_3-0 { -+ atmel,pins = -+ ; /* PA4 periph B with pullup */ -+ }; -+ -+ /delete-node/ mmc1-board; -+ }; -+ }; -+ -+ rtc@fffffeb0 { -+ status = "okay"; -+ }; -+ -+ dbgu: serial@fffff200 { -+ status = "okay"; -+ atmel,use-dma-rx; -+ atmel,use-dma-tx; -+ }; -+ -+ /* runs to Accessory Port 1 */ -+ spi0: spi@f0000000 { -+ status = "okay"; -+ cs-gpios = <&pioA 4 0>, <&pioA 2 0>, <&pioA 3 0>, <&pioA 5 0>; -+ -+ ap1-adc@0 { -+ compatible = "mts-io-ap1-adc"; -+ spi-max-frequency = <20000000>; -+ reg = <0>; -+ }; -+ ap1-dout@1 { -+ compatible = "mts-io-ap1-dout"; -+ spi-max-frequency = <1000000>; -+ reg = <1>; -+ }; -+ ap1-spi@2 { -+ compatible = "mts,mtac"; -+ spi-max-frequency = <2000000>; -+ reg = <2>; -+ }; -+ ap1-din@3 { -+ compatible = "mts-io-ap1-din"; -+ spi-max-frequency = <1000000>; -+ reg = <3>; -+ }; -+ /delete-node/ m25p80@0; -+ }; -+ -+ /* runs to Accessory Port 2 */ -+ spi1: spi@f0004000 { -+ status = "okay"; -+ -+ cs-gpios = <&pioC 15 0>, <&pioC 16 0>, <&pioC 17 0>, <&pioC 18 0>; -+ -+ ap2-adc@0 { -+ compatible = "mts-io-ap2-adc"; -+ spi-max-frequency = <20000000>; -+ reg = <0>; -+ }; -+ ap2-dout@1 { -+ compatible = "mts-io-ap2-dout"; -+ spi-max-frequency = <1000000>; -+ reg = <1>; -+ }; -+ ap2-spi@2 { -+ compatible = "mts,mtac"; -+ spi-max-frequency = <2000000>; -+ reg = <2>; -+ }; -+ ap2-din@3 { -+ compatible = "mts-io-ap2-din"; -+ spi-max-frequency = <1000000>; -+ reg = <3>; -+ }; -+ }; -+ }; -+ -+ nand0: nand@40000000 { -+ reg = < 0x40000000 0x10000000 -+ 0xffffe000 0x600 /* PMECC Registers */ -+ 0xffffe600 0x200 /* PMECC Error Location Registers */ -+ 0x00100000 0x100000 /* PMECC looup table in ROM code */ -+ >; -+ atmel,pmecc-lookup-table-offset = <0x8000 0x10000>; -+ gpios = < &pioC 31 GPIO_ACTIVE_HIGH -+ &pioD 4 GPIO_ACTIVE_HIGH -+ 0 -+ >; -+ atmel,pmecc-cap = <4>; -+ atmel,nand-has-dma; -+ -+ nand@0 { -+ label = "NANDFlash"; -+ reg = <0x0 0x10000000>; -+ }; -+ at91bootstrap@0 { -+ label = "at91bootstrap"; -+ reg = <0x0 0x40000>; -+ }; -+ uboot@40000 { -+ label = "u-Boot"; -+ reg = <0x40000 0x80000>; -+ }; -+ ubootconfig0@c0000 { -+ label = "u-Boot Config"; -+ reg = <0xc0000 0xa0000>; -+ }; -+ ubootconfig1@160000 { -+ label = "u-Boot Redundant Config"; -+ reg = <0x160000 0xa0000>; -+ }; -+ uImage@200000 { -+ label = "uImage"; -+ reg = <0x200000 0x600000>; -+ }; -+ config0@800000 { -+ label = "Config"; -+ reg = <0x800000 0x800000>; -+ }; -+ config1@1000000 { -+ label = "OEM Config"; -+ reg = <0x1000000 0x800000>; -+ }; -+ rootfs@1800000 { -+ label = "Rootfs"; -+ reg = <0x1800000 0x8000000>; -+ }; -+ user@9800000 { -+ label = "User data"; -+ reg = <0x9800000 0x6800000>; -+ }; -+ }; -+ }; -+ -+ leds { -+ compatible = "gpio-leds"; -+ -+ 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>; -+ }; -+ }; -+ -+ /* GPS-PPS input on AP1 */ -+ pps-0 { -+ compatible = "pps-gpio"; -+ gpios = <&pioA 29 0>; -+ capture-clear; -+ status = "okay"; -+ }; -+ -+ /* pca953x driver wants a regulator -+ * This dummy regulator prevents warnings */ -+ dummy_reg: regulator@0 { -+ compatible = "regulator-fixed"; -+ reg = <0>; -+ regulator-name = "dummy-supply"; -+ }; -+ -+ i2c-gpio-0 { -+ status = "okay"; -+ -+ id_eeprom@56 { -+ compatible = "atmel,24c04"; -+ reg = <0x56>; -+ pagesize = <16>; -+ status = "okay"; -+ }; -+ board_temp@48 { -+ compatible = "ti,tmp102"; -+ reg = <0x48>; -+ status = "okay"; -+ /* 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 */ -+ gpio4: pca9557@18 { -+ compatible = "nxp,pca9557"; -+ reg = <0x18>; -+ gpio-controller; -+ #gpio-cells = <2>; -+ vcc-supply = <&dummy_reg>; -+ }; -+ gpio5: pca9557@19 { -+ compatible = "nxp,pca9557"; -+ reg = <0x19>; -+ gpio-controller; -+ #gpio-cells = <2>; -+ vcc-supply = <&dummy_reg>; -+ }; -+ }; -+ i2c-gpio-1 { -+ status = "okay"; -+ -+ ap1_eeprom@50 { -+ compatible = "atmel,24c04"; -+ reg = <0x50>; -+ pagesize = <16>; -+ status = "okay"; -+ }; -+ ap2_eeprom@52 { -+ compatible = "atmel,24c04"; -+ reg = <0x52>; -+ pagesize = <16>; -+ status = "okay"; -+ }; -+ }; -+ mts-io-0 { -+ status = "okay"; -+ compatible = "mts,mts-io"; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&pinctrl_mts_io_out>, <&pinctrl_mts_io_in>, <&pinctrl_mts_io_gnss>; -+ }; -+}; -Index: linux-4.9/arch/arm/boot/dts/at91sam9x5cm.dtsi -=================================================================== -diff -aNru linux-4.9-orig/arch/arm/boot/dts/at91sam9x5cm.dtsi linux-4.9/arch/arm/boot/dts/at91sam9x5cm.dtsi ---- linux-4.9-orig/arch/arm/boot/dts/at91sam9x5cm.dtsi 2018-11-28 18:38:25.509563104 -0600 -+++ linux-4.9/arch/arm/boot/dts/at91sam9x5cm.dtsi 2018-11-28 18:39:16.213561602 -0600 -@@ -43,48 +43,8 @@ - atmel,has-pmecc; /* Enable PMECC */ - atmel,pmecc-cap = <2>; - atmel,pmecc-sector-size = <512>; -- nand-on-flash-bbt; -+ /* nand-on-flash-bbt; */ - status = "okay"; -- -- at91bootstrap@0 { -- label = "at91bootstrap"; -- reg = <0x0 0x40000>; -- }; -- -- uboot@40000 { -- label = "u-boot"; -- reg = <0x40000 0x80000>; -- }; -- -- ubootenv@c0000 { -- label = "U-Boot Env"; -- reg = <0xc0000 0x140000>; -- }; -- -- kernel@200000 { -- label = "kernel"; -- reg = <0x200000 0x600000>; -- }; -- -- rootfs@800000 { -- label = "rootfs"; -- reg = <0x800000 0x1f800000>; -- }; -- }; -- }; -- -- leds { -- compatible = "gpio-leds"; -- -- pb18 { -- label = "pb18"; -- gpios = <&pioB 18 GPIO_ACTIVE_LOW>; -- linux,default-trigger = "heartbeat"; -- }; -- -- pd21 { -- label = "pd21"; -- gpios = <&pioD 21 GPIO_ACTIVE_HIGH>; - }; - }; - -@@ -96,5 +56,4 @@ - pinctrl-0 = <&pinctrl_1wire_cm>; - status = "okay"; - }; -- - }; -Index: linux-4.9/arch/arm/boot/dts/at91sam9x5ek.dtsi -=================================================================== -diff -aNru linux-4.9-orig/arch/arm/boot/dts/at91sam9x5ek.dtsi linux-4.9/arch/arm/boot/dts/at91sam9x5ek.dtsi ---- linux-4.9-orig/arch/arm/boot/dts/at91sam9x5ek.dtsi 2018-11-28 17:48:21.157652047 -0600 -+++ linux-4.9/arch/arm/boot/dts/at91sam9x5ek.dtsi 2018-11-28 17:49:54.793649275 -0600 -@@ -25,23 +25,11 @@ - &pinctrl_mmc0_slot0_clk_cmd_dat0 - &pinctrl_mmc0_slot0_dat1_3>; - status = "okay"; -+ /* external micro SD slot */ - slot@0 { - reg = <0>; - bus-width = <4>; -- cd-gpios = <&pioD 15 GPIO_ACTIVE_HIGH>; -- }; -- }; -- -- mmc1: mmc@f000c000 { -- pinctrl-0 = < -- &pinctrl_board_mmc1 -- &pinctrl_mmc1_slot0_clk_cmd_dat0 -- &pinctrl_mmc1_slot0_dat1_3>; -- status = "okay"; -- slot@0 { -- reg = <0>; -- bus-width = <4>; -- cd-gpios = <&pioD 14 GPIO_ACTIVE_HIGH>; -+ cd-gpios = <&pioA 1 GPIO_ACTIVE_HIGH>; - }; - }; - -@@ -49,7 +37,7 @@ - status = "okay"; - }; - -- usart0: serial@f801c000 { -+ uart0: serial@f8040000 { - atmel,use-dma-rx; - atmel,use-dma-tx; - status = "okay"; -@@ -58,25 +46,12 @@ - usb2: gadget@f803c000 { - pinctrl-names = "default"; - pinctrl-0 = <&pinctrl_board_usb2>; -- atmel,vbus-gpio = <&pioB 16 GPIO_ACTIVE_HIGH>; -- status = "okay"; -- }; -- -- i2c0: i2c@f8010000 { -- status = "okay"; -- -- wm8731: wm8731@1a { -- compatible = "wm8731"; -- reg = <0x1a>; -- }; -- }; -- -- adc0: adc@f804c000 { -- atmel,adc-ts-wires = <4>; -- atmel,adc-ts-pressure-threshold = <10000>; -+ /* atmel,vbus-gpio = <&pioB 16 GPIO_ACTIVE_HIGH>; mtcdt: no vbus-gpio */ - status = "okay"; - }; - -+ /* A/D convertor is unusable on Conduit */ -+ - pinctrl@fffff400 { - camera_sensor { - pinctrl_pck0_as_isi_mck: pck0_as_isi_mck-0 { -@@ -118,7 +93,7 @@ - }; - - spi0: spi@f0000000 { -- status = "disabled"; /* conflict with mmc1 */ -+ status = "okay"; - cs-gpios = <&pioA 14 0>, <0>, <0>, <0>; - m25p80@0 { - compatible = "atmel,at25df321a"; -@@ -131,37 +106,20 @@ - status = "okay"; - }; - -- ssc0: ssc@f0010000 { -- status = "okay"; -- }; - }; - - usb0: ohci@00600000 { - status = "okay"; - num-ports = <3>; -- atmel,vbus-gpio = <0 /* &pioD 18 GPIO_ACTIVE_LOW *//* Activate to have access to port A */ -- &pioD 19 GPIO_ACTIVE_LOW -- &pioD 20 GPIO_ACTIVE_LOW -- >; -+ //mtcdt: no vbus-gpio -+ // atmel,vbus-gpio = <0 /* &pioD 18 GPIO_ACTIVE_LOW *//* Activate to have access to port A */ -+ // &pioD 19 GPIO_ACTIVE_LOW -+ // &pioD 20 GPIO_ACTIVE_LOW -+ // >; - }; - - usb1: ehci@00700000 { - status = "okay"; - }; - }; -- -- sound { -- compatible = "atmel,sam9x5-wm8731-audio"; -- -- atmel,model = "wm8731 @ AT91SAM9X5EK"; -- -- atmel,audio-routing = -- "Headphone Jack", "RHPOUT", -- "Headphone Jack", "LHPOUT", -- "LLINEIN", "Line In Jack", -- "RLINEIN", "Line In Jack"; -- -- atmel,ssc-controller = <&ssc0>; -- atmel,audio-codec = <&wm8731>; -- }; - }; diff -aNru linux-4.9-orig/arch/arm/boot/dts/Makefile linux-4.9/arch/arm/boot/dts/Makefile --- linux-4.9-orig/arch/arm/boot/dts/Makefile 2018-11-28 17:48:26.197651897 -0600 +++ linux-4.9/arch/arm/boot/dts/Makefile 2018-11-28 17:49:26.441650114 -0600 @@ -512,70 +11,3 @@ diff -aNru linux-4.9-orig/arch/arm/boot/dts/Makefile linux-4.9/arch/arm/boot/dts dtb-$(CONFIG_SOC_SAM_V7) += \ at91-kizbox2.dtb \ at91-sama5d2_ptc_ek.dtb \ -Index: linux-4.9/arch/arm/boot/dts/at91sam9x5.dtsi -=================================================================== -diff -aNru linux-4.9-orig/arch/arm/boot/dts/at91sam9x5.dtsi linux-4.9/arch/arm/boot/dts/at91sam9x5.dtsi ---- linux-4.9-orig/arch/arm/boot/dts/at91sam9x5.dtsi 2018-11-28 17:20:48.149700984 -0600 -+++ linux-4.9/arch/arm/boot/dts/at91sam9x5.dtsi 2018-11-28 17:27:35.665688919 -0600 -@@ -32,9 +32,6 @@ - gpio3 = &pioD; - tcb0 = &tcb0; - tcb1 = &tcb1; -- i2c0 = &i2c0; -- i2c1 = &i2c1; -- i2c2 = &i2c2; - ssc0 = &ssc0; - pwm0 = &pwm0; - }; -@@ -963,50 +960,7 @@ - status = "disabled"; - }; - -- i2c0: i2c@f8010000 { -- compatible = "atmel,at91sam9x5-i2c"; -- reg = <0xf8010000 0x100>; -- interrupts = <9 IRQ_TYPE_LEVEL_HIGH 6>; -- dmas = <&dma0 1 AT91_DMA_CFG_PER_ID(7)>, -- <&dma0 1 AT91_DMA_CFG_PER_ID(8)>; -- dma-names = "tx", "rx"; -- #address-cells = <1>; -- #size-cells = <0>; -- pinctrl-names = "default"; -- pinctrl-0 = <&pinctrl_i2c0>; -- clocks = <&twi0_clk>; -- status = "disabled"; -- }; -- -- i2c1: i2c@f8014000 { -- compatible = "atmel,at91sam9x5-i2c"; -- reg = <0xf8014000 0x100>; -- interrupts = <10 IRQ_TYPE_LEVEL_HIGH 6>; -- dmas = <&dma1 1 AT91_DMA_CFG_PER_ID(5)>, -- <&dma1 1 AT91_DMA_CFG_PER_ID(6)>; -- dma-names = "tx", "rx"; -- #address-cells = <1>; -- #size-cells = <0>; -- pinctrl-names = "default"; -- pinctrl-0 = <&pinctrl_i2c1>; -- clocks = <&twi1_clk>; -- status = "disabled"; -- }; -- -- i2c2: i2c@f8018000 { -- compatible = "atmel,at91sam9x5-i2c"; -- reg = <0xf8018000 0x100>; -- interrupts = <11 IRQ_TYPE_LEVEL_HIGH 6>; -- dmas = <&dma0 1 AT91_DMA_CFG_PER_ID(9)>, -- <&dma0 1 AT91_DMA_CFG_PER_ID(10)>; -- dma-names = "tx", "rx"; -- #address-cells = <1>; -- #size-cells = <0>; -- pinctrl-names = "default"; -- pinctrl-0 = <&pinctrl_i2c2>; -- clocks = <&twi2_clk>; -- status = "disabled"; -- }; -+ /* /delete_node/ command does not work. */ - - uart0: serial@f8040000 { - compatible = "atmel,at91sam9260-usart"; diff --git a/recipes-kernel/linux/linux-at91-4.9.87/mtcdt/mt-at91.h b/recipes-kernel/linux/linux-at91-4.9.87/mtcdt/mt-at91.h new file mode 100644 index 0000000..36fba62 --- /dev/null +++ b/recipes-kernel/linux/linux-at91-4.9.87/mtcdt/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-4.9.87/mtcdt/mtcdt.dts b/recipes-kernel/linux/linux-at91-4.9.87/mtcdt/mtcdt.dts new file mode 100644 index 0000000..2ee2e86 --- /dev/null +++ b/recipes-kernel/linux/linux-at91-4.9.87/mtcdt/mtcdt.dts @@ -0,0 +1,435 @@ +/* + * DTS file for Multi-Tech Systems MTCDT Hardware + */ + +/dts-v1/; +#include "at91sam9g25.dtsi" +#include "at91sam9x5ek.dtsi" +#include + + +/ { + model = "Multi-Tech Systems MTCDT"; + compatible = "atmel,at91sam9g25ek", "atmel,at91sam9x5ek", "atmel,at91sam9x5", "atmel,at91sam9"; + + aliases { + /delete-property/ i2c0; + /delete-property/ i2c1; + /delete-property/ i2c2; + /delete-property/ ssc0; + // serial2, usart1 is AP1 serial + serial4 = &usart3; // AP2 serial + serial5 = &uart0; // GNSS on MTCDT-0.2 + /delete-property/ serial1; // usart0 + /delete-property/ serial3; // usart2 + }; + + /delete-node/ 1wire_cm; + ahb { + apb { + /delete-node/ i2c@f8010000; + /delete-node/ i2c@f8014000; + /delete-node/ i2c@f8018000; + /delete-node/ mmc@f000c000; + /delete-node/ adc@f804c000; + /delete-node/ ssc@f0010000; + /delete-node/ serial@f801c000; + macb0: ethernet@f802c000 { + phy-mode = "rmii"; + status = "okay"; + }; + + pinctrl@fffff400 { + /delete-node/ 1wire_cm; + usart1 { + /delete-node/ usart1_sck-0; + pinctrl_usart1_rng: usart1_rng-0 { + atmel,pins = ; + }; + pinctrl_usart1_dcd: usart1_dcd-0 { + atmel,pins = ; + }; + pinctrl_usart1_dtr: usart1_dtr-0 { + atmel,pins = ; + }; + }; + usart3 { + /delete-node/ usart3_sck-0; + pinctrl_usart3_rng: usart3_rng-0 { + atmel,pins = ; + }; + pinctrl_usart3_dcd: usart3_dcd-0 { + atmel,pins = ; + }; + pinctrl_usart3_dtr: usart3_dtr-0 { + atmel,pins = ; + }; + }; + + mmc0 { + pinctrl_board_mmc0: mmc0-board { + atmel,pins = + ; /* PA1 gpio SD card pin pull up and deglitch */ + }; + /* /delete-property/ cd-gpios; */ + }; + /delete-node/ mmc@f000c000; + + nand { + pinctrl_nand: nand-0 { + atmel,pins = + ; /* PD13 periph A Data bit 7 */ + }; + + /delete-node/ nand_16bits-0; + }; + mts-io { + pinctrl_mts_io_out: mts_io-0 { + // gpio4 and gpio5 are reset in at91bootstrap. They should not be touched in Linux. + atmel,pins = + ; /* PD18 USB Hub reset */ + output-high; // ignored by at91_pinctrl + }; + pinctrl_mts_io_in: mts_io-1 { + atmel,pins = + ; /* PD20 WiFi_BT_LPMode Input */ + }; + // GNSS kept in reset to prevent EXAR from hanging + pinctrl_mts_io_gnss: mts_io-2 { + atmel,pins = + ; /* PD15 N_GNSS_RESET */ + output-low; // ignored by at91_pinctrl + }; + }; + + mmc1 { + pinctrl_mmc1_slot0_clk_cmd_dat0: mmc1_slot0_clk_cmd_dat0-0 { + atmel,pins = + ; /* PA11 periph B with pullup */ + }; + + pinctrl_mmc1_slot0_dat1_3: mmc1_slot0_dat1_3-0 { + atmel,pins = + ; /* PA4 periph B with pullup */ + }; + + /delete-node/ mmc1-board; + }; + }; + + rtc@fffffeb0 { + status = "okay"; + }; + + dbgu: serial@fffff200 { + status = "okay"; + atmel,use-dma-rx; + atmel,use-dma-tx; + }; + /* runs to Accessory Port 1 */ + spi0: spi@f0000000 { + /delete-node/ m25p80@0; + }; + +#ifdef NO_OVERLAY + status = "disabled"; + // A5->A28 for MTCDT 0.2 + // cs-gpios = <&pioA 4 0>, <&pioA 2 0>, <&pioA 3 0>, <&pioA 5 0>; + ap1-adc@0 { + spi-max-frequency = <20000000>; + reg = <0>; + }; + ap1-dout@1 { + spi-max-frequency = <1000000>; + reg = <1>; + }; + ap1-spi@2 { + spi-max-frequency = <2000000>; + reg = <2>; + }; + ap1-din@3 { + spi-max-frequency = <1000000>; + reg = <3>; + }; + }; + + /* runs to Accessory Port 2 */ + spi1: spi@f0004000 { + status = "disabled"; + + cs-gpios = <&pioC 15 0>, <&pioC 16 0>, <&pioC 17 0>, <&pioC 18 0>; + + ap2-adc@0 { + compatible = "mts-io-ap2-adc"; + spi-max-frequency = <20000000>; + reg = <0>; + }; + ap2-dout@1 { + compatible = "mts-io-ap2-dout"; + spi-max-frequency = <1000000>; + reg = <1>; + }; + ap2-spi@2 { + compatible = "mts,mtac"; + spi-max-frequency = <2000000>; + reg = <2>; + }; + ap2-din@3 { + compatible = "mts-io-ap2-din"; + spi-max-frequency = <1000000>; + reg = <3>; + }; + }; +#endif // NO_OVERLAY + }; + + nand0: nand@40000000 { + /delete-property/ nand-on-flash-bbt; + reg = < 0x40000000 0x10000000 + 0xffffe000 0x600 /* PMECC Registers */ + 0xffffe600 0x200 /* PMECC Error Location Registers */ + 0x00100000 0x100000 /* PMECC looup table in ROM code */ + >; + atmel,pmecc-lookup-table-offset = <0x8000 0x10000>; + gpios = < &pioC 31 GPIO_ACTIVE_HIGH + &pioD 4 GPIO_ACTIVE_HIGH + 0 + >; + atmel,pmecc-cap = <4>; + atmel,nand-has-dma; + + nand@0 { + label = "NANDFlash"; + reg = <0x0 0x10000000>; + }; + at91bootstrap@0 { + label = "at91bootstrap"; + reg = <0x0 0x40000>; + }; + uboot@40000 { + label = "u-Boot"; + reg = <0x40000 0x80000>; + }; + /delete-node/ ubootenv@c0000; + ubootconfig0@c0000 { + label = "u-Boot Config"; + reg = <0xc0000 0xa0000>; + }; + ubootconfig1@160000 { + label = "u-Boot Redundant Config"; + reg = <0x160000 0xa0000>; + }; + /delete-node/ kernel@200000; + uImage@200000 { + label = "uImage"; + reg = <0x200000 0x600000>; + }; + config0@800000 { + label = "Config"; + reg = <0x800000 0x800000>; + }; + config1@1000000 { + label = "OEM Config"; + reg = <0x1000000 0x800000>; + }; + /delete-node/ rootfs@800000; + rootfs@1800000 { + label = "Rootfs"; + reg = <0x1800000 0x8000000>; + }; + user@9800000 { + label = "User data"; + reg = <0x9800000 0x6800000>; + }; + }; + }; + + leds { + status = "disabled"; + /delete-node/ pb18; + /delete-node/ pd21; + + led-status { + label = "led-status"; // LED2 + gpios = <&pioA 24 GPIO_ACTIVE_LOW>; // All + linux,default-trigger = "default-on"; + }; + }; + + /* GPS-PPS input on AP1 */ + pps-0 { + compatible = "pps-gpio"; + gpios = <&pioA 29 0>; + capture-clear; + status = "okay"; + }; + + /* pca953x driver wants a regulator + * This dummy regulator prevents warnings */ + dummy_reg: regulator@0 { + compatible = "regulator-fixed"; + regulator-name = "dummy-supply"; + }; + + i2c-gpio-0 { + status = "okay"; + + id_eeprom@56 { + compatible = "atmel,24c04"; + reg = <0x56>; + pagesize = <16>; + status = "okay"; + }; + board_temp@48 { + compatible = "ti,tmp102"; + reg = <0x48>; + status = "okay"; + /* 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>; + }; + gpio5: pca9557@19 { + compatible = "nxp,pca9557"; + reg = <0x19>; + gpio-controller; + #gpio-cells = <2>; + vcc-supply = <&dummy_reg>; + }; + }; + i2c-gpio-1 { + status = "okay"; + + ap1_eeprom@50 { + compatible = "atmel,24c04"; + reg = <0x50>; + pagesize = <16>; + status = "okay"; + }; + ap2_eeprom@52 { + compatible = "atmel,24c04"; + reg = <0x52>; + pagesize = <16>; + status = "okay"; + }; + }; + mts-io-0 { + status = "okay"; + compatible = "mts,mts-io"; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_mts_io_out>, <&pinctrl_mts_io_in>, <&pinctrl_mts_io_gnss>; + }; + /delete-node/ sound; + /delete-node/ ssc@f0010000; + /delete-node/ adc@f804c000; +}; + +&usb0 { + /delete-property/ atmel,vbus-gpio; +}; + +&usb2 { + /delete-property/ atmel,vbus-gpio; + status = "okay"; +}; + +&uart0 { + // GNSS on MTCDT-0.2 + status = "disabled"; + 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"; + atmel,use-dma-rx; + atmel,use-dma-tx; +}; + +&usart1 { + status = "disabled"; + atmel,use-dma-rx; + atmel,use-dma-tx; + pinctrl-0 = <&pinctrl_usart1 &pinctrl_usart1_rts &pinctrl_usart1_cts + &pinctrl_usart1_rng &pinctrl_usart1_dcd &pinctrl_usart1_dtr>; + rng-gpios = <&pioA 27 GPIO_ACTIVE_LOW>; + dcd-gpios = <&pioA 26 GPIO_ACTIVE_LOW>; + dtr-gpios = <&pioA 25 GPIO_ACTIVE_LOW>; + dma-names = "tx", "rx"; +}; + + +&usart3 { + status = "disabled"; + atmel,use-dma-rx; + atmel,use-dma-tx; + pinctrl-0 = <&pinctrl_usart3 &pinctrl_usart3_rts &pinctrl_usart3_cts + &pinctrl_usart3_rng &pinctrl_usart3_dcd &pinctrl_usart3_dtr>; + rng-gpios = <&pioC 14 GPIO_ACTIVE_LOW>; + dcd-gpios = <&pioC 13 GPIO_ACTIVE_LOW>; + dtr-gpios = <&pioC 12 GPIO_ACTIVE_LOW>; + dma-names = "tx", "rx"; +}; + +/* Explicit phandles for overlays + * Compiler generated low values + */ +&pioA { + phandle = ; + phandle,linux = ; +}; +&pioB { + phandle = ; + phandle,linux = ; +}; +&pioC { + phandle = ; + phandle,linux = ; +}; +&pioD { + phandle = ; + phandle,linux = ; +}; +// gpio-base is in the doc but does not work. +&gpio4 { + phandle = ; + phandle,linux = ; + // gpio-base = <128>; +}; +&gpio5 { + phandle = ; + phandle,linux = ; + // gpio-base = <136>; +}; diff --git a/recipes-kernel/linux/linux-at91_4.9.87.bb b/recipes-kernel/linux/linux-at91_4.9.87.bb index 6e66b00..7fc0e5d 100644 --- a/recipes-kernel/linux/linux-at91_4.9.87.bb +++ b/recipes-kernel/linux/linux-at91_4.9.87.bb @@ -60,6 +60,8 @@ COMMON_PATCHES = " \ SRC_URI_append_mtcdt = "\ ${COMMON_PATCHES} \ + file://mtcdt.dts \ + file://mt-at91.h \ file://linux-4.9-mtcdt-device-tree.patch \ file://linux-4.9-mtcdt-atmel-multidrop.patch \ " @@ -125,6 +127,10 @@ kernel_do_configure_append() { rm -f ${B}/.scmversion ${S}/.scmversion cd ${S}; git status; cd - } +kernel_do_configure_append_mtcdt() { + cp ${WORKDIR}/mtcdt.dts ${S}/arch/arm/boot/dts + cp ${WORKDIR}/mt-at91.h ${S}/arch/arm/boot/dts/include/dt-bindings/gpio +} KERNEL_MODULE_PACKAGE_SUFFIX="" -- cgit v1.2.3 From 130ab6fd5153fa528e2e33a501d9ecffed55067b Mon Sep 17 00:00:00 2001 From: John Klug Date: Wed, 10 Nov 2021 11:26:59 -0600 Subject: Cannot use same stanza names at at91sam9x5cm.dtsi or partition order is incorrect --- recipes-kernel/linux/linux-at91-4.9.87/mtcdt/mtcdt.dts | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/recipes-kernel/linux/linux-at91-4.9.87/mtcdt/mtcdt.dts b/recipes-kernel/linux/linux-at91-4.9.87/mtcdt/mtcdt.dts index 2ee2e86..f485baa 100644 --- a/recipes-kernel/linux/linux-at91-4.9.87/mtcdt/mtcdt.dts +++ b/recipes-kernel/linux/linux-at91-4.9.87/mtcdt/mtcdt.dts @@ -220,19 +220,27 @@ atmel,pmecc-cap = <4>; atmel,nand-has-dma; + /* To ensure correct partition ordering, we must delete + * at91sam9x5cm.dtsi partitions and not use the same names + * for the stanzas. */ + /delete-node/ at91bootstrap@0; + /delete-node/ uboot@40000; + /delete-node/ ubootenv@c0000; + /delete-node/ kernel@200000; + /delete-node/ rootfs@800000; + nand@0 { label = "NANDFlash"; reg = <0x0 0x10000000>; }; - at91bootstrap@0 { + at91bootstrapMT@0 { label = "at91bootstrap"; reg = <0x0 0x40000>; }; - uboot@40000 { + ubootMT@40000 { label = "u-Boot"; reg = <0x40000 0x80000>; }; - /delete-node/ ubootenv@c0000; ubootconfig0@c0000 { label = "u-Boot Config"; reg = <0xc0000 0xa0000>; @@ -241,7 +249,6 @@ label = "u-Boot Redundant Config"; reg = <0x160000 0xa0000>; }; - /delete-node/ kernel@200000; uImage@200000 { label = "uImage"; reg = <0x200000 0x600000>; @@ -254,7 +261,6 @@ label = "OEM Config"; reg = <0x1000000 0x800000>; }; - /delete-node/ rootfs@800000; rootfs@1800000 { label = "Rootfs"; reg = <0x1800000 0x8000000>; -- cgit v1.2.3 From 948c5945a4b324a5a33c395727df844fff25555f Mon Sep 17 00:00:00 2001 From: John Klug Date: Fri, 12 Nov 2021 20:25:39 -0600 Subject: Remove support for IRQ because our I/O expander does not have this --- recipes-kernel/linux/linux-at91-4.9.87/defconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes-kernel/linux/linux-at91-4.9.87/defconfig b/recipes-kernel/linux/linux-at91-4.9.87/defconfig index 0490771..05971d9 100644 --- a/recipes-kernel/linux/linux-at91-4.9.87/defconfig +++ b/recipes-kernel/linux/linux-at91-4.9.87/defconfig @@ -1989,7 +1989,7 @@ CONFIG_GPIO_SYSFS=y # CONFIG_GPIO_MAX7300 is not set # CONFIG_GPIO_MAX732X is not set CONFIG_GPIO_PCA953X=y -CONFIG_GPIO_PCA953X_IRQ=y +# CONFIG_GPIO_PCA953X_IRQ is not set # CONFIG_GPIO_PCF857X is not set # CONFIG_GPIO_SX150X is not set # CONFIG_GPIO_TPIC2810 is not set -- cgit v1.2.3 From 0c630ce6825b353bda5f3505d35afb904816e838 Mon Sep 17 00:00:00 2001 From: John Klug Date: Tue, 26 Oct 2021 09:51:38 -0500 Subject: Turn off debug in the RS9113 driver due to too many warnings --- recipes-kernel/rs9113/rs9113-from-src/debug-rs9113.patch | 14 ++++++++++++++ recipes-kernel/rs9113/rs9113-from-src_1.6.5.bb | 4 +++- 2 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 recipes-kernel/rs9113/rs9113-from-src/debug-rs9113.patch diff --git a/recipes-kernel/rs9113/rs9113-from-src/debug-rs9113.patch b/recipes-kernel/rs9113/rs9113-from-src/debug-rs9113.patch new file mode 100644 index 0000000..4101116 --- /dev/null +++ b/recipes-kernel/rs9113/rs9113-from-src/debug-rs9113.patch @@ -0,0 +1,14 @@ +* Turn off debug to prevent performance issues +======================================================= +diff --git a/source/host/config/make.config b/source/host/config/make.config +index fd5133b..fc4507d 100644 +--- a/source/host/config/make.config ++++ b/source/host/config/make.config +@@ -48,7 +48,6 @@ ifeq ($(CONFIG_CHW_20_40), y) + endif + + +-EXTRA_CFLAGS += -DONEBOX_DEBUG_ENABLE + EXTRA_CFLAGS += -DPROGRAMMING_BBP_TA + EXTRA_CFLAGS += -DPROGRAMMING_SCAN_TA + EXTRA_CFLAGS += -DRSI_SDIO_MULTI_BLOCK_SUPPORT diff --git a/recipes-kernel/rs9113/rs9113-from-src_1.6.5.bb b/recipes-kernel/rs9113/rs9113-from-src_1.6.5.bb index efd6549..a1af590 100644 --- a/recipes-kernel/rs9113/rs9113-from-src_1.6.5.bb +++ b/recipes-kernel/rs9113/rs9113-from-src_1.6.5.bb @@ -18,6 +18,8 @@ SRCREV_FORMAT = "machine" SRC_URI = " \ git://git@${MTS_INTERNAL_GIT}/mlinux/meta-rs9113.git;protocol=ssh;branch=${PV};destsuffix=meta/ \ git://git@${MTS_INTERNAL_GIT}/mlinux/Redpine.git;protocol=ssh;branch=${PV} \ + file://debug-rs9113.patch \ + file://onebox-backlog-counter.patch \ " SRCXX_URI = " \ git://git@${MTS_INTERNAL_GIT}/mlinux/Redpine.git;protocol=ssh;branch=${PV};name=machine \ @@ -59,7 +61,7 @@ do_compile () { do_patch () { cd ${WORKDIR}/git - for f in ${M}/patches/* ; do + for f in ${M}/patches/* ../*.patch ; do # Cannot use [[ $f =~ \.patch$ ]] here because the $ after patch breaks the recipe. if echo ${f} | grep '\.patch$' >/dev/null 2>&1 ; then echo found patch ${f} -- cgit v1.2.3 From 6345651c59f68a02f30b91fd215439fdb127d50f Mon Sep 17 00:00:00 2001 From: John Klug Date: Fri, 5 Nov 2021 07:04:19 -0500 Subject: Remove patch from recipe that is in meta-rs9113 --- recipes-kernel/rs9113/rs9113-from-src_1.6.5.bb | 1 - 1 file changed, 1 deletion(-) diff --git a/recipes-kernel/rs9113/rs9113-from-src_1.6.5.bb b/recipes-kernel/rs9113/rs9113-from-src_1.6.5.bb index a1af590..b9ddf80 100644 --- a/recipes-kernel/rs9113/rs9113-from-src_1.6.5.bb +++ b/recipes-kernel/rs9113/rs9113-from-src_1.6.5.bb @@ -19,7 +19,6 @@ SRC_URI = " \ git://git@${MTS_INTERNAL_GIT}/mlinux/meta-rs9113.git;protocol=ssh;branch=${PV};destsuffix=meta/ \ git://git@${MTS_INTERNAL_GIT}/mlinux/Redpine.git;protocol=ssh;branch=${PV} \ file://debug-rs9113.patch \ - file://onebox-backlog-counter.patch \ " SRCXX_URI = " \ git://git@${MTS_INTERNAL_GIT}/mlinux/Redpine.git;protocol=ssh;branch=${PV};name=machine \ -- cgit v1.2.3 From ec5e69d8a24345d6a01347df76ea29a4f682fd70 Mon Sep 17 00:00:00 2001 From: Andrii Pientsov Date: Mon, 22 Nov 2021 09:56:05 +0200 Subject: Add PCA953X driver to kernel 5.4.81 for MTCDT-0.2 --- recipes-kernel/linux/linux-at91-5.4.81/defconfig | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/recipes-kernel/linux/linux-at91-5.4.81/defconfig b/recipes-kernel/linux/linux-at91-5.4.81/defconfig index 6a98945..022b72d 100644 --- a/recipes-kernel/linux/linux-at91-5.4.81/defconfig +++ b/recipes-kernel/linux/linux-at91-5.4.81/defconfig @@ -2207,7 +2207,8 @@ CONFIG_GPIO_SYSFS=y # CONFIG_GPIO_GW_PLD is not set # CONFIG_GPIO_MAX7300 is not set # CONFIG_GPIO_MAX732X is not set -# CONFIG_GPIO_PCA953X is not set +CONFIG_GPIO_PCA953X=y +# CONFIG_GPIO_PCA953X_IRQ is not set # CONFIG_GPIO_PCF857X is not set # CONFIG_GPIO_TPIC2810 is not set # end of I2C GPIO expanders -- cgit v1.2.3 From 52a369e5e4819acddbc5b5261133a7ed9e7e0c7d Mon Sep 17 00:00:00 2001 From: Andrii Pientsov Date: Mon, 22 Nov 2021 12:32:17 +0200 Subject: Reserve 5 bit serial for multidrop in Atmel Serial driver. Kernel 5.4.81 --- ...ux-5.4-reserve-5-bit-serial-for-multidrop.patch | 31 ++++++++++++++++++++++ recipes-kernel/linux/linux-at91_5.4.81.bb | 1 + 2 files changed, 32 insertions(+) create mode 100644 recipes-kernel/linux/linux-at91-5.4.81/mtcdt/linux-5.4-reserve-5-bit-serial-for-multidrop.patch diff --git a/recipes-kernel/linux/linux-at91-5.4.81/mtcdt/linux-5.4-reserve-5-bit-serial-for-multidrop.patch b/recipes-kernel/linux/linux-at91-5.4.81/mtcdt/linux-5.4-reserve-5-bit-serial-for-multidrop.patch new file mode 100644 index 0000000..33f8ecd --- /dev/null +++ b/recipes-kernel/linux/linux-at91-5.4.81/mtcdt/linux-5.4-reserve-5-bit-serial-for-multidrop.patch @@ -0,0 +1,31 @@ +From 1edc302f56b57512a99d6c21e1ddb85a89d16045 Mon Sep 17 00:00:00 2001 +From: Andrii Pientsov +Date: Mon, 22 Nov 2021 12:03:15 +0200 +Subject: [PATCH] [PATCH] linux-5.4-reserve-5-bit-serial-for-multidrop + +--- + drivers/tty/serial/atmel_serial.c | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/drivers/tty/serial/atmel_serial.c b/drivers/tty/serial/atmel_serial.c +index ea0215a0f4a4..28d4a92c0d63 100644 +--- a/drivers/tty/serial/atmel_serial.c ++++ b/drivers/tty/serial/atmel_serial.c +@@ -2158,10 +2158,13 @@ static void atmel_set_termios(struct uart_port *port, struct ktermios *termios, + + baud = uart_get_baud_rate(port, termios, old, 0, port->uartclk / 16); + ++ mdrop = 0; + /* byte size */ + switch (termios->c_cflag & CSIZE) { + case CS5: +- mode |= ATMEL_US_CHRL_5; ++ mode |= ATMEL_US_PAR_MULTI_DROP; ++ mdrop = ATMEL_US_SENDA; ++ printk(KERN_INFO "termios: Setting Atmel Multi-Drop serial"); + break; + case CS6: + mode |= ATMEL_US_CHRL_6; +-- +2.25.1 + diff --git a/recipes-kernel/linux/linux-at91_5.4.81.bb b/recipes-kernel/linux/linux-at91_5.4.81.bb index 4c9d3c1..f742ed7 100644 --- a/recipes-kernel/linux/linux-at91_5.4.81.bb +++ b/recipes-kernel/linux/linux-at91_5.4.81.bb @@ -49,6 +49,7 @@ COMMON_PATCHES = " \ SRC_URI_append_mtcdt = "\ ${COMMON_PATCHES} \ + file://linux-5.4-reserve-5-bit-serial-for-multidrop.patch \ " SRC_URI_append_mtrv1 = "\ ${COMMON_PATCHES} \ -- cgit v1.2.3 From 5e0e2a5bdcca315e79e0dab0fbdcfaa2c94ac445 Mon Sep 17 00:00:00 2001 From: Andrii Pientsov Date: Tue, 30 Nov 2021 17:40:50 +0200 Subject: Update mtcdt.dts for MTCDT-0.2 --- recipes-kernel/linux/linux-at91-5.4.81/mt-at91.h | 19 +++ .../linux/linux-at91-5.4.81/mts-dts/mtcdt.dts | 160 +++++++++++++++------ recipes-kernel/linux/linux-at91_5.4.81.bb | 2 + 3 files changed, 136 insertions(+), 45 deletions(-) create mode 100644 recipes-kernel/linux/linux-at91-5.4.81/mt-at91.h 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 #include #include +#include / { @@ -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 = ; /* PC29 periph C */ }; + + pinctrl_usart1_rng: usart1_rng-0 { + atmel,pins = + ; + }; + + pinctrl_usart1_dcd: usart1_dcd-0 { + atmel,pins = + ; + }; + + pinctrl_usart1_dtr: usart1_dtr-0 { + atmel,pins = + ; + }; }; usart2 { @@ -417,6 +433,21 @@ atmel,pins = ; /* PC26 periph B */ }; + + pinctrl_usart3_rng: usart3_rng-0 { + atmel,pins = + ; + }; + + pinctrl_usart3_dcd: usart3_dcd-0 { + atmel,pins = + ; + }; + + pinctrl_usart3_dtr: usart3_dtr-0 { + atmel,pins = + ; + }; }; 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 = - ; /* PD18 USB Hub reset */ - output-high; - }; - pinctrl_mts_io_in: mts_io-1 { + ; /* PD18 USB Hub reset */ + output-high; // ignored by at91_pinctrl + }; + pinctrl_mts_io_in: mts_io-1 { atmel,pins = ; /* 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 = - ; /* PD15 N_GNSS_RESET */ - output-low; - }; + ; /* 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 = ; + phandle,linux = ; }; pioB: gpio@fffff600 { @@ -750,6 +785,8 @@ interrupt-controller; #interrupt-cells = <2>; clocks = <&pmc PMC_TYPE_PERIPHERAL 2>; + phandle = ; + phandle,linux = ; }; pioC: gpio@fffff800 { @@ -761,6 +798,8 @@ interrupt-controller; #interrupt-cells = <2>; clocks = <&pmc PMC_TYPE_PERIPHERAL 3>; + phandle = ; + phandle,linux = ; }; pioD: gpio@fffffa00 { @@ -773,6 +812,8 @@ interrupt-controller; #interrupt-cells = <2>; clocks = <&pmc PMC_TYPE_PERIPHERAL 3>; + phandle = ; + phandle,linux = ; }; }; @@ -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 = ; + phandle,linux = ; + // gpio-base = <128>; + }; + + gpio5: pca9557@19 { + compatible = "nxp,pca9557"; + reg = <0x19>; + gpio-controller; + #gpio-cells = <2>; + vcc-supply = <&dummy_reg>; + phandle = ; + phandle,linux = ; + // 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 () { -- cgit v1.2.3