[coreboot-gerrit] New patch to review for coreboot: fsp_broadwell_de: Adjust printed address in SPI debug messages

Werner Zeh (werner.zeh@siemens.com) gerrit at coreboot.org
Mon Sep 5 08:23:24 CEST 2016


Werner Zeh (werner.zeh at siemens.com) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/16500

-gerrit

commit 67d49207e2322500f83653c963f8b07a742358c9
Author: Werner Zeh <werner.zeh at siemens.com>
Date:   Mon Sep 5 08:14:23 2016 +0200

    fsp_broadwell_de: Adjust printed address in SPI debug messages
    
    For an unknown reason the printed address in the SPI debug messages is
    modified before it is printed by subtracting the constant 0xf020 from
    the passed in address.
    What I suppose this debug code should do is to print the used register
    address within the SPI controller while any parts of this address that
    belongs to the SPI base address should be omitted. To fix that remove
    the subtraction of 0xf020 and adjust the address mask to 0x3ff so that
    only the offset to the registers inside the SPI controller will be
    visible in the debug messages.
    
    Change-Id: I93ba7119873115c7abc80a214cc30363a6930b3b
    Signed-off-by: Werner Zeh <werner.zeh at siemens.com>
---
 src/soc/intel/fsp_broadwell_de/spi.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/soc/intel/fsp_broadwell_de/spi.c b/src/soc/intel/fsp_broadwell_de/spi.c
index 57f7951..fc2eee4 100644
--- a/src/soc/intel/fsp_broadwell_de/spi.c
+++ b/src/soc/intel/fsp_broadwell_de/spi.c
@@ -164,7 +164,7 @@ static u8 readb_(const void *addr)
 	u8 v = read8(addr);
 	if (IS_ENABLED(CONFIG_DEBUG_SPI_FLASH)) {
 		printk(BIOS_DEBUG, "SPI: read %2.2x from %4.4x\n",
-			v, ((unsigned) addr & 0xffff) - 0xf020);
+			v, (unsigned) addr & 0x3ff);
 	}
 	return v;
 }
@@ -174,7 +174,7 @@ static u16 readw_(const void *addr)
 	u16 v = read16(addr);
 	if (IS_ENABLED(CONFIG_DEBUG_SPI_FLASH)) {
 		printk(BIOS_DEBUG, "SPI: read %4.4x from %4.4x\n",
-			v, ((unsigned) addr & 0xffff) - 0xf020);
+			v, (unsigned) addr & 0x3ff);
 	}
 	return v;
 }
@@ -184,7 +184,7 @@ static u32 readl_(const void *addr)
 	u32 v = read32(addr);
 	if (IS_ENABLED(CONFIG_DEBUG_SPI_FLASH)) {
 		printk(BIOS_DEBUG, "SPI: read %8.8x from %4.4x\n",
-			v, ((unsigned) addr & 0xffff) - 0xf020);
+			v, (unsigned) addr & 0x3ff);
 	}
 	return v;
 }
@@ -194,7 +194,7 @@ static void writeb_(u8 b, void *addr)
 	write8(addr, b);
 	if (IS_ENABLED(CONFIG_DEBUG_SPI_FLASH)) {
 		printk(BIOS_DEBUG, "SPI: wrote %2.2x to %4.4x\n",
-			b, ((unsigned) addr & 0xffff) - 0xf020);
+			b, (unsigned) addr & 0x3ff);
 	}
 }
 
@@ -203,7 +203,7 @@ static void writew_(u16 b, void *addr)
 	write16(addr, b);
 	if (IS_ENABLED(CONFIG_DEBUG_SPI_FLASH)) {
 		printk(BIOS_DEBUG, "SPI: wrote %4.4x to %4.4x\n",
-			b, ((unsigned) addr & 0xffff) - 0xf020);
+			b, (unsigned) addr & 0x3ff);
 	}
 }
 
@@ -212,7 +212,7 @@ static void writel_(u32 b, void *addr)
 	write32(addr, b);
 	if (IS_ENABLED(CONFIG_DEBUG_SPI_FLASH)) {
 		printk(BIOS_DEBUG, "SPI: wrote %8.8x to %4.4x\n",
-			b, ((unsigned) addr & 0xffff) - 0xf020);
+			b, (unsigned) addr & 0x3ff);
 	}
 }
 



More information about the coreboot-gerrit mailing list