From patchwork Fri Jan 29 07:24:05 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 373279 Delivered-To: patch@linaro.org Received: by 2002:a02:a60d:0:0:0:0:0 with SMTP id c13csp1953319jam; Thu, 28 Jan 2021 23:29:34 -0800 (PST) X-Google-Smtp-Source: ABdhPJzvnMXVRhTcrf2LD+BUjwTx7ED4tjTU+n+Xy+/n364sei6lugIBr7T/4FZX86xJJH5f4u+K X-Received: by 2002:a17:906:7e42:: with SMTP id z2mr3210892ejr.177.1611905374344; Thu, 28 Jan 2021 23:29:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611905374; cv=none; d=google.com; s=arc-20160816; b=D5V4YQDEhHq6YQWaUM0Ix02FNXAnMvbq7KAVN7sXBON/sVSkwiL6b0DdQCGUdHlEZ+ 7GTzVSVILHiLkkCFDcPZXGcG60DAbBHhKBpQTVdk12KVbajjae9K7fCU9FCi7D1f307O 3UhK01dtZ7WCG7CLBAn8lOFJXij6RmlUU3XeR0W1fW8TIJZYrAgg2XYOg3FodsKrFvb3 bX4LFkgjU+9CdWKr8kgmCb79+nLmA+F6fPx03V02TmWdLeAoTvcBq7CfnI5UuaxQPpZn HQhEha6e/eQyQUvBG6vg5vCDUCOh/OrpctIjvzraIa3+OEbHqb5u3gqHPrQyMz6+H+h8 AHrA== 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=PYJHN29z38YJQy9+aRfXhxK7SVaDLVhX0WgONtRAors=; b=qeCfhIZaB9qIrZQyyo/eSZhxgZuuJGF4wyvlCSgUtibzcpcxgJBDf8g0r0+4iRH7aF K76OUDoSjRHn6l/JrDwJmgmOMsdaBFTAaAfhWOJIb5URLaTQdVyVcgv+BLPrjHABx+gt PNqSoJjDpghOUHqlpg6Wcm8Jd3AaHzGcVlfjdouXPx9XGJ1vpLtdRWg2+rM4DGsb73+4 GbHVFraUIqZZEW6GGgg/ysLNP16ZEe4ruhPBGU0SI3joV5wC0/Mv8Zxa0Xa0wKJckOpx qd0FUwtcoq8d4PM8PTVKLQw+LAUqdQbl0FJB1s3zr9QMw7L5WpzbPV6BrfMy22OkUJM5 uzIw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=yU7MgniE; 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 v5si4670712eda.107.2021.01.28.23.29.34; Thu, 28 Jan 2021 23:29:34 -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=yU7MgniE; 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 S232200AbhA2H2S (ORCPT + 6 others); Fri, 29 Jan 2021 02:28:18 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35438 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231926AbhA2H2Q (ORCPT ); Fri, 29 Jan 2021 02:28:16 -0500 Received: from mail-pl1-x62d.google.com (mail-pl1-x62d.google.com [IPv6:2607:f8b0:4864:20::62d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 245A3C061756 for ; Thu, 28 Jan 2021 23:27:36 -0800 (PST) Received: by mail-pl1-x62d.google.com with SMTP id u11so4751399plg.13 for ; Thu, 28 Jan 2021 23:27:36 -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=PYJHN29z38YJQy9+aRfXhxK7SVaDLVhX0WgONtRAors=; b=yU7MgniEnfF9zCaYCDMrurU7l+NtPr041utDGm17Pg5UIy3s5OGmry2lc8O29PJmT2 LVX5bNWr3SeXgrQQt2zy40u4iO/yYn/yBy4oBbIpholxrlpaKjCl14vM7Wt+It4ip2sO 2/EbYlvkfSWhF1Qo+CXfXBQEDd5xyR39ZYqaYzb4Z0fdOVBqXppSBEQkf8HD7TG7D6Zu LXPXITbgqPsJtiXb9mNcVFG6w/GkRS5rw0AL+VGfBTshjiJix9WcbmzhtyrnpQDKNOw2 1pYbKPpLDjojhi2zFLNqORo+babfbQdNoiNcbBqbJherujYjpWMmXFN5dYl1tzKN7Cxg XT4A== 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=PYJHN29z38YJQy9+aRfXhxK7SVaDLVhX0WgONtRAors=; b=Hj/USMzSSncwkQpZoGDzczhpolG1ESfCjMX87lBNxl0Av38U8hKWauvZpDuo2O/2b6 cZC8Qx7vlFb/VUPSI9Hg4uJKuVFOAqmuZQ8pukrYyCkPybqEVLVkiB/b1373Ia4oGRqh liFqY0kqFYOnPLp+Q4k7NoircqZnO0sxMp8eRXM53v9ym1HbCPimW9JEkCDAmR27kF1v 7jbs7hDUECRQBb0J0nFJVPyR3C9wrBOq9YhYnSEYM0qGfZbSqcjWdg6PQnFt12wTID53 09frE7V4hRxwd2pdkzieZlTpL3g2hBy5+VScF5E+v5Y9+Guzp7M8cK0WNY/VfGK512fD O1ag== X-Gm-Message-State: AOAM532OFcyoSbJBAUWahXfekhQNdJFmmSNIyn9NUPtSgC/HwIr82oiN /qJ93JTuYtAqECLcAiZWlW4c5w== X-Received: by 2002:a17:90a:dc01:: with SMTP id i1mr3192662pjv.134.1611905255766; Thu, 28 Jan 2021 23:27:35 -0800 (PST) Received: from localhost ([122.172.59.240]) by smtp.gmail.com with ESMTPSA id v31sm8494685pgl.76.2021.01.28.23.27.34 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 28 Jan 2021 23:27:35 -0800 (PST) From: Viresh Kumar To: Frank Rowand , Rob Herring , Pantelis Antoniou , Masahiro Yamada Cc: Viresh Kumar , Vincent Guittot , linux-kernel@vger.kernel.org, anmar.oueja@linaro.org, Bill Mills , David Gibson , devicetree@vger.kernel.org, Michal Marek Subject: [PATCH V7 1/6] scripts: dtc: Fetch fdtoverlay.c from external DTC project Date: Fri, 29 Jan 2021 12:54:05 +0530 Message-Id: <28f66f70602225bb6aeb58e924c20bde9d864327.1611904394.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 We will start building overlays for platforms soon in the kernel and would need fdtoverlay tool going forward. Lets start fetching it. Signed-off-by: Viresh Kumar --- scripts/dtc/update-dtc-source.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) -- 2.25.0.rc1.19.g042ed3e048af diff --git a/scripts/dtc/update-dtc-source.sh b/scripts/dtc/update-dtc-source.sh index bc704e2a6a4a..32ff17ffd089 100755 --- a/scripts/dtc/update-dtc-source.sh +++ b/scripts/dtc/update-dtc-source.sh @@ -37,6 +37,7 @@ DTC_SOURCE="checks.c data.c dtc.c dtc.h flattree.c fstree.c livetree.c srcpos.c LIBFDT_SOURCE="fdt.c fdt.h fdt_addresses.c fdt_empty_tree.c \ fdt_overlay.c fdt_ro.c fdt_rw.c fdt_strerror.c fdt_sw.c \ fdt_wip.c libfdt.h libfdt_env.h libfdt_internal.h" +FDTOVERLAY_SOURCE=fdtoverlay.c get_last_dtc_version() { git log --oneline scripts/dtc/ | grep 'upstream' | head -1 | sed -e 's/^.* \(.*\)/\1/' @@ -54,7 +55,7 @@ dtc_log=$(git log --oneline ${last_dtc_ver}..) # Copy the files into the Linux tree cd $DTC_LINUX_PATH -for f in $DTC_SOURCE; do +for f in $DTC_SOURCE $FDTOVERLAY_SOURCE; do cp ${DTC_UPSTREAM_PATH}/${f} ${f} git add ${f} done From patchwork Fri Jan 29 07:24:06 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 373280 Delivered-To: patch@linaro.org Received: by 2002:a02:a60d:0:0:0:0:0 with SMTP id c13csp1953329jam; Thu, 28 Jan 2021 23:29:35 -0800 (PST) X-Google-Smtp-Source: ABdhPJxcgEdW4ybQ6pQkB1DhsXLFOUn+wE1kqo5OsdjyauFxDzsWlzCAsrLZZMj+AZmKnxsAXSr1 X-Received: by 2002:a17:906:b41:: with SMTP id v1mr3243510ejg.277.1611905375237; Thu, 28 Jan 2021 23:29:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611905375; cv=none; d=google.com; s=arc-20160816; b=0UVt90tB6lrelm8EoZ0KeuTCoc0woGifvBKYu3mE521e4T9yb7cl08hlnHOuLjuPLE LCyl88gqVKknf60Li5Pcas5P3SD+PNxetcjBv4RFLQv/7a4YhaGR/l+CnSaE1QDX2u03 nEnxi796C5E2xpnL4jQEs88irOtgflmqVIXnIQ89ZXSliYDBA7uSS8ylFrRWTqfZRBid MNVFq5e8cc5oCpTH70ODjgODODMg0IibeLfLUVqYiIMJ9HZ/V6Z7s24zan7pGBp4xfJB fj0RJZy1qRe86cjRi98/NUHiYTCXlM7/dsWmbtnuikXSdi522rb09X2EzMYEIQGbjGNb DOoA== 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=OeN9gKBBM/q6ukcOgQJMkKFDzkcULPM9HldUw032FnY=; b=HtadF0twRet5VI+L1a8/k+morEXh2yeK1A3WI45zZyTIK8n3LG7oPDZVTjVxuUBbm+ O6qtyH0a8UXhAa2FGOueRCs+CRgsJd4ENK8MMMuvvjetBHJkSbDoHLjGoSdRnSxC8+L/ tSxmmmZ0P5yCt8Li+3Kifwy3Kr2EjiPNrEsm2TCtluwCRodqfCqrzK9fpe4PNdehDyq/ 9EJ4CQJ+73JLIFerjVMdFaAVzLUVOLNjLPWiB/ILci4aljHchsSv519k19qY6/5TOUXN RKa9MsWDRt36W5tKOLF0xQQuINN8qP3fTC76aud7BUy4VfO9pES5+zE5UeU9o/2reDoc iqhA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=pI+dfoj3; 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 v5si4670712eda.107.2021.01.28.23.29.35; Thu, 28 Jan 2021 23:29: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=pI+dfoj3; 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 S232221AbhA2H2y (ORCPT + 6 others); Fri, 29 Jan 2021 02:28:54 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35574 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231981AbhA2H2x (ORCPT ); Fri, 29 Jan 2021 02:28:53 -0500 Received: from mail-pl1-x634.google.com (mail-pl1-x634.google.com [IPv6:2607:f8b0:4864:20::634]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 42CB1C0613ED for ; Thu, 28 Jan 2021 23:27:39 -0800 (PST) Received: by mail-pl1-x634.google.com with SMTP id b17so4772379plz.6 for ; Thu, 28 Jan 2021 23:27:39 -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=OeN9gKBBM/q6ukcOgQJMkKFDzkcULPM9HldUw032FnY=; b=pI+dfoj3vbIoNcfLsrCmQQebn2SGwolZ8tjzCiTRGKAwwDE5Xs45A2wFFQF12m+Eus 7ohAKzLK85IDFK5UPhdtE2GqbwR78IpQf6FKcTh8sCU/zQdcsiMA0byPRsjXRdDI/zOA 7yCuxaOuEF1Siu7f4Z7T6+bt+fZYZIIOwGIGfItJrRg5B3purFjXVcRVp1t/DuwKRhlM 1HSj3MGNSd7Rw9p94fr0QGkDpY9ZgA5C/45kdd0fQ5copfwm/uxGKN1WJqd6wxrboaj2 tJLzLKDYqMGTbshdtS6cjx0PbdjhSyZReDp3xjjvFi2cZEKVLsKs6wHgggD8dVnQEZl2 qZ+A== 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=OeN9gKBBM/q6ukcOgQJMkKFDzkcULPM9HldUw032FnY=; b=he9wDkSA56StplC7GELWIxOkHZicnN+uYzYkVjD8sBr3Ozv29taoJLUm/bFuBvlsYq yXIIYKdlXErVhyskqagl66r9e9aVfwt61DicPfcjHCbECb7tD3Fsr2UFkMMMmoXKOVph /16UIwEDF6GbJvhmjwQOUHw0LPAof7FbEMYzn6/F8LBQhpLGnsviXOLsWgKCmpQrfGtB bsemQnXzw57F1fia1flM7fLx2qQCR8ZZpD0lW2sD3WE1kKzUsCYALpb5zOaOjbJLdYCY OPLvEfIkoT1oARKn79kq4sonmIT/WmfkTzY7i9fu6x7UwStnZar+b57hmxIRZ8pvexgW ml/w== X-Gm-Message-State: AOAM531xkIrNXPqUn0qW2wRnycwgEXoOFY5zYSDH2r5nMiCE14xRM9dX 3HsGUKrs8Om/VC55AcovMxmzQQ== X-Received: by 2002:a17:902:744b:b029:e1:2169:6272 with SMTP id e11-20020a170902744bb02900e121696272mr1847825plt.35.1611905258844; Thu, 28 Jan 2021 23:27:38 -0800 (PST) Received: from localhost ([122.172.59.240]) by smtp.gmail.com with ESMTPSA id m4sm8135093pfa.53.2021.01.28.23.27.37 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 28 Jan 2021 23:27:38 -0800 (PST) From: Viresh Kumar To: Frank Rowand , Rob Herring , Pantelis Antoniou , Masahiro Yamada Cc: Viresh Kumar , Vincent Guittot , linux-kernel@vger.kernel.org, anmar.oueja@linaro.org, Bill Mills , David Gibson , devicetree@vger.kernel.org, Michal Marek Subject: [PATCH V7 2/6] scripts: dtc: Build fdtoverlay tool Date: Fri, 29 Jan 2021 12:54:06 +0530 Message-Id: <4a201dea3ba11a00cab7e936dfc1140dac1a1ae3.1611904394.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 We will start building overlays for platforms soon in the kernel and would need fdtoverlay going forward. Lets start building it. The fdtoverlay program applies one or more overlay dtb blobs to a base dtb blob. The kernel build system would later use fdtoverlay to generate the overlaid blobs based on platform specific configurations. Signed-off-by: Viresh Kumar --- scripts/dtc/Makefile | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) -- 2.25.0.rc1.19.g042ed3e048af diff --git a/scripts/dtc/Makefile b/scripts/dtc/Makefile index 4852bf44e913..c8c21e0f2531 100644 --- a/scripts/dtc/Makefile +++ b/scripts/dtc/Makefile @@ -1,13 +1,19 @@ # SPDX-License-Identifier: GPL-2.0 # scripts/dtc makefile -hostprogs-always-$(CONFIG_DTC) += dtc +hostprogs-always-$(CONFIG_DTC) += dtc fdtoverlay hostprogs-always-$(CHECK_DT_BINDING) += dtc dtc-objs := dtc.o flattree.o fstree.o data.o livetree.o treesource.o \ srcpos.o checks.o util.o dtc-objs += dtc-lexer.lex.o dtc-parser.tab.o +# The upstream project builds libfdt as a separate library. We are choosing to +# instead directly link the libfdt object files into fdtoverlay. +libfdt-objs := fdt.o fdt_ro.o fdt_wip.o fdt_sw.o fdt_rw.o fdt_strerror.o fdt_empty_tree.o fdt_addresses.o fdt_overlay.o +libfdt = $(addprefix libfdt/,$(libfdt-objs)) +fdtoverlay-objs := $(libfdt) fdtoverlay.o util.o + # Source files need to get at the userspace version of libfdt_env.h to compile HOST_EXTRACFLAGS += -I $(srctree)/$(src)/libfdt From patchwork Fri Jan 29 07:24:07 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 373281 Delivered-To: patch@linaro.org Received: by 2002:a02:a60d:0:0:0:0:0 with SMTP id c13csp1953336jam; Thu, 28 Jan 2021 23:29:35 -0800 (PST) X-Google-Smtp-Source: ABdhPJwNSaIQCESwdyAY0aN5VTyWw1x4jyrMPwMSKBLLk6AfsZTbTHdKGPAsRXnJMwr+6VWux+vu X-Received: by 2002:a05:6402:160f:: with SMTP id f15mr3669228edv.348.1611905375652; Thu, 28 Jan 2021 23:29:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611905375; cv=none; d=google.com; s=arc-20160816; b=tgaXo/EuKAAwmJoftzgF3wZoUmpWk5/Q1cG1ytI/gPwmmtdPOfigNgGwUpzxrtdHA9 msQUMcBxhyyRAzJ5id3pAtW0ePN1TCWUPMP8+unYVUZTHyOb4eemHgDY4IAdo98HxfWR OApYbVgOAJ/sZsc2H69moG1dSL+pkETwsr7eBAIipyntWaxSoYpq+hLbCAUD1zCoY6W8 qsmgl+HQP0cTkBOEP3SDaKkKO1n8XJ0T+t/bjzMgmJX/165xNGnQviKHy/e2THKrS6Dd bZIrX1l6hWNXrurY0bL+781hZQ3KZdHxQkp6dMjefsnxIoOdRZyPKyaQ6P4L33EN3a0r yzBg== 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=9FnCdmEEGSQX+RKqefc8hvZ3CGNJpcGjSObBIm4DdhU=; b=Cv4Jw2Bz6LtpS3feRKbh7utsvjEYTHlRlcivbT/5qDQc3xzT0+T+MriFa/tYljSaYs qXdDPchKIwE4oL0YUUXMmv0D5hThhFszl68YMX5DIKMc0FkscMohW4YvkZZE5JROBXI6 SAfFBI8Ln9IgQGTVRN/RgzV6tV0VsybsJEqKtS9wtfoHwIFTYdIX7WjquAf8jLsURmKL d9jQl5BapUVUsRbxF0wUAZER53UbwLxBaeHdwg8B7fbafqV91Uwn5iK3dO09bPuFMp9X iDzy+WpjjTy6JG6io/4fuBmCsMARSCnPtnUQJC5El+TqUvImVb1pLoFhwkzfXf0JKOLY HtPQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=kB035kve; 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 v5si4670712eda.107.2021.01.28.23.29.35; Thu, 28 Jan 2021 23:29: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=kB035kve; 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 S232231AbhA2H24 (ORCPT + 6 others); Fri, 29 Jan 2021 02:28:56 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35578 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230121AbhA2H2y (ORCPT ); Fri, 29 Jan 2021 02:28:54 -0500 Received: from mail-pf1-x42f.google.com (mail-pf1-x42f.google.com [IPv6:2607:f8b0:4864:20::42f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 68D70C061788 for ; Thu, 28 Jan 2021 23:27:42 -0800 (PST) Received: by mail-pf1-x42f.google.com with SMTP id u67so5689250pfb.3 for ; Thu, 28 Jan 2021 23:27:42 -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=9FnCdmEEGSQX+RKqefc8hvZ3CGNJpcGjSObBIm4DdhU=; b=kB035kveINWMK1eljsuEccoJ3ic19ZxI7tiMmeiP7i37vALoC/3KgMKq/kQy2QlvWf X+d17ixF4ZgIBLA5r8nWE8/s6hqQ7JP0OlRlk1htHDbFIoezIh3H7krCaB77usN4KckB Zm5eL3NrKVoiODQtGZvoaXBfSs/eYA0i3fYZyqazBWQfQea2dr58YYcZmb3XT3okLWE+ 5rbV2J913GrOeWHvZMb9gkM+z/QyYXx72rII5Ssuc+k2jLaCy4ysSQ+Oo3DrkzOrkfdV wSEvDpdAHfgw1Qwq7+3xx4sf0lnKTfH5vRh/DG+O030g/nXNHAAKl5xUWItdSrxst7e4 CUjw== 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=9FnCdmEEGSQX+RKqefc8hvZ3CGNJpcGjSObBIm4DdhU=; b=Py/mL+yMPyRfMncVH1tbxvS1d5AT1sst5IpVk0vu2wm9M3tEcafPMWmIucXAIwIqHj D/kOorY5epDTUTsZqsE/ffw1eEP+bIrNIr871C3gYaC0WI8kgrZ9m71kxLX78YOilPih 2nG9QjaD7gQ30vatHcePqr8coZWzXdqYInzYP+gMEegy+J1bLrnYgIxqZAyPx9wNwteg 3wtIjcB61uycuzKedn4HfSaao78IaPmXc7cTec38UnGG0jtjfUNntNrV/1L3W7VzCQRm gJD9G3UyGFixmfSnYe4ERAK8J4jpBr+kMN3a4kdT6muK5UepRPgX/PsmtiZYHsRHo6fz SxoQ== X-Gm-Message-State: AOAM5309qreyD3C/1ZcEOPDEexT6QtAG1HKn1X2tRjqyp8/WFzBdOHMO htlKYwmIqw5ffU/leIpomQaqbA== X-Received: by 2002:a63:3c7:: with SMTP id 190mr3428325pgd.207.1611905261956; Thu, 28 Jan 2021 23:27:41 -0800 (PST) Received: from localhost ([122.172.59.240]) by smtp.gmail.com with ESMTPSA id j7sm8058310pfh.147.2021.01.28.23.27.40 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 28 Jan 2021 23:27:41 -0800 (PST) From: Viresh Kumar To: Frank Rowand , Rob Herring , Pantelis Antoniou , Masahiro Yamada Cc: Viresh Kumar , Vincent Guittot , linux-kernel@vger.kernel.org, anmar.oueja@linaro.org, Bill Mills , David Gibson , devicetree@vger.kernel.org, Michal Marek Subject: [PATCH V7 3/6] scripts: dtc: Remove the unused fdtdump.c file Date: Fri, 29 Jan 2021 12:54:07 +0530 Message-Id: <7ea1a9e7fd5d75b7adfc2a4c40dde2d4ea3fddf8.1611904394.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 This was copied from external DTC repository long back and isn't used anymore. Over that the dtc tool can be used to generate the dts source back from the dtb. Remove the unused fdtdump.c file. Signed-off-by: Viresh Kumar --- scripts/dtc/fdtdump.c | 163 ------------------------------------------ 1 file changed, 163 deletions(-) delete mode 100644 scripts/dtc/fdtdump.c -- 2.25.0.rc1.19.g042ed3e048af diff --git a/scripts/dtc/fdtdump.c b/scripts/dtc/fdtdump.c deleted file mode 100644 index 7d460a50b513..000000000000 --- a/scripts/dtc/fdtdump.c +++ /dev/null @@ -1,163 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0 -/* - * fdtdump.c - Contributed by Pantelis Antoniou - */ - -#include -#include -#include -#include -#include - -#include -#include - -#include "util.h" - -#define ALIGN(x, a) (((x) + ((a) - 1)) & ~((a) - 1)) -#define PALIGN(p, a) ((void *)(ALIGN((unsigned long)(p), (a)))) -#define GET_CELL(p) (p += 4, *((const uint32_t *)(p-4))) - -static void print_data(const char *data, int len) -{ - int i; - const char *p = data; - - /* no data, don't print */ - if (len == 0) - return; - - if (util_is_printable_string(data, len)) { - printf(" = \"%s\"", (const char *)data); - } else if ((len % 4) == 0) { - printf(" = <"); - for (i = 0; i < len; i += 4) - printf("0x%08x%s", fdt32_to_cpu(GET_CELL(p)), - i < (len - 4) ? " " : ""); - printf(">"); - } else { - printf(" = ["); - for (i = 0; i < len; i++) - printf("%02x%s", *p++, i < len - 1 ? " " : ""); - printf("]"); - } -} - -static void dump_blob(void *blob) -{ - struct fdt_header *bph = blob; - uint32_t off_mem_rsvmap = fdt32_to_cpu(bph->off_mem_rsvmap); - uint32_t off_dt = fdt32_to_cpu(bph->off_dt_struct); - uint32_t off_str = fdt32_to_cpu(bph->off_dt_strings); - struct fdt_reserve_entry *p_rsvmap = - (struct fdt_reserve_entry *)((char *)blob + off_mem_rsvmap); - const char *p_struct = (const char *)blob + off_dt; - const char *p_strings = (const char *)blob + off_str; - uint32_t version = fdt32_to_cpu(bph->version); - uint32_t totalsize = fdt32_to_cpu(bph->totalsize); - uint32_t tag; - const char *p, *s, *t; - int depth, sz, shift; - int i; - uint64_t addr, size; - - depth = 0; - shift = 4; - - printf("/dts-v1/;\n"); - printf("// magic:\t\t0x%x\n", fdt32_to_cpu(bph->magic)); - printf("// totalsize:\t\t0x%x (%d)\n", totalsize, totalsize); - printf("// off_dt_struct:\t0x%x\n", off_dt); - printf("// off_dt_strings:\t0x%x\n", off_str); - printf("// off_mem_rsvmap:\t0x%x\n", off_mem_rsvmap); - printf("// version:\t\t%d\n", version); - printf("// last_comp_version:\t%d\n", - fdt32_to_cpu(bph->last_comp_version)); - if (version >= 2) - printf("// boot_cpuid_phys:\t0x%x\n", - fdt32_to_cpu(bph->boot_cpuid_phys)); - - if (version >= 3) - printf("// size_dt_strings:\t0x%x\n", - fdt32_to_cpu(bph->size_dt_strings)); - if (version >= 17) - printf("// size_dt_struct:\t0x%x\n", - fdt32_to_cpu(bph->size_dt_struct)); - printf("\n"); - - for (i = 0; ; i++) { - addr = fdt64_to_cpu(p_rsvmap[i].address); - size = fdt64_to_cpu(p_rsvmap[i].size); - if (addr == 0 && size == 0) - break; - - printf("/memreserve/ %llx %llx;\n", - (unsigned long long)addr, (unsigned long long)size); - } - - p = p_struct; - while ((tag = fdt32_to_cpu(GET_CELL(p))) != FDT_END) { - - /* printf("tag: 0x%08x (%d)\n", tag, p - p_struct); */ - - if (tag == FDT_BEGIN_NODE) { - s = p; - p = PALIGN(p + strlen(s) + 1, 4); - - if (*s == '\0') - s = "/"; - - printf("%*s%s {\n", depth * shift, "", s); - - depth++; - continue; - } - - if (tag == FDT_END_NODE) { - depth--; - - printf("%*s};\n", depth * shift, ""); - continue; - } - - if (tag == FDT_NOP) { - printf("%*s// [NOP]\n", depth * shift, ""); - continue; - } - - if (tag != FDT_PROP) { - fprintf(stderr, "%*s ** Unknown tag 0x%08x\n", depth * shift, "", tag); - break; - } - sz = fdt32_to_cpu(GET_CELL(p)); - s = p_strings + fdt32_to_cpu(GET_CELL(p)); - if (version < 16 && sz >= 8) - p = PALIGN(p, 8); - t = p; - - p = PALIGN(p + sz, 4); - - printf("%*s%s", depth * shift, "", s); - print_data(t, sz); - printf(";\n"); - } -} - - -int main(int argc, char *argv[]) -{ - char *buf; - - if (argc < 2) { - fprintf(stderr, "supply input filename\n"); - return 5; - } - - buf = utilfdt_read(argv[1]); - if (buf) - dump_blob(buf); - else - return 10; - - return 0; -} From patchwork Fri Jan 29 07:24:08 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 373282 Delivered-To: patch@linaro.org Received: by 2002:a02:a60d:0:0:0:0:0 with SMTP id c13csp1953348jam; Thu, 28 Jan 2021 23:29:37 -0800 (PST) X-Google-Smtp-Source: ABdhPJxx9fe1T9w38nTx8H6HBhGRjL1hlkewcEwI660k5h2YJdXk9I9hzcOZevVLHhiW0RLOB04Y X-Received: by 2002:aa7:d306:: with SMTP id p6mr3694061edq.351.1611905376851; Thu, 28 Jan 2021 23:29:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611905376; cv=none; d=google.com; s=arc-20160816; b=Tp57WSY6dd+D3WxArUlXDlKSauLtzWfoA0qrDyZN/lfT9/bGvXmpzyJH1BcCKMpp/Z efRhUiD9XIuY2wY22A8Pr7VQkqN1DiVKj9+qaTd1hwhTzc18XJ71Y3EjEf1L2+gPRNMx IS4K4s43xIWad6R7Q1j9o/O/+D/n60Z2O9C7CHoi2nN3IkXcvt0WoTW382RhEog+ZNBD bB9f3j8exj2FRg5ych562MJ/o5h1dBsGq+/2gubUZt26mk2Q2WtOLXyAq8d2cXM7EC0F tLJcFmcn5xv0Pi42Ojvl64oriZSpd7acIO2aPvf5nUIV7WU4TIcSOL1jAfxhg+BOLl7F 3FwQ== 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=ZC1Ffn2n+T2+/SKKdskHJGHoUkjvYaC8Y9q/8gZ/2nI=; b=etB0bsFm35Ism2+IUPWeGYYhQjFoIofg9fhU9X2UY1rkKH+CQOcZZxvSBPhkKWXP2i nA41wBDVdDczHyuDPtx2Ty3/8X/eaFhjf3LcbZ/CWzCSSJG9Hb8ypZyRbAO1r5Iv06Jx U+VgatlaGIxS8FCt3iYY2bQwWobzEUocXm3fpOrJoKzTYUqpn+4ZuLVXG8r7TS1mxZLg 7f5IBEj2kzCEQlCn90PoiEKxjYpxek0qW/JIPQT6G8x5eK7yWxR/3xpIUTe8Y1A7dQgi oVKfM7p6NWfLcpG3PCA+C00OK2SnWTKYP7GI0lLQQIlrfWpR3sraM+jNFBNMBj736HHB u1DQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=hA0E3609; 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 v5si4670712eda.107.2021.01.28.23.29.36; Thu, 28 Jan 2021 23:29:36 -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=hA0E3609; 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 S232260AbhA2H3A (ORCPT + 6 others); Fri, 29 Jan 2021 02:29:00 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35584 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232180AbhA2H2y (ORCPT ); Fri, 29 Jan 2021 02:28:54 -0500 Received: from mail-pj1-x102a.google.com (mail-pj1-x102a.google.com [IPv6:2607:f8b0:4864:20::102a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CFCBDC06178C for ; Thu, 28 Jan 2021 23:27:45 -0800 (PST) Received: by mail-pj1-x102a.google.com with SMTP id a20so5333166pjs.1 for ; Thu, 28 Jan 2021 23:27:45 -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=ZC1Ffn2n+T2+/SKKdskHJGHoUkjvYaC8Y9q/8gZ/2nI=; b=hA0E36099D3Jnqvwzt/jsYfGd5mNS1Ozh+s16u/63PXTiiG+rHKntAJXf9MMOJN+JH vfbg6eITjBWf4Tw+N/KACEa/FPBpZs0Oiz6O5kW6Sx4T5S8PI0Ih89JuVCEWIomefJ7/ 3C7ilMbNQr+4+TtL5h5NRiizFtUbOLfUk62rUpsTXXvtrhv900UAnxPVfY5fZdxGF+rD Cg0xLV1gAjgoP6MQYUhkFaMvn5MxEanqJMLPk6zlxpizUOhdG8DMZoDTWwwRzWviplG2 00sDrptMsSG1ZtsQ+PDR33ZGBrMS2uUMSyFR7c3LMvJLlxu4lY1IFHoHumo1xEr8sAuo cN6A== 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=ZC1Ffn2n+T2+/SKKdskHJGHoUkjvYaC8Y9q/8gZ/2nI=; b=RsU7/nIieyLuz3NvfFc34x+GuSYl5YzNf8n8ShIWNCjCBVOPujQhM3VC/lF4a3Vx2H gu/4rE/bZyIgqiwJWpQ6f3DM7zgyELnvISFf97yEeesDdyVqf0B0cOucy3Gv1xLGMYZb CfxG2HO8lEvjHSEUzN4B89poWGU5CkgtodsYffVOTjkUkGPPA+dnu870RqaCmp4HufmJ PFxkbESJPZgbz8uXYZhc3uwSt8mEAOcKf1EdoZY1lbJ692/yK0+9zfx/FL0beCrHP7C+ AZjFXz9u/s3pFg6obZL4y6J29TUcYW1ILNUvivE/m29/Q/ju1ejia5ieDvtoyqhGxTq7 +xbA== X-Gm-Message-State: AOAM530tJS7WVDZOTUweNy6okJUBcj4h7ZuSk12w00cSQqfMA/8co96I eXdpKj1HLpk8rrwyYoS3Ch/tmQ== X-Received: by 2002:a17:90a:df46:: with SMTP id gy6mr3332054pjb.163.1611905265418; Thu, 28 Jan 2021 23:27:45 -0800 (PST) Received: from localhost ([122.172.59.240]) by smtp.gmail.com with ESMTPSA id w14sm6870723pjl.38.2021.01.28.23.27.44 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 28 Jan 2021 23:27:44 -0800 (PST) From: Viresh Kumar To: Frank Rowand , Rob Herring , Pantelis Antoniou , Masahiro Yamada , Michal Marek Cc: Viresh Kumar , Vincent Guittot , linux-kernel@vger.kernel.org, anmar.oueja@linaro.org, Bill Mills , David Gibson , devicetree@vger.kernel.org, linux-kbuild@vger.kernel.org Subject: [PATCH V7 4/6] kbuild: Add support to build overlays (%.dtbo) Date: Fri, 29 Jan 2021 12:54:08 +0530 Message-Id: <434ba2467dd0cd011565625aeb3450650afe0aae.1611904394.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 Add support for building DT overlays (%.dtbo). The overlay's source file will have the usual extension, i.e. .dts, though the blob will have .dtbo extension to distinguish it from normal blobs. Acked-by: Masahiro Yamada Signed-off-by: Viresh Kumar --- .gitignore | 1 + Makefile | 5 ++++- scripts/Makefile.dtbinst | 3 +++ scripts/Makefile.lib | 5 +++++ 4 files changed, 13 insertions(+), 1 deletion(-) -- 2.25.0.rc1.19.g042ed3e048af Reviewed-by: Geert Uytterhoeven Tested-by: Geert Uytterhoeven diff --git a/.gitignore b/.gitignore index d01cda8e1177..bb65fa253e58 100644 --- a/.gitignore +++ b/.gitignore @@ -18,6 +18,7 @@ *.c.[012]*.* *.dt.yaml *.dtb +*.dtbo *.dtb.S *.dwo *.elf diff --git a/Makefile b/Makefile index e0af7a4a5598..d5bc67e523be 100644 --- a/Makefile +++ b/Makefile @@ -1337,6 +1337,9 @@ ifneq ($(dtstree),) %.dtb: include/config/kernel.release scripts_dtc $(Q)$(MAKE) $(build)=$(dtstree) $(dtstree)/$@ +%.dtbo: include/config/kernel.release scripts_dtc + $(Q)$(MAKE) $(build)=$(dtstree) $(dtstree)/$@ + PHONY += dtbs dtbs_install dtbs_check dtbs: include/config/kernel.release scripts_dtc $(Q)$(MAKE) $(build)=$(dtstree) @@ -1816,7 +1819,7 @@ clean: $(clean-dirs) @find $(if $(KBUILD_EXTMOD), $(KBUILD_EXTMOD), .) $(RCS_FIND_IGNORE) \ \( -name '*.[aios]' -o -name '*.ko' -o -name '.*.cmd' \ -o -name '*.ko.*' \ - -o -name '*.dtb' -o -name '*.dtb.S' -o -name '*.dt.yaml' \ + -o -name '*.dtb' -o -name '*.dtbo' -o -name '*.dtb.S' -o -name '*.dt.yaml' \ -o -name '*.dwo' -o -name '*.lst' \ -o -name '*.su' -o -name '*.mod' \ -o -name '.*.d' -o -name '.*.tmp' -o -name '*.mod.c' \ diff --git a/scripts/Makefile.dtbinst b/scripts/Makefile.dtbinst index 50d580d77ae9..ba01f5ba2517 100644 --- a/scripts/Makefile.dtbinst +++ b/scripts/Makefile.dtbinst @@ -29,6 +29,9 @@ quiet_cmd_dtb_install = INSTALL $@ $(dst)/%.dtb: $(obj)/%.dtb $(call cmd,dtb_install) +$(dst)/%.dtbo: $(obj)/%.dtbo + $(call cmd,dtb_install) + PHONY += $(subdirs) $(subdirs): $(Q)$(MAKE) $(dtbinst)=$@ dst=$(patsubst $(obj)/%,$(dst)/%,$@) diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib index 213677a5ed33..b00855b247e0 100644 --- a/scripts/Makefile.lib +++ b/scripts/Makefile.lib @@ -86,7 +86,9 @@ extra-$(CONFIG_OF_ALL_DTBS) += $(dtb-) ifneq ($(CHECK_DTBS),) extra-y += $(patsubst %.dtb,%.dt.yaml, $(dtb-y)) +extra-y += $(patsubst %.dtbo,%.dt.yaml, $(dtb-y)) extra-$(CONFIG_OF_ALL_DTBS) += $(patsubst %.dtb,%.dt.yaml, $(dtb-)) +extra-$(CONFIG_OF_ALL_DTBS) += $(patsubst %.dtbo,%.dt.yaml, $(dtb-)) endif # Add subdir path @@ -327,6 +329,9 @@ cmd_dtc = $(HOSTCC) -E $(dtc_cpp_flags) -x assembler-with-cpp -o $(dtc-tmp) $< ; $(obj)/%.dtb: $(src)/%.dts $(DTC) FORCE $(call if_changed_dep,dtc) +$(obj)/%.dtbo: $(src)/%.dts $(DTC) FORCE + $(call if_changed_dep,dtc) + DT_CHECKER ?= dt-validate DT_BINDING_DIR := Documentation/devicetree/bindings # DT_TMP_SCHEMA may be overridden from Documentation/devicetree/bindings/Makefile From patchwork Fri Jan 29 07:24:09 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 373284 Delivered-To: patch@linaro.org Received: by 2002:a02:a60d:0:0:0:0:0 with SMTP id c13csp1953358jam; Thu, 28 Jan 2021 23:29:38 -0800 (PST) X-Google-Smtp-Source: ABdhPJz09cQJbjcsg1fq6gCjgGHPKqrWFSR1MeWz9QEnoSmB7PuwK/81VEnG4GPDFoslzJ2q948r X-Received: by 2002:a17:906:f246:: with SMTP id gy6mr3184024ejb.264.1611905378507; Thu, 28 Jan 2021 23:29:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611905378; cv=none; d=google.com; s=arc-20160816; b=Mf97esfwCt0rXZJ/bwAC/6cQcu/E46k4m3IQWByMFoef5v0R0On6qtDocrYVtM+wWx 7ZcsLd4HKVlgI08FpFFO4htgs0aUIEB0AIn65tFDj6zaDcfnQLY63KJGnmHyO4paRUi+ Ors369Ow3/2UzQMzBzzx+1Z6P6zndiXfWCM/bDXWomMrbZ4ubydfJplEblqFK1i7Zfry qj1zKkzs5P306xCMHLhDndh+ktRWbQrtxtJPod7GiEHsYrnP8hUUK3+aQgBtYK9eYsxE mxaFR0WnYqddEahCOPIEBI1GBMiF9iNW5p7WQ6BjAUVfHQG9BS8/EsSZKqRrzRByOV4J FLUw== 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=zGwObSDNhpTlCqU8x6dXBIYlNo68oQYaoM82x8ri0qg=; b=lewk5DAJuVLWbb2AyASf4VzaglOL8JlHSonr81YqoJw3dqSO7eVLzxa9b23fYs9qeS ld2nbl+43LCaA6t2njWRPedDgNArPdkqsUW9wgx3bhGApcf04ES8aAI6b4/ApCLH5n+6 O5csjXb6zNGdjIYDxLX5nuYih40R3zitDEBA5imGXozxVPz8tB5R2JbSo3pZ5lK2Ip7p BHB4tf7aBfJpLjVWO5pgvmzkdJSDjVlFrXytb44UmynmgyOLcsWsjuI28jtgSJx68x/s VzohDJgmG8fBp1nPxUmj2LY5PRVI5hHOoraOjF8ymUxD5NopUBTG9PluQKeHa60Sj2dc Bbkg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Ka2nLljT; 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 v5si4670712eda.107.2021.01.28.23.29.38; Thu, 28 Jan 2021 23:29:38 -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=Ka2nLljT; 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 S232282AbhA2H3Y (ORCPT + 6 others); Fri, 29 Jan 2021 02:29:24 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35616 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232244AbhA2H25 (ORCPT ); Fri, 29 Jan 2021 02:28:57 -0500 Received: from mail-pg1-x536.google.com (mail-pg1-x536.google.com [IPv6:2607:f8b0:4864:20::536]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4761EC061794 for ; Thu, 28 Jan 2021 23:27:49 -0800 (PST) Received: by mail-pg1-x536.google.com with SMTP id o63so6068377pgo.6 for ; Thu, 28 Jan 2021 23:27:49 -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=zGwObSDNhpTlCqU8x6dXBIYlNo68oQYaoM82x8ri0qg=; b=Ka2nLljTKsgHHL6xIl2fDVxg51v2ofmJOrKkj3Kp7txrwojwxCA4YY2CJmmB9cW1Cd dMVbgD1J0VtZLI34fsuLgeEvstcvaBlCULhsKzhQiV1rBzNiHoxaWlSIGDYqLa/NTRYL EOOnQ8Im2mCuCnERfSsyVCIomsjulMvRODf7msjiBPR8w39fk6N0fiJmEKzj5k9wST1E L32849rlAHXvVGr5+NQ+aSXfiSdiCs8ZJtxWMBsUClN9ICn884TTbaO7G/npEnacSezQ xgnaRuJeriOdDo1BLkHgncm86UQMcycVCnO8O+4HR912jWBmDG3KHF+A4RwdwfIX/kCi 9vNQ== 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=zGwObSDNhpTlCqU8x6dXBIYlNo68oQYaoM82x8ri0qg=; b=nw1YLNN88anupXCO8GkcPCZNrT6JS1vDJhdf/ebwQ4FTYuGtiarHhG/pbkbYIx1BcW qeSmDuCuL1Gtdc3RluwOs/3lTdvqLv1C9uyckk2q28iiuT/NaN3+rCG1yn0OuIJla72Z jRDm/yuR+j4yawcYPgdTClwIOUyGR+Z7nH4NoIi9xz6aY2tO1LrkkdQwePJj3dNmYER2 aG5raQaTRgLKCw1e1zkDg8aYK0EbFop3UcuooGwyvhM7/j7HWUXWkbpIPlNSMOeg6S1k bCnJiZMNkyIxjuh6DuwbsHeLN2+eHDhDLAPt3hpCj4BazvOU0gVRX3wtuHItC7ntnHTW g8nA== X-Gm-Message-State: AOAM532Z9NPI/GSrayNrOotGBWiM0JGgV2teerrrdGcDJtHCZ0alRaV5 /20K/9+2unlTeH1b3Osph3D5KQ== X-Received: by 2002:aa7:8f13:0:b029:1bd:f965:66d8 with SMTP id x19-20020aa78f130000b02901bdf96566d8mr3211704pfr.80.1611905268786; Thu, 28 Jan 2021 23:27:48 -0800 (PST) Received: from localhost ([122.172.59.240]) by smtp.gmail.com with ESMTPSA id g15sm7474300pfb.30.2021.01.28.23.27.47 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 28 Jan 2021 23:27:48 -0800 (PST) From: Viresh Kumar To: Frank Rowand , Rob Herring , Pantelis Antoniou , Masahiro Yamada Cc: Viresh Kumar , Vincent Guittot , linux-kernel@vger.kernel.org, anmar.oueja@linaro.org, Bill Mills , David Gibson , devicetree@vger.kernel.org, Michal Marek Subject: [PATCH V7 5/6] of: unittest: Create overlay_common.dtsi and testcases_common.dtsi Date: Fri, 29 Jan 2021 12:54:09 +0530 Message-Id: <585e77b8c8a613103f3251af969514f2aa6d0e0d.1611904394.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 In order to build-test the same unit-test files using fdtoverlay tool, move the device nodes from the existing overlay_base.dts and testcases_common.dts files to .dtsi counterparts. The .dts files now include the new .dtsi files, resulting in exactly the same behavior as earlier. The .dtsi files can now be reused for compile time tests using fdtoverlay (will be done by a later commit). This is required because the base files passed to fdtoverlay tool shouldn't be overlays themselves (i.e. shouldn't have the /plugin/; tag). Note that this commit also moves "testcase-device2" node to testcases.dts from tests-interrupts.dtsi, as this node has a deliberate error in it and is only relevant for runtime testing done with unittest.c. Signed-off-by: Viresh Kumar --- drivers/of/unittest-data/overlay_base.dts | 90 +----------------- drivers/of/unittest-data/overlay_common.dtsi | 91 +++++++++++++++++++ drivers/of/unittest-data/testcases.dts | 18 ++-- .../of/unittest-data/testcases_common.dtsi | 19 ++++ .../of/unittest-data/tests-interrupts.dtsi | 7 -- 5 files changed, 118 insertions(+), 107 deletions(-) create mode 100644 drivers/of/unittest-data/overlay_common.dtsi create mode 100644 drivers/of/unittest-data/testcases_common.dtsi -- 2.25.0.rc1.19.g042ed3e048af diff --git a/drivers/of/unittest-data/overlay_base.dts b/drivers/of/unittest-data/overlay_base.dts index 99ab9d12d00b..ab9014589c5d 100644 --- a/drivers/of/unittest-data/overlay_base.dts +++ b/drivers/of/unittest-data/overlay_base.dts @@ -2,92 +2,4 @@ /dts-v1/; /plugin/; -/* - * Base device tree that overlays will be applied against. - * - * Do not add any properties in node "/". - * Do not add any nodes other than "/testcase-data-2" in node "/". - * Do not add anything that would result in dtc creating node "/__fixups__". - * dtc will create nodes "/__symbols__" and "/__local_fixups__". - */ - -/ { - testcase-data-2 { - #address-cells = <1>; - #size-cells = <1>; - - electric_1: substation@100 { - compatible = "ot,big-volts-control"; - reg = < 0x00000100 0x100 >; - status = "disabled"; - - hvac_1: hvac-medium-1 { - compatible = "ot,hvac-medium"; - heat-range = < 50 75 >; - cool-range = < 60 80 >; - }; - - spin_ctrl_1: motor-1 { - compatible = "ot,ferris-wheel-motor"; - spin = "clockwise"; - rpm_avail = < 50 >; - }; - - spin_ctrl_2: motor-8 { - compatible = "ot,roller-coaster-motor"; - }; - }; - - rides_1: fairway-1 { - #address-cells = <1>; - #size-cells = <1>; - compatible = "ot,rides"; - status = "disabled"; - orientation = < 127 >; - - ride@100 { - #address-cells = <1>; - #size-cells = <1>; - compatible = "ot,roller-coaster"; - reg = < 0x00000100 0x100 >; - hvac-provider = < &hvac_1 >; - hvac-thermostat = < 29 > ; - hvac-zones = < 14 >; - hvac-zone-names = "operator"; - spin-controller = < &spin_ctrl_2 5 &spin_ctrl_2 7 >; - spin-controller-names = "track_1", "track_2"; - queues = < 2 >; - - track@30 { - reg = < 0x00000030 0x10 >; - }; - - track@40 { - reg = < 0x00000040 0x10 >; - }; - - }; - }; - - lights_1: lights@30000 { - compatible = "ot,work-lights"; - reg = < 0x00030000 0x1000 >; - status = "disabled"; - }; - - lights_2: lights@40000 { - compatible = "ot,show-lights"; - reg = < 0x00040000 0x1000 >; - status = "disabled"; - rate = < 13 138 >; - }; - - retail_1: vending@50000 { - reg = < 0x00050000 0x1000 >; - compatible = "ot,tickets"; - status = "disabled"; - }; - - }; -}; - +#include "overlay_common.dtsi" diff --git a/drivers/of/unittest-data/overlay_common.dtsi b/drivers/of/unittest-data/overlay_common.dtsi new file mode 100644 index 000000000000..08874a72556e --- /dev/null +++ b/drivers/of/unittest-data/overlay_common.dtsi @@ -0,0 +1,91 @@ +// SPDX-License-Identifier: GPL-2.0 + +/* + * Base device tree that overlays will be applied against. + * + * Do not add any properties in node "/". + * Do not add any nodes other than "/testcase-data-2" in node "/". + * Do not add anything that would result in dtc creating node "/__fixups__". + * dtc will create nodes "/__symbols__" and "/__local_fixups__". + */ + +/ { + testcase-data-2 { + #address-cells = <1>; + #size-cells = <1>; + + electric_1: substation@100 { + compatible = "ot,big-volts-control"; + reg = < 0x00000100 0x100 >; + status = "disabled"; + + hvac_1: hvac-medium-1 { + compatible = "ot,hvac-medium"; + heat-range = < 50 75 >; + cool-range = < 60 80 >; + }; + + spin_ctrl_1: motor-1 { + compatible = "ot,ferris-wheel-motor"; + spin = "clockwise"; + rpm_avail = < 50 >; + }; + + spin_ctrl_2: motor-8 { + compatible = "ot,roller-coaster-motor"; + }; + }; + + rides_1: fairway-1 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "ot,rides"; + status = "disabled"; + orientation = < 127 >; + + ride@100 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "ot,roller-coaster"; + reg = < 0x00000100 0x100 >; + hvac-provider = < &hvac_1 >; + hvac-thermostat = < 29 > ; + hvac-zones = < 14 >; + hvac-zone-names = "operator"; + spin-controller = < &spin_ctrl_2 5 &spin_ctrl_2 7 >; + spin-controller-names = "track_1", "track_2"; + queues = < 2 >; + + track@30 { + reg = < 0x00000030 0x10 >; + }; + + track@40 { + reg = < 0x00000040 0x10 >; + }; + + }; + }; + + lights_1: lights@30000 { + compatible = "ot,work-lights"; + reg = < 0x00030000 0x1000 >; + status = "disabled"; + }; + + lights_2: lights@40000 { + compatible = "ot,show-lights"; + reg = < 0x00040000 0x1000 >; + status = "disabled"; + rate = < 13 138 >; + }; + + retail_1: vending@50000 { + reg = < 0x00050000 0x1000 >; + compatible = "ot,tickets"; + status = "disabled"; + }; + + }; +}; + diff --git a/drivers/of/unittest-data/testcases.dts b/drivers/of/unittest-data/testcases.dts index a85b5e1c381a..04b9e7bb30d9 100644 --- a/drivers/of/unittest-data/testcases.dts +++ b/drivers/of/unittest-data/testcases.dts @@ -2,19 +2,15 @@ /dts-v1/; /plugin/; +#include "testcases_common.dtsi" + / { testcase-data { - changeset { - prop-update = "hello"; - prop-remove = "world"; - node-remove { - }; + testcase-device2 { + compatible = "testcase-device"; + interrupt-parent = <&test_intc2>; + interrupts = <1>; /* invalid specifier - too short */ }; }; + }; -#include "tests-phandle.dtsi" -#include "tests-interrupts.dtsi" -#include "tests-match.dtsi" -#include "tests-address.dtsi" -#include "tests-platform.dtsi" -#include "tests-overlay.dtsi" diff --git a/drivers/of/unittest-data/testcases_common.dtsi b/drivers/of/unittest-data/testcases_common.dtsi new file mode 100644 index 000000000000..19292bbb4cbb --- /dev/null +++ b/drivers/of/unittest-data/testcases_common.dtsi @@ -0,0 +1,19 @@ +// SPDX-License-Identifier: GPL-2.0 + +/ { + testcase-data { + changeset { + prop-update = "hello"; + prop-remove = "world"; + node-remove { + }; + }; + }; +}; + +#include "tests-phandle.dtsi" +#include "tests-interrupts.dtsi" +#include "tests-match.dtsi" +#include "tests-address.dtsi" +#include "tests-platform.dtsi" +#include "tests-overlay.dtsi" diff --git a/drivers/of/unittest-data/tests-interrupts.dtsi b/drivers/of/unittest-data/tests-interrupts.dtsi index ec175e800725..0e5914611107 100644 --- a/drivers/of/unittest-data/tests-interrupts.dtsi +++ b/drivers/of/unittest-data/tests-interrupts.dtsi @@ -61,12 +61,5 @@ testcase-device1 { interrupt-parent = <&test_intc0>; interrupts = <1>; }; - - testcase-device2 { - compatible = "testcase-device"; - interrupt-parent = <&test_intc2>; - interrupts = <1>; /* invalid specifier - too short */ - }; }; - }; From patchwork Fri Jan 29 07:24:10 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 373283 Delivered-To: patch@linaro.org Received: by 2002:a02:a60d:0:0:0:0:0 with SMTP id c13csp1953352jam; Thu, 28 Jan 2021 23:29:37 -0800 (PST) X-Google-Smtp-Source: ABdhPJwhetMImcYwPz8P5kWTVsbHAC/+OxyVw3jG5yh6lG7l1fEeWX4TXAkNoF9qB3oz9HdPn8jW X-Received: by 2002:a17:906:2c0e:: with SMTP id e14mr3208486ejh.299.1611905377685; Thu, 28 Jan 2021 23:29:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611905377; cv=none; d=google.com; s=arc-20160816; b=FSaL4OokLoQrzqPplgXfgII1LyyBGu8/3RMR6yLkIydXGKU4MwFWok+0v1CAu+JDiO h/8ewia47s8ySn7bbIQlqUXHRjFamLTCGUFmoZ+zFcUWBqyoVSJOGMcg9XZrxSTBRqZ2 NhqBJOfBnXhDO4BwrObh5GfOy/WWb5/VrAQM4k9myueE/L9jf+s9CWtf3uoNsQ6vDjHY rM8rU8K85gbFT+jZE0zuhK9qkT/QcG+umDKV3niADaTHQ/Oq/297Ot0fKBDfm7LKer/G LBDHSpplJJJEOvCdekCRfSutx4QLzGBO0jBBdfEDsnFX6Kco4wPDah+fG2HQfWfVcUzZ v7HQ== 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=ZFJJayi+RV75ZCULMj0kJ6mO1gZLX1EFE3pZWPFttHU=; b=D52f0XO50aGoTgDG962eIWjf8SJda7oOGXrPwcgOlL4yT0GaT7vAwWdOVMxnKM1j15 Ng+BulvsHP+Q9KqkmA3mfI3SydIkGbHS1WLWZqEFnhxFisI+VLYfo3q4h5LpGdHAG1Tl en1zqejW7kTI/lUoxkvgVDWjS8HPK9SuvnDP6VN8T6yizLxJyGm/IOwX+9aoWmc8zZ2G rHqenVmMIuEteaB9BSHsrpf3DoXLSGMQ5Cl0EUb9RZwOhzFtVHTefhk5UUhrAweMt/wH S8AxitdhzldOhlAfm9gwAWtCsnx+oxp2DL/91eTjsFzm/jOJOEtiIz6oL05NJ4DilpT4 SiPA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=UWnusc89; 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 v5si4670712eda.107.2021.01.28.23.29.37; Thu, 28 Jan 2021 23:29:37 -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=UWnusc89; 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 S232228AbhA2H3R (ORCPT + 6 others); Fri, 29 Jan 2021 02:29:17 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35574 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232137AbhA2H3J (ORCPT ); Fri, 29 Jan 2021 02:29:09 -0500 Received: from mail-pj1-x1033.google.com (mail-pj1-x1033.google.com [IPv6:2607:f8b0:4864:20::1033]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6445CC0617A9 for ; Thu, 28 Jan 2021 23:27:52 -0800 (PST) Received: by mail-pj1-x1033.google.com with SMTP id jx18so5881944pjb.5 for ; Thu, 28 Jan 2021 23:27:52 -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=ZFJJayi+RV75ZCULMj0kJ6mO1gZLX1EFE3pZWPFttHU=; b=UWnusc89sByEY+EQQ7PwenfvS1a+eR6yhVarOTzuE4YezP3NS9cfOS1vHoIrU0ELZl +zyPGdiesHKxC+BAJjGQewOe+5gs5PTff1XujwVvHwxx2XwqHCddMYs1TOYgc97mTYZC Lt09HQpVkKJr1+n6fWszrh233w2zdtytJanXMMovQbXLuo3qd6elNeush1yr1RWS6TjE DX93oUS75mUDpQ2NA6Yyw05vXkeTOZragzZz1QOksgn73gmbD9fGfBVvbv15EbNCzX9Q 5eooAeyMLkKylmeBnxB/foem48HBcY69LGrvf6RMyMijC40W6B7JwefAWMqnsUs3QH9w sacw== 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=ZFJJayi+RV75ZCULMj0kJ6mO1gZLX1EFE3pZWPFttHU=; b=WaH0S7fc4Bm+7npBeG+JHBb0y7YJMRmc5xKlnGE3MiBopg23NLZq8Xs1XBdot9/69N bS+OG8b1J3TgZ2MCjaOg4P9grJAGEv2dzjIynesU2Bhj4MMb12Xtkmai+ND9WnKUah5A UxTBSvQoU42y+cx9TpeZ8n0Ij4WYMlosSGyAgxUl9z2b5gC00gBUU1m5y80t3Qhjprh8 sEtyaFT4jrLRM/zxh8h4eZZyUjEJxImbL8sBcnzB/fNe2UCkZ93OZ/8MORKFNZHmJEXF 50M3YY4QjCS0vvd3c78nKzSUBWxtkWuzPrlY7QJ5qfIHVmO+FbM+brOQqOQcWRGvHtgU t84w== X-Gm-Message-State: AOAM530roHQ70qnt+3uNptEWdyt5gAuv7E22Nx33G0QB7gvVx0a/1YFN yXEEMdD80xAaMTzwrXtt0xuDZQ== X-Received: by 2002:a17:90b:4d0a:: with SMTP id mw10mr612660pjb.217.1611905271997; Thu, 28 Jan 2021 23:27:51 -0800 (PST) Received: from localhost ([122.172.59.240]) by smtp.gmail.com with ESMTPSA id p64sm7543889pfb.201.2021.01.28.23.27.51 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 28 Jan 2021 23:27:51 -0800 (PST) From: Viresh Kumar To: Frank Rowand , Rob Herring , Pantelis Antoniou , Masahiro Yamada Cc: Viresh Kumar , Vincent Guittot , linux-kernel@vger.kernel.org, anmar.oueja@linaro.org, Bill Mills , David Gibson , devicetree@vger.kernel.org, Michal Marek Subject: [PATCH V7 6/6] of: unittest: Statically apply overlays using fdtoverlay Date: Fri, 29 Jan 2021 12:54:10 +0530 Message-Id: <3683a542d4141cfcf9c2524a40a9ee75b657c1c2.1611904394.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. Create two new base files static_base_1.dts and static_base_2.dts which includes other .dtsi files. Some unittest overlays deliberately contain errors that unittest checks for. These overlays will cause fdtoverlay to fail, and are thus not included for static builds. Signed-off-by: Viresh Kumar --- drivers/of/unittest-data/Makefile | 56 ++++++++++++++++++++++ drivers/of/unittest-data/static_base_1.dts | 4 ++ drivers/of/unittest-data/static_base_2.dts | 4 ++ 3 files changed, 64 insertions(+) create mode 100644 drivers/of/unittest-data/static_base_1.dts create mode 100644 drivers/of/unittest-data/static_base_2.dts -- 2.25.0.rc1.19.g042ed3e048af Signed-off-by: Rob Herring diff --git a/drivers/of/unittest-data/Makefile b/drivers/of/unittest-data/Makefile index 009f4045c8e4..fc286224b2d1 100644 --- a/drivers/of/unittest-data/Makefile +++ b/drivers/of/unittest-data/Makefile @@ -34,7 +34,63 @@ DTC_FLAGS_overlay += -@ DTC_FLAGS_overlay_bad_phandle += -@ DTC_FLAGS_overlay_bad_symbol += -@ DTC_FLAGS_overlay_base += -@ +DTC_FLAGS_static_base_1 += -@ +DTC_FLAGS_static_base_2 += -@ DTC_FLAGS_testcases += -@ # suppress warnings about intentional errors DTC_FLAGS_testcases += -Wno-interrupts_property + +# Apply overlays statically with fdtoverlay. This is a build time test that +# the overlays can be applied successfully by fdtoverlay. This does not +# guarantee that the overlays can be applied successfully at run time by +# unittest, but it provides a bit of build time test coverage for those +# who do not execute unittest. +# +# The overlays are applied on top of static_base_1.dtb and static_base_2.dtb to +# create static_test_1.dtb and static_test_2.dtb. If fdtoverlay detects an +# error than the kernel build will fail. static_test_1.dtb and +# static_test_2.dtb are not consumed by unittest. +# +# Some unittest overlays deliberately contain errors that unittest checks for. +# These overlays will cause fdtoverlay to fail, and are thus not included +# in the static test: +# overlay_bad_add_dup_node.dtb \ +# overlay_bad_add_dup_prop.dtb \ +# overlay_bad_phandle.dtb \ +# overlay_bad_symbol.dtb \ + +apply_static_overlay_1 := 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 + +apply_static_overlay_2 := overlay.dtb + +quiet_cmd_fdtoverlay = FDTOVERLAY $@ + cmd_fdtoverlay = $(objtree)/scripts/dtc/fdtoverlay -o $@ -i $^ + +$(obj)/static_test_1.dtb: $(obj)/static_base_1.dtb $(addprefix $(obj)/,$(apply_static_overlay_1)) + $(call if_changed,fdtoverlay) + +$(obj)/static_test_2.dtb: $(obj)/static_base_2.dtb $(addprefix $(obj)/,$(apply_static_overlay_2)) + $(call if_changed,fdtoverlay) + +always-$(CONFIG_OF_OVERLAY) += static_test_1.dtb static_test_2.dtb diff --git a/drivers/of/unittest-data/static_base_1.dts b/drivers/of/unittest-data/static_base_1.dts new file mode 100644 index 000000000000..10556cb3f01f --- /dev/null +++ b/drivers/of/unittest-data/static_base_1.dts @@ -0,0 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 +/dts-v1/; + +#include "testcases_common.dtsi" diff --git a/drivers/of/unittest-data/static_base_2.dts b/drivers/of/unittest-data/static_base_2.dts new file mode 100644 index 000000000000..b0ea9504d6f3 --- /dev/null +++ b/drivers/of/unittest-data/static_base_2.dts @@ -0,0 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 +/dts-v1/; + +#include "overlay_common.dtsi"