From b5a2e3ae0634cac33ad666b1d7d1180fcb397524 Mon Sep 17 00:00:00 2001 From: Laxman Dewangan Date: Wed, 29 Mar 2023 10:34:16 +0000 Subject: [PATCH] NVIDIA: SAUCE: dtc: check: Disable warning for plugin DTS BugLink: https://bugs.launchpad.net/bugs/2072591 If the DTS is plugin type i.e. overlay then there are cases that DT rules are violated due to limited property overlay. Like for overlaying nodes named as xyz@12345678 will not have overlay properties for register. In this case, DTC compiler produces warning. Disabling warning for following check for plugin DTS compilation: - reg_format - ranges_format - i2c_bus_bridge - spi_bus_bridge - avoid_default_addr_size - interrupts_property http://nvbugs/4037171 Signed-off-by: Laxman Dewangan Reviewed-by: Bitan Biswas Tested-by: Abhilash G Reviewed-by: Abhilash G Acked-by: Jacob Martin Acked-by: Noah Wager Signed-off-by: Noah Wager --- scripts/dtc/checks.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/scripts/dtc/checks.c b/scripts/dtc/checks.c index 9f31d2607182..0bb0190d4b44 100644 --- a/scripts/dtc/checks.c +++ b/scripts/dtc/checks.c @@ -758,6 +758,10 @@ static void check_reg_format(struct check *c, struct dt_info *dti, struct property *prop; int addr_cells, size_cells, entrylen; + /* Ignore for plugin */ + if (dti->dtsflags & DTSF_PLUGIN) + return; + prop = get_property(node, "reg"); if (!prop) return; /* No "reg", that's fine */ @@ -788,6 +792,10 @@ static void check_ranges_format(struct check *c, struct dt_info *dti, int c_addr_cells, p_addr_cells, c_size_cells, p_size_cells, entrylen; const char *ranges = c->data; + /* Ignore for plugin */ + if (dti->dtsflags & DTSF_PLUGIN) + return; + prop = get_property(node, ranges); if (!prop) return; @@ -1017,6 +1025,10 @@ static const struct bus_type i2c_bus = { static void check_i2c_bus_bridge(struct check *c, struct dt_info *dti, struct node *node) { + /* Ignore for plugin */ + if (dti->dtsflags & DTSF_PLUGIN) + return; + if (strprefixeq(node->name, node->basenamelen, "i2c-bus") || strprefixeq(node->name, node->basenamelen, "i2c-arb")) { node->bus = &i2c_bus; @@ -1096,6 +1108,10 @@ static void check_spi_bus_bridge(struct check *c, struct dt_info *dti, struct no { int spi_addr_cells = 1; + /* Ignore for plugin */ + if (dti->dtsflags & DTSF_PLUGIN) + return; + if (strprefixeq(node->name, node->basenamelen, "spi")) { node->bus = &spi_bus; } else { @@ -1197,6 +1213,10 @@ static void check_avoid_default_addr_size(struct check *c, struct dt_info *dti, if (!node->parent) return; /* Ignore root node */ + /* Ignore for plugin */ + if (dti->dtsflags & DTSF_PLUGIN) + return; + reg = get_property(node, "reg"); ranges = get_property(node, "ranges"); @@ -1690,6 +1710,10 @@ static void check_interrupts_property(struct check *c, if (!irq_prop) return; + /* Ignore for plugin */ + if (dti->dtsflags & DTSF_PLUGIN) + return; + if (!is_multiple_of(irq_prop->val.len, sizeof(cell_t))) FAIL_PROP(c, dti, node, irq_prop, "size (%d) is invalid, expected multiple of %zu", irq_prop->val.len, sizeof(cell_t));