Same change as in commit 8cf8db3a73 ("Kconfig: Use a short, consistent
style for prompts"), fixing stuff that got introduced since then.
Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
It is planned to deprecate SHELL_CREATE_STATIC_SUBCMD_SET macro
which is replaced by SHELL_STATIC_SUBCMD_SET_CREATE.
Additionally, removed irrelevant comments about alphabetical
ordering which is no longer needed.
Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
A common driver is shared between stm32 chips, which was not the case
for stm32f3 series. As a consequence stm32f3 was not maintained
equally and was missing features such as flash layout or dts based
configuration.
Besides, drivers had some flows such as wrong bus clock and
missing HSI clock activation which lead to issues on boards not
using HSI as main clock.
As a consequence this commit moves stm32f3 series flash driver to
common stm32 flash drivers.
Fixes#4197
Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
Cleanup the Kconfig code for the flash driver. Platform-specific
options should be in their own Kconfig files to be consistent and to
not pollute the common configuration.
To this end we move the nrf options into it's own file.
Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
Cleanup the Kconfig code for the flash driver. Platform-specific
options should be in their own Kconfig files to be consistent and to
not pollute the common configuration.
To this end we move the mcux options into it's own file.
Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
Cleanup the Kconfig code for the flash driver. Platform-specific
options should be in their own Kconfig files to be consistent and to
not pollute the common configuration.
To this end we move the nios2 options into it's own file.
Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
The patch 44758977f8 made a change where
SECTORS_COUNT was not calculated properly. This patch corrects it.
Signed-off-by: Rajavardhan Gundi <rajavardhan.gundi@intel.com>
There are issues using lowercase min and max macros when compiling a C++
application with a third-party toolchain such as GNU ARM Embedded when
using some STL headers i.e. <chrono>.
This is because there are actual C++ functions called min and max
defined in some of the STL headers and these macros interfere with them.
By changing the macros to UPPERCASE, which is consistent with almost all
other pre-processor macros this naming conflict is avoided.
All files that use these macros have been updated.
Signed-off-by: Carlos Stuart <carlosstuart1970@gmail.com>
Convert generic FLASH_{WRITE,ERASE}_BLOCK_SIZE to driver specific
generated define DT_JEDEC_SPI_NOR_0_{WRITE,ERASE}_BLOCK_SIZE.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
Convert generic FLASH_WRITE_BLOCK_SIZE to driver specific generated
define DT_SOC_NV_FLASH_0_WRITE_BLOCK_SIZE.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
Convert generic FLASH_{WRITE,ERASE}_BLOCK_SIZE to driver specific
generated define DT_SOC_NV_FLASH_0_{WRITE,ERASE}_BLOCK_SIZE.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
Convert generic FLASH_ERASE_BLOCK_SIZE to driver specific generated
define DT_SOC_NV_FLASH_0_ERASE_BLOCK_SIZE.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
Convert generic FLASH_WRITE_BLOCK_SIZE to driver specific generated
define DT_SOC_NV_FLASH_0_WRITE_BLOCK_SIZE.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
off_t is int with the minimal libc and long with the newlib libc. The
log messages are assuming that off_t is int, therefore this causes
warnings when building with newlib.
Fix that by casting the offset to the "longer" type, ie long.
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Configuration of Erase command is specified in DTS. Hence
the corresponding changes in Kconfig are removed.
Signed-off-by: Rajavardhan Gundi <rajavardhan.gundi@intel.com>
Number of sectors is now calculated from the flash density
i.e. (Flash size)/(sector size).
Signed-off-by: Rajavardhan Gundi <rajavardhan.gundi@intel.com>
This patch enables the support for FLASH_PAGE_LAYOUT and
FLASH_MAP for the generic spin nor flash driver.
Signed-off-by: Rajavardhan Gundi <rajavardhan.gundi@intel.com>
Use DT_ instead of CONFIG_ for spi freq, spi bus name, flash device
name and flash base address.
Signed-off-by: Rajavardhan Gundi <rajavardhan.gundi@intel.com>
Modified drivers to use DEVICE_AND_API_INIT() instead of DEVICE_INIT()
This will make sure driver_api,is populated at build time and is exposed
to user space
Signed-off-by: Varun Sharma <varun.sharma@intel.com>
Use the page size retrieved via page layout in flash erase
shell command in case erase size is not given.
Signed-off-by: Jan Van Winkel <jan.van_winkel@dxplore.eu>
Convert the w25qxxdv driver to use device tree for SPI device params.
Updated the Arduino 101 config to use device tree to specify the SPI
flash. Update the arduino_101_sss to drop Kconfig support for the
w25qxxdv flash.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
Zephyr gecko drivers depend on libraries provided by the vendor. The
same libraries may also be used directly by the application code or
RAIL library. To facilitate the latter use case scenario this commit
adds Kconfig options to independently enable compilation of vendor
HAL library modules.
Signed-off-by: Piotr Mienkowski <piotr.mienkowski@gmail.com>
Until now spi_flash_wb_write/read functions were only supporting
buffers that fit into a W25Q page (even if there were not checking
the offset was page aligned).
This change allows these function to read/write multiple W25Q page.
This change is required as the caller of these functions are not
aware of flash page size.
Signed-off-by: Johannes Hutter <johannes@proglove.de>
Signed-off-by: Olivier Martin <olivier.martin@proglove.de>
Signed-off-by: Michael Wendland <michael@proglove.de>
The next commit will use this new
spi_flash_wb_write_protection_set_with_lock() in
spi_flash_wb_write() that already hold the lock.
To prevent a lock we need to skip the SYNC_LOCK when we want
to disable write protection.
Signed-off-by: Olivier Martin <olivier.martin@proglove.de>
Preparation to introduce the Upper Link Layer (ULL) and
Lower Link Layer (LLL) split architecture.
- Move SoC dependent HAL to vendor specific folder.
- Preparation to split data structures into ULL and LLL
types.
- Added more role and state conditional compilations.
- Added some work-in-progress implementation of advertising
extensions, will be used as inspiration in the new split
architecture work.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Updates the MCUXpresso SDK to version 2.5.0 for applicable SoCs.
Wireless (KW*) and legacy (KL25) SoCs were not included in this
MCUXpresso SDK release and are therefore not updated here.
New in this release is SoC-level and board-level support for external
xip flash in the i.MX RT family.
For RT1050, we are now using the MCUXpresso SDK for the EVKB version of
the board, which correponds to an upgrade from A0 to A1 silicon.
However, we don't yet have Kconfigs in place to support A1 silicon part
numbers, and therefore add a simple cmake hack to convert A0 part
numbers to A1 part numbers.
The SDK flash driver interface also changed slightly in this release,
and thus the zephyr flash shim driver is updated accordingly.
Origin: MCUXpresso SDK
License: BSD 3-Clause
URL: mcux.nxp.com
Purpose: Provide device header files and bare metal peripheral drivers
for Kinetis, LPC, and i.MX SoCs.
Maintained-by: External
Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
Nordic UICR are non-volatile memory registers for
configuring user-specific settings. Basically it is subset of flash
memory available in the SoC.
Add support for operations on NVM which belongs to UICR.
UICR are written or read as ordinary flash memory.
For erasing UICR it is required to call erase with UICR start
address and its size (this is caused by what hardware supported).
Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
This patch adds a flash driver for the STM32F7x series, inspired from
the STM32F4x one. It has been tested on the STM32F723, but should also
work on other SoCs of the family.
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
On SoC families using a Cortex-M7, it is possible to flush only specific
cache lines. Therefore pass the offset and len so that the flush can be
done with more granularity.
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
In general synchronisation between memory and the instruction cache
should be done explicitly, for example this is how it is done for RAM.
It is also done that way for flash writes in the current STM32 flash
driver.
However in case of flash erases, the current STM32 flash driver flushes
the i-cache. It probably doesn't make a big difference for the
Cortex-M3/M4 families as the cache is very small. That said it might
have bigger impact on families based on Cortex-M7 as it has between 4KB
and 16KB of i-cache, that will be added latter in this patch serie.
This patch therefore remove the i-cache flush in
flash_stm32_flush_caches.
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
This reduces the amount of #ifdef and keep all of them at the same
place. The empty function is then optimized-out by the compiler.
At the same time change the negative test by a positive one to simplify
adding new entries.
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
The timeout handling in the STM32 flash driver is currently a counter
in the busy check loop. This doesn't scale well across the whole STM32
family:
- The duration of the loop depends on the CPU speed, the activation of
caches.
- The duration of the longest flash operation (a sector erase as the
driver doesn't support mass erase) can varies a lot mostly depending
on the sector size, 2K on F0 and L4 families or 128K on the F4 family.
In addition the timeout can change depending if the writing thread is
prempted or not.
Fix that by defining a timeout in ms depending on the family, and using
k_uptime_get to get a precise measurement of the time.
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Check clock_control_on return value now that it is checking appropriate
bus is used in the request.
Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
1. Created new shell module: shell_help.
2. Simplified command handlers with new shell print macros.
3. Removed help functions from command handlers.
Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@nordicsemi.no>
Removing help "options" from shell API.
Currently SHELL_OPT macro is not used by users. What is more
commit: a89690d10f ignores possible options created in
command handler by the user. As a result they are not printed
in help message.
Second, currntly implemented "options" in command handlers options are
implemented without SHELL_OPT macro.
And last but not least this change will allow to implement
help handler in a way that user will not need to think about calling
functions printing help in a command handler.
Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@nordicsemi.no>
Remove an unnecessary local variable to store the
return value, instead return directly thereby saving
few bits of memory.
Found using Coccinelle.
Signed-off-by: Himanshu Jha <himanshujha199640@gmail.com>