From mboxrd@z Thu Jan 1 00:00:00 1970 From: Julien Grall Subject: Re: [PATCH V3 33/41] xen/arm: Add versatile express platform Date: Fri, 10 May 2013 15:00:54 +0100 Message-ID: <518CFD96.8090209@linaro.org> References: <1368152307-598-1-git-send-email-julien.grall@linaro.org> <1368152307-598-34-git-send-email-julien.grall@linaro.org> <1368179099.27857.45.camel@zakaz.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1368179099.27857.45.camel@zakaz.uk.xensource.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Ian Campbell Cc: Stefano Stabellini , "patches@linaro.org" , "xen-devel@lists.xen.org" List-Id: xen-devel@lists.xenproject.org On 05/10/2013 10:44 AM, Ian Campbell wrote: >> @@ -91,6 +93,47 @@ out: >> } >> >> /* >> + * TODO: Get base address from the device tree >> + * See arm,vexpress-reset node >> + */ >> +static void vexpress_reset(void) >> +{ >> + void __iomem *base; >> + void __iomem *sp810; >> + >> + /* Use the SP810 system controller to force a reset */ >> + base = ioremap_attr(SP810_ADDRESS & PAGE_MASK, PAGE_SIZE, >> + PAGE_HYPERVISOR_NOCACHE); >> + if ( !base ) >> + { >> + dprintk(XENLOG_ERR, "Unable to map SP810\n"); >> + return; >> + } >> + >> + sp810 = base + (SP810_ADDRESS & ~PAGE_MASK); > > Didn't I see you making vunmap, which iounmap is based on, take care of > the page offsets itself in an earlier patch? Or is that not the reason > you are going through the base + offset dance? I wasn't not sure if you will accept ioremap(..., 8); I will fix the patch. > >> + >> + /* switch to slow mode */ >> + iowritel(sp810, 0x3); >> + dsb(); isb(); >> + /* writing any value to SCSYSSTAT reg will reset the system */ >> + iowritel(sp810 + 4, 0x1); >> + dsb(); isb(); > > Hopefully we don't get here ;-) > >> + iounmap(base); >> +} >> + > -- Julien