summaryrefslogtreecommitdiff
path: root/drivers/pinctrl
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2015-12-29 05:22:52 -0700
committerSimon Glass <sjg@chromium.org>2016-01-20 19:06:22 -0700
commit5589a8182957054f8ac4ec3d91492710e718e44d (patch)
tree206a385c799c38cc3328281e2529b24acb26b13f /drivers/pinctrl
parent4fbd258e69373a60cdf24c9a64065b486f8748c9 (diff)
pinctrl: Avoid binding all pinconfig nodes before relocation
This can create a large number of pinctrl devices. It chews up early malloc() memory and takes time. Only bind those which are marked as needed before relocation. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'drivers/pinctrl')
-rw-r--r--drivers/pinctrl/pinctrl-uclass.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/pinctrl/pinctrl-uclass.c b/drivers/pinctrl/pinctrl-uclass.c
index b5fdcd12a8..c42b312ddd 100644
--- a/drivers/pinctrl/pinctrl-uclass.c
+++ b/drivers/pinctrl/pinctrl-uclass.c
@@ -111,12 +111,16 @@ static int pinconfig_post_bind(struct udevice *dev)
{
const void *fdt = gd->fdt_blob;
int offset = dev->of_offset;
+ bool pre_reloc_only = !(gd->flags & GD_FLG_RELOC);
const char *name;
int ret;
for (offset = fdt_first_subnode(fdt, offset);
offset > 0;
offset = fdt_next_subnode(fdt, offset)) {
+ if (pre_reloc_only &&
+ !fdt_getprop(fdt, offset, "u-boot,dm-pre-reloc", NULL))
+ continue;
/*
* If this node has "compatible" property, this is not
* a pin configuration node, but a normal device. skip.