sb/intel/common/spi: Fix building for 64bit

This avoids the warning of casting pointers to integers of different
size.

Change-Id: I7bcb6dbf286438115c854d618eaa2da21c81400d
Signed-off-by: Arthur Heymans <arthur@aheymans.xyz>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/69389
Reviewed-by: Felix Singer <felixsinger@posteo.net>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Martin L Roth <gaumless@gmail.com>
This commit is contained in:
Arthur Heymans 2022-11-08 15:31:09 +01:00 committed by Martin L Roth
parent b5445ade38
commit d7fc0688e5
1 changed files with 12 additions and 12 deletions

View File

@ -157,8 +157,8 @@ static u8 readb_(const void *addr)
{ {
u8 v = read8(addr); u8 v = read8(addr);
printk(BIOS_DEBUG, "read %2.2x from %4.4x\n", printk(BIOS_DEBUG, "read %2.2x from %4.4lx\n",
v, ((unsigned int)addr & 0xffff) - 0xf020); v, ((uintptr_t)addr & 0xffff) - 0xf020);
return v; return v;
} }
@ -166,8 +166,8 @@ static u16 readw_(const void *addr)
{ {
u16 v = read16(addr); u16 v = read16(addr);
printk(BIOS_DEBUG, "read %4.4x from %4.4x\n", printk(BIOS_DEBUG, "read %4.4x from %4.4lx\n",
v, ((unsigned int)addr & 0xffff) - 0xf020); v, ((uintptr_t)addr & 0xffff) - 0xf020);
return v; return v;
} }
@ -175,30 +175,30 @@ static u32 readl_(const void *addr)
{ {
u32 v = read32(addr); u32 v = read32(addr);
printk(BIOS_DEBUG, "read %8.8x from %4.4x\n", printk(BIOS_DEBUG, "read %8.8x from %4.4lx\n",
v, ((unsigned int)addr & 0xffff) - 0xf020); v, ((uintptr_t)addr & 0xffff) - 0xf020);
return v; return v;
} }
static void writeb_(u8 b, void *addr) static void writeb_(u8 b, void *addr)
{ {
write8(addr, b); write8(addr, b);
printk(BIOS_DEBUG, "wrote %2.2x to %4.4x\n", printk(BIOS_DEBUG, "wrote %2.2x to %4.4lx\n",
b, ((unsigned int)addr & 0xffff) - 0xf020); b, ((uintptr_t)addr & 0xffff) - 0xf020);
} }
static void writew_(u16 b, void *addr) static void writew_(u16 b, void *addr)
{ {
write16(addr, b); write16(addr, b);
printk(BIOS_DEBUG, "wrote %4.4x to %4.4x\n", printk(BIOS_DEBUG, "wrote %4.4x to %4.4lx\n",
b, ((unsigned int)addr & 0xffff) - 0xf020); b, ((uintptr_t)addr & 0xffff) - 0xf020);
} }
static void writel_(u32 b, void *addr) static void writel_(u32 b, void *addr)
{ {
write32(addr, b); write32(addr, b);
printk(BIOS_DEBUG, "wrote %8.8x to %4.4x\n", printk(BIOS_DEBUG, "wrote %8.8x to %4.4lx\n",
b, ((unsigned int)addr & 0xffff) - 0xf020); b, ((uintptr_t)addr & 0xffff) - 0xf020);
} }
#else /* CONFIG_DEBUG_SPI_FLASH ^^^ enabled vvv NOT enabled */ #else /* CONFIG_DEBUG_SPI_FLASH ^^^ enabled vvv NOT enabled */