Jump to content

A20-SOM wake up from NMI_N


PaulMorrison

Recommended Posts

I am making some testing over A20-SOM from Olimex. I have a signal connected to NMI_N pin and with a legacy distribution, with power_start=0 on FEX, I am able to poweroff the board from command line (while the board is still powered) and then poweron/weakup the board raising up the signal on NMI_N.

However, I need to do this on an armbian mainline distribution. I poweroff the board from command line (but keep the board powered), the PWR_LED keeps turn on and the board should wakeup when I turn on the signal on NMI_N and it does on my legacy distribution but not in armbian.

Has anyone any clue, advice/tip to make this work in armbian? I really don't know where to start. 

 

if this helps, here are the docs of A20-SOM and AXP209:

http://dl.linux-sunxi.org/AXP/AXP209_Datasheet_v1.0en.pdf

https://www.olimex.com/Products/SOM/A20/A20-SOM/resources/A20-SOM-user-manual.pdf

 


Many thanks for considering my request!

Link to comment
Share on other sites

2 hours ago, PaulMorrison said:

I have a signal connected to NMI_N pin and with a legacy distribution, with power_start=0 on FEX, I am able to poweroff the board from command line (while the board is still powered) and then poweron/weakup the board raising up the signal on NMI_N.

What exact Kernel & Distribution were you using here ?

 

2 hours ago, PaulMorrison said:

an armbian mainline distribution.

copy the Link of: armbianmonitor -u

 

Link to comment
Share on other sites

4 hours ago, PaulMorrison said:

I am able to poweroff the board from command line (while the board is still powered) and then poweron/weakup the board raising up the signal on NMI_N.

It is not powered off completely in this state, it is sitting in a standby mode in the legacy u-boot.

 

4 hours ago, PaulMorrison said:

However, I need to do this on an armbian mainline distribution. I poweroff the board from command line (but keep the board powered), the PWR_LED keeps turn on and the board should wakeup when I turn on the signal on NMI_N and it does on my legacy distribution but not in armbian.

Both mainline u-boot and kernel do not support such functionality unless you implement it by yourself.

Link to comment
Share on other sites

3 hours ago, Tido said:

What exact Kernel & Distribution were you using here ? 

 

copy the Link of: armbianmonitor -u

 

 

I'm using Armbian_5.41_Olimex-som-a20_Debian_stretch_next_4.14.40

i will post armbianmonitor -u later, need to fix something first but I can try attach armhwinfo.log if that helps

 

 

 

2 hours ago, zador.blood.stained said:

It is not powered off completely in this state, it is sitting in a standby mode in the legacy u-boot.

 

Both mainline u-boot and kernel do not support such functionality unless you implement it by yourself.

 

standby ok, but i was able to do it in legacy without implementing anything

 

Link to comment
Share on other sites

35 minutes ago, PaulMorrison said:

i was able to do it in legacy without implementing anything

Yes, this is already implemented in the legacy/BSP stack. Since mainline u-boot and kernel were made from scratch rather than by porting the Allwinner code, this functionality and many other things were not added.

Link to comment
Share on other sites

On 6/15/2018 at 4:35 PM, zador.blood.stained said:

Yes, this is already implemented in the legacy/BSP stack. Since mainline u-boot and kernel were made from scratch rather than by porting the Allwinner code, this functionality and many other things were not added.

 

This is what I was looking for, thanks. I really need to implement this for mainline, has anyone any clue, advice/tip ?

 

Any alternative to wake up from suspend/hibernate would be usefull as well

Link to comment
Share on other sites

1 hour ago, PaulMorrison said:

I really need to implement this for mainline, has anyone any clue, advice/tip ?

You may want to look at the legacy stack implementation:

  • when power_start != 1 kernel reboots instead of shutting down, so you have to modify or replace the poweroff hook
  • AXP209 PMIC "scratchpad" registers are used as a non-volatile storage to hold the suspend/wait for interrupts flag
  • u-boot checks the PMIC scratchpad to differentiate between normal boot, normal reboot and reboot to suspend
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines