Furquan Shaikh has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/32514
Change subject: soc/intel/common: Set RX_DISABLE for pads configured as NC
......................................................................
soc/intel/common: Set RX_DISABLE for pads configured as NC
For GPIO pads that are configured as no-connect (PAD_NC), setting it
as GPI (with Rx enabled) leads to GPE0_STS being set
incorrectly. Though this is not an issue in practice (GPE0_EN is not
set, so no events triggered), it can confuse users when debugging GPE
related issues.
This change configures PAD_NC to have Rx disabled along with Tx to
ensure that it does not end up setting GPE0_STS bits for unwanted
GPIO pads.
P.S.: IOSSTATE config does not have a TxDRxD setting, so leaving that
configuration as is.
BUG=b:129235068
TEST=Verified that GPE0_STS bits are not set for pads that are marked
as PAD_NC.
Change-Id: I726cc7b86a94e7449352cd8a8806d4d775c593dc
Signed-off-by: Furquan Shaikh <furquan(a)google.com>
---
M src/soc/intel/common/block/include/intelblocks/gpio_defs.h
1 file changed, 9 insertions(+), 3 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/14/32514/1
diff --git a/src/soc/intel/common/block/include/intelblocks/gpio_defs.h b/src/soc/intel/common/block/include/intelblocks/gpio_defs.h
index 0ad3e5c..91d8f00 100644
--- a/src/soc/intel/common/block/include/intelblocks/gpio_defs.h
+++ b/src/soc/intel/common/block/include/intelblocks/gpio_defs.h
@@ -264,10 +264,16 @@
PAD_CFG0_TRIG_##trig | PAD_CFG0_RX_POL_NONE, \
PAD_PULL(pull) | PAD_CFG1_GPIO_DRIVER | PAD_IOSSTATE(TxDRxE))
-/* No Connect configuration for unused pad.
- * NC should be GPI with Term as PU20K, PD20K, NONE depending upon default Term
+/*
+ * No Connect configuration for unused pad.
+ * Both TX and RX are disabled. RX disabling is done to avoid unnecessary
+ * setting of GPI_STS.
*/
-#define PAD_NC(pad, pull) PAD_CFG_GPI(pad, pull, DEEP)
+#define PAD_NC(pad, pull) \
+ _PAD_CFG_STRUCT(pad, \
+ PAD_FUNC(GPIO) | PAD_RESET(DEEP) | \
+ PAD_CFG0_TX_DISABLE | PAD_CFG0_RX_DISABLE, \
+ PAD_PULL(pull) | PAD_IOSSTATE(TxDRxE))
#if CONFIG(SOC_INTEL_COMMON_BLOCK_GPIO_LEGACY_MACROS)
--
To view, visit https://review.coreboot.org/c/coreboot/+/32514
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I726cc7b86a94e7449352cd8a8806d4d775c593dc
Gerrit-Change-Number: 32514
Gerrit-PatchSet: 1
Gerrit-Owner: Furquan Shaikh <furquan(a)google.com>
Gerrit-MessageType: newchange
Julius Werner has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/29104 )
Change subject: sdm845: Port I2C driver
......................................................................
Patch Set 31:
(8 comments)
https://review.coreboot.org/#/c/29104/31/src/soc/qualcomm/sdm845/i2c.c
File src/soc/qualcomm/sdm845/i2c.c:
https://review.coreboot.org/#/c/29104/31/src/soc/qualcomm/sdm845/i2c.c@44
PS31, Line 44: struct qup_i2c_clk_fld *itr = qup_i2c_clk_map + idx;
When you rewrite this to use the generic enum (see other file), I'd write this stuff like this instead:
int clk_div, t_high, t_low, t_cycle;
switch (speed) {
case I2C_SPEED_STANDARD:
clk_div = 7;
t_high = 10;
t_low = 11;
t_cycle = 26;
case I2C_SPEED_FAST:
...
default:
die("Unsupported I2C speed");
}
https://review.coreboot.org/#/c/29104/31/src/soc/qualcomm/sdm845/i2c.c@89
PS31, Line 89: (BITS_PER_WORD >> 4));
What about rewriting this to log2(BITS_PER_WORD) - 3? You said "Done" to that, but it looks like you didn't actually do it.
https://review.coreboot.org/#/c/29104/31/src/soc/qualcomm/sdm845/i2c.c@130
PS31, Line 130: segment.buf, segment.buf
Note that if you combine the three size parameters into one like I'm suggesting in the other file, you can't pass both din and dout here. You'd have to do something like
void *din = NULL, *dout = NULL;
if (!(segment.flags & I2C_M_RD)) {
dout = segment.buf;
...
} else {
din = segment.buf;
...
}
https://review.coreboot.org/#/c/29104/31/src/soc/qualcomm/sdm845/include/so…
File src/soc/qualcomm/sdm845/include/soc/i2c.h:
https://review.coreboot.org/#/c/29104/31/src/soc/qualcomm/sdm845/include/so…
PS31, Line 23: };
Actually, looks like we have an existing enum for this in <device/i2c.h> (I2C_SPEED_FAST, etc.), can you use that instead?
https://review.coreboot.org/#/c/29104/31/src/soc/qualcomm/sdm845/qcom_qup_s…
File src/soc/qualcomm/sdm845/qcom_qup_se.c:
https://review.coreboot.org/#/c/29104/31/src/soc/qualcomm/sdm845/qcom_qup_s…
PS31, Line 101: u32 wait_till_irq_set(unsigned int bus)
I think all of these functions other than qup_isr_handle() could be static?
If you do want to export them, they should probably be better namespaced (e.g. qup_wait_for_irq, qup_handle_tx, etc.).
https://review.coreboot.org/#/c/29104/31/src/soc/qualcomm/sdm845/qcom_qup_s…
PS31, Line 118:
Please fix indentation.
https://review.coreboot.org/#/c/29104/31/src/soc/qualcomm/sdm845/qcom_qup_s…
PS31, Line 184: qup_isr_handle
"ISR handle" sounds a bit weird for that this function actually does (which is handle a full transfer except for the setup part). Maybe qup_handle_transfer() or qup_finish_transfer() would be better?
https://review.coreboot.org/#/c/29104/31/src/soc/qualcomm/sdm845/qcom_qup_s…
PS31, Line 185: unsigned int tx_rem_bytes, unsigned int rx_rem_bytes)
You shouldn't need to pass all of size, tx_rem_bytes and rx_rem_bytes. They should all be the same (unless one of the transfer directions is NULL). You should only have a size, and then set up local variables for the other two:
unsigned int rx_rem_bytes = din ? size : 0;
unsigned int tx_rem_bytes = dout ? size : 0;
--
To view, visit https://review.coreboot.org/c/coreboot/+/29104
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: Ifb76564d8a11427423dd14d8ba7c8c7d500ef346
Gerrit-Change-Number: 29104
Gerrit-PatchSet: 31
Gerrit-Owner: T.Michael Turney <tturne(a)codeaurora.org>
Gerrit-Reviewer: Akash Asthana <akashast(a)qualcomm.corp-partner.google.com>
Gerrit-Reviewer: Julius Werner <jwerner(a)chromium.org>
Gerrit-Reviewer: Martin Roth <martinroth(a)google.com>
Gerrit-Reviewer: Patrick Georgi <pgeorgi(a)google.com>
Gerrit-Reviewer: T Michael Turney <mturney(a)codeaurora.org>
Gerrit-Reviewer: T.Michael Turney <tturne(a)codeaurora.org>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-CC: Paul Menzel <paulepanter(a)users.sourceforge.net>
Gerrit-Comment-Date: Wed, 01 May 2019 00:52:40 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment
Julius Werner has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/27483 )
Change subject: sdm845: Add SPI QUP driver
......................................................................
Patch Set 51:
(4 comments)
Thanks, this looks good now... but it is interdependent with the I2C patch. This patch adds the underlying qcom_qup_se.c stuff, but the I2C patch adds qup_isr_handle() which this patch relies on, so they don't depend on each other. Patches always need to be atomic, so please pull all the shared stuff from the I2C patch into this one.
https://review.coreboot.org/#/c/27483/51/src/mainboard/google/cheza/bootblo…
File src/mainboard/google/cheza/bootblock.c:
https://review.coreboot.org/#/c/27483/51/src/mainboard/google/cheza/bootblo…
PS51, Line 19: #include <soc/qcom_qup_se.h>
nit: please order alphabetically
https://review.coreboot.org/#/c/27483/51/src/soc/qualcomm/sdm845/qspi.c
File src/soc/qualcomm/sdm845/qspi.c:
https://review.coreboot.org/#/c/27483/51/src/soc/qualcomm/sdm845/qspi.c@19
PS51, Line 19: arch
No, this is supposed to be <device/mmio.h>
https://review.coreboot.org/#/c/27483/51/src/soc/qualcomm/sdm845/spi_qup.c
File src/soc/qualcomm/sdm845/spi_qup.c:
https://review.coreboot.org/#/c/27483/51/src/soc/qualcomm/sdm845/spi_qup.c@…
PS51, Line 150: /n"
I think this is supposed to be a \n?
https://review.coreboot.org/#/c/27483/51/src/soc/qualcomm/sdm845/spi_qup.c@…
PS51, Line 153: }
You should actually return an error value here which you can then pass out of qup_spi_claim_bus().
--
To view, visit https://review.coreboot.org/c/coreboot/+/27483
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I35061727d5ccc550eaeb06caef4524bc4cf25b54
Gerrit-Change-Number: 27483
Gerrit-PatchSet: 51
Gerrit-Owner: T.Michael Turney <tturne(a)codeaurora.org>
Gerrit-Reviewer: Martin Roth <martinroth(a)google.com>
Gerrit-Reviewer: Mukesh Savaliya <msavaliy(a)qualcomm.corp-partner.google.com>
Gerrit-Reviewer: Patrick Georgi <pgeorgi(a)google.com>
Gerrit-Reviewer: Paul Menzel <paulepanter(a)users.sourceforge.net>
Gerrit-Reviewer: T Michael Turney <mturney(a)codeaurora.org>
Gerrit-Reviewer: T.Michael Turney <tturne(a)codeaurora.org>
Gerrit-Reviewer: Vin Kamath <vink(a)codeaurora.org>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-CC: Akash Asthana <akashast(a)qualcomm.corp-partner.google.com>
Gerrit-CC: Julius Werner <jwerner(a)chromium.org>
Gerrit-Comment-Date: Wed, 01 May 2019 00:32:28 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment