From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 205CEC433E2 for ; Tue, 1 Sep 2020 12:49:42 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E63B5206CD for ; Tue, 1 Sep 2020 12:49:41 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="qmpwVMSY"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="Gd1n54n1" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E63B5206CD Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:To:From: Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender :Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=B19IE0g6RgzolVu/xQ1BuzNCdLYWzegCGIQ78slc46s=; b=qmpwVMSYYAbkIQBDbX5H+kUoVV CozqK+oCQrLG3EMX2YdDSKEtPQEUZnERr0hh8I8Qd0McJGc/DAFypKJOjFSm1p6Z8VWUcXIYJbIYk hgqzErdNqh6FFVUP8s+51CNiOLD80dYU3KMJnXpczmFaTNsMIjs1I08XA79jkYZVfTGKnK+zjDTIn /K12DjaDlsS44nHOQUC12J5SWS+hhwzqAsByfBFShGjaQKltZpiPmEIXhwtATva96SG4kNdJNlgbF s3hQIBBOmI67jnZYQ/WvQhdimpJbWr1Hicgy70OoYvsB02vlE5Q5v6w19ficqav3Cp60MQKBbPlB9 u77aSUTg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kD5iC-0005kf-5h; Tue, 01 Sep 2020 12:48:32 +0000 Received: from mail-lj1-x244.google.com ([2a00:1450:4864:20::244]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kD5i9-0005k3-R5 for linux-arm-kernel@lists.infradead.org; Tue, 01 Sep 2020 12:48:30 +0000 Received: by mail-lj1-x244.google.com with SMTP id a15so1363126ljk.2 for ; Tue, 01 Sep 2020 05:48:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=5PW+65Kgyr+xm7Eh/qCINnYNdUa7lwuNOeyxr6poY+M=; b=Gd1n54n1e7yfHhNlgRpJmVEMKJc2xdYUrdmmWMvEDbkjO0we+maFuzhN4c2ARhJfU+ oD8uxsb4CI5qba6OhCnLPgJ2yAqTxiBfjmqA3ez2B+5AVKPcKDF9VLRf15eXo4aOuXSc /eJ1Pyb8MmLDH2IAH7TjgIEa5bZubbPy/HlQJVHyzYMN2+vGlCso7BiuceKylKDBHwTL zUc454Km1WNin6NdaZpRhlNjgV2djaUZfjLh5/dcApBovMefVTDZ/smlPskVRNG3Ddh8 ZU4q55E8bR9efZExnH4acywn0nPBfjzDYg9DaFnUqMNdyuvEhCnOV3lMbDB437CzFdEa nf+w== 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:mime-version :content-transfer-encoding; bh=5PW+65Kgyr+xm7Eh/qCINnYNdUa7lwuNOeyxr6poY+M=; b=S1nSE2Tv2+OvbZU1Iw2hemUMnQNnDuQfTPocWCXRtIgAEqjaKh/0e4lr8IE058yitR 2zixfBAGKBNIaPwyNW3w78YguOl6p6rpkPcexMNIZApofSSEWlhmZqAyFEOhH8HzWLu2 hjUBQICSj5DgClMnx92NrJ2rlHbZQ6PVUHEvaZnzbrWGV9ThM0x9LbxcV53P+flW/c6B lqXQFqByRORgeTtZj5TyXEvd+zV9lVnzpXF0ZOe7CNiiqa4VcHlw8CqK8BGbBwr3YBuB df1E5vQBCQoP2CAkrHE/V/AsXDpsiRJEPJAXKn8ZWqTxh4lNJjlO6Pmzhooo80iUbKOu nsaQ== X-Gm-Message-State: AOAM532CBKeyq2f8Wwz+2WJQ698ywQoTMfQlT3TZoWckJLkmT35Kh8zM XNv5ZzDhL+cZ2ufrbrZRDsBXHQ== X-Google-Smtp-Source: ABdhPJz/nk4Qe7fJ/2Cg9JJ0gfc3x2TDRkOxLEEvTSzUjqBhAkjf6kve6uQ2kivso0Q1j0IYGtYSLA== X-Received: by 2002:a2e:b0d2:: with SMTP id g18mr499232ljl.136.1598964508492; Tue, 01 Sep 2020 05:48:28 -0700 (PDT) Received: from genomnajs.ideon.se ([85.235.10.227]) by smtp.gmail.com with ESMTPSA id 69sm172893lfm.83.2020.09.01.05.48.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Sep 2020 05:48:28 -0700 (PDT) From: Linus Walleij To: Russell King Subject: [PATCH] ARM: uncompress: Print the location of appended DTB Date: Tue, 1 Sep 2020 14:48:26 +0200 Message-Id: <20200901124826.155357-1-linus.walleij@linaro.org> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200901_084829_894643_6F7CA383 X-CRM114-Status: GOOD ( 14.48 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Linus Walleij , linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org When using the kernel with an appended DTB it is useful to know where this will end up in the physical memory at the time the kernel boots. We add a debug print macro that will help out with this. Here is a sample debug print after passing -DDEBUG to head.S during compilation: DTB:0x40CEBA70 (0x000051B5) C:0x402080C0-0x40CF0CE0->0x41801D00-0x422EA920 DTB:0x422E56B0 (0x00005262) This means that the appended DTB is first found after the compressed kernel at 0x40CEBA70 of size 0x51B5 and then after the compressed kernel is moved to 0x41801D00 it is found again at 0x422E56B0 and is there size 0x5262. The growth in size of the FDT is due to the call to atags_to_fdt() that augments the DTB with ATAG information. Signed-off-by: Linus Walleij --- arch/arm/boot/compressed/head.S | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/arch/arm/boot/compressed/head.S b/arch/arm/boot/compressed/head.S index ce9e9e989fc6..84a6d828e6d6 100644 --- a/arch/arm/boot/compressed/head.S +++ b/arch/arm/boot/compressed/head.S @@ -113,6 +113,28 @@ #endif .endm + /* + * Debug print of the final appended DTB location + */ + .macro dbgadtb, begin, end +#ifdef DEBUG + kputc #'D' + kputc #'T' + kputc #'B' + kputc #':' + kputc #'0' + kputc #'x' + kphex \begin, 8 /* Start of appended DTB */ + kputc #' ' + kputc #'(' + kputc #'0' + kputc #'x' + kphex \end, 8 /* End of appended DTB */ + kputc #')' + kputc #'\n' +#endif + .endm + .macro enable_cp15_barriers, reg mrc p15, 0, \reg, c1, c0, 0 @ read SCTLR tst \reg, #(1 << 5) @ CP15BEN bit set? @@ -330,6 +352,7 @@ restart: adr r0, LC1 mov r5, r5, ror #8 eor r5, r5, r1, lsr #8 #endif + dbgadtb r6, r5 /* 50% DTB growth should be good enough */ add r5, r5, r5, lsr #1 /* preserve 64-bit alignment */ -- 2.26.2 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel