Patrick Georgi (patrick@georgi-clan.de) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/3189
-gerrit
commit a02998e9c2528fdaa55a33b75d4360eede1f260f Author: Patrick Georgi patrick@georgi-clan.de Date: Fri May 3 20:31:56 2013 +0200
sconfig: Refuse devicetree with leaf "chip"s
It doesn't make sense to have a chip without any containing device in the device tree, and it creates lots of funny issues when trying to make use of such a tree (ask Ron).
Since the right thing is to refuse such devicetrees, this change makes them a syntax error.
Change-Id: Ia35b518bd4acd631e78bdf63c4424c0fa6a81229 Signed-off-by: Patrick Georgi patrick@georgi-clan.de --- util/sconfig/sconfig.tab.c_shipped | 86 +++++++++++++++++++------------------- util/sconfig/sconfig.y | 2 +- 2 files changed, 45 insertions(+), 43 deletions(-)
diff --git a/util/sconfig/sconfig.tab.c_shipped b/util/sconfig/sconfig.tab.c_shipped index 3a56ac8..cd5d628 100644 --- a/util/sconfig/sconfig.tab.c_shipped +++ b/util/sconfig/sconfig.tab.c_shipped @@ -387,7 +387,7 @@ union yyalloc /* YYFINAL -- State number of the termination state. */ #define YYFINAL 3 /* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 37 +#define YYLAST 41
/* YYNTOKENS -- Number of terminals. */ #define YYNTOKENS 28 @@ -396,7 +396,7 @@ union yyalloc /* YYNRULES -- Number of rules. */ #define YYNRULES 22 /* YYNRULES -- Number of states. */ -#define YYNSTATES 41 +#define YYNSTATES 42
/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ #define YYUNDEFTOK 2 @@ -444,22 +444,22 @@ static const yytype_uint8 yytranslate[] = YYRHS. */ static const yytype_uint8 yyprhs[] = { - 0, 0, 3, 4, 7, 10, 13, 16, 17, 20, - 23, 26, 29, 32, 33, 34, 40, 41, 49, 54, - 59, 63, 68 + 0, 0, 3, 4, 7, 10, 12, 15, 18, 21, + 24, 27, 30, 33, 34, 35, 41, 42, 50, 55, + 60, 64, 69 };
/* YYRHS -- A `-1'-separated list of the rules' RHS. */ static const yytype_int8 yyrhs[] = { 29, 0, -1, -1, 30, 33, -1, 31, 35, -1, - 31, 33, -1, 31, 38, -1, -1, 32, 35, -1, - 32, 33, -1, 32, 37, -1, 32, 39, -1, 32, - 40, -1, -1, -1, 3, 12, 34, 31, 9, -1, - -1, 4, 7, 22, 6, 36, 32, 9, -1, 8, - 22, 10, 22, -1, 5, 12, 10, 12, -1, 23, - 22, 22, -1, 23, 22, 22, 24, -1, 25, 22, - 27, 22, -1 + 35, -1, 31, 33, -1, 31, 38, -1, 32, 35, + -1, 32, 33, -1, 32, 37, -1, 32, 39, -1, + 32, 40, -1, -1, -1, 3, 12, 34, 31, 9, + -1, -1, 4, 7, 22, 6, 36, 32, 9, -1, + 8, 22, 10, 22, -1, 5, 12, 10, 12, -1, + 23, 22, 22, -1, 23, 22, 22, 24, -1, 25, + 22, 27, 22, -1 };
/* YYRLINE[YYN] -- source line where rule number YYN was defined. */ @@ -507,7 +507,7 @@ static const yytype_uint8 yyr1[] = /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ static const yytype_uint8 yyr2[] = { - 0, 2, 0, 2, 2, 2, 2, 0, 2, 2, + 0, 2, 0, 2, 2, 1, 2, 2, 2, 2, 2, 2, 2, 0, 0, 5, 0, 7, 4, 4, 3, 4, 4 }; @@ -517,37 +517,37 @@ static const yytype_uint8 yyr2[] = 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, 16, - 19, 13, 0, 0, 17, 0, 0, 9, 8, 10, - 11, 12, 0, 0, 0, 0, 20, 0, 18, 21, - 22 + 2, 0, 0, 1, 0, 3, 14, 0, 0, 0, + 5, 0, 0, 15, 6, 4, 7, 0, 0, 16, + 0, 13, 19, 0, 0, 17, 0, 0, 9, 8, + 10, 11, 12, 0, 0, 0, 0, 20, 0, 18, + 21, 22 };
/* YYDEFGOTO[NTERM-NUM]. */ static const yytype_int8 yydefgoto[] = { - -1, 1, 2, 8, 22, 5, 7, 13, 21, 29, - 14, 30, 31 + -1, 1, 2, 9, 23, 5, 7, 10, 21, 30, + 16, 31, 32 };
/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing STATE-NUM. */ -#define YYPACT_NINF -9 +#define YYPACT_NINF -8 static const yytype_int8 yypact[] = { - -9, 3, 1, -9, -2, -9, -9, -9, 4, 5, - -1, -9, -9, -9, -9, -8, 7, 9, 6, -9, - -9, -9, -3, 2, -9, 8, 10, -9, -9, -9, - -9, -9, 11, 12, -4, 13, -5, 14, -9, -9, - -9 + -8, 10, 1, -8, -1, -8, -8, 8, 7, 4, + -8, -4, 3, -8, -8, -8, -8, 13, 11, -8, + 12, -8, -8, -3, 5, -8, 6, 9, -8, -8, + -8, -8, -8, 15, 14, 2, 16, 17, 18, -8, + -8, -8 };
/* YYPGOTO[NTERM-NUM]. */ static const yytype_int8 yypgoto[] = { - -9, -9, -9, -9, -9, -6, -9, 15, -9, -9, - -9, -9, -9 + -8, -8, -8, -8, -8, -7, -8, -6, -8, -8, + -8, -8, -8 };
/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If @@ -556,35 +556,37 @@ static const yytype_int8 yypgoto[] = #define YYTABLE_NINF -1 static const yytype_uint8 yytable[] = { - 4, 9, 12, 3, 4, 23, 24, 4, 9, 10, - 6, 16, 15, 11, 17, 19, 27, 18, 20, 39, - 25, 35, 26, 37, 32, 0, 0, 0, 0, 0, - 33, 0, 34, 0, 36, 38, 40, 28 + 4, 8, 14, 15, 4, 24, 25, 4, 8, 12, + 3, 6, 8, 13, 11, 18, 28, 29, 17, 19, + 26, 20, 27, 0, 22, 36, 0, 33, 34, 38, + 0, 35, 0, 0, 0, 0, 37, 0, 39, 0, + 41, 40 };
#define yypact_value_is_default(yystate) \ - ((yystate) == (-9)) + ((yystate) == (-8))
#define yytable_value_is_error(yytable_value) \ YYID (0)
static const yytype_int8 yycheck[] = { - 3, 4, 8, 0, 3, 8, 9, 3, 4, 5, - 12, 12, 7, 9, 22, 6, 22, 10, 12, 24, - 23, 10, 25, 27, 22, -1, -1, -1, -1, -1, - 22, -1, 22, -1, 22, 22, 22, 22 + 3, 4, 9, 9, 3, 8, 9, 3, 4, 5, + 0, 12, 4, 9, 7, 12, 23, 23, 22, 6, + 23, 10, 25, -1, 12, 10, -1, 22, 22, 27, + -1, 22, -1, -1, -1, -1, 22, -1, 22, -1, + 22, 24 };
/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing symbol of state STATE-NUM. */ static const yytype_uint8 yystos[] = { - 0, 29, 30, 0, 3, 33, 12, 34, 31, 4, - 5, 9, 33, 35, 38, 7, 12, 22, 10, 6, - 12, 36, 32, 8, 9, 23, 25, 33, 35, 37, - 39, 40, 22, 22, 22, 10, 22, 27, 22, 24, - 22 + 0, 29, 30, 0, 3, 33, 12, 34, 4, 31, + 35, 7, 5, 9, 33, 35, 38, 22, 12, 6, + 10, 36, 12, 32, 8, 9, 23, 25, 33, 35, + 37, 39, 40, 22, 22, 22, 10, 22, 27, 22, + 24, 22 };
#define yyerrok (yyerrstatus = 0) diff --git a/util/sconfig/sconfig.y b/util/sconfig/sconfig.y index 8ea702e..70286d1 100755 --- a/util/sconfig/sconfig.y +++ b/util/sconfig/sconfig.y @@ -34,7 +34,7 @@ static struct device *cur_parent, *cur_bus; %% devtree: { cur_parent = cur_bus = head; } chip { postprocess_devtree(); } ;
-chipchildren: chipchildren device | chipchildren chip | chipchildren registers | /* empty */ ; +chipchildren: chipchildren device | device | chipchildren chip | chipchildren registers ;
devicechildren: devicechildren device | devicechildren chip | devicechildren resource | devicechildren subsystemid | devicechildren ioapic_irq | /* empty */ ;