[coreboot-gerrit] Patch set updated for coreboot: sconfig: Add a new generic device type

Duncan Laurie (dlaurie@google.com) gerrit at coreboot.org
Thu May 12 23:29:06 CEST 2016


Duncan Laurie (dlaurie at google.com) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/14789

-gerrit

commit 2d263545c9d81309a21ec2062ceaacdfe3db136b
Author: Duncan Laurie <dlaurie at chromium.org>
Date:   Sat May 7 20:01:34 2016 -0700

    sconfig: Add a new generic device type
    
    Add support for a basic generic device in the devicetree to bind to a
    device that does not have a specific bus, but may need to be described
    in tables for the operating system.  For instance some chips may have
    various GPIO connections that need described but do not fall under any
    other device.
    
    In order to support this export the basic 'scan_static_bus()' that can
    be used in a device_operations->scan_bus() method to scan for the generic
    devices.
    
    It has been possible to get a semi-generic device by using a fake PNP
    device, but that isn't really appropriate for many devices.
    
    Also Re-generate the shipped files for sconfig.  Use flex 2.6.0 to avoid
    everything being rewritten.  Clean up the local paths that leak into the
    generated configs.
    
    Change-Id: If45a5b18825bdb2cf1e4ba4297ee426cbd1678e3
    Signed-off-by: Duncan Laurie <dlaurie at chromium.org>
---
 src/device/device_util.c           |  12 ++
 src/device/root_device.c           |   2 +-
 src/include/device/device.h        |   1 +
 src/include/device/path.h          |  11 +-
 util/sconfig/lex.yy.c_shipped      | 230 ++++++++++++++++++++-----------------
 util/sconfig/main.c                |   4 +
 util/sconfig/sconfig.l             |   1 +
 util/sconfig/sconfig.tab.c_shipped |  32 +++---
 util/sconfig/sconfig.tab.h_shipped |   3 +-
 util/sconfig/sconfig.y             |   2 +-
 10 files changed, 173 insertions(+), 125 deletions(-)

diff --git a/src/device/device_util.c b/src/device/device_util.c
index b538212..56afefd 100644
--- a/src/device/device_util.c
+++ b/src/device/device_util.c
@@ -222,6 +222,9 @@ u32 dev_path_encode(device_t dev)
 	case DEVICE_PATH_IOAPIC:
 		ret |= dev->path.ioapic.ioapic_id;
 		break;
+	case DEVICE_PATH_GENERIC:
+		ret |= dev->path.generic.subid << 8 | dev->path.generic.id;
+		break;
 	case DEVICE_PATH_NONE:
 	default:
 		break;
@@ -286,6 +289,11 @@ const char *dev_path(device_t dev)
 			snprintf(buffer, sizeof (buffer),
 				 "CPU_BUS: %02x", dev->path.cpu_bus.id);
 			break;
+		case DEVICE_PATH_GENERIC:
+			snprintf(buffer, sizeof (buffer),
+				 "GENERIC: %d.%d", dev->path.generic.id,
+				 dev->path.generic.subid);
+			break;
 		default:
 			printk(BIOS_ERR, "Unknown device path type: %d\n",
 			       dev->path.type);
@@ -353,6 +361,10 @@ int path_eq(struct device_path *path1, struct device_path *path2)
 	case DEVICE_PATH_CPU_BUS:
 		equal = (path1->cpu_bus.id == path2->cpu_bus.id);
 		break;
+	case DEVICE_PATH_GENERIC:
+		equal = (path1->generic.id == path2->generic.id) &&
+			(path1->generic.subid == path2->generic.subid);
+		break;
 	default:
 		printk(BIOS_ERR, "Unknown device type: %d\n", path1->type);
 		break;
diff --git a/src/device/root_device.c b/src/device/root_device.c
index 6b96100..7ff10ae 100644
--- a/src/device/root_device.c
+++ b/src/device/root_device.c
@@ -43,7 +43,7 @@ const char mainboard_name[] = CONFIG_MAINBOARD_VENDOR " " CONFIG_MAINBOARD_PART_
  * @param bus Pointer to the device to which the static buses are attached to.
  */
 
