the following patch was just integrated into master:
commit ac39da44d1f8b7af9d78347b541aaf45fc0c5fa5
Author: Martin Roth <martinroth(a)google.com>
Date: Fri Sep 2 11:09:05 2016 -0600
vendorcode/intel/Makefile.inc: Remove extraneous underscore
Commit e96543e1 (vendorcode/intel: Add UDK 2015 Bindings)
had an extra underscore at the end of one of the make lines that
we missed in the review. Remove it.
Fixes this build warning:
.../Makefile.inc:34: Extraneous text after `ifeq' directive
Change-Id: I0bc76d827207b4f641ac5ff08f540a114347533b
Signed-off-by: Martin Roth <martinroth(a)google.com>
Reviewed-on: https://review.coreboot.org/16411
Tested-by: build bot (Jenkins)
Reviewed-by: Paul Menzel <paulepanter(a)users.sourceforge.net>
Reviewed-by: Alexander Couzens <lynxis(a)fe80.eu>
Reviewed-by: Marshall Dawson <marshalldawson3rd(a)gmail.com>
Reviewed-by: Werner Zeh <werner.zeh(a)siemens.com>
See https://review.coreboot.org/16411 for details.
-gerrit
Werner Zeh (werner.zeh(a)siemens.com) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/16500
-gerrit
commit 6b2e1eb2d1bdcb934ae00fafcfed709360d97beb
Author: Werner Zeh <werner.zeh(a)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.
In addition switch to uint8_t and friends over u8 to sync up with used
types in this file.
Change-Id: I93ba7119873115c7abc80a214cc30363a6930b3b
Signed-off-by: Werner Zeh <werner.zeh(a)siemens.com>
---
src/soc/intel/fsp_broadwell_de/spi.c | 36 +++++++++++++++++++-----------------
1 file changed, 19 insertions(+), 17 deletions(-)
diff --git a/src/soc/intel/fsp_broadwell_de/spi.c b/src/soc/intel/fsp_broadwell_de/spi.c
index 57f7951..116001f 100644
--- a/src/soc/intel/fsp_broadwell_de/spi.c
+++ b/src/soc/intel/fsp_broadwell_de/spi.c
@@ -159,60 +159,62 @@ enum {
SPI_OPCODE_TYPE_WRITE_WITH_ADDRESS = 3
};
-static u8 readb_(const void *addr)
+#define SPI_OFFSET_MASK 0x3ff
+
+static uint8_t readb_(const void *addr)
{
- u8 v = read8(addr);
+ uint8_t 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, ((uint32_t) addr) & SPI_OFFSET_MASK);
}
return v;
}
-static u16 readw_(const void *addr)
+static uint16_t readw_(const void *addr)
{
- u16 v = read16(addr);
+ uint16_t 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, ((uint32_t) addr) & SPI_OFFSET_MASK);
}
return v;
}
-static u32 readl_(const void *addr)
+static uint32_t readl_(const void *addr)
{
- u32 v = read32(addr);
+ uint32_t 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, ((uint32_t) addr) & SPI_OFFSET_MASK);
}
return v;
}
-static void writeb_(u8 b, void *addr)
+static void writeb_(uint8_t 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, ((uint32_t) addr) & SPI_OFFSET_MASK);
}
}
-static void writew_(u16 b, void *addr)
+static void writew_(uint16_t 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, ((uint32_t) addr) & SPI_OFFSET_MASK);
}
}
-static void writel_(u32 b, void *addr)
+static void writel_(uint32_t 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, ((uint32_t) addr) & SPI_OFFSET_MASK);
}
}
@@ -457,10 +459,10 @@ static int spi_setup_offset(spi_transaction *trans)
*
* Return the last read status value on success or -1 on failure.
*/
-static int ich_status_poll(u16 bitmask, int wait_til_set)
+static int ich_status_poll(uint16_t bitmask, int wait_til_set)
{
int timeout = 40000; /* This will result in 400 ms */
- u16 status = 0;
+ uint16_t status = 0;
while (timeout--) {
status = readw_(cntlr.status);
Werner Zeh (werner.zeh(a)siemens.com) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/16499
-gerrit
commit 6738122862a4065f8845ea1507cb46aaad139943
Author: Werner Zeh <werner.zeh(a)siemens.com>
Date: Mon Sep 5 07:40:29 2016 +0200
fsp_baytrail: Refactor code for SPI debug messages
Use the config switch CONFIG_DEBUG_SPI_FLASH on compiler level rather
then on preprocessor level to ensure that the code is compiled even if
the switch is not selected. In addition the following two changes are
introduced:
1. Prepend the debug messages with 'SPI:' to make the output more
meaningful.
2. Change the address mask from 0xffff to 0x3ff and remove the subtraction
of the constant value 0xf020 in order to print only the register
offset within the SPI controller and avoid the visibility of any
fragments from SPI base address.
3. Switch to uint8_t and friends instead of u8 to sync up with other
code in the same file.
Change-Id: Iaf46f29a775039007a402fe862839df06a4cbfaa
Signed-off-by: Werner Zeh <werner.zeh(a)siemens.com>
---
src/soc/intel/fsp_baytrail/spi.c | 72 +++++++++++++++++++++-------------------
1 file changed, 37 insertions(+), 35 deletions(-)
diff --git a/src/soc/intel/fsp_baytrail/spi.c b/src/soc/intel/fsp_baytrail/spi.c
index 1b85fc5..374e7f6 100644
--- a/src/soc/intel/fsp_baytrail/spi.c
+++ b/src/soc/intel/fsp_baytrail/spi.c
@@ -1,6 +1,7 @@
/*
* Copyright (c) 2011 The Chromium OS Authors.
* Copyright (C) 2013-2014 Sage Electronic Engineering, LLC.
+ * 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,65 @@ enum {
SPI_OPCODE_TYPE_WRITE_WITH_ADDRESS = 3
};
-#if IS_ENABLED(CONFIG_DEBUG_SPI_FLASH)
+#define SPI_OFFSET_MASK 0x3ff
-static u8 readb_(const void *addr)
+static uint8_t readb_(const void *addr)
{
- u8 v = read8(addr);
- printk(BIOS_DEBUG, "read %2.2x from %4.4x\n",
- v, ((unsigned) addr & 0xffff) - 0xf020);
+ uint8_t v = read8(addr);
+ if (IS_ENABLED(CONFIG_DEBUG_SPI_FLASH)) {
+ printk(BIOS_DEBUG, "SPI: read %2.2x from %4.4x\n",
+ v, (((uint32_t) addr) & SPI_OFFSET_MASK));
+ }
return v;
}
-static u16 readw_(const void *addr)
+static uint16_t readw_(const void *addr)
{
- u16 v = read16(addr);
- printk(BIOS_DEBUG, "read %4.4x from %4.4x\n",
- v, ((unsigned) addr & 0xffff) - 0xf020);
+ uint16_t v = read16(addr);
+ if (IS_ENABLED(CONFIG_DEBUG_SPI_FLASH)) {
+ printk(BIOS_DEBUG, "SPI: read %4.4x from %4.4x\n",
+ v, (((uint32_t) addr) & SPI_OFFSET_MASK));
+ }
return v;
}
-static u32 readl_(const void *addr)
+static uint32_t readl_(const void *addr)
{
- u32 v = read32(addr);
- printk(BIOS_DEBUG, "read %8.8x from %4.4x\n",
- v, ((unsigned) addr & 0xffff) - 0xf020);
+ uint32_t v = read32(addr);
+ if (IS_ENABLED(CONFIG_DEBUG_SPI_FLASH)) {
+ printk(BIOS_DEBUG, "SPI: read %8.8x from %4.4x\n",
+ v, (((uint32_t) addr) & SPI_OFFSET_MASK));
+ }
return v;
}
-static void writeb_(u8 b, void *addr)
+static void writeb_(uint8_t 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, (((uint32_t) addr) & SPI_OFFSET_MASK));
+ }
}
-static void writew_(u16 b, void *addr)
+static void writew_(uint16_t 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, (((uint32_t) addr) & SPI_OFFSET_MASK));
+ }
}
-static void writel_(u32 b, void *addr)
+static void writel_(uint32_t 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, (((uint32_t) addr) & SPI_OFFSET_MASK));
+ }
}
-#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;
@@ -441,10 +443,10 @@ static int spi_setup_offset(spi_transaction *trans)
*
* Return the last read status value on success or -1 on failure.
*/
-static int ich_status_poll(u16 bitmask, int wait_til_set)
+static int ich_status_poll(uint16_t bitmask, int wait_til_set)
{
int timeout = 40000; /* This will result in 400 ms */
- u16 status = 0;
+ uint16_t status = 0;
while (timeout--) {
status = readw_(cntlr.status);
Aaron Durbin (adurbin(a)chromium.org) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/16431
-gerrit
commit 26732019a871a695722ee475f44d795787fbe7d0
Author: Aaron Durbin <adurbin(a)chromium.org>
Date: Fri Sep 2 20:19:59 2016 -0500
mainboard/google/reef: add baseboard nhlt configuration
Move the current NHLT configuration implementation to the baseboard
area such that other variants can leverage it or provide their
own configuration.
BUG=chrome-os-partner:56677
Change-Id: If0d48cacdc793492e1618d0eda02a149e33f0650
Signed-off-by: Aaron Durbin <adurbin(a)chromium.org>
---
src/mainboard/google/reef/mainboard.c | 15 +--------
.../google/reef/variants/baseboard/Makefile.inc | 1 +
.../baseboard/include/baseboard/variants.h | 4 +++
.../google/reef/variants/baseboard/nhlt.c | 37 ++++++++++++++++++++++
4 files changed, 43 insertions(+), 14 deletions(-)
diff --git a/src/mainboard/google/reef/mainboard.c b/src/mainboard/google/reef/mainboard.c
index a2421df..016c9ac 100644
--- a/src/mainboard/google/reef/mainboard.c
+++ b/src/mainboard/google/reef/mainboard.c
@@ -56,20 +56,7 @@ static unsigned long mainboard_write_acpi_tables(
if (nhlt == NULL)
return start_addr;
- /* 2 Channel DMIC array. */
- if (!nhlt_soc_add_dmic_array(nhlt, 2))
- printk(BIOS_ERR, "Added 2CH DMIC array.\n");
-
- /* Dialog for Headset codec.
- * Headset codec is bi-directional but uses the same configuration
- * settings for render and capture endpoints.
- */
- if (!nhlt_soc_add_da7219(nhlt, AUDIO_LINK_SSP1))
- printk(BIOS_ERR, "Added Dialog_7219 codec.\n");
-
- /* MAXIM Smart Amps for left and right speakers. */
- if (!nhlt_soc_add_max98357(nhlt, AUDIO_LINK_SSP5))
- printk(BIOS_ERR, "Added Maxim_98357 codec.\n");
+ variant_nhlt_init(nhlt);
end_addr = nhlt_soc_serialize(nhlt, start_addr);
diff --git a/src/mainboard/google/reef/variants/baseboard/Makefile.inc b/src/mainboard/google/reef/variants/baseboard/Makefile.inc
index f024c2a..d2d344c 100644
--- a/src/mainboard/google/reef/variants/baseboard/Makefile.inc
+++ b/src/mainboard/google/reef/variants/baseboard/Makefile.inc
@@ -5,5 +5,6 @@ romstage-y += memory.c
ramstage-y += boardid.c
ramstage-y += gpio.c
+ramstage-y += nhlt.c
smm-y += gpio.c
diff --git a/src/mainboard/google/reef/variants/baseboard/include/baseboard/variants.h b/src/mainboard/google/reef/variants/baseboard/include/baseboard/variants.h
index 84e6a30..9f2ed06 100644
--- a/src/mainboard/google/reef/variants/baseboard/include/baseboard/variants.h
+++ b/src/mainboard/google/reef/variants/baseboard/include/baseboard/variants.h
@@ -40,4 +40,8 @@ size_t variant_memory_sku(void);
/* Return ChromeOS gpio table and fill in number of entries. */
const struct cros_gpio *variant_cros_gpios(size_t *num);
+/* Seed the NHLT tables with the board specific information. */
+struct nhlt;
+void variant_nhlt_init(struct nhlt *nhlt);
+
#endif /* BASEBOARD_VARIANTS_H */
diff --git a/src/mainboard/google/reef/variants/baseboard/nhlt.c b/src/mainboard/google/reef/variants/baseboard/nhlt.c
new file mode 100644
index 0000000..ef9ec6c
--- /dev/null
+++ b/src/mainboard/google/reef/variants/baseboard/nhlt.c
@@ -0,0 +1,37 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright 2016 Google Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ */
+
+#include <baseboard/variants.h>
+#include <console/console.h>
+#include <nhlt.h>
+#include <soc/nhlt.h>
+
+void __attribute__((weak)) variant_nhlt_init(struct nhlt *nhlt)
+{
+ /* 2 Channel DMIC array. */
+ if (!nhlt_soc_add_dmic_array(nhlt, 2))
+ printk(BIOS_ERR, "Added 2CH DMIC array.\n");
+
+ /* Dialog for Headset codec.
+ * Headset codec is bi-directional but uses the same configuration
+ * settings for render and capture endpoints.
+ */
+ if (!nhlt_soc_add_da7219(nhlt, AUDIO_LINK_SSP1))
+ printk(BIOS_ERR, "Added Dialog_7219 codec.\n");
+
+ /* MAXIM Smart Amps for left and right speakers. */
+ if (!nhlt_soc_add_max98357(nhlt, AUDIO_LINK_SSP5))
+ printk(BIOS_ERR, "Added Maxim_98357 codec.\n");
+}
Aaron Durbin (adurbin(a)chromium.org) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/16432
-gerrit
commit 4d457c9e490947dc10f6d8c5dd8719bad4db4f88
Author: Aaron Durbin <adurbin(a)chromium.org>
Date: Fri Sep 2 20:29:39 2016 -0500
mainboard/google/reef: drop remaining proto board references
The last vestige of the proto boards is the memory sku id
gpios. No need for performing the memory sku read with pullups
because all current and future boards don't have floating pins.
BUG=chrome-os-partner:56791
Change-Id: I04d541a897ec9aacbf2011293d18242fa32896d2
Signed-off-by: Aaron Durbin <adurbin(a)chromium.org>
---
.../variants/baseboard/include/baseboard/gpio.h | 6 +-----
.../google/reef/variants/baseboard/memory.c | 21 +--------------------
2 files changed, 2 insertions(+), 25 deletions(-)
diff --git a/src/mainboard/google/reef/variants/baseboard/include/baseboard/gpio.h b/src/mainboard/google/reef/variants/baseboard/include/baseboard/gpio.h
index 90cca36..f60bfdc 100644
--- a/src/mainboard/google/reef/variants/baseboard/include/baseboard/gpio.h
+++ b/src/mainboard/google/reef/variants/baseboard/include/baseboard/gpio.h
@@ -39,11 +39,7 @@
#define GPIO_PCH_WP GPIO_75
#define GPIO_EC_IN_RW GPIO_41
-/*
- * The proto boards didn't have memory SKU pins, but the same ones can be
- * utilized as post proto boards because the pins used were never connected
- * or no peripheral utilized the signals on proto boards.
- */
+/* Memory SKU GPIOs. */
#define MEM_CONFIG3 GPIO_45
#define MEM_CONFIG2 GPIO_38
#define MEM_CONFIG1 GPIO_102
diff --git a/src/mainboard/google/reef/variants/baseboard/memory.c b/src/mainboard/google/reef/variants/baseboard/memory.c
index a5b0364..b147253 100644
--- a/src/mainboard/google/reef/variants/baseboard/memory.c
+++ b/src/mainboard/google/reef/variants/baseboard/memory.c
@@ -62,14 +62,6 @@ const struct lpddr4_swizzle_cfg baseboard_lpddr4_swizzle = {
},
};
-/*
- * Proto boards didn't have a memory SKU id. The configuration pins use
- * an internal weak pullup with stronger pulldowns for the 0 bits. As
- * proto boards didn't use the memory SKU pins the SKU id reads as 4'b1111,
- * i.e. 15.
- */
-#define PROTO_SKU 15
-
static const struct lpddr4_sku skus[] = {
/*
* K4F6E304HB-MGCJ - both logical channels While the parts
@@ -133,13 +125,6 @@ static const struct lpddr4_sku skus[] = {
.ch1_rank_density = LP4_8Gb_DENSITY,
.part_num = "H9HCNNN8KUMLHR",
},
- /* K4F8E304HB-MGCH - both logical channels */
- [PROTO_SKU] = {
- .speed = LP4_SPEED_2400,
- .ch0_rank_density = LP4_8Gb_DENSITY,
- .ch1_rank_density = LP4_8Gb_DENSITY,
- .part_num = "K4F8E304HB-MGCH",
- },
};
static const struct lpddr4_cfg lp4cfg = {
@@ -160,9 +145,5 @@ size_t __attribute__((weak)) variant_memory_sku(void)
[1] = MEM_CONFIG1, [0] = MEM_CONFIG0,
};
- /*
- * Read memory SKU id with internal pullups enabled to handle
- * proto boards with no SKU id pins.
- */
- return gpio_pullup_base2_value(pads, ARRAY_SIZE(pads));
+ return gpio_base2_value(pads, ARRAY_SIZE(pads));
}