Karthik Ramasubramanian has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/38280 )
Change subject: mb/google/dedede: Add smihandler stub ......................................................................
mb/google/dedede: Add smihandler stub
Add stub implementation of smihandler.
BUG=b:144768001 TEST=Build test.
Change-Id: I7ab25888812bfb4578915e342b14355ccd15f5cc Signed-off-by: Karthikeyan Ramasubramanian kramasub@google.com --- M src/mainboard/google/dedede/Makefile.inc A src/mainboard/google/dedede/smihandler.c M src/mainboard/google/dedede/variants/baseboard/gpio.c M src/mainboard/google/dedede/variants/baseboard/include/baseboard/variants.h 4 files changed, 47 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/80/38280/1
diff --git a/src/mainboard/google/dedede/Makefile.inc b/src/mainboard/google/dedede/Makefile.inc index 8f50113..f214544 100644 --- a/src/mainboard/google/dedede/Makefile.inc +++ b/src/mainboard/google/dedede/Makefile.inc @@ -2,6 +2,8 @@
ramstage-y += mainboard.c
+smm-$(CONFIG_HAVE_SMI_HANDLER) += smihandler.c + subdirs-y += variants/baseboard CPPFLAGS_common += -I$(src)/mainboard/$(MAINBOARDDIR)/variants/baseboard/include
diff --git a/src/mainboard/google/dedede/smihandler.c b/src/mainboard/google/dedede/smihandler.c new file mode 100644 index 0000000..d4d9c65 --- /dev/null +++ b/src/mainboard/google/dedede/smihandler.c @@ -0,0 +1,33 @@ +/* + * This file is part of the coreboot project. + * + * Copyright 2020 The coreboot project Authors. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include <arch/acpi.h> +#include <baseboard/variants.h> +#include <cpu/x86/smm.h> +#include <intelblocks/smihandler.h> +#include <soc/pm.h> +#include <soc/gpio.h> +#include <variant/gpio.h> + +void mainboard_smi_gpi_handler(const struct gpi_status *sts) +{ +} + +void mainboard_smi_sleep(u8 slp_typ) +{ + const struct pad_config *pads; + size_t num; + + pads = variant_sleep_gpio_table(&num); + gpio_configure_pads(pads, num); +} + +int mainboard_smi_apmc(u8 apmc) +{ + return 0; +} diff --git a/src/mainboard/google/dedede/variants/baseboard/gpio.c b/src/mainboard/google/dedede/variants/baseboard/gpio.c index a141a58..c43e97f 100644 --- a/src/mainboard/google/dedede/variants/baseboard/gpio.c +++ b/src/mainboard/google/dedede/variants/baseboard/gpio.c @@ -31,3 +31,14 @@ *num = ARRAY_SIZE(early_gpio_table); return early_gpio_table; } + +/* GPIO settings before entering sleep. */ +static const struct pad_config sleep_gpio_table[] = { +}; + +const struct pad_config *__attribute__((weak)) + variant_sleep_gpio_table(size_t *num) +{ + *num = ARRAY_SIZE(sleep_gpio_table); + return sleep_gpio_table; +} diff --git a/src/mainboard/google/dedede/variants/baseboard/include/baseboard/variants.h b/src/mainboard/google/dedede/variants/baseboard/include/baseboard/variants.h index ebcd594..309b9eb 100644 --- a/src/mainboard/google/dedede/variants/baseboard/include/baseboard/variants.h +++ b/src/mainboard/google/dedede/variants/baseboard/include/baseboard/variants.h @@ -17,5 +17,6 @@
const struct pad_config *variant_gpio_table(size_t *num); const struct pad_config *variant_early_gpio_table(size_t *num); +const struct pad_config *variant_sleep_gpio_table(size_t *num);
#endif /*__BASEBOARD_VARIANTS_H__ */
Hello Justin TerAvest, build bot (Jenkins), Furquan Shaikh, Patrick Georgi, Martin Roth,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/38280
to look at the new patch set (#4).
Change subject: mb/google/dedede: Add smihandler stub ......................................................................
mb/google/dedede: Add smihandler stub
Add stub implementation of smihandler.
BUG=b:144768001 TEST=Build test.
Change-Id: I7ab25888812bfb4578915e342b14355ccd15f5cc Signed-off-by: Karthikeyan Ramasubramanian kramasub@google.com --- M src/mainboard/google/dedede/Makefile.inc A src/mainboard/google/dedede/smihandler.c M src/mainboard/google/dedede/variants/baseboard/gpio.c M src/mainboard/google/dedede/variants/baseboard/include/baseboard/variants.h 4 files changed, 47 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/80/38280/4
Justin TerAvest has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/38280 )
Change subject: mb/google/dedede: Add smihandler stub ......................................................................
Patch Set 4:
(1 comment)
https://review.coreboot.org/c/coreboot/+/38280/4/src/mainboard/google/dedede... File src/mainboard/google/dedede/smihandler.c:
https://review.coreboot.org/c/coreboot/+/38280/4/src/mainboard/google/dedede... PS4, Line 34: What about elog_gsmi_cb_mainboard_log_wake_source ?
Karthik Ramasubramanian has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/38280 )
Change subject: mb/google/dedede: Add smihandler stub ......................................................................
Patch Set 4:
(1 comment)
https://review.coreboot.org/c/coreboot/+/38280/4/src/mainboard/google/dedede... File src/mainboard/google/dedede/smihandler.c:
https://review.coreboot.org/c/coreboot/+/38280/4/src/mainboard/google/dedede... PS4, Line 34:
What about elog_gsmi_cb_mainboard_log_wake_source ?
I haven't enabled the support for ELOG yet. I am planning to add as a follow-up patch when we enable ELOG.
Justin TerAvest has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/38280 )
Change subject: mb/google/dedede: Add smihandler stub ......................................................................
Patch Set 4: Code-Review+2
Furquan Shaikh has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/38280 )
Change subject: mb/google/dedede: Add smihandler stub ......................................................................
Patch Set 4:
(2 comments)
https://review.coreboot.org/c/coreboot/+/38280/4/src/mainboard/google/dedede... File src/mainboard/google/dedede/variants/baseboard/gpio.c:
https://review.coreboot.org/c/coreboot/+/38280/4/src/mainboard/google/dedede... PS4, Line 39: __attribute__((weak)) __weak
https://review.coreboot.org/c/coreboot/+/38280/4/src/mainboard/google/dedede... PS4, Line 40: variant_sleep_gpio_table(size_t *num) nit: This might fit on the above line.
Hello Justin TerAvest, build bot (Jenkins), Furquan Shaikh, Patrick Georgi, Martin Roth,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/38280
to look at the new patch set (#5).
Change subject: mb/google/dedede: Add smihandler stub ......................................................................
mb/google/dedede: Add smihandler stub
Add stub implementation of smihandler.
BUG=b:144768001 TEST=Build test.
Change-Id: I7ab25888812bfb4578915e342b14355ccd15f5cc Signed-off-by: Karthikeyan Ramasubramanian kramasub@google.com --- M src/mainboard/google/dedede/Makefile.inc A src/mainboard/google/dedede/smihandler.c M src/mainboard/google/dedede/variants/baseboard/gpio.c M src/mainboard/google/dedede/variants/baseboard/include/baseboard/variants.h 4 files changed, 46 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/80/38280/5
build bot (Jenkins) has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/38280 )
Change subject: mb/google/dedede: Add smihandler stub ......................................................................
Patch Set 5:
(1 comment)
https://review.coreboot.org/c/coreboot/+/38280/5/src/mainboard/google/dedede... File src/mainboard/google/dedede/variants/baseboard/gpio.c:
https://review.coreboot.org/c/coreboot/+/38280/5/src/mainboard/google/dedede... PS5, Line 39: const struct pad_config *__weak variant_sleep_gpio_table(size_t *num) "foo *__weak bar" should be "foo *__weak bar"
Hello Justin TerAvest, build bot (Jenkins), Furquan Shaikh, Patrick Georgi, Martin Roth,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/38280
to look at the new patch set (#6).
Change subject: mb/google/dedede: Add smihandler stub ......................................................................
mb/google/dedede: Add smihandler stub
Add stub implementation of smihandler.
BUG=b:144768001 TEST=Build test.
Change-Id: I7ab25888812bfb4578915e342b14355ccd15f5cc Signed-off-by: Karthikeyan Ramasubramanian kramasub@google.com --- M src/mainboard/google/dedede/Makefile.inc A src/mainboard/google/dedede/smihandler.c M src/mainboard/google/dedede/variants/baseboard/gpio.c M src/mainboard/google/dedede/variants/baseboard/include/baseboard/variants.h 4 files changed, 46 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/80/38280/6
Karthik Ramasubramanian has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/38280 )
Change subject: mb/google/dedede: Add smihandler stub ......................................................................
Patch Set 6:
(4 comments)
https://review.coreboot.org/c/coreboot/+/38280/4/src/mainboard/google/dedede... File src/mainboard/google/dedede/smihandler.c:
https://review.coreboot.org/c/coreboot/+/38280/4/src/mainboard/google/dedede... PS4, Line 34:
I haven't enabled the support for ELOG yet. […]
Ack
https://review.coreboot.org/c/coreboot/+/38280/4/src/mainboard/google/dedede... File src/mainboard/google/dedede/variants/baseboard/gpio.c:
https://review.coreboot.org/c/coreboot/+/38280/4/src/mainboard/google/dedede... PS4, Line 39: __attribute__((weak))
__weak
Done
https://review.coreboot.org/c/coreboot/+/38280/4/src/mainboard/google/dedede... PS4, Line 40: variant_sleep_gpio_table(size_t *num)
nit: This might fit on the above line.
Done
https://review.coreboot.org/c/coreboot/+/38280/5/src/mainboard/google/dedede... File src/mainboard/google/dedede/variants/baseboard/gpio.c:
https://review.coreboot.org/c/coreboot/+/38280/5/src/mainboard/google/dedede... PS5, Line 39: const struct pad_config *__weak variant_sleep_gpio_table(size_t *num)
"foo *__weak bar" should be "foo *__weak bar"
Done
Furquan Shaikh has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/38280 )
Change subject: mb/google/dedede: Add smihandler stub ......................................................................
Patch Set 6:
(1 comment)
https://review.coreboot.org/c/coreboot/+/38280/6/src/mainboard/google/dedede... File src/mainboard/google/dedede/smihandler.c:
https://review.coreboot.org/c/coreboot/+/38280/6/src/mainboard/google/dedede... PS6, Line 9: #include <arch/acpi.h> Are all these headers really required?
Hello Balaji Manigandan, Aamir Bohra, Justin TerAvest, build bot (Jenkins), Furquan Shaikh, Patrick Georgi, Martin Roth,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/38280
to look at the new patch set (#7).
Change subject: mb/google/dedede: Add smihandler stub ......................................................................
mb/google/dedede: Add smihandler stub
Add stub implementation of smihandler.
BUG=b:144768001 TEST=Build test.
Change-Id: I7ab25888812bfb4578915e342b14355ccd15f5cc Signed-off-by: Karthikeyan Ramasubramanian kramasub@google.com --- M src/mainboard/google/dedede/Makefile.inc A src/mainboard/google/dedede/smihandler.c M src/mainboard/google/dedede/variants/baseboard/gpio.c M src/mainboard/google/dedede/variants/baseboard/include/baseboard/variants.h 4 files changed, 42 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/80/38280/7
Karthik Ramasubramanian has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/38280 )
Change subject: mb/google/dedede: Add smihandler stub ......................................................................
Patch Set 7:
(1 comment)
https://review.coreboot.org/c/coreboot/+/38280/6/src/mainboard/google/dedede... File src/mainboard/google/dedede/smihandler.c:
https://review.coreboot.org/c/coreboot/+/38280/6/src/mainboard/google/dedede... PS6, Line 9: #include <arch/acpi.h>
Are all these headers really required?
Done
Furquan Shaikh has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/38280 )
Change subject: mb/google/dedede: Add smihandler stub ......................................................................
Patch Set 7: Code-Review+2
Furquan Shaikh has submitted this change. ( https://review.coreboot.org/c/coreboot/+/38280 )
Change subject: mb/google/dedede: Add smihandler stub ......................................................................
mb/google/dedede: Add smihandler stub
Add stub implementation of smihandler.
BUG=b:144768001 TEST=Build test.
Change-Id: I7ab25888812bfb4578915e342b14355ccd15f5cc Signed-off-by: Karthikeyan Ramasubramanian kramasub@google.com Reviewed-on: https://review.coreboot.org/c/coreboot/+/38280 Tested-by: build bot (Jenkins) no-reply@coreboot.org Reviewed-by: Furquan Shaikh furquan@google.com --- M src/mainboard/google/dedede/Makefile.inc A src/mainboard/google/dedede/smihandler.c M src/mainboard/google/dedede/variants/baseboard/gpio.c M src/mainboard/google/dedede/variants/baseboard/include/baseboard/variants.h 4 files changed, 42 insertions(+), 0 deletions(-)
Approvals: build bot (Jenkins): Verified Furquan Shaikh: Looks good to me, approved
diff --git a/src/mainboard/google/dedede/Makefile.inc b/src/mainboard/google/dedede/Makefile.inc index 8f50113..f214544 100644 --- a/src/mainboard/google/dedede/Makefile.inc +++ b/src/mainboard/google/dedede/Makefile.inc @@ -2,6 +2,8 @@
ramstage-y += mainboard.c
+smm-$(CONFIG_HAVE_SMI_HANDLER) += smihandler.c + subdirs-y += variants/baseboard CPPFLAGS_common += -I$(src)/mainboard/$(MAINBOARDDIR)/variants/baseboard/include
diff --git a/src/mainboard/google/dedede/smihandler.c b/src/mainboard/google/dedede/smihandler.c new file mode 100644 index 0000000..780d33f --- /dev/null +++ b/src/mainboard/google/dedede/smihandler.c @@ -0,0 +1,29 @@ +/* + * This file is part of the coreboot project. + * + * Copyright 2020 The coreboot project Authors. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include <baseboard/variants.h> +#include <cpu/x86/smm.h> +#include <intelblocks/smihandler.h> + +void mainboard_smi_gpi_handler(const struct gpi_status *sts) +{ +} + +void mainboard_smi_sleep(u8 slp_typ) +{ + const struct pad_config *pads; + size_t num; + + pads = variant_sleep_gpio_table(&num); + gpio_configure_pads(pads, num); +} + +int mainboard_smi_apmc(u8 apmc) +{ + return 0; +} diff --git a/src/mainboard/google/dedede/variants/baseboard/gpio.c b/src/mainboard/google/dedede/variants/baseboard/gpio.c index c94af6f..65ac66b 100644 --- a/src/mainboard/google/dedede/variants/baseboard/gpio.c +++ b/src/mainboard/google/dedede/variants/baseboard/gpio.c @@ -31,3 +31,13 @@ *num = ARRAY_SIZE(early_gpio_table); return early_gpio_table; } + +/* GPIO settings before entering sleep. */ +static const struct pad_config sleep_gpio_table[] = { +}; + +const struct pad_config *__weak variant_sleep_gpio_table(size_t *num) +{ + *num = ARRAY_SIZE(sleep_gpio_table); + return sleep_gpio_table; +} diff --git a/src/mainboard/google/dedede/variants/baseboard/include/baseboard/variants.h b/src/mainboard/google/dedede/variants/baseboard/include/baseboard/variants.h index ebcd594..309b9eb 100644 --- a/src/mainboard/google/dedede/variants/baseboard/include/baseboard/variants.h +++ b/src/mainboard/google/dedede/variants/baseboard/include/baseboard/variants.h @@ -17,5 +17,6 @@
const struct pad_config *variant_gpio_table(size_t *num); const struct pad_config *variant_early_gpio_table(size_t *num); +const struct pad_config *variant_sleep_gpio_table(size_t *num);
#endif /*__BASEBOARD_VARIANTS_H__ */