drivers/vpd: rename VPD_ANY to VPD_RO_THEN_RW

Rename VPD_ANY to VPD_RO_THEN_RW, to reflect the VPD region search
preference. Update all existing code references for VPD_ANY.

Signed-off-by: Jonathan Zhang <jonzhang@fb.com>
Change-Id: I960688d1f6ab199768107ab73b8a7400a3fdf473
Reviewed-on: https://review.coreboot.org/c/coreboot/+/41586
Reviewed-by: Julius Werner <jwerner@chromium.org>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
Jonathan Zhang 2020-05-28 11:02:13 -07:00 committed by Patrick Georgi
parent b781680d6e
commit a9117ed496
7 changed files with 7 additions and 7 deletions

View File

@ -8,7 +8,7 @@
#define GOOGLE_VPD_2_0_OFFSET 0x600 #define GOOGLE_VPD_2_0_OFFSET 0x600
enum vpd_region { enum vpd_region {
VPD_ANY = 0, VPD_RO_THEN_RW = 0,
VPD_RO = 1, VPD_RO = 1,
VPD_RW = 2 VPD_RW = 2
}; };

View File

@ -46,7 +46,7 @@ uint8_t variant_board_sku(void)
if (!CONFIG(CHROMEOS)) if (!CONFIG(CHROMEOS))
return board_sku_num; return board_sku_num;
if (!vpd_gets(vpd_skuid, vpd_buffer, ARRAY_SIZE(vpd_buffer), VPD_ANY)) if (!vpd_gets(vpd_skuid, vpd_buffer, ARRAY_SIZE(vpd_buffer), VPD_RO_THEN_RW))
return board_sku_num; return board_sku_num;
vpd_len = strlen(vpd_buffer); vpd_len = strlen(vpd_buffer);

View File

@ -70,7 +70,7 @@ int get_wifi_sar_limits(struct wifi_sar_limits *sar_limits)
/* Try to read the SAR limit entry from VPD */ /* Try to read the SAR limit entry from VPD */
if (!vpd_gets(wifi_sar_limit_key, wifi_sar_limit_str, if (!vpd_gets(wifi_sar_limit_key, wifi_sar_limit_str,
buffer_size, VPD_ANY)) { buffer_size, VPD_RO_THEN_RW)) {
printk(BIOS_ERR, "Error: Could not locate '%s' in VPD.\n", printk(BIOS_ERR, "Error: Could not locate '%s' in VPD.\n",
wifi_sar_limit_key); wifi_sar_limit_key);

View File

@ -99,7 +99,7 @@ static size_t fill_up_entries_cache(struct vpd_blob_cache_t *cache,
strcpy(cache->key_name, templates[i]); strcpy(cache->key_name, templates[i]);
cache->key_name[index_location] = j + '0'; cache->key_name[index_location] = j + '0';
payload = vpd_find(cache->key_name, &payload_size, VPD_ANY); payload = vpd_find(cache->key_name, &payload_size, VPD_RO_THEN_RW);
if (!payload) if (!payload)
continue; continue;

View File

@ -73,7 +73,7 @@ void lb_table_add_macs_from_vpd(struct lb_header *header)
* in the VPD - move on. * in the VPD - move on.
*/ */
if (!vpd_gets(mac_addr_key, mac_addr_str, if (!vpd_gets(mac_addr_key, mac_addr_str,
sizeof(mac_addr_str), VPD_ANY)) sizeof(mac_addr_str), VPD_RO_THEN_RW))
break; break;
if (!macs) { if (!macs) {

View File

@ -15,7 +15,7 @@ void lb_table_add_serialno_from_vpd(struct lb_header *header)
size_t len; size_t len;
if (!vpd_gets(serialno_key, serialno, if (!vpd_gets(serialno_key, serialno,
sizeof(serialno), VPD_ANY)) { sizeof(serialno), VPD_RO_THEN_RW)) {
printk(BIOS_ERR, "no serial number in vpd\n"); printk(BIOS_ERR, "no serial number in vpd\n");
return; return;
} }

View File

@ -48,7 +48,7 @@ uint16_t wifi_regulatory_domain(void)
/* If not found for any reason fall backto the default value */ /* If not found for any reason fall backto the default value */
if (!vpd_gets(wrdd_domain_key, wrdd_domain_code, if (!vpd_gets(wrdd_domain_key, wrdd_domain_code,
ARRAY_SIZE(wrdd_domain_code), VPD_ANY)) { ARRAY_SIZE(wrdd_domain_code), VPD_RO_THEN_RW)) {
printk(BIOS_DEBUG, printk(BIOS_DEBUG,
"Error: Could not locate '%s' in VPD\n", wrdd_domain_key); "Error: Could not locate '%s' in VPD\n", wrdd_domain_key);
return WRDD_DEFAULT_REGULATORY_DOMAIN; return WRDD_DEFAULT_REGULATORY_DOMAIN;