Skip to content

iq-x7181-evk / iq-x5121-evk: declare TPM2 machine feature#2367

Closed
khalidfaisal17 wants to merge 2 commits into
qualcomm-linux:masterfrom
khalidfaisal17:feature/tpm_fix_kodiak_ik
Closed

iq-x7181-evk / iq-x5121-evk: declare TPM2 machine feature#2367
khalidfaisal17 wants to merge 2 commits into
qualcomm-linux:masterfrom
khalidfaisal17:feature/tpm_fix_kodiak_ik

Conversation

@khalidfaisal17

@khalidfaisal17 khalidfaisal17 commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

Declare TPM2 as a supported machine feature for iq-x7181-evk and iq-x5121-evk.

This allows TPM-related packages to be conditionally included by
the distro without affecting platforms that do not provide TPM
hardware support.

@lumag lumag left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why isn't module autoloading working? Root cause the problem and fix it rather than working it around with the forced loading of the module.

@github-actions

github-actions Bot commented Jun 5, 2026

Copy link
Copy Markdown

Test run workflow

Test jobs for commit bca45d2

qcom-distro_linux-qcom-6.18
Pass: 139 | Fail: 2 | Total: 185
qcom-distro
Pass: 179 | Fail: 4 | Total: 242
nodistro
Pass: 9 | Fail: 0 | Total: 9

@test-reporting-app

Copy link
Copy Markdown

Test Results

  103 files    633 suites   9h 20m 55s ⏱️
  130 tests    80 ✅   0 💤  50 ❌
5 355 runs  5 086 ✅ 107 💤 162 ❌

For more details on these failures, see this check.

Results for commit bca45d2.

@ricardosalveti

Copy link
Copy Markdown
Contributor

This is a workaround, we need to root cause the issue.

@khalidfaisal17 khalidfaisal17 force-pushed the feature/tpm_fix_kodiak_ik branch from bca45d2 to 8669daa Compare June 8, 2026 11:45
@khalidfaisal17

Copy link
Copy Markdown
Contributor Author

updated the commit;

@lumag

lumag commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

With TCG_TIS_CORE=y, tpm_tis_spi.ko has no module dependency chain and depmod generates no modalias entry for it,

This is very suspiciout. Please post /sbin/modinfo tpm_tis_spi.ko.

@khalidfaisal17

Copy link
Copy Markdown
Contributor Author

With TCG_TIS_CORE=y, tpm_tis_spi.ko has no module dependency chain and depmod generates no modalias entry for it,

This is very suspiciout. Please post /sbin/modinfo tpm_tis_spi.ko.

root@rb3gen2-core-kit:\~# ls -la /dev/tpm*
crw------- 1 root root  10,   224 Mar 13  2026 /dev/tpm0
crw------- 1 root root 252, 65536 Mar 13  2026 /dev/tpmrm0
root@rb3gen2-core-kit:\~# /sbin/modinfo tpm_tis_spi.ko
modinfo: ERROR: Module tpm_tis_spi.ko not found.

modinfo: ERROR: Module tpm_tis_spi.ko not found.

@ndechesne

Copy link
Copy Markdown
Contributor

you need to post the output of this command when TIS_SPI is compiled as =m.

@khalidfaisal17

Copy link
Copy Markdown
Contributor Author

you need to post the output of this command when TIS_SPI is compiled as =m.

Hi @ndechesne , I see the same output here

root@rb3gen2-core-kit:\~# /sbin/modinfo tpm_tis_spi.ko
modinfo: ERROR: Module tpm_tis_spi.ko not found.

@lumag

lumag commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

you need to post the output of this command when TIS_SPI is compiled as =m.

Hi @ndechesne , I see the same output here

root@rb3gen2-core-kit:\~# /sbin/modinfo tpm_tis_spi.ko
modinfo: ERROR: Module tpm_tis_spi.ko not found.

/sbin/modinfo tpm_tis_spi.

@khalidfaisal17

khalidfaisal17 commented Jun 9, 2026

Copy link
Copy Markdown
Contributor Author

/sbin/modinfo tpm_tis_spi

  • Without current change
root@rb3gen2-core-kit:~# /sbin/modinfo tpm_tis_spi
filename:       /lib/modules/6.18.25-g6964936c9bfc-dirty/kernel/drivers/char/tpm/tpm_tis_spi.ko
license:        GPL
description:    TPM Driver for native SPI access
alias:          spi:cr50
alias:          spi:tpm_tis-spi
alias:          spi:tpm_tis_spi
alias:          spi:slb9670
alias:          spi:st33htpm-spi
alias:          spi:attpm20p
alias:          of:N*T*Cgoogle,cr50C*
alias:          of:N*T*Cgoogle,cr50
alias:          of:N*T*Ctcg,tpm_tis-spiC*
alias:          of:N*T*Ctcg,tpm_tis-spi
alias:          of:N*T*Cinfineon,slb9670C*
alias:          of:N*T*Cinfineon,slb9670
alias:          of:N*T*Cst,st33htpm-spiC*
alias:          of:N*T*Cst,st33htpm-spi
alias:          of:N*T*Catmel,attpm20pC*
alias:          of:N*T*Catmel,attpm20p
alias:          acpi*:SMO0768:*
depends:        tpm_tis_core
intree:         Y
name:           tpm_tis_spi
vermagic:       6.18.25-g6964936c9bfc-dirty SMP preempt mod_unload aarch64
root@rb3gen2-core-kit:~#
root@rb3gen2-core-kit:~# /sbin/modinfo tpm_tis_core
filename:       /lib/modules/6.18.25-g6964936c9bfc-dirty/kernel/drivers/char/tpm/tpm_tis_core.ko
license:        GPL
version:        2.0
description:    TPM Driver
author:         Leendert van Doorn <leendert@watson.ibm.com>
srcversion:     D59A9954E7183D60FDF9FE3
depends:
intree:         Y
name:           tpm_tis_core
vermagic:       6.18.25-g6964936c9bfc-dirty SMP preempt mod_unload aarch64
root@rb3gen2-core-kit:~#

  • With current change
root@rb3gen2-core-kit:~# ls -la /dev/tpm*
crw------- 1 root root  10,   224 Mar 13 15:35 /dev/tpm0
crw------- 1 root root 252, 65536 Mar 13 15:35 /dev/tpmrm0
root@rb3gen2-core-kit:~#
root@rb3gen2-core-kit:~# /sbin/modinfo tpm_tis_spi
name:           tpm_tis_spi
filename:       (builtin)
license:        GPL
file:           drivers/char/tpm/tpm_tis_spi
description:    TPM Driver for native SPI access
root@rb3gen2-core-kit:~#

Ideally, the TPM nodes are expected to be enabled and operational. Similar changes have already been implemented in IQ-9075 and IQ-8275. The key distinction is that RB3Gen2 supports multiple variants, with TPM functionality available only on the Industrial Kit configuration, which falls under RB3_CK. If this current change is not the solution, kindly suggest the direction, It would be quite helpful.

@lumag

lumag commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

alias: spi:cr50
alias: spi:tpm_tis-spi
alias: spi:tpm_tis_spi
alias: spi:slb9670
alias: spi:st33htpm-spi
alias: spi:attpm20p
alias: of:NTCgoogle,cr50C*
alias: of:NTCgoogle,cr50
alias: of:NTCtcg,tpm_tis-spiC*
alias: of:NTCtcg,tpm_tis-spi
alias: of:NTCinfineon,slb9670C*
alias: of:NTCinfineon,slb9670
alias: of:NTCst,st33htpm-spiC*
alias: of:NTCst,st33htpm-spi
alias: of:NTCatmel,attpm20pC*
alias: of:NTCatmel,attpm20p
alias: acpi*:SMO0768:*

So, it has aliases for all the devices it supports. Then no, the suggested change is not the right way to solve the issue. Please find the root cause, why udev doesn't try probing the module.

For the current patch it is a NAK.

Declare TPM2 as a supported machine featur for iq-x7181-evk.

This allows TPM-related packages to be conditionally included by
the distro without affecting platforms that do not provide TPM
hardware support.

Signed-off-by: Khalid Faisal Ansari <khalid.ansari@oss.qualcomm.com>
Declare TPM2 as a supported machine feature for iq-x5121-evk.

This allows TPM-related packages to be conditionally included by
the distro without affecting platforms that do not provide TPM
hardware support.

Signed-off-by: Khalid Faisal Ansari <khalid.ansari@oss.qualcomm.com>
@khalidfaisal17 khalidfaisal17 force-pushed the feature/tpm_fix_kodiak_ik branch from 8669daa to c97af0a Compare June 16, 2026 11:27
@github-actions

Copy link
Copy Markdown

Test run workflow

Test jobs for commit c97af0a

nodistro
Pass: 9 | Fail: 0 | Total: 9
qcom-distro_linux-qcom-6.18
Pass: 203 | Fail: 0 | Total: 246
qcom-distro
Pass: 248 | Fail: 0 | Total: 295

@ricardosalveti ricardosalveti changed the title linux-qcom: auto-load tpm_tis_spi for tpm2 iq-x7181-evk / iq-x5121-evk: declare TPM2 machine feature Jun 16, 2026
@ricardosalveti

Copy link
Copy Markdown
Contributor

Can you extend the commit message saying which tpm2 device is available in both targets?

@lumag lumag left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

machine featur

typo

iq-x7181-evk

Please use proper capitalisation.

Also please describe, which TPM chip is being used (or is it fTPM)?

@khalidfaisal17

Copy link
Copy Markdown
Contributor Author

Hi Reviewers.

This PR was initially submitted to address TPM-related issues on RB3Gen2. However, the changes were unintentionally overridden by a subsequent commit.

Closing this thread for now. I will revisit and restart this effort once the root cause is clearly identified.

Actual PR for Hamoa/Purwa TPM change: #2480

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants