From 100e0015753decb67a43f872707ab2ad02eb0e72 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 a1cb6a3..ec942ec 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