Patrick Rudolph has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/48453 )
Change subject: drivers/crb/tpm: Fix compilation on x86_64 ......................................................................
drivers/crb/tpm: Fix compilation on x86_64
Change-Id: I19cce90f44b54e4eb6dd8517793ae887f0bd1e22 Signed-off-by: Patrick Rudolph patrick.rudolph@9elements.com --- M src/drivers/crb/tpm.c M src/drivers/crb/tpm.h 2 files changed, 4 insertions(+), 3 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/53/48453/1
diff --git a/src/drivers/crb/tpm.c b/src/drivers/crb/tpm.c index 476b62b..fcefe96 100644 --- a/src/drivers/crb/tpm.c +++ b/src/drivers/crb/tpm.c @@ -43,10 +43,11 @@ control_area.cancel = read32(CRB_REG(cur_loc, CRB_REG_CANCEL)); control_area.interrupt_control = read64(CRB_REG(cur_loc, CRB_REG_INT_CTRL)); control_area.command_size = read32(CRB_REG(cur_loc, CRB_REG_CMD_SIZE)); - control_area.command_bfr = (void *)(uint32_t)read64(CRB_REG(cur_loc, CRB_REG_CMD_ADDR)); + control_area.command_bfr = + (void *)(uintptr_t)read64(CRB_REG(cur_loc, CRB_REG_CMD_ADDR)); control_area.response_size = read32(CRB_REG(cur_loc, CRB_REG_RESP_SIZE)); control_area.response_bfr = - (void *)(uint32_t)read64(CRB_REG(cur_loc, CRB_REG_RESP_ADDR)); + (void *)(uintptr_t)read64(CRB_REG(cur_loc, CRB_REG_RESP_ADDR)); }
/* Wait for Reg to be expected Value */ diff --git a/src/drivers/crb/tpm.h b/src/drivers/crb/tpm.h index 0d68384..c43beb6 100644 --- a/src/drivers/crb/tpm.h +++ b/src/drivers/crb/tpm.h @@ -6,7 +6,7 @@ #define TPM_CRB_BASE_ADDRESS CONFIG_CRB_TPM_BASE_ADDRESS
#define CRB_REG(LOCTY, REG) \ - (void *)(CONFIG_CRB_TPM_BASE_ADDRESS + (LOCTY << 12) + REG) + (void *)(uintptr_t)(CONFIG_CRB_TPM_BASE_ADDRESS + (LOCTY << 12) + REG)
/* hardware registers */ #define CRB_REG_LOC_STATE 0x00
Arthur Heymans has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/48453 )
Change subject: drivers/crb/tpm: Fix compilation on x86_64 ......................................................................
Patch Set 1: Code-Review+2
Patrick Rudolph has submitted this change. ( https://review.coreboot.org/c/coreboot/+/48453 )
Change subject: drivers/crb/tpm: Fix compilation on x86_64 ......................................................................
drivers/crb/tpm: Fix compilation on x86_64
Change-Id: I19cce90f44b54e4eb6dd8517793ae887f0bd1e22 Signed-off-by: Patrick Rudolph patrick.rudolph@9elements.com Reviewed-on: https://review.coreboot.org/c/coreboot/+/48453 Tested-by: build bot (Jenkins) no-reply@coreboot.org Reviewed-by: Arthur Heymans arthur@aheymans.xyz --- M src/drivers/crb/tpm.c M src/drivers/crb/tpm.h 2 files changed, 4 insertions(+), 3 deletions(-)
Approvals: build bot (Jenkins): Verified Arthur Heymans: Looks good to me, approved
diff --git a/src/drivers/crb/tpm.c b/src/drivers/crb/tpm.c index 476b62b..fcefe96 100644 --- a/src/drivers/crb/tpm.c +++ b/src/drivers/crb/tpm.c @@ -43,10 +43,11 @@ control_area.cancel = read32(CRB_REG(cur_loc, CRB_REG_CANCEL)); control_area.interrupt_control = read64(CRB_REG(cur_loc, CRB_REG_INT_CTRL)); control_area.command_size = read32(CRB_REG(cur_loc, CRB_REG_CMD_SIZE)); - control_area.command_bfr = (void *)(uint32_t)read64(CRB_REG(cur_loc, CRB_REG_CMD_ADDR)); + control_area.command_bfr = + (void *)(uintptr_t)read64(CRB_REG(cur_loc, CRB_REG_CMD_ADDR)); control_area.response_size = read32(CRB_REG(cur_loc, CRB_REG_RESP_SIZE)); control_area.response_bfr = - (void *)(uint32_t)read64(CRB_REG(cur_loc, CRB_REG_RESP_ADDR)); + (void *)(uintptr_t)read64(CRB_REG(cur_loc, CRB_REG_RESP_ADDR)); }
/* Wait for Reg to be expected Value */ diff --git a/src/drivers/crb/tpm.h b/src/drivers/crb/tpm.h index 0d68384..c43beb6 100644 --- a/src/drivers/crb/tpm.h +++ b/src/drivers/crb/tpm.h @@ -6,7 +6,7 @@ #define TPM_CRB_BASE_ADDRESS CONFIG_CRB_TPM_BASE_ADDRESS
#define CRB_REG(LOCTY, REG) \ - (void *)(CONFIG_CRB_TPM_BASE_ADDRESS + (LOCTY << 12) + REG) + (void *)(uintptr_t)(CONFIG_CRB_TPM_BASE_ADDRESS + (LOCTY << 12) + REG)
/* hardware registers */ #define CRB_REG_LOC_STATE 0x00