Commit Graph

49114 Commits

Author SHA1 Message Date
Kumar Gala 686968b16a dts: arm: nxp: lpc: Add dts nodes for IOCON
Add binding and dts nodes for the IOCON and IOCON ports on the LPC
family of SoCs.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2021-03-01 12:04:53 -06:00
Martí Bolívar 01bb08e7d8 samples: switch nrf overlays to sda-gpios, scl-gpios
I only see one sample with an overlay using the now legacy sda-pin and
scl-pin properties. Move it to the new style.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2021-03-01 16:59:56 +01:00
Martí Bolívar 840ba45c74 samples: ccs811: fix nrf51_ble400.overlay whitespace
Use tabs.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2021-03-01 16:59:56 +01:00
Martí Bolívar 17a66304c4 boards: nrf: switch to sda-gpios, scl-gpios
Move the BOARD.dts files for Nordic-based boards to use the new I2C
devicetree properties for specifying the SDA and SCL pins.

This was done with a script.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2021-03-01 16:59:56 +01:00
Martí Bolívar 821c03a14a i2c: nordic: switch to phandle arrays for pinmux
Deprecate the scl-pin and sda-pin properties in the devicetree.
Provide new scl-gpios and sda-gpios properties instead.

This lets the user specify SCL and SDA like this:

   &i2c0 {
         scl-gpios = <&gpio0 1 0>;
         sda-gpios = <&gpio1 4 0>;
   };

Instead of having to use:

   &i2c0 {
         scl-pin = <1>;
         sda-pin = <36>;
   };

Provide error checking and understandable error messages for invalid
configurations.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2021-03-01 16:59:56 +01:00
Martí Bolívar f7aeb2ae4b soc: nrf: add more DT GPIO helper macros
Add some helper macros that will be convenient to use from device
drivers for accessing and error checking pin mux information in the
devicetree:

- NRF_DT_PSEL(): get a PSEL value out of the DT from either a
  'foo-pin' or a 'foo-gpios' style property.

- NRF_DT_PSEL_CHECK_NOT_BOTH(), NRF_DT_PSEL_CHECK_EXACTLY_ONE():
  helpers for checking that a given devicetree is OK according to
  different criteria for setting PSEL properties (NAND or XOR on
  whether the properties exist, respectively).

See comments in the patch for more details.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2021-03-01 16:59:56 +01:00
Ioannis Glaropoulos a6d1754aef tests: kernel: fatal: add missing CONFIG_TEST=y in test suite
Enable CONFIG_TEST in the message_capture test suite.
This allows certain Kconfig configurations, depending
on TEST, to be enabled.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2021-03-01 15:55:10 +01:00
Jakub Rzeszutko 6675f476a4 doc: shell update with getopt
Update of the shell documentation with getopt feature.

Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@nordicsemi.no>
2021-03-01 09:50:32 -05:00
Jakub Rzeszutko 99d064e881 shell: sample: add getopt
Modify an example by adding command that is using shell_getopt funtion.
Extent sample.yaml with getopt configuration.

Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@nordicsemi.no>
2021-03-01 09:50:32 -05:00
Jakub Rzeszutko 7e46765153 shell: add getopt library support
This functionality is is enabled by setting CONFIG_SHELL_GETOPT.
It is not active by default.

User can call following functions inside command handlers:
 - shell_getopt - getopt function based on freebsd implementation
 - shell_getopt_status_get - returns getopt status

Beware when getopt functionality is enabled shell will not parse
command handler to look for "-h" or "--help" options and print
help message automatically.

Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@nordicsemi.no>
2021-03-01 09:50:32 -05:00
Jakub Rzeszutko 74ebf5dba2 codeowners: add getopt library
Add owner for newly created getopt library.
Extend ownership of fnmatch library.

Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@nordicsemi.no>
2021-03-01 09:50:32 -05:00
Jakub Rzeszutko ddb07f57ec lib: add freebsd getopt library
This library is going to be used by the shell module. Some shell users
are not satisfied with subcommands alone and need to use the options
for commands as well.

Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@nordicsemi.no>
2021-03-01 09:50:32 -05:00
Jakub Rzeszutko 72dd5a5c68 lib: move fnmatch to lib/util
We expect to have more libraries with incopatible license. There must
be a common place for such software. It seems that lib/util is good
place for that.

Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@nordicsemi.no>
2021-03-01 09:50:32 -05:00
Jakub Rzeszutko b64fb7c92d shell: make detecting help option optional
Shell will not "steal" by default "-h" and "--help" each time
help functions are enabled.
This change is necessary to implement and use the getopt library.

Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@nordicsemi.no>
2021-03-01 09:50:32 -05:00
Jacob Siverskog c2afabcc7c usb: mass storage: add missing prompt to Kconfig
thread stack size was missing input prompt.

Signed-off-by: Jacob Siverskog <jacob@teenage.engineering>
2021-03-01 09:27:57 -05:00
Carlo Caione eb72b2d72a aarch64: smccc: Retrieve up to 8 64-bit values
The most common secure monitor firmware in the ARM world is TF-A. The
current release allows up to 8 64-bit values to be returned from a
SMC64 call from AArch64 state.

Extend the number of possible return values from 4 to 8.

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
2021-03-01 09:26:56 -05:00
Carlo Caione bc7cb75a82 aarch64: smccc: Use offset macros
Instead of relying on hardcoded offset in the assembly code, introduce
the offset macros to make the code more clear.

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
2021-03-01 09:26:56 -05:00
Carlo Caione 998856bacb aarch64: smccc: Update specs link
The link points to an outdated version. Update it.

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
2021-03-01 09:26:56 -05:00
Carlo Caione 90859c6bf3 aarch64: smccc: Decouple PSCI from SMCCC
The current code is assuming that the SMC/HVC helpers can only be used
by the PSCI driver. This is wrong because a mechanism to call into the
secure monitor should be made available regardless of using PSCI or not.

For example several SoCs relies on SMC calls to read/write e-fuses,
retrieve the chip ID, control power domains, etc...

This patch introduces a new CONFIG_HAS_ARM_SMCCC symbol to enable the
SMC/HVC helpers support and export that to drivers that require it.

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
2021-03-01 09:26:56 -05:00
Carlo Caione 6ff37886dd aarch64: mem_domain: Introduce k_mem_partition_attr_t
Introduce the kernel macros for memory attribution also for AArch64.

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
2021-03-01 09:25:44 -05:00
Jukka Rissanen 9df116ed0f net: utils: Check null pointer in net_sprint_ll_addr_buf()
Check NULL value when we are trying to print link address
because the link address can be null.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2021-03-01 14:23:30 +02:00
Jukka Rissanen b86b778ca5 net: utils: net_pkt_hexdump() was missing log_strdup()
As the input string can be allocated from stack, we need to use
log_strdup() in net_pkt_hexdump() to print the extra string.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2021-03-01 14:23:30 +02:00
Bob Recny 56541268f4 board: arm: add ubx_bmd380eval_nrf52840
Changed document images to smaller versions

Signed-off-by: Bob Recny <bob.recny@u-blox.com>
2021-03-01 14:35:03 +03:00
Ioannis Glaropoulos 1d55f94a32 testsuite: only enable TEST_ARM_CORTEX_M when building tests
Add a dependency on TEST_ARM_CORTEX_M switch, so it
only gets switched on when building tests, not samples,
as originally intended.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2021-03-01 14:33:26 +03:00
Vinayak Kariappa Chettimada f9511079b2 Bluetooth: controller: Remove vendor specific internal LLL include
Remove inclusion of vendor specific internal LLL include
files in ULL source code.

Prefix `lll/` include file path to correctly include vendor
defined types and function implementation.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-03-01 11:24:40 +01:00
Kumar Gala 3b8ea186fd spi: mcux flexcomm: Convert dma to use DEVICE_DT_GET
Replace device_get_binding with DEVICE_DT_GET for getting access
to the dma controller device.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2021-02-28 18:19:18 -06:00
Krzysztof Chruscinski b4da16e81c logging: Refactor msg_finalize
Extract notifying about new log message into separate function.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2021-02-28 17:12:29 -05:00
Krzysztof Chruscinski e0392c5a86 logging: Cleaning up log minimal
Removed printk.h include from log_core.h.

