Mainstream kernel and poweroff on imx6ull board

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Mainstream kernel and poweroff on imx6ull board

Jump to solution
3,137 Views
arthur_rythm
Contributor III

Hi,

We are currently working with an official nxp bsp (rel_imx_4.1.15_2.1.0_ga) on our custom imx6ull 

board. We are trying to move to mainstream kernel. For now the work is done on 4.19.X release.

I am able to make work my audio codec, wifi, bluetooth, etc.. correctly. I have one last issue... The power

off feature. 

By just running poweroff command in the shell on my board, the log seems good :

# poweroff

imx2-wdt 20bc000.wdog: Device shutdown: Expect reboot!
reboot: System halted

But the led are always on and I am not able to boot anymore. 

The custom board uses a pfuze3000 pmic. Eveything is working perfectly on the officiel nxp release

of course but not on the mainstream kernel.  It is like the pmic is not doing his work correctly.

There are thousands of patch on nxp bsp. Any clue about a patch to make work the poweroff 

feature on the mainstream kernel with a pmic  on imx6 board?

I tried to align the pfuze100_regulator sources, all the device tree sources, and it is always 

not working properly

Thanks,

Arthur.

Labels (3)
0 Kudos
1 Solution
2,496 Views
Sasamy
Contributor IV

Hi,

snvs_poweroff is disabled by default

imx6ul.dtsi

I think because there are several poweroff drivers (at least there is still gpio-poweroff), but only one can be used. Therefore, you just need to enable it in your DTS

imx6ul-14x14-evk.dtsi

&snvs_poweroff {
   status = "okay"; 
};

Alexander

View solution in original post

0 Kudos
5 Replies
2,496 Views
Sasamy
Contributor IV

Hi,

I think this is implemented in the Linux kernel since version 4.20

https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/arch/arm/mach-imx/pm-imx6.c?...

Alexander

0 Kudos
2,496 Views
arthur_rythm
Contributor III

Thank you for your answer. I tried to add this to my kernel and this is not working.

I have the log a the end "Unable to poweroff system"

Probably because the pmic power off sequence is not running correctly after this code :

imx6_set_lpm(STOP_POWER_OFF);
imx6q_suspend_finish(0);

I tried to test directly the 4.20 kernel on my board. Same failure on the power off.

I was able to find this very useful commit in my kernel log in on the nxp bsp: 

https://lkml.org/lkml/2018/9/12/105 

In fact my board uses PMIC_ON_REQ and not the PMIC_STBY_REQ signal. So I must no used

the  fsl,pmic-stby-poweroff system in the device tree but the syscon-poweroff instead.

On a working kernel the code to handle the poweroff is in drivers/power/reset/syscon-poweroff. The probe

and the syscon_poweroff function seems to be not trigger on mainstream kernel. There is probably

something missing in the imx6ull.dtsi or imx6ul.dtsi.

Thank you to pointing me the good direction :smileyhappy:

0 Kudos
2,497 Views
Sasamy
Contributor IV

Hi,

snvs_poweroff is disabled by default

imx6ul.dtsi

I think because there are several poweroff drivers (at least there is still gpio-poweroff), but only one can be used. Therefore, you just need to enable it in your DTS

imx6ul-14x14-evk.dtsi

&snvs_poweroff {
   status = "okay"; 
};

Alexander

0 Kudos
2,496 Views
arthur_rythm
Contributor III

Yes that's it... There  is no "disabled" in the original device tree in nxp official bsp.

Juste a "disabled" line to remove in the imx6ul.dtsi or a status okay to add to my

custom board device tree to trigger the driver and now everything is working like a charm...

0 Kudos
2,496 Views
gusarambula
NXP TechSupport
NXP TechSupport

Hello Arthur,

The mainstream kernel is not supported so we do not have much information that may be of help to get it running on the i.MX6ULL.

There are some threads on the communities of a similar behavior although in NXP’s BSPs and not in mainstream kernel. Maybe they may provide some hints:
https://community.nxp.com/thread/359508
https://community.nxp.com/thread/385097

 

There is a new 4.14.78_1.0.0 BSP Release, perhaps you could look at how the PMIC is handled there although you would need to look among the number of patches included.

Another alternative would be contacting NXP Professional Services to ask for help implementing this feature.

My apologies for the inconvenience.

Regards,

0 Kudos