From 5e0a25c9c7cae22d3376685b69a76e6e12311538 Mon Sep 17 00:00:00 2001 From: David Sidrane Date: Fri, 4 Aug 2017 06:29:19 -1000 Subject: [PATCH] nuttx-patches:Removed unused patchs --- ...013-BACKPORT-stm32-serial-dma-hotfix.patch | 290 ------------------ .../00018-BACKPORT-stm32-serial-break.patch | 18 -- nuttx-patches/CMakeLists.txt | 4 +- 3 files changed, 1 insertion(+), 311 deletions(-) delete mode 100644 nuttx-patches/00013-BACKPORT-stm32-serial-dma-hotfix.patch delete mode 100644 nuttx-patches/00018-BACKPORT-stm32-serial-break.patch diff --git a/nuttx-patches/00013-BACKPORT-stm32-serial-dma-hotfix.patch b/nuttx-patches/00013-BACKPORT-stm32-serial-dma-hotfix.patch deleted file mode 100644 index 390fc58549..0000000000 --- a/nuttx-patches/00013-BACKPORT-stm32-serial-dma-hotfix.patch +++ /dev/null @@ -1,290 +0,0 @@ -diff --git NuttX/nuttx/arch/arm/src/stm32/stm32_serial.c NuttX/nuttx/arch/arm/src/stm32/stm32_serial.c -index 644c810..aef3fe1 100644 ---- NuttX/nuttx/arch/arm/src/stm32/stm32_serial.c -+++ NuttX/nuttx/arch/arm/src/stm32/stm32_serial.c -@@ -208,7 +208,7 @@ - # error "Unknown STM32 DMA" - # endif - --/* DMA control words */ -+/* DMA control word */ - - # if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F40XX) - # define SERIAL_DMA_CONTROL_WORD \ -@@ -220,16 +220,6 @@ - CONFIG_USART_DMAPRIO | \ - DMA_SCR_PBURST_SINGLE | \ - DMA_SCR_MBURST_SINGLE) --# ifdef CONFIG_SERIAL_IFLOWCONTROL --# define SERIAL_DMA_IFLOW_CONTROL_WORD \ -- (DMA_SCR_DIR_P2M | \ -- DMA_SCR_MINC | \ -- DMA_SCR_PSIZE_8BITS | \ -- DMA_SCR_MSIZE_8BITS | \ -- CONFIG_USART_DMAPRIO | \ -- DMA_SCR_PBURST_SINGLE | \ -- DMA_SCR_MBURST_SINGLE) --# endif - # else - # define SERIAL_DMA_CONTROL_WORD \ - (DMA_CCR_CIRC | \ -@@ -237,13 +227,6 @@ - DMA_CCR_PSIZE_8BITS | \ - DMA_CCR_MSIZE_8BITS | \ - CONFIG_USART_DMAPRIO) --# ifdef CONFIG_SERIAL_IFLOWCONTROL --# define SERIAL_DMA_IFLOW_CONTROL_WORD \ -- (DMA_CCR_MINC | \ -- DMA_CCR_PSIZE_8BITS | \ -- DMA_CCR_MSIZE_8BITS | \ -- CONFIG_USART_DMAPRIO) --# endif - # endif - - #endif -@@ -1608,28 +1591,13 @@ static int up_dma_setup(struct uart_dev_s *dev) - - priv->rxdma = stm32_dmachannel(priv->rxdma_channel); - --#ifdef CONFIG_SERIAL_IFLOWCONTROL -- if (priv->iflow) -- { -- /* Configure for non-circular DMA reception into the RX FIFO */ -- -- stm32_dmasetup(priv->rxdma, -- priv->usartbase + STM32_USART_RDR_OFFSET, -- (uint32_t)priv->rxfifo, -- RXDMA_BUFFER_SIZE, -- SERIAL_DMA_IFLOW_CONTROL_WORD); -- } -- else --#endif -- { -- /* Configure for circular DMA reception into the RX FIFO */ -+ /* Configure for circular DMA reception into the RX fifo */ - -- stm32_dmasetup(priv->rxdma, -- priv->usartbase + STM32_USART_RDR_OFFSET, -- (uint32_t)priv->rxfifo, -- RXDMA_BUFFER_SIZE, -- SERIAL_DMA_CONTROL_WORD); -- } -+ stm32_dmasetup(priv->rxdma, -+ priv->usartbase + STM32_USART_RDR_OFFSET, -+ (uint32_t)priv->rxfifo, -+ RXDMA_BUFFER_SIZE, -+ SERIAL_DMA_CONTROL_WORD); - - /* Reset our DMA shadow pointer to match the address just - * programmed above. -@@ -1643,26 +1611,12 @@ static int up_dma_setup(struct uart_dev_s *dev) - regval |= USART_CR3_DMAR; - up_serialout(priv, STM32_USART_CR3_OFFSET, regval); - --#ifdef CONFIG_SERIAL_IFLOWCONTROL -- if (priv->iflow) -- { -- /* Start the DMA channel, and arrange for callbacks at the full point -- * in the FIFO. After buffer gets full, hardware flow-control kicks -- * in and DMA transfer is stopped. -- */ -- -- stm32_dmastart(priv->rxdma, up_dma_rxcallback, (void *)priv, false); -- } -- else --#endif -- { -- /* Start the DMA channel, and arrange for callbacks at the half and -- * full points in the FIFO. This ensures that we have half a FIFO -- * worth of time to claim bytes before they are overwritten. -- */ -+ /* Start the DMA channel, and arrange for callbacks at the half and -+ * full points in the FIFO. This ensures that we have half a FIFO -+ * worth of time to claim bytes before they are overwritten. -+ */ - -- stm32_dmastart(priv->rxdma, up_dma_rxcallback, (void *)priv, true); -- } -+ stm32_dmastart(priv->rxdma, up_dma_rxcallback, (void *)priv, true); - - return OK; - } -@@ -1817,7 +1771,7 @@ static void up_detach(struct uart_dev_s *dev) - * interrupt received on the 'irq' It should call uart_transmitchars or - * uart_receivechar to perform the appropriate data transfers. The - * interrupt handling logic must be able to map the 'irq' number into the -- * appropriate uart_dev_s structure in order to call these functions. -+ * approprite uart_dev_s structure in order to call these functions. - * - ****************************************************************************/ - -@@ -2316,9 +2270,11 @@ static bool up_rxflowcontrol(struct uart_dev_s *dev, - unsigned int nbuffered, bool upper) - { - struct up_dev_s *priv = (struct up_dev_s *)dev->priv; -+#if !(defined(CONFIG_SERIAL_IFLOWCONTROL_WATERMARKS) && defined(CONFIG_STM32_FLOWCONTROL_BROKEN)) -+ uint16_t ie; -+#endif - --#if defined(CONFIG_SERIAL_IFLOWCONTROL_WATERMARKS) && \ -- defined(CONFIG_STM32_FLOWCONTROL_BROKEN) -+#if defined(CONFIG_SERIAL_IFLOWCONTROL_WATERMARKS) && defined(CONFIG_STM32_FLOWCONTROL_BROKEN) - if (priv->iflow && (priv->rts_gpio != 0)) - { - /* Assert/de-assert nRTS set it high resume/stop sending */ -@@ -2346,7 +2302,9 @@ static bool up_rxflowcontrol(struct uart_dev_s *dev, - * enable Rx interrupts. - */ - -- uart_disablerxint(dev); -+ ie = priv->ie; -+ ie &= ~USART_CR1_RXNEIE; -+ up_restoreusartint(priv, ie); - return true; - } - -@@ -2359,7 +2317,7 @@ static bool up_rxflowcontrol(struct uart_dev_s *dev, - * received. - */ - -- uart_enablerxint(dev); -+ up_rxint(dev, true); - } - } - #endif -@@ -2391,18 +2349,7 @@ static int up_dma_receive(struct uart_dev_s *dev, unsigned int *status) - priv->rxdmanext++; - if (priv->rxdmanext == RXDMA_BUFFER_SIZE) - { --#ifdef CONFIG_SERIAL_IFLOWCONTROL -- if (priv->iflow) -- { -- /* RX DMA buffer full. RX paused, RTS line pulled up to prevent -- * more input data from other end. -- */ -- } -- else --#endif -- { -- priv->rxdmanext = 0; -- } -+ priv->rxdmanext = 0; - } - } - -@@ -2411,40 +2358,6 @@ static int up_dma_receive(struct uart_dev_s *dev, unsigned int *status) - #endif - - /**************************************************************************** -- * Name: up_dma_reenable -- * -- * Description: -- * Call to re-enable RX DMA. -- * -- ****************************************************************************/ -- --#if defined(SERIAL_HAVE_DMA) && defined(CONFIG_SERIAL_IFLOWCONTROL) --static void up_dma_reenable(struct up_dev_s *priv) --{ -- /* Configure for non-circular DMA reception into the RX fifo */ -- -- stm32_dmasetup(priv->rxdma, -- priv->usartbase + STM32_USART_RDR_OFFSET, -- (uint32_t)priv->rxfifo, -- RXDMA_BUFFER_SIZE, -- SERIAL_DMA_IFLOW_CONTROL_WORD); -- -- /* Reset our DMA shadow pointer to match the address just -- * programmed above. -- */ -- -- priv->rxdmanext = 0; -- -- /* Start the DMA channel, and arrange for callbacks at the full point in -- * the FIFO. After buffer gets full, hardware flow-control kicks in and -- * DMA transfer is stopped. -- */ -- -- stm32_dmastart(priv->rxdma, up_dma_rxcallback, (void *)priv, false); --} --#endif -- --/**************************************************************************** - * Name: up_dma_rxint - * - * Description: -@@ -2466,15 +2379,6 @@ static void up_dma_rxint(struct uart_dev_s *dev, bool enable) - */ - - priv->rxenable = enable; -- --#ifdef CONFIG_SERIAL_IFLOWCONTROL -- if (priv->iflow && priv->rxenable && (priv->rxdmanext == RXDMA_BUFFER_SIZE)) -- { -- /* Re-enable RX DMA. */ -- -- up_dma_reenable(priv); -- } --#endif - } - #endif - -@@ -2510,14 +2414,10 @@ static bool up_dma_rxavailable(struct uart_dev_s *dev) - static void up_send(struct uart_dev_s *dev, int ch) - { - struct up_dev_s *priv = (struct up_dev_s *)dev->priv; -- - #ifdef HAVE_RS485 - if (priv->rs485_dir_gpio != 0) -- { -- stm32_gpiowrite(priv->rs485_dir_gpio, priv->rs485_dir_polarity); -- } -+ stm32_gpiowrite(priv->rs485_dir_gpio, priv->rs485_dir_polarity); - #endif -- - up_serialout(priv, STM32_USART_TDR_OFFSET, (uint32_t)ch); - } - -@@ -2683,16 +2583,6 @@ static void up_dma_rxcallback(DMA_HANDLE handle, uint8_t status, void *arg) - if (priv->rxenable && up_dma_rxavailable(&priv->dev)) - { - uart_recvchars(&priv->dev); -- --#ifdef CONFIG_SERIAL_IFLOWCONTROL -- if (priv->iflow && priv->rxenable && -- (priv->rxdmanext == RXDMA_BUFFER_SIZE)) -- { -- /* Re-enable RX DMA. */ -- -- up_dma_reenable(priv); -- } --#endif - } - } - #endif -@@ -2707,7 +2597,7 @@ static void up_dma_rxcallback(DMA_HANDLE handle, uint8_t status, void *arg) - * Input Parameters: - * - * cb - Returned to the driver. The driver version of the callback -- * structure may include additional, driver-specific state data at -+ * strucure may include additional, driver-specific state data at - * the end of the structure. - * - * pmstate - Identifies the new PM state -@@ -2773,7 +2663,7 @@ static void up_pm_notify(struct pm_callback_s *cb, int domain, - * Input Parameters: - * - * cb - Returned to the driver. The driver version of the callback -- * structure may include additional, driver-specific state data at -+ * strucure may include additional, driver-specific state data at - * the end of the structure. - * - * pmstate - Identifies the new PM state -@@ -2791,6 +2681,7 @@ static void up_pm_notify(struct pm_callback_s *cb, int domain, - * return non-zero values when reverting back to higher power - * consumption modes! - * -+ * - ****************************************************************************/ - - #ifdef CONFIG_PM diff --git a/nuttx-patches/00018-BACKPORT-stm32-serial-break.patch b/nuttx-patches/00018-BACKPORT-stm32-serial-break.patch deleted file mode 100644 index a3b2290104..0000000000 --- a/nuttx-patches/00018-BACKPORT-stm32-serial-break.patch +++ /dev/null @@ -1,18 +0,0 @@ -diff --git NuttX/nuttx/arch/arm/src/stm32/stm32_serial.c NuttX/nuttx/arch/arm/src/stm32/stm32_serial.c -index 644c810..10919e8 100644 ---- NuttX/nuttx/arch/arm/src/stm32/stm32_serial.c -+++ NuttX/nuttx/arch/arm/src/stm32/stm32_serial.c -@@ -1945,11 +1945,11 @@ static int up_interrupt_common(struct up_dev_s *priv) - static int up_ioctl(struct file *filep, int cmd, unsigned long arg) - { - #if defined(CONFIG_SERIAL_TERMIOS) || defined(CONFIG_SERIAL_TIOCSERGSTRUCT) \ -- || defined(CONFIG_STM32F7_SERIALBRK_BSDCOMPAT) -+ || defined(CONFIG_STM32_SERIALBRK_BSDCOMPAT) - struct inode *inode = filep->f_inode; - struct uart_dev_s *dev = inode->i_private; - #endif --#if defined(CONFIG_SERIAL_TERMIOS) || defined(CONFIG_STM32F7_SERIALBRK_BSDCOMPAT) -+#if defined(CONFIG_SERIAL_TERMIOS) || defined(CONFIG_STM32_SERIALBRK_BSDCOMPAT) - struct up_dev_s *priv = (struct up_dev_s *)dev->priv; - #endif - int ret = OK; diff --git a/nuttx-patches/CMakeLists.txt b/nuttx-patches/CMakeLists.txt index 55be7701b5..78dd845540 100644 --- a/nuttx-patches/CMakeLists.txt +++ b/nuttx-patches/CMakeLists.txt @@ -44,12 +44,10 @@ set(nuttx_patches 00010-BACKPORT-stm32-flash-F4-dcache-corruption-fix-no-HSI-on.patch 00011-BACKPORT-priority-restoration-fix.patch 00012-BACKPORT-stack-coloration-overreach-fix.patch -# 00013-BACKPORT-stm32-serial-dma-hotfix.patch 00014-BACKPORT-i2c-hotfix.patch 00015-BACKPORT-stm32f7-DTCM.patch 00016-BACKPORT-fix-CRTSCTS-defines.patch 00017-BACKPORT-cdcacm.patch -# 00018-BACKPORT-stm32-serial-break.patch 00019-BACKPORT-stm32-rcc-keep-HSI-on.patch 00021-BACKPORT-stm32f3x-add-BKP.patch 00022-BACKPORT-stm32-bkp-reference-fix.patch @@ -78,6 +76,6 @@ file(GLOB patches_found *.patch) foreach(patch_file ${patches_found}) list (FIND px4_nuttx_patches ${patch_file} _index) if (${_index} EQUAL -1) -# message(FATAL_ERROR "${patch_file} missing from nuttx-patches/CMakeLists.txt") + message(FATAL_ERROR "${patch_file} missing from nuttx-patches/CMakeLists.txt") endif() endforeach()