From patchwork Tue Jan 12 11:32:58 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Yan X-Patchwork-Id: 8016411 Return-Path: X-Original-To: patchwork-linux-pm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 077349F3F6 for ; Tue, 12 Jan 2016 11:33:36 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 14D1E203C4 for ; Tue, 12 Jan 2016 11:33:35 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 066232038F for ; Tue, 12 Jan 2016 11:33:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934528AbcALLdc (ORCPT ); Tue, 12 Jan 2016 06:33:32 -0500 Received: from regular1.263xmail.com ([211.150.99.137]:50468 "EHLO regular1.263xmail.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933632AbcALLdb (ORCPT ); Tue, 12 Jan 2016 06:33:31 -0500 X-Greylist: delayed 340 seconds by postgrey-1.27 at vger.kernel.org; Tue, 12 Jan 2016 06:33:29 EST Received: from andy.yan?rock-chips.com (unknown [192.168.167.158]) by regular1.263xmail.com (Postfix) with SMTP id E6BB1B3F7; Tue, 12 Jan 2016 19:33:22 +0800 (CST) X-263anti-spam: KSV:0; X-MAIL-GRAY: 0 X-MAIL-DELIVERY: 1 X-KSVirus-check: 0 X-ABS-CHECKED: 4 X-ADDR-CHECKED: 0 Received: from mae.263xmail.com (unknown [121.40.33.66]) by smtp.263.net (Postfix) with ESMTP id 8C3F82AD6E; Tue, 12 Jan 2016 19:33:19 +0800 (CST) Received: from yxj?rock-chips.com (localhost [127.0.0.1]) by mae.263xmail.com (Postfix) with SMTP id 91C2A14B699; Tue, 12 Jan 2016 19:33:23 +0800 (CST) X-MAE-MAIL_UID: 005694e4830803d7@maes@1d7860f117edcc27 X-MAE-ID: 223.6.254.61 X-RL-SENDER: andy.yan@rock-chips.com X-LOGIN-NAME: andy.yan@rock-chips.com X-SENDER-IP: 121.15.173.1 X-SENDER: yxj@rock-chips.com From: Andy Yan To: heiko@sntech.de, arnd@arndb.de, john.stultz@linaro.org Cc: linux@roeck-us.net, galak@codeaurora.org, ijc+devicetree@hellion.org.uk, robh+dt@kernel.org, catalin.marinas@arm.com, geert+renesas@glider.be, sre@kernel.org, olof@lixom.net, dbaryshkov@gmail.com, alexandre.belloni@free-electrons.com, jun.nie@linaro.org, pawel.moll@arm.com, f.fainelli@gmail.com, will.deacon@arm.com, linux-rockchip@lists.infradead.org, devicetree@vger.kernel.org, linux-pm@vger.kernel.org, linux@arm.linux.org.uk, linux-arm-kernel@lists.infradead.org, lorenzo.pieralisi@arm.com, moritz.fischer@ettus.com, cernekee@gmail.com, linux-kernel@vger.kernel.org, dwmw2@infradead.org, mark.rutland@arm.com, maxime.ripard@free-electrons.com, Andy Yan Subject: [PATCH v2 3/4] ARM: dts: rockchip: add syscon-reboot-mode node Date: Tue, 12 Jan 2016 19:32:58 +0800 Message-Id: <1452598378-8371-1-git-send-email-andy.yan@rock-chips.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1452598029-8222-1-git-send-email-andy.yan@rock-chips.com> References: <1452598029-8222-1-git-send-email-andy.yan@rock-chips.com> Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 Reviewed-by: Matthias Brugger --- Changes in v2: - make this node as a subnode of PMU Changes in v1: - correct the maskrom magic number - use macro defined in rockchip_boot-mode.h for reboot-mode DT node arch/arm/boot/dts/rk3288.dtsi | 31 ++++++++++++++++++++++++++ arch/arm/boot/dts/rk3xxx.dtsi | 33 +++++++++++++++++++++++++++- include/dt-bindings/soc/rockchip_boot-mode.h | 30 +++++++++++++++++++++++++ 3 files changed, 93 insertions(+), 1 deletion(-) create mode 100644 include/dt-bindings/soc/rockchip_boot-mode.h diff --git a/arch/arm/boot/dts/rk3288.dtsi b/arch/arm/boot/dts/rk3288.dtsi index 04ea209..4e49fb7 100644 --- a/arch/arm/boot/dts/rk3288.dtsi +++ b/arch/arm/boot/dts/rk3288.dtsi @@ -45,6 +45,7 @@ #include #include #include +#include #include "skeleton.dtsi" / { @@ -712,6 +713,36 @@ clocks = <&cru ACLK_GPU>; }; }; + + reboot-mode { + compatible = "syscon-reboot-mode"; + offset = <0x94>; + + normal { + linux,mode = "normal"; + loader,magic = ; + }; + + loader { + linux,mode = "loader"; + loader,magic = ; + }; + + maskrom { + linux,mode = "maskrom"; + loader,magic = ; + }; + + recovery { + linux,mode = "recovery"; + loader,magic = ; + }; + + fastboot { + linux,mode = "fastboot"; + loader,magic = ; + }; + }; }; sgrf: syscon@ff740000 { diff --git a/arch/arm/boot/dts/rk3xxx.dtsi b/arch/arm/boot/dts/rk3xxx.dtsi index 4497d28..58af546 100644 --- a/arch/arm/boot/dts/rk3xxx.dtsi +++ b/arch/arm/boot/dts/rk3xxx.dtsi @@ -43,6 +43,7 @@ #include #include +#include #include "skeleton.dtsi" / { @@ -242,8 +243,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 = ; + }; + + loader { + linux,mode = "loader"; + loader,magic = ; + }; + + maskrom { + linux,mode = "maskrom"; + loader,magic = ; + }; + + recovery { + linux,mode = "recovery"; + loader,magic = ; + }; + + fastboot { + linux,mode = "fastboot"; + loader,magic = ; + }; + }; }; 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..eedf113 --- /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