All of lore.kernel.org
 help / color / mirror / Atom feed
From: Junze Cao <caojunze424@gmail.com>
To: qemu-devel@nongnu.org
Cc: qemu-riscv@nongnu.org, chao.liu@processmission.com,
	pierrick.bouvier@oss.qualcomm.com, palmer@dabbelt.com,
	alistair.francis@wdc.com, liwei1518@gmail.com,
	daniel.barboza@oss.qualcomm.com, zhiwei_liu@linux.alibaba.com,
	farosas@suse.de, lvivier@redhat.com, pbonzini@redhat.com,
	Junze Cao <caojunze424@gmail.com>
Subject: [PATCH 0/3] riscv: Add K230 DDR controller and PHY models
Date: Thu, 16 Jul 2026 21:24:20 +0800	[thread overview]
Message-ID: <20260716132423.931427-1-caojunze424@gmail.com> (raw)

The K230 SDK U-Boot SPL initializes DRAM by programming the DDRC CFG
and DDR PHY MMIO regions. The k230 machine currently exposes the DDR
configuration region as unimplemented and does not provide the PHY, so
the SPL cannot complete the training and DFI handshakes.

Add minimal models for the register behavior exercised by the SDK SPL.
The controller model provides reset values, register access policy, DFI
and software-update handshakes, and the Init-to-Normal transition. The
PHY model provides CSR ownership, the training mailbox, and DFI
completion. Wire both devices into the k230 machine and document the
resulting SPL support.

These device models allow firmware to complete the DDR initialization
sequence.

Testing performed:

* scripts/checkpatch.pl --branch upstream/master..HEAD
* meson test -C build --print-errorlogs
  qemu:qtest-riscv64/k230-ddr-test (6 subtests passed)
* Booted the K230 SDK U-Boot SPL through DDR initialization to its SPI
  boot path

Junze Cao (3):
  hw/misc: Add K230 DDR controller and PHY models
  hw/riscv: Connect K230 DDR controller and PHY models
  tests/qtest: Add K230 DDR controller tests

 MAINTAINERS                 |   3 +
 docs/system/riscv/k230.rst  |   4 +
 hw/misc/k230_ddr.c          | 544 ++++++++++++++++++++++++++++++++++++
 hw/misc/meson.build         |   1 +
 hw/riscv/k230.c             |  19 +-
 include/hw/misc/k230_ddr.h  |  59 ++++
 include/hw/riscv/k230.h     |   4 +
 tests/qtest/k230-ddr-test.c | 226 +++++++++++++++
 tests/qtest/meson.build     |   3 +-
 9 files changed, 859 insertions(+), 4 deletions(-)
 create mode 100644 hw/misc/k230_ddr.c
 create mode 100644 include/hw/misc/k230_ddr.h
 create mode 100644 tests/qtest/k230-ddr-test.c


base-commit: eca2c16212ef9dcb0871de39bb9d1c2efebe76be
-- 
2.53.0


             reply	other threads:[~2026-07-16 13:24 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-16 13:24 Junze Cao [this message]
2026-07-16 13:24 ` [PATCH 1/3] hw/misc: Add K230 DDR controller and PHY models Junze Cao
2026-07-22 20:06   ` Daniel Henrique Barboza
2026-07-23  8:41   ` Chao Liu
2026-07-16 13:24 ` [PATCH 2/3] hw/riscv: Connect " Junze Cao
2026-07-22 20:08   ` Daniel Henrique Barboza
2026-07-23  8:42   ` Chao Liu
2026-07-16 13:24 ` [PATCH 3/3] tests/qtest: Add K230 DDR controller tests Junze Cao
2026-07-22 20:16   ` Daniel Henrique Barboza
2026-07-23  8:42   ` Chao Liu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260716132423.931427-1-caojunze424@gmail.com \
    --to=caojunze424@gmail.com \
    --cc=alistair.francis@wdc.com \
    --cc=chao.liu@processmission.com \
    --cc=daniel.barboza@oss.qualcomm.com \
    --cc=farosas@suse.de \
    --cc=liwei1518@gmail.com \
    --cc=lvivier@redhat.com \
    --cc=palmer@dabbelt.com \
    --cc=pbonzini@redhat.com \
    --cc=pierrick.bouvier@oss.qualcomm.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-riscv@nongnu.org \
    --cc=zhiwei_liu@linux.alibaba.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.