diff options
author | Andy Yan <andy.yan@rock-chips.com> | 2016-01-12 19:32:58 +0800 |
---|---|---|
committer | Leo Wang <leozwang@google.com> | 2016-01-13 05:11:45 +0000 |
commit | e7e905d0bccef4206e2cb9b04d61e1d788ccf552 (patch) | |
tree | 1f89483f1f8cad76213d8edca6657018422f6330 | |
parent | de073c5b86900f34b227492c3465ab28baeb8c66 (diff) | |
download | v4.1-e7e905d0bccef4206e2cb9b04d61e1d788ccf552.tar.gz |
FROMLIST: ARM: dts: rockchip: add syscon-reboot-mode node
Rockchip platform use a SYSCON mapped register store
the reboot mode magic value for bootloader to use when
system reboot. So add syscon-reboot-mode driver DT node
for rk3xxx,rk3288 platform
Signed-off-by: Andy Yan <andy.yan@rock-chips.com>
Conflicts:
arch/arm/boot/dts/rk3288.dtsi
(due to the power-doamin land in kernel4,4 )
Bug: 25923642
Patchset: reboot mode PATCH[3/4], reboot fastboot can work.
(am https://patchwork.kernel.org/patch/8016431/)
Signed-off-by: Caesar Wang <wxt@rock-chips.com>
Change-Id: I03b24649b175cc67613277f47d70bf55871e3312
-rw-r--r-- | arch/arm/boot/dts/rk3288.dtsi | 31 | ||||
-rw-r--r-- | arch/arm/boot/dts/rk3xxx.dtsi | 33 | ||||
-rw-r--r-- | include/dt-bindings/soc/rockchip_boot-mode.h | 30 |
3 files changed, 93 insertions, 1 deletions
diff --git a/arch/arm/boot/dts/rk3288.dtsi b/arch/arm/boot/dts/rk3288.dtsi index 8eca5878a87..a4ad5c2e47d 100644 --- a/arch/arm/boot/dts/rk3288.dtsi +++ b/arch/arm/boot/dts/rk3288.dtsi @@ -16,6 +16,7 @@ #include <dt-bindings/pinctrl/rockchip.h> #include <dt-bindings/clock/rk3288-cru.h> #include <dt-bindings/thermal/thermal.h> +#include <dt-bindings/soc/rockchip_boot-mode.h> #include "skeleton.dtsi" / { @@ -550,6 +551,36 @@ pmu: power-management@ff730000 { compatible = "rockchip,rk3288-pmu", "syscon"; reg = <0xff730000 0x100>; + + reboot-mode { + compatible = "syscon-reboot-mode"; + offset = <0x94>; + + normal { + linux,mode = "normal"; + loader,magic = <BOOT_NORMAL>; + }; + + loader { + linux,mode = "loader"; + loader,magic = <BOOT_LOADER>; + }; + + maskrom { + linux,mode = "maskrom"; + loader,magic = <BOOT_MASKROM>; + }; + + recovery { + linux,mode = "recovery"; + loader,magic = <BOOT_RECOVERY>; + }; + + fastboot { + linux,mode = "fastboot"; + loader,magic = <BOOT_FASTBOOT>; + }; + }; }; sgrf: syscon@ff740000 { diff --git a/arch/arm/boot/dts/rk3xxx.dtsi b/arch/arm/boot/dts/rk3xxx.dtsi index c54a9715dcf..c1a6cd47d36 100644 --- a/arch/arm/boot/dts/rk3xxx.dtsi +++ b/arch/arm/boot/dts/rk3xxx.dtsi @@ -15,6 +15,7 @@ #include <dt-bindings/interrupt-controller/irq.h> #include <dt-bindings/interrupt-controller/arm-gic.h> +#include <dt-bindings/soc/rockchip_boot-mode.h> #include "skeleton.dtsi" / { @@ -204,8 +205,38 @@ }; pmu: pmu@20004000 { - compatible = "rockchip,rk3066-pmu", "syscon"; + compatible = "rockchip,rk3066-pmu", "syscon", "simple-mfd"; reg = <0x20004000 0x100>; + + reboot-mode { + compatible = "syscon-reboot-mode"; + offset = <0x40>; + + normal { + linux,mode = "normal"; + loader,magic = <BOOT_NORMAL>; + }; + + loader { + linux,mode = "loader"; + loader,magic = <BOOT_LOADER>; + }; + + maskrom { + linux,mode = "maskrom"; + loader,magic = <BOOT_MASKROM>; + }; + + recovery { + linux,mode = "recovery"; + loader,magic = <BOOT_RECOVERY>; + }; + + fastboot { + linux,mode = "fastboot"; + loader,magic = <BOOT_FASTBOOT>; + }; + }; }; grf: grf@20008000 { diff --git a/include/dt-bindings/soc/rockchip_boot-mode.h b/include/dt-bindings/soc/rockchip_boot-mode.h new file mode 100644 index 00000000000..eedf1138db1 --- /dev/null +++ b/include/dt-bindings/soc/rockchip_boot-mode.h @@ -0,0 +1,30 @@ +#ifndef __ROCKCHIP_BOOT_MODE_H +#define __ROCKCHIP_BOOT_MODE_H + +/*high 24 bits is tag, low 8 bits is type*/ +#define REBOOT_FLAG 0x5242C300 +/* normal boot */ +#define BOOT_NORMAL (REBOOT_FLAG + 0) +/* enter loader rockusb mode */ +#define BOOT_LOADER (REBOOT_FLAG + 1) +/* enter maskrom rockusb mode */ +#define BOOT_MASKROM (0xEF08A53C) +/* enter recovery */ +#define BOOT_RECOVERY (REBOOT_FLAG + 3) +/* do not enter recover */ +#define BOOT_NORECOVER (REBOOT_FLAG + 4) +/* boot second OS*/ +#define BOOT_SECONDOS (REBOOT_FLAG + 5) +/* enter recover and wipe data. */ +#define BOOT_WIPEDATA (REBOOT_FLAG + 6) +/* enter recover and wipe all data. */ +#define BOOT_WIPEALL (REBOOT_FLAG + 7) +/* check firmware img with backup part*/ +#define BOOT_CHECKIMG (REBOOT_FLAG + 8) + /* enter fast boot mode */ +#define BOOT_FASTBOOT (REBOOT_FLAG + 9) +#define BOOT_SECUREBOOT_DISABLE (REBOOT_FLAG + 10) +/* enter charge mode */ +#define BOOT_CHARGING (REBOOT_FLAG + 11) + +#endif |