From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:54961) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SFStP-0002kQ-Oe for qemu-devel@nongnu.org; Wed, 04 Apr 2012 12:17:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SFStA-0000Pu-6D for qemu-devel@nongnu.org; Wed, 04 Apr 2012 12:17:05 -0400 Received: from mailout3.w1.samsung.com ([210.118.77.13]:63282) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SFSt9-0000Ow-WB for qemu-devel@nongnu.org; Wed, 04 Apr 2012 12:16:52 -0400 Received: from euspt2 ([210.118.77.13]) by mailout3.w1.samsung.com (Sun Java(tm) System Messaging Server 6.3-8.04 (built Jul 29 2009; 32bit)) with ESMTP id <0M1Y00FYCQJF6N80@mailout3.w1.samsung.com> for qemu-devel@nongnu.org; Wed, 04 Apr 2012 17:16:27 +0100 (BST) Received: from [106.109.9.187] by spt2.w1.samsung.com (iPlanet Messaging Server 5.2 Patch 2 (built Jul 14 2004)) with ESMTPA id <0M1Y00BCRQJSW3@spt2.w1.samsung.com> for qemu-devel@nongnu.org; Wed, 04 Apr 2012 17:16:41 +0100 (BST) Date: Wed, 04 Apr 2012 20:16:35 +0400 From: Maksim Kozlov In-reply-to: <4F7C401D.4000502@ispras.ru> Message-id: <4F7C73E3.4000100@samsung.com> MIME-version: 1.0 Content-type: text/plain; charset=UTF-8; format=flowed Content-transfer-encoding: QUOTED-PRINTABLE References: <1333534133-9917-1-git-send-email-zhur@ispras.ru> <4F7C36C4.2070500@samsung.com> <4F7C401D.4000502@ispras.ru> Subject: Re: [Qemu-devel] [PATCH] Support system reset in Exynos4210 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Dmitry Zhurikhin Cc: Kyungmin Park , Igor Mitsyanko , qemu-devel@nongnu.org, Evgeny Voevodin , Dmitry Solodkiy 04.04.2012 16:35, Dmitry Zhurikhin =D0=BF=D0=B8=D1=88=D0=B5=D1=82: > On 2012-04-04 15:55, Maksim Kozlov wrote: >> 04.04.2012 14:08, Dmitry Zhurikhin =D0=BF=D0=B8=D1=88=D0=B5=D1= =82: >>> Reset the system when 1 is written to SWRESET register >>> >>> Signed-off-by: Dmitry Zhurikhin >>> --- >>> hw/exynos4210_pmu.c | 11 +++++++++++ >>> 1 files changed, 11 insertions(+), 0 deletions(-) >>> >>> diff --git a/hw/exynos4210_pmu.c b/hw/exynos4210_pmu.c >>> index c12d750..edf6e34 100644 >>> --- a/hw/exynos4210_pmu.c >>> +++ b/hw/exynos4210_pmu.c >>> @@ -25,6 +25,7 @@ >>> */ >>> >>> #include "sysbus.h" >>> +#include "sysemu.h" >>> >>> #ifndef DEBUG_PMU >>> #define DEBUG_PMU 0 >>> @@ -422,6 +423,16 @@ static void exynos4210_pmu_write(void *opaqu= e, >>> target_phys_addr_t offset, >>> if (reg_p->offset =3D=3D offset) { >>> PRINT_DEBUG_EXTEND("%s<0x%04x> <- 0x%04x\n", reg= _p->name, >>> (uint32_t)offset, (uint32_t)val); >>> + switch (offset) { >>> + case SWRESET: >>> + if (val& 1) { >>> + qemu_system_reset_request(); >>> + } >>> + break; >>> + default: >>> + /* Nothing */ >>> + break; >>> + } >>> s->reg[i] =3D val; >>> return; >>> } >> It's not quite well. At first, when you do reset, appropriate stat= us >> must be set in RST_STAT register. At second, not all registers in = PMU >> should be set in default value after reset, so you should change P= MU >> reset function for handling different resets (see spec) So, this >> functionality should be wrote more carefully > Well, this is the case when there is a need to modify booting proce= dure > depending on the values of these registers. I haven't found any su= ch > code in the current kernel. As I now remember saving their values = was > indeed important when we were trying to use an U-Boot bootloader. = But > as long as we are sticking with QEMU bootloader it doesn't matter. 3.4-rc1 and 2.6.36 kernels use INFORM5 register which should keep his= =20 value during sw reset. And U-Boot (which can be used instead of kerne= l=20 for some purposes) uses INFORM[456] registers which should be saved a= s well. My opinion is we should not add code which describe incorrect behavio= r=20 of the device regardless of whether kernel uses some registers or no. > Anyway this information is unfortunately absent in Exynos4210 publi= c > documentation. Hm... Really, I've just found out that public specification doesn't= =20 contain information about PMU >> >> And use #define for registers and fields of the registers. It's mo= re >> clearly, as for me. > As you say. :) >> >> Regards, >> MK > > Regards, > Dmitry > >