build/patch/kernel/archive/sunxi-6.5/patches.megous/arm64-dts-pinephone-Add-reboot-mode-driver.patch

81 lines
2.4 KiB
Diff
Raw Normal View History

From d2b86bf819a5ad8081b3675bd55daba80b7f90f0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ond=C5=99ej=20Jirman?= <megi@xff.cz>
Date: Mon, 15 Feb 2021 17:45:13 +0100
Subject: [PATCH 173/464] arm64: dts: pinephone: Add reboot mode driver
With the latest p-boot (released 2021-02-15), you can reboot to
a particular boot option or to the menu, to FEL, to eMMC bootloader,
regardless of the user defined p-boot defaults.
Call reboot with cmd of LINUX_REBOOT_CMD_RESTART2 and arg:
- fel Reboot to FEL
- emmc-egon Reboot with chainload of bootloader from eMMC
- sd1-8 Reboot to SD bootfs option
- emmc1-8 Reboot to eMMC bootfs option
- menu Reboot to p-boot menu
Signed-off-by: Ondrej Jirman <megi@xff.cz>
---
.../dts/allwinner/sun50i-a64-pinephone.dtsi | 37 +++++++++++++++++++
1 file changed, 37 insertions(+)
diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi
index 87847116ab6d..df31223da5d8 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi
+++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi
@@ -84,6 +84,34 @@ sgm3140_flash: led {
};
};
+ /* PinePhone specific reboot modes for p-boot. */
+ reboot-mode {
+ compatible = "nvmem-reboot-mode";
+ nvmem-cells = <&reboot_mode>;
+ nvmem-cell-names = "reboot-mode";
+
+ mode-normal = <0x0>;
+ mode-fel = <0xb0010fe1>;
+ mode-emmc-egon = <0xb001e33c>;
+ mode-sd1 = <0xb0010020>;
+ mode-sd2 = <0xb0010021>;
+ mode-sd3 = <0xb0010022>;
+ mode-sd4 = <0xb0010023>;
+ mode-sd5 = <0xb0010024>;
+ mode-sd6 = <0xb0010025>;
+ mode-sd7 = <0xb0010026>;
+ mode-sd8 = <0xb0010027>;
+ mode-emmc1 = <0xb0010000>;
+ mode-emmc2 = <0xb0010001>;
+ mode-emmc3 = <0xb0010002>;
+ mode-emmc4 = <0xb0010003>;
+ mode-emmc5 = <0xb0010004>;
+ mode-emmc6 = <0xb0010005>;
+ mode-emmc7 = <0xb0010006>;
+ mode-emmc8 = <0xb0010007>;
+ mode-menu = <0xb00100ff>;
+ };
+
speaker_amp: audio-amplifier {
compatible = "simple-audio-amplifier";
enable-gpios = <&pio 2 7 GPIO_ACTIVE_HIGH>; /* PC7 */
@@ -433,6 +461,15 @@ &reg_rtc_ldo {
regulator-name = "vcc-rtc";
};
+&rtc {
+ #address-cells = <1>;
+ #size-cells = <1>;
+
+ reboot_mode: reboot-mode@4 {
+ reg = <0x4 0x4>;
+ };
+};
+
&sound {
status = "okay";
simple-audio-card,name = "PinePhone";
--
2.34.1