Attention is currently required from: Martin Roth.

Angel Pons has uploaded this change for review.

View Change

[WIP] SCONFIG: Add SMBIOS Type 41 entries

Introduce the `smbios_dev_info` devicetree keyword to specify the
instance ID and RefDes (Reference Designation) of onboard devices.

Example syntax:

device pci 1c.0 on # PCIe Port #1
device pci 00.0 on
smbios_dev_info "Ethernet, probably"
end
end
device pci 1c.1 on # PCIe Port #2
device pci 00.0 on
smbios_dev_info 6
end
end
device pci 1c.2 on # PCIe Port #3
device pci 00.0 on
smbios_dev_info "PCIe-PCI Time Machine" 42
end
end

Currently, this only supports PCI devices, and the instance IDs are not
honored. A follow-up will take care of the instance IDs.

Change-Id: Iecca9ada6ee1000674cb5dd7afd5c309d8e1a64b
Signed-off-by: Angel Pons <th3fanbus@gmail.com>
---
M src/arch/x86/smbios.c
M src/include/device/device.h
M util/sconfig/lex.yy.c_shipped
M util/sconfig/main.c
M util/sconfig/sconfig.h
M util/sconfig/sconfig.l
M util/sconfig/sconfig.tab.c_shipped
M util/sconfig/sconfig.tab.h_shipped
M util/sconfig/sconfig.y
9 files changed, 400 insertions(+), 323 deletions(-)

git pull ssh://review.coreboot.org:29418/coreboot refs/changes/70/57370/1
diff --git a/src/arch/x86/smbios.c b/src/arch/x86/smbios.c
index 687d9a1..59afbab 100644
--- a/src/arch/x86/smbios.c
+++ b/src/arch/x86/smbios.c
@@ -1149,8 +1149,9 @@
if (device_type > SMBIOS_DEVICE_TYPE_COUNT)
return 0;

- const char *name = get_pci_subclass_name(dev);
+ const char *name = dev->smbios_refdes ? dev->smbios_refdes : get_pci_subclass_name(dev);

+ /* TODO: Honor dev->smbios_instance_id_valid and dev->smbios_instance_id */
return smbios_write_type41(current, handle,
name, // name
type41_inst_cnt[device_type]++, // inst
diff --git a/src/include/device/device.h b/src/include/device/device.h
index 8f0650f..cac791c 100644
--- a/src/include/device/device.h
+++ b/src/include/device/device.h
@@ -148,6 +148,10 @@
u8 smbios_slot_data_width;
u8 smbios_slot_length;
const char *smbios_slot_designation;
+
+ bool smbios_instance_id_valid;
+ u8 smbios_instance_id;
+ const char *smbios_refdes;
#endif
#endif
DEVTREE_CONST void *chip_info;
diff --git a/util/sconfig/lex.yy.c_shipped b/util/sconfig/lex.yy.c_shipped
index 07cb64b..647ec3d 100644
--- a/util/sconfig/lex.yy.c_shipped
+++ b/util/sconfig/lex.yy.c_shipped
@@ -349,8 +349,8 @@
(yy_hold_char) = *yy_cp; \
*yy_cp = '\0'; \
(yy_c_buf_p) = yy_cp;
-#define YY_NUM_RULES 49
-#define YY_END_OF_BUFFER 50
+#define YY_NUM_RULES 50
+#define YY_END_OF_BUFFER 51
/* This struct is not used in this scanner,
but its presence is necessary. */
struct yy_trans_info
@@ -358,31 +358,31 @@
flex_int32_t yy_verify;
flex_int32_t yy_nxt;
};
-static const flex_int16_t yy_accept[202] =
+static const flex_int16_t yy_accept[210] =
{ 0,
- 0, 0, 50, 48, 1, 3, 48, 48, 48, 43,
- 43, 40, 44, 48, 44, 44, 44, 44, 44, 48,
- 48, 48, 48, 48, 48, 48, 48, 48, 48, 41,
- 48, 1, 3, 48, 0, 48, 48, 0, 2, 43,
- 44, 48, 48, 48, 9, 48, 48, 44, 48, 48,
- 48, 48, 48, 48, 48, 48, 48, 48, 34, 48,
- 48, 48, 48, 48, 15, 48, 48, 48, 48, 48,
- 48, 48, 48, 48, 47, 47, 48, 0, 42, 48,
- 48, 48, 25, 48, 48, 33, 38, 48, 48, 48,
- 48, 48, 22, 48, 48, 32, 48, 48, 48, 16,
+ 0, 0, 51, 49, 1, 3, 49, 49, 49, 44,
+ 44, 41, 45, 49, 45, 45, 45, 45, 45, 49,
+ 49, 49, 49, 49, 49, 49, 49, 49, 49, 42,
+ 49, 1, 3, 49, 0, 49, 49, 0, 2, 44,
+ 45, 49, 49, 49, 9, 49, 49, 45, 49, 49,
+ 49, 49, 49, 49, 49, 49, 49, 49, 34, 49,
+ 49, 49, 49, 49, 15, 49, 49, 49, 49, 49,
+ 49, 49, 49, 49, 48, 48, 49, 0, 43, 49,
+ 49, 49, 25, 49, 49, 33, 38, 49, 49, 49,
+ 49, 49, 22, 49, 49, 32, 49, 49, 49, 16,

- 48, 19, 21, 48, 8, 48, 48, 29, 48, 30,
- 7, 48, 0, 45, 48, 4, 48, 48, 48, 48,
- 48, 48, 31, 48, 48, 48, 48, 48, 28, 48,
- 48, 48, 48, 48, 46, 46, 6, 48, 48, 48,
- 12, 48, 48, 48, 48, 48, 23, 48, 48, 14,
- 48, 48, 48, 48, 5, 26, 48, 48, 17, 48,
- 20, 48, 13, 48, 48, 48, 48, 48, 27, 36,
- 48, 48, 48, 48, 48, 48, 48, 48, 48, 10,
- 48, 48, 48, 11, 48, 18, 48, 48, 48, 35,
- 48, 48, 24, 48, 37, 48, 48, 48, 48, 39,
+ 49, 19, 21, 49, 8, 49, 49, 29, 49, 30,
+ 7, 49, 0, 46, 49, 4, 49, 49, 49, 49,
+ 49, 49, 31, 49, 49, 49, 49, 49, 28, 49,
+ 49, 49, 49, 49, 47, 47, 6, 49, 49, 49,
+ 12, 49, 49, 49, 49, 49, 23, 49, 49, 14,
+ 49, 49, 49, 49, 5, 26, 49, 49, 17, 49,
+ 20, 49, 13, 49, 49, 49, 49, 49, 27, 36,
+ 49, 49, 49, 49, 49, 49, 49, 49, 49, 10,
+ 49, 49, 49, 49, 11, 49, 18, 49, 49, 49,
+ 49, 35, 49, 49, 49, 24, 49, 49, 37, 49,

- 0
+ 49, 49, 49, 49, 49, 40, 49, 39, 0
} ;

static const YY_CHAR yy_ec[256] =
@@ -425,136 +425,140 @@
1, 1, 1, 1, 1, 1, 1, 1, 1, 1
} ;

-static const flex_int16_t yy_base[209] =
+static const flex_int16_t yy_base[217] =
{ 0,
- 0, 0, 274, 0, 271, 275, 269, 39, 43, 40,
- 233, 0, 46, 256, 56, 60, 64, 67, 72, 56,
- 244, 74, 251, 39, 70, 59, 246, 77, 233, 0,
- 0, 263, 275, 108, 259, 112, 116, 260, 275, 0,
- 113, 116, 247, 236, 0, 235, 224, 122, 231, 226,
- 236, 234, 238, 225, 227, 231, 231, 225, 231, 216,
- 216, 217, 219, 221, 0, 208, 216, 210, 210, 117,
- 220, 212, 218, 87, 0, 275, 139, 230, 0, 223,
- 216, 202, 215, 205, 212, 0, 0, 202, 208, 205,
- 196, 204, 0, 202, 192, 0, 196, 200, 190, 0,
+ 0, 0, 282, 0, 279, 283, 277, 39, 43, 40,
+ 241, 0, 46, 264, 56, 60, 64, 67, 72, 56,
+ 252, 74, 259, 39, 70, 59, 254, 77, 241, 0,
+ 0, 271, 283, 108, 267, 112, 116, 268, 283, 0,
+ 113, 116, 255, 244, 0, 243, 232, 122, 239, 234,
+ 244, 242, 246, 233, 235, 239, 239, 233, 239, 224,
+ 224, 225, 227, 229, 0, 216, 224, 218, 218, 117,
+ 228, 220, 226, 87, 0, 283, 139, 238, 0, 231,
+ 224, 210, 223, 213, 220, 0, 0, 210, 216, 213,
+ 204, 212, 0, 210, 200, 0, 204, 208, 198, 0,

- 193, 0, 0, 199, 0, 191, 190, 0, 181, 0,
- 0, 208, 207, 0, 178, 0, 191, 190, 183, 187,
- 177, 173, 0, 183, 171, 177, 182, 183, 0, 170,
- 177, 164, 167, 156, 0, 275, 0, 168, 172, 164,
- 0, 163, 165, 161, 163, 168, 0, 152, 157, 0,
- 150, 150, 149, 146, 0, 0, 158, 160, 0, 144,
- 161, 147, 0, 154, 158, 139, 139, 146, 0, 0,
- 132, 124, 123, 121, 132, 118, 128, 118, 110, 0,
- 122, 120, 125, 0, 114, 0, 114, 107, 94, 0,
- 82, 81, 0, 83, 0, 74, 67, 37, 31, 0,
+ 201, 0, 0, 207, 0, 199, 198, 0, 189, 0,
+ 0, 216, 215, 0, 186, 0, 199, 198, 191, 195,
+ 185, 181, 0, 191, 179, 185, 190, 191, 0, 178,
+ 185, 172, 175, 164, 0, 283, 0, 176, 180, 172,
+ 0, 171, 173, 169, 171, 176, 0, 160, 165, 0,
+ 158, 158, 157, 154, 0, 0, 166, 168, 0, 152,
+ 169, 155, 0, 162, 166, 147, 147, 154, 0, 0,
+ 153, 145, 144, 68, 154, 140, 150, 140, 132, 0,
+ 136, 130, 128, 133, 0, 122, 0, 116, 122, 125,
+ 117, 0, 132, 113, 126, 0, 120, 127, 0, 104,

- 275, 42, 158, 160, 162, 164, 166, 168
+ 106, 94, 78, 65, 37, 0, 31, 0, 283, 42,
+ 158, 160, 162, 164, 166, 168
} ;

-static const flex_int16_t yy_def[209] =
+static const flex_int16_t yy_def[217] =
{ 0,
- 201, 1, 201, 202, 201, 201, 202, 203, 204, 202,
- 10, 202, 10, 202, 10, 10, 10, 10, 10, 202,
- 202, 202, 202, 202, 202, 202, 202, 202, 202, 202,
- 202, 201, 201, 203, 205, 206, 204, 207, 201, 10,
- 10, 10, 202, 202, 202, 202, 202, 10, 202, 202,
- 202, 202, 202, 202, 202, 202, 202, 202, 202, 202,
- 202, 202, 202, 202, 202, 202, 202, 202, 202, 202,
- 202, 202, 202, 202, 202, 201, 206, 208, 42, 202,
- 202, 202, 202, 202, 202, 202, 202, 202, 202, 202,
- 202, 202, 202, 202, 202, 202, 202, 202, 202, 202,
+ 209, 1, 209, 210, 209, 209, 210, 211, 212, 210,
+ 10, 210, 10, 210, 10, 10, 10, 10, 10, 210,
+ 210, 210, 210, 210, 210, 210, 210, 210, 210, 210,
+ 210, 209, 209, 211, 213, 214, 212, 215, 209, 10,
+ 10, 10, 210, 210, 210, 210, 210, 10, 210, 210,
+ 210, 210, 210, 210, 210, 210, 210, 210, 210, 210,
+ 210, 210, 210, 210, 210, 210, 210, 210, 210, 210,
+ 210, 210, 210, 210, 210, 209, 214, 216, 42, 210,
+ 210, 210, 210, 210, 210, 210, 210, 210, 210, 210,
+ 210, 210, 210, 210, 210, 210, 210, 210, 210, 210,

- 202, 202, 202, 202, 202, 202, 202, 202, 202, 202,
- 202, 202, 201, 202, 202, 202, 202, 202, 202, 202,
- 202, 202, 202, 202, 202, 202, 202, 202, 202, 202,
- 202, 202, 202, 202, 202, 201, 202, 202, 202, 202,
- 202, 202, 202, 202, 202, 202, 202, 202, 202, 202,
- 202, 202, 202, 202, 202, 202, 202, 202, 202, 202,
- 202, 202, 202, 202, 202, 202, 202, 202, 202, 202,
- 202, 202, 202, 202, 202, 202, 202, 202, 202, 202,
- 202, 202, 202, 202, 202, 202, 202, 202, 202, 202,
- 202, 202, 202, 202, 202, 202, 202, 202, 202, 202,
+ 210, 210, 210, 210, 210, 210, 210, 210, 210, 210,
+ 210, 210, 209, 210, 210, 210, 210, 210, 210, 210,
+ 210, 210, 210, 210, 210, 210, 210, 210, 210, 210,
+ 210, 210, 210, 210, 210, 209, 210, 210, 210, 210,
+ 210, 210, 210, 210, 210, 210, 210, 210, 210, 210,
+ 210, 210, 210, 210, 210, 210, 210, 210, 210, 210,
+ 210, 210, 210, 210, 210, 210, 210, 210, 210, 210,
+ 210, 210, 210, 210, 210, 210, 210, 210, 210, 210,
+ 210, 210, 210, 210, 210, 210, 210, 210, 210, 210,
+ 210, 210, 210, 210, 210, 210, 210, 210, 210, 210,

- 0, 201, 201, 201, 201, 201, 201, 201
+ 210, 210, 210, 210, 210, 210, 210, 210, 0, 209,
+ 209, 209, 209, 209, 209, 209
} ;

-static const flex_int16_t yy_nxt[316] =
+static const flex_int16_t yy_nxt[324] =
{ 0,
4, 5, 6, 7, 8, 9, 10, 11, 10, 12,
13, 13, 14, 4, 4, 4, 15, 13, 16, 17,
18, 19, 20, 21, 22, 23, 24, 4, 25, 26,
4, 27, 28, 4, 29, 4, 4, 4, 4, 30,
- 35, 35, 31, 36, 38, 39, 40, 40, 40, 200,
+ 35, 35, 31, 36, 38, 39, 40, 40, 40, 208,
41, 41, 41, 41, 41, 62, 41, 41, 41, 41,
- 41, 41, 41, 41, 41, 63, 41, 41, 41, 199,
+ 41, 41, 41, 41, 41, 63, 41, 41, 41, 207,
41, 41, 41, 41, 41, 41, 54, 67, 41, 41,
- 41, 44, 57, 46, 48, 55, 68, 198, 45, 47,
- 69, 64, 49, 197, 51, 50, 52, 65, 196, 66,
+ 41, 44, 57, 46, 48, 55, 68, 181, 45, 47,
+ 69, 64, 49, 206, 51, 50, 52, 65, 205, 66,

- 195, 58, 59, 71, 110, 60, 72, 111, 53, 35,
- 35, 73, 75, 78, 78, 194, 31, 38, 39, 41,
- 41, 41, 79, 79, 79, 193, 79, 79, 41, 41,
- 41, 192, 79, 79, 79, 79, 79, 79, 105, 106,
- 78, 78, 191, 112, 190, 189, 188, 187, 186, 185,
- 184, 183, 182, 181, 180, 179, 178, 84, 34, 34,
+ 182, 58, 59, 71, 110, 60, 72, 111, 53, 35,
+ 35, 73, 75, 78, 78, 204, 31, 38, 39, 41,
+ 41, 41, 79, 79, 79, 203, 79, 79, 41, 41,
+ 41, 202, 79, 79, 79, 79, 79, 79, 105, 106,
+ 78, 78, 201, 112, 200, 199, 198, 197, 196, 195,
+ 194, 193, 192, 191, 190, 189, 188, 84, 34, 34,
37, 37, 35, 35, 77, 77, 38, 38, 78, 78,
- 177, 176, 175, 174, 173, 172, 171, 170, 169, 168,
- 167, 166, 165, 164, 163, 162, 161, 160, 159, 158,
- 157, 156, 155, 154, 153, 152, 151, 150, 149, 148,
+ 187, 186, 185, 184, 183, 180, 179, 178, 177, 176,
+ 175, 174, 173, 172, 171, 170, 169, 168, 167, 166,
+ 165, 164, 163, 162, 161, 160, 159, 158, 157, 156,

- 147, 146, 145, 144, 143, 142, 141, 140, 139, 138,
- 137, 136, 135, 134, 133, 132, 131, 130, 129, 128,
- 127, 126, 125, 124, 123, 122, 121, 120, 119, 118,
- 117, 116, 115, 114, 113, 109, 108, 107, 104, 103,
- 102, 101, 100, 99, 98, 97, 96, 95, 94, 93,
- 92, 91, 90, 89, 88, 87, 86, 85, 83, 82,
- 81, 80, 39, 76, 32, 74, 70, 61, 56, 43,
- 42, 33, 32, 201, 3, 201, 201, 201, 201, 201,
- 201, 201, 201, 201, 201, 201, 201, 201, 201, 201,
- 201, 201, 201, 201, 201, 201, 201, 201, 201, 201,
+ 155, 154, 153, 152, 151, 150, 149, 148, 147, 146,
+ 145, 144, 143, 142, 141, 140, 139, 138, 137, 136,
+ 135, 134, 133, 132, 131, 130, 129, 128, 127, 126,
+ 125, 124, 123, 122, 121, 120, 119, 118, 117, 116,
+ 115, 114, 113, 109, 108, 107, 104, 103, 102, 101,
+ 100, 99, 98, 97, 96, 95, 94, 93, 92, 91,
+ 90, 89, 88, 87, 86, 85, 83, 82, 81, 80,
+ 39, 76, 32, 74, 70, 61, 56, 43, 42, 33,
+ 32, 209, 3, 209, 209, 209, 209, 209, 209, 209,
+ 209, 209, 209, 209, 209, 209, 209, 209, 209, 209,

- 201, 201, 201, 201, 201, 201, 201, 201, 201, 201,
- 201, 201, 201, 201, 201
+ 209, 209, 209, 209, 209, 209, 209, 209, 209, 209,
+ 209, 209, 209, 209, 209, 209, 209, 209, 209, 209,
+ 209, 209, 209
} ;

-static const flex_int16_t yy_chk[316] =
+static const flex_int16_t yy_chk[324] =
{ 0,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 8, 8, 202, 8, 9, 9, 10, 10, 10, 199,
+ 8, 8, 210, 8, 9, 9, 10, 10, 10, 207,
10, 10, 13, 13, 13, 24, 10, 10, 10, 10,
- 10, 10, 15, 15, 15, 24, 16, 16, 16, 198,
+ 10, 10, 15, 15, 15, 24, 16, 16, 16, 205,
17, 17, 17, 18, 18, 18, 20, 26, 19, 19,
- 19, 15, 22, 16, 17, 20, 26, 197, 15, 16,
- 26, 25, 17, 196, 18, 17, 19, 25, 194, 25,
+ 19, 15, 22, 16, 17, 20, 26, 174, 15, 16,
+ 26, 25, 17, 204, 18, 17, 19, 25, 203, 25,

- 192, 22, 22, 28, 74, 22, 28, 74, 19, 34,
- 34, 28, 34, 36, 36, 191, 36, 37, 37, 41,
- 41, 41, 42, 42, 42, 189, 42, 42, 48, 48,
- 48, 188, 42, 42, 42, 42, 42, 42, 70, 70,
- 77, 77, 187, 77, 185, 183, 182, 181, 179, 178,
- 177, 176, 175, 174, 173, 172, 171, 48, 203, 203,
- 204, 204, 205, 205, 206, 206, 207, 207, 208, 208,
- 168, 167, 166, 165, 164, 162, 161, 160, 158, 157,
- 154, 153, 152, 151, 149, 148, 146, 145, 144, 143,
- 142, 140, 139, 138, 134, 133, 132, 131, 130, 128,
+ 174, 22, 22, 28, 74, 22, 28, 74, 19, 34,
+ 34, 28, 34, 36, 36, 202, 36, 37, 37, 41,
+ 41, 41, 42, 42, 42, 201, 42, 42, 48, 48,
+ 48, 200, 42, 42, 42, 42, 42, 42, 70, 70,
+ 77, 77, 198, 77, 197, 195, 194, 193, 191, 190,
+ 189, 188, 186, 184, 183, 182, 181, 48, 211, 211,
+ 212, 212, 213, 213, 214, 214, 215, 215, 216, 216,
+ 179, 178, 177, 176, 175, 173, 172, 171, 168, 167,
+ 166, 165, 164, 162, 161, 160, 158, 157, 154, 153,
+ 152, 151, 149, 148, 146, 145, 144, 143, 142, 140,

- 127, 126, 125, 124, 122, 121, 120, 119, 118, 117,
- 115, 113, 112, 109, 107, 106, 104, 101, 99, 98,
- 97, 95, 94, 92, 91, 90, 89, 88, 85, 84,
- 83, 82, 81, 80, 78, 73, 72, 71, 69, 68,
- 67, 66, 64, 63, 62, 61, 60, 59, 58, 57,
- 56, 55, 54, 53, 52, 51, 50, 49, 47, 46,
- 44, 43, 38, 35, 32, 29, 27, 23, 21, 14,
- 11, 7, 5, 3, 201, 201, 201, 201, 201, 201,
- 201, 201, 201, 201, 201, 201, 201, 201, 201, 201,
- 201, 201, 201, 201, 201, 201, 201, 201, 201, 201,
+ 139, 138, 134, 133, 132, 131, 130, 128, 127, 126,
+ 125, 124, 122, 121, 120, 119, 118, 117, 115, 113,
+ 112, 109, 107, 106, 104, 101, 99, 98, 97, 95,
+ 94, 92, 91, 90, 89, 88, 85, 84, 83, 82,
+ 81, 80, 78, 73, 72, 71, 69, 68, 67, 66,
+ 64, 63, 62, 61, 60, 59, 58, 57, 56, 55,
+ 54, 53, 52, 51, 50, 49, 47, 46, 44, 43,
+ 38, 35, 32, 29, 27, 23, 21, 14, 11, 7,
+ 5, 3, 209, 209, 209, 209, 209, 209, 209, 209,
+ 209, 209, 209, 209, 209, 209, 209, 209, 209, 209,

- 201, 201, 201, 201, 201, 201, 201, 201, 201, 201,
- 201, 201, 201, 201, 201
+ 209, 209, 209, 209, 209, 209, 209, 209, 209, 209,
+ 209, 209, 209, 209, 209, 209, 209, 209, 209, 209,
+ 209, 209, 209
} ;

static yy_state_type yy_last_accepting_state;
@@ -819,13 +823,13 @@
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
{
yy_current_state = (int) yy_def[yy_current_state];
- if ( yy_current_state >= 202 )
+ if ( yy_current_state >= 210 )
yy_c = yy_meta[yy_c];
}
yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
++yy_cp;
}
- while ( yy_base[yy_current_state] != 275 );
+ while ( yy_base[yy_current_state] != 283 );

yy_find_action:
yy_act = yy_accept[yy_current_state];
@@ -1009,15 +1013,15 @@
YY_BREAK
case 40:
YY_RULE_SETUP
-{return(EQUALS);}
+{return(SMBIOS_DEV_INFO);}
YY_BREAK
case 41:
YY_RULE_SETUP
-{return(PIPE);}
+{return(EQUALS);}
YY_BREAK
case 42:
YY_RULE_SETUP
-{yylval.string = malloc(yyleng+1); strncpy(yylval.string, yytext, yyleng); yylval.string[yyleng]='\0'; return(NUMBER);}
+{return(PIPE);}
YY_BREAK
case 43:
YY_RULE_SETUP
@@ -1029,12 +1033,11 @@
YY_BREAK
case 45:
YY_RULE_SETUP
-{yylval.string = malloc(yyleng+1); strncpy(yylval.string, yytext, yyleng); yylval.string[yyleng]='\0'; return(PCIINT);}
+{yylval.string = malloc(yyleng+1); strncpy(yylval.string, yytext, yyleng); yylval.string[yyleng]='\0'; return(NUMBER);}
YY_BREAK
case 46:
-/* rule 46 can match eol */
YY_RULE_SETUP
-{yylval.string = malloc(yyleng-1); strncpy(yylval.string, yytext+1, yyleng-2); yylval.string[yyleng-2]='\0'; return(STRING);}
+{yylval.string = malloc(yyleng+1); strncpy(yylval.string, yytext, yyleng); yylval.string[yyleng]='\0'; return(PCIINT);}
YY_BREAK
case 47:
/* rule 47 can match eol */
@@ -1042,10 +1045,15 @@
{yylval.string = malloc(yyleng-1); strncpy(yylval.string, yytext+1, yyleng-2); yylval.string[yyleng-2]='\0'; return(STRING);}
YY_BREAK
case 48:
+/* rule 48 can match eol */
+YY_RULE_SETUP
+{yylval.string = malloc(yyleng-1); strncpy(yylval.string, yytext+1, yyleng-2); yylval.string[yyleng-2]='\0'; return(STRING);}
+ YY_BREAK
+case 49:
YY_RULE_SETUP
{yylval.string = malloc(yyleng+1); strncpy(yylval.string, yytext, yyleng); yylval.string[yyleng]='\0'; return(STRING);}
YY_BREAK
-case 49:
+case 50:
YY_RULE_SETUP
ECHO;
YY_BREAK
@@ -1345,7 +1353,7 @@
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
{
yy_current_state = (int) yy_def[yy_current_state];
- if ( yy_current_state >= 202 )
+ if ( yy_current_state >= 210 )
yy_c = yy_meta[yy_c];
}
yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
@@ -1373,11 +1381,11 @@
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
{
yy_current_state = (int) yy_def[yy_current_state];
- if ( yy_current_state >= 202 )
+ if ( yy_current_state >= 210 )
yy_c = yy_meta[yy_c];
}
yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
- yy_is_jam = (yy_current_state == 201);
+ yy_is_jam = (yy_current_state == 209);

return yy_is_jam ? 0 : yy_current_state;
}
diff --git a/util/sconfig/main.c b/util/sconfig/main.c
index a9634dd..ca42f1a 100644
--- a/util/sconfig/main.c
+++ b/util/sconfig/main.c
@@ -734,6 +734,7 @@
dev->parent = parent;
dev->subsystem_vendor = -1;
dev->subsystem_device = -1;
+ dev->smbios_instance_id = -1;

alloc_bus(dev);

@@ -1023,6 +1024,24 @@
dev->smbios_slot_designation = designation;
}

+void add_smbios_dev_info(struct bus *bus, const char *refdes, long instance_id)
+{
+ struct device *dev = bus->dev;
+
+ if (dev->bustype != PCI && dev->bustype != DOMAIN) {
+ printf("ERROR: 'slot_type' only allowed for PCI devices\n");
+ exit(1);
+ }
+
+ if (instance_id > UINT8_MAX) {
+ printf("ERROR: SMBIOS device info instance ID '%ld' too large\n", instance_id);
+ exit(1);
+ }
+
+ dev->smbios_refdes = refdes;
+ dev->smbios_instance_id = instance_id >= 0 ? (int)instance_id : -1;
+}
+
void add_pci_subsystem_ids(struct bus *bus, int vendor, int device,
int inherit)
{
@@ -1113,7 +1132,9 @@
return (ptr->smbios_slot_type ||
ptr->smbios_slot_data_width ||
ptr->smbios_slot_designation ||
- ptr->smbios_slot_length);
+ ptr->smbios_slot_length ||
+ ptr->smbios_refdes ||
+ ptr->smbios_instance_id >= 0);
}

static void emit_smbios_data(FILE *fil, struct device *ptr)
@@ -1138,6 +1159,14 @@
fprintf(fil, "\t.smbios_slot_length = %s,\n",
ptr->smbios_slot_length);

+ /* Fill in SMBIOS type41 fields */
+ if (ptr->smbios_refdes)
+ fprintf(fil, "\t.smbios_refdes = \"%s\",\n", ptr->smbios_refdes);
+ if (ptr->smbios_instance_id >= 0) {
+ fprintf(fil, "\t.smbios_instance_id_valid = true,\n");
+ fprintf(fil, "\t.smbios_instance_id = %d,\n", ptr->smbios_instance_id);
+ }
+
fprintf(fil, "#endif\n");
fprintf(fil, "#endif\n");
}
diff --git a/util/sconfig/sconfig.h b/util/sconfig/sconfig.h
index e6bd5aa..c7b359c 100644
--- a/util/sconfig/sconfig.h
+++ b/util/sconfig/sconfig.h
@@ -177,6 +177,10 @@
/* SMBIOS slot length */
char *smbios_slot_length;

+ /* SMBIOS type41 fields */
+ const char *smbios_refdes;
+ int smbios_instance_id;
+
/* List of field+option to probe. */
struct fw_config_probe *probe;
};
@@ -203,6 +207,8 @@
void add_slot_desc(struct bus *bus, char *type, char *length, char *designation,
char *data_width);

+void add_smbios_dev_info(struct bus *bus, const char *refdes, long instance_id);
+
void yyrestart(FILE *input_file);

/* Add chip data to tail of queue. */
diff --git a/util/sconfig/sconfig.l b/util/sconfig/sconfig.l
index 1111267..0997ff6 100755
--- a/util/sconfig/sconfig.l
+++ b/util/sconfig/sconfig.l
@@ -47,6 +47,7 @@
subsystemid {return(SUBSYSTEMID);}
end {return(END);}
smbios_slot_desc {return(SLOT_DESC);}
+smbios_dev_info {return(SMBIOS_DEV_INFO);}
= {return(EQUALS);}
\| {return(PIPE);}
0x[0-9a-fA-F.]+ {yylval.string = malloc(yyleng+1); strncpy(yylval.string, yytext, yyleng); yylval.string[yyleng]='\0'; return(NUMBER);}
diff --git a/util/sconfig/sconfig.tab.c_shipped b/util/sconfig/sconfig.tab.c_shipped
index 6155dc0..997ef1b 100644
--- a/util/sconfig/sconfig.tab.c_shipped
+++ b/util/sconfig/sconfig.tab.c_shipped
@@ -1,4 +1,4 @@
-/* A Bison parser, made by GNU Bison 3.7.5. */
+/* A Bison parser, made by GNU Bison 3.7.6. */

/* Bison implementation for Yacc-like parsers in C

@@ -16,7 +16,7 @@
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>. */
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */

/* As a special exception, you may create a larger work that contains
part or all of the Bison parser skeleton and distribute that work
@@ -46,10 +46,10 @@
USER NAME SPACE" below. */

/* Identify Bison output, and Bison version. */
-#define YYBISON 30705
+#define YYBISON 30706

/* Bison version string. */
-#define YYBISON_VERSION "3.7.5"
+#define YYBISON_VERSION "3.7.6"

/* Skeleton name. */
#define YYSKELETON_NAME "yacc.c"
@@ -138,51 +138,53 @@
YYSYMBOL_IRQ = 25, /* IRQ */
YYSYMBOL_DRQ = 26, /* DRQ */
YYSYMBOL_SLOT_DESC = 27, /* SLOT_DESC */
- YYSYMBOL_IO = 28, /* IO */
- YYSYMBOL_NUMBER = 29, /* NUMBER */
- YYSYMBOL_SUBSYSTEMID = 30, /* SUBSYSTEMID */
- YYSYMBOL_INHERIT = 31, /* INHERIT */
- YYSYMBOL_IOAPIC_IRQ = 32, /* IOAPIC_IRQ */
- YYSYMBOL_IOAPIC = 33, /* IOAPIC */
- YYSYMBOL_PCIINT = 34, /* PCIINT */
- YYSYMBOL_GENERIC = 35, /* GENERIC */
- YYSYMBOL_SPI = 36, /* SPI */
- YYSYMBOL_USB = 37, /* USB */
- YYSYMBOL_MMIO = 38, /* MMIO */
- YYSYMBOL_GPIO = 39, /* GPIO */
- YYSYMBOL_FW_CONFIG_TABLE = 40, /* FW_CONFIG_TABLE */
- YYSYMBOL_FW_CONFIG_FIELD = 41, /* FW_CONFIG_FIELD */
- YYSYMBOL_FW_CONFIG_OPTION = 42, /* FW_CONFIG_OPTION */
- YYSYMBOL_FW_CONFIG_PROBE = 43, /* FW_CONFIG_PROBE */
- YYSYMBOL_PIPE = 44, /* PIPE */
- YYSYMBOL_YYACCEPT = 45, /* $accept */
- YYSYMBOL_devtree = 46, /* devtree */
- YYSYMBOL_chipchildren = 47, /* chipchildren */
- YYSYMBOL_devicechildren = 48, /* devicechildren */
- YYSYMBOL_chip = 49, /* chip */
- YYSYMBOL_50_1 = 50, /* @1 */
- YYSYMBOL_device = 51, /* device */
- YYSYMBOL_52_2 = 52, /* @2 */
- YYSYMBOL_53_3 = 53, /* @3 */
- YYSYMBOL_alias = 54, /* alias */
- YYSYMBOL_status = 55, /* status */
- YYSYMBOL_resource = 56, /* resource */
- YYSYMBOL_reference = 57, /* reference */
- YYSYMBOL_registers = 58, /* registers */
- YYSYMBOL_subsystemid = 59, /* subsystemid */
- YYSYMBOL_ioapic_irq = 60, /* ioapic_irq */
- YYSYMBOL_smbios_slot_desc = 61, /* smbios_slot_desc */
- YYSYMBOL_fw_config_table = 62, /* fw_config_table */
- YYSYMBOL_fw_config_table_children = 63, /* fw_config_table_children */
- YYSYMBOL_fw_config_field_children = 64, /* fw_config_field_children */
- YYSYMBOL_fw_config_field_bits = 65, /* fw_config_field_bits */
- YYSYMBOL_fw_config_field_bits_repeating = 66, /* fw_config_field_bits_repeating */
- YYSYMBOL_fw_config_field = 67, /* fw_config_field */
- YYSYMBOL_68_4 = 68, /* $@4 */
- YYSYMBOL_69_5 = 69, /* $@5 */
- YYSYMBOL_70_6 = 70, /* $@6 */
- YYSYMBOL_fw_config_option = 71, /* fw_config_option */
- YYSYMBOL_fw_config_probe = 72 /* fw_config_probe */
+ YYSYMBOL_SMBIOS_DEV_INFO = 28, /* SMBIOS_DEV_INFO */
+ YYSYMBOL_IO = 29, /* IO */
+ YYSYMBOL_NUMBER = 30, /* NUMBER */
+ YYSYMBOL_SUBSYSTEMID = 31, /* SUBSYSTEMID */
+ YYSYMBOL_INHERIT = 32, /* INHERIT */
+ YYSYMBOL_IOAPIC_IRQ = 33, /* IOAPIC_IRQ */
+ YYSYMBOL_IOAPIC = 34, /* IOAPIC */
+ YYSYMBOL_PCIINT = 35, /* PCIINT */
+ YYSYMBOL_GENERIC = 36, /* GENERIC */
+ YYSYMBOL_SPI = 37, /* SPI */
+ YYSYMBOL_USB = 38, /* USB */
+ YYSYMBOL_MMIO = 39, /* MMIO */
+ YYSYMBOL_GPIO = 40, /* GPIO */
+ YYSYMBOL_FW_CONFIG_TABLE = 41, /* FW_CONFIG_TABLE */
+ YYSYMBOL_FW_CONFIG_FIELD = 42, /* FW_CONFIG_FIELD */
+ YYSYMBOL_FW_CONFIG_OPTION = 43, /* FW_CONFIG_OPTION */
+ YYSYMBOL_FW_CONFIG_PROBE = 44, /* FW_CONFIG_PROBE */
+ YYSYMBOL_PIPE = 45, /* PIPE */
+ YYSYMBOL_YYACCEPT = 46, /* $accept */
+ YYSYMBOL_devtree = 47, /* devtree */
+ YYSYMBOL_chipchildren = 48, /* chipchildren */
+ YYSYMBOL_devicechildren = 49, /* devicechildren */
+ YYSYMBOL_chip = 50, /* chip */
+ YYSYMBOL_51_1 = 51, /* @1 */
+ YYSYMBOL_device = 52, /* device */
+ YYSYMBOL_53_2 = 53, /* @2 */
+ YYSYMBOL_54_3 = 54, /* @3 */
+ YYSYMBOL_alias = 55, /* alias */
+ YYSYMBOL_status = 56, /* status */
+ YYSYMBOL_resource = 57, /* resource */
+ YYSYMBOL_reference = 58, /* reference */
+ YYSYMBOL_registers = 59, /* registers */
+ YYSYMBOL_subsystemid = 60, /* subsystemid */
+ YYSYMBOL_ioapic_irq = 61, /* ioapic_irq */
+ YYSYMBOL_smbios_slot_desc = 62, /* smbios_slot_desc */
+ YYSYMBOL_smbios_dev_info = 63, /* smbios_dev_info */
+ YYSYMBOL_fw_config_table = 64, /* fw_config_table */
+ YYSYMBOL_fw_config_table_children = 65, /* fw_config_table_children */
+ YYSYMBOL_fw_config_field_children = 66, /* fw_config_field_children */
+ YYSYMBOL_fw_config_field_bits = 67, /* fw_config_field_bits */
+ YYSYMBOL_fw_config_field_bits_repeating = 68, /* fw_config_field_bits_repeating */
+ YYSYMBOL_fw_config_field = 69, /* fw_config_field */
+ YYSYMBOL_70_4 = 70, /* $@4 */
+ YYSYMBOL_71_5 = 71, /* $@5 */
+ YYSYMBOL_72_6 = 72, /* $@6 */
+ YYSYMBOL_fw_config_option = 73, /* fw_config_option */
+ YYSYMBOL_fw_config_probe = 74 /* fw_config_probe */
};
typedef enum yysymbol_kind_t yysymbol_kind_t;

