Date: Mon, 19 Jun 2023 11:57:43 -0700 From: Enji Cooper <yaneurabeya@gmail.com> To: Johannes Totz <jo@bruelltuete.com> Cc: FreeBSD Hackers <freebsd-hackers@FreeBSD.org> Subject: Re: tpm for AMD Ryzen Message-ID: <83976649-D24E-475C-9BA2-9922466062A9@gmail.com> In-Reply-To: <f328bc12-b889-2871-e509-0c8664d1c9b3@bruelltuete.com> References: <f328bc12-b889-2871-e509-0c8664d1c9b3@bruelltuete.com>
next in thread | previous in thread | raw e-mail | index | archive | help
--Apple-Mail=_F8AA46D4-6834-4B10-A42D-A3A12094CB0C Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On Jun 19, 2023, at 11:09 AM, Johannes Totz <jo@bruelltuete.com> = wrote: >=20 > Hi everyone, >=20 > I'm trying to get the (f)TPM that comes with AMD's Zen2 to work. > BIOS config screen says it's doing CRB mode. >=20 > So I start poking in tpm_crb.c = https://github.com/freebsd/freebsd-src/blob/main/sys/dev/tpm/tpm_crb.c >=20 > Out of the box, it does not attach. The TPM2 ACPI table says its start = method is 2 (aka ACPI). That's easy to hack around, just mess with the = if-condition at = https://github.com/freebsd/freebsd-src/blob/main/sys/dev/tpm/tpm_crb.c#L11= 5 >=20 > With that adjusted, tpmcrb now probes successfully but does not = attach. >=20 > As far as I can tell the register values it tries to read from the = ACPI-provided memory window are just bogus. >=20 > That makes me suspect that the BIOS has misconfigured it. The TPM2 = table has a different address than what's reported at runtime. > The table says 0xfd210510 is the (physical) address, but acpi says = it's 0xbd13f000. >=20 > Fiddling about with hint.tpmcrb.0.maddr and friends does not yield = anything fruitful: anything I try to override with hints is just = ignored. > Hacking in a > bus_set_resource(dev, SYS_RES_MEMORY, ... 0xfd210510 ...); > ends up giving me that override but still no dice re actual tpm = functionality. >=20 > Has anyone gotten the tpm to work on (consumer) Ryzen? Hi Johannes, I just built a Ryzen machine too with an ASUS Motherboard. Could = you please post the hack that you did to the if-else statement up on = gist so I can take a look at it? Also, if you can post "boot -v=E2=80=9D and =E2=80=9Cpciconf = -lv=E2=80=9D output to separate gists, that would be super helpful :). Cheers! -Enji --Apple-Mail=_F8AA46D4-6834-4B10-A42D-A3A12094CB0C Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEtvtxN6kOllEF3nmX5JFNMZeDGN4FAmSQpScACgkQ5JFNMZeD GN5h7hAApIkaGylnZ4rfBBe7LTD6kPPAz3TENin2Sk64tfR/KQMO9i4h2LhwvS2q 4yNobuABvSrL3tLiTRd21D+n29a9eztY1tfEZSn+y1GjCmOEXKqbcilBP1jkBJk1 RLRxTKR0BLx9P3M/hqcW3uQZt8r3v9mzuM8/i/IeQ3GE+ZZ2yY7CZyt7/0QpHQpE f7F4dYyEFW87z1lIxzUEEwgHnOyheboh+WAtyrNV44sKjzyjeQblMPIftjMSRV/u 04cEd4gueP/rCXCzg4lhA2BaUbW0qAIiwm6OCuOewOUrmiFmo7WbQesXI8auuZ5g rSww6Z6epfZr/GJm+kfGz3pyiXJvHQlO7LnS6uN0Dd6CCIrO+TnKh8ZAbGhbM9Rb Mfvr1xWE/Y1O1dvoxFh988gPBczNVSqzPFeaWDYbi7NhnasrPyE1Gkwb19kIXipe /KrarykzOLClG/fQ8kMmexAnrxFq7QqSALdl+l45e+TqoDu4DeJy+HF6BXKLsYfp 0oHhssyBtFsHLF/5ZCI2K26cKdWmq6VyrlzT+VzYbFAOjQPgJwxkKPm8aCA5pm/o 09Lmwp09dK0SsdHECMe1ZnuPgV6uY0+v+UaoJGVryJO5IRCcBfJDtFsQEtRR6tYB ADfhZSlUnHsU6NQk4JJkX0yuAPPQ0/TebSAXdtDXMkuRy2p1dzc= =5Vdc -----END PGP SIGNATURE----- --Apple-Mail=_F8AA46D4-6834-4B10-A42D-A3A12094CB0C--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?83976649-D24E-475C-9BA2-9922466062A9>