Message ID | 1466404769-3534-1-git-send-email-andy.yan@rock-chips.com (mailing list archive) |
---|---|
State | Not Applicable, archived |
Headers | show |
On Sun 19 Jun 23:39 PDT 2016, Andy Yan wrote: > 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/rk3036/rk3288 based platform > > Reviewed-by: Matthias Brugger <matthias.bgg@gmail.com> > Signed-off-by: Andy Yan <andy.yan@rock-chips.com> > [..] > 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 0000000..ae7c867 > --- /dev/null > +++ b/include/dt-bindings/soc/rockchip_boot-mode.h > @@ -0,0 +1,15 @@ > +#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 bootloader rockusb mode */ > +#define BOOT_BL_DOWNLOAD (REBOOT_FLAG + 1) > +/* enter recovery */ > +#define BOOT_RECOVERY (REBOOT_FLAG + 3) > + /* enter fastboot mode */ > +#define BOOT_FASTBOOT (REBOOT_FLAG + 9) The names of these defines are too generic for being in a header file. You should likely make them include "ROCKCHIP" and "BOOT_MODE". Regards, Bjorn -- To unsubscribe from this list: send the line "unsubscribe linux-pm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Hi Bjorn: On 2016年06月21日 05:55, Bjorn Andersson wrote: > On Sun 19 Jun 23:39 PDT 2016, Andy Yan wrote: > >> 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/rk3036/rk3288 based platform >> >> Reviewed-by: Matthias Brugger <matthias.bgg@gmail.com> >> Signed-off-by: Andy Yan <andy.yan@rock-chips.com> >> > [..] >> 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 0000000..ae7c867 >> --- /dev/null >> +++ b/include/dt-bindings/soc/rockchip_boot-mode.h >> @@ -0,0 +1,15 @@ >> +#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 bootloader rockusb mode */ >> +#define BOOT_BL_DOWNLOAD (REBOOT_FLAG + 1) >> +/* enter recovery */ >> +#define BOOT_RECOVERY (REBOOT_FLAG + 3) >> + /* enter fastboot mode */ >> +#define BOOT_FASTBOOT (REBOOT_FLAG + 9) > The names of these defines are too generic for being in a header file. > You should likely make them include "ROCKCHIP" and "BOOT_MODE". > > Regards, > Bjorn > > > I have already named this file as rockchip_boot-mode.h, I thinks this is enough to declare it. And I also check some header files like qcom,gsbi.h, thermal/theraml_exynos.h, they also don't have include some flag like QCOM or EXYNOS. -- To unsubscribe from this list: send the line "unsubscribe linux-pm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
diff --git a/arch/arm/boot/dts/rk3036.dtsi b/arch/arm/boot/dts/rk3036.dtsi index 843d2be..f22b7df 100644 --- a/arch/arm/boot/dts/rk3036.dtsi +++ b/arch/arm/boot/dts/rk3036.dtsi @@ -43,6 +43,7 @@ #include <dt-bindings/interrupt-controller/arm-gic.h> #include <dt-bindings/pinctrl/rockchip.h> #include <dt-bindings/clock/rk3036-cru.h> +#include <dt-bindings/soc/rockchip_boot-mode.h> #include "skeleton.dtsi" / { @@ -313,8 +314,16 @@ }; grf: syscon@20008000 { - compatible = "rockchip,rk3036-grf", "syscon"; + compatible = "rockchip,rk3036-grf", "syscon", "simple-mfd"; reg = <0x20008000 0x1000>; + reboot-mode { + compatible = "syscon-reboot-mode"; + offset = <0x1d8>; + mode-normal = <BOOT_NORMAL>; + mode-recovery = <BOOT_RECOVERY>; + mode-bootloader = <BOOT_FASTBOOT>; + mode-loader = <BOOT_BL_DOWNLOAD>; + }; }; acodec: acodec-ana@20030000 { diff --git a/arch/arm/boot/dts/rk3288.dtsi b/arch/arm/boot/dts/rk3288.dtsi index 3b44ef3..8c3defd 100644 --- a/arch/arm/boot/dts/rk3288.dtsi +++ b/arch/arm/boot/dts/rk3288.dtsi @@ -45,6 +45,7 @@ #include <dt-bindings/clock/rk3288-cru.h> #include <dt-bindings/thermal/thermal.h> #include <dt-bindings/power/rk3288-power.h> +#include <dt-bindings/soc/rockchip_boot-mode.h> #include "skeleton.dtsi" / { @@ -790,6 +791,15 @@ clocks = <&cru ACLK_GPU>; }; }; + + reboot-mode { + compatible = "syscon-reboot-mode"; + offset = <0x94>; + mode-normal = <BOOT_NORMAL>; + mode-recovery = <BOOT_RECOVERY>; + mode-bootloader = <BOOT_FASTBOOT>; + mode-loader = <BOOT_BL_DOWNLOAD>; + }; }; sgrf: syscon@ff740000 { diff --git a/arch/arm/boot/dts/rk3xxx.dtsi b/arch/arm/boot/dts/rk3xxx.dtsi index 99bbcc2..cc4bc7f 100644 --- a/arch/arm/boot/dts/rk3xxx.dtsi +++ b/arch/arm/boot/dts/rk3xxx.dtsi @@ -43,6 +43,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" / { @@ -246,8 +247,17 @@ }; 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>; + mode-normal = <BOOT_NORMAL>; + mode-recovery = <BOOT_RECOVERY>; + mode-bootloader = <BOOT_FASTBOOT>; + mode-loader = <BOOT_BL_DOWNLOAD>; + }; }; 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 0000000..ae7c867 --- /dev/null +++ b/include/dt-bindings/soc/rockchip_boot-mode.h @@ -0,0 +1,15 @@ +#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 bootloader rockusb mode */ +#define BOOT_BL_DOWNLOAD (REBOOT_FLAG + 1) +/* enter recovery */ +#define BOOT_RECOVERY (REBOOT_FLAG + 3) + /* enter fastboot mode */ +#define BOOT_FASTBOOT (REBOOT_FLAG + 9) + +#endif