Hello Kaiyen Chang,
I'd like you to do a code review. Please visit
https://review.coreboot.org/c/coreboot/+/48302
to review the following change.
Change subject: soc/intel/common/gpio_defs: Add a macro for EDGE_BOTH trigger pad ......................................................................
soc/intel/common/gpio_defs: Add a macro for EDGE_BOTH trigger pad
Adds a new macro to configure the pad to EDGE_BOTH trigger mode.
BUG=b:174336541 TEST=emerge-dedede coreboot
Signed-off-by: Kaiyen Chang kaiyen.chang@intel.corp-partner.google.com Change-Id: Icc805f5cfe45e5cc991fb0561f669907ac454a03 --- M src/soc/intel/common/block/include/intelblocks/gpio_defs.h 1 file changed, 6 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/02/48302/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 422720b..f082470 100644 --- a/src/soc/intel/common/block/include/intelblocks/gpio_defs.h +++ b/src/soc/intel/common/block/include/intelblocks/gpio_defs.h @@ -276,6 +276,12 @@ PAD_FUNC(GPIO) | PAD_RESET(rst) | PAD_BUF(TX_DISABLE), \ PAD_PULL(pull) | PAD_CFG_OWN_GPIO(DRIVER) | PAD_IOSSTATE(TxDRxE))
+#define PAD_CFG_GPI_GPIO_DRIVER_EDGE_BOTH(pad, pull, rst) \ + _PAD_CFG_STRUCT(pad, \ + PAD_FUNC(GPIO) | PAD_RESET(rst) | PAD_BUF(TX_DISABLE) | \ + PAD_CFG0_TRIG_EDGE_BOTH, \ + PAD_PULL(pull) | PAD_CFG_OWN_GPIO(DRIVER) | PAD_IOSSTATE(TxDRxE)) + #define PAD_CFG_GPIO_DRIVER_HI_Z(pad, pull, rst, iosstate, iosterm) \ _PAD_CFG_STRUCT(pad, \ PAD_FUNC(GPIO) | PAD_RESET(rst) | PAD_BUF(TX_RX_DISABLE), \
Kaiyen Chang has uploaded a new patch set (#2) to the change originally created by Kaiyen Chang. ( https://review.coreboot.org/c/coreboot/+/48302 )
Change subject: soc/intel/common/gpio_defs: Add a macro for EDGE_BOTH trigger pad ......................................................................
soc/intel/common/gpio_defs: Add a macro for EDGE_BOTH trigger pad
Adds a new macro to configure the pad to EDGE_BOTH trigger mode.
This macro is used in the pad configuration for Dedede boards. See CB:48303.
BUG=b:174336541 TEST=emerge-dedede coreboot
Signed-off-by: Kaiyen Chang kaiyen.chang@intel.corp-partner.google.com Change-Id: Icc805f5cfe45e5cc991fb0561f669907ac454a03 --- M src/soc/intel/common/block/include/intelblocks/gpio_defs.h 1 file changed, 6 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/02/48302/2
Hello build bot (Jenkins), Kaiyen Chang, Patrick Rudolph,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/48302
to look at the new patch set (#3).
Change subject: soc/intel/common/gpio_defs: Add a macro for EDGE_BOTH trigger pad ......................................................................
soc/intel/common/gpio_defs: Add a macro for EDGE_BOTH trigger pad
Adds a new macro to configure the pad to EDGE_BOTH trigger mode.
This macro is used in the pad configuration for Dedede boards. See CB:48303.
BUG=b:174336541 TEST=emerge-dedede coreboot
Signed-off-by: Kaiyen Chang kaiyen.chang@intel.corp-partner.google.com Change-Id: Icc805f5cfe45e5cc991fb0561f669907ac454a03 --- M src/soc/intel/common/block/include/intelblocks/gpio_defs.h 1 file changed, 6 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/02/48302/3
Furquan Shaikh has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/48302 )
Change subject: soc/intel/common/gpio_defs: Add a macro for EDGE_BOTH trigger pad ......................................................................
Patch Set 3:
(1 comment)
https://review.coreboot.org/c/coreboot/+/48302/3/src/soc/intel/common/block/... File src/soc/intel/common/block/include/intelblocks/gpio_defs.h:
https://review.coreboot.org/c/coreboot/+/48302/3/src/soc/intel/common/block/... PS3, Line 276: , I think the actual problem here is that PAD_CFG_GPI_GPIO_DRIVER isn't configuring trigger as PAD_TRIG(OFF).
The way GPIO interrupts are handled is: 1. Pad is configured as input in coreboot. 2. Pad IRQ information is passed in ACPI tables to kernel. 3. Kernel configures the required pad trigger.
This is the reason why `PAD_CFG_GPI_GPIO_DRIVER_EDGE_BOTH` doesn't exist in coreboot. Can you please try adding PAD_TRIG(OFF) here and check if that fixes the issue for you?
Kaiyen Chang has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/48302 )
Change subject: soc/intel/common/gpio_defs: Add a macro for EDGE_BOTH trigger pad ......................................................................
Patch Set 3:
(1 comment)
https://review.coreboot.org/c/coreboot/+/48302/3/src/soc/intel/common/block/... File src/soc/intel/common/block/include/intelblocks/gpio_defs.h:
https://review.coreboot.org/c/coreboot/+/48302/3/src/soc/intel/common/block/... PS3, Line 276: ,
I think the actual problem here is that PAD_CFG_GPI_GPIO_DRIVER isn't configuring trigger as PAD_TRI […]
Thanks for your comment. I will try it. Your description for GPIO interrupts handling is correct, but I'm not sure if there are other GPIO settings rely on current setting (I mean didn't turn the TRIG off here) because maybe they (Depthcharge or Kernel) don't configure the interrupts correctly. I'm not sure if it will be better that we create another macro for GPI_GPIO setting with PAD_TRIG(OFF), instead of directly adding PAD_TRIG(OFF) here? What do you think?
Furquan Shaikh has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/48302 )
Change subject: soc/intel/common/gpio_defs: Add a macro for EDGE_BOTH trigger pad ......................................................................
Patch Set 3:
(1 comment)
https://review.coreboot.org/c/coreboot/+/48302/3/src/soc/intel/common/block/... File src/soc/intel/common/block/include/intelblocks/gpio_defs.h:
https://review.coreboot.org/c/coreboot/+/48302/3/src/soc/intel/common/block/... PS3, Line 276: ,
Thanks for your comment. I will try it. […]
I think it is just a miss. We should not rely on the trigger being configured in coreboot and just set it to off. Kernel is responsible for configuring the interrupts and it should set up the trigger correctly. I think it is okay to update the same macro to set PAD_TRIG(OFF) rather than creating a new macro (Reason is that more macros = more confusion and in this case the right thing to do is keep trigger off).
Kaiyen Chang has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/48302 )
Change subject: soc/intel/common/gpio_defs: Add a macro for EDGE_BOTH trigger pad ......................................................................
Patch Set 3:
(1 comment)
https://review.coreboot.org/c/coreboot/+/48302/3/src/soc/intel/common/block/... File src/soc/intel/common/block/include/intelblocks/gpio_defs.h:
https://review.coreboot.org/c/coreboot/+/48302/3/src/soc/intel/common/block/... PS3, Line 276: ,
I think it is just a miss. […]
Got it!
Kaiyen Chang has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/48302 )
Change subject: soc/intel/common/gpio_defs: Add PAD_TRIG(OFF) in PAD_CFG_GPI_GPIO_DRIVER ......................................................................
Set Ready For Review
Kaiyen Chang has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/48302 )
Change subject: soc/intel/common/gpio_defs: Add PAD_TRIG(OFF) in PAD_CFG_GPI_GPIO_DRIVER ......................................................................
Patch Set 7:
(1 comment)
https://review.coreboot.org/c/coreboot/+/48302/3/src/soc/intel/common/block/... File src/soc/intel/common/block/include/intelblocks/gpio_defs.h:
https://review.coreboot.org/c/coreboot/+/48302/3/src/soc/intel/common/block/... PS3, Line 276: ,
Got it!
Done
Furquan Shaikh has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/48302 )
Change subject: soc/intel/common/gpio_defs: Add PAD_TRIG(OFF) in PAD_CFG_GPI_GPIO_DRIVER ......................................................................
Patch Set 7: Code-Review+2
EricR Lai has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/48302 )
Change subject: soc/intel/common/gpio_defs: Add PAD_TRIG(OFF) in PAD_CFG_GPI_GPIO_DRIVER ......................................................................
Patch Set 7: Code-Review+2
Patrick Georgi has submitted this change. ( https://review.coreboot.org/c/coreboot/+/48302 )
Change subject: soc/intel/common/gpio_defs: Add PAD_TRIG(OFF) in PAD_CFG_GPI_GPIO_DRIVER ......................................................................
soc/intel/common/gpio_defs: Add PAD_TRIG(OFF) in PAD_CFG_GPI_GPIO_DRIVER
Probabilistic interrupt storm is observed while kernel is configuring the GPIO for SD card CD pin. The root cause is that the macro PAD_CFG_GPI_GPIO_DRIVER isn't configuring trigger as PAD_TRIG(OFF).
The way GPIO interrupts are handled is: 1. Pad is configured as input in coreboot. 2. Pad IRQ information is passed in ACPI tables to kernel. 3. Kernel configures the required pad trigger.
Therefore, PAD_TRIG(OFF) should be added in PAD_CFG_GPI_GPIO_DRIVER to turn off the trigger while pad is configured as input in coreboot and then let kernel to configure the required pad trigger.
BUG=b:174336541 TEST=Run 1500 reboot iterations successfully without any interrupts storm.
Signed-off-by: Kaiyen Chang kaiyen.chang@intel.corp-partner.google.com Change-Id: Icc805f5cfe45e5cc991fb0561f669907ac454a03 Reviewed-on: https://review.coreboot.org/c/coreboot/+/48302 Tested-by: build bot (Jenkins) no-reply@coreboot.org Reviewed-by: Furquan Shaikh furquan@google.com Reviewed-by: EricR Lai ericr_lai@compal.corp-partner.google.com --- M src/soc/intel/common/block/include/intelblocks/gpio_defs.h 1 file changed, 2 insertions(+), 1 deletion(-)
Approvals: build bot (Jenkins): Verified Furquan Shaikh: Looks good to me, approved EricR Lai: Looks good to me, approved
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 422720b..2d6f62a 100644 --- a/src/soc/intel/common/block/include/intelblocks/gpio_defs.h +++ b/src/soc/intel/common/block/include/intelblocks/gpio_defs.h @@ -273,7 +273,8 @@
#define PAD_CFG_GPI_GPIO_DRIVER(pad, pull, rst) \ _PAD_CFG_STRUCT(pad, \ - PAD_FUNC(GPIO) | PAD_RESET(rst) | PAD_BUF(TX_DISABLE), \ + PAD_FUNC(GPIO) | PAD_RESET(rst) | \ + PAD_TRIG(OFF) | PAD_BUF(TX_DISABLE), \ PAD_PULL(pull) | PAD_CFG_OWN_GPIO(DRIVER) | PAD_IOSSTATE(TxDRxE))
#define PAD_CFG_GPIO_DRIVER_HI_Z(pad, pull, rst, iosstate, iosterm) \