Skip to content

Conversation

@tristan-google
Copy link
Contributor

The eSPI, I2C, and SPI emulators use devicetree macros to build an array of devices on the virtual bus. Currently, they will add device nodes that are not status-okay. This leads to linker errors because the respective device drivers would not have instantiated device structs for these nodes --assuming the driver was even compiled. This can be frustrating if nodes need to be disabled for debugging or configuration purposes.

Update the bus emulators to only consider status-okay nodes by changing the macros used to iterate over bus devices.

The eSPI, I2C, and SPI emulators use devicetree macros to build an array of devices on the virtual bus. Currently, they will add device nodes that are not status-okay. This leads to linker errors because the respective device drivers would not have instantiated device structs for these nodes --assuming the driver was even compiled. This can be frustrating if nodes need to be disabled for debugging or configuration purposes. Update the bus emulators to only consider status-okay nodes by changing the macros used to iterate over bus devices. Signed-off-by: Tristan Honscheid <honscheid@google.com>
@carlescufi carlescufi merged commit 8fd1ce7 into zephyrproject-rtos:main Jul 12, 2023
kartben added a commit to kartben/zephyr that referenced this pull request Sep 24, 2025
sjg20 hasn't reviewed any PRs or engaged in any Zephyr activity since Aug 2023. Recent activities: - review: Review on 'fuel_gauge: Add battery cutoff support' zephyrproject-rtos#61435 (2023-08-16T20:23:21Z) - review: Review on 'emul: Only add enabled DT nodes to bus emulators' zephyrproject-rtos#60263 (2023-07-11T19:59:15Z) - review: Review on 'drivers/crypto/it8xxx2: add support for SHA256 hardware accelerator' zephyrproject-rtos#55899 (2023-07-06T15:59:35Z) Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
kartben added a commit to kartben/zephyr that referenced this pull request Sep 24, 2025
sjg20 hasn't reviewed any PRs or engaged in any Zephyr activity since Aug 2023. Recent activities: - review: Review on 'fuel_gauge: Add battery cutoff support' zephyrproject-rtos#61435 (2023-08-16T20:23:21Z) - review: Review on 'emul: Only add enabled DT nodes to bus emulators' zephyrproject-rtos#60263 (2023-07-11T19:59:15Z) - review: Review on 'drivers/crypto/it8xxx2: add support for SHA256 hardware accelerator' zephyrproject-rtos#55899 (2023-07-06T15:59:35Z) Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
kartben added a commit to kartben/zephyr that referenced this pull request Sep 24, 2025
sjg20 hasn't reviewed any PRs or engaged in any Zephyr activity since Aug 2023. Recent activities: - review: Review on 'fuel_gauge: Add battery cutoff support' zephyrproject-rtos#61435 (2023-08-16T20:23:21Z) - review: Review on 'emul: Only add enabled DT nodes to bus emulators' zephyrproject-rtos#60263 (2023-07-11T19:59:15Z) - review: Review on 'drivers/crypto/it8xxx2: add support for SHA256 hardware accelerator' zephyrproject-rtos#55899 (2023-07-06T15:59:35Z) Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
kartben added a commit to kartben/zephyr that referenced this pull request Sep 24, 2025
sjg20 hasn't reviewed any PRs or engaged in any Zephyr activity since Aug 2023. Recent activities: - review: Review on 'fuel_gauge: Add battery cutoff support' zephyrproject-rtos#61435 (2023-08-16T20:23:21Z) - review: Review on 'emul: Only add enabled DT nodes to bus emulators' zephyrproject-rtos#60263 (2023-07-11T19:59:15Z) - review: Review on 'drivers/crypto/it8xxx2: add support for SHA256 hardware accelerator' zephyrproject-rtos#55899 (2023-07-06T15:59:35Z) Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
cfriedt pushed a commit that referenced this pull request Sep 27, 2025
sjg20 hasn't reviewed any PRs or engaged in any Zephyr activity since Aug 2023. Recent activities: - review: Review on 'fuel_gauge: Add battery cutoff support' #61435 (2023-08-16T20:23:21Z) - review: Review on 'emul: Only add enabled DT nodes to bus emulators' #60263 (2023-07-11T19:59:15Z) - review: Review on 'drivers/crypto/it8xxx2: add support for SHA256 hardware accelerator' #55899 (2023-07-06T15:59:35Z) Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment