Commit graph

41120 commits

Author SHA1 Message Date
Vincent Wan
1b263ba0a6 dts: specify cpu frequency for TI CC13X2/CC26X2
Add cpu clock frequency information to DTS so that it can be retrieved
in the code.

Signed-off-by: Vincent Wan <vincent.wan@linaro.org>
2019-11-07 15:55:21 -06:00
Wayne Ren
b1fbe85156 kernel: need to release spinlock before busy_wait
need to release spinlock first before busy_wait,
or other cores cannot get the spinlock when the holder is
busy waitting.

Signed-off-by: Wayne Ren <wei.ren@synopsys.com>
2019-11-07 16:54:56 -05:00
Henrik Brix Andersen
1266860dcf tests: drivers: eeprom: add tests for the EEPROM API
Add EEPROM API test suite.

The test suite is written to run in userspace but it is currently only
whitelisted for native_posix and native_posix_64 boards which do not
support userspace.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2019-11-07 16:32:15 -05:00
Henrik Brix Andersen
2b9d65f4ff tests: drivers: build_all: add EEPROM build configuration
Add Atmel AT2x driver to build_all build configuration.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2019-11-07 16:32:15 -05:00
Henrik Brix Andersen
4c9a1c59fe drivers: eeprom: add driver for Atmel AT24 I2C and AT25 SPI EEPROMs
Add driver for Atmel AT24 (and compatible) I2C along with Atmel AT25
(and compatible) SPI EEPROMs.

Tested with: AT24LC025, AT24C256, AT25AA02E48, and AT25080.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2019-11-07 16:32:15 -05:00
Henrik Brix Andersen
6e56feb2be boards: native_posix: add EEPROM device
Add a 32kB EEPROM device to the Zephyr native POSIX board for testing
purposes.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2019-11-07 16:32:15 -05:00
Henrik Brix Andersen
a54c945ddd drivers: eeprom: add driver for a zephyr native posix EEPROM
Add driver for emulating an EEPROM device using the native POSIX
board. The EEPROM is backed by a binary file in the host file system.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2019-11-07 16:32:15 -05:00
Henrik Brix Andersen
cd6739b9b2 dts: bindings: eeprom: add binding for zephyr native posix EEPROM
Add device tree binding for representing a Zephyr native POSIX EEPROM
device.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2019-11-07 16:32:15 -05:00
Henrik Brix Andersen
e72e4aa813 tests: board_shell: enabled EEPROM shell
Enable EEPROM shell commands in the board_shell test application.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2019-11-07 16:32:15 -05:00
Henrik Brix Andersen
4d4d4cd0b0 drivers: eeprom: add EEPROM shell commands
Add shell commands for reading from and writing to an EEPROM device.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2019-11-07 16:32:15 -05:00
Henrik Brix Andersen
546c3f2f21 drivers: i2c: eeprom_slave: update driver to match the new dts bindings
Update the I2C slave EEPROM driver to match the new atmel,at24 device
tree binding, where the size of the EEPROM is specified in bytes.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2019-11-07 16:32:15 -05:00
Henrik Brix Andersen
2375b10a7e tests: drivers: i2c_slave_api: update overlays to match new dts bindings
Update the board overlays used in the i2c_slave_api tests to match the
new device tree bindings for atmel,at24 I2C EEPROMs.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2019-11-07 16:32:15 -05:00
Henrik Brix Andersen
6d18f095d6 dts: bindings: eeprom: add EEPROM device tree bindings
Add device tree binding for Atmel AT25 (and compatible) SPI
EEPROMs. Update the curent Atmel AT24 I2C EEPROM binding to match.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2019-11-07 16:32:15 -05:00
Henrik Brix Andersen
a2a7b776cb drivers: eeprom: add API for EEPROM devices
Add API for accessing Electrically Erasable Programmable Read-Only
Memory (EEPROM) devices.

EEPROMs have an erase block size of 1 byte, a long lifetime, and allows
overwriting data on byte-by-byte access.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2019-11-07 16:32:15 -05:00
Peter A. Bigot
a58d8ebaa6 driver: uart: make deprecation effective
Several macros were documented as deprecated but lacked the
infrastructure to produce deprecation warnings.  Add the deprecation
marker, and fix the in-tree references to the deprecated spellings.

Note that one non-deprecated macro should have been deprecated, and
is, referring to a newly added line control bit.

Signed-off-by: Peter A. Bigot <pab@pabigot.com>
2019-11-07 12:44:15 -06:00
Peter Bigot
8e55968aba doc: correct path to boards/riscv
The board area was renamed from riscv32 to riscv back in July to
accommodate riscv64 support.  Fix the remaining references in
documentation.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2019-11-07 12:39:08 -06:00
Ioannis Glaropoulos
40fbff6c8f tests: kernel: mem_protect: run tests with ARMV8-M MPU gap filling
We add a new test-case for the mem_protect and userspace tests,
to test the ARMv8-M MPU driver without the skipping of full SRAM
partitioning (i.e. gap filling).

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2019-11-07 09:41:54 -08:00
Ioannis Glaropoulos
a1f5db0e0b arch: arm: mpu: allow optional region gap filling in the ARMv8-M MPU
We allow the run-time, full paritioning of the SRAM space by the
ARMv8-M MPU driver to be an optional feature.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2019-11-07 09:41:54 -08:00
Ioannis Glaropoulos
f103c68699 arch: arm: mpu: move mpu_configure_regions(.) in arm_mpu.c
This commit moves the function mpu_configure_regions(.) from
arm_mpu_v7_internal.h to arm_mpu.c. The function is to be used
by the both ARMv7-M MPU driver, as well as the ARMv8-M MPU
driver (when it behaves like the ARMv7-M driver).

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2019-11-07 09:41:54 -08:00
Ioannis Glaropoulos
6d789510a5 arch: arm: mpu: introduce option to skip background MPU region fill
We introduce MPU_GAP_FILLING Kconfig option that instructs
the MPU driver to enforce a full SRAM partitioning, when it
programs the dynamic MPU regions (user thread stack, PRIV stack
guard and application memory domains) at context-switch. We
allow this to be configurable, in order to increase the number
of MPU regions available for application memory domain programming.

This option is introduced in arch/Kconfig, as it is expected
to serve as a cross-ARCH symbol. The option can be set by the
user during build configuration.

By not enforcing full partition, we may leave part of kernel
SRAM area covered only by the default ARM memory map. This
is fine for User Mode, since the background ARM map does not
allow nPRIV access at all. The difference is that kernel code
will be able to attempt fetching instructions from kernel SRAM
area without this leading directly to a MemManage exception.

Since this does not compromize User Mode, we make the skipping
of full partitioning the default behavior for the ARMv8-M MPU
driver. The application developer may be able to overwrite this.

In the wake of this change we update the macro definitions in
arm_core_mpu_dev.h that derive the maximum number of MPU regions
for application memory domains.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2019-11-07 09:41:54 -08:00
Trond Einar Snekvik
0151d6dc33 Bluetooth: Mesh: Model extension concept
Adds the model extension concept to the access layer, as described in
the Mesh Profile Specification, Section 2.3.6. Extensions are
implemented as a tree, using two pointers in each model:

The extends pointer points to the first extended model, and the next
pointer points to the next sibling or (if the NEXT_IS_PARENT flag is
set) the parent model in the tree, forming a cyclical "Left-child
right-sibling" (LCRS) tree. The tree root can be obtained by calling
bt_mesh_model_root_get(), and the extended models can be walked by
calling bt_mesh_model_tree_walk().

According to the Mesh Profile Specification Section 4.2.3, all models in
the same extension tree share one subscription list per element. This is
implemented by walking the model's extension tree, and pooling the
subscription lists of all models in the same element into one. If the
config server adds a subscription to a model, it may be stored in any of
the model tree's models' subscription lists. No two models in the same
extension tree and element will have duplicate groups listed. This
allows us to increase extended models' capacity for subscriptions
significantly.

Signed-off-by: Trond Einar Snekvik <Trond.Einar.Snekvik@nordicsemi.no>
2019-11-07 18:57:32 +02:00
Andrew Boie
0b27cacabd x86: up-level page fault handling
Now in common code for 32-bit and 64-bit.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2019-11-07 11:19:38 -05:00
Stephanos Ioannidis
d927018282 cmake: Use zephyr_link_libraries in toolchain_ld_cpp.
The toolchain_ld_cpp macro currently uses zephyr_ld_options function
to link libstdc++, instead of zephyr_link_libraries which is actually
intended for this purpose.

This commit replaces the usage of zephyr_ld_options with
zephyr_link_libraries as the former may erroneously filter out
-lstdc++ and the latter ensures that this linker flag is
unconditionally forwarded to the linker.

