-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix reboot on odroid C4 when using UHS microSD cards #4824
Conversation
Hey @ashh87 how is this different from the hack HK carries? (https://github.com/tobetter/linux/blob/odroid-6.1.y/drivers/power/reset/odroid-reboot.c) |
Hi, This is more-or-less the same thing, though I'm fairly sure I've seen a build online with that patch failing to compile. The major difference is in odroid_restart_probe, where "arm_pm_restart = do_odroid_restart;" is replaced with "register_restart_handler(&odroid_restart_handler);". The ability to use arm_pm_restart (directly) was removed at some point, so the original patch was broken, is that how meson_drv_shutdown comes into it? I'm not familiar with that. The patch here stands alone, I think. Meson64 defconfig is changed to compile the odroid-reboot module, but I've only added it to the Odroid C4 dts, so other boards shouldn't have a problem. |
@rpardini we better merge this after release, right? |
cherry-picked into armbian-next, will be included in next push |
Already merged. |
This, if working, might allow to enable UHS for odroidn2 as well as odroidc4. |
The hardkernel device trees have nodes for odroid,reboot in Odroid C4, N2 and N2 plus. The HC4 is meant to be similar hardware to the C4, but doesn't use the reboot driver in tobetter's tree, so I don't know if it is also affected by the issue. Unfortunately I don't have anything other than an Odroid C4 to test against |
Description
This fixes reboot on Odroid C4 boards which boot from UHS microSD cards. The issue has been discussed before here:
https://forum.armbian.com/topic/19340-odroid-c4-will-not-reboot-after-any-sort-of-kernel-update-have-tried-running-nand-sata-install/
A previous pull request removed a version of this patch here:
https://github.com/armbian/build/pull/3154/files#diff-8530e3af79cd8a35329d7d1a44b2a8006ad0cd70deefb0341a9933233673a9b6
The previous version of the patch was broken by upstream changes in the kernel, and this commit contains the minimal changes needed to fix it. Standard PSCI reset functions are now called in mainline, so the patch has been updated to reflect that. The patch now registers a reboot handler which gets called before the standard PSCI functions and toggles some GPIO lines to reset the SD card. If the card is a UHS card, then this puts it back into a state which the bootloader can deal with, and the board can reboot cleanly.
This patch might be applicable to other boards, but I can't test them. They can be tested by adding some code to the device tree, to add in the odroid,reboot driver.
I'd like to work on getting this change added to the kernel. but I'll try to make it more general, so it might not be a board-specific patch by the time it gets that far. When that eventually happens, this patch can be removed again.
How Has This Been Tested?
This has been tested by booting the board with a UHS-I SD card using the kernels compiled for odroidc4 targeting both BRANCH=current and BRANCH=edge. Both versions of the patched kernel allow a clean reboot.
Checklist: