From patchwork Tue Jan 12 08:29:02 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 361150 Delivered-To: patch@linaro.org Received: by 2002:a02:ccad:0:0:0:0:0 with SMTP id t13csp159917jap; Tue, 12 Jan 2021 00:30:47 -0800 (PST) X-Google-Smtp-Source: ABdhPJyegHL3H57uzh6T0a5ZD5AXyLPuoApKMJZ1S1Cdap2ymeZiFiAYzild12TlXbkfFJ5+8W00 X-Received: by 2002:a50:ed04:: with SMTP id j4mr2593817eds.84.1610440247218; Tue, 12 Jan 2021 00:30:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610440247; cv=none; d=google.com; s=arc-20160816; b=RRM4aKdYGEscOauUu6woXGl/wjPwmzhRIq2vUFEA59Y93CmwKaECd0iL5wtolnK1uq MWPGS0itrPU7jeBtUnNAJRtq2DgXpXjrjP4GGn3zJGFcCsgukwQIPscpeOsSwYrYWBsu ARSWHDj80PyzUjB42G9PeQrow+x/i81gWAOYolukr4gXDKyrqEcTbpXM9Kv8HdCf/2MR tOg57WaSrcZHcuEMS69ojEwUmBOyUlex08oHgoHZHuc4VDs5GwEQusJCkFzeP75wjAzN oqd6sgbFflWZsI4q/aNLgIWVto1U24lI1z1KBaXB6y1EhAA+d4mTquKC05ZZPvQ+3MYO By1Q== 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=Mtt1GUKWWqbOFQuUbbs1ITTthSnQjr2xO48uQIgOOA++puAw0RYc+SlaodrMfiMlgB /Qxy+kpzVXXD5Pospi9rMlk7oD+o+VPBYIjDR/HQVNMNlPpBebVb76vUd4eYbNnLFJtt LOPubaklIhu1YKUj8b1aQakVVE1oJJhrFfwFUmxYJDb39/i7/mS7odr8EILI+J8/vPcP FylBkCgt0NLUVlhOqYvYiCG3G8bj7iYabjMS4EFxN5CuXpRFWlwUAdypqpHz4XIeOxfW KGNBkVf+i1V/Ef36J7SNM9yNYUwNVDqonszNOAa5UY/nbUsQMjyuuBPDpAKLEDo75uvs jIiQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=hrulJ76T; 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 n8si808356eju.315.2021.01.12.00.30.47; Tue, 12 Jan 2021 00:30:47 -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=hrulJ76T; 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 S2405242AbhALIab (ORCPT + 6 others); Tue, 12 Jan 2021 03:30:31 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44194 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2405109AbhALIaa (ORCPT ); Tue, 12 Jan 2021 03:30:30 -0500 Received: from mail-pg1-x529.google.com (mail-pg1-x529.google.com [IPv6:2607:f8b0:4864:20::529]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B2E5AC0617AA for ; Tue, 12 Jan 2021 00:29:18 -0800 (PST) Received: by mail-pg1-x529.google.com with SMTP id i7so955220pgc.8 for ; Tue, 12 Jan 2021 00:29: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=9FnCdmEEGSQX+RKqefc8hvZ3CGNJpcGjSObBIm4DdhU=; b=hrulJ76Tv91s7SpdhYOy9jmlFw1Fhw/qiYTAMrHBR79CBwvq6sAzjtxv5hEnUF1yXq Vn+MH/2OzfXdLH4R5B1XZsBVJ0NF9pFu4OqX5CCiPhTgaxCnUygFwsq6cQb8M69Z2dyK pD/Lzt2kiEq0cmqq31x5zlDCPAzScU/o7M6hec8Aw2HP2CX98MfZStjEgwGw+Ly7W0IU CPle+X0NZ6EvnErCZiFMbIneBrc1cWVTjm5Q7QflQ0bGrMRX8nbv5UcU812AzKU6r9DB idwrnlwnDMOYRaKg9IqNcNJuMCcT0M54mgFiZECjX7MzThKAJwsDMQU/xzBhUrkscUMS GU4A== 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=jVQnp4IWe757Svh5KWGIOJk3NM2P6sikHkVPUMpYX6q/gZdoMQxl3KD3MiebpNaRdw B/GOJfiePhhGlYxFgznoEh6Z3JB4S4yEsT46AYry4iGy1F8UQGLeF/JrhadrKvOEDePn zU+12resP3qL9d5nqiIJpFC9oYQzUMUwzJFHbOQ6k3ryxabHraxu9jwt8v7HDPfUF7BD KhDbYaVQxLu4S6fXTd6uM4YZWJMsVdm30NerqK5VxPL/NY2SIGKnFnut/ijx0n/VQnR4 0nNbxiBu8Z3i0Vyb/wmU/0yPsMpX+fxE4Ql9ayAUxWw9bAiirYwtofpvd+4FpjoKdY6r MLOg== X-Gm-Message-State: AOAM533wgRkgckSXkOXWG87vfrPNWZbQ3J9ECrT2yYyTvFE5N79WPjmv AOLU5qz3AVPMCunI4g/H6Kh2nA== X-Received: by 2002:aa7:843a:0:b029:19d:b279:73c9 with SMTP id q26-20020aa7843a0000b029019db27973c9mr3843688pfn.3.1610440158277; Tue, 12 Jan 2021 00:29:18 -0800 (PST) Received: from localhost ([122.172.85.111]) by smtp.gmail.com with ESMTPSA id t7sm2143478pfe.179.2021.01.12.00.29.17 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 12 Jan 2021 00:29:17 -0800 (PST) From: Viresh Kumar To: Pantelis Antoniou , Frank Rowand , Rob Herring Cc: Viresh Kumar , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kbuild@vger.kernel.org, Vincent Guittot , Bill Mills , anmar.oueja@linaro.org, Masahiro Yamada Subject: [PATCH V4 3/3] scripts: dtc: Remove the unused fdtdump.c file Date: Tue, 12 Jan 2021 13:59:02 +0530 Message-Id: <25d98b2fe9bea3fe784f8392a73b88a253c8b97a.1610431620.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; -}