@@ -504,19 +506,19 @@
/* YYFINAL -- State number of the termination state. */
#define YYFINAL 2
/* YYLAST -- Last index in YYTABLE. */
-#define YYLAST 97
+#define YYLAST 101

/* YYNTOKENS -- Number of terminals. */
-#define YYNTOKENS 45
+#define YYNTOKENS 46
/* YYNNTS -- Number of nonterminals. */
-#define YYNNTS 28
+#define YYNNTS 29
/* YYNRULES -- Number of rules. */
-#define YYNRULES 53
+#define YYNRULES 57
/* YYNSTATES -- Number of states. */
-#define YYNSTATES 95
+#define YYNSTATES 100

/* YYMAXUTOK -- Last valid token kind. */
-#define YYMAXUTOK 299
+#define YYMAXUTOK 300


/* YYTRANSLATE(TOKEN-NUM) -- Symbol number corresponding to TOKEN-NUM
@@ -559,7 +561,8 @@
5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
- 35, 36, 37, 38, 39, 40, 41, 42, 43, 44
+ 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
+ 45
};

#if YYDEBUG
@@ -567,11 +570,11 @@
static const yytype_uint8 yyrline[] =
{
0, 26, 26, 26, 26, 28, 28, 28, 28, 28,
- 30, 30, 30, 30, 30, 30, 30, 30, 30, 32,
- 32, 41, 41, 49, 49, 57, 59, 63, 63, 65,
- 68, 71, 74, 77, 80, 83, 86, 89, 93, 96,
- 96, 99, 99, 102, 108, 108, 111, 110, 115, 115,
- 123, 123, 129, 133
+ 30, 30, 30, 30, 30, 30, 30, 30, 30, 30,
+ 32, 32, 41, 41, 49, 49, 57, 59, 63, 63,
+ 65, 68, 71, 74, 77, 80, 83, 86, 89, 92,
+ 95, 98, 102, 105, 105, 108, 108, 111, 117, 117,
+ 120, 119, 124, 124, 132, 132, 138, 142
};
#endif

@@ -591,16 +594,17 @@
"REGISTER", "ALIAS", "REFERENCE", "ASSOCIATION", "BOOL", "STATUS",
"MANDATORY", "BUS", "RESOURCE", "END", "EQUALS", "HEX", "STRING", "PCI",
"PNP", "I2C", "APIC", "CPU_CLUSTER", "CPU", "DOMAIN", "IRQ", "DRQ",
- "SLOT_DESC", "IO", "NUMBER", "SUBSYSTEMID", "INHERIT", "IOAPIC_IRQ",
- "IOAPIC", "PCIINT", "GENERIC", "SPI", "USB", "MMIO", "GPIO",
- "FW_CONFIG_TABLE", "FW_CONFIG_FIELD", "FW_CONFIG_OPTION",
+ "SLOT_DESC", "SMBIOS_DEV_INFO", "IO", "NUMBER", "SUBSYSTEMID", "INHERIT",
+ "IOAPIC_IRQ", "IOAPIC", "PCIINT", "GENERIC", "SPI", "USB", "MMIO",
+ "GPIO", "FW_CONFIG_TABLE", "FW_CONFIG_FIELD", "FW_CONFIG_OPTION",
"FW_CONFIG_PROBE", "PIPE", "$accept", "devtree", "chipchildren",
"devicechildren", "chip", "@1", "device", "@2", "@3", "alias", "status",
"resource", "reference", "registers", "subsystemid", "ioapic_irq",
- "smbios_slot_desc", "fw_config_table", "fw_config_table_children",
- "fw_config_field_children", "fw_config_field_bits",
- "fw_config_field_bits_repeating", "fw_config_field", "$@4", "$@5", "$@6",
- "fw_config_option", "fw_config_probe", YY_NULLPTR
+ "smbios_slot_desc", "smbios_dev_info", "fw_config_table",
+ "fw_config_table_children", "fw_config_field_children",
+ "fw_config_field_bits", "fw_config_field_bits_repeating",
+ "fw_config_field", "$@4", "$@5", "$@6", "fw_config_option",
+ "fw_config_probe", YY_NULLPTR
};

static const char *
@@ -619,11 +623,11 @@
265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
- 295, 296, 297, 298, 299
+ 295, 296, 297, 298, 299, 300
};
#endif

-#define YYPACT_NINF (-27)
+#define YYPACT_NINF (-17)

#define yypact_value_is_default(Yyn) \
((Yyn) == YYPACT_NINF)
@@ -637,16 +641,16 @@
STATE-NUM. */
static const yytype_int8 yypact[] =
{
- -27, 9, -27, 2, -27, -27, -27, -27, -11, -27,
- -27, 4, -27, 43, -13, 10, 20, 21, -27, -27,
- -27, -27, -27, 13, -26, -27, 22, 14, 30, 44,
- -27, -27, 24, -27, -7, 16, 45, 37, 38, -6,
- 13, -26, -27, -27, 39, -27, -27, -27, -27, 41,
- 16, -27, -27, -27, -27, -1, 31, -27, -27, -27,
- -27, -27, -3, -27, 32, -27, 42, 33, 34, 47,
- -27, -27, -27, -27, -27, -27, -27, -27, 1, 50,
- 49, 40, 36, 51, -27, 46, 54, 48, 52, -27,
- -27, 55, -27, -27, -27
+ -17, 3, -17, 2, -17, -17, -17, -17, -2, -17,
+ -17, 21, -17, 42, 9, 8, 26, 33, -17, -17,
+ -17, -17, -17, 22, -16, -17, 34, 23, 39, 47,
+ -17, -17, 27, -17, -10, 12, 52, 43, 44, -9,
+ 22, -16, -17, -17, 45, -17, -17, -17, -17, 46,
+ 12, -17, -17, -17, -17, -1, 29, -17, -17, -17,
+ -17, -17, -3, -17, 35, -17, 49, 6, 37, 38,
+ 53, -17, -17, -17, -17, -17, -17, -17, -17, -17,
+ 4, 54, 55, 41, -17, 48, 40, 56, -17, 50,
+ 57, -17, 32, 51, -17, -17, 59, -17, -17, -17
};

/* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
@@ -654,32 +658,32 @@
means the default is an error. */
static const yytype_int8 yydefact[] =
{
- 2, 0, 1, 0, 40, 3, 4, 19, 0, 9,
- 38, 0, 39, 0, 50, 0, 0, 0, 20, 6,
- 5, 8, 7, 48, 45, 42, 0, 0, 0, 0,
- 43, 42, 0, 46, 0, 0, 25, 0, 0, 0,
- 0, 45, 42, 51, 0, 41, 27, 28, 23, 0,
- 0, 31, 30, 49, 44, 0, 0, 18, 26, 21,
- 47, 52, 0, 18, 0, 24, 0, 0, 0, 0,
- 11, 10, 12, 16, 13, 14, 15, 17, 0, 0,
- 0, 0, 0, 0, 22, 0, 37, 32, 0, 53,
- 29, 36, 33, 34, 35
+ 2, 0, 1, 0, 44, 3, 4, 20, 0, 9,
+ 42, 0, 43, 0, 54, 0, 0, 0, 21, 6,
+ 5, 8, 7, 52, 49, 46, 0, 0, 0, 0,
+ 47, 46, 0, 50, 0, 0, 26, 0, 0, 0,
+ 0, 49, 46, 55, 0, 45, 28, 29, 24, 0,
+ 0, 32, 31, 53, 48, 0, 0, 19, 27, 22,
+ 51, 56, 0, 19, 0, 25, 0, 0, 0, 0,
+ 0, 11, 10, 12, 17, 13, 14, 15, 16, 18,
+ 0, 0, 0, 40, 41, 0, 0, 0, 23, 0,
+ 38, 39, 33, 0, 57, 30, 37, 34, 35, 36
};

/* YYPGOTO[NTERM-NUM]. */
static const yytype_int8 yypgoto[] =
{
- -27, -27, -27, 11, 19, -27, 60, -27, -27, -27,
- 17, -27, -27, 63, -27, -27, -27, -27, -27, -8,
- 53, 56, -27, -27, -27, -27, -27, -27
+ -17, -17, -17, 14, 13, -17, 66, -17, -17, -17,
+ 36, -17, -17, 69, -17, -17, -17, -17, -17, -17,
+ -15, 58, 60, -17, -17, -17, -17, -17, -17
};

/* YYDEFGOTO[NTERM-NUM]. */
static const yytype_int8 yydefgoto[] =
{
- 0, 1, 13, 62, 70, 9, 71, 63, 57, 50,
- 48, 72, 21, 73, 74, 75, 76, 6, 8, 34,
- 24, 33, 12, 42, 31, 25, 45, 77
+ 0, 1, 13, 62, 71, 9, 72, 63, 57, 50,
+ 48, 73, 21, 74, 75, 76, 77, 78, 6, 8,
+ 34, 24, 33, 12, 42, 31, 25, 45, 79
};

/* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If
@@ -687,68 +691,70 @@
number is the opposite. If YYTABLE_NINF, syntax error. */
static const yytype_int8 yytable[] =
{
- 3, 15, 16, 10, 3, 15, 16, 43, 53, 2,
- 64, 65, 3, 60, 64, 84, 23, 26, 32, 7,
- 5, 14, 27, 39, 66, 46, 47, 67, 66, 68,
- 11, 67, 19, 68, 55, 44, 44, 28, 29, 35,
- 69, 44, 30, 36, 69, 37, 3, 15, 16, 4,
- 17, 49, 38, 40, 51, 52, 56, 18, 58, 80,
- 61, 79, 81, 82, 83, 85, 86, 59, 89, 87,
- 88, 91, 94, 20, 78, 90, 22, 0, 0, 92,
- 0, 93, 0, 0, 0, 41, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 54
+ 3, 15, 16, 2, 43, 53, 3, 3, 15, 16,
+ 64, 65, 10, 60, 5, 26, 39, 64, 88, 7,
+ 27, 46, 47, 83, 66, 67, 19, 55, 68, 32,
+ 69, 66, 67, 44, 44, 68, 84, 69, 14, 23,
+ 11, 70, 44, 28, 4, 3, 15, 16, 70, 17,
+ 29, 35, 30, 36, 37, 38, 18, 40, 49, 61,
+ 51, 52, 56, 58, 97, 81, 82, 85, 86, 89,
+ 87, 91, 90, 94, 96, 93, 99, 80, 92, 20,
+ 95, 98, 22, 0, 0, 0, 59, 0, 0, 0,
+ 41, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 54
};

static const yytype_int8 yycheck[] =
{
- 3, 4, 5, 14, 3, 4, 5, 14, 14, 0,
- 13, 14, 3, 14, 13, 14, 29, 7, 44, 17,
- 1, 17, 12, 31, 27, 9, 10, 30, 27, 32,
- 41, 30, 13, 32, 42, 42, 42, 17, 17, 17,
- 43, 42, 29, 29, 43, 15, 3, 4, 5, 40,
- 7, 6, 8, 29, 17, 17, 17, 14, 17, 17,
- 29, 29, 29, 29, 17, 15, 17, 50, 17, 29,
- 34, 17, 17, 13, 63, 29, 13, -1, -1, 31,
- -1, 29, -1, -1, -1, 32, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, 41
+ 3, 4, 5, 0, 14, 14, 3, 3, 4, 5,
+ 13, 14, 14, 14, 1, 7, 31, 13, 14, 17,
+ 12, 9, 10, 17, 27, 28, 13, 42, 31, 45,
+ 33, 27, 28, 43, 43, 31, 30, 33, 17, 30,
+ 42, 44, 43, 17, 41, 3, 4, 5, 44, 7,
+ 17, 17, 30, 30, 15, 8, 14, 30, 6, 30,
+ 17, 17, 17, 17, 32, 30, 17, 30, 30, 15,
+ 17, 30, 17, 17, 17, 35, 17, 63, 30, 13,
+ 30, 30, 13, -1, -1, -1, 50, -1, -1, -1,
+ 32, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, 41
};

/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
symbol of state STATE-NUM. */
static const yytype_int8 yystos[] =
{
- 0, 46, 0, 3, 40, 49, 62, 17, 63, 50,
- 14, 41, 67, 47, 17, 4, 5, 7, 14, 49,
- 51, 57, 58, 29, 65, 70, 7, 12, 17, 17,
- 29, 69, 44, 66, 64, 17, 29, 15, 8, 64,
- 29, 65, 68, 14, 42, 71, 9, 10, 55, 6,
- 54, 17, 17, 14, 66, 64, 17, 53, 17, 55,
- 14, 29, 48, 52, 13, 14, 27, 30, 32, 43,
- 49, 51, 56, 58, 59, 60, 61, 72, 48, 29,
- 17, 29, 29, 17, 14, 15, 17, 29, 34, 17,
- 29, 17, 31, 29, 17
+ 0, 47, 0, 3, 41, 50, 64, 17, 65, 51,
+ 14, 42, 69, 48, 17, 4, 5, 7, 14, 50,
+ 52, 58, 59, 30, 67, 72, 7, 12, 17, 17,
+ 30, 71, 45, 68, 66, 17, 30, 15, 8, 66,
+ 30, 67, 70, 14, 43, 73, 9, 10, 56, 6,
+ 55, 17, 17, 14, 68, 66, 17, 54, 17, 56,
+ 14, 30, 49, 53, 13, 14, 27, 28, 31, 33,
+ 44, 50, 52, 57, 59, 60, 61, 62, 63, 74,
+ 49, 30, 17, 17, 30, 30, 30, 17, 14, 15,
+ 17, 30, 30, 35, 17, 30, 17, 32, 30, 17
};

