https://bugzilla.kernel.org/show_bug.cgi?id=16292





--- Comment #10 from Bob Zhang <bob_zhang2...@tom.com>  2010-06-30 15:12:16 ---
,     Good , I have tested your commands from EFI 7 times. I always successed. 



This is my steps:

Shell>

Shell>

Shell> mm 400 -w 2 -io -n

IO  0x0000000000000400 : 0x0011



Shell> mm 404 1c01 -w 2 -io -n



Shell> mm 404 3c01 -w 2 -io -n





[ilo00237d445efc]</> hpiLO-> cm           ###switch cm mode : 



[ilo00237d445efc] CM:hpiLO-> ps



PS

For System Processor Status see the SS command.



System Power state  : Off          #this will indicate that power has been off.

System Power usage  : 22 Watts used in Auxiliary Mode

Ambient temperature : 25 C

Temperature status  : Normal





Power supplies                State

--------------------------------------------------------------

Power Supply 1                Normal

Power Supply 2                Not Installed





Fans                          State

--------------------------------------------------------------

Fan Unit 1                    Normal

Fan Unit 2                    Normal

Fan Unit 3                    Normal

Fan Unit 4                    Normal

Fan Unit 5                    Normal

Fan Unit 6                    Normal





But I can’t use debug menu MFW to check bit 0 of the FPGA register . I am not
familiar with hardware testing and debugging, could you give me some more
details information ?thanks very much! 





2,  I also checked my driver (located in Linux kernel from Linux acpi group).  



why your actions can result in power off, but for my code , sometimes
successed, and sometimes failure ?

As you said , in this time, I must read bit 0 of FPGA to verify if FPGA worked
well .



Attachment is kernel’s acpi code related shutdown named
“acpi_enter_sleep_state() which control SLP_TYPx and SLP_EN” , if you are
interested in it ,we can compare  the actions my driver did with your actions
from EFI command.



I think our core actions are basic same, 

As ACPI spec, core actions should be :



-        Write sleep type into SLP_TYPx bit of PM1Acontrol register and
PM1Bcontrol register

-        Write 1 to SLP_EN bit of PM1Acontrol register and PM1Bcontrol register 



From your EFI command, it seems that, you didn’t differ PM1Acontrol and
PM1Bcontrol , you only write a register address 0x400(it should be PM1Acontrol
register).



Following is my writing register information:

all flow is :

1, disable Clear wake status         

2, Clear all fixed and general purpose status bits                 #same with
yours . after clear,then I read it again , 0x0000

3, will Disable/clear all GPES

4, will Enable all wakeup GPES  -

5, assert SLP_TYPx and write into PM1A_CNT and PM1B_CNT     #same with yours
,also 0x1c01

5, assert SLP_EN bit, and write into PM1A_CNT and PM1B_CNT  #same with
yours,also 0x3c01

6, After that, delay 10s to write 1 to PM1_CNT register ‘s SLP_EN bit (equal of
step 5. Once again)



Welcome your comments for this comments from open source, for sentosa , do we
need it ?? I don’t think ,we need it. 

if (sleep_state > ACPI_STATE_S3) {   //this code is not written by me , but
from Linux-acpi open source group.

       /*

        * We wanted to sleep > S3, but it didn't happen (by virtue of the

        * fact that we are still executing!)

        *

        * Wait ten seconds, then try again. This is to get S4/S5 to work on

        * all machines.

        *

        * We wait so long to allow chipsets that poll this reg very slowly to

        * still read the right value. Ideally, this block would go

        * away entirely.

        */

       acpi_os_stall(10000000);   //delay 10 seconds. 

       // only set SLP_EN of PM1Control register.

       status = acpi_hw_register_write(ACPI_REGISTER_PM1_CONTROL,  

                     sleep_enable_reg_info->

                     access_bit_mask);



7, After that ,will be in a dead loop to check if ACPI_BITREG_WAKE_STATUS has
been changed 1 by hardware. If set ok, break from the loop. 





My question is that :

4.7.3.2.1 PM1 Control Registers

Register Location: <PM1a_CNT_BLK / PM1b_CNT_BLK> System I/O or Memory Space

Default Value: 00h

Attribute: Read/Write

Size: PM1_CNT_LEN

The PM1 control registers contain the fixed hardware feature control bits.
These bits can be split between

two registers: PM1a_CNT or PM1b_CNT. Each register grouping can be at a
different 32-bit aligned

address and is pointed to by the PM1a_CNT_BLK or PM1b_CNT_BLK. The values for
these pointers to

the register space are found in the FADT. Accesses to PM1 control registers are
accessed through byte and

word accesses



For acpi , why differ PM1Acontrol and PM1B control ? 

PM1AControl is enough ? I need to wirte the same value into PM1Bcontrol ?  











Following is my registers controlling follow. Could you give me some comments ?
thanks very much!



I explain the output format ,just like :

hwregs-0785 [E000000183320000] [05] hw_low_level_read     : Read:  00000011
width 16 from 0000000000000400 (SystemIO)

it represents that ,from 0x400 address (system IO)  ,read a value 0x11 , width
16, 

just like your “mm 400 -w 2 -io -n”



Power down.

acpi_power_off called

 hwsleep-0279 [E000000183320000] [02] enter_sleep_state     : ----Entry

bobdebug: into function(acpi_enter_sleep_state) , in file
(drivers/acpi/hardware/hwsleep.c) , line (281) 

sleep_state=5





// --------------------------  disable Clear wake status 
-----------------------------------

  hwregs-0331 [E000000183320000] [03] set_register          : ----Entry
00000006

  hwregs-0597 [E000000183320000] [04] hw_register_write     : ----Entry

  hwregs-0481 [E000000183320000] [05] hw_register_read      : ----Entry

  hwregs-0785 [E000000183320000] [05] hw_low_level_read     : Read:  00000011
width 16 from 0000000000000400 (SystemIO)

  hwregs-0563 [E000000183320000] [05] hw_register_read      : ----Exit- AE_OK

  hwregs-0854 [E000000183320000] [04] hw_low_level_write    : Wrote: 00008000
width 16   to 0000000000000400 (SystemIO)

  hwregs-0717 [E000000183320000] [04] hw_register_write     : ----Exit- AE_OK

  hwregs-0456 [E000000183320000] [03] set_register          : Set bits:
00008000 actual 00000000 register 1

  hwregs-0457 [E000000183320000] [03] set_register          : ----Exit- AE_OK



// -------------------------Clear all fixed and general purpose status bits 
------------------

  hwregs-0070 [E000000183320000] [03] hw_clear_acpi_status  : ----Entry

  hwregs-0074 [E000000183320000] [03] hw_clear_acpi_status  : About to write
8731 to 0400

  hwregs-0597 [E000000183320000] [04] hw_register_write     : ----Entry

  hwregs-0481 [E000000183320000] [05] hw_register_read      : ----Entry

  hwregs-0785 [E000000183320000] [05] hw_low_level_read     : Read:  00000011
width 16 from 0000000000000400 (SystemIO)

  hwregs-0563 [E000000183320000] [05] hw_register_read      : ----Exit- AE_OK

  hwregs-0854 [E000000183320000] [04] hw_low_level_write    : Wrote: 00008731
width 16   to 0000000000000400 (SystemIO)

                                                //0x8731 (1000 0111 0011 0001)
:  bit[15]:1 , bit[8,9,10]:1 ,bit[4-5]:1 bit[0]:1

  hwregs-0717 [E000000183320000] [04] hw_register_write     : ----Exit- AE_OK

  //  Clear the GPE Bits in all GPE registers in all GPE blocks

  hwregs-0854 [E000000183320000] [04] hw_low_level_write    : Wrote: 000000FF
width  8   to 0000000000000420 (SystemIO)

  hwregs-0854 [E000000183320000] [04] hw_low_level_write    : Wrote: 000000FF
width  8   to 0000000000000421 (SystemIO)

  hwregs-0854 [E000000183320000] [04] hw_low_level_write    : Wrote: 000000FF
width  8   to 0000000000000422 (SystemIO)

  hwregs-0854 [E000000183320000] [04] hw_low_level_write    : Wrote: 000000FF
width  8   to 0000000000000423 (SystemIO)

  hwregs-0854 [E000000183320000] [04] hw_low_level_write    : Wrote: 000000FF
width  8   to 0000000000000424 (SystemIO)

  hwregs-0854 [E000000183320000] [04] hw_low_level_write    : Wrote: 000000FF
width  8   to 0000000000000425 (SystemIO)

  hwregs-0854 [E000000183320000] [04] hw_low_level_write    : Wrote: 000000FF
width  8   to 0000000000000426 (SystemIO)

  hwregs-0854 [E000000183320000] [04] hw_low_level_write    : Wrote: 000000FF
width  8   to 0000000000000427 (SystemIO)

  hwregs-0101 [E000000183320000] [03] hw_clear_acpi_status  : ----Exit- AE_OK 

 //after acpi_hw_clear_acpi_status() 

  hwregs-0481 [E000000183320000] [03] hw_register_read      : ----Entry

  hwregs-0785 [E000000183320000] [03] hw_low_level_read     : Read:  00000000
width 16 from 0000000000000400 (SystemIO)

  hwregs-0563 [E000000183320000] [03] hw_register_read      : ----Exit- AE_OK







// ----------------------    will Disable/clear all GPES 
---------------------------------

   hwgpe-0428 [E000000183320000] [03] hw_disable_all_gpes   : ----Entry

  hwregs-0854 [E000000183320000] [04] hw_low_level_write    : Wrote: 00000000
width  8   to 0000000000000428 (SystemIO)

  hwregs-0854 [E000000183320000] [04] hw_low_level_write    : Wrote: 00000000
width  8   to 0000000000000429 (SystemIO)

  hwregs-0854 [E000000183320000] [04] hw_low_level_write    : Wrote: 00000000
width  8   to 000000000000042A (SystemIO)

  hwregs-0854 [E000000183320000] [04] hw_low_level_write    : Wrote: 00000000
width  8   to 000000000000042B (SystemIO)

  hwregs-0854 [E000000183320000] [04] hw_low_level_write    : Wrote: 00000000
width  8   to 000000000000042C (SystemIO)

  hwregs-0854 [E000000183320000] [04] hw_low_level_write    : Wrote: 00000000
width  8   to 000000000000042D (SystemIO)

  hwregs-0854 [E000000183320000] [04] hw_low_level_write    : Wrote: 00000000
width  8   to 000000000000042E (SystemIO)

  hwregs-0854 [E000000183320000] [04] hw_low_level_write    : Wrote: 00000000
width  8   to 000000000000042F (SystemIO)

  hwregs-0854 [E000000183320000] [04] hw_low_level_write    : Wrote: 000000FF
width  8   to 0000000000000420 (SystemIO)

  hwregs-0854 [E000000183320000] [04] hw_low_level_write    : Wrote: 000000FF
width  8   to 0000000000000421 (SystemIO)

  hwregs-0854 [E000000183320000] [04] hw_low_level_write    : Wrote: 000000FF
width  8   to 0000000000000422 (SystemIO)

  hwregs-0854 [E000000183320000] [04] hw_low_level_write    : Wrote: 000000FF
width  8   to 0000000000000423 (SystemIO)

  hwregs-0854 [E000000183320000] [04] hw_low_level_write    : Wrote: 000000FF
width  8   to 0000000000000424 (SystemIO)

  hwregs-0854 [E000000183320000] [04] hw_low_level_write    : Wrote: 000000FF
width  8   to 0000000000000425 (SystemIO)

  hwregs-0854 [E000000183320000] [04] hw_low_level_write    : Wrote: 000000FF
width  8   to 0000000000000426 (SystemIO)

  hwregs-0854 [E000000183320000] [04] hw_low_level_write    : Wrote: 000000FF
width  8   to 0000000000000427 (SystemIO)

   hwgpe-0432 [E000000183320000] [03] hw_disable_all_gpes   : ----Exit- AE_OK



 /// -------------------------------------- will Enable all wakeup GPES 
------------------------------

   hwgpe-0473 [E000000183320000] [03] hw_enable_all_wakeup_g: ----Entry

   hwgpe-0476 [E000000183320000] [03] hw_enable_all_wakeup_g: ----Exit- AE_OK





//------------------------------ Read old PM1AControl ------------

  hwregs-0481 [E000000183320000] [03] hw_register_read      : ----Entry

  hwregs-0785 [E000000183320000] [03] hw_low_level_read     : Read:  00000001
width 16 from 0000000000000404 (SystemIO)

  hwregs-0563 [E000000183320000] [03] hw_register_read      : ----Exit- AE_OK

line 371: PM1Acontrol=0x1





// ----------------- ---------------assert SLP_TYPx -----------------------

line 397: PM1Acontrol=0x1c01

line 398: PM1Bcontrol=0x1c01

  hwregs-0597 [E000000183320000] [03] hw_register_write     : ----Entry

  hwregs-0854 [E000000183320000] [03] hw_low_level_write    : Wrote: 00001C01
width 16   to 0000000000000404 (SystemIO)

  hwregs-0717 [E000000183320000] [03] hw_register_write     : ----Exit- AE_OK



  hwregs-0597 [E000000183320000] [03] hw_register_write     : ----Entry

  hwregs-0717 [E000000183320000] [03] hw_register_write     : ----Exit- AE_OK





// --------------- assert SLP_EN bit .

line 425: PM1Acontrol=0x3c01

line 426: PM1Bcontrol=0x3c01



// write 0x3c01 into PM1Acontrol and PM1Bcontrol 

till now , printk can't work any longer.

-- 
Configure bugmail: https://bugzilla.kernel.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
You are watching the assignee of the bug.
------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
acpi-bugzilla mailing list
acpi-bugzilla@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/acpi-bugzilla

Reply via email to