Skip to content

Commit

Permalink
soc/intel/xeon_sp: Revise IIO domain ACPI name encoding
Browse files Browse the repository at this point in the history
GNR/SRF supports up to 18 logical IIO stacks. Revise IIO domain
ACPI name encoding in below form to support GNR/SRF,

prefix (16 bit) | socket (3-bit) | stack (5-bit)

Change-Id: I6f4c3c22980f2797dd47c8e0d684e0a3175030b7
Signed-off-by: Shuo Liu <[email protected]>
Signed-off-by: Jincheng Li <[email protected]>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/84310
Tested-by: build bot (Jenkins) <[email protected]>
Reviewed-by: Patrick Rudolph <[email protected]>
Reviewed-by: Angel Pons <[email protected]>
  • Loading branch information
shuoliu0 authored and LeanSheng committed Oct 11, 2024
1 parent b9bf446 commit 177bb5e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/soc/intel/xeon_sp/acpi.c
Original file line number Diff line number Diff line change
Expand Up @@ -100,16 +100,16 @@ void iio_domain_set_acpi_name(struct device *dev, const char *prefix)
.domain_path = dev_get_domain_id(dev)
};

assert(dn.socket < CONFIG_MAX_SOCKET);
assert(dn.stack < 16);
assert(dn.socket < 8);
assert(dn.stack < 32);
assert(prefix != NULL && strlen(prefix) == 2);

if (dn.socket >= CONFIG_MAX_SOCKET || dn.stack >= 16 ||
if (dn.socket >= 8 || dn.stack >= 32 ||
!prefix || strlen(prefix) != 2)
return;

char *name = xmalloc(ACPI_NAME_BUFFER_SIZE);
snprintf(name, ACPI_NAME_BUFFER_SIZE, "%s%1X%1X", prefix, dn.socket, dn.stack);
snprintf(name, ACPI_NAME_BUFFER_SIZE, "%s%02X", prefix, ((dn.socket << 5) + dn.stack));
dev->name = name;
}

Expand Down

0 comments on commit 177bb5e

Please sign in to comment.