Skip to content

Add set/get_tpm_mode host command#225

Open
aranikam wants to merge 2 commits intomainfrom
tpm
Open

Add set/get_tpm_mode host command#225
aranikam wants to merge 2 commits intomainfrom
tpm

Conversation

@aranikam
Copy link
Collaborator

@aranikam aranikam commented Mar 3, 2026

Add set/get TPM host command

uint8_t reserved[3];
} __attribute__((packed, aligned(4)));

#define EC_PRV_CMD_HAVEN_SET_TPM_MODE 0x0051
Copy link
Collaborator

Choose a reason for hiding this comment

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

I see that the current structure with protocols in protocol directory has the host command definitions for the protocol in specific header files. See

#define HOTH_PRV_CMD_HOTH_SET_AUTHZ_RECORD 0x0017
,
#define HOTH_PRV_CMD_HOTH_PAYLOAD_UPDATE 0x0005
, etc.

Even though I prefer a centralized list of host command and structures here, I would like the code to be consistent. Would it be a good idea to move this inside the htool_tpm.h?

.func = htool_get_tpm_mode,
},
{
.verbs = (const char*[]){"tpm", "set_mode", "disabled", NULL},
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: Would it be a good idea to make the argument (disabled, tpm_spi, spi_nor_mailbox) to set_mode be a param?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Would it be a good idea to move parts of this file (which call the host command and process the response, given a device) and corresponding header file inside protocol/ directory?

@@ -0,0 +1,88 @@
// Copyright 2025 Google LLC
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: 2026

@@ -0,0 +1,31 @@
// Copyright 2025 Google LLC
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: 2026

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.

2 participants