From patchwork Fri Jan 8 08:41:20 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 358927 Delivered-To: patch@linaro.org Received: by 2002:a17:906:4755:0:0:0:0 with SMTP id j21csp153257ejs; Fri, 8 Jan 2021 00:43:35 -0800 (PST) X-Google-Smtp-Source: ABdhPJyU6AMGa68m3swaersAi3VVB2s08HPXmsYQajUlMBI5H/iBaOHKlO+5oT6iENyy4HYWY+D/ X-Received: by 2002:a05:6402:610:: with SMTP id n16mr4436364edv.172.1610095415251; Fri, 08 Jan 2021 00:43:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610095415; cv=none; d=google.com; s=arc-20160816; b=cHmDWzSE07dVK783PytevhllGFw1psRmVV95q8wB/WIhkpaUpttuaZGwvzobwO8ion FTNqXJ6RLrOsZMzHbZqVoGinU9EjHpFko+XTEvbh57ve6bmiN7EC1HPzb8ecYmn1wet5 acdBgF1on+Sn0q7p/VWqoMwqTs5kzt2GMKa9uI5LG/trMDDqZFWKTBBJeoQqEUIqCI80 Rw25W/JcCCtcLZ4f0XU4u1j83VH6/Ixshpe79MRRWvU1V0vPvW64QVApZseLEWqheaRx PVPia10Aaa21NkVyb0VA7X1zzSUUjGs0cHzsEalHgyH+T8PrrN3iGVdnFaTKTDXUwAsg AXHg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=5YW50Ah03cn2qpITNLfaRsXD4PDGBQyXlcG2G1/LKtg=; b=WHlME5v0O6JRiwapiUsmN5aa3qAJeEiPYM0grhnFh4e+9GUSDR0B6Kr8uh8RvflVUS /wHFI0kFVdnyxJw32v6GNxkFgzGVSsm+j3Y2xrVhQtzOyjmBdknZ+f3pxJTIN4mhDONB 4M+Zh9nhKx8F+bwougsnkSCILXpA0IYYd+jU/cHJQummdvxOqmvYNPMH0toMtyULLN4T 5Jdg2hBOEOtfn1MUWNLMK8sbdjhv+ckCCkXPQ59Cy2GR8P/LH4ik0tV0tQkwluUu5imy n/rZiJfZ9Mw53E1VKBjnj17udKbh2PIFI591ZrlIf1Xe6hcVdHpPEsIYSVedGOvN1aGa kFbw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=CvsP4jxX; spf=pass (google.com: domain of devicetree-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y12si3329842ejw.561.2021.01.08.00.43.35; Fri, 08 Jan 2021 00:43:35 -0800 (PST) Received-SPF: pass (google.com: domain of devicetree-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=CvsP4jxX; spf=pass (google.com: domain of devicetree-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727741AbhAHImN (ORCPT + 6 others); Fri, 8 Jan 2021 03:42:13 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57372 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725816AbhAHImN (ORCPT ); Fri, 8 Jan 2021 03:42:13 -0500 Received: from mail-pl1-x630.google.com (mail-pl1-x630.google.com [IPv6:2607:f8b0:4864:20::630]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BE78AC0612F4 for ; Fri, 8 Jan 2021 00:41:32 -0800 (PST) Received: by mail-pl1-x630.google.com with SMTP id r4so5295753pls.11 for ; Fri, 08 Jan 2021 00:41:32 -0800 (PST) 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 :mime-version:content-transfer-encoding; bh=5YW50Ah03cn2qpITNLfaRsXD4PDGBQyXlcG2G1/LKtg=; b=CvsP4jxX8IdJOfZqoADc6APWHfTrnbb4YDQ8/D9XHeFZTvFrPC6BQURCTw8A/MdFxt xwxrQX9aGXqNpW5FDCmpb4h/2txCkELIINMpfXkv7JfnJDd60a1Jcij7JMpEVQdjBmOE R0ylNEbBYp9Uiyey3dutCWTdpGHPulnnNdHy3rkUJgu8U0nwB9aziLcqODRoIccQjHtM xFLL3OYcjF0ZP3unUG8fmK3XL0DxqfoE1dR0k2k5VdpRWMSvYz7tO1QYBhRee7UMdljP Coz4z0j8lBzMuoaX/h/LDHeXxqcC9B9qenOEfovKY8FPeW15E0rbhMHRH1fBxLhdzCIj V/kg== 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:mime-version:content-transfer-encoding; bh=5YW50Ah03cn2qpITNLfaRsXD4PDGBQyXlcG2G1/LKtg=; b=O6PMmQ1JUIYY0n7s6oTcKbnAW0wJV+XowmJiz3GEbxK7h5se8C8uvVWAZ6BlBA5qOO FuexoHeoS6cDDzHzrPpL1s3oRVxlMr+qZEhzwgzaRFD7o60MA+VZzDH5U+I0MkgFmcsJ FR1aMpSJC75dmKdIKXHeC5OS7sgIrsm7g9LqMSoDbawqEU3P6Q/w6R3Zw0zDAD492hJL ZswuegtmwzHzKGJbL+b45SJs5Zkxlp4jxVm9QFXBeb9/qcTYosRQrWY8O3WujMVPCJEs ZSpXP/cWXlvhbhbpruSlRnhw5xWirwRtXe1FYAk/ZBikwGSlNZPRYNogja2bTbL1qsL6 xfHg== X-Gm-Message-State: AOAM530kn2wEZjSyBg22B6ieBNay/wEoQCO09P9eRnBAdrzqcdzebTDr qRnRcA5ySATnMVf6XXII1mbfRg== X-Received: by 2002:a17:90a:450c:: with SMTP id u12mr2715278pjg.93.1610095292255; Fri, 08 Jan 2021 00:41:32 -0800 (PST) Received: from localhost ([122.172.20.109]) by smtp.gmail.com with ESMTPSA id m15sm8393768pfa.72.2021.01.08.00.41.30 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 08 Jan 2021 00:41:31 -0800 (PST) From: Viresh Kumar To: Pantelis Antoniou , Frank Rowand , Rob Herring Cc: Viresh Kumar , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kbuild@vger.kernel.org, Vincent Guittot , Bill Mills , anmar.oueja@linaro.org, Masahiro Yamada Subject: [PATCH] of: unittest: Statically apply overlays using fdtoverlay Date: Fri, 8 Jan 2021 14:11:20 +0530 Message-Id: <1e42183ccafa1afba33b3e79a4e3efd3329fd133.1610095159.git.viresh.kumar@linaro.org> X-Mailer: git-send-email 2.25.0.rc1.19.g042ed3e048af In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Now that fdtoverlay is part of the kernel build, start using it to test the unitest overlays we have by applying them statically. The file overlay_base.dtb have symbols of its own and we need to apply overlay.dtb to overlay_base.dtb alone first to make it work, which gives us intermediate-overlay.dtb file. The intermediate-overlay.dtb file along with all other overlays is them applied to testcases.dtb to generate the master.dtb file. Signed-off-by: Viresh Kumar --- Depends on: https://lore.kernel.org/lkml/be5cb12a68d9ac2c35ad9dd50d6b168f7cad6837.1609996381.git.viresh.kumar@linaro.org/ I have kept the .dtb naming for overlays for now, lets see how we do it eventually. Rob/Frank, this doesn't work properly right now. Maybe I missed how these overlays must be applied or there is a bug in fdtoverlay. The master.dtb doesn't include any nodes from overlay_base.dtb or overlay.dtb probably because 'testcase-data-2' node isn't present in testcases.dtb and fdtoverlay doesn't allow applying new nodes to the root node, i.e. allows new sub-nodes once it gets phandle to the parent but nothing can be added to the root node itself. Though I get a feel that it works while applying the nodes dynamically and it is expected to work here as well. (And yeah, this is my first serious attempt at updating Makefiles, I am sure there is a scope of improvement here :)) --- drivers/of/unittest-data/Makefile | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) -- 2.25.0.rc1.19.g042ed3e048af diff --git a/drivers/of/unittest-data/Makefile b/drivers/of/unittest-data/Makefile index 009f4045c8e4..f17bce85f65f 100644 --- a/drivers/of/unittest-data/Makefile +++ b/drivers/of/unittest-data/Makefile @@ -38,3 +38,26 @@ DTC_FLAGS_testcases += -@ # suppress warnings about intentional errors DTC_FLAGS_testcases += -Wno-interrupts_property + +# Apply overlays statically with fdtoverlay +intermediate-overlay := overlay.dtb +master := overlay_0.dtb overlay_1.dtb overlay_2.dtb \ + overlay_3.dtb overlay_4.dtb overlay_5.dtb \ + overlay_6.dtb overlay_7.dtb overlay_8.dtb \ + overlay_9.dtb overlay_10.dtb overlay_11.dtb \ + overlay_12.dtb overlay_13.dtb overlay_15.dtb \ + overlay_gpio_01.dtb overlay_gpio_02a.dtb \ + overlay_gpio_02b.dtb overlay_gpio_03.dtb \ + overlay_gpio_04a.dtb overlay_gpio_04b.dtb \ + intermediate-overlay.dtb + +quiet_cmd_fdtoverlay = fdtoverlay $@ + cmd_fdtoverlay = $(objtree)/scripts/dtc/fdtoverlay -o $@ -i $^ + +$(obj)/intermediate-overlay.dtb: $(obj)/overlay_base.dtb $(addprefix $(obj)/,$(intermediate-overlay)) + $(call if_changed,fdtoverlay) + +$(obj)/master.dtb: $(obj)/testcases.dtb $(addprefix $(obj)/,$(master)) + $(call if_changed,fdtoverlay) + +always-$(CONFIG_OF_OVERLAY) += intermediate-overlay.dtb master.dtb