For more details, refer to the issue #20406.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2019-11-07 16:37:50 +01:00
Andrzej Głąbek
51d055c520 drivers: pwm_nrfx: Fix the driver to allow changing period on the fly
Previously it was not possible to change the PWM period, even if only
a single channel was in use, without first stopping the peripheral,
i.e. setting pulse cycles for the channel to 0. This patch corrects
this behavior.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2019-11-07 16:14:29 +01:00
Jacob Siverskog
eb4679d0c4 uart: Improve line control documentation
Minor improvements to UART line control documentation.

Signed-off-by: Jacob Siverskog <jacob@teenage.engineering>
2019-11-07 15:54:40 +01:00
Kumar Gala
324f5749dc doc: dt: Add note about deprecation of generated_dts_board.conf
Note that generated_dts_board.conf is now deprecated and that users
should utilize functions to access DT related information that was
coming from generated_dts_board.conf.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-11-07 08:47:35 -06:00
Kumar Gala
7573e048ca cmake: dts: Drop loading symbols from generated_dts_board.conf
Now that DT symbols from generated_dts_board.conf are deprecated remove
loading symbols from it.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-11-07 08:43:16 -06:00
Kumar Gala
9da1d41a12 scripts: runners: Drop loading symbols from generated_dts_board.conf
Now that DT symbols from generated_dts_board.conf are deprecated remove
loading symbols from it.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-11-07 08:43:16 -06:00
Ulf Magnusson
f4296a03ca kconfig: Update Kconfiglib and use new helpers in kconfig.py
Update Kconfiglib, menuconfig, and guiconfig to upstream revision
faa1d21998, mostly to get this commit in:

    Add public helpers for generating "<name> (defined at ...)" strings

    Have Symbol/Choice.name_and_loc return strings like

        "MY_SYM (defined at foo:1, bar:2)"
        "<choice> (defined at foo:4)"

    I've added a function like that in at least four different scripts
    now, so that's probably a sign that it's a worthwhile helper.

    Clean up the tests/Klocation tests a bit while adding tests.

Use the new helper to simplify kconfig.py a bit. Also clean it up a bit
by removing some unused stuff.

Some other minor improvements are included as well, e.g. to make
menuconfig/guiconfig give more helpful errors on invalid arguments.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-11-07 15:34:09 +01:00
Ulf Magnusson
a328c5190d kconfig: Add linting script
Add a cleaned-up version of a script I used to find a bunch of unused
symbols and some other Kconfig issues. It's set up to be run directly,
with few environment dependencies.

West is required, because the checks need to see Kconfig files and
source code from all modules.

Checks so far:

 - Symbols that can never be anything but n/empty

 - Symbols that look unused

 - menuconfig symbols with empty menus

 - Symbols only defined in Kconfig.defconfig files

See the help strings for the command-line flags for more information.

Some of these checks could probably be checked in CI later, though the
always-n and unused-symbol checks are a bit heuristic and might need a
lot of whitelisting.

Another reason I want to get this in is to have a clean standalone
reference for how to set up the environment for parsing the Kconfig
files. It's gotten trickier over time.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-11-07 15:32:50 +01:00
Jukka Rissanen
e7be6e12d4 drivers: eth: enc424j600: Set carrier status by link up/down
Set the network interface up / down according to link status.
This means that we call Ethernet carrier on/off function in
proper places.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-11-07 14:50:52 +01:00
Carlo Caione
0650d40d83 kernel: include: Fix warning when !CONFIG_SYS_CLOCK_EXISTS
When the kernel is compiled with !CONFIG_SYS_CLOCK_EXISTS we get the
warning:

 cast to pointer from integer of different size [-Wint-to-pointer-cast]

Fix this avoiding the (void *) cast.

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
2019-11-07 08:22:59 -05:00
François Delawarde
129e05c03f bluetooth: host: fix missing log_strdup
Fix missing log_strdup when loading bt/name setting. It should be done
on every string which is not in read only memory.

Signed-off-by: François Delawarde <fnde@oticon.com>
2019-11-07 12:49:34 +02:00
Erwan Gouriou
eaa6058ebd boards: nucleo_wb55rg: Update doc with BLE support
BLE was missing as supported feature.


Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2019-11-07 02:42:24 -06:00
Benjamin Valentin
7e722564df soc: atmel_sam0: Add SAME53
This adds supoprt for the Atmel SAME53 SoC.

The SAME5x/SAMD5x is a line of Cortex-M4F MCUs that share peripherals
with the sam0 Cortex-M0+ and saml1x Cortex-M23 parts.

Signed-off-by: Benjamin Valentin <benpicco@googlemail.com>
2019-11-06 21:18:00 -06:00
Benjamin Valentin
de6bc41430 soc: atmel_sam0: Add SAME51
This adds supoprt for the Atmel SAME51 SoC.

