Hello Tim Chen,
I'd like you to do a code review. Please visit
https://review.coreboot.org/c/coreboot/+/48195
to review the following change.
Change subject: mb/google/dedede/var/metaknight: Add LTE power on/off sequence ......................................................................
mb/google/dedede/var/metaknight: Add LTE power on/off sequence
LTE module used in metaknight has a specific power on/off sequence. GPIOs related to power sequnce are: * GPP_A10 - LTE_PWR_OFF_R_ODL * GPP_H17 - LTE_RESET_R_ODL 1. Power on: GPP_A10 -> 20ms -> GPP_H17 2. Power off: GPP_H17 -> 10ms -> GPP_A10 3. Warm reset: Power off -> 500ms -> Power on Configure the GPIOs based on these requirements.
BUG=b:173671094 TEST=Build and boot Metaknight to OS. Ensure that the LTE module power sequence requirements are met.
Change-Id: Ibff16129dfe2f1de2b1519049244aba4b3123e52 Signed-off-by: Tim Chen tim-chen@quanta.corp-partner.google.com --- A src/mainboard/google/dedede/variants/metaknight/Makefile.inc A src/mainboard/google/dedede/variants/metaknight/gpio.c M src/mainboard/google/dedede/variants/metaknight/overridetree.cb A src/mainboard/google/dedede/variants/metaknight/variant.c 4 files changed, 65 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/95/48195/1
diff --git a/src/mainboard/google/dedede/variants/metaknight/Makefile.inc b/src/mainboard/google/dedede/variants/metaknight/Makefile.inc new file mode 100644 index 0000000..67a7ab2 --- /dev/null +++ b/src/mainboard/google/dedede/variants/metaknight/Makefile.inc @@ -0,0 +1,5 @@ +# SPDX-License-Identifier: GPL-2.0-only + +ramstage-y += gpio.c + +smm-y += variant.c diff --git a/src/mainboard/google/dedede/variants/metaknight/gpio.c b/src/mainboard/google/dedede/variants/metaknight/gpio.c new file mode 100644 index 0000000..259307e --- /dev/null +++ b/src/mainboard/google/dedede/variants/metaknight/gpio.c @@ -0,0 +1,22 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ + +#include <baseboard/gpio.h> +#include <baseboard/variants.h> +#include <commonlib/helpers.h> +#include <vendorcode/google/chromeos/chromeos.h> + +/* Pad configuration in ramstage*/ +static const struct pad_config gpio_table[] = { + /* A10 : WWAN_EN => LTE_PWR_OFF_ODL */ + PAD_CFG_GPO(GPP_A10, 0, PLTRST), + + + /* H17 : WWAN_RST_L => LTE_RESET_R_ODL */ + PAD_CFG_GPO(GPP_H17, 0, PLTRST), +}; + +const struct pad_config *variant_override_gpio_table(size_t *num) +{ + *num = ARRAY_SIZE(gpio_table); + return gpio_table; +} diff --git a/src/mainboard/google/dedede/variants/metaknight/overridetree.cb b/src/mainboard/google/dedede/variants/metaknight/overridetree.cb index d455a47..958ff0d 100644 --- a/src/mainboard/google/dedede/variants/metaknight/overridetree.cb +++ b/src/mainboard/google/dedede/variants/metaknight/overridetree.cb @@ -51,6 +51,16 @@ chip drivers/usb/acpi device usb 0.0 on chip drivers/usb/acpi + register "desc" = ""LTE"" + register "type" = "UPC_TYPE_INTERNAL" + register "has_power_resource" = "1" + register "reset_gpio" = "ACPI_GPIO_OUTPUT_ACTIVE_LOW(GPP_H17)" + register "reset_off_delay_ms" = "10" + register "enable_gpio" = "ACPI_GPIO_OUTPUT_ACTIVE_HIGH(GPP_A10)" + register "enable_delay_ms" = "20" + device usb 2.3 on end + end + chip drivers/usb/acpi register "desc" = ""User Facing Camera"" register "type" = "UPC_TYPE_INTERNAL" device usb 2.5 on end @@ -60,6 +70,11 @@ register "type" = "UPC_TYPE_INTERNAL" device usb 2.6 on end end + chip drivers/usb/acpi + register "desc" = ""LTE"" + register "type" = "UPC_TYPE_INTERNAL" + device usb 3.3 on end + end end end end # USB xHCI diff --git a/src/mainboard/google/dedede/variants/metaknight/variant.c b/src/mainboard/google/dedede/variants/metaknight/variant.c new file mode 100644 index 0000000..2540fc7 --- /dev/null +++ b/src/mainboard/google/dedede/variants/metaknight/variant.c @@ -0,0 +1,23 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ + +#include <acpi/acpi.h> +#include <baseboard/variants.h> +#include <delay.h> +#include <gpio.h> + +static void power_off_lte_module(void) +{ + gpio_output(GPP_H17, 0); + mdelay(10); + gpio_output(GPP_A10, 0); +} + +void variant_smi_sleep(u8 slp_typ) +{ + /* + * Once the FW_CONFIG is provisioned, power off LTE module only under + * the situation where it is stuffed. + */ + if (slp_typ == ACPI_S5) + power_off_lte_module(); +}
Raymond Wong has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/48195 )
Change subject: mb/google/dedede/var/metaknight: Add LTE power on/off sequence ......................................................................
Patch Set 1: Code-Review+1
Karthik Ramasubramanian has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/48195 )
Change subject: mb/google/dedede/var/metaknight: Add LTE power on/off sequence ......................................................................
Patch Set 1:
(1 comment)
https://review.coreboot.org/c/coreboot/+/48195/1//COMMIT_MSG Commit Message:
https://review.coreboot.org/c/coreboot/+/48195/1//COMMIT_MSG@15 PS1, Line 15: Warm reset: Power off -> 500ms -> Power on LTE module vendor recently has been telling us not to power off the module during warm reset.
That means, GPP_A10 has to remain high during warm reset. Only GPP_H17 (reset) GPIO has to go low during the warm reset. Can you please confirm the requirement from the LTE module vendor.
Tim Chen has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/48195 )
Change subject: mb/google/dedede/var/metaknight: Add LTE power on/off sequence ......................................................................
Patch Set 1:
(1 comment)
https://review.coreboot.org/c/coreboot/+/48195/1//COMMIT_MSG Commit Message:
https://review.coreboot.org/c/coreboot/+/48195/1//COMMIT_MSG@15 PS1, Line 15: Warm reset: Power off -> 500ms -> Power on
LTE module vendor recently has been telling us not to power off the module during warm reset. […]
Below is the answer we get from vendor in issue tracker 173671094
charles.chen@fibocom.corp-partner.google.com added comment #20: I have clarified this issue as below
GPP_A10 connect to LTE FCPO(Pin 6) GPP_H17 connect to LTE RESET(Pin 67) Actually, there are two reset timing control suggestion as page27 and 28 in the HW User manual. One is GPP_A10 always keep high and GPP_H17 goes to low at least 2ms, the other is both of GPP_A10 and GPP_H17 go to low but need to meet t_off2(2ms), t_off(500ms) and t_on1(8ms) describe in the page 28.
Attention is currently required from: Tim Chen. Karthik Ramasubramanian has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/48195 )
Change subject: mb/google/dedede/var/metaknight: Add LTE power on/off sequence ......................................................................
Patch Set 1:
(2 comments)
File src/mainboard/google/dedede/variants/metaknight/gpio.c:
https://review.coreboot.org/c/coreboot/+/48195/comment/b8e1534c_dff70507 PS1, Line 11: PLTRST For the same LTE module, vendor has recommended this - https://review.coreboot.org/c/coreboot/+/48623. Can you please check that?
https://review.coreboot.org/c/coreboot/+/48195/comment/05d2c25a_21b80624 PS1, Line 13: Nit: Remove the extraneous line.
Attention is currently required from: Tim Chen. Hello build bot (Jenkins), Patrick Georgi, Martin Roth, Henry Sun, Tim Chen, Raymond Wong, Karthik Ramasubramanian,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/48195
to look at the new patch set (#2).
Change subject: mb/google/dedede/var/metaknight: Add LTE power on/off sequence ......................................................................
mb/google/dedede/var/metaknight: Add LTE power on/off sequence
LTE module used in metaknight has a specific power on/off sequence. GPIOs related to power sequnce are: * GPP_A10 - LTE_PWR_OFF_R_ODL * GPP_H17 - LTE_RESET_R_ODL 1. Power on: GPP_A10 -> 20ms -> GPP_H17 2. Power off: GPP_H17 -> 10ms -> GPP_A10 3. Warm reset: Power off -> 500ms -> Power on Configure the GPIOs based on these requirements.
BUG=b:173671094 TEST=Build and boot Metaknight to OS. Ensure that the LTE module power sequence requirements are met.
Change-Id: Ibff16129dfe2f1de2b1519049244aba4b3123e52 Signed-off-by: Tim Chen tim-chen@quanta.corp-partner.google.com --- A src/mainboard/google/dedede/variants/metaknight/Makefile.inc A src/mainboard/google/dedede/variants/metaknight/gpio.c M src/mainboard/google/dedede/variants/metaknight/overridetree.cb A src/mainboard/google/dedede/variants/metaknight/variant.c 4 files changed, 64 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/95/48195/2
Attention is currently required from: Tim Chen, Karthik Ramasubramanian. Tim Chen has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/48195 )
Change subject: mb/google/dedede/var/metaknight: Add LTE power on/off sequence ......................................................................
Patch Set 2:
(2 comments)
File src/mainboard/google/dedede/variants/metaknight/gpio.c:
https://review.coreboot.org/c/coreboot/+/48195/comment/2dd948e3_884bbb94 PS1, Line 11: PLTRST
For the same LTE module, vendor has recommended this - https://review.coreboot. […]
Yes, this is one of the way vendor recommended. I had upload patchset2 to let GPIO_A10 keep high during warm reset as https://review.coreboot.org/c/coreboot/+/48623.
https://review.coreboot.org/c/coreboot/+/48195/comment/6b7d8dca_4e0e27bb PS1, Line 13:
Nit: Remove the extraneous line.
Done
Attention is currently required from: Tim Chen. Karthik Ramasubramanian has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/48195 )
Change subject: mb/google/dedede/var/metaknight: Add LTE power on/off sequence ......................................................................
Patch Set 2: Code-Review+2
Attention is currently required from: Tim Chen. Karthik Ramasubramanian has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/48195 )
Change subject: mb/google/dedede/var/metaknight: Add LTE power on/off sequence ......................................................................
Patch Set 2:
(1 comment)
Commit Message:
https://review.coreboot.org/c/coreboot/+/48195/comment/297384a7_7c8ccaad PS1, Line 15: Warm reset: Power off -> 500ms -> Power on
Below is the answer we get from vendor in issue tracker 173671094 […]
Can you update the Warm reset sequence here to reflect what is in the code?
Attention is currently required from: Tim Chen. Hello build bot (Jenkins), Patrick Georgi, Martin Roth, Henry Sun, Tim Chen, Raymond Wong, Karthik Ramasubramanian,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/48195
to look at the new patch set (#3).
Change subject: mb/google/dedede/var/metaknight: Add LTE power on/off sequence ......................................................................
mb/google/dedede/var/metaknight: Add LTE power on/off sequence
LTE module used in metaknight has a specific power on/off sequence. GPIOs related to power sequence are: * GPP_A10 - LTE_PWR_OFF_R_ODL * GPP_H17 - LTE_RESET_R_ODL 1. Power on: GPP_A10 -> 20ms -> GPP_H17 2. Power off: GPP_H17 -> 10ms -> GPP_A10 3. Warm reset: GPP_A10 keeps high, GPP_H17 goes low at least 2ms Configure the GPIOs based on these requirements.
BUG=b:173671094 TEST=Build and boot Metaknight to OS. Ensure that the LTE module power sequence requirements are met.
Change-Id: Ibff16129dfe2f1de2b1519049244aba4b3123e52 Signed-off-by: Tim Chen tim-chen@quanta.corp-partner.google.com --- A src/mainboard/google/dedede/variants/metaknight/Makefile.inc A src/mainboard/google/dedede/variants/metaknight/gpio.c M src/mainboard/google/dedede/variants/metaknight/overridetree.cb A src/mainboard/google/dedede/variants/metaknight/variant.c 4 files changed, 64 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/95/48195/3
Attention is currently required from: Tim Chen. Tim Chen has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/48195 )
Change subject: mb/google/dedede/var/metaknight: Add LTE power on/off sequence ......................................................................
Patch Set 3:
(1 comment)
Commit Message:
https://review.coreboot.org/c/coreboot/+/48195/comment/4e1b46e2_cc4ac25c PS1, Line 15: Warm reset: Power off -> 500ms -> Power on
Can you update the Warm reset sequence here to reflect what is in the code?
Done
Patrick Georgi has submitted this change. ( https://review.coreboot.org/c/coreboot/+/48195 )
Change subject: mb/google/dedede/var/metaknight: Add LTE power on/off sequence ......................................................................
mb/google/dedede/var/metaknight: Add LTE power on/off sequence
LTE module used in metaknight has a specific power on/off sequence. GPIOs related to power sequence are: * GPP_A10 - LTE_PWR_OFF_R_ODL * GPP_H17 - LTE_RESET_R_ODL 1. Power on: GPP_A10 -> 20ms -> GPP_H17 2. Power off: GPP_H17 -> 10ms -> GPP_A10 3. Warm reset: GPP_A10 keeps high, GPP_H17 goes low at least 2ms Configure the GPIOs based on these requirements.
BUG=b:173671094 TEST=Build and boot Metaknight to OS. Ensure that the LTE module power sequence requirements are met.
Change-Id: Ibff16129dfe2f1de2b1519049244aba4b3123e52 Signed-off-by: Tim Chen tim-chen@quanta.corp-partner.google.com Reviewed-on: https://review.coreboot.org/c/coreboot/+/48195 Tested-by: build bot (Jenkins) no-reply@coreboot.org Reviewed-by: Karthik Ramasubramanian kramasub@google.com --- A src/mainboard/google/dedede/variants/metaknight/Makefile.inc A src/mainboard/google/dedede/variants/metaknight/gpio.c M src/mainboard/google/dedede/variants/metaknight/overridetree.cb A src/mainboard/google/dedede/variants/metaknight/variant.c 4 files changed, 64 insertions(+), 0 deletions(-)
Approvals: build bot (Jenkins): Verified Karthik Ramasubramanian: Looks good to me, approved
diff --git a/src/mainboard/google/dedede/variants/metaknight/Makefile.inc b/src/mainboard/google/dedede/variants/metaknight/Makefile.inc new file mode 100644 index 0000000..67a7ab2 --- /dev/null +++ b/src/mainboard/google/dedede/variants/metaknight/Makefile.inc @@ -0,0 +1,5 @@ +# SPDX-License-Identifier: GPL-2.0-only + +ramstage-y += gpio.c + +smm-y += variant.c diff --git a/src/mainboard/google/dedede/variants/metaknight/gpio.c b/src/mainboard/google/dedede/variants/metaknight/gpio.c new file mode 100644 index 0000000..d6a7fd5 --- /dev/null +++ b/src/mainboard/google/dedede/variants/metaknight/gpio.c @@ -0,0 +1,21 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ + +#include <baseboard/gpio.h> +#include <baseboard/variants.h> +#include <commonlib/helpers.h> +#include <vendorcode/google/chromeos/chromeos.h> + +/* Pad configuration in ramstage*/ +static const struct pad_config gpio_table[] = { + /* A10 : WWAN_EN => LTE_PWR_OFF_ODL */ + PAD_CFG_GPO(GPP_A10, 1, PWROK), + + /* H17 : WWAN_RST_L => LTE_RESET_R_ODL */ + PAD_CFG_GPO(GPP_H17, 0, PLTRST), +}; + +const struct pad_config *variant_override_gpio_table(size_t *num) +{ + *num = ARRAY_SIZE(gpio_table); + return gpio_table; +} diff --git a/src/mainboard/google/dedede/variants/metaknight/overridetree.cb b/src/mainboard/google/dedede/variants/metaknight/overridetree.cb index 688ff9b..322f72c 100644 --- a/src/mainboard/google/dedede/variants/metaknight/overridetree.cb +++ b/src/mainboard/google/dedede/variants/metaknight/overridetree.cb @@ -69,6 +69,16 @@ chip drivers/usb/acpi device usb 0.0 on chip drivers/usb/acpi + register "desc" = ""LTE"" + register "type" = "UPC_TYPE_INTERNAL" + register "has_power_resource" = "1" + register "reset_gpio" = "ACPI_GPIO_OUTPUT_ACTIVE_LOW(GPP_H17)" + register "reset_off_delay_ms" = "10" + register "enable_gpio" = "ACPI_GPIO_OUTPUT_ACTIVE_HIGH(GPP_A10)" + register "enable_delay_ms" = "20" + device usb 2.3 on end + end + chip drivers/usb/acpi register "desc" = ""User Facing Camera"" register "type" = "UPC_TYPE_INTERNAL" device usb 2.5 on end @@ -78,6 +88,11 @@ register "type" = "UPC_TYPE_INTERNAL" device usb 2.6 on end end + chip drivers/usb/acpi + register "desc" = ""LTE"" + register "type" = "UPC_TYPE_INTERNAL" + device usb 3.3 on end + end end end end # USB xHCI diff --git a/src/mainboard/google/dedede/variants/metaknight/variant.c b/src/mainboard/google/dedede/variants/metaknight/variant.c new file mode 100644 index 0000000..2540fc7 --- /dev/null +++ b/src/mainboard/google/dedede/variants/metaknight/variant.c @@ -0,0 +1,23 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ + +#include <acpi/acpi.h> +#include <baseboard/variants.h> +#include <delay.h> +#include <gpio.h> + +static void power_off_lte_module(void) +{ + gpio_output(GPP_H17, 0); + mdelay(10); + gpio_output(GPP_A10, 0); +} + +void variant_smi_sleep(u8 slp_typ) +{ + /* + * Once the FW_CONFIG is provisioned, power off LTE module only under + * the situation where it is stuffed. + */ + if (slp_typ == ACPI_S5) + power_off_lte_module(); +}