Commit graph

106223 commits

Author SHA1 Message Date
Marvin Ouma
8faa486430 tests: posix: common: separate posix signal tests into a smaller testsuite
posix.common contains testsuites that can be separated into smaller
groups of tests. This change moves signal tests into a singular
testsuite at tests/posix/signals app directory.

Signed-off-by: Marvin Ouma <pancakesdeath@protonmail.com>
2024-11-29 05:42:17 +01:00
Chaitanya Tata
9762c32115 wifi: Update help/notes for forcing regulatory domain
With recent changes the regulatory domain is handled via the hostap
rather than by passing and going through the driver and hostap doesn't
have any option for forcing the regulatory domain, so, add a note to
reflect that this is implementation dependent to cover both hostap as
well other offloaded implementations.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
2024-11-29 05:42:03 +01:00
Gerard Marull-Paretas
6b11e91ce0 boards: microchip: remove CONFIG_PINCTRL=y entries
They are no longer needed, drivers select this as needed.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2024-11-29 05:41:53 +01:00
Gerard Marull-Paretas
c4c53f87fe soc: microchip: mec*: remove redundant PINCTRL/GPIO defconfigs
These options must be selected by drivers that use the associated
APIs.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2024-11-29 05:41:53 +01:00
Gerard Marull-Paretas
4f6de0169c drivers: microchip xec: select PINCTRL
All drivers using the pinctrl API must select the PINCTRL option.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2024-11-29 05:41:53 +01:00
Rex Chen
03482705f7 modules: hostap: fix eap server ttls macro typo
Fix typo of CONFIG_EAP_SERVER_TTLS macro in CMakeList.txt.

Signed-off-by: Rex Chen <rex.chen_1@nxp.com>
2024-11-28 20:53:41 +01:00
Gerard Marull-Paretas
9465610d9f samples, tests: lora: remove CONFIG_SPI|GPIO=y
This is no longer needed, drivers selects SPI and GPIO as needed.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2024-11-28 20:53:11 +01:00
Gerard Marull-Paretas
55cdc5a93e drivers: lora: sx12xx: select SPI and GPIO
Instead of depending on SPI/GPIO. This allows to just enable
CONFIG_LORA=y + DT node in the application layer. The same
pattern is nowadays followed by most drivers.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2024-11-28 20:53:11 +01:00
Gerard Marull-Paretas
e913a97489 dts: arm: rakwireless: add RAK3172 LoRaWAN module
Add DT definitions for the RAK3172 LoRaWAN module, based on
STM32WLE5.

Ref. https://docs.rakwireless.com/product-categories/wisduo/
             rak3172-module/low-level-development/

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2024-11-28 20:52:54 +01:00
Jukka Rissanen
16669ec4d5 tests: net: dns: Add test for invalid DNS answer parsing
Make sure we catch invalid answer during parsing.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-11-28 20:52:20 +01:00
Jukka Rissanen
6e7fcff579 net: dns: Check DNS answer properly
The dns_unpack_answer() did not check the length of the message
properly which can cause out of bounds read.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-11-28 20:52:20 +01:00
Jukka Rissanen
43c2b9cfe8 net: dns: Validate source buffer length properly
Make sure that when copying the qname, the source buffer is large
enough for the data.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-11-28 20:52:20 +01:00
Jukka Rissanen
6f96915a14 tests: net: dns: Add checking of malformed packet
Make sure we test malformed packet parsing.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-11-28 20:52:20 +01:00
Jukka Rissanen
eb2550a441 net: dns: Check parsing error properly for response
If the packet parsing fails in dns_unpack_response_query(), then
do not continue further but bail out early.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-11-28 20:52:20 +01:00
Jukka Rissanen
3c59bd4fb5 net: wifi_cred: Decrease flash usage for error print strings
As the error print strings are very similar, construct the final
output at runtime to save some flash space.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-11-28 20:52:06 +01:00
Jukka Rissanen
8deebcec21 net: wifi_cred: Remove extra empty lines
Follow net coding style and remove extra new lines between
variable set and checking its value.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-11-28 20:52:06 +01:00
Jukka Rissanen
b2056e0966 net: wifi_cred: Introduce variables at the start of function
Follow the net coding style and declare the variables at the start
of the function.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-11-28 20:52:06 +01:00
Jukka Rissanen
3aa0c8670e net: wifi_cred: Check null before access
We must do null check before trying to access the fields.

Fixes #81980
Coverify-CID: 434549

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-11-28 20:52:06 +01:00
Andy Ross
b4fb833eb9 soc/mediatek/adsp: Source timer rate from DTS
These devices have an architecturally fixed 13 MHz clock device.  But
thankfully you can put a default into a DTS binding so we don't have
to repeat it for all of them.

Signed-off-by: Andy Ross <andyross@google.com>
2024-11-28 20:51:50 +01:00
Andy Ross
09495c9e48 soc/mediatek: Ruffify python scripts
These in-tree scripts fail the new ruff checks.  Clean things up so
modifications can merge.

Signed-off-by: Andy Ross <andyross@google.com>
2024-11-28 20:51:50 +01:00
Andy Ross
fe5c11db05 boards/mediatek: Add mt8196_adsp
Add Zephyr support for the Audio DSP on the MT8196 SOC.  This is a
very similar device to previous designs.  Most of this patch is just
DTS.

The biggest delta is the more complicated second level interrupt
controller, though it is still able to be represented using some
vaguely clever DTS config over the older intc_mtk_adsp driver.

Also the memory layout is slightly different, requiring a little
indirection to set the initial boot stack address and log output
buffer.  And the timer "irq_ack" register bits moved.

Signed-off-by: Andy Ross <andyross@google.com>
2024-11-28 20:51:50 +01:00
Andy Ross
e35de00f86 soc/mtk_adsp: Update gen_img.py address space rules
New platform has different mappings.  Auto-detect rather than parse
dts or similar, as this is is really just a simple format for testing.

Signed-off-by: Andy Ross <andyross@google.com>
2024-11-28 20:51:50 +01:00
Andy Ross
3c0269f4f6 soc/mtk_adsp: Add missing z_prep_c() prototype
The early boot function got renamed to a pseudo-standard "z_prep_c",
but this isn't an actual API and doesn't have a prototype in the
headers anywhere, so the compiler started whining about an undeclared
function.

Signed-off-by: Andy Ross <andyross@google.com>
2024-11-28 20:51:50 +01:00
Andy Ross
4b3874b9ea boards/mediated: Add twister.yaml
Add a twister YAML file for these devices.  Right now they're flagged
as xt-clang only, though xcc and SOF-derived gcc toolchains are known
to work too.  We'll enable the zephyr SDK once sdk-ng support lands.

Signed-off-by: Andy Ross <andyross@google.com>
2024-11-28 20:51:50 +01:00
Andy Ross
cc43e3a527 soc/mediatek: Add missing snippets sections
This got missed by the first version, but recent SOF needs it for
STRUCT_SECTION_ITERABLE usage.

Signed-off-by: Andy Ross <andyross@google.com>
2024-11-28 20:51:50 +01:00
Andy Ross
2b8d542815 boards/mtk_adsp: Add a doc page
Simple docs for this board family.  Not a lot of complexity currently.

Signed-off-by: Andy Ross <andyross@google.com>
2024-11-28 20:51:50 +01:00
Andy Ross
5364783ba1 soc: boards: Add Mediatek MT8186 and MT8188 audio DSPs
These are very similar devices to mt8195, minimal changes needed
beyond boilerplate configuration.

In the process, this reworks the board/soc layout to be HWMv2
compliant, with "adsp" becoming a CPU cluster beneath the SOC.  So the
name of the boards to west become e.g. "mt8195/mt8195/adsp" (which can
be shortened to "mt8195//adsp" if desired).

Note that the cpuclk driver is not yet ported, it works only with 8195
(the clocking/power architecture seems similar between the parts, but
the graph of wells and clocks is different and historically these have
been three separate drivers in SOF).  The biggest changes are in the
image/loader scripts, which needed some rework for cross-device
portability.

Signed-off-by: Andy Ross <andyross@google.com>
2024-11-28 20:51:50 +01:00
Andy Ross
cdd4cbcc67 soc/mtk_adsp: Remove "msg" API
This is a feature of the 8195 DSP only, which is used only vestigially
by SOF to store data that nothing reads.  The Linux kernel on the
other side uses a shared driver for all 81xx devices, which does not
expose the feature.  It seems to work, but it's not worth maintaining
a driver in tree for legacy hardware that will never use it.

Signed-off-by: Andy Ross <andyross@google.com>
2024-11-28 20:51:50 +01:00
Andy Ross
48a84911ac soc/mtk_adsp: Add default console hook
Wire the default printk output to the console at boot, just to be sure
we have stdio output good enough to get tests to pass.

Signed-off-by: Andy Ross <andyross@google.com>
2024-11-28 20:51:50 +01:00
Andy Ross
f7c10ac194 arch: Let CONFIG_IRQ_OFFLOAD_NESTED be overridable
This is currently selected by the arch, but some devices (in paticular
xtensa ones which have configurable interrupt setups) might not
actually be able to effect an irq_offload() from within an ISR even
though we have code for it.

Make this a default and not a select so that lower layers can override
the setting.

Signed-off-by: Andy Ross <andyross@google.com>
2024-11-28 20:51:50 +01:00
Jan Kuliga
8ba134cea6 drivers: auxdisplay: hd44780: implement busy-flag polling mechanism
HD44780 controller can indicate via busy flag whether it's finished
processing current command. This allows for faster completion of HD44780
commands as seen from MCU perspective, as the MCU doesn't have to wait
for fixed long period of time. Implement this functionality.

Signed-off-by: Jan Kuliga <jtkuliga@gmail.com>
2024-11-28 20:51:39 +01:00
Jan Kuliga
1b784f9892 drivers: auxdisplay: hd44780: rework the initialization procedure
If proper power supply is used to power the hd44780, it initializes
correctly on a reset condition all by itself. However,
if the power supply is below its expectations (e.g. some 3.3V Nucleo
board), it won't initialize properly on its own, and the MCU
has to carry out the initialization as listed in the reference manual.
Since we cannot determine it properly in the runtime,
always carry out the initialization procedure.

Signed-off-by: Jan Kuliga <jtkuliga@gmail.com>
2024-11-28 20:51:39 +01:00
Jan Kuliga
91a14dcc50 drivers: auxdisplay: hd44780: add rs-line-delay dt parameter
In order for the driver to be compliant with the timing sequence
diagrams presented in the reference manual, the MCU has to wait
for some additional period of time while setting both the rs and rw
lines.

Signed-off-by: Jan Kuliga <jtkuliga@gmail.com>
2024-11-28 20:51:39 +01:00
Jan Kuliga
55de1c9719 drivers: auxdisplay: hd44780: get rid of excessive delays
Express delay values in nanoseconds. Set the default delay time values
as specified in the HD44780 reference manual.

Signed-off-by: Jan Kuliga <jtkuliga@gmail.com>
2024-11-28 20:51:39 +01:00
Jan Kuliga
537182a96a drivers: auxdisplay: hd44780: rework auxdisplay_hd44780_command()
Make this function more concise in order to introduce busy-flag polling
mechanism later on.

Signed-off-by: Jan Kuliga <jtkuliga@gmail.com>
2024-11-28 20:51:39 +01:00
Jan Kuliga
e8dc0c6f42 drivers: auxdisplay: hd44780: set rw_gpio line value only once
There's no need to set this line every single time a command is sent
to the HD44780. Set it only once, so that one can save some cpu cycles.

Signed-off-by: Jan Kuliga <jtkuliga@gmail.com>
2024-11-28 20:51:39 +01:00
Andreas Rudolf
7d2251381e doc: devicetree: clarify child node disabling
Add a note to status property that disabled parent nodes do not
implicitly disable child nodes.

Issue #82040

Signed-off-by: Andreas Rudolf <andreas.rudolf@husqvarnagroup.com>
2024-11-28 15:44:43 +00:00
Johann Fischer
1a5ab2c16e usb: device_next: fix null pointer dereference in Get Interface
Respond with a Request Error in default and addressed states.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2024-11-28 15:43:56 +00:00
Wilfried Chauveau
468ce19e9c twister: testplan: fix robot filter when there is no simulator
#79174 incorectly interpreted the condition. If no simulator is found
if cannot be "renode" and therefore robot should be considered unsupported.

Signed-off-by: Wilfried Chauveau <wilfried.chauveau@arm.com>
2024-11-28 15:43:48 +00:00
Robert Lubos
df79f10513 net: lib: http_server: Verify fs_read result for filesystem resources
Verify the result of the fs_read() operation when handling filesystem
resources, and abort processing the resource in case of errors.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2024-11-28 15:43:32 +00:00
Stig Bjørlykke
95333705e5 net: lwm2m: Reset server timestamps after bootstrap
Reset the server timestamps after bootstrap to handle a case
where a new server instance has replaced the bootstrap server
instance.

Signed-off-by: Stig Bjørlykke <stig.bjorlykke@nordicsemi.no>
2024-11-28 15:43:18 +00:00
Robert Lubos
35820f23f6 net: lwm2m: Add missing NULL pointer check in shell
In case lwm2m_get_engine_obj_field() fails to find a corresponding
object field when iterating resource instances, simply skip that
resource instance when printing object instance contents.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2024-11-28 15:43:04 +00:00
Stig Bjørlykke
48de0fcd73 net: lwm2m: Fix index for default disabled_until
Use correct index to set disabled_until default value in
server_create().

Signed-off-by: Stig Bjørlykke <stig.bjorlykke@nordicsemi.no>
2024-11-28 15:42:54 +00:00
Stig Bjørlykke
633269a913 net: lwm2m: Accept OMA TLV in LwM2M 1.1
Support write OMA TLV resource instance in LwM2M 1.1.
Accept OMA TLV as default content format.

Signed-off-by: Stig Bjørlykke <stig.bjorlykke@nordicsemi.no>
2024-11-28 15:42:42 +00:00
Jukka Rissanen
3bd4000712 net: dns: mdns_responder: Interface name might miss terminating null
The network interface name that is copied to if_req struct might
be missing terminating null for IPv4.

This is fixing the IPv4 issue which was missed in previous fix attempt.

Fixes #74795
Coverity-CID: 368797

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-11-28 15:42:32 +00:00
Jukka Rissanen
bf091fc909 net: ipv6: Check return value from mbedtls_md_setup
Bail out if mbedtls_md_setup() returns an error.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-11-28 15:42:08 +00:00
Jukka Rissanen
26d033b790 net: ipv6_pe: Check return value from mbedtls_md_setup
Bail out if mbedtls_md_setup() returns an error.

Fixes #81950
Coverify-CID: 434626

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-11-28 15:42:08 +00:00
Stig Bjørlykke
7d20d3a28c net: lwm2m: Make BinaryAppDataContainer instances configurable
Add Kconfig variables for BinaryAppDataContainer instance count
and data instance count.

Signed-off-by: Stig Bjørlykke <stig.bjorlykke@nordicsemi.no>
2024-11-28 15:41:52 +00:00
Ilya Tagunov
07b4d3a297 posix: clock: partially reformat __z_clock_nanosleep
Apply clang-format to the offending lines to make it happy.

Signed-off-by: Ilya Tagunov <Ilya.Tagunov@synopsys.com>
2024-11-28 15:41:32 +00:00
Ilya Tagunov
4c56eb6f65 posix: clock: fix potential int32_t overflow in __z_clock_nanosleep
As k_sleep returns int32_t, there is a possibility for integer overflow
during conversion from milliseconds to nanoseconds.

Signed-off-by: Ilya Tagunov <Ilya.Tagunov@synopsys.com>
2024-11-28 15:41:32 +00:00