Fixed romparser bug, resolved SDOCM00087159
[keystone-rtos/ibl.git] / src / util / romparse / rparse.y
1 /* Parse the parameter spec */
2 %{
3 #define YYERROR_VERBOSE
4 extern char *yytext;
5 %}
6 %token LBRACE RBRACE SECTION EQU VALUE STRING BOOT_MODE PARAM_INDEX OPTIONS 
7 %token MULTI_I2C_ID MY_I2C_ID CORE_FREQ_MHZ I2C_CLK_FREQ_KHZ 
8 %token EXE_FILE PCI_PARMS NEXT_DEV_ADDR NEXT_DEV_ADDR_EXT ADDRESS_DELAY SWPLL
9 %token DEV_ADDR_EXT DEV_ADDR LAYOUT ALIGN PAD LENGTH PAD_FILE_ID
10 %token SWPLL_PREDIV SWPLL_MULT SWPLL_POSTDIV SWPLL_FLAGS
11 %token ADDR_WIDTH N_PINS MODE C2T_DELAY BUS_FREQ_MHZ BUS_FREQ_KHZ CSEL
12 %%
14 promspec   : segment
15                    | promspec segment
16                    ;
18 segment    : bootParams
19                    | layout
20                    | pad
21                    ;
23 bootParams : SECTION LBRACE assigns RBRACE
24                          { section (); }
25                    | PCI_PARMS EQU STRING
26                      { setPciParams (yytext); }
27                    ;
29 layout     : LAYOUT LBRACE assigns RBRACE
30                          { setLayout ();  }
31                    ;
33 pad                : PAD LBRACE assigns RBRACE
34                      { setPad ();  }
35                    ;
38 assigns    : assign
39                    | assigns assign
40                    ;
42 assign     : keyword EQU VALUE
43                          { assignKeyVal ($1, $3); }
44                    | keyword EQU STRING
45                      { assignKeyStr ($1, yytext); }
46                    ;
48 keyword    : BOOT_MODE               {  $$=$1;  }
49                    | PARAM_INDEX                 {  $$=$1;  }
50                    | OPTIONS                     {  $$=$1;  }
51                    | MULTI_I2C_ID            {  $$=$1;  }
52                    | MY_I2C_ID                   {  $$=$1;  }
53                    | CORE_FREQ_MHZ               {  $$=$1;  }
54                    | I2C_CLK_FREQ_KHZ    {  $$=$1;  }
55                    | EXE_FILE                    {  $$=$1;  }
56                    | NEXT_DEV_ADDR       {  $$=$1;  }
57                    | NEXT_DEV_ADDR_EXT   {  $$=$1;  }
58                    | DEV_ADDR_EXT        {  $$=$1;  }
59                    | ADDRESS_DELAY       {  $$=$1;  }
60                    | SWPLL                               {  $$=$1;  }
61                    | DEV_ADDR                    {  $$=$1;  }
62                    | ALIGN                               {  $$=$1;  }
63                    | LENGTH              {  $$=$1;  }
64                    | PAD_FILE_ID         {  $$=$1;  }
65                    | SWPLL_PREDIV                {  $$=$1;  }
66                    | SWPLL_MULT                  {  $$=$1;  }
67                    | SWPLL_POSTDIV               {  $$=$1;  }
68                    | SWPLL_FLAGS                 {  $$=$1;  }
69                    | ADDR_WIDTH          {  $$=$1;  }
70                    | N_PINS                              {  $$=$1;  }
71                    | MODE                {  $$=$1;  }
72                    | C2T_DELAY           {  $$=$1;  }
73                    | BUS_FREQ_MHZ        {  $$=$1;  }
74                    | BUS_FREQ_KHZ        {  $$=$1;  }
75                    | CSEL                                {  $$=$1;  }
76                    ;
78 %%