Commit graph

98463 commits

Author SHA1 Message Date
Maureen Helm 2b7840eae6 spi: Remove unused Kconfig symbols from mcux dspi driver
These mcux dspi driver configs are no longer used after legacy API
support was removed in commit 09dd5e9b22.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2018-09-17 15:58:03 -04:00
Flavio Ceolin 4a211ec241 include: Add missing headers guard
Add missing headers guard

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2018-09-17 15:49:26 -04:00
Flavio Ceolin 67ca176754 headers: Fix headers across the project
Any word started with underscore followed by and uppercase letter or a
second underscore is a reserved word according with C99.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2018-09-17 15:49:26 -04:00
Flavio Ceolin a7fffa9e00 headers: Fix headers guards
Any word started with underscore followed by and uppercase letter or a
second underscore is a reserved word according with C99.

With have *many* violations on Zephyr's code, this commit is tackling
only the violations caused by headers guards. It also takes the
opportunity to normalize them using the filename in uppercase and
replacing dot with underscore. e.g file.h -> FILE_H

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2018-09-17 15:49:26 -04:00
Johan Hedberg 6a68a66726 Bluetooth: GATT: Use BT_GATT_DESCRIPTOR() for descriptors
CEP, CUD and CPF are all characteristic descriptors, so use the
approprirate macro for them.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2018-09-17 22:03:22 +03:00
Johan Hedberg 3c1dab005f Bluetooth: SMP: Remove bogus ARG_UNUSED() macro
The req variable in smp_pairing_failed() does get used, so
ARG_UNUSED() is inappropriate for it.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2018-09-17 14:46:10 -04:00
Johan Hedberg b4d7c2906b Bluetooth: Remove bogus condition for setting IRK for an identity
Just like we set the address for an identity without depending on the
BT_DEV_READY flag, we should do the same for the IRK. Otherwise we
risk getting an all-zeroes IRK. Remove the condition and always set
the IRK value whenever CONFIG_BT_PRIVACY is enabled.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2018-09-17 19:50:49 +03:00
Johan Hedberg cb08963fac Bluetooth: Fix identity creation through vendor HCI
The code creating identities from the Read_Static_Addresses vendor
command was failing to create matching IRKs, resulting in an
all-zeroes IRK to be used. Fix this by using the existing id_create()
function which takes care of generaing an IRK when necessary.

Fixes #10003

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2018-09-17 19:50:49 +03:00
Johan Hedberg a8f4370966 Bluetooth: Move bt_setup_id_addr() to avoid forward declaration
A subsequent patch will make bt_setup_id_addr() depend on id_create()
which was so far lower down in the hci_core.c c-file. Move
bt_setup_id_addr() further down to avoid a forward declaration.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2018-09-17 19:50:49 +03:00
Anas Nashif e36c7f5b2b samples: hello world: print board name
Use CONFIG_BOARD instead of CONFIG_ARCH.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-09-17 09:46:24 -04:00
Anas Nashif 47c20d6ece sample: we have dedicated test for single thread
No need for this here in this sample.
Remove CONFIG_SCHED_MULTIQ which was added by mistake.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-09-17 09:46:24 -04:00
Anas Nashif 2e7bdb6be2 scripts: gen_priv_stacks.py: run through flake8
Follow pep8 style based on flake8 script.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-09-17 09:40:02 -04:00
Anas Nashif 7a08b2b353 scripts: gen_kobject_list.py: run through flake8
Follow pep8 style based on flake8 script.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-09-17 09:40:02 -04:00
Anas Nashif 6af68b3623 scripts: elf_helper.py: run through flake8
Follow pep8 style based on flake8 script.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-09-17 09:40:02 -04:00
Aurelien Jarno 8ec537dc40 samples: nvs: improve one output message, fix another one
Fix the Id of the longarray message.

Also change the display of the "Address" entry to use "Id" instead of
"Entry" to be consistent the other displayed entries.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2018-09-17 07:54:35 -04:00
Aurelien Jarno 9fa1af694e subsys: fs/nvs: do not leave the flash unprotected in case of error
In case a write to the flash failed, do not leave the flash unprotected.
Always call flash_write_protection_set in that case.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2018-09-17 07:54:35 -04:00
Aurelien Jarno ce7e1a1cc8 subsys: fs/nvs: do not change flash protection for zero-length case
Avoid unsetting and setting the flash protection if there is nothing to
write to the flash. This happens for example when deleting data from the
flash using nvs_delete.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2018-09-17 07:54:35 -04:00
Aurelien Jarno 7a76792c87 subsys: fs/nvs: break if no end of sector is found
In case a sector is not empty nor properly closed (ie it never contains
8 times 0xff nor 0x00), the _nvs_prev_ate will loop indefinitely and
will start adressing memory outside of the flash area.

Fix that by stopping the loop when the address matches the beginning of
the sector.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2018-09-17 07:54:35 -04:00
Aurelien Jarno 725d9f7e09 subsys: fs/nvs: simplify crc8 computation
Instead of forcing the crc8 entry to 0xff for the crc8 computation, just
ignore this field in the computation as it is the last one. This avoid
having to set it back to the original value for _nvs_ate_crc8_check.

