Commit graph

97877 commits

Author SHA1 Message Date
Andrew Boie c8188f6722 userspace: add functions for copying to/from user
We now have functions for handling all the details of copying
data to/from user mode, including C strings and copying data
into resource pool allocations.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2018-07-31 07:47:15 -07:00
Andrew Boie b1dec2992e arc: add z_arch_user_string_nlen
Safely measure the length of a potentially dubious string.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2018-07-31 07:47:15 -07:00
Andrew Boie 3cef6deb16 arm: add z_arch_user_string_nlen
Uses fixup infrastructure to safely abort if we get an MPU
fault when examining a string passed in from user mode.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2018-07-31 07:47:15 -07:00
Andrew Boie 9d3cdb3568 x86: add z_arch_user_string_nlen
Uses fixup infrastructure to safely abort if we get a page
fault while measuring a string passed in from user mode.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2018-07-31 07:47:15 -07:00
Andrew Boie 1f2eedff18 kernel: add z_arch_user_string_nlen prototype
This is used to measure the length of potentially unsafe
strings.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2018-07-31 07:47:15 -07:00
Andrew Boie 3369a5ed07 arch: introduce exc_handle.h
Defines some common macros and data structures for declaring
text section ranges with fixup handler addresses if an
exception occurs.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2018-07-31 07:47:15 -07:00
Erwan Gouriou a10d178078 drivers/pinmux: stm32 fix ports_enable array definition
ports_enable array holds port clock information.
It is populated for all SoCs, but ports availability depends on
SoCs. The way it is defined today, location of the port in the
array depends on previous ports definition in SoC CMSIS files.
Though, port index is always the same irrespective of previous
ports availability in the SoC.
This will result in incoherency between port index and clock
information.
Fix this by setting a bogus value if port is not defined.
Return an error if bogus value is read.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2018-07-31 09:45:39 -05:00
Lars Knudsen 70a35e2346 samples: sensors: mma8451q: Add accelerometer sample
Prints accelerometer data from MMA8451Q every 500ms

Signed-off-by: Lars Knudsen <larsgk@gmail.com>
2018-07-31 09:07:54 -05:00
Lars Knudsen ee7f834e00 boards: frdm_kl25z: Add mma8451q to i2c in dts
Adding MMA8451Q to i2c0 on FRDM-KL25Z

Signed-off-by: Lars Knudsen <larsgk@gmail.com>
2018-07-31 09:07:54 -05:00
Lars Knudsen 9c0d7813e5 drivers: sensor: Add support for MMA8451Q (3-axis accelerometer)
Only basic features supported initially but more could be added from:
https://www.nxp.com/docs/en/data-sheet/MMA8451Q.pdf

fixes #9006

A sample app will be provided in a separate PR.

Signed-off-by: Lars Knudsen <larsgk@gmail.com>
2018-07-31 09:07:54 -05:00
Jukka Rissanen fd1fec8ad6 samples: net: IPv4 autoconf sample application
Adding IPv4 autoconf sample application that can be used to
test IPv4 autoconf functionality.

Signed-off-by: Matthias Boesl <matthias.boesl@gmail.com>
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-07-31 16:34:28 +03:00
Jukka Rissanen 00e37cbb5b net: IPv4 link local support
Add basic IPv4 Link Local support as described in RFC 3927.

Signed-off-by: Matthias Boesl <matthias.boesl@gmail.com>
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-07-31 16:34:28 +03:00
Maureen Helm 45f34a4313 tests: flash_map: Add k64-based boards to platform whitelist
Adds the frdm-k64f and hexiwear_k64 boards to the platform whitelist.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2018-07-31 08:44:45 -04:00
Maureen Helm 08470c0f7f tests: flash_map: Don't enable stdout console
This was causing a stack overflow on the frdm_k64f platform.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2018-07-31 08:44:45 -04:00
Maureen Helm 08db8c19a3 tests: flash_map: Enable mpu and allow flash write
It shouldn't be necessary to disable the mpu for this test. Enable
CONFIG_MPU_ALLOW_FLASH_WRITE=y instead.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2018-07-31 08:44:45 -04:00
Maureen Helm f16a7ea836 tests: flash_map: Disable write protection before erase
The flash API requires write protection to be disabled before erasing
the flash. It appears that the nordic platforms for which this test was
originally implemented do not enforce the requirement to disable write
protection. The mcux flash driver, however, does enforce the
requirement, so fix the test to make it work on kinetis platforms.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2018-07-31 08:44:45 -04:00
Ulf Magnusson b3d165f3c2 scripts: kconfig: Handle warnings generated during evaluation
Warnings generated during symbol evaluation were accidentally ignored,
due to checking for warnings before writing .config and autoconf.h
(which indirectly evaluates all symbols).

Move the warning checking code to after writing the configuration to
catch such warnings. kconfig.py still gets rerun if any
warnings-turned-errors show up.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2018-07-31 08:26:28 -04:00
Ulf Magnusson 642db77591 bluetooth: kconfig: Fix swapped 'range's on BT_RFCOMM_L2CAP_MTU
Whoever added Zephyr's prefer-later-defaults Kconfig patch originally
didn't do the same for 'range's. Earlier ranges are still preferred.
Swap the ranges on BT_RFCOMM_L2CAP_MTU to give the intended behavior.

Fixes the following warning for tests/bluetooth/shell/prj_br.conf:

  warning: default value 200 on BT_RFCOMM_L2CAP_MTU (defined at
  subsys/bluetooth/host/Kconfig:508) clamped to 264 due to being outside
  the active range ([264, 32767])

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2018-07-31 08:26:28 -04:00
Johan Hedberg db0e4d5267 Bluetooth: Kconfig: Enable TINYCRYPT_ECC for combined builds
Essentially all products that support pairing or Mesh need to be able
to support ECC. This is particularly important for traditional
peripheral/central use cases where legacy pairing is considered
insecure. With split builds we don't know if the controller supports
ECC HCI commands or not, however with a combined build we know that
the current controller lacks any special ECC support, so enable
TINYCRYPT_ECC by default for such a configuration.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2018-07-31 13:55:40 +03:00
Johan Hedberg c761002e30 samples: net/mqtt_publisher: Explicitly disable BT_TINYCRYPT_ECC
This app will not fit in the 96b_nitrogen board with ECC enabled.
"real-ld: region `SRAM' overflowed by 68 bytes". Disable the feature
explicitly since a subsequent patch will auto-enable it for all
combined Bluetooth Host-Controller builds.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2018-07-31 13:55:40 +03:00
Robert Lubos 80e828b983 net: openthread: Don't regsiter mcast addresses in Zephyr multiple times
OpenThread L2 could've called multicast address registration multiple
times for specific address, which resulted in having multiple entries
containing the same multicast IPv6 address in Zephyr.
Checking if address was already registered prevents that.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2018-07-31 11:13:04 +03:00
Robert Lubos 96e794e6b7 net: openthread: Register OT unicast adresses in Zephyr
Register all OpenThread unicast adresses in Zephyr, not only multicast
adresses.

Fixes #9160

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2018-07-31 11:13:04 +03:00
Robert Lubos 9f817c8c1c samples: net: Allow to register more adresses for OpenThread
Thread registers multiple unicast and multicast adresses by default. As
they are exchanged with Zephyr interface, we need enough buffers to
store them all.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2018-07-31 11:13:04 +03:00
Tomasz Gorochowik 1b6e5f6143 drivers: eth: gmac: Enable 802.1Qav support
This commit makes the driver enable HW Qav support for all available
priority queues.

Note that the hardware doesn't support setting the deltaBandwidth
parameter directly, but it is possible to do this by calculating it
from the negotiated link speed.

The default settings are set according to 802.1Qav 34.3.1, that says:

  The recommended default value of deltaBandwidth(N) for the highest
  numbered traffic class supported is 75%, and for any lower
  numbered traffic classes, the recommended default value is 0%.

