From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.5 required=3.0 tests=DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4AD83C76190 for ; Mon, 22 Jul 2019 19:53:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1E551218F0 for ; Mon, 22 Jul 2019 19:53:25 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="RYJlh3p8" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732354AbfGVTxY (ORCPT ); Mon, 22 Jul 2019 15:53:24 -0400 Received: from mail-wm1-f65.google.com ([209.85.128.65]:35044 "EHLO mail-wm1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728505AbfGVTxV (ORCPT ); Mon, 22 Jul 2019 15:53:21 -0400 Received: by mail-wm1-f65.google.com with SMTP id l2so36444668wmg.0; Mon, 22 Jul 2019 12:53:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=6o0P2aAvSBeZTbjnVSOrNVsoOphy6FmgNYN1/PGj4ik=; b=RYJlh3p8fH+hfwgDEY+vxzFwtIPT13Vk+vYhoVp2cx4akbniuYF/sHg06H2km4eg42 hq2jLVNwm0Q78N5rzgbt1rhHqc+YMm0aiX6pDaHypW1QkGAGK51gvoPrR9OxdFFlqEbH qrZUe5RmXEkabw+4WwiJzZ+T+oxYxRaLFCX7bE2eAnr7H0Ksz6ujHjFm3wzMBw0Plt4P y+IpyCpKKtj5hz/YF/6vohKDWY7emzFLpfqDemLIcsxumFMnBf5dALIG5tfoCWe41K4c xCIm3Sy3hIYGRsyxuQie/W8ZjdpRq8AlzkowsgZoi1qrf76v7L7irr8yWYK0L7Vxid90 EpYA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=6o0P2aAvSBeZTbjnVSOrNVsoOphy6FmgNYN1/PGj4ik=; b=R5rDX7o9ZzXoCDlyUW3cTN6N3gYAvZMs1UsC9LFYxWiMExxikW5bHsvd4evJLn+G1p wluZCJIsYuVHC1i0HKgOLTcrdtjdEZf6AiMvOPPg0K6Rv9DU6bqDCCuLH3V+D8PEqijX YKFbb/Z0+S0GibhfCPcEeSn5gh15mXB+5UV4vn7WjrUWQ7JHTbSjBwrPvXrYqw/VXL/a s61B5H4dC9rIwNVddP1LegswTgvQ1kxyx9V1oqy2ezZxgOBlt4JNVZ6XmnPjqaClvlzN 4wt3wkDwhcVaykMlukxpxLnIlBb/hnE0DJbYixVv8c/a7V9ImP0g9TVTeSnzQ/QpvCvA +LrQ== X-Gm-Message-State: APjAAAVwEGHGVjaJO/LRZYpIPoeqvv8KYCKIC4m0S051cJDZ98H6bxXE 60IDhhp8mjIKPkJxUSsPM28= X-Google-Smtp-Source: APXvYqxAcn/w0rck6qGmO9csw5Ep2yDM/kQvtSot8bn2yHnCKiH0cCssbRkIhRUVc9mWwBVceVrXFQ== X-Received: by 2002:a7b:c748:: with SMTP id w8mr61730407wmk.36.1563825199664; Mon, 22 Jul 2019 12:53:19 -0700 (PDT) Received: from localhost.localdomain (nat-113.starnet.cz. [178.255.168.113]) by smtp.googlemail.com with ESMTPSA id c65sm37382975wma.44.2019.07.22.12.53.18 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 22 Jul 2019 12:53:19 -0700 (PDT) From: Evgeny Kolesnikov Cc: Evgeny Kolesnikov , Sebastian Reichel , Rob Herring , Mark Rutland , Jason Cooper , Andrew Lunn , Gregory Clement , Sebastian Hesselbarth , linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH 1/5] power: reset: Add UART-based MCU poweroff DT bindings Date: Mon, 22 Jul 2019 21:53:01 +0200 Message-Id: X-Mailer: git-send-email 2.21.0 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit To: unlisted-recipients:; (no To-header on input) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This adds device tree bindings of the poweroff driver for power managing micro controller units that are connected to a board via the UART interface. Signed-off-by: Evgeny Kolesnikov --- .../bindings/power/reset/uart-poweroff.txt | 38 +++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 Documentation/devicetree/bindings/power/reset/uart-poweroff.txt diff --git a/Documentation/devicetree/bindings/power/reset/uart-poweroff.txt b/Documentation/devicetree/bindings/power/reset/uart-poweroff.txt new file mode 100644 index 000000000000..86d036271b51 --- /dev/null +++ b/Documentation/devicetree/bindings/power/reset/uart-poweroff.txt @@ -0,0 +1,38 @@ +* UART-based PM MCU power off driver + +Some devices have a microcontroller controlling the main power +supply. This microcontroller is connected to UART of the SoC. +Sending a sequence of characters tells the MCU to turn +the power off. + +The length of the sequence, baud rate and the timeout to process +the command may vary from device to device. + +This driver could be used for WD My Cloud (Marvell SoCs), QNAP +(Kirkwood and Orion5x SoCs) and Synology NAS devices. + +Required properties: +- compatible: Should be "uart-poweroff" +- reg: Address and length of the register set for UART +- clocks: The tclk clock +- cmd: Array of bytes, the command to send to the MCU +- baud: Baud rate [75..460800] + +Optional properties: +- byte-delay: A delay after each byte of a command, could be useful + for sloppy MCUs [ms], default value is 5 +- timeout: A timeout to wait for the MCU to process the command [ms], + default value is 1000 +- override: Boolean flag that indicates if the driver should + prioritize itself over any existing power off driver, + default behaviour is not to interfere + +Example: + poweroff@12100 { + compatible = "uart-poweroff"; + reg = <0x12100 0x100>; + clocks = <&coreclk 0>; + baud = <19200>; + cmd = [fa 03 03 01 00 00 fb]; + status = "okay"; + }; -- 2.21.0