util/sconfig: Get rid of struct header

Now that chips and devices are treated differently in sconfig, this
change gets rid of struct header and add_header function which were
responsible for maintaining list of headers that need to be added to
static.c.

Instead, struct chip is re-factored into struct chip and
struct chip_instance, where chip is a list of unique chips required by
the mainboard whereas chip_instance is an instance of the chip. One
chip can have multiple instances dependending upon the devices in the
system. Also, struct device is updated to hold a pointer to chip
instance instead of the chip structure. This unique list of chips is
then used to add appropriate headers to static.c

BUG=b:80081934
TEST=Verified using abuild that all boards compile successfully.

Change-Id: I6fccdf7c361b4f55a831195adcda9b21932755aa
Signed-off-by: Furquan Shaikh <furquan@google.com>
Reviewed-on: https://review.coreboot.org/26739
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
Furquan Shaikh
2018-05-31 10:33:16 -07:00
parent 369e1f074f
commit c56ae2ffa1
5 changed files with 133 additions and 114 deletions

View File

@@ -86,7 +86,7 @@ int yylex();
void yyerror(const char *s);
static struct device *cur_parent;
static struct chip *cur_chip;
static struct chip_instance *cur_chip_instance;
@@ -165,7 +165,7 @@ union YYSTYPE
struct device *device;
struct chip *chip;
struct chip_instance *chip_instance;
char *string;
int number;
@@ -1300,9 +1300,9 @@ yyreduce:
case 14:
{
(yyval.chip) = new_chip((yyvsp[0].string));
chip_enqueue_tail(cur_chip);
cur_chip = (yyval.chip);
(yyval.chip_instance) = new_chip_instance((yyvsp[0].string));
chip_enqueue_tail(cur_chip_instance);
cur_chip_instance = (yyval.chip_instance);
}
break;
@@ -1310,7 +1310,7 @@ yyreduce:
case 15:
{
cur_chip = chip_dequeue_tail();
cur_chip_instance = chip_dequeue_tail();
}
break;
@@ -1318,7 +1318,7 @@ yyreduce:
case 16:
{
(yyval.device) = new_device(cur_parent, cur_chip, (yyvsp[-2].number), (yyvsp[-1].string), (yyvsp[0].number));
(yyval.device) = new_device(cur_parent, cur_chip_instance, (yyvsp[-2].number), (yyvsp[-1].string), (yyvsp[0].number));
cur_parent = (yyval.device);
}
@@ -1342,7 +1342,7 @@ yyreduce:
case 19:
{ add_register(cur_chip, (yyvsp[-2].string), (yyvsp[0].string)); }
{ add_register(cur_chip_instance, (yyvsp[-2].string), (yyvsp[0].string)); }
break;