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 <ldewangan@nvidia.com>
Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>
Tested-by: Abhilash G <abhilashg@nvidia.com>
Reviewed-by: Abhilash G <abhilashg@nvidia.com>
Acked-by: Jacob Martin <jacob.martin@canonical.com>
Acked-by: Noah Wager <noah.wager@canonical.com>
Signed-off-by: Noah Wager <noah.wager@canonical.com>
This commit is contained in:
Laxman Dewangan
2023-03-29 10:34:16 +00:00
committed by Noah Wager
parent 04e2ed4a9d
commit b5a2e3ae06
+24
View File
@@ -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));