All of lore.kernel.org
 help / color / mirror / Atom feed
From: Julien Grall <julien.grall@arm.com>
To: Andre Przywara <andre.przywara@arm.com>,
	Awais Masood <awais.masood@vadion.com>,
	xen-devel@lists.xenproject.org
Cc: Stefano Stabellini <sstabellini@kernel.org>,
	Xen-devel <xen-devel@lists.xen.org>
Subject: Re: [PATCH v2 1/2] xen/arm64: Add Support for Allwinner H5 (sun50i)
Date: Tue, 3 Oct 2017 12:32:56 +0100	[thread overview]
Message-ID: <bc160f56-7954-a037-a300-d8a95c26978e@arm.com> (raw)
In-Reply-To: <eb3d0a61-2eee-6f40-4f4e-0d5708ff5eac@arm.com>

On 28/09/17 23:49, Andre Przywara wrote:
> Hi,

Hi,

> On 09/28/2017 01:03 PM, Julien Grall wrote:
>>
>>>   #define SUNXI_WDT_MODE            0x04
>>> -#define SUNXI_WDT_MODEADDR        (SUNXI_WDT_BASE + SUNXI_WDT_MODE)
>>>   #define SUNXI_WDT_MODE_EN         (1 << 0)
>>>   #define SUNXI_WDT_MODE_RST_EN     (1 << 1)
>>> -static void sunxi_reset(void)
>>> +static void sunxi_reset(u32 base)
>>>   {
>>>       void __iomem *wdt;
>>> -    wdt = ioremap_nocache(SUNXI_WDT_MODEADDR & PAGE_MASK, PAGE_SIZE);
>>> +    wdt = ioremap_nocache((base + SUNXI_WDT_MODE) & PAGE_MASK, 
>>> PAGE_SIZE);
>>>       if ( !wdt )
>>>       {
>>>           dprintk(XENLOG_ERR, "Unable to map watchdog register!\n");
>>> @@ -42,19 +42,35 @@ static void sunxi_reset(void)
>>>       /* Enable watchdog to trigger a reset after 500 ms: */
>>>       writel(SUNXI_WDT_MODE_EN | SUNXI_WDT_MODE_RST_EN,
>>> -      wdt + (SUNXI_WDT_MODEADDR & ~PAGE_MASK));
>>> +      wdt + ((base + SUNXI_WDT_MODE) & ~PAGE_MASK));
>>>       iounmap(wdt); >
>>>       for (;;)
>>>           wfi();
>>>   }
>>>
>>> -static const char * const sunxi_dt_compat[] __initconst =
>>> +static void sunxi_a20_reset(void)
>>> +{
>>> +    sunxi_reset(SUNXI_WDT_A20_BASE);
>>> +}
>>> +
>>> +static void sunxi_h5_reset(void)
>>> +{
>>> +    sunxi_reset(SUNXI_WDT_H5_BASE);
>>
>> If I read correctly the Device-Tree for 
>> (linux/arch/arm64/boot/dts/allwinner/sun50i-h5.dtsi), the firmware is 
>> supporting PSCI 0.2.
>>
>> PSCI 0.2 provides call for power-off/reset, so implementation the 
>> reset callback should not be necessary.
> 
> Yes, indeed, on the H5 PSCI 0.2 reset works via ATF.
> 
>> Similarly the cubietrucks we have in osstest are using PSCI 0.2 and 
>> should not need the reset. Andre do you know if it is the case for all 
>> the A20?
> 
> It claims 0.2, but in fact it seems not to be fully compliant, as (from 
> looking at the code) U-Boot lacks the reset and poweroff calls. But it 
> looks rather straight-forward to add them, as U-Boot knows how to reset 
> and one would just need to wire up psci_system_reset to this.

Hmmm ok :/. Please ignore my suggestion below to drop reset callback for 
all the allwinner platforms.

Cheers,

-- 
Julien Grall

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

  parent reply	other threads:[~2017-10-03 11:32 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-19 13:38 [PATCH 0/2] xen/arm64/ns16550: Support for Allwinner H5 SoC Awais Masood
2017-09-19 13:38 ` [PATCH 1/2] xen/arm64: Add Support for Allwinner H5 (sun50i) Awais Masood
2017-09-19 13:50   ` Jan Beulich
2017-09-19 13:38 ` [PATCH 2/2] xen/ns16550: Fix ISR lockup on Designware 8250 (H5) Awais Masood
2017-09-19 13:49   ` Jan Beulich
2017-09-26  9:37 ` [PATCH v2 0/2] xen/arm64/ns16550: Support for Allwinner H5 SoC Awais Masood
2017-09-26  9:37   ` [PATCH v2 1/2] xen/arm64: Add Support for Allwinner H5 (sun50i) Awais Masood
2017-09-28 20:03     ` Julien Grall
2017-09-28 22:49       ` Andre Przywara
2017-09-29 16:35         ` Andre Przywara
2017-10-04  9:16           ` Awais Masood
2017-10-04  9:26             ` Andre Przywara
2017-10-04  9:39               ` Awais Masood
2017-10-04 10:03                 ` Andre Przywara
2017-10-03 11:32         ` Julien Grall [this message]
2017-09-26  9:37   ` [PATCH v2 2/2] xen/ns16550: Fix ISR lockup on Designware 8250 (H5) Awais Masood
2017-09-26 11:58     ` Jan Beulich
2017-10-04 11:44   ` [PATCH v3] xen/ns16550: Fix ISR lockup on Allwinner uart Awais Masood
2017-10-06 14:50     ` Jan Beulich
2017-10-10 23:59     ` Stefano Stabellini

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=bc160f56-7954-a037-a300-d8a95c26978e@arm.com \
    --to=julien.grall@arm.com \
    --cc=andre.przywara@arm.com \
    --cc=awais.masood@vadion.com \
    --cc=sstabellini@kernel.org \
    --cc=xen-devel@lists.xen.org \
    --cc=xen-devel@lists.xenproject.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.