Commit graph

95529 commits

Author SHA1 Message Date
Daniel DeGrasse ed64818565 sd: sdio: rework frequency and timing selection logic
Reword frequency and timing selection logic for SDIO framework so that
the maximum supported timing mode between the card and host will be
selected, even if the maximum frequency supported by the host is not
equal to the maximum frequency for that mode.

Also, resolve an issue where a host and card combo only supporting HS
mode or worse would still use legacy timing mode, because the CCCR flags
were not being checked when checking if HS bus speed could be used.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2024-05-16 09:21:03 +02:00
Daniel DeGrasse 82ce2b412d sd: sdmmc: rework frequency and timing selection logic
SDMMC framework frequency and timing selection logic has several
longstanding issues, including:
- requiring that SD hosts support the maximum frequency possible for a
  given UHS mode in order to apply that timing
- selecting SDHC_TIMING_SDR25 for high speed mode, when SDHC_TIMING_HS
  would be correct

Rework the frequency and timing selection logic within the SD framework
to resolve these issues.

Fixes #52589
Fixes #67943

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2024-05-16 09:21:03 +02:00
Daniel DeGrasse 87030f4cbf sd: sdmmc: add DEFAULT and HIGH_SPEED bus speeds
Add DEFAULT and HIGH_SPEED bus speeds to SD spec definition, for non UHS
cards.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2024-05-16 09:21:03 +02:00
Daniel DeGrasse 06f3574685 include: zephyr: sd: sd_spec: add UNSUPPORTED frequency for HS mode
Add UNSUPPORTED frequency macro for HS mode frequencies, used when a
card does not support any high speed mode frequencies

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2024-05-16 09:21:03 +02:00
Daniel DeGrasse 771451f616 include: zephyr: sd: sd_spec: use frequency macros
Use frequency macros to define SD frequencies, this should increase
readability of the file and reduce errors.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2024-05-16 09:21:03 +02:00
Yong Cong Sin a82a54cd38 arch: riscv: remove unnecessary cast
Remove unnecessary cast of `fp` into `uintptr_t`.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
2024-05-16 09:20:19 +02:00
Yong Cong Sin 8c8123466a tests: arch: common: stack_unwind: cleanup Kconfig
Refactor to cleanup some Kconfigs that are not required by
certain architectures to produce the traces.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
2024-05-16 09:20:19 +02:00
Yong Cong Sin 9a4698159d arch: riscv: reorder fatal message
Print the backtrace message after the registers.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
2024-05-16 09:20:19 +02:00
Daniel DeGrasse 2be937dca4 tests: drivers: sdhc: setup SDHC IO before test
Rather than relying to the alphanumeric test ordering implemented in
ZTEST to ensure certain tests run first, setup the SDHC IO properties to
known good values before starting any of the tests. This allows the SDHC
tests to run in any order, rather than needing certain tests to run
first.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2024-05-16 09:18:07 +02:00
Mahesh Mahadevan a6b3b4bb96 boards: frdm_mcxn947: Add USBHS support
Add support for the USBHS controller

Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
2024-05-16 09:17:18 +02:00
Mahesh Mahadevan c68a8818c4 soc: n94x: Add USBHS support
Add support for USBHS controller

Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
2024-05-16 09:17:18 +02:00
Mahesh Mahadevan 04ce8801d9 dts: nxp_mcxn94x: Add USBHS support
Add support for the USB High Speed controller

Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
2024-05-16 09:17:18 +02:00
Mahesh Mahadevan d9e83c9026 drivers: usb: usb_dc_mcux: add case for MCXN94X SOC series
Add case for MCXN94X SOC series to indicate which device controller
is in use.

Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
2024-05-16 09:17:18 +02:00
Phi Bang Nguyen 8599c509b3 manifest: Update hal_nxp
Update NXP hal to the revision pointing to the following commit:

"drivers: csi: Rework to fix the low framerate issue"

