Commit Graph

43457 Commits

Author SHA1 Message Date
Hake Huang f976de4767 counter: enable pit support for k8x series
enable PIT in k8x series

Signed-off-by: Hake Huang <hake.huang@oss.nxp.com>
2020-08-21 14:27:59 -05:00
Hake Huang 5382673bea counter: add pit in k8s board support
enable frdm_k82f with pit counter driver
this driver can be used as period hardware trigger

Signed-off-by: Hake Huang <hake.huang@oss.nxp.com>
2020-08-21 14:27:59 -05:00
Hake Huang 7fb938710b dts: add pit as counter
add dts for kinetis pit counter driver

Signed-off-by: Hake Huang <hake.huang@oss.nxp.com>
2020-08-21 14:27:59 -05:00
Wenbo Yang 17216128ab hardening: remove the empty line before EOF
The extra empty line broke the "ninja hardenconfig" on my machine with
Python 3.7.5, it complains:

"
... ...
File "/home/zephyrproject/zephyr/scripts/kconfig/hardenconfig.py",
line 46, in compare_with_hardened_conf

name = row[0]
IndexError: list index out of range
FAILED: CMakeFiles/hardenconfig
"

The csv.reader reads this empty line and gets an empty list which will
not be successfully "de-referenced".  Removing it to improve the
out-of-box experience when pepople try out the hardening options.

Signed-off-by: Wenbo Yang <wenbo.yangcn@gmail.com>
2020-08-21 15:09:07 -04:00
Meng xianglin 560b8d9fe0 test: thread: add a test case for essential thread abort
Abort a essential thread and handle the fatal error.

Signed-off-by: Meng xianglin <xianglinx.meng@intel.com>
2020-08-21 13:58:35 -04:00
Peter A. Bigot ea8432b92e samples: jesd216: update output to reflect recent bug fix
An off-by-one error calculating the number of parameter headers caused
a third table to not be displayed.

Signed-off-by: Peter A. Bigot <pab@pabigot.com>
2020-08-21 13:57:46 -04:00
Peter A. Bigot c04c40a34e samples: jesd216: fix printf argument to match format
The relative offset will always be small so downcast it to avoid
cross-platform size differences.

Signed-off-by: Peter A. Bigot <pab@pabigot.com>
2020-08-21 13:57:46 -04:00
Peter A. Bigot e32ecab7af checkpatch: disable REPEATED_WORD
A new check in Linux checks for repeated words, which spews false
positives from text like:

* @param param the parameter
* @param device device instance

Signed-off-by: Peter A. Bigot <pab@pabigot.com>
2020-08-21 13:57:02 -04:00
Peter A. Bigot e49e3c8fef scripts: update checkpatch based on current linux kernel version
This squashes and applies the Linux diffs to scripts/checkpatch.pl
between Linux commit 16fbf79b0f83bc75 ("Linux 5.6-rc7") and
9123e3a74ec7b93 ("Linux 5.9-rc1") except for commits identified below.

The last 1000 commits to Zephyr master were compared for checkpatch
output differences between the previous Zephyr version and this
version.  One new diagnostic about function declarations with an empty
parameter-list was introduced (FUNCTION_WITHOUT_ARGS).  The text of an
existing diagnostic was changed (DT_SPLIT_BINDING_PATCH).  The text of
LONG_LINE diagnostics was enhanced to provide the actual line length.

