Commit graph

45923 commits

Author SHA1 Message Date
Jedrzej Ciupis 35ec164e36 west.yml: Update nRF5 ieee802154 driver to v1.9
This commit updates the nRF IEEE 802.15.4 radio driver to version 1.9.

Signed-off-by: Jedrzej Ciupis <jedrzej.ciupis@nordicsemi.no>
2020-11-16 15:24:03 +01:00
Czeslaw Makarski b6b613d4db modules: nordic: Introduce nRF IEEE 802.15.4 Service Layer selection
This patch introduces the nRF IEEE 802.15.4 Service Layer configuration.

Signed-off-by: Czeslaw Makarski <Czeslaw.Makarski@nordicsemi.no>
2020-11-16 15:24:03 +01:00
Jukka Rissanen 82dbda3b57 net: tcp2: Use proper int type for connection MSS
When printing MSS (Maximum Segment Size) value, use uint16_t
always.

Fixes #29997

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-11-16 09:19:21 -05:00
Katsuhiro Suzuki c9112fb52f MAINTAINERS: Add myself to RISCV subsys collaborators.
Currently there is no maintainer and active collaborator in RISCV
subsys area. I hope this helps to encourage RISCV developments.

Signed-off-by: Katsuhiro Suzuki <katsuhiro@katsuster.net>
2020-11-16 08:17:45 -06:00
Jukka Rissanen 7d5ef1f952 net: shell: Print detailed information when TCP2 is enabled
If user has enabled TCP debugging, print detailed internal TCP2
information too when user gives "net conn" command. This is useful
to have when debugging.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-11-16 16:07:10 +02:00
Jukka Rissanen 6a54b1f013 net: tcp: Reorganize internal TCP header file
Comment out TCP1 specific stuff when TCP2 is enabled. This means
shuffling the code around a bit so that common code is placed at
the end. Introduce also net_tcp_foreach() function to TCP2 so that
it can be used from net-shell.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-11-16 16:07:10 +02:00
Carles Cufi 0b1ff6f5e4 doc: Add SPARC to the list of supported archs
The introduction page lists all the architectures supported by Zephyr.
Now that SPARC V8 support has been merged, add it to the list. Also list
it in the set of architectures supported by the SDK.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2020-11-16 08:12:07 -05:00
Emil Gydesen 1dada244c1 Bluetooth: host: Periodic Advertising Sync Transfer
Adds support for the periodic advertising sync transfer
(PAST) feature, which allows a synced device, or an
advertiser, to transfer synchronization of a periodic
advertising train to a connected device.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2020-11-16 13:40:09 +01:00
Dominik Ermel 635230c725 tests/fs/fcb: Enable non-0xff erase value tests
Fcb tests have been modified to be able to work on non-0xff erase
value flash devices.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2020-11-16 13:39:04 +01:00
Dominik Ermel 4832fe43e0 fs/fcb: Enable FCB to work with non-0xff erase value flash
The FCB has been strongly tied to 0xff erased flash devices and this
commit adds support for other erase values.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2020-11-16 13:39:04 +01:00
Dominik Ermel 53fd687344 tests/fs/fcb: Add support for qemu_x86 platform
Overlays that enable FCB tests on qemu_x86 plaftorm have been added.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2020-11-16 13:39:04 +01:00
Eug Krashtan a6be4f608e scripts: Add imgtool to requirements
On Windows, west sign command fails when imgtool not installed
via 'pip3 install'

Signed-off-by: Eug Krashtan <eug.krashtan@gmail.com>
2020-11-16 13:38:47 +01:00
Jukka Rissanen b519ba54f5 net: tcp2: Only accept a valid RST packet
If the seq number is not valid, then drop incoming RST.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-11-16 14:29:07 +02:00
Kiril Petrov 539c3e7fa8 lwm2m: handle return code from lwm2m_socket_add
Handle return code from lwm2m_socket_add

Signed-off-by: Kiril Petrov <retfie@gmail.com>
2020-11-16 14:28:08 +02:00
Jukka Rissanen be4380f5e2 net: tcp2: Remove unnecessary data length calculation
The data length is already calculated in tcp_in() so no need
to do it again in tcp_data_get(). Just pass the length to the
tcp_data_get() function.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-11-16 14:22:13 +02:00
Andrei Gansari dad18934da west.yml: tfm: add BUILD_PROFILE
Updates trusted-firmware-m to a683f7359f0ea2551da7d11509589fcef0dc8a78,
which enables BUILD_PROFILE parameter.

Signed-off-by: Andrei Gansari <andrei.gansari@nxp.com>
2020-11-16 13:45:02 +02:00
Johann Fischer 591740b3ea codeowners: update due to Github user name change
Update CODEOWNERS and MAINTAINERS due to Github user name change.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2020-11-16 10:34:50 +02:00
Martí Bolívar ffc03124c1 devicetree: make DT_PROP_HAS_IDX expand to 0 or 1
We have a use case for checking the results of a DT_PROP_HAS_IDX()
call with COND_CODE_1(). That won't work because its expansion is an
integer comparison; COND_CODE_1() expects a literal 1 or 0.

Adjust the macro implementation so it expands to a literal 1 or 0.
Make this work even when the index argument needs an expansion while
we're at it.

Fixes: #29833
Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-11-15 08:44:56 -06:00
Johan Hedberg f004410aa1 drivers: pcie: Rename pcie_wired_irq to pcie_get_irq
This reflects better the actual purpose of the API.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2020-11-14 11:13:00 +02:00
Johan Hedberg e2b243893d drivers: i2c: dw: Update to use new pcie_alloc_irq API
Take advantage of the new pcie_alloc_irq() API so that we get a valid
IRQ on platforms where the IRQ register is not pre-populated with a
valid value up front.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2020-11-14 11:13:00 +02:00
Johan Hedberg 3203fd3200 drivers: serial: ns16550: Update to use new pcie_alloc_irq API
Use the new pcie_alloc_irq() API so that we get a valid IRQ on
platforms where the IRQ registers do not contain valid values up
front.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2020-11-14 11:13:00 +02:00
Johan Hedberg 9e4dfd8f4e drivers: pcie: Add support for IRQ allocation management
There are x86 platforms where the IRQ configuration register for PCIe
is not pre-populated and the OS needs to assign a number dynamically
by writing to the register.

In order to allocate interrupts we have to know which ones have been
hard-coded in device tree. We accomplish this by collecting these
values through the IRQ_CONNECT() macro and placing them in a dedicated
linker section (in ROM).

The full set of allocated interrupts are managed through a bitmap, and
the pre-allocated values (from the linker section) are inserted into
this upon initial runtime access.

This patch introduces a new pcie_alloc_irq() API that drivers can use
to allocate interrupt line numbers. The two in-tree drivers that were
using this API (I2C and UART) are converted to use the new API.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2020-11-14 11:13:00 +02:00
Martin Åberg c8bbd412c7 doc: release 2.5: Announce the SPARC support
SPARC architecture is a new feature introduced with Zephyr 2.5.

Signed-off-by: Martin Åberg <martin.aberg@gaisler.com>
2020-11-13 14:53:55 -08:00
Martin Åberg 7faec88bd1 MAINTAINERS: Add entry for SPARC architecture
Add myself as collaborator for the SPARC architecture and its
relevant paths.

Signed-off-by: Martin Åberg <martin.aberg@gaisler.com>
2020-11-13 14:53:55 -08:00
Martin Åberg d8ab65d780 codeowners: add owner for SPARC
Add myself as an owner for SPARC related files.

Signed-off-by: Martin Åberg <martin.aberg@gaisler.com>
2020-11-13 14:53:55 -08:00
Martin Åberg 9feb799762 lib: cbprintf: improved %p specifier handling
This fixes an issue where the %p specifier always generated "(nil)"
on SPARC. The failing test cases were:
 tests/lib/sprintf/libraries.libc.sprintf
 tests/kernel/common/kernel.common.misra
 tests/kernel/common/kernel.common.tls
 tests/kernel/common/kernel.common

The exact logic behind the issue has not been fully analyzed, but
it can be observed that this commit eliminates one occurrence of
undefined behavior. (Only allowed to read the last union field written.)

Signed-off-by: Martin Åberg <martin.aberg@gaisler.com>
2020-11-13 14:53:55 -08:00
Martin Åberg 73b7dde833 cmsis: align buffer containing struct k_timer
The slab cmis_timer_slab is used to allocate objects of the type
"struct timer_obj", so it should be defined to use the compile-time
alignment requirement of "struct timer_obj", rather than 4.

Signed-off-by: Martin Åberg <martin.aberg@gaisler.com>
2020-11-13 14:53:55 -08:00
Martin Åberg 42b8a5cbca boards: Add GR716-MINI Development Board
GR716A microcontroller evaluation board with features an 80-pin
mezzanine connector. Also supports simulating with TSIM3.

Signed-off-by: Martin Åberg <martin.aberg@gaisler.com>
2020-11-13 14:53:55 -08:00
Martin Åberg 7e296403b7 soc: GR716A LEON3FT Microcontroller
This adds support for the GR716A fault-tolerant LEON3 microcontroller.

Signed-off-by: Martin Åberg <martin.aberg@gaisler.com>
2020-11-13 14:53:55 -08:00
Martin Åberg d5e0ae9d7a boards: Add generic_leon3 for FPGA design
This board configuration is compatible with
- GRLIB GPL FPGA template designs
- TSIM3 LEON3 eval

Signed-off-by: Martin Åberg <martin.aberg@gaisler.com>
2020-11-13 14:53:55 -08:00
Martin Åberg 34014deb0f boards: Add qemu_leon3
This board configuration can be used out-of-the-box with SPARC QEMU
distributed with Zephyr SDK v0.11.2.

Signed-off-by: Martin Åberg <martin.aberg@gaisler.com>
2020-11-13 14:53:55 -08:00
Martin Åberg bf28bbbcec soc: LEON3 SPARC V8 Processor
This is a generic SOC description applicable to common LEON3 systems.

Signed-off-by: Martin Åberg <martin.aberg@gaisler.com>
2020-11-13 14:53:55 -08:00
Martin Åberg c107714214 sanitycheck: Add TSIM3 support
TSIM3 is a LEON processor and system simulator.

This commit allows using TSIM sanitycheck and the make run target.

TSIM parameters can be further specified in the board configuration
using TSIM and TSIM_SYS.

Signed-off-by: Martin Åberg <martin.aberg@gaisler.com>
2020-11-13 14:53:55 -08:00
Martin Åberg bb5a565aaa timer: Add support for GRLIB GPTIMER
This adds support for GRLIB GPTIMER general purpose timer used in
LEON3/4/5 systems.

One of the GPTIMER subtimers is used to generate periodic interrutps
for announcing ticks. Another subtimer is used as upcounter for the
cycle_get_32() service.

Signed-off-by: Martin Åberg <martin.aberg@gaisler.com>
2020-11-13 14:53:55 -08:00
Martin Åberg ae309f8597 serial: apbuart interrupt support
Adds driver support for APBUART transmitter and receiver
interrupts. Compatible with APBUART implementations without HW FIFO
interrupt, for example QEMU.

Signed-off-by: Martin Åberg <martin.aberg@gaisler.com>
2020-11-13 14:53:55 -08:00
Martin Åberg 4888afd793 serial: Add support for GRLIB APBUART
This adds support for the GRLIB APBUART UART peripheral commonly used in
LEON3/4/5 systems.

Driver features:
- Auto-detecting debug FIFO, if configured by GRMON
- Setting and getting UART transfer attributes
- Hardware FIFO if available
- Any number of APBUART devices based on devicetree
- Error status indication
- Polled operation

Signed-off-by: Martin Åberg <martin.aberg@gaisler.com>
2020-11-13 14:53:55 -08:00
Martin Åberg 1a3784d6b7 intc: Add support for GRLIB IRQMP
This adds support for the GRLIB IRQMP interrupt controller commonly used
in LEON3/4/5 systems.

The driver supports the 15 SPARC interrupts and 16 extended interrupts.

Signed-off-by: Martin Åberg <martin.aberg@gaisler.com>
2020-11-13 14:53:55 -08:00
Martin Åberg 5d38a006a5 sparc: Add testsuite support
This commit provides the timestamp_serialize() define for the SPARC
architecture.

Co-authored-by: Nikolaus Huber <nikolaus.huber.melk@gmail.com>
Signed-off-by: Martin Åberg <martin.aberg@gaisler.com>
2020-11-13 14:53:55 -08:00
Martin Åberg ffc89b59a2 sparc: Add compiler and linker tool support
GCC and binutils support for the SPARC architecture.

Co-authored-by: Nikolaus Huber <nikolaus.huber.melk@gmail.com>
Signed-off-by: Martin Åberg <martin.aberg@gaisler.com>
2020-11-13 14:53:55 -08:00
Martin Åberg 97f6dfdd72 cmake: SPARC workaround for SDK toolchain 0.11
Zephyr SDK version 0.11.3, 0.11.4 and 0.12.0-beta-1 does not have
the required SPARC target support.

Zephyr CI is currently using SDK 0.11.3, which causes the following
build error:

CMake Error at /workdir/zephyr/cmake/compiler/gcc/target.cmake:10
(message):
  C compiler /opt/sdk/zephyr-sdk-0.11.3//bin/-gcc not found - Please
  check your toolchain installation

This patch adds a workaround such that the SDK target.cmake is picked
up from the directory 0.11 when ARCH=sparc.

Signed-off-by: Martin Åberg <martin.aberg@gaisler.com>
2020-11-13 14:53:55 -08:00
Martin Åberg f8d1a9e5ea cmake: Added SPARC support
This commit defines the tool prefix and command line options for the
Zephyr SPARC architectural port.

Signed-off-by: Martin Åberg <martin.aberg@gaisler.com>
2020-11-13 14:53:55 -08:00
Martin Åberg feae3249b2 sparc: add support for thread local storage
Adds the necessary bits to initialize TLS in the stack
area and sets up CPU registers during context switch. Register g7 is
used to point to the thread data. Thread data is accessed with negative
offsets from g7.

Signed-off-by: Martin Åberg <martin.aberg@gaisler.com>
2020-11-13 14:53:55 -08:00
Martin Åberg 07160fa153 arch: Add SPARC processor architecture
SPARC is an open and royalty free processor architecture.

This commit provides SPARC architecture support to Zephyr. It is
compatible with the SPARC V8 specification and the SPARC ABI and is
independent of processor implementation.

Functionality specific to SPRAC processor implementations should
go in soc/sparc. One example is the LEON3 SOC which is part of this
patch set.

The architecture port is fully SPARC ABI compatible, including trap
handlers and interrupt context.

Number of implemented register windows can be configured.

Some SPARC V8 processors borrow the CASA (compare-and-swap) atomic
instructions from SPARC V9. An option has been defined in the
architecture port to forward the corresponding code-generation option
to the compiler.

Stack size related config options have been defined in sparc/Kconfig
to match the SPARC ABI.

Co-authored-by: Nikolaus Huber <nikolaus.huber.melk@gmail.com>
Signed-off-by: Martin Åberg <martin.aberg@gaisler.com>
2020-11-13 14:53:55 -08:00
Martin Åberg 188efb5bfb logging: change default stack size on SPARC
The default stack size of 768 is just too small for SPARC.

Signed-off-by: Martin Åberg <martin.aberg@gaisler.com>
2020-11-13 14:53:55 -08:00
Martin Åberg 6f4bcf7933 libc: minimal: Add SPARC support
This commit defines the off_t type for SPARC.

Signed-off-by: Martin Åberg <martin.aberg@gaisler.com>
2020-11-13 14:53:55 -08:00
Martin Åberg 6d126e7481 lib/posix: SPARC newlib has unsigned short mode_t
This commit eliminates a compilation error by passing int to va_arg
rather than mode_t on SPARC.

Newlib sys/_types.h defines mode_t for SPARC as:
  typedef unsigned short __mode_t;

GCC 10.2.0 gave the following error message and suggested solution:

mqueue.c: In function 'mq_open':
mqueue.c:61:21: error: 'mode_t' {aka 'short unsigned int'} is promoted
 to 'int' when passed through '...' [-Werror]
   61 |   mode = va_arg(va, mode_t);
      |                     ^
mqueue.c:61:21: note: (so you should pass 'int' not 'mode_t' {aka 'short
unsigned int'} to 'va_arg')

Signed-off-by: Martin Åberg <martin.aberg@gaisler.com>
2020-11-13 14:53:55 -08:00
Martin Åberg 2b1baf6e33 debug: openocd: Support for building on SPARC
This adds the pieces needed for openocd.c to compile when ARCH=SPARC.
In particular, it allows the tracing.osawareness.openocd sample to
build and run.

Signed-off-by: Martin Åberg <martin.aberg@gaisler.com>
2020-11-13 14:53:55 -08:00
Martin Åberg b5bab421b7 tests: Avoid out-of-bounds array access on SPARC
The test reads and writes outside the bounds of an array allocated on
the stack in check_input(). This commit disables the test on SPARC.

Signed-off-by: Martin Åberg <martin.aberg@gaisler.com>
2020-11-13 14:53:55 -08:00
Martin Åberg 645b411448 tests: kernel: context: SPARC support
This test requires explicit architecture support, which this commit adds
for SPARC.

Signed-off-by: Martin Åberg <martin.aberg@gaisler.com>
2020-11-13 14:53:55 -08:00
Martin Åberg d2409ec0f7 tests: Big endian support in bitfield test
The BIT_INDEX() macro assumed little-endian. This commit adds
big-endian support, conditioned on the preprocessor define
CONFIG_BIG_ENDIAN.

Signed-off-by: Martin Åberg <martin.aberg@gaisler.com>
2020-11-13 14:53:55 -08:00