From 7a45fc6f1c95197e30344820588e2aeee7258efd Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Tue, 20 Nov 2018 08:08:28 -0600 Subject: [PATCH] arch/arm/src/max326xx: Add framework for MAX326XX standard DMA support. --- arch/arm/src/common/up_initialize.c | 6 +- arch/arm/src/common/up_internal.h | 2 +- arch/arm/src/efm32/efm32_dma.c | 4 +- arch/arm/src/imxrt/imxrt_edma.c | 4 +- arch/arm/src/kinetis/kinetis_dma.c | 2 +- arch/arm/src/lc823450/lc823450_dma.c | 4 +- arch/arm/src/lpc17xx/lpc17_gpdma.c | 4 +- arch/arm/src/lpc43xx/lpc43_gpdma.c | 4 +- arch/arm/src/lpc54xx/lpc54_dma.c | 4 +- arch/arm/src/max326xx/Kconfig | 10 +- arch/arm/src/max326xx/chip/max326_dma.h | 73 ++++-- arch/arm/src/max326xx/common/max326_icc.c | 1 + arch/arm/src/max326xx/max32660/max32660_dma.c | 210 ++++++++++++++++ arch/arm/src/max326xx/max32660/max32660_dma.h | 226 ++++++++++++++++++ arch/arm/src/max326xx/max326_dma.h | 51 ++++ arch/arm/src/sam34/sam_dmac.c | 4 +- arch/arm/src/sama5/sam_dmac.c | 4 +- arch/arm/src/sama5/sam_xdmac.c | 4 +- arch/arm/src/samd2l2/sam_dmac.c | 4 +- arch/arm/src/samd5e5/sam_dmac.c | 4 +- arch/arm/src/samv7/sam_xdmac.c | 4 +- arch/arm/src/stm32/stm32f10xxx_dma.c | 2 +- arch/arm/src/stm32/stm32f20xxx_dma.c | 2 +- arch/arm/src/stm32/stm32f33xxx_dma.c | 2 +- arch/arm/src/stm32/stm32f40xxx_dma.c | 2 +- arch/arm/src/stm32f7/stm32_dma.c | 2 +- arch/arm/src/stm32l4/stm32l4x6xx_dma.c | 2 +- arch/avr/src/common/up_initialize.c | 6 +- arch/avr/src/common/up_internal.h | 2 +- arch/hc/src/common/up_initialize.c | 6 +- arch/hc/src/common/up_internal.h | 2 +- arch/mips/src/common/up_initialize.c | 6 +- arch/mips/src/common/up_internal.h | 2 +- arch/or1k/src/common/up_initialize.c | 6 +- arch/or1k/src/common/up_internal.h | 2 +- arch/x86/src/common/up_initialize.c | 6 +- arch/x86/src/common/up_internal.h | 2 +- 37 files changed, 603 insertions(+), 78 deletions(-) create mode 100644 arch/arm/src/max326xx/max32660/max32660_dma.c create mode 100644 arch/arm/src/max326xx/max32660/max32660_dma.h create mode 100644 arch/arm/src/max326xx/max326_dma.h diff --git a/arch/arm/src/common/up_initialize.c b/arch/arm/src/common/up_initialize.c index eaf0b6b546..7e05865611 100644 --- a/arch/arm/src/common/up_initialize.c +++ b/arch/arm/src/common/up_initialize.c @@ -141,15 +141,15 @@ void up_initialize(void) #endif #ifdef CONFIG_ARCH_DMA - /* Initialize the DMA subsystem if the weak function up_dmainitialize has been + /* Initialize the DMA subsystem if the weak function up_dma_initialize has been * brought into the build */ #ifdef CONFIG_HAVE_WEAKFUNCTIONS - if (up_dmainitialize) + if (up_dma_initialize) #endif { - up_dmainitialize(); + up_dma_initialize(); } #endif diff --git a/arch/arm/src/common/up_internal.h b/arch/arm/src/common/up_internal.h index 341c0c7225..c6c807ebd2 100644 --- a/arch/arm/src/common/up_internal.h +++ b/arch/arm/src/common/up_internal.h @@ -476,7 +476,7 @@ void lowconsole_init(void); /* DMA **********************************************************************/ #ifdef CONFIG_ARCH_DMA -void weak_function up_dmainitialize(void); +void weak_function up_dma_initialize(void); #endif /* Cache control ************************************************************/ diff --git a/arch/arm/src/efm32/efm32_dma.c b/arch/arm/src/efm32/efm32_dma.c index f93497b4d3..7efc1d2021 100644 --- a/arch/arm/src/efm32/efm32_dma.c +++ b/arch/arm/src/efm32/efm32_dma.c @@ -255,7 +255,7 @@ static int efm32_dmac_interrupt(int irq, void *context, FAR void *arg) ****************************************************************************/ /**************************************************************************** - * Name: up_dmainitialize + * Name: up_dma_initialize * * Description: * Initialize the DMA subsystem @@ -265,7 +265,7 @@ static int efm32_dmac_interrupt(int irq, void *context, FAR void *arg) * ****************************************************************************/ -void weak_function up_dmainitialize(void) +void weak_function up_dma_initialize(void) { uint32_t regval; int i; diff --git a/arch/arm/src/imxrt/imxrt_edma.c b/arch/arm/src/imxrt/imxrt_edma.c index 42f783729e..bb8d5f7762 100644 --- a/arch/arm/src/imxrt/imxrt_edma.c +++ b/arch/arm/src/imxrt/imxrt_edma.c @@ -736,7 +736,7 @@ static int imxrt_error_interrupt(int irq, void *context, FAR void *arg) ****************************************************************************/ /**************************************************************************** - * Name: up_dmainitialize + * Name: up_dma_initialize * * Description: * Initialize the DMA subsystem @@ -746,7 +746,7 @@ static int imxrt_error_interrupt(int irq, void *context, FAR void *arg) * ****************************************************************************/ -void weak_function up_dmainitialize(void) +void weak_function up_dma_initialize(void) { uintptr_t regaddr; uint32_t regval; diff --git a/arch/arm/src/kinetis/kinetis_dma.c b/arch/arm/src/kinetis/kinetis_dma.c index 1f4c67762b..df7fc052cb 100644 --- a/arch/arm/src/kinetis/kinetis_dma.c +++ b/arch/arm/src/kinetis/kinetis_dma.c @@ -160,7 +160,7 @@ size_t kinetis_dmaresidual(DMA_HANDLE handle) * ****************************************************************************/ -void weak_function up_dmainitialize(void) +void weak_function up_dma_initialize(void) { int i; uint32_t regval; diff --git a/arch/arm/src/lc823450/lc823450_dma.c b/arch/arm/src/lc823450/lc823450_dma.c index 11e8100bae..9780264b08 100644 --- a/arch/arm/src/lc823450/lc823450_dma.c +++ b/arch/arm/src/lc823450/lc823450_dma.c @@ -339,10 +339,10 @@ void lc823450_dma_test() ****************************************************************************/ /**************************************************************************** - * Name: up_dmainitialize + * Name: up_dma_initialize ****************************************************************************/ -void up_dmainitialize(void) +void up_dma_initialize(void) { int i; diff --git a/arch/arm/src/lpc17xx/lpc17_gpdma.c b/arch/arm/src/lpc17xx/lpc17_gpdma.c index a9ae944319..19b828edc0 100644 --- a/arch/arm/src/lpc17xx/lpc17_gpdma.c +++ b/arch/arm/src/lpc17xx/lpc17_gpdma.c @@ -269,7 +269,7 @@ static int gpdma_interrupt(int irq, FAR void *context, FAR void *arg) ****************************************************************************/ /**************************************************************************** - * Name: up_dmainitialize + * Name: up_dma_initialize * * Description: * Initialize the GPDMA subsystem. Called from up_initialize() early in the @@ -280,7 +280,7 @@ static int gpdma_interrupt(int irq, FAR void *context, FAR void *arg) * ****************************************************************************/ -void weak_function up_dmainitialize(void) +void weak_function up_dma_initialize(void) { uint32_t regval; int ret; diff --git a/arch/arm/src/lpc43xx/lpc43_gpdma.c b/arch/arm/src/lpc43xx/lpc43_gpdma.c index 4e7c6773e4..0e4668e96c 100644 --- a/arch/arm/src/lpc43xx/lpc43_gpdma.c +++ b/arch/arm/src/lpc43xx/lpc43_gpdma.c @@ -269,7 +269,7 @@ static int gpdma_interrupt(int irq, FAR void *context, FAR void *arg) ****************************************************************************/ /**************************************************************************** - * Name: up_dmainitialize + * Name: up_dma_initialize * * Description: * Initialize the GPDMA subsystem. Called from up_initialize() early in the @@ -280,7 +280,7 @@ static int gpdma_interrupt(int irq, FAR void *context, FAR void *arg) * ****************************************************************************/ -void weak_function up_dmainitialize(void) +void weak_function up_dma_initialize(void) { uint32_t regval; int ret; diff --git a/arch/arm/src/lpc54xx/lpc54_dma.c b/arch/arm/src/lpc54xx/lpc54_dma.c index 9a7e93e746..b21afdf436 100644 --- a/arch/arm/src/lpc54xx/lpc54_dma.c +++ b/arch/arm/src/lpc54xx/lpc54_dma.c @@ -217,7 +217,7 @@ static int lpc54_dma_interrupt(int irq, FAR void *context, FAR void *arg) ****************************************************************************/ /**************************************************************************** - * Name: up_dmainitialize + * Name: up_dma_initialize * * Description: * Initialize the DMA subsystem. Called from up_initialize() early in the @@ -228,7 +228,7 @@ static int lpc54_dma_interrupt(int irq, FAR void *context, FAR void *arg) * ****************************************************************************/ -void weak_function up_dmainitialize(void) +void weak_function up_dma_initialize(void) { int ret; diff --git a/arch/arm/src/max326xx/Kconfig b/arch/arm/src/max326xx/Kconfig index fe18da8f58..d920bb5ca6 100644 --- a/arch/arm/src/max326xx/Kconfig +++ b/arch/arm/src/max326xx/Kconfig @@ -97,6 +97,7 @@ config ARCH_FAMILY_MAX32660 bool default n select ARCH_CORTEXM4 + select MAX326XX_HAVE_DMA select MAX326XX_HAVE_I2CS1 select MAX326XX_HAVE_SPIS1 select MAX326XX_HAVE_WDOG @@ -104,6 +105,10 @@ config ARCH_FAMILY_MAX32660 # Chip-Specific Peripheral support +config MAX326XX_HAVE_AES + bool + default n + config MAX326XX_HAVE_WDOG bool default n @@ -128,7 +133,7 @@ config MAX326XX_HAVE_CRC bool default n -config MAX326XX_HAVE_AES +config MAX326XX_HAVE_DMA bool default n @@ -404,8 +409,9 @@ config MAX326XX_ICC select ARMV7M_HAVE_ICACHE config MAX326XX_DMA - bool "DMA" + bool "Standard DMA" default n + depends on MAX326XX_HAVE_DMA config MAX326_GPIOIRQ bool "GPIO Interrupt Support" diff --git a/arch/arm/src/max326xx/chip/max326_dma.h b/arch/arm/src/max326xx/chip/max326_dma.h index c1978e0df7..2cf6655b87 100644 --- a/arch/arm/src/max326xx/chip/max326_dma.h +++ b/arch/arm/src/max326xx/chip/max326_dma.h @@ -47,13 +47,40 @@ * Pre-processor Definitions ************************************************************************************/ -/* Register Offsets *****************************************************************/ +/* DMA Channels */ -#define MAX326_DMA_CHAN0 0 /* DMA Channel 0 */ -#define MAX326_DMA_CHAN1 1 /* DMA Channel 1 */ -#define MAX326_DMA_CHAN2 2 /* DMA Channel 2 */ -#define MAX326_DMA_CHAN3 3 /* DMA Channel 3 */ -#define MAX326_DMA_NCHAN 4 /* Four DMA Channels */ +#define MAX326_DMA_CHAN0 0 /* DMA Channel 0 */ +#define MAX326_DMA_CHAN1 1 /* DMA Channel 1 */ +#define MAX326_DMA_CHAN2 2 /* DMA Channel 2 */ +#define MAX326_DMA_CHAN3 3 /* DMA Channel 3 */ +#define MAX326_DMA_NCHAN 4 /* Four DMA Channels */ + +/* DMA priorities */ + +#define MAX326_DMAPRIO_LO 3 /* Lowest priority */ +#define MAX326_DMAPRIO_MEDLO 2 +#define MAX326_DMAPRIO_MEDHI 1 +#define MAX326_DMAPRIO_HI 0 /* Highest priority */ + +/* DMA Prescaler */ + +#define MAX326_DMA_PS_DISABLE 0 /* Disable timer */ +#define MAX326_DMA_PS_DIV256 1 /* fhclk / 256 */ +#define MAX326_DMA_PS_DIV64K 2 /* fhclk / 64K */ +#define MAX326_DMA_PS_DIV16M 3 /* fhclk / 16M */ + +/* DMA Timeouts */ + +#define MAX326_DMATO_3to4 0 /* 3-4 prescaler clocks */ +#define MAX326_DMATO_7to8 1 /* 7-8 prescaler clocks */ +#define MAX326_DMATO_15to16 2 /* 15-16 prescaler clocks */ +#define MAX326_DMATO_31to82 3 /* 31-32 prescaler clocks */ +#define MAX326_DMATO_63to64 4 /* 63-64 prescaler clocks */ +#define MAX326_DMATO_127to128 5 /* 127-128 prescaler clocks */ +#define MAX326_DMATO_255to256 6 /* 255-256 prescaler clocks */ +#define MAX326_DMATO_511to512 7 /* 511-512 prescaler clocks */ + +/* Register Offsets *****************************************************************/ /* DMA Control Registers */ @@ -118,26 +145,30 @@ #define DMACH_CFG_CHEN (1 << 0) /* Bit nn: Channel Enable */ #define DMACH_CFG_RLDEN (1 << 1) /* Bit nn: Reload Enable */ #define DMACH_CFG_PRI_SHIFT (2) /* Bits 2-3: DMA priority */ -#define DMACH_CFG_PRI_MASK (xx << DMACH_CFG_PRI_SHIFT) +#define DMACH_CFG_PRI_MASK (3 << DMACH_CFG_PRI_SHIFT) +# define DMACH_CFG_PRI(n) ((uint32_t)(n) << DMACH_CFG_PRI_SHIFT) +# define DMACH_CFG_PRI_LO (3 << DMACH_CFG_PRI_SHIFT) +# define DMACH_CFG_PRI_MEDLO (2 << DMACH_CFG_PRI_SHIFT) +# define DMACH_CFG_PRI_MEDHI (1 << DMACH_CFG_PRI_SHIFT) +# define DMACH_CFG_PRI_HI (0 << DMACH_CFG_PRI_SHIFT) #define DMACH_CFG_REQSEL_SHIFT (4) /* Bits 4-9: Request Select */ #define DMACH_CFG_REQSEL_MASK (0x3f << DMACH_CFG_REQSEL_SHIFT) -# define DMACH_CFG_REQSEL_LO (3 << DMACH_CFG_REQSEL_SHIFT) -# define DMACH_CFG_REQSEL_MEDLO (2 << DMACH_CFG_REQSEL_SHIFT) -# define DMACH_CFG_REQSEL_MEDHI (1 << DMACH_CFG_REQSEL_SHIFT) -# define DMACH_CFG_REQSEL_HI (0 << DMACH_CFG_REQSEL_SHIFT) +# define DMACH_CFG_REQSEL(n) ((uint32_t)(n) << DMACH_CFG_REQSEL_SHIFT) #define DMACH_CFG_REQWAIT (1 << 10) /* Bit 10: Request Wait Enable */ #define DMACH_CFG_TOSEL_SHIFT (11) /* Bits 11-13: Time-Out Select */ #define DMACH_CFG_TOSEL_MASK (7 << DMACH_CFG_TOSEL_SHIFT) -# define DMACH_CFG_TOSEL_ 3to4 (0 << DMACH_CFG_TOSEL_SHIFT) /* 3-4 */ -# define DMACH_CFG_TOSEL_ 7to8 (1 << DMACH_CFG_TOSEL_SHIFT) /* 7-8 */ -# define DMACH_CFG_TOSEL_ 15to16 (2 << DMACH_CFG_TOSEL_SHIFT) /* 15-16 */ -# define DMACH_CFG_TOSEL_ 31to82 (3 << DMACH_CFG_TOSEL_SHIFT) /* 31-32 */ -# define DMACH_CFG_TOSEL_ 63to64 (4 << DMACH_CFG_TOSEL_SHIFT) /* 63-64 */ -# define DMACH_CFG_TOSEL_ 127to128 (5 << DMACH_CFG_TOSEL_SHIFT) /* 127-128 */ -# define DMACH_CFG_TOSEL_ 255to256 (6 << DMACH_CFG_TOSEL_SHIFT) /* 255-256 */ -# define DMACH_CFG_TOSEL_ 511to512 (7 << DMACH_CFG_TOSEL_SHIFT) /* 511-512 */ +# define DMACH_CFG_TOSEL(n) ((uint32_t)(n) << DMACH_CFG_TOSEL_SHIFT) +# define DMACH_CFG_TOSEL_3to4 (0 << DMACH_CFG_TOSEL_SHIFT) /* 3-4 */ +# define DMACH_CFG_TOSEL_7to8 (1 << DMACH_CFG_TOSEL_SHIFT) /* 7-8 */ +# define DMACH_CFG_TOSEL_15to16 (2 << DMACH_CFG_TOSEL_SHIFT) /* 15-16 */ +# define DMACH_CFG_TOSEL_31to82 (3 << DMACH_CFG_TOSEL_SHIFT) /* 31-32 */ +# define DMACH_CFG_TOSEL_63to64 (4 << DMACH_CFG_TOSEL_SHIFT) /* 63-64 */ +# define DMACH_CFG_TOSEL_127to128 (5 << DMACH_CFG_TOSEL_SHIFT) /* 127-128 */ +# define DMACH_CFG_TOSEL_255to256 (6 << DMACH_CFG_TOSEL_SHIFT) /* 255-256 */ +# define DMACH_CFG_TOSEL_511to512 (7 << DMACH_CFG_TOSEL_SHIFT) /* 511-512 */ #define DMACH_CFG_PSSEL_SHIFT (14) /* Bits 14-15: Pre-Scale Select */ #define DMACH_CFG_PSSEL_MASK (3 << DMACH_CFG_PSSEL_SHIFT) +# define DMACH_CFG_PSSEL(n) ((uint32_t)(n) << DMACH_CFG_PSSEL_SHIFT) # define DMACH_CFG_PSSEL_DISABLE (0 << DMACH_CFG_PSSEL_SHIFT) /* Disable timer */ # define DMACH_CFG_PSSEL_DIV256 (1 << DMACH_CFG_PSSEL_SHIFT) /* fhclk / 256 */ # define DMACH_CFG_PSSEL_DIV64K (2 << DMACH_CFG_PSSEL_SHIFT) /* fhclk / 64K */ @@ -146,14 +177,14 @@ # define DMACH_CFG_SRCWD_1BYTE (0 << DMACH_CFG_SRCWD_SHIFT) # define DMACH_CFG_SRCWD_2BYTES (1 << DMACH_CFG_SRCWD_SHIFT) # define DMACH_CFG_SRCWD_4BYTES (2 << DMACH_CFG_SRCWD_SHIFT) -#define DMACH_CFG_SRINC (1 << 18) /* Bit 18: Source Increment +#define DMACH_CFG_SRCINC (1 << 18) /* Bit 18: Source Increment * Enable */ #define DMACH_CFG_DSTWD_SHIFT (20) /* Bits 20-21: Destination Width */ #define DMACH_CFG_DSTWD_MASK (3 << DMACH_CFG_DSTWD_SHIFT) # define DMACH_CFG_DSTWD_1BYTE (0 << DMACH_CFG_DSTWD_SHIFT) # define DMACH_CFG_DSTWD_2BYTES (1 << DMACH_CFG_DSTWD_SHIFT) # define DMACH_CFG_DSTWD_4BYTES (2 << DMACH_CFG_DSTWD_SHIFT) -#define DMACH_CFG_DISTINC (1 << 22) /* Bit 22: Destination Increment +#define DMACH_CFG_DSTINC (1 << 22) /* Bit 22: Destination Increment * Enable */ #define DMACH_CFG_BRST_SHIFT (24) /* Bits 24-28: Burst Size */ #define DMACH_CFG_BRST_MASK (31 << DMACH_CFG_BRST_SHIFT) diff --git a/arch/arm/src/max326xx/common/max326_icc.c b/arch/arm/src/max326xx/common/max326_icc.c index 64f3ad362f..84f2309c10 100644 --- a/arch/arm/src/max326xx/common/max326_icc.c +++ b/arch/arm/src/max326xx/common/max326_icc.c @@ -43,6 +43,7 @@ #include #include "up_arch.h" +#include "chip/max326_icc.h" #include "max326_periphclks.h" #include "max326_icc.h" diff --git a/arch/arm/src/max326xx/max32660/max32660_dma.c b/arch/arm/src/max326xx/max32660/max32660_dma.c new file mode 100644 index 0000000000..13da79a3e0 --- /dev/null +++ b/arch/arm/src/max326xx/max32660/max32660_dma.c @@ -0,0 +1,210 @@ +/**************************************************************************** + * arch/arm/src/max32660/max326_dma.c + * + * Copyright (C) 2018 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * 3. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include + +#include + +#include "up_arch.h" + +#include "max326_dma.h" + +#ifdef CONFIG_MAX326_DMA + +/**************************************************************************** + * Private Types + ****************************************************************************/ + + +/**************************************************************************** + * Private Data + ****************************************************************************/ + + +/**************************************************************************** + * Private Functions + ****************************************************************************/ + + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: stm32_dmainitialize + * + * Description: + * Initialize the DMA subsystem + * + * Returned Value: + * None + * + ****************************************************************************/ + +void weak_function up_dma_initialize(void) +{ +} + +/**************************************************************************** + * Name: max326_dma_channel + * + * Description: + * Allocate a DMA channel. + * + * Returned Value: + * If a DMA channel is available, this function returns a non-NULL, void* + * DMA channel handle. NULL is returned on any failure. + * + ****************************************************************************/ + +DMA_HANDLE max326_dma_channel(void) +{ +} + +/**************************************************************************** + * Name: max326_dma_free + * + * Description: + * Release a DMA channel. NOTE: The 'handle' used in this argument must + * NEVER be used again until max326_dma_channel() is called again to re-gain + * a valid handle. + * + * Returned Value: + * None + * + ****************************************************************************/ + +void max326_dma_free(DMA_HANDLE handle) +{ +} + +/**************************************************************************** + * Name: max326_dma_setup + * + * Description: + * Configure DMA for one transfer. + * + * NOTE that an image of the DMA CFG is a required input. Only the + * following fields need be provided however. The DMA logic will handle + * the rest. + * + ****************************************************************************/ + +int max326_dma_setup(DMA_HANDLE handle, uint32_t cfg, uint32_t saddr, + uint32_t daddr, size_t nbytes) +{ +} + +/**************************************************************************** + * Name: max326_dma_setup + * + * Description: + * Append one buffer to the DMA chain. max326_dma_setup() should have + * been called to set up the first buffer. This function may be called + * to chain the DMA to a second buffer. This is done by setting the + * source, destination, and count reload registers. + * + * REVISIT: Currently, the implementation is limited to a single + * appended buffer in the chain. + * + ****************************************************************************/ + +int max326_dma_setup(DMA_HANDLE handle, uint32_t saddr, uint32_t daddr, + size_t nbytes) +{ +} + +/**************************************************************************** + * Name: max326_dmastart + * + * Description: + * Start the DMA transfer + * + ****************************************************************************/ + +int max326_dmastart(DMA_HANDLE handle, dma_callback_t callback, void *arg) +{ +} + +/**************************************************************************** + * Name: max326_dmastop + * + * Description: + * Cancel the DMA. After max326_dmastop() is called, the DMA channel is + * reset and max326_dma_setup() must be called before max326_dmastart() can + * be called again + * + ****************************************************************************/ + +void max326_dmastop(DMA_HANDLE handle) +{ +} + +/**************************************************************************** + * Name: max326_dmasample + * + * Description: + * Sample DMA register contents + * + ****************************************************************************/ + +#ifdef CONFIG_DEBUG_DMA_INFO +void max326_dmasample(DMA_HANDLE handle, struct max326_dmaregs_s *regs) +{ +} +#endif + +/**************************************************************************** + * Name: max326_dmadump + * + * Description: + * Dump previously sampled DMA register contents + * + ****************************************************************************/ + +#ifdef CONFIG_DEBUG_DMA_INFO +void max326_dmadump(DMA_HANDLE handle, const struct max326_dmaregs_s *regs, + const char *msg) +{ +} +#endif + +#endif /* CONFIG_MAX326_DMA */ diff --git a/arch/arm/src/max326xx/max32660/max32660_dma.h b/arch/arm/src/max326xx/max32660/max32660_dma.h new file mode 100644 index 0000000000..1bfa36648d --- /dev/null +++ b/arch/arm/src/max326xx/max32660/max32660_dma.h @@ -0,0 +1,226 @@ +/**************************************************************************** + * arch/arm/src/max326xx/max32660_dma.h + * + * Copyright (C) 2018 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * 3. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + ****************************************************************************/ + +#ifndef __ARCH_ARM_SRC_MAX436XX_MAX32660_MAX32660_DMA_H +#define __ARCH_ARM_SRC_MAX436XX_MAX32660_MAX32660_DMA_H + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include + +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * Public Types + ****************************************************************************/ + +/* DMA channel handle and DMA completion callback function */ + +typedef FAR void *DMA_HANDLE; +typedef void (*dma_callback_t)(DMA_HANDLE handle, void *arg, int result); + +/* The following is used for sampling DMA registers when CONFIG DEBUG_DMA is + * selected + */ + +#ifdef CONFIG_DEBUG_DMA_INFO +struct max326_dmaregs_s +{ + /* Global Registers */ + + uint32_t inten; /* DMA Control register */ + uint32_t intfl; /* DMA Interrupt Status register */ + + /* Channel Registers */ + + uint32_t cfg; /* DMA Channel Configuration Register */ + uint32_t stat; /* DMA Channel Status Register */ + uint32_t src; /* DMA Channel Source Register */ + uint32_t dst; /* DMA Channel Destination Register */ + uint32_t cnt; /* DMA Channel Count Register */ + uint32_t srcrld; /* DMA Channel Source Reload Register */ + uint32_t dstrld; /* DMA Channel Destination Reload Register */ + uint32_t cntrld; /* DMA Channel Count Reload Register */ +}; +#endif + +/**************************************************************************** + * Inline Functions + ****************************************************************************/ + +#ifndef __ASSEMBLY__ + +/**************************************************************************** + * Public Data + ****************************************************************************/ + +#undef EXTERN +#if defined(__cplusplus) +#define EXTERN extern "C" +extern "C" +{ +#else +#define EXTERN extern +#endif + +/**************************************************************************** + * Public Function Prototypes + ****************************************************************************/ + +/**************************************************************************** + * Name: max326_dma_channel + * + * Description: + * Allocate a DMA channel. + * + * Returned Value: + * If a DMA channel is available, this function returns a non-NULL, void* + * DMA channel handle. NULL is returned on any failure. + * + ****************************************************************************/ + +DMA_HANDLE max326_dma_channel(void); + +/**************************************************************************** + * Name: max326_dma_free + * + * Description: + * Release a DMA channel. NOTE: The 'handle' used in this argument must + * NEVER be used again until max326_dma_channel() is called again to re-gain + * a valid handle. + * + * Returned Value: + * None + * + ****************************************************************************/ + +void max326_dma_free(DMA_HANDLE handle); + +/**************************************************************************** + * Name: max326_dma_setup + * + * Description: + * Configure DMA for one transfer. + * + * NOTE that an image of the DMA CFG is a required input. Only the + * following fields need be provided however. The DMA logic will handle + * the rest. + * + ****************************************************************************/ + +int max326_dma_setup(DMA_HANDLE handle, uint32_t cfg, uint32_t saddr, + uint32_t daddr, size_t nbytes); + +/**************************************************************************** + * Name: max326_dma_setup + * + * Description: + * Append one buffer to the DMA chain. max326_dma_setup() should have + * been called to set up the first buffer. This function may be called + * to chain the DMA to a second buffer. This is done by setting the + * source, destination, and count reload registers. + * + * REVISIT: Currently, the implementation is limited to a single + * appended buffer in the chain. + * + ****************************************************************************/ + +int max326_dma_setup(DMA_HANDLE handle, uint32_t saddr, uint32_t daddr, + size_t nbytes); + +/**************************************************************************** + * Name: max326_dmastart + * + * Description: + * Start the DMA transfer + * + ****************************************************************************/ + +int max326_dmastart(DMA_HANDLE handle, dma_callback_t callback, void *arg); + +/**************************************************************************** + * Name: max326_dmastop + * + * Description: + * Cancel the DMA. After max326_dmastop() is called, the DMA channel is + * reset and max326_dma_setup() must be called before max326_dmastart() can + * be called again + * + ****************************************************************************/ + +void max326_dmastop(DMA_HANDLE handle); + +/**************************************************************************** + * Name: max326_dmasample + * + * Description: + * Sample DMA register contents + * + ****************************************************************************/ + +#ifdef CONFIG_DEBUG_DMA_INFO +void max326_dmasample(DMA_HANDLE handle, struct max326_dmaregs_s *regs); +#else +# define max326_dmasample(handle,regs) +#endif + +/**************************************************************************** + * Name: max326_dmadump + * + * Description: + * Dump previously sampled DMA register contents + * + ****************************************************************************/ + +#ifdef CONFIG_DEBUG_DMA_INFO +void max326_dmadump(DMA_HANDLE handle, const struct max326_dmaregs_s *regs, + const char *msg); +#else +# define max326_dmadump(handle,regs,msg) +#endif + +#undef EXTERN +#if defined(__cplusplus) +} +#endif + +#endif /* __ASSEMBLY__ */ +#endif /* __ARCH_ARM_SRC_MAX436XX_MAX32660_MAX32660_DMA_H */ diff --git a/arch/arm/src/max326xx/max326_dma.h b/arch/arm/src/max326xx/max326_dma.h new file mode 100644 index 0000000000..911611980a --- /dev/null +++ b/arch/arm/src/max326xx/max326_dma.h @@ -0,0 +1,51 @@ +/**************************************************************************** + * arch/arm/src/max326xx/max326_dma.h + * + * Copyright (C) 2018 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * 3. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + ****************************************************************************/ + +#ifndef __ARCH_ARM_SRC_MAX436XX_MAX326_DMA_H +#define __ARCH_ARM_SRC_MAX436XX_MAX326_DMA_H + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +/* Standard DMA is only available for the MAX32660 */ + +#ifdef (CONFIG_ARCH_FAMILY_MAX32660) +# include "max32660/max32660_dma.h" +#ednif + +#endif /* __ARCH_ARM_SRC_MAX436XX_MAX326_DMA_H */ diff --git a/arch/arm/src/sam34/sam_dmac.c b/arch/arm/src/sam34/sam_dmac.c index 074e58d2f7..75f0480839 100644 --- a/arch/arm/src/sam34/sam_dmac.c +++ b/arch/arm/src/sam34/sam_dmac.c @@ -1353,7 +1353,7 @@ static int sam_dmainterrupt(int irq, void *context, FAR void *arg) ****************************************************************************/ /**************************************************************************** - * Name: up_dmainitialize + * Name: up_dma_initialize * * Description: * Initialize the DMA subsystem @@ -1363,7 +1363,7 @@ static int sam_dmainterrupt(int irq, void *context, FAR void *arg) * ****************************************************************************/ -void weak_function up_dmainitialize(void) +void weak_function up_dma_initialize(void) { dmainfo("Initialize DMAC0\n"); diff --git a/arch/arm/src/sama5/sam_dmac.c b/arch/arm/src/sama5/sam_dmac.c index 9df12bdd03..0690fea8bd 100644 --- a/arch/arm/src/sama5/sam_dmac.c +++ b/arch/arm/src/sama5/sam_dmac.c @@ -1898,7 +1898,7 @@ void sam_dmainitialize(struct sam_dmac_s *dmac) ****************************************************************************/ /**************************************************************************** - * Name: up_dmainitialize + * Name: up_dma_initialize * * Description: * Initialize the DMA subsystem @@ -1908,7 +1908,7 @@ void sam_dmainitialize(struct sam_dmac_s *dmac) * ****************************************************************************/ -void weak_function up_dmainitialize(void) +void weak_function up_dma_initialize(void) { #ifdef CONFIG_SAMA5_DMAC0 dmainfo("Initialize DMAC0\n"); diff --git a/arch/arm/src/sama5/sam_xdmac.c b/arch/arm/src/sama5/sam_xdmac.c index 11b38fbd03..881c7a39e8 100644 --- a/arch/arm/src/sama5/sam_xdmac.c +++ b/arch/arm/src/sama5/sam_xdmac.c @@ -1925,7 +1925,7 @@ void sam_dmainitialize(struct sam_xdmac_s *xdmac) ****************************************************************************/ /**************************************************************************** - * Name: up_dmainitialize + * Name: up_dma_initialize * * Description: * Initialize the DMA subsystem @@ -1935,7 +1935,7 @@ void sam_dmainitialize(struct sam_xdmac_s *xdmac) * ****************************************************************************/ -void weak_function up_dmainitialize(void) +void weak_function up_dma_initialize(void) { #ifdef CONFIG_SAMA5_XDMAC0 dmainfo("Initialize XDMAC0\n"); diff --git a/arch/arm/src/samd2l2/sam_dmac.c b/arch/arm/src/samd2l2/sam_dmac.c index 61c8eaf8df..831da156cd 100644 --- a/arch/arm/src/samd2l2/sam_dmac.c +++ b/arch/arm/src/samd2l2/sam_dmac.c @@ -790,7 +790,7 @@ static int sam_rxbuffer(struct sam_dmach_s *dmach, uint32_t paddr, ****************************************************************************/ /**************************************************************************** - * Name: up_dmainitialize + * Name: up_dma_initialize * * Description: * Initialize the DMA subsystem @@ -800,7 +800,7 @@ static int sam_rxbuffer(struct sam_dmach_s *dmach, uint32_t paddr, * ****************************************************************************/ -void weak_function up_dmainitialize(void) +void weak_function up_dma_initialize(void) { dmainfo("Initialize DMAC\n"); int i; diff --git a/arch/arm/src/samd5e5/sam_dmac.c b/arch/arm/src/samd5e5/sam_dmac.c index 16d534a3fe..67822a4cef 100644 --- a/arch/arm/src/samd5e5/sam_dmac.c +++ b/arch/arm/src/samd5e5/sam_dmac.c @@ -760,7 +760,7 @@ static int sam_rxbuffer(struct sam_dmach_s *dmach, uint32_t paddr, ****************************************************************************/ /**************************************************************************** - * Name: up_dmainitialize + * Name: up_dma_initialize * * Description: * Initialize the DMA subsystem @@ -770,7 +770,7 @@ static int sam_rxbuffer(struct sam_dmach_s *dmach, uint32_t paddr, * ****************************************************************************/ -void weak_function up_dmainitialize(void) +void weak_function up_dma_initialize(void) { dmainfo("Initialize DMAC\n"); int i; diff --git a/arch/arm/src/samv7/sam_xdmac.c b/arch/arm/src/samv7/sam_xdmac.c index 1b2675d40b..0459b1e494 100644 --- a/arch/arm/src/samv7/sam_xdmac.c +++ b/arch/arm/src/samv7/sam_xdmac.c @@ -1611,7 +1611,7 @@ void sam_dmainitialize(struct sam_xdmac_s *xdmac) ****************************************************************************/ /**************************************************************************** - * Name: up_dmainitialize + * Name: up_dma_initialize * * Description: * Initialize the DMA subsystem @@ -1621,7 +1621,7 @@ void sam_dmainitialize(struct sam_xdmac_s *xdmac) * ****************************************************************************/ -void weak_function up_dmainitialize(void) +void weak_function up_dma_initialize(void) { dmainfo("Initialize XDMAC\n"); diff --git a/arch/arm/src/stm32/stm32f10xxx_dma.c b/arch/arm/src/stm32/stm32f10xxx_dma.c index e080fdd2b8..dcc97fbbfb 100644 --- a/arch/arm/src/stm32/stm32f10xxx_dma.c +++ b/arch/arm/src/stm32/stm32f10xxx_dma.c @@ -343,7 +343,7 @@ static int stm32_dmainterrupt(int irq, void *context, FAR void *arg) * ****************************************************************************/ -void weak_function up_dmainitialize(void) +void weak_function up_dma_initialize(void) { struct stm32_dma_s *dmach; int chndx; diff --git a/arch/arm/src/stm32/stm32f20xxx_dma.c b/arch/arm/src/stm32/stm32f20xxx_dma.c index 5f7fb72f51..b987a7888f 100644 --- a/arch/arm/src/stm32/stm32f20xxx_dma.c +++ b/arch/arm/src/stm32/stm32f20xxx_dma.c @@ -473,7 +473,7 @@ static int stm32_dmainterrupt(int irq, void *context, FAR void *arg) * ****************************************************************************/ -void weak_function up_dmainitialize(void) +void weak_function up_dma_initialize(void) { struct stm32_dma_s *dmast; int stream; diff --git a/arch/arm/src/stm32/stm32f33xxx_dma.c b/arch/arm/src/stm32/stm32f33xxx_dma.c index 81cee7b23b..4b6379981d 100644 --- a/arch/arm/src/stm32/stm32f33xxx_dma.c +++ b/arch/arm/src/stm32/stm32f33xxx_dma.c @@ -291,7 +291,7 @@ static int stm32_dmainterrupt(int irq, void *context, FAR void *arg) * ****************************************************************************/ -void weak_function up_dmainitialize(void) +void weak_function up_dma_initialize(void) { struct stm32_dma_s *dmach; int chndx; diff --git a/arch/arm/src/stm32/stm32f40xxx_dma.c b/arch/arm/src/stm32/stm32f40xxx_dma.c index 608204d92d..b2212835f2 100644 --- a/arch/arm/src/stm32/stm32f40xxx_dma.c +++ b/arch/arm/src/stm32/stm32f40xxx_dma.c @@ -472,7 +472,7 @@ static int stm32_dmainterrupt(int irq, void *context, void *arg) * ****************************************************************************/ -void weak_function up_dmainitialize(void) +void weak_function up_dma_initialize(void) { struct stm32_dma_s *dmast; int stream; diff --git a/arch/arm/src/stm32f7/stm32_dma.c b/arch/arm/src/stm32f7/stm32_dma.c index eb0fab35ca..b83e81ea20 100644 --- a/arch/arm/src/stm32f7/stm32_dma.c +++ b/arch/arm/src/stm32f7/stm32_dma.c @@ -475,7 +475,7 @@ static int stm32_dmainterrupt(int irq, void *context, FAR void *arg) * ****************************************************************************/ -void weak_function up_dmainitialize(void) +void weak_function up_dma_initialize(void) { struct stm32_dma_s *dmast; int stream; diff --git a/arch/arm/src/stm32l4/stm32l4x6xx_dma.c b/arch/arm/src/stm32l4/stm32l4x6xx_dma.c index 0d4dec4498..f60a619df0 100644 --- a/arch/arm/src/stm32l4/stm32l4x6xx_dma.c +++ b/arch/arm/src/stm32l4/stm32l4x6xx_dma.c @@ -342,7 +342,7 @@ static int stm32l4_dmainterrupt(int irq, void *context, FAR void *arg) * ****************************************************************************/ -void weak_function up_dmainitialize(void) +void weak_function up_dma_initialize(void) { struct stm32l4_dma_s *dmach; int chndx; diff --git a/arch/avr/src/common/up_initialize.c b/arch/avr/src/common/up_initialize.c index 9317376fc4..e9918cac8e 100644 --- a/arch/avr/src/common/up_initialize.c +++ b/arch/avr/src/common/up_initialize.c @@ -183,15 +183,15 @@ void up_initialize(void) #endif #ifdef CONFIG_ARCH_DMA - /* Initialize the DMA subsystem if the weak function up_dmainitialize has been + /* Initialize the DMA subsystem if the weak function up_dma_initialize has been * brought into the build */ #ifdef CONFIG_HAVE_WEAKFUNCTIONS - if (up_dmainitialize) + if (up_dma_initialize) #endif { - up_dmainitialize(); + up_dma_initialize(); } #endif diff --git a/arch/avr/src/common/up_internal.h b/arch/avr/src/common/up_internal.h index 9d7c3011c1..9cf4c304db 100644 --- a/arch/avr/src/common/up_internal.h +++ b/arch/avr/src/common/up_internal.h @@ -125,7 +125,7 @@ extern uint32_t _ebss; /* End+1 of .bss */ void up_irqinitialize(void); #ifdef CONFIG_ARCH_DMA -void weak_function up_dmainitialize(void); +void weak_function up_dma_initialize(void); #endif void up_sigdeliver(void); void up_lowputc(char ch); diff --git a/arch/hc/src/common/up_initialize.c b/arch/hc/src/common/up_initialize.c index babaad95c4..b58aec2f44 100644 --- a/arch/hc/src/common/up_initialize.c +++ b/arch/hc/src/common/up_initialize.c @@ -105,15 +105,15 @@ void up_initialize(void) #endif #ifdef CONFIG_ARCH_DMA - /* Initialize the DMA subsystem if the weak function up_dmainitialize has been + /* Initialize the DMA subsystem if the weak function up_dma_initialize has been * brought into the build */ #ifdef CONFIG_HAVE_WEAKFUNCTIONS - if (up_dmainitialize) + if (up_dma_initialize) #endif { - up_dmainitialize(); + up_dma_initialize(); } #endif diff --git a/arch/hc/src/common/up_internal.h b/arch/hc/src/common/up_internal.h index d090df849c..c9e22e837f 100644 --- a/arch/hc/src/common/up_internal.h +++ b/arch/hc/src/common/up_internal.h @@ -192,7 +192,7 @@ void up_addregion(void); /* Sub-system/driver initialization */ #ifdef CONFIG_ARCH_DMA -void weak_function up_dmainitialize(void); +void weak_function up_dma_initialize(void); #endif void up_wdtinit(void); diff --git a/arch/mips/src/common/up_initialize.c b/arch/mips/src/common/up_initialize.c index 31306bb51b..e7fade040f 100644 --- a/arch/mips/src/common/up_initialize.c +++ b/arch/mips/src/common/up_initialize.c @@ -107,15 +107,15 @@ void up_initialize(void) #endif #ifdef CONFIG_ARCH_DMA - /* Initialize the DMA subsystem if the weak function up_dmainitialize has been + /* Initialize the DMA subsystem if the weak function up_dma_initialize has been * brought into the build */ #ifdef CONFIG_HAVE_WEAKFUNCTIONS - if (up_dmainitialize) + if (up_dma_initialize) #endif { - up_dmainitialize(); + up_dma_initialize(); } #endif diff --git a/arch/mips/src/common/up_internal.h b/arch/mips/src/common/up_internal.h index 20a1c37bbe..e18fe7fac6 100644 --- a/arch/mips/src/common/up_internal.h +++ b/arch/mips/src/common/up_internal.h @@ -222,7 +222,7 @@ void up_clrpend_irq(int irq); /* DMA */ #ifdef CONFIG_ARCH_DMA -void weak_function up_dmainitialize(void); +void weak_function up_dma_initialize(void); #endif /* Memory management */ diff --git a/arch/or1k/src/common/up_initialize.c b/arch/or1k/src/common/up_initialize.c index 6de04c1d01..6c8780c210 100644 --- a/arch/or1k/src/common/up_initialize.c +++ b/arch/or1k/src/common/up_initialize.c @@ -200,15 +200,15 @@ void up_initialize(void) #endif #ifdef CONFIG_ARCH_DMA - /* Initialize the DMA subsystem if the weak function up_dmainitialize has been + /* Initialize the DMA subsystem if the weak function up_dma_initialize has been * brought into the build */ #ifdef CONFIG_HAVE_WEAKFUNCTIONS - if (up_dmainitialize) + if (up_dma_initialize) #endif { - up_dmainitialize(); + up_dma_initialize(); } #endif diff --git a/arch/or1k/src/common/up_internal.h b/arch/or1k/src/common/up_internal.h index 05b8519d48..86eb6ce375 100644 --- a/arch/or1k/src/common/up_internal.h +++ b/arch/or1k/src/common/up_internal.h @@ -320,7 +320,7 @@ void lowconsole_init(void); /* DMA **********************************************************************/ #ifdef CONFIG_ARCH_DMA -void weak_function up_dmainitialize(void); +void weak_function up_dma_initialize(void); #endif /* Cache control ************************************************************/ diff --git a/arch/x86/src/common/up_initialize.c b/arch/x86/src/common/up_initialize.c index bfe107d0e1..15a979e600 100644 --- a/arch/x86/src/common/up_initialize.c +++ b/arch/x86/src/common/up_initialize.c @@ -107,15 +107,15 @@ void up_initialize(void) #endif #ifdef CONFIG_ARCH_DMA - /* Initialize the DMA subsystem if the weak function up_dmainitialize has been + /* Initialize the DMA subsystem if the weak function up_dma_initialize has been * brought into the build */ #ifdef CONFIG_HAVE_WEAKFUNCTIONS - if (up_dmainitialize) + if (up_dma_initialize) #endif { - up_dmainitialize(); + up_dma_initialize(); } #endif diff --git a/arch/x86/src/common/up_internal.h b/arch/x86/src/common/up_internal.h index 8cc8bd2c55..1ad721b39c 100644 --- a/arch/x86/src/common/up_internal.h +++ b/arch/x86/src/common/up_internal.h @@ -179,7 +179,7 @@ void up_savestate(uint32_t *regs); void up_decodeirq(uint32_t *regs); void up_irqinitialize(void); #ifdef CONFIG_ARCH_DMA -void weak_function up_dmainitialize(void); +void weak_function up_dma_initialize(void); #endif int up_saveusercontext(uint32_t *saveregs); void up_fullcontextrestore(uint32_t *restoreregs) noreturn_function;