Skip to content

RFC NXP i.MX RT595

Octavian Purdila qemu-arm qemu-devel 3 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 RFC Latest24 patches 3 repliesIn review
  2. v2 RFC23 patches 2 repliesSuperseded
  3. v1 RFC23 patches 32 repliesSuperseded

Changes in v3 from the cover letter

* convert tests from unit to qtest
* move i2c and spi testers from unit tests to hw/misc devices
* switch to using RegisterAccessInfo to generate register information like register names, reset values, or read-only mask
* use register_write instead of adding a new reg32_write API
* remove reg32_aligned_access completly and rely on memops access constraints and size of access for alignment checks
* add qtest APIs for checking memory access faulires
* add qtest APIs for accessing the device clock frequency
* fix bugs detected by address sanitizers

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/24fifo32: add peek functioninclude/qemu/fifo32.h+28 -02 replies
2/24tests/unit: add fifo testtests/unit/meson.build tests/unit/test-fifo.c+98 -00 replies
3/24scripts: add script to generate C header files from SVD XML filesmeson.build scripts/svd-gen-header.py+334 -00 replies
4/24Add mcux-soc-svd subprojecthw/arm/svd/meson.build meson_options.txt scripts/meson-buildoptions.sh +3 more+22 -00 replies
5/24hw/misc: add basic flexcomm device modelhw/arm/meson.build hw/arm/svd/meson.build hw/misc/Kconfig +5 more+504 -00 replies
6/24hw/char: add support for flexcomm usarthw/arm/svd/meson.build hw/char/flexcomm_usart.c hw/char/meson.build +5 more+1376 -00 replies
7/24hw/i2c: add support for flexcomm i2chw/arm/svd/meson.build hw/i2c/flexcomm_i2c.c hw/i2c/meson.build +5 more+1464 -00 replies
8/24hw/ssi: add support for flexcomm spihw/arm/svd/meson.build hw/misc/flexcomm.c hw/ssi/flexcomm_spi.c +5 more+1525 -00 replies
9/24hw/misc: add support for RT500's clock controllerhw/arm/Kconfig hw/arm/svd/meson.build hw/misc/Kconfig +9 more+6459 -00 replies
10/24hw/ssi: add support for flexspihw/arm/svd/meson.build hw/ssi/Kconfig hw/ssi/flexspi.c +4 more+2871 -00 replies
11/24hw/misc: add support for RT500's reset controllerhw/arm/svd/meson.build hw/misc/Kconfig hw/misc/meson.build +5 more+2514 -00 replies
12/24hw/arm: add basic support for the RT500 SoChw/arm/Kconfig hw/arm/meson.build hw/arm/rt500.c +3 more+449 -01 reply
13/24hw/arm: add RT595-EVK boardhw/arm/Kconfig hw/arm/meson.build hw/arm/rt595-evk.c+70 -00 replies
14/24tests/qtest: add register access macros and functionstests/qtest/reg-utils.h+70 -00 replies
15/24system/qtest: add APIS to check for memory access failuressystem/qtest.c tests/qtest/libqtest-single.h tests/qtest/libqtest.c +1 more+265 -200 replies
16/24tests/qtest: add flexcomm teststests/qtest/flexcomm-test.c tests/qtest/meson.build+87 -00 replies
17/24tests/qtest: add flexcomm usart teststests/qtest/flexcomm-usart-test.c tests/qtest/meson.build+316 -10 replies
18/24hw/misc: add i2c-testerhw/misc/Kconfig hw/misc/i2c_tester.c hw/misc/meson.build +1 more+131 -00 replies
19/24tests/qtest: add tests for flexcomm i2ctests/qtest/flexcomm-i2c-test.c tests/qtest/meson.build+170 -10 replies
20/24hw/ssi: allow NULL realize callbacks for peripheralshw/ssi/ssi.c+3 -10 replies
21/24hw/misc: add spi-testerhw/misc/Kconfig hw/misc/meson.build hw/misc/spi_tester.c +1 more+90 -00 replies
22/24tests/qtest: add tests for flexcomm spitests/qtest/flexcomm-spi-test.c tests/qtest/meson.build+145 -10 replies
23/24systems/qtest: add device clock APIshw/core/qdev-clock.c include/hw/qdev-clock.h system/qtest.c +3 more+137 -10 replies
24/24test/unit: add unit tests for RT500's clock controllertests/qtest/meson.build tests/qtest/rt500-clkctl-test.c+196 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v3 yet.