Signed-off-by: Phi Bang Nguyen <phibang.nguyen@nxp.com>
2024-05-16 09:16:51 +02:00
Lyle Zhu fa6df6a51a Bluetooth: HFP_AG: Protect the consistency of AG state/value
Use hfp_ag_lock/hfp_ag_unlock to protect the consistency
of AG state or value.

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
2024-05-16 09:15:49 +02:00
Lyle Zhu 5da8916ad5 Bluetooth: classic: Kconfig: Move Kconfig of classic to classic/Kconfig
Create classic/Kconfig, and move all of classic from Kconfig to
classic/Kconfig.

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
2024-05-16 09:15:49 +02:00
Lyle Zhu 615fe2466b Bluetooth: RFCOMM: Kconfig: Add configure BT_RFCOMM_DLC_STACK_SIZE
The default stack size of RFCOMM DLC is 256.
The default value is sufficient for basic operation.

If more stack space is used (such as call function printk)
in context of callback disconnected of RFCOMM DLC, the
default stack size is not sufficient.

Add a configuration BT_RFCOMM_DLC_STACK_SIZE to configure
the RFCOMM DLC stack size.

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
2024-05-16 09:15:49 +02:00
Lyle Zhu 804dbdd43c Bluetooth: host: Kconfig: Change default value of BT_RFCOMM_TX_MAX
To avoid the case that CONN_TX is available but RFCOMM_TX is
unavailable, set the default value of BT_RFCOMM_TX_MAX to
BT_CONN_TX_MAX.

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
2024-05-16 09:15:49 +02:00
Lyle Zhu c3ac857438 Bluetooth: Kconfig: Set BT_BUF_EVT_RX_SIZE to 255 for BR/EDR
The maximum data length of event packet is 255 for BR/EDR.
Such as the data length of event Remote Name Request
Complete is 255.

Set BT_BUF_EVT_RX_SIZE to 255 to avoid error "Not enough
space in buffer" from bt_hci driver.

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
2024-05-16 09:15:49 +02:00
Lyle Zhu 4c7b19fa5a samples: Bluetooth: HFP_AG: Initialize version
Add a new example handsfree_ag to demonstrate
usage of the handsfree audio gateway APIs.

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
2024-05-16 09:15:49 +02:00
Lyle Zhu 514c78546c include: Bluetooth: Add BT COD macros to hci_types.h
Add macros to get Major Service Classes, Major Device
Class and Minor Device Class.

Define Major Device Class code.
Define Minor Device Class field for Computer Major
Class.
Define Minor Device Class field for Phone Major Class.
Define Minor Device Class field for Audio/Video Major
Class.

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
2024-05-16 09:15:49 +02:00
Lyle Zhu 84144c6833 Bluetooth: HFP_AG: Initialize HFP AG
Implement basic functions for HFP AG.

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
2024-05-16 09:15:49 +02:00
Dmitrii Golovanov 4efc035209 twister: Fix default command line dependency on --device-testing
Fix default command line options check dependency on `--device-testing`
when it is provided to run Twister and turn device command options
as mandatory.

Fixes after changes introduced with #72399.

Signed-off-by: Dmitrii Golovanov <dmitrii.golovanov@intel.com>
2024-05-15 15:13:19 -04:00
Johann Fischer bc183d1278 samples: usb: cdc_acm: set USBD_CDC_ACM_LOG_LEVEL to error
Set USBD_CDC_ACM_LOG_LEVEL to error.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2024-05-15 17:29:24 +01:00
Johann Fischer 2c0187ae84 samples: usb: cdc_acm: enable USB support only when device is connected
If the controller can detect VBUS state changes, enable USB support only
when the device is connected and disable it when the device is
disconnected.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2024-05-15 17:29:24 +01:00
Johann Fischer eb9b46c118 usb: device_next: lock scheduler in usbd_init()
Lock the scheduler to ensure that the context is not preempted before it
is fully initialized.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2024-05-15 17:29:24 +01:00
Johann Fischer c3ec41bdf8 usb: device_next: remove unused API function
Remove unused and not required usbd_ep_ctrl_buf_alloc().

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2024-05-15 17:29:24 +01:00
Johann Fischer ba2e257d06 drivers: udc_nrf: rework controller initialization
udc_init() only initializes and enables the USB regulator. This is
enough to detect VBUS changes, the USB controller is enabled in
udc_enable(). Deinitialization happens correspondingly in reverse order.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2024-05-15 17:29:24 +01:00
Johann Fischer 4c360f38d1 usb: device_next: add controller can detect VBUS state change capability
There are controllers with capability to detect VBUS state change. This
can be used in a generic application to explicitly handle the VBUS
detected event after usbd_init() and for example allow the PMIC to
detect to what type of port device controller is connected.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2024-05-15 17:29:24 +01:00
Johann Fischer 48f2a4bc1a usb: device_next: remove initialized state checks in event processing
For the simple events, do not check whether the device driver and stack
are marked as initialized. USB device notification will reschedule
delivery if the stack is not yet marked initialized.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2024-05-15 17:29:24 +01:00
Johann Fischer 693191467d usb: device_next: add USB device context to message delivery callback
Add USB device context argument to message delivery callback.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2024-05-15 17:29:24 +01:00
Johann Fischer 22d574cb3c usb: device_next: tweak USB device notification support
Since no threads are waiting for the FIFO and we do not need any k_fifo
features, we can just use slist.

