Werner Zeh (werner.zeh(a)siemens.com) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/16347
-gerrit
commit 8649c4b9535d072743420e1a47a6420d349273cf
Author: Werner Zeh <werner.zeh(a)siemens.com>
Date: Mon Aug 29 08:00:50 2016 +0200
fsp_broadwell_de: Refactor code for SPI debug messages
Currently boards based on fsp_broadwell_de fail to compile if the config
switch CONFIG_DEBUG_SPI_FLASH is selected. The error is caused by the
usage of const for the address pointer in the functions writeb_, writew_
and writel_. The reason why it stayed hidden for so long is the fact that
the switch is used with the preprocessor and nobody really selects it
until there is a bug one want to find in this area.
This patch fixes the parameter type definition which solves the error.
In addition the config switch is not used on preprocessor level anymore
but instead on compiler level. This ensures that at least the code
syntax is checked on build time even if the config option is not
selected.
Change-Id: I3514b0d4c08bf5a4740f2632641e09af1b3aaf3a
Signed-off-by: Werner Zeh <werner.zeh(a)siemens.com>
---
src/soc/intel/fsp_broadwell_de/spi.c | 56 ++++++++++++++++++------------------
1 file changed, 28 insertions(+), 28 deletions(-)
diff --git a/src/soc/intel/fsp_broadwell_de/spi.c b/src/soc/intel/fsp_broadwell_de/spi.c
index f98ab97..57f7951 100644
--- a/src/soc/intel/fsp_broadwell_de/spi.c
+++ b/src/soc/intel/fsp_broadwell_de/spi.c
@@ -1,6 +1,7 @@
/*
* Copyright (c) 2013 Google Inc.
* Copyright (C) 2015-2016 Intel Corp.
+ * Copyright (C) 2016 Siemens AG
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
@@ -158,64 +159,63 @@ enum {
SPI_OPCODE_TYPE_WRITE_WITH_ADDRESS = 3
};
-#if IS_ENABLED(CONFIG_DEBUG_SPI_FLASH)
-
static u8 readb_(const void *addr)
{
u8 v = read8(addr);
- printk(BIOS_DEBUG, "read %2.2x from %4.4x\n",
- v, ((unsigned) addr & 0xffff) - 0xf020);
+ if (IS_ENABLED(CONFIG_DEBUG_SPI_FLASH)) {
+ printk(BIOS_DEBUG, "SPI: read %2.2x from %4.4x\n",
+ v, ((unsigned) addr & 0xffff) - 0xf020);
+ }
return v;
}
static u16 readw_(const void *addr)
{
u16 v = read16(addr);
- printk(BIOS_DEBUG, "read %4.4x from %4.4x\n",
- v, ((unsigned) addr & 0xffff) - 0xf020);
+ if (IS_ENABLED(CONFIG_DEBUG_SPI_FLASH)) {
+ printk(BIOS_DEBUG, "SPI: read %4.4x from %4.4x\n",
+ v, ((unsigned) addr & 0xffff) - 0xf020);
+ }
return v;
}
static u32 readl_(const void *addr)
{
u32 v = read32(addr);
- printk(BIOS_DEBUG, "read %8.8x from %4.4x\n",
- v, ((unsigned) addr & 0xffff) - 0xf020);
+ if (IS_ENABLED(CONFIG_DEBUG_SPI_FLASH)) {
+ printk(BIOS_DEBUG, "SPI: read %8.8x from %4.4x\n",
+ v, ((unsigned) addr & 0xffff) - 0xf020);
+ }
return v;
}
-static void writeb_(u8 b, const void *addr)
+static void writeb_(u8 b, void *addr)
{
write8(addr, b);
- printk(BIOS_DEBUG, "wrote %2.2x to %4.4x\n",
- b, ((unsigned) addr & 0xffff) - 0xf020);
+ if (IS_ENABLED(CONFIG_DEBUG_SPI_FLASH)) {
+ printk(BIOS_DEBUG, "SPI: wrote %2.2x to %4.4x\n",
+ b, ((unsigned) addr & 0xffff) - 0xf020);
+ }
}
-static void writew_(u16 b, const void *addr)
+static void writew_(u16 b, void *addr)
{
write16(addr, b);
- printk(BIOS_DEBUG, "wrote %4.4x to %4.4x\n",
- b, ((unsigned) addr & 0xffff) - 0xf020);
+ if (IS_ENABLED(CONFIG_DEBUG_SPI_FLASH)) {
+ printk(BIOS_DEBUG, "SPI: wrote %4.4x to %4.4x\n",
+ b, ((unsigned) addr & 0xffff) - 0xf020);
+ }
}
-static void writel_(u32 b, const void *addr)
+static void writel_(u32 b, void *addr)
{
write32(addr, b);
- printk(BIOS_DEBUG, "wrote %8.8x to %4.4x\n",
- b, ((unsigned) addr & 0xffff) - 0xf020);
+ if (IS_ENABLED(CONFIG_DEBUG_SPI_FLASH)) {
+ printk(BIOS_DEBUG, "SPI: wrote %8.8x to %4.4x\n",
+ b, ((unsigned) addr & 0xffff) - 0xf020);
+ }
}
-#else /* CONFIG_DEBUG_SPI_FLASH ^^^ enabled vvv NOT enabled */
-
-#define readb_(a) read8(a)
-#define readw_(a) read16(a)
-#define readl_(a) read32(a)
-#define writeb_(val, addr) write8(addr, val)
-#define writew_(val, addr) write16(addr, val)
-#define writel_(val, addr) write32(addr, val)
-
-#endif /* CONFIG_DEBUG_SPI_FLASH ^^^ NOT enabled */
-
static void write_reg(const void *value, void *dest, uint32_t size)
{
const uint8_t *bvalue = value;
HAOUAS Elyes (ehaouas(a)noos.fr) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/16343
-gerrit
commit 26011b600c55a12a65e655dcbab4d2cfb50a6bf3
Author: Elyes HAOUAS <ehaouas(a)noos.fr>
Date: Sun Aug 28 19:18:38 2016 +0200
soc/broadcom/cygnus/ddr_init.c: Correct typo in POWER ON and POWER OK.
Change-Id: I5b69a8429eb2f7add08bc134d5d2366a1afe6a4f
Signed-off-by: Elyes HAOUAS <ehaouas(a)noos.fr>
---
src/soc/broadcom/cygnus/ddr_init.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/soc/broadcom/cygnus/ddr_init.c b/src/soc/broadcom/cygnus/ddr_init.c
index 7fa2a56..7488750 100644
--- a/src/soc/broadcom/cygnus/ddr_init.c
+++ b/src/soc/broadcom/cygnus/ddr_init.c
@@ -317,14 +317,14 @@ int cygnus_phy_powerup(void)
if(reg32_read((volatile uint32_t *)CRMU_IHOST_POR_WAKEUP_FLAG)==0)
{
- /* Step 1: POWRON */
+ /* Step 1: POWER ON */
data = reg32_read((volatile uint32_t *)CRMU_DDR_PHY_AON_CTRL);
data |= 0x8;// assert power ON
reg32_write((volatile uint32_t *)CRMU_DDR_PHY_AON_CTRL, data);
__udelay(2);
- /* Step 2: POWROK */
+ /* Step 2: POWER OK */
data |= 0x10;// assert power OK
reg32_write((volatile uint32_t *)CRMU_DDR_PHY_AON_CTRL, data);
HAOUAS Elyes (ehaouas(a)noos.fr) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/16343
-gerrit
commit af29b0d4f2ab269d26b68131cdae5e8835886b4a
Author: Elyes HAOUAS <ehaouas(a)noos.fr>
Date: Sun Aug 28 19:18:38 2016 +0200
soc/broadcom/cygnus/ddr_init.c: Correct typo in POWER ON and OK.
Change-Id: I5b69a8429eb2f7add08bc134d5d2366a1afe6a4f
Signed-off-by: Elyes HAOUAS <ehaouas(a)noos.fr>
---
src/soc/broadcom/cygnus/ddr_init.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/soc/broadcom/cygnus/ddr_init.c b/src/soc/broadcom/cygnus/ddr_init.c
index 7fa2a56..7488750 100644
--- a/src/soc/broadcom/cygnus/ddr_init.c
+++ b/src/soc/broadcom/cygnus/ddr_init.c
@@ -317,14 +317,14 @@ int cygnus_phy_powerup(void)
if(reg32_read((volatile uint32_t *)CRMU_IHOST_POR_WAKEUP_FLAG)==0)
{
- /* Step 1: POWRON */
+ /* Step 1: POWER ON */
data = reg32_read((volatile uint32_t *)CRMU_DDR_PHY_AON_CTRL);
data |= 0x8;// assert power ON
reg32_write((volatile uint32_t *)CRMU_DDR_PHY_AON_CTRL, data);
__udelay(2);
- /* Step 2: POWROK */
+ /* Step 2: POWER OK */
data |= 0x10;// assert power OK
reg32_write((volatile uint32_t *)CRMU_DDR_PHY_AON_CTRL, data);
the following patch was just integrated into master:
commit dbf30678ee658fedca68a75277cd5c005d9833ef
Author: Elyes HAOUAS <ehaouas(a)noos.fr>
Date: Sun Aug 21 17:37:15 2016 +0200
src/arch: Add required space before opening parenthesis '('
Change-Id: I8a44a58506d7cf5ebc9fe7ac4f2b46f9544ba61a
Signed-off-by: Elyes HAOUAS <ehaouas(a)noos.fr>
Reviewed-on: https://review.coreboot.org/16287
Tested-by: build bot (Jenkins)
Reviewed-by: Omar Pakker
Reviewed-by: Martin Roth <martinroth(a)google.com>
See https://review.coreboot.org/16287 for details.
-gerrit