diff options
author | Furquan Shaikh <furquan@google.com> | 2018-06-03 04:22:17 -0700 |
---|---|---|
committer | Furquan Shaikh <furquan@google.com> | 2018-06-08 23:36:02 +0000 |
commit | 931982600d3ac3dfb9d66e013604ecc0573a1744 (patch) | |
tree | f4ceeaa3bf1e4a0c24e89587ce86d54ff8ea808a /util/sconfig/sconfig.tab.c_shipped | |
parent | 7398deda2b12f2ba3ab6c14009ff8da003ef2b0c (diff) | |
download | coreboot-931982600d3ac3dfb9d66e013604ecc0573a1744.tar.xz |
util/sconfig: Re-factor device structure in parse tree
This change re-factors the device structure in parse tree to be able
to support multidev devices just like non-multidev devices.
With this change, every device has a bus under it which is the parent
of all devices that fall on the bus. If there are duplicate entries in
the devicetree, then there will be multiple buses under the device and
each bus will have its own set of children.
The tree starts out with a root device which has a root bus under
it. This is a special device which is created statically and its
parent is its own root bus. When parsing the device tree file, devices
get added under the root bus as children.
Since this change re-organizes the way devicetree is represented, it
gets rid of latestchild and next_sibling pointers from struct
device. Also, the tree traversal to generate static.c is changed to
breadth-first walk instead of using the next_sibling.
BUG=b:80081934
TEST=Verified using abuild that all boards compile successfully.
Change-Id: Ic8c8a73a247e8e992ab6b1b2cc3131e06fa2e5a1
Signed-off-by: Furquan Shaikh <furquan@google.com>
Reviewed-on: https://review.coreboot.org/26800
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Diffstat (limited to 'util/sconfig/sconfig.tab.c_shipped')
-rw-r--r-- | util/sconfig/sconfig.tab.c_shipped | 24 |
1 files changed, 8 insertions, 16 deletions
diff --git a/util/sconfig/sconfig.tab.c_shipped b/util/sconfig/sconfig.tab.c_shipped index 3f0e0af02a..c298a652a9 100644 --- a/util/sconfig/sconfig.tab.c_shipped +++ b/util/sconfig/sconfig.tab.c_shipped @@ -85,7 +85,7 @@ int yylex(); void yyerror(const char *s); -static struct device *cur_parent; +static struct bus *cur_parent; static struct chip_instance *cur_chip_instance; @@ -164,7 +164,7 @@ union YYSTYPE { - struct device *device; + struct device *dev; struct chip_instance *chip_instance; char *string; int number; @@ -487,8 +487,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, 61, 64, - 67, 70, 73 + 40, 40, 40, 40, 42, 42, 51, 51, 59, 62, + 65, 68, 71 }; #endif @@ -1287,13 +1287,7 @@ yyreduce: { case 2: - { cur_parent = head; } - - break; - - case 3: - - { postprocess_devtree(); } + { cur_parent = root_parent; } break; @@ -1318,8 +1312,8 @@ yyreduce: case 16: { - (yyval.device) = new_device(cur_parent, cur_chip_instance, (yyvsp[-2].number), (yyvsp[-1].string), (yyvsp[0].number)); - cur_parent = (yyval.device); + (yyval.dev) = new_device(cur_parent, cur_chip_instance, (yyvsp[-2].number), (yyvsp[-1].string), (yyvsp[0].number)); + cur_parent = (yyval.dev)->last_bus; } break; @@ -1327,9 +1321,7 @@ yyreduce: case 17: { - cur_parent = (yyvsp[-2].device)->parent; - fold_in((yyvsp[-2].device)); - alias_siblings((yyvsp[-2].device)->children); + cur_parent = (yyvsp[-2].dev)->parent; } break; |