Some notifications (caused by interrupts), especially "VBUS ready", can
be triggered very quickly right after UDC initialization if the USB
controller is already connected. Depending on the global thread
configuration, messsage publishing work can be executed before the
context is marked as initialized. Use delayed work to reschedule
publishing when the context is not initialized.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2024-05-15 17:29:24 +01:00
cyliang tw d545c1f377 dts: arm: nuvoton: add rtc node of numaker m2l31x
Update m2l31x.dtsi, to add one rtc node for rtc support.

Signed-off-by: cyliang tw <cyliang@nuvoton.com>
2024-05-15 17:11:28 +01:00
Zhaoxiang Jin 1805c4797f tests: drivers/regulator/voltage: Add regulator test for NXP frdm_mcxn947
Support regulator(vref) output vt oltage test for NXP frdm_mcxn947

Signed-off-by: Zhaoxiang Jin <Zhaoxiang.Jin_1@nxp.com>
2024-05-15 17:28:38 +02:00
Zhaoxiang Jin 3dc82a6606 tests: drivers/adc/adc_api: Support adc api test for NXP frdm_mcxn947
Support adc api test for NXP frdm_mcxn947

Signed-off-by: Zhaoxiang Jin <Zhaoxiang.Jin_1@nxp.com>
2024-05-15 17:28:38 +02:00
Zhaoxiang Jin a3bad67696 samples: drivers/adc: Support adc example for NXP frdm_mcxn947
Support adc example for NXP frdm_mcxn947

Signed-off-by: Zhaoxiang Jin <Zhaoxiang.Jin_1@nxp.com>
2024-05-15 17:28:38 +02:00
Zhaoxiang Jin 85087e2d5d boards: nxp/frdm_mcxn947: Support lpadc for NXP frdm_mcxn947
Support lpadc for NXP frdm_mcxn947

Signed-off-by: Zhaoxiang Jin <Zhaoxiang.Jin_1@nxp.com>
2024-05-15 17:28:38 +02:00
Zhaoxiang Jin 979d90bb95 boards: nxp/frdm_mcxn947: Support vref for NXP frdm_mcxn947
Support vref for NXP frdm_mcxn947

Signed-off-by: Zhaoxiang Jin <Zhaoxiang.Jin_1@nxp.com>
2024-05-15 17:28:38 +02:00
Zhaoxiang Jin 71c60a84f1 dts: arm/nxp/mcxn94x: Add lpadc nodes for NXP mcxn94x
Add lpadc nodes for NXP mcxn94x

Signed-off-by: Zhaoxiang Jin <Zhaoxiang.Jin_1@nxp.com>
2024-05-15 17:28:38 +02:00
Zhaoxiang Jin f61c6fdf06 dts: arm/nxp/mcxn94x: Add vref node for NXP MCXN94x
Add the vref node for NXP MCXN94x

