Fix compilation with CONFIG_DEBUG_SPI_FLASH enabled

Right now coreboot compilation fails when SPI flash debugging is
enabled. Fix it by using the right set of memory functions.

Change-Id: I5e372c4a5df53b4d46aaed9e251e5205ff68cb5b
Signed-off-by: Stefan Reinauer <reinauer@google.com>
Reviewed-on: http://review.coreboot.org/1044
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <patrick@georgi-clan.de>
This commit is contained in:
Stefan Reinauer 2012-05-22 15:24:51 -07:00 committed by Patrick Georgi
parent 71695d8a28
commit 14b23a6ca6
2 changed files with 6 additions and 7 deletions

View File

@ -264,7 +264,6 @@ struct spi_flash *spi_flash_probe(unsigned int bus, unsigned int cs,
#if CONFIG_DEBUG_SPI_FLASH #if CONFIG_DEBUG_SPI_FLASH
printk(BIOS_SPEW, "SF: Got idcodes\n"); printk(BIOS_SPEW, "SF: Got idcodes\n");
print_buffer(0, idcode, 1, sizeof(idcode), 0);
#endif #endif
/* count the number of continuation bytes */ /* count the number of continuation bytes */

View File

@ -162,7 +162,7 @@ enum {
static u8 readb_(const void *addr) static u8 readb_(const void *addr)
{ {
u8 v = readb(addr); u8 v = read8((unsigned long)addr);
printk(BIOS_DEBUG, "read %2.2x from %4.4x\n", printk(BIOS_DEBUG, "read %2.2x from %4.4x\n",
v, ((unsigned) addr & 0xffff) - 0xf020); v, ((unsigned) addr & 0xffff) - 0xf020);
return v; return v;
@ -170,7 +170,7 @@ static u8 readb_(const void *addr)
static u16 readw_(const void *addr) static u16 readw_(const void *addr)
{ {
u16 v = readw(addr); u16 v = read16((unsigned long)addr);
printk(BIOS_DEBUG, "read %4.4x from %4.4x\n", printk(BIOS_DEBUG, "read %4.4x from %4.4x\n",
v, ((unsigned) addr & 0xffff) - 0xf020); v, ((unsigned) addr & 0xffff) - 0xf020);
return v; return v;
@ -178,7 +178,7 @@ static u16 readw_(const void *addr)
static u32 readl_(const void *addr) static u32 readl_(const void *addr)
{ {
u32 v = readl(addr); u32 v = read32((unsigned long)addr);
printk(BIOS_DEBUG, "read %8.8x from %4.4x\n", printk(BIOS_DEBUG, "read %8.8x from %4.4x\n",
v, ((unsigned) addr & 0xffff) - 0xf020); v, ((unsigned) addr & 0xffff) - 0xf020);
return v; return v;
@ -186,21 +186,21 @@ static u32 readl_(const void *addr)
static void writeb_(u8 b, const void *addr) static void writeb_(u8 b, const void *addr)
{ {
writeb(b, addr); write8((unsigned long)addr, b);
printk(BIOS_DEBUG, "wrote %2.2x to %4.4x\n", printk(BIOS_DEBUG, "wrote %2.2x to %4.4x\n",
b, ((unsigned) addr & 0xffff) - 0xf020); b, ((unsigned) addr & 0xffff) - 0xf020);
} }
static void writew_(u16 b, const void *addr) static void writew_(u16 b, const void *addr)
{ {
writew(b, addr); write16((unsigned long)addr, b);
printk(BIOS_DEBUG, "wrote %4.4x to %4.4x\n", printk(BIOS_DEBUG, "wrote %4.4x to %4.4x\n",
b, ((unsigned) addr & 0xffff) - 0xf020); b, ((unsigned) addr & 0xffff) - 0xf020);
} }
static void writel_(u32 b, const void *addr) static void writel_(u32 b, const void *addr)
{ {
writel(b, addr); write32((unsigned long)addr, b);
printk(BIOS_DEBUG, "wrote %8.8x to %4.4x\n", printk(BIOS_DEBUG, "wrote %8.8x to %4.4x\n",
b, ((unsigned) addr & 0xffff) - 0xf020); b, ((unsigned) addr & 0xffff) - 0xf020);
} }