-static void scan_static_bus(device_t bus)
+void scan_static_bus(device_t bus)
 {
 	device_t child;
 	struct bus *link;
diff --git a/src/include/device/device.h b/src/include/device/device.h
index 62460ae..d9af64a 100644
--- a/src/include/device/device.h
+++ b/src/include/device/device.h
@@ -232,6 +232,7 @@ void fixed_mem_resource(device_t dev, unsigned long index,
 		  unsigned long basek, unsigned long sizek, unsigned long type);
 
 void scan_smbus(device_t bus);
+void scan_static_bus(device_t bus);
 void scan_lpc_bus(device_t bus);
 
 /* It is the caller's responsibility to adjust regions such that ram_resource()
diff --git a/src/include/device/path.h b/src/include/device/path.h
index 8421a38..9d7fb38 100644
--- a/src/include/device/path.h
+++ b/src/include/device/path.h
@@ -13,6 +13,7 @@ enum device_path_type {
 	DEVICE_PATH_CPU,
 	DEVICE_PATH_CPU_BUS,
 	DEVICE_PATH_IOAPIC,
+	DEVICE_PATH_GENERIC,
 
 	/*
 	 * When adding path types to this table, please also update the
@@ -31,7 +32,8 @@ enum device_path_type {
 		"DEVICE_PATH_CPU_CLUSTER",	\
 		"DEVICE_PATH_CPU",		\
 		"DEVICE_PATH_CPU_BUS",		\
-		"DEVICE_PATH_IOAPIC"		\
+		"DEVICE_PATH_IOAPIC",		\
+		"DEVICE_PATH_GENERIC"		\
 }
 
 struct domain_path
@@ -85,6 +87,12 @@ struct cpu_bus_path
 	unsigned id;
 };
 
+struct generic_path
+{
+	unsigned id;
+	unsigned subid;
+};
+
 
 struct device_path {
 	enum device_path_type type;
@@ -98,6 +106,7 @@ struct device_path {
 		struct cpu_cluster_path cpu_cluster;
 		struct cpu_path		cpu;
 		struct cpu_bus_path	cpu_bus;
+		struct generic_path	generic;
 	};
 };
 
diff --git a/util/sconfig/lex.yy.c_shipped b/util/sconfig/lex.yy.c_shipped
index a4dd5cb..2600296 100644
--- a/util/sconfig/lex.yy.c_shipped
+++ b/util/sconfig/lex.yy.c_shipped
@@ -373,8 +373,8 @@ static void yy_fatal_error (yyconst char msg[]  );
 	*yy_cp = '\0'; \
 	(yy_c_buf_p) = yy_cp;
 
-#define YY_NUM_RULES 31
-#define YY_END_OF_BUFFER 32
+#define YY_NUM_RULES 33
+#define YY_END_OF_BUFFER 34
 /* This struct is not used in this scanner,
    but its presence is necessary. */
 struct yy_trans_info
@@ -382,21 +382,22 @@ struct yy_trans_info
 	flex_int32_t yy_verify;
 	flex_int32_t yy_nxt;
 	};
