Attention is currently required from: Arthur Heymans, Patrick Georgi.
Martin Roth has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/63117 )
Change subject: Makefile: Clean up old targets
......................................................................
Patch Set 1: Code-Review+2
--
To view, visit https://review.coreboot.org/c/coreboot/+/63117
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: Iccc62b3c54ee2a074c25674715403c1457f6aad3
Gerrit-Change-Number: 63117
Gerrit-PatchSet: 1
Gerrit-Owner: Arthur Heymans <arthur.heymans(a)9elements.com>
Gerrit-Reviewer: Arthur Heymans <arthur(a)aheymans.xyz>
Gerrit-Reviewer: Elyes Haouas <ehaouas(a)noos.fr>
Gerrit-Reviewer: Martin Roth <martinroth(a)google.com>
Gerrit-Reviewer: Patrick Georgi <patrick(a)coreboot.org>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-CC: Paul Menzel <paulepanter(a)mailbox.org>
Gerrit-Attention: Arthur Heymans <arthur.heymans(a)9elements.com>
Gerrit-Attention: Patrick Georgi <patrick(a)coreboot.org>
Gerrit-Attention: Arthur Heymans <arthur(a)aheymans.xyz>
Gerrit-Comment-Date: Wed, 30 Mar 2022 17:34:54 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment
Matt DeVillier has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/63211 )
Change subject: drivers/i2c/generic: Add support for i2c device detection
......................................................................
drivers/i2c/generic: Add support for i2c device detection
Add 'detect' flag which can be attached to devices which may or may not
be present at runtime, and for which coreboot should probe the i2c bus
to confirm device presence prior to adding an entry for it in the SSDT.
This is useful for boards which may utilize touchpads/touchscreens from
multiple vendors, so that only the device(s) present are added to the
SSDT. This relieves the burden from the OS to detect/probe if a device
is actually present and allows the OS to trust the ACPI _STA value.
Change-Id: I1a4169ed6416d544773a37d29cdcc154d3c28519
Signed-off-by: Matt DeVillier <matt.devillier(a)gmail.com>
---
M src/drivers/i2c/generic/chip.h
M src/drivers/i2c/generic/generic.c
2 files changed, 20 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/11/63211/1
diff --git a/src/drivers/i2c/generic/chip.h b/src/drivers/i2c/generic/chip.h
index 284c9d1..a99b095 100644
--- a/src/drivers/i2c/generic/chip.h
+++ b/src/drivers/i2c/generic/chip.h
@@ -31,6 +31,17 @@
*/
int probed;
+ /*
+ * This flag will add a device property which will indicate
+ * that coreboot should attempt to detect the device on the i2c
+ * bus before generating a device entry in the SSDT.
+ *
+ * This can be used to declare a device that may not exist on
+ * the board, for example to support multiple touchpads and/or
+ * touchscreens.
+ */
+ int detect;
+
/* GPIO used to indicate if this device is present */
unsigned int device_present_gpio;
unsigned int device_present_gpio_invert;
diff --git a/src/drivers/i2c/generic/generic.c b/src/drivers/i2c/generic/generic.c
index 656b9e6..be03cf7 100644
--- a/src/drivers/i2c/generic/generic.c
+++ b/src/drivers/i2c/generic/generic.c
@@ -3,6 +3,7 @@
#include <acpi/acpi_device.h>
#include <acpi/acpigen.h>
#include <console/console.h>
+#include <device/i2c_bus.h>
#include <device/i2c_simple.h>
#include <device/device.h>
#include <device/path.h>
@@ -65,6 +66,14 @@
return;
}
+ if (config->detect) {
+ struct device *const busdev = i2c_busdev((struct device *)dev);
+ bool detected = busdev->ops->ops_i2c_bus->detect(busdev,
+ dev->path.i2c.device);
+ if (!detected)
+ return;
+ }
+
/* Device */
acpigen_write_scope(scope);
acpigen_write_device(acpi_device_name(dev));
--
To view, visit https://review.coreboot.org/c/coreboot/+/63211
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I1a4169ed6416d544773a37d29cdcc154d3c28519
Gerrit-Change-Number: 63211
Gerrit-PatchSet: 1
Gerrit-Owner: Matt DeVillier <matt.devillier(a)gmail.com>
Gerrit-MessageType: newchange
Attention is currently required from: Tim Wawrzynczak.
Hello Tim Wawrzynczak,
I'd like you to do a code review. Please visit
https://review.coreboot.org/c/coreboot/+/63210
to review the following change.
Change subject: drivers/i2c/dw_i2c: Add detect callback to i2c_bus_ops
......................................................................
drivers/i2c/dw_i2c: Add detect callback to i2c_bus_ops
This patch adds the I2C equivalent of an SMBus quick write to an I2C
device, which is used by some I2C drivers as a way to probe the
existence (or absence) of a certain device on the bus, based on
whether or not a 0-byte write to an I2C address is ACKed or NACKed.
Change-Id: I9ed410669aabf9866329c6c6e74a39168a86b73e
Signed-off-by: Matt DeVillier <matt.devillier(a)gmail.com>
Signed-off-by: Tim Wawrzynczak <twawrzynczak(a)chromium.org>
---
M src/drivers/i2c/designware/dw_i2c.c
1 file changed, 67 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/10/63210/1
diff --git a/src/drivers/i2c/designware/dw_i2c.c b/src/drivers/i2c/designware/dw_i2c.c
index 56f3f27..f600f07 100644
--- a/src/drivers/i2c/designware/dw_i2c.c
+++ b/src/drivers/i2c/designware/dw_i2c.c
@@ -92,6 +92,9 @@
INTR_STAT_GEN_CALL = (1 << 11),
};
+/* Bit 0 is 7-bit NAK, bits 1 and 2 are 10-bit NAKs */
+#define INTR_STAT_TX_ABORT_SOURCE_NAK_MASK 0x7
+
/* I2C Controller MMIO register space */
struct dw_i2c_regs {
uint32_t control; /* 0x0 */
@@ -480,6 +483,69 @@
return _dw_i2c_transfer(bus, &orig_msg[start], count - start);
}
+static bool dw_i2c_detect(struct device *dev, unsigned int addr)
+{
+ struct dw_i2c_regs *regs;
+ struct stopwatch sw;
+ bool found = false;
+
+ const int bus = dw_i2c_soc_dev_to_bus(dev);
+ regs = (struct dw_i2c_regs *)dw_i2c_base_address(bus);
+ if (!regs) {
+ printk(BIOS_ERR, "I2C bus %u base address not found\n", bus);
+ return CB_ERR;
+ }
+
+ /* Setup transaction */
+ write32(®s->target_addr, addr);
+ dw_i2c_enable(regs);
+
+ stopwatch_init_usecs_expire(&sw, DW_I2C_TIMEOUT_US);
+
+ while (!(read32(®s->status) & STATUS_TX_FIFO_NOT_FULL)) {
+ if (stopwatch_expired(&sw)) {
+ printk(BIOS_ERR, "I2C transmit timeout\n");
+ return CB_ERR;
+ }
+ }
+
+ /* stop immediately */
+ write32(®s->cmd_data, CMD_DATA_STOP);
+ bool expired = false;
+
+ do {
+ const uint32_t stat = read32(®s->raw_intr_stat);
+ const uint32_t src = read32(®s->tx_abort_source);
+ if (stat & INTR_STAT_TX_ABORT) {
+ if (src & INTR_STAT_TX_ABORT_SOURCE_NAK_MASK)
+ found = false;
+
+ /* clear INTR_STAT_TX_ABORT */
+ read32(®s->clear_tx_abrt_intr);
+ break;
+ } else if (stat & INTR_STAT_STOP_DET) {
+ found = true;
+ /* clear INTR_STST_STOP_DET */
+ read32(®s->clear_stop_det_intr);
+ break;
+ }
+
+ expired = stopwatch_expired(&sw);
+ } while (!expired);
+
+ if (expired)
+ printk(BIOS_ERR, "Failed to detect stop bit or tx abort\n");
+
+ /* Wait for the bus to go idle */
+ if (dw_i2c_wait_for_bus_idle(regs) != CB_SUCCESS)
+ printk(BIOS_ERR, "I2C timeout waiting for bus %u idle\n", bus);
+
+ read32(®s->clear_intr);
+ dw_i2c_disable(regs);
+
+ return found;
+}
+
/* Global I2C bus handler, defined in include/device/i2c_simple.h */
int platform_i2c_transfer(unsigned int bus, struct i2c_msg *msg, int count)
{
@@ -850,4 +916,5 @@
const struct i2c_bus_operations dw_i2c_bus_ops = {
.transfer = dw_i2c_dev_transfer,
+ .detect = dw_i2c_detect,
};
--
To view, visit https://review.coreboot.org/c/coreboot/+/63210
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I9ed410669aabf9866329c6c6e74a39168a86b73e
Gerrit-Change-Number: 63210
Gerrit-PatchSet: 1
Gerrit-Owner: Matt DeVillier <matt.devillier(a)gmail.com>
Gerrit-Reviewer: Tim Wawrzynczak <twawrzynczak(a)chromium.org>
Gerrit-Attention: Tim Wawrzynczak <twawrzynczak(a)chromium.org>
Gerrit-MessageType: newchange
Attention is currently required from: Tim Wawrzynczak.
Hello Tim Wawrzynczak,
I'd like you to do a code review. Please visit
https://review.coreboot.org/c/coreboot/+/63209
to review the following change.
Change subject: device/i2c_bus: Add probe function pointer in i2c_bus_ops
......................................................................
device/i2c_bus: Add probe function pointer in i2c_bus_ops
Some coreboot drivers may want the ability to probe an I2C bus for the
existence of a device, so this patch adds a function pointer in the
i2c_bus_ops structure to accomodate that.
Change-Id: Ia8ddfb187eabec966c253b6cc8526491c99151fc
Signed-off-by: Matt DeVillier <matt.devillier(a)gmail.com>
Signed-off-by: Tim Wawrzynczak <twawrzynczak(a)chromium.org>
---
M src/include/device/i2c_bus.h
1 file changed, 1 insertion(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/09/63209/1
diff --git a/src/include/device/i2c_bus.h b/src/include/device/i2c_bus.h
index 42f461d..01c705b 100644
--- a/src/include/device/i2c_bus.h
+++ b/src/include/device/i2c_bus.h
@@ -11,6 +11,7 @@
/* I2C bus operation for ramstage drivers */
struct i2c_bus_operations {
int (*transfer)(struct device *, const struct i2c_msg *, size_t count);
+ bool (*detect)(struct device *dev, unsigned int addr);
};
/*
--
To view, visit https://review.coreboot.org/c/coreboot/+/63209
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: Ia8ddfb187eabec966c253b6cc8526491c99151fc
Gerrit-Change-Number: 63209
Gerrit-PatchSet: 1
Gerrit-Owner: Matt DeVillier <matt.devillier(a)gmail.com>
Gerrit-Reviewer: Tim Wawrzynczak <twawrzynczak(a)chromium.org>
Gerrit-Attention: Tim Wawrzynczak <twawrzynczak(a)chromium.org>
Gerrit-MessageType: newchange
Attention is currently required from: Michał Żygowski.
Angel Pons has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/62211 )
Change subject: mb/dell: Convert OptiPlex 9010 into directory with variants
......................................................................
Patch Set 4:
(1 comment)
File src/mainboard/dell/snb_ivb_workstations/Kconfig.name:
https://review.coreboot.org/c/coreboot/+/62211/comment/23cf4e73_0f5fe5d4
PS4, Line 4: SOUTHBRIDGE_INTEL_BD82X6X
This seems to have been changed by accident, Q77 is considered Panther Point (which corresponds to the C216 Kconfig option). CB:63207 corrects it.
--
To view, visit https://review.coreboot.org/c/coreboot/+/62211
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I4075f0ae3b24892fcc2be07061a01f8070659239
Gerrit-Change-Number: 62211
Gerrit-PatchSet: 4
Gerrit-Owner: Michał Żygowski <michal.zygowski(a)3mdeb.com>
Gerrit-Reviewer: Krystian Hebel <krystian.hebel(a)3mdeb.com>
Gerrit-Reviewer: Martin Roth <martinroth(a)google.com>
Gerrit-Reviewer: Michał Żygowski <michal.zygowski(a)3mdeb.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-CC: 9elements QA <hardwaretestrobot(a)gmail.com>
Gerrit-CC: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-CC: Paul Menzel <paulepanter(a)mailbox.org>
Gerrit-Attention: Michał Żygowski <michal.zygowski(a)3mdeb.com>
Gerrit-Comment-Date: Wed, 30 Mar 2022 17:14:15 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment