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: 8016481 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 0769DBEEE5 for ; Tue, 12 Jan 2016 11:35:19 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1BF6A2038F for ; Tue, 12 Jan 2016 11:35:18 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id F0A3720120 for ; Tue, 12 Jan 2016 11:35:16 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1aIxD3-0006VW-Sf; Tue, 12 Jan 2016 11:33:57 +0000 Received: from regular1.263xmail.com ([211.150.99.137]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1aIxCx-0006Fp-99; Tue, 12 Jan 2016 11:33:54 +0000 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 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> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160112_033353_702664_ACE07FAD X-CRM114-Status: GOOD ( 11.02 ) X-Spam-Score: -1.9 (-) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: mark.rutland@arm.com, geert+renesas@glider.be, catalin.marinas@arm.com, will.deacon@arm.com, linux-kernel@vger.kernel.org, alexandre.belloni@free-electrons.com, lorenzo.pieralisi@arm.com, f.fainelli@gmail.com, linux@arm.linux.org.uk, dbaryshkov@gmail.com, cernekee@gmail.com, linux-rockchip@lists.infradead.org, linux@roeck-us.net, devicetree@vger.kernel.org, pawel.moll@arm.com, ijc+devicetree@hellion.org.uk, robh+dt@kernel.org, maxime.ripard@free-electrons.com, linux-arm-kernel@lists.infradead.org, moritz.fischer@ettus.com, linux-pm@vger.kernel.org, sre@kernel.org, galak@codeaurora.org, olof@lixom.net, Andy Yan , jun.nie@linaro.org, dwmw2@infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, 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