-static yyconst flex_int16_t yy_accept[116] =
+static yyconst flex_int16_t yy_accept[130] =
     {   0,
-        0,    0,   32,   30,    1,    3,   30,   30,   30,   26,
-       26,   24,   27,   30,   27,   27,   27,   30,   30,   30,
-       30,   30,   30,   30,    1,    3,   30,    0,   30,    0,
-        2,   26,   27,   30,   30,   30,   30,   27,   30,   30,
-       30,   30,   30,   19,   30,   30,   30,    7,   30,   30,
-       30,   30,   29,   29,   25,   30,   30,   15,   30,   30,
-       18,   23,   12,   30,   30,   17,   30,    8,    9,   11,
-       30,   30,   28,    4,   30,   30,   30,   30,   30,   30,
-       30,   30,   30,   30,   30,   30,   30,   13,   30,   30,
-       30,    5,   16,   30,   10,   30,   30,   30,   21,   30,
-
-       30,   30,   30,   30,    6,   30,   30,   30,   30,   30,
-       20,   30,   14,   22,    0
+        0,    0,   34,   32,    1,    3,   32,   32,   32,   27,
+       27,   25,   28,   32,   28,   28,   28,   32,   32,   32,
+       32,   32,   32,   32,   32,    1,    3,   32,    0,   32,
+       32,    0,    2,   27,   28,   32,   32,   32,   32,   28,
+       32,   32,   32,   32,   32,   32,   20,   32,   32,   32,
+        7,   32,   32,   32,   32,   31,   31,   32,    0,   26,
+       32,   32,   15,   32,   32,   19,   24,   32,   12,   32,
+       32,   18,   32,    8,    9,   11,   32,   32,   32,    0,
+       29,    4,   32,   32,   32,   32,   32,   32,   32,   32,
+       32,   30,   30,   32,   32,   32,   32,   32,   32,   13,
+
+       32,   32,   32,    5,   16,   32,   32,   10,   32,   32,
+       32,   17,   22,   32,   32,   32,   32,   32,    6,   32,
+       32,   32,   32,   32,   21,   32,   14,   23,    0
     } ;
 
 static yyconst YY_CHAR yy_ec[256] =
@@ -439,94 +440,102 @@ static yyconst YY_CHAR yy_meta[39] =
         1,    1,    1,    1,    1,    1,    1,    1
     } ;
 
-static yyconst flex_uint16_t yy_base[121] =
+static yyconst flex_uint16_t yy_base[137] =
     {   0,
-        0,    0,  181,    0,  178,  182,  176,   37,   41,   38,
-      141,    0,   44,  163,   54,   78,   60,   45,  159,   42,
-       47,  154,  139,    0,  171,  182,   77,  167,   69,  168,
-      182,    0,   82,  104,  155,  144,  133,   93,  140,  135,
-      145,  145,  139,  145,  130,  130,  137,    0,  133,  127,
-      133,  137,    0,  182,    0,  143,  123,  136,  126,  133,
-        0,    0,    0,  128,  118,    0,  122,    0,    0,    0,
-      121,  112,    0,    0,  125,  124,  117,  109,  115,  120,
-      105,   90,  101,   99,   91,   93,   98,    0,   80,   76,
-       73,    0,    0,   72,   89,   83,   69,   65,    0,   72,
-
-       64,   74,   60,   61,    0,   65,   62,   50,   51,   33,
-        0,   28,    0,    0,  182,   40,  129,  131,  133,  135
+        0,    0,  200,    0,  197,  201,  195,   37,   41,   38,
+      160,    0,   44,  182,   54,   78,   60,  174,   45,  177,
+       42,   47,  172,  157,    0,  189,  201,   77,  185,   87,
+       69,  186,  201,    0,   86,  104,  173,  162,  151,   93,
+      158,  153,  163,  154,  162,  156,  162,  147,  147,  154,
+        0,  150,  144,  150,  154,    0,  201,  101,  166,    0,
+      159,  139,  152,  142,  149,    0,    0,  144,    0,  143,
+      133,    0,  137,    0,    0,    0,  136,  127,  154,  153,
+        0,    0,  138,  137,  130,  122,  121,  127,  132,  117,
+      111,    0,  201,  122,  126,  118,  120,  119,  124,    0,
+
+      108,   95,   92,    0,    0,  101,   85,  102,   96,   80,
+       76,    0,    0,   83,   73,   77,   63,   64,    0,   64,
+       62,   50,   51,   33,    0,   28,    0,    0,  201,   40,
+      129,  131,  133,  135,  137,  139
     } ;
 
-static yyconst flex_int16_t yy_def[121] =
+static yyconst flex_int16_t yy_def[137] =
     {   0,
-      115,    1,  115,  116,  115,  115,  116,  117,  118,  116,
-       10,  116,   10,  116,   10,   10,   10,  116,  116,  116,
-      116,  116,  116,  116,  115,  115,  117,  119,  118,  120,
-      115,   10,   10,   10,  116,  116,  116,   10,  116,  116,
-      116,  116,  116,  116,  116,  116,  116,  116,  116,  116,
-      116,  116,  116,  115,   34,  116,  116,  116,  116,  116,
-      116,  116,  116,  116,  116,  116,  116,  116,  116,  116,
-      116,  116,  116,  116,  116,  116,  116,  116,  116,  116,
-      116,  116,  116,  116,  116,  116,  116,  116,  116,  116,
-      116,  116,  116,  116,  116,  116,  116,  116,  116,  116,
-
-      116,  116,  116,  116,  116,  116,  116,  116,  116,  116,
-      116,  116,  116,  116,    0,  115,  115,  115,  115,  115
+      129,    1,  129,  130,  129,  129,  130,  131,  132,  130,
+       10,  130,   10,  130,   10,   10,   10,  130,  130,  130,
+      130,  130,  130,  130,  130,  129,  129,  131,  133,  134,
+      132,  135,  129,   10,   10,   10,  130,  130,  130,   10,
+      130,  130,  130,  130,  130,  130,  130,  130,  130,  130,
+      130,  130,  130,  130,  130,  130,  129,  134,  136,   36,
+      130,  130,  130,  130,  130,  130,  130,  130,  130,  130,
+      130,  130,  130,  130,  130,  130,  130,  130,  130,  129,
+      130,  130,  130,  130,  130,  130,  130,  130,  130,  130,
+      130,  130,  129,  130,  130,  130,  130,  130,  130,  130,
+
+      130,  130,  130,  130,  130,  130,  130,  130,  130,  130,
+      130,  130,  130,  130,  130,  130,  130,  130,  130,  130,
+      130,  130,  130,  130,  130,  130,  130,  130,    0,  129,
+      129,  129,  129,  129,  129,  129
     } ;
 
-static yyconst flex_uint16_t yy_nxt[221] =
+static yyconst flex_uint16_t yy_nxt[240] =
     {   0,
         4,    5,    6,    7,    8,    9,   10,   11,   10,   12,
        13,   13,   14,    4,    4,    4,   13,   13,   15,   16,
-       17,   13,    4,    4,   18,   19,    4,    4,   20,   21,
-        4,   22,   23,    4,    4,    4,    4,    4,   28,   28,
-       24,   24,   30,   31,   32,   32,   32,  114,   33,   33,
-       33,   33,   33,   42,   33,   33,   33,   33,   33,   33,
-       33,   33,   33,   47,  113,   49,   33,   33,   33,   48,
-       30,   31,   43,   44,   50,  112,   45,   36,   28,   28,
-      111,   53,  110,   37,   33,   33,   33,   41,   33,   33,
-       33,  109,  108,  107,  106,  105,  104,  103,   38,   33,
-
-       33,   33,  102,  101,  100,   99,   39,   98,   97,   40,
-       55,   55,   55,   96,   55,   55,   95,   94,   93,   92,
-       55,   55,   55,   55,   55,   55,   91,   90,   59,   27,
-       27,   29,   29,   28,   28,   30,   30,   89,   88,   87,
-       86,   85,   84,   83,   82,   81,   80,   79,   78,   77,
-       76,   75,   74,   73,   72,   71,   70,   69,   68,   67,
-       66,   65,   64,   63,   62,   61,   60,   58,   57,   56,
-       31,   54,   25,   52,   51,   46,   35,   34,   26,   25,
-      115,    3,  115,  115,  115,  115,  115,  115,  115,  115,
-      115,  115,  115,  115,  115,  115,  115,  115,  115,  115,
-
-      115,  115,  115,  115,  115,  115,  115,  115,  115,  115,
-      115,  115,  115,  115,  115,  115,  115,  115,  115,  115
+       17,   13,   18,    4,   19,   20,    4,    4,   21,   22,
+        4,   23,   24,    4,    4,    4,    4,    4,   29,   29,
+       25,   30,   32,   33,   34,   34,   34,  128,   35,   35,
+       35,   35,   35,   45,   35,   35,   35,   35,   35,   35,
+       35,   35,   35,   50,  127,   52,   35,   35,   35,   51,
+       32,   33,   46,   47,   53,  126,   48,   38,   29,   29,
+      125,   56,  124,   39,   35,   35,   35,   43,   59,   59,
+      123,   25,   35,   35,   35,  122,  121,  120,   40,   35,
+
+       35,   35,   59,   59,  119,   79,   41,  118,  117,   42,
+       60,   60,   60,  116,   60,   60,  115,  114,  113,  112,
+       60,   60,   60,   60,   60,   60,  111,  110,   64,   28,
+       28,   31,   31,   29,   29,   58,   58,   32,   32,   59,
+       59,  109,  108,  107,  106,  105,  104,  103,  102,  101,
+      100,   99,   98,   97,   96,   95,   94,   93,   92,   91,
+       90,   89,   88,   87,   86,   85,   84,   83,   82,   81,
+       80,   78,   77,   76,   75,   74,   73,   72,   71,   70,
+       69,   68,   67,   66,   65,   63,   62,   61,   33,   57,
+       26,   55,   54,   49,   44,   37,   36,   27,   26,  129,
+
+        3,  129,  129,  129,  129,  129,  129,  129,  129,  129,
+      129,  129,  129,  129,  129,  129,  129,  129,  129,  129,
+      129,  129,  129,  129,  129,  129,  129,  129,  129,  129,
+      129,  129,  129,  129,  129,  129,  129,  129,  129
     } ;
 
