From patchwork Tue Dec 15 13:52:22 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Osipenko X-Patchwork-Id: 11974859 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.7 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED,DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable 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 75848C4361B for ; Tue, 15 Dec 2020 13:54:55 +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 106DB224B8 for ; Tue, 15 Dec 2020 13:54:55 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 106DB224B8 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com 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=jzrTbbJ9S0RicmXgIC9pvpdfdOEhngtlUi52AtTUkgs=; b=1VI0vx0tBc7rAWeeuaPa/r/pvo XoZiFbFe0gzuw9mzZ5+y8jhEU1rHKTPo6feoJujtjCrnJD3rPAWvPrJyDgYmTkQi1EHArc7ii4CWa yr9HbKGt9pCB7LvkRdkf3MJ9iJdFhj/JuKb6a/WRXCZIRvpwUCG2rUCx8ngPRFply2IrqSfkQrhnI UB5D95E2OKbTq7QGN0Ie7IL5hk3F3atXbeHu9MA6FsSMQPOJIzBrd6Y0Im5SLrl3Nqfd/9IBzdBgL +q3S/IpiYOsJmG3HZTfuen7UoDbCL7EakDuasKzmQ7g7EyDL68PhO5IUXKuhqtkAhB/U81Bo9VS9W e2EIit/A==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kpAlq-0004qZ-9K; Tue, 15 Dec 2020 13:53:42 +0000 Received: from mail-lf1-x144.google.com ([2a00:1450:4864:20::144]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kpAln-0004q3-VY for linux-arm-kernel@lists.infradead.org; Tue, 15 Dec 2020 13:53:40 +0000 Received: by mail-lf1-x144.google.com with SMTP id u18so39511046lfd.9 for ; Tue, 15 Dec 2020 05:53:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=gDzaS/pPeZh5EiQsya+W0nBISDtLWznXodq8DvMAkkc=; b=JQJYWAVAr9iF6vLnV7Wck1vs/TRGHWt5u2TbU/e6BR6bgmNodpmNt4jlM9WG1krWPW KVDiUAY7zRS0McEaur8CLPcLsH2SokbFWqpFrF+ZewYhUXL3q6BeRgb9Ns5CysAHCh1h +ik4nHs0o6P2Znww+lg1qdl48fYwQPEv05ZOZHg0cfhw6d3XNCb+NNs+TtB3QJmBMsu3 vHk6jZJlfTfnWl44J3sbwNHvTMEHQfsqtuSwNMmSH7I4Azj4qMkMUXvw+luTJLkO8fjs Q+abUGxFXxD/HB9EvH4qMzxTj0nPopLWA7h+3Kg9d+TT9PDbmvgi7r8+B8I4XhGkhqJO Z/6A== 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=gDzaS/pPeZh5EiQsya+W0nBISDtLWznXodq8DvMAkkc=; b=XnoIzUw+pIMUmoCjTH4HKX1VPhrcf7Czjlrn6wQKrcg94yZhTSH6pAku9GfS2R/buV 5CzFru1MtEb1HxhYL8nwW0hmxHo1DKEw1CO6iRi5ljR4FlfGRK0Gs1Pfmw/7ksm3UuDj sJjGTrcsoJTwuTxlUNJMPZL0ENtNBlv/yUMVuXaRMpMeOXY/iB3yEnOMtnpzLe/uZ8+m j0r1LxNxoVg6U+Q7z3cn/52VdgRAv4EDLIqGPIFCcHHxtZa5PwVlUX7CC0zYZkuuGm1R 4WZCQKueuoHePpP5KYFXdCT5FUmEFlvkFEBiUlmku0Y4E+j3tGVurkT+N6gKT1e/JmB/ eezA== X-Gm-Message-State: AOAM530PGdMsOcY/DKQRRjb3FvA6u06PYYns7gCt/iDAx3xvZUSgotKS 0vwKSFMeaA88lgM5u2AHboM= X-Google-Smtp-Source: ABdhPJyoiFDi6yirdb/3UJoHXAC3ipvpCvxxsUUnB7EAzueDX1L1rTCpMDe2+omlMJYQvtJi4D6OBw== X-Received: by 2002:a2e:a584:: with SMTP id m4mr3656220ljp.247.1608040417011; Tue, 15 Dec 2020 05:53:37 -0800 (PST) Received: from localhost.localdomain (109-252-192-57.dynamic.spd-mgts.ru. [109.252.192.57]) by smtp.gmail.com with ESMTPSA id v7sm214842lfg.9.2020.12.15.05.53.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Dec 2020 05:53:36 -0800 (PST) From: Dmitry Osipenko To: Thierry Reding , Jonathan Hunter , Linus Walleij Subject: [PATCH v1] ARM: tegra: Fix misplaced tegra_uart_config in decompressor Date: Tue, 15 Dec 2020 16:52:22 +0300 Message-Id: <20201215135222.6899-1-digetx@gmail.com> X-Mailer: git-send-email 2.29.2 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201215_085340_056592_2F7A0795 X-CRM114-Status: GOOD ( 18.81 ) 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: linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The tegra_uart_config of the DEBUG_LL code is now placed right at the start of the .text section after commit which enabled debug output in the decompressor. Tegra devices are not booting anymore if DEBUG_LL is enabled since tegra_uart_config data is executes as a code. Fix the misplaced tegra_uart_config storage by embedding it into the code. Cc: stable@vger.kernel.org Fixes: 2596a72d3384 ("ARM: 9009/1: uncompress: Enable debug in head.S") Signed-off-by: Dmitry Osipenko Reviewed-by: Linus Walleij --- arch/arm/include/debug/tegra.S | 54 +++++++++++++++++----------------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/arch/arm/include/debug/tegra.S b/arch/arm/include/debug/tegra.S index 98daa7f48314..7267516db0ba 100644 --- a/arch/arm/include/debug/tegra.S +++ b/arch/arm/include/debug/tegra.S @@ -149,7 +149,34 @@ .align 99: .word . +#if defined(ZIMAGE) + .word . + 4 +/* + * Storage for the state maintained by the macro. + * + * In the kernel proper, this data is located in arch/arm/mach-tegra/tegra.c. + * That's because this header is included from multiple files, and we only + * want a single copy of the data. In particular, the UART probing code above + * assumes it's running using physical addresses. This is true when this file + * is included from head.o, but not when included from debug.o. So we need + * to share the probe results between the two copies, rather than having + * to re-run the probing again later. + * + * In the decompressor, we put the storage right here, since common.c + * isn't included in the decompressor build. This storage data gets put in + * .text even though it's really data, since .data is discarded from the + * decompressor. Luckily, .text is writeable in the decompressor, unless + * CONFIG_ZBOOT_ROM. That dependency is handled in arch/arm/Kconfig.debug. + */ + /* Debug UART initialization required */ + .word 1 + /* Debug UART physical address */ + .word 0 + /* Debug UART virtual address */ + .word 0 +#else .word tegra_uart_config +#endif .ltorg /* Load previously selected UART address */ @@ -189,30 +216,3 @@ .macro waituarttxrdy,rd,rx .endm - -/* - * Storage for the state maintained by the macros above. - * - * In the kernel proper, this data is located in arch/arm/mach-tegra/tegra.c. - * That's because this header is included from multiple files, and we only - * want a single copy of the data. In particular, the UART probing code above - * assumes it's running using physical addresses. This is true when this file - * is included from head.o, but not when included from debug.o. So we need - * to share the probe results between the two copies, rather than having - * to re-run the probing again later. - * - * In the decompressor, we put the symbol/storage right here, since common.c - * isn't included in the decompressor build. This symbol gets put in .text - * even though it's really data, since .data is discarded from the - * decompressor. Luckily, .text is writeable in the decompressor, unless - * CONFIG_ZBOOT_ROM. That dependency is handled in arch/arm/Kconfig.debug. - */ -#if defined(ZIMAGE) -tegra_uart_config: - /* Debug UART initialization required */ - .word 1 - /* Debug UART physical address */ - .word 0 - /* Debug UART virtual address */ - .word 0 -#endif