Nico Huber has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/35490 )
Change subject: drivers/i2c/at24rf08c: Cache devices associated with this driver
......................................................................
drivers/i2c/at24rf08c: Cache devices associated with this driver
To get rid of the fragile dev_find_slot_on_smbus(), we let the
chip driver register the individual devices (EEPROMs) instead.
They will be cached in an global array. So, the implementation
assumes that there is only one instance of this driver but that
should always be the case.
Change-Id: I11eade2cea924839f4b1e1eeee612931fdfd1299
Signed-off-by: Nico Huber <nico.huber(a)secunet.com>
---
M src/drivers/i2c/at24rf08c/at24rf08c.c
M src/drivers/i2c/at24rf08c/lenovo.h
M src/drivers/i2c/at24rf08c/lenovo_serials.c
3 files changed, 42 insertions(+), 6 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/90/35490/1
diff --git a/src/drivers/i2c/at24rf08c/at24rf08c.c b/src/drivers/i2c/at24rf08c/at24rf08c.c
index 67760a0..7fbae84 100644
--- a/src/drivers/i2c/at24rf08c/at24rf08c.c
+++ b/src/drivers/i2c/at24rf08c/at24rf08c.c
@@ -18,6 +18,7 @@
#include <device/smbus.h>
#include <smbios.h>
#include <console/console.h>
+#include "lenovo.h"
static void at24rf08c_init(struct device *dev)
{
@@ -26,9 +27,14 @@
if (!dev->enabled)
return;
+ if (dev->path.type != DEVICE_PATH_I2C)
+ return;
+
+ lenovo_serials_register_bank(dev);
+
/* Ensure that EEPROM/RFID chip is not accessible through RFID.
Need to do it only on 5c. */
- if (dev->path.type != DEVICE_PATH_I2C || dev->path.i2c.device != 0x5c)
+ if (dev->path.i2c.device != 0x5c)
return;
printk (BIOS_DEBUG, "Locking EEPROM RFID\n");
diff --git a/src/drivers/i2c/at24rf08c/lenovo.h b/src/drivers/i2c/at24rf08c/lenovo.h
index 6824eb6..45d45cc 100644
--- a/src/drivers/i2c/at24rf08c/lenovo.h
+++ b/src/drivers/i2c/at24rf08c/lenovo.h
@@ -1 +1,23 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * 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.
+ */
+
+#ifndef DRIVERS_I2C_AT24RF08C_LENOVO_H
+#define DRIVERS_I2C_AT24RF08C_LENOVO_H
+
+#include <device/device.h>
+
const char *lenovo_mainboard_partnumber(void);
+
+void lenovo_serials_register_bank(struct device *);
+
+#endif /* DRIVERS_I2C_AT24RF08C_LENOVO_H */
diff --git a/src/drivers/i2c/at24rf08c/lenovo_serials.c b/src/drivers/i2c/at24rf08c/lenovo_serials.c
index 0a6b343..584714e 100644
--- a/src/drivers/i2c/at24rf08c/lenovo_serials.c
+++ b/src/drivers/i2c/at24rf08c/lenovo_serials.c
@@ -24,10 +24,20 @@
#define ERROR_STRING "*INVALID*"
+static struct device *banks[4];
+
+void lenovo_serials_register_bank(struct device *const dev)
+{
+ if (0x54 > dev->path.i2c.device || dev->path.i2c.device > 0x57)
+ return;
+ banks[dev->path.i2c.device & 3] = dev;
+}
+
static struct device *at24rf08c_find_bank(u8 bank)
{
- struct device *dev;
- dev = dev_find_slot_on_smbus(1, 0x54 | bank);
+ struct device *const dev = banks[bank];
+ if (bank > ARRAY_SIZE(banks))
+ return NULL;
if (!dev)
printk(BIOS_WARNING, "EEPROM not found\n");
return dev;
@@ -72,7 +82,6 @@
dev = at24rf08c_find_bank(bank);
if (dev == NULL) {
- printk(BIOS_WARNING, "EEPROM not found\n");
memcpy(result, ERROR_STRING, sizeof (ERROR_STRING));
return;
}
@@ -134,9 +143,8 @@
memset(result, 0, sizeof (result));
- dev = dev_find_slot_on_smbus(1, 0x56);
+ dev = at24rf08c_find_bank(2);
if (dev == NULL) {
- printk(BIOS_WARNING, "EEPROM not found\n");
already_read = 1;
memset(uuid, 0, 16);
return;
--
To view, visit https://review.coreboot.org/c/coreboot/+/35490
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I11eade2cea924839f4b1e1eeee612931fdfd1299
Gerrit-Change-Number: 35490
Gerrit-PatchSet: 1
Gerrit-Owner: Nico Huber <nico.h(a)gmx.de>
Gerrit-MessageType: newchange
Attention is currently required from: Matt DeVillier, Subrata Banik.
Sean Rhodes has posted comments on this change by Sean Rhodes. ( https://review.coreboot.org/c/coreboot/+/84133?usp=email )
Change subject: drivers/usb/acpi: Add DSM for Intel Bluetooth
......................................................................
Patch Set 5:
(4 comments)
File src/drivers/usb/acpi/chip.h:
https://review.coreboot.org/c/coreboot/+/84133/comment/681e8e0b_8d96c7ba?us… :
PS3, Line 51: bool intel_bt;
> can you please use a meaningful name ? I don't understand what you mean by `intel_bt` ? is it like ` […]
Done
File src/drivers/usb/acpi/usb_acpi.c:
https://review.coreboot.org/c/coreboot/+/84133/comment/f1a529bc_c968dc0d?us… :
PS3, Line 12:
> just one space to start the comment
Done
https://review.coreboot.org/c/coreboot/+/84133/comment/fd872506_050f5116?us… :
PS3, Line 27: 0x03
> can you please explain the meaning of hard coded value ?
BIT(0) and BIT(1) - supported and other functions are supported.
https://review.coreboot.org/c/coreboot/+/84133/comment/e2c365d7_3e389a6e?us… :
PS3, Line 36: /* aa10f4e0-81ac-4233-abf6-3b2ac50e28d9 */
> unable to follow why you have used the GUID here ?
THought it made it easier to follow - removed.
--
To view, visit https://review.coreboot.org/c/coreboot/+/84133?usp=email
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: coreboot
Gerrit-Branch: main
Gerrit-Change-Id: Icc18f867604876b27ced2ee4356e47b3aa6b4f74
Gerrit-Change-Number: 84133
Gerrit-PatchSet: 5
Gerrit-Owner: Sean Rhodes <sean(a)starlabs.systems>
Gerrit-Reviewer: Matt DeVillier <matt.devillier(a)gmail.com>
Gerrit-Reviewer: Subrata Banik <subratabanik(a)google.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Attention: Subrata Banik <subratabanik(a)google.com>
Gerrit-Attention: Matt DeVillier <matt.devillier(a)gmail.com>
Gerrit-Comment-Date: Sat, 31 Aug 2024 18:59:57 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Subrata Banik <subratabanik(a)google.com>
Attention is currently required from: Matt DeVillier, Sean Rhodes.
Hello Matt DeVillier, Subrata Banik, build bot (Jenkins),
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/84133?usp=email
to look at the new patch set (#5).
Change subject: drivers/usb/acpi: Add DSM for Intel Bluetooth
......................................................................
drivers/usb/acpi: Add DSM for Intel Bluetooth
Add support for creating a DSM Method for Intel Bluetooth that
is outlined in Intel's connectivity integrated guide (which has
no document number).
It supports two GUIDs:
Set Tile Activaction (2d19d3e1-5708-4696-bd5b-2c3dbae2d6a9)
BIT(0) Indicates whether the device supports other functions
BIT(1) Set Tile Activation
Check/Set Reset Delay (aa10f4e0-81ac-4233-abf6-3b2ac50e28d9)
BIT(0) Indicates whether the device supports other functions
BIT(1) Set Bluetooth reset timing
Change-Id: Icc18f867604876b27ced2ee4356e47b3aa6b4f74
Signed-off-by: Sean Rhodes <sean(a)starlabs.systems>
---
M src/drivers/usb/acpi/chip.h
M src/drivers/usb/acpi/usb_acpi.c
2 files changed, 129 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/33/84133/5
--
To view, visit https://review.coreboot.org/c/coreboot/+/84133?usp=email
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings?usp=email
Gerrit-MessageType: newpatchset
Gerrit-Project: coreboot
Gerrit-Branch: main
Gerrit-Change-Id: Icc18f867604876b27ced2ee4356e47b3aa6b4f74
Gerrit-Change-Number: 84133
Gerrit-PatchSet: 5
Gerrit-Owner: Sean Rhodes <sean(a)starlabs.systems>
Gerrit-Reviewer: Matt DeVillier <matt.devillier(a)gmail.com>
Gerrit-Reviewer: Subrata Banik <subratabanik(a)google.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Attention: Sean Rhodes <sean(a)starlabs.systems>
Gerrit-Attention: Matt DeVillier <matt.devillier(a)gmail.com>
Attention is currently required from: Matt DeVillier, Sean Rhodes.
Hello Matt DeVillier, Subrata Banik, build bot (Jenkins),
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/84133?usp=email
to look at the new patch set (#4).
The following approvals got outdated and were removed:
Code-Review+1 by Matt DeVillier, Verified+1 by build bot (Jenkins)
Change subject: drivers/usb/acpi: Add DSM for Intel Bluetooth
......................................................................
drivers/usb/acpi: Add DSM for Intel Bluetooth
Add support for creating a DSM Method for Intel Bluetooth that
is outlined in Intel's connectivity integrated guide (which has
no document number).
It supports two GUIDs:
Set Tile Activaction (2d19d3e1-5708-4696-bd5b-2c3dbae2d6a9)
BIT(0) Indicates whether the device supports other functions
BIT(1) Set Tile Activation
Check/Set Reset Delay (aa10f4e0-81ac-4233-abf6-3b2ac50e28d9)
BIT(0) Indicates whether the device supports other functions
BIT(1) Set Bluetooth reset timing
Change-Id: Icc18f867604876b27ced2ee4356e47b3aa6b4f74
Signed-off-by: Sean Rhodes <sean(a)starlabs.systems>
---
M src/drivers/usb/acpi/chip.h
M src/drivers/usb/acpi/usb_acpi.c
2 files changed, 129 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/33/84133/4
--
To view, visit https://review.coreboot.org/c/coreboot/+/84133?usp=email
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings?usp=email
Gerrit-MessageType: newpatchset
Gerrit-Project: coreboot
Gerrit-Branch: main
Gerrit-Change-Id: Icc18f867604876b27ced2ee4356e47b3aa6b4f74
Gerrit-Change-Number: 84133
Gerrit-PatchSet: 4
Gerrit-Owner: Sean Rhodes <sean(a)starlabs.systems>
Gerrit-Reviewer: Matt DeVillier <matt.devillier(a)gmail.com>
Gerrit-Reviewer: Subrata Banik <subratabanik(a)google.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Attention: Sean Rhodes <sean(a)starlabs.systems>
Gerrit-Attention: Matt DeVillier <matt.devillier(a)gmail.com>
Attention is currently required from: Dinesh Gehlot, Jeremy Compostella, Jérémy Compostella, Kapil Porwal, Martin L Roth, Nick Vaccaro, Ronak Kanabar, Subrata Banik.
Sean Rhodes has posted comments on this change by Sean Rhodes. ( https://review.coreboot.org/c/coreboot/+/81080?usp=email )
Change subject: soc/intel/alderlake: Correctly set CNVi Reset and Clkreq pins
......................................................................
Patch Set 9:
(1 comment)
File src/soc/intel/alderlake/fsp_params.c:
https://review.coreboot.org/c/coreboot/+/81080/comment/2b39b116_c6382946?us… :
PS9, Line 842: /*
> Isn't a board design specific topic ? Should it be handled in src/mainboard/... […]
I guess a board could use any GPIO for it, but currently, coreboot leaves FSP using pins that can't ever work - surely the default should be changed to what Intel recommend?
--
To view, visit https://review.coreboot.org/c/coreboot/+/81080?usp=email
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: coreboot
Gerrit-Branch: main
Gerrit-Change-Id: Ib534d3cfe888c1c538267caaf324c8ae743da496
Gerrit-Change-Number: 81080
Gerrit-PatchSet: 9
Gerrit-Owner: Sean Rhodes <sean(a)starlabs.systems>
Gerrit-Reviewer: Dinesh Gehlot <digehlot(a)google.com>
Gerrit-Reviewer: Jeremy Compostella <jeremy.compostella(a)intel.corp-partner.google.com>
Gerrit-Reviewer: Kapil Porwal <kapilporwal(a)google.com>
Gerrit-Reviewer: Martin L Roth <gaumless(a)gmail.com>
Gerrit-Reviewer: Nick Vaccaro <nvaccaro(a)chromium.org>
Gerrit-Reviewer: Nico Huber <nico.h(a)gmx.de>
Gerrit-Reviewer: Ronak Kanabar <ronak.kanabar(a)intel.com>
Gerrit-Reviewer: Subrata Banik <subratabanik(a)google.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Reviewer: srinivas.kulkarni(a)intel.com
Gerrit-CC: Felix Held <felix-coreboot(a)felixheld.de>
Gerrit-CC: Jérémy Compostella <jeremy.compostella(a)intel.com>
Gerrit-Attention: Martin L Roth <gaumless(a)gmail.com>
Gerrit-Attention: Jeremy Compostella <jeremy.compostella(a)intel.corp-partner.google.com>
Gerrit-Attention: Subrata Banik <subratabanik(a)google.com>
Gerrit-Attention: Jérémy Compostella <jeremy.compostella(a)intel.com>
Gerrit-Attention: Dinesh Gehlot <digehlot(a)google.com>
Gerrit-Attention: Kapil Porwal <kapilporwal(a)google.com>
Gerrit-Attention: Nick Vaccaro <nvaccaro(a)chromium.org>
Gerrit-Attention: Ronak Kanabar <ronak.kanabar(a)intel.com>
Gerrit-Comment-Date: Sat, 31 Aug 2024 18:51:41 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Jérémy Compostella <jeremy.compostella(a)intel.com>
Attention is currently required from: Elyes Haouas, Jeremy Soller, Michał Żygowski, Piotr Król, Tim Crawford.
Sean Rhodes has posted comments on this change by Elyes Haouas. ( https://review.coreboot.org/c/coreboot/+/84156?usp=email )
Change subject: tree: Use eist_enable as bool for newly merged files
......................................................................
Patch Set 2: Code-Review+2
--
To view, visit https://review.coreboot.org/c/coreboot/+/84156?usp=email
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: coreboot
Gerrit-Branch: main
Gerrit-Change-Id: Icc01852dc5bd04cfa151e8fa7c5bcc160ed978c6
Gerrit-Change-Number: 84156
Gerrit-PatchSet: 2
Gerrit-Owner: Elyes Haouas <ehaouas(a)noos.fr>
Gerrit-Reviewer: Jeremy Soller <jeremy(a)system76.com>
Gerrit-Reviewer: Michał Żygowski <michal.zygowski(a)3mdeb.com>
Gerrit-Reviewer: Piotr Król <piotr.krol(a)3mdeb.com>
Gerrit-Reviewer: Sean Rhodes <sean(a)starlabs.systems>
Gerrit-Reviewer: Tim Crawford <tcrawford(a)system76.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Attention: Tim Crawford <tcrawford(a)system76.com>
Gerrit-Attention: Michał Żygowski <michal.zygowski(a)3mdeb.com>
Gerrit-Attention: Jeremy Soller <jeremy(a)system76.com>
Gerrit-Attention: Elyes Haouas <ehaouas(a)noos.fr>
Gerrit-Attention: Piotr Król <piotr.krol(a)3mdeb.com>
Gerrit-Comment-Date: Sat, 31 Aug 2024 18:47:13 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes