diff options
author | Appukuttan V K <appukuttan.vk@intel.com> | 2024-05-17 14:29:18 +0530 |
---|---|---|
committer | Lean Sheng Tan <sheng.tan@9elements.com> | 2024-05-31 20:36:45 +0000 |
commit | c097c4788b4d9e770327193d26ea708f315d8307 (patch) | |
tree | 037fefaa38ac40eec80c67a91f01fb206d777afe /src/soc/intel/common/block/crashlog | |
parent | 1f97d801ce5a0908bbe6adaf4c4b7f656d40a198 (diff) |
soc/intel: Fix pointer size mismatch errors in crashlog
The crashlog code in intel/common/block and meteorlake soc
was casting integer addresses directly to pointer types,
which caused compilation errors in x86_64 bit builds.
This commit fixes the issue by using uintptr_t for casting
integer addresses to pointer types before dereferencing.
BUG=b:329034258
TEST=Successfully build Meteor Lake (rex) in both x86_32 and
x86_64 modes.
Change-Id: I2d0814a8b767270ec140341bfb51d0782469545d
Signed-off-by: Appukuttan V K <appukuttan.vk@intel.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/82481
Reviewed-by: Subrata Banik <subratabanik@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Eric Lai <ericllai@google.com>
Reviewed-by: Dinesh Gehlot <digehlot@google.com>
Reviewed-by: Kapil Porwal <kapilporwal@google.com>
Diffstat (limited to 'src/soc/intel/common/block/crashlog')
-rw-r--r-- | src/soc/intel/common/block/crashlog/crashlog.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/soc/intel/common/block/crashlog/crashlog.c b/src/soc/intel/common/block/crashlog/crashlog.c index a9ac8a530e..d92d7bc69b 100644 --- a/src/soc/intel/common/block/crashlog/crashlog.c +++ b/src/soc/intel/common/block/crashlog/crashlog.c @@ -112,7 +112,7 @@ int cpu_cl_poll_mailbox_ready(u32 cl_mailbox_addr) u16 stall_cnt = 0; do { - cl_mailbox_interface.data = read32((u32 *)cl_mailbox_addr); + cl_mailbox_interface.data = read32((u32 *)(uintptr_t)cl_mailbox_addr); udelay(CPU_CRASHLOG_WAIT_STALL); stall_cnt++; } while ((cl_mailbox_interface.fields.busy == 1) @@ -140,7 +140,7 @@ int cpu_cl_mailbox_cmd(u8 cmd, u8 param) cl_mailbox_intf.fields.param = param; cl_mailbox_intf.fields.busy = 1; - write32((u32 *)(cl_base_addr + cl_get_cpu_mb_int_addr()), + write32((u32 *)(uintptr_t)(cl_base_addr + cl_get_cpu_mb_int_addr()), cl_mailbox_intf.data); cpu_cl_poll_mailbox_ready(cl_base_addr + cl_get_cpu_mb_int_addr()); @@ -167,7 +167,7 @@ int pmc_cl_gen_descriptor_table(u32 desc_table_addr, pmc_crashlog_desc_table_t *descriptor_table) { int total_data_size = 0; - descriptor_table->numb_regions = read32((u32 *)desc_table_addr); + descriptor_table->numb_regions = read32((u32 *)(uintptr_t)desc_table_addr); printk(BIOS_DEBUG, "CL PMC desc table: numb of regions is 0x%x at addr 0x%x\n", descriptor_table->numb_regions, desc_table_addr); for (int i = 0; i < descriptor_table->numb_regions; i++) { @@ -178,7 +178,7 @@ int pmc_cl_gen_descriptor_table(u32 desc_table_addr, break; } desc_table_addr += 4; - descriptor_table->regions[i].data = read32((u32 *)(desc_table_addr)); + descriptor_table->regions[i].data = read32((u32 *)(uintptr_t)(desc_table_addr)); total_data_size += descriptor_table->regions[i].bits.size * sizeof(u32); printk(BIOS_DEBUG, "CL PMC desc table: region 0x%x has size 0x%x at offset 0x%x\n", i, descriptor_table->regions[i].bits.size, @@ -295,7 +295,7 @@ bool cl_copy_data_from_sram(u32 src_bar, u32 src_addr = src_bar + offset; - u32 data = read32((u32 *)src_addr); + u32 data = read32((u32 *)(uintptr_t)src_addr); /* First 32bits of the record must not be 0xdeadbeef */ if (data == INVALID_CRASHLOG_RECORD) { @@ -320,7 +320,7 @@ bool cl_copy_data_from_sram(u32 src_bar, u32 copied = 0; while (copied < size) { /* DW by DW copy: byte access to PMC SRAM not allowed */ - *dest_addr = read32((u32 *)src_addr); + *dest_addr = read32((u32 *)(uintptr_t)src_addr); dest_addr++; src_addr += 4; copied++; |