Signed-off-by: Zhaoxiang Jin <Zhaoxiang.Jin_1@nxp.com>
2024-05-15 17:28:38 +02:00
Zhaoxiang Jin db87c6c0ff drivers: adc: Support regulator output as reference to LPADC
Support regulator output different voltage as reference to LPADC
the regulator output voltage can be set through property
zephyr,vref-mv

Signed-off-by: Zhaoxiang Jin <Zhaoxiang.Jin_1@nxp.com>
2024-05-15 17:28:38 +02:00
Zhaoxiang Jin 23e37896d8 docs: releases/migration-guide-3.7: Add NXP regulator driver info
Add NXP regulator (nxp,vref) driver info

Signed-off-by: Zhaoxiang Jin <Zhaoxiang.Jin_1@nxp.com>
2024-05-15 17:28:38 +02:00
Zhaoxiang Jin fd736c4f2d drivers: regulator/nxp_vref: Remove nxp_ground_select property
Remove nxp_ground_select property.
Delete the use of NXP vref peripheral CSR register REFL_GRL_SEL bit.

Signed-off-by: Zhaoxiang Jin <Zhaoxiang.Jin_1@nxp.com>
2024-05-15 17:28:38 +02:00
Zhaoxiang Jin 5dde5416b3 drivers: regulator/nxp_vref: Fixed incorrect input parameter
Fixed incorrect parameter passed in function linear_range_get_value.

Signed-off-by: Zhaoxiang Jin <Zhaoxiang.Jin_1@nxp.com>
2024-05-15 17:28:38 +02:00
Daniel DeGrasse 22fa0c0885 test: drivers: disk: disk_access: add STM32 specific testcase
STM32 devices with an SDMMC driver will still need to be tested, but
they do not use the SDHC framework for their disk driver. Therefore, add
a special testcase to validate disk access support for devices with the
STM32 specific SDMMC DT compatible enabled.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2024-05-15 17:28:21 +02:00
Daniel DeGrasse 6d2df0dbf7 boards: st: remove "- sdhc" tag from supported list
SDHC twister tag indicates that the board supports an SD host controller
driver. Since the ST SDMMC support is provided directly via a disk
driver, SDHC tests are not supported on ST boards. Drop this tag in
order to avoid twister failures running the SDHC tests on these
platforms.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2024-05-15 17:28:21 +02:00
Lukasz Mrugala f71a4184f3 scripts: twister: Fix Unit Tests on Windows systems
Unit tests currently are not runnable on Windows systems, failing
on two testfiles: test_jobserver.py and test_testsuite.py.

This commit removes code dependency on Windows-unavailable
elements on Windows systems via skipping the offending tests.

Signed-off-by: Lukasz Mrugala <lukaszx.mrugala@intel.com>
2024-05-15 17:08:06 +02:00
Ayush Singh 56882e2d91 net: zperf: Fix upload ping timeout error
Fixes remote address for ping before upload. This caused the ping in zperf
upload to timeout as shown in the following output:

```
uart:~$ zperf udp upload 2001:db8::2 5001 10 50 1M
Remote port is 5001
Connecting to 2001:db8::2
Duration:       10.00 s
Packet size:    50 bytes
Rate:           1000 kbps
Starting...
ping 2001:db8::2 timeout
Rate:           1.00 Mbps
Packet duration 390 us
```

Fixes: https://github.com/zephyrproject-rtos/zephyr/issues/68674

Signed-off-by: Ayush Singh <ayushdevel1325@gmail.com>
2024-05-15 17:07:58 +02:00
Mykola Kvach 69c6732d23 drivers: regulator: fixed warning during build in gpio regulator
Fix warning in gpio regulator:
    "declaration of 'ret' shadows a previous local".

Signed-off-by: Mykola Kvach <xakep.amatop@gmail.com>
2024-05-15 17:07:51 +02:00
Evgeniy Paltsev 62e32fa7c2 MAINTAINERS: Synopsys: add nsim cmake support file
Add nsim cmake support file as parts of Synopsys platform

Signed-off-by: Evgeniy Paltsev <PaltsevEvgeniy@gmail.com>
Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
2024-05-15 17:07:43 +02:00