-static yyconst flex_int16_t yy_chk[221] =
+static yyconst flex_int16_t yy_chk[240] =
     {   0,
         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
         1,    1,    1,    1,    1,    1,    1,    1,    8,    8,
-      116,    8,    9,    9,   10,   10,   10,  112,   10,   10,
-       13,   13,   13,   18,   10,   10,   10,   10,   10,   10,
-       15,   15,   15,   20,  110,   21,   17,   17,   17,   20,
-       29,   29,   18,   18,   21,  109,   18,   15,   27,   27,
-      108,   27,  107,   15,   16,   16,   16,   17,   33,   33,
-       33,  106,  104,  103,  102,  101,  100,   98,   16,   38,
-
-       38,   38,   97,   96,   95,   94,   16,   91,   90,   16,
-       34,   34,   34,   89,   34,   34,   87,   86,   85,   84,
-       34,   34,   34,   34,   34,   34,   83,   82,   38,  117,
-      117,  118,  118,  119,  119,  120,  120,   81,   80,   79,
-       78,   77,   76,   75,   72,   71,   67,   65,   64,   60,
-       59,   58,   57,   56,   52,   51,   50,   49,   47,   46,
-       45,   44,   43,   42,   41,   40,   39,   37,   36,   35,
-       30,   28,   25,   23,   22,   19,   14,   11,    7,    5,
-        3,  115,  115,  115,  115,  115,  115,  115,  115,  115,
-      115,  115,  115,  115,  115,  115,  115,  115,  115,  115,
-
-      115,  115,  115,  115,  115,  115,  115,  115,  115,  115,
-      115,  115,  115,  115,  115,  115,  115,  115,  115,  115
+      130,    8,    9,    9,   10,   10,   10,  126,   10,   10,
+       13,   13,   13,   19,   10,   10,   10,   10,   10,   10,
+       15,   15,   15,   21,  124,   22,   17,   17,   17,   21,
+       31,   31,   19,   19,   22,  123,   19,   15,   28,   28,
+      122,   28,  121,   15,   16,   16,   16,   17,   30,   30,
+      120,   30,   35,   35,   35,  118,  117,  116,   16,   40,
+
+       40,   40,   58,   58,  115,   58,   16,  114,  111,   16,
+       36,   36,   36,  110,   36,   36,  109,  108,  107,  106,
+       36,   36,   36,   36,   36,   36,  103,  102,   40,  131,
+      131,  132,  132,  133,  133,  134,  134,  135,  135,  136,
+      136,  101,   99,   98,   97,   96,   95,   94,   91,   90,
+       89,   88,   87,   86,   85,   84,   83,   80,   79,   78,
+       77,   73,   71,   70,   68,   65,   64,   63,   62,   61,
+       59,   55,   54,   53,   52,   50,   49,   48,   47,   46,
+       45,   44,   43,   42,   41,   39,   38,   37,   32,   29,
+       26,   24,   23,   20,   18,   14,   11,    7,    5,    3,
+
+      129,  129,  129,  129,  129,  129,  129,  129,  129,  129,
+      129,  129,  129,  129,  129,  129,  129,  129,  129,  129,
+      129,  129,  129,  129,  129,  129,  129,  129,  129,  129,
+      129,  129,  129,  129,  129,  129,  129,  129,  129
     } ;
 
 static yy_state_type yy_last_accepting_state;
@@ -805,13 +814,13 @@ yy_match:
 			while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
 				{
 				yy_current_state = (int) yy_def[yy_current_state];
-				if ( yy_current_state >= 116 )
+				if ( yy_current_state >= 130 )
 					yy_c = yy_meta[(unsigned int) yy_c];
 				}
 			yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
 			++yy_cp;
 			}
-		while ( yy_base[yy_current_state] != 182 );
+		while ( yy_base[yy_current_state] != 201 );
 
 yy_find_action:
 		yy_act = yy_accept[yy_current_state];
@@ -903,39 +912,39 @@ YY_RULE_SETUP
 	YY_BREAK
 case 17:
 YY_RULE_SETUP
-{yylval.number=IRQ; return(RESOURCE);}
+{yylval.number=GENERIC; return(BUS);}
 	YY_BREAK
 case 18:
 YY_RULE_SETUP
-{yylval.number=DRQ; return(RESOURCE);}
+{yylval.number=IRQ; return(RESOURCE);}
 	YY_BREAK
 case 19:
 YY_RULE_SETUP
-{yylval.number=IO; return(RESOURCE);}
+{yylval.number=DRQ; return(RESOURCE);}
 	YY_BREAK
 case 20:
 YY_RULE_SETUP
-{return(IOAPIC_IRQ);}
+{yylval.number=IO; return(RESOURCE);}
 	YY_BREAK
 case 21:
 YY_RULE_SETUP
-{return(INHERIT);}
+{return(IOAPIC_IRQ);}
 	YY_BREAK
 case 22:
 YY_RULE_SETUP
-{return(SUBSYSTEMID);}
+{return(INHERIT);}
 	YY_BREAK
 case 23:
 YY_RULE_SETUP
-{return(END);}
+{return(SUBSYSTEMID);}
 	YY_BREAK
 case 24:
 YY_RULE_SETUP
-{return(EQUALS);}
+{return(END);}
 	YY_BREAK
 case 25:
 YY_RULE_SETUP
-{yylval.string = malloc(yyleng+1); strncpy(yylval.string, yytext, yyleng); yylval.string[yyleng]='\0'; return(NUMBER);}
+{return(EQUALS);}
 	YY_BREAK
 case 26:
 YY_RULE_SETUP
@@ -947,18 +956,27 @@ YY_RULE_SETUP
 	YY_BREAK
 case 28:
 YY_RULE_SETUP
-{yylval.string = malloc(yyleng+1); strncpy(yylval.string, yytext, yyleng); yylval.string[yyleng]='\0'; return(PCIINT);}
+{yylval.string = malloc(yyleng+1); strncpy(yylval.string, yytext, yyleng); yylval.string[yyleng]='\0'; return(NUMBER);}
 	YY_BREAK
 case 29:
-/* rule 29 can match eol */
 YY_RULE_SETUP
-{yylval.string = malloc(yyleng-1); strncpy(yylval.string, yytext+1, yyleng-2); yylval.string[yyleng-2]='\0'; return(STRING);}
+{yylval.string = malloc(yyleng+1); strncpy(yylval.string, yytext, yyleng); yylval.string[yyleng]='\0'; return(PCIINT);}
 	YY_BREAK
 case 30:
+/* rule 30 can match eol */
 YY_RULE_SETUP
-{yylval.string = malloc(yyleng+1); strncpy(yylval.string, yytext, yyleng); yylval.string[yyleng]='\0'; return(STRING);}
+{yylval.string = malloc(yyleng-1); strncpy(yylval.string, yytext+1, yyleng-2); yylval.string[yyleng-2]='\0'; return(STRING);}
 	YY_BREAK
 case 31:
+/* rule 31 can match eol */
+YY_RULE_SETUP
+{yylval.string = malloc(yyleng-1); strncpy(yylval.string, yytext+1, yyleng-2); yylval.string[yyleng-2]='\0'; return(STRING);}
+	YY_BREAK
+case 32:
+YY_RULE_SETUP
+{yylval.string = malloc(yyleng+1); strncpy(yylval.string, yytext, yyleng); yylval.string[yyleng]='\0'; return(STRING);}
+	YY_BREAK
+case 33:
 YY_RULE_SETUP
 ECHO;
 	YY_BREAK
@@ -1254,7 +1272,7 @@ static int yy_get_next_buffer (void)
 		while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
 			{
 			yy_current_state = (int) yy_def[yy_current_state];
-			if ( yy_current_state >= 116 )
+			if ( yy_current_state >= 130 )
 				yy_c = yy_meta[(unsigned int) yy_c];
 			}
 		yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
@@ -1282,11 +1300,11 @@ static int yy_get_next_buffer (void)
 	while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
 		{
 		yy_current_state = (int) yy_def[yy_current_state];
-		if ( yy_current_state >= 116 )
+		if ( yy_current_state >= 130 )
 			yy_c = yy_meta[(unsigned int) yy_c];
 		}
 	yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
-	yy_is_jam = (yy_current_state == 115);
+	yy_is_jam = (yy_current_state == 129);
 
 		return yy_is_jam ? 0 : yy_current_state;
 }
diff --git a/util/sconfig/main.c b/util/sconfig/main.c
index fea90f4..a398c0b 100644
--- a/util/sconfig/main.c
+++ b/util/sconfig/main.c
@@ -279,6 +279,10 @@ struct device *new_device(struct device *parent, struct device *busdev, const in
 	case IOAPIC:
 		new_d->path = ".type=DEVICE_PATH_IOAPIC,{.ioapic={ .ioapic_id = 0x%x }}";
 		break;
+
+	case GENERIC:
+		new_d->path = ".type=DEVICE_PATH_GENERIC,{.generic={ .id = 0x%x, .subid = 0x%x }}";
+		break;
 	}
 	return new_d;
 }
diff --git a/util/sconfig/sconfig.l b/util/sconfig/sconfig.l
index 40fb164..e361508 100755
--- a/util/sconfig/sconfig.l
+++ b/util/sconfig/sconfig.l
@@ -37,6 +37,7 @@ lapic		{yylval.number=APIC; return(BUS);}
 cpu_cluster	{yylval.number=CPU_CLUSTER; return(BUS);}
 cpu		{yylval.number=CPU; return(BUS);}
 domain		{yylval.number=DOMAIN; return(BUS);}
+generic		{yylval.number=GENERIC; return(BUS);}
 irq		{yylval.number=IRQ; return(RESOURCE);}
 drq		{yylval.number=DRQ; return(RESOURCE);}
 io		{yylval.number=IO; return(RESOURCE);}
diff --git a/util/sconfig/sconfig.tab.c_shipped b/util/sconfig/sconfig.tab.c_shipped
index cef198e..bca06a0 100644
--- a/util/sconfig/sconfig.tab.c_shipped
+++ b/util/sconfig/sconfig.tab.c_shipped
@@ -148,7 +148,8 @@ extern int yydebug;
     INHERIT = 280,
     IOAPIC_IRQ = 281,
     IOAPIC = 282,
-    PCIINT = 283
+    PCIINT = 283,
+    GENERIC = 284
   };
 #endif
 
@@ -425,7 +426,7 @@ union yyalloc
 #define YYLAST   39
 
 /* YYNTOKENS -- Number of terminals.  */
-#define YYNTOKENS  29
+#define YYNTOKENS  30
 /* YYNNTS -- Number of nonterminals.  */
 #define YYNNTS  13
 /* YYNRULES -- Number of rules.  */
@@ -436,7 +437,7 @@ union yyalloc
 /* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned
    by yylex, with out-of-bounds checking.  */
 #define YYUNDEFTOK  2
-#define YYMAXUTOK   283
+#define YYMAXUTOK   284
 
 #define YYTRANSLATE(YYX)                                                \
   ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
