Merged in alinjerpelea/nuttx (pull request #992)

arm: codestyle fixes 3

* arm: lpc214x: codestyle fixes

    After the board restructuration is time for codestyle cleanup

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* arm: lpc2378: codestyle fixes

    After the board restructuration is time for codestyle cleanup

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* arm: lpc31xx: codestyle fixes

    After the board restructuration is time for codestyle cleanup

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* arm: lpc54xx: codestyle fixes

    After the board restructuration is time for codestyle cleanup

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* arm: lpc43xx: codestyle fixes

    After the board restructuration is time for codestyle cleanup

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

Approved-by: Gregory Nutt <gnutt@nuttx.org>
This commit is contained in:
Alin Jerpelea
2019-08-14 12:34:18 +00:00
committed by Gregory Nutt
parent 36d21a7a5b
commit de47c8f52f
181 changed files with 1586 additions and 1350 deletions
@@ -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. * Copyright (C) 2007-2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org> * Author: Gregory Nutt <gnutt@nuttx.org>
@@ -33,8 +33,8 @@
* *
****************************************************************************/ ****************************************************************************/
#ifndef __ARCH_BOARD_BOARD_H #ifndef __BOARDS_ARM_LPC214X_MCU123_LPC214X_INCLUDE_BOARD_H
#define __ARCH_BOARD_BOARD_H #define __BOARDS_ARM_LPC214X_MCU123_LPC214X_INCLUDE_BOARD_H
/**************************************************************************** /****************************************************************************
* Included Files * Included Files
@@ -76,4 +76,4 @@
* Inline Functions * Inline Functions
****************************************************************************/ ****************************************************************************/
#endif /* __ARCH_BOARD_BOARD_H */ #endif /* __BOARDS_ARM_LPC214X_MCU123_LPC214X_INCLUDE_BOARD_H */
@@ -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. # Copyright (C) 2008-2009, 2011, 2014, 2017 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <gnutt@nuttx.org> # Author: Gregory Nutt <gnutt@nuttx.org>
@@ -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. * Copyright (C) 2008-2009, 2012 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org> * Author: Gregory Nutt <gnutt@nuttx.org>
@@ -1,6 +1,6 @@
#!/usr/bin/env bash #!/usr/bin/env bash
############################################################################# #############################################################################
# boards/mcu123-lpc214x/lpc21isp.sh # boards/arm/lpc214x/mcu123-lpc214x/lpc21isp.sh
# #
# Copyright (C) 2008 Gregory Nutt. All rights reserved. # Copyright (C) 2008 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <gnutt@nuttx.org> # Author: Gregory Nutt <gnutt@nuttx.org>
@@ -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. # Copyright (C) 2007-2010, 2012, 2015 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <gnutt@nuttx.org> # Author: Gregory Nutt <gnutt@nuttx.org>
@@ -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. * Copyright (C) 2008-2009, 2016 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org> * Author: Gregory Nutt <gnutt@nuttx.org>
@@ -152,10 +152,12 @@ int board_app_initialize(uintptr_t arg)
syslog(LOG_INFO, "Binding SPI port %d to MMC/SD slot %d\n", syslog(LOG_INFO, "Binding SPI port %d to MMC/SD slot %d\n",
CONFIG_NSH_MMCSDSPIPORTNO, CONFIG_NSH_MMCSDSLOTNO); 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) 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); CONFIG_NSH_MMCSDSPIPORTNO, CONFIG_NSH_MMCSDSLOTNO, ret);
return ret; return ret;
} }
@@ -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. * Copyright (C) 2012, 2016 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org> * Author: Gregory Nutt <gnutt@nuttx.org>
@@ -212,6 +212,7 @@ static FAR void *board_composite0_connect(int port)
cdcacm_get_composite_devdesc(&dev[0]); cdcacm_get_composite_devdesc(&dev[0]);
/* Overwrite and correct some values... */ /* Overwrite and correct some values... */
/* The callback functions for the CDC/ACM class */ /* The callback functions for the CDC/ACM class */
dev[0].classobject = cdcacm_classobject; 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].devinfo.ifnobase = ifnobase; /* Offset to Interface-IDs */
dev[0].minor = 0; /* The minor interface number */ dev[0].minor = 0; /* The minor interface number */
/* Strings */ /* Strings */
dev[0].devinfo.strbase = strbase; /* Offset to String Numbers */ 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; strbase += dev[0].devinfo.nstrings;
/* Configure the mass storage device device */ /* Configure the mass storage device device */
/* Ask the usbmsc driver to fill in the constants we didn't /* Ask the usbmsc driver to fill in the constants we didn't
* know here. * know here.
*/ */
@@ -245,6 +247,7 @@ static FAR void *board_composite0_connect(int port)
usbmsc_get_composite_devdesc(&dev[1]); usbmsc_get_composite_devdesc(&dev[1]);
/* Overwrite and correct some values... */ /* Overwrite and correct some values... */
/* The callback functions for the USBMSC class */ /* The callback functions for the USBMSC class */
dev[1].classobject = board_mscclassobject; dev[1].classobject = board_mscclassobject;
@@ -304,6 +307,7 @@ static FAR void *board_composite1_connect(int port)
cdcacm_get_composite_devdesc(&dev[i]); cdcacm_get_composite_devdesc(&dev[i]);
/* Overwrite and correct some values... */ /* Overwrite and correct some values... */
/* The callback functions for the CDC/ACM class */ /* The callback functions for the CDC/ACM class */
dev[i].classobject = cdcacm_classobject; dev[i].classobject = cdcacm_classobject;
@@ -347,7 +351,8 @@ static FAR void *board_composite1_connect(int port)
int board_composite_initialize(int port) int board_composite_initialize(int port)
{ {
/* If system/composite is built as an NSH command, then SD slot should /* 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. * In this case, there is nothing further to be done here.
* *
* NOTE: CONFIG_NSH_BUILTIN_APPS is not a fool-proof indication that NSH * NOTE: CONFIG_NSH_BUILTIN_APPS is not a fool-proof indication that NSH
@@ -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. * Copyright (C) 2007-2009, 2015 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org> * Author: Gregory Nutt <gnutt@nuttx.org>
@@ -91,9 +91,9 @@ void board_autoled_initialize(void)
{ {
/* Initilize GIOs P1.16-P1.23 */ /* Initilize GIOs P1.16-P1.23 */
putled(ALLLEDS,LED_DIR_OFFSET); putled(ALLLEDS, LED_DIR_OFFSET);
putled(ALLLEDS,LED_SET_OFFSET); putled(ALLLEDS, LED_SET_OFFSET);
putled(LEDBIT(0),LED_CLR_OFFSET); putled(LEDBIT(0), LED_CLR_OFFSET);
} }
/**************************************************************************** /****************************************************************************
@@ -102,7 +102,7 @@ void board_autoled_initialize(void)
void board_autoled_on(int led) 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) void board_autoled_off(int led)
{ {
putled(LEDBIT(led),LED_SET_OFFSET); putled(LEDBIT(led), LED_SET_OFFSET);
} }
#endif /* CONFIG_ARCH_LEDS */ #endif /* CONFIG_ARCH_LEDS */
@@ -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 * Copyright (C) 2008-2010, 2012, 2016-2016 Gregory Nutt. All rights
* reserved. * reserved.
@@ -109,15 +109,19 @@
****************************************************************************/ ****************************************************************************/
static int spi_lock(FAR struct spi_dev_s *dev, bool lock); 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,
static uint32_t spi_setfrequency(FAR struct spi_dev_s *dev, uint32_t frequency); 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); static uint8_t spi_status(FAR struct spi_dev_s *dev, uint32_t devid);
#ifdef CONFIG_SPI_CMDDATA #ifdef CONFIG_SPI_CMDDATA
static int spi_cmddata(FAR struct spi_dev_s *dev, uint32_t devid, bool cmd); static int spi_cmddata(FAR struct spi_dev_s *dev, uint32_t devid, bool cmd);
#endif #endif
static uint16_t spi_send(FAR struct spi_dev_s *dev, uint16_t ch); 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_sndblock(FAR struct spi_dev_s *dev, FAR const void *buffer,
static void spi_recvblock(FAR struct spi_dev_s *dev, FAR void *buffer, size_t nwords); size_t nwords);
static void spi_recvblock(FAR struct spi_dev_s *dev, FAR void *buffer,
size_t nwords);
/**************************************************************************** /****************************************************************************
* Private Data * 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; 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; 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. * 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 * The wordsize is determined by the number of bits-per-word
* selected for the SPI interface. If nbits <= 8, the data is * 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: * Returned Value:
* None * 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; FAR const uint8_t *ptr = (FAR const uint8_t *)buffer;
uint8_t sr; 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 * dev - Device-specific state data
* buffer - A pointer to the buffer in which to recieve 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 * 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 * 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: * Returned Value:
* None * 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; FAR uint8_t *ptr = (FAR uint8_t*)buffer;
uint32_t rxpending = 0; 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); spiinfo("nwords: %d\n", nwords);
while (nwords || rxpending) 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.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.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.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 = getreg32(LPC214X_PINSEL1);
regval32 &= ~(LPC214X_PINSEL1_P017_MASK|LPC214X_PINSEL1_P018_MASK| regval32 &= ~(LPC214X_PINSEL1_P017_MASK | LPC214X_PINSEL1_P018_MASK |
LPC214X_PINSEL1_P019_MASK|LPC214X_PINSEL1_P020_MASK); LPC214X_PINSEL1_P019_MASK | LPC214X_PINSEL1_P020_MASK);
regval32 |= (LPC214X_PINSEL1_P017_SCK1|LPC214X_PINSEL1_P018_MISO1| regval32 |= (LPC214X_PINSEL1_P017_SCK1 | LPC214X_PINSEL1_P018_MISO1 |
LPC214X_PINSEL1_P019_MOSI1|LPC214X_PINSEL1_P020_GPIO); LPC214X_PINSEL1_P019_MOSI1 | LPC214X_PINSEL1_P020_GPIO);
putreg32(regval32, LPC214X_PINSEL1); putreg32(regval32, LPC214X_PINSEL1);
/* Disable chip select using P0.20 (SSEL1) (low enables) */ /* 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 */ /* 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) */ /* Disable the SSP and all interrupts (we'll poll for all data) */
@@ -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. * Copyright (C) 2008-2010, 2016 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org> * Author: Gregory Nutt <gnutt@nuttx.org>
@@ -70,7 +70,7 @@
# define LPC214X_MMCSDSLOTNO 0 # define LPC214X_MMCSDSLOTNO 0
#else #else
/* Add configuration for new LPC214x boards here */ /* Add configuration for new LPC214x boards here */
# error "Unrecognized LPC214x board" # error "Unrecognized LPC214x board"
#endif #endif
+2 -2
View File
@@ -228,13 +228,13 @@ Using OpenOCD and GDB with an FT2232 JTAG emulator
- Possibly the value of OPENOCD_PATH and TARGET_PATH - Possibly the value of OPENOCD_PATH and TARGET_PATH
- It assumes that the correct script to use is the one at - 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 Starting OpenOCD
Then you should be able to start the OpenOCD daemon like: 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 If you add that path to your PATH environment variable, the command
simplifies to just: simplifies to just:
+4 -4
View File
@@ -1,5 +1,5 @@
/**************************************************************************** /****************************************************************************
* boards/zp214xpa/include/board.h * boards/arm/lpc214x/zp214xpa/include/board.h
* *
* Copyright (C) 2012 Gregory Nutt. All rights reserved. * Copyright (C) 2012 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org> * Author: Gregory Nutt <gnutt@nuttx.org>
@@ -33,8 +33,8 @@
* *
****************************************************************************/ ****************************************************************************/
#ifndef __BOARDS_ARM_ZP214XPA_INCLUDE_BOARD_H #ifndef __BOARDS_ARM_LPC214X_ZP214XPA_INCLUDE_BOARD_H
#define __BOARDS_ARM_ZP214XPA_INCLUDE_BOARD_H #define __BOARDS_ARM_LPC214X_ZP214XPA_INCLUDE_BOARD_H
/**************************************************************************** /****************************************************************************
* Included Files * Included Files
@@ -65,4 +65,4 @@
* Inline Functions * Inline Functions
****************************************************************************/ ****************************************************************************/
#endif /* __BOARDS_ARM_ZP214XPA_INCLUDE_BOARD_H */ #endif /* __BOARDS_ARM_LPC214X_ZP214XPA_INCLUDE_BOARD_H */
@@ -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. # Copyright (C) 2012, 2014, 2017 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <gnutt@nuttx.org> # Author: Gregory Nutt <gnutt@nuttx.org>
@@ -1,5 +1,5 @@
/**************************************************************************** /****************************************************************************
* boards/zp214xpa/scripts/ld.script * boards/arm/lpc214x/zp214xpa/scripts/ld.script
* *
* Copyright (C) 2012 Gregory Nutt. All rights reserved. * Copyright (C) 2012 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org> * Author: Gregory Nutt <gnutt@nuttx.org>
+1 -1
View File
@@ -1,5 +1,5 @@
############################################################################ ############################################################################
# boards/zp214xpa/src/Makefile # boards/arm/lpc214x/zp214xpa/src/Makefile
# #
# Copyright (C) 2012 Gregory Nutt. All rights reserved. # Copyright (C) 2012 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <gnutt@nuttx.org> # Author: Gregory Nutt <gnutt@nuttx.org>
@@ -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. * Copyright (C) 2015-2017 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org> * Author: Gregory Nutt <gnutt@nuttx.org>
+47 -32
View File
@@ -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 * Copyright (C) 2008-2010, 2012, 2016-2017 Gregory Nutt. All rights
* reserved. * reserved.
@@ -112,15 +112,19 @@
****************************************************************************/ ****************************************************************************/
static int spi_lock(FAR struct spi_dev_s *dev, bool lock); 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,
static uint32_t spi_setfrequency(FAR struct spi_dev_s *dev, uint32_t frequency); 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); static uint8_t spi_status(FAR struct spi_dev_s *dev, uint32_t devid);
#ifdef CONFIG_SPI_CMDDATA #ifdef CONFIG_SPI_CMDDATA
static int spi_cmddata(FAR struct spi_dev_s *dev, uint32_t devid, bool cmd); static int spi_cmddata(FAR struct spi_dev_s *dev, uint32_t devid, bool cmd);
#endif #endif
static uint16_t spi_send(FAR struct spi_dev_s *dev, uint16_t ch); 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_sndblock(FAR struct spi_dev_s *dev, FAR const void *buffer,
static void spi_recvblock(FAR struct spi_dev_s *dev, FAR void *buffer, size_t nwords); size_t nwords);
static void spi_recvblock(FAR struct spi_dev_s *dev, FAR void *buffer,
size_t nwords);
/**************************************************************************** /****************************************************************************
* Private Data * 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 #ifdef CONFIG_DEBUG_SPI_INFO
uint32_t regval; uint32_t regval;
#endif #endif
uint32_t bit = 1 << 20; uint32_t bit = 1 << 20;
/* We do not bother to check if devid == SPIDEV_DISPLAY(0) because that is the /* We do not bother to check if devid == SPIDEV_DISPLAY(0)
* only thing on the bus. * because that is the only thing on the bus.
*/ */
#ifdef CONFIG_DEBUG_SPI_INFO #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) */ /* Disable slave select (low enables) */
putreg32(bit, CS_SET_REGISTER); 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 */ /* 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; 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 #endif
uint32_t bit = 1 << 23; uint32_t bit = 1 << 23;
/* We do not bother to check if devid == SPIDEV_DISPLAY(0) because that is the /* We do not bother to check if devid == SPIDEV_DISPLAY(0)
* only thing on the bus. * because that is the only thing on the bus.
*/ */
/* "This is the Data/Command control pad which determines whether the /* "This is the Data/Command control pad which determines whether the
* data bits are data or a command. * data bits are data or a command.
* *
* A0 = H: the inputs at D0 to D7 are treated as display data. * 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 #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. * 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 * The wordsize is determined by the number of bits-per-word
* selected for the SPI interface. If nbits <= 8, the data is * 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: * Returned Value:
* None * 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; FAR const uint8_t *ptr = (FAR const uint8_t *)buffer;
uint8_t sr; 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 * dev - Device-specific state data
* buffer - A pointer to the buffer in which to recieve 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 * 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
* selected for the SPI interface. If nbits <= 8, the data is * bits-per-word selected for the SPI interface.
* packed into uint8_t's; if nbits >8, the data is packed into uint16_t's * If nbits <= 8, the data is packed into uint8_t's; if nbits >8,
* the data is packed into uint16_t's
* *
* Returned Value: * Returned Value:
* None * 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; FAR uint8_t *ptr = (FAR uint8_t*)buffer;
uint32_t rxpending = 0; 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.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.18/CAP1.3/MISO1/MAT1.3 Bits 4-5=10 for MISO1
* (This is the RESET line for the UG_2864AMBAG01, * (This is the RESET line for the UG_2864AMBAG01,
* although it is okay to configure it as an input too) * 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.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.20/MAT1.3/SSEL1/EINT3 Bits 8-9=00 for P0.20
* PINSEL1 P0.23/VBUS Bits 12-13=00 for P0.21 (we'll control it via GPIO or FIO) * (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); regval32 = getreg32(LPC214X_PINSEL1);
#ifdef CONFIG_LCD_UG2864AMBAG01 #ifdef CONFIG_LCD_UG2864AMBAG01
regval32 &= ~(LPC214X_PINSEL1_P017_MASK|LPC214X_PINSEL1_P019_MASK| regval32 &= ~(LPC214X_PINSEL1_P017_MASK | LPC214X_PINSEL1_P019_MASK |
LPC214X_PINSEL1_P020_MASK|LPC214X_PINSEL1_P023_MASK); LPC214X_PINSEL1_P020_MASK | LPC214X_PINSEL1_P023_MASK);
regval32 |= (LPC214X_PINSEL1_P017_SCK1|LPC214X_PINSEL1_P019_MOSI1| regval32 |= (LPC214X_PINSEL1_P017_SCK1 | LPC214X_PINSEL1_P019_MOSI1 |
LPC214X_PINSEL1_P020_GPIO|LPC214X_PINSEL1_P023_GPIO); LPC214X_PINSEL1_P020_GPIO | LPC214X_PINSEL1_P023_GPIO);
#else #else
regval32 &= ~(LPC214X_PINSEL1_P017_MASK|LPC214X_PINSEL1_P018_MASK regval32 &= ~(LPC214X_PINSEL1_P017_MASK | LPC214X_PINSEL1_P018_MASK
LPC214X_PINSEL1_P019_MASK|LPC214X_PINSEL1_P020_MASK| LPC214X_PINSEL1_P019_MASK | LPC214X_PINSEL1_P020_MASK |
LPC214X_PINSEL1_P023_MASK); LPC214X_PINSEL1_P023_MASK);
regval32 |= (LPC214X_PINSEL1_P017_SCK1|LPC214X_PINSEL1_P018_MISO1| regval32 |= (LPC214X_PINSEL1_P017_SCK1 | LPC214X_PINSEL1_P018_MISO1 |
LPC214X_PINSEL1_P019_MOSI1|LPC214X_PINSEL1_P020_GPIO| LPC214X_PINSEL1_P019_MOSI1 | LPC214X_PINSEL1_P020_GPIO |
LPC214X_PINSEL1_P023_GPIO); LPC214X_PINSEL1_P023_GPIO);
#endif #endif
putreg32(regval32, LPC214X_PINSEL1); putreg32(regval32, LPC214X_PINSEL1);
@@ -640,7 +654,8 @@ FAR struct spi_dev_s *lpc214x_spibus_initialize(int port)
/* Configure 8-bit SPI mode */ /* 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) */ /* Disable the SSP and all interrupts (we'll poll for all data) */
@@ -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. * Copyright (C) 2012 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org> * Author: Gregory Nutt <gnutt@nuttx.org>
@@ -56,7 +56,9 @@
/**************************************************************************** /****************************************************************************
* Pre-processor Definitions * Pre-processor Definitions
****************************************************************************/ ****************************************************************************/
/* Configuration ************************************************************/ /* Configuration ************************************************************/
/* The pin configurations here requires that SPI1 is avaialable */ /* The pin configurations here requires that SPI1 is avaialable */
/* SPI should be configured with CMD/DATA support (and no transfer methods) */ /* SPI should be configured with CMD/DATA support (and no transfer methods) */
@@ -66,6 +68,7 @@
#endif #endif
/* Pin Configuration ********************************************************/ /* Pin Configuration ********************************************************/
/* UG-2864AMBAG01 OLED Display: /* UG-2864AMBAG01 OLED Display:
* *
* PIN NAME PIN CONFIGURATION * PIN NAME PIN CONFIGURATION
+2 -2
View File
@@ -1,6 +1,6 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# #
# See boards/zp214xpa/README.txt for information about # See boards/arm/lpc214x/zp214xpa/README.txt for information about
# this file. # this file.
TOPDIR=$1 TOPDIR=$1
@@ -19,7 +19,7 @@ OPENOCD_PATH="/usr/local/bin"
TARGET_PATH="/usr/local/share/openocd/scripts" TARGET_PATH="/usr/local/share/openocd/scripts"
OPENOCD_EXE=openocd.exe 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}" OPENOCD_ARGS="-f ${OPENOCD_CFG} -s ${TARGET_PATH}"
if [ "X$2" = "X-d" ]; then if [ "X$2" = "X-d" ]; then
@@ -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. * Copyright (C) 2010 Rommel Marcelo. All rights reserved.
* Author: Rommel Marcelo * Author: Rommel Marcelo
@@ -38,12 +38,12 @@
* *
****************************************************************************/ ****************************************************************************/
#ifndef __BOARDS_ARM_OLIMEX_LPC2378_INCLUDE_BOARD_H #ifndef __BOARDS_ARM_LPC2348_OLIMEX_LPC2378_INCLUDE_BOARD_H
#define __BOARDS_ARM_OLIMEX_LPC2378_INCLUDE_BOARD_H #define __BOARDS_ARM_LPC2348_OLIMEX_LPC2378_INCLUDE_BOARD_H
/************************************************************************************ /****************************************************************************
* Pre-processor Definitions * Pre-processor Definitions
************************************************************************************/ ****************************************************************************/
/* If USB is enabled, PLL must be configured for 48MHz to provide USB /* If USB is enabled, PLL must be configured for 48MHz to provide USB
* clocking. * clocking.
@@ -69,7 +69,7 @@
#define LPC23XX_CCLK 57600000 #define LPC23XX_CCLK 57600000
/* LED definitions **********************************************************/ /* LED definitions **********************************************************/
#define LED_STARTED 0 #define LED_STARTED 0
#define LED_HEAPALLOCATE 1 #define LED_HEAPALLOCATE 1
@@ -84,4 +84,4 @@
* Inline Functions * Inline Functions
****************************************************************************/ ****************************************************************************/
#endif /* __BOARDS_ARM_OLIMEX_LPC2378_INCLUDE_BOARD_H */ #endif /* __BOARDS_ARM_LPC2348_OLIMEX_LPC2378_INCLUDE_BOARD_H */
@@ -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. # Copyright (C) 2010 Rommel Marcelo. All rights reserved.
# Author: Rommel Marcelo # Author: Rommel Marcelo
@@ -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. * Copyright (C) 2010 Rommel Marcelo. All rights reserved.
* Author: Rommel Marcelo * Author: Rommel Marcelo
@@ -1,5 +1,5 @@
############################################################################ ############################################################################
# boards/mcu123-lpc214x/src/Makefile # boards/arm/lpc2378/olimex-lpc2378/src/Makefile
# #
# Copyright (C) 2010 Rommel Marcelo. All rights reserved. # Copyright (C) 2010 Rommel Marcelo. All rights reserved.
# Author: Rommel Marcelo # Author: Rommel Marcelo
@@ -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. * Copyright (C) 2010, 2016 Rommel Marcelo. All rights reserved.
* Author: Rommel Marcelo * Author: Rommel Marcelo
@@ -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. * Copyright (C) 2010 Rommel Marcelo. All rights reserved.
* Author: Rommel Marcelo * Author: Rommel Marcelo
+13 -10
View File
@@ -195,11 +195,11 @@ Image Format
it! it!
To work around both of these issues, I have created a small program under 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 either Linux or Cygwin (and probably other tool environments as well). That
tool can be built as follows: tool can be built as follows:
- cd boards/ea3131/tools - cd boards/arm/lpc31xx/ea3131/tools
- make - make
Then, to build the NuttX binary ready to load with the bootloader, just 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. to mklpc.sh in the final step.
2. You can instruct Symantec to ignore the errors and it will stop quarantining 2. You can instruct Symantec to ignore the errors and it will stop quarantining
the NXP program. 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: 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 retrieving revision 1.2
diff -r1.2 lpchdr.c diff -r1.2 lpchdr.c
264c264 264c264
@@ -262,7 +262,7 @@ Using OpenOCD and GDB
Then you should be able to start the OpenOCD daemon like: 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 Where it is assumed that you are executing oocd.sh from the top level
directory where NuttX is installed. 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 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 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 is only a test configuration, and lacks some logic to provide the full On-Demand
Paging solution (see below). Paging solution (see below).
@@ -383,16 +384,17 @@ On-Demand Paging
This example uses a two-pass build. The top-level Makefile recognizes the This example uses a two-pass build. The top-level Makefile recognizes the
configuration option CONFIG_BUILD_2PASS and will execute the Makefile in 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 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 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: Finishing the Example:
---------------------- ----------------------
This example is incomplete in that it does not have any media to reload the 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 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 (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 example. At present, the example works correctly up to the point where
@@ -438,7 +440,8 @@ On-Demand Paging
Alternative: 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 which is probably only useful for testing. Here is the usage module
for this alternative for this alternative
+16 -15
View File
@@ -1,5 +1,5 @@
/************************************************************************************ /****************************************************************************
* boards/ea3131/include/board.h * boards/arm/lpc31xx/ea3131/include/board.h
* include/arch/board/board.h * include/arch/board/board.h
* *
* Copyright (C) 2009-2010, 2014 Gregory Nutt. All rights reserved. * 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 * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE. * POSSIBILITY OF SUCH DAMAGE.
* *
************************************************************************************/ ****************************************************************************/
#ifndef __ARCH_BOARD_BOARD_H #ifndef __BOARDS_ARM_LPC31XX_EA3131_INCLUDE_BOARD_H
#define __ARCH_BOARD_BOARD_H #define __BOARDS_ARM_LPC31XX_EA3131_INCLUDE_BOARD_H
/************************************************************************************ /****************************************************************************
* Included Files * Included Files
************************************************************************************/ ****************************************************************************/
#include <nuttx/config.h> #include <nuttx/config.h>
#ifndef __ASSEMBLY__ #ifndef __ASSEMBLY__
@@ -47,11 +47,12 @@
# include "lpc31_cgudrvr.h" # include "lpc31_cgudrvr.h"
#endif #endif
/************************************************************************************ /****************************************************************************
* Pre-processor Definitions * Pre-processor Definitions
************************************************************************************/ ****************************************************************************/
/* Clocking *****************************************************************/
/* Clocking *************************************************************************/
/* Frequency of the FFAST input */ /* Frequency of the FFAST input */
#define BOARD_FREQIN_FFAST (12000000) /* ffast (12 MHz crystal) */ #define BOARD_FREQIN_FFAST (12000000) /* ffast (12 MHz crystal) */
@@ -80,8 +81,8 @@
#define BOARD_HPLL1_MODE 0 /* PLL mode */ #define BOARD_HPLL1_MODE 0 /* PLL mode */
#define BOARD_HPLL1_FREQ 180000000 /* Frequency of the PLL in MHz */ #define BOARD_HPLL1_FREQ 180000000 /* Frequency of the PLL in MHz */
/* The following 3 bitsets determine which clocks will be enabled at initialization /* The following 3 bitsets determine which clocks will be enabled at
* time. * initialization time.
*/ */
#define BOARD_CLKS_0_31 \ #define BOARD_CLKS_0_31 \
@@ -100,7 +101,7 @@
#define BOARD_CLKS_64_92 \ #define BOARD_CLKS_64_92 \
(0) (0)
/* LED definitions ******************************************************************/ /* LED definitions **********************************************************/
#define LED_STARTED 0 #define LED_STARTED 0
#define LED_HEAPALLOCATE 1 #define LED_HEAPALLOCATE 1
@@ -111,6 +112,6 @@
#define LED_ASSERTION 6 #define LED_ASSERTION 6
#define LED_PANIC 7 #define LED_PANIC 7
/* Button definitions ***************************************************************/ /* Button definitions *******************************************************/
#endif /* __ARCH_BOARD_BOARD_H */ #endif /* __BOARDS_ARM_LPC31XX_EA3131_INCLUDE_BOARD_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 * include/arch/board/board_memorymap.h
* *
* Copyright (C) 2009-2011 Gregory Nutt. All rights reserved. * 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 * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE. * POSSIBILITY OF SUCH DAMAGE.
* *
************************************************************************************/ ****************************************************************************/
#ifndef __ARCH_BOARD_BOARD_MEMORYMAP_H #ifndef __BOARDS_ARM_LPC31XX_EA3131_INCLUDE_MEMORYMAP_H
#define __ARCH_BOARD_BOARD_MEMORYMAP_H #define __BOARDS_ARM_LPC31XX_EA3131INCLUDE_MEMORYMAP_H
/* This file should never be included directly, but only indirectly via /* This file should never be included directly, but only indirectly via
* lpc31_memorymap.h. * lpc31_memorymap.h.
*/ */
/************************************************************************************ /****************************************************************************
* Included Files * Included Files
************************************************************************************/ ****************************************************************************/
#include <nuttx/config.h> #include <nuttx/config.h>
/************************************************************************************ /****************************************************************************
* Pre-processor Definitions * Pre-processor Definitions
************************************************************************************/ ****************************************************************************/
/* If the LPC31xx ROM page table is selected, then the board-logic is required /* If the LPC31xx ROM page table is selected, then the board-logic is
* to provide: * required to provide:
* *
* PGTABLE_BASE_PADDR - The physical address of the page table in ROM, * 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 * PGTABLE_BASE_VADDR - The mapped address of the page table in ROM, and
@@ -60,7 +60,7 @@
*/ */
#ifdef CONFIG_ARCH_ROMPGTABLE #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_SHADOWSPACE_VSECTION 0x00000000 /* 0x00000000-0x00000fff: Shadow Area 4Kb */
# define LPC31_INTSRAM_VSECTION 0x11028000 /* Internal SRAM 96Kb-192Kb */ # 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_INTC_VSECTION 0x60000000 /* 0x60000000-0x60000fff: Interrupt controller 4Kb */
# define LPC31_NAND_VSECTION 0x70000000 /* 0x70000000-0x700007ff: NANDFLASH Ctrl 2Kb */ # 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 ROMPGTABLE_OFFSET 0x0001c000 /* Offset of the ROM page table in ROM */
# define PGTABLE_BASE_PADDR (LPC31_INTSROM0_PSECTION+ROMPGTABLE_OFFSET) # define PGTABLE_BASE_PADDR (LPC31_INTSROM0_PSECTION+ROMPGTABLE_OFFSET)
# define PGTABLE_BASE_VADDR (LPC31_INTSROM0_VSECTION+ROMPGTABLE_OFFSET) # define PGTABLE_BASE_VADDR (LPC31_INTSROM0_VSECTION+ROMPGTABLE_OFFSET)
#endif #endif
/************************************************************************************ /****************************************************************************
* Public Data * Public Data
************************************************************************************/ ****************************************************************************/
#ifndef __ASSEMBLY__ #ifndef __ASSEMBLY__
#undef EXTERN #undef EXTERN
#if defined(__cplusplus) #if defined(__cplusplus)
#define EXTERN extern "C" #define EXTERN extern "C"
extern "C" { extern "C"
{
#else #else
#define EXTERN extern #define EXTERN extern
#endif #endif
/************************************************************************************ /****************************************************************************
* Public Function Prototypes * Public Function Prototypes
************************************************************************************/ ****************************************************************************/
#undef EXTERN #undef EXTERN
#if defined(__cplusplus) #if defined(__cplusplus)
} }
#endif #endif
#endif /* __ASSEMBLY__ */ #endif /* __ASSEMBLY__ */
#endif /* __ARCH_BOARD_BOARD_MEMORYMAP_H */ #endif /* __BOARDS_ARM_LPC31XX_EA3131_MEMORYMAP_H */
+1 -1
View File
@@ -1,5 +1,5 @@
############################################################################ ############################################################################
# boards/ea3131/locked/Makefile # boards/arm/lpc31xx/ea3131/locked/Makefile
# #
# Copyright (C) 2010 Gregory Nutt. All rights reserved. # Copyright (C) 2010 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <gnutt@nuttx.org> # Author: Gregory Nutt <gnutt@nuttx.org>
@@ -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. * Copyright (C) 2010 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org> * Author: Gregory Nutt <gnutt@nuttx.org>
+1 -1
View File
@@ -1,6 +1,6 @@
#!/usr/bin/env bash #!/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. # Copyright (C) 2010-2014, 2017 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <gnutt@nuttx.org> # Author: Gregory Nutt <gnutt@nuttx.org>
+1 -1
View File
@@ -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. # Copyright (C) 2010, 2017 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <gnutt@nuttx.org> # Author: Gregory Nutt <gnutt@nuttx.org>
+1 -1
View File
@@ -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. * Copyright (C) 2010-2012 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org> * Author: Gregory Nutt <gnutt@nuttx.org>
@@ -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. * Copyright (C) 2010, 2012 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org> * Author: Gregory Nutt <gnutt@nuttx.org>
+1 -1
View File
@@ -1,5 +1,5 @@
############################################################################ ############################################################################
# boards/ea3131/src/Makefile # boards/arm/lpc31xx/ea3131/src/Makefile
# #
# Copyright (C) 2009-2010 Gregory Nutt. All rights reserved. # Copyright (C) 2009-2010 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <gnutt@nuttx.org> # Author: Gregory Nutt <gnutt@nuttx.org>
+34 -32
View File
@@ -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. * Copyright (C) 2009-2010,2012 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org> * Author: Gregory Nutt <gnutt@nuttx.org>
@@ -31,14 +31,14 @@
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE. * POSSIBILITY OF SUCH DAMAGE.
* *
************************************************************************************/ ****************************************************************************/
#ifndef __BOARDS_ARM_EA3131_SRC_EA3131_H #ifndef __BOARDS_ARM_LPC31XX_EA3131_SRC_EA3131_H
#define __BOARDS_ARM_EA3131_SRC_EA3131_H #define __BOARDS_ARM_LPC31XX_EA3131_SRC_EA3131_H
/************************************************************************************ /****************************************************************************
* Included Files * Included Files
************************************************************************************/ ****************************************************************************/
#include <nuttx/config.h> #include <nuttx/config.h>
#include <nuttx/compiler.h> #include <nuttx/compiler.h>
@@ -46,109 +46,111 @@
#include "lpc31_ioconfig.h" #include "lpc31_ioconfig.h"
/************************************************************************************ /****************************************************************************
* Pre-processor Definitions * Pre-processor Definitions
************************************************************************************/ ****************************************************************************/
/* EA3131L GPIOs ********************************************************************/ /* EA3131L GPIOs ************************************************************/
/* LEDs -- interface through an I2C GPIO expander */ /* LEDs -- interface through an I2C GPIO expander */
/* BUTTONS -- NOTE that some have EXTI interrupts configured */ /* BUTTONS -- NOTE that some have EXTI interrupts configured */
/* SPI Chip Selects */ /* SPI Chip Selects */
/* SPI NOR flash is the only device on SPI. SPI_CS_OUT0 is its chip select */ /* SPI NOR flash is the only device on SPI. SPI_CS_OUT0 is its chip select */
#define SPINOR_CS IOCONFIG_SPI_CSOUT0 #define SPINOR_CS IOCONFIG_SPI_CSOUT0
/* USB Soft Connect Pullup -- NONE */ /* USB Soft Connect Pullup -- NONE */
/************************************************************************************ /****************************************************************************
* Public Types * Public Types
************************************************************************************/ ****************************************************************************/
/************************************************************************************ /****************************************************************************
* Public data * Public data
************************************************************************************/ ****************************************************************************/
#ifndef __ASSEMBLY__ #ifndef __ASSEMBLY__
/************************************************************************************ /****************************************************************************
* Public Functions * Public Functions
************************************************************************************/ ****************************************************************************/
/************************************************************************************ /****************************************************************************
* Name: lpc31_meminitialize * Name: lpc31_meminitialize
* *
* Description: * Description:
* Initialize external memory resources (sram, sdram, nand, nor, etc.) * Initialize external memory resources (sram, sdram, nand, nor, etc.)
* *
************************************************************************************/ ****************************************************************************/
#ifdef CONFIG_LPC31_EXTDRAM #ifdef CONFIG_LPC31_EXTDRAM
void lpc31_meminitialize(void); void lpc31_meminitialize(void);
#endif #endif
/************************************************************************************ /****************************************************************************
* Name: lpc31_spidev_initialize * Name: lpc31_spidev_initialize
* *
* Description: * Description:
* Called to configure SPI chip select GPIO pins for the EA3131 board. * Called to configure SPI chip select GPIO pins for the EA3131 board.
* *
************************************************************************************/ ****************************************************************************/
void weak_function lpc31_spidev_initialize(void); void weak_function lpc31_spidev_initialize(void);
/************************************************************************************ /****************************************************************************
* Name: lpc31_usbdev_initialize * Name: lpc31_usbdev_initialize
* *
* Description: * Description:
* Called to setup USB-related GPIO pins for the EA3131 board. * Called to setup USB-related GPIO pins for the EA3131 board.
* *
************************************************************************************/ ****************************************************************************/
#if defined(CONFIG_LPC31_USBOTG) && defined(CONFIG_USBDEV) #if defined(CONFIG_LPC31_USBOTG) && defined(CONFIG_USBDEV)
void weak_function lpc31_usbdev_initialize(void); void weak_function lpc31_usbdev_initialize(void);
#endif #endif
/************************************************************************************ /****************************************************************************
* Name: lpc31_usbhost_bootinitialize * Name: lpc31_usbhost_bootinitialize
* *
* Description: * Description:
* Called from lpc31_boardinitialize very early in inialization to setup USB * Called from lpc31_boardinitialize very early in inialization to setup
* host-related GPIO pins for the EA3131 board. * USB host-related GPIO pins for the EA3131 board.
* *
************************************************************************************/ ****************************************************************************/
#if defined(CONFIG_LPC31_USBOTG) && defined(CONFIG_USBHOST) #if defined(CONFIG_LPC31_USBOTG) && defined(CONFIG_USBHOST)
void weak_function lpc31_usbhost_bootinitialize(void); void weak_function lpc31_usbhost_bootinitialize(void);
#endif #endif
/*********************************************************************************** /****************************************************************************
* Name: lpc31_usbhost_initialize * Name: lpc31_usbhost_initialize
* *
* Description: * 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 * This function will start a thread that will monitor for device
* connection/disconnection events. * connection/disconnection events.
* *
***********************************************************************************/ ****************************************************************************/
#if defined(CONFIG_LPC31_USBOTG) && defined(CONFIG_USBHOST) #if defined(CONFIG_LPC31_USBOTG) && defined(CONFIG_USBHOST)
int lpc31_usbhost_initialize(void); int lpc31_usbhost_initialize(void);
#endif #endif
/************************************************************************************ /****************************************************************************
* Name: lpc31_pginitialize * Name: lpc31_pginitialize
* *
* Description: * Description:
* Set up mass storage device to support on demand paging. * Set up mass storage device to support on demand paging.
* *
************************************************************************************/ ****************************************************************************/
#ifdef CONFIG_PAGING #ifdef CONFIG_PAGING
void weak_function lpc31_pginitialize(void); void weak_function lpc31_pginitialize(void);
#endif #endif
#endif /* __ASSEMBLY__ */ #endif /* __ASSEMBLY__ */
#endif /* __BOARDS_ARM_EA3131_SRC_EA3131_H */ #endif /* __BOARDS_ARM_LPC31XX_EA3131_SRC_EA3131_H */
+10 -9
View File
@@ -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. * Copyright (C) 2009, 2012, 2016 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org> * Author: Gregory Nutt <gnutt@nuttx.org>
@@ -72,7 +72,7 @@
# define CONFIG_NSH_MMCSDSLOTNO 0 # define CONFIG_NSH_MMCSDSLOTNO 0
# endif # endif
#else #else
/* Add configuration for new LPC31XX boards here */ /* Add configuration for new LPC31XX boards here */
# error "Unrecognized LPC31XX board" # error "Unrecognized LPC31XX board"
# undef NSH_HAVEUSBDEV # undef NSH_HAVEUSBDEV
@@ -85,8 +85,8 @@
# undef NSH_HAVEUSBDEV # undef NSH_HAVEUSBDEV
#endif #endif
/* Can't support MMC/SD features if mountpoints are disabled or if SDIO support /* Can't support MMC/SD features if mountpoints are disabled or if SDIO
* is not enabled. * support is not enabled.
*/ */
#if defined(CONFIG_DISABLE_MOUNTPOINT) || !defined(CONFIG_LPC31_MCI) #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); ret = mmcsd_slotinitialize(CONFIG_NSH_MMCSDMINOR, sdio);
if (ret != OK) 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; return ret;
} }
syslog(LOG_INFO, "Successfully bound SDIO to the MMC/SD driver\n"); 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 /* Then let's guess and say that there is a card in the slot.
* see if the LPC313X10E-EVAL board supports a GPIO to detect if there is a card in * I need to check to see if the LPC313X10E-EVAL board supports a GPIO to
* the slot. * detect if there is a card in the slot.
*/ */
sdio_mediachange(sdio, true); sdio_mediachange(sdio, true);
#endif #endif
return OK; return OK;
} }
+25 -24
View File
@@ -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. * Copyright (C) 2009, 2012, 2015 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org> * Author: Gregory Nutt <gnutt@nuttx.org>
@@ -31,11 +31,11 @@
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE. * POSSIBILITY OF SUCH DAMAGE.
* *
************************************************************************************/ ****************************************************************************/
/************************************************************************************ /****************************************************************************
* Included Files * Included Files
************************************************************************************/ ****************************************************************************/
#include <nuttx/config.h> #include <nuttx/config.h>
@@ -49,27 +49,28 @@
#include "lpc31.h" #include "lpc31.h"
#include "ea3131.h" #include "ea3131.h"
/************************************************************************************ /****************************************************************************
* Pre-processor Definitions * Pre-processor Definitions
************************************************************************************/ ****************************************************************************/
/************************************************************************************ /****************************************************************************
* Private Functions * Private Functions
************************************************************************************/ ****************************************************************************/
/************************************************************************************ /****************************************************************************
* Public Functions * Public Functions
************************************************************************************/ ****************************************************************************/
/************************************************************************************ /****************************************************************************
* Name: lpc31_boardinitialize * Name: lpc31_boardinitialize
* *
* Description: * Description:
* All LPC31XX architectures must provide the following entry point. This entry * All LPC31XX architectures must provide the following entry point.
* point is called early in the intitialization -- after all memory has been * This entry point is called early in the intitialization -- after all
* configured and mapped but before any devices have been initialized. * memory has been configured and mapped but before any devices have been
* initialized.
* *
************************************************************************************/ ****************************************************************************/
void lpc31_boardinitialize(void) void lpc31_boardinitialize(void)
{ {
@@ -79,8 +80,8 @@ void lpc31_boardinitialize(void)
lpc31_meminitialize(); lpc31_meminitialize();
#endif #endif
/* Configure SPI chip selects if 1) SPI is not disabled, and 2) the weak function /* Configure SPI chip selects if 1) SPI is not disabled, and 2) the weak
* lpc31_spidev_initialize() has been brought into the link. * function lpc31_spidev_initialize() has been brought into the link.
*/ */
#if defined(CONFIG_LPC31_SPI) #if defined(CONFIG_LPC31_SPI)
@@ -90,10 +91,10 @@ void lpc31_boardinitialize(void)
} }
#endif #endif
/* Initialize USB is 1) USBDEV is selected, 2) the USB controller is not /* 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 * disabled, and 3) the weak function lpc31_usbdev_initialize() has been
* into the build. * brought into the build.
*/ */
#if defined(CONFIG_USBDEV) && defined(CONFIG_LPC31_USBOTG) #if defined(CONFIG_USBDEV) && defined(CONFIG_LPC31_USBOTG)
if (lpc31_usbdev_initialize) 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 /* Initialize USB if the 1) the HS host or device controller is in the
* configuration and 2) the weak function lpc31_usbhost_bootinitialize() has * configuration and 2) the weak function lpc31_usbhost_bootinitialize() has
* been brought into the build. Presumably either CONFIG_USBDEV or CONFIG_USBHOST * been brought into the build. Presumably either CONFIG_USBDEV or
* is also selected. * CONFIG_USBHOST is also selected.
*/ */
#if defined(CONFIG_SAMA5_UHPHS) || defined(CONFIG_SAMA5_UDPHS) #if defined(CONFIG_SAMA5_UHPHS) || defined(CONFIG_SAMA5_UDPHS)
@@ -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. * Copyright (C) 2009-2010, 2014-2015 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org> * Author: Gregory Nutt <gnutt@nuttx.org>
@@ -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. * Copyright (C) 2009-2010 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org> * Author: Gregory Nutt <gnutt@nuttx.org>
@@ -51,6 +51,7 @@
****************************************************************************/ ****************************************************************************/
/* Sub-domain Clock Bitsets *************************************************/ /* Sub-domain Clock Bitsets *************************************************/
/* The following bitsets group clocks into bitsets associated with each /* The following bitsets group clocks into bitsets associated with each
* domain and fractional divider subdomain. * domain and fractional divider subdomain.
* *
@@ -132,8 +133,9 @@
#define CGU_CLKSET_DOMAIN2_DIV10 \ #define CGU_CLKSET_DOMAIN2_DIV10 \
(_D2B(CLKID_PWMCLK)) (_D2B(CLKID_PWMCLK))
/* Domain 3 (DOMAINID_AHB0APB2), Clocks 50-57, Fraction dividers 11-13. Clocks /* Domain 3 (DOMAINID_AHB0APB2), Clocks 50-57, Fraction dividers 11-13.
* not defined in the clock sets will be sourced with AHB_APB2_BASE_CLK. * Clocks not defined in the clock sets will be sourced with
* AHB_APB2_BASE_CLK.
*/ */
/* Domain 3, Fractional divider 11: */ /* Domain 3, Fractional divider 11: */
@@ -177,8 +179,9 @@
#define CGU_CLKSET_DOMAIN6_DIV16 \ #define CGU_CLKSET_DOMAIN6_DIV16 \
(0) (0)
/* Domain 7 (DOMAINID_CLK1024FS), Clocks 73-86, Fraction dividers 17-22. Clocks /* Domain 7 (DOMAINID_CLK1024FS), Clocks 73-86, Fraction dividers 17-22.
* not defined in the clock sets will be sourced with CLK1024FS_BASE_CLK. * Clocks not defined in the clock sets will be sourced with
* CLK1024FS_BASE_CLK.
*/ */
/* Domain 7, Fractional divider 17: */ /* Domain 7, Fractional divider 17: */
@@ -428,7 +431,6 @@ const struct lpc31_clkinit_s g_boardclks =
#endif #endif
}; };
/**************************************************************************** /****************************************************************************
* Private Functions * Private Functions
****************************************************************************/ ****************************************************************************/
+50 -42
View File
@@ -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 * Copyright (C) 2010, 2012-2013, 20172018 Gregory Nutt. All rights
* reserved. * reserved.
@@ -86,7 +86,8 @@
# undef CONFIG_EA3131_PAGING_SDSLOT # undef CONFIG_EA3131_PAGING_SDSLOT
# endif # endif
#else #else
/* Add configuration for new LPC31XX boards here */ /* Add configuration for new LPC31XX boards here */
# error "Unrecognized LPC31XX board" # error "Unrecognized LPC31XX board"
# undef CONFIG_EA3131_PAGING_SDSLOT # undef CONFIG_EA3131_PAGING_SDSLOT
# undef HAVE_SD # undef HAVE_SD
@@ -112,16 +113,16 @@
#ifdef CONFIG_PAGING_BINPATH #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) # if defined(CONFIG_EA3131_PAGING_SDSLOT) && !defined(HAVE_SD)
# error "This board does not support SD" # error "This board does not support SD"
# undef CONFIG_EA3131_PAGING_SDSLOT # undef CONFIG_EA3131_PAGING_SDSLOT
# endif # endif
/* Can't support SD if mountpoints are disabled or if SDIO support /* Can't support SD if mountpoints are disabled or if SDIO support
* is not enabled. * is not enabled.
*/ */
# if defined(CONFIG_DISABLE_MOUNTPOINT) || !defined(CONFIG_LPC31_MCI) # if defined(CONFIG_DISABLE_MOUNTPOINT) || !defined(CONFIG_LPC31_MCI)
# ifdef CONFIG_EA3131_PAGING_SDSLOT # ifdef CONFIG_EA3131_PAGING_SDSLOT
@@ -131,7 +132,7 @@
# undef HAVE_SD # undef HAVE_SD
# endif # 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) # if !defined(CONFIG_EA3131_PAGING_MOUNTPT) && defined(CONFIG_EA3131_PAGING_SDSLOT)
# error "No CONFIG_EA3131_PAGING_MOUNTPT provided" # error "No CONFIG_EA3131_PAGING_MOUNTPT provided"
@@ -139,7 +140,7 @@
# undef HAVE_SD # undef HAVE_SD
# endif # endif
/* If no minor number is provided, default to zero */ /* If no minor number is provided, default to zero */
# ifndef CONFIG_EA3131_PAGING_MINOR # ifndef CONFIG_EA3131_PAGING_MINOR
# define CONFIG_EA3131_PAGING_MINOR 0 # define CONFIG_EA3131_PAGING_MINOR 0
@@ -151,21 +152,21 @@
#if defined(CONFIG_PAGING_M25PX) || defined(CONFIG_PAGING_AT45DB) #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 #ifndef CONFIG_LPC31_SPI
# error "SPI support is not enabled" # error "SPI support is not enabled"
#endif #endif
/* Make sure that some value is defined for the offset into the FLASH /* Make sure that some value is defined for the offset into the FLASH
* of the NuttX binary image. * of the NuttX binary image.
*/ */
# ifndef CONFIG_EA3131_PAGING_BINOFFSET # ifndef CONFIG_EA3131_PAGING_BINOFFSET
# define CONFIG_EA3131_PAGING_BINOFFSET 0 # define CONFIG_EA3131_PAGING_BINOFFSET 0
# endif # 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 # ifndef CONFIG_EA3131_PAGING_SPIPORT
# define CONFIG_EA3131_PAGING_SPIPORT 0 # define CONFIG_EA3131_PAGING_SPIPORT 0
@@ -224,9 +225,9 @@ static struct pg_source_s g_pgsrc;
* *
* Description: * Description:
* Initialize the source device that will support paging. * 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 * If BINPATH is defined, then it is the full path to a file on a mounted
* system. In this case initialization will be deferred until the first * file system. In this case initialization will be deferred until the
* time that up_fillpage() is called. * first time that up_fillpage() is called.
* *
****************************************************************************/ ****************************************************************************/
@@ -271,7 +272,8 @@ static inline void lpc31_initsrc(void)
/* Now mount the file system */ /* Now mount the file system */
snprintf(devname, 16, "/dev/mmcsd%d", CONFIG_EA3131_PAGING_MINOR); 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); DEBUGASSERT(ret == OK);
#endif /* CONFIG_EA3131_PAGING_SDSLOT */ #endif /* CONFIG_EA3131_PAGING_SDSLOT */
@@ -326,7 +328,8 @@ static inline void lpc31_initsrc(void)
* from the size of a pointer). * 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); DEBUGASSERT(ret >= 0);
capacity = g_pgsrc.geo.erasesize*g_pgsrc.geo.neraseblocks; capacity = g_pgsrc.geo.erasesize*g_pgsrc.geo.neraseblocks;
pginfo("capacity: %d\n", capacity); 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 * This callback is assumed to occur from an interrupt level when the
* device driver completes the fill operation. * 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- * allocates the page, and up_fillpage() fills it with data from some non-
* volatile storage device. This distinction is made because up_allocpage() * volatile storage device. This distinction is made because up_allocpage()
* can probably be implemented in board-independent logic whereas up_fillpage() * can probably be implemented in board-independent logic whereas
* probably must be implemented as board-specific logic. * up_fillpage() probably must be implemented as board-specific logic.
* *
* NOTE 2: The initial mapping of vpage will be read-able, write-able, * NOTE 2: The initial mapping of vpage will be read-able, write-able,
* but non-cacheable. No special actions will be required of * 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); 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); 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 /* If BINPATH is defined, then it is the full path to a file on a mounted
* system. In this case initialization will be deferred until the first * file system. In this case initialization will be deferred until the
* time that up_fillpage() is called. Are we initialized? * first time that up_fillpage() is called. Are we initialized?
*/ */
#if defined(CONFIG_PAGING_BINPATH) #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 */ /* 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); 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); 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 */ #endif /* CONFIG_PAGING_BLOCKINGFILL */
/************************************************************************************ /****************************************************************************
* Name: lpc31_pginitialize * Name: lpc31_pginitialize
* *
* Description: * Description:
* Set up mass storage device to support on demand paging. * Set up mass storage device to support on demand paging.
* *
************************************************************************************/ ****************************************************************************/
void weak_function lpc31_pginitialize(void) void weak_function lpc31_pginitialize(void)
{ {
/* This initialization does nothing in this example setup. But this function is /* This initialization does nothing in this example setup.
* where you might, for example: * But this function is where you might, for example:
* *
* - Initialize and configure a mass storage device to support on-demand paging. * - Initialize and configure a mass storage device to support on-demand
* This might be, perhaps an SD card or NAND memory. An SPI FLASH would probably * paging. This might be, perhaps an SD card or NAND memory.
* already have been configured by lpc31_spidev_initialize(void); * An SPI FLASH would probably already have been configured by
* - Set up resources to support up_fillpage() operation. For example, perhaps the * lpc31_spidev_initialize(void);
* the text image is stored in a named binary file. In this case, the virtual * - Set up resources to support up_fillpage() operation. For example,
* text addresses might map to offsets into that file. * perhaps the text image is stored in a named binary file.
* - Do whatever else is necessary to make up_fillpage() ready for the first time * In this case, the virtual text addresses might map to offsets into that
* that it is called. * 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 * In reality, however, this function is not very useful:
* from a low level (before nx_start() is even called), it may not be possible to * This function is called from a low level (before nx_start() is even
* perform file system operations or even to get debug output yet. Therefore, * called), it may not be possible to perform file system operations or even
* to keep life simple, initialization will be deferred in all cases until the first * to get debug output yet. Therefore, to keep life simple, initialization
* time that up_fillpage() is called. * will be deferred in all cases until the first time that up_fillpage()
* is called.
*/ */
} }
+1 -1
View File
@@ -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. * Copyright (C) 2009-2010, 2013, 2015 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org> * Author: Gregory Nutt <gnutt@nuttx.org>
+25 -21
View File
@@ -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. * Copyright (C) 2009-2010,2012 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org> * Author: Gregory Nutt <gnutt@nuttx.org>
@@ -70,7 +70,7 @@
#define EA3131_MPMC_DELAY 0x824 #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_TRP (20)
#define EA3131_SDRAM_TRFC (66) #define EA3131_SDRAM_TRFC (66)
@@ -90,7 +90,7 @@
* the HCLK. * the HCLK.
*/ */
#define NS2HCLKS(ns,hclk2,mask) \ #define NS2HCLKS(ns, hclk2, mask) \
((uint32_t)(((uint64_t)ns *(uint64_t)hclk2) / 1000000000ull) & mask) ((uint32_t)(((uint64_t)ns *(uint64_t)hclk2) / 1000000000ull) & mask)
/**************************************************************************** /****************************************************************************
@@ -169,7 +169,10 @@ static void lpc31_sdraminitialize(void)
# define HCLK hclk # define HCLK hclk
#endif #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 #if 0
uint32_t hclk2 = hclk; uint32_t hclk2 = hclk;
@@ -189,9 +192,9 @@ static void lpc31_sdraminitialize(void)
/* Configure device config register nSDCE0 for proper width SDRAM */ /* 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); LPC31_MPMC_DYNCONFIG0);
putreg32((MPMC_DYNRASCAS0_RAS2CLK|MPMC_DYNRASCAS0_CAS2CLK), putreg32((MPMC_DYNRASCAS0_RAS2CLK | MPMC_DYNRASCAS0_CAS2CLK),
LPC31_MPMC_DYNRASCAS0); LPC31_MPMC_DYNRASCAS0);
/* Min 20ns program 1 so that at least 2 HCLKs are used */ /* 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 */ /* Issue continuous NOP commands */
putreg32((MPMC_DYNCONTROL_CE|MPMC_DYNCONTROL_CS|MPMC_DYNCONTROL_INOP), putreg32((MPMC_DYNCONTROL_CE | MPMC_DYNCONTROL_CS |
LPC31_MPMC_DYNCONTROL); MPMC_DYNCONTROL_INOP), LPC31_MPMC_DYNCONTROL);
/* Wait ~200us */ /* Wait ~200us */
@@ -231,8 +234,8 @@ static void lpc31_sdraminitialize(void)
/* Issue a "pre-charge all" command */ /* Issue a "pre-charge all" command */
putreg32((MPMC_DYNCONTROL_CE|MPMC_DYNCONTROL_CS|MPMC_DYNCONTROL_IPALL), putreg32((MPMC_DYNCONTROL_CE | MPMC_DYNCONTROL_CS |
LPC31_MPMC_DYNCONTROL); MPMC_DYNCONTROL_IPALL), LPC31_MPMC_DYNCONTROL);
/* Minimum refresh pulse interval (tRFC) for MT48LC32M16A2=80nsec, /* Minimum refresh pulse interval (tRFC) for MT48LC32M16A2=80nsec,
* 100nsec provides more than adequate interval. * 100nsec provides more than adequate interval.
@@ -247,34 +250,35 @@ static void lpc31_sdraminitialize(void)
/* Recommended refresh interval for normal operation of the Micron /* Recommended refresh interval for normal operation of the Micron
* MT48LC16LFFG = 7.8125usec (128KHz rate). ((HCLK / 128000) - 1) = * 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), putreg32(NS2HCLKS(EA3131_SDRAM_OPERREFRESH, HCLK,
LPC31_MPMC_DYNREFRESH); MPMC_DYNREFRESH_TIMER_MASK), LPC31_MPMC_DYNREFRESH);
/* Select mode register update mode */ /* Select mode register update mode */
putreg32((MPMC_DYNCONTROL_CE|MPMC_DYNCONTROL_CS|MPMC_DYNCONTROL_IMODE), putreg32((MPMC_DYNCONTROL_CE | MPMC_DYNCONTROL_CS |
LPC31_MPMC_DYNCONTROL); MPMC_DYNCONTROL_IMODE), LPC31_MPMC_DYNCONTROL);
/* Program the SDRAM internal mode registers on bank nSDCE0 and reconfigure /* 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 * To get correct value on address bus CAS cycle, requires a shift by 13 for
* 16bit mode * 16bit mode
*/ */
(void)getreg32(LPC31_EXTSDRAM0_VSECTION | (0x23 << 13)); (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); LPC31_MPMC_DYNCONFIG0);
putreg32((MPMC_DYNRASCAS0_RAS2CLK|MPMC_DYNRASCAS0_CAS2CLK), putreg32((MPMC_DYNRASCAS0_RAS2CLK | MPMC_DYNRASCAS0_CAS2CLK),
LPC31_MPMC_DYNRASCAS0); LPC31_MPMC_DYNRASCAS0);
/* Select normal operating mode */ /* Select normal operating mode */
putreg32((MPMC_DYNCONTROL_CE|MPMC_DYNCONTROL_CS|MPMC_DYNCONTROL_INORMAL), putreg32((MPMC_DYNCONTROL_CE | MPMC_DYNCONTROL_CS |
LPC31_MPMC_DYNCONTROL); MPMC_DYNCONTROL_INORMAL), LPC31_MPMC_DYNCONTROL);
/* Enable buffers */ /* Enable buffers */
@@ -282,7 +286,7 @@ static void lpc31_sdraminitialize(void)
regval |= MPMC_DYNCONFIG0_B; regval |= MPMC_DYNCONFIG0_B;
putreg32(regval, LPC31_MPMC_DYNCONFIG0); putreg32(regval, LPC31_MPMC_DYNCONFIG0);
putreg32((MPMC_DYNCONTROL_INORMAL|MPMC_DYNCONTROL_CS), putreg32((MPMC_DYNCONTROL_INORMAL | MPMC_DYNCONTROL_CS),
LPC31_MPMC_DYNCONTROL); LPC31_MPMC_DYNCONTROL);
} }
+27 -21
View File
@@ -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. * Copyright (C) 2009-2012 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org> * Author: Gregory Nutt <gnutt@nuttx.org>
@@ -31,11 +31,11 @@
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE. * POSSIBILITY OF SUCH DAMAGE.
* *
************************************************************************************/ ****************************************************************************/
/************************************************************************************ /****************************************************************************
* Included Files * Included Files
************************************************************************************/ ****************************************************************************/
#include <nuttx/config.h> #include <nuttx/config.h>
@@ -52,38 +52,42 @@
#include "ea3131.h" #include "ea3131.h"
#ifdef CONFIG_LPC31_SPI #ifdef CONFIG_LPC31_SPI
#if 0 /* At present, EA3131 specific logic is hard-coded in the file lpc31_spi.c #if 0
* in arch/arm/src/lpc31xx */ /* At present, EA3131 specific logic is hard-coded in the file lpc31_spi.c
* in arch/arm/src/lpc31xx
*/
/************************************************************************************ /****************************************************************************
* Public Functions * Public Functions
************************************************************************************/ ****************************************************************************/
/************************************************************************************ /****************************************************************************
* Name: lpc31_spidev_initialize * Name: lpc31_spidev_initialize
* *
* Description: * Description:
* Called to configure SPI chip select GPIO pins for the EA3131 board. * Called to configure SPI chip select GPIO pins for the EA3131 board.
* *
************************************************************************************/ ****************************************************************************/
void weak_function lpc31_spidev_initialize(void) void weak_function lpc31_spidev_initialize(void)
{ {
/* NOTE: Clocking for SPI has already been provided. Pin configuration is performed /* NOTE: Clocking for SPI has already been provided.
* on-the-fly, so no additional setup is required. * Pin configuration is performed on-the-fly,
* so no additional setup is required.
*/ */
} }
/************************************************************************************ /****************************************************************************
* Name: lpc31_spiselect and lpc31_spistatus * Name: lpc31_spiselect and lpc31_spistatus
* *
* Description: * Description:
* The external functions, lpc31_spiselect and lpc31_spistatus must be * The external functions, lpc31_spiselect and lpc31_spistatus must be
* provided by board-specific logic. They are implementations of the select * 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 * 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()) * include/nuttx/spi/spi.h).
* are provided by common LPC31XX logic. To use this common SPI logic on your * All other methods (including lpc31_spibus_initialize())
* board: * 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 * 1. Provide logic in lpc31_boardinitialize() to configure SPI chip select
* pins. * pins.
@@ -92,16 +96,18 @@ void weak_function lpc31_spidev_initialize(void)
* status operations using GPIOs in the way your board is configured. * status operations using GPIOs in the way your board is configured.
* 3. Add a calls to lpc31_spibus_initialize() in your low level application * 3. Add a calls to lpc31_spibus_initialize() in your low level application
* initialization logic * initialization logic
* 4. The handle returned by lpc31_spibus_initialize() may then be used to bind the * 4. The handle returned by lpc31_spibus_initialize() may then be used to
* SPI driver to higher level logic (e.g., calling * bind the SPI driver to higher level logic (e.g., calling
* mmcsd_spislotinitialize(), for example, will bind the SPI driver to * mmcsd_spislotinitialize(), for example, will bind the SPI driver to
* the SPI MMC/SD driver). * 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" #warning "Missing logic"
} }
+56 -43
View File
@@ -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. * Copyright (C) 2013, 2015-2017 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org> * Author: Gregory Nutt <gnutt@nuttx.org>
@@ -31,11 +31,11 @@
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE. * POSSIBILITY OF SUCH DAMAGE.
* *
************************************************************************************/ ****************************************************************************/
/************************************************************************************ /****************************************************************************
* Included Files * Included Files
************************************************************************************/ ****************************************************************************/
#include <nuttx/config.h> #include <nuttx/config.h>
@@ -60,9 +60,9 @@
#if defined(CONFIG_LPC31_USBOTG) || defined(CONFIG_USBHOST) #if defined(CONFIG_LPC31_USBOTG) || defined(CONFIG_USBHOST)
/************************************************************************************ /****************************************************************************
* Pre-processor Definitions * Pre-processor Definitions
************************************************************************************/ ****************************************************************************/
#ifndef CONFIG_USBHOST_DEFPRIO #ifndef CONFIG_USBHOST_DEFPRIO
# define CONFIG_USBHOST_DEFPRIO 50 # define CONFIG_USBHOST_DEFPRIO 50
@@ -76,31 +76,32 @@
# endif # endif
#endif #endif
/************************************************************************************ /****************************************************************************
* Private Data * Private Data
************************************************************************************/ ****************************************************************************/
/* Retained device driver handle */ /* Retained device driver handle */
static struct usbhost_connection_s *g_ehciconn; static struct usbhost_connection_s *g_ehciconn;
/************************************************************************************ /****************************************************************************
* Private Functions * Private Functions
************************************************************************************/ ****************************************************************************/
/************************************************************************************ /****************************************************************************
* Name: ehci_waiter * Name: ehci_waiter
* *
* Description: * Description:
* Wait for USB devices to be connected to the EHCI root hub. * Wait for USB devices to be connected to the EHCI root hub.
* *
************************************************************************************/ ****************************************************************************/
static int ehci_waiter(int argc, char *argv[]) static int ehci_waiter(int argc, char *argv[])
{ {
FAR struct usbhost_hubport_s *hport; FAR struct usbhost_hubport_s *hport;
uinfo("ehci_waiter: Running\n"); uinfo("ehci_waiter: Running\n");
for (;;) for (; ; )
{ {
/* Wait for the device to change state */ /* Wait for the device to change state */
@@ -123,48 +124,54 @@ static int ehci_waiter(int argc, char *argv[])
return 0; return 0;
} }
/************************************************************************************ /****************************************************************************
* Public Functions * Public Functions
************************************************************************************/ ****************************************************************************/
/************************************************************************************ /****************************************************************************
* Name: lpc31_usbhost_bootinitialize * Name: lpc31_usbhost_bootinitialize
* *
* Description: * Description:
* Called from lpc31_boardinitialize very early in inialization to setup USB * Called from lpc31_boardinitialize very early in inialization to setup
* host-related GPIO pins for the EA3131 board. * USB host-related GPIO pins for the EA3131 board.
* *
* USB host VBUS power is controlled by a Micrel USB power switch. That switch is * USB host VBUS power is controlled by a Micrel USB power switch.
* driver by a discrete that comes from the I2C-contrrol PCA9532 GPIO expander. * That switch is driver by a discrete that comes from the I2C-contrrol
* PCA9532 GPIO expander.
* *
************************************************************************************/ ****************************************************************************/
void weak_function lpc31_usbhost_bootinitialize(void) void weak_function lpc31_usbhost_bootinitialize(void)
{ {
/* Get an instance of the I2C interface. This will be needed to control the /* Get an instance of the I2C interface.
* PCA9532 GPIO expander. * This will be needed to control the PCA9532 GPIO expander.
*/ */
#warning Missing logic #warning Missing logic
/* Use the I2C interface to initialize the PCA9532 GPIO expander driver */ /* Use the I2C interface to initialize the PCA9532 GPIO expander driver */
#warning Missing logic #warning Missing logic
/* Configure pin to drive VBUS power using the PCA8532 GPIO expander */ /* Configure pin to drive VBUS power using the PCA8532 GPIO expander */
#warning Missing logic #warning Missing logic
/* Configure pin to detect overrcurrent errors */ /* Configure pin to detect overrcurrent errors */
#warning Missing logic #warning Missing logic
} }
/*********************************************************************************** /****************************************************************************
* Name: lpc31_usbhost_initialize * Name: lpc31_usbhost_initialize
* *
* Description: * 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 * This function will start a thread that will monitor for device
* connection/disconnection events. * connection/disconnection events.
* *
***********************************************************************************/ ****************************************************************************/
int lpc31_usbhost_initialize(void) int lpc31_usbhost_initialize(void)
{ {
@@ -191,7 +198,8 @@ int lpc31_usbhost_initialize(void)
ret = usbhost_msc_initialize(); ret = usbhost_msc_initialize();
if (ret != OK) 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 #endif
@@ -238,27 +246,28 @@ int lpc31_usbhost_initialize(void)
return OK; return OK;
} }
/*********************************************************************************** /****************************************************************************
* Name: lpc31_usbhost_vbusdrive * Name: lpc31_usbhost_vbusdrive
* *
* Description: * Description:
* Enable/disable driving of VBUS 5V output. This function must be provided by * Enable/disable driving of VBUS 5V output.
* each platform that implements the OHCI or EHCI host interface * This function must be provided by each platform that implements the OHCI
* or EHCI host interface
* *
* Input Parameters: * Input Parameters:
* rhport - Selects root hub port to be powered host interface. Since the LPC31 * rhport - Selects root hub port to be powered host interface.
* has only a downstream port, zero is the only possible value for this * Since the LPC31 has only a downstream port, zero is the only possible
* parameter. * value for this parameter.
* enable - true: enable VBUS power; false: disable VBUS power * enable - true: enable VBUS power; false: disable VBUS power
* *
* Returned Value: * Returned Value:
* None * None
* *
***********************************************************************************/ ****************************************************************************/
void lpc31_usbhost_vbusdrive(int rhport, bool enable) 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 */ /* The LPC3131 has only a single root hub port */
@@ -269,44 +278,48 @@ void lpc31_usbhost_vbusdrive(int rhport, bool enable)
if (enable) if (enable)
{ {
/* Enable the Power Switch by driving the enable pin low */ /* Enable the Power Switch by driving the enable pin low */
#warning Missing logic #warning Missing logic
} }
else else
{ {
/* Disable the Power Switch by driving the enable pin high */ /* Disable the Power Switch by driving the enable pin high */
#warning Missing logic #warning Missing logic
} }
} }
} }
/************************************************************************************ /****************************************************************************
* Name: lpc31_setup_overcurrent * Name: lpc31_setup_overcurrent
* *
* Description: * Description:
* Setup to receive an interrupt-level callback if an overcurrent condition is * Setup to receive an interrupt-level callback if an overcurrent
* detected. * condition is detected.
* *
* Input Parameters: * Input Parameters:
* handler - New overcurrent interrupt handler * handler - New overcurrent interrupt handler
* arg - The argument that will accompany the interrupt * arg - The argument that will accompany the interrupt
* *
* Returned Value: * 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 */ #if 0 /* Not ready yet */
int lpc31_setup_overcurrent(xcpt_t handler, void *arg) int lpc31_setup_overcurrent(xcpt_t handler, void *arg)
{ {
irqstate_t flags; irqstate_t flags;
/* Disable interrupts until we are done. This guarantees that the /* Disable interrupts until we are done.
* following operations are atomic. * This guarantees that the following operations are atomic.
*/ */
flags = enter_critical_section(); flags = enter_critical_section();
/* Configure the interrupt */ /* Configure the interrupt */
#warning Missing logic #warning Missing logic
leave_critical_section(flags); leave_critical_section(flags);
+1 -1
View File
@@ -1,5 +1,5 @@
############################################################################ ############################################################################
# boards/ea3131/tools/Makefile # boards/arm/lpc31xx/ea3131/tools/Makefile
# #
# Copyright (C) 2010 Gregory Nutt. All rights reserved. # Copyright (C) 2010 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <gnutt@nuttx.org> # Author: Gregory Nutt <gnutt@nuttx.org>
+1 -1
View File
@@ -1,5 +1,5 @@
/************************************************************************************************ /************************************************************************************************
* boards/ea3131/tools/crc32.c * boards/arm/lpc31xx/ea3131/tools/crc32.c
* *
* This file is a part of NuttX: * This file is a part of NuttX:
* *
+1 -1
View File
@@ -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. * Copyright (C) 2010-2011 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org> * Author: Gregory Nutt <gnutt@nuttx.org>
+4 -5
View File
@@ -1,5 +1,5 @@
/************************************************************************************ /************************************************************************************
* boards/ea3131/tools/lpchdr.h * boards/arm/lpc31xx/ea3131/tools/lpchdr.h
* *
* Copyright (C) 2010 Gregory Nutt. All rights reserved. * Copyright (C) 2010 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org> * Author: Gregory Nutt <gnutt@nuttx.org>
@@ -33,8 +33,8 @@
* *
************************************************************************************/ ************************************************************************************/
#ifndef __BOARDS_ARM_EA3131_TOOLS_LPCHDR_H #ifndef __BOARDS_ARM_LPC31XX_EA3131_TOOLS_LPCHDR_H
#define __BOARDS_ARM_EA3131_TOOLS_LPCHDR_H #define __BOARDS_ARM_LPC31XX_EA3131_TOOLS_LPCHDR_H
/************************************************************************************ /************************************************************************************
* Included Files * 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 crc32part(const uint8_t *src, size_t len, uint32_t crc32val);
extern uint32_t crc32(const uint8_t *src, size_t len); 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 */
+3 -3
View File
@@ -1,13 +1,13 @@
#!/usr/bin/env bash #!/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 # from either that directory or TOPDIR
MYNAME=`basename $0` MYNAME=`basename $0`
if [ -x "$PWD/$MYNAME" ]; then if [ -x "$PWD/$MYNAME" ]; then
TOPDIR="$PWD/../../.." TOPDIR="$PWD/../../.."
else else
if [ -x "$PWD/boards/ea3131/tools/$MYNAME" ]; then if [ -x "$PWD/boards/arm/lpc31xx/ea3131/tools/$MYNAME" ]; then
TOPDIR="$PWD" TOPDIR="$PWD"
else else
echo "This script must be executed from a known director" 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 # The lpchdr could be named lpchdr.exe if we are running under Cygwin or
# just lpchdr under Linux # just lpchdr under Linux
TOOLDIR=$TOPDIR/boards/ea3131/tools TOOLDIR=$TOPDIR/boards/arm/lpc31xx/ea3131/tools
if [ ! -d "$TOOLDIR" ]; then if [ ! -d "$TOOLDIR" ]; then
echo "Tool directory $TOOLDIR does not exist" echo "Tool directory $TOOLDIR does not exist"

Some files were not shown because too many files have changed in this diff Show More