Devicetree not including ngpios property on nested gpio-controller..

I am building a project with nrf52840dk, on NCS 2.5.2.  

I have a board that includes an NXP SC18IS606.  This is an ISC to SPI bridge which contains several additional GPIOS (to function as CS lines).

I have taken the NXP SC18IM704 which is a UART to I2C bridge and also includes gpios as an example for how to set this up..

Since this is a bridge and also a gpio the devicetree entry ends up looking like this:

    spi_bridge: SC18IS606@28 {
        compatible = "nxp,sc18is606";
        status = "okay";
        reset-gpio = <&cone_io_expander 1 GPIO_ACTIVE_LOW>;
        reg = <0x28>;

        sc18is606_gpio_port0: sc18is606_gpio {
          compatible = "nxp,sc18is606-gpio";

          #gpio-cells = <2>;
          ngpios = <8>;
          status = "okay";
          gpio-controller;
        };

        spi_ext: sc18is606_spi {
          compatible = "nxp,sc18is606-spi";
          status = "okay";

          //TODO add LED chain here
        };

    };

This is instanced on a i2c0.

For some reason devicetree does not generate the properties for the gpio sub-component.  I get errors like this:

zephyr/include/generated/devicetree_generated.h:13224:45: error: 'DT_N_S_soc_S_i2c_40003000_S_sc18is606_28_S_sc18is606_gpio_P_ngpios' undeclared here (not in a function);

and indeed th edevice tree generated header file only includes properties for compatble and status:

/* Generic property macros: */
#define DT_N_S_soc_S_i2c_40003000_S_sc18is606_28_S_sc18is606_gpio_P_compatible {"nxp,sc18is606-gpio"}
#define DT_N_S_soc_S_i2c_40003000_S_sc18is606_28_S_sc18is606_gpio_P_compatible_IDX_0 "nxp,sc18is606-gpio"
#define DT_N_S_soc_S_i2c_40003000_S_sc18is606_28_S_sc18is606_gpio_P_compatible_IDX_0_STRING_UNQUOTED nxp,sc18is606-gpio
#define DT_N_S_soc_S_i2c_40003000_S_sc18is606_28_S_sc18is606_gpio_P_compatible_IDX_0_STRING_TOKEN nxp_sc18is606_gpio
#define DT_N_S_soc_S_i2c_40003000_S_sc18is606_28_S_sc18is606_gpio_P_compatible_IDX_0_STRING_UPPER_TOKEN NXP_SC18IS606_GPIO
#define DT_N_S_soc_S_i2c_40003000_S_sc18is606_28_S_sc18is606_gpio_P_compatible_IDX_0_EXISTS 1
#define DT_N_S_soc_S_i2c_40003000_S_sc18is606_28_S_sc18is606_gpio_P_compatible_FOREACH_PROP_ELEM(fn) fn(DT_N_S_soc_S_i2c_40003000_S_sc18is606_28_S_sc18is606_gpio, compatible, 0)
#define DT_N_S_soc_S_i2c_40003000_S_sc18is606_28_S_sc18is606_gpio_P_compatible_FOREACH_PROP_ELEM_SEP(fn, sep) fn(DT_N_S_soc_S_i2c_40003000_S_sc18is606_28_S_sc18is606_gpio, compatible, 0)
#define DT_N_S_soc_S_i2c_40003000_S_sc18is606_28_S_sc18is606_gpio_P_compatible_FOREACH_PROP_ELEM_VARGS(fn, ...) fn(DT_N_S_soc_S_i2c_40003000_S_sc18is606_28_S_sc18is606_gpio, compatible, 0, __VA_ARGS__)
#define DT_N_S_soc_S_i2c_40003000_S_sc18is606_28_S_sc18is606_gpio_P_compatible_FOREACH_PROP_ELEM_SEP_VARGS(fn, sep, ...) fn(DT_N_S_soc_S_i2c_40003000_S_sc18is606_28_S_sc18is606_gpio, compatible, 0, __VA_ARGS__)
#define DT_N_S_soc_S_i2c_40003000_S_sc18is606_28_S_sc18is606_gpio_P_compatible_LEN 1
#define DT_N_S_soc_S_i2c_40003000_S_sc18is606_28_S_sc18is606_gpio_P_compatible_EXISTS 1
#define DT_N_S_soc_S_i2c_40003000_S_sc18is606_28_S_sc18is606_gpio_P_status "okay"
#define DT_N_S_soc_S_i2c_40003000_S_sc18is606_28_S_sc18is606_gpio_P_status_STRING_UNQUOTED okay
#define DT_N_S_soc_S_i2c_40003000_S_sc18is606_28_S_sc18is606_gpio_P_status_STRING_TOKEN okay
#define DT_N_S_soc_S_i2c_40003000_S_sc18is606_28_S_sc18is606_gpio_P_status_STRING_UPPER_TOKEN OKAY
#define DT_N_S_soc_S_i2c_40003000_S_sc18is606_28_S_sc18is606_gpio_P_status_IDX_0 "okay"
#define DT_N_S_soc_S_i2c_40003000_S_sc18is606_28_S_sc18is606_gpio_P_status_IDX_0_EXISTS 1
#define DT_N_S_soc_S_i2c_40003000_S_sc18is606_28_S_sc18is606_gpio_P_status_ENUM_IDX 1
#define DT_N_S_soc_S_i2c_40003000_S_sc18is606_28_S_sc18is606_gpio_P_status_ENUM_VAL_okay_EXISTS 1
#define DT_N_S_soc_S_i2c_40003000_S_sc18is606_28_S_sc18is606_gpio_P_status_ENUM_TOKEN okay
#define DT_N_S_soc_S_i2c_40003000_S_sc18is606_28_S_sc18is606_gpio_P_status_ENUM_UPPER_TOKEN OKAY
#define DT_N_S_soc_S_i2c_40003000_S_sc18is606_28_S_sc18is606_gpio_P_status_FOREACH_PROP_ELEM(fn) fn(DT_N_S_soc_S_i2c_40003000_S_sc18is606_28_S_sc18is606_gpio, status, 0)
#define DT_N_S_soc_S_i2c_40003000_S_sc18is606_28_S_sc18is606_gpio_P_status_FOREACH_PROP_ELEM_SEP(fn, sep) fn(DT_N_S_soc_S_i2c_40003000_S_sc18is606_28_S_sc18is606_gpio, status, 0)
#define DT_N_S_soc_S_i2c_40003000_S_sc18is606_28_S_sc18is606_gpio_P_status_FOREACH_PROP_ELEM_VARGS(fn, ...) fn(DT_N_S_soc_S_i2c_40003000_S_sc18is606_28_S_sc18is606_gpio, status, 0, __VA_ARGS__)
#define DT_N_S_soc_S_i2c_40003000_S_sc18is606_28_S_sc18is606_gpio_P_status_FOREACH_PROP_ELEM_SEP_VARGS(fn, sep, ...) fn(DT_N_S_soc_S_i2c_40003000_S_sc18is606_28_S_sc18is606_gpio, status, 0, __VA_ARGS__)
#define DT_N_S_soc_S_i2c_40003000_S_sc18is606_28_S_sc18is606_gpio_P_status_LEN 1
#define DT_N_S_soc_S_i2c_40003000_S_sc18is606_28_S_sc18is606_gpio_P_status_EXISTS 1

I cannot figure out why it generates the ngpios for a ioexpander on the same bus but not for this device.

For reference here is the dts yaml for the gpio sub-component.

description: GPIO controller part for the SC18IS6060 bridge

compatible: "nxp,sc18is606-gpio"

include: gpio-controller.yaml

properties:
  "#gpio-cells":
    required: true
    const: 2

  ngpios:
    required: true
    const: 8
    description: |
      Number of GPIOs available on port expander.

gpio-cells:
  - pin
  - flags

on-bus: nxp,sc18is606

Is it possible there is a depth limit for device tree properties?  Any other ideas on what i'm doing wrong?

Parents Reply Children
No Data
Related