ec/google/wilco: Correct scope of UCSI ACPI device
Set the USCI device scope to _SB and set HID to USBC000 so Windows driver attaches. This matches the ACPI used by the non-Chromebook version of the Dell Latittude 7410 (which uses the same EC). TEST=build/boot Win11 on google/drallion Change-Id: If482fa4a4856c7bc085795bc72b35ebefe2f15c4 Signed-off-by: Matt DeVillier <matt.devillier@gmail.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/77281 Reviewed-by: Subrata Banik <subratabanik@google.com> Reviewed-by: CoolStar <coolstarorganization@gmail.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
		| @@ -50,7 +50,7 @@ Device (EC0) | |||||||
| 		} | 		} | ||||||
|  |  | ||||||
| 		/* Initialize UCSI */ | 		/* Initialize UCSI */ | ||||||
| 		^UCSI.INIT () | 		\_SB.UCSI.INIT () | ||||||
|  |  | ||||||
| 		// Initialize LID switch state | 		// Initialize LID switch state | ||||||
| 		\LIDS = R (P1LC) | 		\LIDS = R (P1LC) | ||||||
|   | |||||||
| @@ -131,6 +131,11 @@ Name (DWTQ, Package () { 0x38, 0xff, WR })	/* DPTF: Write Trip Query */ | |||||||
| Name (CSOS, Package () { 0xb8, 0xff, WR })	/* OS support for S0ix */ | Name (CSOS, Package () { 0xb8, 0xff, WR })	/* OS support for S0ix */ | ||||||
| Name (CSEX, Package () { 0xb9, 0xff, WR })	/* OS enter(1)/exit(0) S0ix */ | Name (CSEX, Package () { 0xb9, 0xff, WR })	/* OS enter(1)/exit(0) S0ix */ | ||||||
|  |  | ||||||
|  | Scope (\_SB) | ||||||
|  | { | ||||||
|  | 	Name (RD, 0) | ||||||
|  | 	Name (WR, 1) | ||||||
|  |  | ||||||
| 	/* | 	/* | ||||||
| 	 * EC UCSI | 	 * EC UCSI | ||||||
| 	 */ | 	 */ | ||||||
| @@ -181,3 +186,4 @@ Name (UMOD, Package () { 0xad, 0xff, WR })	/* UCSI Message Out */ | |||||||
| 	Name (UMOE, Package () { 0xae, 0xff, WR })	/* UCSI Message Out */ | 	Name (UMOE, Package () { 0xae, 0xff, WR })	/* UCSI Message Out */ | ||||||
| 	Name (UMOF, Package () { 0xaf, 0xff, WR })	/* UCSI Message Out */ | 	Name (UMOF, Package () { 0xaf, 0xff, WR })	/* UCSI Message Out */ | ||||||
| 	Name (UCTL, Package () { 0xb0, 0xff, WR })	/* UCSI Control Register */ | 	Name (UCTL, Package () { 0xb0, 0xff, WR })	/* UCSI Control Register */ | ||||||
|  | } | ||||||
|   | |||||||
| @@ -141,7 +141,7 @@ Method (_Q79, 0, Serialized) | |||||||
| { | { | ||||||
| 	If (ISSX == 0) { | 	If (ISSX == 0) { | ||||||
| 		Printf ("EC _Q79 UCSI Event") | 		Printf ("EC _Q79 UCSI Event") | ||||||
| 		Notify (^UCSI, 0x80) | 		Notify (\_SB.UCSI, 0x80) | ||||||
| 		^UCEP = 0 | 		^UCEP = 0 | ||||||
| 	} Else { | 	} Else { | ||||||
| 		Printf ("EC _Q79 UCSI Event Masked in S0ix") | 		Printf ("EC _Q79 UCSI Event Masked in S0ix") | ||||||
|   | |||||||
| @@ -1,12 +1,14 @@ | |||||||
| /* SPDX-License-Identifier: GPL-2.0-only */ | /* SPDX-License-Identifier: GPL-2.0-only */ | ||||||
|  |  | ||||||
|  | Scope (\_SB) | ||||||
|  | { | ||||||
| 	Device (UCSI) | 	Device (UCSI) | ||||||
| 	{ | 	{ | ||||||
| 	Name (_HID, "GOOG000E") | 		Name (_HID, EisaId("USBC000")) | ||||||
| 	Name (_CID, EisaId ("PNP0CA0")) | 		Name (_CID, Package { "GOOG000E", EisaId ("PNP0CA0") }) | ||||||
| 		Name (_DDN, "Wilco EC UCSI") | 		Name (_DDN, "Wilco EC UCSI") | ||||||
| 		Name (_UID, 1) | 		Name (_UID, 1) | ||||||
| 	Name (_STA, 0xb) | 		Name (_STA, 0xf) | ||||||
|  |  | ||||||
| 		/* Value written to EC control register to start UCSI command */ | 		/* Value written to EC control register to start UCSI command */ | ||||||
| 		Name (UCMD, 0xE0) | 		Name (UCMD, 0xE0) | ||||||
| @@ -66,6 +68,15 @@ Device (UCSI) | |||||||
| 			^VER1 = R (^^UVR1) | 			^VER1 = R (^^UVR1) | ||||||
| 		} | 		} | ||||||
|  |  | ||||||
|  | 		Method (R, 1, Serialized, 2){ | ||||||
|  | 			Local0 = \_SB.PCI0.LPCB.EC0.R(Arg0) | ||||||
|  | 			Return (Local0) | ||||||
|  | 		} | ||||||
|  |  | ||||||
|  | 		Method (W, 2, Serialized, 2){ | ||||||
|  | 			\_SB.PCI0.LPCB.EC0.W(Arg0, Arg1) | ||||||
|  | 		} | ||||||
|  |  | ||||||
| 		Method (_DSM, 4, Serialized) | 		Method (_DSM, 4, Serialized) | ||||||
| 		{ | 		{ | ||||||
| 			If (Arg0 != ToUUID ("6f8398c2-7ca4-11e4-ad36-631042b5008f")) { | 			If (Arg0 != ToUUID ("6f8398c2-7ca4-11e4-ad36-631042b5008f")) { | ||||||
| @@ -141,3 +152,4 @@ Device (UCSI) | |||||||
| 			Return (Buffer (1) { 0 }) | 			Return (Buffer (1) { 0 }) | ||||||
| 		} | 		} | ||||||
| 	} | 	} | ||||||
|  | } | ||||||
|   | |||||||
| @@ -196,7 +196,7 @@ static void wilco_ec_fill_ssdt_generator(const struct device *dev) | |||||||
| 	opreg.regionoffset = (uintptr_t)region_ptr; | 	opreg.regionoffset = (uintptr_t)region_ptr; | ||||||
| 	opreg.regionlen = ucsi_alloc_region_len; | 	opreg.regionlen = ucsi_alloc_region_len; | ||||||
|  |  | ||||||
| 	acpigen_write_scope(acpi_device_path_join(dev, "UCSI")); | 	acpigen_write_scope("\\_SB.UCSI"); | ||||||
| 	acpigen_write_name("_CRS"); | 	acpigen_write_name("_CRS"); | ||||||
| 	acpigen_write_resourcetemplate_header(); | 	acpigen_write_resourcetemplate_header(); | ||||||
| 	acpigen_write_mem32fixed(1, (uintptr_t)region_ptr, ucsi_region_len); | 	acpigen_write_mem32fixed(1, (uintptr_t)region_ptr, ucsi_region_len); | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user