Commit graph

77416 commits

Author SHA1 Message Date
Fabio Baltieri b76ac9a851 input: convert the kscan_sdl driver from kscan to input
Convert the SDL driver to use the input subsystem. This is specifically
meant to emulate touchscreen drivers, so it's setup to send triplet of
x, y, touch for touch-on events and just touch off on touch off events.

Renamed the driver to input-sdl-touch since now we can also develop an
sdl driver for simulating key events.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2023-04-11 09:34:23 +02:00
Marc Herbert fad2da39aa intel_adsp: move west sign from west flash to earlier west build
Invoking `west sign` in `west build` accelerates twister because `west
build` is run in parallel, see rationale in superseded and very
different (CMake-based) PR #52942.

To maximize backwards compatibility:
- `west sign` is optional in `west build`
- `west flash` will sign (again) if any rimage --option is passed

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2023-04-10 22:04:47 -04:00
Marc Herbert 2c80c4daa4 west: sign: add new rimage option --if-tool-available
Moving `west sign` from `west flash` to `west build` for rimage has
multiple advantages (including a bit more consistency with
imgtool). However it makes `west build` fail when rimage is missing.

To avoid forcing every CI and developer who never used it before to
install rimage, make signing optional when passing new `west sign`
option --if-tool-available. A clear warning is printed.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2023-04-10 22:04:47 -04:00
Marc Herbert 5c4319d54f west: sign: clean any stale rimage output
We never want to leave stale outputs behind after failing.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2023-04-10 22:04:47 -04:00
Marc Herbert 5bdb1467cf west: sign: define filename constants earlier in rimage signer
Zero functional change, pure preparation for the next commit.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2023-04-10 22:04:47 -04:00
Marc Herbert 2fbcdb5ff2 west: sign: add new west config [rimage].extra-args and a default key
Make RIMAGE_SIGN_KEY a CMake CACHE variable so `west sign` can find it
and use it as a default value.

Fixes https://github.com/thesofproject/sof/issues/6917

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2023-04-10 22:04:47 -04:00
Marc Herbert 66ac6252ed west: sign: add west config [rimage].path = /path/to/rimage
Add a 3rd option besides --tool-path and $PATH

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2023-04-10 22:04:47 -04:00
Marc Herbert dedb002214 west: sign: rimage: simplify rimage --tool-data code
Reduce duplication, no functional change except for a shorter log
statement with slightly less information.

This is required by the next commits.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2023-04-10 22:04:47 -04:00
Marc Herbert 5831164e7a west: sign: add west config [sign].tool = rimage/imgtool
The --tool parameter is not required anymore thanks a [sign] entry in
west config like this one:

```
[sign]
tool = imgtool
```

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2023-04-10 22:04:47 -04:00
Marc Herbert 030b740bd1 west: sign: add ability to read parameters from west config
No functional change yet, will be used in the next commits.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2023-04-10 22:04:47 -04:00
Marc Herbert efb855134e west: sign: rimage: add default value '-c sof/rimage/config'
Don't force 99% of the users to pass the same value.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2023-04-10 22:04:47 -04:00
Fabio Baltieri 6e3339c5ee templates: bug: add a note about project forks
Add a note in the issue template mentioning that bugs in project forks
should be reported on the fork issue tracker.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2023-04-10 18:36:39 -04:00
Yuval Peress d6062d36d0 rtio: Update sensor_batch_processing sample
Update the sample to use mempool feature

Signed-off-by: Yuval Peress <peress@google.com>
2023-04-10 18:34:43 -04:00
Yuval Peress dbb470ea7a rtio: Add a managed memory pool for reads
- Introduce a new Kconfig to enable mempool in RTIO
- Introduce a new RTIO_DEFINE_WITH_MEMPOOL to allocate an RTIO context
  with an associated memory pool.
- Add a new sqe read function rtio_sqe_read_with_pool() for memory pool
  enabled RTIO contexts
- Allow IODevs to allocate only the memory they need via rtio_sqe_rx_buf()
- Allow the consumer to get the allocated buffer via
  rtio_cqe_get_mempool_buffer()
- Consumers need to release the buffer via rtio_release_buffer() when
  processing is complete.

Signed-off-by: Yuval Peress <peress@google.com>
2023-04-10 18:34:43 -04:00
Yuval Peress 80d70b4e96 rtio: Add cqe per each sqe in transaction
Update the policy such that every completed sqe has a parallel cqe.
This has the primary purpose of making any reads in the sqe visible
to the consumer (since they might have different buffers).

Signed-off-by: Yuval Peress <peress@google.com>
2023-04-10 18:34:43 -04:00
Kumar Gala af79019146 armstdc: add string.h & strings.h header
Add string.h header that declerates prototype for strnlen()
as this is not provided by the toolchain headers.

Add strings.h to allow anything that expects strncasecmp() to
be defined there to build correctly.  The arm toolchain actually
defines strncasecmp() in <string.h> so we just have <strings.h>
include <string.h>.

Signed-off-by: Kumar Gala <kumar.gala@intel.com>
2023-04-10 16:32:10 -05:00
Kumar Gala 20b21091cc armstdc: Fixup headers as needed by posix
* Move 'struct _timespec' into sys/_timespec.h as expected by
  <posix/time.h>.

* Introduce 'struct timeval' in sys/_timeval.h as expected by
  <posix/time.h>.

* Add mode_t to <sys/types.h> as expected by <posix/stat.h>

Signed-off-by: Kumar Gala <kumar.gala@intel.com>
2023-04-10 16:32:10 -05:00
Kumar Gala 82538a2d28 armclang: add empty sys/cdefs.h
Various headers include <sys/cdefs.h> like zephyr/posix/sys/stat.h.
When building with the arm-clang toolchain we utilize armstdc
so we need an empty cdefs.h similar to what minimal libc has so
things will build.

Signed-off-by: Kumar Gala <kumar.gala@intel.com>
2023-04-10 16:32:10 -05:00
Keith Packard b272f468d3 tests/lib/mpsc_pbuf: Increase timeout on concurrent test to 120 seconds
There are long delays in this test which make it always take more than 60
seconds to complete.

Signed-off-by: Keith Packard <keithp@keithp.com>
2023-04-10 22:02:46 +09:00
Keith Packard bc5c75cc5a modules/picolibc: Update to version 1.8.1
We're already using all of the relevant changes from 1.8.1, but it's good
to use a released version instead of an intermediate revision.

Signed-off-by: Keith Packard <keithp@keithp.com>
2023-04-10 22:02:46 +09:00
Maureen Helm da633c6148 drivers: sensor: wsen_tids: Store sensor trigger as a pointer
Fixes the wsen_tids sensor driver to store the user-supplied sensor
trigger as a pointer rather than a copy. This enables the trigger
handler to use CONTAINER_OF to retrieve a context pointer when the
trigger is embedded in a larger struct.

Signed-off-by: Maureen Helm <maureen.helm@intel.com>
2023-04-08 18:38:02 +02:00
Maureen Helm a392d8727c drivers: sensor: wsen_itds: Store sensor trigger as a pointer
Fixes the wsen_itds sensor driver to store the user-supplied sensor
trigger as a pointer rather than a copy. This enables the trigger
handler to use CONTAINER_OF to retrieve a context pointer when the
trigger is embedded in a larger struct.

Signed-off-by: Maureen Helm <maureen.helm@intel.com>
2023-04-08 18:38:02 +02:00
Maureen Helm cb28e8321e drivers: sensor: wsen_hids: Store sensor trigger as a pointer
Fixes the wsen_hids sensor driver to store the user-supplied sensor
trigger as a pointer rather than a copy. This enables the trigger
handler to use CONTAINER_OF to retrieve a context pointer when the
trigger is embedded in a larger struct.

Signed-off-by: Maureen Helm <maureen.helm@intel.com>
2023-04-08 18:38:02 +02:00
Maureen Helm 078024515b drivers: sensor: vcnl4040: Store sensor trigger as a pointer
Fixes the vcnl4040 sensor driver to store the user-supplied sensor
trigger as a pointer rather than a copy. This enables the trigger
handler to use CONTAINER_OF to retrieve a context pointer when the
trigger is embedded in a larger struct.

Signed-off-by: Maureen Helm <maureen.helm@intel.com>
2023-04-08 18:38:02 +02:00
Maureen Helm 07632a931f drivers: sensor: tmp108: Store sensor trigger as a pointer
Fixes the tmp108 sensor driver to store the user-supplied sensor
trigger as a pointer rather than a copy. This enables the trigger
handler to use CONTAINER_OF to retrieve a context pointer when the
trigger is embedded in a larger struct.

Signed-off-by: Maureen Helm <maureen.helm@intel.com>
2023-04-08 18:38:02 +02:00
Maureen Helm e43edc95d5 drivers: sensor: tmp007: Store sensor trigger as a pointer
Fixes the tmp007 sensor driver to store the user-supplied sensor
trigger as a pointer rather than a copy. This enables the trigger
handler to use CONTAINER_OF to retrieve a context pointer when the
trigger is embedded in a larger struct.

Signed-off-by: Maureen Helm <maureen.helm@intel.com>
2023-04-08 18:38:02 +02:00
Maureen Helm 56927686b3 drivers: sensor: sx9500: Store sensor trigger as a pointer
Fixes the sx9500 sensor driver to store the user-supplied sensor
trigger as a pointer rather than a copy. This enables the trigger
handler to use CONTAINER_OF to retrieve a context pointer when the
trigger is embedded in a larger struct.

Signed-off-by: Maureen Helm <maureen.helm@intel.com>
2023-04-08 18:38:02 +02:00
Maureen Helm 5ca231ae91 drivers: sensor: stts751: Store sensor trigger as a pointer
Fixes the stts751 sensor driver to store the user-supplied sensor
trigger as a pointer rather than a copy. This enables the trigger
handler to use CONTAINER_OF to retrieve a context pointer when the
trigger is embedded in a larger struct.

Signed-off-by: Maureen Helm <maureen.helm@intel.com>
2023-04-08 18:38:02 +02:00
Maureen Helm 4a97373f15 drivers: sensor: sm351lt: Store sensor trigger as a pointer
Fixes the sm351lt sensor driver to store the user-supplied sensor
trigger as a pointer rather than a copy. This enables the trigger
handler to use CONTAINER_OF to retrieve a context pointer when the
trigger is embedded in a larger struct.

Signed-off-by: Maureen Helm <maureen.helm@intel.com>
2023-04-08 18:38:02 +02:00
Maureen Helm 0c1c77889c drivers: sensor: sht3xd: Store sensor trigger as a pointer
Fixes the sht3xd sensor driver to store the user-supplied sensor
trigger as a pointer rather than a copy. This enables the trigger
handler to use CONTAINER_OF to retrieve a context pointer when the
trigger is embedded in a larger struct.

Signed-off-by: Maureen Helm <maureen.helm@intel.com>
2023-04-08 18:38:02 +02:00
Maureen Helm 6836d03dc0 drivers: sensor: qdec_nrfx: Store sensor trigger as a pointer
Fixes the qdec_nrfx sensor driver to store the user-supplied sensor
trigger as a pointer rather than a copy. This enables the trigger
handler to use CONTAINER_OF to retrieve a context pointer when the
trigger is embedded in a larger struct.

Signed-off-by: Maureen Helm <maureen.helm@intel.com>
2023-04-08 18:38:02 +02:00
Maureen Helm ddf78eb7b8 drivers: sensor: pcnt_esp32: Store sensor trigger as a pointer
Fixes the pcnt_esp32 sensor driver to store the user-supplied sensor
trigger as a pointer rather than a copy. This enables the trigger
handler to use CONTAINER_OF to retrieve a context pointer when the
trigger is embedded in a larger struct.

Signed-off-by: Maureen Helm <maureen.helm@intel.com>
2023-04-08 18:38:02 +02:00
Maureen Helm 19b9bb800a drivers: sensor: mpu9250: Store sensor trigger as a pointer
Fixes the mpu9250 sensor driver to store the user-supplied sensor
trigger as a pointer rather than a copy. This enables the trigger
handler to use CONTAINER_OF to retrieve a context pointer when the
trigger is embedded in a larger struct.

Signed-off-by: Maureen Helm <maureen.helm@intel.com>
2023-04-08 18:38:02 +02:00
Maureen Helm b7e97e2807 drivers: sensor: mpu6050: Store sensor trigger as a pointer
Fixes the mpu6050 sensor driver to store the user-supplied sensor
trigger as a pointer rather than a copy. This enables the trigger
handler to use CONTAINER_OF to retrieve a context pointer when the
trigger is embedded in a larger struct.

Signed-off-by: Maureen Helm <maureen.helm@intel.com>
2023-04-08 18:38:02 +02:00
Maureen Helm 6ae88621d2 drivers: sensor: mcux_acmp: Store sensor trigger as a pointer
Fixes the mcux_acmp sensor driver to store the user-supplied sensor
trigger as a pointer rather than a copy. This enables the trigger
handler to use CONTAINER_OF to retrieve a context pointer when the
trigger is embedded in a larger struct.

Signed-off-by: Maureen Helm <maureen.helm@intel.com>
2023-04-08 18:38:02 +02:00
Maureen Helm 958b7abd26 drivers: sensor: mcp9808: Store sensor trigger as a pointer
Fixes the mcp9808 sensor driver to store the user-supplied sensor
trigger as a pointer rather than a copy. This enables the trigger
handler to use CONTAINER_OF to retrieve a context pointer when the
trigger is embedded in a larger struct.

Signed-off-by: Maureen Helm <maureen.helm@intel.com>
2023-04-08 18:38:02 +02:00
Kumar Gala c09e8fae23 twister: Use pyelf to extract symbol information
For ztest twister would parse the symbol information that was
generated as part of the build (zephyr.symbols).  However the format
of the zephyr.symbols files is highly dependant on the toolchain.

Move to using pyelf to parse the symbol information directly from
zephyr.elf instead so that this works regardless of toolchain.

Signed-off-by: Kumar Gala <kumar.gala@intel.com>
2023-04-08 18:37:52 +02:00
Kumar Gala 53bae96793 twister: allow get_elf_file() to be called on native platforms
On native platforms we typically have CONFIG_BUILD_OUTPUT_EXE set so
we end up with both zephyr.elf and zephyr.exe.  This would cause a
call to get_elf_file() to fail.  There isn't any reason to error out
since zephyr.elf and zephyr.exe should be identical.  So allow it
if the platform type is native.

Signed-off-by: Kumar Gala <kumar.gala@intel.com>
2023-04-08 18:37:52 +02:00
Dmitrii Golovanov f31aab58d5 twister: Add configurable flashing timeout
Use explicit flash command execution timeout at DeviceHandler
instead of the hardcoded value of 60 sec.

When a HW platform executes test cases right after the flash command,
the test case remaining timeout is affected by how much time the flash
operation consumes. Some simulation platforms need to spend significant
amount of time on each 'flash' cycle, usually adding the same delay on
each test case.

This improvement adds two new command line options and device map fields:

  --device-flash-timeout - for the flash operation timeout
  ('flash-timeout' device map field).

  --device-flash-with-test - to indicate that the platform flash
  command also runs a test case, so the overall timeout should be
  calculated as a sum of the flash timeout and the current test case
  timeout to receive all console output from the platform
  ('flash-with-test' device map field).

The device map field values override command line values for the
particular platform where configured.

Default behavior is backward compatible: flash operation fixed timeout
is 60 sec. not including the test case timeout.

Signed-off-by: Dmitrii Golovanov <dmitrii.golovanov@intel.com>
2023-04-08 18:37:33 +02:00
Lucas Tamborrino 9e4d1a817c tests: kernel: fpu_sharing: generic: add xtensa testing
Add xtensa arch to FPU test.

Signed-off-by: Lucas Tamborrino <lucas.tamborrino@espressif.com>
2023-04-08 12:34:25 +02:00
Lucas Tamborrino fcd9234111 soc: xtensa: esp32s3: Add FPU support
Enable FPU on esp32s3

Signed-off-by: Lucas Tamborrino <lucas.tamborrino@espressif.com>
2023-04-08 12:34:25 +02:00
Marcin Niestroj 850ed72214 Bluetooth: logging: don't imply LOG_FUNC_NAME_PREFIX_*
By default there is only CONFIG_LOG_FUNC_NAME_PREFIX_DBG=y enabled. When
both Bluetooth (CONFIG_BT=y) and logging (CONFIG_LOG=y) subsystems are
enabled, then other CONFIG_LOG_FUNC_NAME_PREFIX_{INF,WRN,ERR}=y options are
pulled in as well using an 'imply' Kconfig command indirectly from
`CONFIG_BT_LOG`. This behavior was introduced recently as part of
commit af01a0f313 ("Bluetooth: Logging: Move all logging symbols
together") with no explicit reason provided.

Pulling in LOG_FUNC_NAME_PREFIX_* options automatically with (CONFIG_BT=y
&& CONFIG_LOG=y) blows up flash usage. As an example of downstream project
(nRF52840-based, with Bluetooth and WiFi connectivity), it increases flash
usage from 473668 bytes to 487856 bytes. This seems "only" 3% difference,
but this is actually a lot when there is no good reason why this happens.
Downstream users quite often compare flash sizes of subsequent Zephyr
releases and this 3% footprint increase might be a blocker at some point.
Additionally, it is not trivial to find the root cause of footprint
increase for most (non-expert) users.

The reason why there is so much footprint overhead because of
CONFIG_LOG_FUNC_NAME_PREFIX_*=y is because each function in the
codebase (be it Zephyr or downstream application) that contains logging
macros (LOG_{DBG,INF,WRN,ERR}()) is bloated because the function name has
to be included in the output image.

Remove 'imply LOG_FUNC_NAME_PREFIX_*' commands from 'menuconfig BT_LOG'
option, so that flash usage does not increase too much. Those logging
options are not enabled by other subsystems, so Bluetooth should not be an
exception here.

Signed-off-by: Marcin Niestroj <m.niestroj@emb.dev>
2023-04-08 12:34:07 +02:00
Kumar Gala 5c4d184016 emul: Use STRUCT_SECTION macros for emul devices
Clean up emulator code to utilize macros for handling sections.

Signed-off-by: Kumar Gala <kumar.gala@intel.com>
2023-04-08 12:33:54 +02:00
Al Semjonovs f659740483 tdk_robokit1: Add alias for thermometer sample app
Add ambient-temp0 alias to verify via sample app

Signed-off-by: Al Semjonovs <asemjonovs@google.com>
2023-04-07 16:23:17 -05:00
Al Semjonovs 5d4352f322 sensor: Generic driver for NTC Thermistor
Driver for NTC Thermistors attached to ADC

Signed-off-by: Al Semjonovs <asemjonovs@google.com>
2023-04-07 16:23:17 -05:00
Al Semjonovs fb8d8c5773 scripts: Create a script to generate an NTC thermistor R/T table
Script to generate an R/T table in device tree format given
R25 and Beta values.

Signed-off-by: Al Semjonovs <asemjonovs@google.com>
2023-04-07 16:23:17 -05:00
Al Semjonovs 9fa35bc9a0 adc: Add TI ADS7052 SPI driver
Add driver for TI ADS7052.

Signed-off-by: Al Semjonovs <asemjonovs@google.com>
2023-04-07 16:23:17 -05:00
Kumar Gala 336803e96f tests: iterable_sections: Add missing zephyr_iterable_section
As the test is for iterable sections, we need to utilize
zephyr_iterable_section for targets that need linker script
generation like arm-clang.

So add zephyr_iterable_section() for the RAM & ROM sections
that the testcases utilizes.

Signed-off-by: Kumar Gala <kumar.gala@intel.com>
2023-04-07 18:59:00 +02:00
Kamil Serwus 71d0394752 sam: atsamc2x: dmac enable, fix uart-async
Enable dmac driver for C2x in dtsi file.
Fix tests for atsamc21n_xpro board by adding
overlay.

Signed-off-by: Kamil Serwus <kserwus@gmail.com>
2023-04-07 18:58:24 +02:00
Benjamin Lindqvist 7d23e03566 drivers: sensor: bmi270: Add support for motion, DRDY triggers
This commit adds support for ANY_MOTION and DATA_READY interrupts for
the BMI270. To implement this, a different config blob than the
"max_fifo" blob has to be used.

Signed-off-by: Benjamin Lindqvist <benjamin@eub.se>
2023-04-07 18:58:16 +02:00