Furquan Shaikh has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/40513 )
Change subject: ec/google/chromeec: Fix acpi_name() for Chrome EC device ......................................................................
ec/google/chromeec: Fix acpi_name() for Chrome EC device
In ACPI tables, Chrome EC device (CREC - HID GOOG0004) is a child of EC device (EC0 - HID PNP0C09). However, in coreboot device tree, there is no separate chip/device for EC0. Thus, acpi_name() needs to return EC0.CREC as the ACPI name for the Chrome EC device. By returning the ACPI name as EC0.CREC, all devices that live under Chrome EC device can simply call acpi_device_path()/acpi_device_scope() to emit the right path/scope.
In the future, if we ever add a special chip driver for handling EC0 (HID PNP0C09), then the ACPI name for Chrome EC can be fixed to return CREC.
BUG=b:154290952 TEST=Verified that acpi_device_path()/acpi_device_scope() return the correct name for Chrome EC device.
Signed-off-by: Furquan Shaikh furquan@google.com Change-Id: Iec4b0226d1e98ddeb0f8ed8b89477fc4f453d221 --- M src/ec/google/chromeec/ec_acpi.c 1 file changed, 2 insertions(+), 4 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/13/40513/1
diff --git a/src/ec/google/chromeec/ec_acpi.c b/src/ec/google/chromeec/ec_acpi.c index 6bc9693..33b1fdd 100644 --- a/src/ec/google/chromeec/ec_acpi.c +++ b/src/ec/google/chromeec/ec_acpi.c @@ -16,13 +16,12 @@ #include "ec.h" #include "ec_commands.h"
-#define GOOGLE_CHROMEEC_USBC_DEVICE_PARENT "CREC" #define GOOGLE_CHROMEEC_USBC_DEVICE_HID "GOOG0014" #define GOOGLE_CHROMEEC_USBC_DEVICE_NAME "USBC"
const char *google_chromeec_acpi_name(const struct device *dev) { - return "EC0"; + return "EC0.CREC"; }
static const char *power_role_to_str(enum ec_pd_power_role_caps power_role) @@ -220,8 +219,7 @@ if (google_chromeec_get_num_pd_ports(&num_ports)) return;
- /* Add TypeC device under the existing device + ".CREC" scope */ - acpigen_write_scope(acpi_device_path_join(dev, GOOGLE_CHROMEEC_USBC_DEVICE_PARENT)); + acpigen_write_scope(acpi_device_path(dev)); fill_ssdt_typec_device(num_ports); acpigen_pop_len(); /* Scope */ }
Paul Menzel has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/40513 )
Change subject: ec/google/chromeec: Fix acpi_name() for Chrome EC device ......................................................................
Patch Set 1: Code-Review+1
Tim Wawrzynczak has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/40513 )
Change subject: ec/google/chromeec: Fix acpi_name() for Chrome EC device ......................................................................
Patch Set 1: Code-Review+2
Karthik Ramasubramanian has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/40513 )
Change subject: ec/google/chromeec: Fix acpi_name() for Chrome EC device ......................................................................
Patch Set 1: Code-Review+2
Furquan Shaikh has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/40513 )
Change subject: ec/google/chromeec: Fix acpi_name() for Chrome EC device ......................................................................
Patch Set 1:
(1 comment)
https://review.coreboot.org/c/coreboot/+/40513/1/src/ec/google/chromeec/ec_a... File src/ec/google/chromeec/ec_acpi.c:
https://review.coreboot.org/c/coreboot/+/40513/1/src/ec/google/chromeec/ec_a... PS1, Line 222: acpigen_write_scope This needs to be rebased on top of: https://review.coreboot.org/c/coreboot/+/40032
Hello build bot (Jenkins), Tim Wawrzynczak, Paul Menzel, Aaron Durbin, Karthik Ramasubramanian,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/40513
to look at the new patch set (#2).
Change subject: ec/google/chromeec: Fix acpi_name() for Chrome EC device ......................................................................
ec/google/chromeec: Fix acpi_name() for Chrome EC device
In ACPI tables, Chrome EC device (CREC - HID GOOG0004) is a child of EC device (EC0 - HID PNP0C09). However, in coreboot device tree, there is no separate chip/device for EC0. Thus, acpi_name() needs to return EC0.CREC as the ACPI name for the Chrome EC device. By returning the ACPI name as EC0.CREC, all devices that live under Chrome EC device can simply call acpi_device_path()/acpi_device_scope() to emit the right path/scope.
In the future, if we ever add a special chip driver for handling EC0 (HID PNP0C09), then the ACPI name for Chrome EC can be fixed to return CREC.
BUG=b:154290952 TEST=Verified that acpi_device_path()/acpi_device_scope() return the correct name for Chrome EC device.
Signed-off-by: Furquan Shaikh furquan@google.com Change-Id: Iec4b0226d1e98ddeb0f8ed8b89477fc4f453d221 --- M src/ec/google/chromeec/ec_acpi.c 1 file changed, 2 insertions(+), 4 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/13/40513/2
Furquan Shaikh has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/40513 )
Change subject: ec/google/chromeec: Fix acpi_name() for Chrome EC device ......................................................................
Patch Set 2:
(1 comment)
https://review.coreboot.org/c/coreboot/+/40513/1/src/ec/google/chromeec/ec_a... File src/ec/google/chromeec/ec_acpi.c:
https://review.coreboot.org/c/coreboot/+/40513/1/src/ec/google/chromeec/ec_a... PS1, Line 222: acpigen_write_scope
This needs to be rebased on top of: https://review.coreboot. […]
Done
Tim Wawrzynczak has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/40513 )
Change subject: ec/google/chromeec: Fix acpi_name() for Chrome EC device ......................................................................
Patch Set 2: Code-Review+2
Aaron Durbin has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/40513 )
Change subject: ec/google/chromeec: Fix acpi_name() for Chrome EC device ......................................................................
Patch Set 3: Code-Review+1
(1 comment)
https://review.coreboot.org/c/coreboot/+/40513/3/src/ec/google/chromeec/ec_a... File src/ec/google/chromeec/ec_acpi.c:
https://review.coreboot.org/c/coreboot/+/40513/3/src/ec/google/chromeec/ec_a... PS3, Line 25: return "EC0.CREC"; Leave a comment here about if we have a driver dealing with AML generation that EC0 needs to be omitted?
Furquan Shaikh has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/40513 )
Change subject: ec/google/chromeec: Fix acpi_name() for Chrome EC device ......................................................................
Patch Set 3:
(1 comment)
https://review.coreboot.org/c/coreboot/+/40513/3/src/ec/google/chromeec/ec_a... File src/ec/google/chromeec/ec_acpi.c:
https://review.coreboot.org/c/coreboot/+/40513/3/src/ec/google/chromeec/ec_a... PS3, Line 25: return "EC0.CREC";
Leave a comment here about if we have a driver dealing with AML generation that EC0 needs to be omit […]
Okay, I will add that.
Hello build bot (Jenkins), Tim Wawrzynczak, Paul Menzel, Aaron Durbin, Karthik Ramasubramanian,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/40513
to look at the new patch set (#4).
Change subject: ec/google/chromeec: Fix acpi_name() for Chrome EC device ......................................................................
ec/google/chromeec: Fix acpi_name() for Chrome EC device
In ACPI tables, Chrome EC device (CREC - HID GOOG0004) is a child of EC device (EC0 - HID PNP0C09). However, in coreboot device tree, there is no separate chip/device for EC0. Thus, acpi_name() needs to return EC0.CREC as the ACPI name for the Chrome EC device. By returning the ACPI name as EC0.CREC, all devices that live under Chrome EC device can simply call acpi_device_path()/acpi_device_scope() to emit the right path/scope.
In the future, if we ever add a special chip driver for handling EC0 (HID PNP0C09), then the ACPI name for Chrome EC can be fixed to return CREC.
BUG=b:154290952 TEST=Verified that acpi_device_path()/acpi_device_scope() return the correct name for Chrome EC device.
Signed-off-by: Furquan Shaikh furquan@google.com Change-Id: Iec4b0226d1e98ddeb0f8ed8b89477fc4f453d221 --- M src/ec/google/chromeec/ec_acpi.c 1 file changed, 11 insertions(+), 4 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/13/40513/4
Tim Wawrzynczak has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/40513 )
Change subject: ec/google/chromeec: Fix acpi_name() for Chrome EC device ......................................................................
Patch Set 4: Code-Review+2
(1 comment)
https://review.coreboot.org/c/coreboot/+/40513/4/src/ec/google/chromeec/ec_a... File src/ec/google/chromeec/ec_acpi.c:
https://review.coreboot.org/c/coreboot/+/40513/4/src/ec/google/chromeec/ec_a... PS4, Line 31: drvier driver
Hello build bot (Jenkins), Tim Wawrzynczak, Paul Menzel, Aaron Durbin, Karthik Ramasubramanian,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/40513
to look at the new patch set (#5).
Change subject: ec/google/chromeec: Fix acpi_name() for Chrome EC device ......................................................................
ec/google/chromeec: Fix acpi_name() for Chrome EC device
In ACPI tables, Chrome EC device (CREC - HID GOOG0004) is a child of EC device (EC0 - HID PNP0C09). However, in coreboot device tree, there is no separate chip/device for EC0. Thus, acpi_name() needs to return EC0.CREC as the ACPI name for the Chrome EC device. By returning the ACPI name as EC0.CREC, all devices that live under Chrome EC device can simply call acpi_device_path()/acpi_device_scope() to emit the right path/scope.
In the future, if we ever add a special chip driver for handling EC0 (HID PNP0C09), then the ACPI name for Chrome EC can be fixed to return CREC.
BUG=b:154290952 TEST=Verified that acpi_device_path()/acpi_device_scope() return the correct name for Chrome EC device.
Signed-off-by: Furquan Shaikh furquan@google.com Change-Id: Iec4b0226d1e98ddeb0f8ed8b89477fc4f453d221 --- M src/ec/google/chromeec/ec_acpi.c 1 file changed, 11 insertions(+), 4 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/13/40513/5
Furquan Shaikh has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/40513 )
Change subject: ec/google/chromeec: Fix acpi_name() for Chrome EC device ......................................................................
Patch Set 4:
(1 comment)
https://review.coreboot.org/c/coreboot/+/40513/4/src/ec/google/chromeec/ec_a... File src/ec/google/chromeec/ec_acpi.c:
https://review.coreboot.org/c/coreboot/+/40513/4/src/ec/google/chromeec/ec_a... PS4, Line 31: drvier
driver
woops. done.
Furquan Shaikh has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/40513 )
Change subject: ec/google/chromeec: Fix acpi_name() for Chrome EC device ......................................................................
Patch Set 5:
(1 comment)
https://review.coreboot.org/c/coreboot/+/40513/4/src/ec/google/chromeec/ec_a... File src/ec/google/chromeec/ec_acpi.c:
https://review.coreboot.org/c/coreboot/+/40513/4/src/ec/google/chromeec/ec_a... PS4, Line 31: drvier
woops. done.
Done
Aaron Durbin has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/40513 )
Change subject: ec/google/chromeec: Fix acpi_name() for Chrome EC device ......................................................................
Patch Set 5: Code-Review+2
Furquan Shaikh has submitted this change. ( https://review.coreboot.org/c/coreboot/+/40513 )
Change subject: ec/google/chromeec: Fix acpi_name() for Chrome EC device ......................................................................
ec/google/chromeec: Fix acpi_name() for Chrome EC device
In ACPI tables, Chrome EC device (CREC - HID GOOG0004) is a child of EC device (EC0 - HID PNP0C09). However, in coreboot device tree, there is no separate chip/device for EC0. Thus, acpi_name() needs to return EC0.CREC as the ACPI name for the Chrome EC device. By returning the ACPI name as EC0.CREC, all devices that live under Chrome EC device can simply call acpi_device_path()/acpi_device_scope() to emit the right path/scope.
In the future, if we ever add a special chip driver for handling EC0 (HID PNP0C09), then the ACPI name for Chrome EC can be fixed to return CREC.
BUG=b:154290952 TEST=Verified that acpi_device_path()/acpi_device_scope() return the correct name for Chrome EC device.
Signed-off-by: Furquan Shaikh furquan@google.com Change-Id: Iec4b0226d1e98ddeb0f8ed8b89477fc4f453d221 Reviewed-on: https://review.coreboot.org/c/coreboot/+/40513 Reviewed-by: Aaron Durbin adurbin@chromium.org Tested-by: build bot (Jenkins) no-reply@coreboot.org --- M src/ec/google/chromeec/ec_acpi.c 1 file changed, 11 insertions(+), 4 deletions(-)
Approvals: build bot (Jenkins): Verified Aaron Durbin: Looks good to me, approved
diff --git a/src/ec/google/chromeec/ec_acpi.c b/src/ec/google/chromeec/ec_acpi.c index a7e3ae5..79e3f4b 100644 --- a/src/ec/google/chromeec/ec_acpi.c +++ b/src/ec/google/chromeec/ec_acpi.c @@ -17,13 +17,21 @@ #include "ec.h" #include "ec_commands.h"
-#define GOOGLE_CHROMEEC_USBC_DEVICE_PARENT "CREC" #define GOOGLE_CHROMEEC_USBC_DEVICE_HID "GOOG0014" #define GOOGLE_CHROMEEC_USBC_DEVICE_NAME "USBC"
const char *google_chromeec_acpi_name(const struct device *dev) { - return "EC0"; + /* + * Chrome EC device (CREC - GOOG0004) is really a child of EC device (EC - PNP0C09) in + * ACPI tables. However, in coreboot device tree, there is no separate chip/device for + * EC0. Thus, Chrome EC device needs to return "EC0.CREC" as the ACPI name so that the + * callers can get the correct acpi device path/scope for this device. + * + * If we ever enable a separate driver for generating AML for EC0 device, then this + * function needs to be updated to return "CREC". + */ + return "EC0.CREC"; }
static const char *power_role_to_str(enum ec_pd_power_role_caps power_role) @@ -190,8 +198,7 @@ if (google_chromeec_get_num_pd_ports(&num_ports)) return;
- /* Add TypeC device under the existing device + ".CREC" scope */ - acpigen_write_scope(acpi_device_path_join(dev, GOOGLE_CHROMEEC_USBC_DEVICE_PARENT)); + acpigen_write_scope(acpi_device_path(dev)); acpigen_write_device(GOOGLE_CHROMEEC_USBC_DEVICE_NAME); acpigen_write_name_string("_HID", GOOGLE_CHROMEEC_USBC_DEVICE_HID); acpigen_write_name_string("_DDN", "ChromeOS EC Embedded Controller "