linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: tushar.jagad@linaro.org (Tushar Jagad)
To: linux-arm-kernel@lists.infradead.org
Subject: [RFC PATCH 3/4] ARM64: Big Endian fixes for kernel booting
Date: Wed, 16 Oct 2013 12:34:48 +0530	[thread overview]
Message-ID: <525E3A90.4070809@linaro.org> (raw)
In-Reply-To: <525D8860.7080204@codeaurora.org>

Hi Christopher,

On 10/15/2013 11:54 PM, Christopher Covington wrote:
>>   /*
>> + * Set el0-el1-el2 to Big endian
>> + */
>
> It might be helpful to say why this has to be done (each level needs to be set
> up before it's used?) and maybe list them in the order they're set up in.

Sure will cover more details in the comment.

>> +#if defined(CONFIG_CPU_BIG_ENDIAN)
>> +ENTRY(setend_be)
>> +	mrs     x21, CurrentEL
>> +        cmp     x21, #PSR_MODE_EL2t
>> +	b.ne  	setend_be_el1_el0
>
> Make sure to use tabs rather than spaces and run checkpatch.pl.

Somehow this got skipped. Thanks for pointing it out.

>
>> +
>> +setend_be_el2:
>> +	mrs     x21, sctlr_el2
>> +        mov     x22, #(1<<25)
>> +        orr     x21, x21, x22
>> +        msr     sctlr_el2, x21
>> +	isb
>> +
>> +setend_be_el1_el0:
>> +	mrs     x21, sctlr_el1
>> +        mov     x22, #(3<<24)
>> +        orr     x21, x21, x22
>> +        msr     sctlr_el1, x21
>> +	isb
>> +
>> +	ret
>> +ENDPROC(setend_be)
>> +#endif /* defined(CONFIG_CPU_BIG_ENDIAN) */
>> +
>> +/*
>>    * If we're fortunate enough to boot at EL2, ensure that the world is
>>    * sane before dropping to EL1.
>>    */
>> @@ -181,7 +210,11 @@ ENTRY(el2_setup)
>>
>>   	/* sctlr_el1 */
>>   	mov	x0, #0x0800			// Set/clear RES{1,0} bits
>> +#if defined(CONFIG_CPU_BIG_ENDIAN)
>> +	movk	x0, #0x33d0, lsl #16
>> +#else
>>   	movk	x0, #0x30d0, lsl #16
>> +#endif
>>   	msr	sctlr_el1, x0
>
> This may be easier to read if the magic number were ifdef'ed instead of the code.

Will change this as well.
-- 
Regards,
Tushar

  reply	other threads:[~2013-10-16  7:04 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-11 12:22 [RFC PATCH 0/4] Big Endian support for ARM64 kernel Ankit Jindal
2013-10-11 12:22 ` [RFC PATCH 1/4] ARM64: Add Kconfig option to enable Big Endian kernel Ankit Jindal
2013-10-15 18:09   ` Christopher Covington
2013-10-16  6:49     ` Tushar Jagad
2013-10-16 14:30       ` Christopher Covington
2013-10-11 12:22 ` [RFC PATCH 2/4] ARM64: Include appropriate byteorder for Big Endian Ankit Jindal
2013-10-11 12:22 ` [RFC PATCH 3/4] ARM64: Big Endian fixes for kernel booting Ankit Jindal
2013-10-11 12:52   ` Ankit Jindal
2013-10-15 18:24   ` Christopher Covington
2013-10-16  7:04     ` Tushar Jagad [this message]
2013-10-11 12:22 ` [RFC PATCH 4/4] ARM64: Support for 32-bit big endian userspace Ankit Jindal
2013-10-15 18:09 ` [RFC PATCH 0/4] Big Endian support for ARM64 kernel Christopher Covington
2013-10-16  8:05   ` Tushar Jagad
2013-10-16 14:40     ` Christopher Covington

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=525E3A90.4070809@linaro.org \
    --to=tushar.jagad@linaro.org \
    --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).