[U-Boot] Ambiguous regulator node name prefixes

Felix Brack fb at ltec.ch
Fri Sep 22 14:56:26 UTC 2017


Hello,

I'm working on a DM and DT compatible driver for the TI TPS65910 PMIC.
The regulators for this PMIC are defined in arch/arm/dts/tps65910.dtsi
and named 'regulator at 0' through 'regulator at 13'.
Using for example the prefix 'regulator at 1' in pmic_child_info[] will
match to 'regualtor at 1' and 'regulator at 10' through 'regulator at 13'. Hence,
in my case, a BUCK driver instead of a LDO driver will be bound to
regulators 11 through 13 by pmic_bind_children() which is not correct.

Reflecting on the problem I see the following two solutions:
1) rename the nodes in arch/arm/dts/tps65910.dtsi or
2) modify pmic_bind_children()

Solution 1), rename the nodes in arch/arm/dts/tps65910.dtsi.
The nodes in the device tree include file will be renamed allowing
pmic_bind_children() to distinguish them unambiguously.
Pros: - simple and fast
Cons: - file tps65910.dtsi will divert from the LINUX kernel version of
        the same file
      - other device tree source files like am335x-evmsk.dts,
        am335x-icev2.dts and am335x-pxm50.dts will be affected
      - the boards using those device tree source files may also be
        affected
      - the solution is not sustainable as it is kind of fix for the
        problem with the TPS65910 only

Solution 2), modify pmic_bind_children()
Pros: - will eventually help in similar cases with other PMICs
      - does not affect other, existing designs that are using
        pmic_bind_children() as intended since it is implements using
        some fallback strategy
Cons: - modifications to pmic_bind_children() (not really a con)

I personally favor solution 2 and suggest to modify the function
pmic_bind_children() as follows: if it fails to match the prefix against
the node-name it should try to match it against the node property
'regulator-name' before failing. This retains the entire logic of
pmic_bind_children() and should not produce any collateral damage. The
modifications in the device tree source file are made for a specific
board only, i.e. in its dts file and not in some common include (dtsi)
file, hence not affecting other designs.

Any feedback is appreciate before I start the patch.

-- 
Felix


More information about the U-Boot mailing list