the following patch was just integrated into master:
commit 2dd226a7134d953dfc6dd0b1f319519c2cb237e9
Author: Jagadish Krishnamoorthy <jagadish.krishnamoorthy(a)intel.com>
Date: Thu May 26 14:18:41 2016 -0700
intel/amenia: Configure unused Pads
Configure unused Pads as NC
and sort the pads according to the gpio community.
Move the pad configurations from mainboard to gpio.h
BUG=none
TEST=Boot to OS and check all functionalities.
Change-Id: I8e9eeebf5d75c71c521649c72612c06f3fa43701
Signed-off-by: Jagadish Krishnamoorthy <jagadish.krishnamoorthy(a)intel.com>
Reviewed-on: https://review.coreboot.org/15327
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin(a)chromium.org>
See https://review.coreboot.org/15327 for details.
-gerrit
Duncan Laurie (dlaurie(a)chromium.org) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/15291
-gerrit
commit 2281ccb0919561d1a4539c78a48d4d3b6a12325e
Author: Duncan Laurie <dlaurie(a)chromium.org>
Date: Tue Jun 21 10:41:19 2016 -0700
skylake: Generate ACPI for I2C devices
Have the Skylake SOC generate ACPI Devices for the enabled I2C
controllers instead of passing it in the DSDT with static timings.
The timing values are generated from the controller clock speed and
are more accurate than the hardcoded values that were in the ASL which
were originally copied from Broadwell where the controller is running
at a different clock speed...
Additionally it is now possible for a board to override the values
using devicetree.cb. If zero is passed in for SCL HCNT or LCNT then
the kernel will generate its own timing using the same formula, but if
the SDA hold time value is zero the kernel will NOT generate a correct
value and the SDA hold time may be incorrect.
The logic in the SSDT generator is a bit more complicated than I wanted
but the flexibility for board-level override is important as there may
be extra load on an I2C bus and a board may need to tune these values
to get stable I2C operation on that bus.
This was tested on the Chell platform to ensure all the I2C devices on
the board are still operational with these new timing values.
Change-Id: I4feb3df9e083592792f8fadd7105e081a984a906
Signed-off-by: Duncan Laurie <dlaurie(a)chromium.org>
---
src/soc/intel/skylake/acpi/serialio.asl | 55 ---------------------
src/soc/intel/skylake/chip.h | 3 ++
src/soc/intel/skylake/i2c.c | 84 +++++++++++++++++++++++++++++----
src/soc/intel/skylake/romstage/i2c.c | 14 +++++-
4 files changed, 90 insertions(+), 66 deletions(-)
diff --git a/src/soc/intel/skylake/acpi/serialio.asl b/src/soc/intel/skylake/acpi/serialio.asl
index f274be8..4f74320 100644
--- a/src/soc/intel/skylake/acpi/serialio.asl
+++ b/src/soc/intel/skylake/acpi/serialio.asl
@@ -16,61 +16,6 @@
/* Intel Serial IO Devices */
-Device (I2C0)
-{
- Name (_ADR, 0x00150000)
- Name (_DDN, "Serial IO I2C Controller 0")
-
- Name (SSCN, Package () { 432, 507, 30 })
- Name (FMCN, Package () { 72, 160, 30 })
-}
-
-Device (I2C1)
-{
- Name (_ADR, 0x00150001)
- Name (_DDN, "Serial IO I2C Controller 1")
-
- Name (SSCN, Package () { 528, 640, 30 })
- Name (FMCN, Package () { 128, 160, 30 })
- Name (FPCN, Package () { 48, 64, 30})
-}
-
-Device (I2C2)
-{
- Name (_ADR, 0x00150002)
- Name (_DDN, "Serial IO I2C Controller 2")
-
- Name (SSCN, Package () { 432, 507, 30 })
- Name (FMCN, Package () { 72, 160, 30 })
-}
-
-Device (I2C3)
-{
- Name (_ADR, 0x00150003)
- Name (_DDN, "Serial IO I2C Controller 3")
-
- Name (SSCN, Package () { 432, 507, 30 })
- Name (FMCN, Package () { 72, 160, 30 })
-}
-
-Device (I2C4)
-{
- Name (_ADR, 0x00190002)
- Name (_DDN, "Serial IO I2C Controller 4")
-
- Name (SSCN, Package () { 432, 507, 30 })
- Name (FMCN, Package () { 72, 160, 30 })
-}
-
-Device (I2C5)
-{
- Name (_ADR, 0x00190002)
- Name (_DDN, "Serial IO I2C Controller 5")
-
- Name (SSCN, Package () { 432, 507, 30 })
- Name (FMCN, Package () { 72, 160, 30 })
-}
-
Device (SPI0)
{
Name (_ADR, 0x001E0002)
diff --git a/src/soc/intel/skylake/chip.h b/src/soc/intel/skylake/chip.h
index fe03e59..eec6f1e 100644
--- a/src/soc/intel/skylake/chip.h
+++ b/src/soc/intel/skylake/chip.h
@@ -24,6 +24,7 @@
#include <stdint.h>
#include <soc/gpio_defs.h>
#include <soc/gpe.h>
+#include <soc/intel/common/lpss_i2c.h>
#include <soc/pci_devs.h>
#include <soc/pmc.h>
#include <soc/serialio.h>
@@ -44,6 +45,8 @@ struct skylake_i2c_config {
enum i2c_speed speed;
/* Bus should be enabled prior to ramstage with temporary base */
int early_init;
+ /* Custom bus speed configuration { scl_lcnt, scl_hcnt, sda_hold } */
+ struct lpss_i2c_speed_config speed_config[LPSS_I2C_SPEED_CONFIG_COUNT];
};
struct soc_intel_skylake_config {
diff --git a/src/soc/intel/skylake/i2c.c b/src/soc/intel/skylake/i2c.c
index 64d39cd..8377b50 100644
--- a/src/soc/intel/skylake/i2c.c
+++ b/src/soc/intel/skylake/i2c.c
@@ -13,12 +13,15 @@
* GNU General Public License for more details.
*/
+#include <arch/acpigen.h>
#include <device/device.h>
#include <device/i2c.h>
#include <device/pci.h>
+#include <device/pci_def.h>
#include <device/pci_ids.h>
#include <soc/intel/common/lpss_i2c.h>
#include <soc/ramstage.h>
+#include <string.h>
uintptr_t lpss_i2c_base_address(unsigned bus)
{
@@ -54,26 +57,87 @@ static int i2c_dev_to_bus(struct device *dev)
static void i2c_dev_init(struct device *dev)
{
struct soc_intel_skylake_config *config = dev->chip_info;
- int bus = i2c_dev_to_bus(dev);
+ const struct lpss_i2c_speed_config *sptr;
+ enum i2c_speed speed;
+ int i, bus = i2c_dev_to_bus(dev);
if (!config || bus < 0)
return;
- lpss_i2c_init(bus, config->i2c[bus].speed ? : I2C_SPEED_FAST);
+ speed = config->i2c[bus].speed ? : I2C_SPEED_FAST;
+ lpss_i2c_init(bus, speed);
+
+ /* Apply custom speed config if it has been set by the board */
+ for (i = 0; i < LPSS_I2C_SPEED_CONFIG_COUNT; i++) {
+ sptr = &config->i2c[bus].speed_config[i];
+ if (sptr->speed == speed) {
+ lpss_i2c_set_speed_config(bus, sptr);
+ break;
+ }
+ }
+}
+
+/* Generate ACPI I2C device objects */
+static void i2c_fill_ssdt(struct device *dev)
+{
+ struct soc_intel_skylake_config *config = dev->chip_info;
+ struct lpss_i2c_speed_config *sptr, sgen;
+ uint32_t pci_address;
+ int i, bus = i2c_dev_to_bus(dev);
+ enum i2c_speed speeds[LPSS_I2C_SPEED_CONFIG_COUNT] = {
+ I2C_SPEED_STANDARD,
+ I2C_SPEED_FAST,
+ I2C_SPEED_FAST_PLUS,
+ I2C_SPEED_HIGH,
+ };
+
+ if (!config || bus < 0)
+ return;
+
+ acpigen_write_scope(acpi_device_scope(dev));
+ acpigen_write_device(acpi_device_name(dev));
+
+ /* Build ACPI PCI address */
+ pci_address = PCI_SLOT(dev->path.pci.devfn) << 16;
+ pci_address |= PCI_FUNC(dev->path.pci.devfn);
+ acpigen_write_name_dword("_ADR", pci_address);
+
+ /* Report timing values for the OS driver */
+ for (i = 0; i < LPSS_I2C_SPEED_CONFIG_COUNT; i++) {
+ /* Generate speed config for default case */
+ if (lpss_i2c_gen_speed_config(speeds[i], &sgen) < 0)
+ continue;
+
+ /* Apply board specific override for this speed if found */
+ for (sptr = config->i2c[bus].speed_config;
+ sptr && sptr->speed; sptr++) {
+ if (sptr->speed == speeds[i]) {
+ memcpy(&sgen, sptr, sizeof(sgen));
+ break;
+ }
+ }
+
+ /* Generate ACPI based on selected speed config */
+ lpss_i2c_acpi_write_speed_config(&sgen);
+ }
+
+ acpigen_pop_len();
+ acpigen_pop_len();
}
static struct i2c_bus_operations i2c_bus_ops = {
- .dev_to_bus = &i2c_dev_to_bus,
+ .dev_to_bus = &i2c_dev_to_bus,
};
static struct device_operations i2c_dev_ops = {
- .read_resources = &pci_dev_read_resources,
- .set_resources = &pci_dev_set_resources,
- .enable_resources = &pci_dev_enable_resources,
- .scan_bus = &scan_smbus,
- .ops_pci = &soc_pci_ops,
- .ops_i2c_bus = &i2c_bus_ops,
- .init = &i2c_dev_init,
+ .read_resources = &pci_dev_read_resources,
+ .set_resources = &pci_dev_set_resources,
+ .enable_resources = &pci_dev_enable_resources,
+ .scan_bus = &scan_smbus,
+ .ops_pci = &soc_pci_ops,
+ .ops_i2c_bus = &i2c_bus_ops,
+ .init = &i2c_dev_init,
+ .acpi_fill_ssdt_generator = &i2c_fill_ssdt,
};
static const unsigned short pci_device_ids[] = {
diff --git a/src/soc/intel/skylake/romstage/i2c.c b/src/soc/intel/skylake/romstage/i2c.c
index 64e6924..3d2e994 100644
--- a/src/soc/intel/skylake/romstage/i2c.c
+++ b/src/soc/intel/skylake/romstage/i2c.c
@@ -46,6 +46,8 @@ static void i2c_early_init_bus(unsigned bus)
{
ROMSTAGE_CONST struct soc_intel_skylake_config *config;
ROMSTAGE_CONST struct device *tree_dev;
+ const struct lpss_i2c_speed_config *sptr;
+ enum i2c_speed speed;
pci_devfn_t dev;
unsigned devfn;
uintptr_t base;
@@ -84,7 +86,17 @@ static void i2c_early_init_bus(unsigned bus)
write32(reg, value);
/* Initialize the controller */
- lpss_i2c_init(bus, config->i2c[bus].speed ? : I2C_SPEED_FAST);
+ speed = config->i2c[bus].speed ? : I2C_SPEED_FAST;
+ lpss_i2c_init(bus, speed);
+
+ /* Apply custom speed config if it has been set by the board */
+ for (value = 0; value < LPSS_I2C_SPEED_CONFIG_COUNT; value++) {
+ sptr = &config->i2c[bus].speed_config[value];
+ if (sptr->speed == speed) {
+ lpss_i2c_set_speed_config(bus, sptr);
+ break;
+ }
+ }
}
void i2c_early_init(void)
Duncan Laurie (dlaurie(a)chromium.org) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/15481
-gerrit
commit 10582027bace752c7943f62c2d258e9fc4fcc725
Author: Duncan Laurie <dlaurie(a)chromium.org>
Date: Mon Jun 27 11:05:16 2016 -0700
google/reef: ACPI: Move trackpad to SSDT and remove TPM
Instantiate the touchpad using the drivers/i2c/generic device driver
to generate the ACPI object in the SSDT.
There is not currently a separate wake pin for this device, this will
be added in EVT hardware.
This was tested on the reef board by ensuring that the touchpad device
continues to work in the OS.
Also remove the LPC TPM from the DSDT as it is not present.
Change-Id: I3151a28f628e66f63033398d6fab9fd8f5dfc37b
Signed-off-by: Duncan Laurie <dlaurie(a)chromium.org>
---
src/mainboard/google/reef/Kconfig | 3 ++
src/mainboard/google/reef/acpi/mainboard.asl | 48 +---------------------------
src/mainboard/google/reef/devicetree.cb | 9 +++++-
3 files changed, 12 insertions(+), 48 deletions(-)
diff --git a/src/mainboard/google/reef/Kconfig b/src/mainboard/google/reef/Kconfig
index d64598d..c271f78 100644
--- a/src/mainboard/google/reef/Kconfig
+++ b/src/mainboard/google/reef/Kconfig
@@ -25,6 +25,9 @@ config CHROMEOS
select VBOOT_OPROM_MATTERS
select VIRTUAL_DEV_SWITCH
+config DRIVERS_I2C_GENERIC
+ default y
+
config MAINBOARD_DIR
string
default google/reef
diff --git a/src/mainboard/google/reef/acpi/mainboard.asl b/src/mainboard/google/reef/acpi/mainboard.asl
index 5471488..5b6e976 100644
--- a/src/mainboard/google/reef/acpi/mainboard.asl
+++ b/src/mainboard/google/reef/acpi/mainboard.asl
@@ -33,54 +33,8 @@ Scope (\_SB)
}
}
-Scope (\_SB.PCI0.I2C4)
-{
- /* Standard Mode: HCNT, LCNT, SDA Hold Register */
- /* SDA Hold register value of 40 indicates
- * sda hold time of 0.3us for ic_clk of 133MHz
- */
- Name (SSCN, Package () { 0, 0, 40 })
-
- /* Fast Mode: HCNT, LCNT, SDA Hold Register */
- /* SDA Hold register value of 40 indicates
- * sda hold time of 0.3us for ic_clk of 133MHz
- */
- Name (FMCN, Package () { 0, 0, 40 })
-
- Device (ETPA)
- {
- Name (_HID, "ELAN0000")
- Name (_DDN, "Elan Touchpad")
- Name (_UID, 1)
- Name (ISTP, 1) /* Touchpad */
-
- Name (_CRS, ResourceTemplate()
- {
- I2cSerialBus (
- 0x15, // SlaveAddress
- ControllerInitiated, // SlaveMode
- 400000, // ConnectionSpeed
- AddressingMode7Bit, // AddressingMode
- "\\_SB.PCI0.I2C4", // ResourceSource
- )
- Interrupt (ResourceConsumer, Edge, ActiveLow)
- {
- TOUCHPAD_INT
- }
- })
-
- Method (_STA)
- {
- Return (0xF)
- }
- }
-}
-
-/*
- * LPC Trusted Platform Module
- */
Scope (\_SB.PCI0.LPCB)
{
- #include <drivers/pc80/tpm/acpi/tpm.asl>
+ /* Chrome OS Embedded Controller */
#include "ec.asl"
}
diff --git a/src/mainboard/google/reef/devicetree.cb b/src/mainboard/google/reef/devicetree.cb
index d2b295f..e0831f4 100644
--- a/src/mainboard/google/reef/devicetree.cb
+++ b/src/mainboard/google/reef/devicetree.cb
@@ -61,7 +61,14 @@ chip soc/intel/apollolake
device pci 16.1 on end # - I2C 1
device pci 16.2 on end # - I2C 2
device pci 16.3 on end # - I2C 3
- device pci 17.0 on end # - I2C 4
+ device pci 17.0 on
+ chip drivers/i2c/generic
+ register "hid" = ""ELAN0000""
+ register "desc" = ""ELAN Touchpad""
+ register "irq" = "IRQ_EDGE_LOW(GPIO_18_IRQ)"
+ device i2c 15 on end
+ end
+ end # - I2C 4
device pci 17.1 on end # - I2C 5
device pci 17.2 on end # - I2C 6
device pci 17.3 on end # - I2C 7
Martin Roth (martinroth(a)google.com) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/14482
-gerrit
commit 50eab490dd094ea4333626de7651e27a70f97793
Author: Martin Roth <martinroth(a)google.com>
Date: Sat Apr 23 17:19:41 2016 -0600
nvramcui: Update Makefile
- Add all, clean and distclean to .PHONY
- Rebuild nvramcui.elf when the makefile changes.
- Update libpayload target to $(LIBPAYLOAD_DIR) target - these are the
same thing, but by using the variable it makes it more obvious.
- Remove .config.old as well as .config when running distclean.
- Add CFLAGS to the LPGCC command line:
-- Enable all warnings, set warnings as errors.
-- Optimize for size
-- Enable '-ffreestanding -nostdinc -nostdlib' to keep from building in
system functions and to fix the warning:
libpayload.h: warning: conflicting types for built-in function 'log2'
static inline int log2(u32 x) { return sizeof(x) * 8 - clz(x) - 1; }
Change-Id: Icc6c70b259cd7c22dc960cdb732927f9c0c93ee8
Signed-off-by: Martin Roth <martinroth(a)google.com>
---
payloads/nvramcui/Makefile | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
diff --git a/payloads/nvramcui/Makefile b/payloads/nvramcui/Makefile
index 0f27ff8..c6a9cd0 100644
--- a/payloads/nvramcui/Makefile
+++ b/payloads/nvramcui/Makefile
@@ -3,10 +3,11 @@ XCOMPILE=$(LIBPAYLOAD_DIR)/libpayload.xcompile
# build libpayload and put .config file in $(CURDIR) instead of ../libpayload
# to avoid pollute the libpayload source directory and possible conflicts
LPOPTS=obj="$(CURDIR)/build" DESTDIR="$(CURDIR)" DOTCONFIG="$(CURDIR)/.config"
+CFLAGS += -Wall -Werror -Os -ffreestanding -nostdinc -nostdlib
all: nvramcui.elf
-libpayload:
+$(LIBPAYLOAD_DIR):
$(MAKE) -C ../libpayload $(LPOPTS) defconfig
$(MAKE) -C ../libpayload $(LPOPTS)
$(MAKE) -C ../libpayload $(LPOPTS) install
@@ -14,19 +15,20 @@ libpayload:
ifneq ($(strip $(wildcard libpayload)),)
include $(XCOMPILE)
LPGCC = CC="$(GCC_CC_x86_32)" "$(LIBPAYLOAD_DIR)/bin/lpgcc"
-%.elf: %.c
- $(LPGCC) -o $*.elf $*.c
+%.elf: %.c Makefile
+ $(LPGCC) $(CFLAGS) -o $*.elf $*.c
else
# If libpayload is not found, first build libpayload,
# then do the make, this time it'll find libpayload
# and generate the nvramcui.elf target
-%.elf: libpayload
+%.elf: $(LIBPAYLOAD_DIR)
$(MAKE) all
endif
-.PHONY:
clean:
rm -f nvramcui.elf
distclean: clean
- rm -rf build libpayload .config
+ rm -rf build libpayload .config .config.old
+
+.PHONY: all clean distclean
the following patch was just integrated into master:
commit 9d0cce2087139a2eab447aea3fdebfe44e97c280
Author: Jonathan Neuschäfer <j.neuschaefer(a)gmx.net>
Date: Tue Jun 21 19:37:03 2016 +0200
riscv/bootblock.S: Register machine-mode, not supervisor-mode trap handler
Change-Id: Ic42d8490cc02a3907e2989435aab786f7c0f39c9
Signed-off-by: Jonathan Neuschäfer <j.neuschaefer(a)gmx.net>
Reviewed-on: https://review.coreboot.org/15287
Tested-by: build bot (Jenkins)
Reviewed-by: Ronald G. Minnich <rminnich(a)gmail.com>
See https://review.coreboot.org/15287 for details.
-gerrit