/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
static const yytype_int8 yyr1[] =
{
- 0, 45, 46, 46, 46, 47, 47, 47, 47, 47,
- 48, 48, 48, 48, 48, 48, 48, 48, 48, 50,
- 49, 52, 51, 53, 51, 54, 54, 55, 55, 56,
- 57, 58, 59, 59, 60, 61, 61, 61, 62, 63,
- 63, 64, 64, 65, 66, 66, 68, 67, 69, 67,
- 70, 67, 71, 72
+ 0, 46, 47, 47, 47, 48, 48, 48, 48, 48,
+ 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
+ 51, 50, 53, 52, 54, 52, 55, 55, 56, 56,
+ 57, 58, 59, 60, 60, 61, 62, 62, 62, 63,
+ 63, 63, 64, 65, 65, 66, 66, 67, 68, 68,
+ 70, 69, 71, 69, 72, 69, 73, 74
};

/* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */
static const yytype_int8 yyr2[] =
{
0, 2, 0, 2, 2, 2, 2, 2, 2, 0,
- 2, 2, 2, 2, 2, 2, 2, 2, 0, 0,
- 5, 0, 8, 0, 7, 0, 2, 1, 1, 4,
- 4, 4, 3, 4, 4, 5, 4, 3, 3, 2,
- 0, 2, 0, 2, 3, 0, 0, 7, 0, 6,
- 0, 5, 3, 3
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 0,
+ 0, 5, 0, 8, 0, 7, 0, 2, 1, 1,
+ 4, 4, 4, 3, 4, 4, 5, 4, 3, 3,
+ 2, 2, 3, 2, 0, 2, 0, 2, 3, 0,
+ 0, 7, 0, 6, 0, 5, 3, 3
};


@@ -1219,7 +1225,7 @@
{ cur_parent = root_parent; }
break;

- case 19: /* @1: %empty */
+ case 20: /* @1: %empty */
{
(yyval.chip_instance) = new_chip_instance((yyvsp[0].string));
chip_enqueue_tail(cur_chip_instance);
@@ -1227,105 +1233,117 @@
}
break;

- case 20: /* chip: CHIP STRING @1 chipchildren END */
+ case 21: /* chip: CHIP STRING @1 chipchildren END */
{
cur_chip_instance = chip_dequeue_tail();
}
break;

- case 21: /* @2: %empty */
+ case 22: /* @2: %empty */
{
(yyval.dev) = new_device_raw(cur_parent, cur_chip_instance, (yyvsp[-3].number), (yyvsp[-2].string), (yyvsp[-1].string), (yyvsp[0].number));
cur_parent = (yyval.dev)->last_bus;
}
break;

- case 22: /* device: DEVICE BUS NUMBER alias status @2 devicechildren END */
+ case 23: /* device: DEVICE BUS NUMBER alias status @2 devicechildren END */
{
cur_parent = (yyvsp[-2].dev)->parent;
}
break;

- case 23: /* @3: %empty */
+ case 24: /* @3: %empty */
{
(yyval.dev) = new_device_reference(cur_parent, cur_chip_instance, (yyvsp[-1].string), (yyvsp[0].number));
cur_parent = (yyval.dev)->last_bus;
}
break;

- case 24: /* device: DEVICE REFERENCE STRING status @3 devicechildren END */
+ case 25: /* device: DEVICE REFERENCE STRING status @3 devicechildren END */
{
cur_parent = (yyvsp[-2].dev)->parent;
}
break;

- case 25: /* alias: %empty */
+ case 26: /* alias: %empty */
{
(yyval.string) = NULL;
}
break;

- case 26: /* alias: ALIAS STRING */
+ case 27: /* alias: ALIAS STRING */
{
(yyval.string) = (yyvsp[0].string);
}
break;

- case 29: /* resource: RESOURCE NUMBER EQUALS NUMBER */
+ case 30: /* resource: RESOURCE NUMBER EQUALS NUMBER */
{ add_resource(cur_parent, (yyvsp[-3].number), strtol((yyvsp[-2].string), NULL, 0), strtol((yyvsp[0].string), NULL, 0)); }
break;

- case 30: /* reference: REFERENCE STRING ASSOCIATION STRING */
+ case 31: /* reference: REFERENCE STRING ASSOCIATION STRING */
{ add_reference(cur_chip_instance, (yyvsp[0].string), (yyvsp[-2].string)); }
break;

- case 31: /* registers: REGISTER STRING EQUALS STRING */
+ case 32: /* registers: REGISTER STRING EQUALS STRING */
{ add_register(cur_chip_instance, (yyvsp[-2].string), (yyvsp[0].string)); }
break;

- case 32: /* subsystemid: SUBSYSTEMID NUMBER NUMBER */
+ case 33: /* subsystemid: SUBSYSTEMID NUMBER NUMBER */
{ add_pci_subsystem_ids(cur_parent, strtol((yyvsp[-1].string), NULL, 16), strtol((yyvsp[0].string), NULL, 16), 0); }
break;

- case 33: /* subsystemid: SUBSYSTEMID NUMBER NUMBER INHERIT */
+ case 34: /* subsystemid: SUBSYSTEMID NUMBER NUMBER INHERIT */
{ add_pci_subsystem_ids(cur_parent, strtol((yyvsp[-2].string), NULL, 16), strtol((yyvsp[-1].string), NULL, 16), 1); }
break;

- case 34: /* ioapic_irq: IOAPIC_IRQ NUMBER PCIINT NUMBER */
+ case 35: /* ioapic_irq: IOAPIC_IRQ NUMBER PCIINT NUMBER */
{ add_ioapic_info(cur_parent, strtol((yyvsp[-2].string), NULL, 16), (yyvsp[-1].string), strtol((yyvsp[0].string), NULL, 16)); }
break;

- case 35: /* smbios_slot_desc: SLOT_DESC STRING STRING STRING STRING */
+ case 36: /* smbios_slot_desc: SLOT_DESC STRING STRING STRING STRING */
{ add_slot_desc(cur_parent, (yyvsp[-3].string), (yyvsp[-2].string), (yyvsp[-1].string), (yyvsp[0].string)); }
break;

- case 36: /* smbios_slot_desc: SLOT_DESC STRING STRING STRING */
+ case 37: /* smbios_slot_desc: SLOT_DESC STRING STRING STRING */
{ add_slot_desc(cur_parent, (yyvsp[-2].string), (yyvsp[-1].string), (yyvsp[0].string), NULL); }
break;

- case 37: /* smbios_slot_desc: SLOT_DESC STRING STRING */
+ case 38: /* smbios_slot_desc: SLOT_DESC STRING STRING */
{ add_slot_desc(cur_parent, (yyvsp[-1].string), (yyvsp[0].string), NULL, NULL); }
break;

- case 38: /* fw_config_table: FW_CONFIG_TABLE fw_config_table_children END */
+ case 39: /* smbios_dev_info: SMBIOS_DEV_INFO STRING NUMBER */
+ { add_smbios_dev_info(cur_parent, (yyvsp[-1].string), strtol((yyvsp[0].string), NULL, 0)); }
+ break;
+
+ case 40: /* smbios_dev_info: SMBIOS_DEV_INFO STRING */
+ { add_smbios_dev_info(cur_parent, (yyvsp[0].string), -1); }
+ break;
+
+ case 41: /* smbios_dev_info: SMBIOS_DEV_INFO NUMBER */
+ { add_smbios_dev_info(cur_parent, NULL, strtol((yyvsp[0].string), NULL, 0)); }
+ break;
+
+ case 42: /* fw_config_table: FW_CONFIG_TABLE fw_config_table_children END */
{ }
break;

- case 43: /* fw_config_field_bits: NUMBER NUMBER */
+ case 47: /* fw_config_field_bits: NUMBER NUMBER */
{
append_fw_config_bits(&cur_bits, strtoul((yyvsp[-1].string), NULL, 0), strtoul((yyvsp[0].string), NULL, 0));
}
break;

- case 46: /* $@4: %empty */
+ case 50: /* $@4: %empty */
{ cur_field = new_fw_config_field((yyvsp[-2].string), cur_bits); }
break;

- case 47: /* fw_config_field: FW_CONFIG_FIELD STRING fw_config_field_bits fw_config_field_bits_repeating $@4 fw_config_field_children END */
+ case 51: /* fw_config_field: FW_CONFIG_FIELD STRING fw_config_field_bits fw_config_field_bits_repeating $@4 fw_config_field_children END */
{ cur_bits = NULL; }
break;

- case 48: /* $@5: %empty */
+ case 52: /* $@5: %empty */
{
cur_bits = NULL;
append_fw_config_bits(&cur_bits, strtoul((yyvsp[0].string), NULL, 0), strtoul((yyvsp[0].string), NULL, 0));
@@ -1333,25 +1351,25 @@
}
break;

- case 49: /* fw_config_field: FW_CONFIG_FIELD STRING NUMBER $@5 fw_config_field_children END */
+ case 53: /* fw_config_field: FW_CONFIG_FIELD STRING NUMBER $@5 fw_config_field_children END */
{ cur_bits = NULL; }
break;

- case 50: /* $@6: %empty */
+ case 54: /* $@6: %empty */
{
cur_field = get_fw_config_field((yyvsp[0].string));
}
break;

