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; -}