Add a build assertion to ensure crc8 is kept last.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2018-09-17 07:54:35 -04:00
Aurelien Jarno f1c6f91def subsys: fs/nvs: declare the ate structure as packed
The allocation table entry should be as small as possible in the flash,
so declare it as packed to avoid that the compiler pads it.

Note that this doesn't change anything on ARM, but it might help for
other (future) architectures.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2018-09-17 07:54:35 -04:00
Aurelien Jarno afa9e1f9fc subsys: fs/nvs: improve syslog messages
- Add a missing plural.
- Use a comma to separate the sector number with the offset to not
  confuse that with a range.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2018-09-17 07:54:35 -04:00
Aurelien Jarno 9ec11d70eb subsys: fs/nvs: improve some comments
Use "within sector" instead of "sector", as it could be confused with
the unit otherwise.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2018-09-17 07:54:35 -04:00
Ulf Magnusson e0f1d77f5c menuconfig: Fix some minor graphical glitching and add custom styles
Update menuconfig.py to upstream revision 35a60b786c646.

This fixes some minor graphical glitching, with parts of lines that
don't fit the terminal wrapping around to the next line, and some
headings disappearing.

This version also adds supports for custom style definitions,
contributed by Mitja Horvat (punkfluid). Colors can be specified both by
number and in #RRGGBB notation. Color accuracy varies depending on
terminal capabilities, but will usually be good.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2018-09-17 09:55:12 +02:00
Robert Lubos 349e14d63c net: tls: Fix mbedtls hostname erros when certificates are not used
When no certificate-based ciphersuites are used, mbedTLS compiles out
hostname field and associated functions from its SSL context. This
resulted in compilation error when only PSK-based ciphersuites were
configured.

This commit resolves the issue by compiling-out hostname-related code
from secure sockets implementation on the same basis as mbedTLS does.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2018-09-17 09:48:11 +03:00
Ioannis Glaropoulos 4ed481b07e CODEOWNERS: Assign maintainers for Nordic SoC .dtsi files
Assign a list of maintainers for Nordic SoC Device Tree include
headers.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2018-09-16 19:52:47 -04:00
Christian Taedcke 2eb347b174 arm: exx32: Use one common soc.c for all exx32 socs
The differentiation between the MCUs is handled in the HAL from Silabs.
So all EXX32 MCUs should use the same soc.c file.

Signed-off-by: Christian Taedcke <hacking@taedcke.com>
2018-09-16 08:36:41 -05:00
Kumar Gala 236a2d6f13 dts: arm: nrf: Remove use of CONFIG_SOC_* from Nordic dts files
To move forward and remove use of Kconfig in dts files lets just create
SoC specific dtsi files that the boards can include.  This lets us
remove:

CONFIG_SOC_NRF51822_QFAA
CONFIG_SOC_NRF51822_QFAB
CONFIG_SOC_NRF51822_QFAC
CONFIG_SOC_NRF52810_QFAA
CONFIG_SOC_NRF52832_QFAA
CONFIG_SOC_NRF52832_CIAA
CONFIG_SOC_NRF52832_QFAB
CONFIG_SOC_NRF52840_QIAA

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-09-15 15:33:43 -05:00
Kumar Gala 846121761f dts: arm: atmel_same70: Remove use of CONFIG_SOC_* from Atmel dts files
To move forward and remove use of Kconfig in dts files lets just create
SoC specific dtsi files that the boards can include.  This lets us
remove:

CONFIG_SOC_PART_NUMBER_SAME70*

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-09-15 15:33:43 -05:00
Carles Cufi a75dfe35a0 CODEOWNERS: Assign missing nRF boards and SoC
List the correct maintainers for Nordic Semiconductor boards and SoCs.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2018-09-15 11:23:35 -04:00
Kumar Gala 6e240da26f dts: Use new DT_SIZE_{K,M} macros
Now that we have a common DT_SIZE_K macro use it instead of defining
__SIZE_K eveywhere.  We also have DT_SIZE_M, so use that in a few
places as well.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-09-15 09:23:07 -05:00
Ulf Magnusson 02d0523f40 doc: Fix RST error in Kconfig template documentation
A blank line is needed after '.. code-block::', or the code gets
misinterpreted as RST parameters:

  ...doc/subsystems/logging/logger.rst:168: WARNING: Error in
    "code-block" directive:
  maximum 1 argument(s) allowed, 9 supplied.

  .. code-block:: none
     module = FOO
     module-str = foo
     source "subsys/logging/Kconfig.template.log_config"

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2018-09-15 09:21:49 -05:00
Kumar Gala 91e0388513 dts/arm/st: Remove unneeded setting of #{address,size}-cells from RTC
The RTC node for some reason was setting #address-cells and #size-cells.
However it has no children so there isn't really any reason to do this.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-09-14 22:48:54 -05:00
Yannis Damigos d3c515ecce boards/arm: Enable RTC on STM32F3 based boards
Enable RTC on STM32F3 based boards.

Signed-off-by: Yannis Damigos <giannis.damigos@gmail.com>
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-09-14 22:48:54 -05:00
Yannis Damigos e072aba411 dts/arm/st: Add rtc node to STM32F3
Add rtc node to STM32F3 series.

Signed-off-by: Yannis Damigos <giannis.damigos@gmail.com>
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-09-14 22:48:54 -05:00
Yannis Damigos 0c1725116a drivers/rtc: Enable RTC driver for STM32F3 series
Enable RTC driver for STM32F3 series.

Signed-off-by: Yannis Damigos <giannis.damigos@gmail.com>
2018-09-14 22:48:54 -05:00
Yannis Damigos e688d5c6ce boards/arm: Enable RTC on STM32F4 based boards
Enable RTC on STM32F4 based boards.

Signed-off-by: Yannis Damigos <giannis.damigos@gmail.com>
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-09-14 22:48:54 -05:00
Yannis Damigos 0e505265b3 dts/arm/st: Add rtc node to STM32F4
Add rtc node to STM32F4 series.

Signed-off-by: Yannis Damigos <giannis.damigos@gmail.com>
2018-09-14 22:48:54 -05:00
Yannis Damigos 10c763cfbc drivers/rtc: Enable RTC driver for STM32F4 series
Enable RTC driver for STM32F4 series.

Signed-off-by: Yannis Damigos <giannis.damigos@gmail.com>
2018-09-14 22:48:54 -05:00
Ioannis Glaropoulos 73e8454d17 arch: arm: remove power-of-two align and size requirement for ARMv8-m
The ARMv8-m Memory Protection Unit does not require MPU regions
to be power-of-two aligned and sized. This commit removes this
requirement when building for ARMv8-m MCUs.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2018-09-14 23:05:13 -04:00
Erwan Gouriou b680688329 dts/st: enables possibility to define Flash and SRAM out of tree
In case of out of tree SoC, mem.h will trigger and error since
it is not aware of new SoC CONFIG_SOC_<reference>.
Modify error condition in order to generate the error only if
the flash and error size are not defined at this point (even in
out of tree case).

Fixes #9978

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2018-09-14 21:52:23 -04:00
Flavio Ceolin 0a4478434e kernel; Checking functions return
Checking the return of some scattered functions across kernel.
MISRA-C requires that all non-void functions have their return value
checked, though, in some cases there is nothing to do. Just
acknowledging it.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2018-09-14 16:55:37 -04:00
Flavio Ceolin 65b5280e8f kernel: Check k_thread_create return value
k_thread_create is used only in k_word_q_start that has no error
handling, so the return of that function is not used.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2018-09-14 16:55:37 -04:00
Flavio Ceolin 8f72f245bd kernel: Explicitly check _abort_thread_timemout
A lot of times this API is called during some cleanup even if the
timeout was not set to make the code simpler. In these cases it's not
necessary checking the return. Adding a cast to acknowledge it.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2018-09-14 16:55:37 -04:00
Flavio Ceolin 98c64b6d92 kernel: Change _reschedule signature
_reschedule return's value is not used anywhere, except erroneously by
pthread_barrier_wait.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2018-09-14 16:55:37 -04:00
Flavio Ceolin abffd83d26 kernel: atomic: Ignore atomic_and/or return when not used
There are some cases where atomic_and/or don't need to be
checked. Actively acknowledge these cases.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2018-09-14 16:55:37 -04:00
Flavio Ceolin 4d5397bb0a kernel: Ignore _abort_timeout return
Ignoring the return of _abort_timeout when there is nothing to
do. Either because the condition to return something different from 0
was prior checked or because it was called during come cleanup.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2018-09-14 16:55:37 -04:00
Flavio Ceolin 1663ca8590 kernel: Ignore _pend_current_thread return in some cases
There are some cases that there is nothing to do with
_pend_current_thread() return (that is _Swap return value).

As MISRA-C requires that all non-void functions have their
return value checked, we are explicitly ignoring it when there is
nothing to do.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2018-09-14 16:55:37 -04:00
Flavio Ceolin da49f2e440 coccicnelle: Ignore return of memset
The return of memset is never checked. This patch explicitly ignore
the return to avoid MISRA-C violations.

The only directory excluded directory was ext/* since it contains
only imported code.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2018-09-14 16:55:37 -04:00
Flavio Ceolin 5884c7f54b kernel: Explicitly ignoring _Swap return
Ignoring _Swap return where there is no treatment or nothing to do.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2018-09-14 16:55:37 -04:00
Flavio Ceolin 8a9ba10c2c kernel: swap: Fix __swap signature
__swap function was returning -EAGAIN in some case, though its return
value was declared as unsigned int.

This commit changes this function to return int since it can return a
negative value and its return was already been propagate as int.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2018-09-14 16:55:37 -04:00