- case 51: /* fw_config_field: FW_CONFIG_FIELD STRING $@6 fw_config_field_children END */
+ case 55: /* fw_config_field: FW_CONFIG_FIELD STRING $@6 fw_config_field_children END */
{ cur_bits = NULL; }
break;

- case 52: /* fw_config_option: FW_CONFIG_OPTION STRING NUMBER */
+ case 56: /* fw_config_option: FW_CONFIG_OPTION STRING NUMBER */
{ add_fw_config_option(cur_field, (yyvsp[-1].string), strtoull((yyvsp[0].string), NULL, 0)); }
break;

- case 53: /* fw_config_probe: FW_CONFIG_PROBE STRING STRING */
+ case 57: /* fw_config_probe: FW_CONFIG_PROBE STRING STRING */
{ add_fw_config_probe(cur_parent, (yyvsp[-1].string), (yyvsp[0].string)); }
break;

diff --git a/util/sconfig/sconfig.tab.h_shipped b/util/sconfig/sconfig.tab.h_shipped
index 2179499..5520e23 100644
--- a/util/sconfig/sconfig.tab.h_shipped
+++ b/util/sconfig/sconfig.tab.h_shipped
@@ -1,4 +1,4 @@
-/* A Bison parser, made by GNU Bison 3.7.5. */
+/* A Bison parser, made by GNU Bison 3.7.6. */

/* Bison interface for Yacc-like parsers in C

@@ -16,7 +16,7 @@
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>. */
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */

/* As a special exception, you may create a larger work that contains
part or all of the Bison parser skeleton and distribute that work
@@ -35,8 +35,8 @@
especially those whose name start with YY_ or yy_. They are
private implementation details that can be changed or removed. */

-#ifndef YY_YY_WORK_GIT_COREBOOT_UTIL_SCONFIG_SCONFIG_TAB_H_SHIPPED_INCLUDED
-# define YY_YY_WORK_GIT_COREBOOT_UTIL_SCONFIG_SCONFIG_TAB_H_SHIPPED_INCLUDED
+#ifndef YY_YY_HOME_USUARIO_COREBOOT_UTIL_SCONFIG_SCONFIG_TAB_H_SHIPPED_INCLUDED
+# define YY_YY_HOME_USUARIO_COREBOOT_UTIL_SCONFIG_SCONFIG_TAB_H_SHIPPED_INCLUDED
/* Debug traces. */
#ifndef YYDEBUG
# define YYDEBUG 0
@@ -79,23 +79,24 @@
IRQ = 280, /* IRQ */
DRQ = 281, /* DRQ */
SLOT_DESC = 282, /* SLOT_DESC */
- IO = 283, /* IO */
- NUMBER = 284, /* NUMBER */
- SUBSYSTEMID = 285, /* SUBSYSTEMID */
- INHERIT = 286, /* INHERIT */
- IOAPIC_IRQ = 287, /* IOAPIC_IRQ */
- IOAPIC = 288, /* IOAPIC */
- PCIINT = 289, /* PCIINT */
- GENERIC = 290, /* GENERIC */
- SPI = 291, /* SPI */
- USB = 292, /* USB */
- MMIO = 293, /* MMIO */
- GPIO = 294, /* GPIO */
- FW_CONFIG_TABLE = 295, /* FW_CONFIG_TABLE */
- FW_CONFIG_FIELD = 296, /* FW_CONFIG_FIELD */
- FW_CONFIG_OPTION = 297, /* FW_CONFIG_OPTION */
- FW_CONFIG_PROBE = 298, /* FW_CONFIG_PROBE */
- PIPE = 299 /* PIPE */
+ SMBIOS_DEV_INFO = 283, /* SMBIOS_DEV_INFO */
+ IO = 284, /* IO */
+ NUMBER = 285, /* NUMBER */
+ SUBSYSTEMID = 286, /* SUBSYSTEMID */
+ INHERIT = 287, /* INHERIT */
+ IOAPIC_IRQ = 288, /* IOAPIC_IRQ */
+ IOAPIC = 289, /* IOAPIC */
+ PCIINT = 290, /* PCIINT */
+ GENERIC = 291, /* GENERIC */
+ SPI = 292, /* SPI */
+ USB = 293, /* USB */
+ MMIO = 294, /* MMIO */
+ GPIO = 295, /* GPIO */
+ FW_CONFIG_TABLE = 296, /* FW_CONFIG_TABLE */
+ FW_CONFIG_FIELD = 297, /* FW_CONFIG_FIELD */
+ FW_CONFIG_OPTION = 298, /* FW_CONFIG_OPTION */
+ FW_CONFIG_PROBE = 299, /* FW_CONFIG_PROBE */
+ PIPE = 300 /* PIPE */
};
typedef enum yytokentype yytoken_kind_t;
#endif
@@ -122,4 +123,4 @@

int yyparse (void);

-#endif /* !YY_YY_WORK_GIT_COREBOOT_UTIL_SCONFIG_SCONFIG_TAB_H_SHIPPED_INCLUDED */
+#endif /* !YY_YY_HOME_USUARIO_COREBOOT_UTIL_SCONFIG_SCONFIG_TAB_H_SHIPPED_INCLUDED */
diff --git a/util/sconfig/sconfig.y b/util/sconfig/sconfig.y
index 40c1295..71a3115 100755
--- a/util/sconfig/sconfig.y
+++ b/util/sconfig/sconfig.y
@@ -21,13 +21,13 @@
uint64_t number;
}

-%token CHIP DEVICE REGISTER ALIAS REFERENCE ASSOCIATION BOOL STATUS MANDATORY BUS RESOURCE END EQUALS HEX STRING PCI PNP I2C APIC CPU_CLUSTER CPU DOMAIN IRQ DRQ SLOT_DESC IO NUMBER SUBSYSTEMID INHERIT IOAPIC_IRQ IOAPIC PCIINT GENERIC SPI USB MMIO GPIO FW_CONFIG_TABLE FW_CONFIG_FIELD FW_CONFIG_OPTION FW_CONFIG_PROBE PIPE
+%token CHIP DEVICE REGISTER ALIAS REFERENCE ASSOCIATION BOOL STATUS MANDATORY BUS RESOURCE END EQUALS HEX STRING PCI PNP I2C APIC CPU_CLUSTER CPU DOMAIN IRQ DRQ SLOT_DESC SMBIOS_DEV_INFO IO NUMBER SUBSYSTEMID INHERIT IOAPIC_IRQ IOAPIC PCIINT GENERIC SPI USB MMIO GPIO FW_CONFIG_TABLE FW_CONFIG_FIELD FW_CONFIG_OPTION FW_CONFIG_PROBE PIPE
%%
devtree: { cur_parent = root_parent; } | devtree chip | devtree fw_config_table;

chipchildren: chipchildren device | chipchildren chip | chipchildren registers | chipchildren reference | /* empty */ ;

-devicechildren: devicechildren device | devicechildren chip | devicechildren resource | devicechildren subsystemid | devicechildren ioapic_irq | devicechildren smbios_slot_desc | devicechildren registers | devicechildren fw_config_probe | /* empty */ ;
+devicechildren: devicechildren device | devicechildren chip | devicechildren resource | devicechildren subsystemid | devicechildren ioapic_irq | devicechildren smbios_slot_desc | devicechildren smbios_dev_info | devicechildren registers | devicechildren fw_config_probe | /* empty */ ;

chip: CHIP STRING /* == path */ {
$<chip_instance>$ = new_chip_instance($<string>2);
@@ -89,6 +89,15 @@
smbios_slot_desc: SLOT_DESC STRING STRING
{ add_slot_desc(cur_parent, $<string>2, $<string>3, NULL, NULL); };

+smbios_dev_info: SMBIOS_DEV_INFO STRING NUMBER
+ { add_smbios_dev_info(cur_parent, $<string>2, strtol($<string>3, NULL, 0)); };
+
+smbios_dev_info: SMBIOS_DEV_INFO STRING
+ { add_smbios_dev_info(cur_parent, $<string>2, -1); };
+
+smbios_dev_info: SMBIOS_DEV_INFO NUMBER
+ { add_smbios_dev_info(cur_parent, NULL, strtol($<string>2, NULL, 0)); };
+
/* fw_config: firmware configuration table */
fw_config_table: FW_CONFIG_TABLE fw_config_table_children END { };


To view, visit change 57370. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: Iecca9ada6ee1000674cb5dd7afd5c309d8e1a64b
Gerrit-Change-Number: 57370
Gerrit-PatchSet: 1
Gerrit-Owner: Angel Pons <th3fanbus@gmail.com>
Gerrit-Reviewer: Martin Roth <martinroth@google.com>
Gerrit-Reviewer: Patrick Georgi <pgeorgi@google.com>
Gerrit-Attention: Martin Roth <martinroth@google.com>
Gerrit-MessageType: newchange