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>
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 @@
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 @@
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 @@
"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 @@
unsigned id;
};
+struct generic_path
+{
+ unsigned id;
+ unsigned subid;
+};
+
struct device_path {
enum device_path_type type;
@@ -98,6 +106,7 @@
struct cpu_cluster_path cpu_cluster;
struct cpu_path cpu;
struct cpu_bus_path cpu_bus;
+ struct generic_path generic;
};
};