Linux commit dfa05c28ca7ffc0a ("checkpatch: remove email address
comment from email address comparisons") was removed because
differences in the scripts resulted in false signed-off-by check
diagnostics when a full name included characters not in Basic Latin,
due to changes in how the author name was extracted.  Earlier upstream
changes not integrated into Zephyr may be required.

Linux commit b95692f8b3000166 ("checkpatch: prefer fallthrough; over
fallthrough comments") was removed because Zephyr doesn't support the
upstream pseudo keyword.

Linux commit bdc48fa11e46f867 ("checkpatch/coding-style: deprecate
80-column warning") was edited to not actually change the 80-column
maximum line limit as this change has not been mooted for Zephyr.

Linux commit ced69da1db0b57bb ("checkpatch: fix CONST_STRUCT when
const_structs.checkpatch is missing") was edited to the CONST_STRUCT
file as that's not supported in Zephyr.

Signed-off-by: Peter A. Bigot <pab@pabigot.com>
2020-08-21 13:57:02 -04:00
Jukka Rissanen 34ddb8cfa8 net: includes: Fix indentation in header files
The indentation went wrong when the integer types was changed
from the type "u8_t" to type "uint8_t". This changed the length
of the type and caused the code to look bad in places.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-08-21 13:56:13 -04:00
Peter A. Bigot d75e1a8f32 doc: guides: portability: fix misspellings in POSIX C LANG table
Fix various missing letters and inconsistent parentheses.

Signed-off-by: Peter A. Bigot <pab@pabigot.com>
2020-08-21 13:55:32 -04:00
Marcin Niestroj 1e6679a23b drivers: console: uart_mux: consume ringbuf until it is empty
ringbuf claim API returns pointer to contiguous area. In cases when data
in ringbuf wraps the end of internal buffer, then single call to claim
data is not enough to get all data - there is remaining part on the
beginning of internal buffer. Those remaining bytes will need to wait
for next ISR handler to trigger workqueue. Theoretically this means that
data on the beginning of ringbuf can wait there forever.

Consume data from ringbuf in a loop, stopping only when claiming results
in empty buffer. This will make sure that there is no stale data in the
ringbuf.

Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com>
2020-08-21 13:51:45 -04:00
Matija Tudan efae88ce3a sensor: fxos8700: implement magnetic vector magnitude function
The magnetometer vector-magnitude function will generate an interrupt
when magnitude is greater than specified threshold value. The user
may program the threshold value to establish the conditions needed
to detect a magnetic vector-magnitude change event. Depending on the
values chosen for the reference values, this function may be
configured to detect a magnetic field magnitude that is above
a preset threshold (with reference values = 0), or a change in magnitude
between two magnetic vectors greater than the preset threshold
(with reference values non-zero).

Default configuration of M_VECM_CFG register (address 0x69) is 0x4e.

Signed-off-by: Matija Tudan <mtudan@mobilisis.hr>
2020-08-21 12:30:50 -05:00
Jukka Rissanen 3e1491de26 samples: net: echo-client: Add userspace support
Allow echo-client to run in user mode for testing purposes.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-08-21 14:45:35 +03:00
Loic Poulain 9eb46d95a7 net: shell: TCP stack agnostic shell
Now that TCP2 is the default stack, make the shell compatible
with both stacks.

Note: net_tcp_foreach is not implemented in TCP2, so related
code depends on TCP1.

Signed-off-by: Loic Poulain <loic.poulain@linaro.org>
2020-08-21 12:15:32 +03:00
Marcin Niestroj 4c8d1496ea net: l2: ppp: don't move back to NETWORK state when link goes down
PPP Phase Diagram [1] allows only one way phase change. In current
implementation there is an additional RUNNING phase, which is entered
just after NETWORK phase.

Prevent going back from RUNNING to NETWORK phase when Term-Req was
received, as this is meaningless for overall PPP operation and violates
PPP Phase Diagram property of having one way direction change.

This change also improves Adminitrative Close handling (calling
lcp_close()). This request results in moving into TERMINATE phase. Then
LCP is put down (by calling lcp_down()) and then ppp_link_down() is
called, which so far (before this patch) resulted in moving back to
NETWORK and then to DEAD. Right now (after this patch) we move directly
from TERMINATE to DEAD phase, which is exactly how [1] specifies it.

[1] https://tools.ietf.org/html/rfc1661#section-3.2

Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com>
2020-08-21 11:53:59 +03:00
Marcin Niestroj 47a39b567e net: l2: ppp: lcp: do not force STOPPED state after Adminitrative Close
State Transition Table [1] specifies that Administrative Close should
result in CLOSING state. This is not respected in case of LCP, as
STOPPED state was forced in lcp_close().

Don't force going into STOPPED state in lcp_close() and rely on
ppp_fsm_close() to move to CLOSING state instead.

This patch fixes overall Adminitrative Close procedure and allows to
move back into fully operating PPP connection once again after
Adminitrative Open.

[1] https://tools.ietf.org/html/rfc1661#section-4.1

Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com>
2020-08-21 11:53:38 +03:00
Henrik Brix Andersen b3aca735f7 doc: guides: porting: shields: fix directory layout examples
Fix the directory layout examples to use "<board>" when referring to a
board name, and "boards" when referring to the boards directory.

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
2020-08-21 10:27:57 +02:00
Siddharth Chandrasekaran b5f7706009 doc: portability/posix: Indicate presence of strtok_r
Commit 0637595e added strtok_r implementation but missed updating this
document.

Signed-off-by: Siddharth Chandrasekaran <siddharth@embedjournal.com>
2020-08-20 19:40:18 -04:00
Martí Bolívar af4566b21e devicetree: spi: fix typo in docstring
s/one/none/ in a critical place.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-08-20 19:40:03 -04:00
Daniel Leung 16c4090487 tests: tinycrypt_hmac_prng: exclude MEC1501-based boards
MEC1501 SoC has 256KB of SRAM, but it is split into 224/32KB
for code and data, as each partition is optimized for
the access pattern. There the DTS only specifies 32KB as
data ram. The tinycrypt_hmac_prng test requires 40KB for
ztest stack. This obviously won't fit so exclude the boards
based on MEC1501 from the test.

Fixes #27572

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2020-08-20 14:56:10 -04:00
Henrik Brix Andersen 96a39f00c2 west: runners: jlink: add support for -nogui 1 command line parameter
Add support for the J-Link Commander "-NoGui 1" command line parameter
in the West J-Link runner.

This command line parameter suppresses GUI dialogs (except for license
dialogs) in J-Link Commander starting from v6.80.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2020-08-20 13:04:37 -05:00
Andrew Boie 72792a5e63 userspace: cleanup mem domain assertions
The memory domain APIs document that overlapping regions are
not allowed, check for this unconditionally.

Cleanup assertion error messages. Use __ASSERT_NO_MSG for
blindingly obvious NULL checks.

We now have a `check_add_partition()` function to perform
all the necessary sanity checks on adding a partition to a
domain. This returns true or false, which will help later
when we implement #24609

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2020-08-20 13:58:54 -04:00
Andrew Boie 6f32dd7110 x86: add missing memory domain checks
These macros are used to validate that regions aren't
programmed that allow both writes and execution.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2020-08-20 13:58:54 -04:00
Andrew Boie 86ad13d960 userspace: clarify some mem domain doxyen
Make a few miscellaneous comments clearer.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2020-08-20 13:58:54 -04:00
Andrew Boie bc35b0b780 userspace: add optional member to memory domains
Some systems may need to associate arch-specific data to
a memory domain. Add a Kconfig and `arch` field for this,
and a new arch API to initialize it.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2020-08-20 13:58:54 -04:00
Andrew Boie f8d743a1cb userspace: fix ifdef for k_mem_partition
Wrap the entire definition around CONFIG_MEMORY_PROTECTION.
Add incomplete declaration for IS_ENABLED() purposes.

Some arch code uses struct k_mem_partition internally for
MPU management, even if userspace isn't enabled.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2020-08-20 13:58:54 -04:00
Andrew Boie ca1921aaa3 userspace: fix ifdef for k_mem_domain
ifdef the entire struct k_mem_domain around CONFIG_USERSPACE,
this is specifically and only a userspace feature.

Add an incomplete definition for purposes of allowing the APIs
to be used with IS_ENABLED().

Prevents accidental useless instatiation of k_mem_domain structs.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2020-08-20 13:58:54 -04:00
Andrew Boie 75d5c0bc4b userspace: move mem domain defines
This now has its own header instead of kernel.h. The code is
unchanged other than a forward declaration of k_tid_t.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2020-08-20 13:58:54 -04:00
Meng xianglin 2660878f14 test: power: Test cases for power subsystem
Add test cases for power managment transactions when system enter
idle thread.

Signed-off-by: Meng xianglin <xianglinx.meng@intel.com>
2020-08-20 09:20:14 -04:00
Andrew Boie 44ed730724 x86: static scope for exception handlers
These just need `__used` to avoid compiler warnings.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2020-08-20 10:19:41 +02:00
Maureen Helm 654a49a9f8 soc: nxp_imx: Set entry to _vector_start in boot header
Commit e80e655b01 introduced linker script
enforcement of Cortex-M vector table alignment. Update the i.MX RT boot
header to account for the possibility that the vector table may not be
placed at the address CONFIG_FLASH_BASE_ADDRESS +
CONFIG_ROM_START_OFFSET anymore.

For example, the RT1060 vector table has 176 entries and therefore must
be aligned to 0x400 bytes. If CONFIG_FLASH_BASE_ADDRESS=0x60000000 and
CONFIG_ROM_START_OFFSET=0x2200, the linker script will place the vector
table at 0x60002400 instead of 0x60002200.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2020-08-20 09:20:38 +02:00
Kamil Kasperczyk b07c2f8463 logging: Fix holding coherence of log levels in Spinel backend.
LOG_BACKEND_SPINEL_LEVEL turned out to be useless and was removed.
Also changes to keep coherence between Zephyr log level and OT log
level added by otPlatLog() were introduced.

Signed-off-by: Kamil Kasperczyk <kamil.kasperczyk@nordicsemi.no>
2020-08-20 09:19:12 +02:00
Simon Glass c5d85e175f subsys/testsuite: Add an assert for a zero return code
Many functions signal success by returning a return code of zero. Add
an assertion for this.

Some functions can return a positive value to indicate success, where
they want to convey some information. This is not handled by this
assert function.

Signed-off-by: Simon Glass <sjg@chromium.org>
2020-08-19 19:20:35 -04:00
Peter Bigot bf04c61f6e tests: gpio_basic_api: disconnect output in initial setup
One driver (mchp_xec) appears to have problems with setting the output
value before setting the direction, which can be caught if the order
of checks in the port setup function are reversed.  Reconfigure the
output to a non-output state before the second test to see if that
catches the problem.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-08-19 19:18:43 -04:00
Martí Bolívar 2ed2d3bfa9 scripts: runners: add --no-erase support
If a runner supports the --erase option, make it so that the user can
add --no-erase to the command line to explicitly disable it.

Add a diagnostic at info() level whenever this option is requested.

The intent of this commit is to make it more obvious when a mass erase
was requested, especially in situations (like MCUboot with
CONFIG_MCUBOOT_TRY_MASS_ERASE=y) where this option may be turned on by
default.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-08-19 16:38:26 -05:00
Gerard Marull-Paretas 82e58a0707 boards: arm: adafruit_feather_nrf52840: add support for QSPI flash
Add DT entry for the embedded QSPI NOR flash (GD25Q16) in the Adafruit
nRF52840 feather. Also added support for the spi_flash sample, which has
been used to verify the device.

NOTE: Device seems to fail when using high clock frequencies (e.g.
maximum QSPI frequency). It may be due to PCB layout issues.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2020-08-19 15:43:57 -05:00
Gerard Marull-Paretas 48585cb745 boards: arm: adafruit_feather_nrf52840: add missing SPI compatible
DT compatible was missing from Adafruit nRF52840 feather board thus
preventing samples depending on SPI to build correctly.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2020-08-19 15:43:57 -05:00
Mahesh Mahadevan 47a00423ac MXRT600: Add support to run Basic GPIO test
Use Arduino pins A0 and A1

Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
2020-08-19 13:06:30 -05:00
Mahesh Mahadevan dc294b8773 RT600: Fix IOCON setting
Enable input buffer for both input and output pins.
The buffer must be enabled when the pin is used as
an input. Enabling the buffer enables reading back
the GPIO value when configured as output

Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
2020-08-19 13:06:30 -05:00
Martí Bolívar 5fac1ea7bd doc: usermode: use zephyr_file to locate syscall_handler.h
The file name can be converted into a link to the file using
zephyr_file.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-08-19 10:27:26 -07:00
Torsten Rasmussen edde894d04 cmake: Zephyr CMake package clean-up and minor fix
Fixes: #27375

This is a cleanup of the Zephyr CMake package export.
The code has been simplified so that the export now happens through a
CMake script. This avoids several generated CMake build files compared
to previous export mode, and thus removes the need for a CMake pristine
script.

A benefit of this cleanup is that it also fixes #27375.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2020-08-19 12:52:33 -04:00
Maciej Perkowski c67a0cd098 sanitycheck: Improve tests counting
This patch should improve couting and reporting of the number
of passed/skipped tests.

Signed-off-by: Maciej Perkowski <Maciej.Perkowski@nordicsemi.no>
2020-08-19 12:49:42 -04:00
Jukka Rissanen 60d2885e3c driver: eth: native_posix: Minimum RX sleep with gPTP
Sleep minimum time in RX when gPTP is enabled. Typically we
receive constant stream of gPTP protocol data so no need to
wait very long in that case and cause timeouts.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-08-19 12:47:09 -04:00
Jukka Rissanen db2b5dbaf9 samples: net: gptp: native_posix: Set 1ms clock accuracy
Instead of unknown clock accuracy, set it to 1ms for native_posix
boards. This looks better in TSN monitor.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-08-19 12:47:09 -04:00
Jukka Rissanen acb8956bb7 samples: net: gptp: Enable GM support by default
As we support grand master, enable it by default so things
get tested properly.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-08-19 12:47:09 -04:00
Jukka Rissanen 0a12b7af14 net: shell: Print current gPTP role information
Print role information next to port information. Also make
sure that port number is set correctly.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-08-19 12:47:09 -04:00
Jukka Rissanen 8e9e79b21d net: gptp: Separate common strings from warning messages
Save some memory and separate common string snippets from larger
strings. In this case "does not match" sub-string is printed by
several warning prints so separate the sub-string from the bigger
string.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-08-19 12:47:09 -04:00
Jukka Rissanen 08da995bf9 net: eth: native_posix: Only claim VLAN support when applicable
Make sure that native_posix Ethernet driver is claiming to support
VLAN when the VLAN functionality is enabled.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-08-19 12:47:09 -04:00
Jukka Rissanen fe638d23fc net: native_posix: gptp: Add multiport support
Add gPTP multiport support to native_posix Ethernet driver.
This means that the driver is able to create more than one
network interface and enable gPTP to each of them. This requires
that net-tools is updated as it contains configuration file
for network interfaces in host side.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-08-19 12:47:09 -04:00