Re: [PATCH 08/25] hw/i2c: add support for flexcomm i2c

2024-09-20 Thread Octavian Purdila
On Thu, Sep 19, 2024 at 2:36 AM Peter Maydell wrote: > > On Wed, 18 Sept 2024 at 22:31, Corey Minyard wrote: > > Generally it's frowned upon to have a ton of extra stuff that's not > > used. I would think some is ok, like defining bits in registers that > > aren't used yet, but I have no idea ho

Re: [PATCH 19/25] hw/misc: add i2c-tester

2024-09-18 Thread Octavian Purdila
On Wed, Sep 18, 2024 at 1:06 PM Corey Minyard wrote: > > On Wed, Sep 18, 2024 at 12:22:47PM -0700, Octavian Purdila wrote: > > Add a simple i2c peripheral to be used for testing I2C device > > models. The peripheral has a fixed number of registers that can be > > read and

Re: [PATCH 08/25] hw/i2c: add support for flexcomm i2c

2024-09-18 Thread Octavian Purdila
On Wed, Sep 18, 2024 at 2:31 PM Corey Minyard wrote: > > On Wed, Sep 18, 2024 at 02:04:58PM -0700, Octavian Purdila wrote: > > On Wed, Sep 18, 2024 at 1:17???PM Corey Minyard wrote: > > > > > > On Wed, Sep 18, 2024 at 12:22:36PM -0700, Octavian Purdila wrote:

[PATCH 02/25] tests/unit: add fifo32 tests

2024-09-18 Thread Octavian Purdila
Add push/pop and peek tests for fifo32. Signed-off-by: Octavian Purdila --- tests/unit/test-fifo.c | 50 ++ 1 file changed, 50 insertions(+) diff --git a/tests/unit/test-fifo.c b/tests/unit/test-fifo.c index 14153c41fa..d0e05ba95c 100644 --- a/tests/unit

Re: [PATCH 08/25] hw/i2c: add support for flexcomm i2c

2024-09-18 Thread Octavian Purdila
On Wed, Sep 18, 2024 at 1:17 PM Corey Minyard wrote: > > On Wed, Sep 18, 2024 at 12:22:36PM -0700, Octavian Purdila wrote: > > Add support for NXP's flexcomm i2c. It does not support slave mode or > > DMA. > > > > The patch includes an automatically gene

[PATCH 15/25] tests/qtest: add register access macros and functions

2024-09-18 Thread Octavian Purdila
Add utility macros for accessing register or register bit fields in tests, e.g.: REG32_WRITE(FLEXCOMM, PSELID, persel); g_assert(REG32_READ_FIELD(FLEXCOMM, PSELID, PERSEL) == persel); Signed-off-by: Octavian Purdila --- tests/qtest/reg-utils.h | 70

[PATCH 03/25] scripts: add script to generate C header files from SVD XML files

2024-09-18 Thread Octavian Purdila
\ } Board specific headers contains information about peripheral base register addresses. Signed-off-by: Stefan Stanacar [tavip: pylint fixes, generate layout with qemu register fields instead of bitfields, generate register names, romask and reset values] Signed-off-by: Octavian Purdi

[PATCH 20/25] tests/qtest: add tests for flexcomm i2c

2024-09-18 Thread Octavian Purdila
Add master mode tests for flexcomm i2c. Signed-off-by: Octavian Purdila --- tests/qtest/flexcomm-i2c-test.c | 170 tests/qtest/meson.build | 2 +- 2 files changed, 171 insertions(+), 1 deletion(-) create mode 100644 tests/qtest/flexcomm-i2c-test.c

[PATCH 11/25] hw/ssi: add support for flexspi

2024-09-18 Thread Octavian Purdila
emory access, aka XIP, for now as simple RAM memory regions. The patch includes an automatically generated header which contains the register layout and helpers. The header can be regenerated with the svd-flexspi target when the build is configured with --enable-mcux-soc-svd. Signed-off-by: Oct

[PATCH 13/25] hw/arm: add basic support for the RT500 SoC

2024-09-18 Thread Octavian Purdila
arget when the build is configured with --enable-mcux-soc-svd. Signed-off-by: Octavian Purdila --- include/hw/arm/rt500.h | 44 + include/hw/arm/svd/rt500.h | 63 +++ hw/arm/rt500.c | 329 + hw/arm/Kconfig | 2 + h

[PATCH 21/25] hw/ssi: allow NULL realize callbacks for peripherals

2024-09-18 Thread Octavian Purdila
Signed-off-by: Octavian Purdila --- hw/ssi/ssi.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hw/ssi/ssi.c b/hw/ssi/ssi.c index 3f357e8f16..d1f3ce7c22 100644 --- a/hw/ssi/ssi.c +++ b/hw/ssi/ssi.c @@ -105,7 +105,9 @@ static void ssi_peripheral_realize(DeviceState *dev

[PATCH 14/25] hw/arm: add RT595-EVK board

2024-09-18 Thread Octavian Purdila
Add basic support for the RT595-EVK board, enough to be able to run the NXP's microXpresso SDK hello world example. Signed-off-by: Octavian Purdila --- hw/arm/rt595-evk.c | 64 ++ hw/arm/Kconfig | 5 hw/arm/meson.build | 1 + 3

[PATCH 08/25] hw/i2c: add support for flexcomm i2c

2024-09-18 Thread Octavian Purdila
c-svd. Signed-off-by: Octavian Purdila --- include/hw/arm/svd/flexcomm_i2c.h | 1190 + include/hw/i2c/flexcomm_i2c.h | 40 + include/hw/misc/flexcomm.h|2 + hw/i2c/flexcomm_i2c.c | 250 ++ hw/misc/flexcomm.c|3 + h

[PATCH 09/25] hw/ssi: add support for flexcomm spi

2024-09-18 Thread Octavian Purdila
xcomm-spi target when the build is configured with --enable-mcux-soc-svd. Signed-off-by: Sebastian Ene [tavip: add suport for CFG.SPOL, CFG.LSBF, TX control flags per FIFO entry and 8/16 bit access to FIFORD and FIFOWR, convert to Resettable interface, add support for migration] Signed-off-by: Oct

[PATCH 24/25] systems/qtest: add device clock APIs

2024-09-18 Thread Octavian Purdila
Add qtest APIs to check the device clock frequency. Signed-off-by: Octavian Purdila --- include/hw/qdev-clock.h | 10 +++ tests/qtest/libqtest-single.h | 24 + tests/qtest/libqtest.h| 22 +++ hw/core/qdev-clock.c | 2 +- system/qtest.c

[PATCH 18/25] tests/qtest: add flexcomm usart tests

2024-09-18 Thread Octavian Purdila
Add flexcomm usart polling and irq unit tests. Signed-off-by: Octavian Purdila --- tests/qtest/flexcomm-usart-test.c | 316 ++ tests/qtest/meson.build | 3 +- 2 files changed, 318 insertions(+), 1 deletion(-) create mode 100644 tests/qtest/flexcomm-usart

[PATCH 16/25] system/qtest: add APIS to check for memory access failures

2024-09-18 Thread Octavian Purdila
Add read*/write*_fail qtest APIs to check for memory access failures. Signed-off-by: Octavian Purdila --- tests/qtest/libqtest-single.h | 92 +++ tests/qtest/libqtest.h| 76 + system/qtest.c| 44

[PATCH 05/25] hw/misc: add support for flexcomm

2024-09-18 Thread Octavian Purdila
with --enable-mcux-soc-svd. Signed-off-by: Octavian Purdila --- include/hw/arm/svd/flexcomm.h | 112 ++ include/hw/misc/flexcomm.h | 49 + include/hw/misc/flexcomm_function.h | 47 hw/misc/flexcomm.c | 319 hw/arm/meson.

[PATCH 25/25] tests/qtest: add tests for RT500's clock controller

2024-09-18 Thread Octavian Purdila
Add test to exercise clocks set and clear, system PLL initialization, audio PLL initialization, systick and ostimer clock source selection. Signed-off-by: Octavian Purdila --- tests/qtest/rt500-clkctl-test.c | 195 tests/qtest/meson.build | 1 + 2

[PATCH 06/25] hw/misc/flexcomm.c: add common fifo functionality

2024-09-18 Thread Octavian Purdila
FLEXCOMM SPI and USART share FIFO functionality. Add common helper functions to avoid code duplication. Signed-off-by: Octavian Purdila --- include/hw/misc/flexcomm.h | 2 + include/hw/misc/flexcomm_function.h | 8 +++ hw/misc/flexcomm.c | 83

[PATCH 22/25] hw/misc: add spi-tester

2024-09-18 Thread Octavian Purdila
Add a simple SPI peripheral that echoes back received data. Useful for testing SPI controllers. Signed-off-by: Octavian Purdila --- include/hw/misc/spi_tester.h | 32 + hw/misc/spi_tester.c | 67 hw/misc/Kconfig | 5

[PATCH 00/25] NXP i.MX RT595

2024-09-18 Thread Octavian Purdila
IR=/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 Purdil

[PATCH 23/25] tests/qtest: add tests for flexcomm spi

2024-09-18 Thread Octavian Purdila
From: Sebastian Ene Add master and loopback tests for flexcomm spi. Signed-off-by: Sebastian Ene [tavip: add master mode test, convert to qtest] Signed-off-by: Octavian Purdila --- tests/qtest/flexcomm-spi-test.c | 145 tests/qtest/meson.build | 2

[PATCH 01/25] fifo32: add peek function

2024-09-18 Thread Octavian Purdila
Add fifo32_peek() that returns the first element from the queue without popping it. Signed-off-by: Octavian Purdila --- include/qemu/fifo32.h | 28 1 file changed, 28 insertions(+) diff --git a/include/qemu/fifo32.h b/include/qemu/fifo32.h index 4e9fd1b5ef

[PATCH 07/25] hw/char: add support for flexcomm usart

2024-09-18 Thread Octavian Purdila
nable-mcux-soc-svd. Signed-off-by: Octavian Purdila --- include/hw/arm/svd/flexcomm_usart.h | 1021 +++ include/hw/char/flexcomm_usart.h| 33 + include/hw/misc/flexcomm.h |2 + hw/char/flexcomm_usart.c| 288 hw/misc/flexc

[PATCH 17/25] tests/qtest: add flexcomm tests

2024-09-18 Thread Octavian Purdila
Add flexcomm function selection unit tests. Signed-off-by: Octavian Purdila --- tests/qtest/flexcomm-test.c | 82 + tests/qtest/meson.build | 1 + 2 files changed, 83 insertions(+) create mode 100644 tests/qtest/flexcomm-test.c diff --git a/tests/qtest

[PATCH 12/25] hw/misc: add support for RT500's reset controller

2024-09-18 Thread Octavian Purdila
controllers. The patch includes automatically generated headers which contains the register layout and helpers. The header can be regenerated with the svd-rstctl0 and svd-rstctl1 targets when the build is configured with --enable-mcux-soc-svd. Signed-off-by: Octavian Purdila --- include/hw/arm

[PATCH 04/25] Add mcux-soc-svd subproject

2024-09-18 Thread Octavian Purdila
generated. It is unlikely that already generated headers will be updated, with the exception of minor hardware revisions. Also export the rt595 SVD file which is going to be used by subsequent patches. TBD: switch to a qemu gitlab fork before merge Signed-off-by: Octavian Purdila --- hw/arm/svd

[PATCH 19/25] hw/misc: add i2c-tester

2024-09-18 Thread Octavian Purdila
Add a simple i2c peripheral to be used for testing I2C device models. The peripheral has a fixed number of registers that can be read and written. Signed-off-by: Octavian Purdila --- include/hw/misc/i2c_tester.h | 30 ++ hw/misc/i2c_tester.c | 109

Re: [RFC PATCH v3 01/24] fifo32: add peek function

2024-09-17 Thread Octavian Purdila
e On Fri, Sep 6, 2024 at 4:53 AM Philippe Mathieu-Daudé wrote: > > Hi Octavian, > Hi Philippe, > On 27/8/24 08:45, Octavian Purdila wrote: > > Add fifo32_peek() that returns the first element from the queue > > without popping it. > > >

Re: [PATCH 9/9] tests/unit: add test-fifo unit test

2024-08-30 Thread Octavian Purdila
On Wed, Aug 28, 2024 at 5:23 AM Mark Cave-Ayland wrote: > > This tests the Fifo8 implementation for basic operations as well as testing > for > the correct *_bufptr() including handling wraparound of the internal FIFO > buffer. > > Signed-off-by: Mark Cave-Ayland Reviewed

Re: [PATCH 7/9] fifo8: add fifo8_peek_buf() function

2024-08-30 Thread Octavian Purdila
-Ayland Reviewed-by: Octavian Purdila > --- > include/qemu/fifo8.h | 14 ++ > util/fifo8.c | 5 + > 2 files changed, 19 insertions(+) > > diff --git a/include/qemu/fifo8.h b/include/qemu/fifo8.h > index d1d06754d8..d09984b146 100644 > --- a/incl

Re: [PATCH 8/9] fifo8: introduce fifo8_peek() function

2024-08-30 Thread Octavian Purdila
On Wed, Aug 28, 2024 at 5:23 AM Mark Cave-Ayland wrote: > > This allows uses to peek the byte at the current head of the FIFO. > > Signed-off-by: Mark Cave-Ayland Reviewed-by: Octavian Purdila > --- > include/qemu/fifo8.h | 11 +++ > util/fifo8.c |

Re: [PATCH 6/9] fifo8: honour do_pop argument in fifo8_peekpop_buf()

2024-08-30 Thread Octavian Purdila
> Signed-off-by: Mark Cave-Ayland Reviewed-by: Octavian Purdila > --- > util/fifo8.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/util/fifo8.c b/util/fifo8.c > index 5453cbc1b0..1031ffbe7e 100644 > --- a/util/fifo8.c > +++ b/util/fif

Re: [PATCH 5/9] fifo8: rename fifo8_pop_buf() to fifo8_peekpop_buf()

2024-08-30 Thread Octavian Purdila
Signed-off-by: Mark Cave-Ayland Reviewed-by: Octavian Purdila > --- > util/fifo8.c | 8 +++- > 1 file changed, 7 insertions(+), 1 deletion(-) > > diff --git a/util/fifo8.c b/util/fifo8.c > index efe0117b1f..5453cbc1b0 100644 > --- a/util/fifo8.c > +++ b/util/fifo8.c >

Re: [PATCH 4/9] fifo8: replace fifo8_pop_bufptr() with fifo8_peekpop_bufptr() in fifo8_pop_buf()

2024-08-30 Thread Octavian Purdila
On Wed, Aug 28, 2024 at 5:23 AM Mark Cave-Ayland wrote: > > The upcoming peek functionality will require passing a non-zero value to > fifo8_peekpop_bufptr(). > > Signed-off-by: Mark Cave-Ayland Reviewed-by: Octavian Purdila > --- > util/fifo8.c | 4 ++-- > 1 file cha

Re: [PATCH 3/9] fifo8: add skip parameter to fifo8_peekpop_bufptr()

2024-08-30 Thread Octavian Purdila
On Wed, Aug 28, 2024 at 5:23 AM Mark Cave-Ayland wrote: > > The skip parameter specifies the number of bytes to be skipped from the > current > FIFO head before the peek or pop operation. > > Signed-off-by: Mark Cave-Ayland Reviewed-by: Octavian Purdila > ---

Re: [PATCH 2/9] fifo8: introduce head variable for fifo8_peekpop_bufptr()

2024-08-30 Thread Octavian Purdila
internal FIFO buffer. > > Signed-off-by: Mark Cave-Ayland Reviewed-by: Octavian Purdila > --- > util/fifo8.c | 7 --- > 1 file changed, 4 insertions(+), 3 deletions(-) > > diff --git a/util/fifo8.c b/util/fifo8.c > index 61bce9d9a0..5faa814a6e 100644 > --- a/util

Re: [PATCH 1/9] fifo8: rename fifo8_peekpop_buf() to fifo8_peekpop_bufptr()

2024-08-30 Thread Octavian Purdila
On Wed, Aug 28, 2024 at 5:23 AM Mark Cave-Ayland wrote: > > This is to emphasise that the function returns a pointer to the internal FIFO > buffer. > > Signed-off-by: Mark Cave-Ayland Reviewed-by: Octavian Purdila > --- > util/fifo8.c | 8 > 1 file cha

[RFC PATCH v3 15/24] system/qtest: add APIS to check for memory access failures

2024-08-26 Thread Octavian Purdila
Add read*/write*_fail qtest APIs to check for memory access failures. Signed-off-by: Octavian Purdila --- tests/qtest/libqtest-single.h | 92 +++ tests/qtest/libqtest.h| 76 + system/qtest.c| 44

[RFC PATCH v3 17/24] tests/qtest: add flexcomm usart tests

2024-08-26 Thread Octavian Purdila
Add flexcomm usart polling and irq unit tests. Signed-off-by: Octavian Purdila --- tests/qtest/flexcomm-usart-test.c | 314 ++ tests/qtest/meson.build | 3 +- 2 files changed, 316 insertions(+), 1 deletion(-) create mode 100644 tests/qtest/flexcomm-usart

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

2024-08-26 Thread Octavian Purdila
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

[RFC PATCH v3 22/24] tests/qtest: add tests for flexcomm spi

2024-08-26 Thread Octavian Purdila
From: Sebastian Ene Add master and loopback tests for flexcomm spi. Signed-off-by: Sebastian Ene [tavip: add master mode test, convert to qtest] Signed-off-by: Octavian Purdila --- tests/qtest/flexcomm-spi-test.c | 144 tests/qtest/meson.build | 2

[RFC PATCH v3 06/24] hw/char: add support for flexcomm usart

2024-08-26 Thread Octavian Purdila
nable-mcux-soc-svd. Signed-off-by: Octavian Purdila --- include/hw/arm/svd/flexcomm_usart.h | 1023 +++ include/hw/char/flexcomm_usart.h| 20 + include/hw/misc/flexcomm.h |5 + hw/char/flexcomm_usart.c| 306 hw/misc/flexc

[RFC PATCH v3 23/24] systems/qtest: add device clock APIs

2024-08-26 Thread Octavian Purdila
Add qtest APIs to check the device clock frequency. Signed-off-by: tavip --- include/hw/qdev-clock.h | 10 +++ tests/qtest/libqtest-single.h | 24 + tests/qtest/libqtest.h| 22 +++ hw/core/qdev-clock.c | 2 +- system/qtest.c

[RFC PATCH v3 04/24] Add mcux-soc-svd subproject

2024-08-26 Thread Octavian Purdila
generated. It is unlikely that already generated headers will be updated, with the exception of minor hardware revisions. Also export the rt595 SVD file which is going to be used by subsequent patches. TBD: switch to a qemu gitlab fork before merge Signed-off-by: Octavian Purdila --- hw/arm/svd

[RFC PATCH v3 18/24] hw/misc: add i2c-tester

2024-08-26 Thread Octavian Purdila
Add a simple i2c peripheral to be used for testing I2C device models. The peripheral has a fixed number of registers that can be read and written. Signed-off-by: Octavian Purdila --- include/hw/misc/i2c_tester.h | 30 hw/misc/i2c_tester.c | 94

[RFC PATCH v3 12/24] hw/arm: add basic support for the RT500 SoC

2024-08-26 Thread Octavian Purdila
arget when the build is configured with --enable-mcux-soc-svd. Signed-off-by: Octavian Purdila --- include/hw/arm/rt500.h | 44 + include/hw/arm/svd/rt500.h | 63 +++ hw/arm/rt500.c | 335 + hw/arm/Kconfig | 2 + h

[RFC PATCH v3 07/24] hw/i2c: add support for flexcomm i2c

2024-08-26 Thread Octavian Purdila
c-svd. Signed-off-by: Octavian Purdila --- include/hw/arm/svd/flexcomm_i2c.h | 1192 + include/hw/i2c/flexcomm_i2c.h | 27 + include/hw/misc/flexcomm.h|3 + hw/i2c/flexcomm_i2c.c | 222 ++ hw/misc/flexcomm.c|6 + h

[RFC PATCH v3 16/24] tests/qtest: add flexcomm tests

2024-08-26 Thread Octavian Purdila
Add flexcomm function selection unit tests. Signed-off-by: Octavian Purdila --- tests/qtest/flexcomm-test.c | 86 + tests/qtest/meson.build | 1 + 2 files changed, 87 insertions(+) create mode 100644 tests/qtest/flexcomm-test.c diff --git a/tests/qtest

[RFC PATCH v3 11/24] hw/misc: add support for RT500's reset controller

2024-08-26 Thread Octavian Purdila
controllers. The patch includes automatically generated headers which contains the register layout and helpers. The header can be regenerated with the svd-rstctl0 and svd-rstctl1 targets when the build is configured with --enable-mcux-soc-svd. Signed-off-by: Octavian Purdila --- include/hw/arm

[RFC PATCH v3 14/24] tests/qtest: add register access macros and functions

2024-08-26 Thread Octavian Purdila
Add utility macros for accessing register or register bit fields in tests, e.g.: REG32_WRITE(FLEXCOMM, PSELID, persel); g_assert(REG32_READ_FIELD(FLEXCOMM, PSELID, PERSEL) == persel); Signed-off-by: Octavian Purdila --- tests/qtest/reg-utils.h | 70

[RFC PATCH v3 10/24] hw/ssi: add support for flexspi

2024-08-26 Thread Octavian Purdila
emory access, aka XIP, for now as simple RAM memory regions. The patch includes an automatically generated header which contains the register layout and helpers. The header can be regenerated with the svd-flexspi target when the build is configured with --enable-mcux-soc-svd. Signed-off-by: Oct

[RFC PATCH v3 03/24] scripts: add script to generate C header files from SVD XML files

2024-08-26 Thread Octavian Purdila
\ } Board specific headers contains information about peripheral base register addresses. Signed-off-by: Stefan Stanacar [tavip: pylint fixes, generate layout with qemu register fields instead of bitfields, generate register names, romask and reset values] Signed-off-by: Octavian Purdi

[RFC PATCH v3 24/24] test/unit: add unit tests for RT500's clock controller

2024-08-26 Thread Octavian Purdila
Add test to exercise clocks set and clear, system PLL initialization, audio PLL initialization, systick and ostimer clock source selection. Signed-off-by: Octavian Purdila --- tests/qtest/rt500-clkctl-test.c | 195 tests/qtest/meson.build | 1 + 2

[RFC PATCH v3 20/24] hw/ssi: allow NULL realize callbacks for peripherals

2024-08-26 Thread Octavian Purdila
Signed-off-by: tavip --- hw/ssi/ssi.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hw/ssi/ssi.c b/hw/ssi/ssi.c index 3f357e8f16..d1f3ce7c22 100644 --- a/hw/ssi/ssi.c +++ b/hw/ssi/ssi.c @@ -105,7 +105,9 @@ static void ssi_peripheral_realize(DeviceState *dev, Error **errp

[RFC PATCH v3 02/24] tests/unit: add fifo test

2024-08-26 Thread Octavian Purdila
Add a simple FIFO unit test that test wrap around and push, pop and peek for both fifo8 and fifo32. Signed-off-by: Octavian Purdila --- tests/unit/test-fifo.c | 97 ++ tests/unit/meson.build | 1 + 2 files changed, 98 insertions(+) create mode 100644

[RFC PATCH v3 21/24] hw/misc: add spi-tester

2024-08-26 Thread Octavian Purdila
Add a simple SPI peripheral that echoes back received data. Useful for testing SPI controllers. Signed-off-by: Octavian Purdila --- include/hw/misc/spi_tester.h | 32 ++ hw/misc/spi_tester.c | 52 hw/misc/Kconfig | 5

[RFC PATCH v3 13/24] hw/arm: add RT595-EVK board

2024-08-26 Thread Octavian Purdila
Add basic support for the RT595-EVK board, enough to be able to run the NXP's microXpresso SDK hello world example. Signed-off-by: Octavian Purdila --- hw/arm/rt595-evk.c | 64 ++ hw/arm/Kconfig | 5 hw/arm/meson.build | 1 + 3

[RFC PATCH v3 05/24] hw/misc: add basic flexcomm device model

2024-08-26 Thread Octavian Purdila
n the build is configured with --enable-mcux-soc-svd. Signed-off-by: Octavian Purdila --- include/hw/arm/svd/flexcomm.h | 114 + include/hw/misc/flexcomm.h| 70 hw/misc/flexcomm.c| 302 ++ hw/arm/meson.build| 2

[RFC PATCH v3 19/24] tests/qtest: add tests for flexcomm i2c

2024-08-26 Thread Octavian Purdila
Add master mode tests for flexcomm i2c. Signed-off-by: Octavian Purdila --- tests/qtest/flexcomm-i2c-test.c | 169 tests/qtest/meson.build | 2 +- 2 files changed, 170 insertions(+), 1 deletion(-) create mode 100644 tests/qtest/flexcomm-i2c-test.c

[RFC PATCH v3 01/24] fifo32: add peek function

2024-08-26 Thread Octavian Purdila
Add fifo32_peek() that returns the first element from the queue without popping it. Signed-off-by: Octavian Purdila --- include/qemu/fifo32.h | 28 1 file changed, 28 insertions(+) diff --git a/include/qemu/fifo32.h b/include/qemu/fifo32.h index 4e9fd1b5ef

[RFC PATCH v3 08/24] hw/ssi: add support for flexcomm spi

2024-08-26 Thread Octavian Purdila
xcomm-spi target when the build is configured with --enable-mcux-soc-svd. Signed-off-by: Sebastian Ene [tavip: add suport for CFG.SPOL, CFG.LSBF, TX control flags per FIFO entry and 8/16 bit access to FIFORD and FIFOWR] Signed-off-by: Octavian Purdila --- include/hw/arm/svd/flexcomm_spi.h |

Re: [RFC PATCH v2 00/23] NXP i.MX RT595, ARM SVD and device model unit tests

2024-08-22 Thread Octavian Purdila
On Thu, Aug 22, 2024 at 6:28 AM Peter Maydell wrote: > > On Sat, 17 Aug 2024 at 11:26, Octavian Purdila wrote: > > > > 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. &

[RFC PATCH v2 15/23] hw/ssi: add support for flexcomm spi

2024-08-17 Thread Octavian Purdila
xcomm-spi target when the build is configured with --enable-mcux-soc-svd. Signed-off-by: Sebastian Ene [tavip: add suport for CFG.SPOL, CFG.LSBF, TX control flags per FIFO entry and 8/16 bit access to FIFORD and FIFOWR] Signed-off-by: Octavian Purdila --- include/hw/arm/svd/flexcomm_spi.h

[RFC PATCH v2 14/23] test/unit: add unit tests for flexcomm i2c

2024-08-17 Thread Octavian Purdila
Add master mode tests for flexcomm i2c. Signed-off-by: Octavian Purdila --- tests/unit/test-flexcomm-i2c.c | 210 + tests/unit/meson.build | 10 ++ 2 files changed, 220 insertions(+) create mode 100644 tests/unit/test-flexcomm-i2c.c diff --git a/tests

[RFC PATCH v2 04/23] Add mcux-soc-svd subproject

2024-08-17 Thread Octavian Purdila
generated. It is unlikely that already generated headers will be updated, with the exception of minor hardware revisions. Also export the rt595 SVD file which is going to be used by subsequent patches. TBD: switch to a qemu gitlab fork before merge Signed-off-by: Octavian Purdila --- hw/arm/svd

[RFC PATCH v2 17/23] test/unit: add unit tests for flexcomm spi

2024-08-17 Thread Octavian Purdila
From: Sebastian Ene Add master and loopback tests for flexcomm spi. Signed-off-by: Sebastian Ene [tavip: add master mode test] Signed-off-by: Octavian Purdila --- tests/unit/test-flexcomm-spi.c | 201 + tests/unit/meson.build | 12 ++ 2 files changed

[RFC PATCH v2 11/23] test/unit: add flexcomm usart unit test

2024-08-17 Thread Octavian Purdila
Add polling and irq unit tests for the flexcomm usart device model. Signed-off-by: Octavian Purdila --- tests/unit/test-flexcomm-usart.c | 320 +++ tests/unit/meson.build | 7 + 2 files changed, 327 insertions(+) create mode 100644 tests/unit/test

[RFC PATCH v2 20/23] hw/ssi: add support for flexspi

2024-08-17 Thread Octavian Purdila
emory access, aka XIP, for now as simple RAM memory regions. The patch includes an automatically generated header which contains the register layout and helpers. The header can be regenerated with the svd-flexspi target when the build is configured with --enable-mcux-soc-svd. Signed-off-by: Oct

[RFC PATCH v2 19/23] test/unit: add unit tests for RT500's clock controller

2024-08-17 Thread Octavian Purdila
Add test to exercise clocks set and clear, system PLL initialization, audio PLL initialization, systick and ostimer clock source selection. Signed-off-by: Octavian Purdila --- tests/unit/test-rt500-clkctl.c | 263 + tests/unit/meson.build | 7 + 2 files

[RFC PATCH v2 21/23] hw/misc: add support for RT500's reset controller

2024-08-17 Thread Octavian Purdila
controllers. The patch includes automatically generated headers which contains the register layout and helpers. The header can be regenerated with the svd-rstctl0 and svd-rstctl1 targets when the build is configured with --enable-mcux-soc-svd. Signed-off-by: Octavian Purdila --- include/hw/arm

[RFC PATCH v2 22/23] hw/arm: add basic support for the RT500 SoC

2024-08-17 Thread Octavian Purdila
arget when the build is configured with --enable-mcux-soc-svd. Signed-off-by: Octavian Purdila --- include/hw/arm/rt500.h | 44 + include/hw/arm/svd/rt500.h | 65 +++ hw/arm/rt500.c | 335 + hw/arm/Kconfig | 8 + h

[RFC PATCH v2 10/23] hw/char: add support for flexcomm usart

2024-08-17 Thread Octavian Purdila
nable-mcux-soc-svd. Signed-off-by: Octavian Purdila --- include/hw/arm/svd/flexcomm_usart.h | 959 include/hw/char/flexcomm_usart.h| 20 + include/hw/misc/flexcomm.h | 5 + hw/char/flexcomm_usart.c| 292 + hw/misc/flexc

[RFC PATCH v2 08/23] test/unit: add register access macros and functions

2024-08-17 Thread Octavian Purdila
e, e.g.: /* no register access until a function is selected */ g_assert(reg32_addr_read_raw(f->dev, FLEXCOMM_BASE, &tmp, 4) == MEMTX_ERROR); Signed-off-by: Octavian Purdila --- tests/unit/reg-utils.h | 97 ++ 1 file changed, 97 insertions(+) creat

[RFC PATCH v2 09/23] test/unit: add flexcomm unit test

2024-08-17 Thread Octavian Purdila
Add flexcomm function selection unit tests. Signed-off-by: Octavian Purdila --- tests/unit/test-flexcomm.c | 212 + tests/unit/meson.build | 8 +- 2 files changed, 219 insertions(+), 1 deletion(-) create mode 100644 tests/unit/test-flexcomm.c diff

[RFC PATCH v2 23/23] hw/arm: add RT595-EVK board

2024-08-17 Thread Octavian Purdila
Add basic support for the RT595-EVK board, enough to be able to run the NXP's microXpresso SDK hello world example. Signed-off-by: Octavian Purdila --- hw/arm/rt595-evk.c | 64 ++ hw/arm/Kconfig | 5 hw/arm/meson.build | 1 + 3

[RFC PATCH v2 06/23] hw/misc: add basic flexcomm device model

2024-08-17 Thread Octavian Purdila
n the build is configured with --enable-mcux-soc-svd. Signed-off-by: Octavian Purdila --- include/hw/arm/svd/flexcomm.h | 109 + include/hw/misc/flexcomm.h| 70 + hw/misc/flexcomm.c| 283 ++ hw/arm/meson.build| 2

[RFC PATCH v2 13/23] test/unit: add i2c-tester

2024-08-17 Thread Octavian Purdila
Add a simple i2c peripheral to be used for testing I2C device models. The peripheral has a fixed number of registers that can be read and written. Signed-off-by: Octavian Purdila --- tests/unit/i2c_tester.h | 30 +++ tests/unit/i2c_tester.c | 108

[RFC PATCH v2 03/23] scripts: add script to generate C header files from SVD XML files

2024-08-17 Thread Octavian Purdila
resses. Signed-off-by: Stefan Stanacar [tavip: pylint fixes, generate layout with qemu register fields instead of bitfields, generate register names, wmask and reset values] Signed-off-by: Octavian Purdila --- meson.build | 4 + scripts/svd-gen-header.py | 343 +

[RFC PATCH v2 16/23] test/unit: add spi-tester

2024-08-17 Thread Octavian Purdila
Add a simple SPI peripheral that echoes back received data. Useful for testing SPI controllers. Signed-off-by: Octavian Purdila --- tests/unit/spi_tester.h | 32 +++ tests/unit/spi_tester.c | 57 + 2 files changed, 89 insertions

[RFC PATCH v2 12/23] hw/i2c: add support for flexcomm i2c

2024-08-17 Thread Octavian Purdila
c-svd. Signed-off-by: Octavian Purdila --- include/hw/arm/svd/flexcomm_i2c.h | 1134 + include/hw/i2c/flexcomm_i2c.h | 27 + include/hw/misc/flexcomm.h|3 + hw/i2c/flexcomm_i2c.c | 207 ++ hw/misc/flexcomm.c|6 + h

[RFC PATCH v2 02/23] tests/unit: add fifo test

2024-08-17 Thread Octavian Purdila
Add a simple FIFO unit test that test wrap around and push, pop and peek for both fifo8 and fifo32. Signed-off-by: Octavian Purdila --- tests/unit/test-fifo.c | 97 ++ tests/unit/meson.build | 1 + 2 files changed, 98 insertions(+) create mode 100644

[RFC PATCH v2 05/23] hw: add register access utility functions

2024-08-17 Thread Octavian Purdila
Add register access utility functions for device models, like checking aligned access. Signed-off-by: Octavian Purdila --- include/hw/regs.h | 34 ++ 1 file changed, 34 insertions(+) create mode 100644 include/hw/regs.h diff --git a/include/hw/regs.h b/include

[RFC PATCH v2 01/23] fifo32: add peek function

2024-08-17 Thread Octavian Purdila
Add fifo32_peek() that returns the first element from the queue without popping it. Signed-off-by: Octavian Purdila --- include/qemu/fifo32.h | 28 1 file changed, 28 insertions(+) diff --git a/include/qemu/fifo32.h b/include/qemu/fifo32.h index 4e9fd1b5ef

[RFC PATCH v2 07/23] tests/unit: add system bus mock

2024-08-17 Thread Octavian Purdila
: Octavian Purdila --- tests/unit/sysbus-mock.h | 82 ++ tests/unit/sysbus-mock.c | 312 +++ 2 files changed, 394 insertions(+) create mode 100644 tests/unit/sysbus-mock.h create mode 100644 tests/unit/sysbus-mock.c diff --git a/tests/unit/sysbus-mock.h b

[RFC PATCH v2 00/23] NXP i.MX RT595, ARM SVD and device model unit tests

2024-08-17 Thread Octavian Purdila
../../../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 (19): fifo32: add p

Re: [RFC PATCH 03/23] scripts: add script to generate C header files from SVD XML files

2024-08-13 Thread Octavian Purdila
On Mon, Aug 12, 2024 at 3:43 PM Richard Henderson wrote: > > On 8/13/24 03:56, Octavian Purdila wrote: > >>>typedef struct { > >>> ... > >>> union { > >>>uint32_t PSELID; /* 0x0FF8 Peripheral Select and

Re: [RFC PATCH 05/23] hw: add register access utility functions

2024-08-12 Thread Octavian Purdila
On Mon, Aug 12, 2024 at 8:33 AM Peter Maydell wrote: > > On Mon, 5 Aug 2024 at 21:17, Octavian Purdila wrote: > > > > Add register access utility functions for device models, like checking > > aligned access and reading and writing to a register backstore. > > >

Re: [RFC PATCH 00/23] NXP i.MX RT595, ARM SVD and device model unit tests

2024-08-12 Thread Octavian Purdila
On Mon, Aug 12, 2024 at 9:22 AM Daniel P. Berrangé wrote: > > On Mon, Aug 12, 2024 at 05:10:52PM +0100, Peter Maydell wrote: > > On Mon, 5 Aug 2024 at 21:17, Octavian Purdila wrote: > > > It also introduces unit tests for device models. To allow accessing > > > regi

Re: [RFC PATCH 03/23] scripts: add script to generate C header files from SVD XML files

2024-08-12 Thread Octavian Purdila
On Mon, Aug 12, 2024 at 8:27 AM Peter Maydell wrote: > Hi Peter, Thanks for the review! > On Mon, 5 Aug 2024 at 21:17, Octavian Purdila wrote: > > > > From: Stefan Stanacar > > > > From: Stefan Stanacar > > > > The CMSIS System View Des

Re: [RFC PATCH 04/23] hw/arm: add SVD file for NXP i.MX RT595

2024-08-09 Thread Octavian Purdila
On Fri, Aug 9, 2024 at 2:13 AM Daniel P. Berrangé wrote: > > On Tue, Aug 06, 2024 at 01:31:51PM -0700, Octavian Purdila wrote: > > On Tue, Aug 6, 2024 at 7:06 AM Alex Bennée wrote: > > > > > > Octavian Purdila writes: > > > > > > > Picked from

Re: [RFC PATCH 03/23] scripts: add script to generate C header files from SVD XML files

2024-08-09 Thread Octavian Purdila
On Thu, Aug 8, 2024 at 11:34 PM Paolo Bonzini wrote: > > On 8/8/24 23:56, John Snow wrote: > > I haven't read the rest of this series; I'm chiming in solely from the > > build/python maintainer angle. Do we *always* need pysvd, no matter how > > QEMU was configured? Adding it to the meson line her

Re: [RFC PATCH 03/23] scripts: add script to generate C header files from SVD XML files

2024-08-08 Thread Octavian Purdila
On Thu, Aug 8, 2024 at 2:56 PM John Snow wrote: > > > > On Mon, Aug 5, 2024 at 4:17 PM Octavian Purdila wrote: >> >> From: Stefan Stanacar >> >> From: Stefan Stanacar >> >> The CMSIS System View Description format(CMSIS-SVD) is an XML based

Re: [RFC PATCH 20/23] hw/ssi: add support for flexspi

2024-08-08 Thread Octavian Purdila
On Wed, Aug 7, 2024 at 10:11 PM Philippe Mathieu-Daudé wrote: > > Hi Octavian, > Hi Philippe, Thanks for the review! > On 5/8/24 22:17, Octavian Purdila wrote: > > This is mostly a stub which completes SPI transactions as noops > > by masking out the error interrupt

Re: [RFC PATCH 22/23] hw/arm: add basic support for the RT500 SoC

2024-08-07 Thread Octavian Purdila
On Tue, Aug 6, 2024 at 7:51 AM Philippe Mathieu-Daudé wrote: > > Hi Octavian, > > Few comments inlined. > Hi Philippe, Thank you for the review! I have queued fixes for all of the patches in the set where applicable, I'll wait for more feedback on the rest of the patches before sending v2.

Re: [RFC PATCH 04/23] hw/arm: add SVD file for NXP i.MX RT595

2024-08-07 Thread Octavian Purdila
On Wed, Aug 7, 2024 at 4:24 AM Philippe Mathieu-Daudé wrote: > > On 6/8/24 22:31, Octavian Purdila wrote: > > On Tue, Aug 6, 2024 at 7:06 AM Alex Bennée wrote: > >> > >> Octavian Purdila writes: > >> > >>> Picked from: > >>>

Re: [RFC PATCH 04/23] hw/arm: add SVD file for NXP i.MX RT595

2024-08-06 Thread Octavian Purdila
On Tue, Aug 6, 2024 at 7:06 AM Alex Bennée wrote: > > Octavian Purdila writes: > > > Picked from: > > > > https://github.com/nxp-mcuxpresso/mcux-soc-svd/blob/main/MIMXRT595S/MIMXRT595S_cm33.xml > > > > NOTE: the file is truncated to keep the email size re

[PATCH v4] chardev: add path option for pty backend

2024-08-05 Thread Octavian Purdila
qmp_capabilities"} > {"execute": "chardev-add", "arguments": {"id": "bar", "backend": { "type": "pty", "data": { Also tested that when a link path is not passed invocations still work,

[RFC PATCH 15/23] hw/ssi: add support for flexcomm spi

2024-08-05 Thread Octavian Purdila
From: Sebastian Ene From: Sebastian Ene Add support for NXP's flexcomm spi. It supports FIFO access, interrupts and master mode only. It does not support DMA. Signed-off-by: Sebastian Ene Signed-off-by: Octavian Purdila --- hw/arm/svd/meson.build| 4 + hw/misc/flexc

  1   2   >