sconfig: Add SMBIOS type 9 entries

Add the new field 'smbios_slot_desc', which takes 2 to 4 arguments.
The field is valid for PCI devices and only compiled if SMBIOS table
generation is enabled.

smbios_slot_desc arguments:
1. slot type
2. slot lenth
3. slot designation (optional)
4. slot data width (optional)

Example:

    device pci 1c.1 on
        smbios_slot_desc "21" "3" "MINI-PCI-FULL" "8"
    end # PCIe Port #2 Integrated Wireless LAN

Tested on Lenovo T520.

Change-Id: If95aae3c322d3da47637613b9a872ba1f7af9080
Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/32307
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Philipp Deppenwiese <zaolin.daisuki@gmail.com>
This commit is contained in:
Patrick Rudolph
2019-04-12 14:42:17 +02:00
committed by Patrick Georgi
parent 1a93058448
commit ac24d3c311
8 changed files with 344 additions and 242 deletions

View File

@@ -1,8 +1,8 @@
/* A Bison parser, made by GNU Bison 3.0.4. */
/* A Bison parser, made by GNU Bison 3.0.5. */
/* Bison implementation for Yacc-like parsers in C
Copyright (C) 1984, 1989-1990, 2000-2015 Free Software Foundation, Inc.
Copyright (C) 1984, 1989-1990, 2000-2015, 2018 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -44,7 +44,7 @@
#define YYBISON 1
/* Bison version. */
#define YYBISON_VERSION "3.0.4"
#define YYBISON_VERSION "3.0.5"
/* Skeleton name. */
#define YYSKELETON_NAME "yacc.c"
@@ -144,17 +144,18 @@ extern int yydebug;
DOMAIN = 275,
IRQ = 276,
DRQ = 277,
IO = 278,
NUMBER = 279,
SUBSYSTEMID = 280,
INHERIT = 281,
IOAPIC_IRQ = 282,
IOAPIC = 283,
PCIINT = 284,
GENERIC = 285,
SPI = 286,
USB = 287,
MMIO = 288
SLOT_DESC = 278,
IO = 279,
NUMBER = 280,
SUBSYSTEMID = 281,
INHERIT = 282,
IOAPIC_IRQ = 283,
IOAPIC = 284,
PCIINT = 285,
GENERIC = 286,
SPI = 287,
USB = 288,
MMIO = 289
};
#endif
@@ -429,21 +430,21 @@ union yyalloc
/* YYFINAL -- State number of the termination state. */
#define YYFINAL 3
/* YYLAST -- Last index in YYTABLE. */
#define YYLAST 40
#define YYLAST 43
/* YYNTOKENS -- Number of terminals. */
#define YYNTOKENS 34
#define YYNTOKENS 35
/* YYNNTS -- Number of nonterminals. */
#define YYNNTS 14
#define YYNNTS 15
/* YYNRULES -- Number of rules. */
#define YYNRULES 24
#define YYNRULES 28
/* YYNSTATES -- Number of states. */
#define YYNSTATES 43
#define YYNSTATES 49
/* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned
by yylex, with out-of-bounds checking. */
#define YYUNDEFTOK 2
#define YYMAXUTOK 288
#define YYMAXUTOK 289
#define YYTRANSLATE(YYX) \
((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
@@ -480,7 +481,7 @@ static const yytype_uint8 yytranslate[] =
2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
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
25, 26, 27, 28, 29, 30, 31, 32, 33, 34
};
#if YYDEBUG
@@ -488,8 +489,8 @@ static const yytype_uint8 yytranslate[] =
static const yytype_uint8 yyrline[] =
{
0, 36, 36, 36, 38, 38, 38, 38, 40, 40,
40, 40, 40, 40, 42, 42, 51, 51, 59, 59,
61, 64, 67, 70, 73
40, 40, 40, 40, 40, 42, 42, 51, 51, 59,
59, 61, 64, 67, 70, 73, 76, 79, 82
};
#endif
@@ -500,11 +501,12 @@ static const char *const yytname[] =
{
"$end", "error", "$undefined", "CHIP", "DEVICE", "REGISTER", "BOOL",
"HIDDEN", "BUS", "RESOURCE", "END", "EQUALS", "HEX", "STRING", "PCI",
"PNP", "I2C", "APIC", "CPU_CLUSTER", "CPU", "DOMAIN", "IRQ", "DRQ", "IO",
"NUMBER", "SUBSYSTEMID", "INHERIT", "IOAPIC_IRQ", "IOAPIC", "PCIINT",
"GENERIC", "SPI", "USB", "MMIO", "$accept", "devtree", "$@1",
"chipchildren", "devicechildren", "chip", "@2", "device", "@3", "status",
"resource", "registers", "subsystemid", "ioapic_irq", YY_NULLPTR
"PNP", "I2C", "APIC", "CPU_CLUSTER", "CPU", "DOMAIN", "IRQ", "DRQ",
"SLOT_DESC", "IO", "NUMBER", "SUBSYSTEMID", "INHERIT", "IOAPIC_IRQ",
"IOAPIC", "PCIINT", "GENERIC", "SPI", "USB", "MMIO", "$accept",
"devtree", "$@1", "chipchildren", "devicechildren", "chip", "@2",
"device", "@3", "status", "resource", "registers", "subsystemid",
"ioapic_irq", "smbios_slot_desc", YY_NULLPTR
};
#endif
@@ -516,14 +518,14 @@ static const yytype_uint16 yytoknum[] =
0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
285, 286, 287, 288
285, 286, 287, 288, 289
};
# endif
#define YYPACT_NINF -10
#define YYPACT_NINF -12
#define yypact_value_is_default(Yystate) \
(!!((Yystate) == (-10)))
(!!((Yystate) == (-12)))
#define YYTABLE_NINF -1
@@ -534,11 +536,11 @@ static const yytype_uint16 yytoknum[] =
STATE-NUM. */
static const yytype_int8 yypact[] =
{
-10, 11, 9, -10, 1, -10, -10, -10, 0, 5,
3, -10, -10, -10, -10, -9, 6, 2, 7, -10,
-10, -10, -10, -10, -3, -5, -10, -1, 4, -10,
-10, -10, -10, -10, 10, 8, -4, 12, 13, 14,
-10, -10, -10
-12, 11, 9, -12, 1, -12, -12, -12, 0, 5,
3, -12, -12, -12, -12, -10, 6, 2, 8, -12,
-12, -12, -12, -12, -3, -1, -12, 13, 4, 7,
-12, -12, -12, -12, -12, -12, 16, 15, 10, -11,
12, 17, -5, 14, -12, 18, -12, -12, -12
};
/* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
@@ -546,25 +548,25 @@ static const yytype_int8 yypact[] =
means the default is an error. */
static const yytype_uint8 yydefact[] =
{
2, 0, 0, 1, 0, 3, 14, 7, 0, 0,
0, 15, 5, 4, 6, 0, 0, 0, 0, 18,
19, 16, 21, 13, 0, 0, 17, 0, 0, 9,
8, 10, 11, 12, 0, 0, 0, 0, 22, 0,
20, 23, 24
2, 0, 0, 1, 0, 3, 15, 7, 0, 0,
0, 16, 5, 4, 6, 0, 0, 0, 0, 19,
20, 17, 22, 14, 0, 0, 18, 0, 0, 0,
9, 8, 10, 11, 12, 13, 0, 0, 0, 0,
0, 28, 23, 0, 21, 27, 24, 25, 26
};
/* YYPGOTO[NTERM-NUM]. */
static const yytype_int8 yypgoto[] =
{
-10, -10, -10, -10, -10, -6, -10, 16, -10, -10,
-10, -10, -10, -10
-12, -12, -12, -12, -12, -6, -12, 19, -12, -12,
-12, -12, -12, -12, -12
};
/* YYDEFGOTO[NTERM-NUM]. */
static const yytype_int8 yydefgoto[] =
{
-1, 1, 2, 8, 24, 5, 7, 13, 23, 21,
31, 14, 32, 33
32, 14, 33, 34, 35
};
/* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If
@@ -573,46 +575,46 @@ static const yytype_int8 yydefgoto[] =
static const yytype_uint8 yytable[] =
{
4, 9, 12, 4, 9, 10, 25, 26, 19, 20,
11, 3, 4, 15, 6, 17, 16, 18, 29, 34,
22, 37, 27, 35, 28, 39, 0, 0, 36, 0,
0, 0, 38, 0, 0, 0, 40, 0, 42, 41,
30
11, 3, 4, 15, 6, 17, 16, 18, 30, 43,
27, 22, 46, 28, 36, 29, 37, 40, 41, 38,
45, 48, 39, 0, 0, 42, 0, 44, 0, 47,
0, 0, 0, 31
};
static const yytype_int8 yycheck[] =
{
3, 4, 8, 3, 4, 5, 9, 10, 6, 7,
10, 0, 3, 8, 13, 24, 13, 11, 24, 24,
13, 11, 25, 24, 27, 29, -1, -1, 24, -1,
-1, -1, 24, -1, -1, -1, 24, -1, 24, 26,
24
10, 0, 3, 8, 13, 25, 13, 11, 24, 30,
23, 13, 27, 26, 25, 28, 13, 11, 13, 25,
13, 13, 25, -1, -1, 25, -1, 25, -1, 25,
-1, -1, -1, 24
};
/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
symbol of state STATE-NUM. */
static const yytype_uint8 yystos[] =
{
0, 35, 36, 0, 3, 39, 13, 40, 37, 4,
5, 10, 39, 41, 45, 8, 13, 24, 11, 6,
7, 43, 13, 42, 38, 9, 10, 25, 27, 39,
41, 44, 46, 47, 24, 24, 24, 11, 24, 29,
24, 26, 24
0, 36, 37, 0, 3, 40, 13, 41, 38, 4,
5, 10, 40, 42, 46, 8, 13, 25, 11, 6,
7, 44, 13, 43, 39, 9, 10, 23, 26, 28,
40, 42, 45, 47, 48, 49, 25, 13, 25, 25,
11, 13, 25, 30, 25, 13, 27, 25, 13
};
/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
static const yytype_uint8 yyr1[] =
{
0, 34, 36, 35, 37, 37, 37, 37, 38, 38,
38, 38, 38, 38, 40, 39, 42, 41, 43, 43,
44, 45, 46, 46, 47
0, 35, 37, 36, 38, 38, 38, 38, 39, 39,
39, 39, 39, 39, 39, 41, 40, 43, 42, 44,
44, 45, 46, 47, 47, 48, 49, 49, 49
};
/* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */
static const yytype_uint8 yyr2[] =
{
0, 2, 0, 2, 2, 2, 2, 0, 2, 2,
2, 2, 2, 0, 0, 5, 0, 7, 1, 1,
4, 4, 3, 4, 4
2, 2, 2, 2, 0, 0, 5, 0, 7, 1,
1, 4, 4, 3, 4, 4, 5, 4, 3
};
@@ -973,6 +975,7 @@ yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
case N: \
yyformat = S; \
break
default: /* Avoid compiler warnings. */
YYCASE_(0, YY_("syntax error"));
YYCASE_(1, YY_("syntax error, unexpected %s"));
YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
@@ -1294,7 +1297,7 @@ yyreduce:
break;
case 14:
case 15:
{
(yyval.chip_instance) = new_chip_instance((yyvsp[0].string));
@@ -1304,7 +1307,7 @@ yyreduce:
break;
case 15:
case 16:
{
cur_chip_instance = chip_dequeue_tail();
@@ -1312,7 +1315,7 @@ yyreduce:
break;
case 16:
case 17:
{
(yyval.dev) = new_device(cur_parent, cur_chip_instance, (yyvsp[-2].number), (yyvsp[-1].string), (yyvsp[0].number));
@@ -1321,7 +1324,7 @@ yyreduce:
break;
case 17:
case 18:
{
cur_parent = (yyvsp[-2].dev)->parent;
@@ -1329,36 +1332,54 @@ yyreduce:
break;
case 20:
case 21:
{ add_resource(cur_parent, (yyvsp[-3].number), strtol((yyvsp[-2].string), NULL, 0), strtol((yyvsp[0].string), NULL, 0)); }
break;
case 21:
case 22:
{ add_register(cur_chip_instance, (yyvsp[-2].string), (yyvsp[0].string)); }
break;
case 22:
case 23:
{ add_pci_subsystem_ids(cur_parent, strtol((yyvsp[-1].string), NULL, 16), strtol((yyvsp[0].string), NULL, 16), 0); }
break;
case 23:
case 24:
{ add_pci_subsystem_ids(cur_parent, strtol((yyvsp[-2].string), NULL, 16), strtol((yyvsp[-1].string), NULL, 16), 1); }
break;
case 24:
case 25:
{ add_ioapic_info(cur_parent, strtol((yyvsp[-2].string), NULL, 16), (yyvsp[-1].string), strtol((yyvsp[0].string), NULL, 16)); }
break;
case 26:
{ add_slot_desc(cur_parent, (yyvsp[-3].string), (yyvsp[-2].string), (yyvsp[-1].string), (yyvsp[0].string)); }
break;
case 27:
{ add_slot_desc(cur_parent, (yyvsp[-2].string), (yyvsp[-1].string), (yyvsp[0].string), NULL); }
break;
case 28:
{ add_slot_desc(cur_parent, (yyvsp[-1].string), (yyvsp[0].string), NULL, NULL); }
break;
default: break;