[PATCH RFC 1/3] tpm_crb: expand struct crb_control_area to struct crb_regs

2016-10-11 Thread Jarkko Sakkinen
In order to allow to use locality 0, expand the data structure to expose all of the CRB registers. The address is calculated from the control area address in order to retain backwards compatibility to ACPI start based hardware (pre-Skylake). Signed-off-by: Jarkko Sakkinen --- drivers/char/tpm/tp

Re: [tpmdd-devel] [PATCH RFC 1/3] tpm_crb: expand struct crb_control_area to struct crb_regs

2016-10-09 Thread Jarkko Sakkinen
st:TPM DEVICE DRIVER ; > > open list > > Subject: Re: [tpmdd-devel] [PATCH RFC 1/3] tpm_crb: expand struct > > crb_control_area to struct crb_regs > > > > On Sun, Oct 09, 2016 at 09:33:58PM +0300, Jarkko Sakkinen wrote: > > > > > > Sorry I missed this par

Re: [PATCH RFC 1/3] tpm_crb: expand struct crb_control_area to struct crb_regs

2016-10-09 Thread Jarkko Sakkinen
On Sun, Oct 09, 2016 at 05:07:37PM -0600, Jason Gunthorpe wrote: > On Sun, Oct 09, 2016 at 09:33:58PM +0300, Jarkko Sakkinen wrote: > > > > Sorry I missed this part. > > > > > > Here are the constraints for existing hardware: > > > > > > 1. All the existing CRB start only hardware has the iomem

Re: [tpmdd-devel] [PATCH RFC 1/3] tpm_crb: expand struct crb_control_area to struct crb_regs

2016-10-09 Thread Jason Gunthorpe
On Mon, Oct 10, 2016 at 12:25:11AM +, Winkler, Tomas wrote: > I addition I believe it should be always on offset FED4_0xxxh by the > Spec, so all this arithmetic is a bit of overkill. We don't have any hard coded addresses in the drivers - that seems very inappropriate these days.. Is that a

RE: [tpmdd-devel] [PATCH RFC 1/3] tpm_crb: expand struct crb_control_area to struct crb_regs

2016-10-09 Thread Winkler, Tomas
> -Original Message- > From: Jason Gunthorpe [mailto:jguntho...@obsidianresearch.com] > Sent: Monday, October 10, 2016 02:08 > To: Jarkko Sakkinen > Cc: moderated list:TPM DEVICE DRIVER ; > open list > Subject: Re: [tpmdd-devel] [PATCH RFC 1/3] tpm_crb: expand stru

Re: [PATCH RFC 1/3] tpm_crb: expand struct crb_control_area to struct crb_regs

2016-10-09 Thread Jason Gunthorpe
On Sun, Oct 09, 2016 at 09:33:58PM +0300, Jarkko Sakkinen wrote: > > Sorry I missed this part. > > > > Here are the constraints for existing hardware: > > > > 1. All the existing CRB start only hardware has the iomem covering the > >control area and registers for multiple localities. > > 2.

Re: [PATCH RFC 1/3] tpm_crb: expand struct crb_control_area to struct crb_regs

2016-10-09 Thread Jarkko Sakkinen
On Sun, Oct 09, 2016 at 09:32:32PM +0300, Jarkko Sakkinen wrote: > On Sun, Oct 09, 2016 at 10:49:05AM -0600, Jason Gunthorpe wrote: > > On Sun, Oct 09, 2016 at 12:38:18PM +0300, Jarkko Sakkinen wrote: > > > On Sat, Oct 08, 2016 at 07:42:56PM -0600, Jason Gunthorpe wrote: > > > > On Sun, Oct 09, 201

Re: [PATCH RFC 1/3] tpm_crb: expand struct crb_control_area to struct crb_regs

2016-10-09 Thread Jarkko Sakkinen
On Sun, Oct 09, 2016 at 10:49:05AM -0600, Jason Gunthorpe wrote: > On Sun, Oct 09, 2016 at 12:38:18PM +0300, Jarkko Sakkinen wrote: > > On Sat, Oct 08, 2016 at 07:42:56PM -0600, Jason Gunthorpe wrote: > > > On Sun, Oct 09, 2016 at 03:15:09AM +0300, Jarkko Sakkinen wrote: > > > > + ctrl = crb_

Re: [PATCH RFC 1/3] tpm_crb: expand struct crb_control_area to struct crb_regs

2016-10-09 Thread Jarkko Sakkinen
On Sun, Oct 09, 2016 at 10:49:05AM -0600, Jason Gunthorpe wrote: > On Sun, Oct 09, 2016 at 12:38:18PM +0300, Jarkko Sakkinen wrote: > > On Sat, Oct 08, 2016 at 07:42:56PM -0600, Jason Gunthorpe wrote: > > > On Sun, Oct 09, 2016 at 03:15:09AM +0300, Jarkko Sakkinen wrote: > > > > + ctrl = crb_

Re: [PATCH RFC 1/3] tpm_crb: expand struct crb_control_area to struct crb_regs

2016-10-09 Thread Jason Gunthorpe
On Sun, Oct 09, 2016 at 12:38:18PM +0300, Jarkko Sakkinen wrote: > On Sat, Oct 08, 2016 at 07:42:56PM -0600, Jason Gunthorpe wrote: > > On Sun, Oct 09, 2016 at 03:15:09AM +0300, Jarkko Sakkinen wrote: > > > + ctrl = crb_map_res(dev, priv, &io_res, buf->control_address, > > > +si

Re: [PATCH RFC 1/3] tpm_crb: expand struct crb_control_area to struct crb_regs

2016-10-09 Thread Jarkko Sakkinen
On Sat, Oct 08, 2016 at 07:42:56PM -0600, Jason Gunthorpe wrote: > On Sun, Oct 09, 2016 at 03:15:09AM +0300, Jarkko Sakkinen wrote: > > + ctrl = crb_map_res(dev, priv, &io_res, buf->control_address, > > + sizeof(struct crb_regs) - > > + offsetof(struct cr

Re: [PATCH RFC 1/3] tpm_crb: expand struct crb_control_area to struct crb_regs

2016-10-08 Thread Jason Gunthorpe
On Sun, Oct 09, 2016 at 03:15:09AM +0300, Jarkko Sakkinen wrote: > + ctrl = crb_map_res(dev, priv, &io_res, buf->control_address, > +sizeof(struct crb_regs) - > +offsetof(struct crb_regs, ctrl_req)); > + if (IS_ERR(ctrl)) > + retur

[PATCH RFC 1/3] tpm_crb: expand struct crb_control_area to struct crb_regs

2016-10-08 Thread Jarkko Sakkinen
In order to allow to use locality 0, expand the data structure to expose all of the CRB registers. The address is calculated from the control area address in order to retain backwards compatibility to ACPI start based hardware (pre-Skylake). Signed-off-by: Jarkko Sakkinen --- drivers/char/tpm/tp