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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
This patch should improve couting and reporting of the number
of passed/skipped tests.
Signed-off-by: Maciej Perkowski <Maciej.Perkowski@nordicsemi.no>
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>
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>
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>
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>
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>
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>