From patchwork Mon Sep 3 14:46:52 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jens Wiklander X-Patchwork-Id: 145798 Delivered-To: patches@linaro.org Received: by 2002:a2e:1648:0:0:0:0:0 with SMTP id 8-v6csp2575370ljw; Mon, 3 Sep 2018 07:47:20 -0700 (PDT) X-Received: by 2002:a2e:7113:: with SMTP id m19-v6mr17498237ljc.66.1535986040523; Mon, 03 Sep 2018 07:47:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535986040; cv=none; d=google.com; s=arc-20160816; b=m85eFvsJNuD8vbrA3VzAfB66qkTKFAWKy9quCxP6S+RjZAzwe7Zf9oD4AMDgA3og4k RT7xqkl2yyt0yBK2hEdwt8slA1xJqL41Wr7OM9KvH0jc4MndLBK9VL44RlZ6rNVIQYSi u8tqoYDvX2ag6s0Spk7ulAcGhhPT2N4F2vXBxA6FNI7ZLAoqjON62bkhaLA6Ydvz6mDT mSnWkHT7N5Dnn19YM3vRF5KuFm16poVitOUs3ginJvqt2lPNXEARMNk/69eASp00T4mK 3AoKuFgjyw+F02b/tSrPnbYcaVR+t/hZqRFnEQ62Wp9YSlGrqpmvkpAXUZXvwhWSUXXu 72KA== 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=iQSx05HMMUi4xwXlVR+Lc/rZdgi5IRf7YE6TG4glvE8=; b=qcUWVdGzZQd9qkQw/PZFw/fkQQdkVwXH/RpvVDdha9N0aOjfiF1HGiTeIbhnR2dfpY phgmW54rFcZVSRCVzHVsBmpxbcrm9FOxHkbvl3xUK4i+Wptkdir5Gg789b/x1lEacqpS xdhxyaqqkLcda9a+8S/iA7xD7ScMzkjcYH/CJaP4Hc1lzhUwflP/tLIDus9DRK1MHAgx y9hsSgC6rKeyI57Uu5dw42NFoHZvxeVA6aRu1J6T+3Ms+AOTsBWs05T6CgkWJB6+64Hn AH5gUC0y4VUDY54Oz7wfXgfZdRdW7ZAYlRT3AyBxqSl6cUEcY8sCuQd0AophAAqdByQK 6SfA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=eoWk0O2r; 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 h126-v6sor4184024lfg.22.2018.09.03.07.47.20 for (Google Transport Security); Mon, 03 Sep 2018 07:47:20 -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=eoWk0O2r; 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=iQSx05HMMUi4xwXlVR+Lc/rZdgi5IRf7YE6TG4glvE8=; b=eoWk0O2ra0hW580skXb9KIYU5DkdUDkea23UyGWNiuMl8lQM8A8Piyn1Y3xsrgELo7 a0DXAQPC9LyjaE9+MpWg2r87IAl6IycnL1Yen2bz8hp31MaMFcyoxp2rb4VqcOml1Eit mWW3t7rY0Vb49Vuf3MRI2EiX0Z97lwdfLUFeM= 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=iQSx05HMMUi4xwXlVR+Lc/rZdgi5IRf7YE6TG4glvE8=; b=beqDKB7Sh/kBfzEO3FjipcTdYk3OFz6hoJUw0GK3pNaXV5QNB06IInEfvlMkhHfgNZ d1LIrVKkRC6C2UuEj3Sx7xNOZpyPxeUvWHQRt00qTpnWCjTrrmJGGM0FktqOwEzD3GNQ POglqMQiDNDZL/lSnbDaDqD7IChB7YeXmY5+1NAHP4ZCnps3zmju152W9jjG2RNdPbyi NrD4lYKfb9PGbCPgEIZVzHEU3q8FC6YA2yJ4mQlb0HG8d7OLZE+ApW7SReMcDQk8PCag KAiIdNATPncXqdelSfNRfrlAv17R2zi1dbYeHxDFbIbT3U0Xy3SMVMQ2RAUZTTCnlDNM 8vkQ== X-Gm-Message-State: APzg51A4M1U8Cvk9vQvQnmwJlOZFc2992sll2kBNWdcQDktXnuFlO6Lj OGLqgLWSnjRqs0F0mouHd2kCSGm6 X-Google-Smtp-Source: ANB0Vdb0Y7anrxdlsHhesqYIkbY0k2JSxlfvrfU7YJMfmZRYN4Ah5FfufwUp5Vwyvn3XUAKUh8OkXA== X-Received: by 2002:a19:94c3:: with SMTP id o64-v6mr17730433lfk.70.1535986040235; Mon, 03 Sep 2018 07:47:20 -0700 (PDT) Return-Path: Received: from jax.ideon.se ([85.235.10.227]) by smtp.gmail.com with ESMTPSA id w18-v6sm3343431ljd.73.2018.09.03.07.47.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 03 Sep 2018 07:47:19 -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 v3 01/20] dm: fdt: scan for devices under /firmware too Date: Mon, 3 Sep 2018 16:46:52 +0200 Message-Id: <20180903144711.31585-2-jens.wiklander@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180903144711.31585-1-jens.wiklander@linaro.org> References: <20180903144711.31585-1-jens.wiklander@linaro.org> Just as /chosen may contain devices /firmware may contain devices, scan for devices under /firmware too. Reviewed-by: Simon Glass Signed-off-by: Jens Wiklander --- drivers/core/root.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) -- 2.17.1 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); } }