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@chromium.org> Reviewed-on: https://review.coreboot.org/14789 Tested-by: build bot (Jenkins) Reviewed-by: Aaron Durbin <adurbin@chromium.org> Reviewed-by: Leroy P Leahy <leroy.p.leahy@intel.com>
This commit is contained in:
parent
b7ce5fe311
commit
4650f5baff
|
@ -222,6 +222,9 @@ u32 dev_path_encode(device_t dev)
|
||||||
case DEVICE_PATH_IOAPIC:
|
case DEVICE_PATH_IOAPIC:
|
||||||
ret |= dev->path.ioapic.ioapic_id;
|
ret |= dev->path.ioapic.ioapic_id;
|
||||||
break;
|
break;
|
||||||
|
case DEVICE_PATH_GENERIC:
|
||||||
|
ret |= dev->path.generic.subid << 8 | dev->path.generic.id;
|
||||||
|
break;
|
||||||
case DEVICE_PATH_NONE:
|
case DEVICE_PATH_NONE:
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
@ -286,6 +289,11 @@ const char *dev_path(device_t dev)
|
||||||
snprintf(buffer, sizeof (buffer),
|
snprintf(buffer, sizeof (buffer),
|
||||||
"CPU_BUS: %02x", dev->path.cpu_bus.id);
|
"CPU_BUS: %02x", dev->path.cpu_bus.id);
|
||||||
break;
|
break;
|
||||||
|
case DEVICE_PATH_GENERIC:
|
||||||
|
snprintf(buffer, sizeof (buffer),
|
||||||
|
"GENERIC: %d.%d", dev->path.generic.id,
|
||||||
|
dev->path.generic.subid);
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
printk(BIOS_ERR, "Unknown device path type: %d\n",
|
printk(BIOS_ERR, "Unknown device path type: %d\n",
|
||||||
dev->path.type);
|
dev->path.type);
|
||||||
|
@ -353,6 +361,10 @@ int path_eq(struct device_path *path1, struct device_path *path2)
|
||||||
case DEVICE_PATH_CPU_BUS:
|
case DEVICE_PATH_CPU_BUS:
|
||||||
equal = (path1->cpu_bus.id == path2->cpu_bus.id);
|
equal = (path1->cpu_bus.id == path2->cpu_bus.id);
|
||||||
break;
|
break;
|
||||||
|
case DEVICE_PATH_GENERIC:
|
||||||
|
equal = (path1->generic.id == path2->generic.id) &&
|
||||||
|
(path1->generic.subid == path2->generic.subid);
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
printk(BIOS_ERR, "Unknown device type: %d\n", path1->type);
|
printk(BIOS_ERR, "Unknown device type: %d\n", path1->type);
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -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.
|
* @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;
|
device_t child;
|
||||||
struct bus *link;
|
struct bus *link;
|
||||||
|
|
|
@ -232,6 +232,7 @@ void fixed_mem_resource(device_t dev, unsigned long index,
|
||||||
unsigned long basek, unsigned long sizek, unsigned long type);
|
unsigned long basek, unsigned long sizek, unsigned long type);
|
||||||
|
|
||||||
void scan_smbus(device_t bus);
|
void scan_smbus(device_t bus);
|
||||||
|
void scan_static_bus(device_t bus);
|
||||||
void scan_lpc_bus(device_t bus);
|
void scan_lpc_bus(device_t bus);
|
||||||
|
|
||||||
/* It is the caller's responsibility to adjust regions such that ram_resource()
|
/* It is the caller's responsibility to adjust regions such that ram_resource()
|
||||||
|
|
|
@ -13,6 +13,7 @@ enum device_path_type {
|
||||||
DEVICE_PATH_CPU,
|
DEVICE_PATH_CPU,
|
||||||
DEVICE_PATH_CPU_BUS,
|
DEVICE_PATH_CPU_BUS,
|
||||||
DEVICE_PATH_IOAPIC,
|
DEVICE_PATH_IOAPIC,
|
||||||
|
DEVICE_PATH_GENERIC,
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* When adding path types to this table, please also update the
|
* 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_CLUSTER", \
|
||||||
"DEVICE_PATH_CPU", \
|
"DEVICE_PATH_CPU", \
|
||||||
"DEVICE_PATH_CPU_BUS", \
|
"DEVICE_PATH_CPU_BUS", \
|
||||||
"DEVICE_PATH_IOAPIC" \
|
"DEVICE_PATH_IOAPIC", \
|
||||||
|
"DEVICE_PATH_GENERIC" \
|
||||||
}
|
}
|
||||||
|
|
||||||
struct domain_path
|
struct domain_path
|
||||||
|
@ -85,6 +87,12 @@ struct cpu_bus_path
|
||||||
unsigned id;
|
unsigned id;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct generic_path
|
||||||
|
{
|
||||||
|
unsigned id;
|
||||||
|
unsigned subid;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
struct device_path {
|
struct device_path {
|
||||||
enum device_path_type type;
|
enum device_path_type type;
|
||||||
|
@ -98,6 +106,7 @@ struct device_path {
|
||||||
struct cpu_cluster_path cpu_cluster;
|
struct cpu_cluster_path cpu_cluster;
|
||||||
struct cpu_path cpu;
|
struct cpu_path cpu;
|
||||||
struct cpu_bus_path cpu_bus;
|
struct cpu_bus_path cpu_bus;
|
||||||
|
struct generic_path generic;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -373,8 +373,8 @@ static void yy_fatal_error (yyconst char msg[] );
|
||||||
*yy_cp = '\0'; \
|
*yy_cp = '\0'; \
|
||||||
(yy_c_buf_p) = yy_cp;
|
(yy_c_buf_p) = yy_cp;
|
||||||
|
|
||||||
#define YY_NUM_RULES 31
|
#define YY_NUM_RULES 33
|
||||||
#define YY_END_OF_BUFFER 32
|
#define YY_END_OF_BUFFER 34
|
||||||
/* This struct is not used in this scanner,
|
/* This struct is not used in this scanner,
|
||||||
but its presence is necessary. */
|
but its presence is necessary. */
|
||||||
struct yy_trans_info
|
struct yy_trans_info
|
||||||
|
@ -382,21 +382,22 @@ struct yy_trans_info
|
||||||
flex_int32_t yy_verify;
|
flex_int32_t yy_verify;
|
||||||
flex_int32_t yy_nxt;
|
flex_int32_t yy_nxt;
|
||||||
};
|
};
|
||||||
static yyconst flex_int16_t yy_accept[116] =
|
static yyconst flex_int16_t yy_accept[130] =
|
||||||
{ 0,
|
{ 0,
|
||||||
0, 0, 32, 30, 1, 3, 30, 30, 30, 26,
|
0, 0, 34, 32, 1, 3, 32, 32, 32, 27,
|
||||||
26, 24, 27, 30, 27, 27, 27, 30, 30, 30,
|
27, 25, 28, 32, 28, 28, 28, 32, 32, 32,
|
||||||
30, 30, 30, 30, 1, 3, 30, 0, 30, 0,
|
32, 32, 32, 32, 32, 1, 3, 32, 0, 32,
|
||||||
2, 26, 27, 30, 30, 30, 30, 27, 30, 30,
|
32, 0, 2, 27, 28, 32, 32, 32, 32, 28,
|
||||||
30, 30, 30, 19, 30, 30, 30, 7, 30, 30,
|
32, 32, 32, 32, 32, 32, 20, 32, 32, 32,
|
||||||
30, 30, 29, 29, 25, 30, 30, 15, 30, 30,
|
7, 32, 32, 32, 32, 31, 31, 32, 0, 26,
|
||||||
18, 23, 12, 30, 30, 17, 30, 8, 9, 11,
|
32, 32, 15, 32, 32, 19, 24, 32, 12, 32,
|
||||||
30, 30, 28, 4, 30, 30, 30, 30, 30, 30,
|
32, 18, 32, 8, 9, 11, 32, 32, 32, 0,
|
||||||
30, 30, 30, 30, 30, 30, 30, 13, 30, 30,
|
29, 4, 32, 32, 32, 32, 32, 32, 32, 32,
|
||||||
30, 5, 16, 30, 10, 30, 30, 30, 21, 30,
|
32, 30, 30, 32, 32, 32, 32, 32, 32, 13,
|
||||||
|
|
||||||
30, 30, 30, 30, 6, 30, 30, 30, 30, 30,
|
32, 32, 32, 5, 16, 32, 32, 10, 32, 32,
|
||||||
20, 30, 14, 22, 0
|
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] =
|
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
|
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, 0, 181, 0, 178, 182, 176, 37, 41, 38,
|
0, 0, 200, 0, 197, 201, 195, 37, 41, 38,
|
||||||
141, 0, 44, 163, 54, 78, 60, 45, 159, 42,
|
160, 0, 44, 182, 54, 78, 60, 174, 45, 177,
|
||||||
47, 154, 139, 0, 171, 182, 77, 167, 69, 168,
|
42, 47, 172, 157, 0, 189, 201, 77, 185, 87,
|
||||||
182, 0, 82, 104, 155, 144, 133, 93, 140, 135,
|
69, 186, 201, 0, 86, 104, 173, 162, 151, 93,
|
||||||
145, 145, 139, 145, 130, 130, 137, 0, 133, 127,
|
158, 153, 163, 154, 162, 156, 162, 147, 147, 154,
|
||||||
133, 137, 0, 182, 0, 143, 123, 136, 126, 133,
|
0, 150, 144, 150, 154, 0, 201, 101, 166, 0,
|
||||||
0, 0, 0, 128, 118, 0, 122, 0, 0, 0,
|
159, 139, 152, 142, 149, 0, 0, 144, 0, 143,
|
||||||
121, 112, 0, 0, 125, 124, 117, 109, 115, 120,
|
133, 0, 137, 0, 0, 0, 136, 127, 154, 153,
|
||||||
105, 90, 101, 99, 91, 93, 98, 0, 80, 76,
|
0, 0, 138, 137, 130, 122, 121, 127, 132, 117,
|
||||||
73, 0, 0, 72, 89, 83, 69, 65, 0, 72,
|
111, 0, 201, 122, 126, 118, 120, 119, 124, 0,
|
||||||
|
|
||||||
64, 74, 60, 61, 0, 65, 62, 50, 51, 33,
|
108, 95, 92, 0, 0, 101, 85, 102, 96, 80,
|
||||||
0, 28, 0, 0, 182, 40, 129, 131, 133, 135
|
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,
|
{ 0,
|
||||||
115, 1, 115, 116, 115, 115, 116, 117, 118, 116,
|
129, 1, 129, 130, 129, 129, 130, 131, 132, 130,
|
||||||
10, 116, 10, 116, 10, 10, 10, 116, 116, 116,
|
10, 130, 10, 130, 10, 10, 10, 130, 130, 130,
|
||||||
116, 116, 116, 116, 115, 115, 117, 119, 118, 120,
|
130, 130, 130, 130, 130, 129, 129, 131, 133, 134,
|
||||||
115, 10, 10, 10, 116, 116, 116, 10, 116, 116,
|
132, 135, 129, 10, 10, 10, 130, 130, 130, 10,
|
||||||
116, 116, 116, 116, 116, 116, 116, 116, 116, 116,
|
130, 130, 130, 130, 130, 130, 130, 130, 130, 130,
|
||||||
116, 116, 116, 115, 34, 116, 116, 116, 116, 116,
|
130, 130, 130, 130, 130, 130, 129, 134, 136, 36,
|
||||||
116, 116, 116, 116, 116, 116, 116, 116, 116, 116,
|
130, 130, 130, 130, 130, 130, 130, 130, 130, 130,
|
||||||
116, 116, 116, 116, 116, 116, 116, 116, 116, 116,
|
130, 130, 130, 130, 130, 130, 130, 130, 130, 129,
|
||||||
116, 116, 116, 116, 116, 116, 116, 116, 116, 116,
|
130, 130, 130, 130, 130, 130, 130, 130, 130, 130,
|
||||||
116, 116, 116, 116, 116, 116, 116, 116, 116, 116,
|
130, 130, 129, 130, 130, 130, 130, 130, 130, 130,
|
||||||
|
|
||||||
116, 116, 116, 116, 116, 116, 116, 116, 116, 116,
|
130, 130, 130, 130, 130, 130, 130, 130, 130, 130,
|
||||||
116, 116, 116, 116, 0, 115, 115, 115, 115, 115
|
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,
|
{ 0,
|
||||||
4, 5, 6, 7, 8, 9, 10, 11, 10, 12,
|
4, 5, 6, 7, 8, 9, 10, 11, 10, 12,
|
||||||
13, 13, 14, 4, 4, 4, 13, 13, 15, 16,
|
13, 13, 14, 4, 4, 4, 13, 13, 15, 16,
|
||||||
17, 13, 4, 4, 18, 19, 4, 4, 20, 21,
|
17, 13, 18, 4, 19, 20, 4, 4, 21, 22,
|
||||||
4, 22, 23, 4, 4, 4, 4, 4, 28, 28,
|
4, 23, 24, 4, 4, 4, 4, 4, 29, 29,
|
||||||
24, 24, 30, 31, 32, 32, 32, 114, 33, 33,
|
25, 30, 32, 33, 34, 34, 34, 128, 35, 35,
|
||||||
33, 33, 33, 42, 33, 33, 33, 33, 33, 33,
|
35, 35, 35, 45, 35, 35, 35, 35, 35, 35,
|
||||||
33, 33, 33, 47, 113, 49, 33, 33, 33, 48,
|
35, 35, 35, 50, 127, 52, 35, 35, 35, 51,
|
||||||
30, 31, 43, 44, 50, 112, 45, 36, 28, 28,
|
32, 33, 46, 47, 53, 126, 48, 38, 29, 29,
|
||||||
111, 53, 110, 37, 33, 33, 33, 41, 33, 33,
|
125, 56, 124, 39, 35, 35, 35, 43, 59, 59,
|
||||||
33, 109, 108, 107, 106, 105, 104, 103, 38, 33,
|
123, 25, 35, 35, 35, 122, 121, 120, 40, 35,
|
||||||
|
|
||||||
33, 33, 102, 101, 100, 99, 39, 98, 97, 40,
|
35, 35, 59, 59, 119, 79, 41, 118, 117, 42,
|
||||||
55, 55, 55, 96, 55, 55, 95, 94, 93, 92,
|
60, 60, 60, 116, 60, 60, 115, 114, 113, 112,
|
||||||
55, 55, 55, 55, 55, 55, 91, 90, 59, 27,
|
60, 60, 60, 60, 60, 60, 111, 110, 64, 28,
|
||||||
27, 29, 29, 28, 28, 30, 30, 89, 88, 87,
|
28, 31, 31, 29, 29, 58, 58, 32, 32, 59,
|
||||||
86, 85, 84, 83, 82, 81, 80, 79, 78, 77,
|
59, 109, 108, 107, 106, 105, 104, 103, 102, 101,
|
||||||
76, 75, 74, 73, 72, 71, 70, 69, 68, 67,
|
100, 99, 98, 97, 96, 95, 94, 93, 92, 91,
|
||||||
66, 65, 64, 63, 62, 61, 60, 58, 57, 56,
|
90, 89, 88, 87, 86, 85, 84, 83, 82, 81,
|
||||||
31, 54, 25, 52, 51, 46, 35, 34, 26, 25,
|
80, 78, 77, 76, 75, 74, 73, 72, 71, 70,
|
||||||
115, 3, 115, 115, 115, 115, 115, 115, 115, 115,
|
69, 68, 67, 66, 65, 63, 62, 61, 33, 57,
|
||||||
115, 115, 115, 115, 115, 115, 115, 115, 115, 115,
|
26, 55, 54, 49, 44, 37, 36, 27, 26, 129,
|
||||||
|
|
||||||
115, 115, 115, 115, 115, 115, 115, 115, 115, 115,
|
3, 129, 129, 129, 129, 129, 129, 129, 129, 129,
|
||||||
115, 115, 115, 115, 115, 115, 115, 115, 115, 115
|
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,
|
{ 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, 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,
|
1, 1, 1, 1, 1, 1, 1, 1, 8, 8,
|
||||||
116, 8, 9, 9, 10, 10, 10, 112, 10, 10,
|
130, 8, 9, 9, 10, 10, 10, 126, 10, 10,
|
||||||
13, 13, 13, 18, 10, 10, 10, 10, 10, 10,
|
13, 13, 13, 19, 10, 10, 10, 10, 10, 10,
|
||||||
15, 15, 15, 20, 110, 21, 17, 17, 17, 20,
|
15, 15, 15, 21, 124, 22, 17, 17, 17, 21,
|
||||||
29, 29, 18, 18, 21, 109, 18, 15, 27, 27,
|
31, 31, 19, 19, 22, 123, 19, 15, 28, 28,
|
||||||
108, 27, 107, 15, 16, 16, 16, 17, 33, 33,
|
122, 28, 121, 15, 16, 16, 16, 17, 30, 30,
|
||||||
33, 106, 104, 103, 102, 101, 100, 98, 16, 38,
|
120, 30, 35, 35, 35, 118, 117, 116, 16, 40,
|
||||||
|
|
||||||
38, 38, 97, 96, 95, 94, 16, 91, 90, 16,
|
40, 40, 58, 58, 115, 58, 16, 114, 111, 16,
|
||||||
34, 34, 34, 89, 34, 34, 87, 86, 85, 84,
|
36, 36, 36, 110, 36, 36, 109, 108, 107, 106,
|
||||||
34, 34, 34, 34, 34, 34, 83, 82, 38, 117,
|
36, 36, 36, 36, 36, 36, 103, 102, 40, 131,
|
||||||
117, 118, 118, 119, 119, 120, 120, 81, 80, 79,
|
131, 132, 132, 133, 133, 134, 134, 135, 135, 136,
|
||||||
78, 77, 76, 75, 72, 71, 67, 65, 64, 60,
|
136, 101, 99, 98, 97, 96, 95, 94, 91, 90,
|
||||||
59, 58, 57, 56, 52, 51, 50, 49, 47, 46,
|
89, 88, 87, 86, 85, 84, 83, 80, 79, 78,
|
||||||
45, 44, 43, 42, 41, 40, 39, 37, 36, 35,
|
77, 73, 71, 70, 68, 65, 64, 63, 62, 61,
|
||||||
30, 28, 25, 23, 22, 19, 14, 11, 7, 5,
|
59, 55, 54, 53, 52, 50, 49, 48, 47, 46,
|
||||||
3, 115, 115, 115, 115, 115, 115, 115, 115, 115,
|
45, 44, 43, 42, 41, 39, 38, 37, 32, 29,
|
||||||
115, 115, 115, 115, 115, 115, 115, 115, 115, 115,
|
26, 24, 23, 20, 18, 14, 11, 7, 5, 3,
|
||||||
|
|
||||||
115, 115, 115, 115, 115, 115, 115, 115, 115, 115,
|
129, 129, 129, 129, 129, 129, 129, 129, 129, 129,
|
||||||
115, 115, 115, 115, 115, 115, 115, 115, 115, 115
|
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;
|
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 )
|
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
|
||||||
{
|
{
|
||||||
yy_current_state = (int) yy_def[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_c = yy_meta[(unsigned int) yy_c];
|
||||||
}
|
}
|
||||||
yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
|
yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
|
||||||
++yy_cp;
|
++yy_cp;
|
||||||
}
|
}
|
||||||
while ( yy_base[yy_current_state] != 182 );
|
while ( yy_base[yy_current_state] != 201 );
|
||||||
|
|
||||||
yy_find_action:
|
yy_find_action:
|
||||||
yy_act = yy_accept[yy_current_state];
|
yy_act = yy_accept[yy_current_state];
|
||||||
|
@ -903,39 +912,39 @@ YY_RULE_SETUP
|
||||||
YY_BREAK
|
YY_BREAK
|
||||||
case 17:
|
case 17:
|
||||||
YY_RULE_SETUP
|
YY_RULE_SETUP
|
||||||
{yylval.number=IRQ; return(RESOURCE);}
|
{yylval.number=GENERIC; return(BUS);}
|
||||||
YY_BREAK
|
YY_BREAK
|
||||||
case 18:
|
case 18:
|
||||||
YY_RULE_SETUP
|
YY_RULE_SETUP
|
||||||
{yylval.number=DRQ; return(RESOURCE);}
|
{yylval.number=IRQ; return(RESOURCE);}
|
||||||
YY_BREAK
|
YY_BREAK
|
||||||
case 19:
|
case 19:
|
||||||
YY_RULE_SETUP
|
YY_RULE_SETUP
|
||||||
{yylval.number=IO; return(RESOURCE);}
|
{yylval.number=DRQ; return(RESOURCE);}
|
||||||
YY_BREAK
|
YY_BREAK
|
||||||
case 20:
|
case 20:
|
||||||
YY_RULE_SETUP
|
YY_RULE_SETUP
|
||||||
{return(IOAPIC_IRQ);}
|
{yylval.number=IO; return(RESOURCE);}
|
||||||
YY_BREAK
|
YY_BREAK
|
||||||
case 21:
|
case 21:
|
||||||
YY_RULE_SETUP
|
YY_RULE_SETUP
|
||||||
{return(INHERIT);}
|
{return(IOAPIC_IRQ);}
|
||||||
YY_BREAK
|
YY_BREAK
|
||||||
case 22:
|
case 22:
|
||||||
YY_RULE_SETUP
|
YY_RULE_SETUP
|
||||||
{return(SUBSYSTEMID);}
|
{return(INHERIT);}
|
||||||
YY_BREAK
|
YY_BREAK
|
||||||
case 23:
|
case 23:
|
||||||
YY_RULE_SETUP
|
YY_RULE_SETUP
|
||||||
{return(END);}
|
{return(SUBSYSTEMID);}
|
||||||
YY_BREAK
|
YY_BREAK
|
||||||
case 24:
|
case 24:
|
||||||
YY_RULE_SETUP
|
YY_RULE_SETUP
|
||||||
{return(EQUALS);}
|
{return(END);}
|
||||||
YY_BREAK
|
YY_BREAK
|
||||||
case 25:
|
case 25:
|
||||||
YY_RULE_SETUP
|
YY_RULE_SETUP
|
||||||
{yylval.string = malloc(yyleng+1); strncpy(yylval.string, yytext, yyleng); yylval.string[yyleng]='\0'; return(NUMBER);}
|
{return(EQUALS);}
|
||||||
YY_BREAK
|
YY_BREAK
|
||||||
case 26:
|
case 26:
|
||||||
YY_RULE_SETUP
|
YY_RULE_SETUP
|
||||||
|
@ -947,18 +956,27 @@ YY_RULE_SETUP
|
||||||
YY_BREAK
|
YY_BREAK
|
||||||
case 28:
|
case 28:
|
||||||
YY_RULE_SETUP
|
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
|
YY_BREAK
|
||||||
case 29:
|
case 29:
|
||||||
/* rule 29 can match eol */
|
YY_RULE_SETUP
|
||||||
|
{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
|
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+1, yyleng-2); yylval.string[yyleng-2]='\0'; return(STRING);}
|
||||||
YY_BREAK
|
YY_BREAK
|
||||||
case 30:
|
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
|
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, yyleng); yylval.string[yyleng]='\0'; return(STRING);}
|
||||||
YY_BREAK
|
YY_BREAK
|
||||||
case 31:
|
case 33:
|
||||||
YY_RULE_SETUP
|
YY_RULE_SETUP
|
||||||
ECHO;
|
ECHO;
|
||||||
YY_BREAK
|
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 )
|
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
|
||||||
{
|
{
|
||||||
yy_current_state = (int) yy_def[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_c = yy_meta[(unsigned int) yy_c];
|
||||||
}
|
}
|
||||||
yy_current_state = yy_nxt[yy_base[yy_current_state] + (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 )
|
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
|
||||||
{
|
{
|
||||||
yy_current_state = (int) yy_def[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_c = yy_meta[(unsigned int) yy_c];
|
||||||
}
|
}
|
||||||
yy_current_state = yy_nxt[yy_base[yy_current_state] + (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;
|
return yy_is_jam ? 0 : yy_current_state;
|
||||||
}
|
}
|
||||||
|
|
|
@ -279,6 +279,10 @@ struct device *new_device(struct device *parent, struct device *busdev, const in
|
||||||
case IOAPIC:
|
case IOAPIC:
|
||||||
new_d->path = ".type=DEVICE_PATH_IOAPIC,{.ioapic={ .ioapic_id = 0x%x }}";
|
new_d->path = ".type=DEVICE_PATH_IOAPIC,{.ioapic={ .ioapic_id = 0x%x }}";
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case GENERIC:
|
||||||
|
new_d->path = ".type=DEVICE_PATH_GENERIC,{.generic={ .id = 0x%x, .subid = 0x%x }}";
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
return new_d;
|
return new_d;
|
||||||
}
|
}
|
||||||
|
|
|
@ -37,6 +37,7 @@ lapic {yylval.number=APIC; return(BUS);}
|
||||||
cpu_cluster {yylval.number=CPU_CLUSTER; return(BUS);}
|
cpu_cluster {yylval.number=CPU_CLUSTER; return(BUS);}
|
||||||
cpu {yylval.number=CPU; return(BUS);}
|
cpu {yylval.number=CPU; return(BUS);}
|
||||||
domain {yylval.number=DOMAIN; return(BUS);}
|
domain {yylval.number=DOMAIN; return(BUS);}
|
||||||
|
generic {yylval.number=GENERIC; return(BUS);}
|
||||||
irq {yylval.number=IRQ; return(RESOURCE);}
|
irq {yylval.number=IRQ; return(RESOURCE);}
|
||||||
drq {yylval.number=DRQ; return(RESOURCE);}
|
drq {yylval.number=DRQ; return(RESOURCE);}
|
||||||
io {yylval.number=IO; return(RESOURCE);}
|
io {yylval.number=IO; return(RESOURCE);}
|
||||||
|
|
|
@ -148,7 +148,8 @@ extern int yydebug;
|
||||||
INHERIT = 280,
|
INHERIT = 280,
|
||||||
IOAPIC_IRQ = 281,
|
IOAPIC_IRQ = 281,
|
||||||
IOAPIC = 282,
|
IOAPIC = 282,
|
||||||
PCIINT = 283
|
PCIINT = 283,
|
||||||
|
GENERIC = 284
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -425,7 +426,7 @@ union yyalloc
|
||||||
#define YYLAST 39
|
#define YYLAST 39
|
||||||
|
|
||||||
/* YYNTOKENS -- Number of terminals. */
|
/* YYNTOKENS -- Number of terminals. */
|
||||||
#define YYNTOKENS 29
|
#define YYNTOKENS 30
|
||||||
/* YYNNTS -- Number of nonterminals. */
|
/* YYNNTS -- Number of nonterminals. */
|
||||||
#define YYNNTS 13
|
#define YYNNTS 13
|
||||||
/* YYNRULES -- Number of rules. */
|
/* YYNRULES -- Number of rules. */
|
||||||
|
@ -436,7 +437,7 @@ union yyalloc
|
||||||
/* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned
|
/* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned
|
||||||
by yylex, with out-of-bounds checking. */
|
by yylex, with out-of-bounds checking. */
|
||||||
#define YYUNDEFTOK 2
|
#define YYUNDEFTOK 2
|
||||||
#define YYMAXUTOK 283
|
#define YYMAXUTOK 284
|
||||||
|
|
||||||
#define YYTRANSLATE(YYX) \
|
#define YYTRANSLATE(YYX) \
|
||||||
((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
|
((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,
|
2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
|
||||||
5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
|
5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
|
||||||
15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
|
15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
|
||||||
25, 26, 27, 28
|
25, 26, 27, 28, 29
|
||||||
};
|
};
|
||||||
|
|
||||||
#if YYDEBUG
|
#if YYDEBUG
|
||||||
|
@ -494,9 +495,10 @@ static const char *const yytname[] =
|
||||||
"$end", "error", "$undefined", "CHIP", "DEVICE", "REGISTER", "BOOL",
|
"$end", "error", "$undefined", "CHIP", "DEVICE", "REGISTER", "BOOL",
|
||||||
"BUS", "RESOURCE", "END", "EQUALS", "HEX", "STRING", "PCI", "PNP", "I2C",
|
"BUS", "RESOURCE", "END", "EQUALS", "HEX", "STRING", "PCI", "PNP", "I2C",
|
||||||
"APIC", "CPU_CLUSTER", "CPU", "DOMAIN", "IRQ", "DRQ", "IO", "NUMBER",
|
"APIC", "CPU_CLUSTER", "CPU", "DOMAIN", "IRQ", "DRQ", "IO", "NUMBER",
|
||||||
"SUBSYSTEMID", "INHERIT", "IOAPIC_IRQ", "IOAPIC", "PCIINT", "$accept",
|
"SUBSYSTEMID", "INHERIT", "IOAPIC_IRQ", "IOAPIC", "PCIINT", "GENERIC",
|
||||||
"devtree", "$@1", "chipchildren", "devicechildren", "chip", "@2",
|
"$accept", "devtree", "$@1", "chipchildren", "devicechildren", "chip",
|
||||||
"device", "@3", "resource", "registers", "subsystemid", "ioapic_irq", YY_NULLPTR
|
"@2", "device", "@3", "resource", "registers", "subsystemid",
|
||||||
|
"ioapic_irq", YY_NULLPTR
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -507,7 +509,7 @@ static const yytype_uint16 yytoknum[] =
|
||||||
{
|
{
|
||||||
0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
|
0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
|
||||||
265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
|
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
|
# endif
|
||||||
|
|
||||||
|
@ -581,19 +583,19 @@ static const yytype_int8 yycheck[] =
|
||||||
symbol of state STATE-NUM. */
|
symbol of state STATE-NUM. */
|
||||||
static const yytype_uint8 yystos[] =
|
static const yytype_uint8 yystos[] =
|
||||||
{
|
{
|
||||||
0, 30, 31, 0, 3, 34, 12, 35, 32, 4,
|
0, 31, 32, 0, 3, 35, 12, 36, 33, 4,
|
||||||
5, 9, 34, 36, 39, 7, 12, 23, 10, 6,
|
5, 9, 35, 37, 40, 7, 12, 23, 10, 6,
|
||||||
12, 37, 33, 8, 9, 24, 26, 34, 36, 38,
|
12, 38, 34, 8, 9, 24, 26, 35, 37, 39,
|
||||||
40, 41, 23, 23, 23, 10, 23, 28, 23, 25,
|
41, 42, 23, 23, 23, 10, 23, 28, 23, 25,
|
||||||
23
|
23
|
||||||
};
|
};
|
||||||
|
|
||||||
/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
|
/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
|
||||||
static const yytype_uint8 yyr1[] =
|
static const yytype_uint8 yyr1[] =
|
||||||
{
|
{
|
||||||
0, 29, 31, 30, 32, 32, 32, 32, 33, 33,
|
0, 30, 32, 31, 33, 33, 33, 33, 34, 34,
|
||||||
33, 33, 33, 33, 35, 34, 37, 36, 38, 39,
|
34, 34, 34, 34, 36, 35, 38, 37, 39, 40,
|
||||||
40, 40, 41
|
41, 41, 42
|
||||||
};
|
};
|
||||||
|
|
||||||
/* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */
|
/* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */
|
||||||
|
|
|
@ -70,7 +70,8 @@ extern int yydebug;
|
||||||
INHERIT = 280,
|
INHERIT = 280,
|
||||||
IOAPIC_IRQ = 281,
|
IOAPIC_IRQ = 281,
|
||||||
IOAPIC = 282,
|
IOAPIC = 282,
|
||||||
PCIINT = 283
|
PCIINT = 283,
|
||||||
|
GENERIC = 284
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -29,7 +29,7 @@ static struct device *cur_parent, *cur_bus;
|
||||||
int number;
|
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(); } ;
|
devtree: { cur_parent = cur_bus = head; } chip { postprocess_devtree(); } ;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue