crust-firmware / crust

SCP (power management) firmware for sunxi SoCs
Other
150 stars 34 forks source link

Support for Tanix TX6 #184

Closed jernejsk closed 3 years ago

jernejsk commented 3 years ago

Purpose

This PR introduces support for Tanix TX6 (H6) TV box which has a lot of cut corners. For example, it has only fixed regulators, no power button, no external 32 kHz oscillator. Only two usable wake up sources are thus RTC and CIR. But because there is no 32 kHz oscillator, this PR also adds an option for CIR to use OSC24M instead of OSC32K. Later is not accurate enough, because it's generated from internal RC oscillator.

smaeul commented 3 years ago

I pushed a rebased version of this: https://github.com/crust-firmware/crust/commits/next

Please test if it works for you on H6 with the serial driver disabled (or using R_UART) and with CIR using OSC24M. I took some shortcuts when first adding CIR support, so it doesn't actually acquire a reference to the module clock supplier. That may break with the automatic suspend depth code I added last week. It will see that OSC24M has no users and gate a bunch of things; hopefully that doesn't break CIR.

jernejsk commented 3 years ago

Your branch doesn't work without serial enabled. I guess select NEED_OSC24M should be put back?

jernejsk commented 3 years ago

Even with NEED_OSC24M it doesn't work...

jernejsk commented 3 years ago

ah, I see this symbol doesn't exist anymore

smaeul commented 3 years ago

I merged this, and modified the sunxi-cir driver to work with automatic suspend depth when using OSC24M. Due to that change, these patches are now required for IR to work after resume: https://github.com/smaeul/linux/tree/patch/ir-pm

jernejsk commented 3 years ago

With #185 in place, this works perfectly! Thanks for the help! Linux CIR patches seems clean and could get upstreamed right away.

smaeul commented 3 years ago

Thanks for the confirmation!