From patchwork Wed Mar 18 15:52:44 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Osipenko X-Patchwork-Id: 6041581 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 271F3BF90F for ; Wed, 18 Mar 2015 16:12:48 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 36EB02038D for ; Wed, 18 Mar 2015 16:12:46 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 5C4392035C for ; Wed, 18 Mar 2015 16:12:45 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1YYGWh-0002fV-E2; Wed, 18 Mar 2015 16:08:59 +0000 Received: from mail-la0-x22d.google.com ([2a00:1450:4010:c03::22d]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1YYGIW-0003V1-F2 for linux-arm-kernel@lists.infradead.org; Wed, 18 Mar 2015 15:54:21 +0000 Received: by ladw1 with SMTP id w1so39727209lad.0 for ; Wed, 18 Mar 2015 08:53:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=ERcwOvXd3btVhaEvXNTO6ZJVYmavtQf8XLm9/3gORkU=; b=Bwin+e56ZIgVCK3Xj9kl5EEvqmW0e29aHcJBnd1aixiZNFrNchd8hy7R/QJhWlVPhg q3GwkO3pQ6TCKxgWMXuHEr/v3busQyUik4FIx2CeeZGRWKTGNO+zLZDsQHaybmdKMc1c Y+oqMJBXPbdLxV4Dt1wHTaSFTcXaH8Lnw7RdULFs2qB9gXBitfKIkF8d7ileQgCn1YBv W+92hFdmjqy8bDMqe1CFEr2VqchdIeUlAfLKOiEmQXp7XeB5oWVw6+F+sAgcUU+osFLQ AByGH2J2Uj5eaAM4xkFk/J+0Er3VBH9Ncvdx+z4u00Pu5DGzgYJe4KacP+cixe+SBO9h Vmng== X-Received: by 10.152.21.99 with SMTP id u3mr64519798lae.105.1426694036369; Wed, 18 Mar 2015 08:53:56 -0700 (PDT) Received: from localhost.localdomain ([46.138.70.252]) by mx.google.com with ESMTPSA id zs4sm3458819lbb.48.2015.03.18.08.53.55 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 18 Mar 2015 08:53:55 -0700 (PDT) From: Dmitry Osipenko To: digetx@gmail.com, Russell King , Kukjin Kim , Shawn Guo , Sascha Hauer , Joseph Lo , Stephen Warren , Peter De Schrijver , Thierry Reding Subject: [PATCH v3] ARM: l2c: Maintain CPU endianness for early resume function Date: Wed, 18 Mar 2015 18:52:44 +0300 Message-Id: <1426693972-6612-1-git-send-email-digetx@gmail.com> X-Mailer: git-send-email 2.3.2 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150318_085420_806048_70050228 X-CRM114-Status: UNSURE ( 9.14 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.8 (/) Cc: linux-tegra@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP In big-endian CPU mode l2x0_saved_regs structure stores registers values in BE format. In order to maintain BE CPU mode, these values and immediate constants must be converted back to LE format before writing them to cache controller. Signed-off-by: Dmitry Osipenko Acked-by: Russell King --- Changelog: V2: no code change, fixed patch numbering, extended mail recipients list V3: added missed register reverse for 'ldr' instructions arch/arm/mm/l2c-l2x0-resume.S | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/arch/arm/mm/l2c-l2x0-resume.S b/arch/arm/mm/l2c-l2x0-resume.S index fda415e4..ecb5b74 100644 --- a/arch/arm/mm/l2c-l2x0-resume.S +++ b/arch/arm/mm/l2c-l2x0-resume.S @@ -30,9 +30,19 @@ ENTRY(l2c310_early_resume) teq r1, #0 reteq lr + @ Reverse for big-endian kernel +ARM_BE8(rev r2, r2) +ARM_BE8(rev r3, r3) +ARM_BE8(rev r4, r4) +ARM_BE8(rev r5, r5) +ARM_BE8(rev r6, r6) +ARM_BE8(rev r7, r7) +ARM_BE8(rev r8, r8) + @ The prefetch and power control registers are revision dependent @ and can be written whether or not the L2 cache is enabled ldr r0, [r1, #L2X0_CACHE_ID] +ARM_BE8(rev r0, r0) and r0, r0, #L2X0_CACHE_ID_RTL_MASK cmp r0, #L310_CACHE_ID_RTL_R2P0 strcs r7, [r1, #L310_PREFETCH_CTRL] @@ -41,6 +51,7 @@ ENTRY(l2c310_early_resume) @ Don't setup the L2 cache if it is already enabled ldr r0, [r1, #L2X0_CTRL] +ARM_BE8(rev r0, r0) tst r0, #L2X0_CTRL_EN retne lr @@ -51,6 +62,7 @@ ENTRY(l2c310_early_resume) str r2, [r1, #L2X0_AUX_CTRL] mov r9, #L2X0_CTRL_EN +ARM_BE8(rev r9, r9) str r9, [r1, #L2X0_CTRL] ret lr ENDPROC(l2c310_early_resume)