The default/recommended values can be changed using the ethernet
management API (set_config) - which this commit also adds.

Signed-off-by: Tomasz Gorochowik <tgorochowik@antmicro.com>
2018-07-31 10:25:19 +03:00
Tomasz Gorochowik abd417c078 drivers: eth: gmac: Implement the get_config callback
Handle getting the number of priority queues. The total number of queues
for this driver is configured in kconfig so it is as simple as returning
a defined value in this case.

Signed-off-by: Tomasz Gorochowik <tgorochowik@antmicro.com>
2018-07-31 10:25:19 +03:00
Jukka Rissanen 39ec52d2f1 drivers: eth: native_posix: Make sure sent pkt is freed properly
Follow the packet sending error code in the driver. If packet
cannot be sent, then return <0 to the caller and do not free
the packet. In practice this is not happening here but follow
this general rule anyway.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-07-31 10:03:46 +03:00
Alberto Escolar Piedras 55f6620c3e native_posix: Refactor cmd line options
For each driver/model with command line options.
Move its code for the board file into the driver/model file.

Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
2018-07-30 22:13:46 -04:00
Alberto Escolar Piedras f742d0e2a2 native: Allow cmd line options to be registered dynamically
Allow command line arguments to be registered dynamically
instead of being statically defined.

Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
2018-07-30 22:13:46 -04:00
Alberto Escolar Piedras 550225b668 native: Generalize native tasks
Some drivers or tests need to execute some code before Zephyr is
booted, dynamically register command line arguments, etc.

For this purpose, we generalize the NATIVE_EXIT_TASK to also
provide hooks to run a function at a given point during the startup
of native_posix.

Also, test/boards/native_posix/exit_tasks is generalized to cover
this new functionality.

Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
2018-07-30 22:13:46 -04:00
Marti Bolivar 94be858f31 scripts: west: sync with upstream
This brings in content from commits in the upstream West
repository. Since both the version here and upstream have diverged,
this synchronizes them again.

Signed-off-by: Marti Bolivar <marti@foundries.io>
2018-07-30 17:56:21 -04:00
Spoorthi K 07a8c0cf84 tests: kernel: Add test to verify k_thread_user_mode_enter()
Test to verify k_thread_user_mode_enter() when usermode is
not enabled or supported by architecture. The thread which calls
k_thread_user_mode_enter() with CONFIG_USERSPACE disabled or
architecture doesn't support usermode, should be marked
as usermode and if it is essential, then it has to be cleared.
This is added to improve code coverage.

Signed-off-by: Spoorthi K <spoorthi.k@intel.com>
2018-07-30 14:20:09 -07:00
Anas Nashif 9930633454 kconfig: remove whitelisting for ARC_INIT
ARC_INIT was whitelisted in kconfig, removing now that the issue is
fixed.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-07-30 15:17:51 -04:00
Anas Nashif 87de383c66 tests: CONFIG_ARC_INIT is n by default
CONFIG_ARC_INIT is set to 'n' by default, no need to set this in the
prj.conf.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-07-30 15:17:51 -04:00
Anas Nashif 00dd90efc7 samples: ipm: improve sample metadata
Improve meta-data and whitelist for Quark SE c1000 only.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-07-30 15:17:51 -04:00
Nathaniel Graff 15516ed0ef linker: riscv: Relocate .eh_frame symbol
The .eh_frame symbol was causing __data_rom_start to contain the wrong
offset into the ROM, resulting in corrupt data copied into RAM by
_data_copy(). Fix by placing the .eh_frame in the .text section as is
done in include/arch/x86/linker.ld

