From patchwork Tue Nov 26 05:34:46 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Freddy.Hsin" X-Patchwork-Id: 11261415 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 895CF14DB for ; Tue, 26 Nov 2019 05:35:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 69EB0207DD for ; Tue, 26 Nov 2019 05:35:16 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=mediatek.com header.i=@mediatek.com header.b="FhlbflNr" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727480AbfKZFfG (ORCPT ); Tue, 26 Nov 2019 00:35:06 -0500 Received: from mailgw01.mediatek.com ([210.61.82.183]:61355 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1727436AbfKZFfE (ORCPT ); Tue, 26 Nov 2019 00:35:04 -0500 X-UUID: 052d8fe813694e919e0a0ce9ade97d23-20191126 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Transfer-Encoding:Content-Type:MIME-Version:Message-ID:Date:Subject:CC:To:From; bh=PGHAjeNFj61JuQZqzPm0qOjVOVPlbCv9F5NL4JCmFUs=; b=FhlbflNrqT0mPEQx/nAIsSi4t5cEhAjHxVUiphH/Q9tVgKiRK+nxjIA6po2ShhyWbVfh/BzqXob0gnEEOMz7ikLoTN9iWkABemf/FxOVoI0Klo0EfCAxLqvKhTlY7EEo+whpsDlheONn/9gY1FRCMPsJUfw1O2ruqdxkZJzJHBM=; X-UUID: 052d8fe813694e919e0a0ce9ade97d23-20191126 Received: from mtkcas06.mediatek.inc [(172.21.101.30)] by mailgw01.mediatek.com (envelope-from ) (Cellopoint E-mail Firewall v4.1.10 Build 0809 with TLS) with ESMTP id 1097498708; Tue, 26 Nov 2019 13:34:55 +0800 Received: from mtkcas08.mediatek.inc (172.21.101.126) by mtkmbs07n1.mediatek.inc (172.21.101.16) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Tue, 26 Nov 2019 13:34:50 +0800 Received: from mtkswgap22.mediatek.inc (172.21.77.33) by mtkcas08.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1395.4 via Frontend Transport; Tue, 26 Nov 2019 13:34:34 +0800 From: To: , , , , , , , , , , , CC: , Subject: [PATCH v1 0/4] Support MTK reboot mode driver Date: Tue, 26 Nov 2019 13:34:46 +0800 Message-ID: <1574746490-625-1-git-send-email-freddy.hsin@mediatek.com> X-Mailer: git-send-email 1.7.9.5 MIME-Version: 1.0 X-MTK: N Sender: linux-watchdog-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-watchdog@vger.kernel.org This driver parses the reboot commands like "reboot bootloader" and "reboot recovery" to get a boot mode described in the device tree , then call the write interfae to store the boot mode in mtk RGU (reset generation unit) non-volatile register, which can be read by the bootloader after system reboot, then the bootloader can take different action according to the mode stored. Freddy Hsin (4): power: reset: add reboot mode driver watchdog: populate reboot mode node in toprgu node of MTK RGU (Reset Generation Unit) soc: mediatek: add reboot-mode header dt-binding: power: reset: Add documentation for MTK RGU (Reset Gernation Unit) reboot driver .../devicetree/bindings/power/reset/mtk-reboot.txt | 30 +++++ drivers/power/reset/Kconfig | 11 ++ drivers/power/reset/Makefile | 1 + drivers/power/reset/mtk-reboot.c | 116 ++++++++++++++++++++ drivers/watchdog/mtk_wdt.c | 3 + include/dt-bindings/soc/mediatek,boot-mode.h | 17 +++ 6 files changed, 178 insertions(+) create mode 100644 Documentation/devicetree/bindings/power/reset/mtk-reboot.txt create mode 100644 drivers/power/reset/mtk-reboot.c create mode 100644 include/dt-bindings/soc/mediatek,boot-mode.h