@@ -473,7 +474,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
+      25,    26,    27,    28,    29
 };
 
 #if YYDEBUG
@@ -494,9 +495,10 @@ static const char *const yytname[] =
   "$end", "error", "$undefined", "CHIP", "DEVICE", "REGISTER", "BOOL",
   "BUS", "RESOURCE", "END", "EQUALS", "HEX", "STRING", "PCI", "PNP", "I2C",
   "APIC", "CPU_CLUSTER", "CPU", "DOMAIN", "IRQ", "DRQ", "IO", "NUMBER",
-  "SUBSYSTEMID", "INHERIT", "IOAPIC_IRQ", "IOAPIC", "PCIINT", "$accept",
-  "devtree", "$@1", "chipchildren", "devicechildren", "chip", "@2",
-  "device", "@3", "resource", "registers", "subsystemid", "ioapic_irq", YY_NULLPTR
+  "SUBSYSTEMID", "INHERIT", "IOAPIC_IRQ", "IOAPIC", "PCIINT", "GENERIC",
+  "$accept", "devtree", "$@1", "chipchildren", "devicechildren", "chip",
+  "@2", "device", "@3", "resource", "registers", "subsystemid",
+  "ioapic_irq", YY_NULLPTR
 };
 #endif
 
@@ -507,7 +509,7 @@ 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
+     275,   276,   277,   278,   279,   280,   281,   282,   283,   284
 };
 # endif
 
@@ -581,19 +583,19 @@ static const yytype_int8 yycheck[] =
      symbol of state STATE-NUM.  */
 static const yytype_uint8 yystos[] =
 {
-       0,    30,    31,     0,     3,    34,    12,    35,    32,     4,
-       5,     9,    34,    36,    39,     7,    12,    23,    10,     6,
-      12,    37,    33,     8,     9,    24,    26,    34,    36,    38,
-      40,    41,    23,    23,    23,    10,    23,    28,    23,    25,
+       0,    31,    32,     0,     3,    35,    12,    36,    33,     4,
+       5,     9,    35,    37,    40,     7,    12,    23,    10,     6,
+      12,    38,    34,     8,     9,    24,    26,    35,    37,    39,
+      41,    42,    23,    23,    23,    10,    23,    28,    23,    25,
       23
 };
 
   /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives.  */
 static const yytype_uint8 yyr1[] =
 {
-       0,    29,    31,    30,    32,    32,    32,    32,    33,    33,
-      33,    33,    33,    33,    35,    34,    37,    36,    38,    39,
-      40,    40,    41
+       0,    30,    32,    31,    33,    33,    33,    33,    34,    34,
+      34,    34,    34,    34,    36,    35,    38,    37,    39,    40,
+      41,    41,    42
 };
 
   /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN.  */
diff --git a/util/sconfig/sconfig.tab.h_shipped b/util/sconfig/sconfig.tab.h_shipped
index 1696b0e..9666b37 100644
--- a/util/sconfig/sconfig.tab.h_shipped
+++ b/util/sconfig/sconfig.tab.h_shipped
@@ -70,7 +70,8 @@ extern int yydebug;
     INHERIT = 280,
     IOAPIC_IRQ = 281,
     IOAPIC = 282,
-    PCIINT = 283
+    PCIINT = 283,
+    GENERIC = 284
   };
 #endif
 
diff --git a/util/sconfig/sconfig.y b/util/sconfig/sconfig.y
index a5a063f..b1e37a8 100755
--- a/util/sconfig/sconfig.y
+++ b/util/sconfig/sconfig.y
@@ -29,7 +29,7 @@ static struct device *cur_parent, *cur_bus;
 	int number;
 }
 
-%token CHIP DEVICE REGISTER BOOL BUS RESOURCE END EQUALS HEX STRING PCI PNP I2C APIC CPU_CLUSTER CPU DOMAIN IRQ DRQ IO NUMBER SUBSYSTEMID INHERIT IOAPIC_IRQ IOAPIC PCIINT
+%token CHIP DEVICE REGISTER BOOL 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
 %%
 devtree: { cur_parent = cur_bus = head; } chip { postprocess_devtree(); } ;
 



More information about the coreboot-gerrit mailing list