From 5249619f6a19a3265852ae8a7ceba1b703be4c58 Mon Sep 17 00:00:00 2001 From: Gerard Marull-Paretas Date: Tue, 5 Nov 2024 12:53:36 +0100 Subject: [PATCH 001/113] soc: nordic: nrf54h: gpd: fix compile warning when CONFIG_DEBUG=y Usage of K_SPINLOCK with CONFIG_DEBUG=y seems to trigger a compiler warning about request not always being initialized. Fallback to k_spin_lock/unlock calls to fix this issue. Signed-off-by: Gerard Marull-Paretas --- soc/nordic/nrf54h/gpd/gpd.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/soc/nordic/nrf54h/gpd/gpd.c b/soc/nordic/nrf54h/gpd/gpd.c index ea439a5446034a..d100c893538021 100644 --- a/soc/nordic/nrf54h/gpd/gpd.c +++ b/soc/nordic/nrf54h/gpd/gpd.c @@ -66,16 +66,19 @@ static int nrf_gpd_sync(struct gpd_onoff_manager *gpd_mgr) { int64_t start; nrfs_err_t err; + k_spinlock_key_t key; gdpwr_request_type_t request; - K_SPINLOCK(&gpd_mgr->mgr.lock) { - if (gpd_mgr->mgr.refs == 0) { - request = GDPWR_POWER_REQUEST_CLEAR; - } else { - request = GDPWR_POWER_REQUEST_SET; - } + key = k_spin_lock(&gpd_mgr->mgr.lock); + + if (gpd_mgr->mgr.refs == 0) { + request = GDPWR_POWER_REQUEST_CLEAR; + } else { + request = GDPWR_POWER_REQUEST_SET; } + k_spin_unlock(&gpd_mgr->mgr.lock, key); + atomic_clear_bit(&gpd_service_status, GPD_SERVICE_REQ_ERR); atomic_clear_bit(&gpd_service_status, GPD_SERVICE_REQ_OK); From 0a75809a8ec865c53556794f15c9c8e48b1a3c2f Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Fri, 1 Nov 2024 10:24:01 +0200 Subject: [PATCH 002/113] net: wifi: mgmt: Check string length in sscanf Make sure we are not able to overwrite string variables in sscanf call. Allocate also one extra byte for null terminator character. Fixes #80644 Signed-off-by: Jukka Rissanen --- subsys/net/l2/wifi/wifi_mgmt.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/subsys/net/l2/wifi/wifi_mgmt.c b/subsys/net/l2/wifi/wifi_mgmt.c index 11adc826cf4d6e..ac16e7d3a77ee6 100644 --- a/subsys/net/l2/wifi/wifi_mgmt.c +++ b/subsys/net/l2/wifi/wifi_mgmt.c @@ -23,7 +23,7 @@ LOG_MODULE_REGISTER(net_wifi_mgmt, CONFIG_NET_L2_WIFI_MGMT_LOG_LEVEL); #ifdef CONFIG_WIFI_NM_WPA_SUPPLICANT_ROAMING #define MAX_NEIGHBOR_AP_LIMIT 6U -#define MAX_EVENT_STR_LEN 32U +#define MAX_EVENT_STR_LEN 32 struct wifi_rrm_neighbor_ap_t { char ssid[WIFI_SSID_MAX_LEN + 1]; @@ -502,16 +502,21 @@ NET_MGMT_REGISTER_REQUEST_HANDLER(NET_REQUEST_WIFI_NEIGHBOR_REP_COMPLETE, void wifi_mgmt_raise_neighbor_rep_recv_event(struct net_if *iface, char *inbuf, size_t buf_len) { const uint8_t *buf = inbuf; - char event[MAX_EVENT_STR_LEN] = {0}; - char bssid[WIFI_SSID_MAX_LEN] = {0}; - char bssid_info[WIFI_SSID_MAX_LEN] = {0}; + char event[MAX_EVENT_STR_LEN + 1] = {0}; + char bssid[WIFI_SSID_MAX_LEN + 1] = {0}; + char bssid_info[WIFI_SSID_MAX_LEN + 1] = {0}; int op_class, channel, phy_type; int idx = roaming_params.neighbor_rep.neighbor_cnt; if (!buf || buf[0] == '\0') { return; } - if (sscanf(buf, "%s bssid=%s info=%s op_class=%d chan=%d phy_type=%d", + + if (sscanf(buf, + "%" STRINGIFY(MAX_EVENT_STR_LEN) "s " + "bssid=%" STRINGIFY(WIFI_SSID_MAX_LEN) "s " + "info=%" STRINGIFY(WIFI_SSID_MAX_LEN) "s " + "op_class=%d chan=%d phy_type=%d", event, bssid, bssid_info, &op_class, &channel, &phy_type) == 6) { int i; int match = 0; From 3e1e2ea8ecd2ec73e7d31e0c41c3f11984e38a4f Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Fri, 1 Nov 2024 22:01:11 +0200 Subject: [PATCH 003/113] net: wifi: mgmt: Use memcpy instead of strncpy Using strncpy gives this warning warning: 'strncpy' output may be truncated copying 32 bytes from a string of length 32 [-Wstringop-truncation] strncpy(roaming_params.neighbor_rep.neighbor_ap[idx].bssid_info, bssid_info, sizeof(roaming_params.neighbor_rep.neighbor_ap->bssid_info)); There is '\0' at the end of the allocated buffer so we can safely use memcpy() here to avoid any warnings. Signed-off-by: Jukka Rissanen --- subsys/net/l2/wifi/wifi_mgmt.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/subsys/net/l2/wifi/wifi_mgmt.c b/subsys/net/l2/wifi/wifi_mgmt.c index ac16e7d3a77ee6..3a1f611add1c37 100644 --- a/subsys/net/l2/wifi/wifi_mgmt.c +++ b/subsys/net/l2/wifi/wifi_mgmt.c @@ -535,14 +535,15 @@ void wifi_mgmt_raise_neighbor_rep_recv_event(struct net_if *iface, char *inbuf, } } if (!match && (roaming_params.neighbor_rep.neighbor_cnt < MAX_NEIGHBOR_AP_LIMIT)) { - strncpy((char *)roaming_params.neighbor_rep.neighbor_ap[idx].bssid, - bssid, sizeof(roaming_params.neighbor_rep.neighbor_ap[idx].bssid)); + memcpy((char *)roaming_params.neighbor_rep.neighbor_ap[idx].bssid, + bssid, + sizeof(roaming_params.neighbor_rep.neighbor_ap[idx].bssid)); len = strnlen(bssid, sizeof(bssid) - 1); roaming_params.neighbor_rep.neighbor_ap[idx].bssid[len] = (uint8_t)'\0'; - strncpy((char *)roaming_params.neighbor_rep.neighbor_ap[idx].bssid_info, - (bssid_info), - sizeof(roaming_params.neighbor_rep.neighbor_ap->bssid_info)); + memcpy((char *)roaming_params.neighbor_rep.neighbor_ap[idx].bssid_info, + bssid_info, + sizeof(roaming_params.neighbor_rep.neighbor_ap[idx].bssid_info)); len = strnlen(bssid_info, sizeof(bssid_info) - 1); roaming_params.neighbor_rep.neighbor_ap[idx].bssid_info[len] = (uint8_t)'\0'; From 6619d1566270f206ede6e45b5843a2208c1a339a Mon Sep 17 00:00:00 2001 From: Johann Fischer Date: Fri, 1 Nov 2024 10:53:55 +0100 Subject: [PATCH 004/113] doc: usb: update the USB device stack deprecation plans Deprecation has been postponed one version. Signed-off-by: Johann Fischer --- doc/connectivity/usb/device/usb_device.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/connectivity/usb/device/usb_device.rst b/doc/connectivity/usb/device/usb_device.rst index 30ee886ea8c3df..e0f5b9fc23932b 100644 --- a/doc/connectivity/usb/device/usb_device.rst +++ b/doc/connectivity/usb/device/usb_device.rst @@ -27,9 +27,9 @@ over time. It provides the following functionalities: .. note:: It is planned to deprecate all APIs listed in :ref:`usb_api` and the - functions that depend on them between Zephyr v3.7.0 and v4.0.0, and remove - them in v4.2.0. The new USB device support, represented by the APIs in - :ref:`usb_device_next_api`, will become the default in Zephyr v4.0.0. + functions that depend on them between Zephyr v4.0.0 and v4.1.0, and remove + them in v4.3.0. The new USB device support, represented by the APIs in + :ref:`usb_device_next_api`, will become the default in Zephyr v4.1.0. Supported USB classes ********************* From 0c299e66a45f5228ed538ee400d0a9bcd984dee6 Mon Sep 17 00:00:00 2001 From: Johann Fischer Date: Mon, 30 Sep 2024 12:53:20 +0200 Subject: [PATCH 005/113] drivers: udc_kinetis: reset control endpoint busy flags Reset control endpoint busy flags if configured and enabled, otherwise it could mark the wrong buffer as busy after endpoint disable/enable. Signed-off-by: Johann Fischer --- drivers/usb/udc/udc_kinetis.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/usb/udc/udc_kinetis.c b/drivers/usb/udc/udc_kinetis.c index 5a93d4a8b3a592..c471fb15ebda69 100644 --- a/drivers/usb/udc/udc_kinetis.c +++ b/drivers/usb/udc/udc_kinetis.c @@ -882,6 +882,8 @@ static int usbfsotg_ep_enable(const struct device *dev, if (cfg->addr == USB_CONTROL_EP_OUT) { struct net_buf *buf; + priv->busy[0] = false; + priv->busy[1] = false; buf = udc_ctrl_alloc(dev, USB_CONTROL_EP_OUT, USBFSOTG_EP0_SIZE); usbfsotg_bd_set_ctrl(bd_even, buf->size, buf->data, false); priv->out_buf[0] = buf; From 973f914b90a2e204165e9e32cdf4a653acc00cd9 Mon Sep 17 00:00:00 2001 From: Johann Fischer Date: Wed, 23 Oct 2024 11:23:23 +0200 Subject: [PATCH 006/113] drivers: udc_nrf: fix enqueue of control IN transfer with length 0 If the direction of the last setup packet is not to the device but to the host, then the transfer is not a status stage and should be queued. This is not checked and prevents a zero length control IN transfer to the host, e.g. used by the DFU class to indicate the end of the upload process. Signed-off-by: Johann Fischer --- drivers/usb/udc/udc_nrf.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/drivers/usb/udc/udc_nrf.c b/drivers/usb/udc/udc_nrf.c index c024d2a6a18470..2d1eb17d47231a 100644 --- a/drivers/usb/udc/udc_nrf.c +++ b/drivers/usb/udc/udc_nrf.c @@ -487,7 +487,7 @@ static void udc_nrf_power_handler(nrfx_power_usb_evt_t pwr_evt) } } -static void udc_nrf_fake_status_in(const struct device *dev) +static bool udc_nrf_fake_status_in(const struct device *dev) { struct udc_nrf_evt evt = { .type = UDC_NRF_EVT_STATUS_IN, @@ -497,7 +497,10 @@ static void udc_nrf_fake_status_in(const struct device *dev) if (nrf_usbd_common_last_setup_dir_get() == USB_CONTROL_EP_OUT) { /* Let controller perform status IN stage */ k_msgq_put(&drv_msgq, &evt, K_NO_WAIT); + return true; } + + return false; } static int udc_nrf_ep_enqueue(const struct device *dev, @@ -512,8 +515,9 @@ static int udc_nrf_ep_enqueue(const struct device *dev, udc_buf_put(cfg, buf); if (cfg->addr == USB_CONTROL_EP_IN && buf->len == 0) { - udc_nrf_fake_status_in(dev); - return 0; + if (udc_nrf_fake_status_in(dev)) { + return 0; + } } k_msgq_put(&drv_msgq, &evt, K_NO_WAIT); From 580707ed4d29299d7c3b1bb306aca378634cfe8b Mon Sep 17 00:00:00 2001 From: Chaitanya Tata Date: Fri, 1 Nov 2024 21:49:25 +0530 Subject: [PATCH 007/113] drivers: nrfwifi: Fixes from doc review Help text fixes from doc-team. Signed-off-by: Richa Pandey Signed-off-by: Chaitanya Tata --- drivers/wifi/nrfwifi/Kconfig.nrfwifi | 144 +++++++++++++-------------- 1 file changed, 68 insertions(+), 76 deletions(-) diff --git a/drivers/wifi/nrfwifi/Kconfig.nrfwifi b/drivers/wifi/nrfwifi/Kconfig.nrfwifi index 41bd04afc1238c..6679e40e048826 100644 --- a/drivers/wifi/nrfwifi/Kconfig.nrfwifi +++ b/drivers/wifi/nrfwifi/Kconfig.nrfwifi @@ -69,15 +69,14 @@ config NRF70_RADIO_TEST bool "Radio test mode of the nRF70 driver" config NRF70_OFFLOADED_RAW_TX - bool "Offloaded raw Tx mode of the nRF70 driver" + bool "Offloaded raw TX mode of the nRF70 driver" config NRF70_SYSTEM_WITH_RAW_MODES bool "nRF70 system mode with raw modes" depends on WIFI_NRF7002 || WIFI_NRF7001 select WIFI_NM_WPA_SUPPLICANT help - Select this option to enable system mode of the nRF70 driver with raw modes - + Select this option to enable system mode of the nRF70 driver with raw modes. endchoice config NRF70_SYSTEM_MODE_COMMON @@ -88,7 +87,7 @@ config NET_L2_ETHERNET default y if (!NRF70_RADIO_TEST && !NRF70_OFFLOADED_RAW_TX) config HEAP_MEM_POOL_ADD_SIZE_NRF70 - # Use a maximum that works for typical usecases and boards, each sample/app can override + # Use a maximum that works for typical use cases and boards, each sample/app can override # this value if needed by using CONFIG_HEAP_MEM_POOL_IGNORE_MIN def_int 25000 if NRF70_SCAN_ONLY def_int 150000 @@ -98,7 +97,7 @@ config NRF70_STA_MODE bool "nRF70 STA mode" default y help - Select this option to enable STA mode of the nRF70 driver + Select this option to enable STA mode of the nRF70 driver. config NRF70_AP_MODE bool "Access point mode" @@ -117,7 +116,7 @@ config NRF70_RAW_DATA_RX select EXPERIMENTAL config NRF70_PROMISC_DATA_RX - bool "promiscuous RX sniffer operation in the driver" + bool "Promiscuous RX sniffer operation in the driver" select WIFI_NM_WPA_SUPPLICANT select EXPERIMENTAL select NET_PROMISCUOUS_MODE @@ -154,7 +153,7 @@ config NRF_WIFI_PATCHES_EXTERNAL endchoice config NRF_WIFI_LOW_POWER - bool "low power mode in nRF Wi-Fi chipsets" + bool "Low power mode in nRF Wi-Fi chipsets" default y config NRF70_TCP_IP_CHECKSUM_OFFLOAD @@ -235,7 +234,7 @@ config NRF70_PCB_LOSS_2G range 0 4 help Specifies PCB loss from the antenna connector to the RF pin. - The values are in dB scale in steps of 1dB and range of 0-4dB. + The values are in dB scale in steps of 1 dB and range of 0-4 dB. The loss is considered in the RX path only. config NRF70_PCB_LOSS_5G_BAND1 @@ -244,7 +243,7 @@ config NRF70_PCB_LOSS_5G_BAND1 range 0 4 help Specifies PCB loss from the antenna connector to the RF pin. - The values are in dB scale in steps of 1dB and range of 0-4dB. + The values are in dB scale in steps of 1 dB and range of 0-4 dB. The loss is considered in the RX path only. config NRF70_PCB_LOSS_5G_BAND2 @@ -253,7 +252,7 @@ config NRF70_PCB_LOSS_5G_BAND2 range 0 4 help Specifies PCB loss from the antenna connector to the RF pin. - The values are in dB scale in steps of 1dB and range of 0-4dB. + The values are in dB scale in steps of 1 dB and range of 0-4 dB. The loss is considered in the RX path only. config NRF70_PCB_LOSS_5G_BAND3 @@ -262,7 +261,7 @@ config NRF70_PCB_LOSS_5G_BAND3 range 0 4 help Specifies PCB loss from the antenna connector to the RF pin. - The values are in dB scale in steps of 1dB and range of 0-4dB. + The values are in dB scale in steps of 1 dB and range of 0-4 dB. The loss is considered in the RX path only. config NRF70_ANT_GAIN_2G @@ -491,25 +490,23 @@ config NRF70_RPU_PS_IDLE_TIMEOUT_MS config NRF70_RPU_EXTEND_TWT_SP bool "extending TWT service period" help - In case frames accepted before beginning of SP are not - transmitted before the SP completes then typically they are - dropped to conform to SP window as per specification i.e., no + In case frames accepted before the beginning of SP are not + transmitted before the SP completes, then typically they are + dropped to conform to the SP window as per the specification that is, no transmission outside SP window. - - This feature mitigates the frame loss by transmitting even after SP - completion by using standard contention mechanism which is allowed + This feature mitigates frame loss by transmitting even after SP + completion by using a standard contention mechanism, which is allowed in specification but not recommended. As the device is actively transmitting beyond SP, the power consumption increases depending on the amount - of traffic available at the start of SP. - - Please note that if a frame is sent after SP starts it will be queued and this + of traffic available at the start of the SP. + Note that if a frame is sent after the SP starts, it will be queued, and this mechanism is not used. endif # NRF_WIFI_LOW_POWER config WIFI_FIXED_MAC_ADDRESS - string "WiFi Fixed MAC address in format XX:XX:XX:XX:XX:XX" + string "Wi-Fi Fixed MAC address in format XX:XX:XX:XX:XX:XX" help - This overrides the MAC address read from OTP. Strictly for testing purposes only. + This option overrides the MAC address read from OTP. It is strictly for testing purposes only. choice prompt "Wi-Fi MAC address type" @@ -529,7 +526,7 @@ config WIFI_FIXED_MAC_ADDRESS_ENABLED Enable fixed MAC address config WIFI_RANDOM_MAC_ADDRESS - bool "random MAC address generation at runtime" + bool "Random MAC address generation at runtime" depends on ENTROPY_GENERATOR help This option enables random MAC address generation at runtime. @@ -541,17 +538,17 @@ config NRF70_RSSI_STALE_TIMEOUT_MS int "RSSI stale timeout in milliseconds" default 1000 help - RSSI stale timeout is the period after which driver queries - RPU to get the RSSI the value. - If data is active (e.g. ping), driver stores the RSSI value from + RSSI stale timeout is the period after which the driver queries + RPU to get the RSSI value. + If data is active (for example, ping), the driver stores the RSSI value from the received frames and provides this stored information - to wpa_supplicant. In this case a higher value will be suitable - as stored RSSI value at driver will be updated regularly. + to wpa_supplicant. In this case, a higher value will be suitable + as the stored RSSI value at the driver will be updated regularly. If data is not active or after the stale timeout duration, - driver queries the RPU to get the RSSI value - and provides it to wpa_supplicant. The value should be set to lower - value as driver does not store it and requires RPU to provide the - info. + the driver queries the RPU to get the RSSI value + and provides it to wpa_supplicant. The value should be set to a lower + value as the driver does not store it and requires RPU to provide the + information. if NETWORKING # Finetune defaults for certain system components used by the driver @@ -575,7 +572,7 @@ config MAIN_STACK_SIZE config SHELL_STACK_SIZE default 4096 -# Override the Wi-Fi subsytems WIFI_MGMT_SCAN_SSID_FILT_MAX parameter, +# Override the Wi-Fi subsystems WIFI_MGMT_SCAN_SSID_FILT_MAX parameter, # since we support a maximum of 2 SSIDs for scan result filtering. config WIFI_MGMT_SCAN_SSID_FILT_MAX default 2 @@ -588,7 +585,7 @@ config NRF_WIFI_SCAN_MAX_BSS_CNT Maximum number of scan results to return. 0 represents unlimited number of BSSes. config NRF_WIFI_BEAMFORMING - bool "Wi-Fi beamforming. Enabling beamforming can provide slight improvement in performance where as disabling it can provide better power saving in low network activity applications" + bool "Wi-Fi beamforming. Enabling beamforming can provide a slight improvement in performance, whereas disabling it can provide better power savings in low network activity applications" default y config WIFI_NRF70_SCAN_TIMEOUT_S @@ -625,19 +622,18 @@ config NRF_WIFI_IFACE_MTU default 1500 config WIFI_NRF70_SKIP_LOCAL_ADMIN_MAC - bool "Suppress networks with non-individual MAC address as BSSID in the scan results" + bool "Suppress networks with non-individual MAC addresses as BSSID in the scan results" help - Wi-Fi access points use locally administered MAC address to manage - multiple virtual interfaces, for geo-location usecase these networks - from the virtual interfaces do not help in anyway as they are co-located with the primary interface - that has globally unique MAC address. - + Wi-Fi access points use locally administered MAC addresses to manage + multiple virtual interfaces. For geo-location use cases, these networks + from the virtual interfaces do not help in any way as they are co-located with the primary interface + that has a globally unique MAC address. So, to save resources, this option drops such networks from the scan results. config WIFI_NRF70_SCAN_DISABLE_DFS_CHANNELS bool "Disables DFS channels in scan operation" help - This option disables inclusion of DFS channels in scan operation. + This option disables inclusion of the DFS channels in the scan operation. This is useful to reduce the scan time, as DFS channels are seldom used. config NET_INTERFACE_NAME_LEN @@ -649,29 +645,28 @@ config NRF_WIFI_AP_DEAD_DETECT_TIMEOUT range 1 30 default 20 help - The number of seconds after which AP is declared dead if no beacons - are received from the AP. Used to detect AP silently going down e.g., power off. + The number of seconds after which the AP is declared dead if no beacons + are received from the AP. This is used to detect AP silently going down, for example, due to power off. config NRF_WIFI_RPU_RECOVERY bool "RPU recovery mechanism" depends on NRF_WIFI_LOW_POWER select EXPERIMENTAL help - Enable RPU recovery mechanism to recover from RPU (nRF70) hang. - This feature performs an interface reset (down and up) which triggers - a RPU coldboot. Application's network connection will be lost during - the recovery process and it is application's responsibility to + Enable the RPU recovery mechanism to recover from an RPU (nRF70) hang. + This feature performs an interface reset (down and up), which triggers + a RPU cold boot. The application's network connection will be lost during + the recovery process, and it is the application's responsibility to re-establish the network connection. if NRF_WIFI_RPU_RECOVERY - config NRF_WIFI_RPU_RECOVERY_PROPAGATION_DELAY_MS int "RPU recovery propagation delay in milliseconds" default 2000 help Propagation delay in milliseconds to wait after RPU is powered down before powering it up. This delay is required to ensure that the recovery - is propagted to all the applications and stack and have enough time to + is propagated to all the applications and stack and have enough time to clean up the resources. config NET_MGMT_EVENT_QUEUE_SIZE @@ -682,16 +677,16 @@ config NRF_WIFI_RPU_RECOVERY_PROPAGATION_DELAY_MS int "RPU recovery propagation delay in milliseconds" default 10 help - Propagation delay in milliseconds to wait after RPU is powered down + Propagation delay in milliseconds to wait after the RPU is powered down before powering it up. This delay is required to ensure that the recovery - is propagated to all the applications and stack and have enough time to + is propagated to all the applications and stack, and has enough time to clean up the resources. config NRF_WIFI_RPU_RECOVERY_PS_ACTIVE_TIMEOUT_MS int "RPU recovery power save active timeout in milliseconds" default 50000 help - Power save active timeout in milliseconds after which RPU recovery + Power save active timeout in milliseconds, after which the RPU recovery mechanism will be triggered. This timeout is used to ensure that the RPU attempts to enter power save mode in case of inactivity. @@ -706,7 +701,7 @@ config NRF_WIFI_RPU_MIN_TIME_TO_ENTER_SLEEP_MS config NRF_WIFI_RPU_RECOVERY_DEBUG bool "RPU recovery debug logs" help - Enable RPU recovery debug logs to help debug RPU recovery mechanism. + Enable RPU recovery debug logs to help debug the RPU recovery mechanism. config NRF_WIFI_RPU_RECOVERY_QUIET_PERIOD_MS int "RPU recovery quiet period in milliseconds" @@ -720,7 +715,7 @@ config NRF_WIFI_RPU_RECOVERY_MAX_RETRIES default 0 help Maximum number of consecutive RPU recovery retries before giving up - and resetting the system. Set to 0 to keep retrying indefinitely. + and resetting the system. Set it to 0 to keep retrying indefinitely. config NRF_WIFI_RPU_RECOVERY_RETRY_WINDOW_S int "RPU recovery retry window in seconds" @@ -734,16 +729,14 @@ config NRF_WIFI_RPU_RECOVERY_RETRY_WINDOW_S config NRF_WIFI_RPU_RECOVERY_PS_STATE_DEBUG bool "RPU recovery power save state debug logs" help - Enable RPU recovery power save state debug logs to help debug RPU recovery mechanism. - - + Enable RPU recovery power save state debug logs to help debug the RPU recovery mechanism. endif # NRF_WIFI_RPU_RECOVERY config NRF_WIFI_FEAT_WMM bool "WMM/QoS support" default y help - This option controls disable/enable of the WMM(Wireless Multi-Media) feature. + This option controls disable/enable of the WMM (Wireless Multi-Media) feature. choice NRF_WIFI_PS_DATA_RETRIEVAL_MECHANISM prompt "Power save data retrieval mechanism" @@ -752,37 +745,36 @@ choice NRF_WIFI_PS_DATA_RETRIEVAL_MECHANISM Select the mechanism to retrieve buffered data from AP. config NRF_WIFI_PS_POLL_BASED_RETRIEVAL - bool "PS-Poll frame based mechanism to retrieve buffered data from AP" + bool "PS-Poll frame-based mechanism to retrieve buffered data from AP" help - When AP notifies about availability of buffered data, the STA stays in power save - and retrieves the frames one-by-one, this conserved more power but adds latency - to the traffic. Ideal for minimum number of frames. + When the AP notifies about the availability of buffered data, the STA stays in power save + and retrieves the frames one-by-one. This conserves more power but adds latency + to the traffic. It is ideal for minimum number of frames. config NRF_WIFI_QOS_NULL_BASED_RETRIEVAL - bool "QoS null frame based mechanism to retrieve buffered data from AP" + bool "QoS null frame-based mechanism to retrieve buffered data from AP" help - When AP notifies about availability of buffered data, the STA comes out of - power save and then AP can deliver all buffered frames without any additional + When the AP notifies about the availability of buffered data, the STA comes out of + power save, and then AP can deliver all buffered frames without any additional overhead or latency, but STA enters power save after a delay costing more power - depending on the delay. Ideal for heavy buffered traffic. - + depending on the delay. It is ideal for heavy buffered traffic. endchoice config NRF_WIFI_MGMT_BUFF_OFFLOAD - bool "management buffer offload" + bool "Management buffer offload" default y help - This option offloads the refilling of management buffers to UMAC, saves host - having to exchange commands and events for every management packet even if it is + This option offloads the refilling of management buffers to the UMAC, saving the host + from having to exchange commands and events for every management packet even if it is consumed by UMAC. config NRF_WIFI_FEAT_KEEPALIVE bool "Wi-Fi keepalive feature for connection maintenance" depends on NRF70_STA_MODE help - Enable Wi-Fi keepalive feature to keep the connection alive by sending - keepalive packets to the AP. Primarily intended to interoperate with APs - that disconnect idle clients without any explicit checks. Slightly increases + Enable the Wi-Fi keepalive feature to keep the connection alive by sending + keepalive packets to the AP. This feature is primarily intended to interoperate with APs + that disconnect idle clients without any explicit checks. It slightly increases power consumption. if NRF_WIFI_FEAT_KEEPALIVE @@ -809,9 +801,9 @@ config NRF_WIFI_PS_EXIT_EVERY_TIM config NRF_WIFI_PS_INT_PS bool "Exit power save based on an intelligent algorithm" help - Exit power save based on an intelligent algorithm to retrieve buffered data from AP. + Exit power save based on an intelligent algorithm to retrieve buffered data from the AP. The algorithm tracks the buffered data at the AP and then dynamically decides - whether to stay in PS (for lower amount of buffered data) or exit PS (for higher + whether to stay in PS (for a lower amount of buffered data) or exit PS (for a higher amount of buffered data). endchoice @@ -820,5 +812,5 @@ config NRF70_PASSIVE_SCAN_ONLY depends on NRF70_SCAN_ONLY help Enable this configuration to force passive scan on all channels. - This will override application specified scan type. + This will override application-specified scan type. endif # WIFI_NRF70 From 2995eb79f1f2d7246d27a2b54d690b0e6acd75c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20Cab=C3=A9?= Date: Fri, 1 Nov 2024 16:35:05 +0100 Subject: [PATCH 008/113] doc: fix scrolling glitch causing search bar to be partially hidden MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit With the recent update to Sphinx RTD theme 3.0.0, a 19px-high element that used to display the version number is not visible anymore, so the JS code that hides the upper-left logo when scrolling down needs to be adjusted to account for this change. Signed-off-by: Benjamin Cabé --- doc/_static/js/custom.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/_static/js/custom.js b/doc/_static/js/custom.js index 52f254b38c786d..049d327c809a4d 100644 --- a/doc/_static/js/custom.js +++ b/doc/_static/js/custom.js @@ -16,7 +16,7 @@ const registerOnScrollEvent = (function(){ // Configuration. // The number of pixels the user must scroll by before the logo is completely hidden. - const scrollTopPixels = 156; + const scrollTopPixels = 137; // The target margin to be applied to the navigation bar when the logo is hidden. const menuTopMargin = 54; // The max-height offset when the logo is completely visible. From f2ea8506aea3462b9f0a5d7b41e599ec209dc080 Mon Sep 17 00:00:00 2001 From: Torsten Rasmussen Date: Fri, 1 Nov 2024 15:22:23 +0100 Subject: [PATCH 009/113] cmake: use CMake variable KERNEL_VERSION_CUSTOMIZATION for default value Fixes: #80193 With #62395 the Zephyr kernel and app version customization values were moved to target properties to allow Zephyr modules to adjust the values. This had the consequence described by #80193 that version customization using CMake arguments, `-D`, or CMakeList.txt toplevel file can no longer be used for customizing the version. To support both CMake variable as well as Zephyr module version customization use-cases then this commit uses `zephyr_get()` to fetch any CMake variable adjustments and uses the value for default property setting. This allows users to set customized version while still allow Zephyr modules to overrule this as intended with #62395. Signed-off-by: Torsten Rasmussen --- CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3ce4b5ff1e9e91..88b2d77c3a4d5e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -598,6 +598,8 @@ add_custom_command( COMMAND_EXPAND_LISTS ) add_custom_target(version_h DEPENDS ${PROJECT_BINARY_DIR}/include/generated/zephyr/version.h) +zephyr_get(KERNEL_VERSION_CUSTOMIZATION SYSBUILD LOCAL) +set_property(TARGET version_h PROPERTY KERNEL_VERSION_CUSTOMIZATION ${KERNEL_VERSION_CUSTOMIZATION}) if(EXISTS ${APPLICATION_SOURCE_DIR}/VERSION) add_custom_command( @@ -616,6 +618,8 @@ if(EXISTS ${APPLICATION_SOURCE_DIR}/VERSION) app_version_h DEPENDS ${PROJECT_BINARY_DIR}/include/generated/zephyr/app_version.h) add_dependencies(zephyr_interface app_version_h) + zephyr_get(APP_VERSION_CUSTOMIZATION SYSBUILD LOCAL) + set_property(TARGET app_version_h PROPERTY APP_VERSION_CUSTOMIZATION ${APP_VERSION_CUSTOMIZATION}) endif() # Unfortunately, the order in which CMakeLists.txt code is processed From 6bb0c092b5daaf49216b17ad7199ada0d33c4bfa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20Cab=C3=A9?= Date: Mon, 4 Nov 2024 14:37:12 +0100 Subject: [PATCH 010/113] doc: comparator: fix nested bullet list formatting MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit add missing newline for sub-list to render correctly Signed-off-by: Benjamin Cabé --- doc/hardware/peripherals/comparator.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/hardware/peripherals/comparator.rst b/doc/hardware/peripherals/comparator.rst index e0e63407661712..cd7ad43a9f3d0b 100644 --- a/doc/hardware/peripherals/comparator.rst +++ b/doc/hardware/peripherals/comparator.rst @@ -43,6 +43,7 @@ The ``comp`` shell command provides the following subcommands: * ``get_output`` See :c:func:`comparator_get_output` * ``set_trigger`` See :c:func:`comparator_set_trigger` * ``await_trigger`` Awaits trigger using the following flow: + * Set trigger callback using :c:func:`comparator_set_trigger_callback` * Await callback or time out after default or optionally provided timeout * Clear trigger callback using :c:func:`comparator_set_trigger_callback` From 4690689a36d4c9e7fa70c91a6386caa8bd99c00e Mon Sep 17 00:00:00 2001 From: Kevin ORourke Date: Fri, 11 Oct 2024 08:26:20 +0200 Subject: [PATCH 011/113] drivers: ethernet: eth_stm32_hal: fix bus error after disconnect In some circumstances the struct eth_stm32_tx_context object that was allocated on eth_tx's stack is still referenced after the function exits. This usually happens when the network is disconnected, depending on the PHY hardware. When the network is reconnected there will eventually be a call to HAL_ETH_ReleaseTxPacket, which calls HAL_ETH_TxFreeCallback with the (now invalid) pointer to the tx context. When HAL_ETH_TxFreeCallback tries to dereference that pointer we get a bus error. Fix this by allocating struct eth_stm32_tx_context objects from a static array, similarly to how the buffers are allocated. This ensures that they remain valid until the HAL is finished with them. Fixes: #79037 Signed-off-by: Kevin ORourke --- drivers/ethernet/eth_stm32_hal.c | 46 +++++++++++++++++++++++--------- 1 file changed, 34 insertions(+), 12 deletions(-) diff --git a/drivers/ethernet/eth_stm32_hal.c b/drivers/ethernet/eth_stm32_hal.c index 59adaad032c306..d2c76261498d90 100644 --- a/drivers/ethernet/eth_stm32_hal.c +++ b/drivers/ethernet/eth_stm32_hal.c @@ -122,10 +122,12 @@ struct eth_stm32_tx_buffer_header { struct eth_stm32_tx_context { struct net_pkt *pkt; uint16_t first_tx_buffer_index; + bool used; }; static struct eth_stm32_rx_buffer_header dma_rx_buffer_header[ETH_RX_DESC_CNT]; static struct eth_stm32_tx_buffer_header dma_tx_buffer_header[ETH_TX_DESC_CNT]; +static struct eth_stm32_tx_context dma_tx_context[ETH_TX_DESC_CNT]; void HAL_ETH_RxAllocateCallback(uint8_t **buf) { @@ -188,6 +190,7 @@ void HAL_ETH_TxFreeCallback(uint32_t *buff) buffer_header = NULL; } } + ctx->used = false; } /* allocate a tx buffer and mark it as used */ @@ -203,6 +206,22 @@ static inline uint16_t allocate_tx_buffer(void) k_yield(); } } + +/* allocate a tx context and mark it as used, the first tx buffer is also allocated */ +static inline struct eth_stm32_tx_context *allocate_tx_context(struct net_pkt *pkt) +{ + for (;;) { + for (uint16_t index = 0; index < ETH_TX_DESC_CNT; index++) { + if (!dma_tx_context[index].used) { + dma_tx_context[index].used = true; + dma_tx_context[index].pkt = pkt; + dma_tx_context[index].first_tx_buffer_index = allocate_tx_buffer(); + return &dma_tx_context[index]; + } + } + k_yield(); + } +} #endif /* CONFIG_ETH_STM32_HAL_API_V2 */ #if defined(CONFIG_ETH_STM32_HAL_API_V2) @@ -304,7 +323,7 @@ static int eth_tx(const struct device *dev, struct net_pkt *pkt) size_t total_len; #if defined(CONFIG_ETH_STM32_HAL_API_V2) size_t remaining_read; - struct eth_stm32_tx_context ctx = {.pkt = pkt, .first_tx_buffer_index = 0}; + struct eth_stm32_tx_context *ctx = NULL; struct eth_stm32_tx_buffer_header *buf_header = NULL; #else uint8_t *dma_buffer; @@ -331,8 +350,8 @@ static int eth_tx(const struct device *dev, struct net_pkt *pkt) k_mutex_lock(&dev_data->tx_mutex, K_FOREVER); #if defined(CONFIG_ETH_STM32_HAL_API_V2) - ctx.first_tx_buffer_index = allocate_tx_buffer(); - buf_header = &dma_tx_buffer_header[ctx.first_tx_buffer_index]; + ctx = allocate_tx_context(pkt); + buf_header = &dma_tx_buffer_header[ctx->first_tx_buffer_index]; #else dma_tx_desc = heth->TxDesc; while (IS_ETH_DMATXDESC_OWN(dma_tx_desc) != (uint32_t)RESET) { @@ -388,8 +407,8 @@ static int eth_tx(const struct device *dev, struct net_pkt *pkt) #if defined(CONFIG_ETH_STM32_HAL_API_V2) tx_config.Length = total_len; - tx_config.pData = &ctx; - tx_config.TxBuffer = &dma_tx_buffer_header[ctx.first_tx_buffer_index].tx_buff; + tx_config.pData = ctx; + tx_config.TxBuffer = &dma_tx_buffer_header[ctx->first_tx_buffer_index].tx_buff; /* Reset TX complete interrupt semaphore before TX request*/ k_sem_reset(&dev_data->tx_int_sem); @@ -405,6 +424,9 @@ static int eth_tx(const struct device *dev, struct net_pkt *pkt) goto error; } + /* the tx context is now owned by the HAL */ + ctx = NULL; + /* Wait for end of TX buffer transmission */ /* If the semaphore timeout breaks, it means */ /* an error occurred or IT was not fired */ @@ -500,14 +522,14 @@ static int eth_tx(const struct device *dev, struct net_pkt *pkt) error: #if defined(CONFIG_ETH_STM32_HAL_API_V2) - /* free package tx buffer */ - if (res != 0) { - HAL_ETH_TxFreeCallback((uint32_t *)&ctx); - } else if (HAL_ETH_ReleaseTxPacket(heth) != HAL_OK) { - LOG_ERR("HAL_ETH_ReleaseTxPacket failed"); - res = -EIO; + if (!ctx) { + /* The HAL owns the tx context */ + HAL_ETH_ReleaseTxPacket(heth); + } else { + /* We need to release the tx context and its buffers */ + HAL_ETH_TxFreeCallback((uint32_t *)ctx); } -#endif +#endif /* CONFIG_ETH_STM32_HAL_API_V2 */ k_mutex_unlock(&dev_data->tx_mutex); From 0a68d492e2d907bf35bde832bdc2e741fb2ac53d Mon Sep 17 00:00:00 2001 From: Duy Nguyen Date: Thu, 10 Oct 2024 20:19:20 +0700 Subject: [PATCH 012/113] dts: renesas: Separate pll p q r into child node The new update of clock device tree make the pll p q r clock source cannot be choose by other node This fix add 1 new dts binding for pll out p q r out line Signed-off-by: Duy Nguyen --- boards/renesas/ek_ra8d1/ek_ra8d1.dts | 23 ++++--- boards/renesas/ek_ra8m1/ek_ra8m1.dts | 23 ++++--- boards/renesas/mck_ra8t1/mck_ra8t1.dts | 22 ++++--- .../clock_control_renesas_ra_cgc.c | 4 +- dts/arm/renesas/ra/ra8/r7fa8d1xh.dtsi | 62 ++++++++++++++---- dts/arm/renesas/ra/ra8/r7fa8m1xh.dtsi | 62 ++++++++++++++---- dts/arm/renesas/ra/ra8/r7fa8t1xh.dtsi | 65 ++++++++++++++----- .../clock/renesas,ra-cgc-pll-out.yaml | 19 ++++++ dts/bindings/clock/renesas,ra-cgc-pll.yaml | 12 ---- .../drivers/clock_control/renesas_ra_cgc.h | 15 ++++- 10 files changed, 220 insertions(+), 87 deletions(-) create mode 100644 dts/bindings/clock/renesas,ra-cgc-pll-out.yaml diff --git a/boards/renesas/ek_ra8d1/ek_ra8d1.dts b/boards/renesas/ek_ra8d1/ek_ra8d1.dts index 4e82e5efa0262f..6f189fe7d11385 100644 --- a/boards/renesas/ek_ra8d1/ek_ra8d1.dts +++ b/boards/renesas/ek_ra8d1/ek_ra8d1.dts @@ -57,20 +57,23 @@ }; &pll { - clocks = <&xtal>; - div = <2>; - mul = <96 0>; - divp = <2>; - freqp = ; - divq = <2>; - freqq = ; - divr = <2>; - freqr = ; status = "okay"; + pllp { + status = "okay"; + }; + + pllq { + status = "okay"; + }; + + pllr { + status = "okay"; + }; }; + &sciclk { - clocks = <&pll>; + clocks = <&pllp>; div = <4>; status = "okay"; }; diff --git a/boards/renesas/ek_ra8m1/ek_ra8m1.dts b/boards/renesas/ek_ra8m1/ek_ra8m1.dts index 8bbeec4ed40e1d..fbfbe483b4b455 100644 --- a/boards/renesas/ek_ra8m1/ek_ra8m1.dts +++ b/boards/renesas/ek_ra8m1/ek_ra8m1.dts @@ -87,20 +87,23 @@ }; &pll { - clocks = <&xtal>; - div = <2>; - mul = <96 0>; - divp = <2>; - freqp = ; - divq = <2>; - freqq = ; - divr = <2>; - freqr = ; status = "okay"; + pllp { + status = "okay"; + }; + + pllq { + status = "okay"; + }; + + pllr { + status = "okay"; + }; }; + &sciclk { - clocks = <&pll>; + clocks = <&pllp>; div = <4>; status = "okay"; }; diff --git a/boards/renesas/mck_ra8t1/mck_ra8t1.dts b/boards/renesas/mck_ra8t1/mck_ra8t1.dts index 1f275fcbff24c8..1866767f6748cf 100644 --- a/boards/renesas/mck_ra8t1/mck_ra8t1.dts +++ b/boards/renesas/mck_ra8t1/mck_ra8t1.dts @@ -61,20 +61,22 @@ }; &pll { - clocks = <&xtal>; - div = <2>; - mul = <80 0>; - divp = <2>; - freqp = ; - divq = <2>; - freqq = ; - divr = <2>; - freqr = ; status = "okay"; + pllp { + status = "okay"; + }; + + pllq { + status = "okay"; + }; + + pllr { + status = "okay"; + }; }; &sciclk { - clocks = <&pll>; + clocks = <&pllp>; div = <4>; status = "okay"; }; diff --git a/drivers/clock_control/clock_control_renesas_ra_cgc.c b/drivers/clock_control/clock_control_renesas_ra_cgc.c index 79da94a6d278c9..4ed4bb30daaa2c 100644 --- a/drivers/clock_control/clock_control_renesas_ra_cgc.c +++ b/drivers/clock_control/clock_control_renesas_ra_cgc.c @@ -58,7 +58,7 @@ static int clock_control_renesas_ra_get_rate(const struct device *dev, clock_con } clk_src_rate = R_BSP_SourceClockHzGet(config->clk_src); - clk_div_val = R_FSP_ClockDividerGet(config->clk_div); + clk_div_val = config->clk_div; *rate = clk_src_rate / clk_div_val; return 0; } @@ -94,7 +94,7 @@ static const struct clock_control_driver_api clock_control_reneas_ra_api = { DT_NODE_HAS_PROP(node_id, clocks), \ (RA_CGC_CLK_SRC(DT_CLOCKS_CTLR(node_id))), \ (RA_CGC_CLK_SRC(DT_CLOCKS_CTLR(DT_PARENT(node_id))))), \ - .clk_div = RA_CGC_CLK_DIV(node_id, div, 1)}; \ + .clk_div = DT_PROP(node_id, div)}; \ DEVICE_DT_DEFINE(node_id, &clock_control_ra_init_pclk, NULL, NULL, \ &node_id##_cfg, PRE_KERNEL_1, \ CONFIG_KERNEL_INIT_PRIORITY_OBJECTS, \ diff --git a/dts/arm/renesas/ra/ra8/r7fa8d1xh.dtsi b/dts/arm/renesas/ra/ra8/r7fa8d1xh.dtsi index 3db4898ccb2f77..cd2b62c0924a73 100644 --- a/dts/arm/renesas/ra/ra8/r7fa8d1xh.dtsi +++ b/dts/arm/renesas/ra/ra8/r7fa8d1xh.dtsi @@ -52,12 +52,30 @@ clocks = <&xtal>; div = <2>; mul = <96 0>; - divp = <2>; - freqp = ; - divq = <2>; - freqq = ; - divr = <2>; - freqr = ; + + pllp: pllp { + compatible = "renesas,ra-cgc-pll-out"; + div = <2>; + freq = ; + status = "disabled"; + #clock-cells = <0>; + }; + + pllq: pllq { + compatible = "renesas,ra-cgc-pll-out"; + div = <2>; + freq = ; + status = "disabled"; + #clock-cells = <0>; + }; + + pllr: pllr { + compatible = "renesas,ra-cgc-pll-out"; + div = <2>; + freq = ; + status = "disabled"; + #clock-cells = <0>; + }; status = "disabled"; }; @@ -68,12 +86,30 @@ /* PLL2 */ div = <2>; mul = <96 0>; - divp = <2>; - freqp = ; - divq = <2>; - freqq = ; - divr = <2>; - freqr = ; + + pll2p: pll2p { + compatible = "renesas,ra-cgc-pll-out"; + div = <2>; + freq = ; + status = "disabled"; + #clock-cells = <0>; + }; + + pll2q: pll2q { + compatible = "renesas,ra-cgc-pll-out"; + div = <2>; + freq = ; + status = "disabled"; + #clock-cells = <0>; + }; + + pll2r: pll2r { + compatible = "renesas,ra-cgc-pll-out"; + div = <2>; + freq = ; + status = "disabled"; + #clock-cells = <0>; + }; status = "disabled"; }; @@ -84,7 +120,7 @@ reg-names = "MSTPA", "MSTPB","MSTPC", "MSTPD", "MSTPE"; #clock-cells = <0>; - clocks = <&pll>; + clocks = <&pllp>; status = "okay"; cpuclk: cpuclk { diff --git a/dts/arm/renesas/ra/ra8/r7fa8m1xh.dtsi b/dts/arm/renesas/ra/ra8/r7fa8m1xh.dtsi index cb22fd3357a51b..aedecdd38ff934 100644 --- a/dts/arm/renesas/ra/ra8/r7fa8m1xh.dtsi +++ b/dts/arm/renesas/ra/ra8/r7fa8m1xh.dtsi @@ -52,12 +52,30 @@ clocks = <&xtal>; div = <2>; mul = <96 0>; - divp = <2>; - freqp = ; - divq = <2>; - freqq = ; - divr = <2>; - freqr = ; + + pllp: pllp { + compatible = "renesas,ra-cgc-pll-out"; + div = <2>; + freq = ; + status = "disabled"; + #clock-cells = <0>; + }; + + pllq: pllq { + compatible = "renesas,ra-cgc-pll-out"; + div = <2>; + freq = ; + status = "disabled"; + #clock-cells = <0>; + }; + + pllr: pllr { + compatible = "renesas,ra-cgc-pll-out"; + div = <2>; + freq = ; + status = "disabled"; + #clock-cells = <0>; + }; status = "disabled"; }; @@ -68,12 +86,30 @@ /* PLL2 */ div = <2>; mul = <96 0>; - divp = <2>; - freqp = ; - divq = <2>; - freqq = ; - divr = <2>; - freqr = ; + + pll2p: pll2p { + compatible = "renesas,ra-cgc-pll-out"; + div = <2>; + freq = ; + status = "disabled"; + #clock-cells = <0>; + }; + + pll2q: pll2q { + compatible = "renesas,ra-cgc-pll-out"; + div = <2>; + freq = ; + status = "disabled"; + #clock-cells = <0>; + }; + + pll2r: pll2r { + compatible = "renesas,ra-cgc-pll-out"; + div = <2>; + freq = ; + status = "disabled"; + #clock-cells = <0>; + }; status = "disabled"; }; @@ -84,7 +120,7 @@ reg-names = "MSTPA", "MSTPB","MSTPC", "MSTPD", "MSTPE"; #clock-cells = <0>; - clocks = <&pll>; + clocks = <&pllp>; status = "okay"; cpuclk: cpuclk { diff --git a/dts/arm/renesas/ra/ra8/r7fa8t1xh.dtsi b/dts/arm/renesas/ra/ra8/r7fa8t1xh.dtsi index de851f6bf47e41..a2013deab2592d 100644 --- a/dts/arm/renesas/ra/ra8/r7fa8t1xh.dtsi +++ b/dts/arm/renesas/ra/ra8/r7fa8t1xh.dtsi @@ -47,17 +47,33 @@ pll: pll { compatible = "renesas,ra-cgc-pll"; #clock-cells = <0>; - - /* PLL */ clocks = <&xtal>; div = <2>; mul = <80 0>; - divp = <2>; - freqp = ; - divq = <2>; - freqq = ; - divr = <2>; - freqr = ; + + pllp: pllp { + compatible = "renesas,ra-cgc-pll-out"; + div = <2>; + freq = ; + status = "disabled"; + #clock-cells = <0>; + }; + + pllq: pllq { + compatible = "renesas,ra-cgc-pll-out"; + div = <2>; + freq = ; + status = "disabled"; + #clock-cells = <0>; + }; + + pllr: pllr { + compatible = "renesas,ra-cgc-pll-out"; + div = <2>; + freq = ; + status = "disabled"; + #clock-cells = <0>; + }; status = "disabled"; }; @@ -65,15 +81,32 @@ compatible = "renesas,ra-cgc-pll"; #clock-cells = <0>; - /* PLL2 */ div = <2>; mul = <96 0>; - divp = <2>; - freqp = ; - divq = <2>; - freqq = ; - divr = <2>; - freqr = ; + + pll2p: pll2p { + compatible = "renesas,ra-cgc-pll-out"; + div = <2>; + freq = ; + status = "disabled"; + #clock-cells = <0>; + }; + + pll2q: pll2q { + compatible = "renesas,ra-cgc-pll-out"; + div = <2>; + freq = ; + status = "disabled"; + #clock-cells = <0>; + }; + + pll2r: pll2r { + compatible = "renesas,ra-cgc-pll-out"; + div = <2>; + freq = ; + status = "disabled"; + #clock-cells = <0>; + }; status = "disabled"; }; @@ -84,7 +117,7 @@ reg-names = "MSTPA", "MSTPB","MSTPC", "MSTPD", "MSTPE"; #clock-cells = <0>; - clocks = <&pll>; + clocks = <&pllp>; status = "okay"; cpuclk: cpuclk { diff --git a/dts/bindings/clock/renesas,ra-cgc-pll-out.yaml b/dts/bindings/clock/renesas,ra-cgc-pll-out.yaml new file mode 100644 index 00000000000000..2d35a714899bff --- /dev/null +++ b/dts/bindings/clock/renesas,ra-cgc-pll-out.yaml @@ -0,0 +1,19 @@ +# Copyright (c) 2024 Renesas Electronics Corporation +# SPDX-License-Identifier: Apache-2.0 + +description: Renesas RA Clock Generation Circuit PLL Clock out line + +compatible: "renesas,ra-cgc-pll-out" + +include: [clock-controller.yaml, base.yaml] + +properties: + div: + required: true + type: int + freq: + required: true + type: int + + "#clock-cells": + const: 0 diff --git a/dts/bindings/clock/renesas,ra-cgc-pll.yaml b/dts/bindings/clock/renesas,ra-cgc-pll.yaml index 7c959b6a01db5e..38d1dc410a2309 100644 --- a/dts/bindings/clock/renesas,ra-cgc-pll.yaml +++ b/dts/bindings/clock/renesas,ra-cgc-pll.yaml @@ -16,18 +16,6 @@ properties: mul: required: true type: array - divp: - type: int - freqp: - type: int - divq: - type: int - freqq: - type: int - divr: - type: int - freqr: - type: int "#clock-cells": const: 0 diff --git a/include/zephyr/drivers/clock_control/renesas_ra_cgc.h b/include/zephyr/drivers/clock_control/renesas_ra_cgc.h index a7f147382fdc0d..1c29c9c893e78a 100644 --- a/include/zephyr/drivers/clock_control/renesas_ra_cgc.h +++ b/include/zephyr/drivers/clock_control/renesas_ra_cgc.h @@ -37,14 +37,27 @@ #define RA_CGC_DIV_PCLKD(n) UTIL_CAT(BSP_CLOCKS_SYS_CLOCK_DIV_, n) #define RA_CGC_DIV_PCLKE(n) UTIL_CAT(BSP_CLOCKS_SYS_CLOCK_DIV_, n) #define RA_CGC_DIV_PLL(n) UTIL_CAT(BSP_CLOCKS_PLL_DIV_, n) +#define RA_CGC_DIV_PLLP(n) UTIL_CAT(BSP_CLOCKS_PLL_DIV_, n) +#define RA_CGC_DIV_PLLQ(n) UTIL_CAT(BSP_CLOCKS_PLL_DIV_, n) +#define RA_CGC_DIV_PLLR(n) UTIL_CAT(BSP_CLOCKS_PLL_DIV_, n) #define RA_CGC_DIV_PLL2(n) UTIL_CAT(BSP_CLOCKS_PLL_DIV_, n) +#define RA_CGC_DIV_PLL2P(n) UTIL_CAT(BSP_CLOCKS_PLL_DIV_, n) +#define RA_CGC_DIV_PLL2Q(n) UTIL_CAT(BSP_CLOCKS_PLL_DIV_, n) +#define RA_CGC_DIV_PLL2R(n) UTIL_CAT(BSP_CLOCKS_PLL_DIV_, n) #define RA_CGC_DIV_SCICLK(n) UTIL_CAT(BSP_CLOCKS_SCI_CLOCK_DIV_, n) #define RA_CGC_DIV_SPICLK(n) UTIL_CAT(BSP_CLOCKS_SPI_CLOCK_DIV_, n) #define RA_CGC_DIV_U60CLK(n) UTIL_CAT(BSP_CLOCKS_USB60_CLOCK_DIV_, n) #define RA_CGC_DIV_UCLK(n) UTIL_CAT(BSP_CLOCKS_USB_CLOCK_DIV_, n) #define BSP_CLOCKS_SOURCE_PLL BSP_CLOCKS_SOURCE_CLOCK_PLL -#define BSP_CLOCKS_SOURCE_PLL2 BSP_CLOCKS_SOURCE_CLOCK_PLL +#define BSP_CLOCKS_SOURCE_PLLP BSP_CLOCKS_SOURCE_CLOCK_PLL +#define BSP_CLOCKS_SOURCE_PLLQ BSP_CLOCKS_SOURCE_CLOCK_PLL1Q +#define BSP_CLOCKS_SOURCE_PLLR BSP_CLOCKS_SOURCE_CLOCK_PLL1R + +#define BSP_CLOCKS_SOURCE_PLL2 BSP_CLOCKS_SOURCE_CLOCK_PLL2 +#define BSP_CLOCKS_SOURCE_PLL2P BSP_CLOCKS_SOURCE_CLOCK_PLL2 +#define BSP_CLOCKS_SOURCE_PLL2Q BSP_CLOCKS_SOURCE_CLOCK_PLL2Q +#define BSP_CLOCKS_SOURCE_PLL2R BSP_CLOCKS_SOURCE_CLOCK_PLL2R #define BSP_CLOCKS_CLKOUT_DIV_1 (0) #define BSP_CLOCKS_CLKOUT_DIV_2 (1) From 639d9ae96f691e2c0002f8e0a64a3c1bf5383735 Mon Sep 17 00:00:00 2001 From: Duy Nguyen Date: Mon, 14 Oct 2024 10:36:43 +0700 Subject: [PATCH 013/113] manifest: Update hal_renesas commit ID Update hal renesas commit ID to resolve PLL clock config issue Signed-off-by: Duy Nguyen --- west.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/west.yml b/west.yml index e1f6fda9a9adb7..6ee2aaa5e53c03 100644 --- a/west.yml +++ b/west.yml @@ -214,7 +214,7 @@ manifest: - hal - name: hal_renesas path: modules/hal/renesas - revision: 3dafd030046f8d6f8a26080e9b9c1bcc92d45999 + revision: 10326518701e25bf336a2eaeb8b5820110e4e6a3 groups: - hal - name: hal_rpi_pico From 145d04101d416e20af04b8a9c8bf5fe8fbb0c77b Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Tue, 29 Oct 2024 10:52:37 +0100 Subject: [PATCH 014/113] pm: policy: fix pm_policy_event_register arg The pm_policy_event_register() API takes absolute cycles as the second arg, like pm_policy_event_update(), but the arg is renamed time_us and treated as a relative time in us rather than abs cycles. Fix implementation of pm_policy_event_register() to treat cycles like pm_policy_event_update() and API docs suggest. Signed-off-by: Bjarki Arge Andreasen --- subsys/pm/policy/policy_events.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/subsys/pm/policy/policy_events.c b/subsys/pm/policy/policy_events.c index dc06bffdf55bb0..53fec3edc5d73a 100644 --- a/subsys/pm/policy/policy_events.c +++ b/subsys/pm/policy/policy_events.c @@ -68,14 +68,13 @@ int32_t pm_policy_next_event_ticks(void) return -1; } -void pm_policy_event_register(struct pm_policy_event *evt, uint32_t time_us) +void pm_policy_event_register(struct pm_policy_event *evt, uint32_t cycle) { k_spinlock_key_t key = k_spin_lock(&events_lock); - uint32_t cyc = k_cycle_get_32(); - evt->value_cyc = cyc + k_us_to_cyc_ceil32(time_us); + evt->value_cyc = cycle; sys_slist_append(&events_list, &evt->node); - update_next_event(cyc); + update_next_event(k_cycle_get_32()); k_spin_unlock(&events_lock, key); } From 0911003c11346106a725bca0050f08dea3df4dc4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Ju=C5=99ena?= Date: Wed, 23 Oct 2024 15:22:43 +0200 Subject: [PATCH 015/113] boards: st: stm32h745i_disco: m7: Fix PHY address MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit According to the datasheet, the PHY address is 0x1. When changed to this value the PHY id is correctly read. Before: ``` [00:00:00.602,000] phy_mii: No PHY found at address 0 ``` After: ``` [00:00:00.051,000] phy_mii: PHY (1) ID 7C111 ``` Signed-off-by: Tomáš Juřena --- boards/st/stm32h745i_disco/Kconfig.defconfig | 4 ++++ .../st/stm32h745i_disco/stm32h745i_disco_stm32h745xx_m7.dts | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/boards/st/stm32h745i_disco/Kconfig.defconfig b/boards/st/stm32h745i_disco/Kconfig.defconfig index f2830611565ac7..1788447e060b24 100644 --- a/boards/st/stm32h745i_disco/Kconfig.defconfig +++ b/boards/st/stm32h745i_disco/Kconfig.defconfig @@ -14,6 +14,10 @@ config NET_L2_ETHERNET config ETH_STM32_HAL_MII default y +# STM32H745I-DISCO have PHY connected to address 1 +config ETH_STM32_HAL_PHY_ADDRESS + default 1 + endif # NETWORKING config MEMC diff --git a/boards/st/stm32h745i_disco/stm32h745i_disco_stm32h745xx_m7.dts b/boards/st/stm32h745i_disco/stm32h745i_disco_stm32h745xx_m7.dts index fbc3a388b9cc9a..f1e7204a8646e0 100644 --- a/boards/st/stm32h745i_disco/stm32h745i_disco_stm32h745xx_m7.dts +++ b/boards/st/stm32h745i_disco/stm32h745i_disco_stm32h745xx_m7.dts @@ -151,9 +151,9 @@ pinctrl-0 = <ð_mdio_pa2 ð_mdc_pc1>; pinctrl-names = "default"; - ethernet-phy@0 { + ethernet-phy@1 { compatible = "ethernet-phy"; - reg = <0x00>; + reg = <0x01>; status = "okay"; }; }; From cfb73221076f7dbd845658341b62b7142fd20870 Mon Sep 17 00:00:00 2001 From: Daniel DeGrasse Date: Wed, 16 Oct 2024 16:20:51 -0500 Subject: [PATCH 016/113] drivers: flash: flash_mcux_flexspi: add support for W25Q512NW-IQ/IN Add support for the W25Q512NW-IQ/IN with the FLEXSPI, using a custom LUT table. Fixes #80592 Signed-off-by: Daniel DeGrasse --- drivers/flash/flash_mcux_flexspi_nor.c | 38 ++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/drivers/flash/flash_mcux_flexspi_nor.c b/drivers/flash/flash_mcux_flexspi_nor.c index ea9377d0754141..b2b045e1b02cc3 100644 --- a/drivers/flash/flash_mcux_flexspi_nor.c +++ b/drivers/flash/flash_mcux_flexspi_nor.c @@ -1008,6 +1008,44 @@ static int flash_flexspi_nor_check_jedec(struct flash_flexspi_nor_data *data, /* Device uses bit 1 of status reg 2 for QE */ return flash_flexspi_nor_quad_enable(data, flexspi_lut, JESD216_DW15_QER_VAL_S2B1v5); + case 0x60ef: + if ((vendor_id & 0xFFFFFF) != 0x2060ef) { + /* + * This is not the correct flash chip, and will not + * support the LUT table. Return here + */ + return -ENOTSUP; + } + /* W25Q512NW-IQ/IN flash, use 4 byte read/write */ + flexspi_lut[READ][0] = FLEXSPI_LUT_SEQ( + kFLEXSPI_Command_SDR, kFLEXSPI_1PAD, SPI_NOR_CMD_4READ_4B, + kFLEXSPI_Command_RADDR_SDR, kFLEXSPI_4PAD, 32); + /* Flash needs 8 dummy cycles (at 133MHz) */ + flexspi_lut[READ][1] = FLEXSPI_LUT_SEQ( + kFLEXSPI_Command_DUMMY_SDR, kFLEXSPI_4PAD, 8, + kFLEXSPI_Command_READ_SDR, kFLEXSPI_4PAD, 0x04); + /* Only 1S-1S-4S page program supported */ + flexspi_lut[PAGE_PROGRAM][0] = FLEXSPI_LUT_SEQ( + kFLEXSPI_Command_SDR, kFLEXSPI_1PAD, SPI_NOR_CMD_PP_1_1_4_4B, + kFLEXSPI_Command_RADDR_SDR, kFLEXSPI_1PAD, 32); + flexspi_lut[PAGE_PROGRAM][1] = FLEXSPI_LUT_SEQ( + kFLEXSPI_Command_WRITE_SDR, kFLEXSPI_4PAD, 0x4, + kFLEXSPI_Command_STOP, kFLEXSPI_1PAD, 0x0); + /* Update ERASE commands for 4 byte mode */ + flexspi_lut[ERASE_SECTOR][0] = FLEXSPI_LUT_SEQ( + kFLEXSPI_Command_SDR, kFLEXSPI_1PAD, SPI_NOR_CMD_SE_4B, + kFLEXSPI_Command_RADDR_SDR, kFLEXSPI_1PAD, 32); + flexspi_lut[ERASE_BLOCK][0] = FLEXSPI_LUT_SEQ( + kFLEXSPI_Command_SDR, kFLEXSPI_1PAD, 0xDC, + kFLEXSPI_Command_RADDR_SDR, kFLEXSPI_1PAD, 32), + /* Read instruction used for polling is 0x05 */ + data->legacy_poll = true; + flexspi_lut[READ_STATUS_REG][0] = FLEXSPI_LUT_SEQ( + kFLEXSPI_Command_SDR, kFLEXSPI_1PAD, SPI_NOR_CMD_RDSR, + kFLEXSPI_Command_READ_SDR, kFLEXSPI_1PAD, 0x01); + /* Device uses bit 1 of status reg 2 for QE */ + return flash_flexspi_nor_quad_enable(data, flexspi_lut, + JESD216_DW15_QER_VAL_S2B1v5); case 0x25C2: /* MX25 flash, use 4 byte read/write */ flexspi_lut[READ][0] = FLEXSPI_LUT_SEQ( From 0856ceed7b2248c11a52b012e76b9fe6007fef8d Mon Sep 17 00:00:00 2001 From: Daniel DeGrasse Date: Wed, 16 Oct 2024 16:18:42 -0500 Subject: [PATCH 017/113] soc: nxp: imxrt: correct flexspi XIP check to avoid reclocking RT11xx SOC init should check to see if the zephyr flash node is set to a device on the FLEXSPI bus to determine if the part is running in XIP mode. This check was incorrect, so the FLEXSPI was being reclocked in XIP mode to 24 MHz. Fix this check so the FlexSPI is not downclocked. Fixes #75702 Signed-off-by: Daniel DeGrasse --- soc/nxp/imxrt/imxrt11xx/soc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/soc/nxp/imxrt/imxrt11xx/soc.c b/soc/nxp/imxrt/imxrt11xx/soc.c index 4f1cca4dcc6db0..5ba737cb286076 100644 --- a/soc/nxp/imxrt/imxrt11xx/soc.c +++ b/soc/nxp/imxrt/imxrt11xx/soc.c @@ -559,7 +559,7 @@ static ALWAYS_INLINE void clock_init(void) #endif #endif -#if !(DT_NODE_HAS_COMPAT(DT_CHOSEN(zephyr_flash), nxp_imx_flexspi)) && \ +#if !(DT_NODE_HAS_COMPAT(DT_PARENT(DT_CHOSEN(zephyr_flash)), nxp_imx_flexspi)) && \ defined(CONFIG_MEMC_MCUX_FLEXSPI) && DT_NODE_HAS_STATUS_OKAY(DT_NODELABEL(flexspi)) /* Configure FLEXSPI1 using OSC_RC_48M_DIV2 */ rootCfg.mux = kCLOCK_FLEXSPI1_ClockRoot_MuxOscRc48MDiv2; From 21f37c8bfd06eb1994829062126ec1c244261099 Mon Sep 17 00:00:00 2001 From: David Leach Date: Wed, 30 Oct 2024 14:27:39 -0500 Subject: [PATCH 018/113] tests: counter: RW612 dts overlay support for basic_api tests Remove memory spaces not needed for the counter_basic_api test. Add frdm_rw612.overlay Signed-off-by: David Leach --- .../boards/frdm_rw612.overlay | 48 +++++++++++++++++++ .../boards/rd_rw612_bga.overlay | 17 ++++++- 2 files changed, 64 insertions(+), 1 deletion(-) create mode 100644 tests/drivers/counter/counter_basic_api/boards/frdm_rw612.overlay diff --git a/tests/drivers/counter/counter_basic_api/boards/frdm_rw612.overlay b/tests/drivers/counter/counter_basic_api/boards/frdm_rw612.overlay new file mode 100644 index 00000000000000..536e2f60093c15 --- /dev/null +++ b/tests/drivers/counter/counter_basic_api/boards/frdm_rw612.overlay @@ -0,0 +1,48 @@ +/* + * Copyright 2024 NXP + * + * SPDX-License-Identifier: Apache-2.0 + */ + +&ctimer1 { + status = "okay"; +}; + +&ctimer2 { + status = "okay"; +}; + +&ctimer3 { + status = "okay"; +}; + +&mrt0_channel1 { + status = "okay"; +}; + +&mrt0_channel3 { + status = "okay"; +}; + +&mrt1_channel2 { + status = "okay"; +}; + +&mrt1_channel3 { + status = "okay"; +}; + +/* + * For testing purposes, free up memory spaces not needed by the testing. + */ +&smu1 { + smu1_data: memory@0 { + /delete-property/ zephyr,memory-attr; + }; +}; + +&smu2 { + smu2_data: memory@0 { + /delete-property/ zephyr,memory-attr; + }; +}; diff --git a/tests/drivers/counter/counter_basic_api/boards/rd_rw612_bga.overlay b/tests/drivers/counter/counter_basic_api/boards/rd_rw612_bga.overlay index b47bf1bde7ef60..919714d996c22f 100644 --- a/tests/drivers/counter/counter_basic_api/boards/rd_rw612_bga.overlay +++ b/tests/drivers/counter/counter_basic_api/boards/rd_rw612_bga.overlay @@ -1,5 +1,5 @@ /* - * Copyright 2023 NXP + * Copyright 2023-2024 NXP * * SPDX-License-Identifier: Apache-2.0 */ @@ -31,3 +31,18 @@ &mrt1_channel3 { status = "okay"; }; + +/* + * For testing purposes, free up memory spaces not needed by the testing. + */ +&smu1 { + smu1_data: memory@0 { + /delete-property/ zephyr,memory-attr; + }; +}; + +&smu2 { + smu2_data: memory@0 { + /delete-property/ zephyr,memory-attr; + }; +}; From 9cabb8996958d265266a15b536695a19f7f5f348 Mon Sep 17 00:00:00 2001 From: Anas Nashif Date: Thu, 31 Oct 2024 06:03:41 -0400 Subject: [PATCH 019/113] tests: drivers: display: fix filtering Test was marked build only with filters in each scenario looking for sdl-dc which is only available on native_sim, so cut the chase and use platform_only to narrow things down to native_sim directly instead of building the world to get information we already know. reduces build/run time from 78s to 17s on invocation of twister with default options, saves a ton more when running twister with --all. Signed-off-by: Anas Nashif --- .../display/display_read_write/testcase.yaml | 27 ++++++++++++------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/tests/drivers/display/display_read_write/testcase.yaml b/tests/drivers/display/display_read_write/testcase.yaml index 8e31d2f91f8313..499fc58a1f97eb 100644 --- a/tests/drivers/display/display_read_write/testcase.yaml +++ b/tests/drivers/display/display_read_write/testcase.yaml @@ -5,48 +5,55 @@ common: tags: - drivers - display - filter: dt_chosen_enabled("zephyr,display") - build_only: true # The CI environment has no display device + harness: display tests: drivers.display.read_write.sdl.argb8888: - filter: dt_compat_enabled("zephyr,sdl-dc") + platform_allow: + - native_sim extra_configs: - CONFIG_SDL_DISPLAY_DEFAULT_PIXEL_FORMAT_ARGB_8888=y - CONFIG_SDL_DISPLAY_USE_HARDWARE_ACCELERATOR=n drivers.display.read_write.sdl.rgb888: - filter: dt_compat_enabled("zephyr,sdl-dc") + platform_allow: + - native_sim extra_configs: - CONFIG_SDL_DISPLAY_DEFAULT_PIXEL_FORMAT_RGB_888=y - CONFIG_SDL_DISPLAY_USE_HARDWARE_ACCELERATOR=n drivers.display.read_write.sdl.mono01: - filter: dt_compat_enabled("zephyr,sdl-dc") + platform_allow: + - native_sim extra_configs: - CONFIG_SDL_DISPLAY_DEFAULT_PIXEL_FORMAT_MONO01=y - CONFIG_SDL_DISPLAY_USE_HARDWARE_ACCELERATOR=n drivers.display.read_write.sdl.mono10: - filter: dt_compat_enabled("zephyr,sdl-dc") + platform_allow: + - native_sim extra_configs: - CONFIG_SDL_DISPLAY_DEFAULT_PIXEL_FORMAT_MONO10=y - CONFIG_SDL_DISPLAY_USE_HARDWARE_ACCELERATOR=n drivers.display.read_write.sdl.mono01.lsbfirst: - filter: dt_compat_enabled("zephyr,sdl-dc") + platform_allow: + - native_sim extra_configs: - CONFIG_SDL_DISPLAY_DEFAULT_PIXEL_FORMAT_MONO01=y - CONFIG_SDL_DISPLAY_USE_HARDWARE_ACCELERATOR=n - CONFIG_SDL_DISPLAY_MONO_MSB_FIRST=n drivers.display.read_write.sdl.mono10.lsbfirst: - filter: dt_compat_enabled("zephyr,sdl-dc") + platform_allow: + - native_sim extra_configs: - CONFIG_SDL_DISPLAY_DEFAULT_PIXEL_FORMAT_MONO10=y - CONFIG_SDL_DISPLAY_USE_HARDWARE_ACCELERATOR=n - CONFIG_SDL_DISPLAY_MONO_MSB_FIRST=n drivers.display.read_write.sdl.rgb565: - filter: dt_compat_enabled("zephyr,sdl-dc") + platform_allow: + - native_sim extra_configs: - CONFIG_SDL_DISPLAY_DEFAULT_PIXEL_FORMAT_RGB_565=y - CONFIG_SDL_DISPLAY_USE_HARDWARE_ACCELERATOR=n drivers.display.read_write.sdl.bgr565: - filter: dt_compat_enabled("zephyr,sdl-dc") + platform_allow: + - native_sim extra_configs: - CONFIG_SDL_DISPLAY_DEFAULT_PIXEL_FORMAT_BGR_565=y - CONFIG_SDL_DISPLAY_USE_HARDWARE_ACCELERATOR=n From c1776df8ae8bacf4b6a0f2ad225846e4c2c41c5e Mon Sep 17 00:00:00 2001 From: Grzegorz Swiderski Date: Thu, 31 Oct 2024 11:54:12 +0100 Subject: [PATCH 020/113] soc: nordic: dmm: Fix DMM_REG_ALIGN_SIZE macro when CONFIG_DCACHE=n Make sure this expansion doesn't include `CONFIG_DCACHE_LINE_SIZE`, which would be undefined and produce a build error. Signed-off-by: Grzegorz Swiderski --- soc/nordic/common/dmm.h | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/soc/nordic/common/dmm.h b/soc/nordic/common/dmm.h index e92f01d07b85cc..34b517c92dfc79 100644 --- a/soc/nordic/common/dmm.h +++ b/soc/nordic/common/dmm.h @@ -23,12 +23,13 @@ extern "C" { /** @cond INTERNAL_HIDDEN */ +#ifdef CONFIG_DCACHE + /* Determine if memory region is cacheable. */ -#define DMM_IS_REG_CACHEABLE(node_id) \ - COND_CODE_1(CONFIG_DCACHE, \ - (COND_CODE_1(DT_NODE_HAS_PROP(node_id, zephyr_memory_attr), \ - ((DT_PROP(node_id, zephyr_memory_attr) & DT_MEM_CACHEABLE)), \ - (0))), (0)) +#define DMM_IS_REG_CACHEABLE(node_id) \ + COND_CODE_1(DT_NODE_HAS_PROP(node_id, zephyr_memory_attr), \ + ((DT_PROP(node_id, zephyr_memory_attr) & DT_MEM_CACHEABLE)), \ + (0)) /* Determine required alignment of the data buffers in specified memory region. * Cache line alignment is required if region is cacheable and data cache is enabled. @@ -36,6 +37,13 @@ extern "C" { #define DMM_REG_ALIGN_SIZE(node_id) \ (DMM_IS_REG_CACHEABLE(node_id) ? CONFIG_DCACHE_LINE_SIZE : sizeof(uint8_t)) +#else + +#define DMM_IS_REG_CACHEABLE(node_id) 0 +#define DMM_REG_ALIGN_SIZE(node_id) (sizeof(uint8_t)) + +#endif /* CONFIG_DCACHE */ + /* Determine required alignment of the data buffers in memory region * associated with specified device node. */ From 39015912d05977361db1c9be7f04e19ea8ce91c2 Mon Sep 17 00:00:00 2001 From: The Nguyen Date: Wed, 30 Oct 2024 15:02:04 +0700 Subject: [PATCH 021/113] boards: renesas: doc: update supported feature on Renesas RA boards Add information about CAN supported on these boards: - ek_ra8m1 - ek_ra8d1 - mck_ra8t1 Signed-off-by: The Nguyen --- boards/renesas/ek_ra8d1/doc/index.rst | 2 ++ boards/renesas/ek_ra8m1/doc/index.rst | 2 ++ boards/renesas/mck_ra8t1/doc/index.rst | 2 ++ 3 files changed, 6 insertions(+) diff --git a/boards/renesas/ek_ra8d1/doc/index.rst b/boards/renesas/ek_ra8d1/doc/index.rst index 1e423cc65baffd..a56e8869c334d3 100644 --- a/boards/renesas/ek_ra8d1/doc/index.rst +++ b/boards/renesas/ek_ra8d1/doc/index.rst @@ -108,6 +108,8 @@ The below features are currently supported on Zephyr OS for EK-RA8D1 board: +--------------+------------+------------------+ | COUNTER | on-chip | counter | +--------------+------------+------------------+ +| CAN | on-chip | canfd | ++--------------+------------+------------------+ Other hardware features are currently not supported by the port. diff --git a/boards/renesas/ek_ra8m1/doc/index.rst b/boards/renesas/ek_ra8m1/doc/index.rst index 1c22cd84bb906a..09d36befe02dcd 100644 --- a/boards/renesas/ek_ra8m1/doc/index.rst +++ b/boards/renesas/ek_ra8m1/doc/index.rst @@ -110,6 +110,8 @@ The below features are currently supported on Zephyr OS for EK-RA8M1 board: +-----------+------------+----------------------+ | COUNTER | on-chip | counter | +-----------+------------+----------------------+ +| CAN | on-chip | canfd | ++-----------+------------+----------------------+ Other hardware features are currently not supported by the port. diff --git a/boards/renesas/mck_ra8t1/doc/index.rst b/boards/renesas/mck_ra8t1/doc/index.rst index 5c13563514719b..4e24da06e38d21 100644 --- a/boards/renesas/mck_ra8t1/doc/index.rst +++ b/boards/renesas/mck_ra8t1/doc/index.rst @@ -106,6 +106,8 @@ The below features are currently supported on Zephyr OS for MCB-RA8T1 board: +--------------+------------+----------------------+ | COUNTER | on-chip | counter | +--------------+------------+----------------------+ +| CAN | on-chip | canfd | ++--------------+------------+----------------------+ Other hardware features are currently not supported by the port. From dbda4642cd92033ef00bc91c28ce5b7f5a407c7a Mon Sep 17 00:00:00 2001 From: Valerio Setti Date: Thu, 10 Oct 2024 11:13:34 +0200 Subject: [PATCH 022/113] drivers: crypto: deprecated TinyCrypt shim driver As part of the deprecation process of TinyCrypt started in #79566, this commit set the TinyCrypt based crypto shim driver as deprecated. Signed-off-by: Valerio Setti --- doc/releases/migration-guide-4.0.rst | 6 ++++++ drivers/crypto/Kconfig | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/doc/releases/migration-guide-4.0.rst b/doc/releases/migration-guide-4.0.rst index f5ad27bff77671..1f2f48bb4f31a3 100644 --- a/doc/releases/migration-guide-4.0.rst +++ b/doc/releases/migration-guide-4.0.rst @@ -199,6 +199,12 @@ Clock control Controller Area Network (CAN) ============================= +Crypto +====== + +* Following the deprecation of the TinyCrypt library (:github:`79566`), the + TinyCrypt-based shim driver was marked as deprecated (:github:`79653`). + Display ======= diff --git a/drivers/crypto/Kconfig b/drivers/crypto/Kconfig index 964e9439db0415..a1b147b12bfae4 100644 --- a/drivers/crypto/Kconfig +++ b/drivers/crypto/Kconfig @@ -22,14 +22,14 @@ module-str = CRYPTO source "subsys/logging/Kconfig.template.log_config" config CRYPTO_TINYCRYPT_SHIM - bool "TinyCrypt shim driver [EXPERIMENTAL]" + bool "TinyCrypt shim driver [DEPRECATED]" select TINYCRYPT select TINYCRYPT_AES select TINYCRYPT_AES_CBC select TINYCRYPT_AES_CTR select TINYCRYPT_AES_CCM select TINYCRYPT_AES_CMAC - select EXPERIMENTAL + select DEPRECATED help Enable TinyCrypt shim layer compliant with crypto APIs. From adad8dc48a8eeded928a6a4a067487f3a9e52146 Mon Sep 17 00:00:00 2001 From: Valerio Setti Date: Thu, 10 Oct 2024 12:09:46 +0200 Subject: [PATCH 023/113] soc: remove usage of TinyCrypt in NXP SOCs As for the IMX SOCs all the lines removed in this commit were actually commented out so there's basically no change in code behavior expected here. The only affected SOCs family is therefore the Kinetis one. Signed-off-by: Valerio Setti --- soc/nxp/imxrt/Kconfig.defconfig | 4 ---- soc/nxp/imxrt/imxrt5xx/Kconfig.defconfig | 4 ---- soc/nxp/imxrt/imxrt6xx/Kconfig.defconfig | 4 ---- soc/nxp/kinetis/kwx/Kconfig.defconfig | 4 ---- 4 files changed, 16 deletions(-) diff --git a/soc/nxp/imxrt/Kconfig.defconfig b/soc/nxp/imxrt/Kconfig.defconfig index efada2fc317c7a..caf637260d7c46 100644 --- a/soc/nxp/imxrt/Kconfig.defconfig +++ b/soc/nxp/imxrt/Kconfig.defconfig @@ -85,11 +85,7 @@ choice SEGGER_SYSVIEW_SECTION depends on SEGGER_SYSTEMVIEW endchoice -# -# MBEDTLS is larger but much faster than TinyCrypt so choose wisely -# config MBEDTLS -#config TINYCRYPT default y if CSPRNG_ENABLED depends on ENTROPY_GENERATOR diff --git a/soc/nxp/imxrt/imxrt5xx/Kconfig.defconfig b/soc/nxp/imxrt/imxrt5xx/Kconfig.defconfig index d25750e704ea0b..3c803947269c45 100644 --- a/soc/nxp/imxrt/imxrt5xx/Kconfig.defconfig +++ b/soc/nxp/imxrt/imxrt5xx/Kconfig.defconfig @@ -20,11 +20,7 @@ config NUM_IRQS config ZTEST_NO_YIELD default y if (PM && ZTEST) -# -# MBEDTLS is larger but much faster than TinyCrypt so choose wisely -# config MBEDTLS -#config TINYCRYPT default y if CSPRNG_ENABLED depends on ENTROPY_GENERATOR diff --git a/soc/nxp/imxrt/imxrt6xx/Kconfig.defconfig b/soc/nxp/imxrt/imxrt6xx/Kconfig.defconfig index 4a961be41cf232..cd2b03f8eb0782 100644 --- a/soc/nxp/imxrt/imxrt6xx/Kconfig.defconfig +++ b/soc/nxp/imxrt/imxrt6xx/Kconfig.defconfig @@ -34,11 +34,7 @@ config NUM_IRQS config ZTEST_NO_YIELD default y if (ZTEST && PM) -# -# MBEDTLS is larger but much faster than TinyCrypt so choose wisely -# config MBEDTLS -#config TINYCRYPT default y if CSPRNG_ENABLED depends on ENTROPY_GENERATOR diff --git a/soc/nxp/kinetis/kwx/Kconfig.defconfig b/soc/nxp/kinetis/kwx/Kconfig.defconfig index d2fb4f0de0daab..3785dcd1fd2597 100644 --- a/soc/nxp/kinetis/kwx/Kconfig.defconfig +++ b/soc/nxp/kinetis/kwx/Kconfig.defconfig @@ -25,10 +25,6 @@ choice RNG_GENERATOR_CHOICE default XOSHIRO_RANDOM_GENERATOR endchoice -config TINYCRYPT - default y - depends on ENTROPY_GENERATOR && SOC_MKW41Z4 - endif # SOC_MKW40Z4 || SOC_MKW41Z4 endif # SOC_SERIES_KINETIS_KWX From f4b7d151c599931cc4061b1cba788afa6ee8d6f1 Mon Sep 17 00:00:00 2001 From: Valerio Setti Date: Thu, 10 Oct 2024 12:47:22 +0200 Subject: [PATCH 024/113] board: remove references to TinyCrypt Following the deprecation of TinyCrypt (#79566) we remove tags referring to it. Signed-off-by: Valerio Setti --- boards/96boards/avenger96/96b_avenger96.yaml | 1 - boards/st/stm32mp157c_dk2/stm32mp157c_dk2.yaml | 1 - 2 files changed, 2 deletions(-) diff --git a/boards/96boards/avenger96/96b_avenger96.yaml b/boards/96boards/avenger96/96b_avenger96.yaml index 5d50bcd6943426..ef14d1b879d989 100644 --- a/boards/96boards/avenger96/96b_avenger96.yaml +++ b/boards/96boards/avenger96/96b_avenger96.yaml @@ -14,7 +14,6 @@ testing: - cmsis_rtos_v2 - net - mpu - - tinycrypt - crypto - aes - cmm diff --git a/boards/st/stm32mp157c_dk2/stm32mp157c_dk2.yaml b/boards/st/stm32mp157c_dk2/stm32mp157c_dk2.yaml index d552a6d6aa0d8c..91a4aa38fe0758 100644 --- a/boards/st/stm32mp157c_dk2/stm32mp157c_dk2.yaml +++ b/boards/st/stm32mp157c_dk2/stm32mp157c_dk2.yaml @@ -18,7 +18,6 @@ testing: - cmsis_rtos_v2 - net - mpu - - tinycrypt - crypto - aes - cmm From 3d45ee7cb7e98b868d01ce738304cd569344add1 Mon Sep 17 00:00:00 2001 From: Valerio Setti Date: Thu, 10 Oct 2024 13:17:03 +0200 Subject: [PATCH 025/113] random: remove TinyCrypt usage Following the deprecation of TinyCrypt (#79566) we remove TinyCrypt usage in random generators. This basically only affects the CTR-DRBG random generator which from now only will only make use of Mbed TLS. Signed-off-by: Valerio Setti --- doc/releases/migration-guide-4.0.rst | 8 +++ subsys/random/Kconfig | 6 +-- subsys/random/random_ctr_drbg.c | 74 ---------------------------- 3 files changed, 10 insertions(+), 78 deletions(-) diff --git a/doc/releases/migration-guide-4.0.rst b/doc/releases/migration-guide-4.0.rst index 1f2f48bb4f31a3..49b7e4e0be4f25 100644 --- a/doc/releases/migration-guide-4.0.rst +++ b/doc/releases/migration-guide-4.0.rst @@ -559,6 +559,14 @@ MCUmgr Modem ===== +Random +====== + +* Following the deprecation of the TinyCrypt library (:github:`79566`), usage + of TinyCrypt in the CTR-DRBG random number generator was removed. From now on + Mbed TLS is required to enable :kconfig:option:`CONFIG_CTR_DRBG_CSPRNG_GENERATOR`. + (:github:`79653`) + Shell ===== diff --git a/subsys/random/Kconfig b/subsys/random/Kconfig index 8eb3fe2e48b278..137929d78d20c3 100644 --- a/subsys/random/Kconfig +++ b/subsys/random/Kconfig @@ -106,11 +106,9 @@ config HARDWARE_DEVICE_CS_GENERATOR config CTR_DRBG_CSPRNG_GENERATOR bool "Use CTR-DRBG CSPRNG" - depends on MBEDTLS || TINYCRYPT + depends on MBEDTLS depends on ENTROPY_HAS_DRIVER - select MBEDTLS_CIPHER_AES_ENABLED if MBEDTLS - select TINYCRYPT_CTR_PRNG if TINYCRYPT - select TINYCRYPT_AES if TINYCRYPT + select MBEDTLS_CIPHER_AES_ENABLED help Enables the CTR-DRBG pseudo-random number generator. This CSPRNG shall use the entropy API for an initialization seed. The CTR-DRBG diff --git a/subsys/random/random_ctr_drbg.c b/subsys/random/random_ctr_drbg.c index 88c591075f1822..697c29da58b881 100644 --- a/subsys/random/random_ctr_drbg.c +++ b/subsys/random/random_ctr_drbg.c @@ -10,7 +10,6 @@ #include #include -#if defined(CONFIG_MBEDTLS) #if !defined(CONFIG_MBEDTLS_CFG_FILE) #include "mbedtls/config.h" #else @@ -18,14 +17,6 @@ #endif /* CONFIG_MBEDTLS_CFG_FILE */ #include -#elif defined(CONFIG_TINYCRYPT) - -#include -#include -#include - -#endif /* CONFIG_MBEDTLS */ - /* * entropy_dev is initialized at runtime to allow first time initialization * of the ctr_drbg engine. @@ -35,8 +26,6 @@ static const unsigned char drbg_seed[] = CONFIG_CS_CTR_DRBG_PERSONALIZATION; static bool ctr_initialised; static struct k_mutex ctr_lock; -#if defined(CONFIG_MBEDTLS) - static mbedtls_ctr_drbg_context ctr_ctx; static int ctr_drbg_entropy_func(void *ctx, unsigned char *buf, size_t len) @@ -44,13 +33,6 @@ static int ctr_drbg_entropy_func(void *ctx, unsigned char *buf, size_t len) return entropy_get_entropy(entropy_dev, (void *)buf, len); } -#elif defined(CONFIG_TINYCRYPT) - -static TCCtrPrng_t ctr_ctx; - -#endif /* CONFIG_MBEDTLS */ - - static int ctr_drbg_initialize(void) { int ret; @@ -62,8 +44,6 @@ static int ctr_drbg_initialize(void) return -ENODEV; } -#if defined(CONFIG_MBEDTLS) - mbedtls_ctr_drbg_init(&ctr_ctx); ret = mbedtls_ctr_drbg_seed(&ctr_ctx, @@ -77,27 +57,6 @@ static int ctr_drbg_initialize(void) return -EIO; } -#elif defined(CONFIG_TINYCRYPT) - - uint8_t entropy[TC_AES_KEY_SIZE + TC_AES_BLOCK_SIZE]; - - ret = entropy_get_entropy(entropy_dev, (void *)&entropy, - sizeof(entropy)); - if (ret != 0) { - return -EIO; - } - - ret = tc_ctr_prng_init(&ctr_ctx, - (uint8_t *)&entropy, - sizeof(entropy), - (uint8_t *)drbg_seed, - sizeof(drbg_seed)); - - if (ret == TC_CRYPTO_FAIL) { - return -EIO; - } - -#endif ctr_initialised = true; return 0; } @@ -117,41 +76,8 @@ int z_impl_sys_csrand_get(void *dst, uint32_t outlen) } } -#if defined(CONFIG_MBEDTLS) - ret = mbedtls_ctr_drbg_random(&ctr_ctx, (unsigned char *)dst, outlen); -#elif defined(CONFIG_TINYCRYPT) - - uint8_t entropy[TC_AES_KEY_SIZE + TC_AES_BLOCK_SIZE]; - - ret = tc_ctr_prng_generate(&ctr_ctx, 0, 0, (uint8_t *)dst, outlen); - - if (ret == TC_CRYPTO_SUCCESS) { - ret = 0; - } else if (ret == TC_CTR_PRNG_RESEED_REQ) { - - ret = entropy_get_entropy(entropy_dev, - (void *)&entropy, sizeof(entropy)); - if (ret != 0) { - ret = -EIO; - goto end; - } - - ret = tc_ctr_prng_reseed(&ctr_ctx, - entropy, - sizeof(entropy), - drbg_seed, - sizeof(drbg_seed)); - - ret = tc_ctr_prng_generate(&ctr_ctx, 0, 0, - (uint8_t *)dst, outlen); - - ret = (ret == TC_CRYPTO_SUCCESS) ? 0 : -EIO; - } else { - ret = -EIO; - } -#endif end: k_mutex_unlock(&ctr_lock); From 7f5574817fab1a422e19f6b66de5cd764f4ab78f Mon Sep 17 00:00:00 2001 From: Valerio Setti Date: Thu, 10 Oct 2024 15:45:08 +0200 Subject: [PATCH 026/113] jwt: remove TinyCrypt usage As part of TinyCrypt deprecation process (#79566) this commit removes usage of this library from the JWT subsystem and its related tests. Signed-off-by: Valerio Setti --- doc/releases/migration-guide-4.0.rst | 20 ++++-- doc/releases/release-notes-4.0.rst | 12 ++-- subsys/jwt/CMakeLists.txt | 6 +- subsys/jwt/Kconfig | 67 +++++--------------- subsys/jwt/jwt.c | 8 +-- subsys/jwt/jwt_legacy_ecdsa.c | 82 ------------------------- subsys/jwt/jwt_psa.c | 6 +- tests/subsys/jwt/src/jwt-test-private.c | 4 +- tests/subsys/jwt/testcase.yaml | 13 +--- 9 files changed, 54 insertions(+), 164 deletions(-) delete mode 100644 subsys/jwt/jwt_legacy_ecdsa.c diff --git a/doc/releases/migration-guide-4.0.rst b/doc/releases/migration-guide-4.0.rst index 49b7e4e0be4f25..dbe251676204fb 100644 --- a/doc/releases/migration-guide-4.0.rst +++ b/doc/releases/migration-guide-4.0.rst @@ -576,11 +576,21 @@ Shell JWT (JSON Web Token) ==================== -* By default, the signature is now computed through PSA Crypto API for both RSA and ECDSA. - The newly-added :kconfig:option:`CONFIG_JWT_USE_LEGACY` can be used to switch - back to previous libraries (TinyCrypt for ECDSA and Mbed TLS for RSA). - The conversion to the PSA Crypto API is being done in preparation for the - deprecation of TinyCrypt. (:github:`78243` and :github:`43712`) +* By default, the signature is now computed using the PSA Crypto API for both RSA and ECDSA + (:github:`78243`). The conversion to the PSA Crypto API is part of the adoption + of a standard interface for crypto operations (:github:`43712`). Moreover, + following the deprecation of the TinyCrypt library (:github:`79566`), usage + of TinyCrypt was removed from the JWT subsystem (:github:`79653`). + +* The following new symbols were added to allow specifying both the signature + algorithm and crypto library: + + * :kconfig:option:`CONFIG_JWT_SIGN_RSA_PSA` (default) RSA signature using the PSA Crypto API; + * :kconfig:option:`CONFIG_JWT_SIGN_RSA_LEGACY` RSA signature using Mbed TLS; + * :kconfig:option:`CONFIG_JWT_SIGN_ECDSA_PSA` ECDSA signature using the PSA Crypto API. + + They replace the previously-existing Kconfigs ``CONFIG_JWT_SIGN_RSA`` and + ``CONFIG_JWT_SIGN_ECDSA``. (:github:`79653`) Architectures ************* diff --git a/doc/releases/release-notes-4.0.rst b/doc/releases/release-notes-4.0.rst index 16c1b595ac1053..dba6c620904acf 100644 --- a/doc/releases/release-notes-4.0.rst +++ b/doc/releases/release-notes-4.0.rst @@ -608,12 +608,14 @@ Libraries / Subsystems * JWT (JSON Web Token) - * The following new Kconfigs were added to specify which library to use for the - signature: + * The following new symbols were added to allow specifying both the signature + algorithm and crypto library: - * :kconfig:option:`CONFIG_JWT_USE_PSA` (default) use the PSA Crypto API; - * :kconfig:option:`CONFIG_JWT_USE_LEGACY` use legacy libraries, i.e. TinyCrypt - for ECDSA and Mbed TLS for RSA. + * :kconfig:option:`CONFIG_JWT_SIGN_RSA_PSA` (default) RSA signature using the PSA Crypto API; + * :kconfig:option:`CONFIG_JWT_SIGN_RSA_LEGACY` RSA signature using Mbed TLS; + * :kconfig:option:`CONFIG_JWT_SIGN_ECDSA_PSA` ECDSA signature using the PSA Crypto API. + + (:github:`79653`) HALs **** diff --git a/subsys/jwt/CMakeLists.txt b/subsys/jwt/CMakeLists.txt index 82c65f11f414c1..6bc93cd92b8c17 100644 --- a/subsys/jwt/CMakeLists.txt +++ b/subsys/jwt/CMakeLists.txt @@ -3,8 +3,10 @@ zephyr_library() zephyr_library_sources(jwt.c) -zephyr_library_sources_ifdef(CONFIG_JWT_SIGN_ECDSA_LEGACY jwt_legacy_ecdsa.c) zephyr_library_sources_ifdef(CONFIG_JWT_SIGN_RSA_LEGACY jwt_legacy_rsa.c) -zephyr_library_sources_ifdef(CONFIG_JWT_USE_PSA jwt_psa.c) + +if (CONFIG_JWT_SIGN_RSA_PSA OR CONFIG_JWT_SIGN_ECDSA_PSA) + zephyr_library_sources(jwt_psa.c) +endif() zephyr_library_link_libraries_ifdef(CONFIG_MBEDTLS mbedTLS) diff --git a/subsys/jwt/Kconfig b/subsys/jwt/Kconfig index 651fe46cbf57fa..97446e27d9ee7b 100644 --- a/subsys/jwt/Kconfig +++ b/subsys/jwt/Kconfig @@ -12,69 +12,34 @@ if JWT choice prompt "JWT signature algorithm" - default JWT_SIGN_RSA + default JWT_SIGN_RSA_PSA help Select which algorithm to use for signing JWT tokens. -config JWT_SIGN_RSA - bool "Use RSA signature (RS-256)" - -config JWT_SIGN_ECDSA - bool "Use ECDSA signature (ES-256)" - -endchoice - -choice - default JWT_USE_PSA - prompt "Select crypto library to be used" +config JWT_SIGN_RSA_LEGACY + bool "Use RSA signature (RS-256). Use Mbed TLS as crypto library." + depends on CSPRNG_ENABLED + select MBEDTLS + select MBEDTLS_KEY_EXCHANGE_RSA_ENABLED -config JWT_USE_PSA - bool "PSA crypto API library" +config JWT_SIGN_RSA_PSA + bool "Use RSA signature (RS-256). Use PSA Crypto API." select MBEDTLS if !BUILD_WITH_TFM select MBEDTLS_PSA_CRYPTO_C if !BUILD_WITH_TFM + select PSA_WANT_KEY_TYPE_RSA_PUBLIC_KEY + select PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_IMPORT + select PSA_WANT_ALG_RSA_PKCS1V15_SIGN + select PSA_WANT_ALG_SHA_256 -config JWT_USE_LEGACY - bool "Legacy library: TinyCrypt for ECDSA, Mbed TLS for RSA" - -endchoice - -# Prompless Kconfigs to effectively select which algorithm and library will be used -# to sign the JWT. User's selections on the above choices will determine which -# element will be picked here. config JWT_SIGN_ECDSA_PSA - bool - default y - depends on JWT_SIGN_ECDSA && JWT_USE_PSA + bool "Use ECDSA signature (ES-256). Use PSA Crypto API." + select MBEDTLS if !BUILD_WITH_TFM + select MBEDTLS_PSA_CRYPTO_C if !BUILD_WITH_TFM select PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_IMPORT select PSA_WANT_ALG_ECDSA select PSA_WANT_ECC_SECP_R1_256 select PSA_WANT_ALG_SHA_256 -config JWT_SIGN_ECDSA_LEGACY - bool - default y - depends on JWT_SIGN_ECDSA && JWT_USE_LEGACY - select TINYCRYPT - select TINYCRYPT_SHA256 - select TINYCRYPT_ECC_DSA - select TINYCRYPT_CTR_PRNG - select TINYCRYPT_AES - -config JWT_SIGN_RSA_PSA - bool - default y - depends on JWT_SIGN_RSA && JWT_USE_PSA - select PSA_WANT_KEY_TYPE_RSA_PUBLIC_KEY - select PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_IMPORT - select PSA_WANT_ALG_RSA_PKCS1V15_SIGN - select PSA_WANT_ALG_SHA_256 - -config JWT_SIGN_RSA_LEGACY - bool - default y - depends on JWT_SIGN_RSA && JWT_USE_LEGACY - depends on CSPRNG_ENABLED - select MBEDTLS - select MBEDTLS_KEY_EXCHANGE_RSA_ENABLED +endchoice endif # JWT diff --git a/subsys/jwt/jwt.c b/subsys/jwt/jwt.c index 4487e557096af1..1774637cff962f 100644 --- a/subsys/jwt/jwt.c +++ b/subsys/jwt/jwt.c @@ -14,9 +14,9 @@ #include "jwt.h" -#if defined(CONFIG_JWT_SIGN_RSA) +#if defined(CONFIG_JWT_SIGN_RSA_PSA) || defined(JWT_SIGN_RSA_LEGACY) #define JWT_SIGNATURE_LEN 256 -#else /* CONFIG_JWT_SIGN_ECDSA */ +#else /* CONFIG_JWT_SIGN_ECDSA_PSA */ #define JWT_SIGNATURE_LEN 64 #endif @@ -143,10 +143,10 @@ static int jwt_add_header(struct jwt_builder *builder) * Use https://www.base64encode.org/ for update */ const char jwt_header[] = -#ifdef CONFIG_JWT_SIGN_RSA +#if defined(CONFIG_JWT_SIGN_RSA_PSA) || defined(CONFIG_JWT_SIGN_RSA_LEGACY) /* {"alg":"RS256","typ":"JWT"} */ "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9"; -#else /* CONFIG_JWT_SIGN_ECDSA */ +#else /* CONFIG_JWT_SIGN_ECDSA_PSA */ /* {"alg":"ES256","typ":"JWT"} */ "eyJhbGciOiJFUzI1NiIsInR5cCI6IkpXVCJ9"; #endif diff --git a/subsys/jwt/jwt_legacy_ecdsa.c b/subsys/jwt/jwt_legacy_ecdsa.c deleted file mode 100644 index d8368280270d0b..00000000000000 --- a/subsys/jwt/jwt_legacy_ecdsa.c +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Copyright (C) 2024 BayLibre SAS - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#include -#include -#include - -#include -#include -#include - -#include -#include -#include -#include - -#include "jwt.h" - -static TCCtrPrng_t prng_state; -static bool prng_init; - -static const char personalize[] = "zephyr:drivers/jwt/jwt.c"; - -static int setup_prng(void) -{ - if (prng_init) { - return 0; - } - prng_init = true; - - uint8_t entropy[TC_AES_KEY_SIZE + TC_AES_BLOCK_SIZE]; - - sys_rand_get(entropy, sizeof(entropy)); - - int res = tc_ctr_prng_init(&prng_state, (const uint8_t *)&entropy, sizeof(entropy), - personalize, sizeof(personalize)); - - return res == TC_CRYPTO_SUCCESS ? 0 : -EINVAL; -} - -/* This function is declared in - * modules/crypto/tinycrypt/lib/include/tinycrypt/ecc_platform_specific.h. - * - * TinyCrypt expects this function to be implemented somewhere when using the - * ECC module. - */ -int default_CSPRNG(uint8_t *dest, unsigned int size) -{ - int res = tc_ctr_prng_generate(&prng_state, NULL, 0, dest, size); - return res; -} - -int jwt_sign_impl(struct jwt_builder *builder, const unsigned char *der_key, size_t der_key_len, - unsigned char *sig, size_t sig_size) -{ - struct tc_sha256_state_struct ctx; - uint8_t hash[32]; - int res; - - ARG_UNUSED(sig_size); - - tc_sha256_init(&ctx); - tc_sha256_update(&ctx, builder->base, builder->buf - builder->base); - tc_sha256_final(hash, &ctx); - - res = setup_prng(); - - if (res != 0) { - return res; - } - - /* Note that tinycrypt only supports P-256. */ - res = uECC_sign(der_key, hash, sizeof(hash), sig, &curve_secp256r1); - if (res != TC_CRYPTO_SUCCESS) { - return -EINVAL; - } - - return 0; -} diff --git a/subsys/jwt/jwt_psa.c b/subsys/jwt/jwt_psa.c index edbafa6fefee57..ce5928c09bbd18 100644 --- a/subsys/jwt/jwt_psa.c +++ b/subsys/jwt/jwt_psa.c @@ -24,15 +24,15 @@ int jwt_sign_impl(struct jwt_builder *builder, const unsigned char *der_key, siz psa_algorithm_t alg; int ret; -#if defined(CONFIG_JWT_SIGN_ECDSA) +#if defined(CONFIG_JWT_SIGN_ECDSA_PSA) psa_set_key_type(&attr, PSA_KEY_TYPE_ECC_KEY_PAIR(PSA_ECC_FAMILY_SECP_R1)); psa_set_key_algorithm(&attr, PSA_ALG_ECDSA(PSA_ALG_SHA_256)); alg = PSA_ALG_ECDSA(PSA_ALG_SHA_256); -#else /* CONFIG_JWT_SIGN_RSA */ +#else psa_set_key_type(&attr, PSA_KEY_TYPE_RSA_KEY_PAIR); psa_set_key_algorithm(&attr, PSA_ALG_RSA_PKCS1V15_SIGN(PSA_ALG_SHA_256)); alg = PSA_ALG_RSA_PKCS1V15_SIGN(PSA_ALG_SHA_256); -#endif /* CONFIG_JWT_SIGN_ECDSA || CONFIG_JWT_SIGN_RSA */ +#endif psa_set_key_usage_flags(&attr, PSA_KEY_USAGE_SIGN_MESSAGE); status = psa_import_key(&attr, der_key, der_key_len, &key_id); diff --git a/tests/subsys/jwt/src/jwt-test-private.c b/tests/subsys/jwt/src/jwt-test-private.c index a6fc98a8fb765c..600eaf62d5b13d 100644 --- a/tests/subsys/jwt/src/jwt-test-private.c +++ b/tests/subsys/jwt/src/jwt-test-private.c @@ -4,7 +4,7 @@ * */ -#if defined(CONFIG_JWT_SIGN_RSA) +#if defined(CONFIG_JWT_SIGN_RSA_PSA) || defined(CONFIG_JWT_SIGN_RSA_LEGACY) /* To generate the key in the correct format use the following command: * $ openssl genrsa 2048 | openssl rsa -outform DER | xxd -i @@ -113,7 +113,7 @@ unsigned char jwt_test_private_der[] = { 0x05, 0xfd, 0x71, 0xb0, 0x3e }; -#else /* CONFIG_JWT_SIGN_ECDSA */ +#else /* CONFIG_JWT_SIGN_ECDSA_PSA */ /* Here's how to generate the key in the correct format: * - generate the key using OpenSSL: diff --git a/tests/subsys/jwt/testcase.yaml b/tests/subsys/jwt/testcase.yaml index 6606780a9f1b29..f439e9aea9e1ce 100644 --- a/tests/subsys/jwt/testcase.yaml +++ b/tests/subsys/jwt/testcase.yaml @@ -9,24 +9,17 @@ common: extra_configs: - CONFIG_TEST_RANDOM_GENERATOR=y tests: - libraries.encoding.jwt.ecdsa.legacy: - extra_configs: - - CONFIG_JWT_SIGN_ECDSA=y - - CONFIG_JWT_USE_LEGACY=y libraries.encoding.jwt.ecdsa.psa: extra_configs: - - CONFIG_JWT_SIGN_ECDSA=y - - CONFIG_JWT_USE_PSA=y + - CONFIG_JWT_SIGN_ECDSA_PSA=y - CONFIG_MBEDTLS_PSA_CRYPTO_EXTERNAL_RNG=y - CONFIG_MBEDTLS_PSA_CRYPTO_EXTERNAL_RNG_ALLOW_NON_CSPRNG=y libraries.encoding.jwt.rsa.legacy: filter: CSPRNG_ENABLED extra_configs: - - CONFIG_JWT_SIGN_RSA=y - - CONFIG_JWT_USE_LEGACY=y + - CONFIG_JWT_SIGN_RSA_LEGACY=y libraries.encoding.jwt.rsa.psa: extra_configs: - - CONFIG_JWT_SIGN_RSA=y - - CONFIG_JWT_USE_PSA=y + - CONFIG_JWT_SIGN_RSA_PSA=y - CONFIG_MBEDTLS_PSA_CRYPTO_EXTERNAL_RNG=y - CONFIG_MBEDTLS_PSA_CRYPTO_EXTERNAL_RNG_ALLOW_NON_CSPRNG=y From db967209ca6f3bcaf59d9bfdd4e30ff757d72acc Mon Sep 17 00:00:00 2001 From: Vinayak Kariappa Chettimada Date: Sat, 2 Nov 2024 08:08:54 +0100 Subject: [PATCH 027/113] Bluetooth: Controller: Fix spurious ISO Sync receiver stall Fix spurious ISO Sync Receiver stall due to uninitialised value accessed due to regression introduced by commit 64faceea7270 ("Bluetooth: controller: Stop Sync ISO ticker when establishment fails"). Signed-off-by: Vinayak Kariappa Chettimada --- subsys/bluetooth/controller/ll_sw/nordic/lll/lll_sync_iso.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_sync_iso.c b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_sync_iso.c index 2b17807f217edf..5eeba29b5e88ca 100644 --- a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_sync_iso.c +++ b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_sync_iso.c @@ -427,6 +427,7 @@ static void abort_cb(struct lll_prepare_param *prepare_param, void *param) LL_ASSERT(e); e->type = EVENT_DONE_EXTRA_TYPE_SYNC_ISO; + e->estab_failed = 0U; e->trx_cnt = 0U; e->crc_valid = 0U; @@ -1281,6 +1282,7 @@ static void isr_rx_done(void *param) /* Calculate and place the drift information in done event */ e->type = EVENT_DONE_EXTRA_TYPE_SYNC_ISO; + e->estab_failed = 0U; e->trx_cnt = trx_cnt; e->crc_valid = crc_ok_anchor; From 4c5c434ea20d745a251e2ad063142969854133aa Mon Sep 17 00:00:00 2001 From: Pavel Vasilyev Date: Wed, 30 Oct 2024 13:29:30 +0100 Subject: [PATCH 028/113] bluetooth: mesh: adv: legacy: Check suspended flag in the adv thread Instead of checking the `enabled` flag, check if BT_MESH_SUSPENDED is set in the legacy advertiser thread. BT_MESH_SUSPENDED is set earlier than advertiser is stopped and will prevent the advertiser send anything earlier. Signed-off-by: Pavel Vasilyev --- subsys/bluetooth/mesh/adv_legacy.c | 31 ++++++++++++++++++++++++------ 1 file changed, 25 insertions(+), 6 deletions(-) diff --git a/subsys/bluetooth/mesh/adv_legacy.c b/subsys/bluetooth/mesh/adv_legacy.c index c79a118cf1554a..207ff718566e43 100644 --- a/subsys/bluetooth/mesh/adv_legacy.c +++ b/subsys/bluetooth/mesh/adv_legacy.c @@ -38,7 +38,11 @@ LOG_MODULE_REGISTER(bt_mesh_adv_legacy); static struct k_thread adv_thread_data; static K_KERNEL_STACK_DEFINE(adv_thread_stack, CONFIG_BT_MESH_ADV_STACK_SIZE); static int32_t adv_timeout; -static bool enabled; + +static bool is_mesh_suspended(void) +{ + return atomic_test_bit(bt_mesh.flags, BT_MESH_SUSPENDED); +} static int bt_data_send(uint8_t num_events, uint16_t adv_int, const struct bt_data *ad, size_t ad_len, @@ -104,7 +108,7 @@ static int bt_data_send(uint8_t num_events, uint16_t adv_int, bt_mesh_adv_send_start(duration, err, ctx); } - if (enabled) { + if (!is_mesh_suspended()) { k_sleep(K_MSEC(duration)); } @@ -148,7 +152,7 @@ static void adv_thread(void *p1, void *p2, void *p3) LOG_DBG("started"); struct bt_mesh_adv *adv; - while (enabled) { + while (!is_mesh_suspended()) { if (IS_ENABLED(CONFIG_BT_MESH_GATT_SERVER)) { adv = bt_mesh_adv_get(K_NO_WAIT); if (IS_ENABLED(CONFIG_BT_MESH_PROXY_SOLICITATION) && !adv) { @@ -234,7 +238,13 @@ void bt_mesh_adv_init(void) int bt_mesh_adv_enable(void) { - enabled = true; + /* The advertiser thread relies on BT_MESH_SUSPENDED flag. No point in starting the + * advertiser thread if the flag is not set. + */ + if (is_mesh_suspended()) { + return -EINVAL; + } + k_thread_start(&adv_thread_data); return 0; } @@ -243,12 +253,21 @@ int bt_mesh_adv_disable(void) { int err; - enabled = false; + /* k_thread_join will sleep forever if BT_MESH_SUSPENDED flag is not set. The advertiser + * thread will exit once the flag is set. The flag is set by the higher layer function. Here + * we need to check that the flag is dropped and ensure that the thread is stopped. + */ + if (!is_mesh_suspended()) { + return -EINVAL; + } err = k_thread_join(&adv_thread_data, K_FOREVER); LOG_DBG("Advertising disabled: %d", err); - return 0; + /* Since the thread will immediately stop after this function call and won’t perform any + * further operations, it’s safe to ignore the deadlock error (EDEADLK). + */ + return err == -EDEADLK ? 0 : err; } int bt_mesh_adv_gatt_start(const struct bt_le_adv_param *param, int32_t duration, From 457a20c4a2a9225a865653c2312b23d8d32d13d3 Mon Sep 17 00:00:00 2001 From: Pavel Vasilyev Date: Wed, 30 Oct 2024 14:29:43 +0100 Subject: [PATCH 029/113] test: bsim: bluetooth: mesh: Wait until adv is actually sent k_sleep may not be enough to let advertiser send the message. Instead we should rely on the bt_mesh_send_cb. Signed-off-by: Pavel Vasilyev --- tests/bsim/bluetooth/mesh/src/mesh_test.c | 8 +++++- tests/bsim/bluetooth/mesh/src/mesh_test.h | 2 ++ tests/bsim/bluetooth/mesh/src/test_suspend.c | 26 ++++++++++++++++++-- 3 files changed, 33 insertions(+), 3 deletions(-) diff --git a/tests/bsim/bluetooth/mesh/src/mesh_test.c b/tests/bsim/bluetooth/mesh/src/mesh_test.c index c092c9135b179c..757e150c350131 100644 --- a/tests/bsim/bluetooth/mesh/src/mesh_test.c +++ b/tests/bsim/bluetooth/mesh/src/mesh_test.c @@ -569,11 +569,17 @@ uint16_t bt_mesh_test_own_addr_get(uint16_t start_addr) } void bt_mesh_test_send_over_adv(void *data, size_t len) +{ + bt_mesh_test_send_over_adv_cb(data, len, NULL, NULL); +} + +void bt_mesh_test_send_over_adv_cb(void *data, size_t len, const struct bt_mesh_send_cb *cb, + void *cb_data) { struct bt_mesh_adv *adv = bt_mesh_adv_create(BT_MESH_ADV_DATA, BT_MESH_ADV_TAG_LOCAL, BT_MESH_TRANSMIT(0, 20), K_NO_WAIT); net_buf_simple_add_mem(&adv->b, data, len); - bt_mesh_adv_send(adv, NULL, NULL); + bt_mesh_adv_send(adv, cb, cb_data); } int bt_mesh_test_wait_for_packet(bt_le_scan_cb_t scan_cb, struct k_sem *observer_sem, uint16_t wait) diff --git a/tests/bsim/bluetooth/mesh/src/mesh_test.h b/tests/bsim/bluetooth/mesh/src/mesh_test.h index d3af115c8814b2..2a88d4156ca2be 100644 --- a/tests/bsim/bluetooth/mesh/src/mesh_test.h +++ b/tests/bsim/bluetooth/mesh/src/mesh_test.h @@ -204,6 +204,8 @@ void bt_mesh_test_ra_cb_setup(void (*cb)(uint8_t *, size_t)); uint16_t bt_mesh_test_own_addr_get(uint16_t start_addr); void bt_mesh_test_send_over_adv(void *data, size_t len); +void bt_mesh_test_send_over_adv_cb(void *data, size_t len, const struct bt_mesh_send_cb *cb, + void *cb_data); /* Wait for a packet (i. e. an advertisement or a GATT frame) sent by a device. * `scan_cb` is triggered if the packet is received, and must release `observer_sem` when finished. */ diff --git a/tests/bsim/bluetooth/mesh/src/test_suspend.c b/tests/bsim/bluetooth/mesh/src/test_suspend.c index 5ec6a8dc68525e..58154f37446402 100644 --- a/tests/bsim/bluetooth/mesh/src/test_suspend.c +++ b/tests/bsim/bluetooth/mesh/src/test_suspend.c @@ -318,8 +318,29 @@ static void dut_pub_common(bool disable_bt) ASSERT_OK(bt_mesh_suspend()); } +static void send_start(uint16_t duration, int err, void *cb_data) +{ + if (err) { + FAIL("Failed to send message (err %d)", err); + } +} + +static void send_end(int err, void *cb_data) +{ + k_sem_give((struct k_sem *)cb_data); +} + static void dut_gatt_common(bool disable_bt) { + struct k_sem send_sem; + + k_sem_init(&send_sem, 0, 1); + + const struct bt_mesh_send_cb send_cb = { + .start = send_start, + .end = send_end, + }; + bt_mesh_test_cfg_set(NULL, WAIT_TIME); bt_mesh_device_setup(&prov, &comp); ASSERT_OK_MSG(bt_mesh_prov_enable(BT_MESH_PROV_GATT), "Failed to enable GATT provisioner"); @@ -336,8 +357,9 @@ static void dut_gatt_common(bool disable_bt) /* Send a mesh message to notify Tester that DUT is about to be suspended. */ dut_status = DUT_SUSPENDED; - bt_mesh_test_send_over_adv(&dut_status, sizeof(enum dut_mesh_status)); - k_sleep(K_MSEC(150)); + bt_mesh_test_send_over_adv_cb(&dut_status, sizeof(enum dut_mesh_status), &send_cb, + &send_sem); + ASSERT_OK(k_sem_take(&send_sem, K_MSEC(200))); ASSERT_OK_MSG(bt_mesh_suspend(), "Failed to suspend Mesh."); From 94ad822a339e06beafa653bcdb58ba20b1d6d4c2 Mon Sep 17 00:00:00 2001 From: Carles Cufi Date: Tue, 5 Nov 2024 16:29:04 +0100 Subject: [PATCH 030/113] include: dt-bindings: regulator: nrf5x: Fix guards Fix the include guard mismatch. Found building with clang. Signed-off-by: Carles Cufi --- include/zephyr/dt-bindings/regulator/nrf5x.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/zephyr/dt-bindings/regulator/nrf5x.h b/include/zephyr/dt-bindings/regulator/nrf5x.h index d2507c74a6ea42..1f4e048e9d1f1b 100644 --- a/include/zephyr/dt-bindings/regulator/nrf5x.h +++ b/include/zephyr/dt-bindings/regulator/nrf5x.h @@ -4,7 +4,7 @@ */ #ifndef ZEPHYR_INCLUDE_DT_BINDINGS_REGULATOR_NRF5X_H_ -#define ZEPHYR_INCLUDE_DT_BINDINGS_REGULATOR_NRF_H_ +#define ZEPHYR_INCLUDE_DT_BINDINGS_REGULATOR_NRF5X_H_ /** * @defgroup regulator_nrf5x nRF5X regulator devicetree helpers. From 646775bf9e36c280ad62c8a1811edc030abf7b8c Mon Sep 17 00:00:00 2001 From: Daniel Baluta Date: Tue, 22 Oct 2024 11:41:25 +0300 Subject: [PATCH 031/113] manifest: hal_nxp: Pull in change to fix irqsteer mask computation This fixes irq_steer channel mask index computation for i.MX8MP platform. Signed-off-by: Daniel Baluta --- west.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/west.yml b/west.yml index 6ee2aaa5e53c03..36be63ac83469d 100644 --- a/west.yml +++ b/west.yml @@ -198,7 +198,7 @@ manifest: groups: - hal - name: hal_nxp - revision: 4a4741fa2be33f6b638a49e357c5e33bb7ad0544 + revision: ca9c81a06fbd3db10faf708194443511f1eadacb path: modules/hal/nxp groups: - hal From b9fbfc9a23167ed3c490d02ef91360195a7c40ec Mon Sep 17 00:00:00 2001 From: Lingao Meng Date: Tue, 24 Sep 2024 14:41:44 +0800 Subject: [PATCH 032/113] Bluetooth: Mesh: Introduce separate workq for ADV EXT this PR is to make the host always send packets. Signed-off-by: Lingao Meng --- doc/releases/release-notes-4.0.rst | 5 ++ subsys/bluetooth/mesh/Kconfig | 58 +++++++++++++++++++ subsys/bluetooth/mesh/adv.h | 2 + subsys/bluetooth/mesh/adv_ext.c | 39 +++++++++++-- subsys/bluetooth/mesh/adv_legacy.c | 5 ++ subsys/bluetooth/mesh/proxy_msg.c | 49 +++++++++++++++- subsys/bluetooth/mesh/proxy_msg.h | 3 + subsys/bluetooth/mesh/proxy_srv.c | 2 +- tests/bsim/bluetooth/mesh/compile.sh | 5 +- .../bluetooth/mesh/overlay_workq_sys.conf | 1 + tests/bsim/bluetooth/mesh/src/test_suspend.c | 3 + .../mesh/tests_scripts/advertiser/disable.sh | 3 + .../tests_scripts/advertiser/proxy_mixin.sh | 3 + .../tests_scripts/advertiser/random_order.sh | 3 + .../tests_scripts/advertiser/reverse_order.sh | 3 + .../tests_scripts/advertiser/send_order.sh | 3 + .../tests_scripts/advertiser/tx_cb_multi.sh | 3 + .../tests_scripts/advertiser/tx_cb_single.sh | 3 + .../tests_scripts/proxy_sol/sol_replay.sh | 12 ++++ 19 files changed, 197 insertions(+), 8 deletions(-) create mode 100644 tests/bsim/bluetooth/mesh/overlay_workq_sys.conf diff --git a/doc/releases/release-notes-4.0.rst b/doc/releases/release-notes-4.0.rst index dba6c620904acf..04f4a043ef9fe0 100644 --- a/doc/releases/release-notes-4.0.rst +++ b/doc/releases/release-notes-4.0.rst @@ -148,6 +148,11 @@ Bluetooth * HCI Drivers +* Mesh + + * Introduced a mesh-specific workqueue to increase reliability of the mesh messages + transmission. To get the old behavior enable :kconfig:option:`CONFIG_BT_MESH_WORKQ_SYS`. + Boards & SoC Support ******************** diff --git a/subsys/bluetooth/mesh/Kconfig b/subsys/bluetooth/mesh/Kconfig index 384033f79083e8..37f15191c771ce 100644 --- a/subsys/bluetooth/mesh/Kconfig +++ b/subsys/bluetooth/mesh/Kconfig @@ -103,6 +103,64 @@ menuconfig BT_MESH_ADV_EXT if BT_MESH_ADV_EXT +choice BT_MESH_WORKQ_CONTEXT + prompt "Advertising thread selection" + default BT_MESH_WORKQ_MESH + help + Defines a context for mesh messages transmission. + +config BT_MESH_WORKQ_MESH + bool "Mesh-specific workqueue" + help + When this option is selected, the mesh sends messages from the + mesh-specific workqueue. This will ensure that messages are always sent. + The application needs to ensure the mesh-specific workqueue size is large + enough. Refer to BT_MESH_ADV_STACK_SIZE for the recommended minimum. + +config BT_MESH_WORKQ_SYS + bool "System workqueue" + help + When this option is selected, the mesh sends messages from + the system work queue. The application needs to ensure the system + workqueue stack size (SYSTEM_WORKQUEUE_STACK_SIZE) is large enough, + refer to BT_MESH_ADV_STACK_SIZE for the recommended minimum. + + When this option is enabled and the mesh tries to send a message, + and the host ran out the HCI command buffers controlled by + CONFIG_BT_BUF_CMD_TX_COUNT, the host returns -ENOBUFS immediately + and the mesh drops the message transmission. To mitigate this + issue, make sure to have sufficient number of HCI command buffers. + When this option is enabled, the latency of sending mesh messages + will be affected by other users on the system work queue, resulting in + reduced reliability for sending mesh messages. + +endchoice + +if BT_MESH_WORKQ_MESH + +config BT_MESH_ADV_STACK_SIZE + int "Mesh extended advertiser thread stack size" + default 1536 if BT_MESH_PROXY + default 1024 if BT_HOST_CRYPTO + default 776 if BT_MESH_PRIV_BEACONS + default 768 + help + Size of bt mesh adv thread stack. + + NOTE: This is an advanced setting and should not be changed unless + absolutely necessary + +config BT_MESH_ADV_PRIO + int "Mesh advertiser thread priority" + default 7 + help + Priority of bt mesh adv thread. + + NOTE: This is an advanced setting and should not be changed unless + absolutely necessary + +endif # BT_MESH_WORKQ_MESH + config BT_MESH_RELAY_ADV_SETS int "Maximum of simultaneous relay message support" default 0 diff --git a/subsys/bluetooth/mesh/adv.h b/subsys/bluetooth/mesh/adv.h index cbe4f6e9adb8bf..563a2118b711db 100644 --- a/subsys/bluetooth/mesh/adv.h +++ b/subsys/bluetooth/mesh/adv.h @@ -123,4 +123,6 @@ int bt_mesh_scan_active_set(bool active); int bt_mesh_adv_bt_data_send(uint8_t num_events, uint16_t adv_interval, const struct bt_data *ad, size_t ad_len); +int bt_mesh_wq_submit(struct k_work *work); + #endif /* ZEPHYR_SUBSYS_BLUETOOTH_MESH_ADV_H_ */ diff --git a/subsys/bluetooth/mesh/adv_ext.c b/subsys/bluetooth/mesh/adv_ext.c index b206b81b74342f..2f790f5bc162e3 100644 --- a/subsys/bluetooth/mesh/adv_ext.c +++ b/subsys/bluetooth/mesh/adv_ext.c @@ -33,6 +33,14 @@ LOG_MODULE_REGISTER(bt_mesh_adv_ext); #define CONFIG_BT_MESH_RELAY_ADV_SETS 0 #endif +#ifdef CONFIG_BT_MESH_ADV_STACK_SIZE +#define MESH_WORKQ_PRIORITY CONFIG_BT_MESH_ADV_PRIO +#define MESH_WORKQ_STACK_SIZE CONFIG_BT_MESH_ADV_STACK_SIZE +#else +#define MESH_WORKQ_PRIORITY 0 +#define MESH_WORKQ_STACK_SIZE 0 +#endif + enum { /** Controller is currently advertising */ ADV_FLAG_ACTIVE, @@ -69,6 +77,15 @@ struct bt_mesh_ext_adv { static void send_pending_adv(struct k_work *work); static bool schedule_send(struct bt_mesh_ext_adv *ext_adv); +static struct k_work_q bt_mesh_workq; +static K_KERNEL_STACK_DEFINE(thread_stack, MESH_WORKQ_STACK_SIZE); + +#if defined(CONFIG_BT_MESH_WORKQ_MESH) +#define MESH_WORKQ &bt_mesh_workq +#else /* CONFIG_BT_MESH_WORKQ_SYS */ +#define MESH_WORKQ &k_sys_work_q +#endif /* CONFIG_BT_MESH_WORKQ_MESH */ + static struct bt_mesh_ext_adv advs[] = { [0] = { .tags = ( @@ -258,7 +275,7 @@ static bool schedule_send_with_mask(struct bt_mesh_ext_adv *ext_adv, int ignore_ } atomic_clear_bit(ext_adv->flags, ADV_FLAG_SCHEDULE_PENDING); - k_work_submit(&ext_adv->work); + bt_mesh_wq_submit(&ext_adv->work); return true; } @@ -407,7 +424,7 @@ int bt_mesh_adv_terminate(struct bt_mesh_adv *adv) atomic_set_bit(ext_adv->flags, ADV_FLAG_SENT); - k_work_submit(&ext_adv->work); + bt_mesh_wq_submit(&ext_adv->work); return 0; } @@ -429,6 +446,13 @@ void bt_mesh_adv_init(void) for (int i = 0; i < ARRAY_SIZE(advs); i++) { (void)memcpy(&advs[i].adv_param, &adv_param, sizeof(adv_param)); } + + if (IS_ENABLED(CONFIG_BT_MESH_WORKQ_MESH)) { + k_work_queue_init(&bt_mesh_workq); + k_work_queue_start(&bt_mesh_workq, thread_stack, MESH_WORKQ_STACK_SIZE, + K_PRIO_COOP(MESH_WORKQ_PRIORITY), NULL); + k_thread_name_set(&bt_mesh_workq.thread, "BT MESH WQ"); + } } static struct bt_mesh_ext_adv *adv_instance_find(struct bt_le_ext_adv *instance) @@ -458,7 +482,7 @@ static void adv_sent(struct bt_le_ext_adv *instance, atomic_set_bit(ext_adv->flags, ADV_FLAG_SENT); - k_work_submit(&ext_adv->work); + bt_mesh_wq_submit(&ext_adv->work); } #if defined(CONFIG_BT_MESH_GATT_SERVER) @@ -503,13 +527,13 @@ int bt_mesh_adv_enable(void) int bt_mesh_adv_disable(void) { - int err; struct k_work_sync sync; + int err; for (int i = 0; i < ARRAY_SIZE(advs); i++) { atomic_set_bit(advs[i].flags, ADV_FLAG_SUSPENDING); - if (k_current_get() != &k_sys_work_q.thread || + if (k_current_get() != k_work_queue_thread_get(MESH_WORKQ) || (k_work_busy_get(&advs[i].work) & K_WORK_RUNNING) == 0) { k_work_flush(&advs[i].work, &sync); } @@ -562,3 +586,8 @@ int bt_mesh_adv_bt_data_send(uint8_t num_events, uint16_t adv_interval, { return bt_data_send(advs, num_events, adv_interval, ad, ad_len); } + +int bt_mesh_wq_submit(struct k_work *work) +{ + return k_work_submit_to_queue(MESH_WORKQ, work); +} diff --git a/subsys/bluetooth/mesh/adv_legacy.c b/subsys/bluetooth/mesh/adv_legacy.c index 207ff718566e43..3048adc4170fb4 100644 --- a/subsys/bluetooth/mesh/adv_legacy.c +++ b/subsys/bluetooth/mesh/adv_legacy.c @@ -277,3 +277,8 @@ int bt_mesh_adv_gatt_start(const struct bt_le_adv_param *param, int32_t duration adv_timeout = duration; return bt_le_adv_start(param, ad, ad_len, sd, sd_len); } + +int bt_mesh_wq_submit(struct k_work *work) +{ + return k_work_submit(work); +} diff --git a/subsys/bluetooth/mesh/proxy_msg.c b/subsys/bluetooth/mesh/proxy_msg.c index e2818f8634bf61..861935f58ccf7c 100644 --- a/subsys/bluetooth/mesh/proxy_msg.c +++ b/subsys/bluetooth/mesh/proxy_msg.c @@ -64,6 +64,15 @@ static void proxy_sar_timeout(struct k_work *work) LOG_WRN("Proxy SAR timeout"); role = CONTAINER_OF(dwork, struct bt_mesh_proxy_role, sar_timer); + + while (!k_fifo_is_empty(&role->pending)) { + struct bt_mesh_adv *adv = k_fifo_get(&role->pending, K_NO_WAIT); + + __ASSERT_NO_MSG(adv); + + bt_mesh_adv_unref(adv); + } + if (role->conn) { bt_conn_disconnect(role->conn, BT_HCI_ERR_REMOTE_USER_TERM_CONN); @@ -200,7 +209,7 @@ static void buf_send_end(struct bt_conn *conn, void *user_data) bt_mesh_adv_unref(adv); } -int bt_mesh_proxy_relay_send(struct bt_conn *conn, struct bt_mesh_adv *adv) +static int proxy_relay_send(struct bt_conn *conn, struct bt_mesh_adv *adv) { int err; @@ -230,6 +239,41 @@ int bt_mesh_proxy_relay_send(struct bt_conn *conn, struct bt_mesh_adv *adv) return err; } +int bt_mesh_proxy_relay_send(struct bt_conn *conn, struct bt_mesh_adv *adv) +{ + struct bt_mesh_proxy_role *role = &roles[bt_conn_index(conn)]; + + k_fifo_put(&role->pending, bt_mesh_adv_ref(adv)); + + bt_mesh_wq_submit(&role->work); + + return 0; +} + +static void proxy_msg_send_pending(struct k_work *work) +{ + struct bt_mesh_proxy_role *role; + struct k_work_delayable *dwork = k_work_delayable_from_work(work); + struct bt_mesh_adv *adv; + + role = CONTAINER_OF(dwork, struct bt_mesh_proxy_role, sar_timer); + if (!role->conn) { + return; + } + + adv = k_fifo_get(&role->pending, K_NO_WAIT); + if (!adv) { + return; + } + + (void)proxy_relay_send(role->conn, adv); + bt_mesh_adv_unref(adv); + + if (!k_fifo_is_empty(&role->pending)) { + bt_mesh_wq_submit(&role->work); + } +} + static void proxy_msg_init(struct bt_mesh_proxy_role *role) { /* Check if buf has been allocated, in this way, we no longer need @@ -247,6 +291,9 @@ static void proxy_msg_init(struct bt_mesh_proxy_role *role) net_buf_simple_reset(&role->buf); + k_fifo_init(&role->pending); + k_work_init(&role->work, proxy_msg_send_pending); + k_work_init_delayable(&role->sar_timer, proxy_sar_timeout); } diff --git a/subsys/bluetooth/mesh/proxy_msg.h b/subsys/bluetooth/mesh/proxy_msg.h index 7ad4be7ae5d37b..99564b716933d0 100644 --- a/subsys/bluetooth/mesh/proxy_msg.h +++ b/subsys/bluetooth/mesh/proxy_msg.h @@ -37,6 +37,9 @@ struct bt_mesh_proxy_role { struct bt_conn *conn; uint8_t msg_type; + struct k_fifo pending; + struct k_work work; + struct { proxy_send_cb_t send; proxy_recv_cb_t recv; diff --git a/subsys/bluetooth/mesh/proxy_srv.c b/subsys/bluetooth/mesh/proxy_srv.c index 8855f021734e3a..476006b4eee398 100644 --- a/subsys/bluetooth/mesh/proxy_srv.c +++ b/subsys/bluetooth/mesh/proxy_srv.c @@ -916,7 +916,7 @@ static ssize_t proxy_ccc_write(struct bt_conn *conn, client = find_client(conn); if (client->filter_type == NONE) { client->filter_type = ACCEPT; - k_work_submit(&client->send_beacons); + bt_mesh_wq_submit(&client->send_beacons); } return sizeof(value); diff --git a/tests/bsim/bluetooth/mesh/compile.sh b/tests/bsim/bluetooth/mesh/compile.sh index aa86e6ccb25ccd..05c51f7bfe1e0c 100755 --- a/tests/bsim/bluetooth/mesh/compile.sh +++ b/tests/bsim/bluetooth/mesh/compile.sh @@ -15,12 +15,15 @@ app=tests/bsim/bluetooth/mesh conf_overlay=overlay_pst.conf compile app=tests/bsim/bluetooth/mesh conf_overlay=overlay_gatt.conf compile app=tests/bsim/bluetooth/mesh conf_overlay=overlay_low_lat.conf compile app=tests/bsim/bluetooth/mesh conf_overlay=overlay_psa.conf compile +app=tests/bsim/bluetooth/mesh conf_overlay=overlay_workq_sys.conf compile app=tests/bsim/bluetooth/mesh conf_overlay="overlay_pst.conf;overlay_psa.conf" compile app=tests/bsim/bluetooth/mesh conf_overlay="overlay_gatt.conf;overlay_psa.conf" compile +app=tests/bsim/bluetooth/mesh conf_overlay="overlay_gatt.conf;overlay_workq_sys.conf" compile app=tests/bsim/bluetooth/mesh conf_overlay="overlay_low_lat.conf;overlay_psa.conf" compile app=tests/bsim/bluetooth/mesh conf_overlay="overlay_gatt.conf;overlay_low_lat.conf" compile app=tests/bsim/bluetooth/mesh conf_overlay="overlay_pst.conf;overlay_gatt.conf" compile app=tests/bsim/bluetooth/mesh \ conf_overlay="overlay_pst.conf;overlay_gatt.conf;overlay_psa.conf" compile - +app=tests/bsim/bluetooth/mesh \ + conf_overlay="overlay_pst.conf;overlay_gatt.conf;overlay_workq_sys.conf" compile wait_for_background_jobs diff --git a/tests/bsim/bluetooth/mesh/overlay_workq_sys.conf b/tests/bsim/bluetooth/mesh/overlay_workq_sys.conf new file mode 100644 index 00000000000000..b4ee51bf8d54ed --- /dev/null +++ b/tests/bsim/bluetooth/mesh/overlay_workq_sys.conf @@ -0,0 +1 @@ +CONFIG_BT_MESH_WORKQ_SYS=y diff --git a/tests/bsim/bluetooth/mesh/src/test_suspend.c b/tests/bsim/bluetooth/mesh/src/test_suspend.c index 58154f37446402..34a2ac408957ae 100644 --- a/tests/bsim/bluetooth/mesh/src/test_suspend.c +++ b/tests/bsim/bluetooth/mesh/src/test_suspend.c @@ -295,6 +295,9 @@ static void dut_pub_common(bool disable_bt) ASSERT_OK_MSG(k_sem_take(&publish_sem, K_SECONDS(30)), "Pub timed out"); } + /* Allow publishing to finish before suspending. */ + k_sleep(K_MSEC(100)); + ASSERT_OK_MSG(bt_mesh_suspend(), "Failed to suspend Mesh."); if (disable_bt) { diff --git a/tests/bsim/bluetooth/mesh/tests_scripts/advertiser/disable.sh b/tests/bsim/bluetooth/mesh/tests_scripts/advertiser/disable.sh index 50d2a53a16dc44..d0288a3964b930 100755 --- a/tests/bsim/bluetooth/mesh/tests_scripts/advertiser/disable.sh +++ b/tests/bsim/bluetooth/mesh/tests_scripts/advertiser/disable.sh @@ -36,3 +36,6 @@ RunTest mesh_adv_disable adv_tx_disable adv_rx_disable # Low latency overlay uses legacy advertiser overlay=overlay_low_lat_conf RunTest mesh_adv_disable adv_tx_disable adv_rx_disable + +overlay=overlay_workq_sys_conf +RunTest mesh_adv_disable_workq adv_tx_disable adv_rx_disable diff --git a/tests/bsim/bluetooth/mesh/tests_scripts/advertiser/proxy_mixin.sh b/tests/bsim/bluetooth/mesh/tests_scripts/advertiser/proxy_mixin.sh index 6c49d03fe9f882..fb6af48f651807 100755 --- a/tests/bsim/bluetooth/mesh/tests_scripts/advertiser/proxy_mixin.sh +++ b/tests/bsim/bluetooth/mesh/tests_scripts/advertiser/proxy_mixin.sh @@ -21,5 +21,8 @@ source $(dirname "${BASH_SOURCE[0]}")/../../_mesh_test.sh overlay=overlay_gatt_conf RunTest mesh_adv_proxy_mixin adv_tx_proxy_mixin adv_rx_proxy_mixin +overlay=overlay_gatt_conf_overlay_workq_sys_conf +RunTest mesh_adv_proxy_mixin_workq adv_tx_proxy_mixin adv_rx_proxy_mixin + overlay="overlay_gatt_conf_overlay_psa_conf" RunTest mesh_adv_proxy_mixin_psa adv_tx_proxy_mixin adv_rx_proxy_mixin diff --git a/tests/bsim/bluetooth/mesh/tests_scripts/advertiser/random_order.sh b/tests/bsim/bluetooth/mesh/tests_scripts/advertiser/random_order.sh index a171ffd60f35b8..5808d2cd5086dc 100755 --- a/tests/bsim/bluetooth/mesh/tests_scripts/advertiser/random_order.sh +++ b/tests/bsim/bluetooth/mesh/tests_scripts/advertiser/random_order.sh @@ -7,5 +7,8 @@ source $(dirname "${BASH_SOURCE[0]}")/../../_mesh_test.sh # test buffer management by filling buffers and sending them in random order. RunTest mesh_adv_random_order adv_tx_random_order adv_rx_random_order +overlay=overlay_workq_sys_conf +RunTest mesh_adv_random_order_workq adv_tx_random_order adv_rx_random_order + overlay=overlay_psa_conf RunTest mesh_adv_random_order_psa adv_tx_random_order adv_rx_random_order diff --git a/tests/bsim/bluetooth/mesh/tests_scripts/advertiser/reverse_order.sh b/tests/bsim/bluetooth/mesh/tests_scripts/advertiser/reverse_order.sh index 2b047138109bad..1428833a35b0d5 100755 --- a/tests/bsim/bluetooth/mesh/tests_scripts/advertiser/reverse_order.sh +++ b/tests/bsim/bluetooth/mesh/tests_scripts/advertiser/reverse_order.sh @@ -7,5 +7,8 @@ source $(dirname "${BASH_SOURCE[0]}")/../../_mesh_test.sh # test buffer management by filling all the buffer and sending them in reversed order. RunTest mesh_adv_reverse_order adv_tx_reverse_order adv_rx_receive_order +overlay=overlay_workq_sys_conf +RunTest mesh_adv_reverse_order_workq adv_tx_reverse_order adv_rx_receive_order + overlay=overlay_psa_conf RunTest mesh_adv_reverse_order_psa adv_tx_reverse_order adv_rx_receive_order diff --git a/tests/bsim/bluetooth/mesh/tests_scripts/advertiser/send_order.sh b/tests/bsim/bluetooth/mesh/tests_scripts/advertiser/send_order.sh index a9e8d1ea861742..5122d7fdf0532a 100755 --- a/tests/bsim/bluetooth/mesh/tests_scripts/advertiser/send_order.sh +++ b/tests/bsim/bluetooth/mesh/tests_scripts/advertiser/send_order.sh @@ -7,5 +7,8 @@ source $(dirname "${BASH_SOURCE[0]}")/../../_mesh_test.sh # test buffer management by filling all the buffer and sending them all in order. RunTest mesh_adv_send_order adv_tx_send_order adv_rx_receive_order +overlay=overlay_workq_sys_conf +RunTest mesh_adv_send_order_workq adv_tx_send_order adv_rx_receive_order + overlay=overlay_psa_conf RunTest mesh_adv_send_order_psa adv_tx_send_order adv_rx_receive_order diff --git a/tests/bsim/bluetooth/mesh/tests_scripts/advertiser/tx_cb_multi.sh b/tests/bsim/bluetooth/mesh/tests_scripts/advertiser/tx_cb_multi.sh index 4ca2838ddf933d..a7e3ec954371ab 100755 --- a/tests/bsim/bluetooth/mesh/tests_scripts/advertiser/tx_cb_multi.sh +++ b/tests/bsim/bluetooth/mesh/tests_scripts/advertiser/tx_cb_multi.sh @@ -7,5 +7,8 @@ source $(dirname "${BASH_SOURCE[0]}")/../../_mesh_test.sh # test tx callbacks sequence for multiple advs RunTest mesh_adv_tx_cb_multi adv_tx_cb_multi +overlay=overlay_workq_sys_conf +RunTest mesh_adv_tx_cb_multi_workq adv_tx_cb_multi + overlay=overlay_psa_conf RunTest mesh_adv_tx_cb_multi_psa adv_tx_cb_multi diff --git a/tests/bsim/bluetooth/mesh/tests_scripts/advertiser/tx_cb_single.sh b/tests/bsim/bluetooth/mesh/tests_scripts/advertiser/tx_cb_single.sh index a2b1ad0e9612d0..48d81a6013640f 100755 --- a/tests/bsim/bluetooth/mesh/tests_scripts/advertiser/tx_cb_single.sh +++ b/tests/bsim/bluetooth/mesh/tests_scripts/advertiser/tx_cb_single.sh @@ -7,5 +7,8 @@ source $(dirname "${BASH_SOURCE[0]}")/../../_mesh_test.sh # test tx callbacks parameters and xmit sequence for single adv RunTest mesh_adv_tx_cb_single adv_tx_cb_single adv_rx_xmit +overlay=overlay_workq_sys_conf +RunTest mesh_adv_tx_cb_single_workq adv_tx_cb_single adv_rx_xmit + overlay=overlay_psa_conf RunTest mesh_adv_tx_cb_single_psa adv_tx_cb_single adv_rx_xmit diff --git a/tests/bsim/bluetooth/mesh/tests_scripts/proxy_sol/sol_replay.sh b/tests/bsim/bluetooth/mesh/tests_scripts/proxy_sol/sol_replay.sh index c3da4435eb104e..02f7c933254161 100755 --- a/tests/bsim/bluetooth/mesh/tests_scripts/proxy_sol/sol_replay.sh +++ b/tests/bsim/bluetooth/mesh/tests_scripts/proxy_sol/sol_replay.sh @@ -32,6 +32,18 @@ RunTest mesh_srpl_replay_attack \ proxy_sol_iut_power_replay_attack \ -flash=../results/mesh_srpl_replay_attack/flash.bin -flash_rm +overlay="overlay_pst_conf_overlay_gatt_conf_overlay_workq_sys_conf" +RunTest mesh_srpl_replay_attack_workq \ + proxy_sol_tester_immediate_replay_attack \ + proxy_sol_iut_immediate_replay_attack \ + -flash=../results/mesh_srpl_replay_attack/flash.bin -flash_erase + +overlay="overlay_pst_conf_overlay_gatt_conf_overlay_workq_sys_conf" +RunTest mesh_srpl_replay_attack_workq \ + proxy_sol_tester_power_replay_attack \ + proxy_sol_iut_power_replay_attack \ + -flash=../results/mesh_srpl_replay_attack/flash.bin -flash_rm + overlay="overlay_pst_conf_overlay_gatt_conf_overlay_psa_conf" RunTest mesh_srpl_replay_attack_psa \ proxy_sol_tester_immediate_replay_attack \ From 87bb0b921252ab640aa43c41fdeabd121eccdd6a Mon Sep 17 00:00:00 2001 From: Tomi Fontanilles Date: Thu, 31 Oct 2024 10:43:43 +0200 Subject: [PATCH 033/113] manifest: tf-m: update to 2.1.1 Update the TF-M repos to version 2.1.1. Signed-off-by: Tomi Fontanilles --- doc/releases/release-notes-4.0.rst | 7 +++++-- submanifests/optional.yaml | 2 +- west.yml | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/doc/releases/release-notes-4.0.rst b/doc/releases/release-notes-4.0.rst index 04f4a043ef9fe0..77a092000bede3 100644 --- a/doc/releases/release-notes-4.0.rst +++ b/doc/releases/release-notes-4.0.rst @@ -689,8 +689,11 @@ MCUboot OSDP **** -Trusted Firmware-M -****************** +Trusted Firmware-M (TF-M) +************************* + +* TF-M was updated to version 2.1.1 (from 2.1.0). + The release notes can be found at: https://trustedfirmware-m.readthedocs.io/en/tf-mv2.1.1/releases/2.1.1.html LVGL **** diff --git a/submanifests/optional.yaml b/submanifests/optional.yaml index c0c0d45e4ca2df..59e837c877fb87 100644 --- a/submanifests/optional.yaml +++ b/submanifests/optional.yaml @@ -46,7 +46,7 @@ manifest: groups: - optional - name: tf-m-tests - revision: d552e4f18b92032bd335d5e3aa312f6acd82a83b + revision: 502ea90105ee18f20c78f710e2ba2ded0fc0756e path: modules/tee/tf-m/tf-m-tests remote: upstream groups: diff --git a/west.yml b/west.yml index 36be63ac83469d..4da2eab84bb9ef 100644 --- a/west.yml +++ b/west.yml @@ -327,7 +327,7 @@ manifest: groups: - crypto - name: trusted-firmware-m - revision: a11cd27905aecc4416cfc85552bfc3b997375056 + revision: 8134106ef9cb3df60e8bd22b172532558e936bd2 path: modules/tee/tf-m/trusted-firmware-m groups: - tee From a1dc0b8b3e97542ca9f0c84cba37067710b61ccb Mon Sep 17 00:00:00 2001 From: Daniel DeGrasse Date: Thu, 31 Oct 2024 20:24:57 +0000 Subject: [PATCH 034/113] drivers: disk: sdmmc_subsys: remove CONFIG_SDMMC_VOLUME_NAME Remove CONFIG_SDMMC_VOLUME_NAME, and set the disk name based on the ``disk-name`` property. This aligns with other disk drivers, and allows for multiple instances of the sdmmc_subsys disk driver to be registered. Add disk-name properties for all in tree definitions for the sdmmc-subsys disk driver, and change all in tree usage of the disk name Fixes #75004 Signed-off-by: Daniel DeGrasse --- .../adafruit_grand_central_m4_express.dts | 1 + boards/arduino/mkrzero/arduino_mkrzero.dts | 1 + boards/atmel/sam/sam4e_xpro/sam4e_xpro.dts | 1 + .../esp_wrover_kit/esp_wrover_kit_procpu.dts | 1 + .../bl5340_dvk_nrf5340_cpuapp_common.dtsi | 1 + boards/ezurio/mg100/mg100.dts | 1 + .../hardkernel/odroid_go/odroid_go_procpu.dts | 1 + .../intel_socfpga_agilex5_socdk.dts | 1 + .../m5stack_core2/m5stack_core2_procpu.dts | 1 + boards/madmachine/mm_swiftio/mm_swiftio.dts | 1 + ...nrf5340_audio_dk_nrf5340_cpuapp_common.dtsi | 1 + boards/nxp/frdm_k64f/frdm_k64f.dts | 1 + .../frdm_mcxn947_mcxn947_cpu0.dtsi | 1 + .../lpcxpresso55s69_lpc55s69_cpu0.dts | 1 + boards/nxp/mimxrt1020_evk/mimxrt1020_evk.dts | 1 + boards/nxp/mimxrt1024_evk/mimxrt1024_evk.dts | 1 + boards/nxp/mimxrt1050_evk/mimxrt1050_evk.dts | 1 + boards/nxp/mimxrt1060_evk/mimxrt1060_evk.dts | 1 + .../mimxrt1062_fmurt6/mimxrt1062_fmurt6.dts | 1 + boards/nxp/mimxrt1064_evk/mimxrt1064_evk.dts | 1 + .../mimxrt1170_evk_mimxrt1176_cm7.dts | 1 + .../mimxrt685_evk_mimxrt685s_cm33.dts | 1 + .../vmu_rt1170/vmu_rt1170_mimxrt1176_cm7.dts | 1 + .../olimex/olimexino_stm32/olimexino_stm32.dts | 1 + boards/pjrc/teensy4/teensy41.dts | 1 + .../rcar_h3ulcb/rcar_h3ulcb_r8a77951_a57.dts | 1 + boards/seeed/wio_terminal/wio_terminal.dts | 1 + .../xiao_esp32s3/xiao_esp32s3_procpu_sense.dts | 1 + .../dts/adafruit_2_8_tft_touch_v2.dtsi | 1 + .../adafruit_data_logger.overlay | 1 + .../seeed_xiao_expansion_board.overlay | 1 + .../seeed_xiao_round_display.overlay | 1 + .../sparkfun_carrier_asset_tracker.overlay | 1 + boards/shields/v2c_daplink/v2c_daplink.overlay | 1 + .../v2c_daplink/v2c_daplink_cfg.overlay | 1 + .../dts/waveshare_epaper_common.dtsi | 1 + .../sipeed/longan_nano/longan_nano-common.dtsi | 1 + doc/connectivity/usb/device/usb_device.rst | 10 +++++----- doc/services/storage/disk/access.rst | 1 + drivers/disk/Kconfig.sdmmc | 7 ------- drivers/disk/sdmmc_stm32.c | 2 +- drivers/disk/sdmmc_subsys.c | 18 +++++++++--------- dts/bindings/sd/zephyr,sdmmc-disk.yaml | 9 ++++++++- .../fs_sample/boards/hifive_unmatched.overlay | 1 + .../fs/fs_sample/boards/nrf52840_blip.overlay | 1 + .../fs/fs_sample/boards/nucleo_f429zi.overlay | 1 + samples/subsys/fs/fs_sample/src/main.c | 2 +- samples/subsys/fs/littlefs/README.rst | 6 +++--- samples/subsys/fs/littlefs/src/main.c | 2 +- subsys/fs/shell.c | 2 +- tests/drivers/build_all/disk/spi.dtsi | 1 + tests/drivers/disk/disk_access/src/main.c | 2 +- tests/drivers/disk/disk_performance/src/main.c | 2 +- .../stm32h747i_disco_stm32h747xx_m7.overlay | 6 ------ tests/lib/gui/lvgl/src/main.c | 2 +- .../fs/ext2/boards/hifive_unmatched.overlay | 1 + tests/subsys/fs/ext2/src/main.c | 2 +- tests/subsys/fs/fat_fs_api/src/test_fat.h | 2 +- 58 files changed, 77 insertions(+), 40 deletions(-) diff --git a/boards/adafruit/grand_central_m4_express/adafruit_grand_central_m4_express.dts b/boards/adafruit/grand_central_m4_express/adafruit_grand_central_m4_express.dts index 5cc038332b1fff..24ffdf89acfeff 100644 --- a/boards/adafruit/grand_central_m4_express/adafruit_grand_central_m4_express.dts +++ b/boards/adafruit/grand_central_m4_express/adafruit_grand_central_m4_express.dts @@ -72,6 +72,7 @@ mmc { status = "okay"; compatible = "zephyr,sdmmc-disk"; + disk-name = "SD"; }; }; }; diff --git a/boards/arduino/mkrzero/arduino_mkrzero.dts b/boards/arduino/mkrzero/arduino_mkrzero.dts index b682e84aec894a..a0f26d57fa0a6b 100644 --- a/boards/arduino/mkrzero/arduino_mkrzero.dts +++ b/boards/arduino/mkrzero/arduino_mkrzero.dts @@ -89,6 +89,7 @@ spi-max-frequency = <1000000>; mmc { compatible = "zephyr,sdmmc-disk"; + disk-name = "SD"; status = "okay"; }; }; diff --git a/boards/atmel/sam/sam4e_xpro/sam4e_xpro.dts b/boards/atmel/sam/sam4e_xpro/sam4e_xpro.dts index ddd73d0faeffb1..253d5ba48d1d90 100644 --- a/boards/atmel/sam/sam4e_xpro/sam4e_xpro.dts +++ b/boards/atmel/sam/sam4e_xpro/sam4e_xpro.dts @@ -219,6 +219,7 @@ pinctrl-names = "default"; mmc { compatible = "zephyr,sdmmc-disk"; + disk-name = "SD"; status = "okay"; }; }; diff --git a/boards/espressif/esp_wrover_kit/esp_wrover_kit_procpu.dts b/boards/espressif/esp_wrover_kit/esp_wrover_kit_procpu.dts index 757d15d006fead..3d37df9d5a7d94 100644 --- a/boards/espressif/esp_wrover_kit/esp_wrover_kit_procpu.dts +++ b/boards/espressif/esp_wrover_kit/esp_wrover_kit_procpu.dts @@ -209,6 +209,7 @@ mmc { compatible = "zephyr,sdmmc-disk"; + disk-name = "SD"; status = "okay"; }; }; diff --git a/boards/ezurio/bl5340_dvk/bl5340_dvk_nrf5340_cpuapp_common.dtsi b/boards/ezurio/bl5340_dvk/bl5340_dvk_nrf5340_cpuapp_common.dtsi index bd39a87266b662..c6986c7c878088 100644 --- a/boards/ezurio/bl5340_dvk/bl5340_dvk_nrf5340_cpuapp_common.dtsi +++ b/boards/ezurio/bl5340_dvk/bl5340_dvk_nrf5340_cpuapp_common.dtsi @@ -252,6 +252,7 @@ spi-max-frequency = <8000000>; mmc { compatible = "zephyr,sdmmc-disk"; + disk-name = "SD"; status = "okay"; }; }; diff --git a/boards/ezurio/mg100/mg100.dts b/boards/ezurio/mg100/mg100.dts index de091a3ab662cd..18826ed8956a69 100644 --- a/boards/ezurio/mg100/mg100.dts +++ b/boards/ezurio/mg100/mg100.dts @@ -154,6 +154,7 @@ spi-max-frequency = <8000000>; mmc { compatible = "zephyr,sdmmc-disk"; + disk-name = "SD"; status = "okay"; }; }; diff --git a/boards/hardkernel/odroid_go/odroid_go_procpu.dts b/boards/hardkernel/odroid_go/odroid_go_procpu.dts index 108e503cec47c7..4553b7e338bd0e 100644 --- a/boards/hardkernel/odroid_go/odroid_go_procpu.dts +++ b/boards/hardkernel/odroid_go/odroid_go_procpu.dts @@ -144,6 +144,7 @@ status = "okay"; mmc { compatible = "zephyr,sdmmc-disk"; + disk-name = "SD"; status = "okay"; }; spi-max-frequency = <20000000>; diff --git a/boards/intel/socfpga/agilex5_socdk/intel_socfpga_agilex5_socdk.dts b/boards/intel/socfpga/agilex5_socdk/intel_socfpga_agilex5_socdk.dts index d2f6c4370a379a..6b185154fa6979 100644 --- a/boards/intel/socfpga/agilex5_socdk/intel_socfpga_agilex5_socdk.dts +++ b/boards/intel/socfpga/agilex5_socdk/intel_socfpga_agilex5_socdk.dts @@ -26,6 +26,7 @@ mmc { /*SD Disk Access */ compatible = "zephyr,sdmmc-disk"; + disk-name = "SD"; status = "okay"; }; }; diff --git a/boards/m5stack/m5stack_core2/m5stack_core2_procpu.dts b/boards/m5stack/m5stack_core2/m5stack_core2_procpu.dts index e9bf8d0da33fed..5ab9ad9eacd6a6 100644 --- a/boards/m5stack/m5stack_core2/m5stack_core2_procpu.dts +++ b/boards/m5stack/m5stack_core2/m5stack_core2_procpu.dts @@ -217,6 +217,7 @@ spi-max-frequency = <20000000>; mmc { compatible = "zephyr,sdmmc-disk"; + disk-name = "SD"; status = "okay"; }; diff --git a/boards/madmachine/mm_swiftio/mm_swiftio.dts b/boards/madmachine/mm_swiftio/mm_swiftio.dts index 14af45b01b8004..cbdf85c3c12e67 100644 --- a/boards/madmachine/mm_swiftio/mm_swiftio.dts +++ b/boards/madmachine/mm_swiftio/mm_swiftio.dts @@ -186,6 +186,7 @@ pinctrl-names = "default", "slow", "med", "fast"; mmc { compatible = "zephyr,sdmmc-disk"; + disk-name = "SD"; status = "okay"; }; }; diff --git a/boards/nordic/nrf5340_audio_dk/nrf5340_audio_dk_nrf5340_cpuapp_common.dtsi b/boards/nordic/nrf5340_audio_dk/nrf5340_audio_dk_nrf5340_cpuapp_common.dtsi index 71c05529cc17a3..f29db4cfeb2c3c 100644 --- a/boards/nordic/nrf5340_audio_dk/nrf5340_audio_dk_nrf5340_cpuapp_common.dtsi +++ b/boards/nordic/nrf5340_audio_dk/nrf5340_audio_dk_nrf5340_cpuapp_common.dtsi @@ -214,6 +214,7 @@ arduino_spi: &spi4 { status = "okay"; sdmmc { compatible = "zephyr,sdmmc-disk"; + disk-name = "SD"; status = "okay"; }; diff --git a/boards/nxp/frdm_k64f/frdm_k64f.dts b/boards/nxp/frdm_k64f/frdm_k64f.dts index 8e91aa8cfb99d7..9cb864ccf38975 100644 --- a/boards/nxp/frdm_k64f/frdm_k64f.dts +++ b/boards/nxp/frdm_k64f/frdm_k64f.dts @@ -163,6 +163,7 @@ arduino_spi: &spi0 { status = "okay"; sdmmc { compatible = "zephyr,sdmmc-disk"; + disk-name = "SD"; status = "okay"; }; spi-max-frequency = <24000000>; diff --git a/boards/nxp/frdm_mcxn947/frdm_mcxn947_mcxn947_cpu0.dtsi b/boards/nxp/frdm_mcxn947/frdm_mcxn947_mcxn947_cpu0.dtsi index cad61c08cbf7c6..d2483b4ec0840b 100644 --- a/boards/nxp/frdm_mcxn947/frdm_mcxn947_mcxn947_cpu0.dtsi +++ b/boards/nxp/frdm_mcxn947/frdm_mcxn947_mcxn947_cpu0.dtsi @@ -166,6 +166,7 @@ status = "okay"; sdmmc { compatible = "zephyr,sdmmc-disk"; + disk-name = "SD"; status = "okay"; }; }; diff --git a/boards/nxp/lpcxpresso55s69/lpcxpresso55s69_lpc55s69_cpu0.dts b/boards/nxp/lpcxpresso55s69/lpcxpresso55s69_lpc55s69_cpu0.dts index 82f0e9e330d3be..e87cb04fc79961 100644 --- a/boards/nxp/lpcxpresso55s69/lpcxpresso55s69_lpc55s69_cpu0.dts +++ b/boards/nxp/lpcxpresso55s69/lpcxpresso55s69_lpc55s69_cpu0.dts @@ -121,6 +121,7 @@ pinctrl-names = "default"; mmc { compatible = "zephyr,sdmmc-disk"; + disk-name = "SD"; status = "okay"; }; }; diff --git a/boards/nxp/mimxrt1020_evk/mimxrt1020_evk.dts b/boards/nxp/mimxrt1020_evk/mimxrt1020_evk.dts index 955f363c8a44d1..6c3d096ff8ecba 100644 --- a/boards/nxp/mimxrt1020_evk/mimxrt1020_evk.dts +++ b/boards/nxp/mimxrt1020_evk/mimxrt1020_evk.dts @@ -206,6 +206,7 @@ zephyr_udc0: &usb1 { pwr-gpios = <&gpio3 24 GPIO_ACTIVE_HIGH>; sdmmc { compatible = "zephyr,sdmmc-disk"; + disk-name = "SD"; status = "okay"; }; }; diff --git a/boards/nxp/mimxrt1024_evk/mimxrt1024_evk.dts b/boards/nxp/mimxrt1024_evk/mimxrt1024_evk.dts index 3cb80ddfd78cd6..bc20298898a716 100644 --- a/boards/nxp/mimxrt1024_evk/mimxrt1024_evk.dts +++ b/boards/nxp/mimxrt1024_evk/mimxrt1024_evk.dts @@ -241,6 +241,7 @@ zephyr_udc0: &usb1 { no-1-8-v; sdmmc { compatible = "zephyr,sdmmc-disk"; + disk-name = "SD"; status = "okay"; }; }; diff --git a/boards/nxp/mimxrt1050_evk/mimxrt1050_evk.dts b/boards/nxp/mimxrt1050_evk/mimxrt1050_evk.dts index 846782af5d975d..3879b04cb506af 100644 --- a/boards/nxp/mimxrt1050_evk/mimxrt1050_evk.dts +++ b/boards/nxp/mimxrt1050_evk/mimxrt1050_evk.dts @@ -221,6 +221,7 @@ zephyr_udc0: &usb1 { pinctrl-names = "default", "slow", "med", "fast"; sdmmc { compatible = "zephyr,sdmmc-disk"; + disk-name = "SD"; status = "okay"; }; }; diff --git a/boards/nxp/mimxrt1060_evk/mimxrt1060_evk.dts b/boards/nxp/mimxrt1060_evk/mimxrt1060_evk.dts index c6879a24170336..84dbaac3ae4a93 100644 --- a/boards/nxp/mimxrt1060_evk/mimxrt1060_evk.dts +++ b/boards/nxp/mimxrt1060_evk/mimxrt1060_evk.dts @@ -229,6 +229,7 @@ zephyr_udc0: &usb1 { pinctrl-names = "default", "slow", "med", "fast"; sdmmc { compatible = "zephyr,sdmmc-disk"; + disk-name = "SD"; status = "okay"; }; }; diff --git a/boards/nxp/mimxrt1062_fmurt6/mimxrt1062_fmurt6.dts b/boards/nxp/mimxrt1062_fmurt6/mimxrt1062_fmurt6.dts index 780e792eca69b3..9d124b7b2c306c 100644 --- a/boards/nxp/mimxrt1062_fmurt6/mimxrt1062_fmurt6.dts +++ b/boards/nxp/mimxrt1062_fmurt6/mimxrt1062_fmurt6.dts @@ -420,6 +420,7 @@ zephyr_udc0: &usb1 { pinctrl-names = "default", "slow", "med", "fast"; sdmmc { compatible = "zephyr,sdmmc-disk"; + disk-name = "SD"; status = "okay"; }; }; diff --git a/boards/nxp/mimxrt1064_evk/mimxrt1064_evk.dts b/boards/nxp/mimxrt1064_evk/mimxrt1064_evk.dts index 1a3d76ce753419..8d9f2437d6a801 100644 --- a/boards/nxp/mimxrt1064_evk/mimxrt1064_evk.dts +++ b/boards/nxp/mimxrt1064_evk/mimxrt1064_evk.dts @@ -276,6 +276,7 @@ zephyr_udc0: &usb1 { pinctrl-names = "default", "slow", "med", "fast"; sdmmc { compatible = "zephyr,sdmmc-disk"; + disk-name = "SD"; status = "okay"; }; }; diff --git a/boards/nxp/mimxrt1170_evk/mimxrt1170_evk_mimxrt1176_cm7.dts b/boards/nxp/mimxrt1170_evk/mimxrt1170_evk_mimxrt1176_cm7.dts index f01c8f7f431170..7e2a6c182fb7cb 100644 --- a/boards/nxp/mimxrt1170_evk/mimxrt1170_evk_mimxrt1176_cm7.dts +++ b/boards/nxp/mimxrt1170_evk/mimxrt1170_evk_mimxrt1176_cm7.dts @@ -118,6 +118,7 @@ nxp_mipi_i2c: &lpi2c5 { pwr-gpios = <&gpio10 2 GPIO_ACTIVE_LOW>; sdmmc { compatible = "zephyr,sdmmc-disk"; + disk-name = "SD"; status = "okay"; }; }; diff --git a/boards/nxp/mimxrt685_evk/mimxrt685_evk_mimxrt685s_cm33.dts b/boards/nxp/mimxrt685_evk/mimxrt685_evk_mimxrt685s_cm33.dts index d211e26d3375a5..bc091a2abf424f 100644 --- a/boards/nxp/mimxrt685_evk/mimxrt685_evk_mimxrt685s_cm33.dts +++ b/boards/nxp/mimxrt685_evk/mimxrt685_evk_mimxrt685s_cm33.dts @@ -344,6 +344,7 @@ i2s1: &flexcomm3 { cd-gpios = <&gpio2 9 GPIO_ACTIVE_LOW>; sdmmc { compatible = "zephyr,sdmmc-disk"; + disk-name = "SD"; status = "okay"; }; pinctrl-0 = <&pinmux_usdhc>; diff --git a/boards/nxp/vmu_rt1170/vmu_rt1170_mimxrt1176_cm7.dts b/boards/nxp/vmu_rt1170/vmu_rt1170_mimxrt1176_cm7.dts index 53d7818b0b75a7..205b2149c8b6e2 100644 --- a/boards/nxp/vmu_rt1170/vmu_rt1170_mimxrt1176_cm7.dts +++ b/boards/nxp/vmu_rt1170/vmu_rt1170_mimxrt1176_cm7.dts @@ -459,6 +459,7 @@ cd-gpios = <&gpio3 31 (GPIO_ACTIVE_LOW | GPIO_PULL_DOWN)>; sdmmc { compatible = "zephyr,sdmmc-disk"; + disk-name = "SD"; status = "okay"; }; }; diff --git a/boards/olimex/olimexino_stm32/olimexino_stm32.dts b/boards/olimex/olimexino_stm32/olimexino_stm32.dts index 8c3a3b1491a100..604c58a94fa490 100644 --- a/boards/olimex/olimexino_stm32/olimexino_stm32.dts +++ b/boards/olimex/olimexino_stm32/olimexino_stm32.dts @@ -136,6 +136,7 @@ uext_serial: &usart1 {}; spi-max-frequency = <24000000>; mmc { compatible = "zephyr,sdmmc-disk"; + disk-name = "SD"; status = "okay"; }; }; diff --git a/boards/pjrc/teensy4/teensy41.dts b/boards/pjrc/teensy4/teensy41.dts index c742bcc8009f15..98fc9aa4f4ce25 100644 --- a/boards/pjrc/teensy4/teensy41.dts +++ b/boards/pjrc/teensy4/teensy41.dts @@ -71,6 +71,7 @@ pinctrl-names = "default", "slow", "med", "fast"; mmc { compatible = "zephyr,sdmmc-disk"; + disk-name = "SD"; status = "okay"; }; }; diff --git a/boards/renesas/rcar_h3ulcb/rcar_h3ulcb_r8a77951_a57.dts b/boards/renesas/rcar_h3ulcb/rcar_h3ulcb_r8a77951_a57.dts index 117b6bb4e741bb..8c470e05538e8e 100644 --- a/boards/renesas/rcar_h3ulcb/rcar_h3ulcb_r8a77951_a57.dts +++ b/boards/renesas/rcar_h3ulcb/rcar_h3ulcb_r8a77951_a57.dts @@ -66,6 +66,7 @@ pinctrl-names = "default", "uhs"; disk { compatible = "zephyr,sdmmc-disk"; + disk-name = "SD"; status = "okay"; }; diff --git a/boards/seeed/wio_terminal/wio_terminal.dts b/boards/seeed/wio_terminal/wio_terminal.dts index 42df242515ad35..27d24604f44cce 100644 --- a/boards/seeed/wio_terminal/wio_terminal.dts +++ b/boards/seeed/wio_terminal/wio_terminal.dts @@ -277,6 +277,7 @@ spi-max-frequency = <24000000>; mmc { compatible = "zephyr,sdmmc-disk"; + disk-name = "SD"; }; }; }; diff --git a/boards/seeed/xiao_esp32s3/xiao_esp32s3_procpu_sense.dts b/boards/seeed/xiao_esp32s3/xiao_esp32s3_procpu_sense.dts index 1fc6f2560d7fa2..4dd7a68abced55 100644 --- a/boards/seeed/xiao_esp32s3/xiao_esp32s3_procpu_sense.dts +++ b/boards/seeed/xiao_esp32s3/xiao_esp32s3_procpu_sense.dts @@ -64,6 +64,7 @@ status = "okay"; mmc { compatible = "zephyr,sdmmc-disk"; + disk-name = "SD"; status = "okay"; }; spi-max-frequency = <20000000>; diff --git a/boards/shields/adafruit_2_8_tft_touch_v2/dts/adafruit_2_8_tft_touch_v2.dtsi b/boards/shields/adafruit_2_8_tft_touch_v2/dts/adafruit_2_8_tft_touch_v2.dtsi index d4ecb5e20d6ecc..b2df10395b14cc 100644 --- a/boards/shields/adafruit_2_8_tft_touch_v2/dts/adafruit_2_8_tft_touch_v2.dtsi +++ b/boards/shields/adafruit_2_8_tft_touch_v2/dts/adafruit_2_8_tft_touch_v2.dtsi @@ -58,6 +58,7 @@ spi-max-frequency = <24000000>; mmc { compatible = "zephyr,sdmmc-disk"; + disk-name = "SD"; status = "okay"; }; }; diff --git a/boards/shields/adafruit_data_logger/adafruit_data_logger.overlay b/boards/shields/adafruit_data_logger/adafruit_data_logger.overlay index 00d4876736dc44..1d3ffb8fc75737 100644 --- a/boards/shields/adafruit_data_logger/adafruit_data_logger.overlay +++ b/boards/shields/adafruit_data_logger/adafruit_data_logger.overlay @@ -43,6 +43,7 @@ sdmmc { compatible = "zephyr,sdmmc-disk"; + disk-name = "SD"; status = "okay"; }; }; diff --git a/boards/shields/seeed_xiao_expansion_board/seeed_xiao_expansion_board.overlay b/boards/shields/seeed_xiao_expansion_board/seeed_xiao_expansion_board.overlay index b61e2c85fc5492..54405f39d73d7b 100644 --- a/boards/shields/seeed_xiao_expansion_board/seeed_xiao_expansion_board.overlay +++ b/boards/shields/seeed_xiao_expansion_board/seeed_xiao_expansion_board.overlay @@ -60,6 +60,7 @@ status = "okay"; mmc { compatible = "zephyr,sdmmc-disk"; + disk-name = "SD"; status = "okay"; }; spi-max-frequency = <24000000>; diff --git a/boards/shields/seeed_xiao_round_display/seeed_xiao_round_display.overlay b/boards/shields/seeed_xiao_round_display/seeed_xiao_round_display.overlay index d959fb4b391b97..9e0540d8231c50 100644 --- a/boards/shields/seeed_xiao_round_display/seeed_xiao_round_display.overlay +++ b/boards/shields/seeed_xiao_round_display/seeed_xiao_round_display.overlay @@ -89,6 +89,7 @@ status = "okay"; mmc { compatible = "zephyr,sdmmc-disk"; + disk-name = "SD"; status = "okay"; }; spi-max-frequency = ; diff --git a/boards/shields/sparkfun_carrier_asset_tracker/sparkfun_carrier_asset_tracker.overlay b/boards/shields/sparkfun_carrier_asset_tracker/sparkfun_carrier_asset_tracker.overlay index 6c7a9383c27f0f..83416900763259 100644 --- a/boards/shields/sparkfun_carrier_asset_tracker/sparkfun_carrier_asset_tracker.overlay +++ b/boards/shields/sparkfun_carrier_asset_tracker/sparkfun_carrier_asset_tracker.overlay @@ -35,6 +35,7 @@ status = "okay"; mmc { compatible = "zephyr,sdmmc-disk"; + disk-name = "SD"; status = "okay"; }; spi-max-frequency = ; diff --git a/boards/shields/v2c_daplink/v2c_daplink.overlay b/boards/shields/v2c_daplink/v2c_daplink.overlay index 2ecc1feeb007d5..110971cafbb3e7 100644 --- a/boards/shields/v2c_daplink/v2c_daplink.overlay +++ b/boards/shields/v2c_daplink/v2c_daplink.overlay @@ -41,6 +41,7 @@ spi-max-frequency = <25000000>; mmc { compatible = "zephyr,sdmmc-disk"; + disk-name = "SD"; status = "okay"; }; }; diff --git a/boards/shields/v2c_daplink/v2c_daplink_cfg.overlay b/boards/shields/v2c_daplink/v2c_daplink_cfg.overlay index 0a00a2792bb785..1a4c31d719958c 100644 --- a/boards/shields/v2c_daplink/v2c_daplink_cfg.overlay +++ b/boards/shields/v2c_daplink/v2c_daplink_cfg.overlay @@ -33,6 +33,7 @@ spi-max-frequency = <25000000>; mmc { compatible = "zephyr,sdmmc-disk"; + disk-name = "SD"; status = "okay"; }; }; diff --git a/boards/shields/waveshare_epaper/dts/waveshare_epaper_common.dtsi b/boards/shields/waveshare_epaper/dts/waveshare_epaper_common.dtsi index 9e62469af645f7..80480cf5787f85 100644 --- a/boards/shields/waveshare_epaper/dts/waveshare_epaper_common.dtsi +++ b/boards/shields/waveshare_epaper/dts/waveshare_epaper_common.dtsi @@ -16,6 +16,7 @@ spi-max-frequency = <24000000>; mmc { compatible = "zephyr,sdmmc-disk"; + disk-name = "SD"; status = "okay"; }; }; diff --git a/boards/sipeed/longan_nano/longan_nano-common.dtsi b/boards/sipeed/longan_nano/longan_nano-common.dtsi index c5e9202e94f252..b5ec0c06a7ffa8 100644 --- a/boards/sipeed/longan_nano/longan_nano-common.dtsi +++ b/boards/sipeed/longan_nano/longan_nano-common.dtsi @@ -170,6 +170,7 @@ spi-max-frequency = <24000000>; mmc { compatible = "zephyr,sdmmc-disk"; + disk-name = "SD"; status = "okay"; }; }; diff --git a/doc/connectivity/usb/device/usb_device.rst b/doc/connectivity/usb/device/usb_device.rst index e0f5b9fc23932b..f98a5f4c62dad5 100644 --- a/doc/connectivity/usb/device/usb_device.rst +++ b/doc/connectivity/usb/device/usb_device.rst @@ -321,11 +321,11 @@ access and expose a RAM disk, emulated block device on a flash partition, or SD Card to the host. Only one disk instance can be exported at a time. The disc to be used by the implementation is set by the -:kconfig:option:`CONFIG_MASS_STORAGE_DISK_NAME` and should be the same as the name -used by the disc access driver that the application wants to expose to the host. -SD card disk drivers use options :kconfig:option:`CONFIG_MMC_VOLUME_NAME` or -:kconfig:option:`CONFIG_SDMMC_VOLUME_NAME`, and flash and RAM disk drivers use -node property ``disk-name`` to set the disk name. +:kconfig:option:`CONFIG_MASS_STORAGE_DISK_NAME` and should be the same as the +name used by the disc access driver that the application wants to expose to the +host. MMC disk drivers use option :kconfig:option:`CONFIG_MMC_VOLUME_NAME`, or +flash, RAM, and SDMMC disk drivers use node property ``disk-name`` to set +the disk name. For the emulated block device on a flash partition, the flash partition and flash disk to be used must be described in the devicetree. If a storage partition diff --git a/doc/services/storage/disk/access.rst b/doc/services/storage/disk/access.rst index 7cc5fe12f5419d..047a47478ccf46 100644 --- a/doc/services/storage/disk/access.rst +++ b/doc/services/storage/disk/access.rst @@ -78,6 +78,7 @@ at 24 MHz once the SD card has been initialized: status = "okay"; mmc { compatible = "zephyr,sdmmc-disk"; + disk-name = "SD"; status = "okay"; }; spi-max-frequency = <24000000>; diff --git a/drivers/disk/Kconfig.sdmmc b/drivers/disk/Kconfig.sdmmc index 9b49d3d40c21ee..42d82676b18f28 100644 --- a/drivers/disk/Kconfig.sdmmc +++ b/drivers/disk/Kconfig.sdmmc @@ -20,13 +20,6 @@ config SD_INIT_PRIORITY help SDMMC controller driver initialization priority. -config SDMMC_VOLUME_NAME - string "SDMMC Disk mount point or drive name" - default "SD" if FAT_FILESYSTEM_ELM - default "SDMMC" - help - Disk name as per file system naming guidelines. - config SDMMC_SUBSYS bool "SDMMC access via SD subsystem" select SDMMC_STACK diff --git a/drivers/disk/sdmmc_stm32.c b/drivers/disk/sdmmc_stm32.c index faf9564a9fb0dc..114e7d6b467ab2 100644 --- a/drivers/disk/sdmmc_stm32.c +++ b/drivers/disk/sdmmc_stm32.c @@ -537,7 +537,7 @@ static const struct disk_operations stm32_sdmmc_ops = { }; static struct disk_info stm32_sdmmc_info = { - .name = CONFIG_SDMMC_VOLUME_NAME, + .name = "SD", .ops = &stm32_sdmmc_ops, }; diff --git a/drivers/disk/sdmmc_subsys.c b/drivers/disk/sdmmc_subsys.c index 4eb61c90e7f853..500471d4d659de 100644 --- a/drivers/disk/sdmmc_subsys.c +++ b/drivers/disk/sdmmc_subsys.c @@ -26,7 +26,7 @@ struct sdmmc_config { struct sdmmc_data { struct sd_card card; enum sd_status status; - char *name; + struct disk_info *disk_info; }; @@ -111,19 +111,13 @@ static const struct disk_operations sdmmc_disk_ops = { .ioctl = disk_sdmmc_access_ioctl, }; -static struct disk_info sdmmc_disk = { - .ops = &sdmmc_disk_ops, -}; - static int disk_sdmmc_init(const struct device *dev) { struct sdmmc_data *data = dev->data; data->status = SD_UNINIT; - sdmmc_disk.dev = dev; - sdmmc_disk.name = data->name; - return disk_access_register(&sdmmc_disk); + return disk_access_register(data->disk_info); } #define DISK_ACCESS_SDMMC_INIT(n) \ @@ -131,8 +125,14 @@ static int disk_sdmmc_init(const struct device *dev) .host_controller = DEVICE_DT_GET(DT_INST_PARENT(n)), \ }; \ \ + static struct disk_info sdmmc_disk_##n = { \ + .name = DT_INST_PROP(n, disk_name), \ + .ops = &sdmmc_disk_ops, \ + .dev = DEVICE_DT_INST_GET(n), \ + }; \ + \ static struct sdmmc_data sdmmc_data_##n = { \ - .name = CONFIG_SDMMC_VOLUME_NAME, \ + .disk_info = &sdmmc_disk_##n, \ }; \ \ DEVICE_DT_INST_DEFINE(n, \ diff --git a/dts/bindings/sd/zephyr,sdmmc-disk.yaml b/dts/bindings/sd/zephyr,sdmmc-disk.yaml index bdf84a86db247f..866e99da7c94c4 100644 --- a/dts/bindings/sd/zephyr,sdmmc-disk.yaml +++ b/dts/bindings/sd/zephyr,sdmmc-disk.yaml @@ -1,5 +1,5 @@ description: | - Zephyr MMC disk node. A binding with this compatible present within an SD + Zephyr SDMMC disk node. A binding with this compatible present within an SD host controller device node indicates that an SDMMC disk is attached to that SD bus. This binding will enable that disk to be used with the disk driver API and any subsystems that utilize it. @@ -7,3 +7,10 @@ description: | compatible: "zephyr,sdmmc-disk" include: [sd-device.yaml] + +properties: + disk-name: + type: string + required: true + description: | + Disk name. diff --git a/samples/subsys/fs/fs_sample/boards/hifive_unmatched.overlay b/samples/subsys/fs/fs_sample/boards/hifive_unmatched.overlay index e2daf505227e9e..45f299c3ecfbb9 100644 --- a/samples/subsys/fs/fs_sample/boards/hifive_unmatched.overlay +++ b/samples/subsys/fs/fs_sample/boards/hifive_unmatched.overlay @@ -13,6 +13,7 @@ status = "okay"; mmc { compatible = "zephyr,sdmmc-disk"; + disk-name = "SD"; status = "okay"; }; spi-max-frequency = <20000000>; diff --git a/samples/subsys/fs/fs_sample/boards/nrf52840_blip.overlay b/samples/subsys/fs/fs_sample/boards/nrf52840_blip.overlay index 88bfd3a9336c57..0c3bfa5018923f 100644 --- a/samples/subsys/fs/fs_sample/boards/nrf52840_blip.overlay +++ b/samples/subsys/fs/fs_sample/boards/nrf52840_blip.overlay @@ -14,6 +14,7 @@ status = "okay"; mmc { compatible = "zephyr,sdmmc-disk"; + disk-name = "SD"; status = "okay"; }; spi-max-frequency = <24000000>; diff --git a/samples/subsys/fs/fs_sample/boards/nucleo_f429zi.overlay b/samples/subsys/fs/fs_sample/boards/nucleo_f429zi.overlay index 0942251eb2fd18..ff756caac4674b 100644 --- a/samples/subsys/fs/fs_sample/boards/nucleo_f429zi.overlay +++ b/samples/subsys/fs/fs_sample/boards/nucleo_f429zi.overlay @@ -11,6 +11,7 @@ status = "okay"; mmc { compatible = "zephyr,sdmmc-disk"; + disk-name = "SD"; status = "okay"; }; spi-max-frequency = <25000000>; diff --git a/samples/subsys/fs/fs_sample/src/main.c b/samples/subsys/fs/fs_sample/src/main.c index 01d935d7e1b503..b21bafe01ced7b 100644 --- a/samples/subsys/fs/fs_sample/src/main.c +++ b/samples/subsys/fs/fs_sample/src/main.c @@ -36,7 +36,7 @@ static struct fs_mount_t mp = { #include -#define DISK_DRIVE_NAME "SDMMC" +#define DISK_DRIVE_NAME "SD" #define DISK_MOUNT_PT "/ext" static struct fs_mount_t mp = { diff --git a/samples/subsys/fs/littlefs/README.rst b/samples/subsys/fs/littlefs/README.rst index 600008b5f2b1e5..9aa63b8a174f79 100644 --- a/samples/subsys/fs/littlefs/README.rst +++ b/samples/subsys/fs/littlefs/README.rst @@ -96,9 +96,9 @@ present and enabled in the final board dts and configuration files simultaneousl point name for the ``littlefs`` file system block device will be determined based on the following logic: -* if the :kconfig:option:`CONFIG_SDMMC_VOLUME_NAME` configuration is defined, it will be used - as the mount point name; -* if the :kconfig:option:`CONFIG_SDMMC_VOLUME_NAME` configuration is not defined, but the +* if the :kconfig:option:`CONFIG_DISK_DRIVER_SDMMC` configuration is defined, ``"SD"`` + will be used as the mount point name; +* if the :kconfig:option:`CONFIG_DISK_DRIVER_SDMMC` configuration is not defined, but the :kconfig:option:`CONFIG_MMC_VOLUME_NAME` configuration is defined, :kconfig:option:`CONFIG_MMC_VOLUME_NAME` will be used as the mount point name; * if neither :kconfig:option:`CONFIG_SDMMC_VOLUME_NAME` nor :kconfig:option:`CONFIG_MMC_VOLUME_NAME` diff --git a/samples/subsys/fs/littlefs/src/main.c b/samples/subsys/fs/littlefs/src/main.c index b04b998d7d5ae7..2a47f0e5ca8fbf 100644 --- a/samples/subsys/fs/littlefs/src/main.c +++ b/samples/subsys/fs/littlefs/src/main.c @@ -311,7 +311,7 @@ static int littlefs_mount(struct fs_mount_t *mp) #ifdef CONFIG_APP_LITTLEFS_STORAGE_BLK_SDMMC #if defined(CONFIG_DISK_DRIVER_SDMMC) -#define DISK_NAME CONFIG_SDMMC_VOLUME_NAME +#define DISK_NAME "SD" #elif defined(CONFIG_DISK_DRIVER_MMC) #define DISK_NAME CONFIG_MMC_VOLUME_NAME #else diff --git a/subsys/fs/shell.c b/subsys/fs/shell.c index cb72b6591e748d..b5fd364b3965f0 100644 --- a/subsys/fs/shell.c +++ b/subsys/fs/shell.c @@ -40,7 +40,7 @@ static struct fs_mount_t fatfs_mnt = { #ifdef CONFIG_FS_LITTLEFS_BLK_DEV #if defined(CONFIG_DISK_DRIVER_SDMMC) -#define DISK_NAME CONFIG_SDMMC_VOLUME_NAME +#define DISK_NAME "SD" #elif defined(CONFIG_DISK_DRIVER_MMC) #define DISK_NAME CONFIG_MMC_VOLUME_NAME #else diff --git a/tests/drivers/build_all/disk/spi.dtsi b/tests/drivers/build_all/disk/spi.dtsi index 72014996abd89c..cd36ac3604848e 100644 --- a/tests/drivers/build_all/disk/spi.dtsi +++ b/tests/drivers/build_all/disk/spi.dtsi @@ -11,6 +11,7 @@ sdhc@0 { sdmmc { compatible = "zephyr,sdmmc-disk"; + disk-name = "SD"; status = "okay"; }; diff --git a/tests/drivers/disk/disk_access/src/main.c b/tests/drivers/disk/disk_access/src/main.c index 8e26cc0356eafc..11689006f4d616 100644 --- a/tests/drivers/disk/disk_access/src/main.c +++ b/tests/drivers/disk/disk_access/src/main.c @@ -21,7 +21,7 @@ #endif #if defined(CONFIG_DISK_DRIVER_SDMMC) -#define DISK_NAME_PHYS CONFIG_SDMMC_VOLUME_NAME +#define DISK_NAME_PHYS "SD" #elif defined(CONFIG_DISK_DRIVER_MMC) #define DISK_NAME_PHYS CONFIG_MMC_VOLUME_NAME #elif defined(CONFIG_DISK_DRIVER_FLASH) diff --git a/tests/drivers/disk/disk_performance/src/main.c b/tests/drivers/disk/disk_performance/src/main.c index 0042cde68ee66a..82bf2008ab2794 100644 --- a/tests/drivers/disk/disk_performance/src/main.c +++ b/tests/drivers/disk/disk_performance/src/main.c @@ -13,7 +13,7 @@ #include #if defined(CONFIG_DISK_DRIVER_SDMMC) -#define DISK_NAME CONFIG_SDMMC_VOLUME_NAME +#define DISK_NAME "SD" #elif defined(CONFIG_DISK_DRIVER_MMC) #define DISK_NAME CONFIG_MMC_VOLUME_NAME #elif defined(CONFIG_NVME) diff --git a/tests/lib/gui/lvgl/boards/stm32h747i_disco_stm32h747xx_m7.overlay b/tests/lib/gui/lvgl/boards/stm32h747i_disco_stm32h747xx_m7.overlay index 13dcfa33074674..8bbcd2cb1e54c7 100644 --- a/tests/lib/gui/lvgl/boards/stm32h747i_disco_stm32h747xx_m7.overlay +++ b/tests/lib/gui/lvgl/boards/stm32h747i_disco_stm32h747xx_m7.overlay @@ -4,12 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -&sdmmc1 { - sdmmc { - compatible = "zephyr,sdmmc-disk"; - }; -}; - /delete-node/ &storage_partition; &flash0 { diff --git a/tests/lib/gui/lvgl/src/main.c b/tests/lib/gui/lvgl/src/main.c index 8ee495d936aed2..91e38e1714c8f6 100644 --- a/tests/lib/gui/lvgl/src/main.c +++ b/tests/lib/gui/lvgl/src/main.c @@ -18,7 +18,7 @@ #ifdef CONFIG_FS_LITTLEFS_BLK_DEV #ifdef CONFIG_DISK_DRIVER_SDMMC -#define DISK_NAME CONFIG_SDMMC_VOLUME_NAME +#define DISK_NAME "SD" #elif defined(CONFIG_DISK_DRIVER_MMC) #define DISK_NAME CONFIG_MMC_VOLUME_NAME #else diff --git a/tests/subsys/fs/ext2/boards/hifive_unmatched.overlay b/tests/subsys/fs/ext2/boards/hifive_unmatched.overlay index e2daf505227e9e..45f299c3ecfbb9 100644 --- a/tests/subsys/fs/ext2/boards/hifive_unmatched.overlay +++ b/tests/subsys/fs/ext2/boards/hifive_unmatched.overlay @@ -13,6 +13,7 @@ status = "okay"; mmc { compatible = "zephyr,sdmmc-disk"; + disk-name = "SD"; status = "okay"; }; spi-max-frequency = <20000000>; diff --git a/tests/subsys/fs/ext2/src/main.c b/tests/subsys/fs/ext2/src/main.c index d58a904270ee09..5262a1d942bab1 100644 --- a/tests/subsys/fs/ext2/src/main.c +++ b/tests/subsys/fs/ext2/src/main.c @@ -14,7 +14,7 @@ #elif CONFIG_DISK_DRIVER_FLASH #define STORAGE_DEVICE "NAND" #elif CONFIG_DISK_DRIVER_SDMMC - #define STORAGE_DEVICE "SDMMC" + #define STORAGE_DEVICE "SD" #endif /* All tests must use this structure to mount file system. After each test this structure is cleaned diff --git a/tests/subsys/fs/fat_fs_api/src/test_fat.h b/tests/subsys/fs/fat_fs_api/src/test_fat.h index c5ef9b12b267db..f6464ddc88e037 100644 --- a/tests/subsys/fs/fat_fs_api/src/test_fat.h +++ b/tests/subsys/fs/fat_fs_api/src/test_fat.h @@ -16,7 +16,7 @@ #elif defined(CONFIG_DISK_DRIVER_FLASH) #define DISK_NAME DT_PROP(DT_NODELABEL(test_disk), disk_name) #elif defined(CONFIG_DISK_DRIVER_SDMMC) -#define DISK_NAME CONFIG_SDMMC_VOLUME_NAME +#define DISK_NAME "SD" #elif defined(CONFIG_DISK_DRIVER_MMC) #define DISK_NAME CONFIG_MMC_VOLUME_NAME #else From 07a8e3253a2d8a2076c9c83c4ed4158fa3fbb2a2 Mon Sep 17 00:00:00 2001 From: Daniel DeGrasse Date: Thu, 31 Oct 2024 21:03:44 +0000 Subject: [PATCH 035/113] drivers: disk: mmc_subsys: remove CONFIG_MMC_VOLUME_NAME Remove CONFIG_MMC_VOLUME_NAME, and set the disk name based on the ``disk-name`` property. This aligns with other disk drivers, and allows for multiple instances of the mmc_subsys disk driver to be registered. Add disk-name properties for all in tree definitions for the mmc-subsys disk driver, and change all in tree usage of the disk name Fixes #75004 Signed-off-by: Daniel DeGrasse --- .../mimxrt595_evk_mimxrt595s_cm33.dts | 1 + .../rcar_h3ulcb/rcar_h3ulcb_r8a77951_a57.dts | 1 + .../rcar_salvator_xs/rcar_salvator_xs.dts | 1 + .../rcar_spider_s4_r8a779f0_a55.dts | 1 + doc/connectivity/usb/device/usb_device.rst | 5 ++--- drivers/disk/Kconfig.mmc | 7 ------- drivers/disk/mmc_subsys.c | 18 +++++++++--------- dts/bindings/sd/zephyr,mmc-disk.yaml | 6 ++++++ dts/x86/intel/alder_lake.dtsi | 1 + samples/subsys/fs/fs_sample/src/main.c | 5 +++++ samples/subsys/fs/littlefs/README.rst | 6 +++--- samples/subsys/fs/littlefs/src/main.c | 2 +- subsys/fs/shell.c | 2 +- tests/drivers/build_all/disk/spi.dtsi | 1 + tests/drivers/disk/disk_access/src/main.c | 2 +- tests/drivers/disk/disk_performance/src/main.c | 2 +- tests/lib/gui/lvgl/src/main.c | 2 +- tests/subsys/fs/fat_fs_api/prj_mmc.conf | 1 - tests/subsys/fs/fat_fs_api/src/test_fat.h | 2 +- 19 files changed, 37 insertions(+), 29 deletions(-) diff --git a/boards/nxp/mimxrt595_evk/mimxrt595_evk_mimxrt595s_cm33.dts b/boards/nxp/mimxrt595_evk/mimxrt595_evk_mimxrt595s_cm33.dts index 77c778e7634816..efa9d9d244a69d 100644 --- a/boards/nxp/mimxrt595_evk/mimxrt595_evk_mimxrt595s_cm33.dts +++ b/boards/nxp/mimxrt595_evk/mimxrt595_evk_mimxrt595s_cm33.dts @@ -371,6 +371,7 @@ zephyr_udc0: &usbhs { cd-gpios = <&gpio2 9 GPIO_ACTIVE_LOW>; mmc { compatible = "zephyr,mmc-disk"; + disk-name = "SD2"; status = "okay"; }; pinctrl-0 = <&pinmux_usdhc>; diff --git a/boards/renesas/rcar_h3ulcb/rcar_h3ulcb_r8a77951_a57.dts b/boards/renesas/rcar_h3ulcb/rcar_h3ulcb_r8a77951_a57.dts index 8c470e05538e8e..fd814bc977e030 100644 --- a/boards/renesas/rcar_h3ulcb/rcar_h3ulcb_r8a77951_a57.dts +++ b/boards/renesas/rcar_h3ulcb/rcar_h3ulcb_r8a77951_a57.dts @@ -94,6 +94,7 @@ pinctrl-names = "default", "uhs"; disk { compatible = "zephyr,mmc-disk"; + disk-name = "SD2"; status = "disabled"; }; bus-width = <8>; diff --git a/boards/renesas/rcar_salvator_xs/rcar_salvator_xs.dts b/boards/renesas/rcar_salvator_xs/rcar_salvator_xs.dts index bc926dfddd4fc0..33f836f5924275 100644 --- a/boards/renesas/rcar_salvator_xs/rcar_salvator_xs.dts +++ b/boards/renesas/rcar_salvator_xs/rcar_salvator_xs.dts @@ -46,6 +46,7 @@ pinctrl-names = "default", "uhs"; disk { compatible = "zephyr,mmc-disk"; + disk-name = "SD2"; status = "disabled"; }; bus-width = <8>; diff --git a/boards/renesas/rcar_spider_s4/rcar_spider_s4_r8a779f0_a55.dts b/boards/renesas/rcar_spider_s4/rcar_spider_s4_r8a779f0_a55.dts index 3a7b5c4eb829bb..c512a13f04bd50 100644 --- a/boards/renesas/rcar_spider_s4/rcar_spider_s4_r8a779f0_a55.dts +++ b/boards/renesas/rcar_spider_s4/rcar_spider_s4_r8a779f0_a55.dts @@ -41,6 +41,7 @@ pinctrl-names = "default", "uhs"; disk { compatible = "zephyr,mmc-disk"; + disk-name = "SD2"; status = "okay"; }; bus-width = <8>; diff --git a/doc/connectivity/usb/device/usb_device.rst b/doc/connectivity/usb/device/usb_device.rst index f98a5f4c62dad5..f1230e073d42bb 100644 --- a/doc/connectivity/usb/device/usb_device.rst +++ b/doc/connectivity/usb/device/usb_device.rst @@ -323,9 +323,8 @@ or SD Card to the host. Only one disk instance can be exported at a time. The disc to be used by the implementation is set by the :kconfig:option:`CONFIG_MASS_STORAGE_DISK_NAME` and should be the same as the name used by the disc access driver that the application wants to expose to the -host. MMC disk drivers use option :kconfig:option:`CONFIG_MMC_VOLUME_NAME`, or -flash, RAM, and SDMMC disk drivers use node property ``disk-name`` to set -the disk name. +host. Flash, RAM, and SDMMC/MMC disk drivers use node property ``disk-name`` to +set the disk name. For the emulated block device on a flash partition, the flash partition and flash disk to be used must be described in the devicetree. If a storage partition diff --git a/drivers/disk/Kconfig.mmc b/drivers/disk/Kconfig.mmc index 72a81b8e60f8e6..3811ee4b60a385 100644 --- a/drivers/disk/Kconfig.mmc +++ b/drivers/disk/Kconfig.mmc @@ -16,13 +16,6 @@ config SD_INIT_PRIORITY help MMC controller driver initialization priority. -config MMC_VOLUME_NAME - string "MMC Disk mount point or drive name" - default "SD" if FAT_FILESYSTEM_ELM - default "MMC" - help - Disk name as per file system naming guidelines. - config MMC_SUBSYS bool "MMC access via SD subsystem" select MMC_STACK diff --git a/drivers/disk/mmc_subsys.c b/drivers/disk/mmc_subsys.c index c595c0edb8a7ef..b8e81cd528f5e8 100644 --- a/drivers/disk/mmc_subsys.c +++ b/drivers/disk/mmc_subsys.c @@ -27,7 +27,7 @@ struct mmc_config { struct mmc_data { struct sd_card card; enum sd_status status; - char *name; + struct disk_info *disk_info; }; @@ -107,10 +107,6 @@ static const struct disk_operations mmc_disk_ops = { .ioctl = disk_mmc_access_ioctl, }; -static struct disk_info mmc_disk = { - .ops = &mmc_disk_ops, -}; - static int disk_mmc_init(const struct device *dev) { struct mmc_data *data = dev->data; @@ -118,10 +114,8 @@ static int disk_mmc_init(const struct device *dev) data->status = SD_UNINIT; data->card.bus_width = config->bus_width; - mmc_disk.dev = dev; - mmc_disk.name = data->name; - return disk_access_register(&mmc_disk); + return disk_access_register(data->disk_info); } #define DISK_ACCESS_MMC_INIT(n) \ @@ -130,8 +124,14 @@ static int disk_mmc_init(const struct device *dev) .bus_width = DT_INST_PROP(n, bus_width), \ }; \ \ + static struct disk_info mmc_disk_##n = { \ + .name = DT_INST_PROP(n, disk_name), \ + .ops = &mmc_disk_ops, \ + .dev = DEVICE_DT_INST_GET(n), \ + }; \ + \ static struct mmc_data mmc_data_##n = { \ - .name = CONFIG_MMC_VOLUME_NAME, \ + .disk_info = &mmc_disk_##n, \ }; \ \ DEVICE_DT_INST_DEFINE(n, \ diff --git a/dts/bindings/sd/zephyr,mmc-disk.yaml b/dts/bindings/sd/zephyr,mmc-disk.yaml index f702b341e1a510..4246a994e2eee9 100644 --- a/dts/bindings/sd/zephyr,mmc-disk.yaml +++ b/dts/bindings/sd/zephyr,mmc-disk.yaml @@ -19,3 +19,9 @@ properties: - 1 - 4 - 8 + + disk-name: + type: string + required: true + description: | + Disk name. diff --git a/dts/x86/intel/alder_lake.dtsi b/dts/x86/intel/alder_lake.dtsi index b847278b24faf5..b205df48589157 100644 --- a/dts/x86/intel/alder_lake.dtsi +++ b/dts/x86/intel/alder_lake.dtsi @@ -348,6 +348,7 @@ mmc { compatible = "zephyr,mmc-disk"; + disk-name = "SD2"; bus-width = <8>; status = "okay"; }; diff --git a/samples/subsys/fs/fs_sample/src/main.c b/samples/subsys/fs/fs_sample/src/main.c index b21bafe01ced7b..cb50716c67f812 100644 --- a/samples/subsys/fs/fs_sample/src/main.c +++ b/samples/subsys/fs/fs_sample/src/main.c @@ -22,7 +22,12 @@ * Note the fatfs library is able to mount only strings inside _VOLUME_STRS * in ffconf.h */ +#if defined(CONFIG_DISK_DRIVER_MMC) +#define DISK_DRIVE_NAME "SD2" +#else #define DISK_DRIVE_NAME "SD" +#endif + #define DISK_MOUNT_PT "/"DISK_DRIVE_NAME":" static FATFS fat_fs; diff --git a/samples/subsys/fs/littlefs/README.rst b/samples/subsys/fs/littlefs/README.rst index 9aa63b8a174f79..4c4407cb2521d3 100644 --- a/samples/subsys/fs/littlefs/README.rst +++ b/samples/subsys/fs/littlefs/README.rst @@ -99,9 +99,9 @@ following logic: * if the :kconfig:option:`CONFIG_DISK_DRIVER_SDMMC` configuration is defined, ``"SD"`` will be used as the mount point name; * if the :kconfig:option:`CONFIG_DISK_DRIVER_SDMMC` configuration is not defined, but the - :kconfig:option:`CONFIG_MMC_VOLUME_NAME` configuration is defined, - :kconfig:option:`CONFIG_MMC_VOLUME_NAME` will be used as the mount point name; -* if neither :kconfig:option:`CONFIG_SDMMC_VOLUME_NAME` nor :kconfig:option:`CONFIG_MMC_VOLUME_NAME` + :kconfig:option:`CONFIG_DISK_DRIVER_MMC` configuration is defined, ``"SD2"`` will + be used as the mount point name; +* if neither :kconfig:option:`CONFIG_DISK_DRIVER_SDMMC` nor :kconfig:option:`CONFIG_DISK_DRIVER_MMC` configurations are defined, the mount point name will not be determined, and an appropriate error will appear during the sample build. diff --git a/samples/subsys/fs/littlefs/src/main.c b/samples/subsys/fs/littlefs/src/main.c index 2a47f0e5ca8fbf..e228baad1fa63c 100644 --- a/samples/subsys/fs/littlefs/src/main.c +++ b/samples/subsys/fs/littlefs/src/main.c @@ -313,7 +313,7 @@ static int littlefs_mount(struct fs_mount_t *mp) #if defined(CONFIG_DISK_DRIVER_SDMMC) #define DISK_NAME "SD" #elif defined(CONFIG_DISK_DRIVER_MMC) -#define DISK_NAME CONFIG_MMC_VOLUME_NAME +#define DISK_NAME "SD2" #else #error "No disk device defined, is your board supported?" #endif diff --git a/subsys/fs/shell.c b/subsys/fs/shell.c index b5fd364b3965f0..465e70af4f1aa8 100644 --- a/subsys/fs/shell.c +++ b/subsys/fs/shell.c @@ -42,7 +42,7 @@ static struct fs_mount_t fatfs_mnt = { #if defined(CONFIG_DISK_DRIVER_SDMMC) #define DISK_NAME "SD" #elif defined(CONFIG_DISK_DRIVER_MMC) -#define DISK_NAME CONFIG_MMC_VOLUME_NAME +#define DISK_NAME "SD2" #else #error "No disk device defined, is your board supported?" #endif diff --git a/tests/drivers/build_all/disk/spi.dtsi b/tests/drivers/build_all/disk/spi.dtsi index cd36ac3604848e..389a1a07d213b8 100644 --- a/tests/drivers/build_all/disk/spi.dtsi +++ b/tests/drivers/build_all/disk/spi.dtsi @@ -17,6 +17,7 @@ sdhc@0 { mmc { compatible = "zephyr,mmc-disk"; + disk-name = "SD2"; status = "okay"; }; }; diff --git a/tests/drivers/disk/disk_access/src/main.c b/tests/drivers/disk/disk_access/src/main.c index 11689006f4d616..0c36f1d6121eeb 100644 --- a/tests/drivers/disk/disk_access/src/main.c +++ b/tests/drivers/disk/disk_access/src/main.c @@ -23,7 +23,7 @@ #if defined(CONFIG_DISK_DRIVER_SDMMC) #define DISK_NAME_PHYS "SD" #elif defined(CONFIG_DISK_DRIVER_MMC) -#define DISK_NAME_PHYS CONFIG_MMC_VOLUME_NAME +#define DISK_NAME_PHYS "SD2" #elif defined(CONFIG_DISK_DRIVER_FLASH) #define DISK_NAME_PHYS "NAND" #elif defined(CONFIG_NVME) diff --git a/tests/drivers/disk/disk_performance/src/main.c b/tests/drivers/disk/disk_performance/src/main.c index 82bf2008ab2794..c1ac10ba684132 100644 --- a/tests/drivers/disk/disk_performance/src/main.c +++ b/tests/drivers/disk/disk_performance/src/main.c @@ -15,7 +15,7 @@ #if defined(CONFIG_DISK_DRIVER_SDMMC) #define DISK_NAME "SD" #elif defined(CONFIG_DISK_DRIVER_MMC) -#define DISK_NAME CONFIG_MMC_VOLUME_NAME +#define DISK_NAME "SD2" #elif defined(CONFIG_NVME) #define DISK_NAME "nvme0n0" #else diff --git a/tests/lib/gui/lvgl/src/main.c b/tests/lib/gui/lvgl/src/main.c index 91e38e1714c8f6..0f59d01bd02fd2 100644 --- a/tests/lib/gui/lvgl/src/main.c +++ b/tests/lib/gui/lvgl/src/main.c @@ -20,7 +20,7 @@ #ifdef CONFIG_DISK_DRIVER_SDMMC #define DISK_NAME "SD" #elif defined(CONFIG_DISK_DRIVER_MMC) -#define DISK_NAME CONFIG_MMC_VOLUME_NAME +#define DISK_NAME "SD2" #else #error "No disk device defined, is your board supported?" #endif /* CONFIG_DISK_DRIVER_SDMMC */ diff --git a/tests/subsys/fs/fat_fs_api/prj_mmc.conf b/tests/subsys/fs/fat_fs_api/prj_mmc.conf index e3e903f5a890e2..98181cf96a0e8e 100644 --- a/tests/subsys/fs/fat_fs_api/prj_mmc.conf +++ b/tests/subsys/fs/fat_fs_api/prj_mmc.conf @@ -4,5 +4,4 @@ CONFIG_FAT_FILESYSTEM_ELM=y CONFIG_SPI=y CONFIG_GPIO=y CONFIG_ZTEST=y -CONFIG_MMC_VOLUME_NAME="NAND" CONFIG_MAIN_STACK_SIZE=4096 diff --git a/tests/subsys/fs/fat_fs_api/src/test_fat.h b/tests/subsys/fs/fat_fs_api/src/test_fat.h index f6464ddc88e037..adbeffe78dc12f 100644 --- a/tests/subsys/fs/fat_fs_api/src/test_fat.h +++ b/tests/subsys/fs/fat_fs_api/src/test_fat.h @@ -18,7 +18,7 @@ #elif defined(CONFIG_DISK_DRIVER_SDMMC) #define DISK_NAME "SD" #elif defined(CONFIG_DISK_DRIVER_MMC) -#define DISK_NAME CONFIG_MMC_VOLUME_NAME +#define DISK_NAME "SD2" #else #error "Failed to select DISK access type" #endif From 832e02daa6b68a7cc536279f55057d750de4baa5 Mon Sep 17 00:00:00 2001 From: Daniel DeGrasse Date: Thu, 31 Oct 2024 21:10:17 +0000 Subject: [PATCH 036/113] doc: releases: migration-guide-4.0: add note about disk-name for SD/MMC SD and MMC devices now require the disk-name property. Add a note to the migration guide so that users know the recommended value to add for this name for each disk driver type. Signed-off-by: Daniel DeGrasse --- doc/releases/migration-guide-4.0.rst | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/doc/releases/migration-guide-4.0.rst b/doc/releases/migration-guide-4.0.rst index dbe251676204fb..fcf1763d15e150 100644 --- a/doc/releases/migration-guide-4.0.rst +++ b/doc/releases/migration-guide-4.0.rst @@ -208,6 +208,22 @@ Crypto Display ======= +Disk +==== + +* The SDMMC subsystem driver now requires a ``disk-name`` property be supplied + with the definition of the disk, which is used when registering the + SD device with the disk subsystem. This permits multiple SD devices to be + registered simultaneously. If unsure, ``disk-name = "SD"`` may be used + as a sane default. + +* The MMC subsystem driver now requires a ``disk-name`` property be supplied + with the definition of the disk, which is used when registering the + MMC device with the disk subsystem. This permits multiple MMC devices to be + registered simultaneously. If unsure, ``disk-name = "SD2"`` may be used + as a sane default. + + Enhanced Serial Peripheral Interface (eSPI) =========================================== From ba52c8c350aa24480b249abcab20648222287a9b Mon Sep 17 00:00:00 2001 From: Raffael Rostagno Date: Fri, 1 Nov 2024 16:38:34 -0300 Subject: [PATCH 037/113] west.yml: Update for esp32c2/esp32c6 ledc clock fix Update HAL for esp32c2/esp32c6 ledc clock fix Signed-off-by: Raffael Rostagno --- west.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/west.yml b/west.yml index 4da2eab84bb9ef..5a6a4d46dcce5d 100644 --- a/west.yml +++ b/west.yml @@ -157,7 +157,7 @@ manifest: groups: - hal - name: hal_espressif - revision: 0f1874284f5dee0d49cb23f44f756e7be404e7b7 + revision: 23c17a8735d3047da95e3a81adafa36425636c55 path: modules/hal/espressif west-commands: west/west-commands.yml groups: From b9fc4cc4151fc319f2fa8648a68807baceae01b4 Mon Sep 17 00:00:00 2001 From: Raffael Rostagno Date: Fri, 1 Nov 2024 16:27:03 -0300 Subject: [PATCH 038/113] drivers: pwm: ledc: esp32c2: esp32c6: Fix clock frequency Fix clock frequency for both devices. Signed-off-by: Raffael Rostagno --- drivers/pwm/pwm_led_esp32.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/drivers/pwm/pwm_led_esp32.c b/drivers/pwm/pwm_led_esp32.c index 4c1804ca2371be..ab787bb52ef2fb 100644 --- a/drivers/pwm/pwm_led_esp32.c +++ b/drivers/pwm/pwm_led_esp32.c @@ -22,6 +22,17 @@ #include LOG_MODULE_REGISTER(pwm_ledc_esp32, CONFIG_PWM_LOG_LEVEL); +#if SOC_LEDC_SUPPORT_APB_CLOCK +#define CLOCK_SOURCE LEDC_APB_CLK +#elif SOC_LEDC_SUPPORT_PLL_DIV_CLOCK +#define CLOCK_SOURCE LEDC_SCLK +#if defined(CONFIG_SOC_SERIES_ESP32C2) +#define SCLK_CLK_FREQ MHZ(60) +#elif defined(CONFIG_SOC_SERIES_ESP32C6) +#define SCLK_CLK_FREQ MHZ(80) +#endif +#endif + struct pwm_ledc_esp32_data { ledc_hal_context_t hal; struct k_sem cmd_sem; @@ -350,12 +361,6 @@ static const struct pwm_driver_api pwm_led_esp32_api = { PINCTRL_DT_INST_DEFINE(0); -#if SOC_LEDC_SUPPORT_APB_CLOCK - #define CLOCK_SOURCE LEDC_APB_CLK -#elif SOC_LEDC_SUPPORT_PLL_DIV_CLOCK - #define CLOCK_SOURCE LEDC_SCLK -#endif - #define CHANNEL_CONFIG(node_id) \ { \ .idx = DT_REG_ADDR(node_id), \ From 5c00d99f4b799a0e91805a36c716727b67220305 Mon Sep 17 00:00:00 2001 From: Stephanos Ioannidis Date: Wed, 6 Nov 2024 10:52:53 +0900 Subject: [PATCH 039/113] ci: Add '-specs' to ccache ignore option list `-specs=` is an alternate form of `--specs=`, which is now used by the Zephyr build system. This commit adds `-specs=*` to the ccache ignore option list because, as with `--specs=*`, ccache is unable to resolve the toolchain specs file path and refuses to cache when this option is specified. Signed-off-by: Stephanos Ioannidis --- .github/workflows/codecov.yaml | 2 +- .github/workflows/twister.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/codecov.yaml b/.github/workflows/codecov.yaml index 56edb6a1e87e1f..f22fa7a75820b0 100644 --- a/.github/workflows/codecov.yaml +++ b/.github/workflows/codecov.yaml @@ -34,7 +34,7 @@ jobs: CCACHE_REMOTE_STORAGE: "redis://cache-*.keydb-cache.svc.cluster.local|shards=1,2,3" CCACHE_REMOTE_ONLY: "true" # `--specs` is ignored because ccache is unable to resovle the toolchain specs file path. - CCACHE_IGNOREOPTIONS: '--specs=*' + CCACHE_IGNOREOPTIONS: '-specs=* --specs=*' steps: - name: Apply container owner mismatch workaround run: | diff --git a/.github/workflows/twister.yaml b/.github/workflows/twister.yaml index f12cdeb2efaa29..84fa06390585e3 100644 --- a/.github/workflows/twister.yaml +++ b/.github/workflows/twister.yaml @@ -142,7 +142,7 @@ jobs: CCACHE_REMOTE_STORAGE: "redis://cache-*.keydb-cache.svc.cluster.local|shards=1,2,3" CCACHE_REMOTE_ONLY: "true" # `--specs` is ignored because ccache is unable to resolve the toolchain specs file path. - CCACHE_IGNOREOPTIONS: '--specs=*' + CCACHE_IGNOREOPTIONS: '-specs=* --specs=*' BSIM_OUT_PATH: /opt/bsim/ BSIM_COMPONENTS_PATH: /opt/bsim/components TWISTER_COMMON: ' --force-color --inline-logs -v -N -M --retry-failed 3 --timeout-multiplier 2 ' From d4b7bf986c6a5ea0eedaf2d2b5e2a22567b1dac9 Mon Sep 17 00:00:00 2001 From: Alberto Escolar Piedras Date: Tue, 5 Nov 2024 10:36:51 +0100 Subject: [PATCH 040/113] tests bsim bt audio: Increase execution timeout These tests have been seen failing in CI due to the real time execution timeout. Let's increase it so it does not happen. Signed-off-by: Alberto Escolar Piedras --- .../test_scripts/bap_broadcast_audio_assistant_incorrect_code.sh | 1 + tests/bsim/bluetooth/audio/test_scripts/bap_unicast_audio.sh | 1 + .../audio/test_scripts/bap_unicast_audio_acl_disconnect.sh | 1 + 3 files changed, 3 insertions(+) diff --git a/tests/bsim/bluetooth/audio/test_scripts/bap_broadcast_audio_assistant_incorrect_code.sh b/tests/bsim/bluetooth/audio/test_scripts/bap_broadcast_audio_assistant_incorrect_code.sh index e81bb6492f7c65..da853e6085dc11 100755 --- a/tests/bsim/bluetooth/audio/test_scripts/bap_broadcast_audio_assistant_incorrect_code.sh +++ b/tests/bsim/bluetooth/audio/test_scripts/bap_broadcast_audio_assistant_incorrect_code.sh @@ -6,6 +6,7 @@ SIMULATION_ID="bap_broadcast_audio_assistant_incorrect_code" VERBOSITY_LEVEL=2 +EXECUTE_TIMEOUT=180 source ${ZEPHYR_BASE}/tests/bsim/sh_common.source diff --git a/tests/bsim/bluetooth/audio/test_scripts/bap_unicast_audio.sh b/tests/bsim/bluetooth/audio/test_scripts/bap_unicast_audio.sh index 5bbf5d3d1a8e0f..24444440aa7a19 100755 --- a/tests/bsim/bluetooth/audio/test_scripts/bap_unicast_audio.sh +++ b/tests/bsim/bluetooth/audio/test_scripts/bap_unicast_audio.sh @@ -6,6 +6,7 @@ SIMULATION_ID="unicast_audio" VERBOSITY_LEVEL=2 +EXECUTE_TIMEOUT=120 source ${ZEPHYR_BASE}/tests/bsim/sh_common.source diff --git a/tests/bsim/bluetooth/audio/test_scripts/bap_unicast_audio_acl_disconnect.sh b/tests/bsim/bluetooth/audio/test_scripts/bap_unicast_audio_acl_disconnect.sh index 412473db53a9c0..1b0d1c2890d4e6 100755 --- a/tests/bsim/bluetooth/audio/test_scripts/bap_unicast_audio_acl_disconnect.sh +++ b/tests/bsim/bluetooth/audio/test_scripts/bap_unicast_audio_acl_disconnect.sh @@ -6,6 +6,7 @@ SIMULATION_ID="unicast_audio_acl_disconnect" VERBOSITY_LEVEL=2 +EXECUTE_TIMEOUT=120 source ${ZEPHYR_BASE}/tests/bsim/sh_common.source From 7e1cd18be4aab4c42fce2ea74e21b92d130ff06f Mon Sep 17 00:00:00 2001 From: Dmitrii Golovanov Date: Sun, 3 Nov 2024 18:26:47 +0100 Subject: [PATCH 041/113] twister: Fix NOTRUN status Fix Twister TestCase statuses left not assigned ('NONE') in these 'NOTRUN' situations: * a test suite has `integration platform` which is not available to run. * `--cmake-only` execution. Signed-off-by: Dmitrii Golovanov --- scripts/pylib/twister/twisterlib/runner.py | 8 +++++++- scripts/tests/twister/test_runner.py | 2 +- scripts/tests/twister_blackbox/test_runner.py | 2 +- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/scripts/pylib/twister/twisterlib/runner.py b/scripts/pylib/twister/twisterlib/runner.py index 7bc45e2df677cb..201a869a82a9fd 100644 --- a/scripts/pylib/twister/twisterlib/runner.py +++ b/scripts/pylib/twister/twisterlib/runner.py @@ -900,7 +900,9 @@ def process(self, pipeline, done, message, lock, results): next_op = 'report' elif self.options.cmake_only: if self.instance.status == TwisterStatus.NONE: - self.instance.status = TwisterStatus.PASS + logger.debug("CMake only: PASS %s" % self.instance.name) + self.instance.status = TwisterStatus.NOTRUN + self.instance.add_missing_case_status(TwisterStatus.NOTRUN, 'CMake only') next_op = 'report' else: # Here we check the runtime filter results coming from running cmake @@ -974,6 +976,10 @@ def process(self, pipeline, done, message, lock, results): elif self.instance.run and self.instance.handler.ready: next_op = 'run' else: + if self.instance.status == TwisterStatus.NOTRUN: + run_conditions = f"(run:{self.instance.run}, handler.ready:{self.instance.handler.ready})" + logger.debug(f"Instance {self.instance.name} can't run {run_conditions}") + self.instance.add_missing_case_status(TwisterStatus.NOTRUN, f"Nowhere to run") next_op = 'report' except StatusAttributeError as sae: logger.error(str(sae)) diff --git a/scripts/tests/twister/test_runner.py b/scripts/tests/twister/test_runner.py index 259fd7d1f5b549..b6cd151d78ad01 100644 --- a/scripts/tests/twister/test_runner.py +++ b/scripts/tests/twister/test_runner.py @@ -978,7 +978,7 @@ def mock_getsize(filename, *args, **kwargs): mock.ANY, [], {'op': 'report', 'test': mock.ANY}, - TwisterStatus.PASS, + TwisterStatus.NOTRUN, mock.ANY, 0, None diff --git a/scripts/tests/twister_blackbox/test_runner.py b/scripts/tests/twister_blackbox/test_runner.py index 6a6645bb5d869d..0ace7fb05157bd 100644 --- a/scripts/tests/twister_blackbox/test_runner.py +++ b/scripts/tests/twister_blackbox/test_runner.py @@ -73,7 +73,7 @@ class TestRunner: os.path.join(TEST_DATA, 'tests', 'dummy', 'agnostic'), ['qemu_x86', 'qemu_x86_64'], { - 'passed_configurations': 6, + 'passed_configurations': 0, 'selected_test_instances': 6, 'executed_on_platform': 0, 'only_built': 6, From 952daca6952f68d32a3ed4fa77ca09bbfaf99fad Mon Sep 17 00:00:00 2001 From: Ryan McClelland Date: Fri, 1 Nov 2024 15:52:39 -0700 Subject: [PATCH 042/113] debug: symtab: fix ignored type qualifiers on func return type const is ignored on the function return type. A warning is reported with -Wignored-qualifers. Remove the ignored const. Signed-off-by: Ryan McClelland --- include/zephyr/debug/symtab.h | 4 ++-- subsys/debug/symtab/symtab.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/zephyr/debug/symtab.h b/include/zephyr/debug/symtab.h index ba4e8c572c8a06..19afb5947b892c 100644 --- a/include/zephyr/debug/symtab.h +++ b/include/zephyr/debug/symtab.h @@ -46,7 +46,7 @@ struct symtab_info { * * @return Pointer to the symbol table. */ -const struct symtab_info *const symtab_get(void); +const struct symtab_info *symtab_get(void); /** * @brief Find the symbol name with a binary search @@ -57,7 +57,7 @@ const struct symtab_info *const symtab_get(void); * * @return Name of the nearest symbol if found, otherwise "?" is returned. */ -const char *const symtab_find_symbol_name(uintptr_t addr, uint32_t *offset); +const char *symtab_find_symbol_name(uintptr_t addr, uint32_t *offset); /** * @} diff --git a/subsys/debug/symtab/symtab.c b/subsys/debug/symtab/symtab.c index d82df0cd3c2b52..5cbe6005321902 100644 --- a/subsys/debug/symtab/symtab.c +++ b/subsys/debug/symtab/symtab.c @@ -10,14 +10,14 @@ #include #include -const struct symtab_info *const symtab_get(void) +const struct symtab_info *symtab_get(void) { extern const struct symtab_info z_symtab; return &z_symtab; } -const char *const symtab_find_symbol_name(uintptr_t addr, uint32_t *offset) +const char *symtab_find_symbol_name(uintptr_t addr, uint32_t *offset) { const struct symtab_info *const symtab = symtab_get(); const uint32_t symbol_offset = addr - symtab->first_addr; From 5106a0407e53191c67a920ae41ad0a2d40ff2eb4 Mon Sep 17 00:00:00 2001 From: Chaitanya Tata Date: Fri, 1 Nov 2024 21:03:32 +0530 Subject: [PATCH 043/113] boards: thingy53: Fix missing GPIOs Status and request GPIOs are missing from the edge connector, add those to fix Thingy53 + nRF7002EB build. Signed-off-by: Chaitanya Tata --- boards/nordic/thingy53/thingy53_nrf5340_cpunet.dts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/boards/nordic/thingy53/thingy53_nrf5340_cpunet.dts b/boards/nordic/thingy53/thingy53_nrf5340_cpunet.dts index aa4d4df909c477..3003d4924ce561 100644 --- a/boards/nordic/thingy53/thingy53_nrf5340_cpunet.dts +++ b/boards/nordic/thingy53/thingy53_nrf5340_cpunet.dts @@ -72,7 +72,9 @@ #gpio-cells = <2>; gpio-map-mask = <0xffffffff 0xffffffc0>; gpio-map-pass-thru = <0 0x3f>; - gpio-map = <8 0 &gpio0 5 0>, /* P8, P0.05/AIN1 */ + gpio-map = <5 0 &gpio1 1 0>, /* P5, P1.01/GRANT */ + <6 0 &gpio1 0 0>, /* P6, P1.00/REQ */ + <8 0 &gpio0 5 0>, /* P8, P0.05/AIN1 */ <9 0 &gpio0 4 0>, /* P9, P0.04/AIN0 */ <15 0 &gpio0 8 0>, /* P15, P0.08/TRACEDATA3 */ <16 0 &gpio0 9 0>, /* P16, P0.09/TRACEDATA2 */ From 130c5c00025995780f9ce430605f6c5bec2bed97 Mon Sep 17 00:00:00 2001 From: Maureen Helm Date: Wed, 16 Oct 2024 22:00:10 -0500 Subject: [PATCH 044/113] tests: zbus: publish_stats: Fix for non-zero boot delay Fixes the zbus publishing statistics test to account for a non-zero boot delay, which is often used in hardware testing environments. This fixes an assertion failure observed on multiple max32 boards in the adi board farm. Signed-off-by: Maureen Helm --- tests/subsys/zbus/publish_stats/src/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/subsys/zbus/publish_stats/src/main.c b/tests/subsys/zbus/publish_stats/src/main.c index 86143e707ac17c..b93bedfc120528 100644 --- a/tests/subsys/zbus/publish_stats/src/main.c +++ b/tests/subsys/zbus/publish_stats/src/main.c @@ -25,7 +25,7 @@ ZTEST(publish_stats, test_channel_metadata) zassert_equal(0, zbus_chan_pub_stats_avg_period(&chan)); /* Should be no different after a second of runtime */ - k_sleep(K_SECONDS(1)); + k_sleep(K_TIMEOUT_ABS_MS(1000)); zassert_equal(0, zbus_chan_pub_stats_count(&chan)); zassert_equal(0, zbus_chan_pub_stats_last_time(&chan)); zassert_equal(0, zbus_chan_pub_stats_avg_period(&chan)); From a597feafb8e50624ad7374b1e0111693bd5a30cb Mon Sep 17 00:00:00 2001 From: Robert Lubos Date: Mon, 4 Nov 2024 13:18:46 +0100 Subject: [PATCH 045/113] test: net: lib: prometheus: formatter: Fix test flakiness If a string is already present in the provided buffer, prometheus_format_exposition() appends it instead of overwriting, hence the buffer needs to be cleared on the test start, otherwise it works by chance. Signed-off-by: Robert Lubos --- tests/net/lib/prometheus/formatter/src/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/net/lib/prometheus/formatter/src/main.c b/tests/net/lib/prometheus/formatter/src/main.c index 12af8153cc6e82..f8170b99c19877 100644 --- a/tests/net/lib/prometheus/formatter/src/main.c +++ b/tests/net/lib/prometheus/formatter/src/main.c @@ -36,7 +36,7 @@ PROMETHEUS_COLLECTOR_DEFINE(test_custom_collector); ZTEST(test_formatter, test_prometheus_formatter_simple) { int ret; - char formatted[MAX_BUFFER_SIZE]; + char formatted[MAX_BUFFER_SIZE] = { 0 }; struct prometheus_counter *counter; char exposed[] = "# HELP test_counter Test counter\n" "# TYPE test_counter counter\n" From 97d6cd335cd60c9acb779769f62e66cd58329cfc Mon Sep 17 00:00:00 2001 From: Henrik Brix Andersen Date: Mon, 4 Nov 2024 14:59:25 +0100 Subject: [PATCH 046/113] scripts: check_maintainers: add scripts for checking GitHub accounts Add script for checking if maintainer and collaborator GitHub accounts exist. Signed-off-by: Henrik Brix Andersen --- scripts/check_maintainers.py | 71 ++++++++++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100755 scripts/check_maintainers.py diff --git a/scripts/check_maintainers.py b/scripts/check_maintainers.py new file mode 100755 index 00000000000000..8b393b0ec81ebf --- /dev/null +++ b/scripts/check_maintainers.py @@ -0,0 +1,71 @@ +#!/usr/bin/env python3 + +# Copyright (c) 2024 Vestas Wind Systems A/S +# +# SPDX-License-Identifier: Apache-2.0 + +import argparse +import sys + +from github_helpers import get_github_object +from get_maintainer import Maintainers +from github.GithubException import UnknownObjectException + +def parse_args(): + parser = argparse.ArgumentParser( + formatter_class=argparse.RawDescriptionHelpFormatter, + description=__doc__, allow_abbrev=False) + + parser.add_argument( + "-m", "--maintainers", + metavar="MAINTAINERS_FILE", + help="Maintainers file to load. If not specified, MAINTAINERS.yml in " + "the top-level repository directory is used, and must exist. " + "Paths in the maintainers file will always be taken as relative " + "to the top-level directory.") + + return parser.parse_args() + +def main() -> None: + args = parse_args() + zephyr_repo = get_github_object().get_repo('zephyrproject-rtos/zephyr') + maintainers = Maintainers(args.maintainers) + gh = get_github_object() + gh_users = [] + notfound = [] + noncollabs = [] + + for area in maintainers.areas.values(): + gh_users = list(set(gh_users + area.maintainers + area.collaborators)) + + gh_users.sort() + + print('Checking maintainer and collaborator user accounts on GitHub:') + for gh_user in gh_users: + try: + print('.', end='', flush=True) + gh.get_user(gh_user) + + if not zephyr_repo.has_in_collaborators(gh_user): + noncollabs.append(gh_user) + except UnknownObjectException: + notfound.append(gh_user) + print('\n') + + if notfound: + print('The following GitHub user accounts do not exist:') + print('\n'.join(notfound)) + else: + print('No non-existing user accounts found') + + if noncollabs: + print('The following GitHub user accounts are not collaborators:') + print('\n'.join(noncollabs)) + else: + print('No non-collaborator user accounts found') + + if notfound or noncollabs: + sys.exit(1) + +if __name__ == '__main__': + main() From c261bdf6fc395385420e584b4f60ae32b2c16880 Mon Sep 17 00:00:00 2001 From: Henrik Brix Andersen Date: Mon, 4 Nov 2024 15:07:41 +0100 Subject: [PATCH 047/113] MAINTAINERS: remove nonexistent GitHub user accounts Remove nonexistent GitHub user accounts as reported by the scripts/check_maintainers.py script. Signed-off-by: Henrik Brix Andersen --- MAINTAINERS.yml | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/MAINTAINERS.yml b/MAINTAINERS.yml index 02ba5ecbf974f6..4b905622b3b332 100644 --- a/MAINTAINERS.yml +++ b/MAINTAINERS.yml @@ -1586,9 +1586,7 @@ Release Notes: - drivers.i3c "Drivers: IEEE 802.15.4": - status: maintained - maintainers: - - fgrandel + status: odd fixes collaborators: - rlubos - ankuns @@ -2923,8 +2921,6 @@ Networking: status: maintained maintainers: - jukkar - collaborators: - - fgrandel files: - doc/connectivity/networking/api/gptp.rst - include/zephyr/net/gptp.h @@ -2996,9 +2992,7 @@ Networking: - sample.net.ptp "Networking: Native IEEE 802.15.4": - status: maintained - maintainers: - - fgrandel + status: odd fixes collaborators: - rlubos - jukkar From c86225384a12589a7fff5c8ccd6f47f24b13ca10 Mon Sep 17 00:00:00 2001 From: Chaitanya Tata Date: Mon, 4 Nov 2024 21:42:53 +0530 Subject: [PATCH 048/113] drivers: nrfwifi: Add a NULL check for FMAC context In case the driver UP fails, the FMAC context will be NULL, so, add a NULL check in the DOWN. Fixes a crash seen when working with unprogrammed OTP (no MAC) that fails the interface UP. Signed-off-by: Chaitanya Tata --- drivers/wifi/nrfwifi/src/net_if.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/wifi/nrfwifi/src/net_if.c b/drivers/wifi/nrfwifi/src/net_if.c index a4404cfb1a7a11..1a8b0c7361af4c 100644 --- a/drivers/wifi/nrfwifi/src/net_if.c +++ b/drivers/wifi/nrfwifi/src/net_if.c @@ -877,7 +877,7 @@ int nrf_wifi_if_stop_zep(const struct device *dev) } rpu_ctx_zep = vif_ctx_zep->rpu_ctx_zep; - if (!rpu_ctx_zep) { + if (!rpu_ctx_zep || !rpu_ctx_zep->rpu_ctx) { LOG_ERR("%s: rpu_ctx_zep is NULL", __func__); goto unlock; From ae077b947558f3dc8dbc6872414e5096400fcdec Mon Sep 17 00:00:00 2001 From: Chaitanya Tata Date: Mon, 4 Nov 2024 21:47:06 +0530 Subject: [PATCH 049/113] manifest: hal_nordic: Pull logging level fix Fix the noise during boot. Signed-off-by: Chaitanya Tata --- west.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/west.yml b/west.yml index 5a6a4d46dcce5d..f6c0a3b09f3809 100644 --- a/west.yml +++ b/west.yml @@ -188,7 +188,7 @@ manifest: groups: - hal - name: hal_nordic - revision: cb7600a1be4c8b177867e6d463729c07dd3f6d73 + revision: 2d78179cc4f0601a891553132b13184fa51b6ef9 path: modules/hal/nordic groups: - hal From 9705fc06b481a95c4fdc426a03e07b77f20ed943 Mon Sep 17 00:00:00 2001 From: Chaitanya Tata Date: Tue, 5 Nov 2024 02:52:17 +0530 Subject: [PATCH 050/113] [nrf fromlist] drivers: nrfwifi: Fix CSUM support With introduction of Raw modes, nRF70 driver now advertises get_c onfig OP, but doesn't implement all types. This causes problems two-fold with checksum calculations: 1. The "config" isn't uninitialized, so, every call returns differnet values. So, for UDP header checksum would be done and pkt->chksumdone would be set. But for IPv4 header checksum might be skipped. 2. Even if we initialize to zero, then network stack gets all zeros and calculates checksum by itself rendering offload moot. There is another problem in #1, as there is only single flag for pkt for all checksum, nRF70 driver sees this and tells UMAC to skip checksum for the entire packet. The design isn't coherent, and should be converted to communicate per-type checksum status (some are filled by network stack and some HW). But as nRF70 support all checksum offloads, advertise all types for both RX and TX. Upstream PR #: 80882 Signed-off-by: Chaitanya Tata --- drivers/wifi/nrfwifi/src/net_if.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/drivers/wifi/nrfwifi/src/net_if.c b/drivers/wifi/nrfwifi/src/net_if.c index 1a8b0c7361af4c..19b232b6fe347a 100644 --- a/drivers/wifi/nrfwifi/src/net_if.c +++ b/drivers/wifi/nrfwifi/src/net_if.c @@ -980,10 +980,23 @@ int nrf_wifi_if_get_config_zep(const struct device *dev, goto unlock; } + memset(config, 0, sizeof(struct ethernet_config)); + if (type == ETHERNET_CONFIG_TYPE_TXINJECTION_MODE) { config->txinjection_mode = def_dev_ctx->vif_ctx[vif_ctx_zep->vif_idx]->txinjection_mode; } +#ifdef CONFIG_NRF70_TCP_IP_CHECKSUM_OFFLOAD + if (type == ETHERNET_CONFIG_TYPE_TX_CHECKSUM_SUPPORT || + type == ETHERNET_CONFIG_TYPE_RX_CHECKSUM_SUPPORT) { + config->chksum_support = ETHERNET_CHECKSUM_SUPPORT_IPV4_HEADER | + ETHERNET_CHECKSUM_SUPPORT_IPV4_ICMP | + ETHERNET_CHECKSUM_SUPPORT_IPV6_HEADER | + ETHERNET_CHECKSUM_SUPPORT_IPV6_ICMP | + ETHERNET_CHECKSUM_SUPPORT_TCP | + ETHERNET_CHECKSUM_SUPPORT_UDP; + } +#endif ret = 0; unlock: k_mutex_unlock(&vif_ctx_zep->vif_lock); From 47562485e4ebe0554ac2bbb6b4386702126b0fa5 Mon Sep 17 00:00:00 2001 From: Johan Hedberg Date: Mon, 4 Nov 2024 10:18:16 +0200 Subject: [PATCH 051/113] MAINTAINERS: Fix issues with Bluetooth HCI section The primary header file was missing, and one of the labels was wrong. Signed-off-by: Johan Hedberg --- MAINTAINERS.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/MAINTAINERS.yml b/MAINTAINERS.yml index 4b905622b3b332..3e60959ea1653f 100644 --- a/MAINTAINERS.yml +++ b/MAINTAINERS.yml @@ -314,12 +314,13 @@ Bluetooth HCI: - HoZHel files: - include/zephyr/drivers/bluetooth/ + - include/zephyr/drivers/bluetooth.h - drivers/bluetooth/ - samples/bluetooth/hci_*/ - tests/bsim/bluetooth/hci_uart/ - dts/bindings/bluetooth/ labels: - - "area: Bluetooth Host" + - "area: Bluetooth HCI" - "area: Bluetooth" tests: - bluetooth From 9bdb71fe558183ba0fa892e4d11af488cf9e3a34 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Mon, 4 Nov 2024 13:43:41 +0100 Subject: [PATCH 052/113] tests: subsys: dfu: img_util: Increase stack size MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix a problem with the test that manifested itself with a surprising assertion failure at lib/utils/onoff.c:283. Apparently, due to the stack being too small, some memory got accidentally overwritten. Signed-off-by: Andrzej Głąbek --- tests/subsys/dfu/img_util/prj.conf | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/subsys/dfu/img_util/prj.conf b/tests/subsys/dfu/img_util/prj.conf index 6beb6b102a09c0..4f0bc092cefeb6 100644 --- a/tests/subsys/dfu/img_util/prj.conf +++ b/tests/subsys/dfu/img_util/prj.conf @@ -7,3 +7,4 @@ CONFIG_IMG_MANAGER=y CONFIG_IMG_ENABLE_IMAGE_CHECK=y CONFIG_MCUBOOT_IMG_MANAGER=y CONFIG_IMG_BLOCK_BUF_SIZE=512 +CONFIG_ZTEST_STACK_SIZE=1536 From c0a84524cd16cdb3c4dd95ace36113739f75828e Mon Sep 17 00:00:00 2001 From: Chaitanya Tata Date: Sat, 2 Nov 2024 17:14:23 +0530 Subject: [PATCH 053/113] drivers: nrfwifi: Fix the undefined macro usage This works because undefined macro in conditional is treated as zero, but could end up choosing the wrong divider. Fix the macro with the new name. Signed-off-by: Chaitanya Tata --- drivers/wifi/nrfwifi/src/qspi/src/qspi_if.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/wifi/nrfwifi/src/qspi/src/qspi_if.c b/drivers/wifi/nrfwifi/src/qspi/src/qspi_if.c index 26d9249248cb7f..46c92def8f7e02 100644 --- a/drivers/wifi/nrfwifi/src/qspi/src/qspi_if.c +++ b/drivers/wifi/nrfwifi/src/qspi/src/qspi_if.c @@ -85,7 +85,7 @@ BUILD_ASSERT(QSPI_IF_DEVICE_FREQUENCY >= (NRF_QSPI_BASE_CLOCK_FREQ / 16), * PCLK192M frequency"), but after that operation is complete, the default * divider needs to be restored to avoid increased current consumption. */ -#if (INST_0_SCK_FREQUENCY >= NRF_QSPI_BASE_CLOCK_FREQ) +#if (QSPI_IF_DEVICE_FREQUENCY >= NRF_QSPI_BASE_CLOCK_FREQ) /* For requested SCK >= 96 MHz, use HFCLK192M / 1 / (2*1) = 96 MHz */ #define BASE_CLOCK_DIV NRF_CLOCK_HFCLK_DIV_1 #define INST_0_SCK_CFG NRF_QSPI_FREQ_DIV1 @@ -93,12 +93,12 @@ BUILD_ASSERT(QSPI_IF_DEVICE_FREQUENCY >= (NRF_QSPI_BASE_CLOCK_FREQ / 16), #elif NRF53_ERRATA_159_ENABLE_WORKAROUND #define BASE_CLOCK_DIV NRF_CLOCK_HFCLK_DIV_1 #define INST_0_SCK_CFG (DIV_ROUND_UP(NRF_QSPI_BASE_CLOCK_FREQ, \ - INST_0_SCK_FREQUENCY) - 1) -#elif (INST_0_SCK_FREQUENCY >= (NRF_QSPI_BASE_CLOCK_FREQ / 2)) + QSPI_IF_DEVICE_FREQUENCY) - 1) +#elif (QSPI_IF_DEVICE_FREQUENCY >= (NRF_QSPI_BASE_CLOCK_FREQ / 2)) /* For 96 MHz > SCK >= 48 MHz, use HFCLK192M / 2 / (2*1) = 48 MHz */ #define BASE_CLOCK_DIV NRF_CLOCK_HFCLK_DIV_2 #define INST_0_SCK_CFG NRF_QSPI_FREQ_DIV1 -#elif (INST_0_SCK_FREQUENCY >= (NRF_QSPI_BASE_CLOCK_FREQ / 3)) +#elif (QSPI_IF_DEVICE_FREQUENCY >= (NRF_QSPI_BASE_CLOCK_FREQ / 3)) /* For 48 MHz > SCK >= 32 MHz, use HFCLK192M / 1 / (2*3) = 32 MHz */ #define BASE_CLOCK_DIV NRF_CLOCK_HFCLK_DIV_1 #define INST_0_SCK_CFG NRF_QSPI_FREQ_DIV3 From 75bc16f0a2a2e0563480b475d7e4ab3afc71eca9 Mon Sep 17 00:00:00 2001 From: Thao Luong Date: Fri, 1 Nov 2024 00:06:53 +0700 Subject: [PATCH 054/113] boards: renesas: Remove CONFIG_PINCTRL for RA boards Remove CONFIG_PINCTRL from defconfig files of RA boards Signed-off-by: Thao Luong --- boards/renesas/ek_ra2a1/ek_ra2a1_defconfig | 1 - boards/renesas/ek_ra4e2/ek_ra4e2_defconfig | 1 - boards/renesas/ek_ra4m2/ek_ra4m2_defconfig | 1 - boards/renesas/ek_ra4m3/ek_ra4m3_defconfig | 1 - boards/renesas/ek_ra4w1/ek_ra4w1_defconfig | 1 - boards/renesas/ek_ra6e2/ek_ra6e2_defconfig | 1 - boards/renesas/ek_ra6m1/ek_ra6m1_defconfig | 1 - boards/renesas/ek_ra6m2/ek_ra6m2_defconfig | 1 - boards/renesas/ek_ra6m3/ek_ra6m3_defconfig | 1 - boards/renesas/ek_ra6m4/ek_ra6m4_defconfig | 1 - boards/renesas/ek_ra6m5/ek_ra6m5_defconfig | 1 - boards/renesas/ek_ra8d1/ek_ra8d1_defconfig | 1 - boards/renesas/ek_ra8m1/ek_ra8m1_defconfig | 1 - boards/renesas/fpb_ra6e1/fpb_ra6e1_defconfig | 1 - boards/renesas/fpb_ra6e2/fpb_ra6e2_defconfig | 1 - boards/renesas/mck_ra8t1/mck_ra8t1_defconfig | 1 - 16 files changed, 16 deletions(-) diff --git a/boards/renesas/ek_ra2a1/ek_ra2a1_defconfig b/boards/renesas/ek_ra2a1/ek_ra2a1_defconfig index 6058aa5eb98c92..325e7c85ca21a5 100644 --- a/boards/renesas/ek_ra2a1/ek_ra2a1_defconfig +++ b/boards/renesas/ek_ra2a1/ek_ra2a1_defconfig @@ -5,7 +5,6 @@ CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC=48000000 # Enable GPIO CONFIG_GPIO=y -CONFIG_PINCTRL=y # Enable Console CONFIG_SERIAL=y diff --git a/boards/renesas/ek_ra4e2/ek_ra4e2_defconfig b/boards/renesas/ek_ra4e2/ek_ra4e2_defconfig index ceaa9b32580a3c..091058ed2aca25 100644 --- a/boards/renesas/ek_ra4e2/ek_ra4e2_defconfig +++ b/boards/renesas/ek_ra4e2/ek_ra4e2_defconfig @@ -5,7 +5,6 @@ CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC=100000000 # Enable GPIO CONFIG_GPIO=y -CONFIG_PINCTRL=y # Enable Console CONFIG_SERIAL=y diff --git a/boards/renesas/ek_ra4m2/ek_ra4m2_defconfig b/boards/renesas/ek_ra4m2/ek_ra4m2_defconfig index ceaa9b32580a3c..091058ed2aca25 100644 --- a/boards/renesas/ek_ra4m2/ek_ra4m2_defconfig +++ b/boards/renesas/ek_ra4m2/ek_ra4m2_defconfig @@ -5,7 +5,6 @@ CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC=100000000 # Enable GPIO CONFIG_GPIO=y -CONFIG_PINCTRL=y # Enable Console CONFIG_SERIAL=y diff --git a/boards/renesas/ek_ra4m3/ek_ra4m3_defconfig b/boards/renesas/ek_ra4m3/ek_ra4m3_defconfig index ceaa9b32580a3c..091058ed2aca25 100644 --- a/boards/renesas/ek_ra4m3/ek_ra4m3_defconfig +++ b/boards/renesas/ek_ra4m3/ek_ra4m3_defconfig @@ -5,7 +5,6 @@ CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC=100000000 # Enable GPIO CONFIG_GPIO=y -CONFIG_PINCTRL=y # Enable Console CONFIG_SERIAL=y diff --git a/boards/renesas/ek_ra4w1/ek_ra4w1_defconfig b/boards/renesas/ek_ra4w1/ek_ra4w1_defconfig index 92542b8ab9c11b..3b4854b85b7c21 100644 --- a/boards/renesas/ek_ra4w1/ek_ra4w1_defconfig +++ b/boards/renesas/ek_ra4w1/ek_ra4w1_defconfig @@ -5,7 +5,6 @@ CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC=32000000 # Enable GPIO CONFIG_GPIO=y -CONFIG_PINCTRL=y # Enable Console CONFIG_SERIAL=y diff --git a/boards/renesas/ek_ra6e2/ek_ra6e2_defconfig b/boards/renesas/ek_ra6e2/ek_ra6e2_defconfig index 92bb425cfa8bb5..956d3f6d6505ce 100644 --- a/boards/renesas/ek_ra6e2/ek_ra6e2_defconfig +++ b/boards/renesas/ek_ra6e2/ek_ra6e2_defconfig @@ -5,7 +5,6 @@ CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC=200000000 # Enable GPIO CONFIG_GPIO=y -CONFIG_PINCTRL=y # Enable Console CONFIG_SERIAL=y diff --git a/boards/renesas/ek_ra6m1/ek_ra6m1_defconfig b/boards/renesas/ek_ra6m1/ek_ra6m1_defconfig index 00adc77146e5e8..f252ad1bf25e5e 100644 --- a/boards/renesas/ek_ra6m1/ek_ra6m1_defconfig +++ b/boards/renesas/ek_ra6m1/ek_ra6m1_defconfig @@ -5,7 +5,6 @@ CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC=120000000 # Enable GPIO CONFIG_GPIO=y -CONFIG_PINCTRL=y CONFIG_BUILD_OUTPUT_HEX=y CONFIG_BUILD_NO_GAP_FILL=y diff --git a/boards/renesas/ek_ra6m2/ek_ra6m2_defconfig b/boards/renesas/ek_ra6m2/ek_ra6m2_defconfig index 00adc77146e5e8..f252ad1bf25e5e 100644 --- a/boards/renesas/ek_ra6m2/ek_ra6m2_defconfig +++ b/boards/renesas/ek_ra6m2/ek_ra6m2_defconfig @@ -5,7 +5,6 @@ CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC=120000000 # Enable GPIO CONFIG_GPIO=y -CONFIG_PINCTRL=y CONFIG_BUILD_OUTPUT_HEX=y CONFIG_BUILD_NO_GAP_FILL=y diff --git a/boards/renesas/ek_ra6m3/ek_ra6m3_defconfig b/boards/renesas/ek_ra6m3/ek_ra6m3_defconfig index 31c2fa759e4811..82698fecf6237b 100644 --- a/boards/renesas/ek_ra6m3/ek_ra6m3_defconfig +++ b/boards/renesas/ek_ra6m3/ek_ra6m3_defconfig @@ -5,7 +5,6 @@ CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC=120000000 # Enable GPIO CONFIG_GPIO=y -CONFIG_PINCTRL=y # Enable Console CONFIG_SERIAL=y diff --git a/boards/renesas/ek_ra6m4/ek_ra6m4_defconfig b/boards/renesas/ek_ra6m4/ek_ra6m4_defconfig index 45a5a73366a558..7cdc7f0680aecc 100644 --- a/boards/renesas/ek_ra6m4/ek_ra6m4_defconfig +++ b/boards/renesas/ek_ra6m4/ek_ra6m4_defconfig @@ -5,7 +5,6 @@ CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC=200000000 # Enable GPIO CONFIG_GPIO=y -CONFIG_PINCTRL=y # Enable Console CONFIG_SERIAL=y diff --git a/boards/renesas/ek_ra6m5/ek_ra6m5_defconfig b/boards/renesas/ek_ra6m5/ek_ra6m5_defconfig index 4b5534eb1ff122..80c741f62fb3ff 100644 --- a/boards/renesas/ek_ra6m5/ek_ra6m5_defconfig +++ b/boards/renesas/ek_ra6m5/ek_ra6m5_defconfig @@ -5,7 +5,6 @@ CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC=200000000 # Enable GPIO CONFIG_GPIO=y -CONFIG_PINCTRL=y CONFIG_BUILD_OUTPUT_HEX=y CONFIG_BUILD_NO_GAP_FILL=y diff --git a/boards/renesas/ek_ra8d1/ek_ra8d1_defconfig b/boards/renesas/ek_ra8d1/ek_ra8d1_defconfig index 02195f347f9c1c..ee29549b28c80c 100644 --- a/boards/renesas/ek_ra8d1/ek_ra8d1_defconfig +++ b/boards/renesas/ek_ra8d1/ek_ra8d1_defconfig @@ -5,7 +5,6 @@ CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC=480000000 # Enable GPIO CONFIG_GPIO=y -CONFIG_PINCTRL=y # Enable Console CONFIG_SERIAL=y diff --git a/boards/renesas/ek_ra8m1/ek_ra8m1_defconfig b/boards/renesas/ek_ra8m1/ek_ra8m1_defconfig index d68962b8c92e91..7fd87eb217c231 100644 --- a/boards/renesas/ek_ra8m1/ek_ra8m1_defconfig +++ b/boards/renesas/ek_ra8m1/ek_ra8m1_defconfig @@ -5,7 +5,6 @@ CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC=480000000 # Enable GPIO CONFIG_GPIO=y -CONFIG_PINCTRL=y # Enable Console CONFIG_SERIAL=y diff --git a/boards/renesas/fpb_ra6e1/fpb_ra6e1_defconfig b/boards/renesas/fpb_ra6e1/fpb_ra6e1_defconfig index fa7ef716d3f62c..8733fd3cdc7cd8 100644 --- a/boards/renesas/fpb_ra6e1/fpb_ra6e1_defconfig +++ b/boards/renesas/fpb_ra6e1/fpb_ra6e1_defconfig @@ -5,7 +5,6 @@ CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC=200000000 # Enable GPIO CONFIG_GPIO=y -CONFIG_PINCTRL=y CONFIG_BUILD_OUTPUT_HEX=y CONFIG_BUILD_NO_GAP_FILL=y diff --git a/boards/renesas/fpb_ra6e2/fpb_ra6e2_defconfig b/boards/renesas/fpb_ra6e2/fpb_ra6e2_defconfig index 92bb425cfa8bb5..956d3f6d6505ce 100644 --- a/boards/renesas/fpb_ra6e2/fpb_ra6e2_defconfig +++ b/boards/renesas/fpb_ra6e2/fpb_ra6e2_defconfig @@ -5,7 +5,6 @@ CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC=200000000 # Enable GPIO CONFIG_GPIO=y -CONFIG_PINCTRL=y # Enable Console CONFIG_SERIAL=y diff --git a/boards/renesas/mck_ra8t1/mck_ra8t1_defconfig b/boards/renesas/mck_ra8t1/mck_ra8t1_defconfig index 5cd13d146bfb5c..3a064b9d95877f 100644 --- a/boards/renesas/mck_ra8t1/mck_ra8t1_defconfig +++ b/boards/renesas/mck_ra8t1/mck_ra8t1_defconfig @@ -5,7 +5,6 @@ CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC=480000000 # Enable GPIO CONFIG_GPIO=y -CONFIG_PINCTRL=y # Enable Console CONFIG_SERIAL=y From 56326e4677767994513f8134a1292ca9c1f91c82 Mon Sep 17 00:00:00 2001 From: Thao Luong Date: Fri, 1 Nov 2024 00:09:09 +0700 Subject: [PATCH 055/113] soc: renesas: ra: Remove CONFIG_PINCTRL Remove CONFIG_PINCTRL from ra defconfig files Signed-off-by: Thao Luong --- soc/renesas/ra/ra2a1/Kconfig.defconfig | 3 --- soc/renesas/ra/ra4e2/Kconfig.defconfig | 3 --- soc/renesas/ra/ra4m2/Kconfig.defconfig | 3 --- soc/renesas/ra/ra4m3/Kconfig.defconfig | 3 --- soc/renesas/ra/ra4w1/Kconfig.defconfig | 3 --- soc/renesas/ra/ra6e1/Kconfig.defconfig | 3 --- soc/renesas/ra/ra6e2/Kconfig.defconfig | 3 --- soc/renesas/ra/ra6m1/Kconfig.defconfig | 3 --- soc/renesas/ra/ra6m2/Kconfig.defconfig | 3 --- soc/renesas/ra/ra6m3/Kconfig.defconfig | 3 --- soc/renesas/ra/ra6m4/Kconfig.defconfig | 3 --- soc/renesas/ra/ra6m5/Kconfig.defconfig | 3 --- soc/renesas/ra/ra8d1/Kconfig.defconfig | 3 --- soc/renesas/ra/ra8m1/Kconfig.defconfig | 3 --- soc/renesas/ra/ra8t1/Kconfig.defconfig | 3 --- 15 files changed, 45 deletions(-) diff --git a/soc/renesas/ra/ra2a1/Kconfig.defconfig b/soc/renesas/ra/ra2a1/Kconfig.defconfig index 33a1effb92b6b2..7176e95746acba 100644 --- a/soc/renesas/ra/ra2a1/Kconfig.defconfig +++ b/soc/renesas/ra/ra2a1/Kconfig.defconfig @@ -6,7 +6,4 @@ if SOC_SERIES_RA2A1 config NUM_IRQS default 32 -config PINCTRL - default y - endif # SOC_SERIES_RA2A1 diff --git a/soc/renesas/ra/ra4e2/Kconfig.defconfig b/soc/renesas/ra/ra4e2/Kconfig.defconfig index 985e17502d705d..c19cc52a7f7f48 100644 --- a/soc/renesas/ra/ra4e2/Kconfig.defconfig +++ b/soc/renesas/ra/ra4e2/Kconfig.defconfig @@ -6,7 +6,4 @@ if SOC_SERIES_RA4E2 config NUM_IRQS default 96 -config PINCTRL - default y - endif # SOC_SERIES_RA4E2 diff --git a/soc/renesas/ra/ra4m2/Kconfig.defconfig b/soc/renesas/ra/ra4m2/Kconfig.defconfig index 4d0b12330b0c55..27a3e35097d890 100644 --- a/soc/renesas/ra/ra4m2/Kconfig.defconfig +++ b/soc/renesas/ra/ra4m2/Kconfig.defconfig @@ -6,7 +6,4 @@ if SOC_SERIES_RA4M2 config NUM_IRQS default 96 -config PINCTRL - default y - endif # SOC_SERIES_RA4M2 diff --git a/soc/renesas/ra/ra4m3/Kconfig.defconfig b/soc/renesas/ra/ra4m3/Kconfig.defconfig index a93ed41ee240f9..974ba532beec0d 100644 --- a/soc/renesas/ra/ra4m3/Kconfig.defconfig +++ b/soc/renesas/ra/ra4m3/Kconfig.defconfig @@ -6,7 +6,4 @@ if SOC_SERIES_RA4M3 config NUM_IRQS default 96 -config PINCTRL - default y - endif # SOC_SERIES_RA4M3 diff --git a/soc/renesas/ra/ra4w1/Kconfig.defconfig b/soc/renesas/ra/ra4w1/Kconfig.defconfig index c73bab8b0975fb..56c1866d0e96bb 100644 --- a/soc/renesas/ra/ra4w1/Kconfig.defconfig +++ b/soc/renesas/ra/ra4w1/Kconfig.defconfig @@ -6,7 +6,4 @@ if SOC_SERIES_RA4W1 config NUM_IRQS default 32 -config PINCTRL - default y - endif # SOC_SERIES_RA4W1 diff --git a/soc/renesas/ra/ra6e1/Kconfig.defconfig b/soc/renesas/ra/ra6e1/Kconfig.defconfig index 07ec796a33fb2a..dfdaec67bf4565 100644 --- a/soc/renesas/ra/ra6e1/Kconfig.defconfig +++ b/soc/renesas/ra/ra6e1/Kconfig.defconfig @@ -6,7 +6,4 @@ if SOC_SERIES_RA6E1 config NUM_IRQS default 96 -config PINCTRL - default y - endif # SOC_SERIES_RA6E1 diff --git a/soc/renesas/ra/ra6e2/Kconfig.defconfig b/soc/renesas/ra/ra6e2/Kconfig.defconfig index e08fb2e13563d1..25c013dd855297 100644 --- a/soc/renesas/ra/ra6e2/Kconfig.defconfig +++ b/soc/renesas/ra/ra6e2/Kconfig.defconfig @@ -6,7 +6,4 @@ if SOC_SERIES_RA6E2 config NUM_IRQS default 96 -config PINCTRL - default y - endif # SOC_SERIES_RA6E2 diff --git a/soc/renesas/ra/ra6m1/Kconfig.defconfig b/soc/renesas/ra/ra6m1/Kconfig.defconfig index 4f61b475869584..af401ae242cd0b 100644 --- a/soc/renesas/ra/ra6m1/Kconfig.defconfig +++ b/soc/renesas/ra/ra6m1/Kconfig.defconfig @@ -6,7 +6,4 @@ if SOC_SERIES_RA6M1 config NUM_IRQS default 96 -config PINCTRL - default y - endif # SOC_SERIES_RA6M1 diff --git a/soc/renesas/ra/ra6m2/Kconfig.defconfig b/soc/renesas/ra/ra6m2/Kconfig.defconfig index 33ada2c756e896..c95ecd0cc2928a 100644 --- a/soc/renesas/ra/ra6m2/Kconfig.defconfig +++ b/soc/renesas/ra/ra6m2/Kconfig.defconfig @@ -6,7 +6,4 @@ if SOC_SERIES_RA6M2 config NUM_IRQS default 96 -config PINCTRL - default y - endif # SOC_SERIES_RA6M2 diff --git a/soc/renesas/ra/ra6m3/Kconfig.defconfig b/soc/renesas/ra/ra6m3/Kconfig.defconfig index f1d9a2998d3e4e..e2a02946b38494 100644 --- a/soc/renesas/ra/ra6m3/Kconfig.defconfig +++ b/soc/renesas/ra/ra6m3/Kconfig.defconfig @@ -6,7 +6,4 @@ if SOC_SERIES_RA6M3 config NUM_IRQS default 96 -config PINCTRL - default y - endif # SOC_SERIES_RA6M3 diff --git a/soc/renesas/ra/ra6m4/Kconfig.defconfig b/soc/renesas/ra/ra6m4/Kconfig.defconfig index 672c88d9aa3b2c..aa79e91370a742 100644 --- a/soc/renesas/ra/ra6m4/Kconfig.defconfig +++ b/soc/renesas/ra/ra6m4/Kconfig.defconfig @@ -6,7 +6,4 @@ if SOC_SERIES_RA6M4 config NUM_IRQS default 96 -config PINCTRL - default y - endif # SOC_SERIES_RA6M4 diff --git a/soc/renesas/ra/ra6m5/Kconfig.defconfig b/soc/renesas/ra/ra6m5/Kconfig.defconfig index ca09319ed2a0cc..d0c5c5fc0c3c43 100644 --- a/soc/renesas/ra/ra6m5/Kconfig.defconfig +++ b/soc/renesas/ra/ra6m5/Kconfig.defconfig @@ -6,7 +6,4 @@ if SOC_SERIES_RA6M5 config NUM_IRQS default 96 -config PINCTRL - default y - endif # SOC_SERIES_RA6M5 diff --git a/soc/renesas/ra/ra8d1/Kconfig.defconfig b/soc/renesas/ra/ra8d1/Kconfig.defconfig index 4ff5330ac5a299..5c2a630bfd75d6 100644 --- a/soc/renesas/ra/ra8d1/Kconfig.defconfig +++ b/soc/renesas/ra/ra8d1/Kconfig.defconfig @@ -6,9 +6,6 @@ if SOC_SERIES_RA8D1 config NUM_IRQS default 96 -config PINCTRL - default y - # Set to the minimal size of data which can be written. config FLASH_FILL_BUFFER_SIZE default 128 diff --git a/soc/renesas/ra/ra8m1/Kconfig.defconfig b/soc/renesas/ra/ra8m1/Kconfig.defconfig index 426625e029589d..d963468bb07e33 100644 --- a/soc/renesas/ra/ra8m1/Kconfig.defconfig +++ b/soc/renesas/ra/ra8m1/Kconfig.defconfig @@ -6,9 +6,6 @@ if SOC_SERIES_RA8M1 config NUM_IRQS default 96 -config PINCTRL - default y - # Set to the minimal size of data which can be written. config FLASH_FILL_BUFFER_SIZE default 128 diff --git a/soc/renesas/ra/ra8t1/Kconfig.defconfig b/soc/renesas/ra/ra8t1/Kconfig.defconfig index 1cd1578e621428..3e721bd8fc3ac1 100644 --- a/soc/renesas/ra/ra8t1/Kconfig.defconfig +++ b/soc/renesas/ra/ra8t1/Kconfig.defconfig @@ -6,9 +6,6 @@ if SOC_SERIES_RA8T1 config NUM_IRQS default 96 -config PINCTRL - default y - # Set to the minimal size of data which can be written. config FLASH_FILL_BUFFER_SIZE default 128 From c66dcd52db81c3f39c779d00d4f86896cde8d3d3 Mon Sep 17 00:00:00 2001 From: Thao Luong Date: Fri, 1 Nov 2024 00:12:12 +0700 Subject: [PATCH 056/113] drivers: Select PINCTRL for renesas RA drivers Select PINCTRL for drivers: adc, i2c, pwm, serial and spi Signed-off-by: Thao Luong --- drivers/adc/Kconfig.renesas_ra | 1 + drivers/i2c/Kconfig.renesas_ra | 1 + drivers/pwm/Kconfig.renesas_ra8 | 1 + drivers/serial/Kconfig.renesas_ra8 | 1 + drivers/spi/Kconfig.renesas_ra8 | 1 + 5 files changed, 5 insertions(+) diff --git a/drivers/adc/Kconfig.renesas_ra b/drivers/adc/Kconfig.renesas_ra index 1027788f9c6139..b63050b7f5353d 100644 --- a/drivers/adc/Kconfig.renesas_ra +++ b/drivers/adc/Kconfig.renesas_ra @@ -8,5 +8,6 @@ config ADC_RENESAS_RA default y depends on DT_HAS_RENESAS_RA_ADC_ENABLED select USE_RA_FSP_ADC + select PINCTRL help Enable Renesas RA ADC Driver. diff --git a/drivers/i2c/Kconfig.renesas_ra b/drivers/i2c/Kconfig.renesas_ra index bf11f2d0728873..cf68b2a459767e 100644 --- a/drivers/i2c/Kconfig.renesas_ra +++ b/drivers/i2c/Kconfig.renesas_ra @@ -8,5 +8,6 @@ config RENESAS_RA_I2C_IIC default y depends on DT_HAS_RENESAS_RA_IIC_ENABLED select USE_RA_FSP_I2C_IIC + select PINCTRL help Enable Renesas RA I2C IIC Driver. diff --git a/drivers/pwm/Kconfig.renesas_ra8 b/drivers/pwm/Kconfig.renesas_ra8 index 31701a132ce9e5..b44a1bc971180e 100644 --- a/drivers/pwm/Kconfig.renesas_ra8 +++ b/drivers/pwm/Kconfig.renesas_ra8 @@ -6,5 +6,6 @@ config PWM_RENESAS_RA8 default y depends on DT_HAS_RENESAS_RA8_PWM_ENABLED select USE_RA_FSP_GPT + select PINCTRL help Enable Renesas RA8 PWM Driver. diff --git a/drivers/serial/Kconfig.renesas_ra8 b/drivers/serial/Kconfig.renesas_ra8 index a3752695f5ef28..c95018f41bba3e 100644 --- a/drivers/serial/Kconfig.renesas_ra8 +++ b/drivers/serial/Kconfig.renesas_ra8 @@ -10,6 +10,7 @@ config UART_RA8_SCI_B select SERIAL_SUPPORT_ASYNC select USE_RA_FSP_SCI_B_UART select USE_RA_FSP_DTC if UART_ASYNC_API + select PINCTRL help Enable Renesas RA SCI_B UART Driver. diff --git a/drivers/spi/Kconfig.renesas_ra8 b/drivers/spi/Kconfig.renesas_ra8 index fe0512d049a22d..f2bf3a18fd30b5 100644 --- a/drivers/spi/Kconfig.renesas_ra8 +++ b/drivers/spi/Kconfig.renesas_ra8 @@ -8,6 +8,7 @@ config SPI_RENESAS_RA8 default y depends on DT_HAS_RENESAS_RA8_SPI_B_ENABLED select USE_RA_FSP_SPI_B + select PINCTRL help Enable Renesas RA RA SPI B Driver. From d33686fef703e216e810bbc49a8528db255aaa95 Mon Sep 17 00:00:00 2001 From: Luca Burelli Date: Fri, 25 Oct 2024 17:14:40 +0200 Subject: [PATCH 057/113] tests/subsys/llext: Remove llext.simple.readonly_fs_loader The fs_loader test is always executed in the main test source when CONFIG_FILE_SYSTEM is set, and this is in turn enabled by per-board config overlays. So there is no point in having a separate test case: it is simply a duplicate of the "readonly" test. Signed-off-by: Luca Burelli --- tests/subsys/llext/simple/testcase.yaml | 8 -------- 1 file changed, 8 deletions(-) diff --git a/tests/subsys/llext/simple/testcase.yaml b/tests/subsys/llext/simple/testcase.yaml index 334ad8bf4b3937..b3c06bca766e9e 100644 --- a/tests/subsys/llext/simple/testcase.yaml +++ b/tests/subsys/llext/simple/testcase.yaml @@ -48,14 +48,6 @@ tests: extra_configs: - CONFIG_USERSPACE=y - CONFIG_LLEXT_STORAGE_WRITABLE=n - llext.simple.readonly_fs_loader: - arch_allow: arm riscv # Xtensa needs writable storage - filter: not CONFIG_MPU and not CONFIG_MMU and not CONFIG_SOC_SERIES_S32ZE - extra_configs: - - arch:arm:CONFIG_ARM_MPU=n - - arch:arm:CONFIG_ARM_AARCH32_MMU=n - - arch:riscv:CONFIG_RISCV_PMP=n - - CONFIG_LLEXT_STORAGE_WRITABLE=n llext.simple.readonly_mmu: arch_allow: arm64 arm riscv filter: CONFIG_ARM_MMU From 184a2a65a2b9155194fd5145e85c67fd893aeb16 Mon Sep 17 00:00:00 2001 From: Luca Burelli Date: Wed, 30 Oct 2024 17:37:16 +0100 Subject: [PATCH 058/113] tests/subsys/llext: update filtering logic Restore Apollo boards now that the issue has been fixed. Also remove extra CONFIG_SOC_SERIES_S32ZE filters, as they are already covered by the 'platform_exclude' common section. Signed-off-by: Luca Burelli --- tests/subsys/llext/simple/testcase.yaml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/tests/subsys/llext/simple/testcase.yaml b/tests/subsys/llext/simple/testcase.yaml index b3c06bca766e9e..16948980f4a1e4 100644 --- a/tests/subsys/llext/simple/testcase.yaml +++ b/tests/subsys/llext/simple/testcase.yaml @@ -2,8 +2,6 @@ common: tags: llext platform_exclude: # platforms with active issues - - apollo4p_evb # See #73443 - - apollo4p_blue_kxr_evb # See #73443 - numaker_pfm_m487 # See #63167 - s32z2xxdc2/s32z270/rtu0 # See commit 18a0660 - s32z2xxdc2/s32z270/rtu1 # See commit 18a0660 @@ -35,7 +33,7 @@ tests: # subsystem (storage type, ELF type, MPU/MMU etc) llext.simple.readonly: arch_allow: arm riscv # Xtensa needs writable storage - filter: not CONFIG_MPU and not CONFIG_MMU and not CONFIG_SOC_SERIES_S32ZE + filter: not CONFIG_MPU and not CONFIG_MMU extra_configs: - arch:arm:CONFIG_ARM_MPU=n - arch:arm:CONFIG_ARM_AARCH32_MMU=n @@ -59,7 +57,7 @@ tests: arch_allow: arm xtensa riscv integration_platforms: - qemu_xtensa/dc233c # Xtensa ISA - filter: not CONFIG_MPU and not CONFIG_MMU and not CONFIG_SOC_SERIES_S32ZE + filter: not CONFIG_MPU and not CONFIG_MMU extra_configs: - arch:arm:CONFIG_ARM_MPU=n - arch:arm:CONFIG_ARM_AARCH32_MMU=n @@ -83,7 +81,7 @@ tests: arch_allow: arm xtensa riscv integration_platforms: - qemu_xtensa/dc233c # Xtensa ISA - filter: not CONFIG_MPU and not CONFIG_MMU and not CONFIG_SOC_SERIES_S32ZE + filter: not CONFIG_MPU and not CONFIG_MMU extra_configs: - arch:arm:CONFIG_ARM_MPU=n - arch:arm:CONFIG_ARM_AARCH32_MMU=n From 7427d1c85b49255440628b7d9546fffddf4cf037 Mon Sep 17 00:00:00 2001 From: Luca Burelli Date: Fri, 25 Oct 2024 17:35:26 +0200 Subject: [PATCH 059/113] tests/subsys/llext: cleanup memory protection options Most of the tests in the LLEXT subsystem test suite run with memory protection hardware (MPU/MMU) disabled, to avoid including memory domain issues while testing the core functionality. Only a few tests need to run with MPU/MMU enabled. This patch simplifies the testcase.yaml by setting the memory protection as disabled in a shared config file that is included by most tests. Signed-off-by: Luca Burelli --- .../llext/simple/no_mem_protection.conf | 8 ++++++ tests/subsys/llext/simple/prj.conf | 3 ++ tests/subsys/llext/simple/testcase.yaml | 28 ++++++++----------- 3 files changed, 22 insertions(+), 17 deletions(-) create mode 100644 tests/subsys/llext/simple/no_mem_protection.conf diff --git a/tests/subsys/llext/simple/no_mem_protection.conf b/tests/subsys/llext/simple/no_mem_protection.conf new file mode 100644 index 00000000000000..d45d7836d4d1fa --- /dev/null +++ b/tests/subsys/llext/simple/no_mem_protection.conf @@ -0,0 +1,8 @@ +# Disable MPU and MMU on all supported arches for the bulk of the tests. +# +# This uses the fact that setting an unknown symbol to 'n' has no effect, +# so it is safe to group different arch-specific settings here. +# +CONFIG_ARM_MPU=n +CONFIG_ARM_AARCH32_MMU=n +CONFIG_RISCV_PMP=n diff --git a/tests/subsys/llext/simple/prj.conf b/tests/subsys/llext/simple/prj.conf index d2733eb1dc34f2..33f3a0208e4605 100644 --- a/tests/subsys/llext/simple/prj.conf +++ b/tests/subsys/llext/simple/prj.conf @@ -7,3 +7,6 @@ CONFIG_LLEXT_EXPORT_DEVICES=y CONFIG_LLEXT_LOG_LEVEL_DBG=y CONFIG_APPLICATION_DEFINED_SYSCALL=y + +# The bulk of the tests run with MPU/MMU disabled by including additional +# configuration entries from no_mem_protection.conf. diff --git a/tests/subsys/llext/simple/testcase.yaml b/tests/subsys/llext/simple/testcase.yaml index 16948980f4a1e4..55139a274322dc 100644 --- a/tests/subsys/llext/simple/testcase.yaml +++ b/tests/subsys/llext/simple/testcase.yaml @@ -20,6 +20,8 @@ common: - mps2/an521/cpu0 # ARM Cortex-M33 (ARMv8-M ISA) extra_configs: - arch:arm64:CONFIG_LLEXT_HEAP_SIZE=128 + extra_conf_files: + - prj.conf tests: # While there is in practice no value in compiling subsys/llext/*.c @@ -29,15 +31,15 @@ tests: llext.simple.loader_build: build_only: true - # Run the suite with all combinations of core Kconfig options for the llext - # subsystem (storage type, ELF type, MPU/MMU etc) + # Run the suite with all combinations of core Kconfig options for the LLEXT + # subsystem (storage type, ELF type, MPU/MMU etc). To focus on LLEXT issues, + # most tests include no_mem_protection.conf, which disables memory protection + # hardware completely. llext.simple.readonly: arch_allow: arm riscv # Xtensa needs writable storage filter: not CONFIG_MPU and not CONFIG_MMU + extra_conf_files: ['no_mem_protection.conf'] extra_configs: - - arch:arm:CONFIG_ARM_MPU=n - - arch:arm:CONFIG_ARM_AARCH32_MMU=n - - arch:riscv:CONFIG_RISCV_PMP=n - CONFIG_LLEXT_STORAGE_WRITABLE=n llext.simple.readonly_mpu: min_ram: 128 @@ -58,20 +60,16 @@ tests: integration_platforms: - qemu_xtensa/dc233c # Xtensa ISA filter: not CONFIG_MPU and not CONFIG_MMU + extra_conf_files: ['no_mem_protection.conf'] extra_configs: - - arch:arm:CONFIG_ARM_MPU=n - - arch:arm:CONFIG_ARM_AARCH32_MMU=n - - arch:riscv:CONFIG_RISCV_PMP=n - CONFIG_LLEXT_STORAGE_WRITABLE=y llext.simple.writable_relocatable: arch_allow: arm xtensa riscv integration_platforms: - qemu_xtensa/dc233c # Xtensa ISA filter: not CONFIG_MPU and not CONFIG_MMU + extra_conf_files: ['no_mem_protection.conf'] extra_configs: - - arch:arm:CONFIG_ARM_MPU=n - - arch:arm:CONFIG_ARM_AARCH32_MMU=n - - arch:riscv:CONFIG_RISCV_PMP=n - CONFIG_LLEXT_STORAGE_WRITABLE=y - CONFIG_LLEXT_TYPE_ELF_RELOCATABLE=y @@ -82,10 +80,8 @@ tests: integration_platforms: - qemu_xtensa/dc233c # Xtensa ISA filter: not CONFIG_MPU and not CONFIG_MMU + extra_conf_files: ['no_mem_protection.conf'] extra_configs: - - arch:arm:CONFIG_ARM_MPU=n - - arch:arm:CONFIG_ARM_AARCH32_MMU=n - - arch:riscv:CONFIG_RISCV_PMP=n - CONFIG_LLEXT_STORAGE_WRITABLE=y - CONFIG_LLEXT_EXPORT_BUILTINS_BY_SLID=y llext.simple.writable_relocatable_slid_linking: @@ -93,10 +89,8 @@ tests: integration_platforms: - qemu_xtensa/dc233c # Xtensa ISA filter: not CONFIG_MPU and not CONFIG_MMU + extra_conf_files: ['no_mem_protection.conf'] extra_configs: - - arch:arm:CONFIG_ARM_MPU=n - - arch:arm:CONFIG_ARM_AARCH32_MMU=n - - arch:riscv:CONFIG_RISCV_PMP=n - CONFIG_LLEXT_STORAGE_WRITABLE=y - CONFIG_LLEXT_TYPE_ELF_RELOCATABLE=y - CONFIG_LLEXT_EXPORT_BUILTINS_BY_SLID=y From de1e76fa4e592bcd8592c64501484b0abf5241dd Mon Sep 17 00:00:00 2001 From: Luca Burelli Date: Wed, 30 Oct 2024 17:45:35 +0100 Subject: [PATCH 060/113] tests/subsys/llext: fix coverage for readonly_mmu test The test was not being run on arm64 and riscv because the filter was incorrect. Properly fix the filter to run the test on all platforms that have any kind of MMU enabled. Signed-off-by: Luca Burelli --- tests/subsys/llext/simple/testcase.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/subsys/llext/simple/testcase.yaml b/tests/subsys/llext/simple/testcase.yaml index 55139a274322dc..901bd3d06ad6fe 100644 --- a/tests/subsys/llext/simple/testcase.yaml +++ b/tests/subsys/llext/simple/testcase.yaml @@ -50,10 +50,11 @@ tests: - CONFIG_LLEXT_STORAGE_WRITABLE=n llext.simple.readonly_mmu: arch_allow: arm64 arm riscv - filter: CONFIG_ARM_MMU + filter: CONFIG_MMU or CONFIG_RISCV_PMP integration_platforms: - qemu_cortex_a53 # ARM Cortex-A53 (ARMv8-A ISA) extra_configs: + - CONFIG_LLEXT_HEAP_SIZE=128 # qemu_cortex_a9 requires larger heap - CONFIG_LLEXT_STORAGE_WRITABLE=n llext.simple.writable: arch_allow: arm xtensa riscv From f59e2477ba326459b47c6be1adee120c9cdc8e06 Mon Sep 17 00:00:00 2001 From: Zheng Wu Date: Wed, 30 Oct 2024 19:34:45 +0800 Subject: [PATCH 061/113] drivers: serial: fix potential overflow in fifo_fill and fifo_read Change the type of num_tx/num_rx to avoid overflow. Fixes #80599 Signed-off-by: Zheng Wu --- drivers/serial/leuart_gecko.c | 4 ++-- drivers/serial/uart_gecko.c | 4 ++-- drivers/serial/uart_mcux.c | 4 ++-- drivers/serial/uart_mcux_flexcomm.c | 4 ++-- drivers/serial/uart_mcux_iuart.c | 4 ++-- drivers/serial/uart_mcux_lpsci.c | 4 ++-- drivers/serial/uart_mcux_lpuart.c | 4 ++-- drivers/serial/uart_nrfx_uart.c | 4 ++-- drivers/serial/uart_pl011.c | 4 ++-- drivers/serial/uart_renesas_ra8_sci_b.c | 4 ++-- drivers/serial/uart_renesas_ra_sci.c | 4 ++-- drivers/serial/uart_rv32m1_lpuart.c | 4 ++-- drivers/serial/uart_stellaris.c | 4 ++-- drivers/serial/uart_stm32.c | 22 ++++++++-------------- drivers/serial/usart_gd32.c | 4 ++-- 15 files changed, 36 insertions(+), 42 deletions(-) diff --git a/drivers/serial/leuart_gecko.c b/drivers/serial/leuart_gecko.c index 9eec982802c159..335e2285c1acca 100644 --- a/drivers/serial/leuart_gecko.c +++ b/drivers/serial/leuart_gecko.c @@ -101,7 +101,7 @@ static int leuart_gecko_fifo_fill(const struct device *dev, int len) { LEUART_TypeDef *base = DEV_BASE(dev); - uint8_t num_tx = 0U; + int num_tx = 0U; while ((len - num_tx > 0) && (base->STATUS & LEUART_STATUS_TXBL)) { @@ -116,7 +116,7 @@ static int leuart_gecko_fifo_read(const struct device *dev, uint8_t *rx_data, const int len) { LEUART_TypeDef *base = DEV_BASE(dev); - uint8_t num_rx = 0U; + int num_rx = 0U; while ((len - num_rx > 0) && (base->STATUS & LEUART_STATUS_RXDATAV)) { diff --git a/drivers/serial/uart_gecko.c b/drivers/serial/uart_gecko.c index ffda4fd977ee44..11c396bcd9f1f4 100644 --- a/drivers/serial/uart_gecko.c +++ b/drivers/serial/uart_gecko.c @@ -222,7 +222,7 @@ static int uart_gecko_fifo_fill(const struct device *dev, const uint8_t *tx_data int len) { const struct uart_gecko_config *config = dev->config; - uint8_t num_tx = 0U; + int num_tx = 0U; while ((len - num_tx > 0) && (config->base->STATUS & USART_STATUS_TXBL)) { @@ -237,7 +237,7 @@ static int uart_gecko_fifo_read(const struct device *dev, uint8_t *rx_data, const int len) { const struct uart_gecko_config *config = dev->config; - uint8_t num_rx = 0U; + int num_rx = 0U; while ((len - num_rx > 0) && (config->base->STATUS & USART_STATUS_RXDATAV)) { diff --git a/drivers/serial/uart_mcux.c b/drivers/serial/uart_mcux.c index 7f741ebc3499eb..07b0a0e44e255b 100644 --- a/drivers/serial/uart_mcux.c +++ b/drivers/serial/uart_mcux.c @@ -179,7 +179,7 @@ static int uart_mcux_fifo_fill(const struct device *dev, int len) { const struct uart_mcux_config *config = dev->config; - uint8_t num_tx = 0U; + int num_tx = 0U; while ((len - num_tx > 0) && (UART_GetStatusFlags(config->base) & kUART_TxDataRegEmptyFlag)) { @@ -194,7 +194,7 @@ static int uart_mcux_fifo_read(const struct device *dev, uint8_t *rx_data, const int len) { const struct uart_mcux_config *config = dev->config; - uint8_t num_rx = 0U; + int num_rx = 0U; while ((len - num_rx > 0) && (UART_GetStatusFlags(config->base) & kUART_RxDataRegFullFlag)) { diff --git a/drivers/serial/uart_mcux_flexcomm.c b/drivers/serial/uart_mcux_flexcomm.c index 7b1a7d7c29d558..b39a3a48f11a8e 100644 --- a/drivers/serial/uart_mcux_flexcomm.c +++ b/drivers/serial/uart_mcux_flexcomm.c @@ -146,7 +146,7 @@ static int mcux_flexcomm_fifo_fill(const struct device *dev, int len) { const struct mcux_flexcomm_config *config = dev->config; - uint8_t num_tx = 0U; + int num_tx = 0U; while ((len - num_tx > 0) && (USART_GetStatusFlags(config->base) @@ -162,7 +162,7 @@ static int mcux_flexcomm_fifo_read(const struct device *dev, uint8_t *rx_data, const int len) { const struct mcux_flexcomm_config *config = dev->config; - uint8_t num_rx = 0U; + int num_rx = 0U; while ((len - num_rx > 0) && (USART_GetStatusFlags(config->base) diff --git a/drivers/serial/uart_mcux_iuart.c b/drivers/serial/uart_mcux_iuart.c index f13e3e8df93833..d067f7f622050d 100644 --- a/drivers/serial/uart_mcux_iuart.c +++ b/drivers/serial/uart_mcux_iuart.c @@ -86,7 +86,7 @@ static int mcux_iuart_fifo_fill(const struct device *dev, int len) { const struct mcux_iuart_config *config = dev->config; - uint8_t num_tx = 0U; + int num_tx = 0U; while ((len - num_tx > 0) && (UART_GetStatusFlag(config->base, kUART_TxEmptyFlag))) { @@ -101,7 +101,7 @@ static int mcux_iuart_fifo_read(const struct device *dev, uint8_t *rx_data, const int len) { const struct mcux_iuart_config *config = dev->config; - uint8_t num_rx = 0U; + int num_rx = 0U; while ((len - num_rx > 0) && (UART_GetStatusFlag(config->base, kUART_RxDataReadyFlag))) { diff --git a/drivers/serial/uart_mcux_lpsci.c b/drivers/serial/uart_mcux_lpsci.c index 9a5439d48ed2e8..6a87ef217d7c09 100644 --- a/drivers/serial/uart_mcux_lpsci.c +++ b/drivers/serial/uart_mcux_lpsci.c @@ -89,7 +89,7 @@ static int mcux_lpsci_fifo_fill(const struct device *dev, int len) { const struct mcux_lpsci_config *config = dev->config; - uint8_t num_tx = 0U; + int num_tx = 0U; while ((len - num_tx > 0) && (LPSCI_GetStatusFlags(config->base) @@ -105,7 +105,7 @@ static int mcux_lpsci_fifo_read(const struct device *dev, uint8_t *rx_data, const int len) { const struct mcux_lpsci_config *config = dev->config; - uint8_t num_rx = 0U; + int num_rx = 0U; while ((len - num_rx > 0) && (LPSCI_GetStatusFlags(config->base) diff --git a/drivers/serial/uart_mcux_lpuart.c b/drivers/serial/uart_mcux_lpuart.c index a4c775c5b4e49e..5697a904d7f193 100644 --- a/drivers/serial/uart_mcux_lpuart.c +++ b/drivers/serial/uart_mcux_lpuart.c @@ -233,7 +233,7 @@ static int mcux_lpuart_fifo_fill(const struct device *dev, int len) { const struct mcux_lpuart_config *config = dev->config; - uint8_t num_tx = 0U; + int num_tx = 0U; while ((len - num_tx > 0) && (LPUART_GetStatusFlags(config->base) @@ -248,7 +248,7 @@ static int mcux_lpuart_fifo_read(const struct device *dev, uint8_t *rx_data, const int len) { const struct mcux_lpuart_config *config = dev->config; - uint8_t num_rx = 0U; + int num_rx = 0U; while ((len - num_rx > 0) && (LPUART_GetStatusFlags(config->base) diff --git a/drivers/serial/uart_nrfx_uart.c b/drivers/serial/uart_nrfx_uart.c index 2cf347ded291e3..c151ef490585af 100644 --- a/drivers/serial/uart_nrfx_uart.c +++ b/drivers/serial/uart_nrfx_uart.c @@ -786,7 +786,7 @@ static int uart_nrfx_fifo_fill(const struct device *dev, const uint8_t *tx_data, int len) { - uint8_t num_tx = 0U; + int num_tx = 0U; while ((len - num_tx > 0) && event_txdrdy_check()) { @@ -806,7 +806,7 @@ static int uart_nrfx_fifo_read(const struct device *dev, uint8_t *rx_data, const int size) { - uint8_t num_rx = 0U; + int num_rx = 0U; while ((size - num_rx > 0) && nrf_uart_event_check(uart0_addr, NRF_UART_EVENT_RXDRDY)) { diff --git a/drivers/serial/uart_pl011.c b/drivers/serial/uart_pl011.c index 2f25c305627234..130d4e95957bcd 100644 --- a/drivers/serial/uart_pl011.c +++ b/drivers/serial/uart_pl011.c @@ -317,7 +317,7 @@ static int pl011_runtime_config_get(const struct device *dev, static int pl011_fifo_fill(const struct device *dev, const uint8_t *tx_data, int len) { - uint8_t num_tx = 0U; + int num_tx = 0U; while (!(get_uart(dev)->fr & PL011_FR_TXFF) && (len - num_tx > 0)) { get_uart(dev)->dr = tx_data[num_tx++]; @@ -328,7 +328,7 @@ static int pl011_fifo_fill(const struct device *dev, static int pl011_fifo_read(const struct device *dev, uint8_t *rx_data, const int len) { - uint8_t num_rx = 0U; + int num_rx = 0U; while ((len - num_rx > 0) && !(get_uart(dev)->fr & PL011_FR_RXFE)) { rx_data[num_rx++] = get_uart(dev)->dr; diff --git a/drivers/serial/uart_renesas_ra8_sci_b.c b/drivers/serial/uart_renesas_ra8_sci_b.c index 5918966f18ea5e..8922dd0fbb3d07 100644 --- a/drivers/serial/uart_renesas_ra8_sci_b.c +++ b/drivers/serial/uart_renesas_ra8_sci_b.c @@ -256,7 +256,7 @@ static int uart_ra_sci_b_fifo_fill(const struct device *dev, const uint8_t *tx_d { struct uart_ra_sci_b_data *data = dev->data; const struct uart_ra_sci_b_config *cfg = dev->config; - uint8_t num_tx = 0U; + int num_tx = 0U; if (IS_ENABLED(CONFIG_UART_RA_SCI_B_UART_FIFO_ENABLE) && data->sci.fifo_depth > 0) { while ((size - num_tx > 0) && cfg->regs->FTSR != 0x10U) { @@ -281,7 +281,7 @@ static int uart_ra_sci_b_fifo_read(const struct device *dev, uint8_t *rx_data, c { struct uart_ra_sci_b_data *data = dev->data; const struct uart_ra_sci_b_config *cfg = dev->config; - uint8_t num_rx = 0U; + int num_rx = 0U; if (IS_ENABLED(CONFIG_UART_RA_SCI_B_UART_FIFO_ENABLE) && data->sci.fifo_depth > 0) { while ((size - num_rx > 0) && cfg->regs->FRSR_b.R > 0U) { diff --git a/drivers/serial/uart_renesas_ra_sci.c b/drivers/serial/uart_renesas_ra_sci.c index 1c424f19f5759a..0e9f927a357a22 100644 --- a/drivers/serial/uart_renesas_ra_sci.c +++ b/drivers/serial/uart_renesas_ra_sci.c @@ -301,7 +301,7 @@ static int uart_ra_sci_fifo_fill(const struct device *dev, const uint8_t *tx_dat { struct uart_ra_sci_data *data = dev->data; const struct uart_ra_sci_config *cfg = dev->config; - uint8_t num_tx = 0U; + int num_tx = 0U; #if CONFIG_UART_RA_SCI_UART_FIFO_ENABLE if (data->sci.fifo_depth != 0) { @@ -326,7 +326,7 @@ static int uart_ra_sci_fifo_read(const struct device *dev, uint8_t *rx_data, con { struct uart_ra_sci_data *data = dev->data; const struct uart_ra_sci_config *cfg = dev->config; - uint8_t num_rx = 0U; + int num_rx = 0U; #if CONFIG_UART_RA_SCI_UART_FIFO_ENABLE if (data->sci.fifo_depth != 0) { diff --git a/drivers/serial/uart_rv32m1_lpuart.c b/drivers/serial/uart_rv32m1_lpuart.c index ee3a9621d8c7e1..603a1cd0617542 100644 --- a/drivers/serial/uart_rv32m1_lpuart.c +++ b/drivers/serial/uart_rv32m1_lpuart.c @@ -93,7 +93,7 @@ static int rv32m1_lpuart_fifo_fill(const struct device *dev, int len) { const struct rv32m1_lpuart_config *config = dev->config; - uint8_t num_tx = 0U; + int num_tx = 0U; while ((len - num_tx > 0) && (LPUART_GetStatusFlags(config->base) @@ -109,7 +109,7 @@ static int rv32m1_lpuart_fifo_read(const struct device *dev, uint8_t *rx_data, const int len) { const struct rv32m1_lpuart_config *config = dev->config; - uint8_t num_rx = 0U; + int num_rx = 0U; while ((len - num_rx > 0) && (LPUART_GetStatusFlags(config->base) diff --git a/drivers/serial/uart_stellaris.c b/drivers/serial/uart_stellaris.c index 2dc49d31e513f7..731ea8a3c09d28 100644 --- a/drivers/serial/uart_stellaris.c +++ b/drivers/serial/uart_stellaris.c @@ -313,7 +313,7 @@ static int uart_stellaris_fifo_fill(const struct device *dev, int len) { const struct uart_stellaris_config *config = dev->config; - uint8_t num_tx = 0U; + int num_tx = 0U; while ((len - num_tx > 0) && ((config->uart->fr & UARTFR_TXFF) == 0U)) { config->uart->dr = (uint32_t)tx_data[num_tx++]; @@ -336,7 +336,7 @@ static int uart_stellaris_fifo_read(const struct device *dev, const int size) { const struct uart_stellaris_config *config = dev->config; - uint8_t num_rx = 0U; + int num_rx = 0U; while ((size - num_rx > 0) && ((config->uart->fr & UARTFR_RXFE) == 0U)) { rx_data[num_rx++] = (uint8_t)config->uart->dr; diff --git a/drivers/serial/uart_stm32.c b/drivers/serial/uart_stm32.c index e0232c550e62ec..1f9e7abe01271b 100644 --- a/drivers/serial/uart_stm32.c +++ b/drivers/serial/uart_stm32.c @@ -816,15 +816,14 @@ static inline void __uart_stm32_get_clock(const struct device *dev) #ifdef CONFIG_UART_INTERRUPT_DRIVEN -typedef void (*fifo_fill_fn)(USART_TypeDef *usart, const void *tx_data, - const uint8_t offset); +typedef void (*fifo_fill_fn)(USART_TypeDef *usart, const void *tx_data, const int offset); static int uart_stm32_fifo_fill_visitor(const struct device *dev, const void *tx_data, int size, fifo_fill_fn fill_fn) { const struct uart_stm32_config *config = dev->config; USART_TypeDef *usart = config->usart; - uint8_t num_tx = 0U; + int num_tx = 0U; unsigned int key; if (!LL_USART_IsActiveFlag_TXE(usart)) { @@ -847,8 +846,7 @@ static int uart_stm32_fifo_fill_visitor(const struct device *dev, const void *tx return num_tx; } -static void fifo_fill_with_u8(USART_TypeDef *usart, - const void *tx_data, const uint8_t offset) +static void fifo_fill_with_u8(USART_TypeDef *usart, const void *tx_data, const int offset) { const uint8_t *data = (const uint8_t *)tx_data; /* Send a character (8bit) */ @@ -865,15 +863,14 @@ static int uart_stm32_fifo_fill(const struct device *dev, const uint8_t *tx_data fifo_fill_with_u8); } -typedef void (*fifo_read_fn)(USART_TypeDef *usart, void *rx_data, - const uint8_t offset); +typedef void (*fifo_read_fn)(USART_TypeDef *usart, void *rx_data, const int offset); static int uart_stm32_fifo_read_visitor(const struct device *dev, void *rx_data, const int size, fifo_read_fn read_fn) { const struct uart_stm32_config *config = dev->config; USART_TypeDef *usart = config->usart; - uint8_t num_rx = 0U; + int num_rx = 0U; while ((size - num_rx > 0) && LL_USART_IsActiveFlag_RXNE(usart)) { /* RXNE flag will be cleared upon read from DR|RDR register */ @@ -894,8 +891,7 @@ static int uart_stm32_fifo_read_visitor(const struct device *dev, void *rx_data, return num_rx; } -static void fifo_read_with_u8(USART_TypeDef *usart, void *rx_data, - const uint8_t offset) +static void fifo_read_with_u8(USART_TypeDef *usart, void *rx_data, const int offset) { uint8_t *data = (uint8_t *)rx_data; @@ -914,8 +910,7 @@ static int uart_stm32_fifo_read(const struct device *dev, uint8_t *rx_data, cons #ifdef CONFIG_UART_WIDE_DATA -static void fifo_fill_with_u16(USART_TypeDef *usart, - const void *tx_data, const uint8_t offset) +static void fifo_fill_with_u16(USART_TypeDef *usart, const void *tx_data, const int offset) { const uint16_t *data = (const uint16_t *)tx_data; @@ -933,8 +928,7 @@ static int uart_stm32_fifo_fill_u16(const struct device *dev, const uint16_t *tx fifo_fill_with_u16); } -static void fifo_read_with_u16(USART_TypeDef *usart, void *rx_data, - const uint8_t offset) +static void fifo_read_with_u16(USART_TypeDef *usart, void *rx_data, const int offset) { uint16_t *data = (uint16_t *)rx_data; diff --git a/drivers/serial/usart_gd32.c b/drivers/serial/usart_gd32.c index 972c622f3ad92d..4e5ac37a230e9e 100644 --- a/drivers/serial/usart_gd32.c +++ b/drivers/serial/usart_gd32.c @@ -167,7 +167,7 @@ int usart_gd32_fifo_fill(const struct device *dev, const uint8_t *tx_data, int len) { const struct gd32_usart_config *const cfg = dev->config; - uint8_t num_tx = 0U; + int num_tx = 0U; while ((len - num_tx > 0) && usart_flag_get(cfg->reg, USART_FLAG_TBE)) { @@ -181,7 +181,7 @@ int usart_gd32_fifo_read(const struct device *dev, uint8_t *rx_data, const int size) { const struct gd32_usart_config *const cfg = dev->config; - uint8_t num_rx = 0U; + int num_rx = 0U; while ((size - num_rx > 0) && usart_flag_get(cfg->reg, USART_FLAG_RBNE)) { From 593f4423ab7e9245603c93e02e73f1ba6d9597af Mon Sep 17 00:00:00 2001 From: Michal Smola Date: Wed, 30 Oct 2024 08:21:09 +0100 Subject: [PATCH 062/113] samples: led: pwm: fix console harness regex Led blinking period was made configurable and time unit changed from sec to msec recently in the source code of the sample. Console harness regex was not changed accordingly in sample.yaml. Device testing fails when run with twister. Change the regex to accept any period and change the units to msec. Signed-off-by: Michal Smola --- samples/drivers/led/pwm/sample.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/samples/drivers/led/pwm/sample.yaml b/samples/drivers/led/pwm/sample.yaml index fe9a3845ffbe69..21d27c0d6a999f 100644 --- a/samples/drivers/led/pwm/sample.yaml +++ b/samples/drivers/led/pwm/sample.yaml @@ -17,6 +17,6 @@ tests: - "Turned on" - "Turned off" - "Increasing brightness gradually" - - "Blinking on: 0.1 sec, off: 0.1 sec" - - "(Blinking on: 1 sec, off: 1 sec|Cycle period not supported)" + - "Blinking on: ([0-9]+) msec, off: ([0-9]+) msec" + - "(Blinking on: ([0-9]+) msec, off: ([0-9]+) msec|Cycle period not supported)" - "Turned off, loop end" From cbe07bcb92ea37b0ea3d4f4b5fd5a48819a3b4e5 Mon Sep 17 00:00:00 2001 From: Daniel DeGrasse Date: Thu, 31 Oct 2024 21:17:46 +0000 Subject: [PATCH 063/113] Revert "drivers: display: elcdif: Modify interrupt enablement" This reverts commit 206897658ab88444f32d59e2dbcec65e38d66779. We must keep the frame completion interrupt disabled until we send a new frame to the eLCDIF, as the frame completion interrupt fires at each vertical blank interval. If we keep it enabled, then the semaphore we use to indicate the frame has been loaded by the eLCDIF will be posted to when we do not have a frame queued, and calls to `display_write` will return before the eLCDIF has actually loaded the new framebuffer. Fixes #80590 Signed-off-by: Daniel DeGrasse --- drivers/display/Kconfig.mcux_elcdif | 12 ------------ drivers/display/display_mcux_elcdif.c | 18 ++++++------------ 2 files changed, 6 insertions(+), 24 deletions(-) diff --git a/drivers/display/Kconfig.mcux_elcdif b/drivers/display/Kconfig.mcux_elcdif index c183ac6ada001a..e9b48f761449e1 100644 --- a/drivers/display/Kconfig.mcux_elcdif +++ b/drivers/display/Kconfig.mcux_elcdif @@ -54,18 +54,6 @@ config MCUX_ELCDIF_PXP display_write is called with a framebuffer equal in size to the display. -config MCUX_ELCDIF_LP - bool "ELCDIF low power" - help - This option, when enabled, will enable CUR_FRAME_DONE_IRQ at the display - write function and disable it at the interruption handler for each new frame. - Disabling the interrupt when no new frame needs to be sent gives the CPU the - possibility to enter low-power mode, thus saving energy. - This option, when disabled, CUR_FRAME_DONE_IRQ will be enabled only - once at initialization. This option should be disabled when the application's - frame rate is close to the display's refresh rate to avoid introducing - additional latency caused by frequently enabling and disabling CUR_FRAME_DONE_IRQ. - if MCUX_ELCDIF_PXP choice MCUX_ELCDIF_PXP_ROTATE_DIRECTION diff --git a/drivers/display/display_mcux_elcdif.c b/drivers/display/display_mcux_elcdif.c index 828fcf4314ec8a..d082ac19964092 100644 --- a/drivers/display/display_mcux_elcdif.c +++ b/drivers/display/display_mcux_elcdif.c @@ -214,10 +214,8 @@ static int mcux_elcdif_write(const struct device *dev, const uint16_t x, const u /* Update index of active framebuffer */ dev_data->next_idx = (dev_data->next_idx + 1) % CONFIG_MCUX_ELCDIF_FB_NUM; #endif - - if (IS_ENABLED(CONFIG_MCUX_ELCDIF_LP)) { - ELCDIF_EnableInterrupts(config->base, kELCDIF_CurFrameDoneInterruptEnable); - } + /* Enable frame buffer completion interrupt */ + ELCDIF_EnableInterrupts(config->base, kELCDIF_CurFrameDoneInterruptEnable); /* Wait for frame send to complete */ k_sem_take(&dev_data->sem, K_FOREVER); return ret; @@ -310,11 +308,10 @@ static void mcux_elcdif_isr(const struct device *dev) status = ELCDIF_GetInterruptStatus(config->base); ELCDIF_ClearInterruptStatus(config->base, status); if (config->base->CUR_BUF == ((uint32_t)dev_data->active_fb)) { - if (IS_ENABLED(CONFIG_MCUX_ELCDIF_LP)) { - /* Disable frame completion interrupt if Low power mode is activated*/ - ELCDIF_DisableInterrupts(config->base, kELCDIF_CurFrameDoneInterruptEnable); - } - /* Post to sem to notify that frame display is complete.*/ + /* Disable frame completion interrupt, post to + * sem to notify that frame send is complete. + */ + ELCDIF_DisableInterrupts(config->base, kELCDIF_CurFrameDoneInterruptEnable); k_sem_give(&dev_data->sem); } } @@ -352,9 +349,6 @@ static int mcux_elcdif_init(const struct device *dev) dev_data->active_fb = dev_data->fb[0]; ELCDIF_RgbModeInit(config->base, &dev_data->rgb_mode); - if (!IS_ENABLED(CONFIG_MCUX_ELCDIF_LP)) { - ELCDIF_EnableInterrupts(config->base, kELCDIF_CurFrameDoneInterruptEnable); - } ELCDIF_RgbModeStart(config->base); return 0; From 6c2bc2ff3719081510715c960bca55258c4b525c Mon Sep 17 00:00:00 2001 From: Luca Burelli Date: Sun, 27 Oct 2024 12:37:11 +0100 Subject: [PATCH 064/113] west build: warn about conditional flags in 'extra_configs' The 'west build' command does not know about conditional flags (in the format 'type:value:CONFIG_FOO=bar') in the 'extra_configs' argument of Twister testcase.yaml files, and currently converts them to malformed arguments that are silently ignored by cmake. This change adds a check to 'west build' to clearly warn the user if the 'extra_configs' list contains conditional flags and provide a hint on how to add them to the CMake command line. Signed-off-by: Luca Burelli --- scripts/west_commands/build.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/scripts/west_commands/build.py b/scripts/west_commands/build.py index 8181640adac101..a06ae0d45040e1 100644 --- a/scripts/west_commands/build.py +++ b/scripts/west_commands/build.py @@ -361,7 +361,19 @@ def _parse_test_item(self, test_item): arg_list = extra if data == 'extra_configs': - args = ["-D{}".format(arg.replace('"', '\"')) for arg in arg_list] + args = [] + for arg in arg_list: + equals = arg.find('=') + colon = arg.rfind(':', 0, equals) + if colon != -1: + # conditional configs (xxx:yyy:CONFIG_FOO=bar) + # are not supported by 'west build' + self.wrn('"west build" does not support ' + 'conditional config "{}". Add "-D{}" ' + 'to the supplied CMake arguments if ' + 'desired.'.format(arg, arg[colon+1:])) + continue + args.append("-D{}".format(arg.replace('"', '\"'))) elif data == 'extra_args': # Retain quotes around config options config_options = [arg for arg in arg_list if arg.startswith("CONFIG_")] From ba58b066d49e833e69352e265489708653f6cc01 Mon Sep 17 00:00:00 2001 From: Luca Burelli Date: Wed, 30 Oct 2024 11:36:09 +0100 Subject: [PATCH 065/113] west build: fix a leftover "log" reference in build.py A recent commit changed all references to the global 'west.log' instance (now deprecated) to the new WestCommand logging API, but another PR merged in the same period added an extra instance that is now causing CI to fail. Convert this last reference to the new API. Signed-off-by: Luca Burelli --- scripts/west_commands/build.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/west_commands/build.py b/scripts/west_commands/build.py index a06ae0d45040e1..d3c159db2fc629 100644 --- a/scripts/west_commands/build.py +++ b/scripts/west_commands/build.py @@ -265,7 +265,7 @@ def do_run(self, args, remainder): with open(build_info_file, "w") as f: yaml.dump(build_command, f, default_flow_style=False) except Exception as e: - log.wrn(f'Failed to create info file: {build_info_file},', e) + self.wrn(f'Failed to create info file: {build_info_file},', e) board, origin = self._find_board() self._run_cmake(board, origin, self.args.cmake_opts) From 3a39ca1e7e199e1a1ea2771ee4af1cce070265fa Mon Sep 17 00:00:00 2001 From: Emil Gydesen Date: Mon, 4 Nov 2024 15:42:11 +0100 Subject: [PATCH 066/113] samples: Bluetooth: BAP: Add missing return in stream_is_streaming Add missing return before a `false`;. Signed-off-by: Emil Gydesen --- samples/bluetooth/bap_unicast_client/src/stream_tx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/bluetooth/bap_unicast_client/src/stream_tx.c b/samples/bluetooth/bap_unicast_client/src/stream_tx.c index 06ea3a3c349ecd..ebdc01ab87f97c 100644 --- a/samples/bluetooth/bap_unicast_client/src/stream_tx.c +++ b/samples/bluetooth/bap_unicast_client/src/stream_tx.c @@ -48,7 +48,7 @@ static bool stream_is_streaming(const struct bt_bap_stream *bap_stream) err = bt_bap_ep_get_info(bap_stream->ep, &ep_info); if (err != 0) { - false; + return false; } return ep_info.state == BT_BAP_EP_STATE_STREAMING; From 5d52e39a5298a1a5c8d7375d92de8a2376a4ac1f Mon Sep 17 00:00:00 2001 From: Robin Kastberg Date: Fri, 1 Nov 2024 22:17:05 +0100 Subject: [PATCH 067/113] random: random_timer.c Remove __GNUC__ ifdef Remove an old __GNUC__ ifdef Signed-off-by: Robin Kastberg --- subsys/random/random_timer.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/subsys/random/random_timer.c b/subsys/random/random_timer.c index 74ca676098b625..46534d8860131e 100644 --- a/subsys/random/random_timer.c +++ b/subsys/random/random_timer.c @@ -20,8 +20,6 @@ #include #include -#if defined(__GNUC__) - static struct k_spinlock rand32_lock; /** @@ -71,4 +69,3 @@ void z_impl_sys_rand_get(void *dst, size_t outlen) outlen -= blocksize; } } -#endif /* __GNUC__ */ From 8bd4f244b0aa66476c59d536be5aecf58346611f Mon Sep 17 00:00:00 2001 From: Mark Holden Date: Wed, 22 May 2024 17:49:51 -0700 Subject: [PATCH 068/113] coredump: ARM: Ensure sp in dump is set as gdb expects Gdb is typically able to reconstruct the first two frames of the failing stack using the "pc" and "lr" registers. After that, (if the frame pointer is omitted) it appears to need the stack pointer (sp register) to point to the top of the stack before a fatal error occurred. The ARM Cortex-M processors push registers r0-r3, r12, LR, {possibly FPU registers}, PC, SPSR onto the stack before entering the exception handler. We adjust the stack pointer back to the point before these registers were pushed for preservation in the dump. During k_oops/k_panic, the sp wasn't stored in the core dump at all. Apply similar logic to store it when failures occur in that path. Signed-off-by: Mark Holden --- arch/arm/core/cortex_a_r/swap_helper.S | 6 +- arch/arm/core/cortex_a_r/switch.S | 6 +- arch/arm/core/cortex_m/fault.c | 52 +-------------- arch/arm/core/cortex_m/swap_helper.S | 1 + arch/arm/core/fatal.c | 5 +- arch/arm/include/cortex_a_r/exception.h | 9 +++ arch/arm/include/cortex_m/exception.h | 85 +++++++++++++++++++++++++ 7 files changed, 108 insertions(+), 56 deletions(-) diff --git a/arch/arm/core/cortex_a_r/swap_helper.S b/arch/arm/core/cortex_a_r/swap_helper.S index 457f71e9d7b801..a41e1ab5942fe1 100644 --- a/arch/arm/core/cortex_a_r/swap_helper.S +++ b/arch/arm/core/cortex_a_r/swap_helper.S @@ -336,12 +336,14 @@ _context_switch: _oops: /* - * Pass the exception frame to z_do_kernel_oops. r0 contains the - * exception reason. + * Pass the exception frame to z_do_kernel_oops. */ cps #MODE_SYS mov r0, sp cps #MODE_SVC + /* Zero callee_regs and exc_return (only used on Cortex-M) */ + mov r1, #0 + mov r2, #0 bl z_do_kernel_oops b z_arm_int_exit diff --git a/arch/arm/core/cortex_a_r/switch.S b/arch/arm/core/cortex_a_r/switch.S index 800d46bbf94ddd..4d5a6a627b1cc0 100644 --- a/arch/arm/core/cortex_a_r/switch.S +++ b/arch/arm/core/cortex_a_r/switch.S @@ -150,10 +150,12 @@ offload: _oops: /* - * Pass the exception frame to z_do_kernel_oops. r0 contains the - * exception reason. + * Pass the exception frame to z_do_kernel_oops. */ mov r0, sp + /* Zero callee_regs and exc_return (only used on Cortex-M) */ + mov r1, #0 + mov r2, #0 bl z_do_kernel_oops inv: diff --git a/arch/arm/core/cortex_m/fault.c b/arch/arm/core/cortex_m/fault.c index 4e604ba8033c18..604801a6414d9e 100644 --- a/arch/arm/core/cortex_m/fault.c +++ b/arch/arm/core/cortex_m/fault.c @@ -40,54 +40,6 @@ LOG_MODULE_DECLARE(os, CONFIG_KERNEL_LOG_LEVEL); #define EACD(edr) (((edr) & SYSMPU_EDR_EACD_MASK) >> SYSMPU_EDR_EACD_SHIFT) #endif -/* Exception Return (EXC_RETURN) is provided in LR upon exception entry. - * It is used to perform an exception return and to detect possible state - * transition upon exception. - */ - -/* Prefix. Indicates that this is an EXC_RETURN value. - * This field reads as 0b11111111. - */ -#define EXC_RETURN_INDICATOR_PREFIX (0xFF << 24) -/* bit[0]: Exception Secure. The security domain the exception was taken to. */ -#define EXC_RETURN_EXCEPTION_SECURE_Pos 0 -#define EXC_RETURN_EXCEPTION_SECURE_Msk \ - BIT(EXC_RETURN_EXCEPTION_SECURE_Pos) -#define EXC_RETURN_EXCEPTION_SECURE_Non_Secure 0 -#define EXC_RETURN_EXCEPTION_SECURE_Secure EXC_RETURN_EXCEPTION_SECURE_Msk -/* bit[2]: Stack Pointer selection. */ -#define EXC_RETURN_SPSEL_Pos 2 -#define EXC_RETURN_SPSEL_Msk BIT(EXC_RETURN_SPSEL_Pos) -#define EXC_RETURN_SPSEL_MAIN 0 -#define EXC_RETURN_SPSEL_PROCESS EXC_RETURN_SPSEL_Msk -/* bit[3]: Mode. Indicates the Mode that was stacked from. */ -#define EXC_RETURN_MODE_Pos 3 -#define EXC_RETURN_MODE_Msk BIT(EXC_RETURN_MODE_Pos) -#define EXC_RETURN_MODE_HANDLER 0 -#define EXC_RETURN_MODE_THREAD EXC_RETURN_MODE_Msk -/* bit[4]: Stack frame type. Indicates whether the stack frame is a standard - * integer only stack frame or an extended floating-point stack frame. - */ -#define EXC_RETURN_STACK_FRAME_TYPE_Pos 4 -#define EXC_RETURN_STACK_FRAME_TYPE_Msk BIT(EXC_RETURN_STACK_FRAME_TYPE_Pos) -#define EXC_RETURN_STACK_FRAME_TYPE_EXTENDED 0 -#define EXC_RETURN_STACK_FRAME_TYPE_STANDARD EXC_RETURN_STACK_FRAME_TYPE_Msk -/* bit[5]: Default callee register stacking. Indicates whether the default - * stacking rules apply, or whether the callee registers are already on the - * stack. - */ -#define EXC_RETURN_CALLEE_STACK_Pos 5 -#define EXC_RETURN_CALLEE_STACK_Msk BIT(EXC_RETURN_CALLEE_STACK_Pos) -#define EXC_RETURN_CALLEE_STACK_SKIPPED 0 -#define EXC_RETURN_CALLEE_STACK_DEFAULT EXC_RETURN_CALLEE_STACK_Msk -/* bit[6]: Secure or Non-secure stack. Indicates whether a Secure or - * Non-secure stack is used to restore stack frame on exception return. - */ -#define EXC_RETURN_RETURN_STACK_Pos 6 -#define EXC_RETURN_RETURN_STACK_Msk BIT(EXC_RETURN_RETURN_STACK_Pos) -#define EXC_RETURN_RETURN_STACK_Non_Secure 0 -#define EXC_RETURN_RETURN_STACK_Secure EXC_RETURN_RETURN_STACK_Msk - /* Integrity signature for an ARMv8-M implementation */ #if defined(CONFIG_ARMV7_M_ARMV8_M_FP) #define INTEGRITY_SIGNATURE_STD 0xFEFA125BUL @@ -1112,9 +1064,7 @@ void z_arm_fault(uint32_t msp, uint32_t psp, uint32_t exc_return, __ASSERT(esf != NULL, "ESF could not be retrieved successfully. Shall never occur."); -#ifdef CONFIG_DEBUG_COREDUMP - z_arm_coredump_fault_sp = POINTER_TO_UINT(esf); -#endif + z_arm_set_fault_sp(esf, exc_return); reason = fault_handle(esf, fault, &recoverable); if (recoverable) { diff --git a/arch/arm/core/cortex_m/swap_helper.S b/arch/arm/core/cortex_m/swap_helper.S index 7a557e904f1e05..c6207084b5ea64 100644 --- a/arch/arm/core/cortex_m/swap_helper.S +++ b/arch/arm/core/cortex_m/swap_helper.S @@ -447,6 +447,7 @@ _oops: mov r1, sp /* pointer to _callee_saved_t */ #endif /* CONFIG_ARMV7_M_ARMV8_M_MAINLINE */ #endif /* CONFIG_EXTRA_EXCEPTION_INFO */ + mov r2, lr /* EXC_RETURN */ bl z_do_kernel_oops /* return from SVC exception is done here */ #if defined(CONFIG_EXTRA_EXCEPTION_INFO) diff --git a/arch/arm/core/fatal.c b/arch/arm/core/fatal.c index 4532e238f05c99..d64855b6b8e3e7 100644 --- a/arch/arm/core/fatal.c +++ b/arch/arm/core/fatal.c @@ -101,8 +101,9 @@ void z_arm_fatal_error(unsigned int reason, const struct arch_esf *esf) * * @param esf exception frame * @param callee_regs Callee-saved registers (R4-R11) + * @param exc_return EXC_RETURN value present in LR after exception entry. */ -void z_do_kernel_oops(const struct arch_esf *esf, _callee_saved_t *callee_regs) +void z_do_kernel_oops(const struct arch_esf *esf, _callee_saved_t *callee_regs, uint32_t exc_return) { #if !(defined(CONFIG_EXTRA_EXCEPTION_INFO) && defined(CONFIG_ARMV7_M_ARMV8_M_MAINLINE)) ARG_UNUSED(callee_regs); @@ -110,6 +111,8 @@ void z_do_kernel_oops(const struct arch_esf *esf, _callee_saved_t *callee_regs) /* Stacked R0 holds the exception reason. */ unsigned int reason = esf->basic.r0; + z_arm_set_fault_sp(esf, exc_return); + #if defined(CONFIG_USERSPACE) if (z_arm_preempted_thread_in_user_mode(esf)) { /* diff --git a/arch/arm/include/cortex_a_r/exception.h b/arch/arm/include/cortex_a_r/exception.h index 6daa9c106ee2ba..4326444f112ecf 100644 --- a/arch/arm/include/cortex_a_r/exception.h +++ b/arch/arm/include/cortex_a_r/exception.h @@ -43,6 +43,15 @@ static ALWAYS_INLINE bool arch_is_in_nested_exception(const struct arch_esf *esf return (arch_curr_cpu()->arch.exc_depth > 1U) ? (true) : (false); } +/** + * @brief No current implementation where core dump is not supported + * + * @param esf exception frame + * @param exc_return EXC_RETURN value present in LR after exception entry. + */ +static ALWAYS_INLINE void z_arm_set_fault_sp(const struct arch_esf *esf, uint32_t exc_return) +{} + #if defined(CONFIG_USERSPACE) /* * This function is used by privileged code to determine if the thread diff --git a/arch/arm/include/cortex_m/exception.h b/arch/arm/include/cortex_m/exception.h index 89bdd4b83e9a28..94491a71b3fcc4 100644 --- a/arch/arm/include/cortex_m/exception.h +++ b/arch/arm/include/cortex_m/exception.h @@ -39,6 +39,54 @@ extern volatile irq_offload_routine_t offload_routine; */ #define AIRCR_VECT_KEY_PERMIT_WRITE 0x05FAUL +/* Exception Return (EXC_RETURN) is provided in LR upon exception entry. + * It is used to perform an exception return and to detect possible state + * transition upon exception. + */ + +/* Prefix. Indicates that this is an EXC_RETURN value. + * This field reads as 0b11111111. + */ +#define EXC_RETURN_INDICATOR_PREFIX (0xFF << 24) +/* bit[0]: Exception Secure. The security domain the exception was taken to. */ +#define EXC_RETURN_EXCEPTION_SECURE_Pos 0 +#define EXC_RETURN_EXCEPTION_SECURE_Msk \ + BIT(EXC_RETURN_EXCEPTION_SECURE_Pos) +#define EXC_RETURN_EXCEPTION_SECURE_Non_Secure 0 +#define EXC_RETURN_EXCEPTION_SECURE_Secure EXC_RETURN_EXCEPTION_SECURE_Msk +/* bit[2]: Stack Pointer selection. */ +#define EXC_RETURN_SPSEL_Pos 2 +#define EXC_RETURN_SPSEL_Msk BIT(EXC_RETURN_SPSEL_Pos) +#define EXC_RETURN_SPSEL_MAIN 0 +#define EXC_RETURN_SPSEL_PROCESS EXC_RETURN_SPSEL_Msk +/* bit[3]: Mode. Indicates the Mode that was stacked from. */ +#define EXC_RETURN_MODE_Pos 3 +#define EXC_RETURN_MODE_Msk BIT(EXC_RETURN_MODE_Pos) +#define EXC_RETURN_MODE_HANDLER 0 +#define EXC_RETURN_MODE_THREAD EXC_RETURN_MODE_Msk +/* bit[4]: Stack frame type. Indicates whether the stack frame is a standard + * integer only stack frame or an extended floating-point stack frame. + */ +#define EXC_RETURN_STACK_FRAME_TYPE_Pos 4 +#define EXC_RETURN_STACK_FRAME_TYPE_Msk BIT(EXC_RETURN_STACK_FRAME_TYPE_Pos) +#define EXC_RETURN_STACK_FRAME_TYPE_EXTENDED 0 +#define EXC_RETURN_STACK_FRAME_TYPE_STANDARD EXC_RETURN_STACK_FRAME_TYPE_Msk +/* bit[5]: Default callee register stacking. Indicates whether the default + * stacking rules apply, or whether the callee registers are already on the + * stack. + */ +#define EXC_RETURN_CALLEE_STACK_Pos 5 +#define EXC_RETURN_CALLEE_STACK_Msk BIT(EXC_RETURN_CALLEE_STACK_Pos) +#define EXC_RETURN_CALLEE_STACK_SKIPPED 0 +#define EXC_RETURN_CALLEE_STACK_DEFAULT EXC_RETURN_CALLEE_STACK_Msk +/* bit[6]: Secure or Non-secure stack. Indicates whether a Secure or + * Non-secure stack is used to restore stack frame on exception return. + */ +#define EXC_RETURN_RETURN_STACK_Pos 6 +#define EXC_RETURN_RETURN_STACK_Msk BIT(EXC_RETURN_RETURN_STACK_Pos) +#define EXC_RETURN_RETURN_STACK_Non_Secure 0 +#define EXC_RETURN_RETURN_STACK_Secure EXC_RETURN_RETURN_STACK_Msk + /* * The current executing vector is found in the IPSR register. All * IRQs and system exceptions are considered as interrupt context. @@ -184,6 +232,43 @@ static ALWAYS_INLINE void z_arm_clear_faults(void) #endif /* CONFIG_ARMV6_M_ARMV8_M_BASELINE */ } +/** + * @brief Set z_arm_coredump_fault_sp to stack pointer value expected by GDB + * + * @param esf exception frame + * @param exc_return EXC_RETURN value present in LR after exception entry. + */ +static ALWAYS_INLINE void z_arm_set_fault_sp(const struct arch_esf *esf, uint32_t exc_return) +{ +#ifdef CONFIG_DEBUG_COREDUMP + z_arm_coredump_fault_sp = POINTER_TO_UINT(esf); +#if defined(CONFIG_ARMV7_M_ARMV8_M_MAINLINE) || defined(CONFIG_ARMV6_M_ARMV8_M_BASELINE) + /* Gdb expects a stack pointer that does not include the exception stack frame in order to + * unwind. So adjust the stack pointer accordingly. + */ + z_arm_coredump_fault_sp += sizeof(esf->basic); + +#if defined(CONFIG_FPU) && defined(CONFIG_FPU_SHARING) + /* Assess whether thread had been using the FP registers and add size of additional + * registers if necessary + */ + if ((exc_return & EXC_RETURN_STACK_FRAME_TYPE_STANDARD) == + EXC_RETURN_STACK_FRAME_TYPE_EXTENDED) { + z_arm_coredump_fault_sp += sizeof(esf->fpu); + } +#endif /* CONFIG_FPU && CONFIG_FPU_SHARING */ + +#ifndef CONFIG_ARMV8_M_MAINLINE + if ((esf->basic.xpsr & SCB_CCR_STKALIGN_Msk) == SCB_CCR_STKALIGN_Msk) { + /* Adjust stack alignment after PSR bit[9] detected */ + z_arm_coredump_fault_sp |= 0x4; + } +#endif /* !CONFIG_ARMV8_M_MAINLINE */ + +#endif /* CONFIG_ARMV7_M_ARMV8_M_MAINLINE || CONFIG_ARMV6_M_ARMV8_M_BASELINE */ +#endif /* CONFIG_DEBUG_COREDUMP */ +} + /** * @brief Assess whether a debug monitor event should be treated as an error * From 6984237c063883ded7c9b5b97aa2a08c54552e69 Mon Sep 17 00:00:00 2001 From: Ha Duong Quang Date: Wed, 9 Oct 2024 10:32:12 +0700 Subject: [PATCH 069/113] arch: arm: core: cortex_a_r: enable the VFP unit on boot for FPU_SHARING The FPU is already disabled by the z_arm_svc function when the first thread starts. Therefore, disabling the FPU at boot is unnecessary for lazy FPU; instead, it must be enabled to handle floating-point instructions before the lazy FPU works. Signed-off-by: Ha Duong Quang --- arch/arm/core/cortex_a_r/prep_c.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/arch/arm/core/cortex_a_r/prep_c.c b/arch/arm/core/cortex_a_r/prep_c.c index 8e068f2e3923f8..a10588a49275f1 100644 --- a/arch/arm/core/cortex_a_r/prep_c.c +++ b/arch/arm/core/cortex_a_r/prep_c.c @@ -62,7 +62,6 @@ static inline void z_arm_floating_point_init(void) __set_CPACR(reg_val); barrier_isync_fence_full(); -#if !defined(CONFIG_FPU_SHARING) /* * FPEXC: Floating-Point Exception Control register * comp. ARM Architecture Reference Manual, ARMv7-A and ARMv7-R edition, @@ -84,7 +83,6 @@ static inline void z_arm_floating_point_init(void) */ __set_FPEXC(FPEXC_EN); #endif -#endif } #endif /* CONFIG_CPU_HAS_FPU */ From 6023d6a1428d880a988f1be3ab1b5da5a6e86d61 Mon Sep 17 00:00:00 2001 From: Daniel DeGrasse Date: Fri, 1 Nov 2024 22:36:32 +0000 Subject: [PATCH 070/113] arch: common: fix copy for ramfunc region during XIP init ramfunc region is copied into RAM from FLASH region during XIP init. We copy from the loadaddr of the region, and were previously loading to the symbol __ramfunc_start. This is incorrect when using an MPU with alignment requirements, as the __ramfunc_start symbol may have padding placed before it in the region. The __ramfunc_start symbol still needs to be aligned in order to be used by the MPU though, so define a new symbol __ramfunc_region_start, and use that symbol when copying the __ramfunc region from FLASH to RAM. Fixes #75296 Signed-off-by: Daniel DeGrasse --- arch/common/ramfunc.ld | 1 + cmake/linker_script/arm/linker.cmake | 1 + include/zephyr/linker/linker-defs.h | 1 + kernel/xip.c | 4 ++-- 4 files changed, 5 insertions(+), 2 deletions(-) diff --git a/arch/common/ramfunc.ld b/arch/common/ramfunc.ld index 3894dbfef43578..45dea79d6b669d 100644 --- a/arch/common/ramfunc.ld +++ b/arch/common/ramfunc.ld @@ -9,6 +9,7 @@ SECTION_DATA_PROLOGUE(.ramfunc,,) { + __ramfunc_region_start = .; MPU_ALIGN(__ramfunc_size); __ramfunc_start = .; *(.ramfunc) diff --git a/cmake/linker_script/arm/linker.cmake b/cmake/linker_script/arm/linker.cmake index 332d44b24359e1..bb501a16cdb2f4 100644 --- a/cmake/linker_script/arm/linker.cmake +++ b/cmake/linker_script/arm/linker.cmake @@ -144,6 +144,7 @@ endif() include(${COMMON_ZEPHYR_LINKER_DIR}/ram-end.cmake) +zephyr_linker_symbol(SYMBOL __ramfunc_region_start EXPR "ADDR(.ramfunc)") zephyr_linker_symbol(SYMBOL __kernel_ram_start EXPR "(@__bss_start@)") zephyr_linker_symbol(SYMBOL __kernel_ram_end EXPR "(${RAM_ADDR} + ${RAM_SIZE})") zephyr_linker_symbol(SYMBOL __kernel_ram_size EXPR "(@__kernel_ram_end@ - @__bss_start@)") diff --git a/include/zephyr/linker/linker-defs.h b/include/zephyr/linker/linker-defs.h index ff3cbe6ca6cf48..9c795ae78517ae 100644 --- a/include/zephyr/linker/linker-defs.h +++ b/include/zephyr/linker/linker-defs.h @@ -231,6 +231,7 @@ extern char _nocache_ram_size[]; * section, stored in RAM instead of FLASH. */ #ifdef CONFIG_ARCH_HAS_RAMFUNC_SUPPORT +extern char __ramfunc_region_start[]; extern char __ramfunc_start[]; extern char __ramfunc_end[]; extern char __ramfunc_size[]; diff --git a/kernel/xip.c b/kernel/xip.c index 94d38e9b30dccd..898dfe2ae4cbb3 100644 --- a/kernel/xip.c +++ b/kernel/xip.c @@ -28,8 +28,8 @@ void z_data_copy(void) z_early_memcpy(&__data_region_start, &__data_region_load_start, __data_region_end - __data_region_start); #ifdef CONFIG_ARCH_HAS_RAMFUNC_SUPPORT - z_early_memcpy(&__ramfunc_start, &__ramfunc_load_start, - (uintptr_t) &__ramfunc_size); + z_early_memcpy(&__ramfunc_region_start, &__ramfunc_load_start, + __ramfunc_end - __ramfunc_region_start); #endif /* CONFIG_ARCH_HAS_RAMFUNC_SUPPORT */ #if DT_NODE_HAS_STATUS_OKAY(DT_CHOSEN(zephyr_ccm)) z_early_memcpy(&__ccm_data_start, &__ccm_data_rom_start, From 99b1c2a91202c367ed51bee5df99004ca5ff7bc8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20Cab=C3=A9?= Date: Mon, 4 Nov 2024 18:25:00 +0100 Subject: [PATCH 071/113] doc: releases: rework linkage to old release notes/migration guides MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Move the link to old release notes and migration guides to the bottom of the document Signed-off-by: Benjamin Cabé --- doc/releases/eol_releases.rst | 24 ++++++++++++++++++++++-- doc/releases/index.rst | 16 ++++++++++++++-- 2 files changed, 36 insertions(+), 4 deletions(-) diff --git a/doc/releases/eol_releases.rst b/doc/releases/eol_releases.rst index cf29d850a4dafb..f16f74a87aa735 100644 --- a/doc/releases/eol_releases.rst +++ b/doc/releases/eol_releases.rst @@ -1,7 +1,15 @@ +.. _eol_releases: + End-of-life releases -==================== +#################### + +Release notes and migration guides for end-of-life releases of Zephyr RTOS are kept here for +historical purposes. + +.. _eol_releases_relesase_notes: -Release notes for end-of-life releases of Zephyr RTOS are kept here for historical purposes. +Release Notes +************* .. toctree:: :maxdepth: 1 @@ -12,3 +20,15 @@ Release notes for end-of-life releases of Zephyr RTOS are kept here for historic release-notes-1.* release-notes-2.[0-6] release-notes-3.[0-5] + +.. _eol_releases_migration_guides: + +Migration Guides +**************** + +.. toctree:: + :maxdepth: 1 + :glob: + :reversed: + + migration-guide-3.[5] diff --git a/doc/releases/index.rst b/doc/releases/index.rst index 0f4c7f8ccdd519..9f8c1a968b3a77 100644 --- a/doc/releases/index.rst +++ b/doc/releases/index.rst @@ -81,7 +81,6 @@ needs to be changed are to be detailed in the release's migration guide. :glob: :reversed: - eol_releases release-notes-2.7 release-notes-3.[6-7] release-notes-4.0 @@ -115,7 +114,20 @@ to be able to understand the context of the change. :glob: :reversed: - migration-guide-* + migration-guide-3.[6-7] + migration-guide-4.[0] + +End-of-life Releases +******************** + +.. toctree:: + :hidden: + :maxdepth: 1 + + eol_releases + +Release notes and migration guides for end-of-life releases of Zephyr RTOS can be accessed +:ref:`here `. .. _`GitHub repository`: https://github.com/zephyrproject-rtos/zephyr .. _`GitHub tagged releases`: https://github.com/zephyrproject-rtos/zephyr/tags From d342f9e0c2858ed97aa640814c4a12f84b2bbe6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20Cab=C3=A9?= Date: Mon, 4 Nov 2024 18:27:33 +0100 Subject: [PATCH 072/113] doc: releases: introduce release notes and migration guide docs for 4.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This introduces the release notes and migration guide for 4.1.0 earlier than we typically do, so that people have a placeholder to start adding content as they line up pull requests for 4.1. The two documents are currently orphan and not visible from the main documentation as this would confuse users of 4.0. Signed-off-by: Benjamin Cabé --- doc/releases/migration-guide-4.1.rst | 112 +++++++++++ doc/releases/release-notes-4.1.rst | 288 +++++++++++++++++++++++++++ 2 files changed, 400 insertions(+) create mode 100644 doc/releases/migration-guide-4.1.rst create mode 100644 doc/releases/release-notes-4.1.rst diff --git a/doc/releases/migration-guide-4.1.rst b/doc/releases/migration-guide-4.1.rst new file mode 100644 index 00000000000000..d35ab96073c736 --- /dev/null +++ b/doc/releases/migration-guide-4.1.rst @@ -0,0 +1,112 @@ +:orphan: + +.. _migration_4.1: + +Migration guide to Zephyr v4.1.0 (Working Draft) +################################################ + +This document describes the changes required when migrating your application from Zephyr v4.0.0 to +Zephyr v4.1.0. + +Any other changes (not directly related to migrating applications) can be found in +the :ref:`release notes`. + +.. contents:: + :local: + :depth: 2 + +Build System +************ + +Kernel +****** + +Boards +****** + +Modules +******* + +Mbed TLS +======== + +Trusted Firmware-M +================== + +LVGL +==== + +Device Drivers and Devicetree +***************************** + +Controller Area Network (CAN) +============================= + +Display +======= + +Enhanced Serial Peripheral Interface (eSPI) +=========================================== + +GNSS +==== + +Input +===== + +Interrupt Controller +==================== + +LED Strip +========= + +Sensors +======= + +Serial +====== + +Regulator +========= + +Bluetooth +********* + +Bluetooth HCI +============= + +Bluetooth Mesh +============== + +Bluetooth Audio +=============== + +Bluetooth Classic +================= + +Bluetooth Host +============== + +Bluetooth Crypto +================ + +Networking +********** + +Other Subsystems +**************** + +Flash map +========= + +hawkBit +======= + +MCUmgr +====== + +Modem +===== + +Architectures +************* diff --git a/doc/releases/release-notes-4.1.rst b/doc/releases/release-notes-4.1.rst new file mode 100644 index 00000000000000..202fdb20489ba5 --- /dev/null +++ b/doc/releases/release-notes-4.1.rst @@ -0,0 +1,288 @@ +:orphan: + +.. _zephyr_4.1: + +Zephyr 4.1.0 (Working Draft) +############################ + +We are pleased to announce the release of Zephyr version 4.1.0. + +Major enhancements with this release include: + +An overview of the changes required or recommended when migrating your application from Zephyr +v4.0.0 to Zephyr v4.1.0 can be found in the separate :ref:`migration guide`. + +The following sections provide detailed lists of changes by component. + +Security Vulnerability Related +****************************** +The following CVEs are addressed by this release: + +More detailed information can be found in: +https://docs.zephyrproject.org/latest/security/vulnerabilities.html + +API Changes +*********** + +Removed APIs in this release +============================ + +Deprecated in this release +========================== + +Architectures +************* + +* ARC + +* ARM + +* ARM64 + +* RISC-V + +* Xtensa + +Kernel +****** + +Bluetooth +********* + +* Audio + +* Host + +* HCI Drivers + +Boards & SoC Support +******************** + +* Added support for these SoC series: + +* Made these changes in other SoC series: + +* Added support for these boards: + +* Made these board changes: + +* Added support for the following shields: + +Build system and Infrastructure +******************************* + +Drivers and Sensors +******************* + +* ADC + +* Battery + +* CAN + +* Charger + +* Clock control + +* Counter + +* DAC + +* Disk + +* Display + +* Ethernet + +* Flash + +* GNSS + +* GPIO + +* Hardware info + +* I2C + +* I2S + +* I3C + +* Input + +* LED + +* LED Strip + +* LoRa + +* Mailbox + +* MDIO + +* MFD + +* Modem + +* MIPI-DBI + +* MSPI + +* Pin control + +* PWM + +* Regulators + +* Reset + +* RTC + +* RTIO + +* SDHC + +* Sensors + +* Serial + +* SPI + +* USB + +* Video + +* Watchdog + +* Wi-Fi + +Networking +********** + +* ARP: + +* CoAP: + +* Connection manager: + +* DHCPv4: + +* DHCPv6: + +* DNS/mDNS/LLMNR: + +* gPTP/PTP: + +* HTTP: + +* IPSP: + +* IPv4: + +* IPv6: + +* LwM2M: + +* Misc: + +* MQTT: + +* Network Interface: + +* OpenThread + +* PPP + +* Shell: + +* Sockets: + +* Syslog: + +* TCP: + +* Websocket: + +* Wi-Fi: + +* zperf: + +USB +*** + +Devicetree +********** + +Kconfig +******* + +Libraries / Subsystems +********************** + +* Debug + +* Demand Paging + +* Formatted output + +* Management + +* Logging + +* Modem modules + +* Power management + +* Crypto + +* CMSIS-NN + +* FPGA + +* Random + +* SD + +* State Machine Framework + +* Storage + +* Task Watchdog + +* POSIX API + +* LoRa/LoRaWAN + +* ZBus + +HALs +**** + +* Nordic + +* STM32 + +* ADI + +* Espressif + +MCUboot +******* + +OSDP +**** + +Trusted Firmware-M +****************** + +LVGL +**** + +Tests and Samples +***************** + +Issue Related Items +******************* + +Known Issues +============ From 756affe2ebda6d436370d36c1ff8914d42f69174 Mon Sep 17 00:00:00 2001 From: Dominik Ermel Date: Mon, 4 Nov 2024 12:04:32 +0100 Subject: [PATCH 073/113] doc: releases: 4.0: Add release notes for Flash and Storage Update of release notes in areas related to Storage and Flash. Additionally two known Stream Flash issues have been added to Know Issue section. Signed-off-by: Dominik Ermel --- doc/releases/release-notes-4.0.rst | 47 ++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/doc/releases/release-notes-4.0.rst b/doc/releases/release-notes-4.0.rst index 77a092000bede3..3161f8fc5bb6da 100644 --- a/doc/releases/release-notes-4.0.rst +++ b/doc/releases/release-notes-4.0.rst @@ -327,6 +327,20 @@ Drivers and Sensors * Fixed SPI NOR driver issue where wp, hold and reset pins were incorrectly initialized from device tee when SFDP at run-time has been enabled (:github:`80383`) + * Added :kconfig:option:`CONFIG_SPI_NOR_ACTIVE_DWELL_MS`, to the SPI NOR driver configuration, + which allows setting the time during which the driver will wait before triggering Deep Power Down (DPD). + This option replaces ``CONFIG_SPI_NOR_IDLE_IN_DPD``, aiming at reducing unnecessary power + state changes and SPI transfers between other operations, specifically when burst type + access to an SPI NOR device occurs. + + * Added :kconfig:option:`CONFIG_SPI_NOR_INIT_PRIORITY` to allow selecting the SPI NOR driver initialization priority. + + * The flash API has been extended with the :c:func:`flash_copy` utility function which allows performing + direct data copies between two Flash API devices. + + * Fixed a Flash Simulator issue where offsets were assumed to be absolute instead of relative + to the device base address (:github:`79082`). + * GNSS * GPIO @@ -603,6 +617,36 @@ Libraries / Subsystems from version 2.8.1, the last module update, up to and including the released version 2.9.3. + * LittleFS: Fixed an issue where the DTS option for configuring block cycles for LittleFS instances + was ignored (:github:`79072`). + + * LittleFS: Fixed issue with lookahead buffer size mismatch to actual allocated buffer size + (:github:`77917`). + + * FAT FS: Added :kconfig:option:`CONFIG_FILE_SYSTEM_LIB_LINK` to allow linking file system + support libraries without enabling the File System subsystem. This option can be used + when a user wants to directly use file system libraries, bypassing the File System + subsystem. + + * FAT FS: Added :kconfig:option:`CONFIG_FS_FATFS_LBA64` to enable support for the 64-bit LBA + and GPT in FAT file system driver. + + * FAT FS: Added :kconfig:option:`CONFIG_FS_FATFS_MULTI_PARTITION` that enables support for + devices partitioned with GPT or MBR. + + * FAT FS: Added :kconfig:option:`CONFIG_FS_FATFS_HAS_RTC` that enables RTC usage for time-stamping + files on FAT file systems. + + * FAT FS: Added :kconfig:option:`CONFIG_FS_FATFS_EXTRA_NATIVE_API` that enables additional FAT + file system driver functions, which are not exposed via Zephyr File System subsystem, + for users that intend to directly call them in their code. + + * Stream Flash: Fixed an issue where :c:func:`stream_flash_erase_page` did not properly check + the requested erase range and possibly allowed erasing any page on a device (:github:`79800`). + + * Shell: Fixed an issue were a failed file system mount attempt using the shell would make it + impossible to ever succeed in mounting that file system again until the device was reset (:github:`80024`). + * Task Watchdog * POSIX API @@ -724,3 +768,6 @@ Issue Related Items Known Issues ============ + +- :github:`71042` stream_flash: stream_flash_init() size parameter allows to ignore partition layout +- :github:`67407` stream_flash: stream_flash_erase_page allows to accidentally erase stream From 87a9363fa787edbf789409ed6748af198bf34f1f Mon Sep 17 00:00:00 2001 From: Chaitanya Tata Date: Mon, 4 Nov 2024 15:53:42 +0530 Subject: [PATCH 074/113] drivers: nrfiwif: Enable recovery by default This is needed to ensure Wi-Fi can always be used. Signed-off-by: Chaitanya Tata --- drivers/wifi/nrfwifi/Kconfig.nrfwifi | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/wifi/nrfwifi/Kconfig.nrfwifi b/drivers/wifi/nrfwifi/Kconfig.nrfwifi index 6679e40e048826..2e6934bef22525 100644 --- a/drivers/wifi/nrfwifi/Kconfig.nrfwifi +++ b/drivers/wifi/nrfwifi/Kconfig.nrfwifi @@ -651,6 +651,7 @@ config NRF_WIFI_AP_DEAD_DETECT_TIMEOUT config NRF_WIFI_RPU_RECOVERY bool "RPU recovery mechanism" depends on NRF_WIFI_LOW_POWER + default y select EXPERIMENTAL help Enable the RPU recovery mechanism to recover from an RPU (nRF70) hang. From f5090110daa449665d237a9170383e10bd3c8149 Mon Sep 17 00:00:00 2001 From: Henrik Brix Andersen Date: Mon, 4 Nov 2024 09:38:56 +0100 Subject: [PATCH 075/113] doc: releases: 4.0: add CAN release notes Add CAN related release notes for Zephyr v4.0.0. Signed-off-by: Henrik Brix Andersen --- doc/releases/migration-guide-4.0.rst | 3 --- doc/releases/release-notes-4.0.rst | 5 +++++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/doc/releases/migration-guide-4.0.rst b/doc/releases/migration-guide-4.0.rst index fcf1763d15e150..82c2779a842797 100644 --- a/doc/releases/migration-guide-4.0.rst +++ b/doc/releases/migration-guide-4.0.rst @@ -196,9 +196,6 @@ Clock control load-capacitance-femtofarad = <...>; }; -Controller Area Network (CAN) -============================= - Crypto ====== diff --git a/doc/releases/release-notes-4.0.rst b/doc/releases/release-notes-4.0.rst index 3161f8fc5bb6da..a23a41c3341a24 100644 --- a/doc/releases/release-notes-4.0.rst +++ b/doc/releases/release-notes-4.0.rst @@ -298,6 +298,11 @@ Drivers and Sensors * CAN + * Added initial support for Renesas RA CANFD (:dtcompatible:`renesas,ra-canfd-global`, + :dtcompatible:`renesas,ra-canfd`) + * Added Flexcan support for S32Z27x (:dtcompatible:`nxp,flexcan`, :dtcompatible:`nxp,flexcan-fd`) + * Improved NXP S32 CANXL error reporting (:dtcompatible:`nxp,s32-canxl`) + * Charger * Clock control From d5c88d6576fc406382e87513365fff8131d05d04 Mon Sep 17 00:00:00 2001 From: Henrik Brix Andersen Date: Mon, 4 Nov 2024 09:42:56 +0100 Subject: [PATCH 076/113] doc: releases: 4.0: add EEPROM release notes Add EEPROM related release notes for Zephyr v4.0.0. Signed-off-by: Henrik Brix Andersen --- doc/releases/release-notes-4.0.rst | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/doc/releases/release-notes-4.0.rst b/doc/releases/release-notes-4.0.rst index a23a41c3341a24..bd08679b1b3c4f 100644 --- a/doc/releases/release-notes-4.0.rst +++ b/doc/releases/release-notes-4.0.rst @@ -323,6 +323,11 @@ Drivers and Sensors * Display +* EEPROM + + * Added support for using the EEPROM simulator with embedded C standard libraries + (:dtcompatible:`zephyr,sim-eeprom`). + * Ethernet * LiteX: Renamed the ``compatible`` from ``litex,eth0`` to :dtcompatible:`litex,liteeth`. From af3dac213172bca42472bafef181f5998975fe09 Mon Sep 17 00:00:00 2001 From: Johan Hedberg Date: Mon, 4 Nov 2024 08:39:59 +0200 Subject: [PATCH 077/113] Bluetooth: drivers: Sync bus types with BlueZ The authoritative source of these values is BlueZ: https://git.kernel.org/pub/scm/bluetooth/bluez.git/tree/lib/hci.h#n38 Update our values with the above. The IPM definiton doesn't exist in BlueZ, but should be added there to make sure we don't get out of sync again. Signed-off-by: Johan Hedberg --- dts/bindings/bluetooth/bt-hci.yaml | 2 ++ include/zephyr/drivers/bluetooth.h | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/dts/bindings/bluetooth/bt-hci.yaml b/dts/bindings/bluetooth/bt-hci.yaml index a010310f755328..a56ced5dae1024 100644 --- a/dts/bindings/bluetooth/bt-hci.yaml +++ b/dts/bindings/bluetooth/bt-hci.yaml @@ -19,6 +19,8 @@ properties: - "sdio" - "spi" - "i2c" + - "smd" + - "virtio" - "ipm" bt-hci-quirks: type: string-array diff --git a/include/zephyr/drivers/bluetooth.h b/include/zephyr/drivers/bluetooth.h index f06481948efe95..4f67f512273d24 100644 --- a/include/zephyr/drivers/bluetooth.h +++ b/include/zephyr/drivers/bluetooth.h @@ -69,7 +69,9 @@ enum bt_hci_bus { BT_HCI_BUS_SDIO = 6, BT_HCI_BUS_SPI = 7, BT_HCI_BUS_I2C = 8, - BT_HCI_BUS_IPM = 9, + BT_HCI_BUS_SMD = 9, + BT_HCI_BUS_VIRTIO = 10, + BT_HCI_BUS_IPM = 11, }; #define BT_DT_HCI_QUIRK_OR(node_id, prop, idx) \ From b710167f1b5bd99118f6b2b006afe16f86e07f33 Mon Sep 17 00:00:00 2001 From: Johan Hedberg Date: Mon, 4 Nov 2024 14:03:00 +0200 Subject: [PATCH 078/113] Bluetooth: drivers: Rename IPM to IPC This bus type was originally created for what's today the ipc.c HCI driver. Since this type hasn't yet been synced with BlueZ, rename it for consistency, however leave the old define to not break backwards compatibility with existing DT bindings (there are several more that use "ipm" than ipc.c). Signed-off-by: Johan Hedberg --- dts/bindings/bluetooth/bt-hci.yaml | 3 ++- dts/bindings/bluetooth/zephyr,bt-hci-ipc.yaml | 2 +- include/zephyr/drivers/bluetooth.h | 4 +++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/dts/bindings/bluetooth/bt-hci.yaml b/dts/bindings/bluetooth/bt-hci.yaml index a56ced5dae1024..52d3f82e4ef428 100644 --- a/dts/bindings/bluetooth/bt-hci.yaml +++ b/dts/bindings/bluetooth/bt-hci.yaml @@ -21,7 +21,8 @@ properties: - "i2c" - "smd" - "virtio" - - "ipm" + - "ipm" # Deprecated. "ipc" should be used instead. + - "ipc" bt-hci-quirks: type: string-array description: HCI device quirks diff --git a/dts/bindings/bluetooth/zephyr,bt-hci-ipc.yaml b/dts/bindings/bluetooth/zephyr,bt-hci-ipc.yaml index ee1f8e76c3b17b..f5186e8a3be128 100644 --- a/dts/bindings/bluetooth/zephyr,bt-hci-ipc.yaml +++ b/dts/bindings/bluetooth/zephyr,bt-hci-ipc.yaml @@ -8,7 +8,7 @@ properties: bt-hci-name: default: "IPC" bt-hci-bus: - default: "ipm" + default: "ipc" bt-hci-quirks: default: ["no-auto-dle"] bt-hci-ipc-name: diff --git a/include/zephyr/drivers/bluetooth.h b/include/zephyr/drivers/bluetooth.h index 4f67f512273d24..330ac850b828a4 100644 --- a/include/zephyr/drivers/bluetooth.h +++ b/include/zephyr/drivers/bluetooth.h @@ -71,7 +71,9 @@ enum bt_hci_bus { BT_HCI_BUS_I2C = 8, BT_HCI_BUS_SMD = 9, BT_HCI_BUS_VIRTIO = 10, - BT_HCI_BUS_IPM = 11, + BT_HCI_BUS_IPC = 11, + /* IPM is deprecated and simply an alias for IPC */ + BT_HCI_BUS_IPM = BT_HCI_BUS_IPC, }; #define BT_DT_HCI_QUIRK_OR(node_id, prop, idx) \ From 1f1e4afa4f145699677f8ee50dac5c5890d42dd9 Mon Sep 17 00:00:00 2001 From: Emil Gydesen Date: Fri, 1 Nov 2024 15:05:30 +0100 Subject: [PATCH 079/113] Bluetooth: CSIP: Handle disconnects while in procedure If a device disconnects while we are in a procedure then get_next_active_instance would return a service instance pointer with the `conn` set to NULL. The issue was caused by the set_info being potentially memset when the device that disconnected was the one that held the set_info pointer. The solution is to not use a pointer, but rather a copy of the set_info, so that the active.set_info value is still valid after a disconnect. Since the set_info is not longer a pointer to a specific set_info from one of the members, the logs have been updated as well, as the pointer of the active.set_info is useless for debugging. Signed-off-by: Emil Gydesen --- subsys/bluetooth/audio/csip_set_coordinator.c | 38 +++++++++---------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/subsys/bluetooth/audio/csip_set_coordinator.c b/subsys/bluetooth/audio/csip_set_coordinator.c index 3436f512c49f5d..f27a85087ee1f9 100644 --- a/subsys/bluetooth/audio/csip_set_coordinator.c +++ b/subsys/bluetooth/audio/csip_set_coordinator.c @@ -58,7 +58,7 @@ LOG_MODULE_REGISTER(bt_csip_set_coordinator, CONFIG_BT_CSIP_SET_COORDINATOR_LOG_ static struct active_members { struct bt_csip_set_coordinator_set_member *members[CONFIG_BT_MAX_CONN]; - const struct bt_csip_set_coordinator_set_info *info; + struct bt_csip_set_coordinator_set_info info; uint8_t members_count; uint8_t members_handled; uint8_t members_restored; @@ -169,7 +169,7 @@ static struct bt_csip_set_coordinator_svc_inst *lookup_instance_by_set_info( member_set_info = &member->insts[i].info; if (member_set_info->set_size == set_info->set_size && - memcmp(&member_set_info->sirk, &set_info->sirk, sizeof(set_info->sirk)) == 0) { + memcmp(member_set_info->sirk, set_info->sirk, sizeof(set_info->sirk)) == 0) { return bt_csip_set_coordinator_lookup_instance_by_index(inst->conn, i); } } @@ -184,9 +184,9 @@ static struct bt_csip_set_coordinator_svc_inst *get_next_active_instance(void) member = active.members[active.members_handled]; - svc_inst = lookup_instance_by_set_info(member, active.info); + svc_inst = lookup_instance_by_set_info(member, &active.info); if (svc_inst == NULL) { - LOG_DBG("Failed to lookup instance by set_info %p", active.info); + LOG_DBG("Failed to lookup instance by set_info"); } return svc_inst; @@ -201,8 +201,8 @@ static int member_rank_compare_asc(const void *m1, const void *m2) struct bt_csip_set_coordinator_svc_inst *svc_inst_1; struct bt_csip_set_coordinator_svc_inst *svc_inst_2; - svc_inst_1 = lookup_instance_by_set_info(member_1, active.info); - svc_inst_2 = lookup_instance_by_set_info(member_2, active.info); + svc_inst_1 = lookup_instance_by_set_info(member_1, &active.info); + svc_inst_2 = lookup_instance_by_set_info(member_2, &active.info); if (svc_inst_1 == NULL) { LOG_ERR("svc_inst_1 was NULL for member %p", member_1); @@ -232,7 +232,7 @@ static void active_members_store_ordered(const struct bt_csip_set_coordinator_se { (void)memcpy(active.members, members, count * sizeof(members[0U])); active.members_count = count; - active.info = info; + memcpy(&active.info, info, sizeof(active.info)); if (count > 1U && CONFIG_BT_MAX_CONN > 1) { qsort(active.members, count, sizeof(members[0U]), @@ -1079,7 +1079,7 @@ static void csip_set_coordinator_write_restore_cb(struct bt_conn *conn, int csip_err; member = active.members[active.members_handled - active.members_restored - 1]; - client->cur_inst = lookup_instance_by_set_info(member, active.info); + client->cur_inst = lookup_instance_by_set_info(member, &active.info); if (client->cur_inst == NULL) { release_set_complete(-ENOENT); @@ -1114,9 +1114,9 @@ static void csip_set_coordinator_write_lock_cb(struct bt_conn *conn, active.members_restored = 0; member = active.members[active.members_handled - active.members_restored]; - client->cur_inst = lookup_instance_by_set_info(member, active.info); + client->cur_inst = lookup_instance_by_set_info(member, &active.info); if (client->cur_inst == NULL) { - LOG_DBG("Failed to lookup instance by set_info %p", active.info); + LOG_DBG("Failed to lookup instance by set_info"); lock_set_complete(-ENOENT); return; @@ -1214,7 +1214,7 @@ static void csip_set_coordinator_write_release_cb(struct bt_conn *conn, uint8_t static void csip_set_coordinator_lock_state_read_cb(int err, bool locked) { - const struct bt_csip_set_coordinator_set_info *info = active.info; + const struct bt_csip_set_coordinator_set_info *info = &active.info; struct bt_csip_set_coordinator_set_member *cur_member = NULL; if (err || locked) { @@ -1606,9 +1606,9 @@ csip_set_coordinator_get_lock_state(const struct bt_csip_set_coordinator_set_mem for (uint8_t i = 0U; i < count; i++) { struct bt_csip_set_coordinator_svc_inst *svc_inst; - svc_inst = lookup_instance_by_set_info(active.members[i], active.info); + svc_inst = lookup_instance_by_set_info(active.members[i], &active.info); if (svc_inst == NULL) { - LOG_DBG("Failed to lookup instance by set_info %p", active.info); + LOG_DBG("Failed to lookup instance by set_info"); active_members_reset(); return -ENOENT; @@ -1632,11 +1632,11 @@ csip_set_coordinator_get_lock_state(const struct bt_csip_set_coordinator_set_mem * here. */ if (active.oap_cb == NULL || - !active.oap_cb(active.info, active.members, active.members_count)) { + !active.oap_cb(&active.info, active.members, active.members_count)) { err = -ECANCELED; } - ordered_access_complete(active.info, err, false, NULL); + ordered_access_complete(&active.info, err, false, NULL); } return err; @@ -1718,9 +1718,9 @@ int bt_csip_set_coordinator_lock( active_members_store_ordered(members, count, set_info, true); - svc_inst = lookup_instance_by_set_info(active.members[0], active.info); + svc_inst = lookup_instance_by_set_info(active.members[0], &active.info); if (svc_inst == NULL) { - LOG_DBG("Failed to lookup instance by set_info %p", active.info); + LOG_DBG("Failed to lookup instance by set_info"); active_members_reset(); return -ENOENT; @@ -1764,9 +1764,9 @@ int bt_csip_set_coordinator_release(const struct bt_csip_set_coordinator_set_mem active_members_store_ordered(members, count, set_info, false); - svc_inst = lookup_instance_by_set_info(active.members[0], active.info); + svc_inst = lookup_instance_by_set_info(active.members[0], &active.info); if (svc_inst == NULL) { - LOG_DBG("Failed to lookup instance by set_info %p", active.info); + LOG_DBG("Failed to lookup instance by set_info"); active_members_reset(); return -ENOENT; From e20c095eeebe2cb0bc8455ef6ee87ee49bc3d5d5 Mon Sep 17 00:00:00 2001 From: Xiaoli Ji Date: Wed, 6 Nov 2024 13:55:32 +0800 Subject: [PATCH 080/113] soc: nxp: imxrt118x: update MPU configuration fixes: #80721 Updated mpu region address to secure address. Signed-off-by: Xiaoli Ji --- soc/nxp/imxrt/imxrt118x/m33/mpu_regions.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/soc/nxp/imxrt/imxrt118x/m33/mpu_regions.c b/soc/nxp/imxrt/imxrt118x/m33/mpu_regions.c index 13a20dd1be6ecc..0e017caa56b3cf 100644 --- a/soc/nxp/imxrt/imxrt118x/m33/mpu_regions.c +++ b/soc/nxp/imxrt/imxrt118x/m33/mpu_regions.c @@ -7,18 +7,18 @@ #include #include -#define REGION_HYPERRAM_BASE_ADDRESS 0x04000000 -#define REGION_HYPERRAM_SIZE 0x04000000 -#define REGION_DTCM_BASE_ADDRESS 0x20000000 +#define REGION_FLEXSPI2_BASE_ADDRESS 0x14000000 +#define REGION_FLEXSPI2_SIZE 0x04000000 +#define REGION_DTCM_BASE_ADDRESS 0x30000000 #define REGION_DTCM_SIZE 0x00020000 -#define REGION_FLEXSPI_BASE_ADDRESS 0x28000000 +#define REGION_FLEXSPI_BASE_ADDRESS 0x38000000 #define REGION_FLEXSPI_SIZE 0x08000000 -#define REGION_PERIPHERAL_BASE_ADDRESS 0x40000000 +#define REGION_PERIPHERAL_BASE_ADDRESS 0x50000000 #define REGION_PERIPHERAL_SIZE 0x40000000 static const struct arm_mpu_region mpu_regions[] = { - MPU_REGION_ENTRY("HYPERRAM", REGION_HYPERRAM_BASE_ADDRESS, - REGION_RAM_ATTR(REGION_HYPERRAM_BASE_ADDRESS, REGION_HYPERRAM_SIZE)), + MPU_REGION_ENTRY("FLEXSPI2", REGION_FLEXSPI2_BASE_ADDRESS, + REGION_RAM_ATTR(REGION_FLEXSPI2_BASE_ADDRESS, REGION_FLEXSPI2_SIZE)), MPU_REGION_ENTRY("FLEXSPI", REGION_FLEXSPI_BASE_ADDRESS, REGION_FLASH_ATTR(REGION_FLEXSPI_BASE_ADDRESS, REGION_FLEXSPI_SIZE)), MPU_REGION_ENTRY("DTCM", REGION_DTCM_BASE_ADDRESS, From ec10d56fbb4e9ede93b4fc1973940279f8ab95a3 Mon Sep 17 00:00:00 2001 From: Daniel Kampert Date: Thu, 19 Sep 2024 13:38:03 +0200 Subject: [PATCH 081/113] drivers: rtc: rv8263-c8: Alarm reworking - Fix typos for alarm field identification - Fix a bug where an alarm interrupt starts update interrupts - Rework interrupt code to reduce code size and complexity Signed-off-by: Daniel Kampert --- drivers/rtc/rtc_rv8263.c | 94 ++++++++++++++++++---------------------- 1 file changed, 43 insertions(+), 51 deletions(-) diff --git a/drivers/rtc/rtc_rv8263.c b/drivers/rtc/rtc_rv8263.c index f3cf86c6c7a111..7e76e7fc55d1f6 100644 --- a/drivers/rtc/rtc_rv8263.c +++ b/drivers/rtc/rtc_rv8263.c @@ -86,16 +86,18 @@ struct rv8263c8_data { struct gpio_callback gpio_cb; #endif +#if (CONFIG_RTC_ALARM || CONFIG_RTC_UPDATE) && DT_ANY_INST_HAS_PROP_STATUS_OKAY(int_gpios) + struct k_work interrupt_work; +#endif + #if CONFIG_RTC_ALARM && DT_ANY_INST_HAS_PROP_STATUS_OKAY(int_gpios) rtc_alarm_callback alarm_cb; void *alarm_cb_data; - struct k_work alarm_work; #endif #if CONFIG_RTC_UPDATE && DT_ANY_INST_HAS_PROP_STATUS_OKAY(int_gpios) rtc_update_callback update_cb; void *update_cb_data; - struct k_work update_work; #endif }; @@ -126,41 +128,12 @@ static void rv8263c8_gpio_callback_handler(const struct device *p_port, struct g struct rv8263c8_data *data = CONTAINER_OF(p_cb, struct rv8263c8_data, gpio_cb); -#if CONFIG_RTC_ALARM - k_work_submit(&data->alarm_work); -#endif - -#if CONFIG_RTC_UPDATE - k_work_submit(&data->update_work); +#if CONFIG_RTC_ALARM || CONFIG_RTC_UPDATE + k_work_submit(&data->interrupt_work); #endif } #endif -#if CONFIG_RTC_ALARM && DT_ANY_INST_HAS_PROP_STATUS_OKAY(int_gpios) -static void rv8263c8_alarm_worker(struct k_work *p_work) -{ - struct rv8263c8_data *data = CONTAINER_OF(p_work, struct rv8263c8_data, alarm_work); - const struct rv8263c8_config *config = data->dev->config; - - LOG_DBG("Process alarm worker from interrupt"); - - if (data->alarm_cb != NULL) { - uint8_t reg; - - i2c_reg_read_byte_dt(&config->i2c_bus, RV8263C8_REGISTER_CONTROL_2, ®); - - if (reg & RV8263C8_BM_AF) { - reg &= ~RV8263C8_BM_AF; - - LOG_DBG("Calling alarm callback"); - data->alarm_cb(data->dev, 0, data->alarm_cb_data); - - i2c_reg_write_byte_dt(&config->i2c_bus, RV8263C8_REGISTER_CONTROL_2, reg); - } - } -} -#endif - #if CONFIG_RTC_UPDATE && DT_ANY_INST_HAS_PROP_STATUS_OKAY(int_gpios) static int rv8263c8_update_enable_timer(const struct device *dev) { @@ -181,27 +154,48 @@ static int rv8263c8_update_enable_timer(const struct device *dev) RV8263_BM_TI_TP_PULSE; return i2c_write_dt(&config->i2c_bus, buf, 2); } +#endif -static void rv8263c8_update_worker(struct k_work *p_work) +#if (CONFIG_RTC_ALARM || CONFIG_RTC_UPDATE) && DT_ANY_INST_HAS_PROP_STATUS_OKAY(int_gpios) +static void rv8263c8_interrupt_worker(struct k_work *p_work) { uint8_t reg; - struct rv8263c8_data *data = CONTAINER_OF(p_work, struct rv8263c8_data, update_work); + struct rv8263c8_data *data = CONTAINER_OF(p_work, struct rv8263c8_data, interrupt_work); const struct rv8263c8_config *config = data->dev->config; - LOG_DBG("Process update worker from interrupt"); + i2c_reg_read_byte_dt(&config->i2c_bus, RV8263C8_REGISTER_CONTROL_2, ®); - if (data->update_cb != NULL) { - i2c_reg_read_byte_dt(&config->i2c_bus, RV8263C8_REGISTER_CONTROL_2, ®); +#if CONFIG_RTC_ALARM + /* An alarm interrupt occurs. Clear the timer flag, */ + /* and call the callback. */ + if (reg & RV8263C8_BM_AF) { + LOG_DBG("Process alarm interrupt"); + reg &= ~RV8263C8_BM_AF; - if (reg & RV8263C8_BM_TF) { + if (data->alarm_cb != NULL) { + LOG_DBG("Calling alarm callback"); + data->alarm_cb(data->dev, 0, data->alarm_cb_data); + } + } +#endif + +#if CONFIG_RTC_UPDATE + /* A timer interrupt occurs. Clear the timer flag, */ + /* enable the timer again and call the callback. */ + if (reg & RV8263C8_BM_TF) { + LOG_DBG("Process update interrupt"); + reg &= ~RV8263C8_BM_TF; + + if (data->update_cb != NULL) { LOG_DBG("Calling update callback"); data->update_cb(data->dev, data->update_cb_data); } + + rv8263c8_update_enable_timer(data->dev); } +#endif - rv8263c8_update_enable_timer(data->dev); - i2c_reg_update_byte_dt(&config->i2c_bus, RV8263C8_REGISTER_CONTROL_2, RV8263C8_BM_TF, - RV8263C8_BM_TF); + i2c_reg_write_byte_dt(&config->i2c_bus, RV8263C8_REGISTER_CONTROL_2, reg); } #endif @@ -336,6 +330,7 @@ static int rv8263c8_init(const struct device *dev) #endif #if (CONFIG_RTC_ALARM || CONFIG_RTC_UPDATE) && DT_ANY_INST_HAS_PROP_STATUS_OKAY(int_gpios) + LOG_DBG("Configure interrupt pin"); if (!gpio_is_ready_dt(&config->int_gpio)) { LOG_ERR("GPIO not ready!"); return err; @@ -364,18 +359,15 @@ static int rv8263c8_init(const struct device *dev) #endif (void)k_sem_take(&data->lock, K_FOREVER); -#if CONFIG_RTC_ALARM && DT_ANY_INST_HAS_PROP_STATUS_OKAY(int_gpios) - data->alarm_work.handler = rv8263c8_alarm_worker; -#endif - -#if CONFIG_RTC_UPDATE && DT_ANY_INST_HAS_PROP_STATUS_OKAY(int_gpios) - data->update_work.handler = rv8263c8_update_worker; +#if (CONFIG_RTC_ALARM || CONFIG_RTC_UPDATE) && DT_ANY_INST_HAS_PROP_STATUS_OKAY(int_gpios) + data->interrupt_work.handler = rv8263c8_interrupt_worker; #endif #if (CONFIG_RTC_ALARM || CONFIG_RTC_UPDATE) && DT_ANY_INST_HAS_PROP_STATUS_OKAY(int_gpios) data->dev = dev; #endif k_sem_give(&data->lock); + LOG_DBG("Done"); return 0; } @@ -442,19 +434,19 @@ static int rv8263c8_alarm_set_time(const struct device *dev, uint16_t id, uint16 } if (mask & RTC_ALARM_TIME_MASK_HOUR) { - regs[3] = bin2bcd(timeptr->tm_min) & HOURS_BITS; + regs[3] = bin2bcd(timeptr->tm_hour) & HOURS_BITS; } else { regs[3] = RV8263C8_BM_ALARM_DISABLE; } if (mask & RTC_ALARM_TIME_MASK_MONTHDAY) { - regs[4] = bin2bcd(timeptr->tm_min) & DATE_BITS; + regs[4] = bin2bcd(timeptr->tm_mday) & DATE_BITS; } else { regs[4] = RV8263C8_BM_ALARM_DISABLE; } if (mask & RTC_ALARM_TIME_MASK_WEEKDAY) { - regs[5] = bin2bcd(timeptr->tm_min) & WEEKDAY_BITS; + regs[5] = bin2bcd(timeptr->tm_wday) & WEEKDAY_BITS; } else { regs[5] = RV8263C8_BM_ALARM_DISABLE; } From 308b568219b1c87ce28f8ba89395acd573867a13 Mon Sep 17 00:00:00 2001 From: Christophe Dufaza Date: Thu, 17 Oct 2024 20:44:01 +0200 Subject: [PATCH 082/113] Revert "edtlib: test filters set by including bindings" This unit test was added specifically to cover a regression reported by the CI while working on [1]. Further work on related issues [2] showed that: - [1] and [2] are dead end: we need to first rethink how bindings (and especially child-bindings) are initialized - the inclusion mechanism supported by Zephyr deserves more systematic testing in edtlib if we want to work with confidence The approach we choose is to: - revert all changes made in [1] - from there, systematically add unit tests as we address the issues we identified (or the additional features we need) one after the other [1] edtlib: fix last modified semantic in included property specs [2] edtlib: Preserve paths of properties from included child bindings See also: #65221, #78095 This reverts commit 33bb3b60d95b78149b14b7b09753c355f41fffd9. Signed-off-by: Christophe Dufaza --- .../tests/test-bindings-include/inc-base.yaml | 3 --- .../tests/test-bindings-include/top-allows.yaml | 10 ---------- .../tests/test-bindings-include/top-blocks.yaml | 10 ---------- .../dts/python-devicetree/tests/test_edtlib.py | 17 ----------------- 4 files changed, 40 deletions(-) delete mode 100644 scripts/dts/python-devicetree/tests/test-bindings-include/inc-base.yaml delete mode 100644 scripts/dts/python-devicetree/tests/test-bindings-include/top-allows.yaml delete mode 100644 scripts/dts/python-devicetree/tests/test-bindings-include/top-blocks.yaml diff --git a/scripts/dts/python-devicetree/tests/test-bindings-include/inc-base.yaml b/scripts/dts/python-devicetree/tests/test-bindings-include/inc-base.yaml deleted file mode 100644 index 59dc45eab0dbbe..00000000000000 --- a/scripts/dts/python-devicetree/tests/test-bindings-include/inc-base.yaml +++ /dev/null @@ -1,3 +0,0 @@ -# SPDX-License-Identifier: BSD-3-Clause - -include: base.yaml diff --git a/scripts/dts/python-devicetree/tests/test-bindings-include/top-allows.yaml b/scripts/dts/python-devicetree/tests/test-bindings-include/top-allows.yaml deleted file mode 100644 index a4938eb0d67680..00000000000000 --- a/scripts/dts/python-devicetree/tests/test-bindings-include/top-allows.yaml +++ /dev/null @@ -1,10 +0,0 @@ -# SPDX-License-Identifier: BSD-3-Clause - -description: Test property-allowlist filters set by including bindings - -compatible: "top-allowlist" - -include: - - name: inc-base.yaml - property-allowlist: - - x diff --git a/scripts/dts/python-devicetree/tests/test-bindings-include/top-blocks.yaml b/scripts/dts/python-devicetree/tests/test-bindings-include/top-blocks.yaml deleted file mode 100644 index 787db223a939ee..00000000000000 --- a/scripts/dts/python-devicetree/tests/test-bindings-include/top-blocks.yaml +++ /dev/null @@ -1,10 +0,0 @@ -# SPDX-License-Identifier: BSD-3-Clause - -description: Test property-blocklist filters set by including bindings. - -compatible: "top-blocklist" - -include: - - name: inc-base.yaml - property-blocklist: - - x diff --git a/scripts/dts/python-devicetree/tests/test_edtlib.py b/scripts/dts/python-devicetree/tests/test_edtlib.py index d02bfd7fc6ddf3..acf47ba6265552 100644 --- a/scripts/dts/python-devicetree/tests/test_edtlib.py +++ b/scripts/dts/python-devicetree/tests/test_edtlib.py @@ -378,23 +378,6 @@ def test_include_paths(): assert 'base.yaml' == os.path.basename(top.prop2specs["y"].path) assert 'top.yaml' == os.path.basename(top.prop2specs["p"].path) -def test_include_filters_included_bindings(): - '''Test filters set by including bindings.''' - fname2path = {'base.yaml': 'test-bindings-include/base.yaml', - 'inc-base.yaml': 'test-bindings-include/inc-base.yaml'} - - with from_here(): - top_allows = edtlib.Binding('test-bindings-include/top-allows.yaml', fname2path) - assert top_allows.prop2specs.get("x") - assert not top_allows.prop2specs.get("y") - - with from_here(): - top_blocks = edtlib.Binding('test-bindings-include/top-blocks.yaml', fname2path) - assert not top_blocks.prop2specs.get("x") - assert top_blocks.prop2specs.get("y") - - - def test_bus(): '''Test 'bus:' and 'on-bus:' in bindings''' with from_here(): From 0b946dfc01e9658cbd204ff6e3dc76f4e548bbac Mon Sep 17 00:00:00 2001 From: Christophe Dufaza Date: Thu, 17 Oct 2024 21:56:24 +0200 Subject: [PATCH 083/113] Revert "edtlib: test "last modified" semantic for ... specs" This unit test was added to cover the change introduced by [1]. Further work on related issues [2] showed that the chosen approach is dead end. We're reverting all changes made in [1]. [1] edtlib: fix last modified semantic in included property specs [2] edtlib: Preserve paths of properties from included child bindings See also: #65221, #78095 This reverts commit 70eaa61cb0a4d6796575e6c68614e7c5fe361047. Signed-off-by: Christophe Dufaza --- .../tests/test-bindings-include/base.yaml | 7 ------- .../tests/test-bindings-include/modified.yaml | 7 ------- .../tests/test-bindings-include/top.yaml | 21 ------------------- .../python-devicetree/tests/test_edtlib.py | 12 ----------- 4 files changed, 47 deletions(-) delete mode 100644 scripts/dts/python-devicetree/tests/test-bindings-include/base.yaml delete mode 100644 scripts/dts/python-devicetree/tests/test-bindings-include/modified.yaml delete mode 100644 scripts/dts/python-devicetree/tests/test-bindings-include/top.yaml diff --git a/scripts/dts/python-devicetree/tests/test-bindings-include/base.yaml b/scripts/dts/python-devicetree/tests/test-bindings-include/base.yaml deleted file mode 100644 index f564578b48d0b4..00000000000000 --- a/scripts/dts/python-devicetree/tests/test-bindings-include/base.yaml +++ /dev/null @@ -1,7 +0,0 @@ -# SPDX-License-Identifier: BSD-3-Clause - -properties: - x: - type: int - y: - type: int diff --git a/scripts/dts/python-devicetree/tests/test-bindings-include/modified.yaml b/scripts/dts/python-devicetree/tests/test-bindings-include/modified.yaml deleted file mode 100644 index 3d8130c1aedd0b..00000000000000 --- a/scripts/dts/python-devicetree/tests/test-bindings-include/modified.yaml +++ /dev/null @@ -1,7 +0,0 @@ -# SPDX-License-Identifier: BSD-3-Clause - -include: base.yaml - -properties: - x: - required: true diff --git a/scripts/dts/python-devicetree/tests/test-bindings-include/top.yaml b/scripts/dts/python-devicetree/tests/test-bindings-include/top.yaml deleted file mode 100644 index 8fb9320676d515..00000000000000 --- a/scripts/dts/python-devicetree/tests/test-bindings-include/top.yaml +++ /dev/null @@ -1,21 +0,0 @@ -# SPDX-License-Identifier: BSD-3-Clause - -description: | - Top-level binding file for testing included property spec paths. - - base.yaml: specifies properties "x" and "y" - modified.yaml: includes base.yaml, modifies property "x" - top.yaml (this file): includes modified.yaml, specifies property "p" - - From the top-level binding, we expect: - - "x" was last modified in modified.yaml - - "y" was last modified in base.yaml - - "p" was last modified in top.yaml - -compatible: top-level - -include: modified.yaml - -properties: - p: - type: int diff --git a/scripts/dts/python-devicetree/tests/test_edtlib.py b/scripts/dts/python-devicetree/tests/test_edtlib.py index acf47ba6265552..80709feac0907a 100644 --- a/scripts/dts/python-devicetree/tests/test_edtlib.py +++ b/scripts/dts/python-devicetree/tests/test_edtlib.py @@ -365,18 +365,6 @@ def test_include_filters(): assert set(child.prop2specs.keys()) == {'child-prop-1', 'child-prop-2', 'x', 'z'} # root level 'y' is blocked -def test_include_paths(): - '''Test "last modified" semantic for included bindings paths.''' - - fname2path = {'base.yaml': 'test-bindings-include/base.yaml', - 'modified.yaml': 'test-bindings-include/modified.yaml'} - - with from_here(): - top = edtlib.Binding('test-bindings-include/top.yaml', fname2path) - - assert 'modified.yaml' == os.path.basename(top.prop2specs["x"].path) - assert 'base.yaml' == os.path.basename(top.prop2specs["y"].path) - assert 'top.yaml' == os.path.basename(top.prop2specs["p"].path) def test_bus(): '''Test 'bus:' and 'on-bus:' in bindings''' From c58d6761bcf5c7b4e27c173975e8bbe6098b579f Mon Sep 17 00:00:00 2001 From: Christophe Dufaza Date: Thu, 17 Oct 2024 22:16:29 +0200 Subject: [PATCH 084/113] edtlib: tests: cover basics of filtering inherited properties Use-case "B includes I includes X": - X is a base binding file, specifying common properties - I is an intermediary binding file, which includes X without modification nor filter - B includes I, filtering the properties it chooses to inherit with an allowlist or a blocklist Check that the properties inherited from X via I are actually filtered as B intends to, up to the grandchild-binding level. Signed-off-by: Christophe Dufaza --- .../tests/test-bindings-include/simple.yaml | 30 +++++ .../simple_filter_allowlist.yaml | 12 ++ .../simple_filter_blocklist.yaml | 12 ++ .../test-bindings-include/simple_inherit.yaml | 5 + .../python-devicetree/tests/test_edtlib.py | 112 ++++++++++++++++++ 5 files changed, 171 insertions(+) create mode 100644 scripts/dts/python-devicetree/tests/test-bindings-include/simple.yaml create mode 100644 scripts/dts/python-devicetree/tests/test-bindings-include/simple_filter_allowlist.yaml create mode 100644 scripts/dts/python-devicetree/tests/test-bindings-include/simple_filter_blocklist.yaml create mode 100644 scripts/dts/python-devicetree/tests/test-bindings-include/simple_inherit.yaml diff --git a/scripts/dts/python-devicetree/tests/test-bindings-include/simple.yaml b/scripts/dts/python-devicetree/tests/test-bindings-include/simple.yaml new file mode 100644 index 00000000000000..9ce3fe8b1ee268 --- /dev/null +++ b/scripts/dts/python-devicetree/tests/test-bindings-include/simple.yaml @@ -0,0 +1,30 @@ +# SPDX-License-Identifier: BSD-3-Clause +# +# Base properties for testing property filters up to +# the grandchild-binding level. + +properties: + prop-1: + type: int + prop-2: + type: int + prop-3: + type: int + +child-binding: + properties: + child-prop-1: + type: int + child-prop-2: + type: int + child-prop-3: + type: int + + child-binding: + properties: + grandchild-prop-1: + type: int + grandchild-prop-2: + type: int + grandchild-prop-3: + type: int diff --git a/scripts/dts/python-devicetree/tests/test-bindings-include/simple_filter_allowlist.yaml b/scripts/dts/python-devicetree/tests/test-bindings-include/simple_filter_allowlist.yaml new file mode 100644 index 00000000000000..cae1cb2800acc3 --- /dev/null +++ b/scripts/dts/python-devicetree/tests/test-bindings-include/simple_filter_allowlist.yaml @@ -0,0 +1,12 @@ +# SPDX-License-Identifier: BSD-3-Clause +# +# Filter inherited property specifications +# up to the grandchild-binding level. + +include: + - name: simple_inherit.yaml + property-allowlist: [prop-1] + child-binding: + property-allowlist: [child-prop-1] + child-binding: + property-allowlist: [grandchild-prop-1] diff --git a/scripts/dts/python-devicetree/tests/test-bindings-include/simple_filter_blocklist.yaml b/scripts/dts/python-devicetree/tests/test-bindings-include/simple_filter_blocklist.yaml new file mode 100644 index 00000000000000..e605c6a65dc5e7 --- /dev/null +++ b/scripts/dts/python-devicetree/tests/test-bindings-include/simple_filter_blocklist.yaml @@ -0,0 +1,12 @@ +# SPDX-License-Identifier: BSD-3-Clause +# +# Filter inherited property specifications +# up to the grandchild-binding level. + +include: + - name: simple_inherit.yaml + property-blocklist: [prop-2, prop-3] + child-binding: + property-blocklist: [child-prop-2, child-prop-3] + child-binding: + property-blocklist: [grandchild-prop-2, grandchild-prop-3] diff --git a/scripts/dts/python-devicetree/tests/test-bindings-include/simple_inherit.yaml b/scripts/dts/python-devicetree/tests/test-bindings-include/simple_inherit.yaml new file mode 100644 index 00000000000000..8a95ef38f95115 --- /dev/null +++ b/scripts/dts/python-devicetree/tests/test-bindings-include/simple_inherit.yaml @@ -0,0 +1,5 @@ +# SPDX-License-Identifier: BSD-3-Clause +# +# Inherits property specifications without modification. + +include: simple.yaml diff --git a/scripts/dts/python-devicetree/tests/test_edtlib.py b/scripts/dts/python-devicetree/tests/test_edtlib.py index 80709feac0907a..30fbc7c3fc36f3 100644 --- a/scripts/dts/python-devicetree/tests/test_edtlib.py +++ b/scripts/dts/python-devicetree/tests/test_edtlib.py @@ -365,6 +365,118 @@ def test_include_filters(): assert set(child.prop2specs.keys()) == {'child-prop-1', 'child-prop-2', 'x', 'z'} # root level 'y' is blocked +def test_include_filters_inherited_bindings() -> None: + '''Test the basics of filtering properties inherited via an intermediary binding file. + + Use-case "B includes I includes X": + - X is a base binding file, specifying common properties + - I is an intermediary binding file, which includes X without modification + nor filter + - B includes I, filtering the properties it chooses to inherit + with an allowlist or a blocklist + + Checks that the properties inherited from X via I are actually filtered + as B intends to. + ''' + fname2path = { + # Base binding file, specifies a few properties up to the grandchild-binding level. + "simple.yaml": "test-bindings-include/simple.yaml", + # 'include:'s the base file above, without modification nor filter + "simple_inherit.yaml": "test-bindings-include/simple_inherit.yaml", + } + with from_here(): + binding = edtlib.Binding( + # Filters inherited specifications with an allowlist. + "test-bindings-include/simple_filter_allowlist.yaml", + fname2path, + require_compatible=False, + require_description=False, + ) + # Only property allowed. + assert {"prop-1"} == set(binding.prop2specs.keys()) + + with from_here(): + binding = edtlib.Binding( + # Filters inherited specifications with a blocklist. + "test-bindings-include/simple_filter_blocklist.yaml", + fname2path, + require_compatible=False, + require_description=False, + ) + # Only non blocked property. + assert {"prop-1"} == set(binding.prop2specs.keys()) + +def test_include_filters_inherited_child_bindings() -> None: + '''Test the basics of filtering properties inherited via an intermediary binding file + (child-binding level). + + See also: test_include_filters_inherited_bindings() + ''' + fname2path = { + "simple.yaml": "test-bindings-include/simple.yaml", + "simple_inherit.yaml": "test-bindings-include/simple_inherit.yaml", + } + with from_here(): + binding = edtlib.Binding( + "test-bindings-include/simple_filter_allowlist.yaml", + fname2path, + require_compatible=False, + require_description=False, + ) + assert binding.child_binding + child_binding = binding.child_binding + # Only property allowed. + assert {"child-prop-1"} == set(child_binding.prop2specs.keys()) + + with from_here(): + binding = edtlib.Binding( + "test-bindings-include/simple_filter_blocklist.yaml", + fname2path, + require_compatible=False, + require_description=False, + ) + # Only non blocked property. + assert binding.child_binding + child_binding = binding.child_binding + assert {"child-prop-1"} == set(child_binding.prop2specs.keys()) + +def test_include_filters_inherited_grandchild_bindings() -> None: + '''Test the basics of filtering properties inherited via an intermediary binding file + (grandchild-binding level). + + See also: test_include_filters_inherited_bindings() + ''' + fname2path = { + "simple.yaml": "test-bindings-include/simple.yaml", + "simple_inherit.yaml": "test-bindings-include/simple_inherit.yaml", + } + with from_here(): + binding = edtlib.Binding( + "test-bindings-include/simple_filter_allowlist.yaml", + fname2path, + require_compatible=False, + require_description=False, + ) + assert binding.child_binding + child_binding = binding.child_binding + assert child_binding.child_binding + grandchild_binding = child_binding.child_binding + # Only property allowed. + assert {"grandchild-prop-1"} == set(grandchild_binding.prop2specs.keys()) + + with from_here(): + binding = edtlib.Binding( + "test-bindings-include/simple_filter_blocklist.yaml", + fname2path, + require_compatible=False, + require_description=False, + ) + assert binding.child_binding + child_binding = binding.child_binding + assert child_binding.child_binding + grandchild_binding = child_binding.child_binding + # Only non blocked property. + assert {"grandchild-prop-1"} == set(grandchild_binding.prop2specs.keys()) def test_bus(): '''Test 'bus:' and 'on-bus:' in bindings''' From b0b278503f75bab70a10e65b0287f879765e661f Mon Sep 17 00:00:00 2001 From: Christophe Dufaza Date: Thu, 17 Oct 2024 22:21:24 +0200 Subject: [PATCH 085/113] Revert "edtlib: fix "last modified" semantic for included ... specs" [1] was introduced to get more valuable answers from the PropertySpec.path API, which is supposed to tell in which file the property's specification was "last modfied". Further work on related issues [2] showed that the approach chosen in [1] is dead end: we need to first rethink how bindings (and especially child-bindings) are initialized. [1] edtlib: fix last modified semantic in included property specs [2] edtlib: Preserve paths of properties from included child bindings See also: #65221, #78095 This reverts commit b3b5ad8156866ac39a6ac63236bada28d650b5d6. Signed-off-by: Christophe Dufaza --- .../src/devicetree/edtlib.py | 131 ++---------------- 1 file changed, 15 insertions(+), 116 deletions(-) diff --git a/scripts/dts/python-devicetree/src/devicetree/edtlib.py b/scripts/dts/python-devicetree/src/devicetree/edtlib.py index 099f3672addc12..61db1c8af34374 100644 --- a/scripts/dts/python-devicetree/src/devicetree/edtlib.py +++ b/scripts/dts/python-devicetree/src/devicetree/edtlib.py @@ -163,9 +163,7 @@ class Binding: def __init__(self, path: Optional[str], fname2path: Dict[str, str], raw: Any = None, require_compatible: bool = True, - require_description: bool = True, - inc_allowlist: Optional[List[str]] = None, - inc_blocklist: Optional[List[str]] = None): + require_description: bool = True): """ Binding constructor. @@ -193,36 +191,16 @@ def __init__(self, path: Optional[str], fname2path: Dict[str, str], "description:" line. If False, a missing "description:" is not an error. Either way, "description:" must be a string if it is present in the binding. - - inc_allowlist: - The property-allowlist filter set by including bindings. - - inc_blocklist: - The property-blocklist filter set by including bindings. """ self.path: Optional[str] = path self._fname2path: Dict[str, str] = fname2path - self._inc_allowlist: Optional[List[str]] = inc_allowlist - self._inc_blocklist: Optional[List[str]] = inc_blocklist - if raw is None: if path is None: _err("you must provide either a 'path' or a 'raw' argument") with open(path, encoding="utf-8") as f: raw = yaml.load(f, Loader=_BindingLoader) - # Get the properties this binding modifies - # before we merge the included ones. - last_modified_props = list(raw.get("properties", {}).keys()) - - # Map property names to their specifications: - # - first, _merge_includes() will recursively populate prop2specs with - # the properties specified by the included bindings - # - eventually, we'll update prop2specs with the properties - # this binding itself defines or modifies - self.prop2specs: Dict[str, 'PropertySpec'] = {} - # Merge any included files into self.raw. This also pulls in # inherited child binding definitions, so it has to be done # before initializing those. @@ -246,11 +224,10 @@ def __init__(self, path: Optional[str], fname2path: Dict[str, str], # Make sure this is a well defined object. self._check(require_compatible, require_description) - # Update specs with the properties this binding defines or modifies. - for prop_name in last_modified_props: - self.prop2specs[prop_name] = PropertySpec(prop_name, self) - # Initialize look up tables. + self.prop2specs: Dict[str, 'PropertySpec'] = {} + for prop_name in self.raw.get("properties", {}).keys(): + self.prop2specs[prop_name] = PropertySpec(prop_name, self) self.specifier2cells: Dict[str, List[str]] = {} for key, val in self.raw.items(): if key.endswith("-cells"): @@ -314,41 +291,18 @@ def _merge_includes(self, raw: dict, binding_path: Optional[str]) -> dict: if isinstance(include, str): # Simple scalar string case - # Load YAML file and register property specs into prop2specs. - inc_raw = self._load_raw(include, self._inc_allowlist, - self._inc_blocklist) - - _merge_props(merged, inc_raw, None, binding_path, False) + _merge_props(merged, self._load_raw(include), None, binding_path, + False) elif isinstance(include, list): # List of strings and maps. These types may be intermixed. for elem in include: if isinstance(elem, str): - # Load YAML file and register property specs into prop2specs. - inc_raw = self._load_raw(elem, self._inc_allowlist, - self._inc_blocklist) - - _merge_props(merged, inc_raw, None, binding_path, False) + _merge_props(merged, self._load_raw(elem), None, + binding_path, False) elif isinstance(elem, dict): name = elem.pop('name', None) - - # Merge this include property-allowlist filter - # with filters from including bindings. allowlist = elem.pop('property-allowlist', None) - if allowlist is not None: - if self._inc_allowlist: - allowlist.extend(self._inc_allowlist) - else: - allowlist = self._inc_allowlist - - # Merge this include property-blocklist filter - # with filters from including bindings. blocklist = elem.pop('property-blocklist', None) - if blocklist is not None: - if self._inc_blocklist: - blocklist.extend(self._inc_blocklist) - else: - blocklist = self._inc_blocklist - child_filter = elem.pop('child-binding', None) if elem: @@ -359,12 +313,10 @@ def _merge_includes(self, raw: dict, binding_path: Optional[str]) -> dict: _check_include_dict(name, allowlist, blocklist, child_filter, binding_path) - # Load YAML file, and register (filtered) property specs - # into prop2specs. - contents = self._load_raw(name, - allowlist, blocklist, - child_filter) + contents = self._load_raw(name) + _filter_properties(contents, allowlist, blocklist, + child_filter, binding_path) _merge_props(merged, contents, None, binding_path, False) else: _err(f"all elements in 'include:' in {binding_path} " @@ -384,17 +336,11 @@ def _merge_includes(self, raw: dict, binding_path: Optional[str]) -> dict: return raw - - def _load_raw(self, fname: str, - allowlist: Optional[List[str]] = None, - blocklist: Optional[List[str]] = None, - child_filter: Optional[dict] = None) -> dict: + def _load_raw(self, fname: str) -> dict: # Returns the contents of the binding given by 'fname' after merging - # any bindings it lists in 'include:' into it, according to the given - # property filters. - # - # Will also register the (filtered) included property specs - # into prop2specs. + # any bindings it lists in 'include:' into it. 'fname' is just the + # basename of the file, so we check that there aren't multiple + # candidates. path = self._fname2path.get(fname) @@ -406,55 +352,8 @@ def _load_raw(self, fname: str, if not isinstance(contents, dict): _err(f'{path}: invalid contents, expected a mapping') - # Apply constraints to included YAML contents. - _filter_properties(contents, - allowlist, blocklist, - child_filter, self.path) - - # Register included property specs. - self._add_included_prop2specs(fname, contents, allowlist, blocklist) - return self._merge_includes(contents, path) - def _add_included_prop2specs(self, fname: str, contents: dict, - allowlist: Optional[List[str]] = None, - blocklist: Optional[List[str]] = None) -> None: - # Registers the properties specified by an included binding file - # into the properties this binding supports/requires (aka prop2specs). - # - # Consider "this" binding B includes I1 which itself includes I2. - # - # We assume to be called in that order: - # 1) _add_included_prop2spec(B, I1) - # 2) _add_included_prop2spec(B, I2) - # - # Where we don't want I2 "taking ownership" for properties - # modified by I1. - # - # So we: - # - first create a binding that represents the included file - # - then add the property specs defined by this binding to prop2specs, - # without overriding the specs modified by an including binding - # - # Note: Unfortunately, we can't cache these base bindings, - # as a same YAML file may be included with different filters - # (property-allowlist and such), leading to different contents. - - inc_binding = Binding( - self._fname2path[fname], - self._fname2path, - contents, - require_compatible=False, - require_description=False, - # Recursively pass filters to included bindings. - inc_allowlist=allowlist, - inc_blocklist=blocklist, - ) - - for prop, spec in inc_binding.prop2specs.items(): - if prop not in self.prop2specs: - self.prop2specs[prop] = spec - def _check(self, require_compatible: bool, require_description: bool): # Does sanity checking on the binding. From 8a824f307d0b69ccb3161eddc6be2a08ef60f112 Mon Sep 17 00:00:00 2001 From: Anas Nashif Date: Thu, 17 Oct 2024 12:01:34 -0400 Subject: [PATCH 086/113] mips: tracing: add switched_out trace point add missing switched_out trace point. Partially fixes #76057 Signed-off-by: Anas Nashif --- arch/mips/core/isr.S | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/arch/mips/core/isr.S b/arch/mips/core/isr.S index 86d05d19833567..f2f2f342053641 100644 --- a/arch/mips/core/isr.S +++ b/arch/mips/core/isr.S @@ -70,6 +70,7 @@ GTEXT(_Fault) GTEXT(_k_neg_eagain) GTEXT(z_thread_mark_switched_in) +GTEXT(z_thread_mark_switched_out) /* exports */ GTEXT(__isr_vec) @@ -209,6 +210,9 @@ on_thread_stack: #endif /* CONFIG_PREEMPT_ENABLED */ reschedule: +#ifdef CONFIG_INSTRUMENT_THREAD_SWITCHING + jal z_thread_mark_switched_out +#endif /* * Check if the current thread is the same as the thread on the ready Q. If * so, do not reschedule. From 2f6a65c8a466714b51dcd17a1f41bd5135553105 Mon Sep 17 00:00:00 2001 From: Szymon Janc Date: Thu, 10 Oct 2024 16:13:24 +0200 Subject: [PATCH 087/113] test: bluetooth: Update ICS to TCRL 2024-2 GAP PAST (and BAP) tests were also enabled since controller support is under review. This also adds bqw file which is exported draft project from Qualification Workspace. Signed-off-by: Szymon Janc --- tests/bluetooth/qualification/.editorconfig | 2 +- .../ICS_Zephyr_Bluetooth_Host.bqw | 3161 +++++++++++++++++ .../ICS_Zephyr_Bluetooth_Host.pts | 383 +- 3 files changed, 3519 insertions(+), 27 deletions(-) create mode 100644 tests/bluetooth/qualification/ICS_Zephyr_Bluetooth_Host.bqw diff --git a/tests/bluetooth/qualification/.editorconfig b/tests/bluetooth/qualification/.editorconfig index 40957fa40e6b92..38519f2381289e 100644 --- a/tests/bluetooth/qualification/.editorconfig +++ b/tests/bluetooth/qualification/.editorconfig @@ -1,2 +1,2 @@ -[*.{pts}] +[*.{pts,bqw}] end_of_line = crlf diff --git a/tests/bluetooth/qualification/ICS_Zephyr_Bluetooth_Host.bqw b/tests/bluetooth/qualification/ICS_Zephyr_Bluetooth_Host.bqw new file mode 100644 index 00000000000000..958ad9fd319b5c --- /dev/null +++ b/tests/bluetooth/qualification/ICS_Zephyr_Bluetooth_Host.bqw @@ -0,0 +1,3161 @@ + + + + + + + + + + GAP 10/5 + GAP 16/3 + GAP 31/8 + GAP 8a/11 + GAP 8a/15 + GAP 8a/16 + GAP 10/4 + GAP 16/4 + GAP 36/3 + GAP 8a/7 + GAP 17/3 + GAP 35/4 + GAP 8a/1 + GAP 8a/4 + GAP 21/2 + GAP 21/10 + GAP 22/1 + GAP 31/10 + GAP 32/1 + GAP 32/2 + GAP 22/3 + GAP 24/4 + GAP 10/2 + GAP 11/2 + GAP 36/5 + GAP 8a/2 + GAP 8a/9 + GAP 12/2 + GAP 21/9 + GAP 22/2 + GAP 24/2 + GAP 25/4 + GAP 31/4 + GAP 35/3 + GAP 35/5 + GAP 36/2 + GAP 8a/3 + GAP 8a/8 + GAP 8a/10 + GAP 12/1 + GAP 21/7 + GAP 28/1 + GAP 31/1 + GAP 31/6 + GAP 31/9 + GAP 8a/13 + GAP 8a/17 + GAP 6/1 + GAP 9/1 + GAP 16/1 + GAP 35/6 + GAP 14a/18 + GAP 30a/1 + GAP 30a/3 + GAP 34/3 + GAP 37b/6 + GAP 8a/5 + GAP 10/1 + GAP 21/1 + GAP 21/4 + GAP 22/4 + GAP 24/1 + GAP 32/3 + GAP 34/2 + GAP 8a/19 + GAP 14a/1 + GAP 14a/13 + GAP 27b/7 + GAP 37b/1 + GAP 6/2 + GAP 15/1 + GAP 17/1 + GAP 18/1 + GAP 18/2 + GAP 21/5 + GAP 28/2 + GAP 34/1 + GAP 36/1 + GAP 8a/12 + GAP 8a/14 + GAP 11/3 + GAP 14a/2 + GAP 14a/8 + GAP 14a/12 + GAP 14a/16 + GAP 14a/19 + GAP 24/3 + GAP 30a/11 + GAP 14a/4 + GAP 14a/14 + GAP 30a/7 + GAP 30a/12 + GAP 37b/7 + GAP 10/3 + GAP 20/3 + GAP 25/14 + GAP 27c/2 + GAP 27c/3 + GAP 14a/3 + GAP 14a/5 + GAP 14a/6 + GAP 14a/7 + GAP 30a/6 + GAP 30a/8 + GAP 30a/17 + GAP 35/14 + GAP 37b/8 + GAP 14a/9 + GAP 14a/11 + GAP 30a/9 + GAP 30a/14 + GAP 30a/18 + GAP 30a/19 + GAP 8a/18 + GAP 27b/1 + GAP 30a/2 + GAP 30a/4 + GAP 30a/5 + GAP 30a/10 + GAP 30a/13 + GAP 11/1 + GAP 21/6 + GAP 25/3 + GAP 31/2 + GAP 31/5 + GAP 21/8 + GAP 5/2 + GAP 8/3 + GAP 11b/1 + GAP 14/1 + GAP 5/1 + GAP 14a/10 + GAP 14a/15 + GAP 14a/17 + GAP 27b/6 + GAP 27b/8 + GAP 30a/15 + GAP 30a/16 + GAP 8/2 + GAP 20/2 + GAP 31/11 + GAP 35/15 + GAP 37b/9 + GAP 37c/1 + GAP 37c/3 + GAP 7/1 + GAP 13/2 + GAP 17a/2 + GAP 17b/1 + GAP 20/6 + GAP 20A/5 + GAP 20A/8 + GAP 23/2 + GAP 23/6 + GAP 25/1 + GAP 25/6 + GAP 25/12 + GAP 25/13a + GAP 27/7 + GAP 33/4 + GAP 33/8a + GAP 35/10 + GAP 37/3 + GAP 37/3a + GAP 37a/6 + GAP 20/1 + GAP 27b/9 + GAP 27c/1 + GAP 5/3 + GAP 8/5 + GAP 14/2 + GAP 7/3 + GAP 11a/2 + GAP 17a/1 + GAP 17a/4 + GAP 19/1 + GAP 20/5 + GAP 20A/7 + GAP 20A/18 + GAP 23/3 + GAP 23/7 + GAP 23/7a + GAP 25/2 + GAP 25/5 + GAP 26/3 + GAP 27/5 + GAP 27a/1 + GAP 27a/3 + GAP 27a/4 + GAP 27a/5 + GAP 27b/5 + GAP 31/3 + GAP 37a/2 + GAP 17/4 + GAP 20A/3 + GAP 20A/15 + GAP 25/9 + GAP 25/13b + GAP 25/13c + GAP 27/6 + GAP 27a/2 + GAP 29/4 + GAP 30/1 + GAP 33/1 + GAP 33/5 + GAP 33/8 + GAP 35/8 + GAP 35/11 + GAP 35/12 + GAP 35/13 + GAP 35/13c + GAP 11/5 + GAP 11a/1 + GAP 13/1 + GAP 17/2 + GAP 17/5 + GAP 17b/2 + GAP 20/7 + GAP 20A/2 + GAP 20A/9 + GAP 20A/11 + GAP 20A/13 + GAP 20A/16 + GAP 23/1 + GAP 23/5 + GAP 26/6 + GAP 27/1 + GAP 27/9 + GAP 30/2 + GAP 33/7 + GAP 36/6 + GAP 37a/4 + GAP 0/2 + GAP 17b/3 + GAP 20A/6 + GAP 25/10 + GAP 25/13 + GAP 26/1 + GAP 26/2 + GAP 26/4 + GAP 27/9a + GAP 27b/2 + GAP 29/3 + GAP 33/2 + GAP 35/13a + GAP 35/13b + GAP 37b/5 + GAP 8a/14a + GAP 21/11 + GAP 30a/14a + GAP 8/4 + GAP 8a/6 + GAP 11b/3 + GAP 17a/5 + GAP 19/2 + GAP 19/3 + GAP 20A/10 + GAP 20A/12 + GAP 20A/14a + GAP 20A/17 + GAP 21/3 + GAP 25/7 + GAP 26/5 + GAP 29/1 + GAP 29/2 + GAP 35/1 + GAP 35/9 + GAP 37/7 + GAP 37a/1 + GAP 37a/5 + GAP 37b/2 + GAP 8/1 + GAP 16/2 + GAP 37c/2 + GAP 14a/14a + GAP 20/4 + GAP 5/4 + GAP 11/4 + GAP 7/2 + GAP 11b/2 + GAP 11b/4 + GAP 17b/4 + GAP 20A/4 + GAP 20A/19 + GAP 23/4 + GAP 25/8 + GAP 25/11 + GAP 27b/3 + GAP 33/6 + GAP 35/7 + GAP 37/2 + GAP 37/6 + GAP 37a/3 + GAP 37b/3 + GAP 11c/1 + GAP 20A/1 + GAP 20A/14 + GAP 27/2 + GAP 27a/6 + GAP 35/2 + GAP 37/1 + + + + + L2CAP 2/46 + L2CAP 3/1 + L2CAP 1/5 + L2CAP 2/40 + L2CAP 2/42 + L2CAP 2/47 + L2CAP 3/16 + L2CAP 2/43 + L2CAP 3/12 + L2CAP 4/3 + L2CAP 1/4 + L2CAP 1/6 + L2CAP 2/45a + L2CAP 0/2 + L2CAP 2/48 + L2CAP 4/1 + L2CAP 2/41 + L2CAP 2/48b + L2CAP 4/2 + L2CAP 2/49 + L2CAP 1/3 + + + + + IOP 2/2 + IOP 1/1 + + + + + GATT 3/10 + GATT 3/11 + GATT 3/16 + GATT 4/16 + GATT 3/7 + GATT 4/8 + GATT 4/17 + GATT 4/2 + GATT 4/22 + GATT 3/13 + GATT 3/21 + GATT 3/22 + GATT 3/23 + GATT 4/7 + GATT 3/18 + GATT 3/6 + GATT 4/4 + GATT 3/2 + GATT 3/3 + GATT 3/8 + GATT 3/12 + GATT 3/14 + GATT 3/19 + GATT 3/20 + GATT 4/6 + GATT 4/9 + GATT 4/11 + GATT 4/14 + GATT 7/7 + GATT 9/5 + GATT 9/6 + GATT 10/5 + GATT 4/25 + GATT 8/8 + GATT 3a/1 + GATT 4/12 + GATT 7/2 + GATT 9/10 + GATT 4/19 + GATT 4a/2 + GATT 9/4 + GATT 10/1 + GATT 10/3 + GATT 10/4 + GATT 10/6 + GATT 3/17 + GATT 4/21 + GATT 7/4 + GATT 7/6 + GATT 9/7 + GATT 9/8 + GATT 9/14 + GATT 10/7 + GATT 10/8 + GATT 10/12 + GATT 3/1 + GATT 4/23 + GATT 4/26 + GATT 7/8 + GATT 8/2 + GATT 4/20 + GATT 9/3 + GATT 9/9 + GATT 9/13 + GATT 10/2 + GATT 10/9 + GATT 2/5 + GATT 4/5 + GATT 7/5 + GATT 9/11 + GATT 9/15 + GATT 3/5 + GATT 4/10 + GATT 4/15 + GATT 4a/1 + GATT 4/1 + GATT 4/13 + GATT 4/18 + GATT 3/4 + GATT 3/9 + GATT 3/15 + GATT 4/3 + GATT 9/12 + GATT 1a/1 + GATT 1a/3 + GATT 2/2 + GATT 2/4 + GATT 3a/2 + GATT 7/3 + GATT 9/1 + GATT 9/2 + GATT 10/11 + GATT 2/3a + GATT 4/30 + GATT 4/31 + GATT 1/2 + GATT 3/25 + GATT 1/1 + GATT 3/29 + GATT 3/30 + GATT 3/26 + GATT 4/27 + + + + + SM 4/1 + SM 6/1 + SM 6/2 + SM 2/2 + SM 5/3 + SM 7a/3 + SM 7b/3 + SM 3/1 + SM 2/3 + SM 7a/2 + SM 5/1 + SM 5/4 + SM 5/2 + SM 7a/1 + SM 1/2 + SM 7b/2 + SM 7b/1 + SM 2/1 + SM 1/1 + SM 4/3 + SM 2/5 + SM 4/2 + + + + + ATT 3/12 + ATT 3/15 + ATT 3/18 + ATT 4/10 + ATT 4/7 + ATT 4/8 + ATT 4/12 + ATT 4/22 + ATT 4/24 + ATT 4/27 + ATT 3/3 + ATT 3/4 + ATT 3/6 + ATT 3/9 + ATT 3/19 + ATT 3/21 + ATT 3/22 + ATT 3/25 + ATT 3/28 + ATT 4/2 + ATT 4/16 + ATT 4/26 + ATT 4/20 + ATT 3/10 + ATT 3/16 + ATT 1/1 + ATT 3/26 + ATT 4/1 + ATT 4/13 + ATT 3/7 + ATT 3/11 + ATT 3/14 + ATT 3/17 + ATT 4/3 + ATT 4/6 + ATT 4/9 + ATT 4/19 + ATT 3/8 + ATT 3/23 + ATT 4/4 + ATT 4/5 + ATT 4/14 + ATT 4/17 + ATT 4/23 + ATT 7/2 + ATT 2/3a + ATT 3/31 + ATT 4/33 + ATT 1/2 + ATT 3/1 + ATT 3/2 + ATT 3/5 + ATT 3/13 + ATT 3/20 + ATT 3/24 + ATT 3/27 + ATT 4/11 + ATT 4/15 + ATT 4/18 + ATT 4/21 + ATT 4/25 + ATT 4/28 + ATT 4/32 + ATT 7/3 + ATT 6/1 + ATT 4/31 + ATT 2/2 + ATT 3/30 + ATT 3/32 + ATT 7/1 + + + + + DIS 1/2 + DIS 2/5 + DIS 2/3 + DIS 2/11 + DIS 2/2 + DIS 2/4 + DIS 2/6 + DIS 2/7 + DIS 3/3 + DIS 2/1 + DIS 0/2 + DIS 5/1 + + + + + IAS 2/2 + IAS 2/3 + IAS 1/2 + IAS 3/2 + IAS 0/1 + IAS 2/1 + IAS 2/4 + IAS 3/1 + + + + + HRS 1/2 + HRS 2/1 + HRS 3/6 + HRS 0/1 + HRS 3/2 + HRS 3/5 + HRS 2/2 + HRS 3/4 + + + + + BAS 0/2 + BAS 2/3 + BAS 2/1 + BAS 3/5 + BAS 3/3 + BAS 4/1 + BAS 1/2 + BAS 4/2 + + + + + OTS 4/13 + OTS 4/15 + OTS 6/1 + OTS 3/3 + OTS 4/7 + OTS 5/3 + OTS 5/6 + OTS 8/4 + OTS 8/7 + OTS 2/1 + OTS 4/6 + OTS 6/2 + OTS 6/4 + OTS 6/5 + OTS 3/2 + OTS 4/12 + OTS 5/2 + OTS 8/3 + OTS 4/2 + OTS 4/3 + OTS 4/16 + OTS 4/20 + OTS 5/1 + OTS 0/1 + OTS 5/9 + OTS 6/3 + OTS 7/1 + OTS 8/8 + OTS 4/1 + OTS 5/5 + OTS 8/1 + OTS 8/6 + OTS 8/2 + OTS 4/4 + OTS 4/5 + + + + + OTP 6/10 + OTP 6/12 + OTP 7/1 + OTP 7/20 + OTP 9/12 + OTP 2/2 + OTP 5/1 + OTP 7/6 + OTP 9/4 + OTP 9/9 + OTP 2/1 + OTP 6/11 + OTP 7/15 + OTP 7/17 + OTP 9/10 + OTP 0/1 + OTP 6/3 + OTP 7/3 + OTP 7/19 + OTP 8/30 + OTP 9/3 + OTP 9/11 + OTP 9/15 + OTP 3/2 + OTP 6/1 + OTP 6/13 + OTP 7/16 + OTP 9/18 + OTP 7/18 + OTP 8/1 + OTP 9/5 + OTP 9/8 + OTP 6/9 + OTP 9/6 + OTP 9/13 + OTP 4/1 + OTP 6/2 + OTP 6/14 + OTP 7/2 + OTP 9/1 + OTP 9/14 + OTP 9/16 + OTP 10/1 + OTP 7/7 + OTP 6/7 + OTP 8/19 + OTP 8/18 + OTP 7/12 + OTP 6/4 + OTP 8/2 + OTP 8/17 + + + + + MESH 0/2 + MESH 4/2 + MESH 4/6 + MESH 4/15 + MESH 6/1 + MESH 7/5 + MESH 10/3 + MESH 11/2 + MESH 11/12 + MESH 11/17 + MESH 11/18 + MESH 11/21 + MESH 2/2 + MESH 4/3 + MESH 4/8 + MESH 5/4 + MESH 11/15 + MESH 12/3 + MESH 12/6 + MESH 18/11 + MESH 21/2 + MESH 3/1 + MESH 4/17 + MESH 7/1 + MESH 10/1 + MESH 13/1 + MESH 14/4 + MESH 16/4 + MESH 18/1 + MESH 18/9 + MESH 20/2 + MESH 21/1 + MESH 21/4 + MESH 1a/2 + MESH 4/11 + MESH 4/13 + MESH 7/4 + MESH 11/6 + MESH 11/14 + MESH 11/23 + MESH 12/12 + MESH 14/1 + MESH 18/2 + MESH 18/6 + MESH 18/12 + MESH 11/1 + MESH 11/4 + MESH 11/22 + MESH 12/1 + MESH 15/1 + MESH 20/3 + MESH 2/3 + MESH 3/2 + MESH 4/1 + MESH 4/4 + MESH 4/9 + MESH 4/12 + MESH 4/16 + MESH 5/3 + MESH 6/3 + MESH 7/2 + MESH 8/1 + MESH 9/1 + MESH 11/8 + MESH 11/20 + MESH 12/2 + MESH 12/4 + MESH 14/2 + MESH 14/3 + MESH 15/2 + MESH 15/3 + MESH 16/1 + MESH 16/2 + MESH 16/3 + MESH 16/6 + MESH 18/4 + MESH 18/7 + MESH 20/4 + MESH 21/3 + MESH 12/5 + MESH 12/11 + MESH 18/3 + MESH 18/10 + MESH 20/5 + MESH 10/5 + MESH 11/13 + MESH 12/7 + MESH 2/1 + MESH 4/7 + MESH 4/14 + MESH 7/3 + MESH 10/4 + MESH 11/11 + MESH 12/8 + MESH 15/4 + MESH 15/5 + MESH 16/5 + MESH 18/13 + MESH 19/1 + MESH 4/5 + MESH 4/10 + MESH 5/1 + MESH 5/2 + MESH 6/2 + MESH 10/2 + MESH 11/3 + MESH 11/5 + MESH 11/7 + MESH 11/19 + MESH 11/24 + MESH 13/2 + MESH 14/5 + MESH 18/5 + MESH 18/8 + MESH 20/1 + MESH 11/16 + + + + + LC3 1/1 + LC3 5/2 + LC3 5/4 + LC3 5/6 + LC3 3/6 + LC3 5/5 + LC3 2/3 + LC3 4/1 + LC3 5/1 + LC3 6/1 + LC3 2/1 + LC3 3/3 + LC3 3/5 + LC3 5/3 + LC3 0/1 + LC3 3/1 + LC3 3/2 + LC3 3/4 + LC3 6/2 + LC3 2/2 + LC3 4/2 + + + + + AICS 2/1 + AICS 2/3 + AICS 2/5 + AICS 3/4 + AICS 3/2 + AICS 3/5 + AICS 2/4 + AICS 2/2 + AICS 2/6 + AICS 2/7 + AICS 4/1 + AICS 4/2 + AICS 3/1 + AICS 3/3 + AICS 1/2 + AICS 4/4 + AICS 4/6 + AICS 2/8 + AICS 4/3 + AICS 0/1 + + + + + VOCS 2/2 + VOCS 2/5 + VOCS 2/4 + VOCS 2/7 + VOCS 3/1 + VOCS 3/6 + VOCS 2/1 + VOCS 2/3 + VOCS 3/3 + VOCS 1/2 + VOCS 2/6 + VOCS 2/8 + VOCS 3/4 + VOCS 3/2 + VOCS 0/1 + + + + + VCS 3/1 + VCS 3/2 + VCS 3/4 + VCS 3/7 + VCS 2/2 + VCS 2/1 + VCS 2/4 + VCS 3/6 + VCS 3/5 + VCS 4/3 + VCS 2/3 + VCS 3/3 + VCS 1/2 + VCS 4/4 + VCS 4/6 + VCS 0/1 + VCS 4/1 + VCS 4/2 + + + + + VCP 14/8 + VCP 16/5 + VCP 16/11 + VCP 13/4 + VCP 15/6 + VCP 14/6 + VCP 15/3 + VCP 17/7 + VCP 17/10 + VCP 17/11 + VCP 16/9 + VCP 14/4 + VCP 14/5 + VCP 16/7 + VCP 15/2 + VCP 16/8 + VCP 16/13 + VCP 8/1 + VCP 11/1 + VCP 11/3 + VCP 5/1 + VCP 5/2 + VCP 5/3 + VCP 17/6 + VCP 14/7 + VCP 16/12 + VCP 16/14 + VCP 12/11 + VCP 13/1 + VCP 15/1 + VCP 12/3 + VCP 12/4 + VCP 17/9 + VCP 13/2 + VCP 13/3 + VCP 16/3 + VCP 16/6 + VCP 3/1 + VCP 17/3 + VCP 17/8 + VCP 16/2 + VCP 17/1 + VCP 17/5 + VCP 18/7 + VCP 1/1 + VCP 1/2 + VCP 14/1 + VCP 18/2 + VCP 18/6 + VCP 12/1 + VCP 12/6 + VCP 12/12 + VCP 6/3 + VCP 2/2 + VCP 12/9 + VCP 12/10 + VCP 14/2 + VCP 17/4 + VCP 6/1 + VCP 17/2 + VCP 18/1 + VCP 18/12 + VCP 6/10 + VCP 18/15 + VCP 6/8 + VCP 16/1 + VCP 18/4 + VCP 11/2 + VCP 14/3 + VCP 14/9 + VCP 16/4 + VCP 16/10 + VCP 15/4 + VCP 15/5 + VCP 12/2 + VCP 12/5 + VCP 5/4 + VCP 6/11 + VCP 10/2 + VCP 10/3 + VCP 6/2 + VCP 12/7 + VCP 12/8 + VCP 18/3 + VCP 18/14 + VCP 6/13 + VCP 10/1 + + + + + MICS 2/1 + MICS 3/3 + MICS 1/2 + MICS 3/6 + MICS 3/2 + MICS 3/1 + MICS 0/1 + MICS 3/4 + + + + + MICP 13/3 + MICP 12/2 + MICP 12/3 + MICP 14/4 + MICP 15/6 + MICP 15/11 + MICP 14/5 + MICP 14/9 + MICP 15/10 + MICP 13/5 + MICP 14/3 + MICP 14/13 + MICP 5/2 + MICP 15/7 + MICP 16/4 + MICP 14/7 + MICP 14/11 + MICP 14/12 + MICP 15/8 + MICP 16/5 + MICP 13/4 + MICP 13/6 + MICP 14/6 + MICP 6/1 + MICP 11/1 + MICP 14/8 + MICP 14/10 + MICP 5/1 + MICP 15/9 + MICP 6/4 + MICP 6/6 + MICP 15/5 + MICP 14/1 + MICP 15/4 + MICP 1/1 + MICP 1/2 + MICP 13/1 + MICP 16/1 + MICP 15/1 + MICP 16/3 + MICP 6/2 + MICP 6/8 + MICP 14/2 + MICP 15/2 + MICP 2/2 + MICP 8/1 + MICP 16/13 + MICP 12/1 + MICP 14/14 + MICP 16/6 + MICP 16/7 + MICP 6/14 + MICP 10/2 + MICP 6/5 + MICP 13/2 + MICP 15/3 + MICP 10/1 + MICP 3/1 + MICP 16/14 + MICP 6/13 + + + + + MCS 22/12 + MCS 22/21 + MCS 23/9 + MCS 24/3 + MCS 22/5 + MCS 22/13 + MCS 22/19 + MCS 22/20 + MCS 22/25 + MCS 23/7 + MCS 23/10 + MCS 24/1 + MCS 24/2 + MCS 25/2 + MCS 25/4 + MCS 22/7 + MCS 22/24 + MCS 23/14 + MCS 23/20 + MCS 25/3 + MCS 20/1 + MCS 21/2 + MCS 22/3 + MCS 22/17 + MCS 22/23 + MCS 23/13 + MCS 22/8 + MCS 22/9 + MCS 22/11 + MCS 22/14 + MCS 22/26 + MCS 23/6 + MCS 23/8 + MCS 23/12 + MCS 23/21 + MCS 24/4 + MCS 22/4 + MCS 22/6 + MCS 22/10 + MCS 22/18 + MCS 23/1 + MCS 23/2 + MCS 23/11 + MCS 23/17 + MCS 0b/2 + MCS 22/1 + MCS 22/2 + MCS 22/15 + MCS 22/16 + MCS 22/22 + MCS 23/5 + MCS 23/15 + MCS 23/16 + MCS 23/18 + MCS 25/1 + MCS 25/6 + MCS 23/3 + MCS 23/4 + MCS 23/19 + + + + + MCP 16/9 + MCP 17/3 + MCP 17/4 + MCP 17/7 + MCP 16/13 + MCP 16/14 + MCP 16/22 + MCP 17/8 + MCP 16/6 + MCP 16/19 + MCP 17/17 + MCP 17/18 + MCP 16/5 + MCP 16/11 + MCP 16/17 + MCP 17/5 + MCP 17/6 + MCP 17/12 + MCP 18/7 + MCP 6/2 + MCP 18/2 + MCP 16/7 + MCP 16/8 + MCP 16/16 + MCP 2/2 + MCP 16/20 + MCP 17/1 + MCP 17/9 + MCP 17/11 + MCP 17/13 + MCP 17/14 + MCP 17/19 + MCP 6/3 + MCP 16/21 + MCP 16/2 + MCP 16/4 + MCP 16/10 + MCP 16/15 + MCP 17/15 + MCP 17/20 + MCP 6/5 + MCP 10/1 + MCP 18/3 + MCP 18/4 + MCP 1/2 + MCP 6/4 + MCP 10/2 + MCP 1/1 + MCP 6/6 + MCP 6/1 + MCP 9/2 + MCP 9/3 + MCP 18/8 + MCP 16/1 + MCP 16/3 + MCP 16/12 + MCP 16/18 + MCP 17/2 + MCP 17/10 + MCP 17/16 + MCP 18/5 + MCP 18/6 + MCP 6/13 + MCP 5/3 + MCP 6/7 + MCP 9/1 + MCP 8/1 + MCP 21/3 + MCP 13/3 + MCP 20/1 + MCP 21/2 + MCP 3/1 + MCP 6/14 + MCP 13/2 + MCP 21/1 + MCP 5/2 + MCP 11/1 + MCP 18/14 + MCP 18/15 + MCP 5/4 + + + + + TBS 2/3 + TBS 3/1 + TBS 3/2 + TBS 3/6 + TBS 2/15 + TBS 3/5 + TBS 2/18 + TBS 3/4 + TBS 2/9 + TBS 2/12 + TBS 2/23 + TBS 3/3 + TBS 2/24 + TBS 2/16 + TBS 2/17 + TBS 2/20 + TBS 4/4 + TBS 22/13 + TBS 22/15 + TBS 22/16 + TBS 22/17 + TBS 1/2 + TBS 2/4 + TBS 2/5 + TBS 2/21 + TBS 2/22 + TBS 22/4 + TBS 22/10 + TBS 22/11 + TBS 23/5 + TBS 24/2 + TBS 24/7 + TBS 2/8 + TBS 2/10 + TBS 2/13 + TBS 2/25 + TBS 4/5 + TBS 22/3 + TBS 22/12 + TBS 22/14 + TBS 22/22 + TBS 24/3 + TBS 2/11 + TBS 4/1 + TBS 20/1 + TBS 22/8 + TBS 22/19 + TBS 22/20 + TBS 23/1 + TBS 23/4 + TBS 24/1 + TBS 24/5 + TBS 0/1 + TBS 2/14 + TBS 4/2 + TBS 22/2 + TBS 22/5 + TBS 0b/2 + TBS 2/1 + TBS 2/2 + TBS 2/6 + TBS 4/7 + TBS 21/2 + TBS 22/1 + TBS 22/6 + TBS 22/7 + TBS 22/24 + TBS 23/3 + TBS 2/7 + TBS 2/19 + TBS 22/9 + TBS 22/18 + TBS 22/21 + TBS 22/23 + TBS 22/25 + TBS 23/6 + TBS 24/4 + TBS 0b/1 + TBS 4/3 + TBS 23/2 + + + + + CCP 11/5 + CCP 11/10 + CCP 12/2 + CCP 12/6 + CCP 12/16 + CCP 13/5 + CCP 13/9 + CCP 13/10 + CCP 14/4 + CCP 14/5 + CCP 12/3 + CCP 12/19 + CCP 12/20 + CCP 13/11 + CCP 14/3 + CCP 14/8 + CCP 11/3 + CCP 11/9 + CCP 11/12 + CCP 12/14 + CCP 12/21 + CCP 13/1 + CCP 13/3 + CCP 13/13 + CCP 13/14 + CCP 11/7 + CCP 12/4 + CCP 12/7 + CCP 12/8 + CCP 12/11 + CCP 12/15 + CCP 12/22 + CCP 13/4 + CCP 14/16 + CCP 14/17 + CCP 11/2 + CCP 12/13 + CCP 12/17 + CCP 13/2 + CCP 14/12 + CCP 14/13 + CCP 14/15 + CCP 14/14 + CCP 11/4 + CCP 11/14 + CCP 11/16 + CCP 12/5 + CCP 12/9 + CCP 12/12 + CCP 12/18 + CCP 13/16 + CCP 14/7 + CCP 14/11 + CCP 14/19 + CCP 14/20 + CCP 6/6 + CCP 13/6 + CCP 11/1 + CCP 11/8 + CCP 11/15 + CCP 12/1 + CCP 13/7 + CCP 13/12 + CCP 13/15 + CCP 14/2 + CCP 14/9 + CCP 14/10 + CCP 1/1 + CCP 6/1 + CCP 6/5 + CCP 6/2 + CCP 2/2 + CCP 6/7 + CCP 15/6 + CCP 1/2 + CCP 15/2 + CCP 11/11 + CCP 11/13 + CCP 12/10 + CCP 13/8 + CCP 14/1 + CCP 14/6 + CCP 14/18 + CCP 14/21 + CCP 14/22 + CCP 15/7 + CCP 15/3 + CCP 5/2 + CCP 11/6 + CCP 6/4 + CCP 15/14 + CCP 3/1 + CCP 6/14 + CCP 15/15 + CCP 8/1 + CCP 10/2 + CCP 5/3 + CCP 15/4 + CCP 15/5 + CCP 15/8 + CCP 5/1 + CCP 6/13 + CCP 10/1 + + + + + CSIS 2/3 + CSIS 2/4 + CSIS 3/2 + CSIS 2/2 + CSIS 3/1 + CSIS 2/1 + CSIS 3/4 + CSIS 3/3 + CSIS 1/2 + CSIS 2/5 + CSIS 0a/2 + CSIS 2/6 + CSIS 3/6 + + + + + CSIP 11/2 + CSIP 12/4 + CSIP 6/2 + CSIP 13/3 + CSIP 13/8 + CSIP 5/2 + CSIP 13/6 + CSIP 13/9 + CSIP 14/2 + CSIP 14/5 + CSIP 14/7 + CSIP 12/2 + CSIP 6/1 + CSIP 6/9 + CSIP 5/5 + CSIP 6/8 + CSIP 12/3 + CSIP 14/3 + CSIP 14/6 + CSIP 1/1 + CSIP 1/2 + CSIP 6/7 + CSIP 11/1 + CSIP 11/3 + CSIP 11/4 + CSIP 12/1 + CSIP 12/5 + CSIP 14/9 + CSIP 5/4 + CSIP 13/11 + CSIP 2/2 + CSIP 6/6 + CSIP 13/1 + CSIP 5/1 + CSIP 13/10 + CSIP 14/4 + CSIP 4/2 + CSIP 9/2 + CSIP 13/4 + CSIP 14/15 + CSIP 13/7 + CSIP 14/8 + CSIP 6/15 + CSIP 6/16 + CSIP 13/2 + CSIP 13/5 + CSIP 6/3 + CSIP 10/1 + CSIP 6/4 + CSIP 14/16 + + + + + PACS 4/9 + PACS 4/10 + PACS 4/5 + PACS 4/11 + PACS 4/14 + PACS 4/6 + PACS 5/1 + PACS 4/12 + PACS 4/16 + PACS 3/5 + PACS 4/7 + PACS 4/15 + PACS 4/13 + PACS 3/4 + PACS 4/3 + PACS 3/1 + PACS 4/1 + PACS 4/4 + PACS 4/2 + PACS 2/2 + PACS 3/2 + PACS 3/3 + PACS 6/1 + PACS 6/3 + PACS 4/8 + PACS 3/6 + PACS 6/7 + PACS 6/2 + PACS 6/5 + PACS 6/4 + PACS 1/1 + + + + + ASCS 6/4 + ASCS 6/7 + ASCS 7/4 + ASCS 6/5 + ASCS 7/3 + ASCS 7/5 + ASCS 4/1 + ASCS 6/1 + ASCS 6/2 + ASCS 6/9 + ASCS 6/3 + ASCS 6/8 + ASCS 7/2 + ASCS 2/2 + ASCS 8/2 + ASCS 7/1 + ASCS 5/1 + ASCS 8/1 + ASCS 9/3 + ASCS 6/6 + ASCS 5/3 + ASCS 9/5 + ASCS 0/1 + ASCS 3/1 + ASCS 5/2 + ASCS 9/1 + ASCS 9/7 + ASCS 9/2 + ASCS 9/4 + ASCS 9/9 + ASCS 9/6 + + + + + BASS 3/2 + BASS 3/5 + BASS 4/1 + BASS 5/2 + BASS 5/6 + BASS 4/5 + BASS 5/1 + BASS 3/1 + BASS 4/2 + BASS 4/6 + BASS 4/3 + BASS 5/8 + BASS 5/3 + BASS 0/1 + BASS 2/2 + BASS 3/4 + BASS 4/4 + BASS 5/4 + BASS 5/5 + + + + + BAP 45/7 + BAP 46/1 + BAP 74/2 + BAP 80/3 + BAP 89/9 + BAP 89/12 + BAP 90/1 + BAP 11/2 + BAP 7/2 + BAP 7/3 + BAP 20/5 + BAP 20/10 + BAP 31/2 + BAP 31/6 + BAP 32/3 + BAP 32/4 + BAP 16/12 + BAP 16/15 + BAP 17/6 + BAP 80/6 + BAP 89/6 + BAP 10/5 + BAP 20/7 + BAP 33/7 + BAP 16/11 + BAP 16/14 + BAP 17/12 + BAP 17/14 + BAP 38/2 + BAP 39/1 + BAP 39/8 + BAP 39/10 + BAP 39/15 + BAP 55/5 + BAP 56/1 + BAP 56/6 + BAP 56/8 + BAP 56/12 + BAP 56/16 + BAP 69/1 + BAP 69/16 + BAP 70/1 + BAP 70/7 + BAP 45/11 + BAP 46/2 + BAP 74/1 + BAP 90/5 + BAP 90/7 + BAP 90/8 + BAP 10/2 + BAP 11/3 + BAP 12/17 + BAP 9/8 + BAP 20/6 + BAP 20/8 + BAP 16/9 + BAP 17/2 + BAP 17/9 + BAP 38/3 + BAP 39/11 + BAP 55/3 + BAP 55/6 + BAP 55/12 + BAP 56/5 + BAP 69/10 + BAP 69/15 + BAP 70/12 + BAP 23/1 + BAP 80/1 + BAP 22/2 + BAP 32/5 + BAP 32/6 + BAP 35/2 + BAP 59/4 + BAP 66/2 + BAP 67/3 + BAP 73/5 + BAP 11/1 + BAP 13/17 + BAP 7/1 + BAP 20/2 + BAP 20/3 + BAP 20/11 + BAP 32/2 + BAP 17/5 + BAP 17/13 + BAP 17/16 + BAP 37/17 + BAP 38/4 + BAP 38/9 + BAP 45/6 + BAP 45/8 + BAP 45/13 + BAP 89/7 + BAP 89/10 + BAP 10/4 + BAP 20/4 + BAP 33/4 + BAP 16/13 + BAP 17/3 + BAP 17/10 + BAP 38/10 + BAP 39/5 + BAP 39/12 + BAP 54/4 + BAP 55/9 + BAP 69/2 + BAP 46/3 + BAP 74/3 + BAP 21/3 + BAP 21/5 + BAP 33/1 + BAP 51/3 + BAP 53/1 + BAP 73/8 + BAP 73/10 + BAP 87/1 + BAP 87/2 + BAP 88/6 + BAP 44/3 + BAP 44/7 + BAP 9/7 + BAP 20/9 + BAP 31/1 + BAP 32/1 + BAP 16/10 + BAP 17/11 + BAP 38/6 + BAP 38/7 + BAP 39/9 + BAP 39/14 + BAP 43/1 + BAP 55/4 + BAP 56/4 + BAP 57/1 + BAP 68/6 + BAP 69/4 + BAP 69/7 + BAP 69/13 + BAP 69/14 + BAP 70/3 + BAP 70/14 + BAP 21/6 + BAP 21/7 + BAP 22/9 + BAP 22/12 + BAP 33/2 + BAP 34/2 + BAP 35/1 + BAP 65/2 + BAP 65/4 + BAP 65/5 + BAP 72/1 + BAP 86/4 + BAP 88/5 + BAP 44/6 + BAP 22/4 + BAP 30/3 + BAP 31/5 + BAP 32/7 + BAP 32/9 + BAP 33/6 + BAP 34/3 + BAP 36/17 + BAP 51/1 + BAP 51/5 + BAP 52/1 + BAP 53/2 + BAP 58/3 + BAP 86/1 + BAP 86/2 + BAP 44/2 + BAP 44/8 + BAP 9/1 + BAP 9/3 + BAP 14/2 + BAP 14/3 + BAP 14/4 + BAP 14/10 + BAP 21/2 + BAP 22/7 + BAP 32/10 + BAP 34/4 + BAP 54/17 + BAP 59/2 + BAP 59/12 + BAP 65/1 + BAP 67/2 + BAP 73/2 + BAP 73/12 + BAP 87/3 + BAP 44/9 + BAP 45/9 + BAP 45/10 + BAP 45/12 + BAP 45/14 + BAP 60/1 + BAP 60/2 + BAP 89/8 + BAP 89/13 + BAP 90/3 + BAP 21/4 + BAP 21/8 + BAP 21/9 + BAP 21/10 + BAP 21/11 + BAP 21/12 + BAP 22/3 + BAP 22/6 + BAP 34/5 + BAP 51/4 + BAP 51/6 + BAP 52/2 + BAP 58/1 + BAP 59/1 + BAP 59/5 + BAP 59/8 + BAP 59/10 + BAP 65/3 + BAP 67/1 + BAP 73/1 + BAP 73/4 + BAP 73/9 + BAP 73/11 + BAP 88/1 + BAP 88/3 + BAP 44/10 + BAP 44/13 + BAP 44/15 + BAP 21/1 + BAP 22/5 + BAP 30/1 + BAP 30/2 + BAP 32/8 + BAP 33/3 + BAP 34/1 + BAP 52/4 + BAP 52/5 + BAP 59/3 + BAP 73/6 + BAP 87/4 + BAP 88/2 + BAP 88/4 + BAP 44/4 + BAP 44/11 + BAP 44/12 + BAP 44/14 + BAP 44/16 + BAP 17/8 + BAP 39/2 + BAP 55/10 + BAP 55/11 + BAP 55/14 + BAP 55/16 + BAP 56/7 + BAP 56/9 + BAP 56/11 + BAP 69/5 + BAP 69/8 + BAP 70/8 + BAP 70/10 + BAP 60/4 + BAP 38/13 + BAP 39/4 + BAP 55/2 + BAP 56/2 + BAP 56/3 + BAP 56/10 + BAP 56/14 + BAP 56/15 + BAP 69/9 + BAP 69/11 + BAP 70/6 + BAP 37/8 + BAP 37/13 + BAP 54/5 + BAP 54/11 + BAP 60/3 + BAP 1/1 + BAP 45/5 + BAP 10/1 + BAP 10/3 + BAP 31/7 + BAP 16/16 + BAP 17/4 + BAP 17/7 + BAP 17/15 + BAP 18/1 + BAP 19/1 + BAP 36/4 + BAP 37/4 + BAP 38/12 + BAP 38/14 + BAP 38/16 + BAP 39/7 + BAP 39/13 + BAP 55/1 + BAP 55/7 + BAP 55/15 + BAP 68/4 + BAP 68/17 + BAP 70/2 + BAP 70/4 + BAP 70/15 + BAP 71/1 + BAP 14/5 + BAP 15/12 + BAP 15/13 + BAP 16/5 + BAP 9/4 + BAP 12/6 + BAP 14/16 + BAP 15/3 + BAP 15/4 + BAP 15/5 + BAP 9/2 + BAP 12/4 + BAP 14/11 + BAP 15/1 + BAP 15/15 + BAP 16/8 + BAP 69/3 + BAP 70/5 + BAP 70/11 + BAP 70/13 + BAP 70/16 + BAP 36/12 + BAP 37/1 + BAP 37/9 + BAP 54/7 + BAP 54/13 + BAP 68/10 + BAP 68/15 + BAP 14/13 + BAP 15/2 + BAP 15/14 + BAP 14/7 + BAP 14/12 + BAP 16/6 + BAP 16/7 + BAP 1/4 + BAP 29/1 + BAP 72/2 + BAP 9a/1 + BAP 33a/7 + BAP 33a/8 + BAP 40/1 + BAP 41/11 + BAP 41/13 + BAP 41/16 + BAP 61/3 + BAP 1/2 + BAP 8/1 + BAP 29/2 + BAP 45/4 + BAP 45/3 + BAP 46/4 + BAP 89/3 + BAP 89/11 + BAP 22/1 + BAP 22/8 + BAP 22/10 + BAP 22/11 + BAP 31/3 + BAP 31/4 + BAP 33/5 + BAP 33/8 + BAP 51/2 + BAP 52/3 + BAP 59/6 + BAP 59/7 + BAP 59/9 + BAP 59/11 + BAP 66/1 + BAP 73/3 + BAP 73/7 + BAP 86/3 + BAP 88/7 + BAP 44/1 + BAP 44/5 + BAP 72/3 + BAP 20/1 + BAP 17/1 + BAP 38/1 + BAP 38/5 + BAP 38/8 + BAP 38/11 + BAP 38/15 + BAP 39/3 + BAP 39/6 + BAP 39/16 + BAP 42/1 + BAP 55/8 + BAP 55/13 + BAP 56/13 + BAP 69/6 + BAP 69/12 + BAP 70/9 + BAP 9/5 + BAP 13/4 + BAP 14/6 + BAP 15/10 + BAP 15/11 + BAP 1/6 + BAP 1/5 + BAP 8/2 + BAP 45/2 + BAP 58/2 + BAP 89/1 + BAP 89/5 + BAP 7/10 + BAP 14/1 + BAP 14/9 + BAP 14/15 + BAP 15/8 + BAP 15/9 + BAP 15/16 + BAP 16/1 + BAP 16/3 + BAP 6/2 + BAP 6/4 + BAP 7/6 + BAP 25/2 + BAP 28/2 + BAP 40/10 + BAP 40/13 + BAP 41/3 + BAP 36/15 + BAP 37/5 + BAP 37/10 + BAP 37/12 + BAP 54/2 + BAP 54/10 + BAP 54/16 + BAP 68/1 + BAP 68/12 + BAP 7/7 + BAP 9a/6 + BAP 23/4 + BAP 40/2 + BAP 40/12 + BAP 74/11 + BAP 76/1 + BAP 76/3 + BAP 76/4 + BAP 80/10 + BAP 80/16 + BAP 80/22 + BAP 82/3 + BAP 92/3 + BAP 92/7 + BAP 95/5 + BAP 12/14 + BAP 36/6 + BAP 36/9 + BAP 37/15 + BAP 54/14 + BAP 84/1 + BAP 1/3 + BAP 7/9 + BAP 7/4 + BAP 9a/2 + BAP 9a/7 + BAP 23/2 + BAP 23/7 + BAP 23/19 + BAP 33a/4 + BAP 33a/5 + BAP 40/5 + BAP 40/11 + BAP 41/2 + BAP 74/7 + BAP 7/5 + BAP 7/8 + BAP 9a/4 + BAP 23/10 + BAP 25/1 + BAP 33a/3 + BAP 40/7 + BAP 40/8 + BAP 40/16 + BAP 41/1 + BAP 41/4 + BAP 41/6 + BAP 41/7 + BAP 41/15 + BAP 46/5 + BAP 46/6 + BAP 46/15 + BAP 48/3 + BAP 9a/8 + BAP 23/5 + BAP 33a/1 + BAP 40/3 + BAP 40/6 + BAP 40/9 + BAP 40/14 + BAP 40/15 + BAP 41/14 + BAP 61/1 + BAP 61/2 + BAP 82/1 + BAP 90/2 + BAP 90/4 + BAP 92/6 + BAP 93/5 + BAP 93/6 + BAP 95/2 + BAP 95/3 + BAP 96/2 + BAP 12/10 + BAP 12/12 + BAP 13/5 + BAP 13/8 + BAP 13/9 + BAP 13/11 + BAP 13/16 + BAP 36/5 + BAP 61/5 + BAP 61/6 + BAP 74/23 + BAP 85/4 + BAP 90/17 + BAP 12/3 + BAP 27/4 + BAP 36/14 + BAP 37/7 + BAP 68/3 + BAP 23/6 + BAP 23/18 + BAP 33a/6 + BAP 41/9 + BAP 41/12 + BAP 64/2 + BAP 74/9 + BAP 79/2 + BAP 80/2 + BAP 80/14 + BAP 80/21 + BAP 85/2 + BAP 92/4 + BAP 93/2 + BAP 95/4 + BAP 5/1 + BAP 12/2 + BAP 12/7 + BAP 13/15 + BAP 36/10 + BAP 37/2 + BAP 37/6 + BAP 37/14 + BAP 54/1 + BAP 54/3 + BAP 54/15 + BAP 63/1 + BAP 68/5 + BAP 68/7 + BAP 68/14 + BAP 46/14 + BAP 48/1 + BAP 48/2 + BAP 74/6 + BAP 74/10 + BAP 80/15 + BAP 90/11 + BAP 90/16 + BAP 90/21 + BAP 92/1 + BAP 95/1 + BAP 95/6 + BAP 12/16 + BAP 13/10 + BAP 36/1 + BAP 36/7 + BAP 36/8 + BAP 36/13 + BAP 36/16 + BAP 37/3 + BAP 37/16 + BAP 50/1 + BAP 54/9 + BAP 54/12 + BAP 68/13 + BAP 68/16 + BAP 80/7 + BAP 80/13 + BAP 82/4 + BAP 92/2 + BAP 92/5 + BAP 93/1 + BAP 93/3 + BAP 93/4 + BAP 96/1 + BAP 12/5 + BAP 12/11 + BAP 13/2 + BAP 13/6 + BAP 36/2 + BAP 36/3 + BAP 36/11 + BAP 37/11 + BAP 54/6 + BAP 54/8 + BAP 68/2 + BAP 68/11 + BAP 3/1 + BAP 89/2 + BAP 89/4 + BAP 9/6 + BAP 14/8 + BAP 14/14 + BAP 15/6 + BAP 15/7 + BAP 16/2 + BAP 16/4 + BAP 9a/3 + BAP 9a/5 + BAP 25/3 + BAP 45/1 + BAP 74/8 + BAP 74/15 + BAP 74/22 + BAP 82/2 + BAP 90/6 + BAP 94/1 + BAP 12/1 + BAP 12/8 + BAP 12/13 + BAP 12/15 + BAP 13/3 + BAP 27/2 + BAP 28/4 + BAP 33a/2 + BAP 40/4 + BAP 41/5 + BAP 41/8 + BAP 41/10 + BAP 46/9 + BAP 61/4 + BAP 74/4 + BAP 76/2 + BAP 80/5 + BAP 90/20 + BAP 94/2 + BAP 5/3 + BAP 12/9 + BAP 13/1 + BAP 13/7 + BAP 13/12 + BAP 13/13 + BAP 13/14 + BAP 68/8 + BAP 68/9 + BAP 78/1 + + + + + CAS 5/2 + CAS 0/1 + CAS 3/1 + CAS 2/2 + + + + + CAP 7/2 + CAP 7/4 + CAP 7/9 + CAP 8/1 + CAP 8/2 + CAP 8/3 + CAP 8/4 + CAP 11/7 + CAP 14/1 + CAP 17/2 + CAP 20/5 + CAP 23/2 + CAP 6/1 + CAP 6/7 + CAP 7/6 + CAP 11/2 + CAP 11/12 + CAP 13/1 + CAP 21/1 + CAP 22/8 + CAP 22/9 + CAP 22/10 + CAP 28/6 + CAP 7/8 + CAP 11/3 + CAP 11/11 + CAP 12/1 + CAP 20/1 + CAP 22/5 + CAP 28/7 + CAP 28/9 + CAP 9/1 + CAP 10/1 + CAP 11/10 + CAP 16/1 + CAP 16/5 + CAP 22/3 + CAP 22/7 + CAP 6/5 + CAP 6/6 + CAP 11/1 + CAP 13/2 + CAP 20/2 + CAP 20/4 + CAP 22/1 + CAP 22/6 + CAP 26/6 + CAP 28/8 + CAP 2/2 + CAP 7/3 + CAP 11/4 + CAP 16/6 + CAP 17/5 + CAP 22/2 + CAP 22/12 + CAP 28/10 + CAP 29/1 + CAP 6a/2 + CAP 31/4 + CAP 32/2 + CAP 16/3 + CAP 18/2 + CAP 27/4 + CAP 31/1 + CAP 31/3 + CAP 32/1 + CAP 6/8 + CAP 7/5 + CAP 11/5 + CAP 16/4 + CAP 17/1 + CAP 20/3 + CAP 20/6 + CAP 20/9 + CAP 22/4 + CAP 26/7 + CAP 16/2 + CAP 19/2 + CAP 27/5 + CAP 19/4 + CAP 26/4 + CAP 26/5 + CAP 6/2 + CAP 7/1 + CAP 7/7 + CAP 10/2 + CAP 11/6 + CAP 11/8 + CAP 11/9 + CAP 21/2 + CAP 21/3 + CAP 22/11 + CAP 23/1 + CAP 24/1 + CAP 26/1 + CAP 28/11 + CAP 33/1 + CAP 33/2 + CAP 1/1 + CAP 3/1 + CAP 4/1 + CAP 6/4 + CAP 6a/1 + CAP 18/1 + CAP 19/1 + CAP 31/2 + CAP 6/3 + CAP 1/3 + CAP 1/2 + + + + + HAS 3/1 + HAS 3/5 + HAS 3/12 + HAS 4/5 + HAS 4/6 + HAS 5/2 + HAS 5/3 + HAS 3/14 + HAS 3/10 + HAS 4/1 + HAS 5/1 + HAS 5/4 + HAS 5/6 + HAS 3/1a + HAS 4/4 + HAS 2/2 + HAS 3/3 + HAS 3/4 + HAS 3/8 + HAS 3/9 + HAS 3/13 + HAS 4/7 + HAS 3/2 + HAS 3/7 + HAS 3/11 + HAS 4/3 + HAS 0/1 + HAS 3/6 + HAS 4/2 + HAS 5/5 + HAS 4/9 + HAS 4/8 + HAS 4/10 + + + + + HAP 13/7 + HAP 1/1 + HAP 13/6 + HAP 18/1 + HAP 19/2 + HAP 10/1 + HAP 17/1 + HAP 40/1 + HAP 43/1 + HAP 43/2 + HAP 51/1 + HAP 92/1 + HAP 12/4 + HAP 12/5 + HAP 13/2 + HAP 13/3 + HAP 14/3 + HAP 16/2 + HAP 2/2 + HAP 16/1 + HAP 24/1 + HAP 26/1 + HAP 13/1 + HAP 13/5 + HAP 24/2 + HAP 24/6 + HAP 43/4 + HAP 1/2 + HAP 1/4 + HAP 12/1 + HAP 12/2 + HAP 13/4 + HAP 14/2 + HAP 24/5 + HAP 43/3 + HAP 46/2 + HAP 50/1 + HAP 50/2 + HAP 90/1 + HAP 12/6 + HAP 12/7 + HAP 46/1 + HAP 12/3 + HAP 14/1 + HAP 19/1 + HAP 24/3 + HAP 24/4 + + + + + TMAP 1/4 + TMAP 1/1 + TMAP 1/8 + TMAP 13/1 + TMAP 17/1 + TMAP 18/2 + TMAP 53/1 + TMAP 55/6 + TMAP 56/14 + TMAP 70/1 + TMAP 75/4 + TMAP 75/5 + TMAP 77/1 + TMAP 92/1 + TMAP 93/1 + TMAP 96/10 + TMAP 14/2 + TMAP 14/4 + TMAP 14/5 + TMAP 15/1 + TMAP 15/3 + TMAP 15/6 + TMAP 17/5 + TMAP 50/1 + TMAP 56/8 + TMAP 56/13 + TMAP 75/2 + TMAP 76/5 + TMAP 90/1 + TMAP 95/4 + TMAP 96/1 + TMAP 96/7 + TMAP 96/15 + TMAP 98/2 + TMAP 99/2 + TMAP 117/2 + TMAP 1/2 + TMAP 1/6 + TMAP 14/3 + TMAP 15/5 + TMAP 16/3 + TMAP 16/6 + TMAP 17/2 + TMAP 17/3 + TMAP 52/1 + TMAP 55/4 + TMAP 56/9 + TMAP 72/1 + TMAP 74/2 + TMAP 76/3 + TMAP 76/4 + TMAP 77/2 + TMAP 95/7 + TMAP 96/5 + TMAP 96/9 + TMAP 115/7 + TMAP 115/8 + TMAP 119/1 + TMAP 121/2 + TMAP 151/3 + TMAP 10/1 + TMAP 12/2 + TMAP 14/7 + TMAP 15/2 + TMAP 17/7 + TMAP 19/1 + TMAP 55/7 + TMAP 56/16 + TMAP 57/2 + TMAP 72/2 + TMAP 75/3 + TMAP 95/1 + TMAP 96/2 + TMAP 96/8 + TMAP 96/11 + TMAP 96/16 + TMAP 115/4 + TMAP 116/3 + TMAP 116/9 + TMAP 116/10 + TMAP 118/1 + TMAP 131/1 + TMAP 1/5 + TMAP 1/7 + TMAP 16/5 + TMAP 19/2 + TMAP 19/3 + TMAP 52/2 + TMAP 55/1 + TMAP 55/8 + TMAP 56/1 + TMAP 56/5 + TMAP 56/12 + TMAP 57/1 + TMAP 96/6 + TMAP 97/2 + TMAP 112/2 + TMAP 114/2 + TMAP 96/13 + TMAP 98/1 + TMAP 114/1 + TMAP 115/3 + TMAP 116/8 + TMAP 116/11 + TMAP 3/1 + TMAP 14/1 + TMAP 16/1 + TMAP 16/4 + TMAP 17/6 + TMAP 54/3 + TMAP 55/2 + TMAP 55/3 + TMAP 55/5 + TMAP 56/7 + TMAP 56/10 + TMAP 57/3 + TMAP 74/6 + TMAP 76/1 + TMAP 76/6 + TMAP 78/1 + TMAP 78/2 + TMAP 79/2 + TMAP 95/5 + TMAP 95/6 + TMAP 96/14 + TMAP 98/3 + TMAP 100/1 + TMAP 110/1 + TMAP 113/1 + TMAP 114/4 + TMAP 115/5 + TMAP 116/4 + TMAP 116/7 + TMAP 117/1 + TMAP 118/3 + TMAP 119/2 + TMAP 153/4 + TMAP 14/6 + TMAP 15/4 + TMAP 16/2 + TMAP 17/4 + TMAP 54/1 + TMAP 56/2 + TMAP 56/4 + TMAP 56/6 + TMAP 56/15 + TMAP 74/1 + TMAP 74/3 + TMAP 76/2 + TMAP 78/3 + TMAP 79/1 + TMAP 92/2 + TMAP 94/1 + TMAP 94/5 + TMAP 96/3 + TMAP 96/12 + TMAP 97/1 + TMAP 99/1 + TMAP 114/3 + TMAP 115/1 + TMAP 116/1 + TMAP 116/5 + TMAP 116/14 + TMAP 116/15 + TMAP 151/4 + TMAP 151/5 + TMAP 156/1 + TMAP 151/1 + TMAP 153/1 + TMAP 154/1 + TMAP 2/2 + TMAP 12/1 + TMAP 12/3 + TMAP 18/1 + TMAP 54/2 + TMAP 56/3 + TMAP 56/11 + TMAP 73/1 + TMAP 74/4 + TMAP 74/5 + TMAP 75/1 + TMAP 75/6 + TMAP 94/2 + TMAP 94/3 + TMAP 94/4 + TMAP 95/2 + TMAP 95/3 + TMAP 95/8 + TMAP 96/4 + TMAP 100/2 + TMAP 112/1 + TMAP 116/12 + TMAP 116/16 + TMAP 120/1 + TMAP 153/2 + TMAP 115/2 + TMAP 115/6 + TMAP 116/2 + TMAP 116/6 + TMAP 116/13 + TMAP 118/2 + TMAP 121/1 + TMAP 150/1 + TMAP 151/6 + TMAP 153/5 + TMAP 153/6 + TMAP 151/2 + TMAP 152/1 + + + + + PBP 3/1 + PBP 5/1 + PBP 2/2 + PBP 6/1 + PBP 8/3 + PBP 8/8 + PBP 8/10 + PBP 1/1 + PBP 12/1 + PBP 14/5 + PBP 14/10 + PBP 7/3 + PBP 7/4 + PBP 8/6 + PBP 8/7 + PBP 14/6 + PBP 5/2 + PBP 6/2 + PBP 9/1 + PBP 13/1 + PBP 13/4 + PBP 14/4 + PBP 14/9 + PBP 11/2 + PBP 13/2 + PBP 6/6 + PBP 8/9 + PBP 12/2 + PBP 14/11 + PBP 6/4 + PBP 6/7 + PBP 6/8 + PBP 7/1 + PBP 7/2 + PBP 14/7 + PBP 14/12 + PBP 8/4 + PBP 8/12 + PBP 13/3 + PBP 1/2 + PBP 6/3 + PBP 6/5 + PBP 8/1 + PBP 8/2 + PBP 8/5 + PBP 8/11 + PBP 11/1 + PBP 14/1 + PBP 14/2 + PBP 14/3 + PBP 14/8 + + + + + MBT 20/2 + MBT 3/2 + MBT 20/1 + MBT 0/1 + MBT 10/1 + MBT 10/2 + MBT 3/1 + + + + + DFU 3/1 + DFU 10/1 + DFU 22/3 + DFU 30/1 + DFU 3/2 + DFU 0/1 + DFU 3/3 + DFU 20/1 + DFU 11/1 + DFU 21/1 + DFU 22/1 + DFU 11/2 + DFU 21/2 + + + + + GMAP 15/1 + GMAP 16/1 + GMAP 17/5 + GMAP 20/8 + GMAP 20/13 + GMAP 20/19 + GMAP 20/25 + GMAP 20/60 + GMAP 20/67 + GMAP 20/68 + GMAP 20/76 + GMAP 20/83 + GMAP 20/86 + GMAP 20/87 + GMAP 20/92 + GMAP 20/95 + GMAP 20/97 + GMAP 20/105 + GMAP 20/109 + GMAP 21/1 + GMAP 1/2 + GMAP 12/3 + GMAP 14/1 + GMAP 14/4 + GMAP 14/6 + GMAP 18/2 + GMAP 18/6 + GMAP 20/11 + GMAP 20/15 + GMAP 20/16 + GMAP 20/22 + GMAP 20/24 + GMAP 20/31 + GMAP 20/40 + GMAP 20/41 + GMAP 20/42 + GMAP 20/54 + GMAP 20/57 + GMAP 20/64 + GMAP 20/71 + GMAP 20/73 + GMAP 1/4 + GMAP 1/5 + GMAP 14/3 + GMAP 14/9 + GMAP 16/5 + GMAP 19/2 + GMAP 20/4 + GMAP 20/14 + GMAP 20/17 + GMAP 20/27 + GMAP 20/29 + GMAP 20/30 + GMAP 20/33 + GMAP 20/36 + GMAP 20/38 + GMAP 20/45 + GMAP 20/46 + GMAP 20/48 + GMAP 20/72 + GMAP 20/75 + GMAP 20/89 + GMAP 20/114 + GMAP 30/1 + GMAP 10/1 + GMAP 14/2 + GMAP 14/5 + GMAP 14/8 + GMAP 14/10 + GMAP 15/2 + GMAP 16/3 + GMAP 20/7 + GMAP 20/9 + GMAP 20/21 + GMAP 20/47 + GMAP 20/52 + GMAP 20/53 + GMAP 20/55 + GMAP 20/66 + GMAP 20/69 + GMAP 20/91 + GMAP 20/96 + GMAP 20/104 + GMAP 35/6 + GMAP 37/2 + GMAP 37/3 + GMAP 37/5 + GMAP 38/5 + GMAP 40/13 + GMAP 40/18 + GMAP 40/26 + GMAP 40/28 + GMAP 40/37 + GMAP 40/46 + GMAP 40/48 + GMAP 54/2 + GMAP 54/3 + GMAP 56/1 + GMAP 1/1 + GMAP 1/6 + GMAP 2/2 + GMAP 14/12 + GMAP 16/2 + GMAP 17/4 + GMAP 18/4 + GMAP 18/5 + GMAP 32/4 + GMAP 35/4 + GMAP 35/5 + GMAP 35/8 + GMAP 36/1 + GMAP 37/4 + GMAP 37/6 + GMAP 40/4 + GMAP 40/8 + GMAP 40/14 + GMAP 40/21 + GMAP 40/27 + GMAP 40/33 + GMAP 40/36 + GMAP 20/78 + GMAP 20/79 + GMAP 20/82 + GMAP 20/84 + GMAP 20/88 + GMAP 20/90 + GMAP 20/103 + GMAP 20/111 + GMAP 32/2 + GMAP 34/3 + GMAP 34/4 + GMAP 35/1 + GMAP 35/2 + GMAP 36/2 + GMAP 38/6 + GMAP 40/6 + GMAP 40/7 + GMAP 40/12 + GMAP 40/15 + GMAP 40/17 + GMAP 40/19 + GMAP 40/23 + GMAP 40/32 + GMAP 40/38 + GMAP 40/39 + GMAP 40/44 + GMAP 59/5 + GMAP 59/6 + GMAP 59/8 + GMAP 59/9 + GMAP 59/11 + GMAP 75/1 + GMAP 76/2 + GMAP 76/4 + GMAP 79/8 + GMAP 79/16 + GMAP 92/5 + GMAP 93/2 + GMAP 93/4 + GMAP 102/4 + GMAP 103/4 + GMAP 105/7 + GMAP 12/2 + GMAP 13/1 + GMAP 14/7 + GMAP 16/6 + GMAP 18/3 + GMAP 19/1 + GMAP 20/10 + GMAP 20/26 + GMAP 20/39 + GMAP 20/43 + GMAP 20/50 + GMAP 20/56 + GMAP 20/61 + GMAP 20/85 + GMAP 20/98 + GMAP 20/110 + GMAP 32/3 + GMAP 33/1 + GMAP 35/7 + GMAP 35/10 + GMAP 38/2 + GMAP 38/3 + GMAP 40/1 + GMAP 40/3 + GMAP 40/25 + GMAP 40/34 + GMAP 40/50 + GMAP 40/52 + GMAP 40/63 + GMAP 40/65 + GMAP 40/67 + GMAP 40/72 + GMAP 41/1 + GMAP 56/2 + GMAP 57/3 + GMAP 59/1 + GMAP 77/4 + GMAP 79/14 + GMAP 92/1 + GMAP 93/1 + GMAP 93/5 + GMAP 105/5 + GMAP 107/2 + GMAP 14/11 + GMAP 16/4 + GMAP 17/2 + GMAP 17/3 + GMAP 18/1 + GMAP 20/2 + GMAP 20/3 + GMAP 20/6 + GMAP 20/12 + GMAP 20/18 + GMAP 20/23 + GMAP 20/34 + GMAP 20/37 + GMAP 20/44 + GMAP 20/59 + GMAP 20/65 + GMAP 20/77 + GMAP 20/100 + GMAP 20/106 + GMAP 20/107 + GMAP 20/112 + GMAP 20/113 + GMAP 22/1 + GMAP 34/2 + GMAP 35/3 + GMAP 35/11 + GMAP 36/5 + GMAP 38/1 + GMAP 38/4 + GMAP 40/9 + GMAP 40/10 + GMAP 40/41 + GMAP 40/43 + GMAP 40/60 + GMAP 40/70 + GMAP 50/1 + GMAP 52/1 + GMAP 74/2 + GMAP 75/2 + GMAP 77/1 + GMAP 79/5 + GMAP 79/7 + GMAP 79/10 + GMAP 92/4 + GMAP 94/1 + GMAP 102/1 + GMAP 102/3 + GMAP 103/2 + GMAP 104/1 + GMAP 57/4 + GMAP 58/1 + GMAP 58/2 + GMAP 59/10 + GMAP 60/1 + GMAP 79/2 + GMAP 79/3 + GMAP 79/12 + GMAP 105/4 + GMAP 105/6 + GMAP 107/1 + GMAP 32/5 + GMAP 32/7 + GMAP 35/9 + GMAP 36/3 + GMAP 39/1 + GMAP 40/11 + GMAP 40/20 + GMAP 40/30 + GMAP 40/31 + GMAP 40/35 + GMAP 40/49 + GMAP 40/55 + GMAP 40/61 + GMAP 40/66 + GMAP 40/69 + GMAP 40/71 + GMAP 42/1 + GMAP 54/1 + GMAP 62/1 + GMAP 74/1 + GMAP 74/3 + GMAP 76/3 + GMAP 77/2 + GMAP 82/1 + GMAP 104/3 + GMAP 110/1 + GMAP 20/1 + GMAP 20/35 + GMAP 20/49 + GMAP 20/58 + GMAP 20/63 + GMAP 20/80 + GMAP 20/93 + GMAP 20/94 + GMAP 20/99 + GMAP 20/101 + GMAP 20/102 + GMAP 32/6 + GMAP 35/12 + GMAP 36/4 + GMAP 37/1 + GMAP 40/5 + GMAP 40/16 + GMAP 40/24 + GMAP 40/40 + GMAP 40/42 + GMAP 40/45 + GMAP 40/51 + GMAP 40/53 + GMAP 40/59 + GMAP 40/62 + GMAP 40/64 + GMAP 40/68 + GMAP 57/2 + GMAP 59/2 + GMAP 59/3 + GMAP 59/4 + GMAP 59/7 + GMAP 72/2 + GMAP 102/2 + GMAP 102/5 + GMAP 108/1 + GMAP 40/47 + GMAP 40/57 + GMAP 40/58 + GMAP 53/1 + GMAP 59/12 + GMAP 72/1 + GMAP 74/4 + GMAP 76/1 + GMAP 79/4 + GMAP 79/6 + GMAP 79/9 + GMAP 79/13 + GMAP 92/3 + GMAP 93/3 + GMAP 93/7 + GMAP 103/1 + GMAP 105/1 + GMAP 106/1 + GMAP 104/2 + GMAP 105/2 + GMAP 1/3 + GMAP 12/1 + GMAP 17/1 + GMAP 17/6 + GMAP 19/3 + GMAP 20/5 + GMAP 20/20 + GMAP 20/28 + GMAP 20/32 + GMAP 20/51 + GMAP 20/62 + GMAP 20/70 + GMAP 20/74 + GMAP 20/81 + GMAP 20/108 + GMAP 32/1 + GMAP 34/1 + GMAP 34/5 + GMAP 36/6 + GMAP 40/2 + GMAP 40/22 + GMAP 40/29 + GMAP 40/54 + GMAP 40/56 + GMAP 54/4 + GMAP 55/1 + GMAP 56/3 + GMAP 57/1 + GMAP 70/1 + GMAP 73/1 + GMAP 77/3 + GMAP 78/3 + GMAP 79/1 + GMAP 79/11 + GMAP 79/15 + GMAP 81/1 + GMAP 90/1 + GMAP 92/2 + GMAP 93/6 + GMAP 100/1 + GMAP 103/3 + GMAP 105/3 + + + + + CORE 11/3 + CORE 40/2 + CORE 2a/60 + CORE 11/1 + CORE 11/2 + CORE 12/1 + CORE 12/3 + CORE 2a/53 + CORE 31/2 + CORE 2a/51 + CORE 2a/52 + CORE 2a/54 + CORE 11/5 + CORE 41/2 + CORE 2/1 + CORE 2/60 + CORE 2a/50 + CORE 2b/60 + CORE 11/6 + CORE 20/4 + CORE 20a/1 + + + + + UHCI 0/60 + + + + \ No newline at end of file diff --git a/tests/bluetooth/qualification/ICS_Zephyr_Bluetooth_Host.pts b/tests/bluetooth/qualification/ICS_Zephyr_Bluetooth_Host.pts index 613ae9734e6b94..f6cac3f08c4011 100644 --- a/tests/bluetooth/qualification/ICS_Zephyr_Bluetooth_Host.pts +++ b/tests/bluetooth/qualification/ICS_Zephyr_Bluetooth_Host.pts @@ -1,7 +1,7 @@ - + - 300252 - Zephyr_Bluetooth_Host + 302478 + Zephyr Host GAP @@ -21,6 +21,14 @@ 11b
3 + + 11c
+ 1 +
+ + 17a
+ 4 +
35
11 @@ -29,14 +37,26 @@ 14a
7
+ + 23
+ 7a +
27b
7
+ + 25
+ 13b +
37c
2
+ + 37
+ 3a +
30a
5 @@ -45,6 +65,10 @@ 30a
3
+ + 17
+ 5 +
8a
14a @@ -61,10 +85,22 @@ 30a
10
+ + 36
+ 6 +
30a
17
+ + 37
+ 6 +
+ + 27a
+ 5 +
27b
5 @@ -105,6 +141,14 @@ 25
12
+ + 35
+ 13b +
+ + 25
+ 13c +
17b
3 @@ -113,6 +157,14 @@ 30a
19
+ + 37
+ 7 +
+ + 37a
+ 5 +
30a
18 @@ -137,6 +189,10 @@ 37b
1
+ + 27a
+ 4 +
27b
1 @@ -145,6 +201,14 @@ 30a
4
+ + 35
+ 13c +
+ + 37a
+ 4 +
37b
9 @@ -165,6 +229,10 @@ 30a
13
+ + 17a
+ 5 +
37c
1 @@ -185,6 +253,10 @@ 11b
4
+ + 37a
+ 6 +
20A
18 @@ -201,6 +273,10 @@ 11b
2
+ + 8
+ 5 +
30a
6 @@ -233,6 +309,14 @@ 20A
19
+ + 27a
+ 6 +
+ + 27
+ 9a +
14a
14 @@ -245,10 +329,22 @@ 30a
16
+ + 35
+ 13a +
30a
1
+ + 25
+ 13a +
+ + 11
+ 5 +
35
12 @@ -257,6 +353,10 @@ 30a
11
+ + 26
+ 6 +
14a
9 @@ -265,6 +365,10 @@ 30a
9
+ + 33
+ 8a +
14a
1 @@ -293,6 +397,10 @@ 25
14
+ + 26
+ 5 +
37b
5 @@ -717,6 +825,18 @@ 27
9
+ + 27a
+ 1 +
+ + 27a
+ 2 +
+ + 27a
+ 3 +
28
1 @@ -901,6 +1021,18 @@ 37
3
+ + 37a
+ 1 +
+ + 37a
+ 2 +
+ + 37a
+ 3 +
5
1 @@ -1069,6 +1201,10 @@ 33
7
+ + 33
+ 8 +
7
3 @@ -1214,10 +1350,6 @@ 9
2
- - 10
- 10 -
3a
1 @@ -1936,10 +2068,6 @@ 4
3
- - 4
- 30 -
4
4 @@ -2533,6 +2661,10 @@ 11
16
+ + 11
+ 7 +
4
13 @@ -2545,14 +2677,6 @@ 11
6
- - 11
- 7 -
- - 11
- 8 -
11
19 @@ -2573,6 +2697,10 @@ 11
13
+ + 11
+ 8 +
12
7 @@ -2938,6 +3066,93 @@ 4
+ + LC3 + + 6
+ 2 +
+ + 4
+ 2 +
+ + 3
+ 1 +
+ + 6
+ 1 +
+ + 3
+ 6 +
+ + 2
+ 1 +
+ + 2
+ 3 +
+ + 5
+ 5 +
+ + 3
+ 3 +
+ + 5
+ 4 +
+ + 3
+ 4 +
+ + 1
+ 1 +
+ + 4
+ 1 +
+ + 5
+ 1 +
+ + 5
+ 3 +
+ + 3
+ 5 +
+ + 0
+ 1 +
+ + 2
+ 2 +
+ + 5
+ 6 +
+ + 3
+ 2 +
+ + 5
+ 2 +
+
AICS @@ -5777,6 +5992,10 @@ 23
18
+ + 93
+ 4 +
38
9 @@ -5869,6 +6088,10 @@ 90
1
+ + 92
+ 6 +
90
21 @@ -6065,6 +6288,10 @@ 45
6
+ + 96
+ 2 +
90
2 @@ -6105,6 +6332,10 @@ 39
3
+ + 93
+ 5 +
17
2 @@ -6153,6 +6384,10 @@ 30
3
+ + 90
+ 16 +
36
6 @@ -6161,6 +6396,10 @@ 60
1
+ + 93
+ 6 +
21
2 @@ -6373,10 +6612,18 @@ 52
1
+ + 95
+ 3 +
11
3
+ + 90
+ 17 +
15
12 @@ -6405,6 +6652,10 @@ 56
6
+ + 95
+ 2 +
16
4 @@ -6637,6 +6888,10 @@ 22
9
+ + 88
+ 5 +
68
5 @@ -6653,6 +6908,10 @@ 37
17
+ + 92
+ 5 +
16
5 @@ -6817,6 +7076,10 @@ 41
6
+ + 93
+ 2 +
34
5 @@ -6857,6 +7120,10 @@ 53
2
+ + 80
+ 13 +
89
11 @@ -6957,6 +7224,10 @@ 38
14
+ + 93
+ 3 +
20
11 @@ -7029,6 +7300,10 @@ 80
6
+ + 80
+ 14 +
80
2 @@ -7045,6 +7320,10 @@ 17
10
+ + 80
+ 15 +
54
16 @@ -7229,6 +7508,14 @@ 34
2
+ + 95
+ 5 +
+ + 80
+ 16 +
6
2 @@ -7289,6 +7576,10 @@ 65
2
+ + 95
+ 1 +
46
5 @@ -7305,6 +7596,10 @@ 21
6
+ + 92
+ 4 +
88
6 @@ -7357,6 +7652,10 @@ 92
1
+ + 94
+ 1 +
25
1 @@ -7389,6 +7688,10 @@ 7
1
+ + 93
+ 1 +
52
2 @@ -7401,6 +7704,10 @@ 33a
1
+ + 96
+ 1 +
12
15 @@ -7501,6 +7808,10 @@ 69
7
+ + 95
+ 4 +
13
13 @@ -7589,6 +7900,10 @@ 14
12
+ + 95
+ 6 +
33
7 @@ -7685,6 +8000,10 @@ 73
10
+ + 94
+ 2 +
87
4 @@ -7805,6 +8124,10 @@ 68
16
+ + 82
+ 4 +
31
7 @@ -8913,6 +9236,10 @@ 13
1
+ + 13
+ 7 +
18
1 @@ -11717,12 +12044,16 @@
2
- 54 + 60
20a
1
+ + 2b
+ 60 +
11
2 @@ -11759,6 +12090,10 @@ 20
4
+ + 2a
+ 60 +
2a
50 @@ -11771,10 +12106,6 @@ 2a
52
- - 2b
- 54 -
11
3 @@ -11784,8 +12115,8 @@ UHCI 0
- 54 + 60
-
+ \ No newline at end of file From ce02d0c0fcace84f5a06ca52fa8e7b0ba1e536e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20Cab=C3=A9?= Date: Mon, 4 Nov 2024 12:24:26 +0100 Subject: [PATCH 088/113] doc: releases: Complete documentation release notes for 4.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This completes the existing "Documentation" section of the release notes for 4.0 by documenting the various changes/improvements implemented during the last development cycle. Signed-off-by: Benjamin Cabé --- doc/releases/release-notes-4.0.rst | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/doc/releases/release-notes-4.0.rst b/doc/releases/release-notes-4.0.rst index bd08679b1b3c4f..4c85812fc5751b 100644 --- a/doc/releases/release-notes-4.0.rst +++ b/doc/releases/release-notes-4.0.rst @@ -285,9 +285,24 @@ Build system and Infrastructure Documentation ************* - * Added two new build commands, ``make html-live`` and ``make html-live-fast``, that automatically locally - host the generated documentation. They also automatically rebuild and rehost the documentation when changes - to the input ``.rst`` files are detected on the filesystem. +* Added a new :ref:`interactive board catalog ` enabling users to search boards by criteria + such as name, architecture, vendor, or SoC. +* Added a new :zephyr:code-sample-category:`interactive code sample catalog ` for quickly + finding code samples based on name and description. +* Added :rst:dir:`zephyr:board` directive and :rst:role:`zephyr:board` role to mark Sphinx pages as + board documentation and reference them from other pages. Most existing board documentation pages + have been updated to use this directive, with full migration planned for the next release. +* Added :rst:dir:`zephyr:code-sample-category` directive to describe and group code samples in the + documentation. +* Added a link to the source code of the driver matching a binding's compatible string (when one can + be found in the Zephyr tree) to the :ref:`dt-bindings` documentation. +* Added a button to all code sample README pages allowing to directly browse the sample's source + code on GitHub. +* Moved Zephyr C API documentation out of main documentation. API references now feature a rich + tooltip and link to the dedicated Doxygen site. +* Added two new build commands, ``make html-live`` and ``make html-live-fast``, that automatically + locally host the generated documentation. They also automatically rebuild and rehost the + documentation when changes to the input ``.rst`` files are detected on the filesystem. Drivers and Sensors ******************* From 8fc161f8207a7df52ad707edbb644a85fc28ac8e Mon Sep 17 00:00:00 2001 From: Grzegorz Swiderski Date: Mon, 4 Nov 2024 13:49:55 +0100 Subject: [PATCH 089/113] west: runners: nrf: Check for missing UICR On nRF54H and nRF92, booting certain cores requires programming a UICR, which is normally generated using nrf-regtool. This should be considered an optional dependency, because we do not wish to force non-Nordic users to install it just to work with Zephyr, or just for build-only tests. When nrf-regtool is not installed, a CMake warning will be displayed, but people ignore warnings all the time. As the last line of defense, check for missing UICR in the nrfutil flash runner, to prevent our users from unintentionally programming unbootable firmware. Show a fatal error specifically if CONFIG_NRF_REGTOOL_GENERATE_UICR=y, yet no UICR exists. Signed-off-by: Grzegorz Swiderski --- scripts/west_commands/runners/nrf_common.py | 38 ++++++++++++++------- 1 file changed, 25 insertions(+), 13 deletions(-) diff --git a/scripts/west_commands/runners/nrf_common.py b/scripts/west_commands/runners/nrf_common.py index cf723ba7bd3e65..81aaaf73bf2575 100644 --- a/scripts/west_commands/runners/nrf_common.py +++ b/scripts/west_commands/runners/nrf_common.py @@ -35,9 +35,17 @@ 'NRFDL_DEVICE_CORE_APPLICATION': (0x00FF8000, 0x00FF8800), 'NRFDL_DEVICE_CORE_NETWORK': (0x01FF8000, 0x01FF8800), }, + 'NRF54H_FAMILY': { + 'NRFDL_DEVICE_CORE_APPLICATION': (0x0FFF8000, 0x0FFF8800), + 'NRFDL_DEVICE_CORE_NETWORK': (0x0FFFA000, 0x0FFFA800), + }, 'NRF91_FAMILY': { 'NRFDL_DEVICE_CORE_APPLICATION': (0x00FF8000, 0x00FF8800), - } + }, + 'NRF92_FAMILY': { + 'NRFDL_DEVICE_CORE_APPLICATION': (0x0FFF8000, 0x0FFF8800), + 'NRFDL_DEVICE_CORE_NETWORK': (0x0FFFA000, 0x0FFFA800), + }, } # Relative to the root of the hal_nordic module @@ -307,6 +315,19 @@ def program_hex(self): self.build_conf.getboolean('CONFIG_SOC_NRF54H20_ENGB_CPURAD') or self.build_conf.getboolean('CONFIG_SOC_NRF9280_CPURAD') ) + generated_uicr = self.build_conf.getboolean('CONFIG_NRF_REGTOOL_GENERATE_UICR') + + if cpuapp: + core = 'NRFDL_DEVICE_CORE_APPLICATION' + elif cpurad: + core = 'NRFDL_DEVICE_CORE_NETWORK' + + if generated_uicr and not self.hex_get_uicrs().get(core): + raise RuntimeError( + f"Expected a UICR to be contained in: {self.hex_}\n" + "Please ensure that the correct version of nrf-regtool is " + "installed, then run 'west build --cmake' to try again." + ) if self.erase: self.exec_op('erase', core='NRFDL_DEVICE_CORE_APPLICATION') @@ -335,18 +356,9 @@ def program_hex(self): mpi_hex_dir / 'suit_installed_envelopes_application_merged.hex') self.op_program(app_root_envelope_hex_file, 'ERASE_NONE', None, defer=True, core='NRFDL_DEVICE_CORE_APPLICATION') - if cpuapp: - if not self.erase and self.build_conf.getboolean('CONFIG_NRF_REGTOOL_GENERATE_UICR'): - self.exec_op('erase', core='NRFDL_DEVICE_CORE_APPLICATION', - option={'chip_erase_mode': 'ERASE_UICR', - 'qspi_erase_mode': 'ERASE_NONE'}) - core = 'NRFDL_DEVICE_CORE_APPLICATION' - elif cpurad: - if not self.erase and self.build_conf.getboolean('CONFIG_NRF_REGTOOL_GENERATE_UICR'): - self.exec_op('erase', core='NRFDL_DEVICE_CORE_NETWORK', - option={'chip_erase_mode': 'ERASE_UICR', - 'qspi_erase_mode': 'ERASE_NONE'}) - core = 'NRFDL_DEVICE_CORE_NETWORK' + if not self.erase and generated_uicr: + self.exec_op('erase', core=core, option={'chip_erase_mode': 'ERASE_UICR', + 'qspi_erase_mode': 'ERASE_NONE'}) else: if self.erase: erase_arg = 'ERASE_ALL' From e0d1e5973d8bf6350f9bf39fa2cf408c7e7a5b07 Mon Sep 17 00:00:00 2001 From: Sumit Batra Date: Wed, 6 Nov 2024 15:57:52 +0530 Subject: [PATCH 090/113] mdio: fmurt6: dts: Enable the parent node of mdio mdio_enet_nxp driver accesses the registers of its parent node Ethernet MAC This commit enables this node in mimxrt1062_fmurt6 board's device tree. This also fixes Issue #80881 Signed-off-by: Sumit Batra --- boards/nxp/mimxrt1062_fmurt6/mimxrt1062_fmurt6.dts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/boards/nxp/mimxrt1062_fmurt6/mimxrt1062_fmurt6.dts b/boards/nxp/mimxrt1062_fmurt6/mimxrt1062_fmurt6.dts index 9d124b7b2c306c..44a00e72d9a36d 100644 --- a/boards/nxp/mimxrt1062_fmurt6/mimxrt1062_fmurt6.dts +++ b/boards/nxp/mimxrt1062_fmurt6/mimxrt1062_fmurt6.dts @@ -385,12 +385,17 @@ nxp,prescaler = <64>; }; +&enet2 { + status = "okay"; +}; + &enet2_mac { pinctrl-0 = <&pinmux_enet>; pinctrl-names = "default"; zephyr,random-mac-address; phy-connection-type = "rmii"; phy-handle = <&phy>; + status = "okay"; }; &enet2_mdio { From 6fb8157ee457b2beebf9c931121990e0b86c0bda Mon Sep 17 00:00:00 2001 From: Daniel Leung Date: Wed, 6 Nov 2024 11:11:09 -0800 Subject: [PATCH 091/113] doc: release/4.0: add bits about demand paging This adds some bits about demand paging in release note for 4.0. Signed-off-by: Daniel Leung --- doc/releases/release-notes-4.0.rst | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/doc/releases/release-notes-4.0.rst b/doc/releases/release-notes-4.0.rst index 4c85812fc5751b..c65898468e2a37 100644 --- a/doc/releases/release-notes-4.0.rst +++ b/doc/releases/release-notes-4.0.rst @@ -79,6 +79,8 @@ Architectures * Added initial support for :c:func:`arch_stack_walk` that supports unwinding via esf only + * Added support for demand paging. + * RISC-V * The stack traces upon fatal exception now prints the address of stack pointer (sp) or frame @@ -541,6 +543,8 @@ Libraries / Subsystems * Demand Paging + * Added LRU (Least Recently Used) eviction algorithm. + * Formatted output * Management From d4b1302387b763badbee80f8e94773cb1bda6d42 Mon Sep 17 00:00:00 2001 From: Daniel Leung Date: Wed, 6 Nov 2024 10:59:32 -0800 Subject: [PATCH 092/113] doc: release/4.0: add bits about serial This adds some bits about serial/UART in the migration and release notes for 4.0. Signed-off-by: Daniel Leung --- doc/releases/migration-guide-4.0.rst | 2 ++ doc/releases/release-notes-4.0.rst | 3 +++ 2 files changed, 5 insertions(+) diff --git a/doc/releases/migration-guide-4.0.rst b/doc/releases/migration-guide-4.0.rst index 82c2779a842797..20e10f9a77bc09 100644 --- a/doc/releases/migration-guide-4.0.rst +++ b/doc/releases/migration-guide-4.0.rst @@ -297,6 +297,8 @@ Serial can accept data bytes, instead of ``ret == 1``. The function now returns a lower bound on the number of bytes that can be provided to :c:func:`uart_fifo_fill` without truncation. + * LiteX: ``CONFIG_UART_LITEUART`` has been renamed to :kconfig:option:`CONFIG_UART_LITEX`. + Regulator ========= diff --git a/doc/releases/release-notes-4.0.rst b/doc/releases/release-notes-4.0.rst index c65898468e2a37..16c941de34ede2 100644 --- a/doc/releases/release-notes-4.0.rst +++ b/doc/releases/release-notes-4.0.rst @@ -449,6 +449,9 @@ Drivers and Sensors * LiteX: Renamed the ``compatible`` from ``litex,uart0`` to :dtcompatible:`litex,uart`. * Nordic: Removed ``CONFIG_UART_n_GPIO_MANAGEMENT`` Kconfig options (where n is an instance index) which had no use after pinctrl driver was introduced. + * NS16550: Added support for Synopsys Designware 8250 UART. + * Renesas: Added support for SCI UART. + * Sensry: Added UART support for Ganymed SY1XX. * SPI From 467f31190e6e111edf7ee204ecd3de27c3ff9c9a Mon Sep 17 00:00:00 2001 From: Josuah Demangeon Date: Tue, 5 Nov 2024 16:01:52 +0000 Subject: [PATCH 093/113] doc: release: 4.0: Add video driver and video API updates Add entries for video driver contributed or enhanced. Add entries for video APIs introduced or modified. Signed-off-by: Josuah Demangeon --- doc/releases/release-notes-4.0.rst | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/doc/releases/release-notes-4.0.rst b/doc/releases/release-notes-4.0.rst index 16c941de34ede2..8e3d243e6d67fb 100644 --- a/doc/releases/release-notes-4.0.rst +++ b/doc/releases/release-notes-4.0.rst @@ -470,6 +470,18 @@ Drivers and Sensors * Video + * Introduced API to control frame rate + * Introduced API for partial frames transfer with the video buffer field ``line_offset`` + * Introduced API for :ref:`multi-heap` video buffer allocation with + :kconfig:option:`CONFIG_VIDEO_BUFFER_USE_SHARED_MULTI_HEAP` + * Introduced bindings for common video link properties in ``video-interfaces.yaml`` + * Introduced missing :kconfig:option:`CONFIG_VIDEO_LOG_LEVEL` + * Added support for GalaxyCore GC2145 image sensor (:dtcompatible:`gc,gc2145`) + * Added support for ESP32-S3 LCD-CAM interface (:dtcompatible:`espressif,esp32-lcd-cam`) + * Added support for NXP MCUX SMARTDMA interface (:dtcompatible:`nxp,smartdma`) + * Added support for more OmniVision OV2640 controls (:dtcompatible:`ovti,ov2640`) + * Added support for more OmniVision OV5640 controls (:dtcompatible:`ovti,ov5640`) + * Watchdog * Wi-Fi From 41b3cd77df371604609b3baf76cced88b648937e Mon Sep 17 00:00:00 2001 From: Sylvio Alves Date: Wed, 6 Nov 2024 09:07:11 -0300 Subject: [PATCH 094/113] docs: boards: xiao_esp32s3: migrate board name to new directive Update board name to meet zephyr:board model. Signed-off-by: Sylvio Alves --- boards/seeed/xiao_esp32s3/doc/index.rst | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/boards/seeed/xiao_esp32s3/doc/index.rst b/boards/seeed/xiao_esp32s3/doc/index.rst index 6ce906d3bde59a..7945ec352f0f3f 100644 --- a/boards/seeed/xiao_esp32s3/doc/index.rst +++ b/boards/seeed/xiao_esp32s3/doc/index.rst @@ -1,7 +1,4 @@ -.. _xiao_esp32s3: - -XIAO ESP32S3/XIAO ESP32S3 Sense -############################### +.. zephyr:board:: xiao_esp32s3 Overview ******** From 07fd5600a9e0cd104259a56cfa304d7f2dd27080 Mon Sep 17 00:00:00 2001 From: Sylvio Alves Date: Tue, 5 Nov 2024 09:45:26 -0300 Subject: [PATCH 095/113] kconfig: fix typo and help description. Fix typo and re-phrase help description to improve it. Signed-off-by: Sylvio Alves --- soc/espressif/common/Kconfig | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/soc/espressif/common/Kconfig b/soc/espressif/common/Kconfig index ccb37c6fff78e6..ffeac4ab04535b 100644 --- a/soc/espressif/common/Kconfig +++ b/soc/espressif/common/Kconfig @@ -20,7 +20,7 @@ config ESP_SIMPLE_BOOT default y if !BOOTLOADER_MCUBOOT && !MCUBOOT help The Simple Boot is a booting method that doesn't need a 2nd stage bootloader. - Output is a single image that should be flashed at a offset defined by used SOC. + Output is a single image that should be flashed at an offset defined by used SOC. Please note that this method brings the system up with all memories set-up, but all other features, such as secure boot OTA or slots management are not available. @@ -28,8 +28,8 @@ config ESP_HEAP_RUNTIME bool default y help - Enabling this will allocate SRAM area starting by a last linked data at symbolic `_end`, - ending by a last memory location that can be safely accesed (depending on a boot mode). + Enabling this will allocate SRAM area starting from the last linked data at the symbolic `_end`, + ending at the last memory location that can be safely accessed (depending on a boot mode). This is a memory pool used in runtime to create a new heap memory. config ESP32_TIMER_TASK_STACK_SIZE From 85f9940e144f9f29559b1a36320ff1078cc0cd11 Mon Sep 17 00:00:00 2001 From: Sylvio Alves Date: Tue, 5 Nov 2024 09:41:32 -0300 Subject: [PATCH 096/113] doc: release: 4.0: Add Espressif changes. Adds notes on Espressif changes to this release. Signed-off-by: Sylvio Alves --- doc/releases/release-notes-4.0.rst | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/doc/releases/release-notes-4.0.rst b/doc/releases/release-notes-4.0.rst index 8e3d243e6d67fb..c144a0ae069b42 100644 --- a/doc/releases/release-notes-4.0.rst +++ b/doc/releases/release-notes-4.0.rst @@ -160,10 +160,13 @@ Boards & SoC Support * Added support for these SoC series: + * Added ESP32-C2 and ESP8684 SoC support. + * Made these changes in other SoC series: * NXP S32Z270: Added support for the new silicon cut version 2.0. Note that the previous versions (1.0 and 1.1) are no longer supported. + * Added ESP32 WROVER-E-N16R4 variant. * Added support for these boards: @@ -211,6 +214,7 @@ Boards & SoC Support * :ref:`Renesas RA6E2 Fast Prototyping Board ` (``fpb_ra6e2``) * :ref:`Renesas RA8T1 Evaluation Kit ` (``mck_ra8t1``) * :zephyr:board:`Renode Cortex-R8 Virtual ` (``cortex_r8_virtual``) + * :zephyr:board:`Seeed XIAO ESP32-S3 Sense Variant `: ``xiao_esp32s3``. * :ref:`sensry.io Ganymed Break-Out-Board (BOB) ` (``ganymed_bob``) * :zephyr:board:`SiLabs SiM3U1xx 32-bit MCU USB Development Kit ` (``sim3u1xx_dk``) * :ref:`SparkFun Thing Plus Matter ` (``sparkfun_thing_plus_matter_mgm240p``) @@ -311,6 +315,9 @@ Drivers and Sensors * ADC + * Added proper ADC2 calibration entries in ESP32. + * Fixed calibration scheme in ESP32-S3. + * Battery * CAN @@ -353,6 +360,7 @@ Drivers and Sensors * Fixed SPI NOR driver issue where wp, hold and reset pins were incorrectly initialized from device tee when SFDP at run-time has been enabled (:github:`80383`) + * Updated all Espressif's SoC driver initialization to allow new chipsets and octal flash support. * Added :kconfig:option:`CONFIG_SPI_NOR_ACTIVE_DWELL_MS`, to the SPI NOR driver configuration, which allows setting the time during which the driver will wait before triggering Deep Power Down (DPD). @@ -381,10 +389,18 @@ Drivers and Sensors * I2S + * Added ESP32-S3 and ESP32-C3 driver support. + * I3C * Input + * Fixed broken ESP32 input touch sensor driver. + +* Interrupt + + * Updated ESP32 family interrupt allocator with proper IRQ flags and priorities. + * LED * lp5562: added ``enable-gpios`` property to describe the EN/VCC GPIO of the lp5562. @@ -403,6 +419,8 @@ Drivers and Sensors * Mailbox + * Added driver support for ESP32 and ESP32-S3 SoCs. + * MDIO * MFD @@ -432,6 +450,8 @@ Drivers and Sensors * SDHC + * Added ESP32-S3 driver support. + * Sensors * The existing driver for the Microchip MCP9808 temperature sensor transformed and renamed @@ -486,6 +506,10 @@ Drivers and Sensors * Wi-Fi + * Added ESP32-C2 Wi-Fi support. + * Added ESP32 driver APSTA support. + * Updated ESP32 Wi-Fi driver to reflect actual negotiated PHY mode. + Networking ********** @@ -605,6 +629,8 @@ Libraries / Subsystems * Power management + * Added initial ESP32-C6 power management interface to allow light and deep-sleep features. + * Crypto * Mbed TLS was updated to version 3.6.2 (from 3.6.0). The release notes can be found at: @@ -721,6 +747,9 @@ HALs * Espressif + * Synced HAL to version v5.1.4 to update SoCs low level files, RF libraries and + overall driver support. + MCUboot ******* From 4300a4c33b0f6becc43d1e3a130ebee19c411c6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20Cab=C3=A9?= Date: Tue, 5 Nov 2024 11:48:01 +0100 Subject: [PATCH 097/113] doc: boards: esp32: fix XIAO-ESP32S3 build instructions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fix wrong board target in build command snippets Signed-off-by: Benjamin Cabé --- boards/seeed/xiao_esp32s3/doc/index.rst | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/boards/seeed/xiao_esp32s3/doc/index.rst b/boards/seeed/xiao_esp32s3/doc/index.rst index 7945ec352f0f3f..afc3a7e231c74e 100644 --- a/boards/seeed/xiao_esp32s3/doc/index.rst +++ b/boards/seeed/xiao_esp32s3/doc/index.rst @@ -196,14 +196,14 @@ Build and flash applications as usual (see :ref:`build_an_application` and .. zephyr-app-commands:: :zephyr-app: samples/hello_world - :board: xiao_esp32s3/esp32/procpu + :board: xiao_esp32s3/esp32s3/procpu :goals: build .. group-tab:: XIAO ESP32S3 Sense .. zephyr-app-commands:: :zephyr-app: samples/hello_world - :board: xiao_esp32s3/esp32/procpu/sense + :board: xiao_esp32s3/esp32s3/procpu/sense :goals: build The usual ``flash`` target will work with the ``xiao_esp32s3`` board @@ -216,14 +216,14 @@ application. .. zephyr-app-commands:: :zephyr-app: samples/hello_world - :board: xiao_esp32s3/esp32/procpu + :board: xiao_esp32s3/esp32s3/procpu :goals: flash .. group-tab:: XIAO ESP32S3 Sense .. zephyr-app-commands:: :zephyr-app: samples/hello_world - :board: xiao_esp32s3/esp32/procpu/sense + :board: xiao_esp32s3/esp32s3/procpu/sense :goals: flash Open the serial monitor using the following command: @@ -257,14 +257,14 @@ Here is an example for building the :zephyr:code-sample:`hello_world` applicatio .. zephyr-app-commands:: :zephyr-app: samples/hello_world - :board: xiao_esp32s3/esp32/procpu + :board: xiao_esp32s3/esp32s3/procpu :goals: debug .. group-tab:: XIAO ESP32S3 Sense .. zephyr-app-commands:: :zephyr-app: samples/hello_world - :board: xiao_esp32s3/esp32/procpu/sense + :board: xiao_esp32s3/esp32s3/procpu/sense :goals: debug You can debug an application in the usual way. Here is an example for the :zephyr:code-sample:`hello_world` application. @@ -275,14 +275,14 @@ You can debug an application in the usual way. Here is an example for the :zephy .. zephyr-app-commands:: :zephyr-app: samples/hello_world - :board: xiao_esp32s3/esp32/procpu + :board: xiao_esp32s3/esp32s3/procpu :goals: debug .. group-tab:: XIAO ESP32S3 Sense .. zephyr-app-commands:: :zephyr-app: samples/hello_world - :board: xiao_esp32s3/esp32/procpu/sense + :board: xiao_esp32s3/esp32s3/procpu/sense :goals: debug References From f556826c831edeee835ea1fc1e42e2ff085f392a Mon Sep 17 00:00:00 2001 From: Riadh Ghaddab Date: Tue, 5 Nov 2024 12:18:13 +0100 Subject: [PATCH 098/113] doc: release: 4.0: add notes on ZMS Add notes about the new storage system ZMS Signed-off-by: Riadh Ghaddab --- doc/releases/release-notes-4.0.rst | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/doc/releases/release-notes-4.0.rst b/doc/releases/release-notes-4.0.rst index c144a0ae069b42..9c21cb8b2285ed 100644 --- a/doc/releases/release-notes-4.0.rst +++ b/doc/releases/release-notes-4.0.rst @@ -717,6 +717,10 @@ Libraries / Subsystems * Shell: Fixed an issue were a failed file system mount attempt using the shell would make it impossible to ever succeed in mounting that file system again until the device was reset (:github:`80024`). + * :ref:`ZMS`: Introduction of a new storage system that is designed to work with all types of + non-volatile storage technologies. It supports classical on-chip NOR flash as well as + new technologies like RRAM and MRAM that do not require a separate erase operation at all. + * Task Watchdog * POSIX API From 5155c0e8200d08cccd03ebe234b966e03c9c1d2b Mon Sep 17 00:00:00 2001 From: Fabio Baltieri Date: Wed, 6 Nov 2024 01:35:25 +0000 Subject: [PATCH 099/113] doc: release: add a step to verify that the tag is signed Add an extra "git show" step to the release process to verify that the key has been indeed signed. Signed-off-by: Fabio Baltieri --- doc/project/release_process.rst | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/doc/project/release_process.rst b/doc/project/release_process.rst index 82fd5e303490e6..9c3b39fa38c327 100644 --- a/doc/project/release_process.rst +++ b/doc/project/release_process.rst @@ -453,10 +453,20 @@ steps: #. Post a PR with the updated :zephyr_file:`VERSION` file using ``release: Zephyr 1.11.0-rc1`` as the commit subject. Merge the PR after successful CI. + #. Tag and push the version, using an annotated tag:: $ git pull $ git tag -s -m "Zephyr 1.11.0-rc1" v1.11.0-rc1 + + #. Verify that the tag has been signed correctly, ``git show`` for the + tag must contain a signature (look for the ``BEGIN PGP SIGNATURE`` + or ``BEGIN SSH SIGNATURE`` marker in the output):: + + $ git show v1.11.0-rc1 + + #. Push the tag:: + $ git push git@github.com:zephyrproject-rtos/zephyr.git v1.11.0-rc1 #. Send an email to the mailing lists (``announce`` and ``devel``) @@ -486,6 +496,15 @@ steps: $ git pull $ git tag -s -m "Zephyr 1.11.0" v1.11.0 + + #. Verify that the tag has been signed correctly, ``git show`` for the + tag must contain a signature (look for the ``BEGIN PGP SIGNATURE`` + or ``BEGIN SSH SIGNATURE`` marker in the output):: + + $ git show v1.11.0 + + #. Push the tag:: + $ git push git@github.com:zephyrproject-rtos/zephyr.git v1.11.0 #. Find the new ``v1.11.0`` tag at the top of the releases page and From c3466b14d09b1e51b6ca472f3b3654e40cba12d8 Mon Sep 17 00:00:00 2001 From: Gaofeng Zhang Date: Tue, 22 Oct 2024 10:31:53 +0800 Subject: [PATCH 100/113] manifest: Update hal_nxp to fix hang when board reset Update hal_nxp to fix hang when board reset Signed-off-by: Gaofeng Zhang --- west.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/west.yml b/west.yml index f6c0a3b09f3809..b61f2b97afb79c 100644 --- a/west.yml +++ b/west.yml @@ -198,7 +198,7 @@ manifest: groups: - hal - name: hal_nxp - revision: ca9c81a06fbd3db10faf708194443511f1eadacb + revision: 6e7d5cf2e6463e1b6c967d85ce0032deaa15fb59 path: modules/hal/nxp groups: - hal From e254a7f3c8519082f78cf99f0803ddb15bd992da Mon Sep 17 00:00:00 2001 From: Henrik Skreslet Date: Thu, 31 Oct 2024 08:46:00 +0100 Subject: [PATCH 101/113] modem: cmux: added validation of cmux frame length Validates cmux frame length and drops it if its larger than the receive buffer Signed-off-by: Henrik Skreslet --- subsys/modem/modem_cmux.c | 8 ++++ tests/subsys/modem/modem_cmux/src/main.c | 50 ++++++++++++++++++++++++ 2 files changed, 58 insertions(+) diff --git a/subsys/modem/modem_cmux.c b/subsys/modem/modem_cmux.c index 4a755284bff02a..7a78b06a8f3461 100644 --- a/subsys/modem/modem_cmux.c +++ b/subsys/modem/modem_cmux.c @@ -816,6 +816,14 @@ static void modem_cmux_process_received_byte(struct modem_cmux *cmux, uint8_t by /* Get last 8 bits of data length */ cmux->frame.data_len |= ((uint16_t)byte) << 7; + if (cmux->frame.data_len > cmux->receive_buf_size) { + LOG_ERR("Indicated frame data length %u exceeds receive buffer size %u", + cmux->frame.data_len, cmux->receive_buf_size); + + cmux->receive_state = MODEM_CMUX_RECEIVE_STATE_DROP; + break; + } + /* Await data */ cmux->receive_state = MODEM_CMUX_RECEIVE_STATE_DATA; break; diff --git a/tests/subsys/modem/modem_cmux/src/main.c b/tests/subsys/modem/modem_cmux/src/main.c index 28d772614b185f..579dbb8635ed06 100644 --- a/tests/subsys/modem/modem_cmux/src/main.c +++ b/tests/subsys/modem/modem_cmux/src/main.c @@ -148,6 +148,14 @@ static uint8_t cmux_frame_dlci2_at_newline[] = {0xF9, 0x0B, 0xEF, 0x05, 0x0D, 0x static uint8_t cmux_frame_data_dlci2_at_newline[] = {0x0D, 0x0A}; +/*************************************************************************************************/ +/* DLCI2 AT CMUX error frames */ +/*************************************************************************************************/ +static uint8_t cmux_frame_dlci2_at_cgdcont_invalid_length[] = { + 0xF9, 0x0B, 0xEF, 0xFE, 0x41, 0x54, 0x2B, 0x43, 0x47, 0x44, 0x43, 0x4F, 0x4E, + 0x54, 0x3D, 0x31, 0x2C, 0x22, 0x49, 0x50, 0x22, 0x2C, 0x22, 0x74, 0x72, 0x61, + 0x63, 0x6B, 0x75, 0x6E, 0x69, 0x74, 0x2E, 0x6D, 0x32, 0x6D, 0x22, 0x23, 0xF9}; + /*************************************************************************************************/ /* DLCI1 AT CMUX frames */ /*************************************************************************************************/ @@ -814,4 +822,46 @@ ZTEST(modem_cmux, test_modem_cmux_prevent_work_while_released) zassert_ok(modem_pipe_open(dlci2_pipe, K_SECONDS(10))); } +ZTEST(modem_cmux, test_modem_drop_frames_with_invalid_length) +{ + int ret; + uint32_t events; + + modem_backend_mock_put(&bus_mock, cmux_frame_dlci2_at_cgdcont_invalid_length, + sizeof(cmux_frame_dlci2_at_cgdcont_invalid_length)); + + k_msleep(100); + + events = k_event_test(&cmux_event, EVENT_CMUX_DLCI2_RECEIVE_READY); + + zassert_false(events & EVENT_CMUX_DLCI2_RECEIVE_READY, + "Receive event should not have been received for DLCI2 pipe"); + + modem_backend_mock_put(&bus_mock, cmux_frame_dlci2_at_cgdcont, + sizeof(cmux_frame_dlci2_at_cgdcont)); + + modem_backend_mock_put(&bus_mock, cmux_frame_dlci2_at_newline, + sizeof(cmux_frame_dlci2_at_newline)); + + k_msleep(100); + + events = k_event_test(&cmux_event, EVENT_CMUX_DLCI2_RECEIVE_READY); + zassert_equal(events, EVENT_CMUX_DLCI2_RECEIVE_READY, + "Receive ready event not received for DLCI2 pipe"); + + ret = modem_pipe_receive(dlci2_pipe, buffer2, sizeof(buffer2)); + zassert_true(ret == (sizeof(cmux_frame_data_dlci2_at_cgdcont) + + sizeof(cmux_frame_data_dlci2_at_newline)), + "Incorrect number of bytes received"); + + zassert_true(memcmp(buffer2, cmux_frame_data_dlci2_at_cgdcont, + sizeof(cmux_frame_data_dlci2_at_cgdcont)) == 0, + "Incorrect data received"); + + zassert_true(memcmp(&buffer2[sizeof(cmux_frame_data_dlci2_at_cgdcont)], + cmux_frame_data_dlci2_at_newline, + sizeof(cmux_frame_data_dlci2_at_newline)) == 0, + "Incorrect data received"); +} + ZTEST_SUITE(modem_cmux, NULL, test_modem_cmux_setup, test_modem_cmux_before, NULL, NULL); From 5a03d3f51ca4b97e399c2bd06b5daed7ae169ea6 Mon Sep 17 00:00:00 2001 From: Andries Kruithof Date: Thu, 31 Oct 2024 13:38:34 +0100 Subject: [PATCH 102/113] Bluetooth: Audio: Fix description for broadcast_code callback Small mismatch between the actual procedure name and the name as described in the doxygen documentation for the bap set broadcast code procedure Signed-off-by: Andries Kruithof --- include/zephyr/bluetooth/audio/bap.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/zephyr/bluetooth/audio/bap.h b/include/zephyr/bluetooth/audio/bap.h index 30e265599e0e47..90caa07eb29067 100644 --- a/include/zephyr/bluetooth/audio/bap.h +++ b/include/zephyr/bluetooth/audio/bap.h @@ -2597,7 +2597,7 @@ struct bt_bap_broadcast_assistant_cb { void (*mod_src)(struct bt_conn *conn, int err); /** - * @brief Callback function for bt_bap_broadcast_assistant_broadcast_code(). + * @brief Callback function for bt_bap_broadcast_assistant_set_broadcast_code(). * * @param conn The connection to the peer device. * @param err Error value. 0 on success, GATT error on fail. From 20cd3a3f094047294810c49f9060e674a0fdaa2e Mon Sep 17 00:00:00 2001 From: Luca Burelli Date: Wed, 23 Oct 2024 18:08:05 +0200 Subject: [PATCH 103/113] drivers/flash/mcux: fix flash_read() operation on LPC55S36 As other targets in the LPC55xxx series, the LPC55S36 has a Flash controller that raises ECC errors when reading erased pages directly. To avoid this, there is special code for this platform that calls the HAL FLASH_IsFlashAreaReadable() function. However, this in turn calls a function at an hardcoded address in ROM that _always_ causes an instruction fault, making the situation worse. This patch reworks the read operation to use the FLASH_Read() HAL function for this target to gracefully handle error conditions and properly emulate accesses to erased pages. The preprocessor is required since some targets do not define the FLASH_Read() function. Fixes: #80325 Signed-off-by: Luca Burelli --- drivers/flash/soc_flash_mcux.c | 48 +++++++++++++++++++++++----------- 1 file changed, 33 insertions(+), 15 deletions(-) diff --git a/drivers/flash/soc_flash_mcux.c b/drivers/flash/soc_flash_mcux.c index bcde5bcfc8878d..88b0387f623295 100644 --- a/drivers/flash/soc_flash_mcux.c +++ b/drivers/flash/soc_flash_mcux.c @@ -55,7 +55,7 @@ LOG_MODULE_REGISTER(flash_mcux); #define SOC_NV_FLASH_NODE DT_INST(0, soc_nv_flash) -#if defined(CONFIG_CHECK_BEFORE_READING) && !defined(CONFIG_SOC_LPC55S36) +#if defined(CONFIG_CHECK_BEFORE_READING) && !defined(CONFIG_SOC_LPC55S36) #define FMC_STATUS_FAIL FLASH_INT_CLR_ENABLE_FAIL_MASK #define FMC_STATUS_ERR FLASH_INT_CLR_ENABLE_ERR_MASK #define FMC_STATUS_DONE FLASH_INT_CLR_ENABLE_DONE_MASK @@ -205,35 +205,53 @@ static int flash_mcux_read(const struct device *dev, off_t offset, addr = offset + priv->pflash_block_base; #ifdef CONFIG_CHECK_BEFORE_READING + /* + * Ensure the area is readable, since a direct access may cause faults + * on erased or otherwise unreadable pages. Emulate erased pages, + * return other errors. + */ #ifdef CONFIG_SOC_LPC55S36 - /* Validates the given address range is loaded in the flash hiding region. */ - rc = FLASH_IsFlashAreaReadable(&priv->config, addr, len); - if (rc != kStatus_FLASH_Success) { - rc = -EIO; - } else { - /* Check whether the flash is erased ("len" and "addr" must be word-aligned). */ + /* On LPC55S36, use a HAL function to safely copy from Flash. */ + rc = FLASH_Read(&priv->config, addr, data, len); + switch (rc) { + case kStatus_FLASH_Success: + rc = 0; + break; + case kStatus_FLASH_EccError: + /* Check id the ECC issue is due to the Flash being erased + * ("addr" and "len" must be word-aligned for this call). + */ rc = FLASH_VerifyErase(&priv->config, ((addr + 0x3) & ~0x3), ((len + 0x3) & ~0x3)); if (rc == kStatus_FLASH_Success) { rc = -ENODATA; } else { - rc = 0; + rc = -EIO; } + break; + default: + rc = -EIO; + break; } - #else + #else /* CONFIG_SOC_LPC55S36 */ + /* On all other targets, check if the Flash area is readable. + * If so, copy data from it directly. + */ rc = is_area_readable(addr, len); - #endif /* CONFIG_SOC_LPC55S36 */ -#endif /* CONFIG_CHECK_BEFORE_READING */ - if (!rc) { memcpy(data, (void *) addr, len); } -#ifdef CONFIG_CHECK_BEFORE_READING - else if (rc == -ENODATA) { + #endif /* CONFIG_SOC_LPC55S36 */ + + if (rc == -ENODATA) { /* Erased area, return dummy data as an erased page. */ memset(data, 0xFF, len); rc = 0; } -#endif +#else /* CONFIG_CHECK_BEFORE_READING */ + /* No safety checks, directly copy the memory mapped data. */ + memcpy(data, (void *) addr, len); +#endif /* CONFIG_CHECK_BEFORE_READING */ + return rc; } From 33def3036a59f08954fc4c33b31365e17e7046f2 Mon Sep 17 00:00:00 2001 From: Luca Burelli Date: Tue, 5 Nov 2024 11:30:37 +0100 Subject: [PATCH 104/113] drivers/flash/soc_flash_mcux: adjust alignment logic The current alignment logic does not work as expected if given unaligned values, resulting in a skip of the first word. The length also has to take into account the starting address: for example, asking for 2 bytes at offset 3 should actually check 8 bytes. This patch adjusts the logic so that it always includes the first and the last word of the input area. Signed-off-by: Luca Burelli --- drivers/flash/soc_flash_mcux.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/flash/soc_flash_mcux.c b/drivers/flash/soc_flash_mcux.c index 88b0387f623295..070535f76751c0 100644 --- a/drivers/flash/soc_flash_mcux.c +++ b/drivers/flash/soc_flash_mcux.c @@ -221,7 +221,9 @@ static int flash_mcux_read(const struct device *dev, off_t offset, /* Check id the ECC issue is due to the Flash being erased * ("addr" and "len" must be word-aligned for this call). */ - rc = FLASH_VerifyErase(&priv->config, ((addr + 0x3) & ~0x3), ((len + 0x3) & ~0x3)); + rc = FLASH_VerifyErase(&priv->config, + ROUND_DOWN(addr, 4), + ROUND_DOWN(addr + len + 3, 4) - ROUND_DOWN(addr, 4)); if (rc == kStatus_FLASH_Success) { rc = -ENODATA; } else { From c6cc7a17e50d40ed7e6354bbe2340b90a9ca50f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20Cab=C3=A9?= Date: Tue, 5 Nov 2024 12:18:20 +0100 Subject: [PATCH 105/113] samples: drivers: video: fix shield name MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The capture to LVGL sample is using an incorrect name for the weact_ov2640_cam_module shield Signed-off-by: Benjamin Cabé --- samples/drivers/video/capture_to_lvgl/README.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/drivers/video/capture_to_lvgl/README.rst b/samples/drivers/video/capture_to_lvgl/README.rst index c63fb73f2fcd0c..f3fa5e992ad3a1 100644 --- a/samples/drivers/video/capture_to_lvgl/README.rst +++ b/samples/drivers/video/capture_to_lvgl/README.rst @@ -32,7 +32,7 @@ For :zephyr:board:`mini_stm32h743`, build this sample application with the follo .. zephyr-app-commands:: :zephyr-app: samples/drivers/video/capture_to_lvgl/ :board: mini_stm32h743 - :shield: weact_ministm32h7xx_ov2640 + :shield: weact_ov2640_cam_module :goals: build flash :gen-args: -DCONFIG_BOOT_DELAY=2000 :compact: From 035b139f64defffb23481938a49ffd6a6077f20b Mon Sep 17 00:00:00 2001 From: Benedikt Schmidt Date: Tue, 5 Nov 2024 13:19:32 +0100 Subject: [PATCH 106/113] drivers: fpga: add checks for optional properties of iCE40 Add checks in the GPIO bitbang mode to avoid a fault for missing configuration in the devicetree. Fixes #80850 Signed-off-by: Benedikt Schmidt --- drivers/fpga/fpga_ice40.c | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/drivers/fpga/fpga_ice40.c b/drivers/fpga/fpga_ice40.c index 9a5d6aa87aa468..ac00734f369f12 100644 --- a/drivers/fpga/fpga_ice40.c +++ b/drivers/fpga/fpga_ice40.c @@ -207,6 +207,26 @@ static int fpga_ice40_load_gpio(const struct device *dev, uint32_t *image_ptr, u struct fpga_ice40_data *data = dev->data; const struct fpga_ice40_config *config = dev->config; + if (!device_is_ready(config->clk.port)) { + LOG_ERR("%s: GPIO for clk is not ready", dev->name); + return -ENODEV; + } + + if (!device_is_ready(config->pico.port)) { + LOG_ERR("%s: GPIO for pico is not ready", dev->name); + return -ENODEV; + } + + if (config->set == NULL) { + LOG_ERR("%s: set register was not specified", dev->name); + return -EFAULT; + } + + if (config->clear == NULL) { + LOG_ERR("%s: clear register was not specified", dev->name); + return -EFAULT; + } + /* prepare masks */ cs = BIT(config->bus.config.cs.gpio.pin); clk = BIT(config->clk.pin); @@ -502,6 +522,16 @@ static int fpga_ice40_init(const struct device *dev) int ret; const struct fpga_ice40_config *config = dev->config; + if (!device_is_ready(config->creset.port)) { + LOG_ERR("%s: GPIO for creset is not ready", dev->name); + return -ENODEV; + } + + if (!device_is_ready(config->cdone.port)) { + LOG_ERR("%s: GPIO for cdone is not ready", dev->name); + return -ENODEV; + } + ret = gpio_pin_configure_dt(&config->creset, GPIO_OUTPUT_HIGH); if (ret < 0) { LOG_ERR("failed to configure CRESET: %d", ret); From 2696220bee3d4e655b51f0a9c3597ba4a2d52975 Mon Sep 17 00:00:00 2001 From: Raymond Lei Date: Wed, 6 Nov 2024 13:51:02 -0600 Subject: [PATCH 107/113] soc: nxp: imxrt11xx: Typo in clock initialization of usb2 a typo in usb2 clock initialization which impact the function of usb2. fixes: #81027 Signed-off-by: Raymond Lei --- soc/nxp/imxrt/imxrt11xx/soc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/soc/nxp/imxrt/imxrt11xx/soc.c b/soc/nxp/imxrt/imxrt11xx/soc.c index 5ba737cb286076..8d6bae6323114e 100644 --- a/soc/nxp/imxrt/imxrt11xx/soc.c +++ b/soc/nxp/imxrt/imxrt11xx/soc.c @@ -536,7 +536,7 @@ static ALWAYS_INLINE void clock_init(void) kCLOCK_Usb480M, DT_PROP_BY_PHANDLE(DT_NODELABEL(usb2), clocks, clock_frequency)); CLOCK_EnableUsbhs1Clock(kCLOCK_Usb480M, DT_PROP_BY_PHANDLE(DT_NODELABEL(usb2), clocks, clock_frequency)); -#if DT_NODE_HAS_STATUS_OKAY(DT_NODELABEL(usb1)) && CONFIG_USB_DC_NXP_EHCI +#if DT_NODE_HAS_STATUS_OKAY(DT_NODELABEL(usb2)) && CONFIG_USB_DC_NXP_EHCI USB_EhciPhyInit(kUSB_ControllerEhci1, CPU_XTAL_CLK_HZ, &usbPhyConfig); #endif #endif From 4331b5fe77987c5dcf2845fdf68e043688113df4 Mon Sep 17 00:00:00 2001 From: Emil Gydesen Date: Tue, 5 Nov 2024 15:15:29 +0100 Subject: [PATCH 108/113] tests: Bluetooth: PBP: Fix adv data for PBP BSIM test The test had a few off-by-ones in the code, which caused access to invalid data. Fixed by setting the right buffer sizes and the right AD length fields. Signed-off-by: Emil Gydesen --- .../audio/src/pbp_public_broadcast_source_test.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/bsim/bluetooth/audio/src/pbp_public_broadcast_source_test.c b/tests/bsim/bluetooth/audio/src/pbp_public_broadcast_source_test.c index cd703406e32fce..86df90cc386717 100644 --- a/tests/bsim/bluetooth/audio/src/pbp_public_broadcast_source_test.c +++ b/tests/bsim/bluetooth/audio/src/pbp_public_broadcast_source_test.c @@ -127,7 +127,7 @@ static int setup_extended_adv_data(struct bt_cap_broadcast_source *source, { /* Broadcast Audio Streaming Endpoint advertising data */ NET_BUF_SIMPLE_DEFINE(ad_buf, BT_UUID_SIZE_16 + BT_AUDIO_BROADCAST_ID_SIZE); - NET_BUF_SIMPLE_DEFINE(pbp_ad_buf, BT_UUID_SIZE_16 + 1 + ARRAY_SIZE(pba_metadata)); + NET_BUF_SIMPLE_DEFINE(pbp_ad_buf, BT_PBP_MIN_PBA_SIZE + ARRAY_SIZE(pba_metadata)); NET_BUF_SIMPLE_DEFINE(base_buf, 128); static enum bt_pbp_announcement_feature pba_params; struct bt_data ext_ad[2]; @@ -145,7 +145,7 @@ static int setup_extended_adv_data(struct bt_cap_broadcast_source *source, net_buf_simple_add_le16(&ad_buf, BT_UUID_BROADCAST_AUDIO_VAL); net_buf_simple_add_le24(&ad_buf, broadcast_id); ext_ad[0].type = BT_DATA_SVC_DATA16; - ext_ad[0].data_len = ad_buf.len + sizeof(ext_ad[0].type); + ext_ad[0].data_len = ad_buf.len; ext_ad[0].data = ad_buf.data; /** @@ -162,8 +162,8 @@ static int setup_extended_adv_data(struct bt_cap_broadcast_source *source, printk("Starting stream with high quality!\n"); } - err = bt_pbp_get_announcement(pba_metadata, ARRAY_SIZE(pba_metadata) - 1, - pba_params, &pbp_ad_buf); + err = bt_pbp_get_announcement(pba_metadata, ARRAY_SIZE(pba_metadata), pba_params, + &pbp_ad_buf); if (err != 0) { printk("Failed to create public broadcast announcement!: %d\n", err); From 4f85ce6eda93199946277d09bd5220b5eddd997e Mon Sep 17 00:00:00 2001 From: Maximilian Deubel Date: Tue, 5 Nov 2024 14:58:13 +0100 Subject: [PATCH 109/113] dp: swdp_bitbang: fix missing reset pin error This patch fixes an issue where the reset pin is used even when it's not given. Signed-off-by: Maximilian Deubel --- drivers/dp/swdp_bitbang.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/dp/swdp_bitbang.c b/drivers/dp/swdp_bitbang.c index 7822315ab8e125..8dec65b6c1055f 100644 --- a/drivers/dp/swdp_bitbang.c +++ b/drivers/dp/swdp_bitbang.c @@ -601,9 +601,11 @@ static int sw_port_on(const struct device *dev) return ret; } - ret = gpio_pin_configure_dt(&config->reset, GPIO_OUTPUT_ACTIVE); - if (ret) { - return ret; + if (config->reset.port) { + ret = gpio_pin_configure_dt(&config->reset, GPIO_OUTPUT_ACTIVE); + if (ret) { + return ret; + } } return 0; From 10fa1eab50ac54e41bf75ab0ad01daa4bd25ba13 Mon Sep 17 00:00:00 2001 From: Arif Balik Date: Sat, 26 Oct 2024 15:01:57 +0300 Subject: [PATCH 110/113] drivers: clock: fix STM32_PERIPH_BUS_MIN for STM32U0 `STM32_PERIPH_BUS_MIN` is not the minimum bus address in `stm32u0_clock.h` Signed-off-by: Arif Balik --- include/zephyr/dt-bindings/clock/stm32u0_clock.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/zephyr/dt-bindings/clock/stm32u0_clock.h b/include/zephyr/dt-bindings/clock/stm32u0_clock.h index aee6cbd8518ae5..5ee50598855627 100644 --- a/include/zephyr/dt-bindings/clock/stm32u0_clock.h +++ b/include/zephyr/dt-bindings/clock/stm32u0_clock.h @@ -9,12 +9,12 @@ #include "stm32_common_clocks.h" /** Bus gatting clocks */ -#define STM32_CLOCK_BUS_IOP 0x4C #define STM32_CLOCK_BUS_AHB1 0x48 +#define STM32_CLOCK_BUS_IOP 0x4C #define STM32_CLOCK_BUS_APB1 0x58 #define STM32_CLOCK_BUS_APB1_2 0x60 -#define STM32_PERIPH_BUS_MIN STM32_CLOCK_BUS_IOP +#define STM32_PERIPH_BUS_MIN STM32_CLOCK_BUS_AHB1 #define STM32_PERIPH_BUS_MAX STM32_CLOCK_BUS_APB1_2 /** Domain clocks */ From b92bd6d345659211f0f8bc7eb0cea5c57e4a2416 Mon Sep 17 00:00:00 2001 From: Johan Lafon Date: Mon, 4 Nov 2024 12:10:57 +0100 Subject: [PATCH 111/113] drivers: display: ssd1322: fix never returning call to display_write A call to the write API function was never returning as we were trapped into an infinite loop. This was caused by the pixel_count pointer not being incremented properly. Signed-off-by: Johan Lafon --- drivers/display/ssd1322.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/display/ssd1322.c b/drivers/display/ssd1322.c index e0e154cb032370..c6e20f6f97b29a 100644 --- a/drivers/display/ssd1322.c +++ b/drivers/display/ssd1322.c @@ -107,7 +107,7 @@ static int ssd1322_conv_mono01_grayscale(const uint8_t **buf_in, uint32_t *pixel } buf_in += pixels_in_chunk / 8; - pixel_count -= pixels_in_chunk; + *pixel_count -= pixels_in_chunk; return pixels_in_chunk * segments_per_pixel / 2; } From a140dd3de98e663b8f638fafec73300c7bf16d76 Mon Sep 17 00:00:00 2001 From: Johan Lafon Date: Mon, 4 Nov 2024 12:11:15 +0100 Subject: [PATCH 112/113] drivers: display: ssd1322: fix low and uneven pixel brightness In case more than one segment per pixel is required, only part of the segments were written resulting in low and uneven pixel brightness (at least on NHD-2.7-12864WDW3). Fix it by writing all required segments. Signed-off-by: Johan Lafon --- drivers/display/ssd1322.c | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/drivers/display/ssd1322.c b/drivers/display/ssd1322.c index c6e20f6f97b29a..75d2d1c90a255e 100644 --- a/drivers/display/ssd1322.c +++ b/drivers/display/ssd1322.c @@ -40,6 +40,9 @@ LOG_MODULE_REGISTER(ssd1322, CONFIG_DISPLAY_LOG_LEVEL); #define SSD1322_SET_MUX_RATIO 0xCA #define SSD1322_COMMAND_LOCK 0xFD +#define BITS_PER_SEGMENT 4 +#define SEGMENTS_PER_BYTE (8 / BITS_PER_SEGMENT) + struct ssd1322_config { const struct device *mipi_dev; struct mipi_dbi_config dbi_config; @@ -57,7 +60,7 @@ struct ssd1322_config { bool remap_com_dual; uint8_t segments_per_pixel; uint8_t *conversion_buf; - uint16_t conversion_buf_size; + size_t conversion_buf_size; }; static inline int ssd1322_write_command(const struct device *dev, uint8_t cmd, const uint8_t *buf, @@ -96,19 +99,28 @@ static int ssd1322_conv_mono01_grayscale(const uint8_t **buf_in, uint32_t *pixel /* Output buffer size gets rounded down to avoid splitting chunks in the middle of input * bytes */ - uint16_t pixels_in_chunk = MIN(*pixel_count, ROUND_DOWN(buf_out_size / 2, 8)); + uint16_t pixels_in_chunk = + MIN(*pixel_count, + ROUND_DOWN((buf_out_size * SEGMENTS_PER_BYTE) / segments_per_pixel, 8)); for (uint16_t in_idx = 0; in_idx < pixels_in_chunk; in_idx++) { - uint16_t seg_idx = in_idx * segments_per_pixel; uint8_t color = ((*buf_in)[in_idx / 8] & BIT(in_idx % 8)) ? 0xF : 0; - buf_out[seg_idx / 2] = - (seg_idx % 2 == 0) ? color : ((color << 4) | buf_out[seg_idx / 2]); + for (size_t i = 0; i < segments_per_pixel; i++) { + size_t seg_idx = in_idx * segments_per_pixel + i; + size_t shift = BITS_PER_SEGMENT * (seg_idx % SEGMENTS_PER_BYTE); + + if (shift == 0) { + buf_out[seg_idx / SEGMENTS_PER_BYTE] = color; + } else { + buf_out[seg_idx / SEGMENTS_PER_BYTE] |= color << shift; + } + } } buf_in += pixels_in_chunk / 8; *pixel_count -= pixels_in_chunk; - return pixels_in_chunk * segments_per_pixel / 2; + return pixels_in_chunk * segments_per_pixel / SEGMENTS_PER_BYTE; } static int ssd1322_write_pixels(const struct device *dev, const uint8_t *buf, uint32_t pixel_count) From 2b5ee0ca91e34944f75580317274c135a5d7c855 Mon Sep 17 00:00:00 2001 From: Johan Lafon Date: Mon, 4 Nov 2024 12:08:29 +0100 Subject: [PATCH 113/113] drivers: display: ssd1322: fix only part of the image being diplayed Only the first chunk of the desired image is displayed repeatedly over the screen height (at least on an NHD-2.7-12864WDW3 display). Fix it by computing the internal mono01 to 4bit grayscale conversion buffer size correctly so it can fit the entire image. Signed-off-by: Johan Lafon --- drivers/display/ssd1322.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/display/ssd1322.c b/drivers/display/ssd1322.c index 75d2d1c90a255e..9dee7d3d4c5f54 100644 --- a/drivers/display/ssd1322.c +++ b/drivers/display/ssd1322.c @@ -358,7 +358,9 @@ static struct display_driver_api ssd1322_driver_api = { }; #define SSD1322_CONV_BUFFER_SIZE(node_id) \ - (DT_PROP(node_id, width) * DT_PROP(node_id, segments_per_pixel) * 4) + DIV_ROUND_UP(DT_PROP(node_id, width) * DT_PROP(node_id, height) * \ + DT_PROP(node_id, segments_per_pixel), \ + SEGMENTS_PER_BYTE) #define SSD1322_DEFINE(node_id) \ static uint8_t conversion_buf##node_id[SSD1322_CONV_BUFFER_SIZE(node_id)]; \