Felix Held has submitted this change. ( https://review.coreboot.org/c/coreboot/+/61514 )
Change subject: drivers/i2c/designware/dw_i2c: limit scope of dw_i2c_transfer
......................................................................
drivers/i2c/designware/dw_i2c: limit scope of dw_i2c_transfer
Outside of the designware I2C driver the generic platform_i2c_transfer
function should be used instead, so don't make dw_i2c_transfer available
outside of this file.
Signed-off-by: Felix Held <felix-coreboot(a)felixheld.de>
Change-Id: Ib8b6a08b6aa2cd63adc2ef69b828661fa0ed154a
Reviewed-on: https://review.coreboot.org/c/coreboot/+/61514
Tested-by: build bot (Jenkins) <no-reply(a)coreboot.org>
Reviewed-by: Raul Rangel <rrangel(a)chromium.org>
---
M src/drivers/i2c/designware/dw_i2c.c
M src/drivers/i2c/designware/dw_i2c.h
2 files changed, 1 insertion(+), 8 deletions(-)
Approvals:
build bot (Jenkins): Verified
Raul Rangel: Looks good to me, approved
diff --git a/src/drivers/i2c/designware/dw_i2c.c b/src/drivers/i2c/designware/dw_i2c.c
index 011b38b..bfb5971 100644
--- a/src/drivers/i2c/designware/dw_i2c.c
+++ b/src/drivers/i2c/designware/dw_i2c.c
@@ -453,7 +453,7 @@
return ret;
}
-enum cb_err dw_i2c_transfer(unsigned int bus, const struct i2c_msg *msg, size_t count)
+static enum cb_err dw_i2c_transfer(unsigned int bus, const struct i2c_msg *msg, size_t count)
{
const struct i2c_msg *orig_msg = msg;
size_t i;
diff --git a/src/drivers/i2c/designware/dw_i2c.h b/src/drivers/i2c/designware/dw_i2c.h
index 847b6c3..3d8e663 100644
--- a/src/drivers/i2c/designware/dw_i2c.h
+++ b/src/drivers/i2c/designware/dw_i2c.h
@@ -110,13 +110,6 @@
struct dw_i2c_speed_config *config);
/*
- * Process given I2C segments in a single transfer
- */
-enum cb_err dw_i2c_transfer(unsigned int bus,
- const struct i2c_msg *segments,
- size_t count);
-
-/*
* Map an i2c host controller device to a logical bus number.
* Return value:
* -1 = failure
--
To view, visit https://review.coreboot.org/c/coreboot/+/61514
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: Ib8b6a08b6aa2cd63adc2ef69b828661fa0ed154a
Gerrit-Change-Number: 61514
Gerrit-PatchSet: 2
Gerrit-Owner: Felix Held <felix-coreboot(a)felixheld.de>
Gerrit-Reviewer: Felix Held <felix-coreboot(a)felixheld.de>
Gerrit-Reviewer: Raul Rangel <rrangel(a)chromium.org>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-MessageType: merged
Attention is currently required from: Subrata Banik, Matt DeVillier, Tim Wawrzynczak, Sridhar Siricilla, Angel Pons, Nick Vaccaro, Patrick Rudolph, EricR Lai.
Lean Sheng Tan has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/61433 )
Change subject: soc/intel/skylake: Use PCR write to disable HECI1
......................................................................
Patch Set 10: Code-Review+2
--
To view, visit https://review.coreboot.org/c/coreboot/+/61433
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: Ib6bfa7c48660a6df8d0944de675a4f30fe248d1b
Gerrit-Change-Number: 61433
Gerrit-PatchSet: 10
Gerrit-Owner: Subrata Banik <subratabanik(a)google.com>
Gerrit-Reviewer: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-Reviewer: EricR Lai <ericr_lai(a)compal.corp-partner.google.com>
Gerrit-Reviewer: Lean Sheng Tan <sheng.tan(a)9elements.com>
Gerrit-Reviewer: Matt DeVillier <matt.devillier(a)gmail.com>
Gerrit-Reviewer: Nick Vaccaro <nvaccaro(a)google.com>
Gerrit-Reviewer: Patrick Rudolph <siro(a)das-labor.org>
Gerrit-Reviewer: Tim Wawrzynczak <twawrzynczak(a)chromium.org>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-CC: Paul Menzel <paulepanter(a)mailbox.org>
Gerrit-CC: Sridhar Siricilla <sridhar.siricilla(a)intel.com>
Gerrit-Attention: Subrata Banik <subratabanik(a)google.com>
Gerrit-Attention: Matt DeVillier <matt.devillier(a)gmail.com>
Gerrit-Attention: Tim Wawrzynczak <twawrzynczak(a)chromium.org>
Gerrit-Attention: Sridhar Siricilla <sridhar.siricilla(a)intel.com>
Gerrit-Attention: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-Attention: Nick Vaccaro <nvaccaro(a)google.com>
Gerrit-Attention: Patrick Rudolph <siro(a)das-labor.org>
Gerrit-Attention: EricR Lai <ericr_lai(a)compal.corp-partner.google.com>
Gerrit-Comment-Date: Tue, 01 Feb 2022 17:53:49 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment
Felix Held has submitted this change. ( https://review.coreboot.org/c/coreboot/+/61511 )
Change subject: drivers/i2c/designware/dw_i2c: return enum cb_err from dw_i2c_init
......................................................................
drivers/i2c/designware/dw_i2c: return enum cb_err from dw_i2c_init
Using enum cb_err as return type instead of int improves the readability
of the code.
Signed-off-by: Felix Held <felix-coreboot(a)felixheld.de>
Change-Id: I55e6d93ca141b687871ceaa763bbbbe966c4b4a3
Reviewed-on: https://review.coreboot.org/c/coreboot/+/61511
Tested-by: build bot (Jenkins) <no-reply(a)coreboot.org>
Reviewed-by: Raul Rangel <rrangel(a)chromium.org>
Reviewed-by: Jason Glenesk <jason.glenesk(a)gmail.com>
---
M src/drivers/i2c/designware/dw_i2c.c
M src/drivers/i2c/designware/dw_i2c.h
M src/soc/amd/common/block/i2c/i2c.c
M src/soc/intel/common/block/i2c/i2c.c
4 files changed, 10 insertions(+), 13 deletions(-)
Approvals:
build bot (Jenkins): Verified
Raul Rangel: Looks good to me, approved
Jason Glenesk: Looks good to me, but someone else must approve
diff --git a/src/drivers/i2c/designware/dw_i2c.c b/src/drivers/i2c/designware/dw_i2c.c
index ec34f42..e29d54f 100644
--- a/src/drivers/i2c/designware/dw_i2c.c
+++ b/src/drivers/i2c/designware/dw_i2c.c
@@ -687,33 +687,33 @@
* The bus speed can be passed in Hz or using values from device/i2c.h and
* will default to I2C_SPEED_FAST if it is not provided.
*/
-int dw_i2c_init(unsigned int bus, const struct dw_i2c_bus_config *bcfg)
+enum cb_err dw_i2c_init(unsigned int bus, const struct dw_i2c_bus_config *bcfg)
{
struct dw_i2c_regs *regs;
enum i2c_speed speed;
if (!bcfg)
- return -1;
+ return CB_ERR;
speed = bcfg->speed ? : I2C_SPEED_FAST;
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 -1;
+ return CB_ERR;
}
if (read32(®s->comp_type) != DW_I2C_COMP_TYPE) {
printk(BIOS_ERR, "I2C bus %u has unknown type 0x%x.\n", bus,
read32(®s->comp_type));
- return -1;
+ return CB_ERR;
}
printk(BIOS_DEBUG, "I2C bus %u version 0x%x\n", bus, read32(®s->comp_version));
if (dw_i2c_disable(regs) != CB_SUCCESS) {
printk(BIOS_ERR, "I2C timeout disabling bus %u\n", bus);
- return -1;
+ return CB_ERR;
}
/* Put controller in master mode with restart enabled */
@@ -723,7 +723,7 @@
/* Set bus speed to FAST by default */
if (dw_i2c_set_speed(bus, speed, bcfg) != CB_SUCCESS) {
printk(BIOS_ERR, "I2C failed to set speed for bus %u\n", bus);
- return -1;
+ return CB_ERR;
}
/* Set RX/TX thresholds to smallest values */
@@ -736,7 +736,7 @@
printk(BIOS_INFO, "DW I2C bus %u at %p (%u KHz)\n",
bus, regs, speed / KHz);
- return 0;
+ return CB_SUCCESS;
}
/*
diff --git a/src/drivers/i2c/designware/dw_i2c.h b/src/drivers/i2c/designware/dw_i2c.h
index c010b11..64e27c0 100644
--- a/src/drivers/i2c/designware/dw_i2c.h
+++ b/src/drivers/i2c/designware/dw_i2c.h
@@ -95,11 +95,8 @@
/*
* Initialize this bus controller and set the speed
- * Return value:
- * -1 = failure
- * 0 = success
*/
-int dw_i2c_init(unsigned int bus, const struct dw_i2c_bus_config *bcfg);
+enum cb_err dw_i2c_init(unsigned int bus, const struct dw_i2c_bus_config *bcfg);
/*
* Generate speed config based on clock
diff --git a/src/soc/amd/common/block/i2c/i2c.c b/src/soc/amd/common/block/i2c/i2c.c
index a70645c..733ad88 100644
--- a/src/soc/amd/common/block/i2c/i2c.c
+++ b/src/soc/amd/common/block/i2c/i2c.c
@@ -96,7 +96,7 @@
cfg->early_init != is_early_init)
continue;
- if (dw_i2c_init(bus, cfg)) {
+ if (dw_i2c_init(bus, cfg) != CB_SUCCESS) {
printk(BIOS_ERR, "Failed to init i2c bus %u\n", bus);
continue;
}
diff --git a/src/soc/intel/common/block/i2c/i2c.c b/src/soc/intel/common/block/i2c/i2c.c
index acc23ab..7fdf818 100644
--- a/src/soc/intel/common/block/i2c/i2c.c
+++ b/src/soc/intel/common/block/i2c/i2c.c
@@ -72,7 +72,7 @@
lpss_set_power_state(dev, STATE_D0);
/* Initialize the controller */
- if (dw_i2c_init(bus, config) < 0) {
+ if (dw_i2c_init(bus, config) != CB_SUCCESS) {
printk(BIOS_ERR, "I2C%u failed to initialize\n", bus);
return -1;
}
--
To view, visit https://review.coreboot.org/c/coreboot/+/61511
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I55e6d93ca141b687871ceaa763bbbbe966c4b4a3
Gerrit-Change-Number: 61511
Gerrit-PatchSet: 2
Gerrit-Owner: Felix Held <felix-coreboot(a)felixheld.de>
Gerrit-Reviewer: Felix Held <felix-coreboot(a)felixheld.de>
Gerrit-Reviewer: Jason Glenesk <jason.glenesk(a)gmail.com>
Gerrit-Reviewer: Marshall Dawson <marshalldawson3rd(a)gmail.com>
Gerrit-Reviewer: Patrick Rudolph <siro(a)das-labor.org>
Gerrit-Reviewer: Raul Rangel <rrangel(a)chromium.org>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-MessageType: merged
Attention is currently required from: Arthur Heymans, Felix Singer, Subrata Banik, Tim Wawrzynczak, Sridhar Siricilla, Angel Pons, Werner Zeh, Patrick Rudolph, EricR Lai.
Lean Sheng Tan has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/60405 )
Change subject: soc/intel/common/block/notify: Implement coreboot notify native driver
......................................................................
Patch Set 19:
(1 comment)
Commit Message:
https://review.coreboot.org/c/coreboot/+/60405/comment/4fb2177c_28506c25
PS19, Line 7: soc/intel/common/block/notify: Implement coreboot notify native driver
> > May I know motivation to port notify API to coreboot? Is it not redundant maintain the function (o […]
The design philosophy behind coreboot is straightforward - to empower user with control and choices. There is always a kconfig to choose if you prefer the fsp way :)
--
To view, visit https://review.coreboot.org/c/coreboot/+/60405
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I70bde33f77026e8be165ff082defe3cab6686ec7
Gerrit-Change-Number: 60405
Gerrit-PatchSet: 19
Gerrit-Owner: Subrata Banik <subratabanik(a)google.com>
Gerrit-Reviewer: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-Reviewer: EricR Lai <ericr_lai(a)compal.corp-partner.google.com>
Gerrit-Reviewer: Felix Singer <felixsinger(a)posteo.net>
Gerrit-Reviewer: Lean Sheng Tan <sheng.tan(a)9elements.com>
Gerrit-Reviewer: Patrick Rudolph <siro(a)das-labor.org>
Gerrit-Reviewer: Tim Wawrzynczak <twawrzynczak(a)chromium.org>
Gerrit-Reviewer: Werner Zeh <werner.zeh(a)siemens.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-CC: Arthur Heymans <arthur.heymans(a)9elements.com>
Gerrit-CC: Paul Menzel <paulepanter(a)mailbox.org>
Gerrit-CC: Sridhar Siricilla <sridhar.siricilla(a)intel.com>
Gerrit-Attention: Arthur Heymans <arthur.heymans(a)9elements.com>
Gerrit-Attention: Felix Singer <felixsinger(a)posteo.net>
Gerrit-Attention: Subrata Banik <subratabanik(a)google.com>
Gerrit-Attention: Tim Wawrzynczak <twawrzynczak(a)chromium.org>
Gerrit-Attention: Sridhar Siricilla <sridhar.siricilla(a)intel.com>
Gerrit-Attention: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-Attention: Werner Zeh <werner.zeh(a)siemens.com>
Gerrit-Attention: Patrick Rudolph <siro(a)das-labor.org>
Gerrit-Attention: EricR Lai <ericr_lai(a)compal.corp-partner.google.com>
Gerrit-Comment-Date: Tue, 01 Feb 2022 17:51:19 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Arthur Heymans <arthur.heymans(a)9elements.com>
Comment-In-Reply-To: Sridhar Siricilla <sridhar.siricilla(a)intel.com>
Gerrit-MessageType: comment
Felix Held has submitted this change. ( https://review.coreboot.org/c/coreboot/+/61509 )
Change subject: drivers/i2c/designware/dw_i2c.h: include types.h instead of stdint.h
......................................................................
drivers/i2c/designware/dw_i2c.h: include types.h instead of stdint.h
size_t is defined in stddef.h and not stdint.h, so include types.h to
get both.
Signed-off-by: Felix Held <felix-coreboot(a)felixheld.de>
Change-Id: I3782d3a949b72d1530ebd8078c46bc695f76dc4f
Reviewed-on: https://review.coreboot.org/c/coreboot/+/61509
Tested-by: build bot (Jenkins) <no-reply(a)coreboot.org>
Reviewed-by: Raul Rangel <rrangel(a)chromium.org>
---
M src/drivers/i2c/designware/dw_i2c.h
1 file changed, 1 insertion(+), 1 deletion(-)
Approvals:
build bot (Jenkins): Verified
Raul Rangel: Looks good to me, approved
diff --git a/src/drivers/i2c/designware/dw_i2c.h b/src/drivers/i2c/designware/dw_i2c.h
index e20a5d1..c010b11 100644
--- a/src/drivers/i2c/designware/dw_i2c.h
+++ b/src/drivers/i2c/designware/dw_i2c.h
@@ -5,7 +5,7 @@
#include <device/device.h>
#include <device/i2c.h>
-#include <stdint.h>
+#include <types.h>
#if CONFIG(DRIVERS_I2C_DESIGNWARE_DEBUG)
#define DW_I2C_DEBUG BIOS_DEBUG
--
To view, visit https://review.coreboot.org/c/coreboot/+/61509
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I3782d3a949b72d1530ebd8078c46bc695f76dc4f
Gerrit-Change-Number: 61509
Gerrit-PatchSet: 2
Gerrit-Owner: Felix Held <felix-coreboot(a)felixheld.de>
Gerrit-Reviewer: Felix Held <felix-coreboot(a)felixheld.de>
Gerrit-Reviewer: Raul Rangel <rrangel(a)chromium.org>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-MessageType: merged
Felix Held has submitted this change. ( https://review.coreboot.org/c/coreboot/+/61508 )
Change subject: drivers/i2c/designware/dw_i2c: add missing types.h include
......................................................................
drivers/i2c/designware/dw_i2c: add missing types.h include
This will provide the definitions for size_t, uint32_t and uintptr_t.
Signed-off-by: Felix Held <felix-coreboot(a)felixheld.de>
Change-Id: Icda8d458565bf981545d720d612cbdace04bedd4
Reviewed-on: https://review.coreboot.org/c/coreboot/+/61508
Tested-by: build bot (Jenkins) <no-reply(a)coreboot.org>
Reviewed-by: Raul Rangel <rrangel(a)chromium.org>
---
M src/drivers/i2c/designware/dw_i2c.c
1 file changed, 1 insertion(+), 0 deletions(-)
Approvals:
build bot (Jenkins): Verified
Raul Rangel: Looks good to me, approved
diff --git a/src/drivers/i2c/designware/dw_i2c.c b/src/drivers/i2c/designware/dw_i2c.c
index a6498fb..1f7433e 100644
--- a/src/drivers/i2c/designware/dw_i2c.c
+++ b/src/drivers/i2c/designware/dw_i2c.c
@@ -8,6 +8,7 @@
#include <device/i2c_simple.h>
#include <string.h>
#include <timer.h>
+#include <types.h>
#include "dw_i2c.h"
/* Use a ~10ms timeout for various operations */
--
To view, visit https://review.coreboot.org/c/coreboot/+/61508
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: Icda8d458565bf981545d720d612cbdace04bedd4
Gerrit-Change-Number: 61508
Gerrit-PatchSet: 2
Gerrit-Owner: Felix Held <felix-coreboot(a)felixheld.de>
Gerrit-Reviewer: Felix Held <felix-coreboot(a)felixheld.de>
Gerrit-Reviewer: Raul Rangel <rrangel(a)chromium.org>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-MessageType: merged
Attention is currently required from: Felix Singer, Subrata Banik, Tim Wawrzynczak, Sridhar Siricilla, Angel Pons, Werner Zeh, Patrick Rudolph, EricR Lai.
Arthur Heymans has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/60405 )
Change subject: soc/intel/common/block/notify: Implement coreboot notify native driver
......................................................................
Patch Set 19:
(1 comment)
Commit Message:
https://review.coreboot.org/c/coreboot/+/60405/comment/eff8c406_94eb3364
PS19, Line 7: soc/intel/common/block/notify: Implement coreboot notify native driver
> May I know motivation to port notify API to coreboot? Is it not redundant maintain the function (one by CB and other one by SoC team)? Unless coreboot adds more to FSP notify, then I feel worth to port. WDYT?
There already is overlap between FSP and coreboot in different places. That's why some codepaths in FSP are optional. Coreboot is open source and FSP is not. Having functionality natively in coreboot should not need motivation when the alternative is a closed source binary...
--
To view, visit https://review.coreboot.org/c/coreboot/+/60405
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I70bde33f77026e8be165ff082defe3cab6686ec7
Gerrit-Change-Number: 60405
Gerrit-PatchSet: 19
Gerrit-Owner: Subrata Banik <subratabanik(a)google.com>
Gerrit-Reviewer: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-Reviewer: EricR Lai <ericr_lai(a)compal.corp-partner.google.com>
Gerrit-Reviewer: Felix Singer <felixsinger(a)posteo.net>
Gerrit-Reviewer: Lean Sheng Tan <sheng.tan(a)9elements.com>
Gerrit-Reviewer: Patrick Rudolph <siro(a)das-labor.org>
Gerrit-Reviewer: Tim Wawrzynczak <twawrzynczak(a)chromium.org>
Gerrit-Reviewer: Werner Zeh <werner.zeh(a)siemens.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-CC: Arthur Heymans <arthur.heymans(a)9elements.com>
Gerrit-CC: Paul Menzel <paulepanter(a)mailbox.org>
Gerrit-CC: Sridhar Siricilla <sridhar.siricilla(a)intel.com>
Gerrit-Attention: Felix Singer <felixsinger(a)posteo.net>
Gerrit-Attention: Subrata Banik <subratabanik(a)google.com>
Gerrit-Attention: Tim Wawrzynczak <twawrzynczak(a)chromium.org>
Gerrit-Attention: Sridhar Siricilla <sridhar.siricilla(a)intel.com>
Gerrit-Attention: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-Attention: Werner Zeh <werner.zeh(a)siemens.com>
Gerrit-Attention: Patrick Rudolph <siro(a)das-labor.org>
Gerrit-Attention: EricR Lai <ericr_lai(a)compal.corp-partner.google.com>
Gerrit-Comment-Date: Tue, 01 Feb 2022 17:47:07 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Sridhar Siricilla <sridhar.siricilla(a)intel.com>
Gerrit-MessageType: comment