qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] Support system reset in Exynos4210


From: Dmitry Zhurikhin
Subject: Re: [Qemu-devel] [PATCH] Support system reset in Exynos4210
Date: Wed, 04 Apr 2012 16:35:41 +0400
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-GB; rv:1.9.2.27) Gecko/20120216 Lightning/1.0b2 Thunderbird/3.1.19

On 2012-04-04 15:55, Maksim Kozlov wrote:
> 04.04.2012 14:08, Dmitry Zhurikhin пишет:
>> Reset the system when 1 is written to SWRESET register
>>
>> Signed-off-by: Dmitry Zhurikhin<address@hidden>
>> ---
>>   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 *opaque,
>> target_phys_addr_t offset,
>>           if (reg_p->offset == 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] = val;
>>               return;
>>           }
> It's not quite well. At first, when you do reset, appropriate status
> 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 PMU
> 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 procedure
depending on the values of these registers.  I haven't found any such
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. 
Anyway this information is unfortunately absent in Exynos4210 public
documentation.
>
> And use #define for registers and fields of the registers. It's more
> clearly, as for me.
As you say.
>
> Regards,
> MK

    Regards,
    Dmitry



reply via email to

[Prev in Thread] Current Thread [Next in Thread]