From patchwork Tue Dec 29 12:22:52 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 561552 X-Patchwork-Delegate: sjg@chromium.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 97EEE140BB5 for ; Tue, 29 Dec 2015 23:26:53 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=google.com header.i=@google.com header.b=o94xpvHZ; dkim-atps=neutral Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 8698D4BA2E; Tue, 29 Dec 2015 13:25:47 +0100 (CET) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id k8G_8itSUW_X; Tue, 29 Dec 2015 13:25:47 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 41A7E4BA50; Tue, 29 Dec 2015 13:25:43 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 448184B9FD for ; Tue, 29 Dec 2015 13:24:50 +0100 (CET) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ZhGsUYeIoVQt for ; Tue, 29 Dec 2015 13:24:50 +0100 (CET) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from mail-ob0-f170.google.com (mail-ob0-f170.google.com [209.85.214.170]) by theia.denx.de (Postfix) with ESMTPS id 23B544B9F6 for ; Tue, 29 Dec 2015 13:24:26 +0100 (CET) Received: by mail-ob0-f170.google.com with SMTP id wp13so23739680obc.1 for ; Tue, 29 Dec 2015 04:24:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=N8XLw6RxSHvcC7aah5aVshUYtWSFmUtBF6zLbSovM4M=; b=o94xpvHZ8OdEUNKPHMjDjTtbe+lFUUfGRY2D42h8EMlTCggdw3TqEOhskAn2QUIZk7 i0pc5SAVTnnlkRTUqlwWNkAhhjHKbWuLZM95vQPgTKeOosFw2Yfk0ndrf56DkJqKvbA8 cwV8GeK2hQz6nWWtRpIXN1kfZMILnq7426h+aFzWo6PVsun+V28kF6BD+65kThTM2Rro YpVLmf5GYwomNlsQ9EDRUC+3YWWSEzegMvtERlXc7FlJN2EbVx4BmE/qOWfHeQ2WrRip ZDk5FwTC7dOTRSxIiahc8N1Hnr66pjw5/m0IMX4IUMXHDyV8Y55nn8vyt8pi9AX1AYw3 q5ug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=N8XLw6RxSHvcC7aah5aVshUYtWSFmUtBF6zLbSovM4M=; b=gd3ayKv0ioLfemcRIK2rNN8W6Z5brJvF0chxKjGVp1jftl+CbyPw88l77fzoin2138 024c4koVKj1ss0F7fn7FPyo4saDyBSWo9i8OZbKejS2vaa69ZvndMjqolYie85lUMgc5 VaRXP6KiEAf9N70EVRpsXA9BZSxguhUk21WUQq2rqdBpyQlj7iqn6tlQ0g+fhOB6riNh jYe1MT0uOyK/FCoQ87cps0+MZg5UPbc2bJNDwreieYJWkJ1WsEVc/gUPew/Je9SBbLpf uOkE0Ms7+T4JpeLnZfkaUpEZyMU4ZI/iqtneHbdIJVLQzIji1EIfMbRtIrhAmN9UaIQ9 nNiQ== X-Gm-Message-State: ALoCoQmfKmQ/F+JgIUzEqObo6/ENLKUB5jYQM+rHLWNpzU9arZVsIUxbBVJ7iL2P3lDrSFumbDnv6CeuFwBmcLw2oJ42l2CwHg== X-Received: by 10.60.159.198 with SMTP id xe6mr35019799oeb.64.1451391865298; Tue, 29 Dec 2015 04:24:25 -0800 (PST) Received: from kaki.bld.corp.google.com ([172.29.216.32]) by smtp.gmail.com with ESMTPSA id d9sm21420362obf.19.2015.12.29.04.24.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 29 Dec 2015 04:24:22 -0800 (PST) Received: by kaki.bld.corp.google.com (Postfix, from userid 121222) id 722512219A8; Tue, 29 Dec 2015 05:24:14 -0700 (MST) From: Simon Glass To: U-Boot Mailing List Date: Tue, 29 Dec 2015 05:22:52 -0700 Message-Id: <1451391772-6203-11-git-send-email-sjg@chromium.org> X-Mailer: git-send-email 2.6.0.rc2.230.g3dd15c0 In-Reply-To: <1451391772-6203-1-git-send-email-sjg@chromium.org> References: <1451391772-6203-1-git-send-email-sjg@chromium.org> Cc: Jeffy Chen Subject: [U-Boot] [PATCH 10/10] pinctrl: Avoid binding all pinconfig nodes before relocation X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.15 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" 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 --- drivers/pinctrl/pinctrl-uclass.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/pinctrl/pinctrl-uclass.c b/drivers/pinctrl/pinctrl-uclass.c index b5fdcd1..c42b312 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.