Need to understand the purpose of <1 0 1 1 1 1 1 1 2> in dts file

if some one have a good knowledge in this section in dts file specially

realtek,extif0 = <1 0 1 1 1 1 1 1 2>;

rtl8367b {
		compatible = "realtek,rtl8367b";
		cpu_port = <5>;
		realtek,extif0 = <1 0 1 1 1 1 1 1 2>;
		mii-bus = <&mdio0>;

pls explain , thanks

@tmomas , in this forum , most of the time , you will talk to yourself only :thinking:

You tend to get the best answers that way :slight_smile:

Anyway. grepping for tthat property in the OpenWrt source shows that it is used by the driver for that rtl8367b device. It's loaded by this function with "name" = " realtek,extif0":

static int rtl8367b_extif_init_of(struct rtl8366_smi *smi, int id,
                                  const char *name)
        struct rtl8367_extif_config *cfg;
        const __be32 *prop;
        int size;
        int err;

        prop = of_get_property(smi->parent->of_node, name, &size);
        if (!prop)
                return rtl8367b_extif_init(smi, id, NULL);

        if (size != (9 * sizeof(*prop))) {
                dev_err(smi->parent, "%s property is invalid\n", name);
                return -EINVAL;

        cfg = kzalloc(sizeof(struct rtl8367_extif_config), GFP_KERNEL);
        if (!cfg)
                return -ENOMEM;

        cfg->txdelay = be32_to_cpup(prop++);
        cfg->rxdelay = be32_to_cpup(prop++);
        cfg->mode = be32_to_cpup(prop++);
        cfg->ability.force_mode = be32_to_cpup(prop++);
        cfg->ability.txpause = be32_to_cpup(prop++);
        cfg->ability.rxpause = be32_to_cpup(prop++);
        cfg-> = be32_to_cpup(prop++);
        cfg->ability.duplex = be32_to_cpup(prop++);
        cfg->ability.speed = be32_to_cpup(prop++);

        err = rtl8367b_extif_init(smi, id, cfg);

        return err;

So the short version is that this is an obscure and proprietary way to set these 9 phy properties. The names in that function should be pretty self-explaining? Each of these should have had a designated self-explaining property in the DTS too. In fact, I believe there are standard properties that could be used.

But this is probably a driver originating from som vendor source, with the strange quirks that follows

1 Like

Thank you for your generosity I got it now :heart_eyes:

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.