Commit graph

42249 commits

Author SHA1 Message Date
NavinSankar Velliangiri 820bfb46bc net: http: client: Add port number to HTTP Header
Add port number to HTTP Header.

Signed-off-by: NavinSankar Velliangiri <navin@linumiz.com>
2020-06-15 16:59:20 +02:00
Michael Hope 18d3499dba drivers: usb: fix a buffer overflow in usb_sam0.c
The driver currently blindly copies all of the outgoing bytes into the
endpoint.  Instead, calculate the endpoint size and copy up to that
amount instead.

Signed-off-by: Michael Hope <mlhx@google.com>
2020-06-15 16:56:05 +02:00
Michael Hope fe35269d12 drivers: usb: handle a null output arg on SAM0
The output parameter `ret_bytes` is optional and may be NULL.

Signed-off-by: Michael Hope <mlhx@google.com>
2020-06-15 16:55:52 +02:00
Maureen Helm aadcec16d9 usb: Set thread names in usb device classes
Sets thread names for all usb device class threads (bluetooth, bt_h4,
mass storage, and rndis) to aid debug.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2020-06-15 16:55:01 +02:00
Francois Ramu bd17ff7a51 soc: arm: st_stm32 add low power to stm32l4 series
This patch introduces the support of low power modes
for the STM32L4xx from STMicroelectronics based on the lptim
Here, the power modes are sleep modes with lptimer as wakeup.
Depending on the SYS_POWER_MANAGEMENT configuration.

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2020-06-15 16:54:04 +02:00
Vincent Wan e7a85ddef9 drivers: entropy: add get_entropy_isr() for CC13x2/CC26x2
A non-blocking, isr-safe version of get_entropy() is necessary in order
to be called during boot time before POST_KERNEL initialization.
Otherwise a crash is seen as the existing get_entropy() implementation
uses k_sem and relies on interrupts.

Fixes #18629

Signed-off-by: Vincent Wan <vincent.wan@linaro.org>
2020-06-15 16:53:39 +02:00
Flavio Ceolin 83d0c0a53e serial: uart_xlnx_ps: Fix duplicate initialization
The uart configuration was initializing two fields of an union.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2020-06-15 16:53:20 +02:00
Jose Alberto Meza a1b6dd51d0 drivers: espi: Add support for KBC status operations
In some systems, eSPI host perform operations directly over KBC HW
status.

Signed-off-by: Jose Alberto Meza <jose.a.meza.arellano@intel.com>
2020-06-15 16:52:53 +02:00
Marcin Niestroj 3b0917bcbf tests: posix: eventfd_basic: add new test
Introduce new test for eventfd, which will test it in only basic
scope. The real reason why this is introduced is to have a test with
minimal set of configuration dependencies, such as disabled
pthreads (compared to full tests/posix/eventfd/ variant). This allows to
test eventfd mechanism with both POSIX_API=n and POSIX_API=y.

Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com>
2020-06-15 16:52:29 +02:00
Marcin Niestroj 385abc7740 lib: posix: eventfd: support build with !POSIX_API
Just change include path to support build with CONFIG_POSIX_API=n.

Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com>
2020-06-15 16:52:29 +02:00
Maciej Perkowski bd14a9d493 tests: littlefs: Increase timeout to 180s
The test takes ~175s to end on nrf5284dk_nrf52840 and was failing
due to too short default timeout (60s).

Signed-off-by: Maciej Perkowski <Maciej.Perkowski@nordicsemi.no>
2020-06-15 16:45:38 +02:00
Jukka Rissanen f7d584a0ce net: ethernet: Check that device has PTP clock before access
Avoid null pointer access by checking that Ethernet device has
PTP clock before trying to get the actual PTP clock device.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-06-15 16:40:36 +03:00
Oleg Zhurakivskyy f419a655bb samples: net: sockets: tcp: Enable CONFIG_THREAD_NAME
In order to follow threads by name, enable CONFIG_THREAD_NAME
in the configuration.

Signed-off-by: Oleg Zhurakivskyy <oleg.zhurakivskyy@intel.com>
2020-06-15 16:38:38 +03:00
Oleg Zhurakivskyy d95a2c38e3 net: core: Output a thread name in NET_DBG() if enabled
In order to follow threads by name in the debug output,
output a thread name if CONFIG_THREAD_NAME is enabled.

Signed-off-by: Oleg Zhurakivskyy <oleg.zhurakivskyy@intel.com>
2020-06-15 16:38:38 +03:00
Marcin Niestroj e548c6c5b2 net: config: rely on type rather than number of services configured
So far net config initialization code relied on number of services
needed by application. This was fine as long as all enabled
services (e.g. CONFIG_NET_IPV4=y, CONFIG_NET_IPV6=y) were selected by
project configuration as "needed" (e.g. CONFIG_NET_CONFIG_NEED_IPV4=y,
CONFIG_NET_CONFIG_NEED_IPV6=y). Problem appeared for example when both
IPv4 and IPv6 were enabled (CONFIG_NET_IPV4=y, CONFIG_NET_IPV6=y), but
only IPv6 was marked as "needed" (CONFIG_NET_CONFIG_NEED_IPV6=y). In
such situation number of required services was equal to 1. When IPv4
setup was completed, this resulted in returning from net_config_init()
function. Application code failed, because IPv6 was still not
functional.

Do not rely on number of services anymore, as it is error prone. Use
flags instead to mark which services are ready. Compare those flags with
the flags passed to net_config_init() (selected in project configuration
in most cases) to decide whether network configuration has completed
already or not.

Also introduce services_notify_ready() and services_are_ready() helper
functions to isolate implementation details from the logic.

Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com>
2020-06-15 10:31:37 +03:00
Marcin Niestroj d241c19b0f net: config: fix checking for protocols being ready
With current design there is single semaphore (called 'waiter') for
wakeing up initialization thread. This thread should then check for
number of protocols that still need to be initialized. This happens now
only when waiting on 'waiter' semaphore times out.

Do not check for k_sem_take(&waiter) return value, as all needed
information about protocols being initialized already is in 'counter'
semaphore.

Fixes: #25358

Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com>
2020-06-15 10:31:37 +03:00
Marcin Niestroj f74bea04aa tests: net: poll: disable NET_IPV4
Unit test code uses IPv6 only, so disable IPv4.

Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com>
2020-06-15 10:31:37 +03:00
Marcin Niestroj 0995246edb tests: net: poll: select NET_CONFIG_NEED_IPV6
Unit test code requires IPv6 to be ready. Select
CONFIG_NET_CONFIG_NEED_IPV6=y to ensure that.

Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com>
2020-06-15 10:31:37 +03:00
Marcin Niestroj acd8b8d93e tests: net: select: disable NET_IPV4
Unit test code uses IPv6 only, so disable IPv4.

Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com>
2020-06-15 10:31:37 +03:00
Marcin Niestroj ec57ebff66 tests: net: select: select NET_CONFIG_NEED_IPV6
Unit test code requires IPv6 to be ready. Select
CONFIG_NET_CONFIG_NEED_IPV6=y to ensure that.

Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com>
2020-06-15 10:31:37 +03:00
Michael Hope 69b76d7305 samples: zperf: fix an unaligned access in the UDP uploader
zperf takes a potentially unaligned netowrk packet, casts it to a
struct, and then dereferences the fields.  This causes a crash on
cores that don't support unaligned access such as the Cortex-M0+.

Use the UNALIGNED_GET helper instead.

Signed-off-by: Michael Hope <mlhx@google.com>
2020-06-15 10:30:35 +03:00
Flavio Ceolin 636d6cd9cd samples: application_development: Fix for userspace
This samples was defining a syscall but the whole machinery to this
work was missing.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2020-06-13 16:37:58 -04:00
Flavio Ceolin b0d1abac9c drivers: uart_mux: Add missing verfification handler
Add the verifcation handler for the syscall uart_mux_find.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2020-06-13 16:37:58 -04:00
Tobias Svehagen 8b3a606009 net: shell: Add support for 'net tcp recv' command
Add command to register a receive callback to the net_context used for
the TCP connection that is opened with 'net tcp connect'. The receive
callback will simply print the number of bytes received and inform if
the connection is closed. This makes it possible to test both the tx
and rx paths with the net shell.