Signed-off-by: Nathaniel Graff <nathaniel.graff@sifive.com>
2018-07-30 13:38:31 -05:00
Armando Visconti aa609faab3 samples: board: 96b_argonkey: remove led blinking
The LED part is taking too much time. Let's skip the
led blinking part.

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2018-07-30 09:20:00 -05:00
Jukka Rissanen 21a27e8807 net: l2: Move individual L2 to dedicated directories
No need to keep technologies in main L2 directory so for consistency
create a directory for each of them and place each L2 component to
relevant L2 directory.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-07-30 09:02:02 -04:00
Praful Swarnakar d05bee87e2 tests: kernel: profiling: Add description and doxygen group
Add doxygen group, test description and RTM links for
Profiling test cases.

Signed-off-by: Praful Swarnakar <praful.swarnakar@intel.com>
2018-07-30 08:46:24 -04:00
Tomasz Bursztyka 2c1863ff4c net/ethernet: Add a way to configure MAC address filters into devices
Some Ethernet devices can filter out incoming packets through a list of
valid MAC addresses, so let's add a way to expose this capability, using
it through the ethernet device API.

Fixes #7596

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2018-07-30 08:28:38 -04:00
Johan Hedberg 4fe8eddd27 Bluetooth: SMP: Don't return STK if it hasn't been generated yet
The SMP_FLAG_ENC_PENDING flag indicates that we've generated an STK
and are waiting for encryption to happen. In case the remote enables
encryption prematurely we should not try to encrypt with whatever is
stored in smp->tk, rather reject the pairing attempt.

Fixes #3222

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2018-07-30 13:02:34 +03:00
Jukka Rissanen 9ffab9e63a net: arp: Fix ARP message sending if VLAN is enabled
VLAN tags were not set properly for ARP messages.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-07-30 12:47:02 +03:00
Johan Hedberg 4d10b04aa1 Bluetooth: SMP: Fix missing NULL-checks for bt_auth
The recently added pairing_complete & pairing_failed callbacks
were missing a NULL-check for bt_auth, since it is possible that
there's no authentication callback structure registered at all.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2018-07-30 12:42:45 +03:00
Daniel Leung 0b89920579 arch/x86: update linker definition for x86 real mode
When building the real mode, the linker definition has to place
the real mode entry code at the start of flash area.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2018-07-28 08:14:27 -04:00
Daniel Leung 7b0c7aab22 boards/x86: up_squared: support new devices and Atom SoC
The board config has been verified to boot with serial console
on the Atom version of the UP Squared board. So the references
to Pentium/Celeron can be removed. Moreover, add some notes on
BIOS settings, as it may change the MMIO addresses for various
IP blocks.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2018-07-27 17:16:18 -04:00
Daniel Leung b3e68703b5 arch/x86: apollo_lake: add PCI related bits for UARTs/I2Cs
This adds PCI related configuration for UARTs and I2C controllers
to the Apollo Lake SoC configuration to support PCI devices.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2018-07-27 17:16:18 -04:00
Daniel Leung bcc95235c5 boards/x86: up_squared: add I2C configurations
Add the necessary bits to enable the I2C controllers on
the UP Squared board. Only the ones exposed through the HAT
connector(s) are enabled by default.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2018-07-27 17:16:18 -04:00
Daniel Leung 44be3943bb tests/benchmarks/footprint/min/x86: disable I2C and SPI
Disable CONFIG_I2C and CONFIG_SPI for minimum footprint test,
since we are doing "minimum" footprint.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2018-07-27 17:16:18 -04:00
Daniel Leung 88f4b68165 arch/x86: apollo_lake: add MMU regions for I2C controllers
The Apollo Lake SoC has 8 I2C controllers. The MMU regions are
added to allow access.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2018-07-27 17:16:18 -04:00
Daniel Leung 67b48ab2a8 drivers/i2c: i2c_dw: extends driver to support 8 controllers
This adds the necessary driver structs to support a total of 8
I2C controllers. This also allows each I2C controller to have
its own PCI vendor/device IDs.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2018-07-27 17:16:18 -04:00
Daniel Leung 982b4e14c4 drivers/i2c: extends Kconfig to support 8 controllers
This simply adds 3 set of new Kconfig options to support
a total of 8 I2C controllers.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2018-07-27 17:16:18 -04:00