diff --git a/boards/arm/lpc214x/mcu123-lpc214x/include/board.h b/boards/arm/lpc214x/mcu123-lpc214x/include/board.h index 5166bc8ff1a..300fee6d67f 100644 --- a/boards/arm/lpc214x/mcu123-lpc214x/include/board.h +++ b/boards/arm/lpc214x/mcu123-lpc214x/include/board.h @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/mcu123-lpc214x/include/board.h + * boards/arm/lpc214x/mcu123-lpc214x/include/board.h * * Copyright (C) 2007-2009 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -33,8 +33,8 @@ * ****************************************************************************/ -#ifndef __ARCH_BOARD_BOARD_H -#define __ARCH_BOARD_BOARD_H +#ifndef __BOARDS_ARM_LPC214X_MCU123_LPC214X_INCLUDE_BOARD_H +#define __BOARDS_ARM_LPC214X_MCU123_LPC214X_INCLUDE_BOARD_H /**************************************************************************** * Included Files @@ -76,4 +76,4 @@ * Inline Functions ****************************************************************************/ -#endif /* __ARCH_BOARD_BOARD_H */ +#endif /* __BOARDS_ARM_LPC214X_MCU123_LPC214X_INCLUDE_BOARD_H */ diff --git a/boards/arm/lpc214x/mcu123-lpc214x/scripts/Make.defs b/boards/arm/lpc214x/mcu123-lpc214x/scripts/Make.defs index 050e435db1e..cbb8a3c0f54 100644 --- a/boards/arm/lpc214x/mcu123-lpc214x/scripts/Make.defs +++ b/boards/arm/lpc214x/mcu123-lpc214x/scripts/Make.defs @@ -1,5 +1,5 @@ ############################################################################## -# boards/mcu123-lpc214x/scripts/Make.defs +# boards/arm/lpc214x/mcu123-lpc214x/scripts/Make.defs # # Copyright (C) 2008-2009, 2011, 2014, 2017 Gregory Nutt. All rights reserved. # Author: Gregory Nutt diff --git a/boards/arm/lpc214x/mcu123-lpc214x/scripts/ld.script b/boards/arm/lpc214x/mcu123-lpc214x/scripts/ld.script index d7a9cae2e30..5bb498bcb84 100644 --- a/boards/arm/lpc214x/mcu123-lpc214x/scripts/ld.script +++ b/boards/arm/lpc214x/mcu123-lpc214x/scripts/ld.script @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/mcu123-lpc214x/scripts/ld.script + * boards/arm/lpc214x/mcu123-lpc214x/scripts/ld.script * * Copyright (C) 2008-2009, 2012 Gregory Nutt. All rights reserved. * Author: Gregory Nutt diff --git a/boards/arm/lpc214x/mcu123-lpc214x/scripts/lpc21isp.sh b/boards/arm/lpc214x/mcu123-lpc214x/scripts/lpc21isp.sh index 89d78ae979c..3015eda5b75 100755 --- a/boards/arm/lpc214x/mcu123-lpc214x/scripts/lpc21isp.sh +++ b/boards/arm/lpc214x/mcu123-lpc214x/scripts/lpc21isp.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash ############################################################################# -# boards/mcu123-lpc214x/lpc21isp.sh +# boards/arm/lpc214x/mcu123-lpc214x/lpc21isp.sh # # Copyright (C) 2008 Gregory Nutt. All rights reserved. # Author: Gregory Nutt diff --git a/boards/arm/lpc214x/mcu123-lpc214x/src/Makefile b/boards/arm/lpc214x/mcu123-lpc214x/src/Makefile index 86557f2d47b..41c77f00ed6 100644 --- a/boards/arm/lpc214x/mcu123-lpc214x/src/Makefile +++ b/boards/arm/lpc214x/mcu123-lpc214x/src/Makefile @@ -1,5 +1,5 @@ ############################################################################ -# boards/mcu123-lpc214x/src/Makefile +# boards/arm/lpc214x/mcu123-lpc214x/src/Makefile # # Copyright (C) 2007-2010, 2012, 2015 Gregory Nutt. All rights reserved. # Author: Gregory Nutt diff --git a/boards/arm/lpc214x/mcu123-lpc214x/src/lpc2148_appinit.c b/boards/arm/lpc214x/mcu123-lpc214x/src/lpc2148_appinit.c index cec38015c75..9c75e7d33a7 100644 --- a/boards/arm/lpc214x/mcu123-lpc214x/src/lpc2148_appinit.c +++ b/boards/arm/lpc214x/mcu123-lpc214x/src/lpc2148_appinit.c @@ -1,5 +1,5 @@ /**************************************************************************** - * config/mcu123-lpc214x/src/lpc2148_appinit.c + * boards/arm/lpc214x/mcu123-lpc214x/src/lpc2148_appinit.c * * Copyright (C) 2008-2009, 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -152,10 +152,12 @@ int board_app_initialize(uintptr_t arg) syslog(LOG_INFO, "Binding SPI port %d to MMC/SD slot %d\n", CONFIG_NSH_MMCSDSPIPORTNO, CONFIG_NSH_MMCSDSLOTNO); - ret = mmcsd_spislotinitialize(CONFIG_NSH_MMCSDMINOR, CONFIG_NSH_MMCSDSLOTNO, spi); + ret = mmcsd_spislotinitialize(CONFIG_NSH_MMCSDMINOR, + CONFIG_NSH_MMCSDSLOTNO, spi); if (ret < 0) { - syslog(LOG_ERR, "ERROR: Failed to bind SPI port %d to MMC/SD slot %d: %d\n", + syslog(LOG_ERR, + "ERROR: Failed to bind SPI port %d to MMC/SD slot %d: %d\n", CONFIG_NSH_MMCSDSPIPORTNO, CONFIG_NSH_MMCSDSLOTNO, ret); return ret; } diff --git a/boards/arm/lpc214x/mcu123-lpc214x/src/lpc2148_composite.c b/boards/arm/lpc214x/mcu123-lpc214x/src/lpc2148_composite.c index 8114695bd13..116414fdc0c 100644 --- a/boards/arm/lpc214x/mcu123-lpc214x/src/lpc2148_composite.c +++ b/boards/arm/lpc214x/mcu123-lpc214x/src/lpc2148_composite.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/mcu123-lpc214x/src/lpc2148_composite.c + * boards/arm/lpc214x/mcu123-lpc214x/src/lpc2148_composite.c * * Copyright (C) 2012, 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -212,6 +212,7 @@ static FAR void *board_composite0_connect(int port) cdcacm_get_composite_devdesc(&dev[0]); /* Overwrite and correct some values... */ + /* The callback functions for the CDC/ACM class */ dev[0].classobject = cdcacm_classobject; @@ -222,7 +223,7 @@ static FAR void *board_composite0_connect(int port) dev[0].devinfo.ifnobase = ifnobase; /* Offset to Interface-IDs */ dev[0].minor = 0; /* The minor interface number */ - /* Strings */ + /* Strings */ dev[0].devinfo.strbase = strbase; /* Offset to String Numbers */ @@ -238,6 +239,7 @@ static FAR void *board_composite0_connect(int port) strbase += dev[0].devinfo.nstrings; /* Configure the mass storage device device */ + /* Ask the usbmsc driver to fill in the constants we didn't * know here. */ @@ -245,6 +247,7 @@ static FAR void *board_composite0_connect(int port) usbmsc_get_composite_devdesc(&dev[1]); /* Overwrite and correct some values... */ + /* The callback functions for the USBMSC class */ dev[1].classobject = board_mscclassobject; @@ -304,6 +307,7 @@ static FAR void *board_composite1_connect(int port) cdcacm_get_composite_devdesc(&dev[i]); /* Overwrite and correct some values... */ + /* The callback functions for the CDC/ACM class */ dev[i].classobject = cdcacm_classobject; @@ -347,7 +351,8 @@ static FAR void *board_composite1_connect(int port) int board_composite_initialize(int port) { /* If system/composite is built as an NSH command, then SD slot should - * already have been initialized in board_app_initialize() (see lpc2148_appinit.c). + * already have been initialized in board_app_initialize() + * (see lpc2148_appinit.c). * In this case, there is nothing further to be done here. * * NOTE: CONFIG_NSH_BUILTIN_APPS is not a fool-proof indication that NSH diff --git a/boards/arm/lpc214x/mcu123-lpc214x/src/lpc2148_leds.c b/boards/arm/lpc214x/mcu123-lpc214x/src/lpc2148_leds.c index 02224c29e57..a571b133d3f 100644 --- a/boards/arm/lpc214x/mcu123-lpc214x/src/lpc2148_leds.c +++ b/boards/arm/lpc214x/mcu123-lpc214x/src/lpc2148_leds.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/mcu123-lpc214x/src/lpc2148_leds.c + * boards/arm/lpc214x/mcu123-lpc214x/src/lpc2148_leds.c * * Copyright (C) 2007-2009, 2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -91,9 +91,9 @@ void board_autoled_initialize(void) { /* Initilize GIOs P1.16-P1.23 */ - putled(ALLLEDS,LED_DIR_OFFSET); - putled(ALLLEDS,LED_SET_OFFSET); - putled(LEDBIT(0),LED_CLR_OFFSET); + putled(ALLLEDS, LED_DIR_OFFSET); + putled(ALLLEDS, LED_SET_OFFSET); + putled(LEDBIT(0), LED_CLR_OFFSET); } /**************************************************************************** @@ -102,7 +102,7 @@ void board_autoled_initialize(void) void board_autoled_on(int led) { - putled(LEDBIT(led),LED_CLR_OFFSET); + putled(LEDBIT(led), LED_CLR_OFFSET); } /**************************************************************************** @@ -111,6 +111,6 @@ void board_autoled_on(int led) void board_autoled_off(int led) { - putled(LEDBIT(led),LED_SET_OFFSET); + putled(LEDBIT(led), LED_SET_OFFSET); } #endif /* CONFIG_ARCH_LEDS */ diff --git a/boards/arm/lpc214x/mcu123-lpc214x/src/lpc2148_spi1.c b/boards/arm/lpc214x/mcu123-lpc214x/src/lpc2148_spi1.c index 8a4675fc9c7..a50eb196b27 100644 --- a/boards/arm/lpc214x/mcu123-lpc214x/src/lpc2148_spi1.c +++ b/boards/arm/lpc214x/mcu123-lpc214x/src/lpc2148_spi1.c @@ -1,5 +1,5 @@ /**************************************************************************** - * config/mcu123-lpc214x/src/lpc2148_spi1.c + * boards/arm/lpc214x/mcu123-lpc214x/src/lpc2148_spi1.c * * Copyright (C) 2008-2010, 2012, 2016-2016 Gregory Nutt. All rights * reserved. @@ -109,15 +109,19 @@ ****************************************************************************/ static int spi_lock(FAR struct spi_dev_s *dev, bool lock); -static void spi_select(FAR struct spi_dev_s *dev, uint32_t devid, bool selected); -static uint32_t spi_setfrequency(FAR struct spi_dev_s *dev, uint32_t frequency); +static void spi_select(FAR struct spi_dev_s *dev, uint32_t devid, + bool selected); +static uint32_t spi_setfrequency(FAR struct spi_dev_s *dev, + uint32_t frequency); static uint8_t spi_status(FAR struct spi_dev_s *dev, uint32_t devid); #ifdef CONFIG_SPI_CMDDATA static int spi_cmddata(FAR struct spi_dev_s *dev, uint32_t devid, bool cmd); #endif static uint16_t spi_send(FAR struct spi_dev_s *dev, uint16_t ch); -static void spi_sndblock(FAR struct spi_dev_s *dev, FAR const void *buffer, size_t nwords); -static void spi_recvblock(FAR struct spi_dev_s *dev, FAR void *buffer, size_t nwords); +static void spi_sndblock(FAR struct spi_dev_s *dev, FAR const void *buffer, + size_t nwords); +static void spi_recvblock(FAR struct spi_dev_s *dev, FAR void *buffer, + size_t nwords); /**************************************************************************** * Private Data @@ -217,7 +221,8 @@ static int spi_lock(FAR struct spi_dev_s *dev, bool lock) * ****************************************************************************/ -static void spi_select(FAR struct spi_dev_s *dev, uint32_t devid, bool selected) +static void spi_select(FAR struct spi_dev_s *dev, uint32_t devid, + bool selected) { uint32_t bit = 1 << 20; @@ -273,7 +278,8 @@ static void spi_select(FAR struct spi_dev_s *dev, uint32_t devid, bool selected) * ****************************************************************************/ -static uint32_t spi_setfrequency(FAR struct spi_dev_s *dev, uint32_t frequency) +static uint32_t spi_setfrequency(FAR struct spi_dev_s *dev, + uint32_t frequency) { uint32_t divisor = LPC214X_PCLKFREQ / frequency; @@ -401,14 +407,16 @@ static uint16_t spi_send(FAR struct spi_dev_s *dev, uint16_t wd) * nwords - the length of data to send from the buffer in number of words. * The wordsize is determined by the number of bits-per-word * selected for the SPI interface. If nbits <= 8, the data is - * packed into uint8_t's; if nbits >8, the data is packed into uint16_t's + * packed into uint8_t's; if nbits >8, + * the data is packed into uint16_t's * * Returned Value: * None * ****************************************************************************/ -static void spi_sndblock(FAR struct spi_dev_s *dev, FAR const void *buffer, size_t nwords) +static void spi_sndblock(FAR struct spi_dev_s *dev, FAR const void *buffer, + size_t nwords) { FAR const uint8_t *ptr = (FAR const uint8_t *)buffer; uint8_t sr; @@ -470,21 +478,26 @@ static void spi_sndblock(FAR struct spi_dev_s *dev, FAR const void *buffer, size * dev - Device-specific state data * buffer - A pointer to the buffer in which to recieve data * nwords - the length of data that can be received in the buffer in number - * of words. The wordsize is determined by the number of bits-per-word + * of words. + * The wordsize is determined by the number of bits-per-word * selected for the SPI interface. If nbits <= 8, the data is - * packed into uint8_t's; if nbits >8, the data is packed into uint16_t's + * packed into uint8_t's; if nbits >8, + * the data is packed into uint16_t's * * Returned Value: * None * ****************************************************************************/ -static void spi_recvblock(FAR struct spi_dev_s *dev, FAR void *buffer, size_t nwords) +static void spi_recvblock(FAR struct spi_dev_s *dev, FAR void *buffer, + size_t nwords) { FAR uint8_t *ptr = (FAR uint8_t*)buffer; uint32_t rxpending = 0; - /* While there is remaining to be sent (and no synchronization error has occurred) */ + /* While there is remaining to be sent + * (and no synchronization error has occurred) + */ spiinfo("nwords: %d\n", nwords); while (nwords || rxpending) @@ -553,14 +566,15 @@ FAR struct spi_dev_s *lpc214x_spibus_initialize(int port) * PINSEL1 P0.17/CAP1.2/SCK1/MAT1.2 Bits 2-3=10 for SCK1 * PINSEL1 P0.18/CAP1.3/MISO1/MAT1.3 Bits 4-5=10 for MISO1 * PINSEL1 P0.19/MAT1.2/MOSI1/CAP1.2 Bits 6-7=10 for MOSI1 - * PINSEL1 P0.20/MAT1.3/SSEL1/EINT3 Bits 8-9=10 for P0.20 (we'll control it via GPIO or FIO) + * PINSEL1 P0.20/MAT1.3/SSEL1/EINT3 Bits 8-9=10 for P0.20 + * (we'll control it via GPIO or FIO) */ regval32 = getreg32(LPC214X_PINSEL1); - regval32 &= ~(LPC214X_PINSEL1_P017_MASK|LPC214X_PINSEL1_P018_MASK| - LPC214X_PINSEL1_P019_MASK|LPC214X_PINSEL1_P020_MASK); - regval32 |= (LPC214X_PINSEL1_P017_SCK1|LPC214X_PINSEL1_P018_MISO1| - LPC214X_PINSEL1_P019_MOSI1|LPC214X_PINSEL1_P020_GPIO); + regval32 &= ~(LPC214X_PINSEL1_P017_MASK | LPC214X_PINSEL1_P018_MASK | + LPC214X_PINSEL1_P019_MASK | LPC214X_PINSEL1_P020_MASK); + regval32 |= (LPC214X_PINSEL1_P017_SCK1 | LPC214X_PINSEL1_P018_MISO1 | + LPC214X_PINSEL1_P019_MOSI1 | LPC214X_PINSEL1_P020_GPIO); putreg32(regval32, LPC214X_PINSEL1); /* Disable chip select using P0.20 (SSEL1) (low enables) */ @@ -578,7 +592,8 @@ FAR struct spi_dev_s *lpc214x_spibus_initialize(int port) /* Configure 8-bit SPI mode */ - putreg16(LPC214X_SPI1CR0_DSS8BIT|LPC214X_SPI1CR0_FRFSPI, LPC214X_SPI1_CR0); + putreg16(LPC214X_SPI1CR0_DSS8BIT | LPC214X_SPI1CR0_FRFSPI, + LPC214X_SPI1_CR0); /* Disable the SSP and all interrupts (we'll poll for all data) */ diff --git a/boards/arm/lpc214x/mcu123-lpc214x/src/lpc2148_usbmsc.c b/boards/arm/lpc214x/mcu123-lpc214x/src/lpc2148_usbmsc.c index fdd4d02b1db..58c9615b4f2 100644 --- a/boards/arm/lpc214x/mcu123-lpc214x/src/lpc2148_usbmsc.c +++ b/boards/arm/lpc214x/mcu123-lpc214x/src/lpc2148_usbmsc.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/mcu123-lpc214x/src/lpc2148_usbmsc.c + * boards/arm/lpc214x/mcu123-lpc214x/src/lpc2148_usbmsc.c * * Copyright (C) 2008-2010, 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -70,7 +70,7 @@ # define LPC214X_MMCSDSLOTNO 0 #else - /* Add configuration for new LPC214x boards here */ + /* Add configuration for new LPC214x boards here */ # error "Unrecognized LPC214x board" #endif diff --git a/boards/arm/lpc214x/zp214xpa/README.txt b/boards/arm/lpc214x/zp214xpa/README.txt index e58b37800ab..52c38fab842 100644 --- a/boards/arm/lpc214x/zp214xpa/README.txt +++ b/boards/arm/lpc214x/zp214xpa/README.txt @@ -228,13 +228,13 @@ Using OpenOCD and GDB with an FT2232 JTAG emulator - Possibly the value of OPENOCD_PATH and TARGET_PATH - It assumes that the correct script to use is the one at - boards/zp214xpa/tools/olimex.cfg + boards/arm/lpc214x/zp214xpa/tools/olimex.cfg Starting OpenOCD Then you should be able to start the OpenOCD daemon like: - boards/zp214xpa/tools/oocd.sh $PWD + boards/arm/lpc214x/zp214xpa/tools/oocd.sh $PWD If you add that path to your PATH environment variable, the command simplifies to just: diff --git a/boards/arm/lpc214x/zp214xpa/include/board.h b/boards/arm/lpc214x/zp214xpa/include/board.h index 6d17f0b87de..0788d5c1338 100644 --- a/boards/arm/lpc214x/zp214xpa/include/board.h +++ b/boards/arm/lpc214x/zp214xpa/include/board.h @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/zp214xpa/include/board.h + * boards/arm/lpc214x/zp214xpa/include/board.h * * Copyright (C) 2012 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -33,8 +33,8 @@ * ****************************************************************************/ -#ifndef __BOARDS_ARM_ZP214XPA_INCLUDE_BOARD_H -#define __BOARDS_ARM_ZP214XPA_INCLUDE_BOARD_H +#ifndef __BOARDS_ARM_LPC214X_ZP214XPA_INCLUDE_BOARD_H +#define __BOARDS_ARM_LPC214X_ZP214XPA_INCLUDE_BOARD_H /**************************************************************************** * Included Files @@ -65,4 +65,4 @@ * Inline Functions ****************************************************************************/ -#endif /* __BOARDS_ARM_ZP214XPA_INCLUDE_BOARD_H */ +#endif /* __BOARDS_ARM_LPC214X_ZP214XPA_INCLUDE_BOARD_H */ diff --git a/boards/arm/lpc214x/zp214xpa/scripts/Make.defs b/boards/arm/lpc214x/zp214xpa/scripts/Make.defs index 877fb6c35df..e84639542f8 100644 --- a/boards/arm/lpc214x/zp214xpa/scripts/Make.defs +++ b/boards/arm/lpc214x/zp214xpa/scripts/Make.defs @@ -1,5 +1,5 @@ ############################################################################## -# boards/zp214xpa/scripts/Make.defs +# boards/arm/lpc214x/zp214xpa/scripts/Make.defs # # Copyright (C) 2012, 2014, 2017 Gregory Nutt. All rights reserved. # Author: Gregory Nutt diff --git a/boards/arm/lpc214x/zp214xpa/scripts/ld.script b/boards/arm/lpc214x/zp214xpa/scripts/ld.script index 81911889156..c2c055d0ed7 100644 --- a/boards/arm/lpc214x/zp214xpa/scripts/ld.script +++ b/boards/arm/lpc214x/zp214xpa/scripts/ld.script @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/zp214xpa/scripts/ld.script + * boards/arm/lpc214x/zp214xpa/scripts/ld.script * * Copyright (C) 2012 Gregory Nutt. All rights reserved. * Author: Gregory Nutt diff --git a/boards/arm/lpc214x/zp214xpa/src/Makefile b/boards/arm/lpc214x/zp214xpa/src/Makefile index eb8e5f52c47..4cccb04b21e 100644 --- a/boards/arm/lpc214x/zp214xpa/src/Makefile +++ b/boards/arm/lpc214x/zp214xpa/src/Makefile @@ -1,5 +1,5 @@ ############################################################################ -# boards/zp214xpa/src/Makefile +# boards/arm/lpc214x/zp214xpa/src/Makefile # # Copyright (C) 2012 Gregory Nutt. All rights reserved. # Author: Gregory Nutt diff --git a/boards/arm/lpc214x/zp214xpa/src/lpc2148_appinit.c b/boards/arm/lpc214x/zp214xpa/src/lpc2148_appinit.c index 8652e9134c4..15920bda606 100644 --- a/boards/arm/lpc214x/zp214xpa/src/lpc2148_appinit.c +++ b/boards/arm/lpc214x/zp214xpa/src/lpc2148_appinit.c @@ -1,5 +1,5 @@ /**************************************************************************** - * config/zp214xpa/src/lpc2148_appinit.c + * boards/arm/lpc214x/zp214xpa/src/lpc2148_appinit.c * * Copyright (C) 2015-2017 Gregory Nutt. All rights reserved. * Author: Gregory Nutt diff --git a/boards/arm/lpc214x/zp214xpa/src/lpc2148_spi1.c b/boards/arm/lpc214x/zp214xpa/src/lpc2148_spi1.c index f9c1cc26934..94e9b0501d3 100644 --- a/boards/arm/lpc214x/zp214xpa/src/lpc2148_spi1.c +++ b/boards/arm/lpc214x/zp214xpa/src/lpc2148_spi1.c @@ -1,5 +1,5 @@ /**************************************************************************** - * config/zp214xpa/src/lpc2148_spi1.c + * boards/arm/lpc214x/zp214xpa/src/lpc2148_spi1.c * * Copyright (C) 2008-2010, 2012, 2016-2017 Gregory Nutt. All rights * reserved. @@ -112,15 +112,19 @@ ****************************************************************************/ static int spi_lock(FAR struct spi_dev_s *dev, bool lock); -static void spi_select(FAR struct spi_dev_s *dev, uint32_t devid, bool selected); -static uint32_t spi_setfrequency(FAR struct spi_dev_s *dev, uint32_t frequency); +static void spi_select(FAR struct spi_dev_s *dev, uint32_t devid, + bool selected); +static uint32_t spi_setfrequency(FAR struct spi_dev_s *dev, + uint32_t frequency); static uint8_t spi_status(FAR struct spi_dev_s *dev, uint32_t devid); #ifdef CONFIG_SPI_CMDDATA static int spi_cmddata(FAR struct spi_dev_s *dev, uint32_t devid, bool cmd); #endif static uint16_t spi_send(FAR struct spi_dev_s *dev, uint16_t ch); -static void spi_sndblock(FAR struct spi_dev_s *dev, FAR const void *buffer, size_t nwords); -static void spi_recvblock(FAR struct spi_dev_s *dev, FAR void *buffer, size_t nwords); +static void spi_sndblock(FAR struct spi_dev_s *dev, FAR const void *buffer, + size_t nwords); +static void spi_recvblock(FAR struct spi_dev_s *dev, FAR void *buffer, + size_t nwords); /**************************************************************************** * Private Data @@ -220,15 +224,16 @@ static int spi_lock(FAR struct spi_dev_s *dev, bool lock) * ****************************************************************************/ -static void spi_select(FAR struct spi_dev_s *dev, uint32_t devid, bool selected) +static void spi_select(FAR struct spi_dev_s *dev, uint32_t devid, + bool selected) { #ifdef CONFIG_DEBUG_SPI_INFO uint32_t regval; #endif uint32_t bit = 1 << 20; - /* We do not bother to check if devid == SPIDEV_DISPLAY(0) because that is the - * only thing on the bus. + /* We do not bother to check if devid == SPIDEV_DISPLAY(0) + * because that is the only thing on the bus. */ #ifdef CONFIG_DEBUG_SPI_INFO @@ -247,7 +252,8 @@ static void spi_select(FAR struct spi_dev_s *dev, uint32_t devid, bool selected) /* Disable slave select (low enables) */ putreg32(bit, CS_SET_REGISTER); - spiinfo("CS de-asserted: %08x->%08x\n", regval, getreg32(CS_PIN_REGISTER)); + spiinfo("CS de-asserted: %08x->%08x\n", regval, + getreg32(CS_PIN_REGISTER)); /* Wait for the TX FIFO not full indication */ @@ -287,7 +293,8 @@ static void spi_select(FAR struct spi_dev_s *dev, uint32_t devid, bool selected) * ****************************************************************************/ -static uint32_t spi_setfrequency(FAR struct spi_dev_s *dev, uint32_t frequency) +static uint32_t spi_setfrequency(FAR struct spi_dev_s *dev, + uint32_t frequency) { uint32_t divisor = LPC214X_PCLKFREQ / frequency; @@ -360,15 +367,16 @@ static int spi_cmddata(FAR struct spi_dev_s *dev, uint32_t devid, bool cmd) #endif uint32_t bit = 1 << 23; - /* We do not bother to check if devid == SPIDEV_DISPLAY(0) because that is the - * only thing on the bus. + /* We do not bother to check if devid == SPIDEV_DISPLAY(0) + * because that is the only thing on the bus. */ /* "This is the Data/Command control pad which determines whether the * data bits are data or a command. * * A0 = H: the inputs at D0 to D7 are treated as display data. - * A0 = L: the inputs at D0 to D7 are transferred to the command registers." + * A0 = L: the inputs at D0 to D7 are transferred to the command + * registers." */ #ifdef CONFIG_DEBUG_SPI_INFO @@ -445,14 +453,16 @@ static uint16_t spi_send(FAR struct spi_dev_s *dev, uint16_t wd) * nwords - the length of data to send from the buffer in number of words. * The wordsize is determined by the number of bits-per-word * selected for the SPI interface. If nbits <= 8, the data is - * packed into uint8_t's; if nbits >8, the data is packed into uint16_t's + * packed into uint8_t's; if nbits >8, + * the data is packed into uint16_t's * * Returned Value: * None * ****************************************************************************/ -static void spi_sndblock(FAR struct spi_dev_s *dev, FAR const void *buffer, size_t nwords) +static void spi_sndblock(FAR struct spi_dev_s *dev, FAR const void *buffer, + size_t nwords) { FAR const uint8_t *ptr = (FAR const uint8_t *)buffer; uint8_t sr; @@ -514,16 +524,18 @@ static void spi_sndblock(FAR struct spi_dev_s *dev, FAR const void *buffer, size * dev - Device-specific state data * buffer - A pointer to the buffer in which to recieve data * nwords - the length of data that can be received in the buffer in number - * of words. The wordsize is determined by the number of bits-per-word - * selected for the SPI interface. If nbits <= 8, the data is - * packed into uint8_t's; if nbits >8, the data is packed into uint16_t's + * of words. The wordsize is determined by the number of + * bits-per-word selected for the SPI interface. + * If nbits <= 8, the data is packed into uint8_t's; if nbits >8, + * the data is packed into uint16_t's * * Returned Value: * None * ****************************************************************************/ -static void spi_recvblock(FAR struct spi_dev_s *dev, FAR void *buffer, size_t nwords) +static void spi_recvblock(FAR struct spi_dev_s *dev, FAR void *buffer, + size_t nwords) { FAR uint8_t *ptr = (FAR uint8_t*)buffer; uint32_t rxpending = 0; @@ -596,25 +608,27 @@ FAR struct spi_dev_s *lpc214x_spibus_initialize(int port) * * PINSEL1 P0.17/CAP1.2/SCK1/MAT1.2 Bits 2-3=10 for SCK1 * PINSEL1 P0.18/CAP1.3/MISO1/MAT1.3 Bits 4-5=10 for MISO1 - * (This is the RESET line for the UG_2864AMBAG01, - * although it is okay to configure it as an input too) + * (This is the RESET line for the UG_2864AMBAG01, + * although it is okay to configure it as an input too) * PINSEL1 P0.19/MAT1.2/MOSI1/CAP1.2 Bits 6-7=10 for MOSI1 - * PINSEL1 P0.20/MAT1.3/SSEL1/EINT3 Bits 8-9=00 for P0.20 (we'll control it via GPIO or FIO) - * PINSEL1 P0.23/VBUS Bits 12-13=00 for P0.21 (we'll control it via GPIO or FIO) + * PINSEL1 P0.20/MAT1.3/SSEL1/EINT3 Bits 8-9=00 for P0.20 + * (we'll control it via GPIO or FIO) + * PINSEL1 P0.23/VBUS Bits 12-13=00 for P0.21 + * (we'll control it via GPIO or FIO) */ regval32 = getreg32(LPC214X_PINSEL1); #ifdef CONFIG_LCD_UG2864AMBAG01 - regval32 &= ~(LPC214X_PINSEL1_P017_MASK|LPC214X_PINSEL1_P019_MASK| - LPC214X_PINSEL1_P020_MASK|LPC214X_PINSEL1_P023_MASK); - regval32 |= (LPC214X_PINSEL1_P017_SCK1|LPC214X_PINSEL1_P019_MOSI1| - LPC214X_PINSEL1_P020_GPIO|LPC214X_PINSEL1_P023_GPIO); + regval32 &= ~(LPC214X_PINSEL1_P017_MASK | LPC214X_PINSEL1_P019_MASK | + LPC214X_PINSEL1_P020_MASK | LPC214X_PINSEL1_P023_MASK); + regval32 |= (LPC214X_PINSEL1_P017_SCK1 | LPC214X_PINSEL1_P019_MOSI1 | + LPC214X_PINSEL1_P020_GPIO | LPC214X_PINSEL1_P023_GPIO); #else - regval32 &= ~(LPC214X_PINSEL1_P017_MASK|LPC214X_PINSEL1_P018_MASK - LPC214X_PINSEL1_P019_MASK|LPC214X_PINSEL1_P020_MASK| + regval32 &= ~(LPC214X_PINSEL1_P017_MASK | LPC214X_PINSEL1_P018_MASK + LPC214X_PINSEL1_P019_MASK | LPC214X_PINSEL1_P020_MASK | LPC214X_PINSEL1_P023_MASK); - regval32 |= (LPC214X_PINSEL1_P017_SCK1|LPC214X_PINSEL1_P018_MISO1| - LPC214X_PINSEL1_P019_MOSI1|LPC214X_PINSEL1_P020_GPIO| + regval32 |= (LPC214X_PINSEL1_P017_SCK1 | LPC214X_PINSEL1_P018_MISO1 | + LPC214X_PINSEL1_P019_MOSI1 | LPC214X_PINSEL1_P020_GPIO | LPC214X_PINSEL1_P023_GPIO); #endif putreg32(regval32, LPC214X_PINSEL1); @@ -640,7 +654,8 @@ FAR struct spi_dev_s *lpc214x_spibus_initialize(int port) /* Configure 8-bit SPI mode */ - putreg16(LPC214X_SPI1CR0_DSS8BIT|LPC214X_SPI1CR0_FRFSPI, LPC214X_SPI1_CR0); + putreg16(LPC214X_SPI1CR0_DSS8BIT | LPC214X_SPI1CR0_FRFSPI, + LPC214X_SPI1_CR0); /* Disable the SSP and all interrupts (we'll poll for all data) */ diff --git a/boards/arm/lpc214x/zp214xpa/src/lpc2148_ug2864ambag01.c b/boards/arm/lpc214x/zp214xpa/src/lpc2148_ug2864ambag01.c index ca43d455538..4fce79c5504 100644 --- a/boards/arm/lpc214x/zp214xpa/src/lpc2148_ug2864ambag01.c +++ b/boards/arm/lpc214x/zp214xpa/src/lpc2148_ug2864ambag01.c @@ -1,5 +1,5 @@ /**************************************************************************** - * config/zp214xpa/src/lpc2148_ug2864ambag01.c + * boards/arm/lpc214x/zp214xpa/src/lpc2148_ug2864ambag01.c * * Copyright (C) 2012 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -56,7 +56,9 @@ /**************************************************************************** * Pre-processor Definitions ****************************************************************************/ + /* Configuration ************************************************************/ + /* The pin configurations here requires that SPI1 is avaialable */ /* SPI should be configured with CMD/DATA support (and no transfer methods) */ @@ -66,6 +68,7 @@ #endif /* Pin Configuration ********************************************************/ + /* UG-2864AMBAG01 OLED Display: * * PIN NAME PIN CONFIGURATION diff --git a/boards/arm/lpc214x/zp214xpa/tools/oocd.sh b/boards/arm/lpc214x/zp214xpa/tools/oocd.sh index d278dd4754b..b0eb0e1841f 100755 --- a/boards/arm/lpc214x/zp214xpa/tools/oocd.sh +++ b/boards/arm/lpc214x/zp214xpa/tools/oocd.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash # -# See boards/zp214xpa/README.txt for information about +# See boards/arm/lpc214x/zp214xpa/README.txt for information about # this file. TOPDIR=$1 @@ -19,7 +19,7 @@ OPENOCD_PATH="/usr/local/bin" TARGET_PATH="/usr/local/share/openocd/scripts" OPENOCD_EXE=openocd.exe -OPENOCD_CFG="${TOPDIR}/boards/zp214xpa/tools/olimex.cfg" +OPENOCD_CFG="${TOPDIR}/boards/arm/lpc214x/zp214xpa/tools/olimex.cfg" OPENOCD_ARGS="-f ${OPENOCD_CFG} -s ${TARGET_PATH}" if [ "X$2" = "X-d" ]; then diff --git a/boards/arm/lpc2378/olimex-lpc2378/include/board.h b/boards/arm/lpc2378/olimex-lpc2378/include/board.h index dfdc358bf4e..b510d35443e 100644 --- a/boards/arm/lpc2378/olimex-lpc2378/include/board.h +++ b/boards/arm/lpc2378/olimex-lpc2378/include/board.h @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/olimex-lpc2378/include/board.h + * boards/arm/lpc2378/olimex-lpc2378/include/board.h * * Copyright (C) 2010 Rommel Marcelo. All rights reserved. * Author: Rommel Marcelo @@ -38,12 +38,12 @@ * ****************************************************************************/ -#ifndef __BOARDS_ARM_OLIMEX_LPC2378_INCLUDE_BOARD_H -#define __BOARDS_ARM_OLIMEX_LPC2378_INCLUDE_BOARD_H +#ifndef __BOARDS_ARM_LPC2348_OLIMEX_LPC2378_INCLUDE_BOARD_H +#define __BOARDS_ARM_LPC2348_OLIMEX_LPC2378_INCLUDE_BOARD_H -/************************************************************************************ +/**************************************************************************** * Pre-processor Definitions - ************************************************************************************/ + ****************************************************************************/ /* If USB is enabled, PLL must be configured for 48MHz to provide USB * clocking. @@ -69,7 +69,7 @@ #define LPC23XX_CCLK 57600000 - /* LED definitions **********************************************************/ +/* LED definitions **********************************************************/ #define LED_STARTED 0 #define LED_HEAPALLOCATE 1 @@ -84,4 +84,4 @@ * Inline Functions ****************************************************************************/ -#endif /* __BOARDS_ARM_OLIMEX_LPC2378_INCLUDE_BOARD_H */ +#endif /* __BOARDS_ARM_LPC2348_OLIMEX_LPC2378_INCLUDE_BOARD_H */ diff --git a/boards/arm/lpc2378/olimex-lpc2378/scripts/Make.defs b/boards/arm/lpc2378/olimex-lpc2378/scripts/Make.defs index e3c79409442..6d3c7b676b7 100644 --- a/boards/arm/lpc2378/olimex-lpc2378/scripts/Make.defs +++ b/boards/arm/lpc2378/olimex-lpc2378/scripts/Make.defs @@ -1,5 +1,5 @@ ############################################################################## -# boards/olimex-lpc2378/scripts/Make.defs +# boards/arm/lpc2378/olimex-lpc2378/scripts/Make.defs # # Copyright (C) 2010 Rommel Marcelo. All rights reserved. # Author: Rommel Marcelo diff --git a/boards/arm/lpc2378/olimex-lpc2378/scripts/ld.script b/boards/arm/lpc2378/olimex-lpc2378/scripts/ld.script index 0cd2ba0b4ac..a8686181fe1 100644 --- a/boards/arm/lpc2378/olimex-lpc2378/scripts/ld.script +++ b/boards/arm/lpc2378/olimex-lpc2378/scripts/ld.script @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/olimex-lpc2378/scripts/ld.script + * boards/arm/lpc2378/olimex-lpc2378/scripts/ld.script * * Copyright (C) 2010 Rommel Marcelo. All rights reserved. * Author: Rommel Marcelo diff --git a/boards/arm/lpc2378/olimex-lpc2378/src/Makefile b/boards/arm/lpc2378/olimex-lpc2378/src/Makefile index 111bb21c607..4f9286f8c8f 100644 --- a/boards/arm/lpc2378/olimex-lpc2378/src/Makefile +++ b/boards/arm/lpc2378/olimex-lpc2378/src/Makefile @@ -1,5 +1,5 @@ ############################################################################ -# boards/mcu123-lpc214x/src/Makefile +# boards/arm/lpc2378/olimex-lpc2378/src/Makefile # # Copyright (C) 2010 Rommel Marcelo. All rights reserved. # Author: Rommel Marcelo diff --git a/boards/arm/lpc2378/olimex-lpc2378/src/lpc2378_appinit.c b/boards/arm/lpc2378/olimex-lpc2378/src/lpc2378_appinit.c index 766295c27af..3f0a77c94ec 100644 --- a/boards/arm/lpc2378/olimex-lpc2378/src/lpc2378_appinit.c +++ b/boards/arm/lpc2378/olimex-lpc2378/src/lpc2378_appinit.c @@ -1,5 +1,5 @@ /**************************************************************************** - * config/olimex-lpc2378/src/lpc2378_appinit.c + * boards/arm/lpc2378/olimex-lpc2378/src/lpc2378_appinit.c * * Copyright (C) 2010, 2016 Rommel Marcelo. All rights reserved. * Author: Rommel Marcelo diff --git a/boards/arm/lpc2378/olimex-lpc2378/src/lpc2378_leds.c b/boards/arm/lpc2378/olimex-lpc2378/src/lpc2378_leds.c index 01879f16bbf..650083b6afb 100644 --- a/boards/arm/lpc2378/olimex-lpc2378/src/lpc2378_leds.c +++ b/boards/arm/lpc2378/olimex-lpc2378/src/lpc2378_leds.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/olimex-lpc2378/src/lpc2378_leds.c + * boards/arm/lpc2378/olimex-lpc2378/src/lpc2378_leds.c * * Copyright (C) 2010 Rommel Marcelo. All rights reserved. * Author: Rommel Marcelo diff --git a/boards/arm/lpc31xx/ea3131/README.txt b/boards/arm/lpc31xx/ea3131/README.txt index b9f1f9ca7dd..92a6a676f47 100644 --- a/boards/arm/lpc31xx/ea3131/README.txt +++ b/boards/arm/lpc31xx/ea3131/README.txt @@ -195,11 +195,11 @@ Image Format it! To work around both of these issues, I have created a small program under - boards/ea3131/tools to add the header. This program can be built under + boards/arm/lpc31xx/ea3131/tools to add the header. This program can be built under either Linux or Cygwin (and probably other tool environments as well). That tool can be built as follows: - - cd boards/ea3131/tools + - cd boards/arm/lpc31xx/ea3131/tools - make Then, to build the NuttX binary ready to load with the bootloader, just @@ -216,10 +216,10 @@ Image Format to mklpc.sh in the final step. 2. You can instruct Symantec to ignore the errors and it will stop quarantining the NXP program. - 3. The CRC32 logic in boards/ea3131/tools doesn't seem to work. As a result, + 3. The CRC32 logic in boards/arm/lpc31xx/ea3131/tools doesn't seem to work. As a result, the CRC is currently disabled in the header: - RCS file: /cvsroot/nuttx/nuttx/boards/ea3131/tools/lpchdr.c,v + RCS file: /cvsroot/nuttx/nuttx/boards/arm/lpc31xx/ea3131/tools/lpchdr.c,v retrieving revision 1.2 diff -r1.2 lpchdr.c 264c264 @@ -262,7 +262,7 @@ Using OpenOCD and GDB Then you should be able to start the OpenOCD daemon like: - boards/ea3131/tools/oocd.sh $PWD + boards/arm/lpc31xx/ea3131/tools/oocd.sh $PWD Where it is assumed that you are executing oocd.sh from the top level directory where NuttX is installed. @@ -282,7 +282,8 @@ On-Demand Paging ^^^^^^^^^^^^^^^^ There is a configuration that was used to verify the On-Demand Paging - feature for the ARM926 (see https://bitbucket.org/nuttx/documentation/src/master/NuttXDemandPaging.html). + feature for the ARM926 + (see https://bitbucket.org/nuttx/documentation/src/master/NuttXDemandPaging.html). That configuration is contained in the pgnsh sub-directory. The pgnsh configuration is only a test configuration, and lacks some logic to provide the full On-Demand Paging solution (see below). @@ -383,16 +384,17 @@ On-Demand Paging This example uses a two-pass build. The top-level Makefile recognizes the configuration option CONFIG_BUILD_2PASS and will execute the Makefile in - boards/ea3131/locked/Makefile to build the first pass object, locked.r. + boards/arm/lpc31xx/ea3131/locked/Makefile to build the first pass object, locked.r. This first pass object contains all of the code that must be in the locked text region. The Makefile in arch/arm/src/Makefile then includes this 1st - pass in build, positioning it as controlled by boards/ea3131/scripts/pg-ld.script. + pass in build, positioning it as controlled by + boards/arm/lpc31xx/ea3131/scripts/pg-ld.script. Finishing the Example: ---------------------- This example is incomplete in that it does not have any media to reload the - page text region from: The file boards/ea3131/src/up_fillpage.c is only + page text region from: The file boards/arm/lpc31xx/ea3131/src/up_fillpage.c is only a stub. That logic to actually reload the page from some storage medium (among other things) would have to be implemented in order to complete this example. At present, the example works correctly up to the point where @@ -438,7 +440,8 @@ On-Demand Paging Alternative: ------------ - I have implemented an alternative within boards/ea3131/src/up_fillpage.c + I have implemented an alternative within + boards/arm/lpc31xx/ea3131/src/up_fillpage.c which is probably only useful for testing. Here is the usage module for this alternative diff --git a/boards/arm/lpc31xx/ea3131/include/board.h b/boards/arm/lpc31xx/ea3131/include/board.h index 1ecc21a783a..160a95cd955 100644 --- a/boards/arm/lpc31xx/ea3131/include/board.h +++ b/boards/arm/lpc31xx/ea3131/include/board.h @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/ea3131/include/board.h +/**************************************************************************** + * boards/arm/lpc31xx/ea3131/include/board.h * include/arch/board/board.h * * Copyright (C) 2009-2010, 2014 Gregory Nutt. All rights reserved. @@ -32,14 +32,14 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************************************/ + ****************************************************************************/ -#ifndef __ARCH_BOARD_BOARD_H -#define __ARCH_BOARD_BOARD_H +#ifndef __BOARDS_ARM_LPC31XX_EA3131_INCLUDE_BOARD_H +#define __BOARDS_ARM_LPC31XX_EA3131_INCLUDE_BOARD_H -/************************************************************************************ +/**************************************************************************** * Included Files - ************************************************************************************/ + ****************************************************************************/ #include #ifndef __ASSEMBLY__ @@ -47,11 +47,12 @@ # include "lpc31_cgudrvr.h" #endif -/************************************************************************************ +/**************************************************************************** * Pre-processor Definitions - ************************************************************************************/ + ****************************************************************************/ + +/* Clocking *****************************************************************/ -/* Clocking *************************************************************************/ /* Frequency of the FFAST input */ #define BOARD_FREQIN_FFAST (12000000) /* ffast (12 MHz crystal) */ @@ -80,8 +81,8 @@ #define BOARD_HPLL1_MODE 0 /* PLL mode */ #define BOARD_HPLL1_FREQ 180000000 /* Frequency of the PLL in MHz */ -/* The following 3 bitsets determine which clocks will be enabled at initialization - * time. +/* The following 3 bitsets determine which clocks will be enabled at + * initialization time. */ #define BOARD_CLKS_0_31 \ @@ -100,7 +101,7 @@ #define BOARD_CLKS_64_92 \ (0) -/* LED definitions ******************************************************************/ +/* LED definitions **********************************************************/ #define LED_STARTED 0 #define LED_HEAPALLOCATE 1 @@ -111,6 +112,6 @@ #define LED_ASSERTION 6 #define LED_PANIC 7 -/* Button definitions ***************************************************************/ +/* Button definitions *******************************************************/ -#endif /* __ARCH_BOARD_BOARD_H */ +#endif /* __BOARDS_ARM_LPC31XX_EA3131_INCLUDE_BOARD_H */ diff --git a/boards/arm/lpc31xx/ea3131/include/board_memorymap.h b/boards/arm/lpc31xx/ea3131/include/board_memorymap.h index 9e386723756..0d306dded02 100644 --- a/boards/arm/lpc31xx/ea3131/include/board_memorymap.h +++ b/boards/arm/lpc31xx/ea3131/include/board_memorymap.h @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/ea3131/include/board_memorymap.h +/**************************************************************************** + * boards/arm/lpc31xx/ea3131/include/board_memorymap.h * include/arch/board/board_memorymap.h * * Copyright (C) 2009-2011 Gregory Nutt. All rights reserved. @@ -32,27 +32,27 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************************************/ + ****************************************************************************/ -#ifndef __ARCH_BOARD_BOARD_MEMORYMAP_H -#define __ARCH_BOARD_BOARD_MEMORYMAP_H +#ifndef __BOARDS_ARM_LPC31XX_EA3131_INCLUDE_MEMORYMAP_H +#define __BOARDS_ARM_LPC31XX_EA3131INCLUDE_MEMORYMAP_H /* This file should never be included directly, but only indirectly via * lpc31_memorymap.h. */ -/************************************************************************************ +/**************************************************************************** * Included Files - ************************************************************************************/ + ****************************************************************************/ #include -/************************************************************************************ +/**************************************************************************** * Pre-processor Definitions - ************************************************************************************/ + ****************************************************************************/ -/* If the LPC31xx ROM page table is selected, then the board-logic is required - * to provide: +/* If the LPC31xx ROM page table is selected, then the board-logic is + * required to provide: * * PGTABLE_BASE_PADDR - The physical address of the page table in ROM, * PGTABLE_BASE_VADDR - The mapped address of the page table in ROM, and @@ -60,7 +60,7 @@ */ #ifdef CONFIG_ARCH_ROMPGTABLE - /* The LPC31xx ROM page table uses a 1-1 physical to virtual memory mapping */ + /* The LPC31xx ROM page table uses a 1-1 physical to virtual memory mapping */ # define LPC31_SHADOWSPACE_VSECTION 0x00000000 /* 0x00000000-0x00000fff: Shadow Area 4Kb */ # define LPC31_INTSRAM_VSECTION 0x11028000 /* Internal SRAM 96Kb-192Kb */ @@ -84,34 +84,35 @@ # define LPC31_INTC_VSECTION 0x60000000 /* 0x60000000-0x60000fff: Interrupt controller 4Kb */ # define LPC31_NAND_VSECTION 0x70000000 /* 0x70000000-0x700007ff: NANDFLASH Ctrl 2Kb */ - /* Define the address of the page table within the ROM */ + /* Define the address of the page table within the ROM */ # define ROMPGTABLE_OFFSET 0x0001c000 /* Offset of the ROM page table in ROM */ # define PGTABLE_BASE_PADDR (LPC31_INTSROM0_PSECTION+ROMPGTABLE_OFFSET) # define PGTABLE_BASE_VADDR (LPC31_INTSROM0_VSECTION+ROMPGTABLE_OFFSET) #endif -/************************************************************************************ +/**************************************************************************** * Public Data - ************************************************************************************/ + ****************************************************************************/ #ifndef __ASSEMBLY__ #undef EXTERN #if defined(__cplusplus) #define EXTERN extern "C" -extern "C" { +extern "C" +{ #else #define EXTERN extern #endif -/************************************************************************************ +/**************************************************************************** * Public Function Prototypes - ************************************************************************************/ + ****************************************************************************/ #undef EXTERN #if defined(__cplusplus) } #endif #endif /* __ASSEMBLY__ */ -#endif /* __ARCH_BOARD_BOARD_MEMORYMAP_H */ +#endif /* __BOARDS_ARM_LPC31XX_EA3131_MEMORYMAP_H */ diff --git a/boards/arm/lpc31xx/ea3131/locked/Makefile b/boards/arm/lpc31xx/ea3131/locked/Makefile index 1c7ccc767bf..8216de1dccf 100644 --- a/boards/arm/lpc31xx/ea3131/locked/Makefile +++ b/boards/arm/lpc31xx/ea3131/locked/Makefile @@ -1,5 +1,5 @@ ############################################################################ -# boards/ea3131/locked/Makefile +# boards/arm/lpc31xx/ea3131/locked/Makefile # # Copyright (C) 2010 Gregory Nutt. All rights reserved. # Author: Gregory Nutt diff --git a/boards/arm/lpc31xx/ea3131/locked/ld-locked.script b/boards/arm/lpc31xx/ea3131/locked/ld-locked.script index a44cdc7ba0b..95bbd5e87a4 100644 --- a/boards/arm/lpc31xx/ea3131/locked/ld-locked.script +++ b/boards/arm/lpc31xx/ea3131/locked/ld-locked.script @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/ea3131/locked/ld-locked.script + * boards/arm/lpc31xx/ea3131/locked/ld-locked.script * * Copyright (C) 2010 Gregory Nutt. All rights reserved. * Author: Gregory Nutt diff --git a/boards/arm/lpc31xx/ea3131/locked/mklocked.sh b/boards/arm/lpc31xx/ea3131/locked/mklocked.sh index f807b2925f0..e0d31e1458d 100755 --- a/boards/arm/lpc31xx/ea3131/locked/mklocked.sh +++ b/boards/arm/lpc31xx/ea3131/locked/mklocked.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash ########################################################################### -# boards/ea3131/locked/mklocked.sh +# boards/arm/lpc31xx/ea3131/locked/mklocked.sh # # Copyright (C) 2010-2014, 2017 Gregory Nutt. All rights reserved. # Author: Gregory Nutt diff --git a/boards/arm/lpc31xx/ea3131/scripts/Make.defs b/boards/arm/lpc31xx/ea3131/scripts/Make.defs index 807d9b8f986..fa91b417a15 100644 --- a/boards/arm/lpc31xx/ea3131/scripts/Make.defs +++ b/boards/arm/lpc31xx/ea3131/scripts/Make.defs @@ -1,5 +1,5 @@ ############################################################################ -# boards/ea3131/scripts/Make.defs +# boards/arm/lpc31xx/ea3131/scripts/Make.defs # # Copyright (C) 2010, 2017 Gregory Nutt. All rights reserved. # Author: Gregory Nutt diff --git a/boards/arm/lpc31xx/ea3131/scripts/ld.script b/boards/arm/lpc31xx/ea3131/scripts/ld.script index 4785687cf30..8d082553d14 100644 --- a/boards/arm/lpc31xx/ea3131/scripts/ld.script +++ b/boards/arm/lpc31xx/ea3131/scripts/ld.script @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/ea3131/scripts/ld.script + * boards/arm/lpc31xx/ea3131/scripts/ld.script * * Copyright (C) 2010-2012 Gregory Nutt. All rights reserved. * Author: Gregory Nutt diff --git a/boards/arm/lpc31xx/ea3131/scripts/pg-ld.script b/boards/arm/lpc31xx/ea3131/scripts/pg-ld.script index 888c9653955..a634dc378b9 100644 --- a/boards/arm/lpc31xx/ea3131/scripts/pg-ld.script +++ b/boards/arm/lpc31xx/ea3131/scripts/pg-ld.script @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/ea3131/scripts/pg-ld.script + * boards/arm/lpc31xx/ea3131/scripts/pg-ld.script * * Copyright (C) 2010, 2012 Gregory Nutt. All rights reserved. * Author: Gregory Nutt diff --git a/boards/arm/lpc31xx/ea3131/src/Makefile b/boards/arm/lpc31xx/ea3131/src/Makefile index 9d23a16d1c8..0b73af399c4 100644 --- a/boards/arm/lpc31xx/ea3131/src/Makefile +++ b/boards/arm/lpc31xx/ea3131/src/Makefile @@ -1,5 +1,5 @@ ############################################################################ -# boards/ea3131/src/Makefile +# boards/arm/lpc31xx/ea3131/src/Makefile # # Copyright (C) 2009-2010 Gregory Nutt. All rights reserved. # Author: Gregory Nutt diff --git a/boards/arm/lpc31xx/ea3131/src/ea3131.h b/boards/arm/lpc31xx/ea3131/src/ea3131.h index da735d002d0..8eff6b3038b 100644 --- a/boards/arm/lpc31xx/ea3131/src/ea3131.h +++ b/boards/arm/lpc31xx/ea3131/src/ea3131.h @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/ea3131/src/ea3131.h +/**************************************************************************** + * boards/arm/lpc31xx/ea3131/src/ea3131.h * * Copyright (C) 2009-2010,2012 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -31,14 +31,14 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************************************/ + ****************************************************************************/ -#ifndef __BOARDS_ARM_EA3131_SRC_EA3131_H -#define __BOARDS_ARM_EA3131_SRC_EA3131_H +#ifndef __BOARDS_ARM_LPC31XX_EA3131_SRC_EA3131_H +#define __BOARDS_ARM_LPC31XX_EA3131_SRC_EA3131_H -/************************************************************************************ +/**************************************************************************** * Included Files - ************************************************************************************/ + ****************************************************************************/ #include #include @@ -46,109 +46,111 @@ #include "lpc31_ioconfig.h" -/************************************************************************************ +/**************************************************************************** * Pre-processor Definitions - ************************************************************************************/ + ****************************************************************************/ -/* EA3131L GPIOs ********************************************************************/ +/* EA3131L GPIOs ************************************************************/ /* LEDs -- interface through an I2C GPIO expander */ /* BUTTONS -- NOTE that some have EXTI interrupts configured */ /* SPI Chip Selects */ + /* SPI NOR flash is the only device on SPI. SPI_CS_OUT0 is its chip select */ #define SPINOR_CS IOCONFIG_SPI_CSOUT0 /* USB Soft Connect Pullup -- NONE */ -/************************************************************************************ +/**************************************************************************** * Public Types - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Public data - ************************************************************************************/ + ****************************************************************************/ #ifndef __ASSEMBLY__ -/************************************************************************************ +/**************************************************************************** * Public Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Name: lpc31_meminitialize * * Description: * Initialize external memory resources (sram, sdram, nand, nor, etc.) * - ************************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_LPC31_EXTDRAM void lpc31_meminitialize(void); #endif -/************************************************************************************ +/**************************************************************************** * Name: lpc31_spidev_initialize * * Description: * Called to configure SPI chip select GPIO pins for the EA3131 board. * - ************************************************************************************/ + ****************************************************************************/ void weak_function lpc31_spidev_initialize(void); -/************************************************************************************ +/**************************************************************************** * Name: lpc31_usbdev_initialize * * Description: * Called to setup USB-related GPIO pins for the EA3131 board. * - ************************************************************************************/ + ****************************************************************************/ #if defined(CONFIG_LPC31_USBOTG) && defined(CONFIG_USBDEV) void weak_function lpc31_usbdev_initialize(void); #endif -/************************************************************************************ +/**************************************************************************** * Name: lpc31_usbhost_bootinitialize * * Description: - * Called from lpc31_boardinitialize very early in inialization to setup USB - * host-related GPIO pins for the EA3131 board. + * Called from lpc31_boardinitialize very early in inialization to setup + * USB host-related GPIO pins for the EA3131 board. * - ************************************************************************************/ + ****************************************************************************/ #if defined(CONFIG_LPC31_USBOTG) && defined(CONFIG_USBHOST) void weak_function lpc31_usbhost_bootinitialize(void); #endif -/*********************************************************************************** +/**************************************************************************** * Name: lpc31_usbhost_initialize * * Description: - * Called at application startup time to initialize the USB host functionality. + * Called at application startup time to initialize the USB host + * functionality. * This function will start a thread that will monitor for device * connection/disconnection events. * - ***********************************************************************************/ + ****************************************************************************/ #if defined(CONFIG_LPC31_USBOTG) && defined(CONFIG_USBHOST) int lpc31_usbhost_initialize(void); #endif -/************************************************************************************ +/**************************************************************************** * Name: lpc31_pginitialize * * Description: * Set up mass storage device to support on demand paging. * - ************************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_PAGING void weak_function lpc31_pginitialize(void); #endif #endif /* __ASSEMBLY__ */ -#endif /* __BOARDS_ARM_EA3131_SRC_EA3131_H */ +#endif /* __BOARDS_ARM_LPC31XX_EA3131_SRC_EA3131_H */ diff --git a/boards/arm/lpc31xx/ea3131/src/lpc31_appinit.c b/boards/arm/lpc31xx/ea3131/src/lpc31_appinit.c index ef581641d25..f0cb1c3e0ba 100644 --- a/boards/arm/lpc31xx/ea3131/src/lpc31_appinit.c +++ b/boards/arm/lpc31xx/ea3131/src/lpc31_appinit.c @@ -1,5 +1,5 @@ /**************************************************************************** - * config/ea3131/src/lpc31_appinit.c + * boards/arm/lpc31xx/ea3131/src/lpc31_appinit.c * * Copyright (C) 2009, 2012, 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -72,7 +72,7 @@ # define CONFIG_NSH_MMCSDSLOTNO 0 # endif #else - /* Add configuration for new LPC31XX boards here */ + /* Add configuration for new LPC31XX boards here */ # error "Unrecognized LPC31XX board" # undef NSH_HAVEUSBDEV @@ -85,8 +85,8 @@ # undef NSH_HAVEUSBDEV #endif -/* Can't support MMC/SD features if mountpoints are disabled or if SDIO support - * is not enabled. +/* Can't support MMC/SD features if mountpoints are disabled or if SDIO + * support is not enabled. */ #if defined(CONFIG_DISABLE_MOUNTPOINT) || !defined(CONFIG_LPC31_MCI) @@ -151,18 +151,19 @@ int board_app_initialize(uintptr_t arg) ret = mmcsd_slotinitialize(CONFIG_NSH_MMCSDMINOR, sdio); if (ret != OK) { - syslog(LOG_ERR, "ERROR: Failed to bind SDIO to the MMC/SD driver: %d\n", ret); + syslog(LOG_ERR, + "ERROR: Failed to bind SDIO to the MMC/SD driver: %d\n", ret); return ret; } syslog(LOG_INFO, "Successfully bound SDIO to the MMC/SD driver\n"); - /* Then let's guess and say that there is a card in the slot. I need to check to - * see if the LPC313X10E-EVAL board supports a GPIO to detect if there is a card in - * the slot. + /* Then let's guess and say that there is a card in the slot. + * I need to check to see if the LPC313X10E-EVAL board supports a GPIO to + * detect if there is a card in the slot. */ - sdio_mediachange(sdio, true); + sdio_mediachange(sdio, true); #endif return OK; } diff --git a/boards/arm/lpc31xx/ea3131/src/lpc31_boot.c b/boards/arm/lpc31xx/ea3131/src/lpc31_boot.c index 0a31a92912c..8c89c9e7fbc 100644 --- a/boards/arm/lpc31xx/ea3131/src/lpc31_boot.c +++ b/boards/arm/lpc31xx/ea3131/src/lpc31_boot.c @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/ea3131/src/lpc31_boot.c +/**************************************************************************** + * boards/arm/lpc31xx/ea3131/src/lpc31_boot.c * * Copyright (C) 2009, 2012, 2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -31,11 +31,11 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Included Files - ************************************************************************************/ + ****************************************************************************/ #include @@ -49,27 +49,28 @@ #include "lpc31.h" #include "ea3131.h" -/************************************************************************************ +/**************************************************************************** * Pre-processor Definitions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Private Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Public Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Name: lpc31_boardinitialize * * Description: - * All LPC31XX architectures must provide the following entry point. This entry - * point is called early in the intitialization -- after all memory has been - * configured and mapped but before any devices have been initialized. + * All LPC31XX architectures must provide the following entry point. + * This entry point is called early in the intitialization -- after all + * memory has been configured and mapped but before any devices have been + * initialized. * - ************************************************************************************/ + ****************************************************************************/ void lpc31_boardinitialize(void) { @@ -79,8 +80,8 @@ void lpc31_boardinitialize(void) lpc31_meminitialize(); #endif - /* Configure SPI chip selects if 1) SPI is not disabled, and 2) the weak function - * lpc31_spidev_initialize() has been brought into the link. + /* Configure SPI chip selects if 1) SPI is not disabled, and 2) the weak + * function lpc31_spidev_initialize() has been brought into the link. */ #if defined(CONFIG_LPC31_SPI) @@ -90,10 +91,10 @@ void lpc31_boardinitialize(void) } #endif - /* Initialize USB is 1) USBDEV is selected, 2) the USB controller is not - * disabled, and 3) the weak function lpc31_usbdev_initialize() has been brought - * into the build. - */ + /* Initialize USB is 1) USBDEV is selected, 2) the USB controller is not + * disabled, and 3) the weak function lpc31_usbdev_initialize() has been + * brought into the build. + */ #if defined(CONFIG_USBDEV) && defined(CONFIG_LPC31_USBOTG) if (lpc31_usbdev_initialize) @@ -104,8 +105,8 @@ void lpc31_boardinitialize(void) /* Initialize USB if the 1) the HS host or device controller is in the * configuration and 2) the weak function lpc31_usbhost_bootinitialize() has - * been brought into the build. Presumably either CONFIG_USBDEV or CONFIG_USBHOST - * is also selected. + * been brought into the build. Presumably either CONFIG_USBDEV or + * CONFIG_USBHOST is also selected. */ #if defined(CONFIG_SAMA5_UHPHS) || defined(CONFIG_SAMA5_UDPHS) diff --git a/boards/arm/lpc31xx/ea3131/src/lpc31_buttons.c b/boards/arm/lpc31xx/ea3131/src/lpc31_buttons.c index 9ef45025090..72ad3db9334 100644 --- a/boards/arm/lpc31xx/ea3131/src/lpc31_buttons.c +++ b/boards/arm/lpc31xx/ea3131/src/lpc31_buttons.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/ea3131/src/lpc31_buttons.c + * boards/arm/lpc31xx/ea3131/src/lpc31_buttons.c * * Copyright (C) 2009-2010, 2014-2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt diff --git a/boards/arm/lpc31xx/ea3131/src/lpc31_clkinit.c b/boards/arm/lpc31xx/ea3131/src/lpc31_clkinit.c index b785cfa0322..d1b5acfc3cf 100644 --- a/boards/arm/lpc31xx/ea3131/src/lpc31_clkinit.c +++ b/boards/arm/lpc31xx/ea3131/src/lpc31_clkinit.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/ea3131/src/lpc31_clkinit.c + * boards/arm/lpc31xx/ea3131/src/lpc31_clkinit.c * * Copyright (C) 2009-2010 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -51,6 +51,7 @@ ****************************************************************************/ /* Sub-domain Clock Bitsets *************************************************/ + /* The following bitsets group clocks into bitsets associated with each * domain and fractional divider subdomain. * @@ -132,8 +133,9 @@ #define CGU_CLKSET_DOMAIN2_DIV10 \ (_D2B(CLKID_PWMCLK)) -/* Domain 3 (DOMAINID_AHB0APB2), Clocks 50-57, Fraction dividers 11-13. Clocks - * not defined in the clock sets will be sourced with AHB_APB2_BASE_CLK. +/* Domain 3 (DOMAINID_AHB0APB2), Clocks 50-57, Fraction dividers 11-13. + * Clocks not defined in the clock sets will be sourced with + * AHB_APB2_BASE_CLK. */ /* Domain 3, Fractional divider 11: */ @@ -177,8 +179,9 @@ #define CGU_CLKSET_DOMAIN6_DIV16 \ (0) -/* Domain 7 (DOMAINID_CLK1024FS), Clocks 73-86, Fraction dividers 17-22. Clocks - * not defined in the clock sets will be sourced with CLK1024FS_BASE_CLK. +/* Domain 7 (DOMAINID_CLK1024FS), Clocks 73-86, Fraction dividers 17-22. + * Clocks not defined in the clock sets will be sourced with + * CLK1024FS_BASE_CLK. */ /* Domain 7, Fractional divider 17: */ @@ -428,7 +431,6 @@ const struct lpc31_clkinit_s g_boardclks = #endif }; - /**************************************************************************** * Private Functions ****************************************************************************/ diff --git a/boards/arm/lpc31xx/ea3131/src/lpc31_fillpage.c b/boards/arm/lpc31xx/ea3131/src/lpc31_fillpage.c index 3d0d9eaf2c1..6db0970489b 100644 --- a/boards/arm/lpc31xx/ea3131/src/lpc31_fillpage.c +++ b/boards/arm/lpc31xx/ea3131/src/lpc31_fillpage.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/ea3131/src/lpc31_fillpage.c + * boards/arm/lpc31xx/ea3131/src/lpc31_fillpage.c * * Copyright (C) 2010, 2012-2013, 20172018 Gregory Nutt. All rights * reserved. @@ -86,7 +86,8 @@ # undef CONFIG_EA3131_PAGING_SDSLOT # endif #else - /* Add configuration for new LPC31XX boards here */ + /* Add configuration for new LPC31XX boards here */ + # error "Unrecognized LPC31XX board" # undef CONFIG_EA3131_PAGING_SDSLOT # undef HAVE_SD @@ -112,16 +113,16 @@ #ifdef CONFIG_PAGING_BINPATH - /* Can't support SD if the board does not support SD (duh) */ + /* Can't support SD if the board does not support SD (duh) */ # if defined(CONFIG_EA3131_PAGING_SDSLOT) && !defined(HAVE_SD) # error "This board does not support SD" # undef CONFIG_EA3131_PAGING_SDSLOT # endif - /* Can't support SD if mountpoints are disabled or if SDIO support - * is not enabled. - */ + /* Can't support SD if mountpoints are disabled or if SDIO support + * is not enabled. + */ # if defined(CONFIG_DISABLE_MOUNTPOINT) || !defined(CONFIG_LPC31_MCI) # ifdef CONFIG_EA3131_PAGING_SDSLOT @@ -131,7 +132,7 @@ # undef HAVE_SD # endif - /* A mountpoint for the FAT file system must be provided */ + /* A mountpoint for the FAT file system must be provided */ # if !defined(CONFIG_EA3131_PAGING_MOUNTPT) && defined(CONFIG_EA3131_PAGING_SDSLOT) # error "No CONFIG_EA3131_PAGING_MOUNTPT provided" @@ -139,7 +140,7 @@ # undef HAVE_SD # endif - /* If no minor number is provided, default to zero */ + /* If no minor number is provided, default to zero */ # ifndef CONFIG_EA3131_PAGING_MINOR # define CONFIG_EA3131_PAGING_MINOR 0 @@ -151,21 +152,21 @@ #if defined(CONFIG_PAGING_M25PX) || defined(CONFIG_PAGING_AT45DB) - /* Verify that SPI support is enabld */ + /* Verify that SPI support is enabld */ #ifndef CONFIG_LPC31_SPI # error "SPI support is not enabled" #endif - /* Make sure that some value is defined for the offset into the FLASH - * of the NuttX binary image. - */ + /* Make sure that some value is defined for the offset into the FLASH + * of the NuttX binary image. + */ # ifndef CONFIG_EA3131_PAGING_BINOFFSET # define CONFIG_EA3131_PAGING_BINOFFSET 0 # endif - /* Make sure that some value is defined for the SPI port number */ + /* Make sure that some value is defined for the SPI port number */ # ifndef CONFIG_EA3131_PAGING_SPIPORT # define CONFIG_EA3131_PAGING_SPIPORT 0 @@ -224,9 +225,9 @@ static struct pg_source_s g_pgsrc; * * Description: * Initialize the source device that will support paging. - * If BINPATH is defined, then it is the full path to a file on a mounted file - * system. In this case initialization will be deferred until the first - * time that up_fillpage() is called. + * If BINPATH is defined, then it is the full path to a file on a mounted + * file system. In this case initialization will be deferred until the + * first time that up_fillpage() is called. * ****************************************************************************/ @@ -271,7 +272,8 @@ static inline void lpc31_initsrc(void) /* Now mount the file system */ snprintf(devname, 16, "/dev/mmcsd%d", CONFIG_EA3131_PAGING_MINOR); - ret = mount(devname, CONFIG_EA3131_PAGING_MOUNTPT, "vfat", MS_RDONLY, NULL); + ret = mount(devname, CONFIG_EA3131_PAGING_MOUNTPT, "vfat", MS_RDONLY, + NULL); DEBUGASSERT(ret == OK); #endif /* CONFIG_EA3131_PAGING_SDSLOT */ @@ -326,7 +328,8 @@ static inline void lpc31_initsrc(void) * from the size of a pointer). */ - ret = MTD_IOCTL(g_pgsrc.mtd, MTDIOC_GEOMETRY, (unsigned long)&g_pgsrc.geo); + ret = MTD_IOCTL(g_pgsrc.mtd, MTDIOC_GEOMETRY, + (unsigned long)&g_pgsrc.geo); DEBUGASSERT(ret >= 0); capacity = g_pgsrc.geo.erasesize*g_pgsrc.geo.neraseblocks; pginfo("capacity: %d\n", capacity); @@ -360,11 +363,12 @@ static inline void lpc31_initsrc(void) * This callback is assumed to occur from an interrupt level when the * device driver completes the fill operation. * - * NOTE 1: Allocating and filling a page is a two step process. up_allocpage() + * NOTE 1: + * Allocating and filling a page is a two step process. up_allocpage() * allocates the page, and up_fillpage() fills it with data from some non- * volatile storage device. This distinction is made because up_allocpage() - * can probably be implemented in board-independent logic whereas up_fillpage() - * probably must be implemented as board-specific logic. + * can probably be implemented in board-independent logic whereas + * up_fillpage() probably must be implemented as board-specific logic. * * NOTE 2: The initial mapping of vpage will be read-able, write-able, * but non-cacheable. No special actions will be required of @@ -417,9 +421,9 @@ int up_fillpage(FAR struct tcb_s *tcb, FAR void *vpage) pginfo("TCB: %p vpage: %p far: %08x\n", tcb, vpage, tcb->xcp.far); DEBUGASSERT(tcb->xcp.far >= PG_PAGED_VBASE && tcb->xcp.far < PG_PAGED_VEND); - /* If BINPATH is defined, then it is the full path to a file on a mounted file - * system. In this case initialization will be deferred until the first - * time that up_fillpage() is called. Are we initialized? + /* If BINPATH is defined, then it is the full path to a file on a mounted + * file system. In this case initialization will be deferred until the + * first time that up_fillpage() is called. Are we initialized? */ #if defined(CONFIG_PAGING_BINPATH) @@ -475,7 +479,8 @@ int up_fillpage(FAR struct tcb_s *tcb, FAR void *vpage) /* Version 2: Supports non-blocking, asynchronous fill operations */ -int up_fillpage(FAR struct tcb_s *tcb, FAR void *vpage, up_pgcallback_t pg_callback) +int up_fillpage(FAR struct tcb_s *tcb, FAR void *vpage, + up_pgcallback_t pg_callback) { pginfo("TCB: %p vpage: %d far: %08x\n", tcb, vpage, tcb->xcp.far); DEBUGASSERT(tcb->xcp.far >= PG_PAGED_VBASE && tcb->xcp.far < PG_PAGED_VEND); @@ -493,33 +498,36 @@ int up_fillpage(FAR struct tcb_s *tcb, FAR void *vpage, up_pgcallback_t pg_callb #endif /* CONFIG_PAGING_BLOCKINGFILL */ -/************************************************************************************ +/**************************************************************************** * Name: lpc31_pginitialize * * Description: * Set up mass storage device to support on demand paging. * - ************************************************************************************/ + ****************************************************************************/ void weak_function lpc31_pginitialize(void) { - /* This initialization does nothing in this example setup. But this function is - * where you might, for example: + /* This initialization does nothing in this example setup. + * But this function is where you might, for example: * - * - Initialize and configure a mass storage device to support on-demand paging. - * This might be, perhaps an SD card or NAND memory. An SPI FLASH would probably - * already have been configured by lpc31_spidev_initialize(void); - * - Set up resources to support up_fillpage() operation. For example, perhaps the - * the text image is stored in a named binary file. In this case, the virtual - * text addresses might map to offsets into that file. - * - Do whatever else is necessary to make up_fillpage() ready for the first time - * that it is called. + * - Initialize and configure a mass storage device to support on-demand + * paging. This might be, perhaps an SD card or NAND memory. + * An SPI FLASH would probably already have been configured by + * lpc31_spidev_initialize(void); + * - Set up resources to support up_fillpage() operation. For example, + * perhaps the text image is stored in a named binary file. + * In this case, the virtual text addresses might map to offsets into that + * file. + * - Do whatever else is necessary to make up_fillpage() ready for the first + * time that it is called. * - * In reality, however, this function is not very useful: This function is called - * from a low level (before nx_start() is even called), it may not be possible to - * perform file system operations or even to get debug output yet. Therefore, - * to keep life simple, initialization will be deferred in all cases until the first - * time that up_fillpage() is called. + * In reality, however, this function is not very useful: + * This function is called from a low level (before nx_start() is even + * called), it may not be possible to perform file system operations or even + * to get debug output yet. Therefore, to keep life simple, initialization + * will be deferred in all cases until the first time that up_fillpage() + * is called. */ } diff --git a/boards/arm/lpc31xx/ea3131/src/lpc31_leds.c b/boards/arm/lpc31xx/ea3131/src/lpc31_leds.c index e42f333d948..9545a7b992e 100644 --- a/boards/arm/lpc31xx/ea3131/src/lpc31_leds.c +++ b/boards/arm/lpc31xx/ea3131/src/lpc31_leds.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/ea3131/src/lpc31_leds.c + * boards/arm/lpc31xx/ea3131/src/lpc31_leds.c * * Copyright (C) 2009-2010, 2013, 2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt diff --git a/boards/arm/lpc31xx/ea3131/src/lpc31_mem.c b/boards/arm/lpc31xx/ea3131/src/lpc31_mem.c index 353243412ac..9ab81af9378 100644 --- a/boards/arm/lpc31xx/ea3131/src/lpc31_mem.c +++ b/boards/arm/lpc31xx/ea3131/src/lpc31_mem.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/ea3131/src/lpc31_mem.c + * boards/arm/lpc31xx/ea3131/src/lpc31_mem.c * * Copyright (C) 2009-2010,2012 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -70,7 +70,7 @@ #define EA3131_MPMC_DELAY 0x824 -/*Delay constants in nanosecondss for MT48LC32M16LF SDRAM on board */ +/* Delay constants in nanosecondss for MT48LC32M16LF SDRAM on board */ #define EA3131_SDRAM_TRP (20) #define EA3131_SDRAM_TRFC (66) @@ -90,7 +90,7 @@ * the HCLK. */ -#define NS2HCLKS(ns,hclk2,mask) \ +#define NS2HCLKS(ns, hclk2, mask) \ ((uint32_t)(((uint64_t)ns *(uint64_t)hclk2) / 1000000000ull) & mask) /**************************************************************************** @@ -169,7 +169,10 @@ static void lpc31_sdraminitialize(void) # define HCLK hclk #endif - /* Check RTL for divide by 2 possible. If so change then enable the followng logic */ + /* Check RTL for divide by 2 possible. + * If so change then enable the followng logic + */ + #if 0 uint32_t hclk2 = hclk; @@ -189,9 +192,9 @@ static void lpc31_sdraminitialize(void) /* Configure device config register nSDCE0 for proper width SDRAM */ - putreg32((MPMC_DYNCONFIG0_MDSDRAM|MPMC_DYNCONFIG_HP16_32MX16), + putreg32((MPMC_DYNCONFIG0_MDSDRAM | MPMC_DYNCONFIG_HP16_32MX16), LPC31_MPMC_DYNCONFIG0); - putreg32((MPMC_DYNRASCAS0_RAS2CLK|MPMC_DYNRASCAS0_CAS2CLK), + putreg32((MPMC_DYNRASCAS0_RAS2CLK | MPMC_DYNRASCAS0_CAS2CLK), LPC31_MPMC_DYNRASCAS0); /* Min 20ns program 1 so that at least 2 HCLKs are used */ @@ -222,8 +225,8 @@ static void lpc31_sdraminitialize(void) /* Issue continuous NOP commands */ - putreg32((MPMC_DYNCONTROL_CE|MPMC_DYNCONTROL_CS|MPMC_DYNCONTROL_INOP), - LPC31_MPMC_DYNCONTROL); + putreg32((MPMC_DYNCONTROL_CE | MPMC_DYNCONTROL_CS | + MPMC_DYNCONTROL_INOP), LPC31_MPMC_DYNCONTROL); /* Wait ~200us */ @@ -231,8 +234,8 @@ static void lpc31_sdraminitialize(void) /* Issue a "pre-charge all" command */ - putreg32((MPMC_DYNCONTROL_CE|MPMC_DYNCONTROL_CS|MPMC_DYNCONTROL_IPALL), - LPC31_MPMC_DYNCONTROL); + putreg32((MPMC_DYNCONTROL_CE | MPMC_DYNCONTROL_CS | + MPMC_DYNCONTROL_IPALL), LPC31_MPMC_DYNCONTROL); /* Minimum refresh pulse interval (tRFC) for MT48LC32M16A2=80nsec, * 100nsec provides more than adequate interval. @@ -247,34 +250,35 @@ static void lpc31_sdraminitialize(void) /* Recommended refresh interval for normal operation of the Micron * MT48LC16LFFG = 7.8125usec (128KHz rate). ((HCLK / 128000) - 1) = - * refresh counter interval rate, (subtract one for safety margin). + * refresh counter interval rate, (subtract one for safety margin). */ - putreg32(NS2HCLKS(EA3131_SDRAM_OPERREFRESH, HCLK, MPMC_DYNREFRESH_TIMER_MASK), - LPC31_MPMC_DYNREFRESH); + putreg32(NS2HCLKS(EA3131_SDRAM_OPERREFRESH, HCLK, + MPMC_DYNREFRESH_TIMER_MASK), LPC31_MPMC_DYNREFRESH); /* Select mode register update mode */ - putreg32((MPMC_DYNCONTROL_CE|MPMC_DYNCONTROL_CS|MPMC_DYNCONTROL_IMODE), - LPC31_MPMC_DYNCONTROL); + putreg32((MPMC_DYNCONTROL_CE | MPMC_DYNCONTROL_CS | + MPMC_DYNCONTROL_IMODE), LPC31_MPMC_DYNCONTROL); /* Program the SDRAM internal mode registers on bank nSDCE0 and reconfigure - * the SDRAM chips. Bus speeds up to 90MHz requires use of a CAS latency = 2. + * the SDRAM chips. + * Bus speeds up to 90MHz requires use of a CAS latency = 2. * To get correct value on address bus CAS cycle, requires a shift by 13 for * 16bit mode */ (void)getreg32(LPC31_EXTSDRAM0_VSECTION | (0x23 << 13)); - putreg32((MPMC_DYNCONFIG0_MDSDRAM|MPMC_DYNCONFIG_HP16_32MX16), + putreg32((MPMC_DYNCONFIG0_MDSDRAM | MPMC_DYNCONFIG_HP16_32MX16), LPC31_MPMC_DYNCONFIG0); - putreg32((MPMC_DYNRASCAS0_RAS2CLK|MPMC_DYNRASCAS0_CAS2CLK), + putreg32((MPMC_DYNRASCAS0_RAS2CLK | MPMC_DYNRASCAS0_CAS2CLK), LPC31_MPMC_DYNRASCAS0); /* Select normal operating mode */ - putreg32((MPMC_DYNCONTROL_CE|MPMC_DYNCONTROL_CS|MPMC_DYNCONTROL_INORMAL), - LPC31_MPMC_DYNCONTROL); + putreg32((MPMC_DYNCONTROL_CE | MPMC_DYNCONTROL_CS | + MPMC_DYNCONTROL_INORMAL), LPC31_MPMC_DYNCONTROL); /* Enable buffers */ @@ -282,7 +286,7 @@ static void lpc31_sdraminitialize(void) regval |= MPMC_DYNCONFIG0_B; putreg32(regval, LPC31_MPMC_DYNCONFIG0); - putreg32((MPMC_DYNCONTROL_INORMAL|MPMC_DYNCONTROL_CS), + putreg32((MPMC_DYNCONTROL_INORMAL | MPMC_DYNCONTROL_CS), LPC31_MPMC_DYNCONTROL); } diff --git a/boards/arm/lpc31xx/ea3131/src/lpc31_spi.c b/boards/arm/lpc31xx/ea3131/src/lpc31_spi.c index dbcaf3a0d03..b52e681b610 100644 --- a/boards/arm/lpc31xx/ea3131/src/lpc31_spi.c +++ b/boards/arm/lpc31xx/ea3131/src/lpc31_spi.c @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/ea3131/src/lpc31_spi.c +/**************************************************************************** + * boards/arm/lpc31xx/ea3131/src/lpc31_spi.c * * Copyright (C) 2009-2012 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -31,11 +31,11 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Included Files - ************************************************************************************/ + ****************************************************************************/ #include @@ -52,38 +52,42 @@ #include "ea3131.h" #ifdef CONFIG_LPC31_SPI -#if 0 /* At present, EA3131 specific logic is hard-coded in the file lpc31_spi.c - * in arch/arm/src/lpc31xx */ +#if 0 +/* At present, EA3131 specific logic is hard-coded in the file lpc31_spi.c + * in arch/arm/src/lpc31xx + */ -/************************************************************************************ +/**************************************************************************** * Public Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Name: lpc31_spidev_initialize * * Description: * Called to configure SPI chip select GPIO pins for the EA3131 board. * - ************************************************************************************/ + ****************************************************************************/ void weak_function lpc31_spidev_initialize(void) { - /* NOTE: Clocking for SPI has already been provided. Pin configuration is performed - * on-the-fly, so no additional setup is required. + /* NOTE: Clocking for SPI has already been provided. + * Pin configuration is performed on-the-fly, + * so no additional setup is required. */ } -/************************************************************************************ +/**************************************************************************** * Name: lpc31_spiselect and lpc31_spistatus * * Description: * The external functions, lpc31_spiselect and lpc31_spistatus must be * provided by board-specific logic. They are implementations of the select * and status methods of the SPI interface defined by struct spi_ops_s (see - * include/nuttx/spi/spi.h). All other methods (including lpc31_spibus_initialize()) - * are provided by common LPC31XX logic. To use this common SPI logic on your - * board: + * include/nuttx/spi/spi.h). + * All other methods (including lpc31_spibus_initialize()) + * are provided by common LPC31XX logic. + * To use this common SPI logic on your board: * * 1. Provide logic in lpc31_boardinitialize() to configure SPI chip select * pins. @@ -92,16 +96,18 @@ void weak_function lpc31_spidev_initialize(void) * status operations using GPIOs in the way your board is configured. * 3. Add a calls to lpc31_spibus_initialize() in your low level application * initialization logic - * 4. The handle returned by lpc31_spibus_initialize() may then be used to bind the - * SPI driver to higher level logic (e.g., calling + * 4. The handle returned by lpc31_spibus_initialize() may then be used to + * bind the SPI driver to higher level logic (e.g., calling * mmcsd_spislotinitialize(), for example, will bind the SPI driver to * the SPI MMC/SD driver). * - ************************************************************************************/ + ****************************************************************************/ void lpc31_spiselect(FAR struct spi_dev_s *dev, uint32_t devid, bool selected) { - spiinfo("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); + spiinfo("devid: %d CS: %s\n", (int)devid, + selected ? "assert" : "de-assert"); + #warning "Missing logic" } diff --git a/boards/arm/lpc31xx/ea3131/src/lpc31_usbhost.c b/boards/arm/lpc31xx/ea3131/src/lpc31_usbhost.c index 8c53b786822..eb42c744121 100644 --- a/boards/arm/lpc31xx/ea3131/src/lpc31_usbhost.c +++ b/boards/arm/lpc31xx/ea3131/src/lpc31_usbhost.c @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/ea3131/src/lpc31_usbhost.c +/**************************************************************************** + * boards/arm/lpc31xx/ea3131/src/lpc31_usbhost.c * * Copyright (C) 2013, 2015-2017 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -31,11 +31,11 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Included Files - ************************************************************************************/ + ****************************************************************************/ #include @@ -60,9 +60,9 @@ #if defined(CONFIG_LPC31_USBOTG) || defined(CONFIG_USBHOST) -/************************************************************************************ +/**************************************************************************** * Pre-processor Definitions - ************************************************************************************/ + ****************************************************************************/ #ifndef CONFIG_USBHOST_DEFPRIO # define CONFIG_USBHOST_DEFPRIO 50 @@ -76,31 +76,32 @@ # endif #endif -/************************************************************************************ +/**************************************************************************** * Private Data - ************************************************************************************/ + ****************************************************************************/ + /* Retained device driver handle */ static struct usbhost_connection_s *g_ehciconn; -/************************************************************************************ +/**************************************************************************** * Private Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Name: ehci_waiter * * Description: * Wait for USB devices to be connected to the EHCI root hub. * - ************************************************************************************/ + ****************************************************************************/ static int ehci_waiter(int argc, char *argv[]) { FAR struct usbhost_hubport_s *hport; uinfo("ehci_waiter: Running\n"); - for (;;) + for (; ; ) { /* Wait for the device to change state */ @@ -123,48 +124,54 @@ static int ehci_waiter(int argc, char *argv[]) return 0; } -/************************************************************************************ +/**************************************************************************** * Public Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Name: lpc31_usbhost_bootinitialize * * Description: - * Called from lpc31_boardinitialize very early in inialization to setup USB - * host-related GPIO pins for the EA3131 board. + * Called from lpc31_boardinitialize very early in inialization to setup + * USB host-related GPIO pins for the EA3131 board. * - * USB host VBUS power is controlled by a Micrel USB power switch. That switch is - * driver by a discrete that comes from the I2C-contrrol PCA9532 GPIO expander. + * USB host VBUS power is controlled by a Micrel USB power switch. + * That switch is driver by a discrete that comes from the I2C-contrrol + * PCA9532 GPIO expander. * - ************************************************************************************/ + ****************************************************************************/ void weak_function lpc31_usbhost_bootinitialize(void) { - /* Get an instance of the I2C interface. This will be needed to control the - * PCA9532 GPIO expander. + /* Get an instance of the I2C interface. + * This will be needed to control the PCA9532 GPIO expander. */ + #warning Missing logic /* Use the I2C interface to initialize the PCA9532 GPIO expander driver */ + #warning Missing logic /* Configure pin to drive VBUS power using the PCA8532 GPIO expander */ + #warning Missing logic /* Configure pin to detect overrcurrent errors */ + #warning Missing logic } -/*********************************************************************************** +/**************************************************************************** * Name: lpc31_usbhost_initialize * * Description: - * Called at application startup time to initialize the USB host functionality. + * Called at application startup time to initialize the USB host + * functionality. * This function will start a thread that will monitor for device * connection/disconnection events. * - ***********************************************************************************/ + ****************************************************************************/ int lpc31_usbhost_initialize(void) { @@ -191,7 +198,8 @@ int lpc31_usbhost_initialize(void) ret = usbhost_msc_initialize(); if (ret != OK) { - usyslog(LOG_ERR, "ERROR: Failed to register the mass storage class: %d\n", ret); + usyslog(LOG_ERR, + "ERROR: Failed to register the mass storage class: %d\n", ret); } #endif @@ -238,27 +246,28 @@ int lpc31_usbhost_initialize(void) return OK; } -/*********************************************************************************** +/**************************************************************************** * Name: lpc31_usbhost_vbusdrive * * Description: - * Enable/disable driving of VBUS 5V output. This function must be provided by - * each platform that implements the OHCI or EHCI host interface + * Enable/disable driving of VBUS 5V output. + * This function must be provided by each platform that implements the OHCI + * or EHCI host interface * * Input Parameters: - * rhport - Selects root hub port to be powered host interface. Since the LPC31 - * has only a downstream port, zero is the only possible value for this - * parameter. + * rhport - Selects root hub port to be powered host interface. + * Since the LPC31 has only a downstream port, zero is the only possible + * value for this parameter. * enable - true: enable VBUS power; false: disable VBUS power * * Returned Value: * None * - ***********************************************************************************/ + ****************************************************************************/ void lpc31_usbhost_vbusdrive(int rhport, bool enable) { - uinfo("RHPort%d: enable=%d\n", rhport+1, enable); + uinfo("RHPort%d: enable=%d\n", rhport + 1, enable); /* The LPC3131 has only a single root hub port */ @@ -269,44 +278,48 @@ void lpc31_usbhost_vbusdrive(int rhport, bool enable) if (enable) { /* Enable the Power Switch by driving the enable pin low */ + #warning Missing logic } else { /* Disable the Power Switch by driving the enable pin high */ + #warning Missing logic } } } -/************************************************************************************ +/**************************************************************************** * Name: lpc31_setup_overcurrent * * Description: - * Setup to receive an interrupt-level callback if an overcurrent condition is - * detected. + * Setup to receive an interrupt-level callback if an overcurrent + * condition is detected. * * Input Parameters: * handler - New overcurrent interrupt handler * arg - The argument that will accompany the interrupt * * Returned Value: - * Zero (OK) returned on success; a negated errno value is returned on failure. + * Zero (OK) returned on success; a negated errno value is returned on + * failure. * - ************************************************************************************/ + ****************************************************************************/ #if 0 /* Not ready yet */ int lpc31_setup_overcurrent(xcpt_t handler, void *arg) { irqstate_t flags; - /* Disable interrupts until we are done. This guarantees that the - * following operations are atomic. + /* Disable interrupts until we are done. + * This guarantees that the following operations are atomic. */ flags = enter_critical_section(); /* Configure the interrupt */ + #warning Missing logic leave_critical_section(flags); diff --git a/boards/arm/lpc31xx/ea3131/tools/Makefile b/boards/arm/lpc31xx/ea3131/tools/Makefile index 1de2683f506..1b827b7f378 100644 --- a/boards/arm/lpc31xx/ea3131/tools/Makefile +++ b/boards/arm/lpc31xx/ea3131/tools/Makefile @@ -1,5 +1,5 @@ ############################################################################ -# boards/ea3131/tools/Makefile +# boards/arm/lpc31xx/ea3131/tools/Makefile # # Copyright (C) 2010 Gregory Nutt. All rights reserved. # Author: Gregory Nutt diff --git a/boards/arm/lpc31xx/ea3131/tools/crc32.c b/boards/arm/lpc31xx/ea3131/tools/crc32.c index 7ed1b25b7e2..d4dc61c58a6 100644 --- a/boards/arm/lpc31xx/ea3131/tools/crc32.c +++ b/boards/arm/lpc31xx/ea3131/tools/crc32.c @@ -1,5 +1,5 @@ /************************************************************************************************ - * boards/ea3131/tools/crc32.c + * boards/arm/lpc31xx/ea3131/tools/crc32.c * * This file is a part of NuttX: * diff --git a/boards/arm/lpc31xx/ea3131/tools/lpchdr.c b/boards/arm/lpc31xx/ea3131/tools/lpchdr.c index 618ff0f2841..ddd5653e109 100644 --- a/boards/arm/lpc31xx/ea3131/tools/lpchdr.c +++ b/boards/arm/lpc31xx/ea3131/tools/lpchdr.c @@ -1,5 +1,5 @@ /************************************************************************************ - * boards/ea3131/tools/lpchdr.c + * boards/arm/lpc31xx/ea3131/tools/lpchdr.c * * Copyright (C) 2010-2011 Gregory Nutt. All rights reserved. * Author: Gregory Nutt diff --git a/boards/arm/lpc31xx/ea3131/tools/lpchdr.h b/boards/arm/lpc31xx/ea3131/tools/lpchdr.h index 131197b9d54..d1293109a34 100644 --- a/boards/arm/lpc31xx/ea3131/tools/lpchdr.h +++ b/boards/arm/lpc31xx/ea3131/tools/lpchdr.h @@ -1,5 +1,5 @@ /************************************************************************************ - * boards/ea3131/tools/lpchdr.h + * boards/arm/lpc31xx/ea3131/tools/lpchdr.h * * Copyright (C) 2010 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -33,8 +33,8 @@ * ************************************************************************************/ -#ifndef __BOARDS_ARM_EA3131_TOOLS_LPCHDR_H -#define __BOARDS_ARM_EA3131_TOOLS_LPCHDR_H +#ifndef __BOARDS_ARM_LPC31XX_EA3131_TOOLS_LPCHDR_H +#define __BOARDS_ARM_LPC31XX_EA3131_TOOLS_LPCHDR_H /************************************************************************************ * Included Files @@ -101,5 +101,4 @@ struct lpc31_header_s extern uint32_t crc32part(const uint8_t *src, size_t len, uint32_t crc32val); extern uint32_t crc32(const uint8_t *src, size_t len); -#endif /* __BOARDS_ARM_EA3131_TOOLS_LPCHDR_H */ - +#endif /* __BOARDS_ARM_LPC31XX_EA3131_TOOLS_LPCHDR_H */ diff --git a/boards/arm/lpc31xx/ea3131/tools/mklpc.sh b/boards/arm/lpc31xx/ea3131/tools/mklpc.sh index 5ab3342d93b..fc4c516f801 100755 --- a/boards/arm/lpc31xx/ea3131/tools/mklpc.sh +++ b/boards/arm/lpc31xx/ea3131/tools/mklpc.sh @@ -1,13 +1,13 @@ #!/usr/bin/env bash -# This script lies in sub-directory boards/ea3131/tools but make be executed +# This script lies in sub-directory boards/arm/lpc31xx/ea3131/tools but make be executed # from either that directory or TOPDIR MYNAME=`basename $0` if [ -x "$PWD/$MYNAME" ]; then TOPDIR="$PWD/../../.." else - if [ -x "$PWD/boards/ea3131/tools/$MYNAME" ]; then + if [ -x "$PWD/boards/arm/lpc31xx/ea3131/tools/$MYNAME" ]; then TOPDIR="$PWD" else echo "This script must be executed from a known director" @@ -19,7 +19,7 @@ echo "TOOLDIR: $TOOLDIR" # The lpchdr could be named lpchdr.exe if we are running under Cygwin or # just lpchdr under Linux -TOOLDIR=$TOPDIR/boards/ea3131/tools +TOOLDIR=$TOPDIR/boards/arm/lpc31xx/ea3131/tools if [ ! -d "$TOOLDIR" ]; then echo "Tool directory $TOOLDIR does not exist" diff --git a/boards/arm/lpc31xx/ea3131/tools/oocd.sh b/boards/arm/lpc31xx/ea3131/tools/oocd.sh index fe51e412e59..8da64845aa1 100755 --- a/boards/arm/lpc31xx/ea3131/tools/oocd.sh +++ b/boards/arm/lpc31xx/ea3131/tools/oocd.sh @@ -10,9 +10,9 @@ fi OPENOCD_PATH="/cygdrive/c/gccfd/openocd/bin" OPENOCD_EXE=openocd-ftd2xx.exe -OPENOCD_CFG="${TOPDIR}/boards/ea3131/tools/armusbocd.cfg" +OPENOCD_CFG="${TOPDIR}/boards/arm/lpc31xx/ea3131/tools/armusbocd.cfg" OPENOCD_ARGS="-f `cygpath -w ${OPENOCD_CFG}`" -~/projects/nuttx/nuttx/boards/ea3131/tool +~/projects/nuttx/nuttx/boards/arm/lpc31xx/ea3131/tool if [ "X$2" = "X-d" ]; then OPENOCD_ARGS=$OPENOCD_ARGS" -d3" diff --git a/boards/arm/lpc31xx/ea3152/README.txt b/boards/arm/lpc31xx/ea3152/README.txt index 7e0655dc2f2..6f7186babc5 100644 --- a/boards/arm/lpc31xx/ea3152/README.txt +++ b/boards/arm/lpc31xx/ea3152/README.txt @@ -194,11 +194,11 @@ Image Format it! To work around both of these issues, I have created a small program under - boards/ea3152/tools to add the header. This program can be built under + boards/arm/lpc31xx/ea3152/tools to add the header. This program can be built under either Linux or Cygwin (and probably other tool environments as well). That tool can be built as follows: - - cd boards/ea3152/tools + - cd boards/arm/lpc31xx/ea3152/tools - make Then, to build the NuttX binary ready to load with the bootloader, just @@ -215,10 +215,10 @@ Image Format to mklpc.sh in the final step. 2. You can instruct Symantec to ignore the errors and it will stop quarantining the NXP program. - 3. The CRC32 logic in boards/ea3152/tools doesn't seem to work. As a result, + 3. The CRC32 logic in boards/arm/lpc31xx/ea3152/tools doesn't seem to work. As a result, the CRC is currently disabled in the header: - RCS file: /cvsroot/nuttx/nuttx/boards/ea3152/tools/lpchdr.c,v + RCS file: /cvsroot/nuttx/nuttx/boards/arm/lpc31xx/ea3152/tools/lpchdr.c,v retrieving revision 1.2 diff -r1.2 lpchdr.c 264c264 @@ -261,7 +261,7 @@ Using OpenOCD and GDB Then you should be able to start the OpenOCD daemon like: - boards/ea3152/tools/oocd.sh $PWD + boards/arm/lpc31xx/ea3152/tools/oocd.sh $PWD Where it is assumed that you are executing oocd.sh from the top level directory where NuttX is installed. diff --git a/boards/arm/lpc31xx/ea3152/include/board.h b/boards/arm/lpc31xx/ea3152/include/board.h index 29ff4cf4b18..054d96e0918 100644 --- a/boards/arm/lpc31xx/ea3152/include/board.h +++ b/boards/arm/lpc31xx/ea3152/include/board.h @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/ea3152/include/board.h +/**************************************************************************** + * boards/arm/lpc31xx/ea3152/include/board.h * include/arch/board/board.h * * Copyright (C) 2011 Gregory Nutt. All rights reserved. @@ -32,14 +32,14 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************************************/ + ****************************************************************************/ -#ifndef __ARCH_BOARD_BOARD_H -#define __ARCH_BOARD_BOARD_H +#ifndef __BOARDS_ARM_LPC31XX_EA3152_INCLUDE_BOARD_H +#define __BOARDS_ARM_LPC31XX_EA3152_INCLUDE_BOARD_H -/************************************************************************************ +/**************************************************************************** * Included Files - ************************************************************************************/ + ****************************************************************************/ #include #ifndef __ASSEMBLY__ @@ -47,11 +47,12 @@ # include "lpc31_cgudrvr.h" #endif -/************************************************************************************ +/**************************************************************************** * Pre-processor Definitions - ************************************************************************************/ + ****************************************************************************/ + +/* Clocking *****************************************************************/ -/* Clocking *************************************************************************/ /* Frequency of the FFAST input */ #define BOARD_FREQIN_FFAST (12000000) /* ffast (12 MHz crystal) */ @@ -80,8 +81,8 @@ #define BOARD_HPLL1_MODE 0 /* PLL mode */ #define BOARD_HPLL1_FREQ 180000000 /* Frequency of the PLL in MHz */ -/* The following 3 bitsets determine which clocks will be enabled at initialization - * time. +/* The following 3 bitsets determine which clocks will be enabled at + * initialization time. */ #define BOARD_CLKS_0_31 \ @@ -100,7 +101,7 @@ #define BOARD_CLKS_64_92 \ (0) -/* LED definitions ******************************************************************/ +/* LED definitions **********************************************************/ #define LED_STARTED 0 #define LED_HEAPALLOCATE 1 @@ -111,6 +112,6 @@ #define LED_ASSERTION 6 #define LED_PANIC 7 -/* Button definitions ***************************************************************/ +/* Button definitions *******************************************************/ -#endif /* __ARCH_BOARD_BOARD_H */ +#endif /* __BOARDS_ARM_LPC31XX_EA3152_INCLUDE__BOARD_H */ diff --git a/boards/arm/lpc31xx/ea3152/include/board_memorymap.h b/boards/arm/lpc31xx/ea3152/include/board_memorymap.h index 22bf802a887..f1042f77fdf 100644 --- a/boards/arm/lpc31xx/ea3152/include/board_memorymap.h +++ b/boards/arm/lpc31xx/ea3152/include/board_memorymap.h @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/ea3152/include/board_memorymap.h +/**************************************************************************** + * boards/arm/lpc31xx/ea3152/include/board_memorymap.h * include/arch/board/board_memorymap.h * * Copyright (C) 2011 Gregory Nutt. All rights reserved. @@ -32,24 +32,24 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************************************/ + ****************************************************************************/ -#ifndef __ARCH_BOARD_BOARD_MEMORYMAP_H -#define __ARCH_BOARD_BOARD_MEMORYMAP_H +#ifndef __BOARDS_ARM_LPC31XX_EA3152_INCLUDE_MEMORYMAP_H +#define __BOARDS_ARM_LPC31XX_EA3152_INCLUDE_MEMORYMAP_H /* This file should never be included directly, but only indirectly via * lpc31_memorymap.h. */ -/************************************************************************************ +/**************************************************************************** * Included Files - ************************************************************************************/ + ****************************************************************************/ #include -/************************************************************************************ +/**************************************************************************** * Pre-processor Definitions - ************************************************************************************/ + ****************************************************************************/ /* If the LPC31xx ROM page table is selected, then the board-logic is required * to provide: @@ -60,7 +60,7 @@ */ #ifdef CONFIG_ARCH_ROMPGTABLE - /* The LPC31xx ROM page table uses a 1-1 physical to virtual memory mapping */ + /* The LPC31xx ROM page table uses a 1-1 physical to virtual memory mapping */ # define LPC31_SHADOWSPACE_VSECTION 0x00000000 /* 0x00000000-0x00000fff: Shadow Area 4Kb */ # define LPC31_INTSRAM_VSECTION 0x11028000 /* Internal SRAM 96Kb-192Kb */ @@ -84,34 +84,35 @@ # define LPC31_INTC_VSECTION 0x60000000 /* 0x60000000-0x60000fff: Interrupt controller 4Kb */ # define LPC31_NAND_VSECTION 0x70000000 /* 0x70000000-0x700007ff: NANDFLASH Ctrl 2Kb */ - /* Define the address of the page table within the ROM */ + /* Define the address of the page table within the ROM */ # define ROMPGTABLE_OFFSET 0x0001c000 /* Offset of the ROM page table in ROM */ # define PGTABLE_BASE_PADDR (LPC31_INTSROM0_PSECTION+ROMPGTABLE_OFFSET) # define PGTABLE_BASE_VADDR (LPC31_INTSROM0_VSECTION+ROMPGTABLE_OFFSET) #endif -/************************************************************************************ +/**************************************************************************** * Public Data - ************************************************************************************/ + ****************************************************************************/ #ifndef __ASSEMBLY__ #undef EXTERN #if defined(__cplusplus) #define EXTERN extern "C" -extern "C" { +extern "C" +{ #else #define EXTERN extern #endif -/************************************************************************************ +/**************************************************************************** * Public Function Prototypes - ************************************************************************************/ + ****************************************************************************/ #undef EXTERN #if defined(__cplusplus) } #endif #endif /* __ASSEMBLY__ */ -#endif /* __ARCH_BOARD_BOARD_MEMORYMAP_H */ +#endif /* __BOARDS_ARM_LPC31XX_EA3152_INCLUDE_MEMORYMAP_H */ diff --git a/boards/arm/lpc31xx/ea3152/scripts/Make.defs b/boards/arm/lpc31xx/ea3152/scripts/Make.defs index 6df4e6961fd..7798f00f13e 100644 --- a/boards/arm/lpc31xx/ea3152/scripts/Make.defs +++ b/boards/arm/lpc31xx/ea3152/scripts/Make.defs @@ -1,5 +1,5 @@ ############################################################################ -# boards/ea3152/scripts/Make.defs +# boards/arm/lpc31xx/ea3152/scripts/Make.defs # # Copyright (C) 2011-2012, 2017 Gregory Nutt. All rights reserved. # Author: Gregory Nutt diff --git a/boards/arm/lpc31xx/ea3152/scripts/ea3152.ld b/boards/arm/lpc31xx/ea3152/scripts/ea3152.ld index 4775ee26fa7..f3f66251f0e 100644 --- a/boards/arm/lpc31xx/ea3152/scripts/ea3152.ld +++ b/boards/arm/lpc31xx/ea3152/scripts/ea3152.ld @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/ea3152/scripts/ea3152.ld + * boards/arm/lpc31xx/ea3152/scripts/ea3152.ld * * Copyright (C) 2011-2012, 2017 Gregory Nutt. All rights reserved. * Author: Gregory Nutt diff --git a/boards/arm/lpc31xx/ea3152/src/Makefile b/boards/arm/lpc31xx/ea3152/src/Makefile index f1f96195ddb..731257f3210 100644 --- a/boards/arm/lpc31xx/ea3152/src/Makefile +++ b/boards/arm/lpc31xx/ea3152/src/Makefile @@ -1,5 +1,5 @@ ############################################################################ -# boards/ea3152/src/Makefile +# boards/arm/lpc31xx/ea3152/src/Makefile # # Copyright (C) 2011 Gregory Nutt. All rights reserved. # Author: Gregory Nutt diff --git a/boards/arm/lpc31xx/ea3152/src/ea3152.h b/boards/arm/lpc31xx/ea3152/src/ea3152.h index 8fe5cd16472..a1d7a0e41d5 100644 --- a/boards/arm/lpc31xx/ea3152/src/ea3152.h +++ b/boards/arm/lpc31xx/ea3152/src/ea3152.h @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/ea3152/src/ea3152.h +/**************************************************************************** + * boards/arm/lpc31xx/ea3152/src/ea3152.h * * Copyright (C) 2011 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -31,14 +31,14 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************************************/ + ****************************************************************************/ -#ifndef __BOARDS_ARM_EA3152_SRC_EA3152_H -#define __BOARDS_ARM_EA3152_SRC_EA3152_H +#ifndef __BOARDS_ARM_LPC32XX_EA3152_SRC_EA3152_H +#define __BOARDS_ARM_LPC32XX_EA3152_SRC_EA3152_H -/************************************************************************************ +/**************************************************************************** * Included Files - ************************************************************************************/ + ****************************************************************************/ #include #include @@ -46,80 +46,81 @@ #include "lpc31_ioconfig.h" -/************************************************************************************ +/**************************************************************************** * Pre-processor Definitions - ************************************************************************************/ + ****************************************************************************/ -/* EA3152L GPIOs ********************************************************************/ +/* EA3152L GPIOs ************************************************************/ /* LEDs -- interface through an I2C GPIO expander */ /* BUTTONS -- NOTE that some have EXTI interrupts configured */ /* SPI Chip Selects */ + /* SPI NOR flash is the only device on SPI. SPI_CS_OUT0 is its chip select */ #define SPINOR_CS IOCONFIG_SPI_CSOUT0 /* USB Soft Connect Pullup -- NONE */ -/************************************************************************************ +/**************************************************************************** * Public Types - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Public data - ************************************************************************************/ + ****************************************************************************/ #ifndef __ASSEMBLY__ -/************************************************************************************ +/**************************************************************************** * Public Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Name: lpc31_meminitialize * * Description: * Initialize external memory resources (sram, sdram, nand, nor, etc.) * - ************************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_LPC31_EXTDRAM void lpc31_meminitialize(void); #endif -/************************************************************************************ +/**************************************************************************** * Name: lpc31_spidev_initialize * * Description: * Called to configure SPI chip select GPIO pins for the EA3152 board. * - ************************************************************************************/ + ****************************************************************************/ void weak_function lpc31_spidev_initialize(void); -/************************************************************************************ +/**************************************************************************** * Name: lpc31_usbinitialize * * Description: * Called to setup USB-related GPIO pins for the EA3152 board. * - ************************************************************************************/ + ****************************************************************************/ void weak_function lpc31_usbinitialize(void); -/************************************************************************************ +/**************************************************************************** * Name: lpc31_pginitialize * * Description: * Set up mass storage device to support on demand paging. * - ************************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_PAGING void weak_function lpc31_pginitialize(void); #endif #endif /* __ASSEMBLY__ */ -#endif /* __BOARDS_ARM_EA3152_SRC_EA3152_H */ +#endif /* __BOARDS_ARM_LPC32XX_EA3152_SRC_EA3152_H */ diff --git a/boards/arm/lpc31xx/ea3152/src/lpc31_appinit.c b/boards/arm/lpc31xx/ea3152/src/lpc31_appinit.c index ea30724a845..d78062b38c2 100644 --- a/boards/arm/lpc31xx/ea3152/src/lpc31_appinit.c +++ b/boards/arm/lpc31xx/ea3152/src/lpc31_appinit.c @@ -1,5 +1,5 @@ /**************************************************************************** - * config/ea3152/src/lpc31_appinit.c + * boards/arm/lpc31xx/ea3152/src/lpc31_appinit.c * * Copyright (C) 2011 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -72,7 +72,7 @@ # define CONFIG_NSH_MMCSDSLOTNO 0 # endif #else - /* Add configuration for new LPC31XX boards here */ + /* Add configuration for new LPC31XX boards here */ # error "Unrecognized LPC31XX board" # undef NSH_HAVEUSBDEV @@ -85,8 +85,8 @@ # undef NSH_HAVEUSBDEV #endif -/* Can't support MMC/SD features if mountpoints are disabled or if SDIO support - * is not enabled. +/* Can't support MMC/SD features if mountpoints are disabled or if SDIO + * support is not enabled. */ #if defined(CONFIG_DISABLE_MOUNTPOINT) || !defined(CONFIG_LPC31_MCI) @@ -151,18 +151,19 @@ int board_app_initialize(uintptr_t arg) ret = mmcsd_slotinitialize(CONFIG_NSH_MMCSDMINOR, sdio); if (ret != OK) { - syslog(LOG_ERR, "ERROR: Failed to bind SDIO to the MMC/SD driver: %d\n", ret); + syslog(LOG_ERR, + "ERROR: Failed to bind SDIO to the MMC/SD driver: %d\n", ret); return ret; } syslog(LOG_INFO, "Successfully bound SDIO to the MMC/SD driver\n"); - /* Then let's guess and say that there is a card in the slot. I need to check to - * see if the LPC313X10E-EVAL board supports a GPIO to detect if there is a card in - * the slot. + /* Then let's guess and say that there is a card in the slot. + * I need to check to see if the LPC313X10E-EVAL board supports a GPIO to + * detect if there is a card in the slot. */ - sdio_mediachange(sdio, true); + sdio_mediachange(sdio, true); #endif return OK; } diff --git a/boards/arm/lpc31xx/ea3152/src/lpc31_boot.c b/boards/arm/lpc31xx/ea3152/src/lpc31_boot.c index 0867db4538b..ebb5f951a29 100644 --- a/boards/arm/lpc31xx/ea3152/src/lpc31_boot.c +++ b/boards/arm/lpc31xx/ea3152/src/lpc31_boot.c @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/ea3152/src/lpc31_boot.c +/**************************************************************************** + * boards/arm/lpc31xx/ea3152/src/lpc31_boot.c * * Copyright (C) 2011, 2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -31,11 +31,11 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Included Files - ************************************************************************************/ + ****************************************************************************/ #include @@ -49,27 +49,28 @@ #include "lpc31.h" #include "ea3152.h" -/************************************************************************************ +/**************************************************************************** * Pre-processor Definitions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Private Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Public Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Name: lpc31_boardinitialize * * Description: - * All LPC31XX architectures must provide the following entry point. This entry - * point is called early in the intitialization -- after all memory has been - * configured and mapped but before any devices have been initialized. + * All LPC31XX architectures must provide the following entry point. + * This entry point is called early in the intitialization -- after all + * memory has been configured and mapped but before any devices have been + * initialized. * - ************************************************************************************/ + ****************************************************************************/ void lpc31_boardinitialize(void) { @@ -79,8 +80,8 @@ void lpc31_boardinitialize(void) lpc31_meminitialize(); #endif - /* Configure SPI chip selects if 1) SPI is not disabled, and 2) the weak function - * lpc31_spidev_initialize() has been brought into the link. + /* Configure SPI chip selects if 1) SPI is not disabled, and 2) the weak + * function lpc31_spidev_initialize() has been brought into the link. */ #if defined(CONFIG_LPC31_SPI) @@ -91,8 +92,8 @@ void lpc31_boardinitialize(void) #endif /* Initialize USB is 1) USBDEV is selected, 2) the USB controller is not - * disabled, and 3) the weak function lpc31_usbinitialize() has been brought - * into the build. + * disabled, and 3) the weak function lpc31_usbinitialize() has been + * brought into the build. */ #if defined(CONFIG_USBDEV) && defined(CONFIG_LPC31_USBOTG) diff --git a/boards/arm/lpc31xx/ea3152/src/lpc31_buttons.c b/boards/arm/lpc31xx/ea3152/src/lpc31_buttons.c index f4156439eb9..506620ecb2c 100644 --- a/boards/arm/lpc31xx/ea3152/src/lpc31_buttons.c +++ b/boards/arm/lpc31xx/ea3152/src/lpc31_buttons.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/ea3152/src/lpc31_buttons.c + * boards/arm/lpc31xx/ea3152/src/lpc31_buttons.c * * Copyright (C) 2011, 2014-2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt diff --git a/boards/arm/lpc31xx/ea3152/src/lpc31_clkinit.c b/boards/arm/lpc31xx/ea3152/src/lpc31_clkinit.c index de715d53fac..39afce1b3c7 100644 --- a/boards/arm/lpc31xx/ea3152/src/lpc31_clkinit.c +++ b/boards/arm/lpc31xx/ea3152/src/lpc31_clkinit.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/ea3152/src/lpc31_clkinit.c + * boards/arm/lpc31xx/ea3152/src/lpc31_clkinit.c * * Copyright (C) 2011 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -51,6 +51,7 @@ ****************************************************************************/ /* Sub-domain Clock Bitsets *************************************************/ + /* The following bitsets group clocks into bitsets associated with each * domain and fractional divider subdomain. * @@ -132,8 +133,9 @@ #define CGU_CLKSET_DOMAIN2_DIV10 \ (_D2B(CLKID_PWMCLK)) -/* Domain 3 (DOMAINID_AHB0APB2), Clocks 50-57, Fraction dividers 11-13. Clocks - * not defined in the clock sets will be sourced with AHB_APB2_BASE_CLK. +/* Domain 3 (DOMAINID_AHB0APB2), Clocks 50-57, Fraction dividers 11-13. + * Clocks not defined in the clock sets will be sourced with + * AHB_APB2_BASE_CLK. */ /* Domain 3, Fractional divider 11: */ @@ -177,8 +179,9 @@ #define CGU_CLKSET_DOMAIN6_DIV16 \ (0) -/* Domain 7 (DOMAINID_CLK1024FS), Clocks 73-86, Fraction dividers 17-22. Clocks - * not defined in the clock sets will be sourced with CLK1024FS_BASE_CLK. +/* Domain 7 (DOMAINID_CLK1024FS), Clocks 73-86, Fraction dividers 17-22. + * Clocks not defined in the clock sets will be sourced with + * CLK1024FS_BASE_CLK. */ /* Domain 7, Fractional divider 17: */ diff --git a/boards/arm/lpc31xx/ea3152/src/lpc31_fillpage.c b/boards/arm/lpc31xx/ea3152/src/lpc31_fillpage.c index 77eb35117f6..e2deac368c3 100644 --- a/boards/arm/lpc31xx/ea3152/src/lpc31_fillpage.c +++ b/boards/arm/lpc31xx/ea3152/src/lpc31_fillpage.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/ea3152/src/lpc31_fillpage.c + * boards/arm/lpc31xx/ea3152/src/lpc31_fillpage.c * * Copyright (C) 2011, 2013, 2017-2018 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -85,7 +85,8 @@ # undef CONFIG_EA3152_PAGING_SDSLOT # endif #else - /* Add configuration for new LPC31XX boards here */ + /* Add configuration for new LPC31XX boards here */ + # error "Unrecognized LPC31XX board" # undef CONFIG_EA3152_PAGING_SDSLOT # undef HAVE_SD @@ -111,16 +112,16 @@ #ifdef CONFIG_PAGING_BINPATH - /* Can't support SD if the board does not support SD (duh) */ +/* Can't support SD if the board does not support SD (duh) */ # if defined(CONFIG_EA3152_PAGING_SDSLOT) && !defined(HAVE_SD) # error "This board does not support SD" # undef CONFIG_EA3152_PAGING_SDSLOT # endif - /* Can't support SD if mountpoints are disabled or if SDIO support - * is not enabled. - */ +/* Can't support SD if mountpoints are disabled or if SDIO support + * is not enabled. + */ # if defined(CONFIG_DISABLE_MOUNTPOINT) || !defined(CONFIG_LPC31_MCI) # ifdef CONFIG_EA3152_PAGING_SDSLOT @@ -130,7 +131,7 @@ # undef HAVE_SD # endif - /* A mountpoint for the FAT file system must be provided */ +/* A mountpoint for the FAT file system must be provided */ # if !defined(CONFIG_EA3152_PAGING_MOUNTPT) && defined(CONFIG_EA3152_PAGING_SDSLOT) # error "No CONFIG_EA3152_PAGING_MOUNTPT provided" @@ -138,7 +139,7 @@ # undef HAVE_SD # endif - /* If no minor number is provided, default to zero */ +/* If no minor number is provided, default to zero */ # ifndef CONFIG_EA3152_PAGING_MINOR # define CONFIG_EA3152_PAGING_MINOR 0 @@ -150,21 +151,21 @@ #if defined(CONFIG_PAGING_M25PX) || defined(CONFIG_PAGING_AT45DB) - /* Verify that SPI support is enabld */ +/* Verify that SPI support is enabld */ #ifndef CONFIG_LPC31_SPI # error "SPI support is not enabled" #endif - /* Make sure that some value is defined for the offset into the FLASH - * of the NuttX binary image. - */ +/* Make sure that some value is defined for the offset into the FLASH + * of the NuttX binary image. + */ # ifndef CONFIG_EA3152_PAGING_BINOFFSET # define CONFIG_EA3152_PAGING_BINOFFSET 0 # endif - /* Make sure that some value is defined for the SPI port number */ +/* Make sure that some value is defined for the SPI port number */ # ifndef CONFIG_EA3152_PAGING_SPIPORT # define CONFIG_EA3152_PAGING_SPIPORT 0 @@ -223,8 +224,9 @@ static struct pg_source_s g_pgsrc; * * Description: * Initialize the source device that will support paging. - * If BINPATH is defined, then it is the full path to a file on a mounted file - * system. In this case initialization will be deferred until the first + * If BINPATH is defined, then it is the full path to a file on a mounted + * file system. + * In this case initialization will be deferred until the first * time that up_fillpage() is called. * ****************************************************************************/ @@ -270,7 +272,8 @@ static inline void lpc31_initsrc(void) /* Now mount the file system */ snprintf(devname, 16, "/dev/mmcsd%d", CONFIG_EA3152_PAGING_MINOR); - ret = mount(devname, CONFIG_EA3152_PAGING_MOUNTPT, "vfat", MS_RDONLY, NULL); + ret = mount(devname, CONFIG_EA3152_PAGING_MOUNTPT, "vfat", MS_RDONLY, + NULL); DEBUGASSERT(ret == OK); #endif /* CONFIG_EA3152_PAGING_SDSLOT */ @@ -325,7 +328,8 @@ static inline void lpc31_initsrc(void) * from the size of a pointer). */ - ret = MTD_IOCTL(g_pgsrc.mtd, MTDIOC_GEOMETRY, (unsigned long)&g_pgsrc.geo); + ret = MTD_IOCTL(g_pgsrc.mtd, MTDIOC_GEOMETRY, + (unsigned long)&g_pgsrc.geo); DEBUGASSERT(ret >= 0); capacity = g_pgsrc.geo.erasesize*g_pgsrc.geo.neraseblocks; pginfo("capacity: %d\n", capacity); @@ -359,11 +363,12 @@ static inline void lpc31_initsrc(void) * This callback is assumed to occur from an interrupt level when the * device driver completes the fill operation. * - * NOTE 1: Allocating and filling a page is a two step process. up_allocpage() - * allocates the page, and up_fillpage() fills it with data from some non- - * volatile storage device. This distinction is made because up_allocpage() - * can probably be implemented in board-independent logic whereas up_fillpage() - * probably must be implemented as board-specific logic. + * NOTE 1: Allocating and filling a page is a two step process. + * up_allocpage() allocates the page, and up_fillpage() fills it with data + * from some non- volatile storage device. + * This distinction is made because up_allocpage() + * can probably be implemented in board-independent logic whereas + * up_fillpage() probably must be implemented as board-specific logic. * * NOTE 2: The initial mapping of vpage will be read-able, write-able, * but non-cacheable. No special actions will be required of @@ -416,8 +421,9 @@ int up_fillpage(FAR struct tcb_s *tcb, FAR void *vpage) pginfo("TCB: %p vpage: %p far: %08x\n", tcb, vpage, tcb->xcp.far); DEBUGASSERT(tcb->xcp.far >= PG_PAGED_VBASE && tcb->xcp.far < PG_PAGED_VEND); - /* If BINPATH is defined, then it is the full path to a file on a mounted file - * system. In this case initialization will be deferred until the first + /* If BINPATH is defined, then it is the full path to a file on a mounted + * file system. + * In this case initialization will be deferred until the first * time that up_fillpage() is called. Are we initialized? */ @@ -474,7 +480,8 @@ int up_fillpage(FAR struct tcb_s *tcb, FAR void *vpage) /* Version 2: Supports non-blocking, asynchronous fill operations */ -int up_fillpage(FAR struct tcb_s *tcb, FAR void *vpage, up_pgcallback_t pg_callback) +int up_fillpage(FAR struct tcb_s *tcb, FAR void *vpage, + up_pgcallback_t pg_callback) { pginfo("TCB: %p vpage: %d far: %08x\n", tcb, vpage, tcb->xcp.far); DEBUGASSERT(tcb->xcp.far >= PG_PAGED_VBASE && tcb->xcp.far < PG_PAGED_VEND); @@ -492,33 +499,37 @@ int up_fillpage(FAR struct tcb_s *tcb, FAR void *vpage, up_pgcallback_t pg_callb #endif /* CONFIG_PAGING_BLOCKINGFILL */ -/************************************************************************************ +/**************************************************************************** * Name: lpc31_pginitialize * * Description: * Set up mass storage device to support on demand paging. * - ************************************************************************************/ + ****************************************************************************/ void weak_function lpc31_pginitialize(void) { - /* This initialization does nothing in this example setup. But this function is - * where you might, for example: + /* This initialization does nothing in this example setup. + * But this function is where you might, for example: * - * - Initialize and configure a mass storage device to support on-demand paging. - * This might be, perhaps an SD card or NAND memory. An SPI FLASH would probably - * already have been configured by lpc31_spidev_initialize(void); - * - Set up resources to support up_fillpage() operation. For example, perhaps the - * the text image is stored in a named binary file. In this case, the virtual - * text addresses might map to offsets into that file. - * - Do whatever else is necessary to make up_fillpage() ready for the first time - * that it is called. + * - Initialize and configure a mass storage device to support on-demand + * paging. + * This might be, perhaps an SD card or NAND memory. + * An SPI FLASH would probably already have been configured by + * lpc31_spidev_initialize(void); + * - Set up resources to support up_fillpage() operation. + * For example, perhaps the text image is stored in a named binary file. + * In this case, the virtual text addresses might map to offsets into that + * file. + * - Do whatever else is necessary to make up_fillpage() ready for the first + * time that it is called. * - * In reality, however, this function is not very useful: This function is called - * from a low level (before nx_start() is even called), it may not be possible to - * perform file system operations or even to get debug output yet. Therefore, - * to keep life simple, initialization will be deferred in all cases until the first - * time that up_fillpage() is called. + * In reality, however, this function is not very useful: + * This function is called from a low level (before nx_start() is even + * called), it may not be possible to perform file system operations or even + * to get debug output yet. Therefore, to keep life simple, initialization + * will be deferred in all cases until the first time that up_fillpage() is + * called. */ } diff --git a/boards/arm/lpc31xx/ea3152/src/lpc31_leds.c b/boards/arm/lpc31xx/ea3152/src/lpc31_leds.c index 4f4dfbbaddd..b717f77a30d 100644 --- a/boards/arm/lpc31xx/ea3152/src/lpc31_leds.c +++ b/boards/arm/lpc31xx/ea3152/src/lpc31_leds.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/ea3152/src/lpc31_leds.c + * boards/arm/lpc31xx/ea3152/src/lpc31_leds.c * * Copyright (C) 2011, 2013, 2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt diff --git a/boards/arm/lpc31xx/ea3152/src/lpc31_mem.c b/boards/arm/lpc31xx/ea3152/src/lpc31_mem.c index a8d2c1823ea..2203cec54ac 100644 --- a/boards/arm/lpc31xx/ea3152/src/lpc31_mem.c +++ b/boards/arm/lpc31xx/ea3152/src/lpc31_mem.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/ea3152/src/lpc31_mem.c + * boards/arm/lpc31xx/ea3152/src/lpc31_mem.c * * Copyright (C) 2011 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -169,7 +169,10 @@ static void lpc31_sdraminitialize(void) # define HCLK hclk #endif - /* Check RTL for divide by 2 possible. If so change then enable the followng logic */ + /* Check RTL for divide by 2 possible. + * If so change then enable the following logic + */ + #if 0 uint32_t hclk2 = hclk; @@ -189,14 +192,14 @@ static void lpc31_sdraminitialize(void) /* Configure device config register nSDCE0 for proper width SDRAM */ - putreg32((MPMC_DYNCONFIG0_MDSDRAM|MPMC_DYNCONFIG_HP16_32MX16), + putreg32((MPMC_DYNCONFIG0_MDSDRAM | MPMC_DYNCONFIG_HP16_32MX16), LPC31_MPMC_DYNCONFIG0); - putreg32((MPMC_DYNRASCAS0_RAS2CLK|MPMC_DYNRASCAS0_CAS2CLK), + putreg32((MPMC_DYNRASCAS0_RAS2CLK | MPMC_DYNRASCAS0_CAS2CLK), LPC31_MPMC_DYNRASCAS0); /* Min 20ns program 1 so that at least 2 HCLKs are used */ - putreg32(NS2HCLKS(EA3152_SDRAM_TRP, HCLK2, MPMC_DYNTRP_MASK), + putreg32(NS2HCLKS(EA3152_SDRAM_TRP, HCLK2, MPMC_DYNTRP_MASK), LPC31_MPMC_DYNTRP); putreg32(NS2HCLKS(EA3152_SDRAM_TRAS, HCLK2, MPMC_DYNTRAS_MASK), LPC31_MPMC_DYNTRAS); @@ -206,9 +209,9 @@ static void lpc31_sdraminitialize(void) LPC31_MPMC_DYNTAPR); putreg32(NS2HCLKS(EA3152_SDRAM_TDAL, HCLK2, MPMC_DYNTDAL_MASK), LPC31_MPMC_DYNTDAL); - putreg32(NS2HCLKS(EA3152_SDRAM_TWR, HCLK2, MPMC_DYNTWR_MASK), + putreg32(NS2HCLKS(EA3152_SDRAM_TWR, HCLK2, MPMC_DYNTWR_MASK), LPC31_MPMC_DYNTWR); - putreg32(NS2HCLKS(EA3152_SDRAM_TRC, HCLK2, MPMC_DYNTRC_MASK), + putreg32(NS2HCLKS(EA3152_SDRAM_TRC, HCLK2, MPMC_DYNTRC_MASK), LPC31_MPMC_DYNTRC); putreg32(NS2HCLKS(EA3152_SDRAM_TRFC, HCLK2, MPMC_DYNTRFC_MASK), LPC31_MPMC_DYNTRFC); @@ -222,8 +225,8 @@ static void lpc31_sdraminitialize(void) /* Issue continuous NOP commands */ - putreg32((MPMC_DYNCONTROL_CE|MPMC_DYNCONTROL_CS|MPMC_DYNCONTROL_INOP), - LPC31_MPMC_DYNCONTROL); + putreg32((MPMC_DYNCONTROL_CE | MPMC_DYNCONTROL_CS | + MPMC_DYNCONTROL_INOP), LPC31_MPMC_DYNCONTROL); /* Load ~200us delay value to timer1 */ @@ -231,8 +234,8 @@ static void lpc31_sdraminitialize(void) /* Issue a "pre-charge all" command */ - putreg32((MPMC_DYNCONTROL_CE|MPMC_DYNCONTROL_CS|MPMC_DYNCONTROL_IPALL), - LPC31_MPMC_DYNCONTROL); + putreg32((MPMC_DYNCONTROL_CE | MPMC_DYNCONTROL_CS | + MPMC_DYNCONTROL_IPALL), LPC31_MPMC_DYNCONTROL); /* Minimum refresh pulse interval (tRFC) for MT48LC32M16A2=80nsec, * 100nsec provides more than adequate interval. @@ -247,7 +250,7 @@ static void lpc31_sdraminitialize(void) /* Recommended refresh interval for normal operation of the Micron * MT48LC16LFFG = 7.8125usec (128KHz rate). ((HCLK / 128000) - 1) = - * refresh counter interval rate, (subtract one for safety margin). + * refresh counter interval rate, (subtract one for safety margin). */ putreg32(NS2HCLKS(EA3152_SDRAM_OPERREFRESH, HCLK, MPMC_DYNREFRESH_TIMER_MASK), @@ -255,26 +258,27 @@ static void lpc31_sdraminitialize(void) /* Select mode register update mode */ - putreg32((MPMC_DYNCONTROL_CE|MPMC_DYNCONTROL_CS|MPMC_DYNCONTROL_IMODE), + putreg32((MPMC_DYNCONTROL_CE | MPMC_DYNCONTROL_CS | MPMC_DYNCONTROL_IMODE), LPC31_MPMC_DYNCONTROL); /* Program the SDRAM internal mode registers on bank nSDCE0 and reconfigure - * the SDRAM chips. Bus speeds up to 90MHz requires use of a CAS latency = 2. + * the SDRAM chips. + * Bus speeds up to 90MHz requires use of a CAS latency = 2. * To get correct value on address bus CAS cycle, requires a shift by 13 for * 16bit mode */ (void)getreg32(LPC31_EXTSDRAM0_VSECTION | (0x23 << 13)); - putreg32((MPMC_DYNCONFIG0_MDSDRAM|MPMC_DYNCONFIG_HP16_32MX16), + putreg32((MPMC_DYNCONFIG0_MDSDRAM | MPMC_DYNCONFIG_HP16_32MX16), LPC31_MPMC_DYNCONFIG0); - putreg32((MPMC_DYNRASCAS0_RAS2CLK|MPMC_DYNRASCAS0_CAS2CLK), + putreg32((MPMC_DYNRASCAS0_RAS2CLK | MPMC_DYNRASCAS0_CAS2CLK), LPC31_MPMC_DYNRASCAS0); /* Select normal operating mode */ - putreg32((MPMC_DYNCONTROL_CE|MPMC_DYNCONTROL_CS|MPMC_DYNCONTROL_INORMAL), - LPC31_MPMC_DYNCONTROL); + putreg32((MPMC_DYNCONTROL_CE | MPMC_DYNCONTROL_CS | + MPMC_DYNCONTROL_INORMAL), LPC31_MPMC_DYNCONTROL); /* Enable buffers */ @@ -282,7 +286,7 @@ static void lpc31_sdraminitialize(void) regval |= MPMC_DYNCONFIG0_B; putreg32(regval, LPC31_MPMC_DYNCONFIG0); - putreg32((MPMC_DYNCONTROL_INORMAL|MPMC_DYNCONTROL_CS), + putreg32((MPMC_DYNCONTROL_INORMAL | MPMC_DYNCONTROL_CS), LPC31_MPMC_DYNCONTROL); } diff --git a/boards/arm/lpc31xx/ea3152/src/lpc31_spi.c b/boards/arm/lpc31xx/ea3152/src/lpc31_spi.c index a0080975f7c..bdfa8e48724 100644 --- a/boards/arm/lpc31xx/ea3152/src/lpc31_spi.c +++ b/boards/arm/lpc31xx/ea3152/src/lpc31_spi.c @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/ea3152/src/lpc31_spi.c +/**************************************************************************** + * boards/arm/lpc31xx/ea3152/src/lpc31_spi.c * * Copyright (C) 2011 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -31,11 +31,11 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Included Files - ************************************************************************************/ + ****************************************************************************/ #include @@ -52,38 +52,42 @@ #include "ea3152.h" #ifdef CONFIG_LPC31_SPI -#if 0 /* At present, EA3152 specific logic is hard-coded in the file lpc31_spi.c - * in arch/arm/src/lpc31xx */ +#if 0 +/* At present, EA3152 specific logic is hard-coded in the file lpc31_spi.c + * in arch/arm/src/lpc31xx + */ -/************************************************************************************ +/**************************************************************************** * Public Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Name: lpc31_spidev_initialize * * Description: * Called to configure SPI chip select GPIO pins for the EA3152 board. * - ************************************************************************************/ + ****************************************************************************/ void weak_function lpc31_spidev_initialize(void) { - /* NOTE: Clocking for SPI has already been provided. Pin configuration is performed - * on-the-fly, so no additional setup is required. + /* NOTE: Clocking for SPI has already been provided. + * Pin configuration is performed on-the-fly, + * so no additional setup is required. */ } -/************************************************************************************ +/**************************************************************************** * Name: lpc31_spiselect and lpc31_spistatus * * Description: * The external functions, lpc31_spiselect and lpc31_spistatus must be * provided by board-specific logic. They are implementations of the select * and status methods of the SPI interface defined by struct spi_ops_s (see - * include/nuttx/spi/spi.h). All other methods (including lpc31_spibus_initialize()) - * are provided by common LPC31XX logic. To use this common SPI logic on your - * board: + * include/nuttx/spi/spi.h). + * All other methods (including lpc31_spibus_initialize()) + * are provided by common LPC31XX logic. To use this common SPI logic on + * your board: * * 1. Provide logic in lpc31_boardinitialize() to configure SPI chip select * pins. @@ -92,16 +96,17 @@ void weak_function lpc31_spidev_initialize(void) * status operations using GPIOs in the way your board is configured. * 3. Add a calls to lpc31_spibus_initialize() in your low level application * initialization logic - * 4. The handle returned by lpc31_spibus_initialize() may then be used to bind the - * SPI driver to higher level logic (e.g., calling + * 4. The handle returned by lpc31_spibus_initialize() may then be used to + * bind the SPI driver to higher level logic (e.g., calling * mmcsd_spislotinitialize(), for example, will bind the SPI driver to * the SPI MMC/SD driver). * - ************************************************************************************/ + ****************************************************************************/ void lpc31_spiselect(FAR struct spi_dev_s *dev, uint32_t devid, bool selected) { - spiinfo("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); + spiinfo("devid: %d CS: %s\n", (int)devid, + selected ? "assert" : "de-assert"); #warning "Missing logic" } diff --git a/boards/arm/lpc31xx/ea3152/tools/Makefile b/boards/arm/lpc31xx/ea3152/tools/Makefile index aeed0e94836..349e36dcbaa 100644 --- a/boards/arm/lpc31xx/ea3152/tools/Makefile +++ b/boards/arm/lpc31xx/ea3152/tools/Makefile @@ -1,5 +1,5 @@ ############################################################################ -# boards/ea3152/tools/Makefile +# boards/arm/lpc31xx/ea3152/tools/Makefile # # Copyright (C) 2011 Gregory Nutt. All rights reserved. # Author: Gregory Nutt diff --git a/boards/arm/lpc31xx/ea3152/tools/crc32.c b/boards/arm/lpc31xx/ea3152/tools/crc32.c index 72c92f01a49..507fc623fdc 100644 --- a/boards/arm/lpc31xx/ea3152/tools/crc32.c +++ b/boards/arm/lpc31xx/ea3152/tools/crc32.c @@ -1,5 +1,5 @@ -/************************************************************************************************ - * boards/ea3152/tools/crc32.c +/**************************************************************************** + * boards/arm/lpc31xx/ea3152/tools/crc32.c * * This file is a part of NuttX: * @@ -37,19 +37,19 @@ * - The values must be right-shifted by eight bits by the updcrc logic; the shift must * be u_(bring in zeroes). On some hardware you could probably optimize the shift in * assembler by using byte-swap instructions polynomial $edb88320 - ************************************************************************************************/ + ***************************************************************************/ -/************************************************************************************************ +/**************************************************************************** * Included Files - ************************************************************************************************/ + ****************************************************************************/ #include #include #include "lpchdr.h" -/************************************************************************************************ +/**************************************************************************** * Private Data - ************************************************************************************************/ + ****************************************************************************/ static const uint32_t crc32_tab[] = { @@ -87,16 +87,17 @@ static const uint32_t crc32_tab[] = 0xb3667a2e, 0xc4614ab8, 0x5d681b02, 0x2a6f2b94, 0xb40bbe37, 0xc30c8ea1, 0x5a05df1b, 0x2d02ef8d }; -/************************************************************************************************ +/**************************************************************************** * Public Functions - ************************************************************************************************/ -/************************************************************************************************ + ****************************************************************************/ + +/**************************************************************************** * Name: crc32part * * Description: * Continue CRC calculation on a part of the buffer. * - ************************************************************************************************/ + ****************************************************************************/ uint32_t crc32part(const uint8_t *src, size_t len, uint32_t crc32val) { @@ -109,13 +110,13 @@ uint32_t crc32part(const uint8_t *src, size_t len, uint32_t crc32val) return crc32val; } -/************************************************************************************************ +/**************************************************************************** * Name: crc32 * * Description: * Return a 32-bit CRC of the contents of the 'src' buffer, length 'len' * - ************************************************************************************************/ + ****************************************************************************/ uint32_t crc32(const uint8_t *src, size_t len) { diff --git a/boards/arm/lpc31xx/ea3152/tools/lpchdr.c b/boards/arm/lpc31xx/ea3152/tools/lpchdr.c index 39171c5f24c..808365ad806 100644 --- a/boards/arm/lpc31xx/ea3152/tools/lpchdr.c +++ b/boards/arm/lpc31xx/ea3152/tools/lpchdr.c @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/ea3152/tools/lpchdr.c +/**************************************************************************** + * boards/arm/lpc31xx/ea3152/tools/lpchdr.c * * Copyright (C) 2011 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -31,11 +31,11 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Included Files - ************************************************************************************/ + ****************************************************************************/ #include #include @@ -48,24 +48,24 @@ #include #include "lpchdr.h" -/************************************************************************************ +/**************************************************************************** * Pre-processor Definitions - ************************************************************************************/ + ****************************************************************************/ #define IO_BUF_SIZE 1024 #define HDR_SIZE 0x80 #define HDR_CRC_SIZE 0x6c -/************************************************************************************ +/**************************************************************************** * Private Data - ************************************************************************************/ + ****************************************************************************/ static const char *g_infile; static const char *g_outfile; -/************************************************************************************ +/**************************************************************************** * Private Functions - ************************************************************************************/ + ****************************************************************************/ static void show_usage(const char *progname, int exitcode) { @@ -213,9 +213,9 @@ static inline void writefile(int infd, int outfd, size_t len, size_t padlen) } } -/************************************************************************************ +/**************************************************************************** * Public Functions - ************************************************************************************/ + ****************************************************************************/ int main(int argc, char **argv, char **envp) { @@ -236,14 +236,16 @@ int main(int argc, char **argv, char **envp) infd = open(g_infile, O_RDONLY); if (infd < 0) { - fprintf(stderr, "Failed to open %s for reading: %s\n", g_infile, strerror(errno)); + fprintf(stderr, "Failed to open %s for reading: %s\n", g_infile, + strerror(errno)); exit(2); } outfd = open(g_outfile, O_WRONLY|O_CREAT|O_TRUNC, 0644); if (outfd < 0) { - fprintf(stderr, "Failed to open %s for writing: %s\n", g_outfile, strerror(errno)); + fprintf(stderr, "Failed to open %s for writing: %s\n", g_outfile, + strerror(errno)); exit(2); } @@ -282,7 +284,8 @@ int main(int argc, char **argv, char **envp) nbytes = write(outfd, &g_hdr, HDR_SIZE); if (nbytes != 0x80) { - fprintf(stderr, "write of header to of %s failed: %s\n", g_outfile, strerror(errno)); + fprintf(stderr, "write of header to of %s failed: %s\n", g_outfile, + strerror(errno)); exit(4); } @@ -293,5 +296,3 @@ int main(int argc, char **argv, char **envp) close(outfd); return 0; } - - diff --git a/boards/arm/lpc31xx/ea3152/tools/lpchdr.h b/boards/arm/lpc31xx/ea3152/tools/lpchdr.h index b2599d338fc..ecc869f41bd 100644 --- a/boards/arm/lpc31xx/ea3152/tools/lpchdr.h +++ b/boards/arm/lpc31xx/ea3152/tools/lpchdr.h @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/ea3152/tools/lpchdr.h +/**************************************************************************** + * boards/arm/lpc31xx/ea3152/tools/lpchdr.h * * Copyright (C) 2011 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -31,75 +31,90 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************************************/ + ****************************************************************************/ -#ifndef __BOARDS_ARM_EA3152_TOOLS_LPCHDR_H -#define __BOARDS_ARM_EA3152_TOOLS_LPCHDR_H +#ifndef __BOARDS_ARM_LPC31XX_EA3152_TOOLS_LPCHDR_H +#define __BOARDS_ARM_LPC31XX_EA3152_TOOLS_LPCHDR_H -/************************************************************************************ +/**************************************************************************** * Included Files - ************************************************************************************/ + ****************************************************************************/ #include -/************************************************************************************ +/**************************************************************************** * Pre-processor Definitions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Public Types - ************************************************************************************/ + ****************************************************************************/ struct lpc31_header_s { /* OFFS DESCRIPTION */ - uint32_t vector; /* 0x00 Valid ARM instruction. Usually this will be - * a branch instruction to entry point of the - * image. */ - uint32_t magic; /* 0x04 This field is used by boot ROM to detect a - * valid image header. This field should always - * be set to 0x41676d69. */ - uint32_t execution_crc32; /* 0x08 CRC32 value of execution part of the image. If - * the ‘image_type’ is set to ‘0xA’, this field - * is ignored by boot ROM. */ + uint32_t vector; /* 0x00 Valid ARM instruction. Usually this + * will be a branch instruction to entry + * point of the image. + */ + uint32_t magic; /* 0x04 This field is used by boot ROM to + * detect a valid image header. This field + * should always be set to 0x41676d69. + */ + uint32_t execution_crc32; /* 0x08 CRC32 value of execution part of + * the image. If the ‘image_type’ is set + * to ‘0xA’, this field is ignored by boot + * ROM. + */ uint32_t Reserved0[4]; /* 0x0c-0x18: Should be zero. */ - uint32_t imageType; /* 0x1c Specifies whether CRC check should be done - * on the image or not: + uint32_t imageType; /* 0x1c Specifies whether CRC check should be + * done on the image or not: * 0xA – No CRC check required. * 0xB – Do CRC32 check on both header and - * execution part of the image. */ - uint32_t imageLength; /* 0x20 Total image length including header rounded - * up to the nearest 512 byte boundary. In C - * language the field can be computed as: - * imageLength = (Actual length + 511) & ~0x1FF; */ - uint32_t releaseID; /* 0x24 Release or version number of the image. Note, - * this field is not used by boot ROM but is - * provided to track the image versions. */ - uint32_t buildTime; /* 0x28 Time (expressed in EPOC time format) at which - * image is built. Note, this field is not used - * by boot ROM but is provided to track the image - * versions. */ + * execution part of the image. + */ + uint32_t imageLength; /* 0x20 Total image length including header + * rounded up to the nearest 512 byte + * boundary. In C language the field can be + * computed as: + * imageLength = (Actual length + 511) & ~0x1FF; + */ + uint32_t releaseID; /* 0x24 Release or version number of the + * image. + * Note, this field is not used by boot ROM + * but is provided to track the image + * versions. + */ + uint32_t buildTime; /* 0x28 Time (expressed in EPOC time format) at + * which image is built. Note, this field is + * not used by boot ROM but is provided to + * track the image versions. + */ uint32_t sbzBootParameter; /* 0x2c hould be zero. */ - uint32_t cust_reserved[15]; /* 0x30-0x68: Reserved for customer use (60 bytes) */ - uint32_t header_crc32; /* 0x6c CRC32 value of the header (bytes 0x00 to 0x6C - * of the image). If the ‘image_type’ is set - * to ‘0xA’, this field is ignored by boot ROM. */ + uint32_t cust_reserved[15]; /* 0x30-0x68: Reserved for customer use + * (60 bytes) + */ + uint32_t header_crc32; /* 0x6c CRC32 value of the header + * (bytes 0x00 to 0x6C of the image). + * If the ‘image_type’ is set to ‘0xA’, + * this field is ignored by boot ROM. + */ uint32_t Reserved1[4]; /* 0x70-0x7c: Should be zero. */ - /* 0x80 Start of program code (128Kb max). The final - * image has to be padded to the nearest 512 - * byte boundary */ + /* 0x80 Start of program code (128Kb max). + * The final image has to be padded to the + * nearest 512 byte boundary + */ }; -/************************************************************************************ +/**************************************************************************** * Public data - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Public Functions - ************************************************************************************/ + ****************************************************************************/ extern uint32_t crc32part(const uint8_t *src, size_t len, uint32_t crc32val); extern uint32_t crc32(const uint8_t *src, size_t len); -#endif /* __BOARDS_ARM_EA3152_TOOLS_LPCHDR_H */ - +#endif /* __BOARDS_ARM_LPC31XX_EA3152_TOOLS_LPCHDR_H */ diff --git a/boards/arm/lpc31xx/ea3152/tools/mklpc.sh b/boards/arm/lpc31xx/ea3152/tools/mklpc.sh index df95c0899db..4db9d271aa7 100755 --- a/boards/arm/lpc31xx/ea3152/tools/mklpc.sh +++ b/boards/arm/lpc31xx/ea3152/tools/mklpc.sh @@ -1,13 +1,13 @@ #!/usr/bin/env bash -# This script lies in sub-directory boards/ea3152/tools but make be executed +# This script lies in sub-directory boards/arm/lpc31xx/ea3152/tools but make be executed # from either that directory or TOPDIR MYNAME=`basename $0` if [ -x "$PWD/$MYNAME" ]; then TOPDIR="$PWD/../../.." else - if [ -x "$PWD/boards/ea3152/tools/$MYNAME" ]; then + if [ -x "$PWD/boards/arm/lpc31xx/ea3152/tools/$MYNAME" ]; then TOPDIR="$PWD" else echo "This script must be executed from a known director" @@ -19,7 +19,7 @@ echo "TOOLDIR: $TOOLDIR" # The lpchdr could be named lpchdr.exe if we are running under Cygwin or # just lpchdr under Linux -TOOLDIR=$TOPDIR/boards/ea3152/tools +TOOLDIR=$TOPDIR/boards/arm/lpc31xx/ea3152/tools if [ ! -d "$TOOLDIR" ]; then echo "Tool directory $TOOLDIR does not exist" diff --git a/boards/arm/lpc31xx/ea3152/tools/oocd.sh b/boards/arm/lpc31xx/ea3152/tools/oocd.sh index 474e98c5e31..7730e5b8630 100755 --- a/boards/arm/lpc31xx/ea3152/tools/oocd.sh +++ b/boards/arm/lpc31xx/ea3152/tools/oocd.sh @@ -71,7 +71,7 @@ if [ "X${OPENOCD}" = "X0.4.0" ]; then # Local search directory and configurations - OPENOCD_SEARCHDIR="${TOPDIR}/boards/ea3152/tools" + OPENOCD_SEARCHDIR="${TOPDIR}/boards/arm/lpc31xx/ea3152/tools" OPENOCD_WSEARCHDIR="`cygpath -w ${OPENOCD_SEARCHDIR}`" if [ "X${INTERFACE}" = "XJlink" ]; then @@ -125,7 +125,7 @@ else exit 1 fi - OPENOCD_CFG="${TOPDIR}/boards/ea3152/tools/armusbocd.cfg" + OPENOCD_CFG="${TOPDIR}/boards/arm/lpc31xx/ea3152/tools/armusbocd.cfg" OPENOCD_ARGS="-f `cygpath -w ${OPENOCD_CFG}`" # Verify that everything is what it claims it is and is located where it claims it is. diff --git a/boards/arm/lpc31xx/olimex-lpc-h3131/README.txt b/boards/arm/lpc31xx/olimex-lpc-h3131/README.txt index c725df5f233..b75754d6fe8 100644 --- a/boards/arm/lpc31xx/olimex-lpc-h3131/README.txt +++ b/boards/arm/lpc31xx/olimex-lpc-h3131/README.txt @@ -6,7 +6,7 @@ README NOTE: This is a minimal port to the Olimex LPC-H3131. According to Olimex documentation, the LPC-H3131 is similar in design to the Embedded Artists EA3131. As a consequence, it should be possible to leverage additional - functionality from boards/ea3131 without too much difficulty. + functionality from boards/arm/lpc31xx/ea3131 without too much difficulty. Contents ======== diff --git a/boards/arm/lpc31xx/olimex-lpc-h3131/include/board.h b/boards/arm/lpc31xx/olimex-lpc-h3131/include/board.h index 9b8dfa53c1d..2cff932a6e1 100644 --- a/boards/arm/lpc31xx/olimex-lpc-h3131/include/board.h +++ b/boards/arm/lpc31xx/olimex-lpc-h3131/include/board.h @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/olimex-lpc-h3131/include/board.h +/**************************************************************************** + * boards/arm/lpc31xx/olimex-lpc-h3131/include/board.h * * Copyright (C) 2013, 2017 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -31,14 +31,14 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************************************/ + ****************************************************************************/ -#ifndef __BOARDS_ARM_OLIMEX_LPC_H3131_INCLUDE_BOARD_H -#define __BOARDS_ARM_OLIMEX_LPC_H3131_INCLUDE_BOARD_H +#ifndef __BOARDS_ARM_LPC31XX_OLIMEX_LPC_H3131_INCLUDE_BOARD_H +#define __BOARDS_ARM_LPC31XX_OLIMEX_LPC_H3131_INCLUDE_BOARD_H -/************************************************************************************ +/**************************************************************************** * Included Files - ************************************************************************************/ + ****************************************************************************/ #include #ifndef __ASSEMBLY__ @@ -46,11 +46,12 @@ # include "lpc31_cgudrvr.h" #endif -/************************************************************************************ +/**************************************************************************** * Pre-processor Definitions - ************************************************************************************/ + ****************************************************************************/ + +/* Clocking *****************************************************************/ -/* Clocking *************************************************************************/ /* Frequency of the FFAST input */ #define BOARD_FREQIN_FFAST (12000000) /* ffast (12 MHz crystal) */ @@ -79,8 +80,8 @@ #define BOARD_HPLL1_MODE 0 /* PLL mode */ #define BOARD_HPLL1_FREQ 180000000 /* Frequency of the PLL in MHz */ -/* The following 3 bitsets determine which clocks will be enabled at initialization - * time. +/* The following 3 bitsets determine which clocks will be enabled at + * initialization time. */ #define BOARD_CLKS_0_31 \ @@ -99,9 +100,10 @@ #define BOARD_CLKS_64_92 \ (0) -/* LED definitions ******************************************************************/ -/* If CONFIG_ARCH_LEDS is not defined, then the user can control the LEDs in any - * way. The following definitions are used to access individual LEDs. +/* LED definitions **********************************************************/ + +/* If CONFIG_ARCH_LEDS is not defined, then the user can control the LEDs in + * any way. The following definitions are used to access individual LEDs. */ /* LED index values for use with board_userled() */ @@ -120,7 +122,8 @@ * * SYMBOL Meaning LED state * LED2 LED1 - * ------------------------ -------------------------- ------ ------ */ + * ------------------------ -------------------------- ------ ------ + */ #define LED_STARTED 0 /* NuttX has been started OFF OFF */ #define LED_HEAPALLOCATE 0 /* Heap has been allocated OFF OFF */ @@ -140,12 +143,13 @@ * be used by other board-specific logic. */ -/* Button definitions ***************************************************************/ +/* Button definitions *******************************************************/ + /* The Olimex LPC_H3131 has no user buttons */ -/************************************************************************************ +/**************************************************************************** * Public Data - ************************************************************************************/ + ****************************************************************************/ #ifndef __ASSEMBLY__ @@ -158,34 +162,35 @@ extern "C" #define EXTERN extern #endif -/************************************************************************************ +/**************************************************************************** * Public Function Prototypes - ************************************************************************************/ + ****************************************************************************/ #undef EXTERN #if defined(__cplusplus) } #endif -/************************************************************************************ +/**************************************************************************** * Name: lpc31_setup_overcurrent * * Description: - * Setup to receive an interrupt-level callback if an overcurrent condition is - * detected. + * Setup to receive an interrupt-level callback if an overcurrent condition + * is detected. * * Input Parameters: * handler - New overcurrent interrupt handler * arg - The argument that will accompany the interrupt * * Returned Value: - * Zero (OK) returned on success; a negated errno value is returned on failure. + * Zero (OK) returned on success; a negated errno value is returned on + * failure. * - ************************************************************************************/ + ****************************************************************************/ #if 0 /* Not ready yet */ int lpc31_setup_overcurrent(xcpt_t handler, void *arg); #endif #endif /* __ASSEMBLY__ */ -#endif /* __BOARDS_ARM_OLIMEX_LPC_H3131_INCLUDE_BOARD_H */ +#endif /* __BOARDS_ARM_LPC31XX_OLIMEX_LPC_H3131_INCLUDE_BOARD_H */ diff --git a/boards/arm/lpc31xx/olimex-lpc-h3131/include/board_memorymap.h b/boards/arm/lpc31xx/olimex-lpc-h3131/include/board_memorymap.h index 91725e4d577..dc9b944338c 100644 --- a/boards/arm/lpc31xx/olimex-lpc-h3131/include/board_memorymap.h +++ b/boards/arm/lpc31xx/olimex-lpc-h3131/include/board_memorymap.h @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/olimex-lpc-h3131/include/board_memorymap.h +/**************************************************************************** + * boards/arm/lpc31xx/olimex-lpc-h3131/include/board_memorymap.h * * Copyright (C) 2013 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -31,24 +31,24 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************************************/ + ****************************************************************************/ -#ifndef __BOARDS_ARM_OLIMEX_LPC_H3131_INCLUDE_BOARD_MEMORYMAP_H -#define __BOARDS_ARM_OLIMEX_LPC_H3131_INCLUDE_BOARD_MEMORYMAP_H +#ifndef __BOARDS_ARM_LPC31XX_OLIMEX_LPC_H3131_INCLUDE_BOARD_MEMORYMAP_H +#define __BOARDS_ARM_LPC31XX_OLIMEX_LPC_H3131_INCLUDE_BOARD_MEMORYMAP_H /* This file should never be included directly, but only indirectly via * lpc31_memorymap.h. */ -/************************************************************************************ +/**************************************************************************** * Included Files - ************************************************************************************/ + ****************************************************************************/ #include -/************************************************************************************ +/**************************************************************************** * Pre-processor Definitions - ************************************************************************************/ + ****************************************************************************/ /* If the LPC31xx ROM page table is selected, then the board-logic is required * to provide: @@ -59,7 +59,7 @@ */ #ifdef CONFIG_ARCH_ROMPGTABLE - /* The LPC31xx ROM page table uses a 1-1 physical to virtual memory mapping */ +/* The LPC31xx ROM page table uses a 1-1 physical to virtual memory mapping */ # define LPC31_SHADOWSPACE_VSECTION 0x00000000 /* 0x00000000-0x00000fff: Shadow Area 4Kb */ # define LPC31_INTSRAM_VSECTION 0x11028000 /* Internal SRAM 96Kb-192Kb */ @@ -83,34 +83,35 @@ # define LPC31_INTC_VSECTION 0x60000000 /* 0x60000000-0x60000fff: Interrupt controller 4Kb */ # define LPC31_NAND_VSECTION 0x70000000 /* 0x70000000-0x700007ff: NANDFLASH Ctrl 2Kb */ - /* Define the address of the page table within the ROM */ +/* Define the address of the page table within the ROM */ # define ROMPGTABLE_OFFSET 0x0001c000 /* Offset of the ROM page table in ROM */ # define PGTABLE_BASE_PADDR (LPC31_INTSROM0_PSECTION+ROMPGTABLE_OFFSET) # define PGTABLE_BASE_VADDR (LPC31_INTSROM0_VSECTION+ROMPGTABLE_OFFSET) #endif -/************************************************************************************ +/**************************************************************************** * Public Data - ************************************************************************************/ + ****************************************************************************/ #ifndef __ASSEMBLY__ #undef EXTERN #if defined(__cplusplus) #define EXTERN extern "C" -extern "C" { +extern "C" +{ #else #define EXTERN extern #endif -/************************************************************************************ +/**************************************************************************** * Public Function Prototypes - ************************************************************************************/ + ****************************************************************************/ #undef EXTERN #if defined(__cplusplus) } #endif #endif /* __ASSEMBLY__ */ -#endif /* __BOARDS_ARM_OLIMEX_LPC_H3131_INCLUDE_BOARD_MEMORYMAP_H */ +#endif /* __BOARDS_ARM_LPC31XX_OLIMEX_LPC_H3131_INCLUDE_BOARD_MEMORYMAP_H */ diff --git a/boards/arm/lpc31xx/olimex-lpc-h3131/scripts/Make.defs b/boards/arm/lpc31xx/olimex-lpc-h3131/scripts/Make.defs index fce6b5199a3..afa251b33c3 100644 --- a/boards/arm/lpc31xx/olimex-lpc-h3131/scripts/Make.defs +++ b/boards/arm/lpc31xx/olimex-lpc-h3131/scripts/Make.defs @@ -1,5 +1,5 @@ ############################################################################ -# boards/olimex-lpc-h3131/scripts/Make.defs +# boards/arm/lpc31xx/olimex-lpc-h3131/scripts/Make.defs # # Copyright (C) 2013i, 2017 Gregory Nutt. All rights reserved. # Author: Gregory Nutt diff --git a/boards/arm/lpc31xx/olimex-lpc-h3131/scripts/ld.script b/boards/arm/lpc31xx/olimex-lpc-h3131/scripts/ld.script index 5fd299fa765..5df9330af5b 100644 --- a/boards/arm/lpc31xx/olimex-lpc-h3131/scripts/ld.script +++ b/boards/arm/lpc31xx/olimex-lpc-h3131/scripts/ld.script @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/olimex-lpc-h3131/scripts/ld.script + * boards/arm/lpc31xx/olimex-lpc-h3131/scripts/ld.script * * Copyright (C) 2013 Gregory Nutt. All rights reserved. * Author: Gregory Nutt diff --git a/boards/arm/lpc31xx/olimex-lpc-h3131/src/Makefile b/boards/arm/lpc31xx/olimex-lpc-h3131/src/Makefile index 85cc53c9343..4c04a95aefc 100644 --- a/boards/arm/lpc31xx/olimex-lpc-h3131/src/Makefile +++ b/boards/arm/lpc31xx/olimex-lpc-h3131/src/Makefile @@ -1,5 +1,5 @@ ############################################################################ -# boards/olimex-lpc-h3131/src/Makefile +# boards/arm/lpc31xx/olimex-lpc-h3131/src/Makefile # # Copyright (C) 2013 Gregory Nutt. All rights reserved. # Author: Gregory Nutt diff --git a/boards/arm/lpc31xx/olimex-lpc-h3131/src/lpc31_appinit.c b/boards/arm/lpc31xx/olimex-lpc-h3131/src/lpc31_appinit.c index 0b370308a57..6e4bac732a5 100644 --- a/boards/arm/lpc31xx/olimex-lpc-h3131/src/lpc31_appinit.c +++ b/boards/arm/lpc31xx/olimex-lpc-h3131/src/lpc31_appinit.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/olimex-lpc-h3131/src/lpc31_appinit.c + * boards/arm/lpc31xx/olimex-lpc-h3131/src/lpc31_appinit.c * * Copyright (C) 2013, 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -57,6 +57,7 @@ /**************************************************************************** * Pre-processor Definitions ****************************************************************************/ + /* Configuration ************************************************************/ /* PORT and SLOT number probably depend on the board configuration */ @@ -120,8 +121,8 @@ int board_app_initialize(uintptr_t arg) #endif #ifdef HAVE_USBHOST - /* Initialize USB host operation. lpc31_usbhost_initialize() starts a thread - * will monitor for USB connection and disconnection events. + /* Initialize USB host operation. lpc31_usbhost_initialize() starts a + * thread will monitor for USB connection and disconnection events. */ syslog(LOG_INFO, "Start USB host services\n"); diff --git a/boards/arm/lpc31xx/olimex-lpc-h3131/src/lpc31_boot.c b/boards/arm/lpc31xx/olimex-lpc-h3131/src/lpc31_boot.c index 42cd7c09a2a..7811cbfddff 100644 --- a/boards/arm/lpc31xx/olimex-lpc-h3131/src/lpc31_boot.c +++ b/boards/arm/lpc31xx/olimex-lpc-h3131/src/lpc31_boot.c @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/olimex-lpc-h3131/src/lpc31_boot.c +/**************************************************************************** + * boards/arm/lpc31xx/olimex-lpc-h3131/src/lpc31_boot.c * * Copyright (C) 2013, 2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -31,11 +31,11 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Included Files - ************************************************************************************/ + ****************************************************************************/ #include @@ -49,27 +49,28 @@ #include "lpc31.h" #include "lpc_h3131.h" -/************************************************************************************ +/**************************************************************************** * Pre-processor Definitions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Private Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Public Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Name: lpc31_boardinitialize * * Description: - * All LPC31XX architectures must provide the following entry point. This entry - * point is called early in the intitialization -- after all memory has been - * configured and mapped but before any devices have been initialized. + * All LPC31XX architectures must provide the following entry point. + * This entry point is called early in the intitialization -- after all + * memory has been configured and mapped but before any devices have been + * initialized. * - ************************************************************************************/ + ****************************************************************************/ void lpc31_boardinitialize(void) { @@ -79,8 +80,8 @@ void lpc31_boardinitialize(void) lpc31_meminitialize(); #endif - /* Configure SPI chip selects if 1) SPI is not disabled, and 2) the weak function - * lpc31_spidev_initialize() has been brought into the link. + /* Configure SPI chip selects if 1) SPI is not disabled, and 2) the weak + * function lpc31_spidev_initialize() has been brought into the link. */ #if defined(CONFIG_LPC31_SPI) @@ -90,10 +91,10 @@ void lpc31_boardinitialize(void) } #endif - /* Initialize USB is 1) USBDEV is selected, 2) the USB controller is not - * disabled, and 3) the weak function lpc31_usbdev_initialize() has been brought - * into the build. - */ + /* Initialize USB is 1) USBDEV is selected, 2) the USB controller is not + * disabled, and 3) the weak function lpc31_usbdev_initialize() has + * been brought into the build. + */ #ifdef HAVE_USBDEV if (lpc31_usbdev_initialize) @@ -103,8 +104,8 @@ void lpc31_boardinitialize(void) #endif /* Initialize USB if the 1) the HS host or device controller is in the - * configuration and 2) the weak function lpc31_usbhost_bootinitialize() has - * been brought into the build. Presumably either CONFIG_USBDEV or + * configuration and 2) the weak function lpc31_usbhost_bootinitialize() + * has been brought into the build. Presumably either CONFIG_USBDEV or * CONFIG_USBHOST is also selected. */ diff --git a/boards/arm/lpc31xx/olimex-lpc-h3131/src/lpc31_clkinit.c b/boards/arm/lpc31xx/olimex-lpc-h3131/src/lpc31_clkinit.c index 802c7d43689..dde422cffe5 100644 --- a/boards/arm/lpc31xx/olimex-lpc-h3131/src/lpc31_clkinit.c +++ b/boards/arm/lpc31xx/olimex-lpc-h3131/src/lpc31_clkinit.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/olimex-lpc-h3131/src/lpc31_clkinit.c + * boards/arm/lpc31xx/olimex-lpc-h3131/src/lpc31_clkinit.c * * Copyright (C) 2013 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -51,6 +51,7 @@ ****************************************************************************/ /* Sub-domain Clock Bitsets *************************************************/ + /* The following bitsets group clocks into bitsets associated with each * domain and fractional divider subdomain. * @@ -99,8 +100,9 @@ #define CGU_CLKSET_DOMAIN0_DIV6 \ (_D0B(CLKID_EBICLK)) -/* Domain 1 (DOMAINID_AHB0APB0), Clocks 30-39, Fraction dividers 7-8. Clocks - * not defined in the clock sets will be sourced with AHB_APB0_BASE_CLK. +/* Domain 1 (DOMAINID_AHB0APB0), Clocks 30-39, Fraction dividers 7-8. + * Clocks not defined in the clock sets will be sourced with + * AHB_APB0_BASE_CLK. */ /* Domain 1, Fractional divider 7: */ @@ -116,8 +118,9 @@ _D1B(CLKID_CGUPCLK)|_D1B(CLKID_SYSCREGPCLK)|_D1B(CLKID_OTPPCLK)|\ _D1B(CLKID_RNGPCLK)) -/* Domain 2 (DOMAINID_AHB0APB1), Clocks 40-49, Fraction dividers 9-10. Clocks - * not defined in the clock sets will be sourced with AHB_APB1_BASE_CLK. +/* Domain 2 (DOMAINID_AHB0APB1), Clocks 40-49, Fraction dividers 9-10. + * Clocks not defined in the clock sets will be sourced with + * AHB_APB1_BASE_CLK. */ /* Domain 2, Fractional divider 9: */ @@ -132,8 +135,9 @@ #define CGU_CLKSET_DOMAIN2_DIV10 \ (_D2B(CLKID_PWMCLK)) -/* Domain 3 (DOMAINID_AHB0APB2), Clocks 50-57, Fraction dividers 11-13. Clocks - * not defined in the clock sets will be sourced with AHB_APB2_BASE_CLK. +/* Domain 3 (DOMAINID_AHB0APB2), Clocks 50-57, Fraction dividers 11-13. + * Clocks not defined in the clock sets will be sourced with + * AHB_APB2_BASE_CLK. */ /* Domain 3, Fractional divider 11: */ @@ -153,8 +157,9 @@ #define CGU_CLKSET_DOMAIN3_DIV13 \ (0) -/* Domain 4 (DOMAINID_AHB0APB3), Clocks 58-70, Fraction divider 14. Clocks - * not defined in the clock sets will be sourced with AHB_APB3_BASE_CLK. +/* Domain 4 (DOMAINID_AHB0APB3), Clocks 58-70, Fraction divider 14. + * Clocks not defined in the clock sets will be sourced with + * AHB_APB3_BASE_CLK. */ #define CGU_CLKSET_DOMAIN4_DIV14 \ @@ -177,8 +182,9 @@ #define CGU_CLKSET_DOMAIN6_DIV16 \ (0) -/* Domain 7 (DOMAINID_CLK1024FS), Clocks 73-86, Fraction dividers 17-22. Clocks - * not defined in the clock sets will be sourced with CLK1024FS_BASE_CLK. +/* Domain 7 (DOMAINID_CLK1024FS), Clocks 73-86, Fraction dividers 17-22. + * Clocks not defined in the clock sets will be sourced with + * CLK1024FS_BASE_CLK. */ /* Domain 7, Fractional divider 17: */ diff --git a/boards/arm/lpc31xx/olimex-lpc-h3131/src/lpc31_leds.c b/boards/arm/lpc31xx/olimex-lpc-h3131/src/lpc31_leds.c index 46a78071266..21d48f43a94 100644 --- a/boards/arm/lpc31xx/olimex-lpc-h3131/src/lpc31_leds.c +++ b/boards/arm/lpc31xx/olimex-lpc-h3131/src/lpc31_leds.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/olimex-lpc-h3131/src/lpc31_leds.c + * boards/arm/lpc31xx/olimex-lpc-h3131/src/lpc31_leds.c * * Copyright (C) 2013, 2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -157,20 +157,21 @@ void board_autoled_off(int led) } #endif -/************************************************************************************ +/**************************************************************************** * Name: board_userled_initialize, board_userled, and board_userled_all * * Description: * These interfaces allow user control of the board LEDs. * - * If CONFIG_ARCH_LEDS is defined, then NuttX will control both on-board LEDs up - * until the completion of boot. The it will continue to control LED2; LED1 is - * avaiable for application use. + * If CONFIG_ARCH_LEDS is defined, then NuttX will control both on-board + * LEDs up until the completion of boot. + * Then it will continue to control LED2; + * LED1 is avaiable for application use. * - * If CONFIG_ARCH_LEDS is not defined, then both LEDs are available for application - * use. + * If CONFIG_ARCH_LEDS is not defined, then both LEDs are available + * for application use. * - ************************************************************************************/ + ****************************************************************************/ void board_userled_initialize(void) { @@ -193,9 +194,9 @@ void board_userled(int led, bool ledon) bit = GPIO_LED2; } else - { + { return; - } + } if (ledon) { diff --git a/boards/arm/lpc31xx/olimex-lpc-h3131/src/lpc31_mem.c b/boards/arm/lpc31xx/olimex-lpc-h3131/src/lpc31_mem.c index f43a310be8a..9dcb47da304 100644 --- a/boards/arm/lpc31xx/olimex-lpc-h3131/src/lpc31_mem.c +++ b/boards/arm/lpc31xx/olimex-lpc-h3131/src/lpc31_mem.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/olimex-lpc-h3131/src/lp31_mem.c + * boards/arm/lpc31xx/olimex-lpc-h3131/src/lp31_mem.c * * Copyright (C) 2013 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -73,8 +73,8 @@ (0x20 << SYSCREG_MPMC_DELAYMODES_DEL2_SHIFT) | \ (0x24 << SYSCREG_MPMC_DELAYMODES_DEL3_SHIFT)) - /* Delay constants in nanosecondss for K4S561632J-UC/L75 SDRAM on board */ + /* 90MHz SDRAM Clock */ #define H3131_SDRAM_REFRESH (15625) @@ -150,7 +150,10 @@ static inline void lpc31_sdraminitialize(void) # define HCLK hclk #endif - /* Check RTL for divide by 2 possible. If so change then enable the following logic */ + /* Check RTL for divide by 2 possible. + * If so change then enable the following logic + */ + #if 0 uint32_t hclk2 = hclk; @@ -182,7 +185,7 @@ static inline void lpc31_sdraminitialize(void) regval &= ~(MPMC_DYNCONFIG0_B | MPMC_DYNCONFIG0_P); putreg32(regval, LPC31_MPMC_DYNCONFIG0); - /* Set RAS/CAS delays*/ + /* Set RAS/CAS delays */ putreg32((MPMC_DYNRASCAS0_RAS2CLK | MPMC_DYNRASCAS0_CAS2CLK), LPC31_MPMC_DYNRASCAS0); @@ -210,8 +213,8 @@ static inline void lpc31_sdraminitialize(void) /* Issue continuous NOP commands */ - putreg32((MPMC_DYNCONTROL_CE|MPMC_DYNCONTROL_CS|MPMC_DYNCONTROL_INOP), - LPC31_MPMC_DYNCONTROL); + putreg32((MPMC_DYNCONTROL_CE | MPMC_DYNCONTROL_CS | + MPMC_DYNCONTROL_INOP), LPC31_MPMC_DYNCONTROL); /* Wait ~200us */ @@ -219,8 +222,8 @@ static inline void lpc31_sdraminitialize(void) /* Issue a "pre-charge all" command */ - putreg32((MPMC_DYNCONTROL_CE|MPMC_DYNCONTROL_CS|MPMC_DYNCONTROL_IPALL), - LPC31_MPMC_DYNCONTROL); + putreg32((MPMC_DYNCONTROL_CE | MPMC_DYNCONTROL_CS | + MPMC_DYNCONTROL_IPALL), LPC31_MPMC_DYNCONTROL); /* Minimum refresh pulse interval (tRFC) for MT48LC32M16A2=80nsec, * 100nsec provides more than adequate interval. @@ -244,11 +247,12 @@ static inline void lpc31_sdraminitialize(void) /* Select mode register update mode */ - putreg32((MPMC_DYNCONTROL_CE|MPMC_DYNCONTROL_CS|MPMC_DYNCONTROL_IMODE), - LPC31_MPMC_DYNCONTROL); + putreg32((MPMC_DYNCONTROL_CE | MPMC_DYNCONTROL_CS | + MPMC_DYNCONTROL_IMODE), LPC31_MPMC_DYNCONTROL); /* Program the SDRAM internal mode registers on bank nSDCE0 and reconfigure - * the SDRAM chips. Bus speeds up to 90MHz requires use of a CAS latency = 2. + * the SDRAM chips. + * Bus speeds up to 90MHz requires use of a CAS latency = 2. * To get correct value on address bus CAS cycle, requires a shift by 12 for * 16bit mode */ diff --git a/boards/arm/lpc31xx/olimex-lpc-h3131/src/lpc31_mmcsd.c b/boards/arm/lpc31xx/olimex-lpc-h3131/src/lpc31_mmcsd.c index 83ecede2c4c..dcec540d180 100644 --- a/boards/arm/lpc31xx/olimex-lpc-h3131/src/lpc31_mmcsd.c +++ b/boards/arm/lpc31xx/olimex-lpc-h3131/src/lpc31_mmcsd.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/olimex-lpc-h3131/src/lpc31_mmcsd.c + * boards/arm/lpc31xx/olimex-lpc-h3131/src/lpc31_mmcsd.c * * Copyright (C) 2013 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -96,9 +96,9 @@ int lpc31_mmcsd_initialize(int slot, int minor) finfo("Successfully bound SDIO to the MMC/SD driver\n"); - /* Then let's guess and say that there is a card in the slot. I need to check to - * see if the LPC-H3131 board supports a GPIO to detect if there is a card in - * the slot. + /* Then let's guess and say that there is a card in the slot. + * I need to check to see if the LPC-H3131 board supports a GPIO to detect + * if there is a card in the slot. */ sdio_mediachange(sdio, true); diff --git a/boards/arm/lpc31xx/olimex-lpc-h3131/src/lpc31_spi.c b/boards/arm/lpc31xx/olimex-lpc-h3131/src/lpc31_spi.c index 3c28db9c8a9..3f719221ea5 100644 --- a/boards/arm/lpc31xx/olimex-lpc-h3131/src/lpc31_spi.c +++ b/boards/arm/lpc31xx/olimex-lpc-h3131/src/lpc31_spi.c @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/olimex-lpc-h3131/src/lpc31_spi.c +/**************************************************************************** + * boards/arm/lpc31xx/olimex-lpc-h3131/src/lpc31_spi.c * * Copyright (C) 2013 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -31,11 +31,11 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Included Files - ************************************************************************************/ + ****************************************************************************/ #include @@ -52,56 +52,63 @@ #include "lpc_h3131.h" #ifdef CONFIG_LPC31_SPI -#if 0 /* At present, LPC-H3131 specific logic is hard-coded in the file lpc31_spi.c - * in arch/arm/src/lpc31xx */ +#if 0 +/* At present, LPC-H3131 specific logic is hard-coded in the file lpc31_spi.c + * in arch/arm/src/lpc31xx + */ -/************************************************************************************ +/**************************************************************************** * Public Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Name: lpc31_spidev_initialize * * Description: * Called to configure SPI chip select GPIO pins for the LPC-H3131 board. * - ************************************************************************************/ + ****************************************************************************/ void weak_function lpc31_spidev_initialize(void) { - /* NOTE: Clocking for SPI has already been provided. Pin configuration is performed - * on-the-fly, so no additional setup is required. + /* NOTE: Clocking for SPI has already been provided. + * Pin configuration is performed on-the-fly, so no additional setup + * is required. */ } -/************************************************************************************ +/**************************************************************************** * Name: lpc31_spiselect and lpc31_spistatus * * Description: * The external functions, lpc31_spiselect and lpc31_spistatus must be - * provided by board-specific logic. They are implementations of the select - * and status methods of the SPI interface defined by struct spi_ops_s (see - * include/nuttx/spi/spi.h). All other methods (including lpc31_spibus_initialize()) - * are provided by common LPC31XX logic. To use this common SPI logic on your - * board: + * provided by board-specific logic. They are implementations of the + * select and status methods of the SPI interface defined by struct + * spi_ops_s (see include/nuttx/spi/spi.h). + * All other methods (including lpc31_spibus_initialize()) are provided + * by common LPC31XX logic. + * To use this common SPI logic on your board: * - * 1. Provide logic in lpc31_boardinitialize() to configure SPI chip select - * pins. + * 1. Provide logic in lpc31_boardinitialize() to configure SPI chip + * select pins. * 2. Provide lpc31_spiselect() and lpc31_spistatus() functions in your - * board-specific logic. These functions will perform chip selection and - * status operations using GPIOs in the way your board is configured. - * 3. Add a calls to lpc31_spibus_initialize() in your low level application - * initialization logic - * 4. The handle returned by lpc31_spibus_initialize() may then be used to bind the - * SPI driver to higher level logic (e.g., calling - * mmcsd_spislotinitialize(), for example, will bind the SPI driver to - * the SPI MMC/SD driver). + * board-specific logic. These functions will perform chip selection + * and status operations using GPIOs in the way your board is + * configured. + * 3. Add a calls to lpc31_spibus_initialize() in your low level + * application initialization logic + * 4. The handle returned by lpc31_spibus_initialize() may then be used + * to bind the SPI driver to higher level logic (e.g., calling + * mmcsd_spislotinitialize(), for example, will bind the SPI + * driver to the SPI MMC/SD driver). * - ************************************************************************************/ + ****************************************************************************/ -void lpc31_spiselect(FAR struct spi_dev_s *dev, uint32_t devid, bool selected) +void lpc31_spiselect(FAR struct spi_dev_s *dev, uint32_t devid, + bool selected) { - spiinfo("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); + spiinfo("devid: %d CS: %s\n", (int)devid, + selected ? "assert" : "de-assert"); #warning "Missing logic" } @@ -112,4 +119,3 @@ uint8_t lpc31_spistatus(FAR struct spi_dev_s *dev, uint32_t devid) #endif /* 0 */ #endif /* CONFIG_LPC31_SPI */ - diff --git a/boards/arm/lpc31xx/olimex-lpc-h3131/src/lpc31_usbhost.c b/boards/arm/lpc31xx/olimex-lpc-h3131/src/lpc31_usbhost.c index 2f45dc489c1..2e3889f199c 100644 --- a/boards/arm/lpc31xx/olimex-lpc-h3131/src/lpc31_usbhost.c +++ b/boards/arm/lpc31xx/olimex-lpc-h3131/src/lpc31_usbhost.c @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/olimex-lpc-h3131/src/lpc31_usbhost.c +/**************************************************************************** + * boards/arm/lpc31xx/olimex-lpc-h3131/src/lpc31_usbhost.c * * Copyright (C) 2013, 2015-2017 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -31,11 +31,11 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Included Files - ************************************************************************************/ + ****************************************************************************/ #include @@ -60,9 +60,9 @@ #ifdef HAVE_USBHOST -/************************************************************************************ +/**************************************************************************** * Pre-processor Definitions - ************************************************************************************/ + ****************************************************************************/ #ifndef CONFIG_USBHOST_DEFPRIO # define CONFIG_USBHOST_DEFPRIO 50 @@ -76,9 +76,10 @@ # endif #endif -/************************************************************************************ +/**************************************************************************** * Private Data - ************************************************************************************/ + ****************************************************************************/ + /* Retained device driver handle */ static struct usbhost_connection_s *g_ehciconn; @@ -89,24 +90,24 @@ static struct usbhost_connection_s *g_ehciconn; static xcpt_t g_ochandler; #endif -/************************************************************************************ +/**************************************************************************** * Private Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Name: ehci_waiter * * Description: * Wait for USB devices to be connected to the EHCI root hub. * - ************************************************************************************/ + ****************************************************************************/ static int ehci_waiter(int argc, char *argv[]) { FAR struct usbhost_hubport_s *hport; uinfo("ehci_waiter: Running\n"); - for (;;) + for (; ; ) { /* Wait for the device to change state */ @@ -129,23 +130,23 @@ static int ehci_waiter(int argc, char *argv[]) return 0; } -/************************************************************************************ +/**************************************************************************** * Public Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Name: lpc31_usbhost_bootinitialize * * Description: - * Called from lpc31_boardinitialize very early in inialization to setup USB - * host-related GPIO pins for the LPC-H3131 board. + * Called from lpc31_boardinitialize very early in inialization to setup + * USB host-related GPIO pins for the LPC-H3131 board. * * SIGNAL GPIO * ----------- ------- * #OTG_PWR_E GPIO19 * #OTG_OVRCR GPIO20 * - ************************************************************************************/ + ****************************************************************************/ void weak_function lpc31_usbhost_bootinitialize(void) { @@ -158,18 +159,20 @@ void weak_function lpc31_usbhost_bootinitialize(void) gpio_configinput(LPC31_IOCONFIG_GPIO, GPIO_NOTG_OVRCR); /* Configure to receive interrupts on the overrcurrent input pin */ + #warning Missing logic } -/*********************************************************************************** +/**************************************************************************** * Name: lpc31_usbhost_initialize * * Description: - * Called at application startup time to initialize the USB host functionality. + * Called at application startup time to initialize the USB host + * functionality. * This function will start a thread that will monitor for device * connection/disconnection events. * - ***********************************************************************************/ + ****************************************************************************/ int lpc31_usbhost_initialize(void) { @@ -231,7 +234,7 @@ int lpc31_usbhost_initialize(void) /* Start a thread to handle device connection. */ - pid = kthread_create("EHCI Monitor", CONFIG_USBHOST_DEFPRIO,i + pid = kthread_create("EHCI Monitor", CONFIG_USBHOST_DEFPRIO, i CONFIG_USBHOST_STACKSIZE, (main_t)ehci_waiter, (FAR char * const *)NULL); if (pid < 0) @@ -243,27 +246,28 @@ int lpc31_usbhost_initialize(void) return OK; } -/*********************************************************************************** +/**************************************************************************** * Name: lpc31_usbhost_vbusdrive * * Description: - * Enable/disable driving of VBUS 5V output. This function must be provided by - * each platform that implements the OHCI or EHCI host interface + * Enable/disable driving of VBUS 5V output. + * This function must be provided by each platform that implements the + * OHCI or EHCI host interface * * Input Parameters: - * rhport - Selects root hub port to be powered host interface. Since the LPC31 - * has only a downstream port, zero is the only possible value for this - * parameter. + * rhport - Selects root hub port to be powered host interface. + * Since the LPC31 has only a downstream port, zero is the only + * possible value for this parameter. * enable - true: enable VBUS power; false: disable VBUS power * * Returned Value: * None * - ***********************************************************************************/ + ****************************************************************************/ void lpc31_usbhost_vbusdrive(int rhport, bool enable) { - uinfo("RHPort%d: enable=%d\n", rhport+1, enable); + uinfo("RHPort%d: enable=%d\n", rhport + 1, enable); /* The LPC3131 has only a single root hub port */ @@ -286,21 +290,22 @@ void lpc31_usbhost_vbusdrive(int rhport, bool enable) } } -/************************************************************************************ +/**************************************************************************** * Name: lpc31_setup_overcurrent * * Description: - * Setup to receive an interrupt-level callback if an overcurrent condition is - * detected. + * Setup to receive an interrupt-level callback if an overcurrent + * condition is detected. * * Input Parameters: * handler - New overcurrent interrupt handler * arg - The argument that will accompany the interrupt * * Returned Value: - * Zero (OK) returned on success; a negated errno value is returned on failure. + * Zero (OK) returned on success; a negated errno value is returned + * on failure. * - ************************************************************************************/ + ****************************************************************************/ #if 0 /* Not ready yet */ int lpc31_setup_overcurrent(xcpt_t handler, void *arg) @@ -314,11 +319,11 @@ int lpc31_setup_overcurrent(xcpt_t handler, void *arg) flags = enter_critical_section(); /* Configure the interrupt */ + #warning Missing logic leave_critical_section(flags); return oldhandler; } #endif /* 0 */ - #endif /* HAVE_USBHOST */ diff --git a/boards/arm/lpc31xx/olimex-lpc-h3131/src/lpc_h3131.h b/boards/arm/lpc31xx/olimex-lpc-h3131/src/lpc_h3131.h index 3f9dd935b33..7400a0f6249 100644 --- a/boards/arm/lpc31xx/olimex-lpc-h3131/src/lpc_h3131.h +++ b/boards/arm/lpc31xx/olimex-lpc-h3131/src/lpc_h3131.h @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/olimex-lpc-h3131/src/lpc_h3131.h +/**************************************************************************** + * boards/arm/lpc31xx/olimex-lpc-h3131/src/lpc_h3131.h * * Copyright (C) 2013 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -31,14 +31,14 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************************************/ + ****************************************************************************/ -#ifndef __BOARDS_ARM_OLIMEX_LPC_H3131_SRC_LPC_H3131_H -#define __BOARDS_ARM_OLIMEX_LPC_H3131_SRC_LPC_H3131_H +#ifndef __BOARDS_ARM_LPC31XX_OLIMEX_LPC_H3131_SRC_LPC_H3131_H +#define __BOARDS_ARM_LPC31XX_OLIMEX_LPC_H3131_SRC_LPC_H3131_H -/************************************************************************************ +/**************************************************************************** * Included Files - ************************************************************************************/ + ****************************************************************************/ #include #include @@ -46,9 +46,10 @@ #include "lpc31_ioconfig.h" -/************************************************************************************ +/**************************************************************************** * Pre-processor Definitions - ************************************************************************************/ + ****************************************************************************/ + /* Configuration ************************************************************/ /* PORT and SLOT number probably depend on the board configuration */ @@ -58,8 +59,8 @@ #define HAVE_USBHOST 1 #define HAVE_USBMONITOR 1 -/* Can't support MMC/SD features if mountpoints are disabled or if SDIO support - * is not enabled. +/* Can't support MMC/SD features if mountpoints are disabled or if + * SDIO support is not enabled. */ #if defined(CONFIG_DISABLE_MOUNTPOINT) || !defined(CONFIG_LPC31_MCI) @@ -86,7 +87,8 @@ # undef HAVE_USBMONITOR #endif -/* LPC-H3131 GPIOs ******************************************************************/ +/* LPC-H3131 GPIOs **********************************************************/ + /* BUTTONS. There are no user accessible buttons on the LPC-H3131 */ /* LEDs @@ -112,82 +114,84 @@ #define GPIO_NOTG_OVRCR IOCONFIG_GPIO_GPIO20 /* SPI Chip Selects */ + /* SPI NOR flash is the only device on SPI. SPI_CS_OUT0 is its chip select */ #define SPINOR_CS IOCONFIG_SPI_CSOUT0 /* USB Soft Connect Pullup -- NONE */ -/************************************************************************************ +/**************************************************************************** * Public Types - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Public data - ************************************************************************************/ + ****************************************************************************/ #ifndef __ASSEMBLY__ -/************************************************************************************ +/**************************************************************************** * Public Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Name: lpc31_meminitialize * * Description: * Initialize external memory resources (sram, sdram, nand, nor, etc.) * - ************************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_LPC31_EXTDRAM void lpc31_meminitialize(void); #endif -/************************************************************************************ +/**************************************************************************** * Name: lpc31_spidev_initialize * * Description: * Called to configure SPI chip select GPIO pins for the LPC-H3131 board. * - ************************************************************************************/ + ****************************************************************************/ void weak_function lpc31_spidev_initialize(void); -/************************************************************************************ +/**************************************************************************** * Name: lpc31_usbdev_initialize * * Description: * Called to setup USB-related GPIO pins for the LPC-H3131 board. * - ************************************************************************************/ + ****************************************************************************/ #ifdef HAVE_USBDEV void weak_function lpc31_usbdev_initialize(void); #endif -/************************************************************************************ +/**************************************************************************** * Name: lpc31_usbhost_bootinitialize * * Description: - * Called from lpc31_boardinitialize very early in inialization to setup USB - * host-related GPIO pins for the LPC-H3131 board. + * Called from lpc31_boardinitialize very early in inialization to setup + * USB host-related GPIO pins for the LPC-H3131 board. * - ************************************************************************************/ + ****************************************************************************/ #ifdef HAVE_USBHOST void weak_function lpc31_usbhost_bootinitialize(void); #endif -/*********************************************************************************** +/**************************************************************************** * Name: lpc31_usbhost_initialize * * Description: - * Called at application startup time to initialize the USB host functionality. + * Called at application startup time to initialize the USB host + * functionality. * This function will start a thread that will monitor for device * connection/disconnection events. * - ***********************************************************************************/ + ****************************************************************************/ #ifdef HAVE_USBHOST int lpc31_usbhost_initialize(void); @@ -206,5 +210,4 @@ int lpc31_mmcsd_initialize(int slot, int minor) #endif #endif /* __ASSEMBLY__ */ -#endif /* __BOARDS_ARM_OLIMEX_LPC_H3131_SRC_LPC_H3131_H */ - +#endif /* __BOARDS_ARM_LPC31XX_OLIMEX_LPC_H3131_SRC_LPC_H3131_H */ diff --git a/boards/arm/lpc31xx/olimex-lpc-h3131/tools/Makefile b/boards/arm/lpc31xx/olimex-lpc-h3131/tools/Makefile index 6e2c2d42d51..22f38c2390e 100644 --- a/boards/arm/lpc31xx/olimex-lpc-h3131/tools/Makefile +++ b/boards/arm/lpc31xx/olimex-lpc-h3131/tools/Makefile @@ -1,5 +1,5 @@ ############################################################################ -# boards/olimex-lpc-h3131/tools/Makefile +# boards/arm/lpc31xx/olimex-lpc-h3131/tools/Makefile # # Copyright (C) 2013 Gregory Nutt. All rights reserved. # Author: Gregory Nutt diff --git a/boards/arm/lpc31xx/olimex-lpc-h3131/tools/crc32.c b/boards/arm/lpc31xx/olimex-lpc-h3131/tools/crc32.c index 29b04f83df1..f7214fc9de2 100644 --- a/boards/arm/lpc31xx/olimex-lpc-h3131/tools/crc32.c +++ b/boards/arm/lpc31xx/olimex-lpc-h3131/tools/crc32.c @@ -1,5 +1,5 @@ -/************************************************************************************************ - * boards/olimex-lpc-h3131/tools/crc32.c +/**************************************************************************** + * boards/arm/lpc31xx/olimex-lpc-h3131/tools/crc32.c * * This file is a part of NuttX: * @@ -7,49 +7,55 @@ * * The logic in this file was developed by Gary S. Brown: * - * COPYRIGHT (C) 1986 Gary S. Brown. You may use this program, or code or tables - * extracted from it, as desired without restriction. + * COPYRIGHT (C) 1986 Gary S. Brown. You may use this program, or code + * or tables extracted from it, as desired without restriction. * - * First, the polynomial itself and its table of feedback terms. The polynomial is: + * First, the polynomial itself and its table of feedback terms. + * The polynomial is: * * X^32+X^26+X^23+X^22+X^16+X^12+X^11+X^10+X^8+X^7+X^5+X^4+X^2+X^1+X^0 * - * Note that we take it "backwards" and put the highest-order term in the lowest-order bit. - * The X^32 term is "implied"; the LSB is the X^31 term, etc. The X^0 term (usually shown - * as "+1") results in the MSB being 1 + * Note that we take it "backwards" and put the highest-order term in the + * lowest-order bit. + * The X^32 term is "implied"; the LSB is the X^31 term, etc. + * The X^0 term (usually shown as "+1") results in the MSB being 1 * - * Note that the usual hardware shift register implementation, which is what we're using - * (we're merely optimizing it by doing eight-bit chunks at a time) shifts bits into the - * lowest-order term. In our implementation, that means shifting towards the right. Why - * do we do it this way? Because the calculated CRC must be transmitted in order from - * highest-order term to lowest-order term. UARTs transmit characters in order from LSB - * to MSB. By storing the CRC this way we hand it to the UART in the order low-byte to - * high-byte; the UART sends each low-bit to hight-bit; and the result is transmission bit - * by bit from highest- to lowest-order term without requiring any bit shuffling on our + * Note that the usual hardware shift register implementation, which is what + * we're using (we're merely optimizing it by doing eight-bit chunks at a + * time) shifts bits into the lowest-order term. + * In our implementation, that means shifting towards the right. + * Why do it this way? Because the calculated CRC must be transmitted in + * order from highest-order term to lowest-order term. UARTs transmit + * characters in order from LSB to MSB. By storing the CRC this way we + * hand it to the UART in the order low-byte to high-byte; the UART sends + * each low-bit to hight-bit; and the result is transmission bit by bit from + * highest- to lowest-order term without requiring any bit shuffling on our * part. Reception works similarly * * The feedback terms table consists of 256, 32-bit entries. Notes * - * - The table can be generated at runtime if desired; code to do so is shown later. It - * might not be obvious, but the feedback terms simply represent the results of eight - * shift/xor operations for all combinations of data and CRC register values + * - The table can be generated at runtime if desired; code to do so is shown + * later. It might not be obvious, but the feedback terms simply represent + * the results of eight shift/xor operations for all combinations of data + * and CRC register values * - * - The values must be right-shifted by eight bits by the updcrc logic; the shift must - * be u_(bring in zeroes). On some hardware you could probably optimize the shift in - * assembler by using byte-swap instructions polynomial $edb88320 - ************************************************************************************************/ + * - The values must be right-shifted by eight bits by the updcrc logic; the + * shift must be u_(bring in zeroes). On some hardware you could probably + * optimize the shift in assembler by using byte-swap instructions + * polynomial $edb88320 + ***************************************************************************/ -/************************************************************************************************ +/**************************************************************************** * Included Files - ************************************************************************************************/ + ****************************************************************************/ #include #include #include "lpchdr.h" -/************************************************************************************************ +/**************************************************************************** * Private Data - ************************************************************************************************/ + ****************************************************************************/ static const uint32_t crc32_tab[] = { @@ -87,16 +93,17 @@ static const uint32_t crc32_tab[] = 0xb3667a2e, 0xc4614ab8, 0x5d681b02, 0x2a6f2b94, 0xb40bbe37, 0xc30c8ea1, 0x5a05df1b, 0x2d02ef8d }; -/************************************************************************************************ +/**************************************************************************** * Public Functions - ************************************************************************************************/ -/************************************************************************************************ + ****************************************************************************/ + +/**************************************************************************** * Name: crc32part * * Description: * Continue CRC calculation on a part of the buffer. * - ************************************************************************************************/ + ****************************************************************************/ uint32_t crc32part(const uint8_t *src, size_t len, uint32_t crc32val) { @@ -109,13 +116,13 @@ uint32_t crc32part(const uint8_t *src, size_t len, uint32_t crc32val) return crc32val; } -/************************************************************************************************ +/**************************************************************************** * Name: crc32 * * Description: * Return a 32-bit CRC of the contents of the 'src' buffer, length 'len' * - ************************************************************************************************/ + ****************************************************************************/ uint32_t crc32(const uint8_t *src, size_t len) { diff --git a/boards/arm/lpc31xx/olimex-lpc-h3131/tools/lpchdr.c b/boards/arm/lpc31xx/olimex-lpc-h3131/tools/lpchdr.c index cec2321271f..9f85ffe80c3 100644 --- a/boards/arm/lpc31xx/olimex-lpc-h3131/tools/lpchdr.c +++ b/boards/arm/lpc31xx/olimex-lpc-h3131/tools/lpchdr.c @@ -1,5 +1,5 @@ /************************************************************************************ - * boards/olimex-lpc-h3131/tools/lpchdr.c + * boards/arm/lpc31xx/olimex-lpc-h3131/tools/lpchdr.c * * Copyright (C) 2013 Gregory Nutt. All rights reserved. * Author: Gregory Nutt diff --git a/boards/arm/lpc31xx/olimex-lpc-h3131/tools/lpchdr.h b/boards/arm/lpc31xx/olimex-lpc-h3131/tools/lpchdr.h index a726b9d95c1..d417a4d4677 100644 --- a/boards/arm/lpc31xx/olimex-lpc-h3131/tools/lpchdr.h +++ b/boards/arm/lpc31xx/olimex-lpc-h3131/tools/lpchdr.h @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/olimex-lpc-h3131/tools/lpchdr.h +/**************************************************************************** + * boards/arm/lpc31xx/olimex-lpc-h3131/tools/lpchdr.h * * Copyright (C) 2013 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -31,24 +31,24 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************************************/ + ****************************************************************************/ -#ifndef __BOARDS_ARM_OLIMEX_LPC_H3131_TOOLS_LPCHDR_H -#define __BOARDS_ARM_OLIMEX_LPC_H3131_TOOLS_LPCHDR_H +#ifndef __BOARDS_ARM_LPC31XX_OLIMEX_LPC_H3131_TOOLS_LPCHDR_H +#define __BOARDS_ARM_LPC31XX_OLIMEX_LPC_H3131_TOOLS_LPCHDR_H -/************************************************************************************ +/**************************************************************************** * Included Files - ************************************************************************************/ + ****************************************************************************/ #include -/************************************************************************************ +/**************************************************************************** * Pre-processor Definitions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Public Types - ************************************************************************************/ + ****************************************************************************/ struct lpc31_header_s { @@ -90,16 +90,15 @@ struct lpc31_header_s * byte boundary */ }; -/************************************************************************************ +/**************************************************************************** * Public data - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Public Functions - ************************************************************************************/ + ****************************************************************************/ extern uint32_t crc32part(const uint8_t *src, size_t len, uint32_t crc32val); extern uint32_t crc32(const uint8_t *src, size_t len); -#endif /* __BOARDS_ARM_OLIMEX_LPC_H3131_TOOLS_LPCHDR_H */ - +#endif /* __BOARDS_ARM_LPC31XX_OLIMEX_LPC_H3131_TOOLS_LPCHDR_H */ diff --git a/boards/arm/lpc31xx/olimex-lpc-h3131/tools/mklpc.sh b/boards/arm/lpc31xx/olimex-lpc-h3131/tools/mklpc.sh index e43f5fbb2b0..095e3169dc8 100755 --- a/boards/arm/lpc31xx/olimex-lpc-h3131/tools/mklpc.sh +++ b/boards/arm/lpc31xx/olimex-lpc-h3131/tools/mklpc.sh @@ -1,13 +1,13 @@ #!/usr/bin/env bash -# This script lies in sub-directory boards/olimex-lpc-h3131/tools but make be executed +# This script lies in sub-directory boards/arm/lpc31xx/olimex-lpc-h3131/tools but make be executed # from either that directory or TOPDIR MYNAME=`basename $0` if [ -x "$PWD/$MYNAME" ]; then TOPDIR="$PWD/../../.." else - if [ -x "$PWD/boards/olimex-lpc-h3131/tools/$MYNAME" ]; then + if [ -x "$PWD/boards/arm/lpc31xx/olimex-lpc-h3131/tools/$MYNAME" ]; then TOPDIR="$PWD" else echo "This script must be executed from a known director" @@ -19,7 +19,7 @@ echo "TOOLDIR: $TOOLDIR" # The lpchdr could be named lpchdr.exe if we are running under Cygwin or # just lpchdr under Linux -TOOLDIR=$TOPDIR/boards/olimex-lpc-h3131/tools +TOOLDIR=$TOPDIR/boards/arm/lpc31xx/olimex-lpc-h3131/tools if [ ! -d "$TOOLDIR" ]; then echo "Tool directory $TOOLDIR does not exist" diff --git a/boards/arm/lpc31xx/olimex-lpc-h3131/tools/oocd.sh b/boards/arm/lpc31xx/olimex-lpc-h3131/tools/oocd.sh index c187a871c85..85ec5ee8872 100755 --- a/boards/arm/lpc31xx/olimex-lpc-h3131/tools/oocd.sh +++ b/boards/arm/lpc31xx/olimex-lpc-h3131/tools/oocd.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash # -# See boards/olimex-lpc-h3131/README.txt for information about +# See boards/arm/lpc31xx/olimex-lpc-h3131/README.txt for information about # this file. TOPDIR=$1 @@ -22,8 +22,8 @@ TARGET_PATH="/usr/local/share/openocd/scripts" # OPENOCD_EXE=openocd-ftd2xx.exe OPENOCD_EXE=openocd.exe -#OPENOCD_CFG=`cygpath -w "${TOPDIR}/boards/olimex-lpc1766stk/tools/olimex.cfg"` -OPENOCD_CFG="${TOPDIR}/boards/olimex-lpc-h3131/tools/armusbocd.cfg" +#OPENOCD_CFG=`cygpath -w "${TOPDIR}/boards/arm/lpc31xx/olimex-lpc1766stk/tools/olimex.cfg"` +OPENOCD_CFG="${TOPDIR}/boards/arm/lpc31xx/olimex-lpc-h3131/tools/armusbocd.cfg" # OPENOCD_ARGS="-f `cygpath -w ${OPENOCD_CFG}` -s `cygpath -w ${TARGET_PATH}`" # OPENOCD_ARGS="-f interface/arm-usb-ocd.cfg -f target/lpc3131.cfg -c \"adapter_khz 1000\"" diff --git a/boards/arm/lpc43xx/bambino-200e/include/board.h b/boards/arm/lpc43xx/bambino-200e/include/board.h index 986e5adb649..ba11dc2403c 100644 --- a/boards/arm/lpc43xx/bambino-200e/include/board.h +++ b/boards/arm/lpc43xx/bambino-200e/include/board.h @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/bambino-200e/include/board.h + * boards/arm/lpc43xx/bambino-200e/include/board.h * * Copyright (C) 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -34,8 +34,8 @@ * ****************************************************************************/ -#ifndef __BOARDS_ARM_BAMBINO_200E_INCLUDE_BOARD_H -#define __BOARDS_ARM_BAMBINO_200E_INCLUDE_BOARD_H +#ifndef __BOARDS_ARM_LPC43XX_BAMBINO_200E_INCLUDE_BOARD_H +#define __BOARDS_ARM_LPC43XX_BAMBINO_200E_INCLUDE_BOARD_H /**************************************************************************** * Included Files @@ -53,6 +53,7 @@ ****************************************************************************/ /* Clocking ****************************************************************/ + /* NOTE: The following definitions require lpc43_cgu.h. It is not included * here because the including C file may not have that file in its include * path. @@ -145,9 +146,9 @@ /* This is the clock setup we configure for: * - * SYSCLK = BOARD_OSCCLK_FREQUENCY = 12MHz -> Select Main oscillator for source - * PLL0CLK = (2 * 20 * SYSCLK) / 1 = 480MHz -> PLL0 multipler=20, pre-divider=1 - * CCLCK = 480MHz / 6 = 80MHz -> CCLK divider = 6 + * SYSCLK = BOARD_OSCCLK_FREQUENCY = 12MHz -> Select Main oscillator for source + * PLL0CLK = (2 * 20 * SYSCLK) / 1 = 480MHz -> PLL0 multipler=20, pre-divider=1 + * CCLCK = 480MHz / 6 = 80MHz -> CCLK divider = 6 */ #define LPC43_CCLK BOARD_FCLKOUT_FREQUENCY @@ -161,7 +162,6 @@ # define BOARD_ABP1_FREQUENCY BOARD_XTAL_FREQUENCY #endif - #if defined(CONFIG_LPC43_BUS) || defined(CONFIG_LPC43_I2C1) || \ defined(CONFIG_LPC43_DAC) || defined(CONFIG_LPC43_ADC0) || \ defined(CONFIG_LPC43_ADC1) || defined(CONFIG_LPC43_CAN0) @@ -186,6 +186,7 @@ #define BOARD_SDIO_CLKSRC BASE_SDIO_CLKSEL_PLL1 /* USB0 ********************************************************************/ + /* Settings needed in lpc43_cpu.c */ #define BOARD_USB0_CLKSRC PLL0USB_CLKSEL_XTAL @@ -193,6 +194,7 @@ #define BOARD_USB0_NP_DIV 0x00302062 /* Table 149 datsheet, valid for 12Mhz Fclkin */ /* SPIFI clocking **********************************************************/ + /* The SPIFI will receive clocking from a divider per the settings provided * in this file. The NuttX code will configure PLL1 as the input clock * for the selected divider @@ -211,7 +213,6 @@ # define BOARD_SPIFI_DIVB 1 /* Use IDIVB */ #endif - /* We need to configure the divider so that its output is as close to the * desired SCLK value. The peak data transfer rate will be about half of * this frequency in bytes per second. @@ -245,13 +246,14 @@ * BOARD_CLKDIV_SDXFR=2, Fsdmmc=22MHz (25MHz max) * * NOTE: Clock division is 2*n. For example, value of 0 means divide by - * 2 * 0 = 0 (no division, bypass), value of 1 means divide by 2 * 1 = 2, value - * of 255 means divide by 2 * 255 = 510, and so on. + * 2 * 0 = 0 (no division, bypass), value of 1 means divide by 2 * 1 = 2, + * value of 255 means divide by 2 * 255 = 510, and so on. * - * SD/MMC logic will write the value ((clkdiv + 1) >> 1) as the divisor. So an - * odd value calculated below will be moved up to next higher divider value. So - * the value 3 will cause 2 to be written as the divider value and the effective - * divider will be 4. + * SD/MMC logic will write the value ((clkdiv + 1) >> 1) as the divisor. + * So an odd value calculated below will be moved up to next higher divider + * value. + * So the value 3 will cause 2 to be written as the divider value and the + * effective divider will be 4. */ #define BOARD_CLKDIV_INIT BOARD_SDMMC_CEIL(BOARD_SDMMC_FREQUENCY, 400000) @@ -260,6 +262,7 @@ #define BOARD_CLKDIV_SDXFR BOARD_SDMMC_CEIL(BOARD_SDMMC_FREQUENCY, 25000000) /* UART clocking ***********************************************************/ + /* Configure all U[S]ARTs to use the XTAL input frequency */ #define BOARD_USART0_CLKSRC BASE_USART0_CLKSEL_XTAL @@ -275,6 +278,7 @@ #define BOARD_USART3_BASEFREQ BOARD_XTAL_FREQUENCY /* LED definitions *********************************************************/ + /* The Bambino 200E has 2 user-controllable LEDs labeled LED1 and LED2 in the * schematic and on bus referred to has GPIO3[7] and GPIO5[5], respectively. * @@ -317,6 +321,7 @@ #define LED_PANIC 2 /* NC ON NC OFF */ /* UART Pins ****************************************************************/ + /* The Bambino 200E does not have RS-232 drivers or serial connectors on * board. UART1 and USART2 are availables on Socket 5 and 10, recpectively: * @@ -350,6 +355,7 @@ #define PINCONF_U3_DIR PINCONF_U3_DIR_2 /* SPI Pins ****************************************************************/ + /* The Bambino 200E has SPI peripheral pins reserved for SPIFI. * SSP0 and SSP1 are available on Socket 1 and 10, respectively: * @@ -399,4 +405,4 @@ #define GPIO_SD_CMD PINCONF_SD_CMD_1 #define GPIO_SD_CLK CLKCONF_SD_CLK_2 -#endif /* __BOARDS_ARM_BAMBINO_200E_INCLUDE_BOARD_H */ +#endif /* __BOARDS_ARM_LPC43XX_BAMBINO_200E_INCLUDE_BOARD_H */ diff --git a/boards/arm/lpc43xx/bambino-200e/kernel/Makefile b/boards/arm/lpc43xx/bambino-200e/kernel/Makefile index 93e70caad68..928f46054d5 100644 --- a/boards/arm/lpc43xx/bambino-200e/kernel/Makefile +++ b/boards/arm/lpc43xx/bambino-200e/kernel/Makefile @@ -1,5 +1,5 @@ ############################################################################ -# boards/bambino-200e/kernel/Makefile +# boards/arm/lpc43xx/bambino-200e/kernel/Makefile # # Copyright (C) 2013, 2015 Gregory Nutt. All rights reserved. # Author: Gregory Nutt diff --git a/boards/arm/lpc43xx/bambino-200e/kernel/lpc43_userspace.c b/boards/arm/lpc43xx/bambino-200e/kernel/lpc43_userspace.c index 367594100b6..eb6d6793b85 100644 --- a/boards/arm/lpc43xx/bambino-200e/kernel/lpc43_userspace.c +++ b/boards/arm/lpc43xx/bambino-200e/kernel/lpc43_userspace.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/bambino-200e/kernel/lpc43_userspace.c + * boards/arm/lpc43xx/bambino-200e/kernel/lpc43_userspace.c * * Copyright (C) 2017 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -51,6 +51,7 @@ /**************************************************************************** * Pre-processor Definitions ****************************************************************************/ + /* Configuration ************************************************************/ #ifndef CONFIG_NUTTX_USERSPACE @@ -66,8 +67,8 @@ ****************************************************************************/ /* These 'addresses' of these values are setup by the linker script. They are - * not actual uint32_t storage locations! They are only used meaningfully in the - * following way: + * not actual uint32_t storage locations! They are only used meaningfully in + * the following way: * * - The linker script defines, for example, the symbol_sdata. * - The declaration extern uint32_t _sdata; makes C happy. C will believe diff --git a/boards/arm/lpc43xx/bambino-200e/scripts/Make.defs b/boards/arm/lpc43xx/bambino-200e/scripts/Make.defs index 2c1de46448c..0194eeaa15f 100644 --- a/boards/arm/lpc43xx/bambino-200e/scripts/Make.defs +++ b/boards/arm/lpc43xx/bambino-200e/scripts/Make.defs @@ -1,5 +1,5 @@ ############################################################################ -# boards/bambino-200e/scripts/Make.defs +# boards/arm/lpc43xx/bambino-200e/scripts/Make.defs # # Copyright (C) 2016, 2017 Gregory Nutt. All rights reserved. # Author: Gregory Nutt diff --git a/boards/arm/lpc43xx/bambino-200e/scripts/memory.ld b/boards/arm/lpc43xx/bambino-200e/scripts/memory.ld index c5af303f0f9..881ceb387c0 100644 --- a/boards/arm/lpc43xx/bambino-200e/scripts/memory.ld +++ b/boards/arm/lpc43xx/bambino-200e/scripts/memory.ld @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/stm32f4discovery/scripts/memory.ld + * boards/arm/lpc43xx/bambino-200e/scripts/memory.ld * * Copyright (C) 2017 Gregory Nutt. All rights reserved. * Author: Gregory Nutt diff --git a/boards/arm/lpc43xx/bambino-200e/scripts/ramconfig.ld b/boards/arm/lpc43xx/bambino-200e/scripts/ramconfig.ld index fcdb16834ff..8866cbd8dd6 100644 --- a/boards/arm/lpc43xx/bambino-200e/scripts/ramconfig.ld +++ b/boards/arm/lpc43xx/bambino-200e/scripts/ramconfig.ld @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/bambino-200e/scripts/ramconfig.ld + * boards/arm/lpc43xx/bambino-200e/scripts/ramconfig.ld * * Copyright (C) 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt diff --git a/boards/arm/lpc43xx/bambino-200e/scripts/spificonfig.ld b/boards/arm/lpc43xx/bambino-200e/scripts/spificonfig.ld index 6f516cf5be2..3535bc5d722 100644 --- a/boards/arm/lpc43xx/bambino-200e/scripts/spificonfig.ld +++ b/boards/arm/lpc43xx/bambino-200e/scripts/spificonfig.ld @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/bambino-200e/scripts/spificonfig.ld + * boards/arm/lpc43xx/bambino-200e/scripts/spificonfig.ld * * Copyright (C) 2012 Gregory Nutt. All rights reserved. * Author: Gregory Nutt diff --git a/boards/arm/lpc43xx/bambino-200e/scripts/user-space.ld b/boards/arm/lpc43xx/bambino-200e/scripts/user-space.ld index 147070f3d6d..4905533f989 100644 --- a/boards/arm/lpc43xx/bambino-200e/scripts/user-space.ld +++ b/boards/arm/lpc43xx/bambino-200e/scripts/user-space.ld @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/stm32f4discovery/scripts/user-space.ld + * boards/arm/lpc43xx/bambino-200e/scripts/user-space.ld * * Copyright (C) 2017 Gregory Nutt. All rights reserved. * Author: Gregory Nutt diff --git a/boards/arm/lpc43xx/bambino-200e/src/Makefile b/boards/arm/lpc43xx/bambino-200e/src/Makefile index fc6bbc5f107..1e28a1a6bc0 100644 --- a/boards/arm/lpc43xx/bambino-200e/src/Makefile +++ b/boards/arm/lpc43xx/bambino-200e/src/Makefile @@ -1,5 +1,5 @@ ############################################################################ -# boards/bambino-200e/src/Makefile +# boards/arm/lpc43xx/bambino-200e/src/Makefile # # Copyright (C) 2012 Gregory Nutt. All rights reserved. # Author: Gregory Nutt diff --git a/boards/arm/lpc43xx/bambino-200e/src/bambino-200e.h b/boards/arm/lpc43xx/bambino-200e/src/bambino-200e.h index 66724f29838..14c9e98111b 100644 --- a/boards/arm/lpc43xx/bambino-200e/src/bambino-200e.h +++ b/boards/arm/lpc43xx/bambino-200e/src/bambino-200e.h @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/bambino-200e/src/bambino-200e.h + * boards/arm/lpc43xx/bambino-200e/src/bambino-200e.h * * Copyright (C) 2016, 2018 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -34,8 +34,8 @@ * ****************************************************************************/ -#ifndef _CONFIGS_BAMBINO_200E_SRC_BAMBINO_H -#define _CONFIGS_BAMBINO_200E_SRC_BAMBINO_H +#ifndef __BOARDS_ARM_LPC43X_BAMBINO_200E_SRC_BAMBINO_H +#define __BOARDS_ARM_LPC43X_BAMBINO_200E_SRC_BAMBINO_H /**************************************************************************** * Included Files @@ -166,7 +166,7 @@ void weak_function lpc43_sspdev_initialize(void); -/************************************************************************************ +/**************************************************************************** * Name: lpc43_max31855initialize * * Description: @@ -181,17 +181,18 @@ void weak_function lpc43_sspdev_initialize(void); * Returned Value: * Zero (OK) on success; a negated errno value on failure. * - ************************************************************************************/ + ****************************************************************************/ -int lpc43_max31855initialize(FAR const char *devpath, int bus, uint16_t devid); +int lpc43_max31855initialize(FAR const char *devpath, int bus, + uint16_t devid); -/************************************************************************************ +/**************************************************************************** * Name: lpc43xx_timerinitialize() * * Description: * Perform architecture-specific initialization of the timer hardware. * - ************************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_TIMER int lpc43_timerinitialize(void); @@ -200,4 +201,4 @@ int lpc43_timerinitialize(void); #endif #endif /* __ASSEMBLY__ */ -#endif /* _CONFIGS_BAMBINO_200E_SRC_BAMBINO_H */ +#endif /* __BOARDS_ARM_LPC43X_BAMBINO_200E_SRC_BAMBINO_H */ diff --git a/boards/arm/lpc43xx/bambino-200e/src/lpc43_appinit.c b/boards/arm/lpc43xx/bambino-200e/src/lpc43_appinit.c index 899405aedb8..280039f560a 100644 --- a/boards/arm/lpc43xx/bambino-200e/src/lpc43_appinit.c +++ b/boards/arm/lpc43xx/bambino-200e/src/lpc43_appinit.c @@ -1,5 +1,5 @@ /**************************************************************************** - * config/bambino-200e/src/lpc43_appinit.c + * boards/arm/lpc43xx/bambino-200e/src/lpc43_appinit.c * * Copyright (C) 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt diff --git a/boards/arm/lpc43xx/bambino-200e/src/lpc43_autoleds.c b/boards/arm/lpc43xx/bambino-200e/src/lpc43_autoleds.c index 9f47af566e5..037cd0275eb 100644 --- a/boards/arm/lpc43xx/bambino-200e/src/lpc43_autoleds.c +++ b/boards/arm/lpc43xx/bambino-200e/src/lpc43_autoleds.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/bambino-200e/src/lpc43_autoleds.c + * boards/arm/lpc43xx/bambino-200e/src/lpc43_autoleds.c * * Copyright (C) 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -56,6 +56,7 @@ #ifdef CONFIG_ARCH_LEDS /* LED definitions **********************************************************/ + /* The LPC4330-Xplorer has 2 user-controllable LEDs labeled D2 an D3 in the * schematic and on but referred to has LED1 and LED2 here, respectively. * diff --git a/boards/arm/lpc43xx/bambino-200e/src/lpc43_boot.c b/boards/arm/lpc43xx/bambino-200e/src/lpc43_boot.c index 97914d6e83e..1925b002533 100644 --- a/boards/arm/lpc43xx/bambino-200e/src/lpc43_boot.c +++ b/boards/arm/lpc43xx/bambino-200e/src/lpc43_boot.c @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/bambino-200e/src/lpc43_boot.c +/**************************************************************************** + * boards/arm/lpc43xx/bambino-200e/src/lpc43_boot.c * * Copyright (C) 2016, 2018 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -32,11 +32,11 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Included Files - ************************************************************************************/ + ****************************************************************************/ #include @@ -66,19 +66,20 @@ enum ssp_channel_e SSP1 }; -/************************************************************************************ +/**************************************************************************** * Public Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Name: lpc43_boardinitialize * * Description: - * All LPC43xx architectures must provide the following entry point. This entry - * point is called early in the initialization -- after all memory has been - * configured and mapped but before any devices have been initialized. + * All LPC43xx architectures must provide the following entry point. + * This entry point is called early in the initialization -- after all + * memory has been configured and mapped but before any devices have been + * initialized. * - ************************************************************************************/ + ****************************************************************************/ void lpc43_boardinitialize(void) { @@ -88,8 +89,9 @@ void lpc43_boardinitialize(void) board_autoled_initialize(); #endif - /* Configure SSP chip selects if 1) Any SSP channel is not disabled, and 2) the - * weak function lpc43_sspdev_initialize() has been brought into the link. + /* Configure SSP chip selects if 1) Any SSP channel is not disabled, and 2) + * the weak function lpc43_sspdev_initialize() has been brought into the + * link. */ #if defined(CONFIG_LPC43_SSP0) || defined(CONFIG_LPC43_SSP1) @@ -106,10 +108,11 @@ void lpc43_boardinitialize(void) * Description: * If CONFIG_BOARD_LATE_INITIALIZE is selected, then an additional * initialization call will be performed in the boot-up sequence to a - * function called board_late_initialize(). board_late_initialize() will be - * called immediately after up_initialize() is called and just before the - * initial application is started. This additional initialization phase - * may be used, for example, to initialize board-specific device drivers. + * function called board_late_initialize(). + * board_late_initialize() will be called immediately after up_initialize() + * is called and just before the initial application is started. + * This additional initialization phase may be used, for example, to + * initialize board-specific device drivers. * ****************************************************************************/ diff --git a/boards/arm/lpc43xx/bambino-200e/src/lpc43_buttons.c b/boards/arm/lpc43xx/bambino-200e/src/lpc43_buttons.c index 340227da425..7cc695585fd 100644 --- a/boards/arm/lpc43xx/bambino-200e/src/lpc43_buttons.c +++ b/boards/arm/lpc43xx/bambino-200e/src/lpc43_buttons.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/bambino-200e/src/lpc43_buttons.c + * boards/arm/lpc43xx/bambino-200e/src/lpc43_buttons.c * * Copyright (C) 2016-2017 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -108,9 +108,9 @@ void board_button_initialize(void) * Name: board_buttons * * Description: - * board_button_initialize() must be called to initialize button resources. After - * that, board_buttons() may be called to collect the current state of all - * buttons. + * board_button_initialize() must be called to initialize button resources. + * After that, board_buttons() may be called to collect the current state + * of all buttons. * * board_buttons() may be called at any time to harvest the state of every * button. The state of the buttons is returned as a bitset with one @@ -129,16 +129,16 @@ uint32_t board_buttons(void) for (i = 0; i < NUM_BUTTONS; i++) { - /* A LOW value means that the key is pressed. */ + /* A LOW value means that the key is pressed. */ - bool released = lpc43_gpio_read(g_buttoncfg[i]); + bool released = lpc43_gpio_read(g_buttoncfg[i]); - /* Accumulate the set of depressed (not released) keys */ + /* Accumulate the set of depressed (not released) keys */ - if (!released) - { + if (!released) + { ret |= (1 << i); - } + } } return ret; @@ -148,19 +148,22 @@ uint32_t board_buttons(void) * Button support. * * Description: - * board_button_initialize() must be called to initialize button resources. After - * that, board_button_irq() may be called to register button interrupt handlers. + * board_button_initialize() must be called to initialize button resources. + * After that, board_button_irq() may be called to register button + * interrupt handlers. * - * board_button_irq() may be called to register an interrupt handler that will - * be called when a button is depressed or released. The ID value is a - * button enumeration value that uniquely identifies a button resource. See the - * BOARD_BUTTON_* and BOARD_JOYSTICK_* definitions in board.h for the meaning - * of enumeration values. + * board_button_irq() may be called to register an interrupt handler that + * will be called when a button is depressed or released. + * The ID value is a button enumeration value that uniquely identifies a + * button resource. + * See the BOARD_BUTTON_* and BOARD_JOYSTICK_* definitions in board.h for + * the meaning of enumeration values. * - * Note that board_button_irq() also enables button interrupts. Button - * interrupts will remain enabled after the interrupt handler is attached. - * Interrupts may be disabled (and detached) by calling board_button_irq with - * irqhandler equal to NULL. + * Note that board_button_irq() also enables button interrupts. + * Button interrupts will remain enabled after the interrupt handler is + * attached. + * Interrupts may be disabled (and detached) by calling board_button_irq + * with irqhandler equal to NULL. * ****************************************************************************/ diff --git a/boards/arm/lpc43xx/bambino-200e/src/lpc43_max31855.c b/boards/arm/lpc43xx/bambino-200e/src/lpc43_max31855.c index dd1fe2cb4de..5029946c7dc 100644 --- a/boards/arm/lpc43xx/bambino-200e/src/lpc43_max31855.c +++ b/boards/arm/lpc43xx/bambino-200e/src/lpc43_max31855.c @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/bambino-200e/src/lpc43_max31855.c +/**************************************************************************** + * boards/arm/lpc43xx/bambino-200e/src/lpc43_max31855.c * * Copyright (C) 2015 Alan Carvalho de Assis. All rights reserved. * Author: Alan Carvalho de Assis @@ -31,11 +31,11 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Included Files - ************************************************************************************/ + ****************************************************************************/ #include @@ -49,7 +49,6 @@ #include - #include "lpc43_spi.h" #include "lpc43_ssp.h" @@ -59,11 +58,11 @@ #if defined(CONFIG_SPI) && defined(CONFIG_SENSORS_MAX31855) -/************************************************************************************ +/**************************************************************************** * Public Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Name: lpc43_max31855initialize * * Description: @@ -77,7 +76,7 @@ * Returned Value: * Zero (OK) on success; a negated errno value on failure. * - ************************************************************************************/ + ****************************************************************************/ int lpc43_max31855initialize(FAR const char *devpath, int bus, uint16_t devid) { diff --git a/boards/arm/lpc43xx/bambino-200e/src/lpc43_ostest.c b/boards/arm/lpc43xx/bambino-200e/src/lpc43_ostest.c index 0610a490b2b..2962a9c6b47 100644 --- a/boards/arm/lpc43xx/bambino-200e/src/lpc43_ostest.c +++ b/boards/arm/lpc43xx/bambino-200e/src/lpc43_ostest.c @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/bambino-200e/src/lpc43_ostest.c +/**************************************************************************** + * boards/arm/lpc43xx/bambino-200e/src/lpc43_ostest.c * * Copyright (C) 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -32,11 +32,11 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Included Files - ************************************************************************************/ + ****************************************************************************/ #include @@ -52,11 +52,11 @@ #include "up_internal.h" #include "bambino-200e.h" -/************************************************************************************ +/**************************************************************************** * Pre-processor Definitions - ************************************************************************************/ + ****************************************************************************/ -/* Configuration ********************************************************************/ +/* Configuration ************************************************************/ #undef HAVE_FPU #if defined(CONFIG_ARCH_FPU) && defined(CONFIG_TESTING_OSTEST_FPUSIZE) && \ @@ -70,18 +70,18 @@ # error "CONFIG_TESTING_OSTEST_FPUSIZE has the wrong size" #endif -/************************************************************************************ +/**************************************************************************** * Private Data - ************************************************************************************/ + ****************************************************************************/ static uint32_t g_saveregs[XCPTCONTEXT_REGS]; -/************************************************************************************ +/**************************************************************************** * Public Functions - ************************************************************************************/ + ****************************************************************************/ -/* Given an array of size CONFIG_TESTING_OSTEST_FPUSIZE, this function will return - * the current FPU registers. +/* Given an array of size CONFIG_TESTING_OSTEST_FPUSIZE, this function will + * return the current FPU registers. */ void arch_getfpu(FAR uint32_t *fpusave) diff --git a/boards/arm/lpc43xx/bambino-200e/src/lpc43_ssp.c b/boards/arm/lpc43xx/bambino-200e/src/lpc43_ssp.c index e07189ab839..265cec0a5e4 100644 --- a/boards/arm/lpc43xx/bambino-200e/src/lpc43_ssp.c +++ b/boards/arm/lpc43xx/bambino-200e/src/lpc43_ssp.c @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/bambino-200e/src/lpc43_ssp.c +/**************************************************************************** + * boards/arm/lpc43xx/bambino-200e/src/lpc43_ssp.c * * Copyright (C) 2011-2012 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -31,11 +31,11 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Included Files - ************************************************************************************/ + ****************************************************************************/ #include @@ -55,9 +55,9 @@ #include #include -/************************************************************************************ +/**************************************************************************** * Public Functions - ************************************************************************************/ + ****************************************************************************/ /**************************************************************************** * Name: lpc43_sspdev_initialize @@ -86,22 +86,25 @@ void weak_function lpc43_sspdev_initialize(void) #endif } -/************************************************************************************ +/**************************************************************************** * Name: lpc43_ssp0select * * Description: - * Perform chip selection using GPIO pins, controlling data flow in SSP0 channel. + * Perform chip selection using GPIO pins, controlling data flow in SSP0 + * channel. * * Input parameters: * devpath - The full path to the driver. E.g., "/dev/temp0" * devid - Minor device number. E.g., 0, 1, 2, etc. * selected - Logical state of the pin * - ************************************************************************************/ + ****************************************************************************/ -void lpc43_ssp0select(FAR struct spi_dev_s *dev, uint32_t devid, bool selected) +void lpc43_ssp0select(FAR struct spi_dev_s *dev, uint32_t devid, + bool selected) { - spiinfo("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); + spiinfo("devid: %d CS: %s\n", (int)devid, + selected ? "assert" : "de-assert"); #if defined(CONFIG_SENSORS_MAX31855) if (devid == SPIDEV_TEMPERATURE(0)) @@ -116,7 +119,7 @@ void lpc43_ssp0select(FAR struct spi_dev_s *dev, uint32_t devid, bool selected) #endif } -/************************************************************************************ +/**************************************************************************** * Name: lpc43_ssp0status * * Description: @@ -128,29 +131,32 @@ void lpc43_ssp0select(FAR struct spi_dev_s *dev, uint32_t devid, bool selected) * * Returned Value: * Zero - ************************************************************************************/ + ****************************************************************************/ uint8_t lpc43_ssp0status(FAR struct spi_dev_s *dev, uint32_t devid) { return 0; } -/************************************************************************************ +/**************************************************************************** * Name: lpc43_ssp1select * * Description: - * Perform chip selection using GPIO pins, controlling data flow in SSP1 channel. + * Perform chip selection using GPIO pins, controlling data flow in SSP1 + * channel. * * Input parameters: * devpath - The full path to the driver. E.g., "/dev/temp0" * devid - Minor device number. E.g., 0, 1, 2, etc. * selected - Logical state of the pin * - ************************************************************************************/ + ****************************************************************************/ -void lpc43_ssp1select(FAR struct spi_dev_s *dev, uint32_t devid, bool selected) +void lpc43_ssp1select(FAR struct spi_dev_s *dev, uint32_t devid, + bool selected) { - spiinfo("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); + spiinfo("devid: %d CS: %s\n", (int)devid, + selected ? "assert" : "de-assert"); #if defined(CONFIG_SENSORS_MAX31855) if (devid == SPIDEV_TEMPERATURE(0)) @@ -165,7 +171,7 @@ void lpc43_ssp1select(FAR struct spi_dev_s *dev, uint32_t devid, bool selected) #endif } -/************************************************************************************ +/**************************************************************************** * Name: lpc43_ssp1status * * Description: @@ -177,7 +183,7 @@ void lpc43_ssp1select(FAR struct spi_dev_s *dev, uint32_t devid, bool selected) * * Returned Value: * Zero - ************************************************************************************/ + ****************************************************************************/ uint8_t lpc43_ssp1status(FAR struct spi_dev_s *dev, uint32_t devid) { diff --git a/boards/arm/lpc43xx/bambino-200e/src/lpc43_timer.c b/boards/arm/lpc43xx/bambino-200e/src/lpc43_timer.c index f1b8840959c..aad3ac07972 100644 --- a/boards/arm/lpc43xx/bambino-200e/src/lpc43_timer.c +++ b/boards/arm/lpc43xx/bambino-200e/src/lpc43_timer.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/bambino-200e/src/lpc43_timer.c + * boards/arm/lpc43xx/bambino-200e/src/lpc43_timer.c * * Copyright (C) 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -61,6 +61,7 @@ /**************************************************************************** * Pre-processor Definitions ****************************************************************************/ + /* Configuration ************************************************************/ #if !(defined(CONFIG_LPC43_TMR0) || defined(CONFIG_LPC43_TMR1) || defined(CONFIG_LPC43_TMR2) \ diff --git a/boards/arm/lpc43xx/bambino-200e/src/lpc43_userleds.c b/boards/arm/lpc43xx/bambino-200e/src/lpc43_userleds.c index c6be975c156..c3bcf12fd1c 100644 --- a/boards/arm/lpc43xx/bambino-200e/src/lpc43_userleds.c +++ b/boards/arm/lpc43xx/bambino-200e/src/lpc43_userleds.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/bambino-200e/src/lpc43_userleds.c + * boards/arm/lpc43xx/bambino-200e/src/lpc43_userleds.c * * Copyright (C) 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -59,6 +59,7 @@ ****************************************************************************/ /* LED definitions **********************************************************/ + /* The LPC4330-Xplorer has 2 user-controllable LEDs labeled D2 an D3 in the * schematic and on but referred to has LED1 and LED2 here, respectively. * diff --git a/boards/arm/lpc43xx/lpc4330-xplorer/README.txt b/boards/arm/lpc43xx/lpc4330-xplorer/README.txt index 2625307d3de..c34395b5e05 100644 --- a/boards/arm/lpc43xx/lpc4330-xplorer/README.txt +++ b/boards/arm/lpc43xx/lpc4330-xplorer/README.txt @@ -269,8 +269,8 @@ Code Red IDE/Tools The LPC18xx/LPC43xx debug driver can also be used to program the LPC43xx flash directly from the command line. The script flash.sh that may be - found in the boards/lpc4330-xplorer/scripts directory can do that with - a single command line command. + found in the boards/arm/lpc43xx/lpc4330-xplorer/scripts directory can do + that with a single command line command. Executing from SPIFI -------------------- diff --git a/boards/arm/lpc43xx/lpc4330-xplorer/include/board.h b/boards/arm/lpc43xx/lpc4330-xplorer/include/board.h index f16e5382293..ad3d188ba3b 100644 --- a/boards/arm/lpc43xx/lpc4330-xplorer/include/board.h +++ b/boards/arm/lpc43xx/lpc4330-xplorer/include/board.h @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/lpc4330-xplorer/include/board.h + * boards/arm/lpc43xx/lpc4330-xplorer/include/board.h * * Copyright (C) 2012, 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -33,8 +33,8 @@ * ****************************************************************************/ -#ifndef __ARCH_BOARD_BOARD_H -#define __ARCH_BOARD_BOARD_H +#ifndef __BOARDS_ARM_LPC43XX_LPC4330_XPLORER_INCLUDE_BOARD_H +#define __BOARDS_ARM_LPC43XX_LPC4330_XPLORER_INCLUDE__BOARD_H /**************************************************************************** * Included Files @@ -52,6 +52,7 @@ ****************************************************************************/ /* Clocking ****************************************************************/ + /* NOTE: The following definitions require lpc43_cgu.h. It is not included * here because the including C file may not have that file in its include * path. @@ -143,9 +144,9 @@ /* This is the clock setup we configure for: * - * SYSCLK = BOARD_OSCCLK_FREQUENCY = 12MHz -> Select Main oscillator for source - * PLL0CLK = (2 * 20 * SYSCLK) / 1 = 480MHz -> PLL0 multipler=20, pre-divider=1 - * CCLCK = 480MHz / 6 = 80MHz -> CCLK divider = 6 + * SYSCLK = BOARD_OSCCLK_FREQUENCY = 12MHz -> Select Main oscillator for source + * PLL0CLK = (2 * 20 * SYSCLK) / 1 = 480MHz -> PLL0 multipler=20, pre-divider=1 + * CCLCK = 480MHz / 6 = 80MHz -> CCLK divider = 6 */ #define LPC43_CCLK BOARD_FCLKOUT_FREQUENCY @@ -159,7 +160,6 @@ # define BOARD_ABP1_FREQUENCY BOARD_XTAL_FREQUENCY #endif - #if defined(CONFIG_LPC43_BUS) || defined(CONFIG_LPC43_I2C1) || \ defined(CONFIG_LPC43_DAC) || defined(CONFIG_LPC43_ADC0) || \ defined(CONFIG_LPC43_ADC1) || defined(CONFIG_LPC43_CAN0) @@ -180,6 +180,7 @@ #define BOARD_SSP1_BASEFREQ BOARD_IDIVA_FREQUENCY /* USB0 ********************************************************************/ + /* Settings needed in lpc43_cpu.c */ #define BOARD_USB0_CLKSRC PLL0USB_CLKSEL_XTAL @@ -187,6 +188,7 @@ #define BOARD_USB0_NP_DIV 0x00302062 /* Table 149 datsheet, valid for 12Mhz Fclkin */ /* SPIFI clocking **********************************************************/ + /* The SPIFI will receive clocking from a divider per the settings provided * in this file. The NuttX code will configure PLL1 as the input clock * for the selected divider @@ -205,7 +207,6 @@ # define BOARD_SPIFI_DIVB 1 /* Use IDIVB */ #endif - /* We need to configure the divider so that its output is as close to the * desired SCLK value. The peak data transfer rate will be about half of * this frequency in bytes per second. @@ -229,13 +230,14 @@ /* Mode-dependent function clock division * * NOTE: Clock division is 2*n. For example, value of 0 means divide by - * 2 * 0 = 0 (no division, bypass), value of 1 means divide by 2 * 1 = 2, value - * of 255 means divide by 2 * 255 = 510, and so on. + * 2 * 0 = 0 (no division, bypass), value of 1 means divide by 2 * 1 = 2, + * value of 255 means divide by 2 * 255 = 510, and so on. * - * SD/MMC logic will write the value ((clkdiv + 1) >> 1) as the divisor. So an - * odd value calculated below will be moved up to next higher divider value. So - * the value 3 will cause 2 to be written as the divider value and the effective - * divider will be 4. + * SD/MMC logic will write the value ((clkdiv + 1) >> 1) as the divisor. + * So an odd value calculated below will be moved up to next higher divider + * value. + * So the value 3 will cause 2 to be written as the divider value and the + * effective divider will be 4. * * NOTE: The SDIO function clock to the interface can be up to 52 MHZ. * See UM10503 Section 22.2. @@ -247,6 +249,7 @@ #define BOARD_CLKDIV_SDXFR BOARD_SDMMC_CEIL(BOARD_SDMMC_FREQUENCY, 25000000) /* UART clocking ***********************************************************/ + /* Configure all U[S]ARTs to use the XTAL input frequency */ #define BOARD_USART0_CLKSRC BASE_USART0_CLKSEL_XTAL @@ -262,6 +265,7 @@ #define BOARD_USART3_BASEFREQ BOARD_XTAL_FREQUENCY /* LED definitions *********************************************************/ + /* The LPC4330-Xplorer has 2 user-controllable LEDs labeled D2 an D3 in the * schematic and on but referred to has LED1 and LED2 here, respectively. * @@ -304,6 +308,7 @@ #define LED_PANIC 2 /* NC ON NC OFF */ /* UART Pins ****************************************************************/ + /* The LPC4330 Xplorer does not have RS-232 drivers or serial connectors on * board. USART0 and UART1 are available on J8 as follows: * @@ -345,4 +350,4 @@ #define PINCONF_ENET_MDC PINCONF_ENET_MDC_3 #define PINCONF_ENET_TX_EN PINCONF_ENET_TX_EN_1 -#endif /* __ARCH_BOARD_BOARD_H */ +#endif /* __BOARDS_ARM_LPC43XX_LPC4330_XPLORER_INCLUDE_BOARD_H */ diff --git a/boards/arm/lpc43xx/lpc4330-xplorer/scripts/Make.defs b/boards/arm/lpc43xx/lpc4330-xplorer/scripts/Make.defs index 72cf0f2a0c2..2db496ef116 100644 --- a/boards/arm/lpc43xx/lpc4330-xplorer/scripts/Make.defs +++ b/boards/arm/lpc43xx/lpc4330-xplorer/scripts/Make.defs @@ -1,5 +1,5 @@ ############################################################################ -# boards/lpc4330-xplorer/scripts/Make.defs +# boards/arm/lpc43xx/lpc4330-xplorer/scripts/Make.defs # # Copyright (C) 2012, 2017 Gregory Nutt. All rights reserved. # Author: Gregory Nutt diff --git a/boards/arm/lpc43xx/lpc4330-xplorer/scripts/flash.sh b/boards/arm/lpc43xx/lpc4330-xplorer/scripts/flash.sh index 247b860f458..406bf531cd1 100755 --- a/boards/arm/lpc43xx/lpc4330-xplorer/scripts/flash.sh +++ b/boards/arm/lpc43xx/lpc4330-xplorer/scripts/flash.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash -#################################################################################### +############################################################################# # flash.sh # # Copyright (C) 2012 Gregory Nutt. All rights reserved. @@ -32,7 +32,7 @@ # ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE # POSSIBILITY OF SUCH DAMAGE. # -#################################################################################### +############################################################################# set -x USAGE="$0 " diff --git a/boards/arm/lpc43xx/lpc4330-xplorer/scripts/ramconfig.ld b/boards/arm/lpc43xx/lpc4330-xplorer/scripts/ramconfig.ld index df2c83afb41..11c87bc2c42 100644 --- a/boards/arm/lpc43xx/lpc4330-xplorer/scripts/ramconfig.ld +++ b/boards/arm/lpc43xx/lpc4330-xplorer/scripts/ramconfig.ld @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/lpc4330-xplorer/scripts/ramconfig.ld + * boards/arm/lpc43xx/lpc4330-xplorer/scripts/ramconfig.ld * * Copyright (C) 2012 Gregory Nutt. All rights reserved. * Author: Gregory Nutt diff --git a/boards/arm/lpc43xx/lpc4330-xplorer/scripts/spificonfig.ld b/boards/arm/lpc43xx/lpc4330-xplorer/scripts/spificonfig.ld index 289e7e0c297..5a2f288a122 100644 --- a/boards/arm/lpc43xx/lpc4330-xplorer/scripts/spificonfig.ld +++ b/boards/arm/lpc43xx/lpc4330-xplorer/scripts/spificonfig.ld @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/lpc4330-xplorer/scripts/spificonfig.ld + * boards/arm/lpc43xx/lpc4330-xplorer/scripts/spificonfig.ld * * Copyright (C) 2012 Gregory Nutt. All rights reserved. * Author: Gregory Nutt diff --git a/boards/arm/lpc43xx/lpc4330-xplorer/src/Makefile b/boards/arm/lpc43xx/lpc4330-xplorer/src/Makefile index 1b5e6af399a..8dd39302191 100644 --- a/boards/arm/lpc43xx/lpc4330-xplorer/src/Makefile +++ b/boards/arm/lpc43xx/lpc4330-xplorer/src/Makefile @@ -1,5 +1,5 @@ ############################################################################ -# boards/lpc4330-xplorer/src/Makefile +# boards/arm/lpc43xx/lpc4330-xplorer/src/Makefile # # Copyright (C) 2012 Gregory Nutt. All rights reserved. # Author: Gregory Nutt diff --git a/boards/arm/lpc43xx/lpc4330-xplorer/src/lpc4330-xplorer.h b/boards/arm/lpc43xx/lpc4330-xplorer/src/lpc4330-xplorer.h index 0f80ecf70a1..cc52b533fa0 100644 --- a/boards/arm/lpc43xx/lpc4330-xplorer/src/lpc4330-xplorer.h +++ b/boards/arm/lpc43xx/lpc4330-xplorer/src/lpc4330-xplorer.h @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/lpc4330-xplorer/src/lpc4330-xplorer.h + * boards/arm/lpc43xx/lpc4330-xplorer/src/lpc4330-xplorer.h * * Copyright (C) 2012 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -33,8 +33,8 @@ * ****************************************************************************/ -#ifndef _CONFIGS_LPC4330_XPLORER_SRC_XPLORER_H -#define _CONFIGS_LPC4330_XPLORER_SRC_XPLORER_H +#ifndef __BOARDSS_ARM_LPC43XX_LPC4330_XPLORER_SRC_XPLORER_H +#define __BOARDSS_ARM_LPC43XX_LPC4330_XPLORER_SRC_XPLORER_H /**************************************************************************** * Included Files @@ -123,4 +123,4 @@ void weak_function lpc43_sspdev_initialize(void); #endif /* __ASSEMBLY__ */ -#endif /* _CONFIGS_LPC4330_XPLORER_SRC_XPLORER_H */ +#endif /* __BOARDSS_ARM_LPC43XX_LPC4330_XPLORER_SRC_XPLORER_H */ diff --git a/boards/arm/lpc43xx/lpc4330-xplorer/src/lpc43_appinit.c b/boards/arm/lpc43xx/lpc4330-xplorer/src/lpc43_appinit.c index 5288a7eb88c..fbe019d8b59 100644 --- a/boards/arm/lpc43xx/lpc4330-xplorer/src/lpc43_appinit.c +++ b/boards/arm/lpc43xx/lpc4330-xplorer/src/lpc43_appinit.c @@ -1,5 +1,5 @@ /**************************************************************************** - * config/lpc4330-xplorer/src/lpc43_appinit.c + * boards/arm/lpc43xx/lpc4330-xplorer/src/lpc43_appinit.c * * Copyright (C) 2012, 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -60,6 +60,7 @@ /**************************************************************************** * Pre-processor Definitions ****************************************************************************/ + /* Configuration ************************************************************/ #ifndef CONFIG_SPIFI_DEVNO diff --git a/boards/arm/lpc43xx/lpc4330-xplorer/src/lpc43_autoleds.c b/boards/arm/lpc43xx/lpc4330-xplorer/src/lpc43_autoleds.c index ad2a7806c6d..ae618002802 100644 --- a/boards/arm/lpc43xx/lpc4330-xplorer/src/lpc43_autoleds.c +++ b/boards/arm/lpc43xx/lpc4330-xplorer/src/lpc43_autoleds.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/lpc4330-xplorer/src/lpc43_autoleds.c + * boards/arm/lpc43xx/lpc4330-xplorer/src/lpc43_autoleds.c * * Copyright (C) 2012-2013, 2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -55,6 +55,7 @@ #ifdef CONFIG_ARCH_LEDS /* LED definitions **********************************************************/ + /* The LPC4330-Xplorer has 2 user-controllable LEDs labeled D2 an D3 in the * schematic and on but referred to has LED1 and LED2 here, respectively. * diff --git a/boards/arm/lpc43xx/lpc4330-xplorer/src/lpc43_boot.c b/boards/arm/lpc43xx/lpc4330-xplorer/src/lpc43_boot.c index b56f25e3f84..cb2934c3de7 100644 --- a/boards/arm/lpc43xx/lpc4330-xplorer/src/lpc43_boot.c +++ b/boards/arm/lpc43xx/lpc4330-xplorer/src/lpc43_boot.c @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/lpc4330-xplorer/src/lpc43_boot.c +/**************************************************************************** + * boards/arm/lpc43xx/lpc4330-xplorer/src/lpc43_boot.c * * Copyright (C) 2012, 2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -31,11 +31,11 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Included Files - ************************************************************************************/ + ****************************************************************************/ #include @@ -49,27 +49,28 @@ #include "lpc4330-xplorer.h" -/************************************************************************************ +/**************************************************************************** * Pre-processor Definitions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Private Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Public Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Name: lpc43_boardinitialize * * Description: - * All LPC43xx architectures must provide the following entry point. This entry point - * is called early in the intitialization -- after all memory has been configured - * and mapped but before any devices have been initialized. + * All LPC43xx architectures must provide the following entry point. + * This entry point is called early in the intitialization -- after all + * memory has been configured and mapped but before any devices have been + * initialized. * - ************************************************************************************/ + ****************************************************************************/ void lpc43_boardinitialize(void) { diff --git a/boards/arm/lpc43xx/lpc4330-xplorer/src/lpc43_buttons.c b/boards/arm/lpc43xx/lpc4330-xplorer/src/lpc43_buttons.c index cdb6b12c557..e59e2a8dd27 100644 --- a/boards/arm/lpc43xx/lpc4330-xplorer/src/lpc43_buttons.c +++ b/boards/arm/lpc43xx/lpc4330-xplorer/src/lpc43_buttons.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/lpc4330-xplorer/src/lpc43_buttons.c + * boards/arm/lpc43xx/lpc4330-xplorer/src/lpc43_buttons.c * * Copyright (C) 2012, 2015, 2017 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -59,6 +59,7 @@ /**************************************************************************** * Private Data ****************************************************************************/ + /* Pin configuration for each LPC4330 Xplorer button. This array is indexed * by the BUTTON_* definitions in board.h */ @@ -91,10 +92,10 @@ static uint8_t g_buttonirq[NUM_BUTTONS] = * Name: board_button_initialize * * Description: - * board_button_initialize() must be called to initialize button resources. After - * that, board_buttons() may be called to collect the current state of all - * buttons or board_button_irq() may be called to register button interrupt - * handlers. + * board_button_initialize() must be called to initialize button resources. + * After that, board_buttons() may be called to collect the current state + * of all buttons or board_button_irq() may be called to register button + * interrupt handlers. * ****************************************************************************/ @@ -114,9 +115,9 @@ void board_button_initialize(void) * Name: board_buttons * * Description: - * board_button_initialize() must be called to initialize button resources. After - * that, board_buttons() may be called to collect the current state of all - * buttons. + * board_button_initialize() must be called to initialize button resources. + * After that, board_buttons() may be called to collect the current state + * of all buttons. * * board_buttons() may be called at any time to harvest the state of every * button. The state of the buttons is returned as a bitset with one @@ -135,16 +136,16 @@ uint32_t board_buttons(void) for (i = 0; i < NUM_BUTTONS; i++) { - /* A LOW value means that the key is pressed. */ + /* A LOW value means that the key is pressed. */ - bool released = lpc43_gpio_read(g_buttoncfg[i]); + bool released = lpc43_gpio_read(g_buttoncfg[i]); - /* Accumulate the set of depressed (not released) keys */ + /* Accumulate the set of depressed (not released) keys */ - if (!released) - { + if (!released) + { ret |= (1 << i); - } + } } return ret; @@ -154,19 +155,22 @@ uint32_t board_buttons(void) * Button support. * * Description: - * board_button_initialize() must be called to initialize button resources. After - * that, board_button_irq() may be called to register button interrupt handlers. + * board_button_initialize() must be called to initialize button resources. + * After that, board_button_irq() may be called to register button interrupt + * handlers. * - * board_button_irq() may be called to register an interrupt handler that will - * be called when a button is depressed or released. The ID value is a - * button enumeration value that uniquely identifies a button resource. See the - * BOARD_BUTTON_* and BOARD_JOYSTICK_* definitions in board.h for the meaning - * of enumeration values. + * board_button_irq() may be called to register an interrupt handler that + * will be called when a button is depressed or released. + * The ID value is a button enumeration value that uniquely identifies a + * button resource. + * See the BOARD_BUTTON_* and BOARD_JOYSTICK_* definitions in board.h for + * the meaning of enumeration values. * - * Note that board_button_irq() also enables button interrupts. Button - * interrupts will remain enabled after the interrupt handler is attached. - * Interrupts may be disabled (and detached) by calling board_button_irq with - * irqhandler equal to NULL. + * Note that board_button_irq() also enables button interrupts. + * Button interrupts will remain enabled after the interrupt handler is + * attached. + * Interrupts may be disabled (and detached) by calling board_button_irq + * with irqhandler equal to NULL. * ****************************************************************************/ @@ -210,5 +214,4 @@ int board_button_irq(int id, xcpt_t irqhandler, FAR void *arg) return OK; } #endif - #endif /* CONFIG_ARCH_BUTTONS */ diff --git a/boards/arm/lpc43xx/lpc4330-xplorer/src/lpc43_ostest.c b/boards/arm/lpc43xx/lpc4330-xplorer/src/lpc43_ostest.c index 9feb47cefb0..2641cdd8c37 100644 --- a/boards/arm/lpc43xx/lpc4330-xplorer/src/lpc43_ostest.c +++ b/boards/arm/lpc43xx/lpc4330-xplorer/src/lpc43_ostest.c @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/lpc4330-xplorer/src/lpc43_ostest.c +/**************************************************************************** + * boards/arm/lpc43xx/lpc4330-xplorer/src/lpc43_ostest.c * * Copyright (C) 2012 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -31,11 +31,11 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Included Files - ************************************************************************************/ + ****************************************************************************/ #include @@ -51,10 +51,11 @@ #include "up_internal.h" #include "lpc4330-xplorer.h" -/************************************************************************************ +/**************************************************************************** * Pre-processor Definitions - ************************************************************************************/ -/* Configuration ********************************************************************/ + ****************************************************************************/ + +/* Configuration ************************************************************/ #undef HAVE_FPU #if defined(CONFIG_ARCH_FPU) && defined(CONFIG_TESTING_OSTEST_FPUSIZE) && \ @@ -68,21 +69,22 @@ # error "CONFIG_TESTING_OSTEST_FPUSIZE has the wrong size" #endif -/************************************************************************************ +/**************************************************************************** * Private Data - ************************************************************************************/ + ****************************************************************************/ static uint32_t g_saveregs[XCPTCONTEXT_REGS]; -/************************************************************************************ +/**************************************************************************** * Private Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Public Functions - ************************************************************************************/ -/* Given an array of size CONFIG_TESTING_OSTEST_FPUSIZE, this function will return - * the current FPU registers. + ****************************************************************************/ + +/* Given an array of size CONFIG_TESTING_OSTEST_FPUSIZE, this function will + * return the current FPU registers. */ void arch_getfpu(FAR uint32_t *fpusave) diff --git a/boards/arm/lpc43xx/lpc4330-xplorer/src/lpc43_userleds.c b/boards/arm/lpc43xx/lpc4330-xplorer/src/lpc43_userleds.c index 7bb80d55a17..3496fe1063d 100644 --- a/boards/arm/lpc43xx/lpc4330-xplorer/src/lpc43_userleds.c +++ b/boards/arm/lpc43xx/lpc4330-xplorer/src/lpc43_userleds.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/lpc4330-xplorer/src/lpc43_userleds.c + * boards/arm/lpc43xx/lpc4330-xplorer/src/lpc43_userleds.c * * Copyright (C) 2012-2013, 2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -56,7 +56,9 @@ /**************************************************************************** * Pre-processor Definitions ****************************************************************************/ + /* LED definitions **********************************************************/ + /* The LPC4330-Xplorer has 2 user-controllable LEDs labeled D2 an D3 in the * schematic and on but referred to has LED1 and LED2 here, respectively. * diff --git a/boards/arm/lpc43xx/lpc4337-ws/README.txt b/boards/arm/lpc43xx/lpc4337-ws/README.txt index fa6e4bd1a15..ea33a74fdb3 100644 --- a/boards/arm/lpc43xx/lpc4337-ws/README.txt +++ b/boards/arm/lpc43xx/lpc4337-ws/README.txt @@ -265,7 +265,7 @@ Code Red IDE/Tools The LPC18xx/LPC43xx debug driver can also be used to program the LPC43xx flash directly from the command line. The script flash.sh that may be - found in the boards/LPC4337-ws/scripts directory can do that with + found in the boards/arm/lpc43xx/lpc4337-ws/scripts directory can do that with a single command line command. Executing from SPIFI diff --git a/boards/arm/lpc43xx/lpc4337-ws/include/board.h b/boards/arm/lpc43xx/lpc4337-ws/include/board.h index 68035c3b6b8..847307985cf 100644 --- a/boards/arm/lpc43xx/lpc4337-ws/include/board.h +++ b/boards/arm/lpc43xx/lpc4337-ws/include/board.h @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/lpc4337-ws/include/board.h + * boards/arm/lpc43xx/lpc4337-ws/include/board.h * * Copyright (C) 2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -33,8 +33,8 @@ * ****************************************************************************/ -#ifndef __BOARDS_ARM_LPC4337_WS_INCLUDE_BOARD_H -#define __BOARDS_ARM_LPC4337_WS_INCLUDE_BOARD_H +#ifndef __BOARDS_ARM_LPC43XX_LPC4337_WS_INCLUDE_BOARD_H +#define __BOARDS_ARM_LPC43XX_LPC4337_WS_INCLUDE_BOARD_H /**************************************************************************** * Included Files @@ -52,6 +52,7 @@ ****************************************************************************/ /* Clocking ****************************************************************/ + /* NOTE: The following definitions require lpc43_cgu.h. It is not included * here because the including C file may not have that file in its include * path. @@ -150,7 +151,6 @@ # define BOARD_ABP1_FREQUENCY BOARD_XTAL_FREQUENCY #endif - #if defined(CONFIG_LPC43_BUS) || defined(CONFIG_LPC43_I2C1) || \ defined(CONFIG_LPC43_DAC) || defined(CONFIG_LPC43_ADC0) || \ defined(CONFIG_LPC43_ADC1) || defined(CONFIG_LPC43_CAN0) @@ -163,6 +163,7 @@ #define BOARD_IDIVA_FREQUENCY (BOARD_FCLKOUT_FREQUENCY/BOARD_IDIVA_DIVIDER) /* USB0 ********************************************************************/ + /* Settings needed in lpc43_cpu.c */ #define BOARD_USB0_CLKSRC PLL0USB_CLKSEL_XTAL @@ -170,6 +171,7 @@ #define BOARD_USB0_NP_DIV 0x00302062 /* Table 149 datsheet, valid for 12Mhz Fclkin */ /* SPIFI clocking **********************************************************/ + /* The SPIFI will receive clocking from a divider per the settings provided * in this file. The NuttX code will configure PLL1 as the input clock * for the selected divider @@ -222,6 +224,7 @@ #endif /* UART clocking ***********************************************************/ + /* Configure all U[S]ARTs to use the XTAL input frequency */ #define BOARD_USART0_CLKSRC BASE_USART0_CLKSEL_XTAL @@ -236,10 +239,10 @@ #define BOARD_USART3_CLKSRC BASE_USART3_CLKSEL_XTAL #define BOARD_USART3_BASEFREQ BOARD_XTAL_FREQUENCY -/* SSP clocking *********************************************************** +/* SSP clocking ************************************************************* * - * BOARD_SSPX_BASEFREQ may be further divided by 2-254 to get the SSP clock. If we - * want a usable range of 400KHz to 25MHz for the SSP, then: + * BOARD_SSPX_BASEFREQ may be further divided by 2-254 to get the SSP clock. + * If we want a usable range of 400KHz to 25MHz for the SSP, then: * * 1. SSPCLK must be greater than (2*25MHz) = 50MHz, and * 2. SSPCLK must be less than (254*400Khz) = 101.6MHz. @@ -253,6 +256,7 @@ #define BOARD_SSP1_BASEFREQ BOARD_IDIVA_FREQUENCY /* LED definitions *********************************************************/ + /* LED1 K2 GPIO0[8] * * LED index values for use with board_userled() @@ -286,6 +290,7 @@ #define LED_PANIC 3 /* Flashing */ /* UART Pins ****************************************************************/ + /* The following definitions must be provided so that the LPC43 serial * driver can set up the U[S]ART for the serial console properly (see the * file arch/arc/src/lpc43xx/lpc43*_pinconf.h for more info). @@ -317,4 +322,4 @@ #define PINCONF_SSP1_MOSI PINCONF_SSP1_MOSI_1 #define PINCONF_SSP1_SCK PINCONF_SSP1_SCK_2 -#endif /* __BOARDS_ARM_LPC4337_WS_INCLUDE_BOARD_H */ +#endif /* __BOARDS_ARM_LPC43XX_LPC4337_WS_INCLUDE_BOARD_H */ diff --git a/boards/arm/lpc43xx/lpc4337-ws/scripts/Make.defs b/boards/arm/lpc43xx/lpc4337-ws/scripts/Make.defs index a90eefa95f1..b9d8f02de39 100644 --- a/boards/arm/lpc43xx/lpc4337-ws/scripts/Make.defs +++ b/boards/arm/lpc43xx/lpc4337-ws/scripts/Make.defs @@ -1,5 +1,5 @@ ############################################################################ -# boards/lpc4337-ws/scripts/Make.defs +# boards/arm/lpc43xx/lpc4337-ws/scripts/Make.defs # # Copyright (C) 2016, 2017 Gregory Nutt. All rights reserved. # Author: Gregory Nutt diff --git a/boards/arm/lpc43xx/lpc4337-ws/scripts/flashaconfig.ld b/boards/arm/lpc43xx/lpc4337-ws/scripts/flashaconfig.ld index 1ebc32372ae..ae0149b9115 100644 --- a/boards/arm/lpc43xx/lpc4337-ws/scripts/flashaconfig.ld +++ b/boards/arm/lpc43xx/lpc4337-ws/scripts/flashaconfig.ld @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/lpc4337-ws/scripts/flashconfig.ld + * boards/arm/lpc43xx/lpc4337-ws/scripts/flashconfig.ld * * Copyright (C) 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt diff --git a/boards/arm/lpc43xx/lpc4337-ws/scripts/ramconfig.ld b/boards/arm/lpc43xx/lpc4337-ws/scripts/ramconfig.ld index 1b714cf0521..d20b70ca47a 100644 --- a/boards/arm/lpc43xx/lpc4337-ws/scripts/ramconfig.ld +++ b/boards/arm/lpc43xx/lpc4337-ws/scripts/ramconfig.ld @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/lpc4337-ws/scripts/ramconfig.ld + * boards/arm/lpc43xx/lpc4337-ws/scripts/ramconfig.ld * * Copyright (C) 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt diff --git a/boards/arm/lpc43xx/lpc4337-ws/src/Makefile b/boards/arm/lpc43xx/lpc4337-ws/src/Makefile index 77a33d7061a..579418663cd 100644 --- a/boards/arm/lpc43xx/lpc4337-ws/src/Makefile +++ b/boards/arm/lpc43xx/lpc4337-ws/src/Makefile @@ -1,5 +1,5 @@ ############################################################################ -# boards/lpc4337-ws/src/Makefile +# boards/arm/lpc43xx/lpc4337-ws/src/Makefile # # Copyright (C) 2016 Gregory Nutt. All rights reserved. # Author: Gregory Nutt diff --git a/boards/arm/lpc43xx/lpc4337-ws/src/lpc4337-ws.h b/boards/arm/lpc43xx/lpc4337-ws/src/lpc4337-ws.h index 5d582c8711b..22ab39737fd 100644 --- a/boards/arm/lpc43xx/lpc4337-ws/src/lpc4337-ws.h +++ b/boards/arm/lpc43xx/lpc4337-ws/src/lpc4337-ws.h @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/lpc4337-ws/src/lpc4337-ws.h + * boards/arm/lpc43xx/lpc4337-ws/src/lpc4337-ws.h * * Copyright (C) 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -33,8 +33,8 @@ * ****************************************************************************/ -#ifndef _CONFIGS_LPC4337_WS_SRC_LPC4337_WS_H -#define _CONFIGS_LPC4337_WS_SRC_LPC4337_WS_H +#ifndef __BOARDS_ARM_LPC43XX_LPC4337_WS_SRC_LPC4337_WS_H +#define __BOARDS_ARM_LPC43XX_LPC4337_WS_SRC_LPC4337_WS_H /**************************************************************************** * Included Files @@ -67,17 +67,17 @@ * Public Functions ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Name: lpc43_adc_setup * * Description: * Initialize ADC and register the ADC driver. * - ************************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_LPC43_ADC0 int lpc43_adc_setup(void); #endif #endif /* __ASSEMBLY__ */ -#endif +#endif /* __BOARDS_ARM_LPC43XX_LPC4337_WS_SRC_LPC4337_WS_H */ diff --git a/boards/arm/lpc43xx/lpc4337-ws/src/lpc43_adc.c b/boards/arm/lpc43xx/lpc4337-ws/src/lpc43_adc.c index 517118d46c3..47e94b1f045 100644 --- a/boards/arm/lpc43xx/lpc4337-ws/src/lpc43_adc.c +++ b/boards/arm/lpc43xx/lpc4337-ws/src/lpc43_adc.c @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/lpc4337-ws/src/lpc43_adc.c +/**************************************************************************** + * boards/arm/lpc43xx/lpc4337-ws/src/lpc43_adc.c * * Copyright (C) 2013 Zilogic Systems. All rights reserved. * Author: Kannan @@ -36,11 +36,11 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Included Files - ************************************************************************************/ + ****************************************************************************/ #include @@ -58,17 +58,17 @@ #if defined(CONFIG_LPC43_ADC0) || defined(CONFIG_LPC43_ADC1) -/************************************************************************************ +/**************************************************************************** * Public Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Name: lpc43_adc_setup * * Description: * Initialize ADC and register the ADC driver. * - ************************************************************************************/ + ****************************************************************************/ int lpc43_adc_setup(void) { diff --git a/boards/arm/lpc43xx/lpc4337-ws/src/lpc43_appinit.c b/boards/arm/lpc43xx/lpc4337-ws/src/lpc43_appinit.c index 4ecde1cb2f6..17a3366dee4 100644 --- a/boards/arm/lpc43xx/lpc4337-ws/src/lpc43_appinit.c +++ b/boards/arm/lpc43xx/lpc4337-ws/src/lpc43_appinit.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/lpc4337-ws/src/lpc43_appinit.c + * boards/arm/lpc43xx/lpc4337-ws/src/lpc43_appinit.c * * Copyright (C) 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt diff --git a/boards/arm/lpc43xx/lpc4337-ws/src/lpc43_boot.c b/boards/arm/lpc43xx/lpc4337-ws/src/lpc43_boot.c index 08f19c3417a..959f78d4885 100644 --- a/boards/arm/lpc43xx/lpc4337-ws/src/lpc43_boot.c +++ b/boards/arm/lpc43xx/lpc4337-ws/src/lpc43_boot.c @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/lpc4337-ws/src/lpc43_boot.c +/**************************************************************************** + * boards/arm/lpc43xx/lpc4337-ws/src/lpc43_boot.c * * Copyright (C) 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -31,11 +31,11 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Included Files - ************************************************************************************/ + ****************************************************************************/ #include @@ -49,19 +49,20 @@ #include "lpc4337-ws.h" -/************************************************************************************ +/**************************************************************************** * Public Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Name: lpc43_boardinitialize * * Description: - * All LPC43xx architectures must provide the following entry point. This entry point - * is called early in the intitialization -- after all memory has been configured - * and mapped but before any devices have been initialized. + * All LPC43xx architectures must provide the following entry point. + * This entry point is called early in the intitialization -- after all + * memory has been configured and mapped but before any devices have been + * initialized. * - ************************************************************************************/ + ****************************************************************************/ void lpc43_boardinitialize(void) { diff --git a/boards/arm/lpc43xx/lpc4357-evb/include/board.h b/boards/arm/lpc43xx/lpc4357-evb/include/board.h index e80f264d0db..dbd0e997049 100644 --- a/boards/arm/lpc43xx/lpc4357-evb/include/board.h +++ b/boards/arm/lpc43xx/lpc4357-evb/include/board.h @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/lpc4357-evb/include/board.h + * boards/arm/lpc43xx/lpc4357-evb/include/board.h * * Copyright (C) 2014 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -33,8 +33,8 @@ * ****************************************************************************/ -#ifndef _CONFIGS_LPC4357_EVB_INCLUDE_BOARD_H -#define _CONFIGS_LPC4357_EVB_INCLUDE_BOARD_H +#ifndef __BOARDS_ARM_LPC43XX_LPC4357_EVB_INCLUDE_BOARD_H +#define __BOARDS_ARM_LPC43XX_LPC4357_EVB_INCLUDE_BOARD_H /**************************************************************************** * Included Files @@ -52,6 +52,7 @@ ****************************************************************************/ /* Clocking ****************************************************************/ + /* NOTE: The following definitions require lpc43_cgu.h. It is not included * here because the including C file may not have that file in its include * path. @@ -143,14 +144,15 @@ /* This is the clock setup we configure for: * - * SYSCLK = BOARD_OSCCLK_FREQUENCY = 12MHz -> Select Main oscillator for source - * PLL0CLK = (2 * 20 * SYSCLK) / 1 = 480MHz -> PLL0 multipler=20, pre-divider=1 - * CCLCK = 480MHz / 6 = 80MHz -> CCLK divider = 6 + * SYSCLK = BOARD_OSCCLK_FREQUENCY = 12MHz -> Select Main oscillator for source + * PLL0CLK = (2 * 20 * SYSCLK) / 1 = 480MHz -> PLL0 multipler=20, pre-divider=1 + * CCLCK = 480MHz / 6 = 80MHz -> CCLK divider = 6 */ #define LPC43_CCLK BOARD_FCLKOUT_FREQUENCY /* USB0 ********************************************************************/ + /* Settings needed in lpc43_cpu.c */ #define BOARD_USB0_CLKSRC PLL0USB_CLKSEL_XTAL @@ -158,6 +160,7 @@ #define BOARD_USB0_NP_DIV 0x00302062 /* Table 149 datsheet, valid for 12Mhz Fclkin */ /* SPIFI clocking **********************************************************/ + /* The SPIFI will receive clocking from a divider per the settings provided * in this file. The NuttX code will configure PLL1 as the input clock * for the selected divider @@ -176,7 +179,6 @@ # define BOARD_SPIFI_DIVB 1 /* Use IDIVB */ #endif - /* We need to configure the divider so that its output is as close to the * desired SCLK value. The peak data transfer rate will be about half of * this frequency in bytes per second. @@ -190,6 +192,7 @@ #endif /* UART clocking ***********************************************************/ + /* Configure all U[S]ARTs to use the XTAL input frequency */ #define BOARD_USART0_CLKSRC BASE_USART0_CLKSEL_XTAL @@ -205,6 +208,7 @@ #define BOARD_USART3_BASEFREQ BOARD_XTAL_FREQUENCY /* LED definitions *********************************************************/ + /* The LPC4357-EVB has one user-controllable LED labelled D6 controlled * by the signal LED_3V3: * @@ -249,10 +253,13 @@ */ /* Button definitions *******************************************************/ + /* To be provided */ /* UART Pins ****************************************************************/ + /* REVISIT: Thee are most likely left over from the LPC4330-Xplorer */ + /* The LPC4357-EVB does not have RS-232 drivers or serial connectors on * board. USART0 and UART1 are available on J8 as follows: * @@ -286,4 +293,4 @@ #define PINCONF_U3_RXD PINCONF_U3_RXD_4 #define PINCONF_U3_DIR PINCONF_U3_DIR_3 -#endif /* _CONFIGS_LPC4357_EVB_INCLUDE_BOARD_H */ +#endif /* __BOARDS_ARM_LPC43XX_LPC4357_EVB_INCLUDE_BOARD_H */ diff --git a/boards/arm/lpc43xx/lpc4357-evb/scripts/Make.defs b/boards/arm/lpc43xx/lpc4357-evb/scripts/Make.defs index 522ff7d587b..91c3793643a 100644 --- a/boards/arm/lpc43xx/lpc4357-evb/scripts/Make.defs +++ b/boards/arm/lpc43xx/lpc4357-evb/scripts/Make.defs @@ -1,5 +1,5 @@ ############################################################################ -# boards/lpc4357-evb/scripts/Make.defs +# boards/arm/lpc43xx/lpc4357-evb/scripts/Make.defs # # Copyright (C) 2014, 2017 Gregory Nutt. All rights reserved. # Author: Gregory Nutt diff --git a/boards/arm/lpc43xx/lpc4357-evb/scripts/flash.sh b/boards/arm/lpc43xx/lpc4357-evb/scripts/flash.sh index 2c6c38ab2a2..af7071c6fdc 100755 --- a/boards/arm/lpc43xx/lpc4357-evb/scripts/flash.sh +++ b/boards/arm/lpc43xx/lpc4357-evb/scripts/flash.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash #################################################################################### -# boards/lpc4357-evb/scripts/flash.sh +# boards/arm/lpc43xx/lpc4357-evb/scripts/flash.sh # # Copyright (C) 2014 Gregory Nutt. All rights reserved. # Author: Gregory Nutt diff --git a/boards/arm/lpc43xx/lpc4357-evb/scripts/flashaconfig.ld b/boards/arm/lpc43xx/lpc4357-evb/scripts/flashaconfig.ld index 2a28599ff17..eb44ccad6c7 100644 --- a/boards/arm/lpc43xx/lpc4357-evb/scripts/flashaconfig.ld +++ b/boards/arm/lpc43xx/lpc4357-evb/scripts/flashaconfig.ld @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/lpc4357-evb/scripts/flashconfig.ld + * boards/arm/lpc43xx/lpc4357-evb/scripts/flashconfig.ld * * Copyright (C) 2014 Gregory Nutt. All rights reserved. * Author: Gregory Nutt diff --git a/boards/arm/lpc43xx/lpc4357-evb/scripts/ramconfig.ld b/boards/arm/lpc43xx/lpc4357-evb/scripts/ramconfig.ld index 96dff999fc7..0f57a7d2e0d 100644 --- a/boards/arm/lpc43xx/lpc4357-evb/scripts/ramconfig.ld +++ b/boards/arm/lpc43xx/lpc4357-evb/scripts/ramconfig.ld @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/lpc4357-evb/scripts/ramconfig.ld + * boards/arm/lpc43xx/lpc4357-evb/scripts/ramconfig.ld * * Copyright (C) 2014 Gregory Nutt. All rights reserved. * Author: Gregory Nutt diff --git a/boards/arm/lpc43xx/lpc4357-evb/scripts/spificonfig.ld b/boards/arm/lpc43xx/lpc4357-evb/scripts/spificonfig.ld index c0d82fee4ea..239dfe7d084 100644 --- a/boards/arm/lpc43xx/lpc4357-evb/scripts/spificonfig.ld +++ b/boards/arm/lpc43xx/lpc4357-evb/scripts/spificonfig.ld @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/lpc4357-evb/scripts/spificonfig.ld + * boards/arm/lpc43xx/lpc4357-evb/scripts/spificonfig.ld * * Copyright (C) 2014 Gregory Nutt. All rights reserved. * Author: Gregory Nutt diff --git a/boards/arm/lpc43xx/lpc4357-evb/src/Makefile b/boards/arm/lpc43xx/lpc4357-evb/src/Makefile index 4bcdb17cf25..63bd954754e 100644 --- a/boards/arm/lpc43xx/lpc4357-evb/src/Makefile +++ b/boards/arm/lpc43xx/lpc4357-evb/src/Makefile @@ -1,5 +1,5 @@ ############################################################################ -# boards/lpc4357-evb/src/Makefile +# boards/arm/lpc43xx/lpc4357-evb/src/Makefile # # Copyright (C) 2014 Gregory Nutt. All rights reserved. # Author: Gregory Nutt diff --git a/boards/arm/lpc43xx/lpc4357-evb/src/lpc4357-evb.h b/boards/arm/lpc43xx/lpc4357-evb/src/lpc4357-evb.h index 66f9e97578e..93c9b3a7520 100644 --- a/boards/arm/lpc43xx/lpc4357-evb/src/lpc4357-evb.h +++ b/boards/arm/lpc43xx/lpc4357-evb/src/lpc4357-evb.h @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/lpc4357-evb/src/lpc4357-evb.h + * boards/arm/lpc43xx/lpc4357-evb/src/lpc4357-evb.h * * Copyright (C) 2014 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -33,8 +33,8 @@ * ****************************************************************************/ -#ifndef _CONFIGS_LPC4357_EVB_SRC_LPC3257_EVB_H -#define _CONFIGS_LPC4357_EVB_SRC_LPC3257_EVB_H +#ifndef __BOARDS_ARM_LPC43XX_LPC4357_EVB_SRC_LPC3257_EVB_H +#define __BOARDS_ARM_LPC43XX_LPC4357_EVB_SRC_LPC3257_EVB_H /**************************************************************************** * Included Files @@ -49,7 +49,9 @@ /**************************************************************************** * Pre-processor Definitions ****************************************************************************/ + /* LED definitions **********************************************************/ + /* The LPC4357-EVB has one user-controllable LED labelled D6 controlled by * the signal LED_3V3: * @@ -75,6 +77,7 @@ #define GPIO_LED (GPIO_MODE_OUTPUT | GPIO_VALUE_ONE | GPIO_PORT7 | GPIO_PIN7) /* Button definitions *******************************************************/ + /* to be provided */ /**************************************************************************** @@ -92,4 +95,4 @@ ****************************************************************************/ #endif /* __ASSEMBLY__ */ -#endif /* _CONFIGS_LPC4357_EVB_SRC_LPC3257_EVB_H */ +#endif /* __BOARDS_ARM_LPC43XX_LPC4357_EVB_SRC_LPC3257_EVB_H */ diff --git a/boards/arm/lpc43xx/lpc4357-evb/src/lpc43_appinit.c b/boards/arm/lpc43xx/lpc4357-evb/src/lpc43_appinit.c index 96e66b11812..66f5c485601 100644 --- a/boards/arm/lpc43xx/lpc4357-evb/src/lpc43_appinit.c +++ b/boards/arm/lpc43xx/lpc4357-evb/src/lpc43_appinit.c @@ -1,5 +1,5 @@ /**************************************************************************** - * config/lpc4357-evb/src/lpc43_appinit.c + * boards/arm/lpc43xx/lpc4357-evb/src/lpc43_appinit.c * * Copyright (C) 2014, 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -60,6 +60,7 @@ /**************************************************************************** * Pre-processor Definitions ****************************************************************************/ + /* Configuration ************************************************************/ #ifndef CONFIG_SPIFI_DEVNO diff --git a/boards/arm/lpc43xx/lpc4357-evb/src/lpc43_autoleds.c b/boards/arm/lpc43xx/lpc4357-evb/src/lpc43_autoleds.c index 34d33493645..76971d091c9 100644 --- a/boards/arm/lpc43xx/lpc4357-evb/src/lpc43_autoleds.c +++ b/boards/arm/lpc43xx/lpc4357-evb/src/lpc43_autoleds.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/lpc4357-evb/src/lpc43_autoleds.c + * boards/arm/lpc43xx/lpc4357-evb/src/lpc43_autoleds.c * * Copyright (C) 2014-2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -57,7 +57,9 @@ /**************************************************************************** * Pre-processor Definitions ****************************************************************************/ + /* LED definitions **********************************************************/ + /* The LPC4357-EVB has one user-controllable LED labelled D6 controlled by * the signal LED_3V3: * diff --git a/boards/arm/lpc43xx/lpc4357-evb/src/lpc43_boot.c b/boards/arm/lpc43xx/lpc4357-evb/src/lpc43_boot.c index c9cad01e2aa..120a5a06513 100644 --- a/boards/arm/lpc43xx/lpc4357-evb/src/lpc43_boot.c +++ b/boards/arm/lpc43xx/lpc4357-evb/src/lpc43_boot.c @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/lpc4357-evb/src/lpc43_boot.c +/**************************************************************************** + * boards/arm/lpc43xx/lpc4357-evb/src/lpc43_boot.c * * Copyright (C) 2014-2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -31,11 +31,11 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Included Files - ************************************************************************************/ + ****************************************************************************/ #include @@ -49,27 +49,28 @@ #include "lpc4357-evb.h" -/************************************************************************************ +/**************************************************************************** * Pre-processor Definitions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Private Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Public Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Name: lpc43_boardinitialize * * Description: - * All LPC43xx architectures must provide the following entry point. This entry point - * is called early in the intitialization -- after all memory has been configured - * and mapped but before any devices have been initialized. + * All LPC43xx architectures must provide the following entry point. + * This entry point is called early in the intitialization -- after all + * memory has been configured and mapped but before any devices have been + * initialized. * - ************************************************************************************/ + ****************************************************************************/ void lpc43_boardinitialize(void) { diff --git a/boards/arm/lpc43xx/lpc4357-evb/src/lpc43_buttons.c b/boards/arm/lpc43xx/lpc4357-evb/src/lpc43_buttons.c index b1cf50c8c61..c29d147a297 100644 --- a/boards/arm/lpc43xx/lpc4357-evb/src/lpc43_buttons.c +++ b/boards/arm/lpc43xx/lpc4357-evb/src/lpc43_buttons.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/lpc4357-evb/src/board_buttons.c + * boards/arm/lpc43xx/lpc4357-evb/src/board_buttons.c * * Copyright (C) 2014-2015, 2017 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -92,10 +92,10 @@ static uint8_t g_buttonirq[NUM_BUTTONS] = * Name: board_button_initialize * * Description: - * board_button_initialize() must be called to initialize button resources. After - * that, board_buttons() may be called to collect the current state of all - * buttons or board_button_irq() may be called to register button interrupt - * handlers. + * board_button_initialize() must be called to initialize button resources. + * After that, board_buttons() may be called to collect the current state + * of all buttons or board_button_irq() may be called to register button + * interrupt handlers. * ****************************************************************************/ @@ -117,9 +117,9 @@ void board_button_initialize(void) * Name: board_buttons * * Description: - * board_button_initialize() must be called to initialize button resources. After - * that, board_buttons() may be called to collect the current state of all - * buttons. + * board_button_initialize() must be called to initialize button resources. + * After that, board_buttons() may be called to collect the current state + * of all buttons. * * board_buttons() may be called at any time to harvest the state of every * button. The state of the buttons is returned as a bitset with one @@ -139,16 +139,16 @@ uint32_t board_buttons(void) for (i = 0; i < NUM_BUTTONS; i++) { - /* A LOW value means that the key is pressed. */ + /* A LOW value means that the key is pressed. */ - bool released = lpc43_gpio_read(g_buttoncfg[i]); + bool released = lpc43_gpio_read(g_buttoncfg[i]); - /* Accumulate the set of depressed (not released) keys */ + /* Accumulate the set of depressed (not released) keys */ - if (!released) - { + if (!released) + { ret |= (1 << i); - } + } } return ret; @@ -161,19 +161,22 @@ uint32_t board_buttons(void) * Button support. * * Description: - * board_button_initialize() must be called to initialize button resources. After - * that, board_button_irq() may be called to register button interrupt handlers. + * board_button_initialize() must be called to initialize button resources. + * After that, board_button_irq() may be called to register button interrupt + * handlers. * - * board_button_irq() may be called to register an interrupt handler that will - * be called when a button is depressed or released. The ID value is a - * button enumeration value that uniquely identifies a button resource. See the - * BOARD_BUTTON_* and BOARD_JOYSTICK_* definitions in board.h for the meaning - * of enumeration values. + * board_button_irq() may be called to register an interrupt handler that + * will be called when a button is depressed or released. + * The ID value is a button enumeration value that uniquely identifies a + * button resource. + * See the BOARD_BUTTON_* and BOARD_JOYSTICK_* definitions in board.h for + * the meaning of enumeration values. * - * Note that board_button_irq() also enables button interrupts. Button - * interrupts will remain enabled after the interrupt handler is attached. - * Interrupts may be disabled (and detached) by calling board_button_irq with - * irqhandler equal to NULL. + * Note that board_button_irq() also enables button interrupts. + * Button interrupts will remain enabled after the interrupt handler + * is attached. + * Interrupts may be disabled (and detached) by calling board_button_irq + * with irqhandler equal to NULL. * ****************************************************************************/ @@ -223,5 +226,4 @@ int board_button_irq(int id, xcpt_t irqhandler, FAR void *arg) #endif /* Not yet implemented */ } #endif - #endif /* CONFIG_ARCH_BUTTONS */ diff --git a/boards/arm/lpc43xx/lpc4357-evb/src/lpc43_ostest.c b/boards/arm/lpc43xx/lpc4357-evb/src/lpc43_ostest.c index 37d649c8256..07736e16779 100644 --- a/boards/arm/lpc43xx/lpc4357-evb/src/lpc43_ostest.c +++ b/boards/arm/lpc43xx/lpc4357-evb/src/lpc43_ostest.c @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/lpc4357-evb/src/lpc43_ostest.c +/**************************************************************************** + * boards/arm/lpc43xx/lpc4357-evb/src/lpc43_ostest.c * * Copyright (C) 2014 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -31,11 +31,11 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Included Files - ************************************************************************************/ + ****************************************************************************/ #include @@ -51,10 +51,11 @@ #include "up_internal.h" #include "lpc4357-evb.h" -/************************************************************************************ +/**************************************************************************** * Pre-processor Definitions - ************************************************************************************/ -/* Configuration ********************************************************************/ + ****************************************************************************/ + +/* Configuration ************************************************************/ #undef HAVE_FPU #if defined(CONFIG_ARCH_FPU) && defined(CONFIG_TESTING_OSTEST_FPUSIZE) && \ @@ -68,21 +69,22 @@ # error "CONFIG_TESTING_OSTEST_FPUSIZE has the wrong size" #endif -/************************************************************************************ +/**************************************************************************** * Private Data - ************************************************************************************/ + ****************************************************************************/ static uint32_t g_saveregs[XCPTCONTEXT_REGS]; -/************************************************************************************ +/**************************************************************************** * Private Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Public Functions - ************************************************************************************/ -/* Given an array of size CONFIG_TESTING_OSTEST_FPUSIZE, this function will return - * the current FPU registers. + ****************************************************************************/ + +/* Given an array of size CONFIG_TESTING_OSTEST_FPUSIZE, this function + * will return the current FPU registers. */ void arch_getfpu(FAR uint32_t *fpusave) diff --git a/boards/arm/lpc43xx/lpc4357-evb/src/lpc43_userleds.c b/boards/arm/lpc43xx/lpc4357-evb/src/lpc43_userleds.c index 49692071d6d..1bedf688cb9 100644 --- a/boards/arm/lpc43xx/lpc4357-evb/src/lpc43_userleds.c +++ b/boards/arm/lpc43xx/lpc4357-evb/src/lpc43_userleds.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/lpc4357-evb/src/lpc43_userleds.c + * boards/arm/lpc43xx/lpc4357-evb/src/lpc43_userleds.c * * Copyright (C) 2014, 2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -56,7 +56,9 @@ /**************************************************************************** * Pre-processor Definitions ****************************************************************************/ + /* LED definitions **********************************************************/ + /* The LPC4357-EVB has one user-controllable LED labelled D6 controlled by * the signal LED_3V3: * diff --git a/boards/arm/lpc43xx/lpc4370-link2/README.txt b/boards/arm/lpc43xx/lpc4370-link2/README.txt index 35a837c4ef8..c805a230ea5 100644 --- a/boards/arm/lpc43xx/lpc4370-link2/README.txt +++ b/boards/arm/lpc43xx/lpc4370-link2/README.txt @@ -265,8 +265,8 @@ Code Red IDE/Tools The LPC18xx/LPC43xx debug driver can also be used to program the LPC43xx flash directly from the command line. The script flash.sh that may be - found in the boards/LPC4370-Link2/scripts directory can do that with - a single command line command. + found in the boards/arm/lpc43xx/lpc4370-Link2/scripts directory can do that + with a single command line command. Executing from SPIFI -------------------- diff --git a/boards/arm/lpc43xx/lpc4370-link2/include/board.h b/boards/arm/lpc43xx/lpc4370-link2/include/board.h index 3b5515af1b6..2ea3405f9eb 100644 --- a/boards/arm/lpc43xx/lpc4370-link2/include/board.h +++ b/boards/arm/lpc43xx/lpc4370-link2/include/board.h @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/lpc4357-link2/include/board.h + * boards/arm/lpc43xx/lpc4357-link2/include/board.h * * Copyright (C) 2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -33,8 +33,8 @@ * ****************************************************************************/ -#ifndef __BOARDS_ARM_LPC4357_LINK2_INCLUDE_BOARD_H -#define __BOARDS_ARM_LPC4357_LINK2_INCLUDE_BOARD_H +#ifndef __BOARDS_ARM_LPC43XX_LPC4357_LINK2_INCLUDE_BOARD_H +#define __BOARDS_ARM_LPC43XX_LPC4357_LINK2_INCLUDE_BOARD_H /**************************************************************************** * Included Files @@ -52,6 +52,7 @@ ****************************************************************************/ /* Clocking ****************************************************************/ + /* NOTE: The following definitions require lpc43_cgu.h. It is not included * here because the including C file may not have that file in its include * path. @@ -138,7 +139,6 @@ # define BOARD_FCLKOUT_FREQUENCY (204000000) /* 17 * 12,000,000 / 1 */ # define BOARD_FCCO_FREQUENCY (204000000) /* Fclockout */ - #endif #define LPC43_CCLK BOARD_FCLKOUT_FREQUENCY @@ -148,20 +148,17 @@ # define BOARD_ABP1_FREQUENCY BOARD_XTAL_FREQUENCY #endif - #if defined(CONFIG_LPC43_BUS) || defined(CONFIG_LPC43_I2C1) || defined(CONFIG_LPC43_DAC) || defined(CONFIG_LPC43_ADC0) || defined(CONFIG_LPC43_ADC1) || defined(CONFIG_LPC43_CAN0) # define BOARD_ABP3_CLKSRC BASE_APB_CLKSEL_XTAL # define BOARD_ABP3_FREQUENCY BOARD_XTAL_FREQUENCY #endif - - #define BOARD_IDIVA_DIVIDER (2) #define BOARD_IDIVA_CLKSRC IDIVA_CLKSEL_PLL1 #define BOARD_IDIVA_FREQUENCY (BOARD_FCLKOUT_FREQUENCY/BOARD_IDIVA_DIVIDER) - /* USB0 ********************************************************************/ + /* Settings needed in lpc43_cpu.c */ #define BOARD_USB0_CLKSRC PLL0USB_CLKSEL_XTAL @@ -169,6 +166,7 @@ #define BOARD_USB0_NP_DIV 0x00302062 /* Table 149 datsheet, valid for 12Mhz Fclkin */ /* SPIFI clocking **********************************************************/ + /* The SPIFI will receive clocking from a divider per the settings provided * in this file. The NuttX code will configure PLL1 as the input clock * for the selected divider @@ -187,7 +185,6 @@ # define BOARD_SPIFI_DIVB 1 /* Use IDIVB */ #endif - /* We need to configure the divider so that its output is as close to the * desired SCLK value. The peak data transfer rate will be about half of * this frequency in bytes per second. @@ -222,6 +219,7 @@ #endif /* UART clocking ***********************************************************/ + /* Configure all U[S]ARTs to use the XTAL input frequency */ #define BOARD_USART0_CLKSRC BASE_USART0_CLKSEL_XTAL @@ -236,11 +234,10 @@ #define BOARD_USART3_CLKSRC BASE_USART3_CLKSEL_XTAL #define BOARD_USART3_BASEFREQ BOARD_XTAL_FREQUENCY +/* SSP clocking *************************************************************/ -/* SSP clocking *********************************************************** - * - * BOARD_SSPX_BASEFREQ may be further divided by 2-254 to get the SSP clock. If we - * want a usable range of 400KHz to 25MHz for the SSP, then: +/* BOARD_SSPX_BASEFREQ may be further divided by 2-254 to get the SSP clock. + * If we want a usable range of 400KHz to 25MHz for the SSP, then: * * 1. SSPCLK must be greater than (2*25MHz) = 50MHz, and * 2. SSPCLK must be less than (254*400Khz) = 101.6MHz. @@ -254,6 +251,7 @@ #define BOARD_SSP1_BASEFREQ BOARD_IDIVA_FREQUENCY /* LED definitions *********************************************************/ + /* LED1 K2 GPIO0[8] * * LED index values for use with board_userled() @@ -287,8 +285,8 @@ #define LED_PANIC 3 /* Flashing */ /* UART Pins ****************************************************************/ -/* - * The following definitions must be provided so that the LPC43 serial + +/* The following definitions must be provided so that the LPC43 serial * driver can set up the U[S]ART for the serial console properly (see the * file arch/arc/src/lpc43xx/lpc43*_pinconf.h for more info). */ @@ -320,4 +318,4 @@ #define PINCONF_SSP1_SCK PINCONF_SSP1_SCK_1 #define PINCONF_SSP1_SSEL PINCONF_SSP1_SSEL_1 -#endif /* __BOARDS_ARM_LPC4357_LINK2_INCLUDE_BOARD_H */ +#endif /* __BOARDS_ARM_LPC43XX_LPC4357_LINK2_INCLUDE_BOARD_H */ diff --git a/boards/arm/lpc43xx/lpc4370-link2/scripts/Make.defs b/boards/arm/lpc43xx/lpc4370-link2/scripts/Make.defs index c2005d0dc72..dd2424fd5d8 100644 --- a/boards/arm/lpc43xx/lpc4370-link2/scripts/Make.defs +++ b/boards/arm/lpc43xx/lpc4370-link2/scripts/Make.defs @@ -1,5 +1,5 @@ ############################################################################ -# boards/lpc4370-link2/scripts/Make.defs +# boards/arm/lpc43xx/lpc4370-link2/scripts/Make.defs # # Copyright (C) 2014, 2017 Gregory Nutt. All rights reserved. # Author: Gregory Nutt diff --git a/boards/arm/lpc43xx/lpc4370-link2/scripts/flash.bat b/boards/arm/lpc43xx/lpc4370-link2/scripts/flash.bat index 7a269a21753..75b4c746620 100644 --- a/boards/arm/lpc43xx/lpc4370-link2/scripts/flash.bat +++ b/boards/arm/lpc43xx/lpc4370-link2/scripts/flash.bat @@ -6,4 +6,3 @@ TIMEOUT /T 5 %LPCScrypt%\lpcscrypt.exe erase SPIFI %LPCScrypt%\lpcscrypt.exe program ..\..\..\nuttx.bin SPIFI - \ No newline at end of file diff --git a/boards/arm/lpc43xx/lpc4370-link2/scripts/ramconfig.ld b/boards/arm/lpc43xx/lpc4370-link2/scripts/ramconfig.ld index f2def59b726..b785434bd9d 100644 --- a/boards/arm/lpc43xx/lpc4370-link2/scripts/ramconfig.ld +++ b/boards/arm/lpc43xx/lpc4370-link2/scripts/ramconfig.ld @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/lpc4370-link2/scripts/ramconfig.ld + * boards/arm/lpc43xx/lpc4370-link2/scripts/ramconfig.ld * * Copyright (C) 2012 Gregory Nutt. All rights reserved. * Author: Gregory Nutt diff --git a/boards/arm/lpc43xx/lpc4370-link2/scripts/spificonfig.ld b/boards/arm/lpc43xx/lpc4370-link2/scripts/spificonfig.ld index 9de91e08640..a3ef87c2161 100644 --- a/boards/arm/lpc43xx/lpc4370-link2/scripts/spificonfig.ld +++ b/boards/arm/lpc43xx/lpc4370-link2/scripts/spificonfig.ld @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/lpc4370-link2/scripts/spificonfig.ld + * boards/arm/lpc43xx/lpc4370-link2/scripts/spificonfig.ld * * Copyright (C) 2012 Gregory Nutt. All rights reserved. * Author: Gregory Nutt diff --git a/boards/arm/lpc43xx/lpc4370-link2/src/Makefile b/boards/arm/lpc43xx/lpc4370-link2/src/Makefile index 17ca863fe34..0deedb62995 100644 --- a/boards/arm/lpc43xx/lpc4370-link2/src/Makefile +++ b/boards/arm/lpc43xx/lpc4370-link2/src/Makefile @@ -1,5 +1,5 @@ ############################################################################ -# boards/lpc4370-link2/src/Makefile +# boards/arm/lpc43xx/lpc4370-link2/src/Makefile # # Copyright (C) 2015 Gregory Nutt. All rights reserved. # Author: Gregory Nutt diff --git a/boards/arm/lpc43xx/lpc4370-link2/src/lpc4370-link2.h b/boards/arm/lpc43xx/lpc4370-link2/src/lpc4370-link2.h index 0461dcfb4ce..25261d18452 100644 --- a/boards/arm/lpc43xx/lpc4370-link2/src/lpc4370-link2.h +++ b/boards/arm/lpc43xx/lpc4370-link2/src/lpc4370-link2.h @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/lpc4370-link2/src/lpc4370-link2.h + * boards/arm/lpc43xx/lpc4370-link2/src/lpc4370-link2.h * * Copyright (C) 2015, 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -33,8 +33,8 @@ * ****************************************************************************/ -#ifndef _CONFIGS_LPC4370_LINK2_SRC_LPC3257_LINK2_H -#define _CONFIGS_LPC4370_LINK2_SRC_LPC3257_LINK2_H +#ifndef __BOARDS_ARM_LPC43XX_LPC4370_LINK2_SRC_LPC3257_LINK2_H +#define __BOARDS_ARM_LPC43XX_LPC4370_LINK2_SRC_LPC3257_LINK2_H /**************************************************************************** * Included Files @@ -50,6 +50,7 @@ /**************************************************************************** * Pre-processor Definitions ****************************************************************************/ + /* Do we need to register I2C drivers on behalf of the I2C tool? */ #define HAVE_I2CTOOL 1 @@ -58,6 +59,7 @@ #endif /* LED definitions **********************************************************/ + /* The LPC4370-LINK2 has one user-controllable LED labelled D6 controlled by * the signal LED_3V3: * @@ -83,6 +85,7 @@ #define GPIO_LED (GPIO_MODE_OUTPUT | GPIO_VALUE_ONE | GPIO_PORT0 | GPIO_PIN8) /* Button definitions *******************************************************/ + /* to be provided */ /**************************************************************************** @@ -99,28 +102,27 @@ * Public Functions ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Name: board_spifi_initialize * * Description: * Initialize SPIFI. * - ************************************************************************************/ + ****************************************************************************/ void board_spifi_initialize(void); -/************************************************************************************ +/**************************************************************************** * Name: lpc43_adc_setup * * Description: * Initialize ADC and register the ADC driver. * - ************************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_ADC int lpc43_adc_setup(void); #endif #endif /* __ASSEMBLY__ */ -#endif /* _CONFIGS_LPC4370_LINK2_SRC_LPC3257_LINK2_H */ - +#endif /* __BOARDS_ARM_LPC43XX_LPC4370_LINK2_SRC_LPC3257_LINK2_H */ diff --git a/boards/arm/lpc43xx/lpc4370-link2/src/lpc43_adc.c b/boards/arm/lpc43xx/lpc4370-link2/src/lpc43_adc.c index 20181af2978..823a5cb4435 100644 --- a/boards/arm/lpc43xx/lpc4370-link2/src/lpc43_adc.c +++ b/boards/arm/lpc43xx/lpc4370-link2/src/lpc43_adc.c @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/lpc4370-link2/src/lpc43_adc.c +/**************************************************************************** + * boards/arm/lpc43xx/lpc4370-link2/src/lpc43_adc.c * * Copyright (C) 2013 Zilogic Systems. All rights reserved. * Author: Kannan @@ -36,11 +36,11 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Included Files - ************************************************************************************/ + ****************************************************************************/ #include @@ -58,17 +58,17 @@ #if defined(CONFIG_LPC43_ADC0) || defined(CONFIG_LPC43_ADC1) -/************************************************************************************ +/**************************************************************************** * Public Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Name: lpc43_adc_setup * * Description: * Initialize ADC and register the ADC driver. * - ************************************************************************************/ + ****************************************************************************/ int lpc43_adc_setup(void) { diff --git a/boards/arm/lpc43xx/lpc4370-link2/src/lpc43_appinit.c b/boards/arm/lpc43xx/lpc4370-link2/src/lpc43_appinit.c index 0d8f5817c0e..54393cc2efd 100644 --- a/boards/arm/lpc43xx/lpc4370-link2/src/lpc43_appinit.c +++ b/boards/arm/lpc43xx/lpc4370-link2/src/lpc43_appinit.c @@ -1,5 +1,5 @@ /**************************************************************************** - * config/lpc4370-link2/src/lpc43_appinit.c + * boards/arm/lpc43xx/lpc4370-link2/src/lpc43_appinit.c * * Copyright (C) 2015-2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt diff --git a/boards/arm/lpc43xx/lpc4370-link2/src/lpc43_autoleds.c b/boards/arm/lpc43xx/lpc4370-link2/src/lpc43_autoleds.c index 3bc8c8f12db..3f764952018 100644 --- a/boards/arm/lpc43xx/lpc4370-link2/src/lpc43_autoleds.c +++ b/boards/arm/lpc43xx/lpc4370-link2/src/lpc43_autoleds.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/lpc4370-link2/src/lpc43_autoleds.c + * boards/arm/lpc43xx/lpc4370-link2/src/lpc43_autoleds.c * * Copyright (C) 2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -146,4 +146,3 @@ void board_autoled_off(int led) } #endif /* CONFIG_ARCH_LEDS */ - diff --git a/boards/arm/lpc43xx/lpc4370-link2/src/lpc43_boot.c b/boards/arm/lpc43xx/lpc4370-link2/src/lpc43_boot.c index a117ff93b72..833a998cd32 100644 --- a/boards/arm/lpc43xx/lpc4370-link2/src/lpc43_boot.c +++ b/boards/arm/lpc43xx/lpc4370-link2/src/lpc43_boot.c @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/lpc4370-link2/src/lpc43_boot.c +/**************************************************************************** + * boards/arm/lpc43xx/lpc4370-link2/src/lpc43_boot.c * * Copyright (C) 2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -31,11 +31,11 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Included Files - ************************************************************************************/ + ****************************************************************************/ #include @@ -49,27 +49,28 @@ #include "lpc4370-link2.h" -/************************************************************************************ +/**************************************************************************** * Pre-processor Definitions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Private Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Public Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Name: lpc43_boardinitialize * * Description: - * All LPC43xx architectures must provide the following entry point. This entry point - * is called early in the intitialization -- after all memory has been configured - * and mapped but before any devices have been initialized. + * All LPC43xx architectures must provide the following entry point. + * This entry point is called early in the intitialization -- after all + * memory has been configured and mapped but before any devices have been + * initialized. * - ************************************************************************************/ + ****************************************************************************/ void lpc43_boardinitialize(void) { diff --git a/boards/arm/lpc43xx/lpc4370-link2/src/lpc43_ostest.c b/boards/arm/lpc43xx/lpc4370-link2/src/lpc43_ostest.c index 706c6e0f226..8d6ba8c29a9 100644 --- a/boards/arm/lpc43xx/lpc4370-link2/src/lpc43_ostest.c +++ b/boards/arm/lpc43xx/lpc4370-link2/src/lpc43_ostest.c @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/lpc4370-link2/src/lpc43_ostest.c +/**************************************************************************** + * boards/arm/lpc43xx/lpc4370-link2/src/lpc43_ostest.c * * Copyright (C) 2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -31,11 +31,11 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Included Files - ************************************************************************************/ + ****************************************************************************/ #include @@ -51,10 +51,11 @@ #include "up_internal.h" #include "lpc4370-link2.h" -/************************************************************************************ +/**************************************************************************** * Pre-processor Definitions - ************************************************************************************/ -/* Configuration ********************************************************************/ + ****************************************************************************/ + +/* Configuration ************************************************************/ #undef HAVE_FPU #if defined(CONFIG_ARCH_FPU) && defined(CONFIG_TESTING_OSTEST_FPUSIZE) && \ @@ -68,21 +69,22 @@ # error "CONFIG_TESTING_OSTEST_FPUSIZE has the wrong size" #endif -/************************************************************************************ +/**************************************************************************** * Private Data - ************************************************************************************/ + ****************************************************************************/ static uint32_t g_saveregs[XCPTCONTEXT_REGS]; -/************************************************************************************ +/**************************************************************************** * Private Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Public Functions - ************************************************************************************/ -/* Given an array of size CONFIG_TESTING_OSTEST_FPUSIZE, this function will return - * the current FPU registers. + ****************************************************************************/ + +/* Given an array of size CONFIG_TESTING_OSTEST_FPUSIZE, this function will + * return the current FPU registers. */ void arch_getfpu(FAR uint32_t *fpusave) @@ -110,4 +112,3 @@ bool arch_cmpfpu(FAR const uint32_t *fpusave1, FAR const uint32_t *fpusave2) } #endif /* HAVE_FPU */ - diff --git a/boards/arm/lpc43xx/lpc4370-link2/src/lpc43_spifilib_init.c b/boards/arm/lpc43xx/lpc4370-link2/src/lpc43_spifilib_init.c index 9cc39bacb56..0f68b353d75 100644 --- a/boards/arm/lpc43xx/lpc4370-link2/src/lpc43_spifilib_init.c +++ b/boards/arm/lpc43xx/lpc4370-link2/src/lpc43_spifilib_init.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/lpc4370-link2/src/lpc43_spifilib_init.c + * boards/arm/lpc43xx/lpc4370-link2/src/lpc43_spifilib_init.c * * Copyright (C) 2015-2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt diff --git a/boards/arm/lpc43xx/lpc4370-link2/src/lpc43_userleds.c b/boards/arm/lpc43xx/lpc4370-link2/src/lpc43_userleds.c index 3c05fe2178c..ceb01f079a6 100644 --- a/boards/arm/lpc43xx/lpc4370-link2/src/lpc43_userleds.c +++ b/boards/arm/lpc43xx/lpc4370-link2/src/lpc43_userleds.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/lpc4370-link2/src/lpc43_userleds.c + * boards/arm/lpc43xx/lpc4370-link2/src/lpc43_userleds.c * * Copyright (C) 2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -115,4 +115,3 @@ void board_userled_all(uint8_t ledset) } #endif /* !CONFIG_ARCH_LEDS */ - diff --git a/boards/arm/lpc54xx/lpcxpresso-lpc54628/include/board.h b/boards/arm/lpc54xx/lpcxpresso-lpc54628/include/board.h index cd010a727cb..f7dd9f823d8 100644 --- a/boards/arm/lpc54xx/lpcxpresso-lpc54628/include/board.h +++ b/boards/arm/lpc54xx/lpcxpresso-lpc54628/include/board.h @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/lpcxpresso-lpc54628/include/board.h + * boards/arm/lpc54xx/lpcxpresso-lpc54628/include/board.h * * Copyright (C) 2017-2018 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -33,8 +33,8 @@ * ****************************************************************************/ -#ifndef _CONFIGS_LPCXPRESSO_LPC54628_INCLUDE_BOARD_H -#define _CONFIGS_LPCXPRESSO_LPC54628_INCLUDE_BOARD_H +#ifndef __BOARDS_ARM_LPC54XX_LPCXPRESSO_LPC54628_INCLUDE_BOARD_H +#define __BOARDS_ARM_LPC54XX_LPCXPRESSO_LPC54628_INCLUDE_BOARD_H /**************************************************************************** * Included Files @@ -146,21 +146,23 @@ #define BOARD_FRGCLK_INPUT BOARD_MAIN_CLK /* FRG input frequency */ #define BOARD_FRGCLK 48000000 /* May not be exact */ -/* SysTick: The SysTick clock may be clocked internally either by the by the - * system clock (CLKSOURCE==1) or by the SysTick function clock (CLKSOURCE==0). +/* SysTick: + * The SysTick clock may be clocked internally either by the by the system + * clock (CLKSOURCE==1) or by the SysTick function clock (CLKSOURCE==0). * The SysTick Function clock is equal to: * * Fsystick = Fmainclk / SYSTICKCLKDIV * - * Tips for selecting BOARD_SYSTICKCLKDIV: The resulting SysTick reload value - * should be as large as possible, but must be less than 2^24: + * Tips for selecting BOARD_SYSTICKCLKDIV: + * The resulting SysTick reload value should be as large as possible, + * but must be less than 2^24: * * SYSTICKDIV > Fmainclk / CLK_TCK / 2^24 * - * The logic in lpc54_timerisr.c will always select the SysTick function clock - * as the source (CLKSOURCE==0). NOTE: When the system tick clock divider is - * selected as the clock source, the CPU clock must be at least 2.5 times - * faster than the divider output. + * The logic in lpc54_timerisr.c will always select the SysTick function + * clock as the source (CLKSOURCE==0). + * NOTE: When the system tick clock divider is selected as the clock source, + * the CPU clock must be at least 2.5 times faster than the divider output. * * SysTick Divider: (SYSTICKCLKDIV) */ @@ -193,7 +195,8 @@ #endif #define BOARD_EMC_FREQUENCY (BOARD_CPU_FREQUENCY / BOARD_EMC_CLKDIV) -/* SD/MMC or SDIO interface/ +/* SD/MMC or SDIO interface */ + /* SD/MMC function clock. The SDMMC source clock (Fsdmmc) is the main clock * which may be divided down by the SYSCON module (8-bit divider, functional * range, 1-256). The SD clock is obtained by dividing the source clock @@ -231,13 +234,13 @@ * BOARD_CLKDIV_SDXFR=6[5], Fsdmmc=18MHz (25MHz max) * * NOTE: Clock division is 2*n. For example, value of 0 means divide by - * 2 * 0 = 0 (no division, bypass), value of 1 means divide by 2 * 1 = 2, value - * of 255 means divide by 2 * 255 = 510, and so on. + * 2 * 0 = 0 (no division, bypass), value of 1 means divide by 2 * 1 = 2, + * value of 255 means divide by 2 * 255 = 510, and so on. * - * SD/MMC logic will write the value ((clkdiv + 1) >> 1) as the divisor. So an - * odd value calculated below will be moved up to next higher divider value. So - * the value 3 will cause 2 to be written as the divider value and the effective - * divider will be 4. + * SD/MMC logic will write the value ((clkdiv + 1) >> 1) as the divisor. + * So an odd value calculated below will be moved up to next higher divider + * value. So the value 3 will cause 2 to be written as the divider value + * and the effective divider will be 4. */ #define BOARD_CLKDIV_INIT BOARD_SDMMC_CEIL(BOARD_SDMMC_FREQUENCY, 400000) @@ -246,6 +249,7 @@ #define BOARD_CLKDIV_SDXFR BOARD_SDMMC_CEIL(BOARD_SDMMC_FREQUENCY, 25000000) /* LED definitions *********************************************************/ + /* The LPCXpress-LPC54628 has three user LEDs: D9, D11, and D12. These * LEDs are for application use. They are illuminated when the driving * signal from the LPC546xx is low. The LEDs are driven by ports P2-2 (D9), @@ -295,6 +299,7 @@ */ /* Button definitions *******************************************************/ + /* The LPCXpresso has four switches: * * SW2 ISP2 P0.6 @@ -319,6 +324,7 @@ #define BUTTON_USER_BIT (1 << BUTTON_USER) /* Pin Disambiguation *******************************************************/ + /* Flexcomm0/USART0 * * USART0 connects to the serial bridge on LPC4322JET100 and is typically used @@ -524,4 +530,4 @@ extern "C" #endif #endif /* __ASSEMBLY__ */ -#endif /* _CONFIGS_LPCXPRESSO_LPC54628_INCLUDE_BOARD_H */ +#endif /* __BOARDS_ARM_LPC54XX_LPCXPRESSO_LPC54628_INCLUDE_BOARD_H */ diff --git a/boards/arm/lpc54xx/lpcxpresso-lpc54628/scripts/Make.defs b/boards/arm/lpc54xx/lpcxpresso-lpc54628/scripts/Make.defs index 2dd03ea3ee6..e574417c4cf 100644 --- a/boards/arm/lpc54xx/lpcxpresso-lpc54628/scripts/Make.defs +++ b/boards/arm/lpc54xx/lpcxpresso-lpc54628/scripts/Make.defs @@ -1,5 +1,5 @@ ############################################################################ -# boards/lpcxpresso-lpc54628/scripts/Make.defs +# boards/arm/lpc54xx/lpcxpresso-lpc54628/scripts/Make.defs # # Copyright (C) 2017 Gregory Nutt. All rights reserved. # Author: Gregory Nutt diff --git a/boards/arm/lpc54xx/lpcxpresso-lpc54628/scripts/flash.ld b/boards/arm/lpc54xx/lpcxpresso-lpc54628/scripts/flash.ld index 5a71b338dc8..58d4234f1f2 100644 --- a/boards/arm/lpc54xx/lpcxpresso-lpc54628/scripts/flash.ld +++ b/boards/arm/lpc54xx/lpcxpresso-lpc54628/scripts/flash.ld @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/lpcxpresso-lpc54628/scripts/flash.ld + * boards/arm/lpc54xx/lpcxpresso-lpc54628/scripts/flash.ld * * Copyright (C) 2017 Gregory Nutt. All rights reserved. * Author: Gregory Nutt diff --git a/boards/arm/lpc54xx/lpcxpresso-lpc54628/src/Makefile b/boards/arm/lpc54xx/lpcxpresso-lpc54628/src/Makefile index 580b190801c..88d3258fb29 100644 --- a/boards/arm/lpc54xx/lpcxpresso-lpc54628/src/Makefile +++ b/boards/arm/lpc54xx/lpcxpresso-lpc54628/src/Makefile @@ -1,5 +1,5 @@ ############################################################################ -# boards/lpcxpresso-lpc54628/src/Makefile +# boards/arm/lpc54xx/lpcxpresso-lpc54628/src/Makefile # # Copyright (C) 2017 Gregory Nutt. All rights reserved. # Author: Gregory Nutt diff --git a/boards/arm/lpc54xx/lpcxpresso-lpc54628/src/lpc54_appinit.c b/boards/arm/lpc54xx/lpcxpresso-lpc54628/src/lpc54_appinit.c index d545d1af53a..5e308bcf39a 100644 --- a/boards/arm/lpc54xx/lpcxpresso-lpc54628/src/lpc54_appinit.c +++ b/boards/arm/lpc54xx/lpcxpresso-lpc54628/src/lpc54_appinit.c @@ -1,5 +1,5 @@ /**************************************************************************** - * config/lpcxpresso-lpc54628/src/lpc54_appinit.c + * boards/arm/lpc54xx/lpcxpresso-lpc54628/src/lpc54_appinit.c * * Copyright (C) 2017 Gregory Nutt. All rights reserved. * Author: Gregory Nutt diff --git a/boards/arm/lpc54xx/lpcxpresso-lpc54628/src/lpc54_autoleds.c b/boards/arm/lpc54xx/lpcxpresso-lpc54628/src/lpc54_autoleds.c index 66e05bccc17..3178c6d2226 100644 --- a/boards/arm/lpc54xx/lpcxpresso-lpc54628/src/lpc54_autoleds.c +++ b/boards/arm/lpc54xx/lpcxpresso-lpc54628/src/lpc54_autoleds.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/lpcxpresso-lpc54628/src/lpc54_autoleds.c + * boards/arm/lpc54xx/lpcxpresso-lpc54628/src/lpc54_autoleds.c * * Copyright (C) 2017 Gregory Nutt. All rights reserved. * Author: Gregory Nutt diff --git a/boards/arm/lpc54xx/lpcxpresso-lpc54628/src/lpc54_boot.c b/boards/arm/lpc54xx/lpcxpresso-lpc54628/src/lpc54_boot.c index 11045a92403..95b76f99608 100644 --- a/boards/arm/lpc54xx/lpcxpresso-lpc54628/src/lpc54_boot.c +++ b/boards/arm/lpc54xx/lpcxpresso-lpc54628/src/lpc54_boot.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/lpcxpresso-lpc54628/src/lpc54_boot.c + * boards/arm/lpc54xx/lpcxpresso-lpc54628/src/lpc54_boot.c * * Copyright (C) 2017 Gregory Nutt. All rights reserved. * Author: Gregory Nutt diff --git a/boards/arm/lpc54xx/lpcxpresso-lpc54628/src/lpc54_bringup.c b/boards/arm/lpc54xx/lpcxpresso-lpc54628/src/lpc54_bringup.c index 92ad73dd7d6..107a449f9bb 100644 --- a/boards/arm/lpc54xx/lpcxpresso-lpc54628/src/lpc54_bringup.c +++ b/boards/arm/lpc54xx/lpcxpresso-lpc54628/src/lpc54_bringup.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/lpcxpresso-lpc54628/src/lpc54_bringup.c + * boards/arm/lpc54xx/lpcxpresso-lpc54628/src/lpc54_bringup.c * * Copyright (C) 2017 Gregory Nutt. All rights reserved. * Author: Gregory Nutt diff --git a/boards/arm/lpc54xx/lpcxpresso-lpc54628/src/lpc54_buttons.c b/boards/arm/lpc54xx/lpcxpresso-lpc54628/src/lpc54_buttons.c index 91e62ab2018..5551dc35dc7 100644 --- a/boards/arm/lpc54xx/lpcxpresso-lpc54628/src/lpc54_buttons.c +++ b/boards/arm/lpc54xx/lpcxpresso-lpc54628/src/lpc54_buttons.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/lpcxpresso-lpc54628/src/lpc54_buttons.c + * boards/arm/lpc54xx/lpcxpresso-lpc54628/src/lpc54_buttons.c * * Copyright (C) 2017 Gregory Nutt. All rights reserved. * Author: Gregory Nutt diff --git a/boards/arm/lpc54xx/lpcxpresso-lpc54628/src/lpc54_ft5x06.c b/boards/arm/lpc54xx/lpcxpresso-lpc54628/src/lpc54_ft5x06.c index fee88be19be..85ade24ce28 100644 --- a/boards/arm/lpc54xx/lpcxpresso-lpc54628/src/lpc54_ft5x06.c +++ b/boards/arm/lpc54xx/lpcxpresso-lpc54628/src/lpc54_ft5x06.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/lpcxpresso-lpc54628/src/lpc54_ft5x06.c + * boards/arm/lpc54xx/lpcxpresso-lpc54628/src/lpc54_ft5x06.c * * Copyright (C) 2017 Gregory Nutt. All rights reserved. * Author: Gregory Nutt diff --git a/boards/arm/lpc54xx/lpcxpresso-lpc54628/src/lpc54_i2c.c b/boards/arm/lpc54xx/lpcxpresso-lpc54628/src/lpc54_i2c.c index 65abc2b3615..a3015179603 100644 --- a/boards/arm/lpc54xx/lpcxpresso-lpc54628/src/lpc54_i2c.c +++ b/boards/arm/lpc54xx/lpcxpresso-lpc54628/src/lpc54_i2c.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/lpcxpresso-lpc54628/src/lpc54_i2c.c + * boards/arm/lpc54xx/lpcxpresso-lpc54628/src/lpc54_i2c.c * * Copyright (C) 2017 Gregory Nutt. All rights reserved. * Author: Gregory Nutt diff --git a/boards/arm/lpc54xx/lpcxpresso-lpc54628/src/lpc54_i2ctool.c b/boards/arm/lpc54xx/lpcxpresso-lpc54628/src/lpc54_i2ctool.c index d2ea29cd960..3792192ae8e 100644 --- a/boards/arm/lpc54xx/lpcxpresso-lpc54628/src/lpc54_i2ctool.c +++ b/boards/arm/lpc54xx/lpcxpresso-lpc54628/src/lpc54_i2ctool.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/lpcxpresso-lpc54628/src/lpc54_i2ctool.c + * boards/arm/lpc54xx/lpcxpresso-lpc54628/src/lpc54_i2ctool.c * * Copyright (C) 2017 Gregory Nutt. All rights reserved. * Author: Gregory Nutt diff --git a/boards/arm/lpc54xx/lpcxpresso-lpc54628/src/lpc54_lcd.c b/boards/arm/lpc54xx/lpcxpresso-lpc54628/src/lpc54_lcd.c index 0beb6b8609e..97d06cc1a30 100644 --- a/boards/arm/lpc54xx/lpcxpresso-lpc54628/src/lpc54_lcd.c +++ b/boards/arm/lpc54xx/lpcxpresso-lpc54628/src/lpc54_lcd.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/lpcxpresso_lpc54628/src/lpc54_lcd.c + * boards/arm/lpc54xx/lpcxpresso_lpc54628/src/lpc54_lcd.c * * Copyright (C) 2017 Gregory Nutt. All rights reserved. * Author: Gregory Nutt diff --git a/boards/arm/lpc54xx/lpcxpresso-lpc54628/src/lpc54_sdram.c b/boards/arm/lpc54xx/lpcxpresso-lpc54628/src/lpc54_sdram.c index 313e1361b2f..aac3c02e1f9 100644 --- a/boards/arm/lpc54xx/lpcxpresso-lpc54628/src/lpc54_sdram.c +++ b/boards/arm/lpc54xx/lpcxpresso-lpc54628/src/lpc54_sdram.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/lpcxpresso-lpc54628/src/lpc54_bringup.c + * boards/arm/lpc54xx/lpcxpresso-lpc54628/src/lpc54_bringup.c * * Copyright (C) 2017 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -124,7 +124,7 @@ static const struct emc_dynamic_chip_config_s g_emc_dynchipconfig = .rasnclk = 2, .mode = 0x23, .extmode = 0, /* SDRAM only */ - .addrmap = 0x09, /* 128Mbits (8M*16, 4banks, 12 rows, 9 columns)*/ + .addrmap = 0x09, /* 128Mbits (8M*16, 4banks, 12 rows, 9 columns) */ }; /**************************************************************************** diff --git a/boards/arm/lpc54xx/lpcxpresso-lpc54628/src/lpc54_userleds.c b/boards/arm/lpc54xx/lpcxpresso-lpc54628/src/lpc54_userleds.c index 7cceae489b4..67017ea4099 100644 --- a/boards/arm/lpc54xx/lpcxpresso-lpc54628/src/lpc54_userleds.c +++ b/boards/arm/lpc54xx/lpcxpresso-lpc54628/src/lpc54_userleds.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/lpcxpresso-lpc54628/src/lpc54_userleds.c + * boards/arm/lpc54xx/lpcxpresso-lpc54628/src/lpc54_userleds.c * * Copyright (C) 2017 Gregory Nutt. All rights reserved. * Author: Gregory Nutt diff --git a/boards/arm/lpc54xx/lpcxpresso-lpc54628/src/lpcxpresso-lpc54628.h b/boards/arm/lpc54xx/lpcxpresso-lpc54628/src/lpcxpresso-lpc54628.h index 18208e4db35..7e38d09e93c 100644 --- a/boards/arm/lpc54xx/lpcxpresso-lpc54628/src/lpcxpresso-lpc54628.h +++ b/boards/arm/lpc54xx/lpcxpresso-lpc54628/src/lpcxpresso-lpc54628.h @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/lpcxpresso-lpc54628/src/lpcxpresso-lpc54628.h + * boards/arm/lpc54xx/lpcxpresso-lpc54628/src/lpcxpresso-lpc54628.h * * Copyright (C) 2017 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -33,8 +33,8 @@ * ****************************************************************************/ -#ifndef _CONFIGS_LPCXPRESSO_LPC54628_SRC_LPCXPRESSO_LPC54628_H -#define _CONFIGS_LPCXPRESSO_LPC54628_SRC_LPCXPRESSO_LPC54628_H +#ifndef __BOARDS_ARM_LPC54XX_LPCXPRESSO_LPC54628_SRC_LPCXPRESSO_LPC54628_H +#define __BOARDS_ARM_LPC54XX_LPCXPRESSO_LPC54628_SRC_LPCXPRESSO_LPC54628_H /**************************************************************************** * Included Files @@ -219,6 +219,7 @@ I2C5CNT + I2C6CNT + I2C7CNT + I2C8CNT + I2C9CNT ) /* LED definitions **********************************************************/ + /* The LPCXpress-LPC54628 has three user LEDs: D9, D11, and D12. These * LEDs are for application use. They are illuminated when the driving * signal from the LPC546xx is low. The LEDs are driven by ports P2-2 (D9), @@ -238,6 +239,7 @@ GPIO_MODE_DIGITAL | GPIO_FILTER_OFF | GPIO_PUSHPULL | GPIO_PULLUP) /* Button definitions *******************************************************/ + /* The LPCXpresso has four switches: * * SW2 ISP2 P0.6 @@ -262,6 +264,7 @@ (GPIO_PORT1 | GPIO_PIN1 | GPIO_INTBOTH | GPIO_MODE_DIGITAL | GPIO_FILTER_ON) /* LCD/TSC definitions ******************************************************/ + /* The backlight is controlled by P3.31 and is intended to connect via PWM * to control the brightness level. For simplicity here, it configured as a * simple GPIO output. @@ -398,4 +401,4 @@ void lpc54_i2c_free(int ndx); #endif #endif /* __ASSEMBLY__ */ -#endif /* _CONFIGS_LPCXPRESSO_LPC54628_SRC_LPCXPRESSO_LPC54628_H */ +#endif /* __BOARDS_ARM_LPC54XX_LPCXPRESSO_LPC54628_SRC_LPCXPRESSO_LPC54628_H */