From e663f8ea2ee50ff1f0215b90835f8fec5fd161b0 Mon Sep 17 00:00:00 2001 From: raiden00pl Date: Sat, 21 Mar 2020 13:29:04 +0100 Subject: [PATCH] xmc4: fix some CS releted issues and remove empty files --- arch/arm/src/xmc4/Make.defs | 12 ------ arch/arm/src/xmc4/chip.h | 20 ++-------- arch/arm/src/xmc4/xmc4_clockconfig.h | 18 ++++----- arch/arm/src/xmc4/xmc4_clrpend.c | 10 ++--- arch/arm/src/xmc4/xmc4_config.h | 35 +++++------------ arch/arm/src/xmc4/xmc4_dma.c | 1 - arch/arm/src/xmc4/xmc4_dma.h | 7 ++-- arch/arm/src/xmc4/xmc4_i2c.c | 1 - arch/arm/src/xmc4/xmc4_lowputc.c | 13 ++++--- arch/arm/src/xmc4/xmc4_mpuinit.h | 14 +++---- arch/arm/src/xmc4/xmc4_pwm.c | 1 - arch/arm/src/xmc4/xmc4_pwm.h | 2 +- arch/arm/src/xmc4/xmc4_serial.c | 38 ++++++++++--------- arch/arm/src/xmc4/xmc4_spi.h | 18 ++++++--- arch/arm/src/xmc4/xmc4_start.c | 17 +++++---- arch/arm/src/xmc4/xmc4_start.h | 2 +- arch/arm/src/xmc4/xmc4_userspace.h | 14 +++---- boards/arm/xmc4/xmc4500-relax/README.txt | 2 +- .../xmc4/xmc4500-relax/src/xmc4500-relax.h | 2 +- boards/arm/xmc4/xmc4500-relax/src/xmc4_spi.c | 9 +++-- 20 files changed, 105 insertions(+), 131 deletions(-) delete mode 100644 arch/arm/src/xmc4/xmc4_dma.c delete mode 100644 arch/arm/src/xmc4/xmc4_i2c.c delete mode 100644 arch/arm/src/xmc4/xmc4_pwm.c diff --git a/arch/arm/src/xmc4/Make.defs b/arch/arm/src/xmc4/Make.defs index af7025f116..8e1cab8594 100644 --- a/arch/arm/src/xmc4/Make.defs +++ b/arch/arm/src/xmc4/Make.defs @@ -126,18 +126,6 @@ ifeq ($(CONFIG_DEBUG_GPIO_INFO),y) CHIP_CSRCS += xmc4_pindump.c endif -ifeq ($(CONFIG_XMC4_DMA),y) -CHIP_CSRCS += xmc4_dma.c -endif - -ifeq ($(CONFIG_PWM),y) -CHIP_CSRCS += xmc4_pwm.c -endif - -ifeq ($(CONFIG_I2C),y) -CHIP_CSRCS += xmc4_i2c.c -endif - ifeq ($(CONFIG_XMC4_USCI_SPI),y) CHIP_CSRCS += xmc4_spi.c endif diff --git a/arch/arm/src/xmc4/chip.h b/arch/arm/src/xmc4/chip.h index 93c2f4a506..b686b3e8f5 100644 --- a/arch/arm/src/xmc4/chip.h +++ b/arch/arm/src/xmc4/chip.h @@ -50,6 +50,10 @@ #include #include "hardware/xmc4_memorymap.h" +/************************************************************************************ + * Pre-processor Definitions + ************************************************************************************/ + /* If the common ARMv7-M vector handling logic is used, then it expects the * following definition in this file that provides the number of supported external * interrupts which, for this architecture, is provided in the arch/xmc4/chip.h @@ -58,20 +62,4 @@ #define ARMV7M_PERIPHERAL_INTERRUPTS XMC4_IRQ_NEXTINTS -/************************************************************************************ - * Pre-processor Definitions - ************************************************************************************/ - -/************************************************************************************ - * Public Types - ************************************************************************************/ - -/************************************************************************************ - * Public Data - ************************************************************************************/ - -/************************************************************************************ - * Public Functions - ************************************************************************************/ - #endif /* __ARCH_ARM_SRC_XMC4_CHIP_H */ diff --git a/arch/arm/src/xmc4/xmc4_clockconfig.h b/arch/arm/src/xmc4/xmc4_clockconfig.h index 5001683acc..86a4cf7cc4 100644 --- a/arch/arm/src/xmc4/xmc4_clockconfig.h +++ b/arch/arm/src/xmc4/xmc4_clockconfig.h @@ -1,4 +1,4 @@ -/************************************************************************************ +/**************************************************************************** * arch/arm/src/xmc4/xmc4_clockconfig.h * * Copyright (C) 2017 Gregory Nutt. All rights reserved. @@ -31,28 +31,28 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************************************/ + ****************************************************************************/ #ifndef __ARCH_ARM_SRC_XMC4_XMC4_CLOCKCONFIG_H #define __ARCH_ARM_SRC_XMC4_XMC4_CLOCKCONFIG_H -/************************************************************************************ +/**************************************************************************** * Included Files - ************************************************************************************/ + ****************************************************************************/ #include #include -/************************************************************************************ +/**************************************************************************** * Preprocessor Definitions - ************************************************************************************/ + ****************************************************************************/ #define OFI_FREQUENCY 24000000 /* Frequency of internal Backup Clock Source */ #define OSI_FREQUENCY 32768 /* Frequency of internal Slow Clock Source */ -/************************************************************************************ - * Public Functions - ************************************************************************************/ +/**************************************************************************** + * Public Function Prototypes + ****************************************************************************/ /**************************************************************************** * Name: xmc4_clock_configure diff --git a/arch/arm/src/xmc4/xmc4_clrpend.c b/arch/arm/src/xmc4/xmc4_clrpend.c index 33422ea5e2..860b82d774 100644 --- a/arch/arm/src/xmc4/xmc4_clrpend.c +++ b/arch/arm/src/xmc4/xmc4_clrpend.c @@ -52,8 +52,8 @@ * Name: xmc4_clrpend * * Description: - * Clear a pending interrupt at the NVIC. This does not seem to be required - * for most interrupts. Don't know why... + * Clear a pending interrupt at the NVIC. This does not seem to be + * required for most interrupts. Don't know why... * * I keep it in a separate file so that it will not increase the footprint * on Kinetis platforms that do not need this function. @@ -66,15 +66,15 @@ void xmc4_clrpend(int irq) if (irq >= XMC4_IRQ_FIRST) { - if (irq < (XMC4_IRQ_FIRST+32)) + if (irq < (XMC4_IRQ_FIRST + 32)) { putreg32(1 << (irq - XMC4_IRQ_FIRST), NVIC_IRQ0_31_CLRPEND); } - else if (irq < (XMC4_IRQ_FIRST+64)) + else if (irq < (XMC4_IRQ_FIRST + 64)) { putreg32(1 << (irq - XMC4_IRQ_FIRST - 32), NVIC_IRQ32_63_CLRPEND); } - else if (irq < (XMC4_IRQ_FIRST+96)) + else if (irq < (XMC4_IRQ_FIRST +96)) { putreg32(1 << (irq - XMC4_IRQ_FIRST - 64), NVIC_IRQ64_95_CLRPEND); } diff --git a/arch/arm/src/xmc4/xmc4_config.h b/arch/arm/src/xmc4/xmc4_config.h index 0a9c204268..44ea86209d 100644 --- a/arch/arm/src/xmc4/xmc4_config.h +++ b/arch/arm/src/xmc4/xmc4_config.h @@ -1,4 +1,4 @@ -/************************************************************************************ +/**************************************************************************** * arch/arm/src/xmc4/xmc4_config.h * * Copyright (C) 2017 Gregory Nutt. All rights reserved. @@ -31,25 +31,26 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************************************/ + ****************************************************************************/ #ifndef __ARCH_ARM_SRC_XMC4_XMC4_CONFIG_H #define __ARCH_ARM_SRC_XMC4_XMC4_CONFIG_H -/************************************************************************************ +/**************************************************************************** * Included Files - ************************************************************************************/ + ****************************************************************************/ #include #include #include "chip.h" -/************************************************************************************ +/**************************************************************************** * Pre-processor Definitions - ************************************************************************************/ + ****************************************************************************/ + +/* Configuration ************************************************************/ -/* Configuration *********************************************************************/ /* Make sure that no unsupported UARTs are enabled */ #ifndef CONFIG_XMC4_USIC0 @@ -101,8 +102,8 @@ # define HAVE_UART_DEVICE 1 #endif -/* Is there a serial console? There should be at most one defined. It could be on - * any UARTn, n=0,1,2,3,4,5 +/* Is there a serial console? There should be at most one defined. + * It could be on any UARTn, n=0,1,2,3,4,5 */ #undef HAVE_UART_CONSOLE @@ -200,20 +201,4 @@ # define CONFIG_XMC4_UART5PRIO NVIC_SYSH_PRIORITY_DEFAULT #endif -/************************************************************************************ - * Public Types - ************************************************************************************/ - -/************************************************************************************ - * Public Data - ************************************************************************************/ - -/************************************************************************************ - * Inline Functions - ************************************************************************************/ - -/************************************************************************************ - * Public Functions - ************************************************************************************/ - #endif /* __ARCH_ARM_SRC_XMC4_XMC4_CONFIG_H */ diff --git a/arch/arm/src/xmc4/xmc4_dma.c b/arch/arm/src/xmc4/xmc4_dma.c deleted file mode 100644 index 8b13789179..0000000000 --- a/arch/arm/src/xmc4/xmc4_dma.c +++ /dev/null @@ -1 +0,0 @@ - diff --git a/arch/arm/src/xmc4/xmc4_dma.h b/arch/arm/src/xmc4/xmc4_dma.h index 8584512814..3fcc54a8ca 100644 --- a/arch/arm/src/xmc4/xmc4_dma.h +++ b/arch/arm/src/xmc4/xmc4_dma.h @@ -98,10 +98,9 @@ extern "C" #define EXTERN extern #endif - -/************************************************************************************ - * Public Functions - ************************************************************************************/ +/**************************************************************************** + * Public Function Prototypes + ****************************************************************************/ /**************************************************************************** * Name: xmc4_dmainitialize diff --git a/arch/arm/src/xmc4/xmc4_i2c.c b/arch/arm/src/xmc4/xmc4_i2c.c deleted file mode 100644 index 8b13789179..0000000000 --- a/arch/arm/src/xmc4/xmc4_i2c.c +++ /dev/null @@ -1 +0,0 @@ - diff --git a/arch/arm/src/xmc4/xmc4_lowputc.c b/arch/arm/src/xmc4/xmc4_lowputc.c index a55fb41b95..ab97d36704 100644 --- a/arch/arm/src/xmc4/xmc4_lowputc.c +++ b/arch/arm/src/xmc4/xmc4_lowputc.c @@ -378,9 +378,10 @@ int xmc4_uart_configure(enum usic_channel_e channel, * a data word */ - regval &= ~(USIC_TBCTR_DPTR_MASK | USIC_TBCTR_LIMIT_MASK | USIC_TBCTR_STBTEN | - USIC_TBCTR_SIZE_MASK | USIC_TBCTR_LOF); - regval |= (USIC_TBCTR_DPTR(16) | USIC_TBCTR_LIMIT(1) | USIC_TBCTR_SIZE_16); + regval &= ~(USIC_TBCTR_DPTR_MASK | USIC_TBCTR_LIMIT_MASK | + USIC_TBCTR_STBTEN | USIC_TBCTR_SIZE_MASK | USIC_TBCTR_LOF); + regval |= (USIC_TBCTR_DPTR(16) | USIC_TBCTR_LIMIT(1) | + USIC_TBCTR_SIZE_16); putreg32(regval, base + XMC4_USIC_TBCTR_OFFSET); /* Disable the receive FIFO */ @@ -399,8 +400,10 @@ int xmc4_uart_configure(enum usic_channel_e channel, * of a new data word */ - regval &= ~(USIC_RBCTR_DPTR_MASK | USIC_RBCTR_LIMIT_MASK | USIC_RBCTR_SIZE_MASK); - regval |= (USIC_RBCTR_DPTR(0) | USIC_RBCTR_LIMIT(15) | USIC_RBCTR_SIZE_16 | USIC_RBCTR_LOF); + regval &= ~(USIC_RBCTR_DPTR_MASK | USIC_RBCTR_LIMIT_MASK | + USIC_RBCTR_SIZE_MASK); + regval |= (USIC_RBCTR_DPTR(0) | USIC_RBCTR_LIMIT(15) | USIC_RBCTR_SIZE_16 | + USIC_RBCTR_LOF); putreg32(regval, base + XMC4_USIC_RBCTR_OFFSET); /* Start UART */ diff --git a/arch/arm/src/xmc4/xmc4_mpuinit.h b/arch/arm/src/xmc4/xmc4_mpuinit.h index f318424bad..e1630a853d 100644 --- a/arch/arm/src/xmc4/xmc4_mpuinit.h +++ b/arch/arm/src/xmc4/xmc4_mpuinit.h @@ -1,4 +1,4 @@ -/************************************************************************************ +/**************************************************************************** * arch/arm/src/xmc4/xmc4_mpuinit.h * * Copyright (C) 2017 Gregory Nutt. All rights reserved. @@ -31,20 +31,20 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************************************/ + ****************************************************************************/ #ifndef __ARCH_ARM_SRC_XMC4_XMC4_MPUINIT_H #define __ARCH_ARM_SRC_XMC4_XMC4_MPUINIT_H -/************************************************************************************ +/**************************************************************************** * Included Files - ************************************************************************************/ + ****************************************************************************/ #include -/************************************************************************************ - * Public Functions - ************************************************************************************/ +/**************************************************************************** + * Public Function Prototypes + ****************************************************************************/ /**************************************************************************** * Name: xmc4_mpuinitialize diff --git a/arch/arm/src/xmc4/xmc4_pwm.c b/arch/arm/src/xmc4/xmc4_pwm.c deleted file mode 100644 index 8b13789179..0000000000 --- a/arch/arm/src/xmc4/xmc4_pwm.c +++ /dev/null @@ -1 +0,0 @@ - diff --git a/arch/arm/src/xmc4/xmc4_pwm.h b/arch/arm/src/xmc4/xmc4_pwm.h index 4de5b5f56a..acde9d35b2 100644 --- a/arch/arm/src/xmc4/xmc4_pwm.h +++ b/arch/arm/src/xmc4/xmc4_pwm.h @@ -70,7 +70,7 @@ extern "C" #endif /************************************************************************************ - * Public Functions + * Public Function Prototypes ************************************************************************************/ /************************************************************************************ diff --git a/arch/arm/src/xmc4/xmc4_serial.c b/arch/arm/src/xmc4/xmc4_serial.c index 684db27c34..ee2be448ca 100644 --- a/arch/arm/src/xmc4/xmc4_serial.c +++ b/arch/arm/src/xmc4/xmc4_serial.c @@ -64,7 +64,9 @@ /**************************************************************************** * Pre-processor Definitions ****************************************************************************/ + /* Some sanity checks *******************************************************/ + /* Is there at least one UART enabled and configured as a RS-232 device? */ #ifndef HAVE_UART_DEVICE @@ -348,7 +350,7 @@ static uart_dev_t g_uart0port = { .size = CONFIG_UART0_TXBUFSIZE, .buffer = g_uart0txbuffer, - }, + }, .ops = &g_uart_ops, .priv = &g_uart0priv, }; @@ -383,7 +385,7 @@ static uart_dev_t g_uart1port = { .size = CONFIG_UART1_TXBUFSIZE, .buffer = g_uart1txbuffer, - }, + }, .ops = &g_uart_ops, .priv = &g_uart1priv, }; @@ -418,7 +420,7 @@ static uart_dev_t g_uart2port = { .size = CONFIG_UART2_TXBUFSIZE, .buffer = g_uart2txbuffer, - }, + }, .ops = &g_uart_ops, .priv = &g_uart2priv, }; @@ -453,7 +455,7 @@ static uart_dev_t g_uart3port = { .size = CONFIG_UART3_TXBUFSIZE, .buffer = g_uart3txbuffer, - }, + }, .ops = &g_uart_ops, .priv = &g_uart3priv, }; @@ -488,7 +490,7 @@ static uart_dev_t g_uart4port = { .size = CONFIG_UART4_TXBUFSIZE, .buffer = g_uart4txbuffer, - }, + }, .ops = &g_uart_ops, .priv = &g_uart4priv, }; @@ -523,7 +525,7 @@ static uart_dev_t g_uart5port = { .size = CONFIG_UART5_TXBUFSIZE, .buffer = g_uart5txbuffer, - }, + }, .ops = &g_uart_ops, .priv = &g_uart5priv, }; @@ -557,8 +559,9 @@ static inline void xmc4_serialout(struct xmc4_dev_s *priv, * Name: xmc4_modifyreg ****************************************************************************/ -static inline void xmc4_modifyreg(struct xmc4_dev_s *priv, unsigned int offset, - uint32_t setbits, uint32_t clrbits) +static inline void xmc4_modifyreg(struct xmc4_dev_s *priv, unsigned + int offset, uint32_t setbits, + uint32_t clrbits) { irqstate_t flags; uintptr_t regaddr = priv->uartbase + offset; @@ -678,14 +681,15 @@ static void xmc4_shutdown(struct uart_dev_s *dev) * Name: xmc4_attach * * Description: - * Configure the UART to operation in interrupt driven mode. This method is - * called when the serial port is opened. Normally, this is just after the + * Configure the UART to operation in interrupt driven mode. This method + * is called when the serial port is opened. Normally, this is just after * the setup() method is called, however, the serial console may operate in * a non-interrupt driven mode during the boot phase. * - * RX and TX interrupts are not enabled when by the attach method (unless the - * hardware supports multiple levels of interrupt enabling). The RX and TX - * interrupts are not enabled until the txint() and rxint() methods are called. + * RX and TX interrupts are not enabled when by the attach method (unless + * the hardware supports multiple levels of interrupt enabling). + * The RX and TX interrupts are not enabled until the txint() and rxint() + * methods are called. * ****************************************************************************/ @@ -712,8 +716,8 @@ static int xmc4_attach(struct uart_dev_s *dev) * * Description: * Detach UART interrupts. This method is called when the serial port is - * closed normally just before the shutdown method is called. The exception - * is the serial console which is never shutdown. + * closed normally just before the shutdown method is called. + * The exception is the serial console which is never shutdown. * ****************************************************************************/ @@ -885,8 +889,8 @@ static void xmc4_rxint(struct uart_dev_s *dev, bool enable) if (enable) { #ifndef CONFIG_SUPPRESS_SERIAL_INTS - /* Receive an interrupt when their is anything in the Rx data register (or an Rx - * timeout occurs). + /* Receive an interrupt when their is anything in the Rx data register + * (or an Rx timeout occurs). */ priv->ccr |= CCR_RX_EVENTS; diff --git a/arch/arm/src/xmc4/xmc4_spi.h b/arch/arm/src/xmc4/xmc4_spi.h index eae9d47ad3..426d9077e1 100644 --- a/arch/arm/src/xmc4/xmc4_spi.h +++ b/arch/arm/src/xmc4/xmc4_spi.h @@ -121,7 +121,8 @@ FAR struct spi_dev_s *xmc4_spibus_initialize(int channel); ****************************************************************************/ #ifdef CONFIG_XMC4_SPI0 -void xmc4_spi0select(FAR struct spi_dev_s *dev, uint32_t devid, bool selected); +void xmc4_spi0select(FAR struct spi_dev_s *dev, uint32_t devid, + bool selected); uint8_t xmc4_spi0status(FAR struct spi_dev_s *dev, uint32_t devid); #ifdef CONFIG_SPI_CMDDATA int xmc4_spi0cmddata(FAR struct spi_dev_s *dev, uint32_t devid, bool cmd); @@ -129,7 +130,8 @@ int xmc4_spi0cmddata(FAR struct spi_dev_s *dev, uint32_t devid, bool cmd); #endif #ifdef CONFIG_XMC4_SPI1 -void xmc4_spi1select(FAR struct spi_dev_s *dev, uint32_t devid, bool selected); +void xmc4_spi1select(FAR struct spi_dev_s *dev, uint32_t devid, + bool selected); uint8_t xmc4_spi1status(FAR struct spi_dev_s *dev, uint32_t devid); #ifdef CONFIG_SPI_CMDDATA int xmc4_spi1cmddata(FAR struct spi_dev_s *dev, uint32_t devid, bool cmd); @@ -137,7 +139,8 @@ int xmc4_spi1cmddata(FAR struct spi_dev_s *dev, uint32_t devid, bool cmd); #endif #ifdef CONFIG_XMC4_SPI2 -void xmc4_spi2select(FAR struct spi_dev_s *dev, uint32_t devid, bool selected); +void xmc4_spi2select(FAR struct spi_dev_s *dev, uint32_t devid, + bool selected); uint8_t xmc4_spi2status(FAR struct spi_dev_s *dev, uint32_t devid); #ifdef CONFIG_SPI_CMDDATA int xmc4_spi2cmddata(FAR struct spi_dev_s *dev, uint32_t devid, bool cmd); @@ -145,7 +148,8 @@ int xmc4_spi2cmddata(FAR struct spi_dev_s *dev, uint32_t devid, bool cmd); #endif #ifdef CONFIG_XMC4_SPI3 -void xmc4_spi3select(FAR struct spi_dev_s *dev, uint32_t devid, bool selected); +void xmc4_spi3select(FAR struct spi_dev_s *dev, uint32_t devid, + bool selected); uint8_t xmc4_spi3status(FAR struct spi_dev_s *dev, uint32_t devid); #ifdef CONFIG_SPI_CMDDATA int xmc4_spi3cmddata(FAR struct spi_dev_s *dev, uint32_t devid, bool cmd); @@ -153,7 +157,8 @@ int xmc4_spi3cmddata(FAR struct spi_dev_s *dev, uint32_t devid, bool cmd); #endif #ifdef CONFIG_XMC4_SPI4 -void xmc4_spi4select(FAR struct spi_dev_s *dev, uint32_t devid, bool selected); +void xmc4_spi4select(FAR struct spi_dev_s *dev, uint32_t devid, + bool selected); uint8_t xmc4_spi4status(FAR struct spi_dev_s *dev, uint32_t devid); #ifdef CONFIG_SPI_CMDDATA int xmc4_spi4cmddata(FAR struct spi_dev_s *dev, uint32_t devid, bool cmd); @@ -161,7 +166,8 @@ int xmc4_spi4cmddata(FAR struct spi_dev_s *dev, uint32_t devid, bool cmd); #endif #ifdef CONFIG_XMC4_SPI5 -void xmc4_spi5select(FAR struct spi_dev_s *dev, uint32_t devid, bool selected); +void xmc4_spi5select(FAR struct spi_dev_s *dev, uint32_t devid, + bool selected); uint8_t xmc4_spi5status(FAR struct spi_dev_s *dev, uint32_t devid); #ifdef CONFIG_SPI_CMDDATA int xmc4_spi5cmddata(FAR struct spi_dev_s *dev, uint32_t devid, bool cmd); diff --git a/arch/arm/src/xmc4/xmc4_start.c b/arch/arm/src/xmc4/xmc4_start.c index 8c1a028e84..ba14815f51 100644 --- a/arch/arm/src/xmc4/xmc4_start.c +++ b/arch/arm/src/xmc4/xmc4_start.c @@ -73,9 +73,10 @@ static void go_nx_start(void *pv, unsigned int nbytes) /**************************************************************************** * Pre-processor Definitions ****************************************************************************/ + /* Memory Map ***************************************************************/ -/* - * 0x0000:0000 - Beginning of the internal FLASH. Address of vectors. + +/* 0x0000:0000 - Beginning of the internal FLASH. Address of vectors. * Mapped as boot memory address 0x0000:0000 at reset. * 0x07ff:ffff - End of flash region (assuming the max of 2MiB of FLASH). * 0x1fff:0000 - Start of internal SRAM and start of .data (_sdata) @@ -119,7 +120,6 @@ const uintptr_t g_idle_topstack = HEAP_BASE; * Private Functions ****************************************************************************/ - #ifdef CONFIG_ARMV7M_STACKCHECK /* we need to get r10 set before we can allow instrumentation calls */ @@ -142,7 +142,8 @@ void __start(void) __attribute__ ((no_instrument_function)); * done, the processor reserves space on the stack for the FP state, * but does not save that state information to the stack. * - * Software must not change the value of the ASPEN bit or LSPEN bit while either: + * Software must not change the value of the ASPEN bit or LSPEN bit while + * either: * - the CPACR permits access to CP10 and CP11, that give access to the FP * extension, or * - the CONTROL.FPCA bit is set to 1 @@ -176,7 +177,7 @@ static inline void xmc4_fpu_config(void) /* Enable full access to CP10 and CP11 */ regval = getreg32(NVIC_CPACR); - regval |= ((3 << (2*10)) | (3 << (2*11))); + regval |= ((3 << (2 * 10)) | (3 << (2 * 11))); putreg32(regval, NVIC_CPACR); } @@ -206,7 +207,7 @@ static inline void xmc4_fpu_config(void) /* Enable full access to CP10 and CP11 */ regval = getreg32(NVIC_CPACR); - regval |= ((3 << (2*10)) | (3 << (2*11))); + regval |= ((3 << (2 * 10)) | (3 << (2 * 11))); putreg32(regval, NVIC_CPACR); } @@ -312,10 +313,12 @@ void __start(void) #ifdef CONFIG_ARMV7M_STACKCHECK /* Set the stack limit before we attempt to call any functions */ - __asm__ volatile ("sub r10, sp, %0" : : "r" (CONFIG_IDLETHREAD_STACKSIZE - 64) : ); + __asm__ volatile ("sub r10, sp, %0" : : "r" + (CONFIG_IDLETHREAD_STACKSIZE - 64) :); #endif /* Disable the watchdog timer */ + /* TODO - add logic to disable the watchdog timer */ /* Enable unaligned memory access */ diff --git a/arch/arm/src/xmc4/xmc4_start.h b/arch/arm/src/xmc4/xmc4_start.h index ec76e2bf64..458a40219c 100644 --- a/arch/arm/src/xmc4/xmc4_start.h +++ b/arch/arm/src/xmc4/xmc4_start.h @@ -43,7 +43,7 @@ #include /************************************************************************************ - * Public Functions + * Public Function Prototypes ************************************************************************************/ /************************************************************************************ diff --git a/arch/arm/src/xmc4/xmc4_userspace.h b/arch/arm/src/xmc4/xmc4_userspace.h index 661982c8f9..1f445b5ec6 100644 --- a/arch/arm/src/xmc4/xmc4_userspace.h +++ b/arch/arm/src/xmc4/xmc4_userspace.h @@ -1,4 +1,4 @@ -/************************************************************************************ +/**************************************************************************** * arch/arm/src/xmc4/xmc4_userspace.h * * Copyright (C) 2017 Gregory Nutt. All rights reserved. @@ -31,20 +31,20 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************************************/ + ****************************************************************************/ #ifndef __ARCH_ARM_SRC_XMC4_XMC4_USERSPACE_H #define __ARCH_ARM_SRC_XMC4_XMC4_USERSPACE_H -/************************************************************************************ +/**************************************************************************** * Included Files - ************************************************************************************/ + ****************************************************************************/ #include -/************************************************************************************ - * Public Functions - ************************************************************************************/ +/**************************************************************************** + * Public Function Prototypes + ****************************************************************************/ /**************************************************************************** * Name: xmc4_userspace diff --git a/boards/arm/xmc4/xmc4500-relax/README.txt b/boards/arm/xmc4/xmc4500-relax/README.txt index 7f69500cc9..4826d4ec68 100644 --- a/boards/arm/xmc4/xmc4500-relax/README.txt +++ b/boards/arm/xmc4/xmc4500-relax/README.txt @@ -1,7 +1,7 @@ README for the XMC4500 Relax ============================ - The directory provides board support for the Infinion XMC4500 Relax v1 + The directory provides board support for the Infineon XMC4500 Relax v1 boards. There are to variants of this board: There is a Lite version that has fewer features, for example, no 32.768KHz crystal. diff --git a/boards/arm/xmc4/xmc4500-relax/src/xmc4500-relax.h b/boards/arm/xmc4/xmc4500-relax/src/xmc4500-relax.h index d404d94b54..484e68b6f4 100644 --- a/boards/arm/xmc4/xmc4500-relax/src/xmc4500-relax.h +++ b/boards/arm/xmc4/xmc4500-relax/src/xmc4500-relax.h @@ -93,7 +93,7 @@ #ifndef __ASSEMBLY__ /**************************************************************************** - * Public Functions + * Public Function Prototypes ****************************************************************************/ /**************************************************************************** diff --git a/boards/arm/xmc4/xmc4500-relax/src/xmc4_spi.c b/boards/arm/xmc4/xmc4500-relax/src/xmc4_spi.c index 6cb91c002a..701a6ad558 100644 --- a/boards/arm/xmc4/xmc4500-relax/src/xmc4_spi.c +++ b/boards/arm/xmc4/xmc4500-relax/src/xmc4_spi.c @@ -90,10 +90,10 @@ void weak_function xmc4_spidev_initialize(void) * * Description: * These external functions must be provided by board-specific logic. They - * are implementations of the select, status, and cmddata methods of the SPI - * interface defined by struct spi_ops_s (see include/nuttx/spi/spi.h). All - * other methods including xmc4_spibus_initialize()) are provided by common - * Kinetis logic. To use this common SPI logic on your board: + * are implementations of the select, status, and cmddata methods of the + * SPI interface defined by struct spi_ops_s (see include/nuttx/spi/spi.h). + * All other methods including xmc4_spibus_initialize()) are provided by + * common xmc4 logic. To use this common SPI logic on your board: * * 1. Provide logic in xmc4_boardinitialize() to configure SPI chip select * pins. @@ -113,6 +113,7 @@ void weak_function xmc4_spidev_initialize(void) * the SPI MMC/SD driver). * ****************************************************************************/ + /**************************************************************************** * Name: xmc4_spi[n]select *