Commit graph

46465 commits

Author SHA1 Message Date
Pawel Czarnecki 967d336dae boards: riscv: litex_vexriscv: enable clock control driver
This enables the LiteX clock control driver for litex_vexriscv platform.

Signed-off-by: Pawel Czarnecki <pczarnecki@internships.antmicro.com>
Signed-off-by: Mateusz Holenko <mholenko@antmicro.com>
2020-12-06 12:35:16 -05:00
Pawel Czarnecki ed6c0103a9 drivers: clock control: Add LiteX clock control driver
This commit adds LiteX SoC Builder clock control driver for MMCM
module. It gives ability to change frequency, phase and duty cycle
on up to 7 clock outputs.

Signed-off-by: Pawel Czarnecki <pczarnecki@internships.antmicro.com>
Signed-off-by: Mateusz Holenko <mholenko@antmicro.com>
2020-12-06 12:35:16 -05:00
Pawel Czarnecki 98fd9d0975 boards/dts: riscv: litex_vexriscv: add clock control driver to devicetree
This extends litex_vexriscv.dts file by adding clock controller nodes.

Signed-off-by: Pawel Czarnecki <pczarnecki@internships.antmicro.com>
Signed-off-by: Mateusz Holenko <mholenko@antmicro.com>
2020-12-06 12:35:16 -05:00
Pawel Czarnecki 3c054dfd54 dts: riscv: litex_vexriscv: update copyrights
This updates Antmicro copyright header.

Signed-off-by: Pawel Czarnecki <pczarnecki@internships.antmicro.com>
Signed-off-by: Mateusz Holenko <mholenko@antmicro.com>
2020-12-06 12:35:16 -05:00
Pawel Czarnecki a9bdf38d03 dts: bindings: clock: add LiteX clock control bindings
This adds bindings for the LiteX clock control driver.

Signed-off-by: Pawel Czarnecki <pczarnecki@internships.antmicro.com>
Signed-off-by: Mateusz Holenko <mholenko@antmicro.com>
2020-12-06 12:35:16 -05:00
Mateusz Holenko 21542749eb CODEOWNERS: simplify LiteX-related entries
This adds a generic entry for all LiteX-related
drivers.

Signed-off-by: Mateusz Holenko <mholenko@antmicro.com>
2020-12-06 12:35:16 -05:00
Carlo Caione d9666ff4d0 qemu_cortex_a53: Get SRAM info from DTS
SRAM base address and size are currently hardcoded in the defconfig.
This is wrong because symbols like KERNEL_RAM_SIZE and KERNEL_VM_BASE
are not currently being set. Fix this by adding the correct DTS entry.

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
2020-12-05 10:24:54 -05:00
Jingru Wang 5f2aa0409c toolchain: improved toolchain abstraction for compilers and linker
Accodind to c55c64e to update code

Signed-off-by: Jingru Wang <jingru@synopsys.com>
2020-12-05 10:19:50 -05:00
Martin Jäger 916dd0f6c4 drivers: watchdog: iwdg_stm32: Fix timeout calculation
CONFIG_IWDG_STM32_TIMEOUT allowed values of 100 us for initial watchdog
timeout, which was actually rounded to zero in the driver, which uses
milliseconds resolution for timeouts. This resulted in the reload value
being set to maximum possible (calculation: 0U - 1).

This commit updates the calculation of timeout minimum and maximum
values considering the actual LSI frequency of the used MCU.

As the resolution of CONFIG_IWDG_STM32_TIMEOUT in microseconds doesn't
make sense if the driver supports only milliseconds, it is renamed to
IWDG_STM32_INITIAL_TIMEOUT (this prevents accidental wrong settings in
existing firmware) and the unit is changed to ms.

Signed-off-by: Martin Jäger <martin@libre.solar>
2020-12-04 23:09:42 -05:00
Vinayak Kariappa Chettimada e6911bc06c Bluetooth: controller: Fix Coded PHY S2 S8 coding use
Fix PHY Update control procedure to accept the preferred Tx
coding options (S2 or S8) requested even if there is no
actual PHY change happening on procedure completion.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2020-12-04 23:08:51 -05:00
Andrzej Kaczmarek e9cece87bb Bluetooth: controller: Add definitions for AdvA and TargetA offsets
Both AdvA and TargetA have constant offset in extended header so it
makes sense to have dedicated definitions for those numbers.
AdvA is always placed at the beginning on extended header while TargetA
follows AdvA directly. There are no PDUs without AdvA and with only
TargetA.

Offsets of other fields depends on extended header contents and thus
are non constant.

Signed-off-by: Andrzej Kaczmarek <andrzej.kaczmarek@codecoup.pl>
2020-12-04 23:08:15 -05:00
Andrzej Kaczmarek 99226e1e95 Bluetooth: controller: Add ext_hdr member to pdu_adv_com_ext_adv
'ext_hdr' member only covers extended header part of 'ext_hdr_adv_data'
and with addition of 'data' member to 'pdu_adv_ext_hdr' those can be
used to quickly access both extended header flags and data directly
from 'pdu_adv' without need for extra local variables and casts.

Signed-off-by: Andrzej Kaczmarek <andrzej.kaczmarek@codecoup.pl>
2020-12-04 23:08:15 -05:00
Andrzej Kaczmarek def072ea65 Bluetooth: controller: Rename pdu_adv_hdr to pdu_adv_ext_hdr
pdu_adv_hdr name is quite confusing since it suggests some generic
header for advertising PDUs while this in fact is extended header
which is a part of common extended advertising payload and only applies
to extended advertising PDUs.

Signed-off-by: Andrzej Kaczmarek <andrzej.kaczmarek@codecoup.pl>
2020-12-04 23:08:15 -05:00
Andrzej Kaczmarek 014eb0ddf8 Bluetooth: controller: Rename ext_hdr_adi_adv_data
The 'adi' part of that member name does not make sense since ADI is
already part of extended header, so we only have 'extended header' and
'advertising data'.

Signed-off-by: Andrzej Kaczmarek <andrzej.kaczmarek@codecoup.pl>
2020-12-04 23:08:15 -05:00
Flavio Ceolin 9a16097fd8 kernel: sched: Change variable name in z_tick_sleep
Change a variable name to avoid confusion between time and ticks.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2020-12-04 23:05:57 -05:00
Flavio Ceolin 7a815d5d99 kernel: sched: Use k_ticks_t in z_tick_sleep
z_tick_sleep was using int32_t what could cause a possible overflow
when converting from k_ticks_t.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2020-12-04 23:05:57 -05:00
Katsuhiro Suzuki 8453a73ede kernel: init: activate FPU for main thread
This patch activates FPU feature for main thread if FPU related
configs (FPU, FPU_SHARING) are enabled.

Signed-off-by: Katsuhiro Suzuki <katsuhiro@katsuster.net>
2020-12-04 23:05:08 -05:00
Andrzej Kaczmarek 85adca4be3 Bluetooth: controller: Use proper handle in advertising events
If handle mapping is enabled, we need to use proper advertising set
handle in HCI event.

Signed-off-by: Andrzej Kaczmarek <andrzej.kaczmarek@codecoup.pl>
2020-12-04 16:31:44 -05:00
Jukka Rissanen 517fd3b91b codeowners: Add myself for GSM modem files
I have been working on the GSM modem files so would like to
review future patches.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-12-04 12:16:54 -06:00
Jukka Rissanen f0f4b334b9 codeowners: Update scripts/net/ owners
Patrik Flykt (pfl) is no longer working on this.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-12-04 12:16:54 -06:00
Andrzej Kaczmarek 77fd7fdbd7 Bluetooth: controller: Initialize scan rsp only for legacy adv
When legacy set is configured we need to make sure scan response is
properly initialized with empty data. For extended sets we should not
touch scan response on configure since data for those sets have to be
set explicitly, e.g. we cannot enable scannable advertising set if no
data was set.

Signed-off-by: Andrzej Kaczmarek <andrzej.kaczmarek@codecoup.pl>
2020-12-04 17:44:13 +01:00
Andrzej Puzdrowski 694a9af1dd settings: fix possible unaligned write while a line coping
It was possible that settings_line_entry_copy() did unaligned
flash write.
This patch introduce respecting the flash write-block-size.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2020-12-04 17:10:47 +01:00
Andrzej Kaczmarek e4c39d6e19 Bluetooth: controller: Fix AdvA/TgtA for extended adv PDUs
AdvA in extended advertising PDUs was only set if random address was
used. This patch enables proper support for AdvA/TgtA in those PDUs
also with LL Privacy enabled.

On enable, we always update advertising PDU (i.e. ADV_IND, ADV_EXT_IND
or ADV_AUX_IND, depending on advertising set parameters) as well as
scan response PDU.

On RPA timeout, we simply copy old PDU as-is and update AdvA in new
PDU, since both PDUs are exactly the same (except AdvA) so no need to
recreate it step-by-step.

Signed-off-by: Andrzej Kaczmarek <andrzej.kaczmarek@codecoup.pl>
2020-12-04 17:09:46 +01:00
Emil Gydesen b527f80f0f Bluetooth: controller: Guard ll_adv_iso_by_hci_handle_* functions
Guards the functions with CONFIG_BT_CTLR_HCI_ADV_HANDLE_MAPPING
and added a non-HCI inline function for them.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2020-12-04 17:09:33 +01:00
Emil Gydesen 2c67c29fd4 Bluetooth: controller: Remove empty BIS packet tx from ULL
The empty BIS packet should be enqueue and handled in the LLL.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2020-12-04 17:09:33 +01:00
Emil Gydesen 47e716ba83 Bluetooth: controller: removed node_rx for big create/terminate
Removed the node_rx argument for the BIG create/terminate
functions. The event should not be sent right after the
command, but needs to wait for transmissions of
empty BIS packets or BIG terminate indications.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2020-12-04 17:09:33 +01:00
Emil Gydesen b32af6a643 Bluetooth: controller: ll_big_create add check if handle already created
Adds a check to verify that the BIG handle isn't already allocated.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2020-12-04 17:09:33 +01:00
Emil Gydesen 146fd961ef Bluetooth: controller: ull_adv_iso merge unknown adv id check
Merges the 3 checks for checking valid adv when creating a big.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2020-12-04 17:09:33 +01:00
Emil Gydesen 9c9253db5f Bluetooth: controller: Move ISO tx functionality to ull_iso.c
Moves the ISO tx pool and functions from ull_adv_iso.c to
ull_iso.c as the pool and functions will be shared between
BIS and CIS.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2020-12-04 17:09:33 +01:00
Emil Gydesen e1aa633e67 Bluetooth: controller: Rearrange functions in ull_adv_iso.c
Rearranged the functions so the order of functions match
the common pattern in other ULL files.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2020-12-04 17:09:33 +01:00
Emil Gydesen 4971ad1be6 Bluetooth: controller: Add initial basic ISO broadcast test
Adds a initial ISO broadcast test case that simply
creates, waits and terminates a BIG using the ll API.

The newly created test directory can be expanded to contain
connected ISO (CIS) tests as well in the future.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2020-12-04 17:09:33 +01:00
Emil Gydesen 41fe6d72a1 Bluetooth: controller: Implements BIG terminate command
Implements the BIG terminate command that terminates a
BIG and returns the appropriate events.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2020-12-04 17:09:33 +01:00
Emil Gydesen 339b9b8df5 Bluetooth: controller: BIG create sends empty BIS PDUs (ULL)
When a BIG is create, it will now start sending empty BIS PDUs;
at least from an ULL perspective, as the LLL support is still
missing.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2020-12-04 17:09:33 +01:00
Emil Gydesen 5a512fbe2f Bluetooth: controller: Implements ULL handling for BIG create command
Implements handling of the BIG create command in the upper link layer.
Does not yet handle sending any BIS events.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2020-12-04 17:09:33 +01:00
Jukka Rissanen cc528d37c2 net: syslog: Make sure CONFIG_LOG_IMMEDIATE is not set
The immediate logging option cannot be used with network logging
support CONFIG_LOG_BACKEND_NET as that would cause the generated
rsyslog messages to be malformed. The UDP packets would only have
one byte payloads which is not correct. So make sure that user is
not able to select a configuration with immediate mode and network
logging.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-12-04 15:46:42 +02:00
Jedrzej Ciupis 8621e87fb8 west.yml: Update hal_nordic revision
This commit brings a bugfix for nRF IEEE 802.15.4 hp_timer platform
in hal_nordic repo.

Signed-off-by: Jedrzej Ciupis <jedrzej.ciupis@nordicsemi.no>
2020-12-04 15:32:17 +02:00
Carlo Caione 7e36bd31fe arch: aarch64: Use SP_EL0 instead of SP_ELx
ARM64 is currently using SP_ELx as stack pointer for kernel and threads
because everything is running in EL1. If support for EL0 is required, it
is necessary to switch to use SP_EL0 instead, that is the only stack
pointer that can be accessed at all exception levels by threads.

While it is not required to keep using SP_EL0 also during the
exceptions, the current code implementation makes it easier to use the
same stack pointer as the one used by threads also during the
exceptions.

This patch moves the code from using SP_ELx to SP_EL0 and fill in the
missing entries in the vector table.

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
2020-12-04 08:13:42 -05:00
Andrei Gansari 8f7d73900d modules: tfm: BL2 default comment
Adds a comment regarding the effect of TFM_BL2_CONFIG_FILE_DEFAULT on
building TFM images.

Signed-off-by: Andrei Gansari <andrei.gansari@nxp.com>
2020-12-04 15:06:56 +02:00
Andrei Gansari 42523a39e3 samples: tfm_integration: lpc55s69 documentation
Update sample documentations to reflect the new way to flash
lpcxpresso55s69 boards with TFM.

Signed-off-by: Andrei Gansari <andrei.gansari@nxp.com>
2020-12-04 15:06:56 +02:00
Andrei Gansari f48c82ebe7 boards: lpcxpresso55s69: enable TFM with MCUboot
Set building TFM with MCUboot. Set the build configuration to
profile_medium, we need smaller TFM images to fit into flash.
Build MCUboot, TFM, sign it, sign Zephyr NS image and merge all the
images. Also change the other configuration, BL2=OFF, to merge as a
single image.
Update documentation on how to flash the board.

Signed-off-by: Andrei Gansari <andrei.gansari@nxp.com>
2020-12-04 15:06:56 +02:00
Andrei Gansari d969debb10 boards: lpcxpresso55s69: BL2=OFF memory settings
Create a special configuration when BL2=OFF is set. DTS partitioning is
used for MCUboot, but does not match TFM's flash_layout.h configuration
when BL2=OFF, DTS matches when BL2=ON.

Signed-off-by: Andrei Gansari <andrei.gansari@nxp.com>
2020-12-04 15:06:56 +02:00
Andrei Gansari 38c5cf63e9 boards: lpcxpresso55s69: partition refactor
Refactor lpcxpresso55s69's partitions to match TFM's flash_layout.h
configuration. This matches TFM with MCUboot configuration.

Signed-off-by: Andrei Gansari <andrei.gansari@nxp.com>
2020-12-04 15:06:56 +02:00
Martin Åberg 0b69c558f4 doc: release 2.5: Announce the SPARC FPU support
The SPARC architecture support added in Zephyr 2.5 provides FPU
support.

Signed-off-by: Martin Åberg <martin.aberg@gaisler.com>
2020-12-04 14:33:43 +02:00
Martin Åberg ebcdb210e3 tests/float_disable: ported to SPARC
Enable the test for SPARC and take into account that
arch_float_disable() returns -ENOSYS.

Signed-off-by: Martin Åberg <martin.aberg@gaisler.com>
2020-12-04 14:33:43 +02:00
Martin Åberg 5fc94948a8 tests/fpu_sharing: ported to SPARC
Added the bits and pieces required to run the test on SPARC.

Signed-off-by: Martin Åberg <martin.aberg@gaisler.com>
2020-12-04 14:33:43 +02:00
Martin Åberg 6265e2b42a tests/sprintf: FP tests independent of endian
The test access double variables as individual uint32_t. This
commit ensures that the correct uint32_t is accessed, based on
CONFIG_BIG_ENDIAN.

Signed-off-by: Martin Åberg <martin.aberg@gaisler.com>
2020-12-04 14:33:43 +02:00
Martin Åberg 5166b74d5f boards: set CPU_HAS_FPU on LEON3 soc and boards
GR716A and QEMU has FPU.

Signed-off-by: Martin Åberg <martin.aberg@gaisler.com>
2020-12-04 14:33:43 +02:00
Martin Åberg 53a4acb2dc SPARC: add FPU support
This change adds full shared floating point support for the SPARC
architecture.

All SPARC floating point registers are scratch registers with respect
to function call boundaries. That means we only have to save floating
point registers when switching threads in ISR. The registers are
stored to the corresponding thread stack.

FPU is disabled when calling ISR. Any attempt to use FPU in ISR
will generate the fp_disabled trap which causes Zephyr fatal error.

- This commit adds no new thread state.
- All FPU contest save/restore is synchronous and lazy FPU context
  switch is not implemented.

Signed-off-by: Martin Åberg <martin.aberg@gaisler.com>
2020-12-04 14:33:43 +02:00
Martin Åberg 356d37fb7f SPARC: optimized interrupt stack frame size
With this change we allocate stack space only for the registers we
actually store in the thread interrupt stack frame.

Furthermore, no function is called on with the interrupt context save
frame %sp so no full frame is needed here. ABI functions are called
later in the interrupt trap handler, but that is after the dedicated
interrupt stack has been installed.

This saves 96 bytes of stack space for each interrupted context.

Signed-off-by: Martin Åberg <martin.aberg@gaisler.com>
2020-12-04 14:33:43 +02:00
Martin Åberg 3734465354 SPARC: optimized interrupt trap stores and loads
The input registers (i0..i7) are not modified by the interrupt trap
handler and are preserved by function calls. So we do not need to
store them in the interrupt stack frame.

This saves 48 bytes of stack space for each interrupted context,
and eliminates 4 double word stores and 4 double word loads.

Signed-off-by: Martin Åberg <martin.aberg@gaisler.com>
2020-12-04 14:33:43 +02:00