zephyr/soc/arm
Carlo Caione 7a48ad34d9 nordic: Rely on internal busy_wait implementation for QEMU
The Nordic board are selecting CONFIG_ARCH_HAS_CUSTOM_BUSY_WAIT by
default and rely on some HAL code to implement a cycle accurate busy
delay loop.

This is in general fine for real hardware but when QEMU and emulation is
taken into account, a cycle accurate busy wait implementation based on
delay in executing machine code can be misleading.

Let's take for example qemu_cortex_m0 (that is based on the nRF51
chipset) and this code:

  uint32_t before, after;

  while (1) {
      before = k_cycle_get_32();
      k_busy_wait(1000 * 1000);
      after = k_cycle_get_32();
      printk("diff cycles: %d\n", after - before);
  }

With CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC=1000000 this diff cycles should
be always around 1000000, in reality when executed with:

  qemu-system-arm -cpu cortex-m0 -machine microbit -nographic
      -kernel build/zephyr/zephyr.elf

This results in something like this:

  diff cycles: 22285
  diff cycles: 24339
  diff cycles: 21483
  diff cycles: 21063
  diff cycles: 21116
  diff cycles: 19633

This is possibly due to the fact that the cycle accurate delay busy loop
is too fast in emulation.

When dealing with QEMU let's use the reliable busy loop implementation
based on k_cycle_get_32() instead.

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
2023-06-05 20:20:54 -04:00
..
arm barriers: Move __ISB() to the new API 2023-05-24 13:13:57 -04:00
aspeed soc: arm: aspeed: remove unused DIV_ROUND_UP 2023-04-11 12:00:37 +02:00
atmel_sam soc: Only select HAS_SEGGER_RTT if module is available 2023-04-20 14:57:51 +02:00
atmel_sam0 sam: can: CAN driver for SAM0 socs 2023-05-22 08:03:58 +00:00
bcm_vk init: remove the need for a dummy device pointer in SYS_INIT functions 2023-04-12 14:28:07 +00:00
common/cortex_m soc: migrate includes to <zephyr/...> 2022-05-06 19:57:59 +02:00
cypress init: remove the need for a dummy device pointer in SYS_INIT functions 2023-04-12 14:28:07 +00:00
gigadevice soc: Only select HAS_SEGGER_RTT if module is available 2023-04-20 14:57:51 +02:00
infineon_cat1 drivers: bluetooth: Add Infineon Bluetooth driver 2023-05-17 09:59:36 +03:00
infineon_xmc soc: arm: infineon_xmc: Add XMC4700 MCU series 2023-05-02 12:34:55 +02:00
intel_socfpga_std init: remove the need for a dummy device pointer in SYS_INIT functions 2023-04-12 14:28:07 +00:00
microchip_mec barriers: Move __ISB() to the new API 2023-05-24 13:13:57 -04:00
nordic_nrf nordic: Rely on internal busy_wait implementation for QEMU 2023-06-05 20:20:54 -04:00
nuvoton_npcx intc: miwu: npcx: improve interrupt latency of miwu input events 2023-05-17 09:48:54 +02:00
nuvoton_numicro drivers: pinctrl: add numicro pinctrl driver 2022-12-08 18:46:33 +01:00
nxp_imx soc: arm: nxp_imx: add FLEXSPI1 and FLEXSPI2 memory sections for RT5xx 2023-05-26 10:21:34 -05:00
nxp_kinetis soc: Only select HAS_SEGGER_RTT if module is available 2023-04-20 14:57:51 +02:00
nxp_lpc soc: nxp_lpc: Add USBFS support 2023-05-26 17:53:37 -04:00
nxp_s32 barriers: Move __ISB() to the new API 2023-05-24 13:13:57 -04:00
quicklogic_eos_s3 init: remove the need for a dummy device pointer in SYS_INIT functions 2023-04-12 14:28:07 +00:00
renesas_rcar barriers: Move __ISB() to the new API 2023-05-24 13:13:57 -04:00
renesas_smartbond scripts: runners: ezflashcli: Add support to flash images for MCUboot 2023-05-26 05:53:02 -04:00
rpi_pico soc: Only select HAS_SEGGER_RTT if module is available 2023-04-20 14:57:51 +02:00
silabs_exx32 soc/arm/silabs_ex32/efr32bg27: select CONFIG_SOC_GECKO_SE 2023-05-26 05:54:40 -04:00
st_stm32 soc: stm32wl: Added logging declaration to soc.c 2023-05-15 09:59:22 +00:00
ti_lm3s6965 init: remove the need for a dummy device pointer in SYS_INIT functions 2023-04-12 14:28:07 +00:00
ti_simplelink init: remove the need for a dummy device pointer in SYS_INIT functions 2023-04-12 14:28:07 +00:00
xilinx_zynq7000 init: remove the need for a dummy device pointer in SYS_INIT functions 2023-04-12 14:28:07 +00:00
xilinx_zynqmp init: remove the need for a dummy device pointer in SYS_INIT functions 2023-04-12 14:28:07 +00:00
CMakeLists.txt soc: arm: framework for common fixed MPU region configuration 2019-12-09 11:51:14 -05:00
Kconfig soc: nordic_nrf: nrf91: Add support for nRF9161 SiP / nRF9120 SoC 2023-04-17 09:30:12 -07:00