aboutsummaryrefslogtreecommitdiff
path: root/dtc.h
diff options
context:
space:
mode:
authorRob Herring <robh@kernel.org>2017-03-20 09:44:16 -0500
committerDavid Gibson <david@gibson.dropbear.id.au>2017-03-21 14:45:37 +1100
commit33c3985226d344662511f999aa1920c112a549da (patch)
tree168ab422f8adde9ff159e9c005f655802c269d11 /dtc.h
parent558cd81bdd432769b59bff01240c44f82cfb1a9d (diff)
downloaddtc-33c3985226d344662511f999aa1920c112a549da.zip
dtc-33c3985226d344662511f999aa1920c112a549da.tar.gz
dtc-33c3985226d344662511f999aa1920c112a549da.tar.bz2
checks: Add bus checks for PCI buses
Add PCI bridge and device node checks. We identify PCI bridges with 'device_type = "pci"' as only PCI bridges should set that property. For bridges, check that node name is pci or pcie, ranges and bus-range are present, and #address-cells and #size-cells are correct. For devices, check the reg property fields are correct for the first element (the config address). Check that the unit address is formatted corectly based on the reg property. Device unit addresses are in the form DD or DD,F where DD is the device 0-0x1f and F is the function 0-7. Also, check that the bus number is within the expected range defined by bridge's bus-ranges. Reviewed-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Rob Herring <robh@kernel.org> [dwg: Added a missing check dependency] Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Diffstat (limited to 'dtc.h')
-rw-r--r--dtc.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/dtc.h b/dtc.h
index 403b79d..fc24e17 100644
--- a/dtc.h
+++ b/dtc.h
@@ -135,6 +135,10 @@ struct label {
struct label *next;
};
+struct bus_type {
+ const char *name;
+};
+
struct property {
bool deleted;
char *name;
@@ -161,6 +165,7 @@ struct node {
int addr_cells, size_cells;
struct label *labels;
+ const struct bus_type *bus;
};
#define for_each_label_withdel(l0, l) \