From patchwork Fri Jan 22 10:50:31 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 368615 Delivered-To: patch@linaro.org Received: by 2002:a02:a60d:0:0:0:0:0 with SMTP id c13csp1400608jam; Fri, 22 Jan 2021 02:56:43 -0800 (PST) X-Google-Smtp-Source: ABdhPJzwSu42hmBhhNKS690IuBHn+B8Q76iKQCdwTm9trvaZWJM5/EhLjE3F3FNDxQUALCUK5BDD X-Received: by 2002:aa7:d64b:: with SMTP id v11mr2606706edr.16.1611313003792; Fri, 22 Jan 2021 02:56:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611313003; cv=none; d=google.com; s=arc-20160816; b=fzPf1vm/nyEFCKXN7/qDZxux3RDWvo54gaL8QIZO/hFu0Bz27mVxgTYoMrqbha0BuS hTXNdKGQGilIXJzb4Dql8E0rcE3dmjXqOgx3tP/HMo/tBDlwyKtEpWjqmJGNneOG4euy wkKAIjOrVg+Pnl5suTIzDkWzCqgl1uQGEc0O7tv5jJw0UJxZ5iEKmDrDPjlVsTfVdmAm C9CMvE1dXHYiKJn250/m5rMB0wHpbDxZb17AZZ8kbA+aV0p1ZJaQD+d0YsfpyblZ1Msp V58bKy3yBxzN48IE/GbklBNPpDeDOWPD+89A9w5YFiecNP6Tk5PNWCyBPbhxQRj9RelH wLtw== 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=pVIcQEh83W3UhYSl4hEp+8e/amXU5AmUKesfJQX4zm/4QAcvTkU+iDy+m3IaSC1sLz 0rxYTJxgSoW8/Y2X3FFBmiRB/46us053hgC5HnE2540V1wmFJR/01mlOm/XMB57xkBxt GwwIDDMhf1HKaPgyjEGBtWcw8BrFARnlbNT67A03DsMQ2iwn4WunXp1h/q0C7BUq5yyD k5DxzxnLyqYeb1sJHwPQagnsFs3tVYZb99+7jNJP6OpuqvYn0NTWtrPYlEjQhDEdnf0w N68zlwEMGJd28/YmU/KjtwczC84ajR7D0vxvK5jhr6Jj5W8c3uLJ0QZxEELDgqtDQGsZ hXkw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=AP04QnPE; 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 v1si3354421edt.548.2021.01.22.02.56.43; Fri, 22 Jan 2021 02:56:43 -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=AP04QnPE; 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 S1727190AbhAVKzL (ORCPT + 6 others); Fri, 22 Jan 2021 05:55:11 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33390 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727497AbhAVKvm (ORCPT ); Fri, 22 Jan 2021 05:51:42 -0500 Received: from mail-pg1-x534.google.com (mail-pg1-x534.google.com [IPv6:2607:f8b0:4864:20::534]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7CF72C061794 for ; Fri, 22 Jan 2021 02:51:02 -0800 (PST) Received: by mail-pg1-x534.google.com with SMTP id 15so3438136pgx.7 for ; Fri, 22 Jan 2021 02:51:02 -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=AP04QnPEq4omjlVd+XdVlwgJ67Xem0dBgHqNS1NMAk3e7DwbaWW8RgDO+sQnmk2ARX GXttGe+eUwii441N+kRqjfw+Nmtm3EQLerO+0c3mptkNBWOXHKMF2BiY6Dc3zrv+16U5 cMfFkO8sy/tywJhIyqwV1UyWjPk9fF04TYurPsgJvwhAcHHFX+0WOq6p1VB6b6taJiED ARoPTT0Wtw5Skh++d6MVcWawwTedLM3WJHGiN3m/nL5/aTrGOi/2hUrJP7GSOhAGK54w jjpV3CYIJGNLPoW/HXSoC8PjvTYpgOxPzxT2B+qXt0gXHkKojMdMEaMsfok103U3xGpH j7JQ== 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=DvR8q6cqjERrueK9JXpwlRWl+6A4K2w+1dcZfNl5WyEs5xqT8Zog7gGLwAKPexO0hZ 6tCGyg70NwI0Ix+C7F/byKOdBoHJaVv+sOgTL6CcregGZHWjAtSDLYK3430A2o3ORdEi N1u/q54A1le2DZmSd/C4owY/Xp/WCKXBYafaY3khPDY8RWNDcsT4m/sf/zl5WA0X+ghL sCeCOtrFgUJfVSOiHyrFQV8rV675G6lzvRJUYDfDg+RD3E5+f0jj1odcB41uJKr+OOvU kVf39hv5/BDcaP2L1kZr0y+7nPh+RxiGh49i653w37dAVhNR8KVeQrEoEMzgiVo+L4r7 jQCQ== X-Gm-Message-State: AOAM5305xy+604a+NWQDXZzMAKBu9IHsOgdrdoPt3v3xhwAVGX0zCtJv 2xfO1bucHASnPsWEx+WeHtFwwg== X-Received: by 2002:a63:574c:: with SMTP id h12mr4116854pgm.79.1611312661973; Fri, 22 Jan 2021 02:51:01 -0800 (PST) Received: from localhost ([122.172.59.240]) by smtp.gmail.com with ESMTPSA id s9sm1776905pfd.38.2021.01.22.02.51.00 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 22 Jan 2021 02:51:01 -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 V6 1/6] scripts: dtc: Fetch fdtoverlay.c from external DTC project Date: Fri, 22 Jan 2021 16:20:31 +0530 Message-Id: <41f7158a707f20980e71a8d254c1d7aed84ad371.1611312122.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 22 10:50:32 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 368613 Delivered-To: patch@linaro.org Received: by 2002:a02:a60d:0:0:0:0:0 with SMTP id c13csp1399790jam; Fri, 22 Jan 2021 02:55:27 -0800 (PST) X-Google-Smtp-Source: ABdhPJwUU53wTB+nFvbz1qF793P6kRQkcjzYjJY3KIa79v8bNtGcIq5FsYnKln/qRd4scaPilF2A X-Received: by 2002:a05:6402:1701:: with SMTP id y1mr2643421edu.251.1611312927430; Fri, 22 Jan 2021 02:55:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611312927; cv=none; d=google.com; s=arc-20160816; b=jbGt6VR1Pc+MzpiNl8T50KWns4Kt0b4Mqs2VcQxVNU6CLxOp9S/FNJBhIlbyxjHFJt RqI2r343XjuPsfDppWmydUjra90R2JBFOyKPAvTGNwc9d/Ry2QVQ+Oxqy0E/ss6rRRTo 6A1ei9mn6vekAQb1WyB6cNEAIXBzMCh3dQcp4Pzd4eW2Uhk2A1e95NT+8ETH9OUhVH1Y TlnAzrKR8c2F5SwbHtnavOpI1feUbCsVPld6bKEu8o5ofEm3GtvhcbuorlD7zwQi3rW4 CaXRC4Xe9Jzga+vQLSa+aaJtQNlTnvQrxklJOKuvKM0I7ShRS0IxlwCleNpaZQzutQNx KhTg== 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=Mj8NkcRMiBcX8enUu0QdAFt4QvkXJ54u28VgjHZrnr8=; b=xE6a8EuJCllXCJU6SbXhq5B0heEJhaKXHfCNTLyK9Z8kQ8fpZPFK4kG0+K9tCiGf2z nmQzD8Sq0wiYLv+qvDepxf2BOuMPgp4yZ/8BNfeMqhn+w9PZHamMqPRZAf3ghheNJKVO 1yOqusnPU+T1d11adGVsch97PWwE9kq3ZjFnPlwARuPaNc/R+bQoocKLEQ/tNiIuqUwS DyaXTwUz3mVxbaNpk3GXAnxtrGtFceMV5TmYsl3UwywG7k1IP+JnOr/Pal00DoyEFjgL 3NSrglbYTETqP5xFc8KpI+b2cELmUtWP542KZlb0I8kLtqZxrbtKPY0uZlTfKPU48Vyi ruAA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=INxEBZOQ; 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 v1si3354421edt.548.2021.01.22.02.55.27; Fri, 22 Jan 2021 02:55:27 -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=INxEBZOQ; 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 S1727325AbhAVKws (ORCPT + 6 others); Fri, 22 Jan 2021 05:52:48 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32964 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727377AbhAVKvh (ORCPT ); Fri, 22 Jan 2021 05:51:37 -0500 Received: from mail-pj1-x102b.google.com (mail-pj1-x102b.google.com [IPv6:2607:f8b0:4864:20::102b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5DA29C0617A7 for ; Fri, 22 Jan 2021 02:51:05 -0800 (PST) Received: by mail-pj1-x102b.google.com with SMTP id b5so3525854pjl.0 for ; Fri, 22 Jan 2021 02:51:05 -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=Mj8NkcRMiBcX8enUu0QdAFt4QvkXJ54u28VgjHZrnr8=; b=INxEBZOQHpe111nBfLB+3bNd6+RN9DFzc2OWu9iizQXyYIdz4XMaOf/jxNFMJBgmms vosF1GBO+qfSFoc+neKr0WcW+8P6DXBVECICNv3zAZ5t+CpDFhrmDlLyNdDwEVlWoeUj MBw2Mj2SYZt+XxyiQ4EKRqiNY/7+gu0R5LBVgu1DT3Fb9YPU/yl05KjbPi+QNaZhmUII 9nN0rJfXEqKDTwtOSS1+Zwg0UhGxrFEoHNDaRkzRUdPH6g9hJcfSlo4Vd8plEC5Ty2AD LDFRixw/0gs70JkvlZuhGt+qO+BMV4hciyAWWj5zx3gbSC3mdAYLNo5L2kW4n1GovZG7 LmhA== 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=Mj8NkcRMiBcX8enUu0QdAFt4QvkXJ54u28VgjHZrnr8=; b=feTU9XxMEK5CL5uN3LxtAI7EnnT4QUKo3Cf0Ns7X9meNCe8TcmTvuNAmMd3Hek6Ew2 BUr2us71DHVAHTUCaFVRWNSS93FoAYEj8pXXc/mZxEugmhReRuuAFZmwVDkaqUYrWm1j dWoL/lknwt6byeGfKxCD3QptccYyqW9YTJz36NSR8G9ql969HpfuKxlMSeJDKERlFoFC WKBsYpgvOxxCecby9orXgqQTeGTPEigHYO0FurqrXu27EVYyLt7U/9JG1nihC234dS6f 9EV0Z557OSfhAr+GnMld2SrkPwNJVwvoi+bryPZxrLlxZW9tjUD6VQFoVnLsFJn89KpB kWmg== X-Gm-Message-State: AOAM532laHKDkFdxPM4f2/O2F7IozCKkF/K0CWmVR7x6K4fetRkUIF2E XSkFvSl2n6DlHpj/uehBiifSfIPn/m+z4A== X-Received: by 2002:a17:90b:1a87:: with SMTP id ng7mr4801788pjb.211.1611312664993; Fri, 22 Jan 2021 02:51:04 -0800 (PST) Received: from localhost ([122.172.59.240]) by smtp.gmail.com with ESMTPSA id c189sm8682506pfb.175.2021.01.22.02.51.04 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 22 Jan 2021 02:51:04 -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 V6 2/6] scripts: dtc: Build fdtoverlay tool Date: Fri, 22 Jan 2021 16:20:32 +0530 Message-Id: <2dfec4acb1bfbab08b431908ace0a77cc3279434.1611312122.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 (or merges) 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 | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) -- 2.25.0.rc1.19.g042ed3e048af diff --git a/scripts/dtc/Makefile b/scripts/dtc/Makefile index 4852bf44e913..5f19386a49eb 100644 --- a/scripts/dtc/Makefile +++ b/scripts/dtc/Makefile @@ -1,13 +1,17 @@ # 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 +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 22 10:50:33 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 368617 Delivered-To: patch@linaro.org Received: by 2002:a02:a60d:0:0:0:0:0 with SMTP id c13csp1400617jam; Fri, 22 Jan 2021 02:56:44 -0800 (PST) X-Google-Smtp-Source: ABdhPJzMV9sfwwvj345ZjgGX1zG89ctGeDIagXOjkVq53PJCNzgTrhL1/nr+VYZwFQlG/4gejMtR X-Received: by 2002:aa7:c804:: with SMTP id a4mr2646024edt.297.1611313004831; Fri, 22 Jan 2021 02:56:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611313004; cv=none; d=google.com; s=arc-20160816; b=dEmAOgFxBqsUGY6bS+xNx7XFpyCqnHBg3QaroLJvEQKtOVzHr3f/TCS5HFCUFYy7kd 0fXNh+jU3GjYZqgGyvb2PmFzMu+yP76CbFH25BXdkWdRwAqHhw2oQwqATGV89uAX/heE xjLEZ+CX2l8fh975osy27+jAItjxScCnM/xxfpiNJMJRyS0078cI3eW1iTUqwJTKouEy WwTL56f+Nk9fD79TAn9vm+P/GEXRMgxFOP/8ivKO5Dz/7x/UXyjt5VKWqJ6yRZ1YE5sz Zu2Hu1fjuhjTtPN+V0cojxu7I787SU1S3vAZrW6ngYxgr2aji0xWLNSJy6O1q6R5OAIR 0B4g== 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=v9eF63yO9o2N7hgyudz+5eVtp1kkI8Q3nLeE1wWquMc9tHwIBx5udkavb6ieOvzqx4 pEI+KThEK5KIQosAscHSM+rVKuOjZjLVwqh28JpD34PI8rW9d335m+sQfdTv1I2OeLwU JXQxO7kciK5D6emPDqH1XrLSkty6lfrktskggnLYjM6kDnKMg4JSlKX/8Y+SeMcP1+mc nG9ZeZQNOKNSQ1kvARX6XyXlR4QVY0r6NbRdnlwCuv7MtgGZAy7jAMXa1YpaJ98Q2Ffe j2J+8EpAxU3RFfupgE3oXWsXXbsqn48y7lXE3U8hS2imeaUYMj2zwOTn3qyqsFjo7itp FMEA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=wLzCN8OE; 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 v1si3354421edt.548.2021.01.22.02.56.44; Fri, 22 Jan 2021 02:56:44 -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=wLzCN8OE; 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 S1727231AbhAVKz1 (ORCPT + 6 others); Fri, 22 Jan 2021 05:55:27 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33420 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727519AbhAVKvt (ORCPT ); Fri, 22 Jan 2021 05:51:49 -0500 Received: from mail-pj1-x1031.google.com (mail-pj1-x1031.google.com [IPv6:2607:f8b0:4864:20::1031]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DFB8BC0617AB for ; Fri, 22 Jan 2021 02:51:08 -0800 (PST) Received: by mail-pj1-x1031.google.com with SMTP id p15so3459688pjv.3 for ; Fri, 22 Jan 2021 02:51:08 -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=wLzCN8OEmq88g0xUSSeEgIpgE6MCUAs074gL4aMWRKoc1MoWNtJFvpNYuhSy8Trxu+ 8/PCP/NhbQTpfYe+HnS148B0mF0llj7MUB1cOuQPBVfS6ednTD6BnT18U5FAcxDHHSFp OhawpYtyu1XZ+1z1dZCxNra0YA0xXocqeMllEELeVxFXesChIMKs65csxicnGTebCnVw W0kpBPJMnNdIxbD96mF/qIa0t+1LURQqmOc8eoiiQ69/bULxr/fDCPDlT0ZJYAlbNGxa 3blNvcu+1HuXyPOhewzBT/9T7GdchctR2GsRSF+Q4e7ksQXO61fyNtVUYNDuZKSNxzgQ 582A== 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=ZeSnfqr4m8Q5Afl7Nz6WJp4Dbd0x8e///efyX1uUK99ejGJQJa5P4K6WjLAN9UyABd tv3DCZI7lX6tOhTLpx4REl2Fhxx5rfv6qipjjw/Q8T21whZFzqgkxN+qMr0ezYJqNUgK neTA78Jgoq2PUW8TYw2JU0Ycgd1YbHVcdEBqZ/C265U3kqjVS2dyOoS80YgdqvaHJBLO GmM1az/USy12mOlln3+5IXCZHoBa3xjH3Fw1PmFeHX4tKxy/dQIGKu6NZPqcgNXJX1mV nzuwbByPwQ8sm/M2oAWbCGDfvdmrPxgLvqFz+fnocPAm59cdvKh/I1KkwHqxojgnRIO3 U3iw== X-Gm-Message-State: AOAM532cIOtZ3W3GiAIGGg2vHEhXlbiTCAFpxoi/TQSiyeV4dddaTOHN jYg/t5ouDXm/NtLsELb+WqhTIw== X-Received: by 2002:a17:90a:db06:: with SMTP id g6mr4533585pjv.221.1611312668459; Fri, 22 Jan 2021 02:51:08 -0800 (PST) Received: from localhost ([122.172.59.240]) by smtp.gmail.com with ESMTPSA id fy20sm9764789pjb.54.2021.01.22.02.51.07 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 22 Jan 2021 02:51:07 -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 V6 3/6] scripts: dtc: Remove the unused fdtdump.c file Date: Fri, 22 Jan 2021 16:20:33 +0530 Message-Id: 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 22 10:50:34 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 368621 Delivered-To: patch@linaro.org Received: by 2002:a02:a60d:0:0:0:0:0 with SMTP id c13csp1446926jam; Fri, 22 Jan 2021 04:02:19 -0800 (PST) X-Google-Smtp-Source: ABdhPJxfbDFW1X9+JIjfi6lO0+3l95+MPhcJY/mRjmg3JhmkCDpQ5piy7Uf/rjX8yd9l7E/V4Bo7 X-Received: by 2002:aa7:d1d4:: with SMTP id g20mr2958488edp.244.1611316939335; Fri, 22 Jan 2021 04:02:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611316939; cv=none; d=google.com; s=arc-20160816; b=K3rxDZ73fd0C8IsmTrRCC+opvM2mZdYS2CDC6D/1+sWZ1l5Fpl0SJrkkaAvNBHsAT4 pqYcj665KkCvkZiP3/kw4mjANDa54+en3I7kS+QIkwNi9rGrdeonGzYro7kJVAUPMimp TZD+tSXrkwsLb2N9BuKRjRBLK/ZOzP6c7xXyGVznDcccZYftJywR2tKqHJZ+CXsHtxCw icfPKL1R0BbTQsl+FGcvrTbSAvzJMqchnfspee0AySlyG4+DhrWmhIOAO3VroiePzpQS G7IMWtO0y+jU5wvtHTLStXZLvUPSw6uQfMl1pV086AbBwc57VpRArNYn0pK3ZbURu++p 0iXg== 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=iEpV/4+pPDDR7a+hsqu9AsNuEUO5TQBQt3UbF56LflA=; b=IKwp645lsl6RIF8QrxHK6yGOOB6DY/xsBex5DhkxgomFsNeDtU+N1ebhNBrkrPdv3t x+4m9MK+dzMlg4dqtcxqmC4j0J0Iau1QPoJDHeESOdTh1QLrad0VyOHzr8ziuZyxfhiJ HwEe2snMGAqrXkXN2TZKO2TwC2vX706zsQfeOdRBiKW1UVNMrLAYhGmaHGHIpHRL2LhC kJMpOTtByjwcCRylMrhdKEAcVtO3dy9ZPnrWef0HtK64NesJdVMNel4Ken83aotuasLn hwNpCjgU9vvtDkeHLrPf+mJU7Pzbei3sWoJay8JreXFAp1EADgp4ijTDKBsp5h9EgZQu 9abw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=sWrdcTSn; 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 r7si3400048edv.345.2021.01.22.04.02.19; Fri, 22 Jan 2021 04:02:19 -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=sWrdcTSn; 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 S1727214AbhAVKzP (ORCPT + 6 others); Fri, 22 Jan 2021 05:55:15 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33438 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727534AbhAVKvw (ORCPT ); Fri, 22 Jan 2021 05:51:52 -0500 Received: from mail-pf1-x431.google.com (mail-pf1-x431.google.com [IPv6:2607:f8b0:4864:20::431]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 37D2CC061353 for ; Fri, 22 Jan 2021 02:51:12 -0800 (PST) Received: by mail-pf1-x431.google.com with SMTP id q131so3428668pfq.10 for ; Fri, 22 Jan 2021 02:51:12 -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=iEpV/4+pPDDR7a+hsqu9AsNuEUO5TQBQt3UbF56LflA=; b=sWrdcTSnHVrF0YS3uSKW5LnuC2iM1fGJiNkwUttGPC/iUUJAzwXFSK30L021dMW0Ln rqMIezwKbS6JOB/M9tubz10ho2rkxROjRNE389vJj7O2PCiOuSUA1DfkFlVdxDUnuDDP G8tsiGJbg5juhzroZNh6fpkWwhfd/lOG4ehUPP7aAJM0ufxw5Ky0X2xbB/HX/RTff2eU JUoBv9vWOSLFymqxrikuOCC9GmXh2z3znGreXaq1vNF7vhr+/VsLZuyKd3IF1/Oa2vyD iLWST9xr/2ayhnAOwpBih07yAuZNz+q3/fGEJDHKYL4MXNUvRS0MLaPXx2//t9HEexvl lzcA== 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=iEpV/4+pPDDR7a+hsqu9AsNuEUO5TQBQt3UbF56LflA=; b=hqt9hNqhZQs0ISd4JDlY7TtPm9qQWCK+Pb6of0r8OxPj/n9h3qW0eOmn+TPXc9GJOP cR1Pza/ouvivvbvJ6G8rbmOQl0jepWN7ph0bcQ2OeCPNGsQLNSakvb782pTdKjEpW0r3 IhUbhUav59nrOOEL7i/TXi29D5arGsv3CAU6clkvJI0ZQB51Xjhm2q1tl+oHiltFV8lT EoNh0A/tP3nLrDefsyyc7xKNesWI0m+PpU1W473P2Q72FS9EEYGFlroNSDQRd7Hth1YT +3Js2lLBQjvUCPe4BZajj28tLBOhhsacmcDpYIuE1klv8rbO1nk9tl4WPLXlblhs+lzI ebfw== X-Gm-Message-State: AOAM531yPf1R5g7RNqt0iP4Vj9t7fQvElacfaHDB+E2BcqO3go4RHiE8 qxAvZFb0PfTj6eTU/JMQFtDh7g== X-Received: by 2002:a63:405:: with SMTP id 5mr4182014pge.44.1611312671691; Fri, 22 Jan 2021 02:51:11 -0800 (PST) Received: from localhost ([122.172.59.240]) by smtp.gmail.com with ESMTPSA id m27sm8210751pgn.62.2021.01.22.02.51.10 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 22 Jan 2021 02:51:11 -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 V6 4/6] kbuild: Add support to build overlays (%.dtbo) Date: Fri, 22 Jan 2021 16:20:34 +0530 Message-Id: <43d693de2034dd30bb7d4576ffb52207ca220079.1611312122.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. 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 Acked-by: Masahiro Yamada 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 9e73f82e0d86..18fd02f55d9b 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 22 10:50:35 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 368614 Delivered-To: patch@linaro.org Received: by 2002:a02:a60d:0:0:0:0:0 with SMTP id c13csp1399815jam; Fri, 22 Jan 2021 02:55:29 -0800 (PST) X-Google-Smtp-Source: ABdhPJwVS90MzSrIpt5ROsSWKeAZVAL94rgWqE/c8Tbo06+XXTc3G2irV/JDKv67RE3F0EwuihpH X-Received: by 2002:a05:6402:41:: with SMTP id f1mr2669582edu.286.1611312929049; Fri, 22 Jan 2021 02:55:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611312929; cv=none; d=google.com; s=arc-20160816; b=Xop8i0GzHGrTxhPdDARrPOED99jNNmhEYdZ0ALQn6U0s6qjt9Cr1EURG5LtYHf0J/h g6R/v/sFNKEV5DXSGhFD2SwBzmfOHR9Q/9IBncJB9wC1F8d5t/rFUnKzxwL9r0cYkQ0O vcoAd32Zg/fhdTzl38Obk1n4H048pofLtlP1OkNpdYdusvY6ta7Xb8feADfwCkregCC/ mhN4X0k1SkTKSR/DQqzluWclopngGEIxf+j0FcOvDXgB8ZGOA8F6OUWkymqONeYD+aGU zccFj6hQnONUjFMjP3mcql2awtDc6AbLPX2fGnJJ+FwVfyvPgLw34NNBjqKjbv3mjGDD S6uQ== 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=IvP3Ma3+woV2oq3EN9w3VxuCelFndEmoc/p15PUWCoI=; b=DoF37LEFZubdDBoa4plWq35ff3TDBCOggEmF6AjprHm92JQ0OpSypTvlNzFZkHQ8px G2Jf+S7KOnH3o9DC/HG9KtTpeUwdqP8lxb6EHYrJDkdjpzxKVe/1J1ORMeDdcaGU7yAR 4s0w4jcAg0VAW1t66hgWcXxirMhgi139m7hn5WQCQkCV6cw9qV0hUsglNdP3IxaGVv01 IL5I5bCSpCO4OUICSV5gyLuqRerFDcZY58R0oSV/2/7tspYheBg86Tus47mevoK98WUI KqjqGKqP1XeAWwRaVnnKeWzJFOGH5Mejn9SODBLbrxwKTXE+NZmyVo++pBCZYlcmbEtE WQ9w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=qIzBgw3j; 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 v1si3354421edt.548.2021.01.22.02.55.28; Fri, 22 Jan 2021 02:55:29 -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=qIzBgw3j; 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 S1727359AbhAVKxC (ORCPT + 6 others); Fri, 22 Jan 2021 05:53:02 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33192 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727242AbhAVKvj (ORCPT ); Fri, 22 Jan 2021 05:51:39 -0500 Received: from mail-pg1-x52d.google.com (mail-pg1-x52d.google.com [IPv6:2607:f8b0:4864:20::52d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 77B28C06121C for ; Fri, 22 Jan 2021 02:51:15 -0800 (PST) Received: by mail-pg1-x52d.google.com with SMTP id i5so3464765pgo.1 for ; Fri, 22 Jan 2021 02:51:15 -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=IvP3Ma3+woV2oq3EN9w3VxuCelFndEmoc/p15PUWCoI=; b=qIzBgw3jW7F+GTnEAUQS9lOmWPtddtULB+IUna2qDntsPazCkt8S4I/8Q3M8lUHmu/ JPsMXN23lxyNkHzvrm1qM4sPjxQTnNaX4nwFXRPXKvcNYkqA8t7u+5B9hRxMxyEypf93 ARgbOWGTEovalb+yr32e2j1tjoUfM39rZquLXDctAZ0wApx8c/X3JMENijj0dhke127L x57/iyb8sEPqnhFzYwN99mAAdrB24cfT9ketruUP2ofmPh7cRQusjXqziN/WRk+uEp0X FLWnvV96f0YcMBE/2XTtsn/eDck9AnEstu33UxzCsSLJ9paJ44qeHCa5rVW786ByMVUy 6E8w== 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=IvP3Ma3+woV2oq3EN9w3VxuCelFndEmoc/p15PUWCoI=; b=OXpCj6EmiD9YTzw2gRQhCAmtXns19s/gcnJPYEw/i6VEh/vpeQJHf/5fQ5UbqlXqoq lVpE2JQp9fSu2xJFJ3ODjpJM0uk56zGXb7upj19JqhPuiUoTQ7sKcH8fa9bqY14tRd43 lVCaRolU9H/xmOuE/Vr8wD3l6V32PjlCfQorp/k8WFi9PH9GJAYdg3CVGfseRISWGD8S uIcpwA7FfH4EkGCZkaV/fUPEz6Jvx8SO6SthwVAf9YkfYpo4JPKG1erLiFW9e8eLAIlR 1uoUzkHZF0lEpFIKlgvLfoZsABlGOWYSr9H2ZXIsNK3Fw9GXpkVqmSp18XoUwrSyjxy9 IBrg== X-Gm-Message-State: AOAM5305WqkP56jpaww6C74zSRWbO8jgaYUQ4LuhgC2uci05dlgWzBee C/wvVWtLpJs71NjuaJaU684TNg== X-Received: by 2002:aa7:8104:0:b029:1ae:684f:d140 with SMTP id b4-20020aa781040000b02901ae684fd140mr4249323pfi.62.1611312675006; Fri, 22 Jan 2021 02:51:15 -0800 (PST) Received: from localhost ([122.172.59.240]) by smtp.gmail.com with ESMTPSA id 6sm9292068pjm.31.2021.01.22.02.51.14 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 22 Jan 2021 02:51:14 -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 V6 5/6] of: unittest: Create overlay_common.dtsi and testcases_common.dtsi Date: Fri, 22 Jan 2021 16:20:35 +0530 Message-Id: <94180731aa4a17e4834458a979de7de782dc73d4.1611312122.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 files. 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 in a later patch). This is required because the base files passed to fdtoverlay tool shouldn't be overlays themselves (i.e. shouldn't have the /plugin/; tag). 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 | 17 +--- .../of/unittest-data/testcases_common.dtsi | 18 ++++ 4 files changed, 111 insertions(+), 105 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..185125085784 100644 --- a/drivers/of/unittest-data/testcases.dts +++ b/drivers/of/unittest-data/testcases.dts @@ -2,19 +2,4 @@ /dts-v1/; /plugin/; -/ { - 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" +#include "testcases_common.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..05f16606b6a5 --- /dev/null +++ b/drivers/of/unittest-data/testcases_common.dtsi @@ -0,0 +1,18 @@ +// 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" From patchwork Fri Jan 22 10:50:36 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 368620 Delivered-To: patch@linaro.org Received: by 2002:a02:a60d:0:0:0:0:0 with SMTP id c13csp1446872jam; Fri, 22 Jan 2021 04:02:17 -0800 (PST) X-Google-Smtp-Source: ABdhPJxs88LLiMDcZq4dpc5F1cmVjHnbvISyvWIyZVaFLhega4oj7DorVrgbsx6ZxxYxoFw4Kqn5 X-Received: by 2002:a17:907:9710:: with SMTP id jg16mr2831923ejc.286.1611316937230; Fri, 22 Jan 2021 04:02:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611316937; cv=none; d=google.com; s=arc-20160816; b=W3Gf0wmdCL3eHeYZJaJl+6svnbS/TXgWjyNvu4HmWGq9kmKlrFuCXL2RNfAikYAtxy n0SxVv6ljpLFq5lXYcYBkfMmnyjNs2alqk3uhSpKfLBKc4tbeQkvD/pNsOki+u+KGL7y 4jfB67yR0SWE60kPO1i6dFF+/mLlqFNW28nuHW6+M4AhVhE7EIpYuXET1nDOd/hjw6l5 bWhVN6Ve47Q45Wv0ogA5B3Nd2VIL0TkPKBnVLFUXDlG8Su26PiS7LSGUBe3CDyYyIQDk TooZS7ugyOLy0VxvgY//FmXmyVSvetSIFAelWaUVjFDKHaz6wmkN8pbBvz2pWPFPK7Ub e3KA== 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=LPFWN6gpauI4vigWfOz/xPJOdZeAxCmm0GF1zvJDfzo=; b=UqfA44GRzErn7jz1S89gSUWfTcayujwo2iNNUNtm1X3L6q6rBRLOctJkZEGc4SIdua 2ydWuvfOAyZoClSegOev+blIjK74N9DmcvYeaDkc+Udi9jXxe+iZAWNhq8exUzaY7N5q xtWe4+MbEG890H73Y5gyZ+RcDzMHRnrnclNM32VHXXyVVn7RwSMU2roIuvy9cao+HaYa hq2fyiJCS/EfaC708W8eYesEL2IMPBU4brV8tjbSEgSQj7XXCsra9PGRSRMlvJFY7q44 oCYZM0cmVP8h1BHztyQAeLPPqiEFSvWpfpb/J/N//ehjDLkMZHB5+uK9YsJ6Nuz3QLEv Riag== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=V+Hz5lr6; 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 r7si3400048edv.345.2021.01.22.04.02.17; Fri, 22 Jan 2021 04:02:17 -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=V+Hz5lr6; 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 S1727442AbhAVKz7 (ORCPT + 6 others); Fri, 22 Jan 2021 05:55:59 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33484 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727584AbhAVKwE (ORCPT ); Fri, 22 Jan 2021 05:52:04 -0500 Received: from mail-pg1-x52b.google.com (mail-pg1-x52b.google.com [IPv6:2607:f8b0:4864:20::52b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7FA1CC06121D for ; Fri, 22 Jan 2021 02:51:18 -0800 (PST) Received: by mail-pg1-x52b.google.com with SMTP id i7so3434580pgc.8 for ; Fri, 22 Jan 2021 02:51:18 -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=LPFWN6gpauI4vigWfOz/xPJOdZeAxCmm0GF1zvJDfzo=; b=V+Hz5lr6HX/rwkb7XWX0ZVFoYsa7Z6oigc7al8V8vGUi3astJhd+qexzbJ2yXMlcuH lIkc+An9dl9VuEI+iXslcp65fU4tsTywBsHS6BMsH72fXtrnRG/9sov745Nl5bXF82+Y YoCnvhP+vXOw438QQb9a1U2HzbICgZ9mwU6khvlOChY3CIm5mROzbRP5jAQu0CGSRq68 D1Y1NYxFsuvxON9dqPQJnUAdlqhRHKCUgjgyHWGFW0DDMIoWYgjStSkEIiJZgVdZXHG7 gtLnTn9j2xVHvWNqTxFANOBWKSj133pli5mDWg2FDJqv5EWLDVVBEwZ7T3QD98JANASA apZA== 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=LPFWN6gpauI4vigWfOz/xPJOdZeAxCmm0GF1zvJDfzo=; b=jdJmh1tgsdFaQB17KGko7ynI9ykCkKhHlXdKuoFXVqY9VpT44sZ7luhsyw2xqVqYcc Um9TVfwvRFkp2M8fqbLuUwhmUvSrWffAkmEe+jPkySdQevRKkBF9FJ9B1atKL0hCinXx 78JBwvzhzS4PQPagq+b5RQV/deSic3qCvu2THwZVIgdPolJQ70XUVLMo3G0m8Z5Y0QAP s3PF2oCI2du25xEKJK+Z4UUTMuI316E4/9dKLHap/QEP2By2iwbMqiqcNMmgSBMBSwZa g74wlWygHQlF03H7gtqbPBlhpi/DwGYj3ea+YiiCaJWa2bPoLVx1pr/Eu/Vf503i+j+D ySjw== X-Gm-Message-State: AOAM532UaHOryaZjIdICSOWf26OZtnm7BtPvQHT6Lz+0dDfmbu4AyxXQ 3ZTK7XHmwEMF+xsxSNFEfGWxbw== X-Received: by 2002:a62:d401:0:b029:1bd:4078:553b with SMTP id a1-20020a62d4010000b02901bd4078553bmr3575219pfh.21.1611312678067; Fri, 22 Jan 2021 02:51:18 -0800 (PST) Received: from localhost ([122.172.59.240]) by smtp.gmail.com with ESMTPSA id j3sm8799732pjs.50.2021.01.22.02.51.17 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 22 Jan 2021 02:51:17 -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 V6 6/6] of: unittest: Statically apply overlays using fdtoverlay Date: Fri, 22 Jan 2021 16:20:36 +0530 Message-Id: <58e8523e1489b70b76211fb94a9229ae12c33cad.1611312122.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 a new base file static_base.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 in the static_test.dtb. Signed-off-by: Viresh Kumar --- drivers/of/unittest-data/Makefile | 51 ++++++++++++++++++++++++ drivers/of/unittest-data/static_base.dts | 5 +++ 2 files changed, 56 insertions(+) create mode 100644 drivers/of/unittest-data/static_base.dts -- 2.25.0.rc1.19.g042ed3e048af diff --git a/drivers/of/unittest-data/Makefile b/drivers/of/unittest-data/Makefile index 009f4045c8e4..586fa8cda916 100644 --- a/drivers/of/unittest-data/Makefile +++ b/drivers/of/unittest-data/Makefile @@ -34,7 +34,58 @@ DTC_FLAGS_overlay += -@ DTC_FLAGS_overlay_bad_phandle += -@ DTC_FLAGS_overlay_bad_symbol += -@ DTC_FLAGS_overlay_base += -@ +DTC_FLAGS_static_base += -@ 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.dtb to create static_test.dtb +# If fdtoverlay detects an error than the kernel build will fail. +# static_test.dtb is 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 \ +# overlay_base.dtb \ + +apply_static_overlay := overlay.dtb \ + 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 + +quiet_cmd_fdtoverlay = FDTOVERLAY $@ + cmd_fdtoverlay = $(objtree)/scripts/dtc/fdtoverlay -o $@ -i $^ + +$(obj)/static_test.dtb: $(obj)/static_base.dtb $(addprefix $(obj)/,$(apply_static_overlay)) + $(call if_changed,fdtoverlay) + +always-$(CONFIG_OF_OVERLAY) += static_test.dtb diff --git a/drivers/of/unittest-data/static_base.dts b/drivers/of/unittest-data/static_base.dts new file mode 100644 index 000000000000..3c9af4aefb96 --- /dev/null +++ b/drivers/of/unittest-data/static_base.dts @@ -0,0 +1,5 @@ +// SPDX-License-Identifier: GPL-2.0 +/dts-v1/; + +#include "overlay_common.dtsi" +#include "testcases_common.dtsi"