Closed PabloPL closed 5 years ago
Rebooting functions by using https://github.com/xc-racer99/linux/commit/e94d34cfff38ba4f42db7f2a20eaf49e38da4ad9
Still struggling with syscon-reboot-mode and syscon-poweroff to get parameters written to the INFORM registers/regular shutdown
https://github.com/xc-racer99/linux/commit/b245a366cbf101e073a47314f9eb3e220ca29284 is functional for syscon poweroff support. Needs the following added to the defconfig
CONFIG_POWER_RESET=y
CONFIG_POWER_RESET_SYSCON_POWEROFF=y
I cannot seem to get syscon-reboot-mode to even probe, so I can't test if my code above works (yes, I have modified the defconfig for it)
About syscon poweroff, i've applied it to for-upstream/aries-patches-v2 branch and when invoking shutdown, device is still showing logs on screen (last entry is "reboot: System halted"). Shouldn't power be turned off?
Umm, what command are you using to shutdown? Running "shutdown now" on Debian gives the following
[ OK ] Reached target Shutdown.
systemd-shutdow: 19 output lines suppressed due to ratelimiting
systemd-shutdown[1]: Sending SIGTERM to remaining processes...
systemd-journald[1179]: Received SIGTERM from PID 1 (systemd-shutdow).
systemd-shutdown[1]: Sending SIGKILL to remaining processes...
systemd-shutdown[1]: Unmounting file systems.
systemd-shutdown[1]: Remounting '/' read-only with options ''.
EXT4-fs (mmcblk1p1): re-mounted. Opts:
systemd-shutdown[1]: Remounting '/' read-only with options ''.
EXT4-fs (mmcblk1p1): re-mounted. Opts:
systemd-shutdown[1]: All filesystems unmounted.
systemd-shutdown[1]: Deactivating swaps.
systemd-shutdown[1]: All swaps deactivated.
systemd-shutdown[1]: Detaching loop devices.
systemd-shutdown[1]: All loop devices detached.
rebo
when building from the for-upstream/aries-patches-v2 branch
By just running shutdown. I can see in log message that board is halted, but screen is still working.
Weird. Does just pushing the power button turn it on again?
Vendor kernel read from PS_HOLD_CONTROL and then writes it back, see https://github.com/xc-racer99/android_kernel_samsung_aries/blob/aosp-7.1/arch/arm/mach-s5pv210/mach-aries.c#L4326
For my variant, reading from PS_HOLD_CONTROL gave a value of 0x5301, but I used 0x5200 as that is what is in arch/arm/boot/dts/exynos-syscon-restart.dtsi - using the value of 0x5301 didn't work as the syscon driver won't write something to the register if it's already there.
You can play around with different values in u-boot using the command
mw.b 0xe010e81c 0x5301 1
Without cable attached it's working fine (device/screen is powered off and booted by pressing button again after shutdown. Maybe it's related to unbrickable mod? Sorry for problems.
syscon poweroff was merged as part of Aries v2 patches; we still need to figure out why the S5P_SW_RESET doesn't work or else make adjusts to the watchdog driver so we can use it to reset as in the vendor kernel (and ported upstream in https://github.com/xc-racer99/linux/commit/e94d34cfff38ba4f42db7f2a20eaf49e38da4ad9)
It should be noted that when using the SD card SPL in u-boot, then S5P_SW_RESET works as one would expect.
I think we can close this, the reason that the SW_RESET doesn't work is due to a mistake in the stock bootloader. For some reason it assumes that the memory will already be setup, while in fact it isn't.
No dts changes needed? Till now only poweroff was merged.
Yep, no DTS changes needed, it works as expected when using the WIP SPL branch of u-boot.
The SW_RESET hook is hard-coded in the s5pv210 common support at https://github.com/PabloPL/linux/blob/master/arch/arm/mach-s5pv210/s5pv210.c#L71
I suppose we could set the reboot-mode entries for configuring the bootloader, but there's no standard about this. We could either match the stock bootloader or else the midas config.
I was thinking something like
for the reboot mode notifier (don't know if you can stack up the reboot modes or not... this is totally untested)