Signed-off-by: Tobias Svehagen <tobias.svehagen@gmail.com>
2020-06-13 16:36:08 -04:00
Ruslan Mstoi e406c9c448 scripts: gen_gcov_files.py: add argument help text
Convert the description comment at the top of the file to a
documentation string. That string then maybe viewed with the --help
argument. Also, rework a bit the documentation string: remove usage,
since that is provided by the help message of the argparse module.

Signed-off-by: Ruslan Mstoi <ruslan.mstoi@intel.com>
2020-06-13 16:33:22 -04:00
Ruslan Mstoi 69b07e3156 scripts: gen_gcov_files.py: PEP 8 style fixes
Fix PEP 8 coding style issues reported by pycodestyle.

Signed-off-by: Ruslan Mstoi <ruslan.mstoi@intel.com>
2020-06-13 16:33:22 -04:00
Léonard Bise 7b869f0392 net: dns: Ignore queries when resolving a name
It might happen that while we are waiting for the response
to one of our query, we receive a query to resolve another name.
Previously this would make the current name resolution to fail because
only responses were expected to be received.

Signed-off-by: Léonard Bise <leonard.bise@gmail.com>
2020-06-13 22:14:42 +03:00
Andrzej Puzdrowski 4f7f6c96be includes/storage/stream_flash: clarification on API usage
Clarify that number of bytes_written means bytes number of bytes
written belongs to the user's payload.

Added API note for emphasize that any flush write should be
the last write operation in any writes row.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2020-06-13 11:57:35 +02:00
Andrzej Puzdrowski ac07694309 storag/stream: fix stream_flash_bytes_written() return value
stream_flash_bytes_written() returned number o bytes physically
written to the flash. This number might be bigger than the requested
number as is aligned to the device write-block-size.

stream_flash_bytes_written() should return number of bytes
written requested by the user.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2020-06-13 11:57:35 +02:00
Abhishek Shah 43fbcaebf9 boards: arm: bcm958402m2_a72: Enable PCIe EP support
Enable PCIe EP support on bcm958402m2_a72 board

Signed-off-by: Abhishek Shah <abhishek.shah@broadcom.com>
2020-06-13 01:35:19 -07:00
Abhishek Shah ecc1673b78 pcie: endpoint: Add iProc PCIe EP driver
iProc PCIe EP IP is present in Broadcom PCIe offload chips.
Add iProc PCIe EP driver to provide basic PCIe EP functionality.

Signed-off-by: Abhishek Shah <abhishek.shah@broadcom.com>
Signed-off-by: Shivaraj Shetty <shivaraj.shetty@broadcom.com>
2020-06-13 01:35:19 -07:00
Abhishek Shah a8a5242249 dts: arm: viper: Add DT node for iProc PCIe EP
dts: arm: Add iProc PCIe EP node in Viper DT

Signed-off-by: Abhishek Shah <abhishek.shah@broadcom.com>
Signed-off-by: Shivaraj Shetty <shivaraj.shetty@broadcom.com>
2020-06-13 01:35:19 -07:00
Abhishek Shah 455663dbf2 dts: bindings: Add binding for iProc PCIe EP node
Add device tree binding for the iProc PCIe EP present on
Broadcom Valkyrie/Viper SoC series.

Signed-off-by: Abhishek Shah <abhishek.shah@broadcom.com>
2020-06-13 01:35:19 -07:00
Abhishek Shah 3c2fa8cd51 pcie: endpoint: Introduce API to achieve PCIe data transfer
Introduce common API to achieve data transfer using memcpy
to/from outbound region of PCIe EP.

Signed-off-by: Abhishek Shah <abhishek.shah@broadcom.com>
2020-06-13 01:35:19 -07:00
Abhishek Shah ca17315d7f pcie: endpoint: Add public APIs for PCIe endpoint driver
Add public APIs for PCIe endpoint driver:
- EP configuration space read/write
- Mapping/Unmapping of Host buffer and PCIe outbound region
- Raise interrupt to Host
These are minimal base APIs to make PCIe EP functional.

Also, add a Kconfig and an empty CMakeLists.txt for drivers to extend.

Signed-off-by: Abhishek Shah <abhishek.shah@broadcom.com>
2020-06-13 01:35:19 -07:00
Abhishek Shah bee0fdea1e drivers: pcie: remove depends on X86
Remove depends on X86 for config PCIE,
Let the platforms select PCIE if they want to.