Read the v3 thread

Cover letter [RFC PATCH v3 00/24] NXP i.MX RT595

This patch set adds support for NXP's RT500 MCU [1] and the RT595 EVK[2]. More RT500 device models will be submitted in future patch sets.

The goal of this first patch set is to provide a minimal set that allows running the NXP MCU SDK hello world example[4].

The patch set introduces a (python) tool that generates C header files from ARM SVD files[3]. This significantly reduces the effort to write a new device model by automatically generating: register definitions and layout (including bit fields), register names for easier debugging and tracing, reset register values, register write masks, etc.

The generated files are commited and not generated at compile time. Build targets are created so that they can be easily regenerated if needed.

Changes since v2:
* convert tests from unit to qtest
* move i2c and spi testers from unit tests to hw/misc devices
* switch to using RegisterAccessInfo to generate register information like register names, reset values, or read-only mask
* use register_write instead of adding a new reg32_write API
* remove reg32_aligned_access completly and rely on memops access constraints and size of access for alignment checks
* add qtest APIs for checking memory access faulires
* add qtest APIs for accessing the device clock frequency
* fix bugs detected by address sanitizers

Changes since v1:
* setup scripts/git.orderfile
* svd_gen_header: add support for multi line comments
* svd_gen_header: use qemu register fields instead of bitfields
* svd_gen_header: generate register write mask array
* add mcux-soc-svd as a subproject instead of commiting the rt595 SVD file directly
* svd generated headers: don't generate them at compile time, instead commit the generated headers and create compile targets so that it is easy to regenerate them
* remove pysvd dependency; developers who need to (re)generate svd headers need to have it installed on the host machine
* use DEFINE_TYPES where possible
* use g_strdup_printf where possible
* reduce iterator variables scopes
* hard code rt500 to use the cortex-m33
* use static for local arrays initializers
* remove rt500 properties as they are not yet used
* drop private/public comments
* remove unused headers
* free rt500 mem regions in rt500_unrealize() instead of rt500_finalize
* use memops access constraints where possible instead of reg32_aligned_access
* flexspi: use 64bit properties for mmap_size property
* rstctl: use a generic abstract type and remove the "num" property
* flexspi: don't call get_system_memory() directly and remove mmap_base property

[1] https://www.nxp.com/docs/en/data-sheet/IMXRT500EC.pdf
[2] https://www.nxp.com/webapp/Download?colCode=MIMXRT595EVKHUG
[3] https://arm-software.github.io/CMSIS_5/SVD/html/index.html
[4] Building and running the NXP MCU SDK hello world example

    Clone the following git repos:

    https://github.com/nxp-mcuxpresso/cmsis.git,
    https://github.com/nxp-mcuxpresso/mcux-sdk.git
    https://github.com/nxp-mcuxpresso/mcux-sdk-examples.git

    in the following directories: CMSIS, core, examples.

    cd examples/evkmimxrt595/demo_apps/hello_world/armgcc

    ARMGCC_DIR=/usr CFLAGS=-I../../../../../CMSIS/CMSIS/Core/Include \
      sh build_flash_debug.sh

    qemu-system-arm --machine rt595-evk -kernel flash_debug/hello_world.elf \
      -global armv7m.init-nsvtor=0x08001000 -global armv7m.init-svtor=0x08001000 \
      -chardev stdio,id=flexcomm0

Octavian Purdila (21):
fifo32: add peek function
tests/unit: add fifo test
Add mcux-soc-svd subproject
hw/misc: add basic flexcomm device model hw/char: add support for flexcomm usart
hw/i2c: add support for flexcomm i2c
hw/misc: add support for RT500's clock controller hw/ssi: add support for flexspi
hw/misc: add support for RT500's reset controller hw/arm: add basic support for the RT500 SoC hw/arm: add RT595-EVK board
tests/qtest: add register access macros and functions system/qtest: add APIS to check for memory access failures tests/qtest: add flexcomm tests
tests/qtest: add flexcomm usart tests
hw/misc: add i2c-tester
tests/qtest: add tests for flexcomm i2c
hw/ssi: allow NULL realize callbacks for peripherals hw/misc: add spi-tester
systems/qtest: add device clock APIs
test/unit: add unit tests for RT500's clock controller

Sebastian Ene (2):
hw/ssi: add support for flexcomm spi
tests/qtest: add tests for flexcomm spi

Stefan Stanacar (1):
scripts: add script to generate C header files from SVD XML files

 meson.build                                   |    4 +
 include/hw/arm/rt500.h                        |   44 +
 include/hw/arm/svd/flexcomm.h                 |  114 +
 include/hw/arm/svd/flexcomm_i2c.h             | 1192 ++++++
 include/hw/arm/svd/flexcomm_spi.h             | 1038 +++++
 include/hw/arm/svd/flexcomm_usart.h           | 1023 +++++
 include/hw/arm/svd/flexspi.h                  | 2658 +++++++++++++
 include/hw/arm/svd/rt500.h                    |   63 +
 include/hw/arm/svd/rt500_clkctl0.h            | 2485 ++++++++++++
 include/hw/arm/svd/rt500_clkctl1.h            | 3398 +++++++++++++++++
 include/hw/arm/svd/rt500_rstctl0.h            |  860 +++++
 include/hw/arm/svd/rt500_rstctl1.h            | 1373 +++++++
 include/hw/char/flexcomm_usart.h              |   20 +
 include/hw/i2c/flexcomm_i2c.h                 |   27 +
 include/hw/misc/flexcomm.h                    |   85 +
 include/hw/misc/i2c_tester.h                  |   30 +
 include/hw/misc/rt500_clk_freqs.h             |   18 +
 include/hw/misc/rt500_clkctl0.h               |   37 +
 include/hw/misc/rt500_clkctl1.h               |   36 +
 include/hw/misc/rt500_rstctl.h                |   32 +
 include/hw/misc/spi_tester.h                  |   32 +
 include/hw/qdev-clock.h                       |   10 +
 include/hw/ssi/flexcomm_spi.h                 |   20 +
 include/hw/ssi/flexspi.h                      |   32 +
 include/qemu/fifo32.h                         |   28 +
 tests/qtest/libqtest-single.h                 |  116 +
 tests/qtest/libqtest.h                        |   98 +
 tests/qtest/reg-utils.h                       |   70 +
 hw/arm/rt500.c                                |  335 ++
 hw/arm/rt595-evk.c                            |   64 +
 hw/char/flexcomm_usart.c                      |  306 ++
 hw/core/qdev-clock.c                          |    2 +-
 hw/i2c/flexcomm_i2c.c                         |  222 ++
 hw/misc/flexcomm.c                            |  323 ++
 hw/misc/i2c_tester.c                          |   94 +
 hw/misc/rt500_clkctl0.c                       |  239 ++
 hw/misc/rt500_clkctl1.c                       |  223 ++
 hw/misc/rt500_rstctl.c                        |  235 ++
 hw/misc/spi_tester.c                          |   52 +
 hw/ssi/flexcomm_spi.c                         |  442 +++
 hw/ssi/flexspi.c                              |  169 +
 hw/ssi/ssi.c                                  |    4 +-
 system/qtest.c                                |   95 +-
 tests/qtest/flexcomm-i2c-test.c               |  169 +
 tests/qtest/flexcomm-spi-test.c               |  144 +
 tests/qtest/flexcomm-test.c                   |   86 +
 tests/qtest/flexcomm-usart-test.c             |  314 ++
 tests/qtest/libqtest.c                        |  102 +-
 tests/qtest/rt500-clkctl-test.c               |  195 +
 tests/unit/test-fifo.c                        |   97 +
 hw/arm/Kconfig                                |   12 +
 hw/arm/meson.build                            |    4 +
 hw/arm/svd/meson.build                        |   35 +
 hw/char/meson.build                           |    1 +
 hw/char/trace-events                          |    9 +
 hw/i2c/meson.build                            |    1 +
 hw/i2c/trace-events                           |   10 +
 hw/misc/Kconfig                               |   21 +
 hw/misc/meson.build                           |    7 +
 hw/misc/trace-events                          |   18 +
 hw/ssi/Kconfig                                |    4 +
 hw/ssi/meson.build                            |    2 +
 hw/ssi/trace-events                           |   12 +
 meson_options.txt                             |    3 +
 scripts/meson-buildoptions.sh                 |    4 +
 scripts/svd-gen-header.py                     |  330 ++
 subprojects/.gitignore                        |    1 +
 subprojects/mcux-soc-svd.wrap                 |    5 +
 .../packagefiles/mcux-soc-svd/meson.build     |    5 +
 tests/qtest/meson.build                       |    3 +
 tests/unit/meson.build                        |    1 +
 71 files changed, 19321 insertions(+), 22 deletions(-)
 create mode 100644 include/hw/arm/rt500.h
 create mode 100644 include/hw/arm/svd/flexcomm.h
 create mode 100644 include/hw/arm/svd/flexcomm_i2c.h
 create mode 100644 include/hw/arm/svd/flexcomm_spi.h
 create mode 100644 include/hw/arm/svd/flexcomm_usart.h
 create mode 100644 include/hw/arm/svd/flexspi.h
 create mode 100644 include/hw/arm/svd/rt500.h
 create mode 100644 include/hw/arm/svd/rt500_clkctl0.h
 create mode 100644 include/hw/arm/svd/rt500_clkctl1.h
 create mode 100644 include/hw/arm/svd/rt500_rstctl0.h
 create mode 100644 include/hw/arm/svd/rt500_rstctl1.h
 create mode 100644 include/hw/char/flexcomm_usart.h
 create mode 100644 include/hw/i2c/flexcomm_i2c.h
 create mode 100644 include/hw/misc/flexcomm.h
 create mode 100644 include/hw/misc/i2c_tester.h
 create mode 100644 include/hw/misc/rt500_clk_freqs.h
 create mode 100644 include/hw/misc/rt500_clkctl0.h
 create mode 100644 include/hw/misc/rt500_clkctl1.h
 create mode 100644 include/hw/misc/rt500_rstctl.h
 create mode 100644 include/hw/misc/spi_tester.h
 create mode 100644 include/hw/ssi/flexcomm_spi.h
 create mode 100644 include/hw/ssi/flexspi.h
 create mode 100644 tests/qtest/reg-utils.h
 create mode 100644 hw/arm/rt500.c
 create mode 100644 hw/arm/rt595-evk.c
 create mode 100644 hw/char/flexcomm_usart.c
 create mode 100644 hw/i2c/flexcomm_i2c.c
 create mode 100644 hw/misc/flexcomm.c
 create mode 100644 hw/misc/i2c_tester.c
 create mode 100644 hw/misc/rt500_clkctl0.c
 create mode 100644 hw/misc/rt500_clkctl1.c
 create mode 100644 hw/misc/rt500_rstctl.c
 create mode 100644 hw/misc/spi_tester.c
 create mode 100644 hw/ssi/flexcomm_spi.c
 create mode 100644 hw/ssi/flexspi.c
 create mode 100644 tests/qtest/flexcomm-i2c-test.c
 create mode 100644 tests/qtest/flexcomm-spi-test.c
 create mode 100644 tests/qtest/flexcomm-test.c
 create mode 100644 tests/qtest/flexcomm-usart-test.c
 create mode 100644 tests/qtest/rt500-clkctl-test.c
 create mode 100644 tests/unit/test-fifo.c
 create mode 100644 hw/arm/svd/meson.build
 create mode 100755 scripts/svd-gen-header.py
 create mode 100644 subprojects/mcux-soc-svd.wrap
 create mode 100644 subprojects/packagefiles/mcux-soc-svd/meson.build
Signature · 1 line
2.46.0.295.g3b9ea8a38a-goog