Since LOG_PRINTK cannot be enabled with LOG_MINIMAL removed
support for both.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2021-02-28 17:12:29 -05:00
Kumar Gala 5b6de52a71 device.h: Add macro API to get a devicename from a devicetree node
We default to use the "label" properties of a devicetree node as the
name if it exists.  If the "label" does not exist we than use the
node-name@unit-address for the node as the name.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2021-02-28 17:12:04 -05:00
Kumar Gala 1da16553fb dts: stm32: Add exti nodes to stm32 wl series
The STM32 WL dts is missing the exti node.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2021-02-28 17:12:04 -05:00
Ioannis Glaropoulos ae505e97bd tests: thread: thread_api: fix to allow test to run for non-secure
Allow the test to run for non-secure firmware builds, by
removing the test-case for nonsense string, as this test-case
will likely produce a secure fault which will crash the kernel.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2021-02-28 16:50:47 -05:00
Johann Fischer 7cd92dd40a doc: release-notes-2.6: add note about USB HID macros deprecation
Add note about USB HID macros deprecation.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2021-02-28 16:50:24 -05:00
Johann Fischer 6568f4ab99 usb: hid: remove usb_hid_descriptor from public header
usb_hid_descriptor struct is only used internally and
is not intended to be used by the USB HID device application.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2021-02-28 16:50:24 -05:00
Johann Fischer 9f3b60ab60 samples: intel_s1000_crb: replace deprecated HID macros
Replace deprecated HID macros.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2021-02-28 16:50:24 -05:00
Johann Fischer 65678bb1d4 samples: hid: convert to use new common HID macros
Convert to use new common HID macros.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2021-02-28 16:50:24 -05:00
Johann Fischer 879a5cfe48 usb: hid: replace deprecated macros
Replace deprecated macros.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2021-02-28 16:50:24 -05:00
Johann Fischer c186e8f3f6 doc: usb: add initial USB HID documentation
Add initial USB HID documentation.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2021-02-28 16:50:24 -05:00
Johann Fischer 374978cba1 doc: usb: move API description to related chapters
Move API description to related chapters.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2021-02-28 16:50:24 -05:00
Johann Fischer 5840b76e1e include: usb: add common HID definitions header
Add common HID definitions header and move common macros
from USB HID header to common HID header.
The header can thus be used by Bluetooth HID profile or
others independently of USB subsystem.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2021-02-28 16:50:24 -05:00
Ioannis Glaropoulos ec1bce58d1 tests: kernel: interrupt: do not run for Cortex-M Non-Secure mode
tests/kernel/interrupt tests interrupt trigger functionality,
however, the Non-Secure Cortex-M mode does not have full control
of the interrupt handling, so this test cannot be guaranteed to
pass when executing in Non-Secure mode. Filter the test out for
Non-Secure Cortex-M builds.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2021-02-28 16:49:54 -05:00
Ioannis Glaropoulos 038de00d61 tests: kernel: device: adaptation for the test to run in Non-Secure mode
Exclude the test_null_dynamic_name test-suite from running the
test, in Non-Secure mode (Cortex-M), because passing a NULL
device name de-references memory at 0x0 which is likely to
cause a SecureFault and crash the kernel.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2021-02-28 16:49:54 -05:00
Nicolas Pitre 443e3f519e arm64: mmu: initialize early
This is fundamental enough that it better be initialized ASAP.
Many other things get initialized soon afterwards assuming the MMU
is already operational.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2021-02-28 16:49:12 -05:00
Nicolas Pitre 9461600c86 aarch64: mmu: rationalize debugging output
Make it into a generic call that can be used in various places.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2021-02-28 16:49:12 -05:00
Nicolas Pitre b40a2fdb8b aarch64: mmu: fix common MMU mapping
Location of __kernel_ram_start is too far and _app_smem .bss areas
are not covered. Use _image_ram_start instead.

Location of __kernel_ram_end is also way too far. We should stop at
_image_ram_end where the expected unmapped area starts.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2021-02-28 16:49:12 -05:00
Nicolas Pitre fb3de16f0c aarch64: mmu: use a range (start..end) for common MMU mapping
This is easier to cover multiple segments this way. Especially since
not all boundary symbols from the linker script come with a size
derrivative.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2021-02-28 16:49:12 -05:00
Nicolas Pitre cb49e4b789 aarch64: mmu: invert the MT_OVERWRITE flag
The MT_OVERWRITE case is much more common. Redefine that flag as
MT_NO_OVERWRITE instead for those fewer cases where it is needed.

One such case is platform provided mappings. Apply them after the
common kernel mappings and use the MT_NO_OVERWRITE on them.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2021-02-28 16:49:12 -05:00
Nicolas Pitre 56c77118d3 aarch64: mmu: factor out the phys argument out of set_mapping()
Minor cleanup.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2021-02-28 16:49:12 -05:00
Nicolas Pitre f53bd24a4d aarch64: mmu: move get_region_desc() closer to usage points
Simple code tidiness.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2021-02-28 16:49:12 -05:00
Nicolas Pitre b696090bb7 aarch64: mmu: make page table pool global
There is no real reason for keeping page tables into separate pools.
Make it global which allows for more efficient memory usage and
simplifies the code.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2021-02-28 16:49:12 -05:00
Nicolas Pitre 459bfed9ea aarch64: mmu: dynamic mapping support
Introduce a remove_map() to ... remove a mapping.

Add a use count to the page table pool so pages can be dynamically
allocated, deallocated and reused.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2021-02-28 16:49:12 -05:00