From: Ilias Apalodimas <ilias.apalodimas@linaro.org>
To: Simon Glass <sjg@chromium.org>
Cc: u-boot@lists.denx.de, trini@konsulko.com,
Rick Chen <rick@andestech.com>, Sean Anderson <seanga2@gmail.com>,
Heinrich Schuchardt <xypron.glpk@gmx.de>,
Masahisa Kojima <masahisa.kojima@linaro.org>
Subject: Re: [PATCH 2/6 v4] tpm2: Add a TPMv2 MMIO TIS driver
Date: Fri, 5 Nov 2021 10:17:21 +0200 [thread overview]
Message-ID: <YYTokflM1yszqoxD@apalos.home> (raw)
In-Reply-To: <CAPnjgZ1kWfOUFC9ytSrDQ112rnJ-67X_CELX+Goqj7Roon+c9Q@mail.gmail.com>
Hi Simon,
[...]
> > + u8 *result)
> > +{
> > + struct tpm_tis_chip_data *drv_data = (void *)dev_get_driver_data(udev);
> > +
> > + while (len--)
> > + *result++ = ioread8(drv_data->iobase + addr);
> > + return 0;
> > +}
> > +
> > +static int mmio_write_bytes(struct udevice *udev, u32 addr, u16 len,
> > + const u8 *value)
> > +{
> > + struct tpm_tis_chip_data *drv_data = (void *)dev_get_driver_data(udev);
> > +
> > + while (len--)
> > + iowrite8(*value++, drv_data->iobase + addr);
>
> So should this use regmap?
>
Isn't the point of regmap abstracting the bus access itself? Something
along the lines of
******** ********** ***********
* SPI ** --> * * --> * SPI DM ** --> Device
******** * * ***********
* REGMAP *
******** * *
* MMIO * --> * * --> **************
******** ********** * MMIO access* --> Device
**************
Right now we have discrete drivers for the SPI and MMIO TPMs.
However using it makes sense if we want to merge parts of the SPI, MMIO and I2C
drivers in the future. That though is not what this patchset deals with.
Let's first clean up the crud of the TIS APIs duplication we've been
carrying over various TPM drivers and worry about consolidating the bus
accesses later.
Thanks
/Ilias
> > + return 0;
> > +}
> [..]
>
> Regards,
> Simon
next prev parent reply other threads:[~2021-11-05 8:17 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-03 15:09 [PATCH 0/6 v4] TPM cleanups and MMIO driver Ilias Apalodimas
2021-11-03 15:09 ` [PATCH 1/6 v4] tpm2: Introduce TIS tpm core Ilias Apalodimas
2021-11-05 2:02 ` Simon Glass
2021-11-05 7:01 ` Ilias Apalodimas
2021-11-05 16:12 ` Simon Glass
2021-11-03 15:09 ` [PATCH 2/6 v4] tpm2: Add a TPMv2 MMIO TIS driver Ilias Apalodimas
2021-11-05 2:02 ` Simon Glass
2021-11-05 8:17 ` Ilias Apalodimas [this message]
2021-11-05 8:23 ` Ilias Apalodimas
2021-11-05 16:12 ` Simon Glass
2021-11-03 15:09 ` [PATCH 3/6 v4] tpm: Use the new API on tpm2 spi driver Ilias Apalodimas
2021-11-05 2:02 ` Simon Glass
2021-11-03 15:09 ` [PATCH 4/6 v4] configs: Enable tpmv2 mmio on qemu for arm/arm64 Ilias Apalodimas
2021-11-05 2:02 ` Simon Glass
2021-11-03 15:09 ` [PATCH 5/6 v4] doc: qemu: Add instructions for swtpm usage Ilias Apalodimas
2021-11-05 2:02 ` Simon Glass
2021-11-03 15:09 ` [PATCH 6/6 v4] MAINTAINERS: Add entry for TPM drivers Ilias Apalodimas
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=YYTokflM1yszqoxD@apalos.home \
--to=ilias.apalodimas@linaro.org \
--cc=masahisa.kojima@linaro.org \
--cc=rick@andestech.com \
--cc=seanga2@gmail.com \
--cc=sjg@chromium.org \
--cc=trini@konsulko.com \
--cc=u-boot@lists.denx.de \
--cc=xypron.glpk@gmx.de \
/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