diff --git a/ChangeLog b/ChangeLog
index 8f3cefa8ffc..7b20e8cc1ba 100755
--- a/ChangeLog
+++ b/ChangeLog
@@ -11878,7 +11878,7 @@
* arch/arm/src/samv7: Fix missing unlock of device in MCAN
mcan_txempty(). From Frank Benkert (2016-06-01).
-7.17 2016-xx-xx Gregory Nutt
+7.17 2016-07-25 Gregory Nutt
* drivers/mtd/flash_eraseall.c: Removed. This is no longer used
in the OS and is simply a wrapper around the MDIOC_BULKERASE
@@ -11917,27 +11917,16 @@
* arch/arm/src/stm32: Add support for the STM32F105R. From Konstantin
Berezenko (2016-06-06).
* include/signal.h: Change type of SIG_ERR, SIG_IGN, ... to
- _sa_handler_t. They type void does not work with the IAR toolchain.
+ _sa_handler_t. The type void does not work with the IAR toolchain.
From Aleksandr Vyhovanec (2016-06-07).
- * arch/arm/src/stm32f7 and include/stm32f7: Added STM32FF76xxx and
- STM32FF7xx families. From David Sidrane (2016-06-08).
- * Refactoring configs/nucleo-144 sub-directories to support additional
- nucleo-144 board. Add support for the Nucleo-F767ZI board. From David
- Sidrane (2016-06-08).
- * arch/arm/src/kinetis: Add a USB device controller driver for kinetis.
- Derived from pic32mx usb driver, which uses the same usb controller.
- From kfazz (2016-06-06).
- * configs/teensy-3.x: Add USB device support and usbnsh configuration.
- From kfazz (2016-06-06.
- * arch/arm/src/stm32: Add STM32F105R support. From Konstantin Berezenko
- (2016-06-06).
- * include/signal.h: Change type of SIG_IGN and related defines to
- _sa_handler_t. From Aleksandr Vyhovanec (2016-06-07).
* configs/nucleo-144: Refactored configs/nucleo-144 sub-directories to
support additional nucleo-144 board. Add support for the Nucleo-F767ZI
board. From David Sidrane (2016-06-07).
- * arch/arm/src/stm32f7: Add support for STM32FF76xxx and STM32FF7xx
- families. From David Sidrane (2016-06-08).
+ * arch/arm/src/stm32f7 and include/stm32f7: Added STM32F76xxx and
+ STM32F77xx families. From David Sidrane (2016-06-08).
+ * Refactoring configs/nucleo-144 sub-directories to support additional
+ nucleo-144 board. Add support for the Nucleo-F767ZI board. From David
+ Sidrane (2016-06-08).
* include/assert.h: Check if NDEBUG is defined. From Paul Alexander
Patience (2016-06-08).
* arch/arm/src/stm32: Fix STM32 DMA code and configuration for STM32F37X
@@ -11958,25 +11947,10 @@
and the full packet length, need to subtract the size of the link
layer header before making the comparison or we will get false
positives (i.e., the packet is really too small) (2016-06-09)
- * drivers/mtd: Added driver of IS25xP SPI flash devices. Based on
- sst25xx driver. From Marten Svanfeldt (2016-06-09).
- * arch/arm/src/kinetis: Teensy clock fixes. The High Gain bit in
- MCG_C1 was preventing teensy from booting except after a programming
- session. The second change doesn't appear to change any functionality,
- but complies with restrictions in the k20 family reference manual on
- FEI -> FBE clock transiions. From kfazz (2016-06-09).
- * arch/arm/src/stm32: Fix timer input clock definitions. From David
- Sidrane (2016-06-09).
* configs/: All configurations that have both CONFIG_NSH_LIBRARY=y and
CONFIG_NET=y must now also have CONFIG_NSH_NETINIT=y (2016-06-09).
* arch/arm/src/kinetis: Kinetis pwm support, based on kl_pwm driver.
From kfazz (2016-06-09).
- * net/: In both IPv6 and IPv4 incoming logic: (1) Should check if the
- packet size is large enough before trying to access the packet length
- in the IP header. (2) In the comparison between the IP length and the
- full packet length, need to subtract the size of the link layer header
- before making the comparison or we will get false positives (i.e., the
- packet is really too small) (2016-06-09).
* arch/srm/src/stm32: Fix compilation errors in debug mode of
stm32_pwm.c. From Konstantin Berezenko (2016-06-09).
* arch/arm/src/kinetis: Support up to 8 channels per timer. From kfazz
@@ -11991,7 +11965,7 @@
chips. From Konstantin Berezenko (2016-06-10).
* drivers/include/input: Button upper half driver: Add definitions
needed for compilation with the poll() interface is not disabled
- (2016-06-11).
+ (2016-06-11).
* Kconfig/, include/debug.h, and many other files: (1) Debug features
are now enabled separately from debug output. CONFIG_DEBUG is gone.
It is replaced with CONFIG_DEBUG_FEATURES. (2) The macros dbg() and
@@ -12033,7 +12007,7 @@
control the delay between the assertion of the ChipSelect and the
first bit, between the last bit and the de-assertion of the
ChipSelect and between two ChipSelects. This is needed to tune the
- transfer according the specification of the connected devices.
+ transfer according the specification of the connected devices.
- Add three "hw-features" for the SAMV7, which controls the behavior
of the ChipSelect:
- force CS inactive after transfer: this forces a (short)
@@ -12136,7 +12110,7 @@
refresh (via tools/refresh.sh). I assume that it is a hand-edited
configuration and, hence, must be removed from the repository
(2016-06-23).
- * arch/arm/arc/sam34: DAC bugfix: DACC_WPMR_WPKEY_MASK -> DACC_WPMR_WPKEY.
+ * arch/arm/arc/sam34: DAC bugfix: DACC_WPMR_WPKEY_MASK -> DACC_WPMR_WPKEY.
Timer bugfix: Fix ops check in TCIOC_STOP. From Wolfgang Reissnegge
(2016-06-23).
* configs/nucleo-144: Added SDMMC support to Nucleo-144. From David
@@ -12212,7 +12186,7 @@
style symbolic links.
The fix here is to also execute the clean_context AFTER executing
menuconfig. A lot more happens now: It used to be that doing 'make
- menuconfig' only did the menuconfig operation. No it does context,
+ menuconfig' only did the menuconfig operation. Now it does context,
pre_config, menuconfig, clean_context. Not nearly as snappy as it used
to be (2016-06-28).
* arch/arm/src/efm32, lcp43, stm32, stm32l4: disable interrupts with
@@ -12375,3 +12349,141 @@
adds DEBUGASSERT for invalid geometry and additional memory debug
logic. Also fixes the dangling pointer on error bug. From Ken
Pettit (2016-07-14).
+ * arch/arm/src/lpc32xx: Extend LPC43xx EMC code to support SDRAM on a
+ dynamic memory interface. From Vytautas Lukenskas (2016-07-19).
+ * arch/sim/src: Add the simulated QSPI (N25Q) flash to the simulation
+ and modify sim up_spiflash.c to enable it to run with different MTD
+ drivers based on config options (currently m25p, sst26 and w25).
+ From Ken Pettit (2016-07-19).
+ * drivers/pipe: Add support to allocating different sizes for pipe and
+ fifo buffers. Adds mkfifo2() and pipe2() which are just like mkfifo()
+ and pipe(), but allow control of the size of the underlying, in-memory
+ circular buffer . Move pipe() and mkpipe() to nuttx/libc, they are no
+ longer core OS interfaces. Capability currenty used only by PTY logic
+ to support, configurable, smaller buffers for PTYs (2016-07-19).
+ * include/nuttx/drivers: Move driver-related files from include/nuttx
+ to include/nuttx/drivers. Move driver related prototypes out of
+ include/nuttx/fs/fs.h and into new include/drivers/drivers.h
+ (2016-07-20).
+ * include /nuttx/lib: Move library-related files from include/nuttx to
+ include/nuttx/lib (2016-07-21).
+ * drivers/serial/serial.c: Fix a race condition noted by Stefan Kolb.
+ Between the test if the TX buffer is full and entering a critical
+ section, bytes may be removed from the TX buffer making the wait
+ unnecessary. The unnecessary wait is an inefficiency, but not really
+ a problem. But with USB CDC/ACM it can be a problem because the
+ entire TX buffer may be emptied when we lose the race. If that
+ happens that uart_putxmitchar() can hang waiting for data to be
+ removed from an empty TX buffer (2016-07-22).
+ * arch/arm/src/stm32 and stm32l4: STM32 F4/L4 RTC ALARM: were enabling
+ interrupts too early in the power-up sequence, BEFORE the interrupt
+ system was being initialized (2016-07-23).
+ * drivers/ioexpander: GPIO driver: Add support for receiving signals
+ from interrupt pins (2016-07-23).
+ * drivers/usbdev: USBMSC: Add locks when removing request from queue.
+ From Wolfgang Reissnegger (2016-07-23).
+ * drivers/usbdev: USBMSC: Fix reversed logic on waiting for SCSI thread
+ start. The scsi thread was waiting for the wrong condition. However,
+ this was masked by the fact that the code creating the scsi thread was
+ also holding usbmsc_scsi_lock(priv) while initializing data, hence
+ this lock synchronized the scsi thread start with init completion.
+ From Wolfgang Reissnegger (2016-07-23).
+ * arch/arm/src/sam34: SAM3/4 UDP: Fix handling of endpoint RX FIFO
+ banks. This fixes a race condition where the HW fills a FIFO bank
+ while the SW is busy, resulting in out of sequence USB packets
+ (2016-07-23).
+ * Freedom-K64F: Add PWM support. From Jordan MacIntyre (2016-07-25).
+
+
+7.18 2016-xx-xx Gregory Nutt
+
+ * drivers/serial/pty.c, serial.c, usbdev/cdcacm.c, include/nuttx/fs/ioctl.h:
+ Fix FIONWRITE and add FIONSPACE. All implementations of FIONWRITE
+ were wrong. FIONWRITE should return the number of bytes waiting in
+ the outgoing send queue, not the free space. Rather, FIONSPACE should
+ return the free space in the send queue (2016-07-25).
+ * lib_dumpbuffer: Now prints a large on-stack buffer first to avoid
+ problems when the syslog output is prefixed with time. From Pierre-
+ noel Bouteville (2016-07-27).
+ * sched/clock and sched/sched: Add standard adjtime() interface and
+ basic timekeeping support. Normally used with an NTP client to keep
+ system time in synchronizationi. From Max Neklyudov (Merged on
+ 20160-07-28).
+ * arch/arm/src/stm32: Add timekeeping support for the STM32 tickless
+ mode. From Max Neklyudov (Merged on 20160-07-28).
+ * Top-Level Makefiles. Fix a chicken-and-egg problem. In the menuconfig
+ target, the context dependency was executed before kconfig-mconf.
+ That was necessary because the link at apps/platform/board needed to
+ be set up before creating the apps/Kconfig file. Otherwise, the
+ platform Kconfig files would not be included. But this introduces
+ the chicken-and-egg problem in some configurations.
+ In particular: (1) An NX graphics configuration is used that requires
+ auto-generation of source files using cpp, (2) the configuration is
+ set for Linux, but (3) we are running under Cygwin with (4) a Windows
+ native toolchain. In this case, POSIX-style symbolic links are set
+ up but the Windows native toolchain cannot follow them.
+ The reason we are running 'make menuconfig' is to change from Linux
+ to Cygwin, but the target fails. During the context phase, NX runs
+ CPP to generate source files but that fails because the Windows native
+ toolchain cannot follow the links. Checkmate.
+ This was fixed by changing all of the make menuconfig (and related)
+ targets. They no longer depend on context being run. Instead, they
+ depend only on the dirlinks target. The dirlinks target only sets
+ up the directory links but does not try to run all of the context
+ setup; the compiler is never invoked; no code is autogeneraed; and
+ things work (2016-07-28).
+ * tools/refresh.sh: Recent complexities added to apps/ means that
+ configuration needs correct Make.defs file in place in order to
+ configure properly (2016-07-28).
+ * tools/kconfig2html.c: Update to handle absolute paths when sourcing
+ Kconfig files (2016-07-29).
+ * libc/math: This fixes the following libc/math issues: (1) asin[f l]()
+ use Newton’s method to converge on a solution. But Newton’s method
+ converges very slowly (> 500,000 iterations) for values of x close
+ to 1.0; and, in the case of asinl(), sometimes fails to converge
+ (loops forever). The attached patch uses an trig identity for
+ values of x > sqrt(2). The resultant functions converge in no more
+ than 5 iterations, 6 for asinl(). (2) The NuttX erf[f l]() functions
+ are based on Chebyshev fitting to a good guess. The problem there’s a
+ bug in the implementation that causes the functions to blow up with x
+ near -3.0. This patch fixes that problem. It should be noted that
+ this method returns the error function erf(x) with fractional error
+ less than 1.2E-07 and that’s fine for the float version erff(), but
+ the same method is used for double and long double version which
+ will yield only slightly better precision. This patch doesn't address
+ the issue of lower precision for erf() and erfl(). (3) a faster
+ version of copysignf() for floats is included. From David S. Alessio
+ (2016-07-30).
+ * I/O Expander: Remove hard-coded PCA9555 fields from ioexpander.h
+ definitons. Add support for an attach() method that may be used when
+ any subset of pin interrupts occur (2016-07-31).
+ * PCA9555 Driver: Replace the signalling logic with a simple callback
+ using the new definitons of ioexpander.h. This repartitioning of
+ functionality is necessary because (1) the I/O expander driver is the
+ lower-lower part of any driver that uses GPIOs (include the GPIO
+ driver itself) and should not be interacting directly with the much
+ higher level application layer. And (2) in order to be compatible
+ with the GPIO driver (and any arbitrary upper half driver), the
+ PCA9555 should not directly signal, but should call back into the
+ upper half. The upper half driver that interacts directly with the
+ application is the appropriate place to be generating signal
+ (2016-07-31).
+ * drivers/ioexpander/skeleton.c: Add a skeleton I/O Expander driver
+ (based on the PCA9555 driver) (2016-07-31).
+ * I/O Expander Interface: Encode and extend I/O expander options to
+ include interrupt configuration (2016-07-31).
+ * drivers/ioexpander: Add an (untested) TCA64XX I/O Expander driver
+ leveraged from Project Ara (2016-07-31).
+ * I/O Expander Interface: Add argument to interrupt callback. Add a
+ method to detach the interrupt (2016-08-01).
+ * drivers/ioexpander: Add a GPIO lower-half driver that can be used to
+ register a GPIO character driver for accessing pins on an I/O expander
+ (2016-08-01).
+ * drivers/ioexpander: Add PCF8574 I/O Expander driver. Some cleanup
+ also of other expander drivers (2016-08-01).
+ * drivers/ioexpander: GPIO driver: Add IOCTLs to get the pin type and
+ to unregister a signal handler (2016-08-01).
+ * configs/sim: Add simulator-based test support for apps/examples/gpio
+ 2016-08-01).
+ * drivers/sensors: Add KXJT9 Accelerometer driver from the Motorola
+ Moto Z MDK (2016-08-02).
diff --git a/Documentation/NuttShell.html b/Documentation/NuttShell.html
index 90e0764a791..1d284dbea7a 100644
--- a/Documentation/NuttShell.html
+++ b/Documentation/NuttShell.html
@@ -8,7 +8,7 @@
NuttShell (NSH)
- Last Updated: February 8, 2016
+ Last Updated: August 4, 2016
|
@@ -3277,7 +3277,7 @@ nsh>
mkfifo |
- CONFIG_NFILE_DESCRIPTORS > 0 |
+ CONFIG_NFILE_DESCRIPTORS > 0 && CONFIG_PIPES && CONFIG_DEV_FIFO_SIZE > 0 |
CONFIG_NSH_DISABLE_MKFIFO |
diff --git a/Documentation/NuttX.html b/Documentation/NuttX.html
index 83c42c61cfd..700876be653 100644
--- a/Documentation/NuttX.html
+++ b/Documentation/NuttX.html
@@ -8,7 +8,7 @@
NuttX RTOS
- Last Updated: June 1, 2016
+ Last Updated: July 25, 2016
|
@@ -389,9 +389,10 @@
|
- Inheritable "controlling terminals" and I/O re-direction.
+ Inheritable "controlling terminals" and I/O re-direction. Pseudo-terminals
+
|
|
@@ -1003,7 +1004,7 @@
|
|
- USB device controller drivers available for the PIC32, Atmel AVR, SAM3, SAM4, and SAMA5Dx, NXP LPC17xx, LPC214x, LPC313x, and LPC43xx, Silicon Laboraties EFM32, STMicro STM32 F1, F2, F3, and F4, and TI DM320.
+ USB device controller drivers available for the PIC32, Atmel AVR, SAM3, SAM4, SAMv7, and SAMA5Dx, NXP/Freescale LPC17xx, LPC214x, LPC313x, LPC43xx, and Kinetis, Silicon Laboraties EFM32, STMicro STM32 F1, F2, F3, F4, and F7, and TI DM320.
|
@@ -1340,11 +1341,11 @@
Released Versions
In addition to the ever-changing GIT repository, there are frozen released versions of NuttX available.
- The current release is NuttX 7.16.
- NuttX 7.16 is the 116th release of NuttX.
+ The current release is NuttX 7.17.
+ NuttX 7.17 is the 117th release of NuttX.
It was released on June 1, 2016, and is available for download from the
Bitbucket.org website.
- Note that the release consists of two tarballs: nuttx-7.16.tar.gz and apps-7.16.tar.gz.
+ Note that the release consists of two tarballs: nuttx-7.17.tar.gz and apps-7.17.tar.gz.
Both may be needed (see the top-level nuttx/README.txt file for build information).
@@ -1353,7 +1354,7 @@
- nuttx.
- Release notes for NuttX 7.16 are available here.
+ Release notes for NuttX 7.17 are available here.
Release notes for all released versions on NuttX are available in the Bitbucket GIT.
The ChangeLog for all releases of NuttX is available in the ChangeLog file that can viewed in the Bitbucket GIT.
The ChangeLog for the current release is at the bottom of that file.
@@ -1361,7 +1362,7 @@
apps.
Atmel AVR
Host PC based simulations
@@ -1578,6 +1580,7 @@
STMicro STM32F102x (STM32 F1 Family, ARM Cortex-M3)
STMicro STM32F103C4/C8 (STM32 F1 "Low- and Medium-Density Line" Family, ARM Cortex-M3)
STMicro STM32F103x (STM32 F1 Family, ARM Cortex-M3)
+ STMicro STM32F105x (ARM Cortex-M3)
STMicro STM32F107x (STM32 F1 "Connectivity Line" family, ARM Cortex-M3)
STMicro STM32F205x (STM32 F2 family, ARM Cortex-M3)
STMicro STM32F207x (STM32 F2 family, ARM Cortex-M3)
@@ -1598,6 +1601,7 @@
STMicro STM32 L476 (STM32 F4 family, ARM Cortex-M4)
STMicro STM32 F745/F746 (STM32 F7 family, ARM Cortex-M7)
STMicro STM32 F756 (STM32 F7 family, ARM Cortex-M7)
+ STMicro STM32 F76xx/F77xx (STM32 F7 family, ARM Cortex-M7)
Texas Instruments (some formerly Luminary)
@@ -1659,7 +1663,7 @@
STATUS:
Does not support interrupts but is otherwise fully functional.
- Refer to the NuttX README file for further information.
+ Refer to the NuttX README file for further information.
@@ -1684,7 +1688,7 @@
STATUS:
This port is complete, verified, and included in the initial NuttX release.
- Refer to the NuttX board README file for further information.
+ Refer to the NuttX board README file for further information.
@@ -1709,7 +1713,7 @@
This port was contributed by Denis Carilki and includes the work of Denis Carikli, Alan Carvalho de Assis, and Stefan Richter.
Calypso support first appeared in NuttX-6.17 with LCD drivers.
Support for the Calypso keyboard was added in NuttX-6.24 by Denis Carilki.
- Refer to the NuttX board README files for the Compal E88, Compal E99 and Pirelli DP-L10 phones for further information.
+ Refer to the NuttX board README files for the Compal E88, Compal E99 and Pirelli DP-L10 phones for further information.
@@ -1736,7 +1740,7 @@
timer interrupts, serial console, USB driver, and SPI-based MMC/SD card
support. A verified NuttShell (NSH)
configuration is also available.
- Refer to the NuttX board README files for the mcu123.com and for the ZPA213X/4XPA boards for further information.
+ Refer to the NuttX board README files for the mcu123.com and for the ZPA213X/4XPA boards for further information.
Development Environments:
@@ -1771,7 +1775,7 @@
The port is complete and verified.
As of NuttX 5.3, the port included only basic timer interrupts and serial console support.
In NuttX 7.1, Lizhuoyi contributed additional I2C and SPI drivers.
- Refer to the NuttX board README file for further information.
+ Refer to the NuttX board README file for further information.
Development Environments: (Same as for the NXP LPC214x).
@@ -1804,7 +1808,7 @@
SD cards).
An SPI-based ENC28J60 Ethernet driver for add-on hardware is available and
but has not been fully verified on the Olimex board (due to issues powering the ENC28J60 add-on board).
- Refer to the NuttX board README file for further information.
+ Refer to the NuttX board README file for further information.
Development Environments:
@@ -1836,7 +1840,7 @@
STATUS:
This port has stalled due to development tool issues.
Coding is complete on the basic port (timer, serial console, SPI).
- Refer to the NuttX board README file for further information.
+ Refer to the NuttX board README file for further information.
@@ -1865,7 +1869,7 @@
The basic port (timer interrupts, serial ports, network, framebuffer, etc.) is complete.
All implemented features have been verified with the exception of the USB device-side
driver; that implementation is complete but untested.
- Refer to the NuttX board README file for further information.
+ Refer to the NuttX board README file for further information.
@@ -1901,7 +1905,7 @@
However, as of this writing, I have not had the opportunity to verify this new feature.
- Refer to the Embedded Artists EA3131 board README file for further information.
+ Refer to the Embedded Artists EA3131 board README file for further information.
@@ -1917,7 +1921,7 @@
NOTE: That driver should work on the EA3131 as well. However, the EA3131 uses a PCA9532 PWM part to controller the port power so the it would not quite be a simple drop-in.
- Refer to the Olimex LPC-H3131 board README file for further information.
+ Refer to the Olimex LPC-H3131 board README file for further information.
@@ -1945,7 +1949,7 @@
At this point, verification of the EA3152 port has been overcome by events and
may never happen.
However, the port is available for anyone who may want to use it.
- Refer to the NuttX board README file for further information.
+ Refer to the NuttX board README file for further information.
@@ -2137,7 +2141,7 @@
NuttX-7.4 added support for the on-board WM8904 CODEC chip and for Tickless operation.
- Refer to the NuttX board README file for further information.
+ Refer to the NuttX board README file for further information.
@@ -2158,7 +2162,7 @@
The SAMA5D3 Xplained board does not have NOR FLASH and, as a consequence NuttX must boot into SDRAM with the help of U-Boot.
- Refer to the NuttX board README file for further information.
+ Refer to the NuttX board README file for further information.
@@ -2189,7 +2193,7 @@
The TM7000 LCDC with the maXTouch multi-touch controller are also fully support in a special NxWM configuration for that larger display.
Support for a graphics media player is included (although there were issues with the WM8904 audio CODEC on my board).
An SRAM bootloader was also included.
- Refer to the NuttX board README file for current status.
+ Refer to the NuttX board README file for current status.
@@ -2232,7 +2236,7 @@
This port was developed on the v1 board, but the others may be compatible:
- Refer to the NuttX board README file for further information.
+ Refer to the NuttX board README file for further information.
STATUS.
@@ -2264,7 +2268,7 @@
Sabre-6Quad.
This is a port to the NXP/Freescale Sabre-6Quad board.
- Refer to the NuttX board README file for further information.
+ Refer to the NuttX board README file for further information.
STATUS:
@@ -2274,7 +2278,7 @@
Basic support of NuttX running in SMP mode on the i.MX6Q was also accomplished in NuttX-7.16.
- However, there are still known issues with SMP support on this platform as described in the README file for the board.
+ However, there are still known issues with SMP support on this platform as described in the README file for the board.
@@ -2298,13 +2302,13 @@
STATUS.
This is currently in progress but the effort is stalled due to tool-related issues.
- Refer to the NuttX board README file for further information.
+ Refer to the NuttX board README file for further information.
Toolchain:
The TMS570 is a big-endian ARM platform and requires a big-endian ARM toolchain.
All testing has been performed using a big-endian NuttX buildroot toolchain.
- Instructions for building this toolchain are included in the board README file.
+ Instructions for building this toolchain are included in the board README file.
@@ -2329,7 +2333,7 @@
This initial support is very minimal:
There is a NuttShell (NSH) configuration that might be the basis for an application development.
As of this writing, more device drivers are needed to make this a more complete port.
- Refer to the NuttX board README file for further information.
+ Refer to the NuttX board README file for further information.
Memory Usage.
@@ -2393,7 +2397,7 @@ nsh>
As of NuttX-6.28 more device driver development would be needed to make this a complete port, particularly to support USB OTG.
A TSI and a SPI driver were added in NuttX-6.29.
Alan contributed a PWM driver in NuttX-6.32.
- Refer to the Freedom KL25Z board README file for further information.
+ Refer to the Freedom KL25Z board README file for further information.
@@ -2407,7 +2411,7 @@ nsh>
STATUS.
This is the work of Michael Hope.
Verified, initial support for the Teensy-LC first appeared in NuttX-7.10.
- Refer to the Teensy-LC board README file for further information.
+ Refer to the Teensy-LC board README file for further information.
@@ -2431,7 +2435,7 @@ nsh>
This work was contributed in NuttX 7.8 by Derek B. Noonburg.
The board support is very similar to the Freedom-KL25Z.
It was decided to support this a a separate board, however, due to some small board-level differences.
- Refer to the Freedom KL26Z board README file for further information.
+ Refer to the Freedom KL26Z board README file for further information.
@@ -2454,7 +2458,7 @@ nsh>
The initial SAMD20 Xplained Pro release (NuttX 7.1) included a functional NuttShell (NSH) configuration.
An SPI driver was also included to support the OLED1 and I/O1 modules.
That SPI driver, however, was not completed verified due to higher priority tasks that came up (I hope to get back to this later).
- Refer to the SAMD20 Explained Pro board README file for further information.
+ Refer to the SAMD20 Explained Pro board README file for further information.
@@ -2478,7 +2482,7 @@ nsh>
Initial support for the SAML21 Xplained Pro was release in the NuttX 7.10.
This initial support included a basic configuration for the NuttShell (NSH)
(see the NSH User Guide).
- Refer to the SAML21 Explained Pro board README file for further information.
+ Refer to the SAML21 Explained Pro board README file for further information.
@@ -2500,7 +2504,7 @@ nsh>
STATUS:
The first released version was provided in NuttX 7.10.
- Refer to the board README.txt file for further information.
+ Refer to the board README.txt file for further information.
@@ -2541,7 +2545,7 @@ nsh>
STATUS:
This port was was released in NuttX 6.14.
- Refer to the NuttX board README file for further information.
+ Refer to the NuttX board README file for further information.
@@ -2565,7 +2569,7 @@ nsh>
The current port includes timer, serial console, Ethernet, SSI, and microSD support.
There are working configurations to run the NuttShell
(NSH), the NuttX networking test, and the uIP web server.
- Refer to the NuttX board README file for further information.
+ Refer to the NuttX board README file for further information.
@@ -2605,7 +2609,7 @@ nsh>
NOTE: As it is configured now, you MUST have a network connected.
Otherwise, the NSH prompt will not come up because the Ethernet
driver is waiting for the network to come up.
- Refer to the NuttX board README file for further information.
+ Refer to the NuttX board README file for further information.
@@ -2631,7 +2635,7 @@ nsh>
STATUS:
This port was released in NuttX 5.10.
Features are the same as with the Eagle-100 LM3S6918 described above.
- Refer to the NuttX board README file for further information.
+ Refer to the NuttX board README file for further information.
@@ -2648,7 +2652,7 @@ nsh>
Header file support was contributed by Tiago Maluta for this part.
Jose Pablo Rojas V. is used those header file changes to port NuttX to the TI/Stellaris EKK-LM3S9B96.
That port was available in the NuttX-6.20 release.
- Refer to the NuttX board README file for further information.
+ Refer to the NuttX board README file for further information.
@@ -2691,7 +2695,7 @@ nsh>
DMA and USART-based SPI supported are included, but not fully tested.
- Refer to the EFM32 Gecko Starter Kit README.txt file for further information.
+ Refer to the EFM32 Gecko Starter Kit README.txt file for further information.
@@ -2715,7 +2719,7 @@ nsh>
The board suppport is complete but untested because of tool-related issues. An OpenOCD compatible, SWD debugger would be required to make further progress in testing.
- Refer to the Olimex EFM32G880F120-STK README.txt for further information.
+ Refer to the Olimex EFM32G880F120-STK README.txt for further information.
@@ -2810,7 +2814,7 @@ nsh>
This initial support includes a configuration using the NuttShell (NSH) that might be the basis for an application development.
A driver for the on-board segment LCD is included as well as an option to drive the segment LCD from an NSH "built-in" command.
As of this writing, a few more things are needed to make this a more complete port: 1) Verfication of more device drivers (timers, quadrature encoders, PWM, etc.), and 2) logic that actually uses the low-power consumption modes of the EnergyLite part.
- Refer to the NuttX board README file for further information.
+ Refer to the NuttX board README file for further information.
Memory Usage.
@@ -2877,7 +2881,7 @@ nsh>
STM32VL-Discovery.
In NuttX-6.33, support for the STMicro STM32VL-Discovery board was contributed by Alan Carvalho de Assis.
The STM32VL-Discovery board features an STM32F100RB MCU.
- Refer to the NuttX board README file for further information.
+ Refer to the NuttX board README file for further information.
@@ -2933,7 +2937,7 @@ nsh>
The basic STM32F103C8 port was released in NuttX version 6.28.
This work was contributed by Laurent Latil.
- Refer to the NuttX board README file for further information.
+ Refer to the NuttX board README file for further information.
@@ -2958,21 +2962,21 @@ nsh>
STM3210E-EVAL.
A port for the STMicro STM3210E-EVAL development board that
features the STM32F103ZET6 MCU.
- Refer to the NuttX board README file for further information.
+ Refer to the NuttX board README file for further information.
HY-Mini STM32v board.
This board is based on the STM32F103VCT chip. Port contributed by Laurent Latil.
- Refer to the NuttX board README file.
+ Refer to the NuttX board README file.
The M3 Wildfire development board (STM32F103VET6), version 2.
See http://firestm32.taobao.com (the current board is version 3).
- Refer to the NuttX board README file for further information.
+ Refer to the NuttX board README file for further information.
@@ -2980,7 +2984,7 @@ nsh>
LeafLab's Maple and Maple Mini boards.
These boards are based on the STM32F103RBT6 chip for the standard version and on the STM32F103CBT6 for the mini version.
See the LeafLabs web site for hardware information;
- see the NuttX board README file for further information about the NuttX port.
+ see the NuttX board README file for further information about the NuttX port.
@@ -2989,7 +2993,7 @@ nsh>
The Spark boards are based on the STM32F103CBT6 chip and feature wireless networking using the TI CC3000 WLAN module.
See the Spark web site for hardware information;
The emulated Spark is a base board for the Maple Mini board (see above) developed by David Sidrane that supports Spark development while we all way breathlessly for or Spark boards.
- see the NuttX board README file for further information about the NuttX port.
+ see the NuttX board README file for further information about the NuttX port.
Initially Spark support was introduced in NuttX 6.31 and completed in NuttX 6.32.
@@ -3078,6 +3082,20 @@ nsh>
|
|
+
+
|
+
+
+ STMicro STM32F105x.
+ Architecture support (only) for the STM32 F105R was contribed in NuttX-7.17 by Konstantin Berezenko.
+ There is currently no support for boards using any STM32F105x parts in the source tree.
+
+ |
+
+
+
|
+
|
+
|
@@ -3110,7 +3128,7 @@ nsh>
(1) Basic Cortex-M3 port,
(2) Ethernet,
(3) On-board LEDs.
- Refer to the NuttX board README file for further information.
+ Refer to the NuttX board README file for further information.
@@ -3137,7 +3155,7 @@ nsh>
STATUS:
Networking and touchscreen support are well test.
But, at present, neither USB nor LCD functionality have been verified.
- Refer to the SViewtool STM32F103/F107 README file for further information.
+ Refer to the SViewtool STM32F103/F107 README file for further information.
|
@@ -3181,7 +3199,7 @@ nsh>
STATUS:
The peripherals of the STM32 F2 family are compatible with the STM32 F4 family.
See discussion of the STM3240G-EVAL board below for further information.
- Refer also to the NuttX board README file for further information.
+ Refer also to the NuttX board README file for further information.
Support for both the IAR and uVision GCC IDEs added for the STM3220G-EVAL board in NuttX 7.16.
@@ -3219,7 +3237,7 @@ nsh>
Subsequent NuttX releases will extend this port and add support for the SDIO-based SD cards and
USB device.
- Refer to the NuttX board README file for further information about this port.
+ Refer to the NuttX board README file for further information about this port.
@@ -3249,7 +3267,7 @@ nsh>
STATUS:
As of this writing, the basic port is code complete and a fully verified configuration exists for the NuttShell NSH).
The first fully functional Arduino Due port was released in NuttX-6.29.
- Refer to the NuttX board README file for further information.
+ Refer to the NuttX board README file for further information.
@@ -3341,7 +3359,7 @@ nsh>
-
Support for the mbed board was contributed by Dave Marples and released in NuttX-5.11.
- Refer to the NuttX board README file for further information.
+ Refer to the NuttX board README file for further information.
@@ -3365,7 +3383,7 @@ nsh>
The NuttX-5.17 released added support for low-speed USB devices, interrupt endpoints, and a USB host HID keyboard class driver.
- Refer to the NuttX board README file for further information.
+ Refer to the NuttX board README file for further information.
@@ -3384,7 +3402,7 @@ nsh>
An fully verified board configuration is included in NuttX-6.2.
The Code Red toolchain is supported under either Linux or Windows.
Verified configurations include DHCPD, the NuttShell (NSH), NuttX graphis (NX), THTTPD, and USB mass storage device.
- Refer to the NuttX board README file for further information.
+ Refer to the NuttX board README file for further information.
@@ -3395,7 +3413,7 @@ nsh>
The initial release was included NuttX-6.26.
The Nuttx Buildroot toolchain is used by default.
Verifed configurations include the "Hello, World!" example application and a THTTPD demonstration.
- Refer to the NuttX board README file for further information.
+ Refer to the NuttX board README file for further information.
@@ -3403,7 +3421,7 @@ nsh>
This board configuration was contributed and made available in NuttX-6.20.
As contributed board support, I am unsure of what all has been verfied and what has not.
- See the Microment website Lincoln60 board and the NuttX board README file for further information about the Lincoln board.
+ See the Microment website Lincoln60 board and the NuttX board README file for further information about the Lincoln board.
@@ -3411,7 +3429,7 @@ nsh>
This board configuration was contributed by Vladimir Komendantskiy and made available in NuttX-7.15.
This is a variant of the LPCXpresso LPC1768 board support with special provisions for the U-Blox Model Evaluation board.
- See the NuttX board README file for further information about this port.
+ See the NuttX board README file for further information about this port.
@@ -3446,7 +3464,7 @@ nsh>
The NSH configuration includes verified support for a DMA-based SD card interface.
The frame-buffer LCD driver is functional and uses the SDRAM for frame-buffer memory.
A touchscreen interface has been developed but there appears to be a hardware issue with the WaveShare implementation of the XPT2046 touchscreen controller.
- Refer to the NuttX board README file for further information.
+ Refer to the NuttX board README file for further information.
@@ -3469,7 +3487,7 @@ nsh>
STATUS:
- Refer to the Teensy-3.1 board README file for further information.
+ Refer to the Teensy-3.1 board README file for further information.
@@ -3497,7 +3515,7 @@ nsh>
(2) bring up the NuttShell NSH, (3) develop support for the SDHC-based SD card,
(4) develop support for USB host and device, and (2) develop an LCD driver.
NOTE: Some of these remaining tasks are shared with the K60 work described below.
- Refer to the NuttX board README file for further information.
+ Refer to the NuttX board README file for further information.
@@ -3522,12 +3540,7 @@ nsh>
An additional, validated configuration exists for the NuttShell (NSH, see the
NSH User Guide).
This basic TWR-K60N512 first appeared in NuttX-6.8.
- Ethernet and SD card (SDHC) drivers also exist:
- The SDHC driver is partially integrated in to the NSH configuration but has some outstanding issues.
- the Ethernet driver became stable in NuttX-7.14 thanks to the efforts of Andrew Webster.
- Additional work remaining includes: (1) integrate th SDHC drivers, and (2) develop support for USB host and device.
- NOTE: Most of these remaining tasks are the same as the pending K40 tasks described above.
- Refer to the NuttX board README file for further information.
+ Refer to the NuttX board README file for further information.
@@ -3536,6 +3549,43 @@ nsh>
+
+
|
+
+
+ FreeScale Kinetis K64.
+ Support for the Kinetis K64 family and specifically for the NXP/Freescale Freedom K64F board was added in NuttX 7.17.
+ Initial release includes two NSH configurations with support for on-board LEDs, buttons, and Ethernet with the on-board KSZ8081 PHY.
+ SDHC supported has been integrated, but not verified.
+ Refer to the NuttX board README file for further information.
+
+ |
+
+
+
|
+
+
+ Driver Status.
+
+
+ -
+ NuttX-6.8.
+ Ethernet and SD card (SDHC) drivers also exist:
+ The SDHC driver is partially integrated in to the NSH configuration but has some outstanding issues.
+ Additional work remaining includes: (1) integrate th SDHC drivers, and (2) develop support for USB host and device.
+ NOTE: Most of these remaining tasks are the same as the pending K40 tasks described above.
+
+ -
+ NuttX-7.14.
+ The Ethernet driver became stable in NuttX-7.14 thanks to the efforts of Andrew Webster.
+
-
+ NuttX-7.17.
+ Ethernet support was extended and verified on the Freedom K64F.
+ A Kinetis USB device controller driver and PWM support was contributed by kfazz.
+
+
+ |
+
|
|
@@ -3577,7 +3627,7 @@ nsh>
The basic port for the STM32F3-Discover was first released in NuttX-6.26.
Many of the drivers previously released for the STM32 F1, Value Line, and F2 and F4 may be usable on this platform as well.
New drivers will be required for ADC and I2C which are very different on this platform.
- Refer to the NuttX board README file for further information.
+ Refer to the NuttX board README file for further information.
@@ -3632,7 +3682,7 @@ nsh>
NuttX-7.2
The basic port for STMicro Nucleo F401RE board was contributed by Frank Bennett.
- Refer to the NuttX board README file for further information.
+ Refer to the NuttX board README file for further information.
@@ -3685,7 +3735,7 @@ nsh>
Support for the Olimex STM32 H405 board was added in NuttX-7.3.
- Refer to the NuttX board README file for further information.
+ Refer to the NuttX board README file for further information.
@@ -3716,7 +3766,7 @@ nsh>
STATUS:
The basic port for the STM32F4-Discovery was contributed by Mike Smith and was first released in NuttX-6.14.
All drivers listed for the STM3240G-EVAL are usable on this platform as well.
- Refer to the NuttX board README file for further information.
+ Refer to the NuttX board README file for further information.
@@ -3733,7 +3783,7 @@ nsh>
Battery connect and batter charger circuit.
- See the Mikroelektronika website for more information about this board and the NuttX board README file for further information about the NuttX port.
+ See the Mikroelektronika website for more information about this board and the NuttX board README file for further information about the NuttX port.
@@ -3745,12 +3795,17 @@ nsh>
Olimex STM32 H405.
Support for the Olimex STM32 H405 development board was contributed by Martin Lederhilger and appeared in NuttX-7.3.
- See the NuttX board README file for further information about the NuttX port.
+ See the NuttX board README file for further information about the NuttX port.
Olimex STM32 H407.
Support for the Olimex STM32 H407 development board was contributed by Neil Hancock and appeared in NuttX-7.14.
- See the NuttX board README file for further information about the NuttX port.
+ See the NuttX board README file for further information about the NuttX port.
+
+
+ Olimex STM32 E407.
+ Support for the Olimex STM32 E407 development board was contributed by Mateusz Szafoni and appeared in NuttX-7.17.
+ See the NuttX board README file for further information about the NuttX port.
@@ -3808,7 +3863,7 @@ nsh>
- Refer to the STM32F429I-Discovery board README file for further information.
+ Refer to the STM32F429I-Discovery board README file for further information.
@@ -3857,13 +3912,13 @@ nsh>
Nucleo-L476RG.
- Board support for the STMicro NucleoL476RG board from ST Micro was contributed by Sebastien Lorquet in NuttX-7.15. See the STMicro website and the board README file for further information.
+ Board support for the STMicro NucleoL476RG board from ST Micro was contributed by Sebastien Lorquet in NuttX-7.15. See the STMicro website and the board README file for further information.
STM32L476VG Discovery.
- Board support for the STMicro STM32L476VG Discovery board from ST Micro was contributed by Dave in NuttX-7.15. See the STMicro website and the board README file for further information.
+ Board support for the STMicro STM32L476VG Discovery board from ST Micro was contributed by Dave in NuttX-7.15. See the STMicro website and the board README file for further information.
@@ -3912,42 +3967,15 @@ nsh>
-
STATUS:
- Refer to the NuttX board README file for more detailed information about this port.
+ Refer to the NuttX board README file for more detailed information about this port.
-
NuttX-6.20
- The basic port is complete.
+ The basic LPC4330-Xplorer port is complete.
The basic NuttShell (NSH) configuration is present and fully verified.
This includes verified support for: SYSTICK system time, pin and GPIO configuration, and a serial console.
-
- Several drivers have been copied from the related LPC17xx port but require integration into the LPC43xx: ADC, DAC, GPDMA, I2C, SPI, and SSP.
- The registers for these blocks are the same in both the LPC43xx and the LPC17xx and they should integrate into the LPC43xx very easily by simply adapting the clocking and pin configuration logic.
-
-
- Other LPC17xx drivers were not brought into the LPC43xx port because these peripherals have been completely redesigned: CAN, Ethernet, USB device, and USB host.
-
-
- So then there is no support for the following LPC43xx peripherals: SD/MMC, EMC, USB0,USB1, Ethernet, LCD, SCT, Timers 0-3, MCPWM, QEI, Alarm timer, WWDT, RTC, Event monitor, and CAN.
-
-
- Some of these can be leveraged from other MCUs that appear to support the same peripheral IP:
-
-
- -
- The LPC43xx USB0 peripheral appears to be the same as the USB OTG peripheral for the LPC31xx.
- The LPC31xx USB0 device-side driver has been copied from the LPC31xx port but also integration into the LPC43xx (clocking and pin configuration).
- It should be possible to complete porting of this LPC31xx driver with a small porting effort.
-
- -
- The Ethernet block looks to be based on the same IP as the STM32 Ethernet and, as a result, it should be possible to leverage the NuttX STM32 Ethernet driver with a little more effort.
-
-
-
- -
-
NuttX-6.21
- Added support for a SPIFI block driver and for RS-485 option to the serial driver.
@@ -3959,7 +3987,7 @@ nsh>
@@ -4335,7 +4405,7 @@ Mem: 29232 5920 23312 23312
A new Ethernet MAC driver has been developed and is functional in the NSH configuration.
A DMA-base SPI driver is supported and has been verified with the AT25 Serial FLASH.
The SAM4E-EK should be compatible with most of the other SAM3/4 drivers (like HSMCI, DMAC, etc.) but those have not be verified on the SAM4E-EK as of this writing.
- Refer to the NuttX board README file for further information.
+ Refer to the NuttX board README file for further information.
@@ -4421,7 +4491,7 @@ Mem: 29232 5920 23312 23312
RSWDT driver.
- Refer to the NuttX board README file for further information.
+ Refer to the NuttX board README file for further information.
@@ -4438,7 +4508,7 @@ Mem: 29232 5920 23312 23312
This port uses Atmel SAM E70 Xplained Evaluation Kit (ATSAME70-XPLD).
This board is essentially a lower cost version of the SAMV71-XULT board featuring the ATSAME70Q21 Cortex-M7 microcontroller.
See the Atmel SAMV71 for supported features.
- Also refer to the NuttX board README file for further information.
+ Also refer to the NuttX board README file for further information.
@@ -4461,24 +4531,39 @@ Mem: 29232 5920 23312 23312
A basic port for the Nucleo-144 board with the STM32F746ZG MCU was contribued in NuttX-7.16 by Kconstantin Berezenko.
+
+ STATUS:
+
+
+
+ The basic STM32F746G-DISCO port is complete and there are two, verified configurations available.
+ Both configurations use the NuttShell (NSH) and a serial console; one includes Ethernet support.
+ The first release of the STM32F746G_DISCO port was available in NuttX-7.11.
+
+
+ Refer to the NuttX board README file for further information.
+
+
- STATUS:
+ STM32 F7 Driver Status:
-
- The basic STM32F746G-DISCO port is complete and there are two, verified configurations available.
- Both configurations use the NuttShell (NSH) and a serial console; one includes Ethernet support.
- DMA supports is available.
- The STM32 F7 peripherals are very similar to some members of the STM32 F4 and additional drivers can easily be ported the F7 as discussed in this Wiki page: Porting Drivers to the STM32 F7
- The first release of the STM32F746G_DISCO port was available in NuttX-7.11.
-
-
- Refer to the NuttX board README file for further information.
-
+ -
+
NuttX-7.11.
+ Serial driver and Ethernet driver support, along with DMA support, were available availabe in this initial release.
+ The STM32 F7 peripherals are very similar to some members of the STM32 F4 and additional drivers can easily be ported the F7 as discussed in this Wiki page: Porting Drivers to the STM32 F7
+
+
+ -
+
NuttX-7.17.
+ Davide Sidrane contributed PWR, RTC, BBSRAM, and DBGMCU support.
+ Lok Tep contribed SPI, I2c, ADC, SDMMC, and USB device driver support.
+
+
|
|
@@ -4490,9 +4575,38 @@ Mem: 29232 5920 23312 23312
STMicro STM32 F756.
Architecture-only support is available for the STM32 F756 family (meaning that the parts are supported, but there is not example board supported in the system).
This support was made available in NuttX-7.11.
+ See above for STM32 F7 driver availability.
+
+
+
|
+
|
+
+
+
|
+
+
+ STMicro STM32 F76xx/F77xx.
+ Architecture support for the STM32 F76xx and F77xx families was contributed by David Sidrane in NuttX 7.17. Support is available for one board from this family:
+
+
+
+ See above for STM32 F7 driver availability.
+
+ |
+
+
|
|
@@ -4530,14 +4644,14 @@ Mem: 29232 5920 23312 23312
STATUS:
Work on this port has stalled due to toolchain issues. Complete, but untested code for this port appears in the NuttX 6.5 release.
- Refer to the NuttX board README file for further information.
+ Refer to the NuttX board README file for further information.
LowPowerLab MoteinoMEGA.
This port of NuttX to the MoteinoMEGA from LowPowerLab.
The MoteinoMEGA is based on an Atmel ATMega1284P.
- See the LowPowerlab website and the board README file for further information.
+ See the LowPowerlab website and the board README file for further information.
@@ -4554,7 +4668,7 @@ Mem: 29232 5920 23312 23312
STATUS:
The basic port was released in NuttX-7.14 including a simple "Hello, World!" and OS test configurations.
Extensive effort was made to the use the special capabilities of the Atmel Studio AVR compiler to retain strings in FLASH memory and so keep the SRAM memory usage to a minimum.
- Refer to the NuttX board README file for further information.
+ Refer to the NuttX board README file for further information.
@@ -4584,7 +4698,7 @@ Mem: 29232 5920 23312 23312
The basic port was released in NuttX-6.5. This basic port consists only of
a "Hello, World!!" example that demonstrates initialization of the OS,
creation of a simple task, and serial console output.
- Refer to the NuttX board README file for further information.
+ Refer to the NuttX board README file for further information.
@@ -4606,7 +4720,7 @@ Mem: 29232 5920 23312 23312
An SPI driver and a USB device driver exist for the AT90USB as well
as a USB mass storage configuration. However, this configuration is not
fully debugged as of the NuttX-6.5 release.
- Refer to the NuttX board README file for further information.
+ Refer to the NuttX board README file for further information.
@@ -4699,7 +4813,7 @@ Mem: 29232 5920 23312 23312
The basic, port was be released in NuttX-5.13.
A complete port will include drivers for additional AVR32 UC3 devices -- like SPI and USB --- and will be available in a later release,
time permitting.
- Refer to the NuttX board README file for further information.
+ Refer to the NuttX board README file for further information.
@@ -4736,7 +4850,7 @@ Mem: 29232 5920 23312 23312
However, testing has not yet begun due to issues with BDMs, Code Warrior, and
the paging in the build process.
Progress is slow, but I hope to see a fully verified MC9S12NE64 port in the near future.
- Refer to the NuttX board README files for DEMO9S12NE64 and for the NE64 /PoE Badge for further information.
+ Refer to the NuttX board README files for DEMO9S12NE64 and for the NE64 /PoE Badge for further information.
@@ -4763,7 +4877,7 @@ Mem: 29232 5920 23312 23312
The port is reported to be functional on the Bifferboard as well.
In NuttX 7.1, Lizhuoyi contributed additional keyboard and VGA drivers.
This is a great, stable starting point for anyone interest in fleshing out the x86 port!
- Refer to the NuttX README file for further information.
+ Refer to the NuttX README file for further information.
@@ -4791,7 +4905,7 @@ Mem: 29232 5920 23312 23312
This initial port of NuttX to RGMP was provided in NuttX-6.3.
This initial RGP port provides only minimal driver support and does not use the native NuttX interrupt system.
This is a great, stable starting point for anyone interest in working with NuttX under RGMP!
- Refer to the NuttX README file for further information.
+ Refer to the NuttX README file for further information.
@@ -4822,7 +4936,7 @@ Mem: 29232 5920 23312 23312
The PGA117, however, is not yet fully integrated to support ADC sampling.
See the NSH User Guide for further information about NSH.
The first verified port to the Mirtoo module was available with the NuttX 6.20 release.
- Refer to the NuttX board README file for further information.
+ Refer to the NuttX board README file for further information.
@@ -4856,7 +4970,7 @@ Mem: 29232 5920 23312 23312
An untested USB device-side driver is available in the source tree.
A more complete port would include support of the USB OTG port and of the LCD display on this board.
Those drivers are not yet available as of this writing.
- Refer to the NuttX board README file for further information.
+ Refer to the NuttX board README file for further information.
@@ -4872,7 +4986,7 @@ Mem: 29232 5920 23312 23312
STATUS:
The basic port is code complete and fully verified in NuttX 6.13.
Available configurations include the NuttShell (NSH - see the NSH User Guide).
- Refer to the NuttX board README file for further information.
+ Refer to the NuttX board README file for further information.
UBW32 Board from Sparkfun
This is the port to the Sparkfun UBW32 board.
@@ -4885,7 +4999,7 @@ Mem: 29232 5920 23312 23312
The basic port is code complete and fully verified in NuttX 6.18.
Available configurations include the NuttShell (NSH - see the NSH User Guide).
USB has not yet been fully tested but on first pass appears to be functional.
- Refer to the NuttX board README file for further information.
+ Refer to the NuttX board README file for further information.
@@ -4916,7 +5030,7 @@ Mem: 29232 5920 23312 23312
A verified configuration is available for the NuttShel (NSH) appeared in NuttX-6.16.
Board support includes a verified USB (device-side) driver.
Also included are a a verified Ethernet driver, a partially verified USB device controller driver, and an unverifed SPI driver.
- Refer to the NuttX board README file for further information.
+ Refer to the NuttX board README file for further information.
Mikroelektronika PIC32MX7 Mulitmedia Board (MMB).
A port has been completed for the Mikroelektronika PIC32MX7 Multimedia Board (MMB).
@@ -4939,7 +5053,7 @@ Mem: 29232 5920 23312 23312
However, additional verification and tuning of this driver is required.
Further display/touchscreen verification would require C++ support (for NxWidgets and NxWM).
Since I there is no PIC32 C++ is the free version of the MPLAB C32 toolchain, further graphics development is stalled.
- Refer to the NuttX board README file for further information.
+ Refer to the NuttX board README file for further information.
@@ -5010,7 +5124,7 @@ Mem: 29232 5920 23312 23312
Ethernet (code complete, but not yet functional),
- Refer to the NuttX board README file for further information.
+ Refer to the NuttX board README file for further information.
@@ -5056,7 +5170,7 @@ Mem: 29232 5920 23312 23312
(which has very limit SH-1 support to begin with), or perhaps with the CMON debugger.
At any rate, I have exhausted all of the energy that I am willing to put into this cool
old processor for the time being.
- Refer to the NuttX board README file for further information.
+ Refer to the NuttX board README file for further information.
@@ -5093,7 +5207,7 @@ BFD_ASSERT (*plt_offset != (bfd_vma) -1);
No workaround is known at this time. This is a show stopper for M16C.
- Refer to the NuttX board README file for further information.
+ Refer to the NuttX board README file for further information.
@@ -5120,7 +5234,7 @@ BFD_ASSERT (*plt_offset != (bfd_vma) -1);
The initial release of support for the z16f was made available in NuttX version 0.3.7.
A working NuttShell (NSH) configuration as added in NuttX-6.33 (although a patch is required to work around an issue with a ZDS-II 5.0.1 tool problem).
An ESPI driver was added in NuttX-7.2.
- Refer to the NuttX board README file for further information.
+ Refer to the NuttX board README file for further information.
@@ -5155,7 +5269,7 @@ BFD_ASSERT (*plt_offset != (bfd_vma) -1);
The first integrated version was released in NuttX version 0.4.2 (with important early bugfixes
in 0.4.3 and 0.4.4).
As of this writing, that port provides basic board support with a serial console, SPI, and eZ80F91 EMAC driver.
- Refer to the NuttX board README files for the ez80f0910200kitg and ez80f910200zcofile for further information.
+ Refer to the NuttX board README files for the ez80f0910200kitg and ez80f910200zcofile for further information.
@@ -5186,7 +5300,7 @@ BFD_ASSERT (*plt_offset != (bfd_vma) -1);
STATUS:
This release has been verified only on the ZiLOG ZDS-II Z8Encore! chip simulation
as of nuttx-0.3.9.
- Refer to the NuttX board README files for the z8encore000zco and for thez8f64200100kit for further information.
+ Refer to the NuttX board README files for the z8encore000zco and for thez8f64200100kit for further information.
@@ -5215,7 +5329,7 @@ BFD_ASSERT (*plt_offset != (bfd_vma) -1);
Most of the NuttX is in port for both the Z80182 and for the P112 board.
Boards from Kickstarter project will not be available, however, until the third quarter of 2013.
So it will be some time before this port is verified on hardware.
- Refer to the NuttX board README file for further information.
+ Refer to the NuttX board README file for further information.
@@ -5240,7 +5354,7 @@ BFD_ASSERT (*plt_offset != (bfd_vma) -1);
STATUS:
This port is complete and stable to the extent that it can be tested
using an instruction set simulator.
- Refer to the NuttX board README file for further information.
+ Refer to the NuttX board README file for further information.
@@ -5264,7 +5378,7 @@ BFD_ASSERT (*plt_offset != (bfd_vma) -1);
STATUS:
Basically the same as for the Z80 instruction set simulator.
This port was contributed by Jacques Pelletier.
- Refer to the NuttX board README file for further information.
+ Refer to the NuttX board README file for further information.
diff --git a/Documentation/NuttxPortingGuide.html b/Documentation/NuttxPortingGuide.html
index d36ca6f2104..bf32596fef0 100644
--- a/Documentation/NuttxPortingGuide.html
+++ b/Documentation/NuttxPortingGuide.html
@@ -4439,7 +4439,7 @@ void board_autoled_off(int led);
- Interface Definition.
- The header file for the NuttX PWM driver reside at
include/nuttx/pwm.h.
+ The header file for the NuttX PWM driver reside at include/nuttx/drivers/pwm.h.
This header file includes both the application level interface to the PWM driver as well as the interface between the "upper half" and "lower half" drivers.
The PWM module uses a standard character driver framework.
However, since the PWM driver is a devices control interface and not a data transfer interface,
@@ -4472,7 +4472,7 @@ void board_autoled_off(int led);
- Interface Definition.
- The header file for the NuttX CAN driver reside at
include/nuttx/can.h.
+ The header file for the NuttX CAN driver resides at include/nuttx/drivers/can.h.
This header file includes both the application level interface to the CAN driver as well as the interface between the "upper half" and "lower half" drivers.
The CAN module uses a standard character driver framework.
diff --git a/Kconfig b/Kconfig
index c174c16e4cb..31f6f54629c 100644
--- a/Kconfig
+++ b/Kconfig
@@ -339,10 +339,10 @@ config ARCH_MATH_H
default n
---help---
There is also a re-directing version of math.h in the source tree.
- However, it resides out-of-the-way at include/nuttx/math.h because it
+ However, it resides out-of-the-way at include/nuttx/lib/math.h because it
conflicts too often with the system math.h. If ARCH_MATH_H=y is
defined, however, the top-level makefile will copy the redirecting
- math.h header file from include/nuttx/math.h to include/math.h. math.h
+ math.h header file from include/nuttx/lib/math.h to include/math.h. math.h
will then include the architecture-specific version of math.h that you
must provide at nuttx/arch/>architecture/include/stdarg.h
If ARCH_STDARG_H=y is defined, the top-level makefile will copy the
- re-directing stdarg.h header file from include/nuttx/stdarg.h to
+ re-directing stdarg.h header file from include/nuttx/lib/stdarg.h to
include/stdarg.h. So for the architectures that cannot use their
toolchain's stdarg.h file, they can use this alternative by defining
ARCH_STDARG_H=y and providing. If ARCH_STDARG_H, is not defined, then
diff --git a/Makefile.unix b/Makefile.unix
index a117f171fc1..d1ee224a67e 100644
--- a/Makefile.unix
+++ b/Makefile.unix
@@ -181,18 +181,18 @@ endif
BIN = nuttx$(EXEEXT)
all: $(BIN)
-.PHONY: context clean_context check_context export subdir_clean clean subdir_distclean distclean apps_clean apps_distclean
+.PHONY: dirlinks context clean_context check_context export subdir_clean clean subdir_distclean distclean apps_clean apps_distclean
-# Target used to copy include/nuttx/math.h. If CONFIG_ARCH_MATH_H is
+# Target used to copy include/nuttx/lib/math.h. If CONFIG_ARCH_MATH_H is
# defined, then there is an architecture specific math.h header file
# that will be included indirectly from include/math.h. But first, we
# have to copy math.h from include/nuttx/. to include/. Logic within
-# include/nuttx/math.h will hand the redirection to the architecture-
+# include/nuttx/lib/math.h will hand the redirection to the architecture-
# specific math.h header file.
#
# If the CONFIG_LIBM is defined, the Rhombus libm will be built at libc/math.
# Definitions and prototypes for the Rhombus libm are also contained in
-# include/nuttx/math.h and so the file must also be copied in that case.
+# include/nuttx/lib/math.h and so the file must also be copied in that case.
#
# If neither CONFIG_ARCH_MATH_H nor CONFIG_LIBM is defined, then no math.h
# header file will be provided. You would want that behavior if (1) you
@@ -208,8 +208,8 @@ endif
endif
ifeq ($(NEED_MATH_H),y)
-include/math.h: include/nuttx/math.h
- $(Q) cp -f include/nuttx/math.h include/math.h
+include/math.h: include/nuttx/lib/math.h
+ $(Q) cp -f include/nuttx/lib/math.h include/math.h
else
include/math.h:
endif
@@ -221,20 +221,20 @@ endif
# the settings in this float.h are actually correct for your platform!
ifeq ($(CONFIG_ARCH_FLOAT_H),y)
-include/float.h: include/nuttx/float.h
- $(Q) cp -f include/nuttx/float.h include/float.h
+include/float.h: include/nuttx/lib/float.h
+ $(Q) cp -f include/nuttx/lib/float.h include/float.h
else
include/float.h:
endif
-# Target used to copy include/nuttx/stdarg.h. If CONFIG_ARCH_STDARG_H is
+# Target used to copy include/nuttx/lib/stdarg.h. If CONFIG_ARCH_STDARG_H is
# defined, then there is an architecture specific stdarg.h header file
-# that will be included indirectly from include/stdarg.h. But first, we
+# that will be included indirectly from include/lib/stdarg.h. But first, we
# have to copy stdarg.h from include/nuttx/. to include/.
ifeq ($(CONFIG_ARCH_STDARG_H),y)
-include/stdarg.h: include/nuttx/stdarg.h
- $(Q) cp -f include/nuttx/stdarg.h include/stdarg.h
+include/stdarg.h: include/nuttx/lib/stdarg.h
+ $(Q) cp -f include/nuttx/lib/stdarg.h include/stdarg.h
else
include/stdarg.h:
endif
@@ -315,6 +315,8 @@ ifneq ($(CONFIG_ARCH_CHIP),)
endif
dirlinks: include/arch include/arch/board include/arch/chip $(ARCH_SRC)/board $(ARCH_SRC)/chip
+ $(Q) $(MAKE) -C configs dirlinks TOPDIR="$(TOPDIR)"
+ $(Q) $(MAKE) -C $(CONFIG_APPS_DIR) dirlinks TOPDIR="$(TOPDIR)"
# context
#
@@ -470,32 +472,32 @@ pass2dep: context tools/mkdeps$(HOSTEXEEXT) tools/cnvwindeps$(HOSTEXEEXT)
# location: http://ymorin.is-a-geek.org/projects/kconfig-frontends. See
# README.txt file in the NuttX tools GIT repository for additional information.
-do_config: context apps_preconfig
+do_config: dirlinks apps_preconfig
$(Q) APPSDIR=${CONFIG_APPS_DIR} kconfig-conf Kconfig
config: do_config clean_context
-do_oldconfig: context apps_preconfig
+do_oldconfig: dirlinks apps_preconfig
$(Q) APPSDIR=${CONFIG_APPS_DIR} kconfig-conf --oldconfig Kconfig
oldconfig: do_oldconfig clean_context
-do_olddefconfig: context apps_preconfig
+do_olddefconfig: dirlinks apps_preconfig
$(Q) APPSDIR=${CONFIG_APPS_DIR} kconfig-conf --olddefconfig Kconfig
olddefconfig: do_olddefconfig clean_context
-do_menuconfig: context apps_preconfig
+do_menuconfig: dirlinks apps_preconfig
$(Q) APPSDIR=${CONFIG_APPS_DIR} kconfig-mconf Kconfig
menuconfig: do_menuconfig clean_context
-do_qconfig: context apps_preconfig
+do_qconfig: dirlinks apps_preconfig
$(Q) APPSDIR=${CONFIG_APPS_DIR} kconfig-qconf Kconfig
qconfig: do_qconfig clean_context
-gconfig: context apps_preconfig
+gconfig: dirlinks apps_preconfig
$(Q) APPSDIR=${CONFIG_APPS_DIR} kconfig-gconf Kconfig
gconfig: do_gconfig clean_context
diff --git a/Makefile.win b/Makefile.win
index 1f30310525e..b15052f16ca 100644
--- a/Makefile.win
+++ b/Makefile.win
@@ -174,7 +174,7 @@ endif
BIN = nuttx$(EXEEXT)
all: $(BIN)
-.PHONY: context clean_context check_context configenv config oldconfig menuconfig export subdir_clean clean subdir_distclean distclean apps_clean apps_distclean
+.PHONY: dirlinks context clean_context check_context configenv config oldconfig menuconfig export subdir_clean clean subdir_distclean distclean apps_clean apps_distclean
# Target used to copy include\nuttx\math.h. If CONFIG_ARCH_MATH_H is
# defined, then there is an architecture specific math.h header file
@@ -335,6 +335,8 @@ endif
endif
dirlinks: include\arch include\arch\board include\arch\chip $(ARCH_SRC)\board $(ARCH_SRC)\chip
+ $(Q) $(MAKE) -C configs dirlinks TOPDIR="$(TOPDIR)"
+ $(Q) $(MAKE) -C $(CONFIG_APPS_DIR) dirlinks TOPDIR="$(TOPDIR)"
# context
#
@@ -466,22 +468,22 @@ pass2dep: context tools\mkdeps$(HOSTEXEEXT)
# location: http://ymorin.is-a-geek.org/projects/kconfig-frontends. See
# misc\tools\README.txt for additional information.
-do_config: context apps_preconfig
+do_config: dirlinks apps_preconfig
$(Q) set APPSDIR=$(patsubst "%",%,${CONFIG_APPS_DIR})& kconfig-conf Kconfig
config: do_config clean_context
-do_oldconfig: context apps_preconfig
+do_oldconfig: dirlinks apps_preconfig
$(Q) set APPSDIR=$(patsubst "%",%,${CONFIG_APPS_DIR})& kconfig-conf --oldconfig Kconfig
oldconfig: do_oldconfig clean_context
-do_olddefconfig: context apps_preconfig
+do_olddefconfig: dirlinks apps_preconfig
$(Q) set APPSDIR=$(patsubst "%",%,${CONFIG_APPS_DIR})& kconfig-conf --olddefconfig Kconfig
olddefconfig: do_olddefconfig clean_context
-do_menuconfig: context configenv apps_preconfig
+do_menuconfig: dirlinks configenv apps_preconfig
$(Q) set APPSDIR=$(patsubst "%",%,${CONFIG_APPS_DIR})& kconfig-mconf Kconfig
menuconfig: do_menuconfig clean_context
diff --git a/README.txt b/README.txt
index 4c12dca85ac..6843d81a4b8 100644
--- a/README.txt
+++ b/README.txt
@@ -15,6 +15,7 @@ README
- NuttX Configuration Tool
- Finding Selections in the Configuration Menus
- Reveal Hidden Configuration Options
+ - Make Sure that You on on the Right Platform
- Comparing Two Configurations
- Incompatibilities with Older Configurations
- NuttX Configuration Tool under DOS
@@ -321,13 +322,13 @@ Notes about Header Files
If you have a custom, architecture specific math.h header file, then
that header file should be placed at arch//include/math.h. There
- is a stub math.h header file located at include/nuttx/math.h. This stub
+ is a stub math.h header file located at include/nuttx/lib/math.h. This stub
header file can be used to "redirect" the inclusion to an architecture-
specific math.h header file. If you add an architecture specific math.h
header file then you should also define CONFIG_ARCH_MATH_H=y in your
NuttX Configuration file. If CONFIG_ARCH_MATH_H is selected, then the
top-level Makefile will copy the stub math.h header file from
- include/nuttx/math.h to include/math.h where it will become the system
+ include/nuttx/lib/math.h to include/math.h where it will become the system
math.h header file. The stub math.h header file does nothing other
than to include that architecture-specific math.h header file as the
system math.h header file.
@@ -576,6 +577,38 @@ Reveal Hidden Configuration Options
cannot be selected and has no value). About all you do is to select
the option to see what the dependencies are.
+Make Sure that You on on the Right Platform
+-------------------------------------------
+
+ Saved configurations may run on Linux, Cygwin (32- or 64-bit), or other
+ platforms. The platform characteristics can be changed use 'make
+ menuconfig'. Sometimes this can be confusing due to the differences
+ between the platforms. Enter sethost.sh
+
+ sethost.sh is a simple script that changes a configuration to your
+ host platform. This can greatly simplify life if you use many different
+ configurations. For example, if you are running on Linux and you
+ configure like this:
+
+ $ cd tools
+ $ ./configure.sh board/configuration
+ $ cd ..
+
+ The you can use the following command to both (1) make sure that the
+ configuration is up to date, AND (2) the configuration is set up
+ correctly for Linux:
+
+ $ tools/sethost.sh -l
+
+ Or, if you are on a Windows/Cygwin 64-bit platform:
+
+ $ tools/sethost.sh -w
+
+ Other options are available from the help option built into the
+ script. You can see all options with:
+
+ $ tools/sethost.sh -h
+
Comparing Two Configurations
----------------------------
@@ -948,9 +981,13 @@ Native Windows Build
--------------------
The beginnings of a Windows native build are in place but still not often
- used as of this writing. The windows native build logic initiated
- if CONFIG_WINDOWS_NATIVE=y is defined in the NuttX configuration file:
+ used as of this writing. The build was functional but because of lack of
+ use may find some issues to be resolved with this build configuration.
+ The windows native build logic initiated if CONFIG_WINDOWS_NATIVE=y is
+ defined in the NuttX configuration file:
+
+
This build:
- Uses all Windows style paths
diff --git a/ReleaseNotes b/ReleaseNotes
index 5afe3d5724e..27710f0c6b3 100644
--- a/ReleaseNotes
+++ b/ReleaseNotes
@@ -8905,25 +8905,25 @@ Additional new features and extended functionality:
This is based on the similar SAMD20 Xplained Pro board.
* Freescale/NXP KL:
-
+
- KL25Z64: Added support for the KL25Z64. The KL25Z64 is a lower
memory variant of the KL25Z128 and is used on the Teensy LC. From
Michael as SourceForge patch 50.
* Freescale/NXP KL Boards:
-
+
- Teensy-LC: Add board support for the Teensy LC board. Support is
based off the Freedom KL25Z board. LED, PWM, and UART0 have been
tested. The SPI pins are mapped correctly but have not yet been
tested. From Michael Hope as SourceForge patch 51.
* NXP LPC111x:
-
+
- LPC111x: Support for the LPC11xx family (the LPC1115 MCU in
particular). Contributed by Alan Carvalho de Assis.
* NXP LPC111x Boards:
-
+
- LPCXpresso LPC1115: Support for the LPCXpression LPC1115
board. Contributed by Alan Carvalho de Assis.
@@ -9158,7 +9158,7 @@ detailed bugfix information):
- LPC17 USB OHCI: Correct some initialization of data structures.
When hub support is enabled, it would overwrite the end of an array
and clobber some OS data structures.
- - LPC17xx Ethernet: Review, update, and modify the Ethernet driver so
+ - LPC17xx Ethernet: Review, update, and modify the Ethernet driver so
that it works better with CONFIG_NET_NOINTS=y. Also, update all
LPC17xx networking configurations so that they have
CONFIG_NET_NOTINTS=y selected.
@@ -9585,7 +9585,7 @@ detailed bugfix information):
* ARMv7-A:
- Cortex-A5 vfork(): Fix a Cortex-A compilation error when system
- calls are enabled in modes other than CONFIG_BUILD_KERNEL.
+ calls are enabled in modes other than CONFIG_BUILD_KERNEL.
* Atmel SAMA5 Drivers:
@@ -10099,7 +10099,7 @@ Additional new features and extended functionality:
- ps command: The 'ps' command now uses /proc// to obtain task
status information. A consequence of this is that you cannot use
the 'ps' command if the procfs is not enabled and mounted at /proc.
-
+
* Applications: apps/system:
- apps/system/hexed: Port the hexed command line hexadeciamal editor
@@ -10144,7 +10144,7 @@ detailed bugfix information):
* Graphics/Graphic Drivers:
- - ILI9432: Fixed errors in orientation. Portrait, RPortrait, and
+ - ILI9432: Fixed errors in orientation. Portrait, RPortrait, and
Landscript should work correly now. They were displayed mirrored.
From Marco Krahl.
@@ -10321,7 +10321,7 @@ Additional new features and extended functionality:
pointer indicates that the referenced object may reside either in
flash or in RAM. The compiler automatically makes 32-bit pointer
with flag indicating whether referenced object is in flash or RAM
- and generates code to access either in run-time. Thus, any function
+ and generates code to access either in run-time. Thus, any function
hat accepts __memx object can transparently work with RAM and flash
objects.
For platforms with a Harvard architecture and a very small RAM like
@@ -10350,7 +10350,7 @@ Additional new features and extended functionality:
dependencies generated by a Windows compiler so that they can be
used with the Cygwin make.
- tools/mkwindeps.sh: A script that coordinates use of cnvwindeps.exe.
- Dependencies now work on the Cygwin platform when using a Windows
+ Dependencies now work on the Cygwin platform when using a Windows
ative toolchain.
* Applications: NSH
@@ -10516,7 +10516,7 @@ Additional new features and extended functionality:
implemented via ioctl calls. However, it does not yet implement
the standard ADC interface. From Alexander Entinger.
- U-Blox Modem: Add an upper half driver for the U-Blox Modem. From
- Vladimir Komendantskiy.
+ Vladimir Komendantskiy.
- I2C: Add an I2C, "upper half", character drivers to support raw I2C
data transfers for test applications.
- RGB LED: Add a driver to manage a RGB LED via PWM. From Alan
@@ -10857,7 +10857,7 @@ Additional new features and extended functionality:
Neil Hancock.
- STM32 L4 QSPI: Add a QSPI driver with DMA support and (optional
memory mapped mode support. From Dave ziggurat29).
- - STM32, STM32 L4, and STM32 F7 Serial: Add support for compliant
+ - STM32, STM32 L4, and STM32 F7 Serial: Add support for compliant
SD-style breaks. From David Sidrane.
- STM32 L4 CAN: Add CAN support for STM32L4. From Sebastien Lorquet.
- STM32 1-Wire: Add support for a custom 1-wire driver. The serial
@@ -11079,3 +11079,699 @@ detailed bugfix information):
- Several Makefiles: Add .PHONY definitions to prevent 'clean up to date'
message weirdness when 'make clean' is done with no .config or
Make.defs file.
+
+NuttX-7.17 Release Notes
+------------------------
+
+The 117th release of NuttX, Version 7.17, was made on July 25, 2016,
+and is available for download from the Bitbucket.org website. Note
+that release consists of two tarballs: nuttx-7.17.tar.gz and
+apps-7.17.tar.gz. These are available from:
+
+ https://bitbucket.org/nuttx/nuttx/downloads
+ https://bitbucket.org/nuttx/apps/downloads
+
+Both may be needed (see the top-level nuttx/README.txt file for build
+information).
+
+Additional new features and extended functionality:
+
+ * File System and Block and MTD Drivers:
+
+ - drivers/mtd: Add a driver of IS25xP SPI flash devices. Based on
+ sst25xx driver. From Marten Svanfeldt.
+
+ * Networking and Network Drivers:
+
+ - Break out internal interface psock_ioctl().
+
+ * Common Device Drivers:
+
+ - PTYs: Added support for pseduo-terminals: Device drivers that can be
+ used for communications between tasks (usually with re-directed I/O).
+ Based on existing pipe logic.
+ - Button upper half driver: Added support for poll().
+ - CAN: Add support for poll. From Paul Alexander Patience.
+ - GPIO: Add support for a simple GPIO driver. It supports only pre-
+ configured input, output, and interrupting pins with basic input and
+ output operations. Interrupt events can lead to notification via a
+ signal.
+ - I/O Expander: Shadow-Mode: The output- and configuration registers of
+ the IO-Expander are held in the microcontrollers memory and only
+ written to the IO-Expander. This reduces bus traffic and is more
+ error-proof than the normal read-modify-write operation. Retry Mode:
+ If enabled and an error occurs while writing to the IO-Expander the
+ current transmission is automatically repeated once. From Michael
+ Spahlinger.
+ - Pipes/FIFOs: Add support to allocating different sizes for pipe and
+ fifo buffers. Adds mkfifo2() and pipe2() which are just like mkfifo()
+ and pipe(), but allow control of the size of the underlying, in-memory
+ circular buffer. Move pipe() and mkpipe() to the C library, they are
+ no longer core OS interfaces. Capability currenty used only by PTY
+ logic to support, configurable, smaller buffers for PTYs.
+
+ * SYSLOG/Debug Output:
+
+ - SYSLOG: Consolidated all SYSLOG logic in drivers/syslog. Added an
+ abstraction layer that supports: (1) redirection of SYSLOG outpout.
+ This is usually so that you can boot with one SYSLOG output but
+ transition to another SYSLOG output when the OS has initialialized,
+ (2) adds common serialization of interrupt output as a configuration
+ option. Without this configuration setting, interrupt level output
+ will be asynchronous. And (3) vsyslog is now a system call and is
+ usable with other-than-FLAT builds.
+ - SYSLOG: syslog() will now automatically redirect output to
+ lowsyslog() if called from an interrupt handler.
+ - Extended SYSLOG logic so that we can send SYSLOG output to a file.
+ - SYSLOG character device channel will now expand LF to CR-LF.
+ Controllable with a configuration option.
+ - Add a SYSLOG character device that can be used to re-direct output
+ to the SYSLOG channel (Not be be confused the the SYSLGO output to a
+ character device).
+ - Debug features are now enabled separately from debug output.
+ (1) CONFIG_DEBUG is gone. It is replaced with CONFIG_DEBUG_FEATURES.
+ (2) The macros dbg() and vdbg() have renamed as _err() and _info(),
+ respectively. This also applies to all of the variants as well,
+ XXdbg() and XXvdbg(). (3) Add a new debug level, _warn() (and
+ all variants XXwarn(), XXvwarn(), etc.). (4) Debug assertions can
+ now be enabled separately from debug output. (5) You can now enable
+ subsystem/device driver debug output at different output levels. For
+ example, CONFIG_DEBUG_FS no longer enables file system debug output
+ It enables general file system debug logic and enables selection of
+ CONFIG_DEBUG_FS_ERROR, CONFIG_DEBUG_FS_WARN, and CONFIG_DEBUG_FS_INFO.
+ - Since the SYSLOG layer now automatically handles low-level vs.
+ high-level output, the low-level (ll) variants of the debug macros
+ were eliminated.
+ - Reviewed all uses of *err(). These macro family should indicate
+ only error conditions. Convert *err() to either *info() or add
+ ERROR:, depending on if an error is reported.
+ - _alert(): New debug macro: _alert(). This is high priority,
+ unconditional output and is used to simplify and standardize crash
+ error reporting.
+ - Many CONFIG_DEBUG_* options did not have matching macros defined in
+ include/debug.h. Rather, there were various definitions scattered
+ throughout the sourse tree. These were collected together and
+ centralized with single macro definitions in include/debug.h
+
+ * Simulation Platform:
+
+ - Added the simulated QSPI (N25Q) flash to the simulation and extened
+ flash simulation capabilities to run with MTD drivers based on config
+ options (currently m25p, sst26 and w25). From Ken Pettit.
+
+ * Atmel SAMV7 Drivers:
+
+ - SPI: SPI-Freq. 40MHz; VARSELECT; hw-features This change adds the
+ following improvements:
+
+ o Increase the allowed SPI-Frequency from 20 to 40 MHz.
+ o Correct and rename the "VARSELECT" option This option was
+ included in the code as "CONFIG_SPI_VARSELECT" but nowhere
+ defined in a Kconfig file. The change renames it to
+ "CONFIG_SAMV7_SPI_VARSELECT" and corrects the implementation
+ according the datasheet of Atmel. In short, this option
+ switches the processor from "fixed peripheral selection"
+ (single device) to "variable peripheral selection" (multiple
+ devices on the bus).
+ o Add a new Function to the interface to control the timing and
+ delays of the chip according the ChipSelect lines. This function
+ can control the delay between the assertion of the ChipSelect and
+ the first bit, between the last bit and the de-assertion of the
+ ChipSelect and between two ChipSelects. This is needed to tune
+ the transfer according the specification of the connected devices.
+ o Add three "hw-features" for the SAMV7, which controls the behavior
+ of the ChipSelect:
+ - force CS inactive after transfer: this forces a (short) de-
+ assertion of the CS after a transfer, even if more data is
+ available in time
+ - force CS active after transfer: this forces the CS to stay
+ active after a transfer, even if the chip runs out of data.
+ Btw.: this is a prerequisit to make the LASTXFER bit working
+ at all.
+ - escape LASTXFER: this suppresses the LASTXFER bit at the end
+ of the next transfer. The "escape"-Flag is reset automatically.
+
+ From Frank Benkert
+ - TWISHS: Driver improvements from Michael Spahlinger.
+ - GPIO-Driver fixed for Open-Drain Pins:
+
+ o sam_gpioread: Now the actual line level from the pin is read
+ back. This is extremely important for Open-Drain Pins, which
+ can be used bidirectionally
+ o Re-Implemented twi_reset-function and enhanced it so it can be
+ called from inside the driver (see next point)
+ o Glitch-Filter: Added a configuration option to enable the twi-
+ built-in glitch filter
+ o Added a "Single Master Mode": In EMC Testing the TWI-Bus got
+ stuck because the TWI-Master detected a Multi-Master access (but
+ there is no second master). With the option "Single Master" we
+ detect these events and automatically trigger a twi_reset. We
+ also do an automatic recovery if a slave got stuck (SDA stays
+ low).
+
+ With the above changes I²C-Bus reliability in harsh environments (eg.
+ EMC) is greatly improved. The small change in the GPIO-Driver was
+ necessary because otherwise you cannot read back the correct line
+ status of Open-Drain Outputs and this is needed by the twi_reset
+ function. From Michael Spahlinger
+
+ * NXP Freescale LPC43xx Drivers:
+
+ - EMC: Extend LPC43xx EMC code to support SDRAM on a dynamic memory
+ interface. From Vytautas Lukenskas.
+
+ * NXP Freescale Kinetis:
+
+ - Kinetis K64: Add basic support for the K64 family. I leveraged the
+ changes from https://github.com/jmacintyre/nuttx-k64f and merged
+ into the existing kinetis code with a lot of changes and additions
+ (like pin multiplexing definitions).
+
+ * NXP Freescale Kinetis Drivers:
+
+ - Add a KinetisUSB device controller driver. Derived from the pic32mx
+ usb driver, which uses the same usb controller. From kfazz.
+ - Kinetis pwm support, based on the KL pwm driver. From kfazz.
+ - Kinetis Ethernet: Add support for the KSZ8081 PHY.
+ - Kinetis Ethernet: Modified Ethernet driver to try all PHY addresses
+ and then only fail if the driver cannot find a usable PHY address.
+ This means that you no longer have to specific the PHY address in
+ advance.
+ - Kinetis Ethernet: Add support for CONFIG_NET_NOINTS. The driver no
+ longer runs the networking at interrupt level but can defer interrupt
+ work to the high-priority work queue.
+
+ * NXP Freescale Kinetis Boards:
+
+ - Teensy-3.x: Add USB support and a usbnsh configuration.
+ From kfazz (2016-06).
+ - Freedom-K64F: Add support for the NXP Freedom-K64F board at 120MHz.
+ This is primarily the work of Jordan Macintyre. I leveraged this
+ code from https://github.com/jmacintyre/nuttx-k64f which was, itself,
+ a leverage from the old K60 TWR configuration. This includes
+ significant corrections (LEDs, buttons, README, etc) and extensions
+ and updates to match more recent BSPs.
+ - Freedom-K64F: Added a configuration that supports networking.
+
+ * STMicro STM32:
+
+ - STM32 F1-4: Added support for the STM32F105R. From Konstantin
+ Berezenko.
+ - STM32 F4: Added support for the STM32FF76xxx and STM32FF7xx
+ families. From David Sidrane.
+ - STM32 F1-4: Add support for Tickless mode (two timer
+ implementation). From Max Neklyudov.
+ - STM32 L4: Add support for tickless OS, and incidentally timers,
+ PWM, oneshot, free-running.... From ziggurat29.
+
+ * STMicro STM32 Drivers:
+
+ - STM32 F1-4: Add the up_getc() function to STM32 in order to support
+ the minnsh configuration. From Alan Carvalho de Assis.
+ - STM32 F7: Add SPI driver. From David Sidrane.
+ - STM32 F7: Add SPI, I2C, and ADC drivers. From Lok Tep.
+ - STM32 L4: Add ioctls to set/get CAN bit timing in stm32l4. Add
+ ioctl hooks to allow future management of can id filters. From
+ Sebastien Lorquet.
+ - STM32 L4: Add some CAN mode IOCTL calls. These will be useful for
+ device autotest when the application boots. They are redundant
+ with the CONFIG_CAN_LOOPBACK option, which can now just be
+ interpreted as a default setting. From Sebastien Lorquet.
+ - STM32 F1-4: Port STM32L4 CAN IOCTLs to STM32. From Sebastien Lorquet.
+ - STM32 L4: Implementation of loopback IOCTLs. From Sebastien
+ Lorquet.
+ - STM32 F7: Added SDMMC1 support for stm32F7 74-75. From Lok Tep.
+ - STM32 F7: Add USB support. From Lok Tep.
+ - STM32 F7: Added PWR, RTC, and BBSRAM support for stm32f7. From David
+ Sidrane.
+ - STM32 F7: Added STMF7xxx RTC. From David Sidrane.
+ - STM32 F7: Added STM32F7 DBGMCU. From David Sidrane.
+ - STM32 L4: Port support for both RX FIFOs from STM32 CAN. From Paul
+ Alexander Patience.
+
+ * STMicro STM32 Boards:
+
+ - Added a minnsh configuration for the STM32F103-Minimum board. From
+ Alan Carvalho de Assis .
+ - Added support for the Nucleo-F767ZI board. From David Sidrane.
+ - Nucleo-144/Nucleo-F767ZI: Add test for STM32 F7 SPI. From David
+ Sidrane.
+ - Nucleo-144: Added SDMMC support to Nucleo-144. From David Sidrane.
+ - Olimex STM32-E4077: Add support for Olimex STM32 E407 board. From
+ Mateusz Szafoni.
+ - Nucleo-144: Added USB OTG device to Nucleo-144. From David Sidrane.
+ - Nucleo-144: Added bbsram test to Nucleo-144. From David Sidrane.
+ - STM32F4 Disovery: add CAN support for STM32F4 Discovery. From
+ Matthias Renner.
+ - STM32F4 Disovery: added a canard configuration files. From
+ Matthias Renner.
+ - STM32F4 Discovery: Add FPU support for ostest for the STM32F4
+ Disovery platform. From David Alessio.
+ - STM32L476 Discovery: Update stm32l476 disco to include init code for
+ smartfs and nxffs for cases where those fs are included in build.
+ From ziggurat29.
+
+ * C Library/Header Files:
+
+ - include/assert.h: Check if NDEBUG is defined. From Paul Alexander
+ Patience.
+ - assert.h: Define static assert for C++ usage. From Paul Alexander
+ Patience.
+ - Add crc64 support. From Paul Alexander Patience.
+ - hex2bin: Move the portable library portion of apps/system/hex2bin
+ the C library with the OS internals. It is used in certain internal
+ boot-loader builds.
+ - Add raise().
+ - libm: This change should significantly improve the performance of
+ single precision floating point math library functions. The vast
+ majority of changes have to do with preventing the compiler from
+ needlessly promoting floats to doubles, performing the calculation
+ with doubles, only to demote the result to float. These changes only
+ affect the math lib functions that return float. From David Alessio.
+ - printf(): If there are no streams, let printf() fall back to use
+ syslog() for output.
+ - Move pipe() and mkpipe() to nuttx/libc, they are no
+ longer core OS interfaces. Capability currenty used only by PTY logi
+ to support, configurable, smaller buffers for PTYs.
+ - Move driver-related files from include/nuttx to include/nuttx/drivers.
+ Move driver related prototypes out of include/nuttx/fs/fs.h and into
+ new include/drivers/drivers.h.
+ - include /nuttx/lib: Move library-related files from include/nuttx to
+ include/nuttx/lib.
+
+ * Build/Configuration System:
+
+ - Custom Board Configuration: Add logic to support custom board
+ directories that include a Kconfig file. During the context phase
+ of the build, any Kconfig file in the custom board directory is
+ copied into configs/dummy, replacing the existing Kconfig file with
+ the target Kconfig file.
+ - Remove the includes/apps link to apps/include. It is no longer
+ used. From Sebastien Lorquet.
+
+ * Tools:
+
+ - tools/tesbuild.sh will now build NxWM configurations.
+
+ * Appplication Build/Configuration System:
+
+ - Change to the way that apps/ Kconfig files are generated in
+ order to better support reuse of the apps/ directory in NuttX
+ products. Changes include: Make the full tree use wildcards
+ make.defs, Add empty preconfig rules to 'leaf' makefiles, Use
+ directory.mk for recursive dir makefiles, Individual app kconfig
+ fixes, Recursive Kconfig autogeneration, Add kconfig files for
+ pcode and tiff, and fix a gitignore rule, From Sébastien Lorquet.
+ - apps/include directory structure reorganized. There are no longer
+ any header files in the apps/include/. directory. Rather, sub-
+ directories were added to match the partitioning of apps/ sub-
+ directories and the header files were moved into the appropriate
+ sub-directory. This change is intended to help with some changes
+ being considered by Sébastien Lorquet.
+ - Call all includes from to "bla/bla.h". From Sebastien
+ Lorquet.
+ - Add apps/include to include path in top-level Make.defs file.
+
+ * Applications: apps/nshlib:
+
+ - Make NSH net-initialization be a configuration option. From Marten
+ Svanfeld.
+ - Add NTP client initialization in NSH network startup logic. From
+ David S. Alessio .
+ - 'ps' command now prints out the stack usage if stack coloration is
+ enabled. From Frank Benkert.
+ - Allow stack usage to be disabled on constrained systems. From David
+ Sidrane.
+
+ * Applications: apps/netutils:
+
+ - NTP Client: Add retries. From David S. Alessio.
+ - NTP Client: The NTP client will now optionally use pool.ntp.org as
+ the NTP server; and reset the retry count upon success -- more robust.
+ From David Alessio.
+ - ESP8266: Add logic to set the BAUD rate. From Pierre-noel Bouteville.
+ - ESP8266: In Kconfig, select ARCH_HAVE_NET when NETUTILS_ESP8266 is
+ selected. This allows, among other things, support for network debug
+ output. From Pierre-noel Bouteville.
+
+ * Applications: apps/fsutils:
+
+ - flash_eraseall: IOCTL wrapper for MDCIO_BULKERASE command. Was in
+ nuttx/drivers/mtd. Moved to apps/fsutils because the call directly into
+ the OS was incorrect.
+
+ * Applications: apps/canutils:
+
+ - canlib: Basic CAN utility library. From Sebastien Lorquet.
+
+ * Platforms: apps/system:
+
+ - flash_eraseall: Now uses the IOCTL wrapper at apps/fsutils/flash_eraseall.
+
+ * Platforms: apps/platform:
+
+ - Add platform files for Olimex STM32 E407. From Mateusz Szafoni.
+
+ * Applications: apps/examples:
+
+ - apps/examples/canard: Add canard example application. From
+ Matthias Renner.
+ - apps/examples/pty_test: PTY test program. From Alan Carvalho de
+ Assis.
+
+Works-In-Progress:
+
+ * IEEE802.14.5/6LowPAN. Hooks and framework for this effort were
+ introduced in NuttX-7.15. Work has continued on this effort on
+ forks from the main repositories, albeit with many interruptions.
+ The completion of this wireless feature will postponed until at
+ least NuttX-7.18.
+
+ * i.MX6 SMP. Partially functional, but there is more that still
+ needs to be done.
+
+Bugfixes. Only the most critical bugfixes are listed here (see the
+ChangeLog for the complete list of bugfixes and for additional, more
+detailed bugfix information):
+
+ * Core OS:
+
+ - semaphores: Need to set errno to EINVAL on errors in sem_post()
+ and sem_wait(). From Paul Alexander Patience.
+
+ * File System/Block Drivers/MTD Drivers:
+
+ - Several MTD FLASH drivers nullify the freed 'priv' structure and
+ failed to return NULL as stated in the comments. Result, will
+ operate on a NULL pointer later. Noted by David Sidrane.
+ - VFS ioctl(). Per comments from David Sidrane, file_ioctl() should
+ not return succeed if the ioctl method is not supported. It
+ probably should return ENOTTY in that case.
+ - SST26 Driver: Before accessing the sst26 flash, the "Global Unlock"
+ command must me executed, which I do in the sst26 driver. BUT re-
+ reading the datasheet, the WREN instruction is required to enable
+ the execution of this command. This was not done. I have no idea how
+ the driver currently works except by chance. The writes should never
+ happen at all, the flash is half-enabled! From Sebastien Lorquet.
+ - N25Qxx Driver: Alter the notion of 'blocksize' to be equivalent to
+ 'flash write page size' in order to align with assumptions in the
+ smartfs driver (at least, maybe other things do as well). Correct a
+ bug that was previously masked by having blocksize=eraseblocksize
+ which would cause buffer overflows and delicious hardfaults.
+ Trivial spelling changes in comments, etc. From ziggurat29.
+ - SmartFS: Fix a 32-byte memory leak. From Ken Pettit.
+ - SMART MTD layer: Fixes freesector logic error when sectorsPerBlk=256,
+ adds DEBUGASSERT for invalid geometry and additional memory debug
+ logic. Also fixes the dangling pointer on error bug. From Ken
+ Pettit.
+
+ * Common Drivers:
+
+ - USB CDC/ACM Device Class: cdcacm_unbind leaks write request objects.
+ This arises due to freeing the bulk IN endpoint before the loop
+ that frees the requests via cdcasm_freereq. That function checks
+ the parameters and skips the freeing if either is NULL. Freeing
+ the bulk IN enpoint will cause the first param to be NULL, thereby
+ bypassing the free operation. To fix, I moved the release of the
+ bulk IN endpoint until after to loop (much as was the case for the
+ OUT and read requests, which did not exhibit the problem). From
+ ziggurat29.
+ - Pipes and FIFOs: Add missing configuration for pipe ring buffer
+ size. From Frank Benkert.
+ - UART 16550: Handle when CONFIG_SERIAL_UART_ARCH_IOCTL is not
+ enabled. From Heath Petersen.
+ - Common Serial Upper Half: Fix a race condition noted by Stefan
+ Kolb. Between the test if the TX buffer is full and entering a
+ critical section, bytes may be removed from the TX buffer making
+ the wait unnecessary. The unnecessary wait is an inefficiency,
+ but not really a problem. But with USB CDC/ACM it can be a problem
+ because the entire TX buffer may be emptied when we lose the race.
+ If that happens that uart_putxmitchar() can hang waiting for data
+ to be removed from an empty TX buffer.
+ - USB MSC Device Class: Add locks when removing request from queue.
+ From Wolfgang Reissnegger.
+ - USB MSC Device Class: Fix reversed logic on waiting for SCSI thread
+ start. The scsi thread was waiting for the wrong condition.
+ However, this was masked by the fact that the code creating the
+ scsi thread was also holding usbmsc_scsi_lock(priv) while
+ initializing data, hence this lock synchronized the scsi thread
+ start with init completion. From Wolfgang Reissnegger.
+
+ * Graphics and Graphic Drivers:
+
+ - Correct conditional compilation in ST7565 LCD driver. From Pierre-
+ noel Bouteville
+
+ * Networking:
+
+ - In both IPv6 and IPv4 incoming logic: (1) Should check if the
+ packet size is large enough before trying to access the packet
+ length in the IP header. (2) In the comparison between the IP
+ length and the full packet length, need to subtract the size of
+ he link layer header before making the comparison or we will get
+ false positives (i.e., the packet is really too small)
+ - TCP Networking: While working with version 7.10 I discovered a
+ problem in TCP stack that could be observed on high network load.
+ Generally speaking, the problem is that RST flag is set in
+ unnecessary case, in which between loss of some TCP packet and its
+ proper retransmission, another packets had been successfully sent.
+ The scenario is as follows: NuttX did not receive ACK for some sent
+ packet, so it has been probably lost somewhere. But before its
+ retransmission starts, NuttX is correctly issuing next TCP packets,
+ with sequence numbers increasing properly. When the retransmission
+ of previously lost packet finally succeeds, tcp_input receives the
+ accumulated ACK value, which acknowledges also the packets sent in
+ the meantime (i.e. between unsuccessful sending of lost packet and
+ its proper retransmission). However, variable unackseq is still set
+ to conn->isn + conn->sent, which is truth only if no further
+ packets transmission occurred in the meantime. Because of incorrect
+ (in such specific case) unackseq value, few lines further condition
+ if (ackseq <= unackseq)is not met, and, as a result, we are going to
+ reset label. From Jakub Lagwa.
+
+ * ARMv7-M:
+
+ - ARM stack check: Fix double fault on IDLE task with stack size = 0.
+ From David Sidrane.
+
+ * Atmel SAMV7 Drivers:
+
+ - CAN: CAN Message Filtering fixed: (1) stdfilters didn't work because
+ the filter was never enabled (wrong number of bits to shift), and
+ (2) Filters were never used because the configuration register
+ cannot be written without using the initialization mode. Both bugs
+ are fixed by this change. Filtering has been tested with both
+ standard and extended identifiers and is now working properly. From
+ Michael Spahlinger.
+
+ * Atmel SAMA5:
+
+
+ * Atmel SAM3/4 Drivers:
+
+ - Fix some errors in AFEC header file. From OrbitalFox.
+ - DAC: DACC_WPMR_WPKEY_MASK -> DACC_WPMR_WPKEY. From Wolfgang
+ Reissnegge.
+ - Timer: Fix ops check in TCIOC_STOP. From Wolfgang Reissnegge.
+ - I2C: Fix reversed logic in twi_startmessage(). From Wolfgang
+ Reissnegger.
+ - SAM3/4 UDP: Fix handling of endpoint RX FIFO banks. This fixes
+ a race condition where the HW fills a FIFO bank while the SW is
+ busy, resulting in out of sequence USB packets.
+
+ * Atmel SAMV7 Drivers:
+
+ - USBHS Device: This change solves a problem which causes data loss
+ while sending data via USB. This problem is caused by an incorrect
+ handling of the endpoint state in the USB driver sam_usbdevhs. This
+ leads under some circumstances to situations in which an DMA
+ transfer is setup while a previous DMA transfer is currently active.
+ Amongst other things I introduced the new endpoint state
+ USBHS_EPSTATE_SENDING_DMA for the fix. To reproduce the problem, I
+ used a program which send as many data as possible via a CDC/ACM
+ device and verified the received data on the PC. From Stefan Kolb.
+
+ * NXP Freescale Kinetis Drivers:
+
+ - Timers: Support up to 8 channels per timer. From kfazz.
+
+ * NXP Freescale Kinetis Boards:
+
+ - Teensy 3.x clock fixes: The High Gain bit in MCG_C1 was preventing
+ teensy from booting except after a programming session. The second
+ change doesn't appear to change any functionality, but complies with
+ restrictions in the k20 family reference manual on FEI -> FBE clock
+ transiions. From kfazz.
+
+ * NXP Freescale LPC17xx Drivers:
+
+ - LPC17 Ethernet: Needs to correctly ignore PHYID2 revision number
+ when comparing PHY IDs.
+
+ * NXP Freescale LPC43xx Drivers:
+
+ - Fix errors in GPIO interrupt logic. From v01d (phreakuencies)
+ - Ethernet: Correct auto-negotiation mode in the LPC43xx Ethernet.
+ From Alexander Vasiljev
+ - Writing zero to NVIC_IRQ_ENABLE has no effect. Disable interrupts
+ with NVIC_IRQ_CLEAR. From Paul Alexander Patience.
+ - SPIFI: If CONFIG_SPIFI_SECTOR512 undefined, lpc43_bwrite doesn't do
+ actual write (probably copy/paste errors). Still not sure about
+ current state of lpc43_spifi implementation, but for me NXFFS works
+ with this change. From Vytautas Lukenskas.
+
+ * Qemu-i486:
+
+ - Fix qemu-i486/ostest/Make.defs test for M32. From Heath Petersen.
+
+ * SiLabs EFM32 Drivers:
+
+ - Fix EFM32 FLASH conditional compilation. From Pierre-noel
+ Bouteville
+ - Writing zero to NVIC_IRQ_ENABLE has no effect. Disable interrupts
+ with NVIC_IRQ_CLEAR. From Paul Alexander Patience.
+
+ * STMicro STM32:
+
+ - STM32 F1-F4: In PWM driver, just update duty if frequency is not
+ changed and PSM started. This removeis glitch or blinking when
+ only duty is frequently changed. From Pierre-noel Bouteville.
+
+ * STMicro STM32 Drivers:
+
+ - STM32 F7: Fixed STM32F7 DMA stm32_dmacapable. DMA working on SDMMC.
+ From David Sidrane.
+ - STM32 F1-F4 Timer Driver: Change calculation of per- timer pre-scaler
+ value. Add support for all timers
+ - STM32 F1-F4: Correct conditional compilation in STM32 timer capture
+ logic. From Pierre-noel Bouteville
+ - STM32 F1-F4: Fix STM32 DMA code and configuration for STM32F37X chips.
+ From Marten Svanfeldt.
+ - STM32 F1-F4: Fix compilation errors in debug mode of stm32_pwm.c.
+ From Konstantin Berezenko.
+ - STM32 F1-F4: Correct the CAN2 RX IRQ number for stm32f10xx chips.
+ From Konstantin Berezenko.
+ - STM32 F1-F4: Move backup domain reset to to earlier in the
+ initialization sequence (stm32_rcc.c() in order to avoid disabling
+ LSE during RTC initialiation. From Alan Carvalho de Assis.
+ - STM32 F1-F4: When configuring a GPIO via stm32_configgpio() the
+ function will first set the mode to output and then set the initial
+ state of the gpio later on. If you have an application with an
+ externaly pulled-up pin, this would lead to a glitch on the line
+ that may be dangerous in some applications (e.G. Reset Line for
+ other chips, etc). This changes sets the output state before
+ configuring the pin as an output. From Pascal Speck .
+ - STM32 F7: Apply Pascal Speck's GPIO STM32 change to STM32 L4.
+ - STM32 L4: Apply Pascal Speck's GPIO STM32 change to STM32 L4.
+ From Sebastien Lorquet.
+ - STM32 F7: BUGFIX: PLLs IS2 and SAI P Calculation. From David
+ Sidrane.
+ - STM32 L4: STM32 CAN fixes need to be backported to STM32L4 as well.
+ - STM32 F1-F4 and L4: Writing zero to NVIC_IRQ_ENABLE has no effect.
+ Disable interrupts with NVIC_IRQ_CLEAR. From Paul Alexander
+ Patience.
+ - STM32 F7: STMF7xxx RTC: (1) Remove proxy #defines, (2) Ensure the
+ LSE(ON) etal are set and remembered in a) A cold start (RTC_MAGIC
+ invalid) of the RTC, and b) A warm start (RTC_MAGIC valid) of the
+ RTC but a clock change. The change was needed because in bench
+ testing a merge of the latest's STM32 53ec3ca (and friends) it
+ became apparent that the sequence of operation is wrong in the
+ reset of the Backup Domain in the RCC code. PWR is required before
+ the Backup Domain can be futzed with. !!!This Code should be tested
+ on STM32 and if needed rippled to the STM32 families. From David
+ Sidrane.
+ - STM32 F1-F4: STM32 BBSRAM fixed (and formatted) flags. From David
+ Sidrane.
+ - STM32 F7: STM32F7 BBSRAM fixed (and formatted) flags. From David
+ Sidrane.
+ - STM32 L4: Fix incorrect clock setup for LPTIM1. From ziggurat29.
+ - STM32 F4/L4 RTC ALARM: were enabling interrupts too early in the
+ power-up sequence, BEFORE the interrupt system was being
+ initialized.
+
+ * STMicro STM32 Boards:
+
+ - STM32 board.h: Fix STM32 timer input clock definitions. From David
+ Sidrane.
+
+ * TI Tiva Drivers:
+
+ - Bug Fix in tiva_serial.c - UART5, UART6 and UART7 were not being
+ configured as TTYS0 for printing over serial console. From Shirshak
+ Sengupta.
+
+ * C Library/Header Files:
+
+ - include/signal.h: Change type of SIG_ERR, SIG_IGN, ... to
+ _sa_handler_t. The type void does not work with the IAR toolchain.
+ From Aleksandr Vyhovanec.
+ - crc16: fix error. From Paul Alexander Patience.
+ - strtoul() and strtoull(): Fix errno settings required by function
+ definition. Resolved Bitbucket Issue #1. From Sebastien Lorquet.
+
+ * Build/Configuration System:
+
+ - Build system: This change fixes a build problem that only occurs
+ when reconfiguring from Linux to Windows or vice-versa. It is a
+ problem that was present but not usually experienced until two
+ things happened: (1) The pre_config target was added to run before
+ the menconfig operation and (2) the context target was added before
+ the pre_config target in order to set up the correct symbolic links
+ (in the apps/platform directory) needed by the pre_config target.
+ But then now if you start with a Linux system and run 'make
+ menuconfig' to switch to Linux, the context target will execute
+ first and set up POSIX style symbolic links before doing the
+ menuconfig. Then after the menuconfig, the make will fail on
+ Windows if you are using a Windows native toolchain because that
+ native toolchain cannot follow the Cygwin- style symbolic links.
+ The fix here is to also execute the clean_context AFTER executing
+ menuconfig. A lot more happens now: It used to be that doing
+ 'make menuconfig' only did the menuconfig operation. Now it does
+ context, pre_config, menuconfig, clean_context. Not nearly as
+ snappy as it used to be.
+ - Need to build the drivers/ directory even it file descriptors are
+ not supported. There are things in the drivers/ directory that are
+ still needed (like SYSLOG logic).
+ - Remove all inclusion of header files from the apps/include
+ directory from NuttX core logic. There should be no dependency on
+ logic within NuttX on logic within apps/. This caused a lot of
+ reshuffling of logic: binfmt pcode support, usbmonitor is now a
+ kernel thread, TZ/Olson database moved to libc/zoneinfo.
+
+ * Application Build/Configuration System:
+
+ - Make sure that APPNAME is defined in all Makefiles that generate
+ applications. From Sebastien Lorquet.
+
+ * apps/builtins:
+
+ - apps/builtins: exec_builtin was not using the provided open flags.
+ As a result >> redirection was not working; it was treated the same
+ as >.
+
+ * apps/nshlib:
+
+ - apps/nshilib: PS Command: When Priority Inheritance is enabled, the
+ format of /proc//status changes to show both the current
+ priority and the thread’s base priority. This messes up the format
+ of cmd_ps. From David Alessio.
+
+ * apps/netutils:
+
+ - apps/netutils, uIP webserver: Fix a data declaration in a header
+ file.
+
+ * apps/canutils:
+
+ - apps/canutils/libuavcan: Fix for recent change to STM32 timer
+ frequency definiitions.
+
+ * apps/examples:
+
+ - apps/examples/alarm: ioctl call was clobbering file descriptor.
+ - apps/examples/can: Some variables were not declared in all required
+ cases. From Sebastien Lorquet.
+ - apps/examples/media: media example was intended to take either a
+ command line argument, or a compiled-in default value from config.
+ However, the default was ignored, leading to confusing error
+ messages. From ziggurat29.
diff --git a/TODO b/TODO
index bbc8f7657ac..215d21d983e 100644
--- a/TODO
+++ b/TODO
@@ -1,4 +1,4 @@
-NuttX TODO List (Last updated July 3, 2016)
+NuttX TODO List (Last updated July 20, 2016)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
This file summarizes known NuttX bugs, limitations, inconsistencies with
@@ -447,6 +447,7 @@ o Kernel/Protected Build
mkfatfs mkfatfs
mkrd ramdisk_register()
ping icmp_ping()
+ mount foreach_mountpoint()
The busybox mkfatfs does not involve any OS calls; it does
its job by simply opening the block driver (using open/xopen)
@@ -818,7 +819,7 @@ o Binary loaders (binfmt/)
"Read-Only Data in RAM" at
http://nuttx.org/Documentation/NuttXNxFlat.html#limitations).
- The newer 4.6.3compiler generated PC relative relocations to the strings:
+ The newer 4.6.3 compiler generated PC relative relocations to the strings:
.L2:
.word .LC0-(.LPIC0+4)
@@ -1339,6 +1340,8 @@ o Libraries (libc/)
UPDATE: 2015-09-01: A fix for the noted problems with asin()
has been applied.
+ 2016-07-30: Numerous fixes and performance improvements from
+ David Alessio.
Status: Open
Priority: Low for casual users but clearly high if you need care about
@@ -1399,6 +1402,15 @@ o File system / Generic drivers (fs/, drivers/)
socket structures. There really should be one array that
is a union of file and socket descriptors. Then socket and
file descriptors could lie in the same range.
+
+ Another example of how the current implementation limits
+ functionality: I recently started an implement of the FILEMAX
+ (using pctl() instead sysctl()). My objective was to be able
+ to control the number of available file descriptors on a task-
+ by-task basis. The complexity due to the partitioning of
+ desciptor space in a range for file descriptors and a range
+ for socket descriptors made this feature nearly impossible to
+ implement.
Status: Open
Priority: Low
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 87282302762..50153eb3cba 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -225,6 +225,7 @@ config ARCH_CHIP_STM32
select ARCH_HAVE_I2CRESET
select ARCH_HAVE_HEAPCHECK
select ARCH_HAVE_TICKLESS
+ select ARCH_HAVE_TIMEKEEPING
select ARMV7M_HAVE_STACKCHECK
---help---
STMicro STM32 architectures (ARM Cortex-M3/4).
diff --git a/arch/arm/include/lpc17xx/lpc176x_irq.h b/arch/arm/include/lpc17xx/lpc176x_irq.h
index 248c5c47d66..b844b33d652 100644
--- a/arch/arm/include/lpc17xx/lpc176x_irq.h
+++ b/arch/arm/include/lpc17xx/lpc176x_irq.h
@@ -147,7 +147,7 @@
* 42
*/
-#ifdef CONFIG_GPIO_IRQ
+#ifdef CONFIG_LPC17_GPIOIRQ
# define LPC17_VALID_GPIOINT0 (0x7fff8ffful) /* GPIO port 0 interrupt set */
# define LPC17_VALID_GPIOINT2 (0x00003ffful) /* GPIO port 2 interrupt set */
diff --git a/arch/arm/include/lpc17xx/lpc178x_irq.h b/arch/arm/include/lpc17xx/lpc178x_irq.h
index 76c74904528..52ed1731a5c 100644
--- a/arch/arm/include/lpc17xx/lpc178x_irq.h
+++ b/arch/arm/include/lpc17xx/lpc178x_irq.h
@@ -166,7 +166,7 @@
* 42
*/
-#ifdef CONFIG_GPIO_IRQ
+#ifdef CONFIG_LPC17_GPIOIRQ
# define LPC17_VALID_GPIOINT0 (0xfffffffful) /* GPIO port 0 interrupt set */
# define LPC17_VALID_GPIOINT2 (0xfffffffful) /* GPIO port 2 interrupt set */
diff --git a/arch/arm/include/samdl/samd20_irq.h b/arch/arm/include/samdl/samd20_irq.h
index 01361e8e00e..709fddaeac8 100644
--- a/arch/arm/include/samdl/samd20_irq.h
+++ b/arch/arm/include/samdl/samd20_irq.h
@@ -81,7 +81,7 @@
/* GPIO interrupts. Up to 16 pins may be configured to support interrupts */
-#ifdef CONFIG_GPIO_IRQ
+#ifdef CONFIG_SAMDL_GPIOIRQ
# define SAM_IRQ_EXTINT0 (SAM_IRQ_NIRQS+0) /* External interrupt 0 */
# define SAM_IRQ_EXTINT1 (SAM_IRQ_NIRQS+1) /* External interrupt 1 */
# define SAM_IRQ_EXTINT2 (SAM_IRQ_NIRQS+2) /* External interrupt 2 */
diff --git a/arch/arm/include/samdl/samd21_irq.h b/arch/arm/include/samdl/samd21_irq.h
index 2ea4db82579..7b5c633ef62 100644
--- a/arch/arm/include/samdl/samd21_irq.h
+++ b/arch/arm/include/samdl/samd21_irq.h
@@ -88,7 +88,7 @@
/* GPIO interrupts. Up to 16 pins may be configured to support interrupts */
-#ifdef CONFIG_GPIO_IRQ
+#ifdef CONFIG_SAMDL_GPIOIRQ
# define SAM_IRQ_EXTINT0 (SAM_IRQ_NIRQS+0) /* External interrupt 0 */
# define SAM_IRQ_EXTINT1 (SAM_IRQ_NIRQS+1) /* External interrupt 1 */
# define SAM_IRQ_EXTINT2 (SAM_IRQ_NIRQS+2) /* External interrupt 2 */
diff --git a/arch/arm/include/samdl/saml21_irq.h b/arch/arm/include/samdl/saml21_irq.h
index 9622a032152..24c774dbd0f 100644
--- a/arch/arm/include/samdl/saml21_irq.h
+++ b/arch/arm/include/samdl/saml21_irq.h
@@ -89,7 +89,7 @@
/* GPIO interrupts. Up to 16 pins may be configured to support interrupts */
-#ifdef CONFIG_GPIO_IRQ
+#ifdef CONFIG_SAMDL_GPIOIRQ
# define SAM_IRQ_EXTINT0 (SAM_IRQ_NIRQS+0) /* External interrupt 0 */
# define SAM_IRQ_EXTINT1 (SAM_IRQ_NIRQS+1) /* External interrupt 1 */
# define SAM_IRQ_EXTINT2 (SAM_IRQ_NIRQS+2) /* External interrupt 2 */
diff --git a/arch/arm/src/armv7-r/arm_doirq.c b/arch/arm/src/armv7-r/arm_doirq.c
index fdf392d3384..5d492f5ddc7 100644
--- a/arch/arm/src/armv7-r/arm_doirq.c
+++ b/arch/arm/src/armv7-r/arm_doirq.c
@@ -52,22 +52,6 @@
#include "group/group.h"
-/****************************************************************************
- * Pre-processor Definitions
- ****************************************************************************/
-
-/****************************************************************************
- * Public Data
- ****************************************************************************/
-
-/****************************************************************************
- * Private Data
- ****************************************************************************/
-
-/****************************************************************************
- * Private Functions
- ****************************************************************************/
-
/****************************************************************************
* Public Functions
****************************************************************************/
diff --git a/arch/arm/src/common/up_initialize.c b/arch/arm/src/common/up_initialize.c
index 6b5117adf1b..a97cd40a92e 100644
--- a/arch/arm/src/common/up_initialize.c
+++ b/arch/arm/src/common/up_initialize.c
@@ -44,14 +44,16 @@
#include
#include
#include
-#include
+#include
#include
#include
#include
#include
#include
#include
+#include
#include
+#include
#include
@@ -158,21 +160,21 @@ void up_initialize(void)
up_irqinitialize();
+#ifdef CONFIG_PM
/* Initialize the power management subsystem. This MCU-specific function
* must be called *very* early in the initialization sequence *before* any
* other device drivers are initialized (since they may attempt to register
* with the power management subsystem).
*/
-#ifdef CONFIG_PM
up_pminitialize();
#endif
+#ifdef CONFIG_ARCH_DMA
/* Initialize the DMA subsystem if the weak function up_dmainitialize has been
* brought into the build
*/
-#ifdef CONFIG_ARCH_DMA
#ifdef CONFIG_HAVE_WEAKFUNCTIONS
if (up_dmainitialize)
#endif
@@ -196,6 +198,14 @@ void up_initialize(void)
devnull_register(); /* Standard /dev/null */
#endif
+#if defined(CONFIG_DEV_RANDOM)
+ devrandom_register(); /* Standard /dev/random */
+#endif
+
+#if defined(CONFIG_DEV_URANDOM)
+ devurandom_register(); /* Standard /dev/urandom */
+#endif
+
#if defined(CONFIG_DEV_ZERO)
devzero_register(); /* Standard /dev/zero */
#endif
@@ -228,22 +238,10 @@ void up_initialize(void)
ramlog_consoleinit();
#endif
- /* Initialize the HW crypto and /dev/crypto */
+#if CONFIG_NFILE_DESCRIPTORS > 0 && defined(CONFIG_PSEUDOTERM_SUSV1)
+ /* Register the master pseudo-terminal multiplexor device */
-#if defined(CONFIG_CRYPTO)
- up_cryptoinitialize();
-#endif
-
-#if CONFIG_NFILE_DESCRIPTORS > 0
-#if defined(CONFIG_CRYPTO_CRYPTODEV)
- devcrypto_register();
-#endif
-#endif
-
- /* Initialize the Random Number Generator (RNG) */
-
-#ifdef CONFIG_DEV_RANDOM
- up_rnginitialize();
+ (void)ptmx_register();
#endif
/* Early initialization of the system logging device. Some SYSLOG channel
@@ -253,6 +251,16 @@ void up_initialize(void)
syslog_initialize(SYSLOG_INIT_EARLY);
+#if defined(CONFIG_CRYPTO)
+ /* Initialize the HW crypto and /dev/crypto */
+
+ up_cryptoinitialize();
+#endif
+
+#if CONFIG_NFILE_DESCRIPTORS > 0 && defined(CONFIG_CRYPTO_CRYPTODEV)
+ devcrypto_register();
+#endif
+
#ifndef CONFIG_NETDEV_LATEINIT
/* Initialize the network */
diff --git a/arch/arm/src/common/up_internal.h b/arch/arm/src/common/up_internal.h
index feec4333558..36095a87a45 100644
--- a/arch/arm/src/common/up_internal.h
+++ b/arch/arm/src/common/up_internal.h
@@ -545,12 +545,6 @@ void up_usbuninitialize(void);
# define up_usbuninitialize()
#endif
-/* Random Number Generator (RNG) ********************************************/
-
-#ifdef CONFIG_DEV_RANDOM
-void up_rnginitialize(void);
-#endif
-
/* Debug ********************************************************************/
#ifdef CONFIG_STACK_COLORATION
void up_stack_color(FAR void *stackbase, size_t nbytes);
diff --git a/arch/arm/src/efm32/efm32_irq.c b/arch/arm/src/efm32/efm32_irq.c
index 63a82b194ca..db5992dea7b 100644
--- a/arch/arm/src/efm32/efm32_irq.c
+++ b/arch/arm/src/efm32/efm32_irq.c
@@ -93,10 +93,6 @@ volatile uint32_t *g_current_regs[1];
extern uint32_t _vectors[];
-/****************************************************************************
- * Private Data
- ****************************************************************************/
-
/****************************************************************************
* Private Functions
****************************************************************************/
@@ -261,15 +257,9 @@ static int efm32_irqinfo(int irq, uintptr_t *regaddr, uint32_t *bit,
{
if (irq < NR_VECTORS)
{
- n = irq - EFM32_IRQ_INTERRUPTS;
+ n = irq - EFM32_IRQ_INTERRUPTS;
*regaddr = NVIC_IRQ_ENABLE(n) + offset;
-
- while (n >= 32)
- {
- n -= 32;
- }
-
- *bit = 1 << n;
+ *bit = (uint32_t)1 << (n & 0x1f);
}
else
{
diff --git a/arch/arm/src/efm32/efm32_pwm.c b/arch/arm/src/efm32/efm32_pwm.c
index b34d8aeb2ff..f07a3eed4b7 100644
--- a/arch/arm/src/efm32/efm32_pwm.c
+++ b/arch/arm/src/efm32/efm32_pwm.c
@@ -47,7 +47,7 @@
#include
#include
-#include
+#include
#include
#include "up_arch.h"
diff --git a/arch/arm/src/efm32/efm32_pwm.h b/arch/arm/src/efm32/efm32_pwm.h
index af46c3b6f8b..61e4f5f116d 100644
--- a/arch/arm/src/efm32/efm32_pwm.h
+++ b/arch/arm/src/efm32/efm32_pwm.h
@@ -39,7 +39,7 @@
/* The EFM32 does not have dedicated PWM hardware. Rather, pulsed output
* control is a capability of the EFM32 timers. The logic in this file
* implements the lower half of the standard, NuttX PWM interface using the
- * EFM32 timers. That interface is described in include/nuttx/pwm.h.
+ * EFM32 timers. That interface is described in include/nuttx/drivers/pwm.h.
*/
/****************************************************************************
diff --git a/arch/arm/src/kinetis/Kconfig b/arch/arm/src/kinetis/Kconfig
index 4be634107b2..6028e6470b2 100644
--- a/arch/arm/src/kinetis/Kconfig
+++ b/arch/arm/src/kinetis/Kconfig
@@ -418,6 +418,9 @@ config KINETIS_PIT
endmenu
+menu "Kinetis FTM PWM Configuration"
+ depends on KINETIS_FTM0 || KINETIS_FTM1 || KINETIS_FTM2
+
config KINETIS_FTM0_PWM
bool "FTM0 PWM"
default n
@@ -481,14 +484,16 @@ config KINETIS_FTM2_CHANNEL
If FTM2 is enabled for PWM usage, you also need specifies the timer output
channel {0,..,1}
+endmenu # Kinetis FTM PWM Configuration
+
menu "Kinetis GPIO Interrupt Configuration"
-config GPIO_IRQ
+config KINETIS_GPIOIRQ
bool "GPIO pin interrupts"
---help---
Enable support for interrupting GPIO pins
-if GPIO_IRQ
+if KINETIS_GPIOIRQ
config KINETIS_PORTAINTS
bool "GPIOA interrupts"
diff --git a/arch/arm/src/kinetis/Make.defs b/arch/arm/src/kinetis/Make.defs
index 662dd618737..9d4ea5083ab 100644
--- a/arch/arm/src/kinetis/Make.defs
+++ b/arch/arm/src/kinetis/Make.defs
@@ -103,7 +103,7 @@ ifeq ($(CONFIG_BUILD_PROTECTED),y)
CHIP_CSRCS += kinetis_userspace.c kinetis_mpuinit.c
endif
-ifeq ($(CONFIG_GPIO_IRQ),y)
+ifeq ($(CONFIG_KINETIS_GPIOIRQ),y)
CHIP_CSRCS += kinetis_pinirq.c
endif
diff --git a/arch/arm/src/kinetis/chip/kinetis_k60memorymap.h b/arch/arm/src/kinetis/chip/kinetis_k60memorymap.h
index 8b00303ef7b..135da475536 100644
--- a/arch/arm/src/kinetis/chip/kinetis_k60memorymap.h
+++ b/arch/arm/src/kinetis/chip/kinetis_k60memorymap.h
@@ -44,7 +44,7 @@
#include "chip.h"
-#ifdef KINETIS_K64
+#ifdef KINETIS_K60
/************************************************************************************
* Pre-processor Definitions
@@ -192,5 +192,5 @@
* Public Functions
************************************************************************************/
-#endif /* KINETIS_K64 */
+#endif /* KINETIS_K60 */
#endif /* __ARCH_ARM_SRC_KINETIS_CHIP_KINETIS_K60MEMORYMAP_H */
diff --git a/arch/arm/src/kinetis/kinetis.h b/arch/arm/src/kinetis/kinetis.h
index fccd4b90af7..bb02f01e92c 100644
--- a/arch/arm/src/kinetis/kinetis.h
+++ b/arch/arm/src/kinetis/kinetis.h
@@ -476,7 +476,7 @@ bool kinetis_gpioread(uint32_t pinset);
*
************************************************************************************/
-#ifdef CONFIG_GPIO_IRQ
+#ifdef CONFIG_KINETIS_GPIOIRQ
void kinetis_pinirqinitialize(void);
#else
# define kinetis_pinirqinitialize()
@@ -514,7 +514,7 @@ xcpt_t kinetis_pinirqattach(uint32_t pinset, xcpt_t pinisr);
*
************************************************************************************/
-#ifdef CONFIG_GPIO_IRQ
+#ifdef CONFIG_KINETIS_GPIOIRQ
void kinetis_pinirqenable(uint32_t pinset);
#else
# define kinetis_pinirqenable(pinset)
@@ -528,7 +528,7 @@ void kinetis_pinirqenable(uint32_t pinset);
*
************************************************************************************/
-#ifdef CONFIG_GPIO_IRQ
+#ifdef CONFIG_KINETIS_GPIOIRQ
void kinetis_pinirqdisable(uint32_t pinset);
#else
# define kinetis_pinirqdisable(pinset)
diff --git a/arch/arm/src/kinetis/kinetis_clockconfig.c b/arch/arm/src/kinetis/kinetis_clockconfig.c
index 2f703ea96e7..7d3d6ecb22a 100644
--- a/arch/arm/src/kinetis/kinetis_clockconfig.c
+++ b/arch/arm/src/kinetis/kinetis_clockconfig.c
@@ -39,8 +39,6 @@
#include
-#include
-
#include "up_arch.h"
#include "kinetis.h"
@@ -50,6 +48,8 @@
#include "chip/kinetis_llwu.h"
#include "chip/kinetis_pinmux.h"
+#include
+
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
diff --git a/arch/arm/src/kinetis/kinetis_irq.c b/arch/arm/src/kinetis/kinetis_irq.c
index d2a04de3ae6..a969bbacd7a 100644
--- a/arch/arm/src/kinetis/kinetis_irq.c
+++ b/arch/arm/src/kinetis/kinetis_irq.c
@@ -439,7 +439,7 @@ void up_irqinitialize(void)
* configured pin interrupts.
*/
-#ifdef CONFIG_GPIO_IRQ
+#ifdef CONFIG_KINETIS_GPIOIRQ
kinetis_pinirqinitialize();
#endif
diff --git a/arch/arm/src/kinetis/kinetis_pinirq.c b/arch/arm/src/kinetis/kinetis_pinirq.c
index 919d51e67c9..cc5933e715a 100644
--- a/arch/arm/src/kinetis/kinetis_pinirq.c
+++ b/arch/arm/src/kinetis/kinetis_pinirq.c
@@ -52,7 +52,7 @@
#include "kinetis.h"
#include "chip/kinetis_port.h"
-#ifdef CONFIG_GPIO_IRQ
+#ifdef CONFIG_KINETIS_GPIOIRQ
/****************************************************************************
* Pre-processor Definitions
@@ -450,4 +450,4 @@ void kinetis_pinirqdisable(uint32_t pinset)
}
#endif /* HAVE_PORTINTS */
}
-#endif /* CONFIG_GPIO_IRQ */
+#endif /* CONFIG_KINETIS_GPIOIRQ */
diff --git a/arch/arm/src/kinetis/kinetis_pwm.c b/arch/arm/src/kinetis/kinetis_pwm.c
index 19de382634e..4eea85bd420 100644
--- a/arch/arm/src/kinetis/kinetis_pwm.c
+++ b/arch/arm/src/kinetis/kinetis_pwm.c
@@ -49,7 +49,7 @@
#include
#include
-#include
+#include
#include
#include "up_internal.h"
@@ -58,7 +58,7 @@
#include "chip.h"
#include "kinetis.h"
-#include "chip/kinetis_pwm.h"
+#include "kinetis_pwm.h"
#include "chip/kinetis_gpio.h"
#include "chip/kinetis_ftm.h"
#include "chip/kinetis_sim.h"
diff --git a/arch/arm/src/kl/Kconfig b/arch/arm/src/kl/Kconfig
index bfa40491538..7dd13a686b9 100644
--- a/arch/arm/src/kl/Kconfig
+++ b/arch/arm/src/kl/Kconfig
@@ -345,12 +345,12 @@ config KL_TPM2_CHANNEL
comment "Kinetis GPIO Interrupt Configuration"
-config GPIO_IRQ
+config KL_GPIOIRQ
bool "GPIO pin interrupts"
---help---
Enable support for interrupting GPIO pins
-if GPIO_IRQ
+if KL_GPIOIRQ
config KL_PORTAINTS
bool "GPIOA interrupts"
diff --git a/arch/arm/src/kl/Make.defs b/arch/arm/src/kl/Make.defs
index 105d267a73a..d7712f0983c 100644
--- a/arch/arm/src/kl/Make.defs
+++ b/arch/arm/src/kl/Make.defs
@@ -81,7 +81,7 @@ ifeq ($(CONFIG_BUILD_PROTECTED),y)
CHIP_CSRCS += kl_userspace.c
endif
-ifeq ($(CONFIG_GPIO_IRQ),y)
+ifeq ($(CONFIG_KL_GPIOIRQ),y)
CHIP_CSRCS += kl_gpioirq.c
endif
diff --git a/arch/arm/src/kl/kl_gpio.h b/arch/arm/src/kl/kl_gpio.h
index fc2cd7f37e9..0024e676086 100644
--- a/arch/arm/src/kl/kl_gpio.h
+++ b/arch/arm/src/kl/kl_gpio.h
@@ -386,7 +386,7 @@ xcpt_t kl_gpioirqattach(uint32_t pinset, xcpt_t pinisr);
*
************************************************************************************/
-#ifdef CONFIG_GPIO_IRQ
+#ifdef CONFIG_KL_GPIOIRQ
void kl_gpioirqenable(uint32_t pinset);
#else
# define kl_gpioirqenable(pinset)
@@ -400,7 +400,7 @@ void kl_gpioirqenable(uint32_t pinset);
*
************************************************************************************/
-#ifdef CONFIG_GPIO_IRQ
+#ifdef CONFIG_KL_GPIOIRQ
void kl_gpioirqdisable(uint32_t pinset);
#else
# define kl_gpioirqdisable(pinset)
diff --git a/arch/arm/src/kl/kl_gpioirq.c b/arch/arm/src/kl/kl_gpioirq.c
index 2b481bce3a2..61331343ccd 100644
--- a/arch/arm/src/kl/kl_gpioirq.c
+++ b/arch/arm/src/kl/kl_gpioirq.c
@@ -51,7 +51,7 @@
#include "chip/kl_port.h"
#include "kl_gpio.h"
-#ifdef CONFIG_GPIO_IRQ
+#ifdef CONFIG_KL_GPIOIRQ
/****************************************************************************
* Pre-processor Definitions
@@ -396,4 +396,4 @@ void kl_gpioirqdisable(uint32_t pinset)
}
#endif /* HAVE_PORTINTS */
}
-#endif /* CONFIG_GPIO_IRQ */
+#endif /* CONFIG_KL_GPIOIRQ */
diff --git a/arch/arm/src/kl/kl_irq.c b/arch/arm/src/kl/kl_irq.c
index b37f7afe1c9..94628f26bf7 100644
--- a/arch/arm/src/kl/kl_irq.c
+++ b/arch/arm/src/kl/kl_irq.c
@@ -248,7 +248,7 @@ void up_irqinitialize(void)
* configured pin interrupts.
*/
-#ifdef CONFIG_GPIO_IRQ
+#ifdef CONFIG_KL_GPIOIRQ
kl_gpioirqinitialize();
#endif
diff --git a/arch/arm/src/kl/kl_pwm.c b/arch/arm/src/kl/kl_pwm.c
index 6f3f6e40503..a34aa0f8175 100644
--- a/arch/arm/src/kl/kl_pwm.c
+++ b/arch/arm/src/kl/kl_pwm.c
@@ -48,7 +48,7 @@
#include
#include
-#include
+#include
#include
#include "up_internal.h"
diff --git a/arch/arm/src/kl/kl_pwm.h b/arch/arm/src/kl/kl_pwm.h
index f9afbcd7800..5b64e40967b 100644
--- a/arch/arm/src/kl/kl_pwm.h
+++ b/arch/arm/src/kl/kl_pwm.h
@@ -90,13 +90,13 @@
# elif CONFIG_KL_TPM0_CHANNEL == 1
# define PWM_TPM0_PINCFG GPIO_TPM0_CH1OUT
# elif CONFIG_KL_TPM0_CHANNEL == 2
-# define PWM_TPM0_PINCFG GPIO_TPM1_CH2OUT
+# define PWM_TPM0_PINCFG GPIO_TPM0_CH2OUT
# elif CONFIG_KL_TPM0_CHANNEL == 3
-# define PWM_TPM0_PINCFG GPIO_TPM1_CH3OUT
+# define PWM_TPM0_PINCFG GPIO_TPM0_CH3OUT
# elif CONFIG_KL_TPM0_CHANNEL == 4
-# define PWM_TPM0_PINCFG GPIO_TPM1_CH4OUT
+# define PWM_TPM0_PINCFG GPIO_TPM0_CH4OUT
# elif CONFIG_KL_TPM0_CHANNEL == 5
-# define PWM_TPM0_PINCFG GPIO_TPM1_CH5OUT
+# define PWM_TPM0_PINCFG GPIO_TPM0_CH5OUT
# else
# error "Unsupported value of CONFIG_KL_TPM1_CHANNEL"
# endif
diff --git a/arch/arm/src/lpc11xx/Kconfig b/arch/arm/src/lpc11xx/Kconfig
index 31a9711cf07..33ab254958b 100644
--- a/arch/arm/src/lpc11xx/Kconfig
+++ b/arch/arm/src/lpc11xx/Kconfig
@@ -237,7 +237,7 @@ config CAN_REGDEBUG
endmenu
-config GPIO_IRQ
+config LPC11_GPIOIRQ
bool "GPIO interrupt support"
default n
---help---
diff --git a/arch/arm/src/lpc11xx/Make.defs b/arch/arm/src/lpc11xx/Make.defs
index 041419c2488..a347d99946d 100644
--- a/arch/arm/src/lpc11xx/Make.defs
+++ b/arch/arm/src/lpc11xx/Make.defs
@@ -84,7 +84,7 @@ ifeq ($(CONFIG_BUILD_PROTECTED),y)
CHIP_CSRCS += lpc11_userspace.c
endif
-ifeq ($(CONFIG_GPIO_IRQ),y)
+ifeq ($(CONFIG_LPC11_GPIOIRQ),y)
CHIP_CSRCS += lpc11_gpioint.c
endif
diff --git a/arch/arm/src/lpc11xx/lpc111x_gpio.c b/arch/arm/src/lpc11xx/lpc111x_gpio.c
index 6a0718e11d7..cba1ee71734 100644
--- a/arch/arm/src/lpc11xx/lpc111x_gpio.c
+++ b/arch/arm/src/lpc11xx/lpc111x_gpio.c
@@ -79,7 +79,7 @@
* actually set up to interrupt until the interrupt is enabled.
*/
-#ifdef CONFIG_GPIO_IRQ
+#ifdef CONFIG_LPC11_GPIOIRQ
uint64_t g_intedge0;
uint64_t g_intedge2;
#endif
@@ -295,7 +295,7 @@ static int lpc11_pullup(lpc11_pinset_t cfgset, unsigned int port,
*
****************************************************************************/
-#ifdef CONFIG_GPIO_IRQ
+#ifdef CONFIG_LPC11_GPIOIRQ
static void lpc11_setintedge(unsigned int port, unsigned int pin,
unsigned int value)
{
@@ -323,7 +323,7 @@ static void lpc11_setintedge(unsigned int port, unsigned int pin,
*intedge &= ~((uint64_t)3 << shift);
*intedge |= ((uint64_t)value << shift);
}
-#endif /* CONFIG_GPIO_IRQ */
+#endif /* CONFIG_LPC11_GPIOIRQ */
/****************************************************************************
* Name: lpc11_setopendrain
@@ -453,7 +453,7 @@ static inline int lpc11_configinput(lpc11_pinset_t cfgset, unsigned int port,
/* Forget about any falling/rising edge interrupt enabled */
-#ifdef CONFIG_GPIO_IRQ
+#ifdef CONFIG_LPC11_GPIOIRQ
lpc11_setintedge(port, pin, 0);
#endif
}
@@ -495,7 +495,7 @@ static inline int lpc11_configinterrupt(lpc11_pinset_t cfgset, unsigned int port
/* Then just remember the rising/falling edge interrupt enabled */
DEBUGASSERT(port == 0 || port == 2);
-#ifdef CONFIG_GPIO_IRQ
+#ifdef CONFIG_LPC11_GPIOIRQ
lpc11_setintedge(port, pin, (cfgset & GPIO_EDGE_MASK) >> GPIO_EDGE_SHIFT);
#endif
return OK;
diff --git a/arch/arm/src/lpc11xx/lpc11_gpio.h b/arch/arm/src/lpc11xx/lpc11_gpio.h
index a0e1c2d8990..f77b748613e 100644
--- a/arch/arm/src/lpc11xx/lpc11_gpio.h
+++ b/arch/arm/src/lpc11xx/lpc11_gpio.h
@@ -88,7 +88,7 @@ extern "C"
* lpc11_gpioint.c, and lpc11_gpiodbg.c
*/
-#ifdef CONFIG_GPIO_IRQ
+#ifdef CONFIG_LPC11_GPIOIRQ
EXTERN uint64_t g_intedge0;
EXTERN uint64_t g_intedge2;
#endif
@@ -108,7 +108,7 @@ EXTERN const uint32_t g_intbase[GPIO_NPORTS];
*
************************************************************************************/
-#ifdef CONFIG_GPIO_IRQ
+#ifdef CONFIG_LPC11_GPIOIRQ
void lpc11_gpioirqinitialize(void);
#else
# define lpc11_gpioirqinitialize()
@@ -152,7 +152,7 @@ bool lpc11_gpioread(lpc11_pinset_t pinset);
*
************************************************************************************/
-#ifdef CONFIG_GPIO_IRQ
+#ifdef CONFIG_LPC11_GPIOIRQ
void lpc11_gpioirqenable(int irq);
#else
# define lpc11_gpioirqenable(irq)
@@ -166,7 +166,7 @@ void lpc11_gpioirqenable(int irq);
*
************************************************************************************/
-#ifdef CONFIG_GPIO_IRQ
+#ifdef CONFIG_LPC11_GPIOIRQ
void lpc11_gpioirqdisable(int irq);
#else
# define lpc11_gpioirqdisable(irq)
diff --git a/arch/arm/src/lpc11xx/lpc11_gpioint.c b/arch/arm/src/lpc11xx/lpc11_gpioint.c
index 4ce6b48c9ed..8aaefed1497 100644
--- a/arch/arm/src/lpc11xx/lpc11_gpioint.c
+++ b/arch/arm/src/lpc11xx/lpc11_gpioint.c
@@ -51,7 +51,7 @@
#include "chip.h"
#include "lpc11_gpio.h"
-#ifdef CONFIG_GPIO_IRQ
+#ifdef CONFIG_LPC11_GPIOIRQ
/****************************************************************************
* Pre-processor Definitions
@@ -543,5 +543,5 @@ void lpc11_gpioirqdisable(int irq)
}
}
-#endif /* CONFIG_GPIO_IRQ */
+#endif /* CONFIG_LPC11_GPIOIRQ */
diff --git a/arch/arm/src/lpc11xx/lpc11_irq.c b/arch/arm/src/lpc11xx/lpc11_irq.c
index f861943bc0a..4399c582003 100644
--- a/arch/arm/src/lpc11xx/lpc11_irq.c
+++ b/arch/arm/src/lpc11xx/lpc11_irq.c
@@ -244,7 +244,7 @@ void up_irqinitialize(void)
* configured pin interrupts.
*/
-#ifdef CONFIG_GPIO_IRQ
+#ifdef CONFIG_LPC11_GPIOIRQ
lpc11_gpioirqinitialize();
#endif
diff --git a/arch/arm/src/lpc11xx/lpc11_timer.c b/arch/arm/src/lpc11xx/lpc11_timer.c
index e742dc2de0b..a9ce65a073a 100644
--- a/arch/arm/src/lpc11xx/lpc11_timer.c
+++ b/arch/arm/src/lpc11xx/lpc11_timer.c
@@ -47,7 +47,7 @@
#include
#include
-#include
+#include
#include
#include "up_internal.h"
diff --git a/arch/arm/src/lpc17xx/Kconfig b/arch/arm/src/lpc17xx/Kconfig
index abfd205fedc..5038000d865 100644
--- a/arch/arm/src/lpc17xx/Kconfig
+++ b/arch/arm/src/lpc17xx/Kconfig
@@ -604,7 +604,7 @@ config LPC17_CAN_REGDEBUG
endmenu
-config GPIO_IRQ
+config LPC17_GPIOIRQ
bool "GPIO interrupt support"
default n
---help---
diff --git a/arch/arm/src/lpc17xx/Make.defs b/arch/arm/src/lpc17xx/Make.defs
index 919f70e7579..f1dd3cde114 100644
--- a/arch/arm/src/lpc17xx/Make.defs
+++ b/arch/arm/src/lpc17xx/Make.defs
@@ -133,7 +133,7 @@ ifeq ($(CONFIG_LPC17_EMC),y)
CHIP_CSRCS += lpc17_emc.c
endif
-ifeq ($(CONFIG_GPIO_IRQ),y)
+ifeq ($(CONFIG_LPC17_GPIOIRQ),y)
CHIP_CSRCS += lpc17_gpioint.c
endif
diff --git a/arch/arm/src/lpc17xx/lpc176x_gpio.c b/arch/arm/src/lpc17xx/lpc176x_gpio.c
index 7de2fd04bcc..b2b8e9805ab 100644
--- a/arch/arm/src/lpc17xx/lpc176x_gpio.c
+++ b/arch/arm/src/lpc17xx/lpc176x_gpio.c
@@ -78,7 +78,7 @@
* actually set up to interrupt until the interrupt is enabled.
*/
-#ifdef CONFIG_GPIO_IRQ
+#ifdef CONFIG_LPC17_GPIOIRQ
uint64_t g_intedge0;
uint64_t g_intedge2;
#endif
@@ -300,7 +300,7 @@ static int lpc17_pullup(lpc17_pinset_t cfgset, unsigned int port,
*
****************************************************************************/
-#ifdef CONFIG_GPIO_IRQ
+#ifdef CONFIG_LPC17_GPIOIRQ
static void lpc17_setintedge(unsigned int port, unsigned int pin,
unsigned int value)
{
@@ -328,7 +328,7 @@ static void lpc17_setintedge(unsigned int port, unsigned int pin,
*intedge &= ~((uint64_t)3 << shift);
*intedge |= ((uint64_t)value << shift);
}
-#endif /* CONFIG_GPIO_IRQ */
+#endif /* CONFIG_LPC17_GPIOIRQ */
/****************************************************************************
* Name: lpc17_setopendrain
@@ -412,7 +412,7 @@ static inline int lpc17_configinput(lpc17_pinset_t cfgset, unsigned int port, un
/* Forget about any falling/rising edge interrupt enabled */
-#ifdef CONFIG_GPIO_IRQ
+#ifdef CONFIG_LPC17_GPIOIRQ
lpc17_setintedge(port, pin, 0);
#endif
}
@@ -453,7 +453,7 @@ static inline int lpc17_configinterrupt(lpc17_pinset_t cfgset, unsigned int port
/* Then just remember the rising/falling edge interrupt enabled */
DEBUGASSERT(port == 0 || port == 2);
-#ifdef CONFIG_GPIO_IRQ
+#ifdef CONFIG_LPC17_GPIOIRQ
lpc17_setintedge(port, pin, (cfgset & GPIO_EDGE_MASK) >> GPIO_EDGE_SHIFT);
#endif
return OK;
diff --git a/arch/arm/src/lpc17xx/lpc178x_gpio.c b/arch/arm/src/lpc17xx/lpc178x_gpio.c
index a30b7d42558..a6892d597f6 100644
--- a/arch/arm/src/lpc17xx/lpc178x_gpio.c
+++ b/arch/arm/src/lpc17xx/lpc178x_gpio.c
@@ -79,7 +79,7 @@
* actually set up to interrupt until the interrupt is enabled.
*/
-#ifdef CONFIG_GPIO_IRQ
+#ifdef CONFIG_LPC17_GPIOIRQ
uint64_t g_intedge0;
uint64_t g_intedge2;
#endif
@@ -526,7 +526,7 @@ static void lpc17_setpullup(lpc17_pinset_t cfgset, unsigned int port,
*
****************************************************************************/
-#ifdef CONFIG_GPIO_IRQ
+#ifdef CONFIG_LPC17_GPIOIRQ
static void lpc17_setintedge(unsigned int port, unsigned int pin,
unsigned int value)
{
@@ -554,7 +554,7 @@ static void lpc17_setintedge(unsigned int port, unsigned int pin,
*intedge &= ~((uint64_t)3 << shift);
*intedge |= ((uint64_t)value << shift);
}
-#endif /* CONFIG_GPIO_IRQ */
+#endif /* CONFIG_LPC17_GPIOIRQ */
/****************************************************************************
* Name: lpc17_configinput
@@ -601,7 +601,7 @@ static inline int lpc17_configinput(lpc17_pinset_t cfgset, unsigned int port,
/* Forget about any falling/rising edge interrupt enabled */
-#ifdef CONFIG_GPIO_IRQ
+#ifdef CONFIG_LPC17_GPIOIRQ
lpc17_setintedge(port, pin, 0);
#endif
}
@@ -656,7 +656,7 @@ static inline int lpc17_configinterrupt(lpc17_pinset_t cfgset, unsigned int port
/* Then just remember the rising/falling edge interrupt enabled */
DEBUGASSERT(port == 0 || port == 2);
-#ifdef CONFIG_GPIO_IRQ
+#ifdef CONFIG_LPC17_GPIOIRQ
lpc17_setintedge(port, pin, (cfgset & GPIO_EDGE_MASK) >> GPIO_EDGE_SHIFT);
#endif
return OK;
diff --git a/arch/arm/src/lpc17xx/lpc17_can.c b/arch/arm/src/lpc17xx/lpc17_can.c
index f25de325b9f..f961bef5493 100644
--- a/arch/arm/src/lpc17xx/lpc17_can.c
+++ b/arch/arm/src/lpc17xx/lpc17_can.c
@@ -57,7 +57,7 @@
#include
#include
#include
-#include
+#include
#include "up_internal.h"
#include "up_arch.h"
diff --git a/arch/arm/src/lpc17xx/lpc17_gpio.h b/arch/arm/src/lpc17xx/lpc17_gpio.h
index 1129a26235d..6aab5b9f84c 100644
--- a/arch/arm/src/lpc17xx/lpc17_gpio.h
+++ b/arch/arm/src/lpc17xx/lpc17_gpio.h
@@ -89,7 +89,7 @@ extern "C"
* lpc17_gpioint.c, and lpc17_gpiodbg.c
*/
-#ifdef CONFIG_GPIO_IRQ
+#ifdef CONFIG_LPC17_GPIOIRQ
EXTERN uint64_t g_intedge0;
EXTERN uint64_t g_intedge2;
#endif
@@ -109,7 +109,7 @@ EXTERN const uint32_t g_intbase[GPIO_NPORTS];
*
************************************************************************************/
-#ifdef CONFIG_GPIO_IRQ
+#ifdef CONFIG_LPC17_GPIOIRQ
void lpc17_gpioirqinitialize(void);
#else
# define lpc17_gpioirqinitialize()
@@ -153,7 +153,7 @@ bool lpc17_gpioread(lpc17_pinset_t pinset);
*
************************************************************************************/
-#ifdef CONFIG_GPIO_IRQ
+#ifdef CONFIG_LPC17_GPIOIRQ
void lpc17_gpioirqenable(int irq);
#else
# define lpc17_gpioirqenable(irq)
@@ -167,7 +167,7 @@ void lpc17_gpioirqenable(int irq);
*
************************************************************************************/
-#ifdef CONFIG_GPIO_IRQ
+#ifdef CONFIG_LPC17_GPIOIRQ
void lpc17_gpioirqdisable(int irq);
#else
# define lpc17_gpioirqdisable(irq)
diff --git a/arch/arm/src/lpc17xx/lpc17_gpioint.c b/arch/arm/src/lpc17xx/lpc17_gpioint.c
index 46acb05e6fa..0c1ca613625 100644
--- a/arch/arm/src/lpc17xx/lpc17_gpioint.c
+++ b/arch/arm/src/lpc17xx/lpc17_gpioint.c
@@ -51,7 +51,7 @@
#include "chip.h"
#include "lpc17_gpio.h"
-#ifdef CONFIG_GPIO_IRQ
+#ifdef CONFIG_LPC17_GPIOIRQ
/****************************************************************************
* Pre-processor Definitions
@@ -543,4 +543,4 @@ void lpc17_gpioirqdisable(int irq)
}
}
-#endif /* CONFIG_GPIO_IRQ */
+#endif /* CONFIG_LPC17_GPIOIRQ */
diff --git a/arch/arm/src/lpc17xx/lpc17_irq.c b/arch/arm/src/lpc17xx/lpc17_irq.c
index 44d149c7342..ac8fb8855cd 100644
--- a/arch/arm/src/lpc17xx/lpc17_irq.c
+++ b/arch/arm/src/lpc17xx/lpc17_irq.c
@@ -412,7 +412,7 @@ void up_irqinitialize(void)
* GPIO pins.
*/
-#ifdef CONFIG_GPIO_IRQ
+#ifdef CONFIG_LPC17_GPIOIRQ
lpc17_gpioirqinitialize();
#endif
@@ -456,7 +456,7 @@ void up_disable_irq(int irq)
putreg32(regval, regaddr);
}
}
-#ifdef CONFIG_GPIO_IRQ
+#ifdef CONFIG_LPC17_GPIOIRQ
else if (irq >= LPC17_VALID_FIRST0L)
{
/* Maybe it is a (derived) GPIO IRQ */
@@ -501,7 +501,7 @@ void up_enable_irq(int irq)
putreg32(regval, regaddr);
}
}
-#ifdef CONFIG_GPIO_IRQ
+#ifdef CONFIG_LPC17_GPIOIRQ
else if (irq >= LPC17_VALID_FIRST0L)
{
/* Maybe it is a (derived) GPIO IRQ */
diff --git a/arch/arm/src/lpc17xx/lpc17_mcpwm.c b/arch/arm/src/lpc17xx/lpc17_mcpwm.c
index be526964c4a..db0d1a9d67d 100644
--- a/arch/arm/src/lpc17xx/lpc17_mcpwm.c
+++ b/arch/arm/src/lpc17xx/lpc17_mcpwm.c
@@ -47,7 +47,7 @@
#include
#include
-#include
+#include
#include
#include "up_internal.h"
diff --git a/arch/arm/src/lpc17xx/lpc17_pwm.c b/arch/arm/src/lpc17xx/lpc17_pwm.c
index dc073fc1a73..c284934570c 100644
--- a/arch/arm/src/lpc17xx/lpc17_pwm.c
+++ b/arch/arm/src/lpc17xx/lpc17_pwm.c
@@ -47,7 +47,7 @@
#include
#include
-#include
+#include
#include
#include "up_internal.h"
diff --git a/arch/arm/src/lpc17xx/lpc17_timer.c b/arch/arm/src/lpc17xx/lpc17_timer.c
index 9278578b678..434f416021f 100644
--- a/arch/arm/src/lpc17xx/lpc17_timer.c
+++ b/arch/arm/src/lpc17xx/lpc17_timer.c
@@ -47,7 +47,7 @@
#include
#include
-#include
+#include
#include
#include "up_internal.h"
diff --git a/arch/arm/src/lpc43xx/Kconfig b/arch/arm/src/lpc43xx/Kconfig
index e7f830ed2ba..80da35c00ca 100644
--- a/arch/arm/src/lpc43xx/Kconfig
+++ b/arch/arm/src/lpc43xx/Kconfig
@@ -81,36 +81,43 @@ config ARCH_FAMILY_LPC4320
bool
default y if ARCH_CHIP_LPC4320FBD144 || ARCH_CHIP_LPC4320FET100
select ARCH_HAVE_TICKLESS
+ select ARCH_HAVE_AHB_SRAM_BANK1
config ARCH_FAMILY_LPC4330
bool
default y if ARCH_CHIP_LPC4330FBD144 || ARCH_CHIP_LPC4330FET100 || ARCH_CHIP_LPC4330FET180 || ARCH_CHIP_LPC4330FET256 || ARCH_CHIP_LPC4337JET100
select ARCH_HAVE_TICKLESS
+ select ARCH_HAVE_AHB_SRAM_BANK1
config ARCH_FAMILY_LPC4337
bool
default y if ARCH_CHIP_LPC4337JBD144
select ARCH_HAVE_TICKLESS
+ select ARCH_HAVE_AHB_SRAM_BANK1
config ARCH_FAMILY_LPC4350
bool
default y if ARCH_CHIP_LPC4350FBD208 || ARCH_CHIP_LPC4350FET180 || ARCH_CHIP_LPC4350FET256
select ARCH_HAVE_TICKLESS
+ select ARCH_HAVE_AHB_SRAM_BANK1
config ARCH_FAMILY_LPC4353
bool
default y if ARCH_CHIP_LPC4353FBD208 || ARCH_CHIP_LPC4353FET180 || ARCH_CHIP_LPC4353FET256
select ARCH_HAVE_TICKLESS
+ select ARCH_HAVE_AHB_SRAM_BANK1
config ARCH_FAMILY_LPC4357
bool
default y if ARCH_CHIP_LPC4357FET180 || ARCH_CHIP_LPC4357FBD208 || ARCH_CHIP_LPC4357FET256
select ARCH_HAVE_TICKLESS
+ select ARCH_HAVE_AHB_SRAM_BANK1
config ARCH_FAMILY_LPC4370
bool
default y if ARCH_CHIP_LPC4370FET100
select ARCH_HAVE_TICKLESS
+ select ARCH_HAVE_AHB_SRAM_BANK1
choice
prompt "LPC43XX Boot Configuration"
@@ -177,9 +184,15 @@ config LPC43_DAC
config LPC43_EMC
bool "External Memory Controller (EMC)"
default n
+ select ARCH_HAVE_EXTSDRAM0
+ select ARCH_HAVE_EXTSDRAM1
+ select ARCH_HAVE_EXTSDRAM2
+ select ARCH_HAVE_EXTSDRAM3
config LPC43_ETHERNET
bool "Ethernet"
+ select NETDEVICES
+ select ARCH_HAVE_PHY
default n
config LPC43_EVNTMNTR
@@ -320,6 +333,158 @@ config LPC43_GPIO_IRQ
---help---
Enable support for GPIO interrupts
+menu "Internal Memory Configuration"
+
+config ARCH_HAVE_AHB_SRAM_BANK1
+ bool
+
+if !LPC43_BOOT_SRAM
+
+config LPC43_USE_LOCSRAM_BANK1
+ bool "Use local SRAM bank 1 memory region"
+ default n
+ ---help---
+ Add local SRAM bank 1 memory region.
+
+endif # LPC43_BOOT_SRAM
+
+config LPC43_USE_AHBSRAM_BANK0
+ bool "Use AHB SRAM bank 0 memory region"
+ default n
+ ---help---
+ Add local AHB SRAM bank 0 memory region.
+
+config LPC43_USE_AHBSRAM_BANK1
+ bool "Use AHB SRAM bank 1 memory region"
+ default n
+ depends on ARCH_HAVE_AHB_SRAM_BANK1
+ ---help---
+ Add local AHB SRAM bank 1 memory region.
+
+config LPC43_HEAP_AHBSRAM_BANK2
+ bool "Use AHB SRAM bank 2 (ETB SRAM) memory region"
+ default n
+ ---help---
+ Add local AHB SRAM bank 2 (ETB SRAM) memory region.
+
+endmenu # LPC43xx Internal Memory Configuration
+
+menu "External Memory Configuration"
+
+config ARCH_HAVE_EXTSDRAM0
+ bool
+
+config ARCH_HAVE_EXTSDRAM1
+ bool
+
+config ARCH_HAVE_EXTSDRAM2
+ bool
+
+config ARCH_HAVE_EXTSDRAM3
+ bool
+
+config LPC43_EXTSDRAM0
+ bool "Configure external SDRAM0 (on DYNCS0)"
+ default n
+ depends on ARCH_HAVE_EXTSDRAM0
+ select ARCH_HAVE_EXTSDRAM
+ ---help---
+ Configure external SDRAM memory and, if applicable, map then external
+ SDRAM into the memory map.
+
+if LPC43_EXTSDRAM0
+
+config LPC43_EXTSDRAM0_SIZE
+ int "External SDRAM0 size"
+ default 0
+ ---help---
+ Size of the external SDRAM on DYNCS0 in bytes.
+
+config LPC43_EXTSDRAM0_HEAP
+ bool "Add external SDRAM on DYNCS0 to the heap"
+ default y
+ ---help---
+ Add the external SDRAM on DYNCS0 into the heap.
+
+endif # LCP43_EXTSDRAM0
+
+config LPC43_EXTSDRAM1
+ bool "Configure external SDRAM1 (on DYNCS1)"
+ default n
+ depends on ARCH_HAVE_EXTSDRAM1
+ select ARCH_HAVE_EXTSDRAM
+ ---help---
+ Configure external SDRAM memoryand, if applicable, map then external
+ SDRAM into the memory map.
+
+if LPC43_EXTSDRAM1
+
+config LPC43_EXTSDRAM1_SIZE
+ int "External SDRAM1 size"
+ default 0
+ ---help---
+ Size of the external SDRAM on DYNCS1 in bytes.
+
+config LPC43_EXTSDRAM1_HEAP
+ bool "Add external SDRAM on DYNCS1 to the heap"
+ default y
+ ---help---
+ Add the external SDRAM on DYNCS1 into the heap.
+
+endif # LCP43_EXTSDRAM1
+
+config LPC43_EXTSDRAM2
+ bool "Configure external SDRAM2 (on DYNCS2)"
+ default n
+ depends on ARCH_HAVE_EXTSDRAM2
+ select ARCH_HAVE_EXTSDRAM
+ ---help---
+ Configure external SDRAM memoryand, if applicable, map then external
+ SDRAM into the memory map.
+
+if LPC43_EXTSDRAM2
+
+config LPC43_EXTSDRAM2_SIZE
+ int "External SDRAM2 size"
+ default 0
+ ---help---
+ Size of the external SDRAM on DYNCS2 in bytes.
+
+config LPC43_EXTSDRAM2_HEAP
+ bool "Add external SDRAM on DYNCS2 to the heap"
+ default y
+ ---help---
+ Add the external SDRAM on DYNCS2 into the heap.
+
+endif # LCP43_EXTSDRAM2
+
+config LPC43_EXTSDRAM3
+ bool "Configure external SDRAM3 (on DYNCS3)"
+ default n
+ depends on ARCH_HAVE_EXTSDRAM3
+ select ARCH_HAVE_EXTSDRAM
+ ---help---
+ Configure external SDRAM memoryand, if applicable, map then external
+ SDRAM into the memory map.
+
+if LPC43_EXTSDRAM3
+
+config LPC43_EXTSDRAM3_SIZE
+ int "External SDRAM3 size"
+ default 0
+ ---help---
+ Size of the external SDRAM in bytes.
+
+config LPC43_EXTSDRAM3_HEAP
+ bool "Add external SDRAM on DYNCS3 to the heap"
+ default y
+ ---help---
+ Add the external SDRAM on DYNCS3 into the heap.
+
+endif # LCP43_EXTSDRAM3
+
+endmenu # External Memory Configuration
+
if LPC43_ETHERNET
menu "Ethernet MAC configuration"
diff --git a/arch/arm/src/lpc43xx/Make.defs b/arch/arm/src/lpc43xx/Make.defs
index 6e5d7ef3a78..79ddaa4a022 100644
--- a/arch/arm/src/lpc43xx/Make.defs
+++ b/arch/arm/src/lpc43xx/Make.defs
@@ -126,6 +126,10 @@ ifeq ($(CONFIG_LPC43_ETHERNET),y)
CHIP_CSRCS += lpc43_ethernet.c
endif
+ifeq ($(CONFIG_LPC43_EMC),y)
+CHIP_CSRCS += lpc43_emc.c
+endif
+
ifeq ($(CONFIG_LPC43_SPI),y)
CHIP_CSRCS += lpc43_spi.c
else
diff --git a/arch/arm/src/lpc43xx/chip/lpc435357_memorymap.h b/arch/arm/src/lpc43xx/chip/lpc435357_memorymap.h
index 1b8312c965f..852bd2a862e 100644
--- a/arch/arm/src/lpc43xx/chip/lpc435357_memorymap.h
+++ b/arch/arm/src/lpc43xx/chip/lpc435357_memorymap.h
@@ -90,6 +90,8 @@
/* AHB SRAM */
#define LPC43_AHBSRAM_BANK0_BASE (LPC43_AHBSRAM_BASE)
+#define LPC43_AHBSRAM_BANK1_BASE (LPC43_AHBSRAM_BASE + 0x00008000)
+#define LPC43_AHBSRAM_BANK2_BASE (LPC43_AHBSRAM_BASE + 0x0000c000)
#define LPC43_EEPROM_BASE (LPC43_AHBSRAM_BASE + 0x00004000)
#define LPC43_AHBSRAM_BITBAND_BASE (LPC43_AHBSRAM_BASE + 0x02000000)
diff --git a/arch/arm/src/lpc43xx/chip/lpc4357fet256_pinconfig.h b/arch/arm/src/lpc43xx/chip/lpc4357fet256_pinconfig.h
index b29722479a3..41a5d939540 100644
--- a/arch/arm/src/lpc43xx/chip/lpc4357fet256_pinconfig.h
+++ b/arch/arm/src/lpc43xx/chip/lpc4357fet256_pinconfig.h
@@ -190,86 +190,86 @@
#define PINCONF_CTOUT15_2 (PINCONF_FUNC1|PINCONF_PINSD|PINCONF_PIN_0)
#define PINCONF_CTOUT15_3 (PINCONF_FUNC2|PINCONF_PINS1|PINCONF_PIN_11)
-#define PINCONF_EMC_A0 (PINCONF_FUNC3|PINCONF_PINS2|PINCONF_PIN_9)
-#define PINCONF_EMC_A1 (PINCONF_FUNC3|PINCONF_PINS2|PINCONF_PIN_10)
-#define PINCONF_EMC_A2 (PINCONF_FUNC3|PINCONF_PINS2|PINCONF_PIN_11)
-#define PINCONF_EMC_A3 (PINCONF_FUNC3|PINCONF_PINS2|PINCONF_PIN_12)
-#define PINCONF_EMC_A4 (PINCONF_FUNC3|PINCONF_PINS2|PINCONF_PIN_13)
-#define PINCONF_EMC_A5 (PINCONF_FUNC2|PINCONF_PINS1|PINCONF_PIN_0)
-#define PINCONF_EMC_A6 (PINCONF_FUNC2|PINCONF_PINS1|PINCONF_PIN_1)
-#define PINCONF_EMC_A7 (PINCONF_FUNC2|PINCONF_PINS1|PINCONF_PIN_2)
-#define PINCONF_EMC_A8 (PINCONF_FUNC3|PINCONF_PINS2|PINCONF_PIN_8)
-#define PINCONF_EMC_A9 (PINCONF_FUNC3|PINCONF_PINS2|PINCONF_PIN_7)
-#define PINCONF_EMC_A10 (PINCONF_FUNC2|PINCONF_PINS2|PINCONF_PIN_6)
-#define PINCONF_EMC_A11 (PINCONF_FUNC2|PINCONF_PINS2|PINCONF_PIN_2)
-#define PINCONF_EMC_A12 (PINCONF_FUNC2|PINCONF_PINS2|PINCONF_PIN_1)
-#define PINCONF_EMC_A13 (PINCONF_FUNC2|PINCONF_PINS2|PINCONF_PIN_0)
-#define PINCONF_EMC_A14 (PINCONF_FUNC1|PINCONF_PINS6|PINCONF_PIN_8)
-#define PINCONF_EMC_A15 (PINCONF_FUNC1|PINCONF_PINS6|PINCONF_PIN_7)
-#define PINCONF_EMC_A16 (PINCONF_FUNC2|PINCONF_PINSD|PINCONF_PIN_16)
-#define PINCONF_EMC_A17 (PINCONF_FUNC2|PINCONF_PINSD|PINCONF_PIN_15)
-#define PINCONF_EMC_A18 (PINCONF_FUNC3|PINCONF_PINSE|PINCONF_PIN_0)
-#define PINCONF_EMC_A19 (PINCONF_FUNC3|PINCONF_PINSE|PINCONF_PIN_1)
-#define PINCONF_EMC_A20 (PINCONF_FUNC3|PINCONF_PINSE|PINCONF_PIN_2)
-#define PINCONF_EMC_A21 (PINCONF_FUNC3|PINCONF_PINSE|PINCONF_PIN_3)
-#define PINCONF_EMC_A22 (PINCONF_FUNC3|PINCONF_PINSE|PINCONF_PIN_4)
-#define PINCONF_EMC_A23 (PINCONF_FUNC3|PINCONF_PINSA|PINCONF_PIN_4)
-#define PINCONF_EMC_BLS0 (PINCONF_FUNC3|PINCONF_PINS1|PINCONF_PIN_4)
-#define PINCONF_EMC_BLS1 (PINCONF_FUNC1|PINCONF_PINS6|PINCONF_PIN_6)
-#define PINCONF_EMC_BLS2 (PINCONF_FUNC2|PINCONF_PINSD|PINCONF_PIN_13)
-#define PINCONF_EMC_BLS3 (PINCONF_FUNC2|PINCONF_PINSD|PINCONF_PIN_10)
-#define PINCONF_EMC_CAS (PINCONF_FUNC3|PINCONF_PINS6|PINCONF_PIN_4)
-#define PINCONF_EMC_CKEOUT0 (PINCONF_FUNC3|PINCONF_PINS6|PINCONF_PIN_11)
-#define PINCONF_EMC_CKEOUT1 (PINCONF_FUNC1|PINCONF_PINS6|PINCONF_PIN_2)
-#define PINCONF_EMC_CKEOUT2 (PINCONF_FUNC2|PINCONF_PINSD|PINCONF_PIN_1)
-#define PINCONF_EMC_CKEOUT3 (PINCONF_FUNC3|PINCONF_PINSE|PINCONF_PIN_15)
-#define PINCONF_EMC_CS0 (PINCONF_FUNC3|PINCONF_PINS1|PINCONF_PIN_5)
-#define PINCONF_EMC_CS1 (PINCONF_FUNC3|PINCONF_PINS6|PINCONF_PIN_3)
-#define PINCONF_EMC_CS2 (PINCONF_FUNC2|PINCONF_PINSD|PINCONF_PIN_12)
-#define PINCONF_EMC_CS3 (PINCONF_FUNC2|PINCONF_PINSD|PINCONF_PIN_11)
-#define PINCONF_EMC_D0 (PINCONF_FUNC3|PINCONF_PINS1|PINCONF_PIN_7)
-#define PINCONF_EMC_D1 (PINCONF_FUNC3|PINCONF_PINS1|PINCONF_PIN_8)
-#define PINCONF_EMC_D2 (PINCONF_FUNC3|PINCONF_PINS1|PINCONF_PIN_9)
-#define PINCONF_EMC_D3 (PINCONF_FUNC3|PINCONF_PINS1|PINCONF_PIN_10)
-#define PINCONF_EMC_D4 (PINCONF_FUNC3|PINCONF_PINS1|PINCONF_PIN_11)
-#define PINCONF_EMC_D5 (PINCONF_FUNC3|PINCONF_PINS1|PINCONF_PIN_12)
-#define PINCONF_EMC_D6 (PINCONF_FUNC3|PINCONF_PINS1|PINCONF_PIN_13)
-#define PINCONF_EMC_D7 (PINCONF_FUNC3|PINCONF_PINS1|PINCONF_PIN_14)
-#define PINCONF_EMC_D8 (PINCONF_FUNC2|PINCONF_PINS5|PINCONF_PIN_4)
-#define PINCONF_EMC_D9 (PINCONF_FUNC2|PINCONF_PINS5|PINCONF_PIN_5)
-#define PINCONF_EMC_D10 (PINCONF_FUNC2|PINCONF_PINS5|PINCONF_PIN_6)
-#define PINCONF_EMC_D11 (PINCONF_FUNC2|PINCONF_PINS5|PINCONF_PIN_7)
-#define PINCONF_EMC_D12 (PINCONF_FUNC2|PINCONF_PINS5|PINCONF_PIN_0)
-#define PINCONF_EMC_D13 (PINCONF_FUNC2|PINCONF_PINS5|PINCONF_PIN_1)
-#define PINCONF_EMC_D14 (PINCONF_FUNC2|PINCONF_PINS5|PINCONF_PIN_2)
-#define PINCONF_EMC_D15 (PINCONF_FUNC2|PINCONF_PINS5|PINCONF_PIN_3)
-#define PINCONF_EMC_D16 (PINCONF_FUNC2|PINCONF_PINSD|PINCONF_PIN_2)
-#define PINCONF_EMC_D17 (PINCONF_FUNC2|PINCONF_PINSD|PINCONF_PIN_3)
-#define PINCONF_EMC_D18 (PINCONF_FUNC2|PINCONF_PINSD|PINCONF_PIN_4)
-#define PINCONF_EMC_D19 (PINCONF_FUNC2|PINCONF_PINSD|PINCONF_PIN_5)
-#define PINCONF_EMC_D20 (PINCONF_FUNC2|PINCONF_PINSD|PINCONF_PIN_6)
-#define PINCONF_EMC_D21 (PINCONF_FUNC2|PINCONF_PINSD|PINCONF_PIN_7)
-#define PINCONF_EMC_D22 (PINCONF_FUNC2|PINCONF_PINSD|PINCONF_PIN_8)
-#define PINCONF_EMC_D23 (PINCONF_FUNC2|PINCONF_PINSD|PINCONF_PIN_9)
-#define PINCONF_EMC_D24 (PINCONF_FUNC3|PINCONF_PINSE|PINCONF_PIN_5)
-#define PINCONF_EMC_D25 (PINCONF_FUNC3|PINCONF_PINSE|PINCONF_PIN_6)
-#define PINCONF_EMC_D26 (PINCONF_FUNC3|PINCONF_PINSE|PINCONF_PIN_7)
-#define PINCONF_EMC_D27 (PINCONF_FUNC3|PINCONF_PINSE|PINCONF_PIN_8)
-#define PINCONF_EMC_D28 (PINCONF_FUNC3|PINCONF_PINSE|PINCONF_PIN_9)
-#define PINCONF_EMC_D29 (PINCONF_FUNC3|PINCONF_PINSE|PINCONF_PIN_10)
-#define PINCONF_EMC_D30 (PINCONF_FUNC3|PINCONF_PINSE|PINCONF_PIN_11)
-#define PINCONF_EMC_D31 (PINCONF_FUNC3|PINCONF_PINSE|PINCONF_PIN_12)
-#define PINCONF_EMC_DQMOUT0 (PINCONF_FUNC3|PINCONF_PINS6|PINCONF_PIN_12)
-#define PINCONF_EMC_DQMOUT1 (PINCONF_FUNC3|PINCONF_PINS6|PINCONF_PIN_10)
-#define PINCONF_EMC_DQMOUT2 (PINCONF_FUNC2|PINCONF_PINSD|PINCONF_PIN_0)
-#define PINCONF_EMC_DQMOUT3 (PINCONF_FUNC3|PINCONF_PINSE|PINCONF_PIN_13)
-#define PINCONF_EMC_DYCS0 (PINCONF_FUNC3|PINCONF_PINS6|PINCONF_PIN_9)
-#define PINCONF_EMC_DYCS1 (PINCONF_FUNC1|PINCONF_PINS6|PINCONF_PIN_1)
-#define PINCONF_EMC_DYCS2 (PINCONF_FUNC2|PINCONF_PINSD|PINCONF_PIN_14)
-#define PINCONF_EMC_DYCS3 (PINCONF_FUNC3|PINCONF_PINSE|PINCONF_PIN_14)
-#define PINCONF_EMC_OE (PINCONF_FUNC3|PINCONF_PINS1|PINCONF_PIN_3)
-#define PINCONF_EMC_RAS (PINCONF_FUNC3|PINCONF_PINS6|PINCONF_PIN_5)
-#define PINCONF_EMC_WE (PINCONF_FUNC3|PINCONF_PINS1|PINCONF_PIN_6)
+#define PINCONF_EMC_A0 (PINCONF_FUNC3|PINCONF_INBUFFER|PINCONF_GLITCH|PINCONF_SLEW_FAST|PINCONF_PINS2|PINCONF_PIN_9)
+#define PINCONF_EMC_A1 (PINCONF_FUNC3|PINCONF_INBUFFER|PINCONF_GLITCH|PINCONF_SLEW_FAST|PINCONF_PINS2|PINCONF_PIN_10)
+#define PINCONF_EMC_A2 (PINCONF_FUNC3|PINCONF_INBUFFER|PINCONF_GLITCH|PINCONF_SLEW_FAST|PINCONF_PINS2|PINCONF_PIN_11)
+#define PINCONF_EMC_A3 (PINCONF_FUNC3|PINCONF_INBUFFER|PINCONF_GLITCH|PINCONF_SLEW_FAST|PINCONF_PINS2|PINCONF_PIN_12)
+#define PINCONF_EMC_A4 (PINCONF_FUNC3|PINCONF_INBUFFER|PINCONF_GLITCH|PINCONF_SLEW_FAST|PINCONF_PINS2|PINCONF_PIN_13)
+#define PINCONF_EMC_A5 (PINCONF_FUNC2|PINCONF_INBUFFER|PINCONF_GLITCH|PINCONF_SLEW_FAST|PINCONF_PINS1|PINCONF_PIN_0)
+#define PINCONF_EMC_A6 (PINCONF_FUNC2|PINCONF_INBUFFER|PINCONF_GLITCH|PINCONF_SLEW_FAST|PINCONF_PINS1|PINCONF_PIN_1)
+#define PINCONF_EMC_A7 (PINCONF_FUNC2|PINCONF_INBUFFER|PINCONF_GLITCH|PINCONF_SLEW_FAST|PINCONF_PINS1|PINCONF_PIN_2)
+#define PINCONF_EMC_A8 (PINCONF_FUNC3|PINCONF_INBUFFER|PINCONF_GLITCH|PINCONF_SLEW_FAST|PINCONF_PINS2|PINCONF_PIN_8)
+#define PINCONF_EMC_A9 (PINCONF_FUNC3|PINCONF_INBUFFER|PINCONF_GLITCH|PINCONF_SLEW_FAST|PINCONF_PINS2|PINCONF_PIN_7)
+#define PINCONF_EMC_A10 (PINCONF_FUNC2|PINCONF_INBUFFER|PINCONF_GLITCH|PINCONF_SLEW_FAST|PINCONF_PINS2|PINCONF_PIN_6)
+#define PINCONF_EMC_A11 (PINCONF_FUNC2|PINCONF_INBUFFER|PINCONF_GLITCH|PINCONF_SLEW_FAST|PINCONF_PINS2|PINCONF_PIN_2)
+#define PINCONF_EMC_A12 (PINCONF_FUNC2|PINCONF_INBUFFER|PINCONF_GLITCH|PINCONF_SLEW_FAST|PINCONF_PINS2|PINCONF_PIN_1)
+#define PINCONF_EMC_A13 (PINCONF_FUNC2|PINCONF_INBUFFER|PINCONF_GLITCH|PINCONF_SLEW_FAST|PINCONF_PINS2|PINCONF_PIN_0)
+#define PINCONF_EMC_A14 (PINCONF_FUNC1|PINCONF_INBUFFER|PINCONF_GLITCH|PINCONF_SLEW_FAST|PINCONF_PINS6|PINCONF_PIN_8)
+#define PINCONF_EMC_A15 (PINCONF_FUNC1|PINCONF_INBUFFER|PINCONF_GLITCH|PINCONF_SLEW_FAST|PINCONF_PINS6|PINCONF_PIN_7)
+#define PINCONF_EMC_A16 (PINCONF_FUNC2|PINCONF_INBUFFER|PINCONF_GLITCH|PINCONF_SLEW_FAST|PINCONF_PINSD|PINCONF_PIN_16)
+#define PINCONF_EMC_A17 (PINCONF_FUNC2|PINCONF_INBUFFER|PINCONF_GLITCH|PINCONF_SLEW_FAST|PINCONF_PINSD|PINCONF_PIN_15)
+#define PINCONF_EMC_A18 (PINCONF_FUNC3|PINCONF_INBUFFER|PINCONF_GLITCH|PINCONF_SLEW_FAST|PINCONF_PINSE|PINCONF_PIN_0)
+#define PINCONF_EMC_A19 (PINCONF_FUNC3|PINCONF_INBUFFER|PINCONF_GLITCH|PINCONF_SLEW_FAST|PINCONF_PINSE|PINCONF_PIN_1)
+#define PINCONF_EMC_A20 (PINCONF_FUNC3|PINCONF_INBUFFER|PINCONF_GLITCH|PINCONF_SLEW_FAST|PINCONF_PINSE|PINCONF_PIN_2)
+#define PINCONF_EMC_A21 (PINCONF_FUNC3|PINCONF_INBUFFER|PINCONF_GLITCH|PINCONF_SLEW_FAST|PINCONF_PINSE|PINCONF_PIN_3)
+#define PINCONF_EMC_A22 (PINCONF_FUNC3|PINCONF_INBUFFER|PINCONF_GLITCH|PINCONF_SLEW_FAST|PINCONF_PINSE|PINCONF_PIN_4)
+#define PINCONF_EMC_A23 (PINCONF_FUNC3|PINCONF_INBUFFER|PINCONF_GLITCH|PINCONF_SLEW_FAST|PINCONF_PINSA|PINCONF_PIN_4)
+#define PINCONF_EMC_BLS0 (PINCONF_FUNC3|PINCONF_INBUFFER|PINCONF_GLITCH|PINCONF_SLEW_FAST|PINCONF_PINS1|PINCONF_PIN_4)
+#define PINCONF_EMC_BLS1 (PINCONF_FUNC1|PINCONF_INBUFFER|PINCONF_GLITCH|PINCONF_SLEW_FAST|PINCONF_PINS6|PINCONF_PIN_6)
+#define PINCONF_EMC_BLS2 (PINCONF_FUNC2|PINCONF_INBUFFER|PINCONF_GLITCH|PINCONF_SLEW_FAST|PINCONF_PINSD|PINCONF_PIN_13)
+#define PINCONF_EMC_BLS3 (PINCONF_FUNC2|PINCONF_INBUFFER|PINCONF_GLITCH|PINCONF_SLEW_FAST|PINCONF_PINSD|PINCONF_PIN_10)
+#define PINCONF_EMC_CAS (PINCONF_FUNC3|PINCONF_INBUFFER|PINCONF_GLITCH|PINCONF_SLEW_FAST|PINCONF_PINS6|PINCONF_PIN_4)
+#define PINCONF_EMC_CKEOUT0 (PINCONF_FUNC3|PINCONF_INBUFFER|PINCONF_GLITCH|PINCONF_SLEW_FAST|PINCONF_PINS6|PINCONF_PIN_11)
+#define PINCONF_EMC_CKEOUT1 (PINCONF_FUNC1|PINCONF_INBUFFER|PINCONF_GLITCH|PINCONF_SLEW_FAST|PINCONF_PINS6|PINCONF_PIN_2)
+#define PINCONF_EMC_CKEOUT2 (PINCONF_FUNC2|PINCONF_INBUFFER|PINCONF_GLITCH|PINCONF_SLEW_FAST|PINCONF_PINSD|PINCONF_PIN_1)
+#define PINCONF_EMC_CKEOUT3 (PINCONF_FUNC3|PINCONF_INBUFFER|PINCONF_GLITCH|PINCONF_SLEW_FAST|PINCONF_PINSE|PINCONF_PIN_15)
+#define PINCONF_EMC_CS0 (PINCONF_FUNC3|PINCONF_INBUFFER|PINCONF_GLITCH|PINCONF_SLEW_FAST|PINCONF_PINS1|PINCONF_PIN_5)
+#define PINCONF_EMC_CS1 (PINCONF_FUNC3|PINCONF_INBUFFER|PINCONF_GLITCH|PINCONF_SLEW_FAST|PINCONF_PINS6|PINCONF_PIN_3)
+#define PINCONF_EMC_CS2 (PINCONF_FUNC2|PINCONF_INBUFFER|PINCONF_GLITCH|PINCONF_SLEW_FAST|PINCONF_PINSD|PINCONF_PIN_12)
+#define PINCONF_EMC_CS3 (PINCONF_FUNC2|PINCONF_INBUFFER|PINCONF_GLITCH|PINCONF_SLEW_FAST|PINCONF_PINSD|PINCONF_PIN_11)
+#define PINCONF_EMC_D0 (PINCONF_FUNC3|PINCONF_INBUFFER|PINCONF_GLITCH|PINCONF_SLEW_FAST|PINCONF_PINS1|PINCONF_PIN_7)
+#define PINCONF_EMC_D1 (PINCONF_FUNC3|PINCONF_INBUFFER|PINCONF_GLITCH|PINCONF_SLEW_FAST|PINCONF_PINS1|PINCONF_PIN_8)
+#define PINCONF_EMC_D2 (PINCONF_FUNC3|PINCONF_INBUFFER|PINCONF_GLITCH|PINCONF_SLEW_FAST|PINCONF_PINS1|PINCONF_PIN_9)
+#define PINCONF_EMC_D3 (PINCONF_FUNC3|PINCONF_INBUFFER|PINCONF_GLITCH|PINCONF_SLEW_FAST|PINCONF_PINS1|PINCONF_PIN_10)
+#define PINCONF_EMC_D4 (PINCONF_FUNC3|PINCONF_INBUFFER|PINCONF_GLITCH|PINCONF_SLEW_FAST|PINCONF_PINS1|PINCONF_PIN_11)
+#define PINCONF_EMC_D5 (PINCONF_FUNC3|PINCONF_INBUFFER|PINCONF_GLITCH|PINCONF_SLEW_FAST|PINCONF_PINS1|PINCONF_PIN_12)
+#define PINCONF_EMC_D6 (PINCONF_FUNC3|PINCONF_INBUFFER|PINCONF_GLITCH|PINCONF_SLEW_FAST|PINCONF_PINS1|PINCONF_PIN_13)
+#define PINCONF_EMC_D7 (PINCONF_FUNC3|PINCONF_INBUFFER|PINCONF_GLITCH|PINCONF_SLEW_FAST|PINCONF_PINS1|PINCONF_PIN_14)
+#define PINCONF_EMC_D8 (PINCONF_FUNC2|PINCONF_INBUFFER|PINCONF_GLITCH|PINCONF_SLEW_FAST|PINCONF_PINS5|PINCONF_PIN_4)
+#define PINCONF_EMC_D9 (PINCONF_FUNC2|PINCONF_INBUFFER|PINCONF_GLITCH|PINCONF_SLEW_FAST|PINCONF_PINS5|PINCONF_PIN_5)
+#define PINCONF_EMC_D10 (PINCONF_FUNC2|PINCONF_INBUFFER|PINCONF_GLITCH|PINCONF_SLEW_FAST|PINCONF_PINS5|PINCONF_PIN_6)
+#define PINCONF_EMC_D11 (PINCONF_FUNC2|PINCONF_INBUFFER|PINCONF_GLITCH|PINCONF_SLEW_FAST|PINCONF_PINS5|PINCONF_PIN_7)
+#define PINCONF_EMC_D12 (PINCONF_FUNC2|PINCONF_INBUFFER|PINCONF_GLITCH|PINCONF_SLEW_FAST|PINCONF_PINS5|PINCONF_PIN_0)
+#define PINCONF_EMC_D13 (PINCONF_FUNC2|PINCONF_INBUFFER|PINCONF_GLITCH|PINCONF_SLEW_FAST|PINCONF_PINS5|PINCONF_PIN_1)
+#define PINCONF_EMC_D14 (PINCONF_FUNC2|PINCONF_INBUFFER|PINCONF_GLITCH|PINCONF_SLEW_FAST|PINCONF_PINS5|PINCONF_PIN_2)
+#define PINCONF_EMC_D15 (PINCONF_FUNC2|PINCONF_INBUFFER|PINCONF_GLITCH|PINCONF_SLEW_FAST|PINCONF_PINS5|PINCONF_PIN_3)
+#define PINCONF_EMC_D16 (PINCONF_FUNC2|PINCONF_INBUFFER|PINCONF_GLITCH|PINCONF_SLEW_FAST|PINCONF_PINSD|PINCONF_PIN_2)
+#define PINCONF_EMC_D17 (PINCONF_FUNC2|PINCONF_INBUFFER|PINCONF_GLITCH|PINCONF_SLEW_FAST|PINCONF_PINSD|PINCONF_PIN_3)
+#define PINCONF_EMC_D18 (PINCONF_FUNC2|PINCONF_INBUFFER|PINCONF_GLITCH|PINCONF_SLEW_FAST|PINCONF_PINSD|PINCONF_PIN_4)
+#define PINCONF_EMC_D19 (PINCONF_FUNC2|PINCONF_INBUFFER|PINCONF_GLITCH|PINCONF_SLEW_FAST|PINCONF_PINSD|PINCONF_PIN_5)
+#define PINCONF_EMC_D20 (PINCONF_FUNC2|PINCONF_INBUFFER|PINCONF_GLITCH|PINCONF_SLEW_FAST|PINCONF_PINSD|PINCONF_PIN_6)
+#define PINCONF_EMC_D21 (PINCONF_FUNC2|PINCONF_INBUFFER|PINCONF_GLITCH|PINCONF_SLEW_FAST|PINCONF_PINSD|PINCONF_PIN_7)
+#define PINCONF_EMC_D22 (PINCONF_FUNC2|PINCONF_INBUFFER|PINCONF_GLITCH|PINCONF_SLEW_FAST|PINCONF_PINSD|PINCONF_PIN_8)
+#define PINCONF_EMC_D23 (PINCONF_FUNC2|PINCONF_INBUFFER|PINCONF_GLITCH|PINCONF_SLEW_FAST|PINCONF_PINSD|PINCONF_PIN_9)
+#define PINCONF_EMC_D24 (PINCONF_FUNC3|PINCONF_INBUFFER|PINCONF_GLITCH|PINCONF_SLEW_FAST|PINCONF_PINSE|PINCONF_PIN_5)
+#define PINCONF_EMC_D25 (PINCONF_FUNC3|PINCONF_INBUFFER|PINCONF_GLITCH|PINCONF_SLEW_FAST|PINCONF_PINSE|PINCONF_PIN_6)
+#define PINCONF_EMC_D26 (PINCONF_FUNC3|PINCONF_INBUFFER|PINCONF_GLITCH|PINCONF_SLEW_FAST|PINCONF_PINSE|PINCONF_PIN_7)
+#define PINCONF_EMC_D27 (PINCONF_FUNC3|PINCONF_INBUFFER|PINCONF_GLITCH|PINCONF_SLEW_FAST|PINCONF_PINSE|PINCONF_PIN_8)
+#define PINCONF_EMC_D28 (PINCONF_FUNC3|PINCONF_INBUFFER|PINCONF_GLITCH|PINCONF_SLEW_FAST|PINCONF_PINSE|PINCONF_PIN_9)
+#define PINCONF_EMC_D29 (PINCONF_FUNC3|PINCONF_INBUFFER|PINCONF_GLITCH|PINCONF_SLEW_FAST|PINCONF_PINSE|PINCONF_PIN_10)
+#define PINCONF_EMC_D30 (PINCONF_FUNC3|PINCONF_INBUFFER|PINCONF_GLITCH|PINCONF_SLEW_FAST|PINCONF_PINSE|PINCONF_PIN_11)
+#define PINCONF_EMC_D31 (PINCONF_FUNC3|PINCONF_INBUFFER|PINCONF_GLITCH|PINCONF_SLEW_FAST|PINCONF_PINSE|PINCONF_PIN_12)
+#define PINCONF_EMC_DQMOUT0 (PINCONF_FUNC3|PINCONF_INBUFFER|PINCONF_GLITCH|PINCONF_SLEW_FAST|PINCONF_PINS6|PINCONF_PIN_12)
+#define PINCONF_EMC_DQMOUT1 (PINCONF_FUNC3|PINCONF_INBUFFER|PINCONF_GLITCH|PINCONF_SLEW_FAST|PINCONF_PINS6|PINCONF_PIN_10)
+#define PINCONF_EMC_DQMOUT2 (PINCONF_FUNC2|PINCONF_INBUFFER|PINCONF_GLITCH|PINCONF_SLEW_FAST|PINCONF_PINSD|PINCONF_PIN_0)
+#define PINCONF_EMC_DQMOUT3 (PINCONF_FUNC3|PINCONF_INBUFFER|PINCONF_GLITCH|PINCONF_SLEW_FAST|PINCONF_PINSE|PINCONF_PIN_13)
+#define PINCONF_EMC_DYCS0 (PINCONF_FUNC3|PINCONF_INBUFFER|PINCONF_GLITCH|PINCONF_SLEW_FAST|PINCONF_PINS6|PINCONF_PIN_9)
+#define PINCONF_EMC_DYCS1 (PINCONF_FUNC1|PINCONF_INBUFFER|PINCONF_GLITCH|PINCONF_SLEW_FAST|PINCONF_PINS6|PINCONF_PIN_1)
+#define PINCONF_EMC_DYCS2 (PINCONF_FUNC2|PINCONF_INBUFFER|PINCONF_GLITCH|PINCONF_SLEW_FAST|PINCONF_PINSD|PINCONF_PIN_14)
+#define PINCONF_EMC_DYCS3 (PINCONF_FUNC3|PINCONF_INBUFFER|PINCONF_GLITCH|PINCONF_SLEW_FAST|PINCONF_PINSE|PINCONF_PIN_14)
+#define PINCONF_EMC_OE (PINCONF_FUNC3|PINCONF_INBUFFER|PINCONF_GLITCH|PINCONF_SLEW_FAST|PINCONF_PINS1|PINCONF_PIN_3)
+#define PINCONF_EMC_RAS (PINCONF_FUNC3|PINCONF_INBUFFER|PINCONF_GLITCH|PINCONF_SLEW_FAST|PINCONF_PINS6|PINCONF_PIN_5)
+#define PINCONF_EMC_WE (PINCONF_FUNC3|PINCONF_INBUFFER|PINCONF_GLITCH|PINCONF_SLEW_FAST|PINCONF_PINS1|PINCONF_PIN_6)
#define PINCONF_ENET_COL_1 (PINCONF_FUNC2|PINCONF_INBUFFER|PINCONF_SLEW_FAST|PINCONF_PINS0|PINCONF_PIN_1)
#define PINCONF_ENET_COL_2 (PINCONF_FUNC5|PINCONF_INBUFFER|PINCONF_SLEW_FAST|PINCONF_PINS9|PINCONF_PIN_6)
diff --git a/arch/arm/src/lpc43xx/chip/lpc43_ccu.h b/arch/arm/src/lpc43xx/chip/lpc43_ccu.h
index a2cb20ca62f..51cdcdb9fc9 100644
--- a/arch/arm/src/lpc43xx/chip/lpc43_ccu.h
+++ b/arch/arm/src/lpc43xx/chip/lpc43_ccu.h
@@ -1,7 +1,7 @@
/****************************************************************************************************
* arch/arm/src/lpc43xx/chip/lpc43_ccu.h
*
- * Copyright (C) 2012 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2012, 2016 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt
*
* Redistribution and use in source and binary forms, with or without
@@ -45,6 +45,7 @@
/****************************************************************************************************
* Pre-processor Definitions
****************************************************************************************************/
+
/* Register Offsets *********************************************************************************/
#define LPC43_CCU1_PM_OFFSET 0x0000 /* CCU1 power mode register */
@@ -343,6 +344,23 @@
#define CCU_CLK_STAT_WAKEUP (1 << 2) /* Bit 2: Wake-up mechanism enable status */
/* Bits 3-31: Reserved */
+/* CCU1 Branch Clock EMCDIV Configuration Registers */
+
+#define CCU_CLK_EMCDIV_CFG_RUN (1 << 0) /* Bit 0: Run enable */
+#define CCU_CLK_EMCDIV_CFG_AUTO (1 << 1) /* Bit 1: Auto (AHB disable mechanism) enable */
+#define CCU_CLK_EMCDIV_CFG_WAKEUP (1 << 2) /* Bit 2: Wake-up mechanism enable */
+ /* Bits 3-4: Reserved */
+#define CCU_CLK_EMCDIV_CLOCK_DIV_SHIFT (5) /* Bits 5-7: Clock divider */
+#define CCU_CLK_EMCDIV_CLOCK_DIV_MASK (7 << CCU_CLK_EMCDIV_CLOCK_DIV_SHIFT)
+# define CCU_CLK_EMCDIV_CFG_DIV_FUNC(n) ((n) << CCU_CLK_EMCDIV_CLOCK_DIV_SHIFT)
+# define CCU_CLK_EMCDIV_CFG_DIV_NODIV (0 << CCU_CLK_EMCDIV_CLOCK_DIV_SHIFT) /* Bit 5-7: No division */
+# define CCU_CLK_EMCDIV_CFG_DIV_BY2 (1 << CCU_CLK_EMCDIV_CLOCK_DIV_SHIFT) /* Bit 5-7: Division by 2 */
+ /* Bits 8-26: Reserved */
+#define CCU_CLK_EMCDIV_CLOCK_DIVSTAT_SHIFT (27) /* Bits 27-29: Clock divider status */
+#define CCU_CLK_EMCDIV_CLOCK_DIVSTAT_MASK (7 << CCU_CLK_EMCDIV_CLOCK_DIVSTAT_SHIFT)
+# define CCU_CLK_EMCDIV_CFG_DIVSTAT_NODIV (0 << CCU_CLK_EMCDIV_CLOCK_DIVSTAT_SHIFT) /* Bit 27-29: No division */
+# define CCU_CLK_EMCDIV_CFG_DIVSTAT_BY2 (1 << CCU_CLK_EMCDIV_CLOCK_DIVSTAT_MASK) /* Bit 26-29: Divistion by 2 */
+
/****************************************************************************************************
* Public Types
****************************************************************************************************/
diff --git a/arch/arm/src/lpc43xx/chip/lpc43_emc.h b/arch/arm/src/lpc43xx/chip/lpc43_emc.h
index 4fb3ae38be6..b61cbcbc585 100644
--- a/arch/arm/src/lpc43xx/chip/lpc43_emc.h
+++ b/arch/arm/src/lpc43xx/chip/lpc43_emc.h
@@ -1,7 +1,7 @@
/****************************************************************************************************
* arch/arm/src/lpc43xx/chip/lpc43_emc.h
*
- * Copyright (C) 2012 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2012, 2016 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt
*
* Redistribution and use in source and binary forms, with or without
@@ -45,6 +45,7 @@
/****************************************************************************************************
* Pre-processor Definitions
****************************************************************************************************/
+
/* Register Offsets *********************************************************************************/
#define LPC43_EMC_CONTROL_OFFSET 0x0000 /* EMC Control register */
@@ -213,6 +214,7 @@
#define EMC_CONTROL_LOWPOWER (1 << 2) /* Bit 2: Low-power mode */
/* Bits 3-31: Reserved */
/* EMC Status register */
+
#define EMC__
#define EMC_STATUS_BUSY (1 << 0) /* Bit 0: Busy */
#define EMC_STATUS_WB (1 << 1) /* Bit 1: Write buffer status */
@@ -333,13 +335,64 @@
# define EMC_DYNCONFIG_MD_SDRAM (0 << EMC_DYNCONFIG_MD_SHIFT) /* SDRAM (POR reset value) */
/* Bits 5-6: Reserved */
#define EMC_DYNCONFIG_AM0_SHIFT (7) /* Bits 7-12: AM0 Address mapping (see user manual) */
-#define EMC_DYNCONFIG_AM0_MASK (0x3f << EMC_DYNCONFIG_AM0_SHIFT)
+#define EMC_DYNCONFIG_AM0_MASK (0x3F << EMC_DYNCONFIG_AM0_SHIFT)
/* Bit 13: Reserved */
#define EMC_DYNCONFIG_AM1 (1 << 14) /* Bit 14: AM1 Address mapping (see user manual) */
/* Bits 15-18: Reserved */
-#define EMC_DYNCONFIG_BENA (1 << 10) /* Bit 19: Buffer enable */
+#define EMC_DYNCONFIG_BENA (1 << 19) /* Bit 19: Buffer enable */
#define EMC_DYNCONFIG_WP (1 << 20) /* Bit 20: Write protect. */
/* Bits 21-31: Reserved */
+
+/* Dynamic Memory Configuration register Memory Configuration Values */
+/* TODO: complete configuration */
+
+/* Data Bus Width Value in LPC43_EMC_DYNCONFIG register (bit 14) */
+
+#define EMC_DYNCONFIG_DATA_BUS_16 (0 << 14) /* Data bus width 16 bit */
+#define EMC_DYNCONFIG_DATA_BUS_32 (1 << 14) /* Data bus width 32 bit */
+
+/* Low power SDRAM value in LPC43_EMC_DYNCONFIG register (bit 12) */
+
+#define EMC_DYNCONFIG_LPSDRAM (1 << 12) /* Low power SDRAM value (Bank, Row, Column)*/
+#define EMC_DYNCONFIG_HPSDRAM (0 << 12) /* High performance SDRAM value (Row, Bank, Column)*/
+
+/* Address mapping table for LPC43_EMC_DYNCONFIG register (bits 7-11) */
+
+/* Device size bits in LPC43_EMC_DYNCONFIG register (bits 9-11) */
+
+#define EMC_DYNCONFIG_DEV_SIZE_SHIFT (9)
+#define EMC_DYNCONFIG_DEV_SIZE_MASK (0x7)
+# define EMC_DYNCONFIG_DEV_SIZE_16Mb (0x00 << EMC_DYNCONFIG_DEV_SIZE_SHIFT)
+# define EMC_DYNCONFIG_DEV_SIZE_64Mb (0x01 << EMC_DYNCONFIG_DEV_SIZE_SHIFT)
+# define EMC_DYNCONFIG_DEV_SIZE_128Mb (0x02 << EMC_DYNCONFIG_DEV_SIZE_SHIFT)
+# define EMC_DYNCONFIG_DEV_SIZE_256Mb (0x03 << EMC_DYNCONFIG_DEV_SIZE_SHIFT)
+# define EMC_DYNCONFIG_DEV_SIZE_512Mb (0x04 << EMC_DYNCONFIG_DEV_SIZE_SHIFT)
+
+/* Bus width bits in LPC43_EMC_DYNCONFIG register (bits 7-8) */
+
+#define EMC_DYNCONFIG_DEV_BUS_SHIFT (7)
+#define EMC_DYNCONFIG_DEV_BUS_MASK (0x3)
+# define EMC_DYNCONFIG_DEV_BUS_8 (0x00 << EMC_DYNCONFIG_DEV_BUS_SHIFT)
+# define EMC_DYNCONFIG_DEV_BUS_16 (0x01 << EMC_DYNCONFIG_DEV_BUS_SHIFT)
+# define EMC_DYNCONFIG_DEV_BUS_32 (0x02 << EMC_DYNCONFIG_DEV_BUS_SHIFT)
+
+#define EMC_DYNCONFIG_2Mx8_2BANKS_11ROWS_9COLS ((0x0 << 9) | (0x0 << 7)) /* 16Mb (2Mx8), 2 banks, row length = 11, column length = 9 */
+#define EMC_DYNCONFIG_1Mx16_2BANKS_11ROWS_8COLS ((0x0 << 9) | (0x1 << 7)) /* 16Mb (1Mx16), 2 banks, row length = 11, column length = 8 */
+#define EMC_DYNCONFIG_8Mx8_4BANKS_12ROWS_9COLS ((0x1 << 9) | (0x0 << 7)) /* 64Mb (8Mx8), 4 banks, row length = 12, column length = 9 */
+#define EMC_DYNCONFIG_4Mx16_4BANKS_12ROWS_8COLS ((0x1 << 9) | (0x1 << 7)) /* 64Mb (4Mx16), 4 banks, row length = 12, column length = 8 */
+#define EMC_DYNCONFIG_2Mx32_4BANKS_11ROWS_8COLS ((0x1 << 9) | (0x2 << 7)) /* 64Mb (2Mx32), 4 banks, row length = 11, column length = 8, 32 bit bus only */
+#define EMC_DYNCONFIG_16Mx8_4BANKS_12ROWS_10COLS ((0x2 << 9) | (0x0 << 7)) /* 128Mb (16Mx8), 4 banks, row length = 12, column length = 10 */
+#define EMC_DYNCONFIG_8Mx16_4BANKS_12ROWS_9COLS ((0x2 << 9) | (0x1 << 7)) /* 128Mb (8Mx16), 4 banks, row length = 12, column length = 9 */
+#define EMC_DYNCONFIG_4Mx32_4BANKS_12ROWS_8COLS ((0x2 << 9) | (0x2 << 7)) /* 128Mb (4Mx32), 4 banks, row length = 12, column length = 8 */
+#define EMC_DYNCONFIG_32Mx8_4BANKS_13ROWS_10COLS ((0x3 << 9) | (0x0 << 7)) /* 256Mb (32Mx8), 4 banks, row length = 13, column length = 10, 32 bit bus only */
+#define EMC_DYNCONFIG_16Mx16_4BANKS_13ROWS_9COLS ((0x3 << 9) | (0x1 << 7)) /* 256Mb (16Mx16), 4 banks, row length = 13, column length = 9 */
+#define EMC_DYNCONFIG_8Mx32_4BANKS_13ROWS_8COLS ((0x3 << 9) | (0x2 << 7)) /* 256Mb (8Mx32), 4 banks, row length = 13, column length = 8, 32 bit bus only */
+#define EMC_DYNCONFIG_8Mx32_4BANKS_12ROWS_9COLS ((0x2 << 9) | (0x1 << 7)) /* 256Mb (8Mx32), 4 banks, row length = 12, column length = 9, 32 bit bus only */
+#define EMC_DYNCONFIG_64Mx8_4BANKS_13ROWS_10COLS ((0x4 << 9) | (0x0 << 7)) /* 512Mb (64Mx8), 4 banks, row length = 13, column length = 11 */
+#define EMC_DYNCONFIG_32Mx16_4BANKS_13ROWS_10COLS ((0x4 << 9) | (0x1 << 7)) /* 512Mb (32Mx16), 4 banks, row length = 13, column length = 10 */
+#define EMC_DYNCONFIG_16Mx32_4BANKS_13ROWS_9COLS ((0x3 << 9) | (0x1 << 7)) /* 512Mb (16Mx32), 4 banks, row length = 13, column length = 9, 32 bit bus only */
+#define EMC_DYNCONFIG_32Mx32_4BANKS_13ROWS_10COLS ((0x4 << 9) | (0x1 << 7)) /* 1Gb (32Mx32), 4 banks, row length = 13, column length = 10,32 bit bus only */
+
/* Dynamic Memory RAS & CAS Delay registers */
#define EMC_DYNRASCAS_RAS_SHIFT (0) /* Bits 0-1: RAS latency (active to read/write delay) */
@@ -354,6 +407,35 @@
# define EMC_DYNRASCAS_CAS_2CCLK (2 << EMC_DYNRASCAS_CAS_SHIFT) /* Two CCLK cycles */
# define EMC_DYNRASCAS_CAS_3CCLK (3 << EMC_DYNRASCAS_CAS_SHIFT) /* Three CCLK cycles (POR reset value) */
/* Bits 10-31: Reserved */
+
+/* Dynamic SDRAM mode register definitions */
+
+ /* Bits 0-2: Burst length. All other values are reserved. */
+#define EMC_DYNMODE_BURST_LENGTH_SHIFT (0)
+#define EMC_DYNMODE_BURST_LENGTH_MASK (0x7)
+# define EMC_DYNMODE_BURST_LENGTH_1 (0 << EMC_DYNMODE_BURST_LENGTH_SHIFT)
+# define EMC_DYNMODE_BURST_LENGTH_2 (1 << EMC_DYNMODE_BURST_LENGTH_SHIFT)
+# define EMC_DYNMODE_BURST_LENGTH_4 (2 << EMC_DYNMODE_BURST_LENGTH_SHIFT)
+# define EMC_DYNMODE_BURST_LENGTH_8 (3 << EMC_DYNMODE_BURST_LENGTH_SHIFT)
+ /* Bit 3: Burst mode type */
+#define EMC_DYNMODE_BURST_TYPE_SHIFT (3)
+# define EMC_DYNMODE_BURST_TYPE_SEQUENTIAL (0 << EMC_DYNMODE_BURST_TYPE_SHIFT) /* burst type sequential */
+# define EMC_DYNMODE_BURST_TYPE_INTERLEAVED (1 << EMC_DYNMODE_BURST_TYPE_INTERLEAVED) /* burst type interleaved */
+ /* Bits 4-6: Latency mode. All other values are reserved. */
+#define EMC_DYNMODE_CAS_SHIFT (4)
+#define EMC_DYNMODE_CAS_MASK (0x7)
+# define EMC_DYNMODE_CAS_2 (2 << EMC_DYNMODE_CAS_SHIFT) /* CAS latency of 2 cycles */
+# define EMC_DYNMODE_CAS_3 (3 << EMC_DYNMODE_CAS_SHIFT) /* CAS latency of 3 cycles */
+ /* Bits 7-8: Operating mode. All other values are reserved. */
+#define EMC_DYNMODE_OPMODE_SHIFT (7)
+#define EMC_DYNMODE_OPMODE_MASK (0x3)
+# define EMC_DYNMODE_OPMODE_STANDARD (0 << EMC_DYNMODE_OPMODE_SHIFT) /* dynamic standard operation mode */
+ /* Bit 9: Write burst mode */
+#define EMC_DYNMODE_WBMODE_SHIFT (9)
+# define EMC_DYNMODE_WBMODE_PROGRAMMED (0 << EMC_DYNMODE_WBMODE_SHIFT) /* write burst mode programmed */
+# define EMC_DYNMODE_WBMODE_SINGLE_LOC (1 << EMC_DYNMODE_WBMODE_SHIFT) /* write burst mode single loc */
+ /* Bits 10-11: Reserved */
+
/* Static Memory Configuration registers */
#define EMC_STATCONFIG_MW_SHIFT (0) /* Bits 0-1: Memory width */
diff --git a/arch/arm/src/lpc43xx/lpc43_adc.c b/arch/arm/src/lpc43xx/lpc43_adc.c
index 4286451f11e..2a9db4297d9 100644
--- a/arch/arm/src/lpc43xx/lpc43_adc.c
+++ b/arch/arm/src/lpc43xx/lpc43_adc.c
@@ -59,7 +59,6 @@
#include
#include
-#include
#include
#include
#include
@@ -80,6 +79,12 @@
#include "lpc43_pinconfig.h"
+/* board.h should be included last because it depends on the previous
+ * inclusions and may need to modify other definitions.
+ */
+
+#include
+
#if defined(CONFIG_LPC43_ADC0) /* TODO ADC1 */
/****************************************************************************
diff --git a/arch/arm/src/lpc43xx/lpc43_allocateheap.c b/arch/arm/src/lpc43xx/lpc43_allocateheap.c
index 70a0bbe5873..b7a947b668f 100644
--- a/arch/arm/src/lpc43xx/lpc43_allocateheap.c
+++ b/arch/arm/src/lpc43xx/lpc43_allocateheap.c
@@ -1,7 +1,7 @@
/****************************************************************************
* arch/arm/src/lpc43xx/lpc43_allocateheap.c
*
- * Copyright (C) 2012-2013, 2015 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2012-2013, 2015-2016 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt
*
* Redistribution and use in source and binary forms, with or without
@@ -61,6 +61,7 @@
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
+
/* Get customizations for each supported chip.
*
* SRAM Resources
@@ -95,6 +96,25 @@
* NOTE 1: The 64Kb of AHB of SRAM on the LPC4350/30/20 span all AHB SRAM
* banks but are treated as two banks of 48 an 16Kb by the NuttX memory
* manager. This gives some symmetry to all of the members of the family.
+ *
+ * ----------------------------------------------------------------------
+ * EMC SDRAM
+ * ----------------------------------------------------------------------
+ * LPC43xx may have dynamic RAM connected on EMC bus. Up to 4 chips can be
+ * connected.
+ *
+ * DYCS0 (0x2800 0000) up to 128MB
+ * DYCS1 (0x3000 0000) up to 256MB
+ * DYCS2 (0x6000 0000) up to 256MB
+ * DYCS3 (0x7000 0000) up to 256MB
+ *
+ * LPC43xx may have static RAM connected on EMC bus.
+ *
+ * CS0 (0x1C00 0000) up to 16MB
+ * CS1 (0x1D00 0000) up to 16MB
+ * CS2 (0x1E00 0000) up to 16MB
+ * CS3 (0x1F00 0000) up to 16MB
+ *
*/
/* Configuration ************************************************************/
@@ -136,58 +156,89 @@
*
* CONFIG_RAM_START = The start of the data RAM region which may be
* either local SRAM bank 0 (Configuration A) or 1 (Configuration B).
- * CONFIG_RAM_START = The size of the data RAM region.
- * CONFIG_RAM_END = The sum of the above
+ * CONFIG_RAM_SIZE = The size of the data RAM region.
+ * CONFIG_RAM_END = The sum of the above.
+ */
+
+/* External Memory Configuration
+ *
+ * Dynamic memory configuration
+ * For dynamic memory configuration at least one of LPC43_EXTSDRAMx
+ * should by defined.
+ * Also, together with LPC43_EXTSDRAMx should be defined:
+ * LPC43_EXTSDRAMxSIZE = External RAM size in bytes.
+ * LPC43_EXTSDRAMxHEAP = Should this RAM be use as heap space?
*/
/* Check for Configuration A. */
+#undef MM_USE_LOCSRAM_BANK0
+#undef MM_USE_LOCSRAM_BANK1
+#undef MM_USE_AHBSRAM_BANK0
+#undef MM_USE_AHBSRAM_BANK1
+#undef MM_USE_AHBSRAM_BANK2
+#undef MM_USE_EXTSDRAM0
+#undef MM_USE_EXTSDRAM1
+#undef MM_USE_EXTSDRAM2
+#undef MM_USE_EXTSDRAM3
+#undef MM_HAVE_REGION
+
#ifndef CONFIG_LPC43_BOOT_SRAM
/* Configuration A */
-/* CONFIG_RAM_START should be set to the base of AHB SRAM, local 0. */
+/* CONFIG_RAM_START shoudl be set to the base of local SRAM, Bank 0. */
# if CONFIG_RAM_START != LPC43_LOCSRAM_BANK0_BASE
-# error "CONFIG_RAM_START must be set to the base address of RAM Bank 0"
+# error "CONFIG_RAM_START must be set to the base address of RAM bank 0"
# endif
-/* The configured RAM size should be equal to the size of local SRAM Bank 0 */
+/* The configured RAM size should be equal to the size of local SRAM Bank 0. */
# if CONFIG_RAM_SIZE != LPC43_LOCSRAM_BANK0_SIZE
-# error "CONFIG_RAM_SIZE must be set to size of AHB SRAM Bank 0"
+# error "CONFIG_RAM_SIZE must be set to size of local SRAM Bank 0"
# endif
-/* Now we can assign all of the memory regions for configuration A */
+/* Local SRAM Bank 0 will be used as main memory region */
-# define MM_REGION1_BASE LPC43_LOCSRAM_BANK0_BASE
-# define MM_REGION1_SIZE LPC43_LOCSRAM_BANK0_SIZE
-# define MM_REGION2_BASE LPC43_LOCSRAM_BANK1_BASE
-# define MM_REGION2_SIZE LPC43_LOCSRAM_BANK1_SIZE
-# define MM_REGION3_BASE LPC43_AHBSRAM_BANK0_BASE
-# define MM_REGION3_SIZE LPC43_AHBSRAM_BANK0_SIZE
-#else
+# define MM_USE_LOCSRAM_BANK0 0
+
+/* Use local SRAM Bank 1 if configured */
+
+# ifdef CONFIG_LPC43_USE_LOCSRAM_BANK1
+# define MM_USE_LOCSRAM_BANK1 1
+# endif
+
+#else /* CONFIG_LPC43_BOOT_SRAM */
/* Configuration B */
-/* CONFIG_RAM_START should be set to the base of local SRAM, bank 1. */
+/* CONFIG_RAM_START should be set to the base of local SRAM, Bank 1. */
# if CONFIG_RAM_START != LPC43_LOCSRAM_BANK1_BASE
-# error "CONFIG_RAM_START must be set to the base address of SRAM Bank 1"
+# error "CONFIG_RAM_START must be set to the base address of RAM bank 1"
# endif
-/* The configured RAM size should be equal to the size of local SRAM Bank 1 */
+/* The configured RAM size should be equal to the size of local SRAM Bank 1. */
# if CONFIG_RAM_SIZE != LPC43_LOCSRAM_BANK1_SIZE
-# error "CONFIG_RAM_SIZE must be set to size of AHB SRAM Bank 1"
+# error "CONFIG_RAM_SIZE must be set to size of local SRAM Bank 1"
# endif
-/* Now we can assign all of the memory regions for configuration B */
+/* Shouldn't use Local SRAM Bank 0 as system use it for code.
+ * Local SRAM Bank1 is used as main memory region.
+ */
-# define MM_REGION1_BASE LPC43_LOCSRAM_BANK1_BASE
-# define MM_REGION1_SIZE LPC43_LOCSRAM_BANK1_SIZE
-# define MM_REGION2_BASE LPC43_AHBSRAM_BANK0_BASE
-# define MM_REGION2_SIZE LPC43_AHBSRAM_BANK0_SIZE
-# undef MM_REGION3_BASE
-# undef MM_REGION3_SIZE
+# define MM_USE_LOCSRAM_BANK1 0
+
+#endif /* CONFIG_LPC43_BOOT_SRAM */
+
+/* Configure other memory banks */
+
+#ifdef CONFIG_LPC43_AHBSRAM_BANK0
+# define MM_USE_AHBSRAM_BANK0 1
+#endif
+
+#ifdef CONFIG_LPC43_AHBSRAM_BANK1
+# define MM_USE_AHBSRAM_BANK1 1
#endif
#define MM_DMAREGION_BASE LPC43_AHBSRAM_BANK2_BASE
@@ -199,8 +250,69 @@
#warning "Missing Logic"
-#define MM_DMAHEAP_BASE MM_DMAREGION_BASE /* For now... use it all */
-#define MM_DMAHEAP_SIZE MM_DMAREGION_SIZE
+#ifdef CONFIG_LPC43_AHBSRAM_BANK2
+# define MM_USE_AHBSRAM_BANK2 1
+# define MM_DMAHEAP_BASE MM_DMAREGION_BASE /* For now... use it all */
+# define MM_DMAHEAP_SIZE MM_DMAREGION_SIZE
+#endif
+
+/* External RAM configuration */
+
+/* Check if external SDRAM is supported and, if so, it is intended to be used
+ * used as heap.
+ */
+
+#if !defined(CONFIG_LPC43_EXTSDRAM0) || !defined(CONFIG_LPC43_EXTSDRAM0_HEAP)
+# undef CONFIG_LPC43_EXTSDRAM0_SIZE
+# define CONFIG_LPC43_EXTSDRAM0_SIZE 0
+#endif
+
+#if !defined(CONFIG_LPC43_EXTSDRAM1) || !defined(CONFIG_LPC43_EXTSDRAM1_HEAP)
+# undef CONFIG_LPC43_EXTSDRAM1_SIZE
+# define CONFIG_LPC43_EXTSDRAM1_SIZE 0
+#endif
+
+#if !defined(CONFIG_LPC43_EXTSDRAM2) || !defined(CONFIG_LPC43_EXTSDRAM2_HEAP)
+# undef CONFIG_LPC43_EXTSDRAM2_SIZE
+# define CONFIG_LPC43_EXTSDRAM2_SIZE 0
+#endif
+
+#if !defined(CONFIG_LPC43_EXTSDRAM3) || !defined(CONFIG_LPC43_EXTSDRAM3_HEAP)
+# undef CONFIG_LPC43_EXTSDRAM3_SIZE
+# define CONFIG_LPC43_EXTSDRAM3_SIZE 0
+#endif
+
+#if CONFIG_LPC43_EXTSDRAM0_SIZE > 0
+# define MM_USE_EXTSDRAM0 1
+# define MM_EXTSDRAM0_REGION LPC43_DYCS0_BASE
+# define MM_EXTSDRAM0_SIZE CONFIG_LPC43_EXTSDRAM0_SIZE
+#endif /* CONFIG_LPC43_EXTSDRAM0_SIZE */
+
+#if CONFIG_LPC43_EXTSDRAM1_SIZE > 0
+# define MM_USE_EXTSDRAM1 1
+# define MM_EXTSDRAM1_REGION LPC43_DYCS1_BASE
+# define MM_EXTSDRAM1_SIZE CONFIG_LPC43_EXTSDRAM1_SIZE
+#endif /* CONFIG_LPC43_EXTSDRAM1_SIZE */
+
+#if CONFIG_LPC43_EXTSDRAM2_SIZE > 0
+# define MM_USE_EXTSDRAM2 1
+# define MM_EXTSDRAM2_REGION LPC43_DYCS2_BASE
+# define MM_EXTSDRAM2_SIZE CONFIG_LPC43_EXTSDRAM2_SIZE
+#endif /* CONFIG_LPC43_EXTSDRAM1_SIZE */
+
+#if CONFIG_LPC43_EXTSDRAM3_SIZE > 0
+# define HAVE_EXTSDRAM3_REGION 1
+# define MM_EXTSDRAM3_REGION LPC43_DYCS3_BASE
+# define MM_EXTSDRAM3_SIZE CONFIG_LPC43_EXTSDRAM3_SIZE
+#endif /* CONFIG_LPC43_EXTSDRAM3_SIZE */
+
+#if CONFIG_MM_REGIONS > 1 && \
+ (defined(MM_USE_LOCSRAM_BANK1) || defined(MM_USE_AHBSRAM_BANK0) || \
+ defined(MM_USE_AHBSRAM_BANK1) || defined(MM_USE_AHBSRAM_BANK2) || \
+ defined(MM_USE_EXTSDRAM0) || defined(MM_USE_EXTSDRAM1) || \
+ defined(MM_USE_EXTSDRAM2) || defined(MM_USE_EXTSDRAM3))
+# define MM_HAVE_REGION 1
+#endif
/****************************************************************************
* Private Data
@@ -216,15 +328,31 @@
* thread is the thread that the system boots on and, eventually, becomes the
* idle, do nothing task that runs only when there is nothing else to run.
* The heap continues from there until the configured end of memory.
- * g_idle_topstack is the beginning of this heap region (not necessarily aligned).
+ * g_idle_topstack is the beginning of this heap region (not necessarily
+ * aligned).
*/
const uint32_t g_idle_topstack = (uint32_t)&_ebss + CONFIG_IDLETHREAD_STACKSIZE;
+#ifdef MM_HAVE_REGION
+static uint8_t g_mem_region_next = 0;
+#endif
+
/****************************************************************************
* Private Functions
****************************************************************************/
+#ifdef MM_HAVE_REGION
+static void mem_addregion(FAR void *region_start, size_t region_size)
+{
+ if (g_mem_region_next <= CONFIG_MM_REGIONS)
+ {
+ kmm_addregion(region_start, region_size);
+ g_mem_region_next++;
+ }
+}
+#endif
+
/****************************************************************************
* Public Functions
****************************************************************************/
@@ -265,35 +393,42 @@ void up_allocate_heap(FAR void **heap_start, size_t *heap_size)
#if CONFIG_MM_REGIONS > 1
void up_addregion(void)
{
-#if CONFIG_MM_REGIONS > 1
- /* Add the next SRAM region (which should exist) */
+#ifdef MM_HAVE_REGION
+ /* start from second region */
- kmm_addregion((FAR void *)MM_REGION2_BASE, MM_REGION2_SIZE);
+ g_mem_region_next = 2;
-#ifdef MM_REGION3_BASE
- /* Add the third SRAM region (which will not exist in configuration B) */
+# ifdef MM_USE_LOCSRAM_BANK1
+ mem_addregion((FAR void *)LPC43_LOCSRAM_BANK1_BASE, LPC43_LOCSRAM_BANK1_SIZE);
+# endif
-#if CONFIG_MM_REGIONS > 2
- /* Add the third SRAM region (which may not exist) */
+# ifdef MM_USE_AHBSRAM_BANK0
+ mem_addregion((FAR void *)LPC43_AHBSRAM_BANK0_BASE, LPC43_AHBSRAM_BANK0_SIZE);
+# endif
- kmm_addregion((FAR void *)MM_REGION3_BASE, MM_REGION3_SIZE);
+# ifdef MM_USE_AHBSRAM_BANK1
+ mem_addregion((FAR void *)LPC43_AHBSRAM_BANK1_BASE, LPC43_AHBSRAM_BANK1_SIZE);
+# endif
-#if CONFIG_MM_REGIONS > 3 && defined(MM_DMAHEAP_BASE)
- /* Add the DMA region (which may not be available) */
+# ifdef MM_USE_AHBSRAM_BANK2
+ mem_addregion((FAR void *)MM_DMAREGION_BASE, MM_DMAREGION_SIZE);
+# endif
- kmm_addregion((FAR void *)MM_DMAHEAP_BASE, MM_DMAHEAP_SIZE);
+# ifdef MM_USE_EXTSDRAM0
+ mem_addregion((FAR void *)MM_EXTSDRAM0_REGION, MM_EXTSDRAM0_SIZE);
+# endif
-#endif /* CONFIG_MM_REGIONS > 3 && defined(MM_DMAHEAP_BASE) */
-#endif /* CONFIG_MM_REGIONS > 2 */
-#else /* MM_REGION3_BASE */
+# ifdef MM_USE_EXTSDRAM1
+ mem_addregion((FAR void *)MM_EXTSDRAM1_REGION, MM_EXTSDRAM1_SIZE);
+# endif
-#if CONFIG_MM_REGIONS > 2 && defined(MM_DMAHEAP_BASE)
- /* Add the DMA region (which may not be available) */
+# ifdef MM_USE_EXTSDRAM2
+ mem_addregion((FAR void *)MM_EXTSDRAM2_REGION, MM_EXTSDRAM2_SIZE);
+# endif
- kmm_addregion((FAR void *)MM_DMAHEAP_BASE, MM_DMAHEAP_SIZE);
-
-#endif /* CONFIG_MM_REGIONS > 3 && defined(MM_DMAHEAP_BASE) */
-#endif /* MM_REGION3_BASE */
-#endif /* CONFIG_MM_REGIONS > 1 */
+# ifdef MM_USE_EXTSDRAM3
+ mem_addregion((FAR void *)MM_EXTSDRAM3_REGION, MM_EXTSDRAM3_SIZE);
+# endif
+#endif
}
#endif
diff --git a/arch/arm/src/lpc43xx/lpc43_emc.c b/arch/arm/src/lpc43xx/lpc43_emc.c
new file mode 100644
index 00000000000..a15ecb5610d
--- /dev/null
+++ b/arch/arm/src/lpc43xx/lpc43_emc.c
@@ -0,0 +1,141 @@
+/****************************************************************************
+ * arch/arm/src/lpc43xx/lpc43_emc.c
+ *
+ ****************************************************************************/
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include
+
+
+/* TODO: add #if defined(CONFIG_LPC43_EMC) */
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+
+#include
+#include
+#include
+
+#include "up_internal.h"
+
+#include "chip.h"
+#include "lpc43_pinconfig.h"
+#include "lpc43_emc.h"
+#include "chip/lpc43_creg.h"
+#include "chip/lpc43_cgu.h"
+#include "chip/lpc43_ccu.h"
+#include "lpc43_rgu.h"
+#include "lpc43_gpio.h"
+#include "up_arch.h"
+#include
+
+
+/****************************************************************************
+ * Pre-processor Definitions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Public Data
+ ****************************************************************************/
+
+/****************************************************************************
+ * Private Data
+ ****************************************************************************/
+
+/****************************************************************************
+ * Private Functions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Public Functions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Name: lpc43_emcinit
+ *
+ * Description:
+ * Initialize EMC controller. Start in full power
+ * mode.
+ *
+ ****************************************************************************/
+void lpc43_emcinit(uint32_t enable, uint32_t clock_ratio, uint32_t endian_mode)
+{
+ uint32_t regval;
+
+ /* Enable clock for EMC controller. */
+
+ regval = getreg32(LPC43_CCU1_M4_EMC_CFG);
+ regval |= CCU_CLK_CFG_RUN;
+ putreg32(regval, LPC43_CCU1_M4_EMC_CFG);
+
+ /* Configure endian mode and clock ratio. */
+
+ regval = 0;
+ if (endian_mode)
+ regval |= EMC_CONFIG_EM;
+ if (clock_ratio)
+ regval |= EMC_CONFIG_CR;
+
+ putreg32(regval, LPC43_EMC_CONFIG);
+
+ /* Enable EMC 001 normal memory map, no low power mode. */
+
+ putreg32(EMC_CONTROL_ENA, LPC43_EMC_CONTROL);
+}
+
+/****************************************************************************
+ * Name: lpc43_lowpowermode
+ *
+ * Description:
+ * Set EMC lowpower mode.
+ *
+ ****************************************************************************/
+void lpc43_lowpowermode(uint8_t enable)
+{
+ uint32_t regval;
+
+ regval = getreg32(LPC43_EMC_CONTROL);
+ if (enable)
+ {
+ regval |= EMC_CONTROL_LOWPOWER;
+ putreg32(regval, LPC43_EMC_CONTROL);
+ }
+ else
+ {
+ regval &= ~EMC_CONTROL_LOWPOWER;
+ putreg32(regval, LPC43_EMC_CONTROL);
+ }
+}
+
+/****************************************************************************
+ * Name: lpc43_emcenable
+ *
+ * Description:
+ * Enable or disable EMC controller.
+ *
+ ****************************************************************************/
+void lpc43_emcenable(uint8_t enable)
+{
+ uint32_t regval;
+
+ regval = getreg32(LPC43_EMC_CONTROL);
+ if (enable)
+ {
+ regval |= EMC_CONTROL_ENA;
+ putreg32(regval, LPC43_EMC_CONTROL);
+ }
+ else
+ {
+ regval &= ~EMC_CONTROL_ENA;
+ putreg32(regval, LPC43_EMC_CONTROL);
+ }
+}
diff --git a/arch/arm/src/lpc43xx/lpc43_emc.h b/arch/arm/src/lpc43xx/lpc43_emc.h
index 3c2bd2496fe..77b71d86120 100644
--- a/arch/arm/src/lpc43xx/lpc43_emc.h
+++ b/arch/arm/src/lpc43xx/lpc43_emc.h
@@ -1,7 +1,7 @@
/************************************************************************************
* arch/arm/src/lpc43xx/lpc43_emc.h
*
- * Copyright (C) 2012 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2012, 2016 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt
*
* Redistribution and use in source and binary forms, with or without
@@ -48,16 +48,22 @@
* Pre-processor Definitions
************************************************************************************/
-/************************************************************************************
- * Public Types
- ************************************************************************************/
+/* Chip select Definitions **********************************************************/
+
+#define EMC_CS0 0
+#define EMC_CS1 1
+#define EMC_CS2 2
+#define EMC_CS3 3
+
+#define EMC_DYNCS0 0
+#define EMC_DYNCS1 1
+#define EMC_DYNCS2 2
+#define EMC_DYNCS3 3
/************************************************************************************
- * Public Data
+ * Public Function Prototypes
************************************************************************************/
-/************************************************************************************
- * Public Functions
- ************************************************************************************/
+void lpc43_emcinit(uint32_t enable, uint32_t clock_ratio, uint32_t endian_mode);
#endif /* __ARCH_ARM_SRC_LPC43XX_LPC43_EMC_H */
diff --git a/arch/arm/src/lpc43xx/lpc43_irq.c b/arch/arm/src/lpc43xx/lpc43_irq.c
index 26881472c8d..09680bd9e91 100644
--- a/arch/arm/src/lpc43xx/lpc43_irq.c
+++ b/arch/arm/src/lpc43xx/lpc43_irq.c
@@ -91,10 +91,6 @@ volatile uint32_t *g_current_regs[1];
extern uint32_t _vectors[];
-/****************************************************************************
- * Private Data
- ****************************************************************************/
-
/****************************************************************************
* Private Functions
****************************************************************************/
@@ -250,15 +246,9 @@ static int lpc43_irqinfo(int irq, uintptr_t *regaddr, uint32_t *bit,
if (irq >= LPC43_IRQ_EXTINT)
{
- n = irq - LPC43_IRQ_EXTINT;
+ n = irq - LPC43_IRQ_EXTINT;
*regaddr = NVIC_IRQ_ENABLE(n) + offset;
-
- while (n >= 32)
- {
- n -= 32;
- }
-
- *bit = 1 << n;
+ *bit = (uint32_t)1 << (n & 0x1f);
}
/* Handle processor exceptions. Only a few can be disabled */
diff --git a/arch/arm/src/sam34/chip/sam3x_memorymap.h b/arch/arm/src/sam34/chip/sam3x_memorymap.h
index e32e6ec226e..ba053d3c353 100644
--- a/arch/arm/src/sam34/chip/sam3x_memorymap.h
+++ b/arch/arm/src/sam34/chip/sam3x_memorymap.h
@@ -91,6 +91,7 @@
# define SAM_TC8_BASE 0x40088080 /* 0x40088080-0x400880bf: Timer Counter 5 */
/* 0x400880c0-0x4008ffff Reserved */
#define SAM_TWI_BASE 0x4008c000 /* 0x4008c000-0x4001ffff: Two-Wire Interface */
+# define SAM_TWIN_BASE(n) (SAM_TWI_BASE + ((n) << 14))
# define SAM_TWI0_BASE 0x4008c000 /* 0x4008c000-0x4008ffff: Two-Wire Interface 0 */
# define SAM_TWI1_BASE 0x40090000 /* 0x40090000-0x40093fff: Two-Wire Interface 1 */
#define SAM_PWM_BASE 0x40094000 /* 0x40020000-0x4003ffff: Pulse Width Modulation */
diff --git a/arch/arm/src/sam34/chip/sam4cm_memorymap.h b/arch/arm/src/sam34/chip/sam4cm_memorymap.h
index 15505238845..c0b2de041b8 100644
--- a/arch/arm/src/sam34/chip/sam4cm_memorymap.h
+++ b/arch/arm/src/sam34/chip/sam4cm_memorymap.h
@@ -77,8 +77,12 @@
#define SAM_TC3_BASE 0x40014000
#define SAM_TC4_BASE 0x40014040
#define SAM_TC5_BASE 0x40014080
+
+#define SAM_TWI_BASE 0x40018000
+#define SAM_TWIN_BASE(n) (SAM_TWI_BASE + ((n) << 14))
#define SAM_TWI0_BASE 0x40018000
#define SAM_TWI1_BASE 0x4001C000
+
#define SAM_USART0_BASE 0x40024000
#define SAM_USART1_BASE 0x40028000
#define SAM_USART2_BASE 0x4002C000
diff --git a/arch/arm/src/sam34/chip/sam4e_memorymap.h b/arch/arm/src/sam34/chip/sam4e_memorymap.h
index 95bfdef2eb7..1cf95993996 100644
--- a/arch/arm/src/sam34/chip/sam4e_memorymap.h
+++ b/arch/arm/src/sam34/chip/sam4e_memorymap.h
@@ -108,6 +108,7 @@
# define SAM_USART0_BASE 0x400a0000 /* 0x400a0000-0x400a3fff: USART0 */
# define SAM_USART1_BASE 0x400a4000 /* 0x400a4000-0x400abfff: USART1 */
#define SAM_TWI_BASE 0x400a8000 /* 0x400a8000-0x400affff: Two-Wire Interface */
+# define SAM_TWIN_BASE(n) (SAM_TWI_BASE + ((n) << 14))
# define SAM_TWI0_BASE 0x400a8000 /* 0x400a8000-0x400abfff: Two-Wire Interface 0 */
# define SAM_TWI1_BASE 0x400ac000 /* 0x400ac000-0x400affff: Two-Wire Interface 1 */
#define SAM_AFEC_BASE 0x400b0000 /* 0x400b0000-0x400b7fff: Analog Front End */
diff --git a/arch/arm/src/sam34/chip/sam4l_memorymap.h b/arch/arm/src/sam34/chip/sam4l_memorymap.h
index 56810fe442c..62a8c6a0c5c 100644
--- a/arch/arm/src/sam34/chip/sam4l_memorymap.h
+++ b/arch/arm/src/sam34/chip/sam4l_memorymap.h
@@ -82,6 +82,9 @@
/* 0x4000c000-0x4000ffff: Reserved */
#define SAM_TC0_BASE 0x40100000 /* 0x40100000-0x4013ffff: Timer Counter 0 */
#define SAM_TC1_BASE 0x40140000 /* 0x40180000-0x4017ffff: Timer Counter 1 */
+
+#define SAM_TWIMS_BASE 0x40180000 /* 0x40180000-0x401fffff: Two-wire Master/Slave */
+#define SAM_TWIN_BASE(n) (SAM_TWIMS_BASE + ((n) << 14))
#define SAM_TWIMS0_BASE 0x40180000 /* 0x40180000-0x401bffff: Two-wire Master/Slave Interface 0 */
#define SAM_TWIMS1_BASE 0x401c0000 /* 0x401c0000-0x401fffff: Two-wire Master/Slave Interface 1 */
/* 0x40020000-0x40023fff: Reserved */
diff --git a/arch/arm/src/sam34/chip/sam4s_memorymap.h b/arch/arm/src/sam34/chip/sam4s_memorymap.h
index 0ebf658866c..45e8a97a3f6 100644
--- a/arch/arm/src/sam34/chip/sam4s_memorymap.h
+++ b/arch/arm/src/sam34/chip/sam4s_memorymap.h
@@ -84,6 +84,7 @@
# define SAM_TC5_BASE 0x40014080 /* 0x40014080-0x400140bf: Timer Counter 5 */
#define SAM_TWI_BASE 0x40018000 /* 0x40018000-0x4001ffff: Two-Wire Interface */
+# define SAM_TWIN_BASE(n) (SAM_TWI_BASE + ((n) << 14))
# define SAM_TWI0_BASE 0x40018000 /* 0x40018000-0x4001bfff: Two-Wire Interface 0 */
# define SAM_TWI1_BASE 0x4001c000 /* 0x4001c000-0x4001ffff: Two-Wire Interface 1 */
#define SAM_PWM_BASE 0x40020000 /* 0x40020000-0x4003ffff: Pulse Width Modulation */
diff --git a/arch/arm/src/sam34/chip/sam_twi.h b/arch/arm/src/sam34/chip/sam_twi.h
index 8ad5a0f8aeb..2f843dd07c3 100644
--- a/arch/arm/src/sam34/chip/sam_twi.h
+++ b/arch/arm/src/sam34/chip/sam_twi.h
@@ -143,6 +143,7 @@
#define TWI_MMR_MREAD (1 << 12) /* Bit 12: Master Read Direction */
#define TWI_MMR_DADR_SHIFT (16) /* Bits 16-22: Device Address */
#define TWI_MMR_DADR_MASK (0x7f << TWI_MMR_DADR_SHIFT)
+# define TWI_MMR_DADR(n) ((uint32_t)(n) << TWI_MMR_DADR_SHIFT)
/* TWI Slave Mode Register */
@@ -186,6 +187,9 @@
#define TWI_INT_RXBUFF (1 << 14) /* Bit 14: RX Buffer */
#define TWI_INT_TXBUFE (1 << 15) /* Bit 15: TX Buffer Empty */
+#define TWI_INT_ERRORS (0x00000340)
+#define TWI_INT_ALL (0x0000ffff)
+
/* TWI Receive Holding Register */
#define TWI_RHR_RXDATA_SHIFT (0) /* Bits 0-7: Master or Slave Receive Holding Data */
diff --git a/arch/arm/src/sam34/sam_serial.c b/arch/arm/src/sam34/sam_serial.c
index 46df27954a1..36043e9deb8 100644
--- a/arch/arm/src/sam34/sam_serial.c
+++ b/arch/arm/src/sam34/sam_serial.c
@@ -692,8 +692,8 @@ static void up_disableallints(struct up_dev_s *priv, uint32_t *imr)
static int up_setup(struct uart_dev_s *dev)
{
- struct up_dev_s *priv = (struct up_dev_s *)dev->priv;
#ifndef CONFIG_SUPPRESS_UART_CONFIG
+ struct up_dev_s *priv = (struct up_dev_s *)dev->priv;
uint32_t regval;
uint32_t imr;
diff --git a/arch/arm/src/sam34/sam_udp.c b/arch/arm/src/sam34/sam_udp.c
index 6fe76f4f57b..96a521d0ba5 100644
--- a/arch/arm/src/sam34/sam_udp.c
+++ b/arch/arm/src/sam34/sam_udp.c
@@ -305,6 +305,7 @@ struct sam_ep_s
uint8_t zlpneeded:1; /* Zero length packet needed at end of transfer */
uint8_t zlpsent:1; /* Zero length packet has been sent */
uint8_t txbusy:1; /* Write request queue is busy (recursion avoidance kludge) */
+ uint8_t lastbank:1; /* Last bank we read data from */
};
struct sam_usbdev_s
@@ -1188,9 +1189,14 @@ static int sam_req_read(struct sam_usbdev_s *priv, struct sam_ep_s *privep,
/* We get here when an RXDATABK0/1 interrupt occurs. That interrupt
* cannot be cleared until all of the data has been taken from the RX
- * FIFO. But we can
+ * FIFO.
+ *
+ * Also, we need to remember which bank we read last so the interrupt handler
+ * can determine the correct bank read sequence for future reads.
*/
+ privep->lastbank = bank;
+
sam_csr_clrbits(epno, bank ? UDPEP_CSR_RXDATABK1 : UDPEP_CSR_RXDATABK0);
/* Complete the transfer immediately and give the data to the class
@@ -1873,7 +1879,6 @@ static void sam_ep_bankinterrupt(struct sam_usbdev_s *priv,
* transferred from the FIFO.
*/
- privep->epstate = UDP_EPSTATE_IDLE;
(void)sam_req_read(priv, privep, pktsize, bank);
}
@@ -1959,6 +1964,8 @@ static void sam_ep_interrupt(struct sam_usbdev_s *priv, int epno)
struct sam_ep_s *privep;
uintptr_t regaddr;
uint32_t csr;
+ bool bk0;
+ bool bk1;
DEBUGASSERT((unsigned)epno < SAM_UDP_NENDPOINTS);
@@ -2020,34 +2027,82 @@ static void sam_ep_interrupt(struct sam_usbdev_s *priv, int epno)
}
}
- /* OUT packet received in data bank 0 */
- if ((csr & UDPEP_CSR_RXDATABK0) != 0)
+ /* OUT packet received.
+ *
+ * OUT packets are received in two banks. The hardware does not provide
+ * information about which bank has been filled last. Therefore we need to
+ * keep track about which bank we read last to figure out which bank(s) we
+ * need to read next.
+ *
+ * When we get here either none, one or both banks can be filled with data.
+ * Depending on which bank we read last and which bank(s) contain data we
+ * need to correctly sequence the FIFO reads:
+ *
+ * case lastbank bk0 bk1 read sequence
+ * 1. 0 0 0 No data to read
+ * 2. 0 1 0 Only read bank 0
+ * 3. 0 0 1 Only read bank 1
+ * 4. 0 1 1 Read bank 1, then read bank 0
+ *
+ * 5. 1 0 0 No data to read
+ * 6. 1 1 0 Only read bank 0
+ * 7. 1 0 1 Only read bank 1 (should not happen)
+ * 8. 1 1 1 Read bank 0, then read bank 1
+ *
+ * lastbank will be updated in sam_req_read() after the FIFO has been read
+ * and clear RXDATABKx.
+ */
+
+ bk0 = (csr & UDPEP_CSR_RXDATABK0) != 0;
+ bk1 = (csr & UDPEP_CSR_RXDATABK1) != 0;
+
+ /* 2. and 6. - Only read bank 0 */
+
+ if (bk0 && !bk1)
{
usbtrace(TRACE_INTDECODE(SAM_TRACEINTID_RXDATABK0), (uint16_t)csr);
-
- /* Handle data received on Bank 0. sam_ep_bankinterrupt will
- * clear the RXDATABK0 interrupt once that data has been
- * transferred from the FIFO.
- */
-
sam_ep_bankinterrupt(priv, privep, csr, 0);
}
- /* OUT packet received in data bank 1 */
+ /* 3. and 7. - Only read bank 1*/
- else if ((csr & UDPEP_CSR_RXDATABK1) != 0)
+ else if (!bk0 && bk1)
{
+#ifdef CONFIG_DEBUG_USB_WARN
+ if (privep->lastbank == 1)
+ {
+ uwarn("WARNING: Unexpected USB RX case.\n");
+ }
+#endif
+
usbtrace(TRACE_INTDECODE(SAM_TRACEINTID_RXDATABK1), (uint16_t)csr);
- DEBUGASSERT(SAM_UDP_NBANKS(epno) > 1);
-
- /* Handle data received on Bank 1. sam_ep_bankinterrupt will
- * clear the RXDATABK1 interrupt once that data has been
- * transferred from the FIFO.
- */
-
sam_ep_bankinterrupt(priv, privep, csr, 1);
}
+ else if (bk0 && bk1)
+ {
+ /* 4. - Read bank 1, then read bank 0 */
+
+ if (privep->lastbank == 0)
+ {
+ usbtrace(TRACE_INTDECODE(SAM_TRACEINTID_RXDATABK1), (uint16_t)csr);
+ sam_ep_bankinterrupt(priv, privep, csr, 1);
+
+ usbtrace(TRACE_INTDECODE(SAM_TRACEINTID_RXDATABK0), (uint16_t)csr);
+ sam_ep_bankinterrupt(priv, privep, csr, 0);
+ }
+
+ /* 8. - Read bank 0, then read bank 1 */
+
+ else
+ {
+ usbtrace(TRACE_INTDECODE(SAM_TRACEINTID_RXDATABK0), (uint16_t)csr);
+ sam_ep_bankinterrupt(priv, privep, csr, 0);
+
+ usbtrace(TRACE_INTDECODE(SAM_TRACEINTID_RXDATABK1), (uint16_t)csr);
+ sam_ep_bankinterrupt(priv, privep, csr, 1);
+ }
+ }
/* STALL sent */
@@ -2510,6 +2565,7 @@ static void sam_ep_reset(struct sam_usbdev_s *priv, uint8_t epno)
privep->zlpneeded = false;
privep->zlpsent = false;
privep->txbusy = false;
+ privep->lastbank = 1;
}
/****************************************************************************
diff --git a/arch/arm/src/sama5/sam_can.c b/arch/arm/src/sama5/sam_can.c
index 3e1b3d116a1..f801e6e8341 100644
--- a/arch/arm/src/sama5/sam_can.c
+++ b/arch/arm/src/sama5/sam_can.c
@@ -60,7 +60,7 @@
#include
#include
-#include
+#include
#include "up_internal.h"
#include "up_arch.h"
diff --git a/arch/arm/src/sama5/sam_can.h b/arch/arm/src/sama5/sam_can.h
index c18361533f2..5a26fe83143 100644
--- a/arch/arm/src/sama5/sam_can.h
+++ b/arch/arm/src/sama5/sam_can.h
@@ -45,7 +45,7 @@
#include "chip.h"
#include "chip/sam_can.h"
-#include
+#include
#if defined(CONFIG_CAN) && (defined(CONFIG_SAMA5_CAN0) || defined(CONFIG_SAMA5_CAN1))
diff --git a/arch/arm/src/sama5/sam_pwm.c b/arch/arm/src/sama5/sam_pwm.c
index 0de1d91dea0..d523da24a1c 100644
--- a/arch/arm/src/sama5/sam_pwm.c
+++ b/arch/arm/src/sama5/sam_pwm.c
@@ -47,7 +47,7 @@
#include
#include
-#include
+#include
#include "chip/sam_pinmap.h"
#include
diff --git a/arch/arm/src/sama5/sam_trng.c b/arch/arm/src/sama5/sam_trng.c
index a3eb102640e..4c0f5ab1bcc 100644
--- a/arch/arm/src/sama5/sam_trng.c
+++ b/arch/arm/src/sama5/sam_trng.c
@@ -1,7 +1,7 @@
/****************************************************************************
* arch/arm/src/sama5/sam_trng.c
*
- * Copyright (C) 2013 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2013, 2016 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt
*
* Derives, in part, from Max Holtzberg's STM32 RNG Nuttx driver:
@@ -52,6 +52,8 @@
#include
#include
+#include
+#include
#include "up_arch.h"
#include "up_internal.h"
@@ -59,6 +61,9 @@
#include "sam_periphclks.h"
#include "sam_trng.h"
+#if defined(CONFIG_SAMA5_TRNG)
+#if defined(CONFIG_DEV_RANDOM) || defined(CONFIG_DEV_URANDOM_ARCH)
+
/****************************************************************************
* Private Function Prototypes
****************************************************************************/
@@ -325,14 +330,10 @@ errout:
}
/****************************************************************************
- * Public Functions
- ****************************************************************************/
-
-/****************************************************************************
- * Name: up_rnginitialize
+ * Name: sam_rng_initialize
*
* Description:
- * Initialize the TRNG hardware and register the /dev/randome driver.
+ * Initialize the TRNG hardware.
*
* Input Parameters:
* None
@@ -342,7 +343,7 @@ errout:
*
****************************************************************************/
-void up_rnginitialize(void)
+static int sam_rng_initialize(void)
{
int ret;
@@ -360,10 +361,11 @@ void up_rnginitialize(void)
/* Initialize the TRNG interrupt */
- if (irq_attach(SAM_IRQ_TRNG, sam_interrupt))
+ ret = irq_attach(SAM_IRQ_TRNG, sam_interrupt);
+ if (ret < 0)
{
ferr("ERROR: Failed to attach to IRQ%d\n", SAM_IRQ_TRNG);
- return;
+ return ret;
}
/* Disable the interrupts at the TRNG */
@@ -374,16 +376,80 @@ void up_rnginitialize(void)
putreg32(TRNG_CR_DISABLE | TRNG_CR_KEY, SAM_TRNG_CR);
- /* Register the character driver */
-
- ret = register_driver("/dev/random", &g_trngops, 0644, NULL);
- if (ret < 0)
- {
- ferr("ERROR: Failed to register /dev/random\n");
- return;
- }
-
/* Enable the TRNG interrupt at the AIC */
up_enable_irq(SAM_IRQ_TRNG);
+ return OK;
}
+
+/****************************************************************************
+ * Public Functions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Name: devrandom_register
+ *
+ * Description:
+ * Initialize the TRNG hardware and register the /dev/random driver.
+ * Must be called BEFORE devurandom_register.
+ *
+ * Input Parameters:
+ * None
+ *
+ * Returned Value:
+ * None
+ *
+ ****************************************************************************/
+
+#ifdef CONFIG_DEV_RANDOM
+void devrandom_register(void)
+{
+ int ret;
+
+ ret = sam_rng_initialize();
+ if (ret >= 0)
+ {
+ ret = register_driver("/dev/random", &g_trngops, 0644, NULL);
+ if (ret < 0)
+ {
+ ferr("ERROR: Failed to register /dev/random\n");
+ }
+ }
+}
+#endif
+
+/****************************************************************************
+ * Name: devurandom_register
+ *
+ * Description:
+ * Register /dev/urandom
+ *
+ * Input Parameters:
+ * None
+ *
+ * Returned Value:
+ * None
+ *
+ ****************************************************************************/
+
+#ifdef CONFIG_DEV_URANDOM_ARCH
+void devurandom_register(void)
+{
+ int ret;
+
+#ifndef CONFIG_DEV_RANDOM
+ ret = sam_rng_initialize();
+ if (ret >= 0)
+#endif
+ {
+ ret = register_driver("/dev/urandom", &g_trngops, 0644, NULL);
+ if (ret < 0)
+ {
+ ferr("ERROR: Failed to register /dev/urandom\n");
+ }
+ }
+}
+#endif
+
+#endif /* CONFIG_DEV_RANDOM || CONFIG_DEV_URANDOM_ARCH */
+#endif /* CONFIG_SAMA5_TRNG */
diff --git a/arch/arm/src/samv7/sam_mcan.c b/arch/arm/src/samv7/sam_mcan.c
index 748b01b10b3..49e05f306b9 100644
--- a/arch/arm/src/samv7/sam_mcan.c
+++ b/arch/arm/src/samv7/sam_mcan.c
@@ -56,7 +56,7 @@
#include
#include
#include
-#include
+#include
#include "cache.h"
#include "up_internal.h"
diff --git a/arch/arm/src/samv7/sam_mcan.h b/arch/arm/src/samv7/sam_mcan.h
index 540800b37d3..07ecdd71ad3 100644
--- a/arch/arm/src/samv7/sam_mcan.h
+++ b/arch/arm/src/samv7/sam_mcan.h
@@ -45,7 +45,7 @@
#include "chip.h"
#include "chip/sam_mcan.h"
-#include
+#include
#if defined(CONFIG_CAN) && (defined(CONFIG_SAMV7_MCAN0) || \
defined(CONFIG_SAMV7_MCAN1))
diff --git a/arch/arm/src/samv7/sam_trng.c b/arch/arm/src/samv7/sam_trng.c
index 7dc29a77d83..d6cc16eb0b4 100644
--- a/arch/arm/src/samv7/sam_trng.c
+++ b/arch/arm/src/samv7/sam_trng.c
@@ -1,7 +1,7 @@
/****************************************************************************
* arch/arm/src/samv7/sam_trng.c
*
- * Copyright (C) 2015 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2015-2016 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt
*
* Derives from the SAMA5D3 TRNG Nuttx driver which, in turn, derives, in
@@ -53,6 +53,8 @@
#include
#include
+#include
+#include
#include "up_arch.h"
#include "up_internal.h"
@@ -60,6 +62,9 @@
#include "sam_periphclks.h"
#include "sam_trng.h"
+#if defined(CONFIG_SAMV7_TRNG)
+#if defined(CONFIG_DEV_RANDOM) || defined(CONFIG_DEV_URANDOM_ARCH)
+
/****************************************************************************
* Private Function Prototypes
****************************************************************************/
@@ -326,14 +331,10 @@ errout:
}
/****************************************************************************
- * Public Functions
- ****************************************************************************/
-
-/****************************************************************************
- * Name: up_rnginitialize
+ * Name: sam_rng_initialize
*
* Description:
- * Initialize the TRNG hardware and register the /dev/randome driver.
+ * Initialize the TRNG hardware.
*
* Input Parameters:
* None
@@ -343,7 +344,7 @@ errout:
*
****************************************************************************/
-void up_rnginitialize(void)
+static int sam_rng_initialize(void)
{
int ret;
@@ -361,10 +362,11 @@ void up_rnginitialize(void)
/* Initialize the TRNG interrupt */
- if (irq_attach(SAM_IRQ_TRNG, sam_interrupt))
+ ret = irq_attach(SAM_IRQ_TRNG, sam_interrupt);
+ if (ret < 0)
{
ferr("ERROR: Failed to attach to IRQ%d\n", SAM_IRQ_TRNG);
- return;
+ return ret;
}
/* Disable the interrupts at the TRNG */
@@ -375,16 +377,80 @@ void up_rnginitialize(void)
putreg32(TRNG_CR_DISABLE | TRNG_CR_KEY, SAM_TRNG_CR);
- /* Register the character driver */
-
- ret = register_driver("/dev/random", &g_trngops, 0644, NULL);
- if (ret < 0)
- {
- ferr("ERROR: Failed to register /dev/random\n");
- return;
- }
-
/* Enable the TRNG interrupt at the AIC */
up_enable_irq(SAM_IRQ_TRNG);
+ return OK;
}
+
+/****************************************************************************
+ * Public Functions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Name: devrandom_register
+ *
+ * Description:
+ * Initialize the TRNG hardware and register the /dev/random driver.
+ * Must be called BEFORE devurandom_register.
+ *
+ * Input Parameters:
+ * None
+ *
+ * Returned Value:
+ * None
+ *
+ ****************************************************************************/
+
+#ifdef CONFIG_DEV_RANDOM
+void devrandom_register(void)
+{
+ int ret;
+
+ ret = sam_rng_initialize();
+ if (ret >= 0)
+ {
+ ret = register_driver("/dev/random", &g_trngops, 0644, NULL);
+ if (ret < 0)
+ {
+ ferr("ERROR: Failed to register /dev/random\n");
+ }
+ }
+}
+#endif
+
+/****************************************************************************
+ * Name: devurandom_register
+ *
+ * Description:
+ * Register /dev/urandom
+ *
+ * Input Parameters:
+ * None
+ *
+ * Returned Value:
+ * None
+ *
+ ****************************************************************************/
+
+#ifdef CONFIG_DEV_URANDOM_ARCH
+void devurandom_register(void)
+{
+ int ret;
+
+#ifndef CONFIG_DEV_RANDOM
+ ret = sam_rng_initialize();
+ if (ret >= 0)
+#endif
+ {
+ ret = register_driver("/dev/urandom", &g_trngops, 0644, NULL);
+ if (ret < 0)
+ {
+ ferr("ERROR: Failed to register /dev/urandom\n");
+ }
+ }
+}
+#endif
+
+#endif /* CONFIG_DEV_RANDOM || CONFIG_DEV_URANDOM_ARCH */
+#endif /* CONFIG_SAMV7_TRNG */
diff --git a/arch/arm/src/stm32/Kconfig b/arch/arm/src/stm32/Kconfig
index 932e74c81b5..3b7a1cf8cc8 100644
--- a/arch/arm/src/stm32/Kconfig
+++ b/arch/arm/src/stm32/Kconfig
@@ -1206,7 +1206,6 @@ config STM32_CONNECTIVITYLINE
select STM32_HAVE_TIM5
select STM32_HAVE_TIM6
select STM32_HAVE_TIM7
- select STM32_HAVE_TIM8
select STM32_HAVE_ADC2
select STM32_HAVE_CAN1
select STM32_HAVE_CAN2
diff --git a/arch/arm/src/stm32/stm32_1wire.c b/arch/arm/src/stm32/stm32_1wire.c
index 4c0fa6c0f77..d0afa9d8bba 100644
--- a/arch/arm/src/stm32/stm32_1wire.c
+++ b/arch/arm/src/stm32/stm32_1wire.c
@@ -54,9 +54,9 @@
#include
#include
-#include
#include
#include
+#include
#include
diff --git a/arch/arm/src/stm32/stm32_can.c b/arch/arm/src/stm32/stm32_can.c
index 334c7337d62..ed973d57bd0 100644
--- a/arch/arm/src/stm32/stm32_can.c
+++ b/arch/arm/src/stm32/stm32_can.c
@@ -53,7 +53,7 @@
#include
#include
#include
-#include
+#include
#include "up_internal.h"
#include "up_arch.h"
diff --git a/arch/arm/src/stm32/stm32_can.h b/arch/arm/src/stm32/stm32_can.h
index e78b3af34f7..765dc95c0ca 100644
--- a/arch/arm/src/stm32/stm32_can.h
+++ b/arch/arm/src/stm32/stm32_can.h
@@ -45,7 +45,7 @@
#include "chip.h"
#include "chip/stm32_can.h"
-#include
+#include
/************************************************************************************
* Pre-processor Definitions
diff --git a/arch/arm/src/stm32/stm32_exti_alarm.c b/arch/arm/src/stm32/stm32_exti_alarm.c
index f38574f2523..2e6d582a4aa 100644
--- a/arch/arm/src/stm32/stm32_exti_alarm.c
+++ b/arch/arm/src/stm32/stm32_exti_alarm.c
@@ -53,10 +53,6 @@
#include "stm32_gpio.h"
#include "stm32_exti.h"
-/****************************************************************************
- * Pre-processor Definitions
- ****************************************************************************/
-
/****************************************************************************
* Private Data
****************************************************************************/
@@ -65,10 +61,6 @@
static xcpt_t stm32_exti_callback;
-/****************************************************************************
- * Public Data
- ****************************************************************************/
-
/****************************************************************************
* Private Functions
****************************************************************************/
diff --git a/arch/arm/src/stm32/stm32_freerun.c b/arch/arm/src/stm32/stm32_freerun.c
index 836df043ad7..38133c7c365 100644
--- a/arch/arm/src/stm32/stm32_freerun.c
+++ b/arch/arm/src/stm32/stm32_freerun.c
@@ -53,7 +53,7 @@
#ifdef CONFIG_STM32_FREERUN
/****************************************************************************
- * Private Functions
+ * Private Data
****************************************************************************/
static struct stm32_freerun_s *g_freerun;
@@ -80,6 +80,7 @@ static struct stm32_freerun_s *g_freerun;
*
****************************************************************************/
+#ifndef CONFIG_CLOCK_TIMEKEEPING
static int stm32_freerun_handler(int irq, void *context)
{
struct stm32_freerun_s *freerun = g_freerun;
@@ -90,6 +91,7 @@ static int stm32_freerun_handler(int irq, void *context)
STM32_TIM_ACKINT(freerun->tch, 0);
return OK;
}
+#endif /* CONFIG_CLOCK_TIMEKEEPING */
/****************************************************************************
* Public Functions
@@ -140,15 +142,21 @@ int stm32_freerun_initialize(struct stm32_freerun_s *freerun, int chan,
* success.
*/
- freerun->chan = chan;
- freerun->running = false;
- freerun->overflow = 0;
+ freerun->chan = chan;
+ freerun->running = false;
- g_freerun = freerun;
+#ifdef CONFIG_CLOCK_TIMEKEEPING
+ freerun->counter_mask = 0xffffffffull;
+#endif
+
+#ifndef CONFIG_CLOCK_TIMEKEEPING
+ freerun->overflow = 0;
+ g_freerun = freerun;
/* Set up to receive the callback when the counter overflow occurs */
STM32_TIM_SETISR(freerun->tch, stm32_freerun_handler, 0);
+#endif
/* Set timer period */
@@ -157,8 +165,11 @@ int stm32_freerun_initialize(struct stm32_freerun_s *freerun, int chan,
/* Start the counter */
STM32_TIM_SETMODE(freerun->tch, STM32_TIM_MODE_UP);
+
+#ifndef CONFIG_CLOCK_TIMEKEEPING
STM32_TIM_ACKINT(freerun->tch, 0);
STM32_TIM_ENABLEINT(freerun->tch, 0);
+#endif
return OK;
}
@@ -182,6 +193,8 @@ int stm32_freerun_initialize(struct stm32_freerun_s *freerun, int chan,
*
****************************************************************************/
+#ifndef CONFIG_CLOCK_TIMEKEEPING
+
int stm32_freerun_counter(struct stm32_freerun_s *freerun,
struct timespec *ts)
{
@@ -257,6 +270,16 @@ int stm32_freerun_counter(struct stm32_freerun_s *freerun,
return OK;
}
+#else /* CONFIG_CLOCK_TIMEKEEPING */
+
+int stm32_freerun_counter(struct stm32_freerun_s *freerun, uint64_t *counter)
+{
+ *counter = (uint64_t)STM32_TIM_GETCOUNTER(freerun->tch);
+ return OK;
+}
+
+#endif /* CONFIG_CLOCK_TIMEKEEPING */
+
/****************************************************************************
* Name: stm32_freerun_uninitialize
*
diff --git a/arch/arm/src/stm32/stm32_freerun.h b/arch/arm/src/stm32/stm32_freerun.h
index 08dd1786da7..bc7609666cf 100644
--- a/arch/arm/src/stm32/stm32_freerun.h
+++ b/arch/arm/src/stm32/stm32_freerun.h
@@ -64,9 +64,16 @@ struct stm32_freerun_s
{
uint8_t chan; /* The timer/counter in use */
bool running; /* True: the timer is running */
- uint32_t overflow; /* Timer counter overflow */
FAR struct stm32_tim_dev_s *tch; /* Handle returned by stm32_tim_init() */
uint32_t frequency;
+
+#ifndef CONFIG_CLOCK_TIMEKEEPING
+ uint32_t overflow; /* Timer counter overflow */
+#endif
+
+#ifdef CONFIG_CLOCK_TIMEKEEPING
+ uint64_t counter_mask;
+#endif
};
/****************************************************************************
@@ -127,9 +134,18 @@ int stm32_freerun_initialize(struct stm32_freerun_s *freerun, int chan,
*
****************************************************************************/
+#ifndef CONFIG_CLOCK_TIMEKEEPING
+
int stm32_freerun_counter(struct stm32_freerun_s *freerun,
struct timespec *ts);
+#else /* CONFIG_CLOCK_TIMEKEEPING */
+
+int stm32_freerun_counter(struct stm32_freerun_s *freerun,
+ uint64_t *counter);
+
+#endif /* CONFIG_CLOCK_TIMEKEEPING */
+
/****************************************************************************
* Name: stm32_freerun_uninitialize
*
diff --git a/arch/arm/src/stm32/stm32_irq.c b/arch/arm/src/stm32/stm32_irq.c
index ea7c4ddfcbe..ff40bf8d033 100644
--- a/arch/arm/src/stm32/stm32_irq.c
+++ b/arch/arm/src/stm32/stm32_irq.c
@@ -253,15 +253,9 @@ static int stm32_irqinfo(int irq, uintptr_t *regaddr, uint32_t *bit,
if (irq >= STM32_IRQ_FIRST)
{
- n = irq - STM32_IRQ_FIRST;
+ n = irq - STM32_IRQ_FIRST;
*regaddr = NVIC_IRQ_ENABLE(n) + offset;
-
- while (n >= 32)
- {
- n -= 32;
- }
-
- *bit = 1 << n;
+ *bit = (uint32_t)1 << (n & 0x1f);
}
/* Handle processor exceptions. Only a few can be disabled */
diff --git a/arch/arm/src/stm32/stm32_pwm.c b/arch/arm/src/stm32/stm32_pwm.c
index 7b8f4224e08..425f256ba05 100644
--- a/arch/arm/src/stm32/stm32_pwm.c
+++ b/arch/arm/src/stm32/stm32_pwm.c
@@ -48,7 +48,7 @@
#include
#include
-#include
+#include
#include
#include "up_internal.h"
diff --git a/arch/arm/src/stm32/stm32_pwm.h b/arch/arm/src/stm32/stm32_pwm.h
index e636ead3a37..1321389046e 100644
--- a/arch/arm/src/stm32/stm32_pwm.h
+++ b/arch/arm/src/stm32/stm32_pwm.h
@@ -41,7 +41,7 @@
/* The STM32 does not have dedicated PWM hardware. Rather, pulsed output control
* is a capabilitiy of the STM32 timers. The logic in this file implements the
* lower half of the standard, NuttX PWM interface using the STM32 timers. That
- * interface is described in include/nuttx/pwm.h.
+ * interface is described in include/nuttx/drivers/pwm.h.
*/
/************************************************************************************
diff --git a/arch/arm/src/stm32/stm32_rng.c b/arch/arm/src/stm32/stm32_rng.c
index fce55ebf0a3..8dde6a6c35c 100644
--- a/arch/arm/src/stm32/stm32_rng.c
+++ b/arch/arm/src/stm32/stm32_rng.c
@@ -46,16 +46,21 @@
#include
#include
+#include
+#include
#include "up_arch.h"
#include "chip/stm32_rng.h"
#include "up_internal.h"
+#if defined(CONFIG_STM32_RNG)
+#if defined(CONFIG_DEV_RANDOM) || defined(CONFIG_DEV_URANDOM_ARCH)
+
/****************************************************************************
* Private Function Prototypes
****************************************************************************/
-static int stm32_rnginitialize(void);
+static int stm32_rng_initialize(void);
static int stm32_interrupt(int irq, void *context);
static void stm32_enable(void);
static void stm32_disable(void);
@@ -98,7 +103,7 @@ static const struct file_operations g_rngops =
* Private functions
****************************************************************************/
-static int stm32_rnginitialize()
+static int stm32_rng_initialize()
{
uint32_t regval;
@@ -258,8 +263,52 @@ static ssize_t stm32_read(struct file *filep, char *buffer, size_t buflen)
* Public Functions
****************************************************************************/
-void up_rnginitialize()
+/****************************************************************************
+ * Name: devrandom_register
+ *
+ * Description:
+ * Initialize the RNG hardware and register the /dev/random driver.
+ * Must be called BEFORE devurandom_register.
+ *
+ * Input Parameters:
+ * None
+ *
+ * Returned Value:
+ * None
+ *
+ ****************************************************************************/
+
+#ifdef CONFIG_DEV_RANDOM
+void devrandom_register(void)
{
- stm32_rnginitialize();
- register_driver("/dev/random", &g_rngops, 0444, NULL);
+ stm32_rng_initialize();
+ (void)register_driver("/dev/random", &g_rngops, 0444, NULL);
}
+#endif
+
+/****************************************************************************
+ * Name: devurandom_register
+ *
+ * Description:
+ * Register /dev/urandom
+ *
+ * Input Parameters:
+ * None
+ *
+ * Returned Value:
+ * None
+ *
+ ****************************************************************************/
+
+#ifdef CONFIG_DEV_URANDOM_ARCH
+void devurandom_register(void)
+{
+#ifndef CONFIG_DEV_RANDOM
+ stm32_rng_initialize();
+#endif
+ (void)register_driver("/dev/urandom", &g_rngops, 0444, NULL);
+}
+#endif
+
+#endif /* CONFIG_DEV_RANDOM || CONFIG_DEV_URANDOM_ARCH */
+#endif /* CONFIG_STM32_RNG */
diff --git a/arch/arm/src/stm32/stm32_tickless.c b/arch/arm/src/stm32/stm32_tickless.c
index eadef5ce90d..82d7a593d25 100644
--- a/arch/arm/src/stm32/stm32_tickless.c
+++ b/arch/arm/src/stm32/stm32_tickless.c
@@ -272,11 +272,44 @@ void up_timer_initialize(void)
*
****************************************************************************/
+#ifndef CONFIG_CLOCK_TIMEKEEPING
+
int up_timer_gettime(FAR struct timespec *ts)
{
return stm32_freerun_counter(&g_tickless.freerun, ts);
}
+#else
+
+int up_timer_getcounter(FAR uint64_t *cycles)
+{
+ return stm32_freerun_counter(&g_tickless.freerun, cycles);
+}
+
+#endif /* CONFIG_CLOCK_TIMEKEEPING */
+
+/****************************************************************************
+ * Name: up_timer_getmask
+ *
+ * Description:
+ * To be provided
+ *
+ * Input Parameters:
+ * mask - Location to return the 64-bit mask
+ *
+ * Returned Value:
+ * None
+ *
+ ****************************************************************************/
+
+#ifdef CONFIG_CLOCK_TIMEKEEPING
+void up_timer_getmask(FAR uint64_t *mask)
+{
+ DEBUGASSERT(mask != NULL);
+ *mask = g_tickless.freerun.counter_mask;
+}
+#endif /* CONFIG_CLOCK_TIMEKEEPING */
+
/****************************************************************************
* Name: up_timer_cancel
*
diff --git a/arch/arm/src/stm32/stm32f40xxx_rtcc.c b/arch/arm/src/stm32/stm32f40xxx_rtcc.c
index c20024d8b1a..7145243b894 100644
--- a/arch/arm/src/stm32/stm32f40xxx_rtcc.c
+++ b/arch/arm/src/stm32/stm32f40xxx_rtcc.c
@@ -136,6 +136,7 @@ struct alm_cbinfo_s
/* Callback to use when an EXTI is activated */
static struct alm_cbinfo_s g_alarmcb[RTC_ALARM_LAST];
+static bool g_alarm_enabled; /* True: Alarm interrupts are enabled */
#endif
/****************************************************************************
@@ -157,6 +158,7 @@ static int rtchw_set_alrmar(rtc_alarmreg_t alarmreg);
static int rtchw_check_alrbwf(void);
static int rtchw_set_alrmbr(rtc_alarmreg_t alarmreg);
#endif
+static inline void rtc_enable_alarm(void);
#endif
/****************************************************************************
@@ -811,6 +813,46 @@ rtchw_set_alrmbr_exit:
}
#endif
+/****************************************************************************
+ * Name: rtc_enable_alarm
+ *
+ * Description:
+ * Enable ALARM interrupts
+ *
+ * Input Parameters:
+ * None
+ *
+ * Returned Value:
+ * None
+ *
+ ****************************************************************************/
+
+#ifdef CONFIG_RTC_ALARM
+static inline void rtc_enable_alarm(void)
+{
+ /* Is the alarm already enabled? */
+
+ if (!g_alarm_enabled)
+ {
+ /* Configure RTC interrupt to catch alarm interrupts. All RTC
+ * interrupts are connected to the EXTI controller. To enable the
+ * RTC Alarm interrupt, the following sequence is required:
+ *
+ * 1. Configure and enable the EXTI Line 17 RTC ALARM in interrupt
+ * mode and select the rising edge sensitivity.
+ * For STM32F4xx
+ * EXTI line 21 RTC Tamper & Timestamp
+ * EXTI line 22 RTC Wakeup
+ * 2. Configure and enable the RTC_Alarm IRQ channel in the NVIC.
+ * 3. Configure the RTC to generate RTC alarms (Alarm A or Alarm B).
+ */
+
+ stm32_exti_alarm(true, false, true, stm32_rtc_alarm_handler);
+ g_alarm_enabled = true;
+ }
+}
+#endif
+
/****************************************************************************
* Public Functions
****************************************************************************/
@@ -1010,25 +1052,7 @@ int up_rtc_initialize(void)
return -ETIMEDOUT;
}
-#ifdef CONFIG_RTC_ALARM
- /* Configure RTC interrupt to catch alarm interrupts. All RTC interrupts
- * are connected to the EXTI controller. To enable the RTC Alarm
- * interrupt, the following sequence is required:
- *
- * 1. Configure and enable the EXTI Line 17 RTC ALARM in interrupt mode
- * and select the rising edge sensitivity.
- * For STM32F4xx
- * EXTI line 21 RTC Tamper & Timestamp
- * EXTI line 22 RTC Wakeup
- * 2. Configure and enable the RTC_Alarm IRQ channel in the NVIC.
- * 3. Configure the RTC to generate RTC alarms (Alarm A or Alarm B).
- */
-
- stm32_exti_alarm(true, false, true, stm32_rtc_alarm_handler);
- rtc_dumpregs("After InitExtiAlarm");
-#else
rtc_dumpregs("After Initialization");
-#endif
g_rtc_enabled = true;
return OK;
@@ -1321,6 +1345,10 @@ int stm32_rtc_setalarm(FAR struct alm_setalarm_s *alminfo)
ASSERT(alminfo != NULL);
DEBUGASSERT(RTC_ALARM_LAST > alminfo->as_id);
+ /* Make sure the the alarm interrupt is enabled at the NVIC */
+
+ rtc_enable_alarm();
+
/* REVISIT: Should test that the time is in the future */
rtc_dumptime(&alminfo->as_time, "New alarm time");
@@ -1335,7 +1363,7 @@ int stm32_rtc_setalarm(FAR struct alm_setalarm_s *alminfo)
(rtc_bin2bcd(alminfo->as_time.tm_hour) << RTC_ALRMR_HU_SHIFT) |
(rtc_bin2bcd(alminfo->as_time.tm_mday) << RTC_ALRMR_DU_SHIFT);
- /* Set the alarm in hardware and enable interrupts */
+ /* Set the alarm in hardware and enable interrupts from the RTC */
switch (alminfo->as_id)
{
diff --git a/arch/arm/src/stm32l4/stm32l4_can.c b/arch/arm/src/stm32l4/stm32l4_can.c
index 7891319e8f1..18b49a86e74 100644
--- a/arch/arm/src/stm32l4/stm32l4_can.c
+++ b/arch/arm/src/stm32l4/stm32l4_can.c
@@ -57,7 +57,7 @@
#include
#include
#include
-#include
+#include
#include "up_internal.h"
#include "up_arch.h"
diff --git a/arch/arm/src/stm32l4/stm32l4_can.h b/arch/arm/src/stm32l4/stm32l4_can.h
index 453b031bda2..86eb26fb659 100644
--- a/arch/arm/src/stm32l4/stm32l4_can.h
+++ b/arch/arm/src/stm32l4/stm32l4_can.h
@@ -49,7 +49,7 @@
#include "chip.h"
#include "chip/stm32l4_can.h"
-#include
+#include
/************************************************************************************
* Pre-processor Definitions
diff --git a/arch/arm/src/stm32l4/stm32l4_irq.c b/arch/arm/src/stm32l4/stm32l4_irq.c
index 8e90bf0fa8a..720c05ecc69 100644
--- a/arch/arm/src/stm32l4/stm32l4_irq.c
+++ b/arch/arm/src/stm32l4/stm32l4_irq.c
@@ -1,8 +1,7 @@
/****************************************************************************
* arch/arm/src/stm32l4/stm32l4_irq.c
- * arch/arm/src/chip/stm32l4_irq.c
*
- * Copyright (C) 2009-2015 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2009-2016 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt
*
* Redistribution and use in source and binary forms, with or without
@@ -90,10 +89,6 @@ volatile uint32_t *g_current_regs[1];
extern uint32_t _vectors[];
-/****************************************************************************
- * Private Data
- ****************************************************************************/
-
/****************************************************************************
* Private Functions
****************************************************************************/
@@ -252,15 +247,9 @@ static int stm32l4_irqinfo(int irq, uintptr_t *regaddr, uint32_t *bit,
if (irq >= STM32L4_IRQ_FIRST)
{
- n = irq - STM32L4_IRQ_FIRST;
+ n = irq - STM32L4_IRQ_FIRST;
*regaddr = NVIC_IRQ_ENABLE(n) + offset;
-
- while (n >= 32)
- {
- n -= 32;
- }
-
- *bit = 1 << n;
+ *bit = (uint32_t)1 << (n & 0x1f);
}
/* Handle processor exceptions. Only a few can be disabled */
diff --git a/arch/arm/src/stm32l4/stm32l4_pwm.c b/arch/arm/src/stm32l4/stm32l4_pwm.c
index b5cd35fb29d..d3478ea0df2 100644
--- a/arch/arm/src/stm32l4/stm32l4_pwm.c
+++ b/arch/arm/src/stm32l4/stm32l4_pwm.c
@@ -48,7 +48,7 @@
#include
#include
-#include
+#include
#include
#include "up_internal.h"
diff --git a/arch/arm/src/stm32l4/stm32l4_pwm.h b/arch/arm/src/stm32l4/stm32l4_pwm.h
index fff04e9e476..942aef0cfa5 100644
--- a/arch/arm/src/stm32l4/stm32l4_pwm.h
+++ b/arch/arm/src/stm32l4/stm32l4_pwm.h
@@ -41,7 +41,7 @@
/* The STM32L4 does not have dedicated PWM hardware. Rather, pulsed output control
* is a capability of the STM32L4 timers. The logic in this file implements the
* lower half of the standard, NuttX PWM interface using the STM32L4 timers. That
- * interface is described in include/nuttx/pwm.h.
+ * interface is described in include/nuttx/drivers/pwm.h.
*/
/************************************************************************************
diff --git a/arch/arm/src/stm32l4/stm32l4_rng.c b/arch/arm/src/stm32l4/stm32l4_rng.c
index f9324fb6f1e..a544847061b 100644
--- a/arch/arm/src/stm32l4/stm32l4_rng.c
+++ b/arch/arm/src/stm32l4/stm32l4_rng.c
@@ -47,18 +47,21 @@
#include
#include
+#include
+#include
#include "up_arch.h"
#include "chip/stm32l4_rng.h"
#include "up_internal.h"
-#ifdef CONFIG_STM32L4_RNG
+#if defined(CONFIG_STM32L4_RNG)
+#if defined(CONFIG_DEV_RANDOM) || defined(CONFIG_DEV_URANDOM_ARCH)
/****************************************************************************
* Private Function Prototypes
****************************************************************************/
-static int stm32l4_rnginitialize(void);
+static int stm32l4_rng_initialize(void);
static int stm32l4_rnginterrupt(int irq, void *context);
static void stm32l4_rngenable(void);
static void stm32l4_rngdisable(void);
@@ -105,7 +108,7 @@ static const struct file_operations g_rngops =
* Private functions
****************************************************************************/
-static int stm32l4_rnginitialize(void)
+static int stm32l4_rng_initialize(void)
{
_info("Initializing RNG\n");
@@ -289,10 +292,52 @@ static ssize_t stm32l4_rngread(struct file *filep, char *buffer, size_t buflen)
* Public Functions
****************************************************************************/
-void up_rnginitialize(void)
-{
- stm32l4_rnginitialize();
- register_driver("/dev/random", &g_rngops, 0444, NULL);
-}
+/****************************************************************************
+ * Name: devrandom_register
+ *
+ * Description:
+ * Initialize the RNG hardware and register the /dev/random driver.
+ * Must be called BEFORE devurandom_register.
+ *
+ * Input Parameters:
+ * None
+ *
+ * Returned Value:
+ * None
+ *
+ ****************************************************************************/
+#ifdef CONFIG_DEV_RANDOM
+void devrandom_register(void)
+{
+ stm32l4_rng_initialize();
+ (void)register_driver("/dev/random", &g_rngops, 0444, NULL);
+}
+#endif
+
+/****************************************************************************
+ * Name: devurandom_register
+ *
+ * Description:
+ * Register /dev/urandom
+ *
+ * Input Parameters:
+ * None
+ *
+ * Returned Value:
+ * None
+ *
+ ****************************************************************************/
+
+#ifdef CONFIG_DEV_URANDOM_ARCH
+void devurandom_register(void)
+{
+#ifndef CONFIG_DEV_RANDOM
+ stm32l4_rng_initialize();
+#endif
+ (void)register_driver("/dev/urandom", &g_rngops, 0444, NULL);
+}
+#endif
+
+#endif /* CONFIG_DEV_RANDOM || CONFIG_DEV_URANDOM_ARCH */
#endif /* CONFIG_STM32L4_RNG */
diff --git a/arch/arm/src/stm32l4/stm32l4_rtcc.c b/arch/arm/src/stm32l4/stm32l4_rtcc.c
index 338d9a54076..1ee4306080f 100644
--- a/arch/arm/src/stm32l4/stm32l4_rtcc.c
+++ b/arch/arm/src/stm32l4/stm32l4_rtcc.c
@@ -1,7 +1,7 @@
/************************************************************************************
* arch/arm/src/stm32l4/stm32l4_rtcc.c
*
- * Copyright (C) 2012-2015 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2012-2016 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt
* dev@ziggurat29.com (adaptations to stm32l4)
*
@@ -134,6 +134,7 @@ struct alm_cbinfo_s
/* Callback to use when an EXTI is activated */
static struct alm_cbinfo_s g_alarmcb[RTC_ALARM_LAST];
+static bool g_alarm_enabled; /* True: Alarm interrupts are enabled */
#endif
/************************************************************************************
@@ -153,6 +154,7 @@ static int rtchw_check_alrawf(void);
static int rtchw_check_alrbwf(void);
static int rtchw_set_alrmar(rtc_alarmreg_t alarmreg);
static int rtchw_set_alrmbr(rtc_alarmreg_t alarmreg);
+static inline void rtc_enable_alarm(void);
#endif
/************************************************************************************
@@ -234,31 +236,6 @@ static void rtc_dumptime(FAR const struct tm *tp, FAR const char *msg)
# define rtc_dumptime(tp, msg)
#endif
-/************************************************************************************
- * Name: rtc_is_inits
- *
- * Description:
- * Returns 'true' if the RTC has been initialized (according to the RTC itself).
- * It will be 'false' if the RTC has never been initialized since first time power
- * up, and the counters are stopped until it is first initialized.
- *
- * Input Parameters:
- * None
- *
- * Returned Value:
- * bool -- true if the INITS flag is set in the ISR.
- *
- ************************************************************************************/
-
-bool rtc_is_inits(void)
-{
- uint32_t regval;
-
- regval = getreg32(STM32L4_RTC_ISR);
-
- return (regval & RTC_ISR_INITS) ? true : false;
-}
-
/************************************************************************************
* Name: rtc_wprunlock
*
@@ -791,10 +768,74 @@ rtchw_set_alrmbr_exit:
}
#endif
+/****************************************************************************
+ * Name: rtc_enable_alarm
+ *
+ * Description:
+ * Enable ALARM interrupts
+ *
+ * Input Parameters:
+ * None
+ *
+ * Returned Value:
+ * None
+ *
+ ****************************************************************************/
+
+#ifdef CONFIG_RTC_ALARM
+static inline void rtc_enable_alarm(void)
+{
+ /* Is the alarm already enabled? */
+
+ if (!g_alarm_enabled)
+ {
+ /* Configure RTC interrupt to catch alarm interrupts. All RTC
+ * interrupts are connected to the EXTI controller. To enable the
+ * RTC Alarm interrupt, the following sequence is required:
+ *
+ * 1. Configure and enable the EXTI Line 18 in interrupt mode and
+ * select the rising edge sensitivity.
+ * EXTI line 19 RTC Tamper or Timestamp or CSS_LSE
+ * EXTI line 20 RTC Wakeup
+ * 2. Configure and enable the RTC_Alarm IRQ channel in the NVIC.
+ * 3. Configure the RTC to generate RTC alarms (Alarm A or Alarm B).
+ */
+
+ stm32l4_exti_alarm(true, false, true, stm32l4_rtc_alarm_handler);
+ g_alarm_enabled = true;
+ }
+}
+#endif
+
/************************************************************************************
* Public Functions
************************************************************************************/
+/************************************************************************************
+ * Name: rtc_is_inits
+ *
+ * Description:
+ * Returns 'true' if the RTC has been initialized (according to the RTC itself).
+ * It will be 'false' if the RTC has never been initialized since first time power
+ * up, and the counters are stopped until it is first initialized.
+ *
+ * Input Parameters:
+ * None
+ *
+ * Returned Value:
+ * bool -- true if the INITS flag is set in the ISR.
+ *
+ ************************************************************************************/
+
+bool rtc_is_inits(void)
+{
+ uint32_t regval;
+
+ regval = getreg32(STM32L4_RTC_ISR);
+
+ return (regval & RTC_ISR_INITS) ? true : false;
+}
+
/************************************************************************************
* Name: up_rtc_initialize
*
@@ -949,22 +990,6 @@ int up_rtc_initialize(void)
(void)stm32l4_pwr_enablebkp(false);
}
-#ifdef CONFIG_RTC_ALARM
- /* Configure RTC interrupt to catch alarm interrupts. All RTC interrupts are
- * connected to the EXTI controller. To enable the RTC Alarm interrupt, the
- * following sequence is required:
- *
- * 1. Configure and enable the EXTI Line 18 in interrupt mode and select the
- * rising edge sensitivity.
- * EXTI line 19 RTC Tamper or Timestamp or CSS_LSE
- * EXTI line 20 RTC Wakeup
- * 2. Configure and enable the RTC_Alarm IRQ channel in the NVIC.
- * 3. Configure the RTC to generate RTC alarms (Alarm A or Alarm B).
- */
-
- stm32l4_exti_alarm(true, false, true, stm32l4_rtc_alarm_handler);
-#endif
-
g_rtc_enabled = true;
rtc_dumpregs("After Initialization");
@@ -1241,6 +1266,10 @@ int stm32l4_rtc_setalarm(FAR struct alm_setalarm_s *alminfo)
ASSERT(alminfo != NULL);
DEBUGASSERT(RTC_ALARM_LAST > alminfo->as_id);
+ /* Make sure the the alarm interrupt is enabled at the NVIC */
+
+ rtc_enable_alarm();
+
/* REVISIT: Should test that the time is in the future */
rtc_dumptime(&alminfo->as_time, "New alarm time");
@@ -1249,7 +1278,7 @@ int stm32l4_rtc_setalarm(FAR struct alm_setalarm_s *alminfo)
alarmreg = rtc_reg_alrmr_bin2bcd(&alminfo->as_time);
- /* Set the alarm in hardware and enable interrupts */
+ /* Set the alarm in hardware and enable interrupts from the RTC */
switch (alminfo->as_id)
{
diff --git a/arch/avr/src/common/up_initialize.c b/arch/avr/src/common/up_initialize.c
index 669821631c0..55a9b167530 100644
--- a/arch/avr/src/common/up_initialize.c
+++ b/arch/avr/src/common/up_initialize.c
@@ -43,13 +43,16 @@
#include
#include
-#include
+#include
#include
#include
#include
#include
#include
#include
+#include
+#include
+#include
#include
@@ -199,11 +202,21 @@ void up_initialize(void)
up_irqinitialize();
- /* Initialize the DMA subsystem if the weak function stm32_dmainitialize has been
+#ifdef CONFIG_PM
+ /* Initialize the power management subsystem. This MCU-specific function
+ * must be called *very* early in the initialization sequence *before* any
+ * other device drivers are initialized (since they may attempt to register
+ * with the power management subsystem).
+ */
+
+ up_pminitialize();
+#endif
+
+#ifdef CONFIG_ARCH_DMA
+ /* Initialize the DMA subsystem if the weak function up_dmainitialize has been
* brought into the build
*/
-#ifdef CONFIG_ARCH_DMA
#ifdef CONFIG_HAVE_WEAKFUNCTIONS
if (up_dmainitialize)
#endif
@@ -226,6 +239,14 @@ void up_initialize(void)
devnull_register(); /* Standard /dev/null */
#endif
+#if defined(CONFIG_DEV_RANDOM)
+ devrandom_register(); /* Standard /dev/random */
+#endif
+
+#if defined(CONFIG_DEV_URANDOM)
+ devurandom_register(); /* Standard /dev/urandom */
+#endif
+
#if defined(CONFIG_DEV_ZERO)
devzero_register(); /* Standard /dev/zero */
#endif
@@ -258,6 +279,12 @@ void up_initialize(void)
ramlog_consoleinit();
#endif
+#if CONFIG_NFILE_DESCRIPTORS > 0 && defined(CONFIG_PSEUDOTERM_SUSV1)
+ /* Register the master pseudo-terminal multiplexor device */
+
+ (void)ptmx_register();
+#endif
+
/* Early initialization of the system logging device. Some SYSLOG channel
* can be initialized early in the initialization sequence because they
* depend on only minimal OS initialization.
@@ -265,6 +292,16 @@ void up_initialize(void)
syslog_initialize(SYSLOG_INIT_EARLY);
+#if defined(CONFIG_CRYPTO)
+ /* Initialize the HW crypto and /dev/crypto */
+
+ up_cryptoinitialize();
+#endif
+
+#if CONFIG_NFILE_DESCRIPTORS > 0 && defined(CONFIG_CRYPTO_CRYPTODEV)
+ devcrypto_register();
+#endif
+
#ifndef CONFIG_NETDEV_LATEINIT
/* Initialize the network */
diff --git a/arch/hc/include/m9s12/irq.h b/arch/hc/include/m9s12/irq.h
index 63ab556b8e4..d70e40de349 100644
--- a/arch/hc/include/m9s12/irq.h
+++ b/arch/hc/include/m9s12/irq.h
@@ -108,7 +108,7 @@
* Port J: Pins 0-3 and 6-7
*/
-#ifdef CONFIG_GPIO_IRQ
+#ifdef CONFIG_HCS12_GPIOIRQ
/* To conserve space, interrupts must also be configured, port by port */
@@ -156,7 +156,7 @@
# endif
#else
# define HCS12_IRQ_NIRQS HCS12_IRQ_NVECTORS
-#endif /* CONFIG_GPIO_IRQ */
+#endif /* CONFIG_HCS12_GPIOIRQ */
#define HCS12_IRQ_VILLEGAL HCS12_IRQ_NIRQS /* Any reserved vector */
#define NR_IRQS (HCS12_IRQ_NIRQS+1)
diff --git a/arch/hc/src/common/up_initialize.c b/arch/hc/src/common/up_initialize.c
index c5b1149d04a..1d75e24baf9 100644
--- a/arch/hc/src/common/up_initialize.c
+++ b/arch/hc/src/common/up_initialize.c
@@ -44,13 +44,16 @@
#include
#include
#include
-#include
+#include
#include
#include
#include
#include
#include
#include
+#include
+#include
+#include
#include "up_arch.h"
#include "up_internal.h"
@@ -125,11 +128,21 @@ void up_initialize(void)
up_irqinitialize();
- /* Initialize the DMA subsystem if the weak function stm32_dmainitialize has been
+#ifdef CONFIG_PM
+ /* Initialize the power management subsystem. This MCU-specific function
+ * must be called *very* early in the initialization sequence *before* any
+ * other device drivers are initialized (since they may attempt to register
+ * with the power management subsystem).
+ */
+
+ up_pminitialize();
+#endif
+
+#ifdef CONFIG_ARCH_DMA
+ /* Initialize the DMA subsystem if the weak function up_dmainitialize has been
* brought into the build
*/
-#ifdef CONFIG_ARCH_DMA
#ifdef CONFIG_HAVE_WEAKFUNCTIONS
if (up_dmainitialize)
#endif
@@ -152,6 +165,14 @@ void up_initialize(void)
devnull_register(); /* Standard /dev/null */
#endif
+#if defined(CONFIG_DEV_RANDOM)
+ devrandom_register(); /* Standard /dev/random */
+#endif
+
+#if defined(CONFIG_DEV_URANDOM)
+ devurandom_register(); /* Standard /dev/urandom */
+#endif
+
#if defined(CONFIG_DEV_ZERO)
devzero_register(); /* Standard /dev/zero */
#endif
@@ -184,6 +205,12 @@ void up_initialize(void)
ramlog_consoleinit();
#endif
+#if CONFIG_NFILE_DESCRIPTORS > 0 && defined(CONFIG_PSEUDOTERM_SUSV1)
+ /* Register the master pseudo-terminal multiplexor device */
+
+ (void)ptmx_register();
+#endif
+
/* Early initialization of the system logging device. Some SYSLOG channel
* can be initialized early in the initialization sequence because they
* depend on only minimal OS initialization.
@@ -191,6 +218,16 @@ void up_initialize(void)
syslog_initialize(SYSLOG_INIT_EARLY);
+#if defined(CONFIG_CRYPTO)
+ /* Initialize the HW crypto and /dev/crypto */
+
+ up_cryptoinitialize();
+#endif
+
+#if CONFIG_NFILE_DESCRIPTORS > 0 && defined(CONFIG_CRYPTO_CRYPTODEV)
+ devcrypto_register();
+#endif
+
#ifndef CONFIG_NETDEV_LATEINIT
/* Initialize the network */
diff --git a/arch/hc/src/m9s12/Kconfig b/arch/hc/src/m9s12/Kconfig
index 9e05745e49c..37c357c79d7 100644
--- a/arch/hc/src/m9s12/Kconfig
+++ b/arch/hc/src/m9s12/Kconfig
@@ -40,4 +40,12 @@ config HCS12_NONBANKED
in memory.
endmenu # HSC12 Build Options
+
+config HCS12_GPIOIRQ
+ bool "GPIO interrupt support"
+ default n
+ depends on EXPERIMENTAL
+ ---help---
+ Enable support for GPIO interrupts (not implemented)
+
endif # ARCH_HSC12
diff --git a/arch/hc/src/m9s12/m9s12.h b/arch/hc/src/m9s12/m9s12.h
index 9a1c9711599..50e3a14abe7 100644
--- a/arch/hc/src/m9s12/m9s12.h
+++ b/arch/hc/src/m9s12/m9s12.h
@@ -266,7 +266,7 @@ bool hcs12_gpioread(uint16_t pinset);
*
************************************************************************************/
-#ifdef CONFIG_GPIO_IRQ
+#ifdef CONFIG_HCS12_GPIOIRQ
void hcs12_gpioirqenable(int irq);
#else
# define hcs12_gpioirqenable(irq)
@@ -280,7 +280,7 @@ void hcs12_gpioirqenable(int irq);
*
************************************************************************************/
-#ifdef CONFIG_GPIO_IRQ
+#ifdef CONFIG_HCS12_GPIOIRQ
void hcs12_gpioirqdisable(int irq);
#else
# define hcs12_gpioirqdisable(irq)
diff --git a/arch/hc/src/m9s12/m9s12_gpioirq.c b/arch/hc/src/m9s12/m9s12_gpioirq.c
index 4dae0551244..d16c208f4cb 100644
--- a/arch/hc/src/m9s12/m9s12_gpioirq.c
+++ b/arch/hc/src/m9s12/m9s12_gpioirq.c
@@ -75,7 +75,7 @@
*
****************************************************************************/
-#ifdef CONFIG_GPIO_IRQ
+#ifdef CONFIG_HCS12_GPIOIRQ
static int hcs12_mapirq(int irq, uint16_t *regaddr, uint8_t *pin)
{
if (irq >= HCC12_IRQ_PGFIRST)
@@ -121,7 +121,7 @@ static int hcs12_mapirq(int irq, uint16_t *regaddr, uint8_t *pin)
}
return -EINVAL;
}
-#endif /* CONFIG_GPIO_IRQ */
+#endif /* CONFIG_HCS12_GPIOIRQ */
/****************************************************************************
* Name: up_gpioa/b/cinterrupt
@@ -131,7 +131,7 @@ static int hcs12_mapirq(int irq, uint16_t *regaddr, uint8_t *pin)
*
****************************************************************************/
-#ifdef CONFIG_GPIO_IRQ
+#ifdef CONFIG_HCS12_GPIOIRQ
static int hcs12_interrupt(uint16_t base, int irq0, uint8_t valid, void *context)
{
uint8_t pending;
@@ -204,7 +204,7 @@ static int hcs12_pjinterrupt(int irq, void *context)
HCS12_IRQ_PJSET, context);
}
#endif
-#endif /* CONFIG_GPIO_IRQ */
+#endif /* CONFIG_HCS12_GPIOIRQ */
/****************************************************************************
* Public Functions
@@ -229,7 +229,7 @@ void hcs12_gpioirqinitialize(void)
/* Attach GPIO IRQ interrupt handlers */
-#ifdef CONFIG_GPIO_IRQ
+#ifdef CONFIG_HCS12_GPIOIRQ
# ifdef CONFIG_HCS12_PORTG_INTS
irq_attach(HCS12_IRQ_VPORTG, hcs12_pginterrupt);
# endif
@@ -239,7 +239,7 @@ void hcs12_gpioirqinitialize(void)
# ifdef CONFIG_HCS12_PORTJ_INTS
irq_attach(HCS12_IRQ_VPORTJ, hcs12_pjinterrupt);
# endif
-#endif /* CONFIG_GPIO_IRQ */
+#endif /* CONFIG_HCS12_GPIOIRQ */
}
/****************************************************************************
@@ -250,7 +250,7 @@ void hcs12_gpioirqinitialize(void)
*
****************************************************************************/
-#ifdef CONFIG_GPIO_IRQ
+#ifdef CONFIG_HCS12_GPIOIRQ
void hcs12_gpioirqenable(int irq)
{
uint16_t regaddr;
@@ -265,7 +265,7 @@ void hcs12_gpioirqenable(int irq)
leave_critical_section(flags);
}
}
-#endif /* CONFIG_GPIO_IRQ */
+#endif /* CONFIG_HCS12_GPIOIRQ */
/****************************************************************************
* Name: hcs12_gpioirqdisable
@@ -275,7 +275,7 @@ void hcs12_gpioirqenable(int irq)
*
****************************************************************************/
-#ifdef CONFIG_GPIO_IRQ
+#ifdef CONFIG_HCS12_GPIOIRQ
void hcs12_gpioirqdisable(int irq)
{
uint16_t regaddr;
@@ -290,5 +290,5 @@ void hcs12_gpioirqdisable(int irq)
leave_critical_section(flags);
}
}
-#endif /* CONFIG_GPIO_IRQ */
+#endif /* CONFIG_HCS12_GPIOIRQ */
diff --git a/arch/hc/src/m9s12/m9s12_irq.c b/arch/hc/src/m9s12/m9s12_irq.c
index a91c270f099..4ce19d70e90 100644
--- a/arch/hc/src/m9s12/m9s12_irq.c
+++ b/arch/hc/src/m9s12/m9s12_irq.c
@@ -75,7 +75,7 @@ void up_irqinitialize(void)
* GPIO pins.
*/
-#ifdef CONFIG_GPIO_IRQ
+#ifdef CONFIG_HCS12_GPIOIRQ
hcs12_gpioirqinitialize();
#endif
diff --git a/arch/mips/src/common/up_initialize.c b/arch/mips/src/common/up_initialize.c
index d6d634c9bc7..609ce62f826 100644
--- a/arch/mips/src/common/up_initialize.c
+++ b/arch/mips/src/common/up_initialize.c
@@ -44,13 +44,16 @@
#include
#include
#include
-#include
+#include
#include
#include
#include
#include
#include
#include
+#include
+#include
+#include
#include
@@ -127,11 +130,21 @@ void up_initialize(void)
up_irqinitialize();
- /* Initialize the DMA subsystem if the weak function stm32_dmainitialize has been
+#ifdef CONFIG_PM
+ /* Initialize the power management subsystem. This MCU-specific function
+ * must be called *very* early in the initialization sequence *before* any
+ * other device drivers are initialized (since they may attempt to register
+ * with the power management subsystem).
+ */
+
+ up_pminitialize();
+#endif
+
+#ifdef CONFIG_ARCH_DMA
+ /* Initialize the DMA subsystem if the weak function up_dmainitialize has been
* brought into the build
*/
-#ifdef CONFIG_ARCH_DMA
#ifdef CONFIG_HAVE_WEAKFUNCTIONS
if (up_dmainitialize)
#endif
@@ -154,6 +167,14 @@ void up_initialize(void)
devnull_register(); /* Standard /dev/null */
#endif
+#if defined(CONFIG_DEV_RANDOM)
+ devrandom_register(); /* Standard /dev/random */
+#endif
+
+#if defined(CONFIG_DEV_URANDOM)
+ devurandom_register(); /* Standard /dev/urandom */
+#endif
+
#if defined(CONFIG_DEV_ZERO)
devzero_register(); /* Standard /dev/zero */
#endif
@@ -186,6 +207,12 @@ void up_initialize(void)
ramlog_consoleinit();
#endif
+#if CONFIG_NFILE_DESCRIPTORS > 0 && defined(CONFIG_PSEUDOTERM_SUSV1)
+ /* Register the master pseudo-terminal multiplexor device */
+
+ (void)ptmx_register();
+#endif
+
/* Early initialization of the system logging device. Some SYSLOG channel
* can be initialized early in the initialization sequence because they
* depend on only minimal OS initialization.
@@ -193,6 +220,16 @@ void up_initialize(void)
syslog_initialize(SYSLOG_INIT_EARLY);
+#if defined(CONFIG_CRYPTO)
+ /* Initialize the HW crypto and /dev/crypto */
+
+ up_cryptoinitialize();
+#endif
+
+#if CONFIG_NFILE_DESCRIPTORS > 0 && defined(CONFIG_CRYPTO_CRYPTODEV)
+ devcrypto_register();
+#endif
+
#ifndef CONFIG_NETDEV_LATEINIT
/* Initialize the network */
diff --git a/arch/rgmp/src/nuttx.c b/arch/rgmp/src/nuttx.c
index 4a274264d7f..07faf590fd7 100644
--- a/arch/rgmp/src/nuttx.c
+++ b/arch/rgmp/src/nuttx.c
@@ -45,14 +45,21 @@
#include
#include
-#include
-#include
-#include
#include
#include
#include
#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
#include "task/task.h"
#include "sched/sched.h"
#include "group/group.h"
@@ -85,23 +92,90 @@ static inline void up_switchcontext(struct tcb_s *ctcb, struct tcb_s *ntcb)
void up_initialize(void)
{
- extern pidhash_t g_pidhash[];
- extern void vdev_init(void);
- extern void nuttx_arch_init(void);
+ extern pidhash_t g_pidhash[];
+ extern void vdev_init(void);
+ extern void nuttx_arch_init(void);
- // initialize the current_task to g_idletcb
- current_task = g_pidhash[PIDHASH(0)].tcb;
+ /* Initialize the current_task to g_idletcb */
- // OS memory alloc system is ready
- use_os_kmalloc = 1;
+ current_task = g_pidhash[PIDHASH(0)].tcb;
- // rgmp vdev init
- vdev_init();
+ /* OS memory alloc system is ready */
- nuttx_arch_init();
+ use_os_kmalloc = 1;
- // enable interrupt
- local_irq_enable();
+ /* rgmp vdev init */
+
+ vdev_init();
+
+ nuttx_arch_init();
+
+#ifdef CONFIG_PM
+ /* Initialize the power management subsystem. This MCU-specific function
+ * must be called *very* early in the initialization sequence *before* any
+ * other device drivers are initialized (since they may attempt to register
+ * with the power management subsystem).
+ */
+
+ up_pminitialize();
+#endif
+
+#if CONFIG_NFILE_DESCRIPTORS > 0 && defined(CONFIG_PSEUDOTERM_SUSV1)
+ /* Register the master pseudo-terminal multiplexor device */
+
+ (void)ptmx_register();
+#endif
+
+ /* Early initialization of the system logging device. Some SYSLOG channel
+ * can be initialized early in the initialization sequence because they
+ * depend on only minimal OS initialization.
+ */
+
+ syslog_initialize(SYSLOG_INIT_EARLY);
+
+ /* Register devices */
+
+#if CONFIG_NFILE_DESCRIPTORS > 0
+
+#if defined(CONFIG_DEV_NULL)
+ devnull_register(); /* Standard /dev/null */
+#endif
+
+#if defined(CONFIG_DEV_RANDOM)
+ devrandom_register(); /* Standard /dev/random */
+#endif
+
+#if defined(CONFIG_DEV_URANDOM)
+ devurandom_register(); /* Standard /dev/urandom */
+#endif
+
+#if defined(CONFIG_DEV_ZERO)
+ devzero_register(); /* Standard /dev/zero */
+#endif
+
+#if defined(CONFIG_DEV_LOOP)
+ loop_register(); /* Standard /dev/loop */
+#endif
+#endif /* CONFIG_NFILE_DESCRIPTORS */
+
+#if defined(CONFIG_SCHED_INSTRUMENTATION_BUFFER) && \
+ defined(CONFIG_DRIVER_NOTE)
+ note_register(); /* Non-standard /dev/note */
+#endif
+
+#if defined(CONFIG_CRYPTO)
+ /* Initialize the HW crypto and /dev/crypto */
+
+ up_cryptoinitialize();
+#endif
+
+#if CONFIG_NFILE_DESCRIPTORS > 0 && defined(CONFIG_CRYPTO_CRYPTODEV)
+ devcrypto_register();
+#endif
+
+ /* Enable interrupt */
+
+ local_irq_enable();
}
void up_idle(void)
@@ -251,6 +325,7 @@ void up_release_stack(struct tcb_s *dtcb, uint8_t ttype)
* hold the blocked task TCB.
*
****************************************************************************/
+
void up_block_task(struct tcb_s *tcb, tstate_t task_state)
{
/* Verify that the context switch can be performed */
diff --git a/arch/rgmp/src/x86/arch_nuttx.c b/arch/rgmp/src/x86/arch_nuttx.c
index d5ae6916862..32f919cd784 100644
--- a/arch/rgmp/src/x86/arch_nuttx.c
+++ b/arch/rgmp/src/x86/arch_nuttx.c
@@ -44,7 +44,6 @@
#include
#include
-
void nuttx_arch_init(void)
{
extern void e1000_mod_init(void);
@@ -57,7 +56,6 @@ void nuttx_arch_init(void)
// setup e1000
e1000_mod_init();
#endif
-
}
void nuttx_arch_exit(void)
diff --git a/arch/sh/src/common/up_initialize.c b/arch/sh/src/common/up_initialize.c
index c333f4b9939..2cd40a07188 100644
--- a/arch/sh/src/common/up_initialize.c
+++ b/arch/sh/src/common/up_initialize.c
@@ -44,13 +44,16 @@
#include
#include
#include
-#include
+#include
#include
#include
#include
#include
#include
#include
+#include
+#include
+#include
#include "up_arch.h"
#include "up_internal.h"
@@ -129,9 +132,19 @@ void up_initialize(void)
up_irqinitialize();
- /* Initialize the system timer interrupt */
+#ifdef CONFIG_PM
+ /* Initialize the power management subsystem. This MCU-specific function
+ * must be called *very* early in the initialization sequence *before* any
+ * other device drivers are initialized (since they may attempt to register
+ * with the power management subsystem).
+ */
+
+ up_pminitialize();
+#endif
#if !defined(CONFIG_SUPPRESS_INTERRUPTS) && !defined(CONFIG_SUPPRESS_TIMER_INTS)
+ /* Initialize the system timer interrupt */
+
up_timer_initialize();
#endif
@@ -143,6 +156,14 @@ void up_initialize(void)
devnull_register(); /* Standard /dev/null */
#endif
+#if defined(CONFIG_DEV_RANDOM)
+ devrandom_register(); /* Standard /dev/random */
+#endif
+
+#if defined(CONFIG_DEV_URANDOM)
+ devurandom_register(); /* Standard /dev/urandom */
+#endif
+
#if defined(CONFIG_DEV_ZERO)
devzero_register(); /* Standard /dev/zero */
#endif
@@ -178,6 +199,12 @@ void up_initialize(void)
ramlog_consoleinit();
#endif
+#if CONFIG_NFILE_DESCRIPTORS > 0 && defined(CONFIG_PSEUDOTERM_SUSV1)
+ /* Register the master pseudo-terminal multiplexor device */
+
+ (void)ptmx_register();
+#endif
+
/* Early initialization of the system logging device. Some SYSLOG channel
* can be initialized early in the initialization sequence because they
* depend on only minimal OS initialization.
@@ -185,6 +212,16 @@ void up_initialize(void)
syslog_initialize(SYSLOG_INIT_EARLY);
+#if defined(CONFIG_CRYPTO)
+ /* Initialize the HW crypto and /dev/crypto */
+
+ up_cryptoinitialize();
+#endif
+
+#if CONFIG_NFILE_DESCRIPTORS > 0 && defined(CONFIG_CRYPTO_CRYPTODEV)
+ devcrypto_register();
+#endif
+
#ifndef CONFIG_NETDEV_LATEINIT
/* Initialize the network */
diff --git a/arch/sim/Kconfig b/arch/sim/Kconfig
index 7384d3d7230..975d0449a5b 100644
--- a/arch/sim/Kconfig
+++ b/arch/sim/Kconfig
@@ -211,8 +211,33 @@ config SIM_TCNWAITERS
default 4
depends on !POLL_DISABLE && SIM_TOUCHSCREEN
---help---
- The maximum number of threads that can be waiting on poll() for a touchscreen event.
- Default: 4
+ The maximum number of threads that can be waiting on poll() for a
+ touchscreen event. Default: 4
+
+config SIM_IOEXPANDER
+ bool "Simulated I/O Expander"
+ default n
+ depends on IOEXPANDER
+ select IOEXPANDER_INT_ENABLE
+ ---help---
+ Build a simple, simulated I/O Expander chip simulation (for testing
+ purposes only).
+
+if SIM_IOEXPANDER
+
+config SIM_INT_NCALLBACKS
+ int "Max number of interrupt callbacks"
+ default 4
+ ---help---
+ This is the maximum number of interrupt callbacks supported
+
+config SIM_INT_POLLDELAY
+ int "Interrupt poll delay (used)"
+ default 500000
+ ---help---
+ This microsecond delay defines the polling rate for missed interrupts.
+
+endif # SIM_IOEXPANDER
config SIM_SPIFLASH
bool "Simulated SPI FLASH with SMARTFS"
@@ -245,20 +270,6 @@ config SIM_SPIFLASH_128M
endchoice
-config SIM_SPIFLASH_MANUFACTURER
- hex "Hex ID of the FLASH manufacturer code"
- default 0x20
- depends on SIM_SPIFLASH
- ---help---
- Allows the simulated FLASH Manufacturer ID to be set.
-
-config SIM_SPIFLASH_MEMORY_TYPE
- hex "Hex ID of the FLASH Memory Type code"
- default 0x20
- depends on SIM_SPIFLASH
- ---help---
- Allows the simulated FLASH Memory Type code to be set.
-
config SIM_SPIFLASH_SECTORSIZE
int "FLASH Sector Erase Size"
default 65536
@@ -277,6 +288,51 @@ config SIM_SPIFLASH_SUBSECTORSIZE
Sets the smaller sub-sector erase size supported by the
FLASH emulation
+config SIM_SPIFLASH_M25P
+ bool "Enable M25Pxx FLASH"
+ depends on MTD_M25P
+ ---help---
+ Enables simulation of an M25P type FLASH
+
+config SIM_SPIFLASH_SST26
+ bool "Enable SST26 FLASH"
+ depends on MTD_SST26
+ ---help---
+ Enables simulation of an SST26 type FLASH
+
+config SIM_SPIFLASH_W25
+ bool "Enable W25 FLASH"
+ depends on MTD_W25
+ ---help---
+ Enables simulation of a W25 type FLASH
+
+config SIM_SPIFLASH_CUSTOM
+ bool "Enable Emulation of a Custom Manufacturer / ID FLASH"
+ depends on SIM_SPIFLASH
+ ---help---
+ Enables simulation of FLASH with a custom Manufacturer, ID and Capacity
+
+config SIM_SPIFLASH_MANUFACTURER
+ hex "Hex ID of the FLASH manufacturer code"
+ default 0x20
+ depends on SIM_SPIFLASH_CUSTOM
+ ---help---
+ Allows the simulated FLASH Manufacturer ID to be set.
+
+config SIM_SPIFLASH_MEMORY_TYPE
+ hex "Hex ID of the FLASH Memory Type code"
+ default 0x20
+ depends on SIM_SPIFLASH_CUSTOM
+ ---help---
+ Allows the simulated FLASH Memory Type code to be set.
+
+config SIM_SPIFLASH_CAPACITY
+ hex "Hex ID of the FLASH capacity code"
+ default 0x14
+ depends on SIM_SPIFLASH_CUSTOM
+ ---help---
+ Allows the simulated FLASH Memory Capacity code to be set.
+
config SIM_SPIFLASH_PAGESIZE
int "FLASH Write / Program Page Size"
default 256
@@ -289,4 +345,79 @@ config SIM_SPIFLASH_PAGESIZE
"wrap" causing the initial data sent to be overwritten.
This is consistent with standard SPI FLASH operation.
-endif
+config SIM_QSPIFLASH
+ bool "Simulated QSPI FLASH with SMARTFS"
+ default n
+ select FS_SMARTFS
+ select MTD_SMART
+ ---help---
+ Adds a simulated QSPI FLASH that responds to N25QXXX style
+ commands on the QSPI bus.
+
+choice
+ prompt "Simulated QSPI FLASH Size"
+ default SIM_QSPIFLASH_1M
+ depends on SIM_QSPIFLASH
+
+config SIM_QSPIFLASH_1M
+ bool "1 MBit (128K Byte)"
+
+config SIM_QSPIFLASH_8M
+ bool "8 MBit (1M Byte)"
+
+config SIM_QSPIFLASH_32M
+ bool "32 MBit (4M Byte)"
+
+config SIM_QSPIFLASH_64M
+ bool "64 MBit (8M Byte)"
+
+config SIM_QSPIFLASH_128M
+ bool "128 MBit (16M Byte)"
+
+endchoice
+
+config SIM_QSPIFLASH_MANUFACTURER
+ hex "Hex ID of the FLASH manufacturer code"
+ default 0x20
+ depends on SIM_QSPIFLASH
+ ---help---
+ Allows the simulated FLASH Manufacturer ID to be set.
+
+config SIM_QSPIFLASH_MEMORY_TYPE
+ hex "Hex ID of the FLASH Memory Type code"
+ default 0xba
+ depends on SIM_QSPIFLASH
+ ---help---
+ Allows the simulated FLASH Memory Type code to be set.
+
+config SIM_QSPIFLASH_SECTORSIZE
+ int "FLASH Sector Erase Size"
+ default 65536
+ depends on SIM_QSPIFLASH
+ ---help---
+ Sets the large sector erase size that the part simulates.
+ This driver simulates QSPI devices that have both a large
+ sector erase as well as a "sub-sector" (per the datasheet)
+ erase size (typically 4K bytes).
+
+config SIM_QSPIFLASH_SUBSECTORSIZE
+ int "FLASH Sub-Sector Erase Size"
+ default 4096
+ depends on SIM_QSPIFLASH
+ ---help---
+ Sets the smaller sub-sector erase size supported by the
+ FLASH emulation
+
+config SIM_QSPIFLASH_PAGESIZE
+ int "FLASH Write / Program Page Size"
+ default 256
+ depends on SIM_QSPIFLASH
+ ---help---
+ Sets the size of a page program operation. The page size
+ represents the maximum number of bytes that can be sent
+ for a program operation. If more bytes than this are
+ sent on a single Page Program, then the address will
+ "wrap" causing the initial data sent to be overwritten.
+ This is consistent with standard SPI FLASH operation.
+
+endif # ARCH_SIM
diff --git a/arch/sim/src/Makefile b/arch/sim/src/Makefile
index 72401d6c773..d669f394218 100644
--- a/arch/sim/src/Makefile
+++ b/arch/sim/src/Makefile
@@ -57,7 +57,7 @@ CSRCS = up_initialize.c up_idle.c up_interruptcontext.c up_initialstate.c
CSRCS += up_createstack.c up_usestack.c up_releasestack.c up_stackframe.c
CSRCS += up_unblocktask.c up_blocktask.c up_releasepending.c
CSRCS += up_reprioritizertr.c up_exit.c up_schedulesigaction.c up_spiflash.c
-CSRCS += up_allocateheap.c up_devconsole.c
+CSRCS += up_allocateheap.c up_devconsole.c up_qspiflash.c
HOSTSRCS = up_hostusleep.c
@@ -103,6 +103,10 @@ endif
endif
endif
+ifeq ($(CONFIG_SIM_IOEXPANDER),y)
+ CSRCS += up_ioexpander.c
+endif
+
ifeq ($(CONFIG_ELF),y)
CSRCS += up_elf.c
endif
diff --git a/arch/sim/src/nuttx-names.dat b/arch/sim/src/nuttx-names.dat
index 698df015764..759743be534 100644
--- a/arch/sim/src/nuttx-names.dat
+++ b/arch/sim/src/nuttx-names.dat
@@ -1,34 +1,58 @@
+_exit NX_exit
accept NXaccept
+asprintf NXasprintf
+basename NXbasename
calloc NXcalloc
+chdir NXchdir
+clearenv NXclearenv
clock_gettime NXclock_gettime
close NXclose
closedir NXclosedir
dup NXdup
+dup2 NXdup2
+exit NXexit
free NXfree
fclose NXfclose
+fdopen NXfdopen
+fgetc NXfgetc
fopen NXfopen
+fprintf NXfprintf
fputc NXfputc
fcntl NXfcntl
fputs NXfputs
fread NXfread
+fseek NXfseek
fwrite NXfwrite
fsync NXfsync
+ftell NXftell
getenv NXgetenv
+getopt NXgetopt
+getpid NXgetpid
gettimeofday NXgettimeofday
ioctl NXioctl
isatty NXisatty
+kill NXkill
listen NXlisten
lseek NXlseek
+mallinfo NXmallinfo
malloc NXmalloc
malloc_init NXmalloc_init
+memcmp NXmemcmp
+memcpy NXmemcpy
+memset NXmemset
+mkfifo NXmkfifo
+mktime NXmktime
+mq_close NXmq_close
mkdir NXmkdir
mount NXmount
open NXopen
opendir NXopendir
nanosleep NXnanosleep
+pipe NXpipe
poll NXpoll
printf NXprintf
pthread_create NXpthread_create
+pthread_exit NXpthread_exit
pthread_getspecific NXpthread_getspecific
pthread_key_create NXpthread_key_create
pthread_kill NXpthread_kill
@@ -40,38 +64,72 @@ pthread_mutex_unlock NXpthread_mutex_unlock
pthread_setspecific NXpthread_setspecific
pthread_sigmask NXpthread_sigmask
pthread_yield NXpthread_yield
+ptsname NXptsname
+ptsname_r NXptsname_r
puts NXputs
read NXread
readdir NXreaddir
realloc NXrealloc
recv NXrecv
recvfrom NXrecvfrom
+rename NXrename
rewinddir NXrewinddir
rmdir NXrmdir
sched_yield NXsched_yield
seekdir NXseekdir
select NXselect
+sem_getvalue NXsem_getvalue
sem_init NXsem_init
sem_post NXsem_post
sem_wait NXsem_wait
send NXsend
sendto NXsendto
+setenv NXsetenv
+setlogmask NXsetlogmask
setsockopt NXsetsockopt
sigaction NXsigaction
+sigaddset NXsigaddset
+sigdelset NXsigdelset
+sigemptyset NXsigemptyset
+sigfillset NXsigfillset
sighold NXsighold
+sigismember NXsigismember
sigprocmask NXsigprocmask
sigtimedwait NXsigtimedwait
sigrelse NXsigrelse
sleep NXsleep
+snprintf NXsnprintf
socket NXsocket
+sprintf NXsprintf
stat NXstat
statfs NXstatfs
+strcat NXstrcat
+strchr NXstrchr
+strcmp NXstrcmp
+strcpy NXstrcpy
+strcspn NXstrcspn
+strdup NXstrdup
+strftime NXstrftime
+strlen NXstrlen
+strncasecmp NXstrncasecmp
+strncmp NXstrncmp
+strncpy NXstrncpy
+strrchr NXstrrchr
+strtok_r NXstrtok_r
+strtol NXstrtol
+strtoul NXstrtoul
+syslog NXsyslog
system NXsystem
tcgetattr NXtcgetattr
tcsetattr NXtcsetattr
umount2 NXumount2
unlink NXunlink
+unlockpt NXunlockpt
+uname NXuname
+unsetenv NXunsetenv
usleep NXusleep
+vasprintf NXvasprintf
vfork NXvfork
+vfprintf NXvfprintf
write NXwrite
zmalloc NXzmalloc
diff --git a/arch/sim/src/up_blockdevice.c b/arch/sim/src/up_blockdevice.c
index 066df0a1dfe..b74480ecc06 100644
--- a/arch/sim/src/up_blockdevice.c
+++ b/arch/sim/src/up_blockdevice.c
@@ -44,7 +44,7 @@
#include
#include
-#include
+#include
#include "up_internal.h"
diff --git a/arch/sim/src/up_hostfs.c b/arch/sim/src/up_hostfs.c
index f0928ed0dac..5e1e1f79cb4 100644
--- a/arch/sim/src/up_hostfs.c
+++ b/arch/sim/src/up_hostfs.c
@@ -36,6 +36,7 @@
/****************************************************************************
* Included Files
****************************************************************************/
+
#define _BSD_SOURCE
#include
@@ -50,6 +51,7 @@
#include
#include
+#define __SIM__ 1
#include "hostfs.h"
/****************************************************************************
@@ -62,40 +64,44 @@ int host_open(const char *pathname, int flags, int mode)
/* Perform flag mapping */
- if ((flags & (HOSTFS_FLAG_RDOK | HOSTFS_FLAG_WROK)) ==
- (HOSTFS_FLAG_RDOK | HOSTFS_FLAG_WROK))
+ if ((flags & NUTTX_O_RDWR) == NUTTX_O_RDWR)
{
mapflags = O_RDWR;
}
- else if (flags & HOSTFS_FLAG_RDOK)
+ else if (flags & NUTTX_O_RDONLY)
{
mapflags = O_RDONLY;
}
- else if (flags & HOSTFS_FLAG_WROK)
+ else if (flags & NUTTX_O_WRONLY)
{
mapflags = O_WRONLY;
}
- if (flags & HOSTFS_FLAG_APPEND)
+ if (flags & NUTTX_O_APPEND)
{
mapflags |= O_APPEND;
}
- if (flags & HOSTFS_FLAG_CREAT)
+ if (flags & NUTTX_O_CREAT)
{
mapflags |= O_CREAT;
}
- if (flags & HOSTFS_FLAG_EXCL)
+ if (flags & NUTTX_O_EXCL)
{
mapflags |= O_EXCL;
}
- if (flags & HOSTFS_FLAG_TRUNC)
+ if (flags & NUTTX_O_TRUNC)
{
mapflags |= O_TRUNC;
}
+ if (flags & NUTTX_O_NONBLOCK)
+ {
+ mapflags |= O_NONBLOCK;
+ }
+
return open(pathname, mapflags, mode);
}
@@ -180,21 +186,22 @@ int host_dup(int fd)
void *host_opendir(const char *name)
{
- return (void *) opendir(name);
+ /* Return the host DIR pointer */
+
+ return (void *)opendir(name);
}
/****************************************************************************
* Public Functions
****************************************************************************/
-int host_readdir(void* dirp, struct host_dirent_s* entry)
+int host_readdir(void* dirp, struct nuttx_dirent_s* entry)
{
- struct dirent *ent;
+ struct dirent *ent;
/* Call the host's readdir routine */
ent = readdir(dirp);
-
if (ent != NULL)
{
/* Copy the entry name */
@@ -206,24 +213,21 @@ int host_readdir(void* dirp, struct host_dirent_s* entry)
entry->d_type = 0;
if (ent->d_type == DT_REG)
{
- entry->d_type = HOSTFS_DTYPE_FILE;
+ entry->d_type = NUTTX_DTYPE_FILE;
}
else if (ent->d_type == DT_CHR)
{
- entry->d_type = HOSTFS_DTYPE_CHR;
+ entry->d_type = NUTTX_DTYPE_CHR;
}
else if (ent->d_type == DT_BLK)
{
- entry->d_type = HOSTFS_DTYPE_BLK;
+ entry->d_type = NUTTX_DTYPE_BLK;
}
else if (ent->d_type == DT_DIR)
{
- entry->d_type = HOSTFS_DTYPE_DIRECTORY;
+ entry->d_type = NUTTX_DTYPE_DIRECTORY;
}
- }
- if (ent)
- {
return 0;
}
@@ -234,7 +238,7 @@ int host_readdir(void* dirp, struct host_dirent_s* entry)
* Public Functions
****************************************************************************/
-void host_rewinddir(void* dirp)
+void host_rewinddir(void *dirp)
{
/* Just call the rewinddir routine */
@@ -245,7 +249,7 @@ void host_rewinddir(void* dirp)
* Public Functions
****************************************************************************/
-int host_closedir(void* dirp)
+int host_closedir(void *dirp)
{
return closedir(dirp);
}
@@ -254,7 +258,7 @@ int host_closedir(void* dirp)
* Public Functions
****************************************************************************/
-int host_statfs(const char *path, struct host_statfs_s *buf)
+int host_statfs(const char *path, struct nuttx_statfs_s *buf)
{
int ret;
struct statfs host_buf;
@@ -263,18 +267,16 @@ int host_statfs(const char *path, struct host_statfs_s *buf)
ret = statfs(path, &host_buf);
- /* Map the return values */
+ /* Map the struct statfs value */
buf->f_type = host_buf.f_type;
+ buf->f_namelen = host_buf.f_namelen;
buf->f_bsize = host_buf.f_bsize;
buf->f_blocks = host_buf.f_blocks;
buf->f_bfree = host_buf.f_bfree;
buf->f_bavail = host_buf.f_bavail;
buf->f_files = host_buf.f_files;
buf->f_ffree = host_buf.f_ffree;
- buf->f_fsid = 0;
- buf->f_namelen = host_buf.f_namelen;
- buf->f_frsize = host_buf.f_frsize;
return ret;
}
@@ -321,62 +323,50 @@ int host_rename(const char *oldpath, const char *newpath)
* Public Functions
****************************************************************************/
-int host_stat(const char *path, struct host_stat_s *buf)
+int host_stat(const char *path, struct nuttx_stat_s *buf)
{
- struct stat host_buf;
- int ret;
+ struct stat host_buf;
+ int ret;
/* Call the host's stat routine */
ret = stat(path, &host_buf);
- /* Now map the return values to the common struct */
+ /* Map the return values */
- buf->st_dev = host_buf.st_dev; /* ID of the device containing file */
- buf->st_ino = host_buf.st_ino;; /* inode number */
- buf->st_nlink = host_buf.st_nlink; /* number of hard links */
- buf->st_uid = host_buf.st_uid; /* user ID of owner */
- buf->st_gid = host_buf.st_gid; /* group ID of owner */
- buf->st_rdev = host_buf.st_rdev; /* device ID */
- buf->st_size = host_buf.st_size; /* total size, in bytes */
- buf->st_blksize = host_buf.st_blksize; /* blocksize for file system I/O */
- buf->st_blocks = host_buf.st_blocks; /* number of 512B blocks allocated */
- buf->st_atim = host_buf.st_atime; /* time of last access */
- buf->st_mtim = host_buf.st_mtime; /* time of last modification */
- buf->st_ctim = host_buf.st_ctime; /* time of last status change */
+ buf->st_mode = host_buf.st_mode & 0777;
- /* Map the mode bits */
-
- buf->st_mode = host_buf.st_mode & 0xFFF;
- if (S_ISREG(host_buf.st_mode))
+ if (host_buf.st_mode & S_IFDIR)
{
- buf->st_mode |= HOST_ST_MODE_REG;
+ buf->st_mode |= NUTTX_S_IFDIR;
+ }
+ else if (host_buf.st_mode & S_IFREG)
+ {
+ buf->st_mode |= NUTTX_S_IFREG;
+ }
+ else if (host_buf.st_mode & S_IFCHR)
+ {
+ buf->st_mode |= NUTTX_S_IFCHR;
+ }
+ else if (host_buf.st_mode & S_IFBLK)
+ {
+ buf->st_mode |= NUTTX_S_IFBLK;
+ }
+ else if (host_buf.st_mode & S_IFLNK)
+ {
+ buf->st_mode |= NUTTX_S_IFLNK;
+ }
+ else /* if (host_buf.st_mode & S_IFIFO) */
+ {
+ buf->st_mode |= NUTTX_S_IFIFO;
}
- if (S_ISDIR(host_buf.st_mode))
- {
- buf->st_mode |= HOST_ST_MODE_DIR;
- }
-
- if (S_ISCHR(host_buf.st_mode))
- {
- buf->st_mode |= HOST_ST_MODE_CHR;
- }
-
- if (S_ISBLK(host_buf.st_mode))
- {
- buf->st_mode |= HOST_ST_MODE_BLK;
- }
-
- if (S_ISFIFO(host_buf.st_mode))
- {
- buf->st_mode |= HOST_ST_MODE_PIPE;
- }
-
- if (S_ISLNK(host_buf.st_mode))
- {
- buf->st_mode |= HOST_ST_MODE_LINK;
- }
+ buf->st_size = host_buf.st_size;
+ buf->st_blksize = host_buf.st_blksize;
+ buf->st_blocks = host_buf.st_blocks;
+ buf->st_atim = host_buf.st_atim.tv_sec;
+ buf->st_mtim = host_buf.st_mtim.tv_sec;
+ buf->st_ctim = host_buf.st_ctim.tv_sec;
return ret;
}
diff --git a/arch/sim/src/up_initialize.c b/arch/sim/src/up_initialize.c
index cb07619eabd..ada5bb33ba0 100644
--- a/arch/sim/src/up_initialize.c
+++ b/arch/sim/src/up_initialize.c
@@ -43,7 +43,7 @@
#include
#include
-#include
+#include
#include
#include
#include
@@ -52,6 +52,9 @@
#include