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