From: Stefan Berger <stefanb@linux.ibm.com>
To: Ninad Palsule <ninad@linux.ibm.com>, qemu-devel@nongnu.org
Cc: joel@jms.id.au, andrew@aj.id.au, clg@kaod.org
Subject: Re: [PATCH 3/3] Add support for TPM devices over I2C bus
Date: Tue, 21 Mar 2023 21:30:03 -0400 [thread overview]
Message-ID: <2d32bfa7-0804-c046-bb8c-ca30d400ed4a@linux.ibm.com> (raw)
In-Reply-To: <20230321053001.3886666-4-ninad@linux.ibm.com>
On 3/21/23 01:30, Ninad Palsule wrote:
> Qemu already supports devices attached to ISA and sysbus. This drop adds
> support for the I2C bus attached TPM devices. I2C model only supports
> TPM2 protocol.
>
> +
> +/* Send data to TPM */
> +static inline void tpm_tis_i2c_tpm_send(TPMStateI2C *i2cst)
> +{
> + if ((i2cst->operation == OP_SEND) && (i2cst->offset > 1)) {
> + uint16_t tis_reg;
> + uint32_t data;
> + int i;
> +
> + tis_reg = tpm_tis_i2c_to_tis_reg(i2cst->data[0], &i2cst->size);
> +
> + /* Index 0 is always a register */
> + for (i = 1; i < i2cst->offset; i++) {
> + data = (i2cst->data[i] & 0xff);
> + tpm_tis_write_data(&i2cst->state, tis_reg, data, 1);
> + }
I think there should be tpm_tis_set_data_buffer function that you can call rather than transferring the data byte-by-byte.
Thanks for the series!
Stefan
next prev parent reply other threads:[~2023-03-22 1:31 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-21 5:29 [PATCH 0/3] Add support for TPM devices over I2C bus Ninad Palsule
2023-03-21 5:29 ` [PATCH 1/3] " Ninad Palsule
2023-03-21 23:35 ` Stefan Berger
2023-03-22 11:13 ` Ninad Palsule
2023-03-21 5:30 ` [PATCH 2/3] " Ninad Palsule
2023-03-21 23:54 ` Stefan Berger
2023-03-22 11:18 ` Ninad Palsule
2023-03-22 11:24 ` Stefan Berger
2023-03-22 16:56 ` Ninad Palsule
2023-03-22 12:05 ` Stefan Berger
2023-03-22 16:58 ` Ninad Palsule
2023-03-21 5:30 ` [PATCH 3/3] " Ninad Palsule
2023-03-22 1:10 ` Stefan Berger
2023-03-22 11:26 ` Ninad Palsule
2023-03-22 1:30 ` Stefan Berger [this message]
2023-03-22 11:28 ` Ninad Palsule
2023-03-22 11:50 ` Stefan Berger
2023-03-22 13:04 ` Stefan Berger
2023-03-23 0:43 ` Ninad Palsule
2023-03-22 17:01 ` Ninad Palsule
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=2d32bfa7-0804-c046-bb8c-ca30d400ed4a@linux.ibm.com \
--to=stefanb@linux.ibm.com \
--cc=andrew@aj.id.au \
--cc=clg@kaod.org \
--cc=joel@jms.id.au \
--cc=ninad@linux.ibm.com \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).