From patchwork Mon Jul 15 02:50:50 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guoqing Jiang X-Patchwork-Id: 2827270 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.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id CC878C0AB2 for ; Mon, 15 Jul 2013 02:51:48 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id DA5B92012F for ; Mon, 15 Jul 2013 02:51:47 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 9902D2012C for ; Mon, 15 Jul 2013 02:51:46 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UyYsz-0003Px-Hc; Mon, 15 Jul 2013 02:51:37 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1UyYsw-0002IQ-TR; Mon, 15 Jul 2013 02:51:34 +0000 Received: from mail-pd0-x22b.google.com ([2607:f8b0:400e:c02::22b]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UyYst-0002Hs-RH for linux-arm-kernel@lists.infradead.org; Mon, 15 Jul 2013 02:51:32 +0000 Received: by mail-pd0-f171.google.com with SMTP id y14so10265928pdi.16 for ; Sun, 14 Jul 2013 19:51:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=5BQkEhRzoPUTIf0tWICva7wqNWz6bN6YekBYh5yKgNg=; b=p96yC9+5+nOa+ustRvfGeJB4/EynyF5p/lSf0lPNg6dPD3gI/jBA2LbK9GV+NmsBe6 9thbVtPjyh7OeJ3cJwYCMm/9wLwTshXU6sPbGI8+hkJgV/SE4S1ub4F4H9n//9xkCdx4 8VcbT4QRfkBvvhnxyG8ObzbhDbLjsUZih8RDmI0V2Nnxr/yCdg0pAPqoHKTK3wH2OTNJ e7llOe62dfVehQ2VmWGqsqZkNkBesqhnBeUOvGErTXNUdDu8N45ML6vl5StChnb8SUf5 b/iehXugtXcDVpQCT6iZtKKIImWQonQyIffAsFm6tr4snG6jDxhCw+9jN9a5naw870JI 8aoQ== X-Received: by 10.66.221.2 with SMTP id qa2mr53046920pac.188.1373856665734; Sun, 14 Jul 2013 19:51:05 -0700 (PDT) Received: from [128.224.163.23] ([1.202.252.122]) by mx.google.com with ESMTPSA id ie3sm58072863pbc.13.2013.07.14.19.50.59 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 14 Jul 2013 19:51:04 -0700 (PDT) Message-ID: <51E3638A.3080103@gmail.com> Date: Mon, 15 Jul 2013 10:50:50 +0800 From: jgq516@gmail.com User-Agent: Mozilla/5.0 (X11; Linux i686 on x86_64; rv:17.0) Gecko/20130620 Thunderbird/17.0.7 MIME-Version: 1.0 To: Ben Dooks Subject: Re: v3.10 - big endian core support References: <20130712134726.0a909165@skate> <51DFEFD9.2060509@codethink.co.uk> In-Reply-To: <51DFEFD9.2060509@codethink.co.uk> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130714_225131_999136_50FB836F X-CRM114-Status: GOOD ( 21.18 ) X-Spam-Score: -1.8 (-) Cc: Thomas Petazzoni , rmk@arm.linux.org.uk, Will Deacon , "linux-arm-kernel@lists.infradead.org" , Vijay Kilari X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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.5 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable 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 On 07/12/2013 08:00 PM, Ben Dooks wrote: > On 12/07/13 12:56, Vijay Kilari wrote: >> On Fri, Jul 12, 2013 at 5:17 PM, Thomas Petazzoni >> wrote: >>> Dear Vijay Kilari, >>> >>> On Fri, 12 Jul 2013 17:09:12 +0530, Vijay Kilari wrote: >>> >>>>> Ben Dooks has a separate branch on top of this base branch for >>>>> big-endian support, that adds atags compat code to convert the ATAGs >>>>> data from LE to BE. See the baserock/311/be/atags branch in >>>>> git://git.baserock.org/delta/linux. Or >>>>> http://git.baserock.org/cgi-bin/cgit.cgi/delta/linux.git/log/?h=baserock/311/be/atags. >>>>> >>>> >>>> ARM VE TC2 board, enabling CONFIG_THUMB2_KERNEL failed to boot in >>>> BE mode >>>> It hangs at very early stage of boot >>> >>> Yeah, the Thumb2 code is not supported by Ben Dooks patches, it's part >>> of the TODO-list. I think Ben said he would probably not have much time >>> to work on this. I might be able to spare some time on this, so just >>> let me know if I should start working on this. If I remember correctly, >>> it's mainly the fixup_pv_table code that needed some Thumb2/BE love. >> >> In fact, I tried with below changes.. still it fails >> >> diff --git a/arch/arm/kernel/head.S b/arch/arm/kernel/head.S >> index 2de1114..7df64c7 100644 >> --- a/arch/arm/kernel/head.S >> +++ b/arch/arm/kernel/head.S >> @@ -592,8 +592,14 @@ __fixup_a_pv_table: >> b 2f >> 1: add r7, r3 >> ldrh ip, [r7, #2] >> +#ifdef CONFIG_CPU_ENDIAN_BE8 >> + rev ip, ip >> +#endif > > Do you need a rev16 here? I think you may have tried > reversing the full 32 bits here instead of just the > 16bits of instruction that was loaded. > Thanks Ben, 3.4 kernel booted ok with your suggested modifications. gjiang@gjiang-desktop:~/work/be-a15$ git diff root@localhost:~# zcat /proc/config.gz |grep BE8 CONFIG_CPU_ENDIAN_BE8=y CONFIG_CPU_BE8_BOOT_LE=y root@localhost:~# zcat /proc/config.gz |grep THUMB CONFIG_ARM_THUMB=y # CONFIG_ARM_THUMBEE is not set CONFIG_THUMB2_KERNEL=y CONFIG_THUMB2_AVOID_R_ARM_THM_JUMP11=y Regards, Xiao >> and ip, 0x8f00 >> orr ip, r6 @ mask in offset bits 31-24 >> +#ifdef CONFIG_CPU_ENDIAN_BE8 >> + rev ip, ip >> +#endif >> strh ip, [r7, #2] >> 2: cmp r4, r5 >> ldrcc r7, [r4], #4 @ use branch for delay slot >> >>> >>> Will, is getting Thumb2 working a requirement to get the BE support >>> merged, or can we for now make the BE option depends on >>> !THUMB2_KERNEL ? >>> >>> Thanks! >>> >>> Thomas >>> -- >>> Thomas Petazzoni, Free Electrons >>> Kernel, drivers, real-time and embedded Linux >>> development, consulting, training and support. >>> http://free-electrons.com > > diff --git a/arch/arm/kernel/head.S b/arch/arm/kernel/head.S index 0ad3af8..1a0196c 100644 --- a/arch/arm/kernel/head.S +++ b/arch/arm/kernel/head.S @@ -600,8 +600,10 @@ __fixup_a_pv_table: b 2f 1: add r7, r3 ldrh ip, [r7, #2] + rev16 ip, ip @be8 and ip, 0x8f00 orr ip, r6 @ mask in offset bits 31-24 + rev16 ip, ip @be8 strh ip, [r7, #2] 2: cmp r4, r5 ldrcc r7, [r4], #4 @ use branch for delay slot