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

81 lines
2.4 KiB
Diff

From 5bac00091537750f47ad4da029171b0836183491 Mon Sep 17 00:00:00 2001
From: Ondrej Jirman <megous@megous.com>
Date: Mon, 15 Feb 2021 17:45:13 +0100
Subject: [PATCH 276/478] 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 <megous@megous.com>
---
.../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 5b44a979f250..1b406226301b 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi
+++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi
@@ -82,6 +82,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 */
@@ -431,6 +459,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.35.3