All of lore.kernel.org
 help / color / mirror / Atom feed
From: Klaus Jensen <its@irrelevant.dk>
To: qemu-devel@nongnu.org
Cc: "Andrew Jeffery" <andrew@aj.id.au>,
	"Keith Busch" <kbusch@kernel.org>,
	"Corey Minyard" <cminyard@mvista.com>,
	"Peter Delevoryas" <peter@pjd.dev>,
	qemu-arm@nongnu.org, "Peter Maydell" <peter.maydell@linaro.org>,
	qemu-block@nongnu.org, "Jeremy Kerr" <jk@codeconstruct.com.au>,
	"Joel Stanley" <joel@jms.id.au>,
	"Cédric Le Goater" <clg@kaod.org>,
	"Klaus Jensen" <its@irrelevant.dk>,
	"Klaus Jensen" <k.jensen@samsung.com>
Subject: [PATCH 0/3] hw/{i2c, nvme}: mctp endpoint, nvme management interface model
Date: Wed, 16 Nov 2022 09:43:09 +0100	[thread overview]
Message-ID: <20221116084312.35808-1-its@irrelevant.dk> (raw)

From: Klaus Jensen <k.jensen@samsung.com>

This adds a generic MCTP endpoint model that other devices may derive
from. I'm not 100% happy with the design of the class methods, but it's
a start.

Patch 1 is a bug fix, but since there are currently no in-tree users of
the API, it is not critical. I'd like to have Peter verify the fix with
his netdev code as well.

Also included is a very basic implementation of an NVMe-MI device,
supporting only a small subset of the required commands.

Since this all relies on i2c target mode, this can currently only be
used with an SoC that includes the Aspeed I2C controller.

The easiest way to get up and running with this, is to grab my buildroot
overlay[1]. It includes modified a modified dts as well as a couple of
required packages.

QEMU can then be launched along these lines:

  qemu-system-arm \
    -nographic \
    -M ast2600-evb \
    -kernel output/images/zImage \
    -initrd output/images/rootfs.cpio \
    -dtb output/images/aspeed-ast2600-evb-nmi.dtb \
    -nic user,hostfwd=tcp::2222-:22 \
    -device nmi-i2c,address=0x3a \
    -serial mon:stdio

From within the booted system,

  mctp addr add 8 dev mctpi2c15
  mctp link set mctpi2c15 up
  mctp route add 9 via mctpi2c15
  mctp neigh add 9 dev mctpi2c15 lladdr 0x3a
  mi-mctp 1 9 info

Comments are very welcome!

  [1]: https://github.com/birkelund/buildroots/tree/main/mctp-i2c

Klaus Jensen (3):
  hw/i2c: only schedule pending master when bus is idle
  hw/i2c: add mctp core
  hw/nvme: add nvme management interface model

 hw/arm/Kconfig         |   1 +
 hw/i2c/Kconfig         |   4 +
 hw/i2c/aspeed_i2c.c    |   2 +
 hw/i2c/core.c          |  37 ++--
 hw/i2c/mctp.c          | 365 +++++++++++++++++++++++++++++++++++++++
 hw/i2c/meson.build     |   1 +
 hw/i2c/trace-events    |  12 ++
 hw/nvme/meson.build    |   1 +
 hw/nvme/nmi-i2c.c      | 381 +++++++++++++++++++++++++++++++++++++++++
 hw/nvme/trace-events   |   6 +
 include/hw/i2c/i2c.h   |   2 +
 include/hw/i2c/mctp.h  |  83 +++++++++
 include/hw/misc/mctp.h |  43 +++++
 13 files changed, 923 insertions(+), 15 deletions(-)
 create mode 100644 hw/i2c/mctp.c
 create mode 100644 hw/nvme/nmi-i2c.c
 create mode 100644 include/hw/i2c/mctp.h
 create mode 100644 include/hw/misc/mctp.h

-- 
2.38.1



             reply	other threads:[~2022-11-16  8:43 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-16  8:43 Klaus Jensen [this message]
2022-11-16  8:43 ` [PATCH maybe-7.2 1/3] hw/i2c: only schedule pending master when bus is idle Klaus Jensen
2022-11-16 13:16   ` Peter Maydell
2022-11-16 13:43   ` Corey Minyard
2022-11-16 15:58   ` Cédric Le Goater
2022-11-17  6:40     ` Klaus Jensen
2022-11-17  6:56       ` Cédric Le Goater
2022-11-17  7:37         ` Klaus Jensen
2022-11-17  8:01           ` Cédric Le Goater
2022-11-17 11:58             ` Klaus Jensen
2022-11-17 13:40               ` Cédric Le Goater
2022-11-18  6:59                 ` Klaus Jensen
2022-11-22  8:45                 ` Klaus Jensen
2022-11-16  8:43 ` [PATCH RFC 2/3] hw/i2c: add mctp core Klaus Jensen
2022-11-16 14:27   ` Corey Minyard
2022-11-17  6:51     ` Klaus Jensen
2022-11-18  5:56   ` Jeremy Kerr
2022-11-18  6:15     ` Jeremy Kerr
2022-11-18  7:03       ` Klaus Jensen
2022-11-18  7:09         ` Jeremy Kerr
2022-11-18  7:01     ` Klaus Jensen
2022-11-21  8:04       ` Matt Johnston
2022-11-16  8:43 ` [PATCH RFC 3/3] hw/nvme: add nvme management interface model Klaus Jensen
2022-11-18  7:56   ` Philippe Mathieu-Daudé
2022-11-18  7:58     ` Klaus Jensen
2022-11-16  9:18 ` [PATCH 0/3] hw/{i2c,nvme}: mctp endpoint, " Jeremy Kerr

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=20221116084312.35808-1-its@irrelevant.dk \
    --to=its@irrelevant.dk \
    --cc=andrew@aj.id.au \
    --cc=clg@kaod.org \
    --cc=cminyard@mvista.com \
    --cc=jk@codeconstruct.com.au \
    --cc=joel@jms.id.au \
    --cc=k.jensen@samsung.com \
    --cc=kbusch@kernel.org \
    --cc=peter.maydell@linaro.org \
    --cc=peter@pjd.dev \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    /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.