From patchwork Wed Jan 20 07:06:45 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 366962 Delivered-To: patch@linaro.org Received: by 2002:a02:a60d:0:0:0:0:0 with SMTP id c13csp204433jam; Tue, 19 Jan 2021 23:09:49 -0800 (PST) X-Google-Smtp-Source: ABdhPJzRENZ8aGp36oXaT7JGDHgbk1ghYaRmIQmSwBu2dERKAxF1dlaNszL2fUL9AoS+0EUHsR1W X-Received: by 2002:a17:907:da9:: with SMTP id go41mr5330367ejc.326.1611126588993; Tue, 19 Jan 2021 23:09:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611126588; cv=none; d=google.com; s=arc-20160816; b=c4lSfI9O2EByoBNUSOMGEQLnh443MNEezqcAptMb9Ef2Re+9ZEBnVUR4kVzekeO98l WoyK6Rv/PPALnxgHNKZ4Je84RRO1vpQDF5/x384/0btjNY62rX/4CGU5gfqQdz0cJk4q dpQ17sZd9j1mURQjaao0p90f+LXfwsgDhfhvFQlR2e3fOi8y3mf3ALPyg3F0MPpQRzTN XsGUvSh32DuIA/2LvuWDtjFUX5VfjNYEt7CUwtShh2eTUYCIAyJrzblGsFnuJa5CBQQ5 v3+rbFal9l1+B3B0Q3cIua2NFVUD63VylFnlbsnvazhIQIyY4aTHHQ+DrvdN0ci30+wY mRhw== 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=yI9wyH+kjz5h6qj9/bPTTL9o3+EG/3nVgEeHiEiLkc83P4n0XG0DnkvvCxmVnZV4l3 mmg6K93d7DzZr4R59iiZFYdLAfW3cmc91vqR2nxwM84ny9McGy4hQGkJJm6zRj81zKFv tK2S+YDbFtat4kGJfENiqYcs2c6Elu+lsij3ypAvwE08nnA4EGmlKM8GHOUgAqaqsqcM FP0adcQxOjVJJM9aiW2mtiwwsPHB5BmyKhEF9UmYnUpIl8I7V+KRUvayne4eEfAfQI// MeYttumG3SgZs/N9NXp1cLL1s6+z7JkL7q7xJph234izcnpGUrULscRoIyrIE3Sx/BFt Hviw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="p121J/5G"; 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 hh2si401429ejb.627.2021.01.19.23.09.48; Tue, 19 Jan 2021 23:09:48 -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="p121J/5G"; 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 S1728275AbhATHJN (ORCPT + 6 others); Wed, 20 Jan 2021 02:09:13 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43094 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728120AbhATHJC (ORCPT ); Wed, 20 Jan 2021 02:09:02 -0500 Received: from mail-pj1-x102e.google.com (mail-pj1-x102e.google.com [IPv6:2607:f8b0:4864:20::102e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4E88DC061793 for ; Tue, 19 Jan 2021 23:07:49 -0800 (PST) Received: by mail-pj1-x102e.google.com with SMTP id l23so1617441pjg.1 for ; Tue, 19 Jan 2021 23:07: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=9FnCdmEEGSQX+RKqefc8hvZ3CGNJpcGjSObBIm4DdhU=; b=p121J/5GsWmVdei7cT5XCaB6DnT64K+rfFzJkY39ir4WPYYzyq7KIO+Ugk7wQBADoB /4iIz9ubKkAsoSDacb7idNt0mGXFoXywGrxtHOJgGQZb1+9eEODzZHSDS6w2HsIKJ/2G ZJNYnAqTWppIIEFDD4WpVl63Ib0GoXFFxfRSxadg+h/oJ2pIG7QrKlcTGqLz4xXQ4rwE MiG4iR5jL4eyqFlKlI9ucth8ysBqSN+VLpTnwlbzfiFCb/tgnZJng/F1ywROa9Byou4a zN9d4/FFKwnFf6SyEJdKSgaORetLdCB3ixACy0uBcpIjBnL/+Krwbk8h4FZw3rQTI2hr BSaw== 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=LvQMDADSqRYi619jvQ//+qNAPJBrI7joNWHD+y9HCxqgx8mwZWdAv3V+w84aHU2qnl Rnx06pLVzVC47HTBJZAVxTsrGseuvA8rITJNygpV+MK2Umbxx7S+DyHEdgDaFN+GWlWU t4rb9Gd5XhlAPrFwZu1GWj3ldRY2/+NyZMNdXPQTdPn8Px+1LVh36j0SG9nWb7Zrc0M1 zn9Vjmgz5jb5rgX2XU2+Z3LZopbC28hql+s5L5fjykAMxfCMnyBxRwWsNfTLimB3k4Ie 1IwlvIOxQbwnnj+K9PHAvAPlBEzSEokhkTS1ykSQ+qD5A9Z+1I/88f2EF8znlcjwxoa4 TObA== X-Gm-Message-State: AOAM530XM8tXD7/UDFQ4iFGVVqFD8YARSTtmR9cuAj/+PeEqb+52JcJf TIvICBrJlvuIPlZjeDphQF56VA== X-Received: by 2002:a17:90a:d255:: with SMTP id o21mr4113781pjw.151.1611126468885; Tue, 19 Jan 2021 23:07:48 -0800 (PST) Received: from localhost ([122.172.59.240]) by smtp.gmail.com with ESMTPSA id f29sm1128623pgm.76.2021.01.19.23.07.47 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 19 Jan 2021 23:07:48 -0800 (PST) From: Viresh Kumar To: Frank Rowand , Rob Herring , Pantelis Antoniou Cc: Viresh Kumar , Vincent Guittot , Masahiro Yamada , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, David Gibson , Bill Mills , anmar.oueja@linaro.org Subject: [PATCH V5 3/5] scripts: dtc: Remove the unused fdtdump.c file Date: Wed, 20 Jan 2021 12:36:45 +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; -}