From patchwork Thu Aug 23 10:43:20 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jens Wiklander X-Patchwork-Id: 144907 Delivered-To: patches@linaro.org Received: by 2002:a2e:1648:0:0:0:0:0 with SMTP id 8-v6csp30502ljw; Thu, 23 Aug 2018 03:43:42 -0700 (PDT) X-Received: by 2002:a19:3855:: with SMTP id d21-v6mr11917630lfj.24.1535021021983; Thu, 23 Aug 2018 03:43:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535021021; cv=none; d=google.com; s=arc-20160816; b=FtWMlIjoC2ZgbslXJzgNpzm5E/AsdFxpS1roAOzNeHFUdHXuzOceJXFVRvRebm8SUm 0NJKVW6287ecrQSLGB79RARpNRNlTIFxlYW3B76DoA3wTMolx6C6Wk4JCj+J69YANrQV z0/9POesRRevZQXrDOyP3fIaLuxB0OKix58e218t7YyivVpg9suAjEbKr5heq1moSheu /AK3JBzeinSII2CC0VRn5GTuOVvd2VIxKm4Qt7TWPXBwNAHbuMhOW82T6+tW6oRZIqOU qATsdfa3oOCj6ISQRogr1CF9n9YdpsKOtJ+BnYCkC01k1iy3Zd8pY6tv7tps41gIrdBs vYwA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=j+kvqfSyg1CJWcHDhfVVXVXwi2uXT6XpteOIAJqhq6A=; b=yUsFin70bazshU/0YQ6A2x4toY5jpzTP+egn3A1XRwYwdLXKgaNC/Tv3ha8FLueucj WSXFNpNVBXJOZ4nJevxYmU4wMAhqfvgEW15O2rcTO6NgyPZEtwWV8xYR/zcXitB4rce8 OUoA6CU67QE1tzOfrslR9pPAK5wz6kwIuc13ALWc3OetmNVeAuvZUnkPhsu33sqIZEjY Rhqa97D98nWzG1AQmoMu+wCemH38mvGAtswytbj+KzYjgmCN6HQFTlEchshKeMzclrQM hok01yzyriMqHRj4r7OajlVh8sAB9gdGaqCWvAENxXsDV4IItG/1Rc+LRS+JUV/Uh/AG sb7A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=VTtKhsux; spf=pass (google.com: domain of jens.wiklander@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=jens.wiklander@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id g95-v6sor908631ljg.32.2018.08.23.03.43.41 for (Google Transport Security); Thu, 23 Aug 2018 03:43:41 -0700 (PDT) Received-SPF: pass (google.com: domain of jens.wiklander@linaro.org designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=VTtKhsux; spf=pass (google.com: domain of jens.wiklander@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=jens.wiklander@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=j+kvqfSyg1CJWcHDhfVVXVXwi2uXT6XpteOIAJqhq6A=; b=VTtKhsuxLD++TXBUX2hGbfYKnXcBT6v4Ijd2u8Vo+5aWYlZ7IzzRlPdoTMwT7SBOVm To+KSB2rMpPOQm/ex/akFYBWnU/CzD85iASTeBau/X2eeQ3lj1EY2uEsjeRHZe+ZH3ke /9HR5fCUkcKpg0Vd5cl9HW9ovHBvD1DkZVj2I= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=j+kvqfSyg1CJWcHDhfVVXVXwi2uXT6XpteOIAJqhq6A=; b=JZMfuTcTT760l5nKeFqIMgzfAE0N3p8wKye0Z3dhFd+TokC3oJMrLPkdFauQGfA8Ii /yB9yb7RJ3XEdsfY/AuwpJsYoSUWGj3IZunSuRcDZtcJab6NvM1xOqFtwBlfaVSCMbbV OIWkuilZHSnu5DcLvlOzM9XInSDOymX96pMHwTRK2lgXkl5HZrCWnHn4PzjYKX3Pyl1B 4DzD+a9uvIjT0buOwRHMn5kQVRJp26ildoILwNJn5UPpE7vyoerue2OTIzj4sxTaFWPO Hglf+Odg0BFQtH+OEtba8Umef8J34ULqIM9xLQJiy+RROWfaw/MPuZvHTtG+AA2UtdtN pamw== X-Gm-Message-State: AOUpUlEBoWNiz72TYBFvESW0YOttCsJnre3DQaGQQMerp1O/ci15VNRm LaCRMeDXra0VAH1QsXZSg0QHG1Q4 X-Google-Smtp-Source: AA+uWPxyK5JQRixbsexJ9j8wRugRLB1ndRJvVNnpniOKzC8TB5M99wYS5fM2h+Ip5xHS+VeQxLl0ig== X-Received: by 2002:a2e:85d5:: with SMTP id h21-v6mr38762424ljj.103.1535021021797; Thu, 23 Aug 2018 03:43:41 -0700 (PDT) Return-Path: Received: from jax.ideon.se ([85.235.10.227]) by smtp.gmail.com with ESMTPSA id y5-v6sm679771ljj.75.2018.08.23.03.43.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 23 Aug 2018 03:43:41 -0700 (PDT) From: Jens Wiklander To: u-boot@lists.denx.de Cc: Simon Glass , Igor Opaniuk , Tom Rini , Jaehoon Chung , Pierre Aubert , Albert Aribaud , Peter Griffin , Michal Simek , Jens Wiklander Subject: [PATCH v2 01/15] dm: fdt: scan for devices under /firmware too Date: Thu, 23 Aug 2018 12:43:20 +0200 Message-Id: <20180823104334.16083-2-jens.wiklander@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180823104334.16083-1-jens.wiklander@linaro.org> References: <20180823104334.16083-1-jens.wiklander@linaro.org> Just as /chosen may contain devices /firmware may contain devices, scan for devices under /firmware too. Signed-off-by: Jens Wiklander --- drivers/core/root.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) -- 2.17.1 Reviewed-by: Simon Glass diff --git a/drivers/core/root.c b/drivers/core/root.c index 72bcc7d7f2a3..0dca507e1187 100644 --- a/drivers/core/root.c +++ b/drivers/core/root.c @@ -265,9 +265,15 @@ static int dm_scan_fdt_node(struct udevice *parent, const void *blob, for (offset = fdt_first_subnode(blob, offset); offset > 0; offset = fdt_next_subnode(blob, offset)) { - /* "chosen" node isn't a device itself but may contain some: */ - if (!strcmp(fdt_get_name(blob, offset, NULL), "chosen")) { - pr_debug("parsing subnodes of \"chosen\"\n"); + const char *node_name = fdt_get_name(blob, offset, NULL); + + /* + * The "chosen" and "firmware" nodes aren't devices + * themselves but may contain some: + */ + if (!strcmp(node_name, "chosen") || + !strcmp(node_name, "firmware")) { + pr_debug("parsing subnodes of \"%s\"\n", node_name); err = dm_scan_fdt_node(parent, blob, offset, pre_reloc_only); @@ -286,8 +292,7 @@ static int dm_scan_fdt_node(struct udevice *parent, const void *blob, err = lists_bind_fdt(parent, offset_to_ofnode(offset), NULL); if (err && !ret) { ret = err; - debug("%s: ret=%d\n", fdt_get_name(blob, offset, NULL), - ret); + debug("%s: ret=%d\n", node_name, ret); } }