The SAME5x/SAMD5x is a line of Cortex-M4F MCUs that share peripherals
with the sam0 Cortex-M0+ and saml1x Cortex-M23 parts.

Signed-off-by: Benjamin Valentin <benpicco@googlemail.com>
2019-11-06 21:18:00 -06:00
Benjamin Valentin
f8b8545931 soc: atmel_sam0: Add SAMD51
This adds supoprt for the Atmel SAMD51 SoC.

The SAME5x/SAMD5x is a line of Cortex-M4F MCUs that share peripherals
with the sam0 Cortex-M0+ and saml1x Cortex-M23 parts.

Signed-off-by: Benjamin Valentin <benjamin.valentin@ml-pa.com>
2019-11-06 21:18:00 -06:00
Benjamin Valentin
4cfd0fd1d0 soc: sam0: Add SERCOM fixup for samd5x
The SERCOMS on SAMD5x/SAME5x are connected to different MCLK
APBMASKs. There is no systematic way to tell whether a SERCOM
is connected to APBA, APBB, APBC or APBD, so rely on the
information from ASF instead of replicating it elsewhere.

This is needed for SPI, I2C and UART support on the SAMD5x/SAME5x
platform.

Signed-off-by: Benjamin Valentin <benjamin.valentin@ml-pa.com>
2019-11-06 21:18:00 -06:00
Benjamin Valentin
496ace1500 soc: atmel_sam0: Add SAME54
This adds supoprt for the Atmel SAME54 SoC.

The SAME5x/SAMD5x is a line of Cortex-M4F MCUs that share peripherals
with the sam0 Cortex-M0+ and saml1x Cortex-M23 parts.

Signed-off-by: Benjamin Valentin <benjamin.valentin@ml-pa.com>
2019-11-06 21:18:00 -06:00
Benjamin Valentin
aa45d7ad77 west.yml: update hal_atmel for SAMD5x/SAME5x
Update hal_atmel to include vendor files for SAMD5x/SAME5x.

Signed-off-by: Benjamin Valentin <benjamin.valentin@ml-pa.com>
2019-11-06 21:18:00 -06:00
Andrew Boie
91468b5a04 kernel: fatal: show faulting CPU
Doing this in common code since we have an API for it.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2019-11-06 18:11:09 -08:00
Andrew Boie
7d1ae023f8 x86: enable stack overflow detection on 64-bit
CONFIG_HW_STACK_PROTECTION is now available.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2019-11-06 17:50:34 -08:00
Andrew Boie
9fb89ccf32 x86: consolidate some fatal error code
Some code for unwinding stacks and z_x86_fatal_error()
now in a common C file, suitable for both modes.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2019-11-06 17:50:34 -08:00
Andrew Boie
64f6e2ac6b x86: consolidate STACK_ROUND_* definition
There was no definition for 64-bit.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2019-11-06 17:50:34 -08:00
Andrew Boie
ec3aafbf78 printk: print pointers on 64-bit properly
Needs a min-width of 16, not 8, for 64-bit.
Some indentation oddities fixed.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2019-11-06 17:50:34 -08:00
Andrew Boie
65e17a923f x86: fix z_x86_page_tables_get() for 64-bit
Needs a different assembly instruction.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2019-11-06 17:50:34 -08:00
Andrew Boie
a9e0d14c57 x86: unify stack macro definitions
Introduce a new header thread_stack.h which does the
right thing for both 32-bit and 64-bit x86.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2019-11-06 17:50:34 -08:00
Benjamin Valentin
10a1b25da6 interrupt_controller: sam0: Add support for SAME54
The EIC/PORT peripheral works very much alike the one in
previous sam0 parts.

Signed-off-by: Benjamin Valentin <benpicco@googlemail.com>
2019-11-06 17:49:28 -08:00
Benjamin Valentin
224174bc99 gpio: sam0: provide PORT_PMUX_PMUXE_A_Val define
SAMD5x/SAME5x header files do not provide this define anymore.
On SAMD2x it was 0, this is still valid.

Signed-off-by: Benjamin Valentin <benpicco@googlemail.com>
2019-11-06 17:49:28 -08:00
Benjamin Valentin
3d11666c4e pinmux: sam0: Add support for PORTD
Some devices like SAME54 have an additional GPIO port.

Signed-off-by: Benjamin Valentin <benjamin.valentin@ml-pa.com>
2019-11-06 17:49:28 -08:00