public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Arnab Basu <arnab.basu@freescale.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] arm64 patch: gicv3 support
Date: Mon, 10 Feb 2014 15:59:55 +0530	[thread overview]
Message-ID: <52F8AA23.9050900@freescale.com> (raw)
In-Reply-To: <450dad08.17bf3.1441ada3539.Coremail.fenghua@phytium.com.cn>

Hi David

On 10-Feb-14 1:41 PM, FengHua wrote:
> 
>>> +	/* Initialize All ReDistributors */
>>> +1:	ldr	x1, =GICR_BASE
>>> +2:	mov	w0, #~0x2
>>> +	ldr	w2, [x1, GICR_WAKER]
>>> +	and	w2, w2, w0		/* Clear ProcessorSleep */
>>> +	str	w2, [x1, GICR_WAKER]
>>> +	dsb	st
>>> +	isb
>>> +0:	ldr	w0, [x1, GICR_WAKER]
>>> +	tbnz	w0, #2, 0b		/* Wait Children be Alive */
>>> +
>>> +	add	x2, x1, #(1 << 16)	/* SGI_Base */
>>> +	mov	w5, #~0
>>> +	str	w5, [x2, GICR_IGROUPRn]
>>> +	str	wzr, [x2, GICR_IGROUPMODRn]	/* SGIs|PPIs Group1NS */
>>> +	mov	w0, #0x1		/* Enable SGI 0 */
>>> +	str	w0, [x2, GICR_ISENABLERn]
>>> +
>>> +	ldr	w0, [x1, GICR_TYPER]
>>> +	add	x1, x1, #(2 << 16)
>>> +	tbz	w0, #4, 2b		/* Next ReDistributor if Exist */
>>
>> I am not sure that this is a good idea. Why should the primary code initialize all redistributors?
>> Would it not be a better idea to make this code per cpu and let each core initialize its own
>> redistributor interface?
>>
> Yes, the redistributor could be initialized by it's corresponding processor.
> But, how could we determine the correspondence of redistributors and processors?
> It will be implementation specific and the code will be a little more complicated.
> 

Each processor should compare the affinity encoded in the GICR_TYPER[63:32] bits for all redistributors 
with the affinity encoded in its own MPIDR_EL1 and only initialize the matching redistributor.
Why will this be implementation specific?

Yes code will possibly be more complicated but it will be much more robust, consider the case when
all CPUs are not being brought out of reset simultaneously. In this case we might not want to wake
up all the redistributors.

Thanks
Arnab

  parent reply	other threads:[~2014-02-10 10:29 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-15  8:10 [U-Boot] [PATCH] arm64 patch: gicv3 support fenghua at phytium.com.cn
2014-01-15 14:19 ` bhupesh.sharma at freescale.com
2014-01-16  1:17   ` FengHua
2014-01-16  3:45     ` bhupesh.sharma at freescale.com
2014-01-16  7:21       ` FengHua
2014-02-07 10:01 ` [U-Boot] " Arnab Basu
     [not found]   ` <450dad08.17bf3.1441ada3539.Coremail.fenghua@phytium.com.cn>
2014-02-10 10:29     ` Arnab Basu [this message]
2014-02-21 16:38 ` [U-Boot] [PATCH] " Albert ARIBAUD
2014-02-24 13:22   ` FengHua

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=52F8AA23.9050900@freescale.com \
    --to=arnab.basu@freescale.com \
    --cc=u-boot@lists.denx.de \
    /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