… unfortunately without a battery. This means the RTC will run as long is power is applied to the board. It survives a software power-off or software reset, but when you pull the power plug it will stop. Not ideal, but better than nothing…
It’s part of the MT6323 PMIC (the voltage regulator). A few days ago Sean Wang from Mediatek posted a patchset which seems to work just fine even though it’s not yet part of the kernel. You can find his first version (all-in-on for kernel 4.14) as part of my Yocto repo here:
along with his patch to add poweroff support - which also works for me:
It requires an addition to the PMIC wrapper (‘pwrap’) section of the devicetree:
I didn’t measure power consumption, I just noticed all LEDs going off. Given that the code is for the PMIC, it’s probably fair to assume that stuff that’s not powered by the PMIC will remain powered on.
@jofri
with this patches, power-button now acts as real power-button, which triggers power-off on running system at the moment of pressung it. can this be changed (time to press,disable) without affecting the poweroff?
some people have soldered power-pins (to bootup on powersupply available) which now causes a boot-loop
# Clock driver for MediaTek SoC
#
CONFIG_COMMON_CLK_MEDIATEK=y
CONFIG_COMMON_CLK_MT2701=y
# CONFIG_COMMON_CLK_MT2701_MMSYS is not set
# CONFIG_COMMON_CLK_MT2701_IMGSYS is not set
# CONFIG_COMMON_CLK_MT2701_VDECSYS is not set
CONFIG_COMMON_CLK_MT2701_HIFSYS=y
CONFIG_COMMON_CLK_MT2701_ETHSYS=y
# CONFIG_COMMON_CLK_MT2701_BDPSYS is not set
# CONFIG_COMMON_CLK_MT2701_AUDSYS is not set
# CONFIG_COMMON_CLK_MT2701_G3DSYS is not set
CONFIG_COMMON_CLK_MT7622=y
# CONFIG_COMMON_CLK_MT7622_ETHSYS is not set
# CONFIG_COMMON_CLK_MT7622_HIFSYS is not set
# CONFIG_COMMON_CLK_MT7622_AUDSYS is not set
CONFIG_COMMON_CLK_MT8135=y
CONFIG_COMMON_CLK_MT8173=y
# CONFIG_HWSPINLOCK is not set
ok, 4.14 currently supports much more features like hdmi (second gmac, hnat, …) which may cause more options…basic hdmi-patches (by mediatek) maybe included, but at least dts-nodes and fbdev is missing
@jofri: if i activate rtc_class=y (see my defconfig in 4.19-rc) i get the following errors:
CC drivers/rtc/rtc-mt6397.o
In file included from drivers/rtc/rtc-mt6397.c:13:
./include/linux/mfd/mt6397/core.h:59:15: error: field 'irqlock' has incomplete type
struct mutex irqlock;
^~~~~~~
drivers/rtc/rtc-mt6397.c:320:34: error: array type has incomplete element type 'struct of_device_id'
static const struct of_device_id mt6397_rtc_of_match[] = {
^~~~~~~~~~~~~~~~~~~
drivers/rtc/rtc-mt6397.c:321:4: error: field name not in record or union initializer
{ .compatible = "mediatek,mt6323-rtc", },
^
drivers/rtc/rtc-mt6397.c:321:4: note: (near initialization for 'mt6397_rtc_of_match')
drivers/rtc/rtc-mt6397.c:322:4: error: field name not in record or union initializer
{ .compatible = "mediatek,mt6397-rtc", },
^
drivers/rtc/rtc-mt6397.c:322:4: note: (near initialization for 'mt6397_rtc_of_match')
drivers/rtc/rtc-mt6397.c:320:34: warning: 'mt6397_rtc_of_match' defined but not used [-Wunused-variable]
static const struct of_device_id mt6397_rtc_of_match[] = {
^~~~~~~~~~~~~~~~~~~
scripts/Makefile.build:307: recipe for target 'drivers/rtc/rtc-mt6397.o' failed
make[2]: *** [drivers/rtc/rtc-mt6397.o] Error 1
scripts/Makefile.build:548: recipe for target 'drivers/rtc' failed
make[1]: *** [drivers/rtc] Error 2
Makefile:1057: recipe for target 'drivers' failed
make: *** [drivers] Error 2
can you take a look at this? First one seems to be missing include