dm: pinctrl: Prevent (re-)configuring pins when already done before relocation
authorLukasz Majewski <lukma@denx.de>
Tue, 18 Dec 2018 11:30:50 +0000 (12:30 +0100)
committerTom Rini <trini@konsulko.com>
Thu, 27 Dec 2018 02:21:07 +0000 (21:21 -0500)
This commit prevents from re-configuring pins if those were configured
before relocation.

Some pins - like UART or DDR must be setup before relocation
(as they have 'u-boot,dm-pre-reloc' property set in DTS). Without this
change, those pins are re-configured after relocation (pre_reloc_only = 0,
so we do not "continue").
Such behavior may be a problem for DDR PAD configuration, as they might
be already leveled/tuned with original setup).

Signed-off-by: Lukasz Majewski <lukma@denx.de>
drivers/pinctrl/pinctrl-uclass.c

index 6db0445..29c910c 100644 (file)
@@ -117,9 +117,9 @@ static int pinconfig_post_bind(struct udevice *dev)
        int ret;
 
        dev_for_each_subnode(node, dev) {
-               if (pre_reloc_only &&
-                   !ofnode_pre_reloc(node))
+               if (pre_reloc_only ^ ofnode_pre_reloc(node))
                        continue;
+
                /*
                 * If this node has "compatible" property, this is not
                 * a pin configuration node, but a normal device. skip.