Signed-off-by: Abhishek Shah <abhishek.shah@broadcom.com>
2020-06-13 01:35:19 -07:00
Andrew Boie 8920549464 qemu_x86: propagate exit reason code to the shell
This helps distingush between fatal errors if logging isn't
enabled.

As detailed in comments, pass a reason code which controls
the QEMU process' return value.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2020-06-12 23:24:37 -04:00
Anas Nashif 6f4f5b1fe5 tests: exclude qemu_arc_hs in lifo_usage test
Fails very frequently in CI, disabling until a fix is available, see

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-06-12 23:22:57 -04:00
Carles Cufi 8617e93b84 Bluetooth: controller: Work around compiler silliness
For some reason GCC 9.x doesn't seem to be able to realize that set_num
will always be > 0 and so the local variable status will always be
initialized. Use a do {} while instead to keep it happy.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2020-06-12 22:58:05 +02:00
Hake Huang 999c59c1ec dma: add error check on peripheral to peripheral
add dma direction check for dma_sam0

Signed-off-by: Hake Huang <hake.huang@oss.nxp.com>
2020-06-12 13:03:28 -05:00
Hake Huang 10fc7a38cc dma: add EDMA MCUX support for RT and k6s
tested on mimxrt1060_evt
  MEMORY_NOCACHE is needed
test on frdmk64f
  special test slot need configure with
  CONFIG_DMA_TEST_SLOT_START

Signed-off-by: Hake Huang <hake.huang@oss.nxp.com>
2020-06-12 13:03:28 -05:00
Hake Huang 5582c2f00b dt-bindings: dts/arm/nxp : add MCUX EDMA Support
add MCUX EDMA support for dts binding

Signed-off-by: Hake Huang <hake.huang@oss.nxp.com>
2020-06-12 13:03:28 -05:00
Hake Huang 6bb555ce83 clock_control: add EDMA clock support
add clock rate for RT series from ipg
Kinetis does not need additional clock added

Signed-off-by: Hake Huang <hake.huang@oss.nxp.com>
2020-06-12 13:03:28 -05:00
Hake Huang 77c4015082 dma: add support for MCUX EDMA
1. expand PERIPHERAL_TO_PERIPHERAL
2. add slot size to 128 as i.MX-rt has 127 slot
3. add link_channel member in dma_conf which is used to
   support chain channel

Signed-off-by: Hake Huang <hake.huang@oss.nxp.com>
2020-06-12 13:03:28 -05:00
Hake Huang abce94bb98 dma: add EDMA test support for MCUX
for RT series CONFIG_NOCACHE_MEMORY need enabled
for Kinetis series CONFIG_DMA_TEST_SLOT_START for test
modify the target and dest alignment

frdmk64f need replace strlen to sizeof in irq callback
clean the unused receive buffer, so output is tidy

Signed-off-by: Hake Huang <hake.huang@oss.nxp.com>
2020-06-12 13:03:28 -05:00
Anas Nashif 2ca3473349 spelling: fix typo
Fix some random typos..

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-06-12 11:53:41 -04:00
Anas Nashif adb6a89be5 sanitycheck: capture non-ztest results
We were missing test results from non-ztest tests in the target reports.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-06-12 11:50:26 -04:00
Torsten Rasmussen 8e8c6cd92b cmake: improved DTC detection handling
Fixes: #26096

In some cases DTC may be installed, but in a non-working state.
In such cases, CMake will abort processing with an cryptic error.

This commit now handles dtc version errors and print a warning., and
CMake processing continues.

dtc is an optional component and failures should not break CMake run.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2020-06-12 17:10:36 +02:00
Andrzej Puzdrowski a0c9202906 manifest: update mcuboot to upmerged to upstream 9b48d08
MCUBoot was synchronized with upsteram
https://github.com/JuulLabs-OSS/mcuboot/commit/9b48d08

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2020-06-12 17:07:17 +02:00
Christopher Friedt 72e7debca5 tests: posix: tests for nanosleep(2)
This commit provides test-cases for nanosleep(2)

Signed-off-by: Christopher Friedt <chrisfriedt@gmail.com>
2020-06-12 17:02:03 +02:00