linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: jgq516@gmail.com (jgq516 at gmail.com)
To: linux-arm-kernel@lists.infradead.org
Subject: v3.10 - big endian core support
Date: Mon, 15 Jul 2013 10:50:50 +0800	[thread overview]
Message-ID: <51E3638A.3080103@gmail.com> (raw)
In-Reply-To: <51DFEFD9.2060509@codethink.co.uk>

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
>> <thomas.petazzoni@free-electrons.com>  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 at gjiang-desktop:~/work/be-a15$ git diff
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

root at localhost:~# zcat /proc/config.gz |grep BE8
CONFIG_CPU_ENDIAN_BE8=y
CONFIG_CPU_BE8_BOOT_LE=y
root at 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
>
>

  reply	other threads:[~2013-07-15  2:50 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CALicx6u89THSiRa4FzGZrcoG8q+o_BD8qVEC4CYXEjPUVK_fJw@mail.gmail.com>
2013-07-12 11:47 ` v3.10 - big endian core support Thomas Petazzoni
2013-07-12 11:56   ` Vijay Kilari
2013-07-12 12:00     ` Ben Dooks
2013-07-15  2:50       ` jgq516 at gmail.com [this message]
2013-07-15  6:15         ` Vijay Kilari
2013-07-12 11:58   ` Ben Dooks
2013-07-12 12:06     ` Thomas Petazzoni
2013-07-12 12:33       ` Ben Dooks
2013-07-14 21:53     ` Will Deacon
2013-07-15  8:03       ` Ben Dooks
2013-07-15  8:36         ` Thomas Petazzoni
2013-07-15  9:02           ` jgq516 at gmail.com
2013-07-15 10:26           ` Ben Dooks
2013-07-15 13:17             ` Thomas Petazzoni
2013-07-16  8:00             ` jgq516 at gmail.com
2013-07-16 10:38               ` Ben Dooks
2013-07-01 11:03 Ben Dooks
2013-07-01 14:33 ` Thomas Petazzoni
2013-07-01 15:20   ` Ben Dooks
2013-07-08  5:39 ` jgq516 at gmail.com
2013-07-08  8:49   ` Will Deacon
2013-07-08  9:51     ` jgq516 at gmail.com
2013-07-08 11:02       ` Will Deacon
2013-07-08 17:03         ` Will Deacon
2013-07-09  1:18           ` jgq516 at gmail.com
2013-07-09  3:34             ` jgq516 at gmail.com
2013-07-09  7:45               ` Will Deacon
2013-07-09  9:55                 ` jgq516 at gmail.com
2013-07-09 10:04                   ` jgq516 at gmail.com
2013-07-09 15:36           ` Thomas Petazzoni
2013-07-08  9:58   ` Ben Dooks
2013-07-08 10:03     ` jgq516 at gmail.com
2013-07-08 11:10       ` Ben Dooks
2013-07-09  9:53         ` jgq516 at gmail.com
2013-07-09  9:59           ` Ben Dooks

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=51E3638A.3080103@gmail.com \
    --to=jgq516@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).