From patchwork Fri Sep 24 08:42:28 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandre Ghiti X-Patchwork-Id: 1532107 X-Patchwork-Delegate: uboot@andestech.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=canonical.com header.i=@canonical.com header.a=rsa-sha256 header.s=20210705 header.b=Ug9Ka/0x; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4HG5D502LQz9sRf for ; Fri, 24 Sep 2021 18:43:48 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 17CAA83433; Fri, 24 Sep 2021 10:43:43 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=canonical.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=canonical.com header.i=@canonical.com header.b="Ug9Ka/0x"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id D35BE8343F; Fri, 24 Sep 2021 10:43:40 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from smtp-relay-internal-1.canonical.com (smtp-relay-internal-1.canonical.com [185.125.188.123]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 5017483431 for ; Fri, 24 Sep 2021 10:43:37 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=canonical.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=alexandre.ghiti@canonical.com Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-1.canonical.com (Postfix) with ESMTPS id 01CD240264 for ; Fri, 24 Sep 2021 08:43:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1632473017; bh=JyJWVG/fK8V+YFgX4Krl3xpNvItyfa3EwsNnJNIX1ng=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=Ug9Ka/0xEJtUdTYuFocGNvgSeDG3ex/DLRCNZqk/7RbpKCl4f+p6FIgGchkQYn3Zw 0RMr3BEEk+JZdFYM3qF+zUriPfXcP5S6rlqkqnrrs61NLZrXgtLvoxE+RPqkrdKUR0 nlfK3ot2QzgfXHlEV6bokE0LedzOJ2sww9jwh+htmhyHKBKzzSBrqQegAkjhu9RfO5 DpQcaOBtYEKskZib4BuYVg0lycKnlKwtnA08H7juHO9TmsRip6px5s6WnODiTgm39Q SlXg/DCGdJ04kDrQtR8zOpJrWTkw+5mvn2sSw0vOidt3Mx9FfZN9IhJrY+u3Me9Ue4 f1bYOwe1jkmug== Received: by mail-wr1-f70.google.com with SMTP id c15-20020a5d4ccf000000b0015dff622f39so7400388wrt.21 for ; Fri, 24 Sep 2021 01:43:36 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=JyJWVG/fK8V+YFgX4Krl3xpNvItyfa3EwsNnJNIX1ng=; b=q/+PRjvd4WZVJqTYPEkPnPtm0EPIzwPbecDlGZKo8M7iyVyhKIdp5J+HrhH2DW5lZZ R74O2kGRrf6QXn2quOhNrMerHFqRLrN+kCqfO73nD7UTef7EoBAXiMUYag2+yt+NOqGE DCbhBGMUQJJWdNX3e0H8BgrikSsh/iDNt0LYnRUtVeZhA0+1QqIFItuJOikVim9y+nbF bMjzmCRDx7JKbSN8A/BHybbT7bWWcGbDAkMLg8AsQc7QkSnl0/NiyYOJayduLxM79lZt rfeNZzWNEOEP16yjF2jAWwsUY7ls4XnL6mHDyV36Ma24KmsytEZe9PGirXcFhMOY2XaU fFTw== X-Gm-Message-State: AOAM530eufuuxN5UkukgZmnTeDJ2DQ7BNuj9ukWI8p4OVMUYMQani7zb hHwaxxHzXEQjkWRz3d5Rx7S1YnyP/TJmo8cWCASzWHoIUf+cEj7oslonW/mR/rFpDkrV5ucFpPO g1WmClIc9oDW20A5DpGvidVwocWy8VNg= X-Received: by 2002:adf:db0c:: with SMTP id s12mr10227455wri.322.1632473014731; Fri, 24 Sep 2021 01:43:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxME00g93+CcdCFev48Zgesy9IBuBM7YZfvzsCbgy5bBSH5QwopcKt6l+bSHO5iB7PYwtXOPg== X-Received: by 2002:adf:db0c:: with SMTP id s12mr10227436wri.322.1632473014562; Fri, 24 Sep 2021 01:43:34 -0700 (PDT) Received: from localhost.localdomain (lfbn-lyo-1-470-249.w2-7.abo.wanadoo.fr. [2.7.60.249]) by smtp.gmail.com with ESMTPSA id u13sm7774395wmq.33.2021.09.24.01.43.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Sep 2021 01:43:34 -0700 (PDT) From: Alexandre Ghiti To: Paul Walmsley , Pragnesh Patel , Green Wan , Jaehoon Chung , Heinrich Schuchardt , u-boot@lists.denx.de Cc: Alexandre Ghiti Subject: [PATCH v2 1/4] dt-bindings: power: Add da9063 PMIC device bindings Date: Fri, 24 Sep 2021 10:42:28 +0200 Message-Id: <20210924084231.3311216-2-alexandre.ghiti@canonical.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210924084231.3311216-1-alexandre.ghiti@canonical.com> References: <20210924084231.3311216-1-alexandre.ghiti@canonical.com> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.2 at phobos.denx.de X-Virus-Status: Clean This new device tree binding documentation is largely inspired by the Linux Kernel same document, minus the unimplemented devices and properties. Signed-off-by: Alexandre Ghiti --- doc/device-tree-bindings/power/da9063.txt | 62 +++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 doc/device-tree-bindings/power/da9063.txt diff --git a/doc/device-tree-bindings/power/da9063.txt b/doc/device-tree-bindings/power/da9063.txt new file mode 100644 index 0000000000..30873ca360 --- /dev/null +++ b/doc/device-tree-bindings/power/da9063.txt @@ -0,0 +1,62 @@ +* Dialog DA9063/DA9063L Power Management Integrated Circuit (PMIC) + +DA9063 consists of the following sub-devices (I2C Only): + +Device Supply Names Description +------ ------------ ----------- +da9063-regulator : : LDOs & BUCKs + +====== + +Required properties: + +- compatible : Should be "dlg,da9063" or "dlg,da9063l" +- reg : Specifies the I2C slave address (this defaults to 0x58 but it can be + modified to match the chip's OTP settings). + +Sub-nodes: + +- regulators : This node defines the settings for the LDOs and BUCKs. + The DA9063(L) regulators are bound using their names listed below: + + bcore1 : BUCK CORE1 + bcore2 : BUCK CORE2 + bpro : BUCK PRO + bmem : BUCK MEM + bio : BUCK IO + bperi : BUCK PERI + ldo1 : LDO_1 (DA9063 only) + ldo2 : LDO_2 (DA9063 only) + ldo3 : LDO_3 + ldo4 : LDO_4 (DA9063 only) + ldo5 : LDO_5 (DA9063 only) + ldo6 : LDO_6 (DA9063 only) + ldo7 : LDO_7 + ldo8 : LDO_8 + ldo9 : LDO_9 + ldo10 : LDO_10 (DA9063 only) + ldo11 : LDO_11 + +Example: + + pmic0: da9063@58 { + compatible = "dlg,da9063" + reg = <0x58>; + + regulators { + DA9063_BCORE1: bcore1 { + regulator-name = "BCORE1"; + regulator-min-microvolt = <300000>; + regulator-max-microvolt = <1570000>; + regulator-min-microamp = <500000>; + regulator-max-microamp = <2000000>; + regulator-boot-on; + }; + DA9063_LDO11: ldo11 { + regulator-name = "LDO_11"; + regulator-min-microvolt = <900000>; + regulator-max-microvolt = <3600000>; + regulator-boot-on; + }; + }; + }; From patchwork Fri Sep 24 08:42:29 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandre Ghiti X-Patchwork-Id: 1532108 X-Patchwork-Delegate: uboot@andestech.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=canonical.com header.i=@canonical.com header.a=rsa-sha256 header.s=20210705 header.b=CLWbnRwK; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4HG5FB3cCnz9sX3 for ; Fri, 24 Sep 2021 18:44:46 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 13DC58338C; Fri, 24 Sep 2021 10:44:43 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=canonical.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=canonical.com header.i=@canonical.com header.b="CLWbnRwK"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 83A7C83433; Fri, 24 Sep 2021 10:44:39 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from smtp-relay-internal-0.canonical.com (smtp-relay-internal-0.canonical.com [185.125.188.122]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 17E1B8336B for ; Fri, 24 Sep 2021 10:44:36 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=canonical.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=alexandre.ghiti@canonical.com Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-0.canonical.com (Postfix) with ESMTPS id B2A6D40192 for ; Fri, 24 Sep 2021 08:44:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1632473075; bh=kK2DkrZ7Fw+7kRFIezv+6ZrGPPsQB09q8RbUHnwlHMI=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=CLWbnRwKSCWxpsPPZ0+08hMmWrcP90kiqWQvQUvEZ/BHSnayUSGlPFa1vDg3r6BMG vf9lkJJ4RZG0Q8GgLzdWuunHDbm9KKUONFmHtl5JuQyVRfmlBOWcKwhjRbb7y+ue1R St27NHNfomAHy1WuHdiZK3qwdvdcNBkjna7pcf5nJ3z6mabn5Ldk4FT7BoY2bvJTZG 484ERRboUlFOzdRFXs23DRsMgulfoVIv8ZSKZS/+3F9Dr7pHxBSLpreonYi28ji3PP R/ebmyB1b/Rx+vzaGYSwqjTO3xFOnv+FlbIWT43xD/p8Gmjph2U+xdKPZSBpJfrcss YChE1qlG9qzRg== Received: by mail-wr1-f70.google.com with SMTP id k2-20020adfc702000000b0016006b2da9bso7451921wrg.1 for ; Fri, 24 Sep 2021 01:44:35 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=kK2DkrZ7Fw+7kRFIezv+6ZrGPPsQB09q8RbUHnwlHMI=; b=4MWIvb23E5PQMElEhbDUuYcnkPqM4j8CX4bMfgPnUY65jVBo5P7/iyJFq9erLwXbLt oI8/n1ZcA18AaCjv42whLhRpaI+Cf6vxRHGNtm0r7PmzCEPh7GQig4fhPXA6fAgPhIGc HT52U4wQhyW17yBV2zcS+ojGL2Yj0wAL7ESvYVA/t0rvmIGvF0Wx6vjPbkic6GOOUN7I k2grar0ePCHKEP86kKxiJXXq8qswqqcXKtb9dOhPh5NeteISAuN4iaWo/22DinA3jEu1 2qLH/CVYsYihCNqYPXPsExceYlkbk7S5AahY0kptzNrVvAYrej3p+ANye8ow5XcNqxEt p9dw== X-Gm-Message-State: AOAM531/Ru+sxSWfKs2LB4ODtKKwCe6O57FuFYIt1l8TrMvw8gnnFCDD QQh9iaCk4cryE10CwrTdYZK1b/IpTQK+qWTCjPLF6IzpNNGHRqAv/ytXo1QfIs619y4ZjFZPjLo HQmZ3qTcuxYpiRuD5vnu7+hIGQEyVrLE= X-Received: by 2002:a05:600c:1c07:: with SMTP id j7mr778519wms.171.1632473075449; Fri, 24 Sep 2021 01:44:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJycw3tst/PhLh7tw+zDM9HBxUfAzphMFWcCbcuj5LNjZWjDA3FrB6zk8AgrAj37IUqPXsuspw== X-Received: by 2002:a05:600c:1c07:: with SMTP id j7mr778508wms.171.1632473075315; Fri, 24 Sep 2021 01:44:35 -0700 (PDT) Received: from localhost.localdomain (lfbn-lyo-1-470-249.w2-7.abo.wanadoo.fr. [2.7.60.249]) by smtp.gmail.com with ESMTPSA id x17sm7863935wrc.51.2021.09.24.01.44.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Sep 2021 01:44:35 -0700 (PDT) From: Alexandre Ghiti To: Paul Walmsley , Pragnesh Patel , Green Wan , Jaehoon Chung , Heinrich Schuchardt , u-boot@lists.denx.de Cc: Alexandre Ghiti Subject: [PATCH v2 2/4] dt-bindings: power: Add new da9063 sysreset subdevice bindings Date: Fri, 24 Sep 2021 10:42:29 +0200 Message-Id: <20210924084231.3311216-3-alexandre.ghiti@canonical.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210924084231.3311216-1-alexandre.ghiti@canonical.com> References: <20210924084231.3311216-1-alexandre.ghiti@canonical.com> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.2 at phobos.denx.de X-Virus-Status: Clean The sysreset driver for the da9063 will need some new bindings: add them now to the device documentation. Signed-off-by: Alexandre Ghiti --- doc/device-tree-bindings/power/da9063.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/doc/device-tree-bindings/power/da9063.txt b/doc/device-tree-bindings/power/da9063.txt index 30873ca360..29e8e44be4 100644 --- a/doc/device-tree-bindings/power/da9063.txt +++ b/doc/device-tree-bindings/power/da9063.txt @@ -5,6 +5,7 @@ DA9063 consists of the following sub-devices (I2C Only): Device Supply Names Description ------ ------------ ----------- da9063-regulator : : LDOs & BUCKs +da9063-reset : : Reset ====== @@ -37,12 +38,17 @@ Sub-nodes: ldo10 : LDO_10 (DA9063 only) ldo11 : LDO_11 +- reset : This node defines the reset settings controlled by the device. + Example: pmic0: da9063@58 { compatible = "dlg,da9063" reg = <0x58>; + reset { + }; + regulators { DA9063_BCORE1: bcore1 { regulator-name = "BCORE1"; From patchwork Fri Sep 24 08:42:30 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandre Ghiti X-Patchwork-Id: 1532109 X-Patchwork-Delegate: uboot@andestech.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=canonical.com header.i=@canonical.com header.a=rsa-sha256 header.s=20210705 header.b=lOU3bqtK; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4HG5GN3LRKz9sX3 for ; Fri, 24 Sep 2021 18:45:48 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 2FBC68344A; Fri, 24 Sep 2021 10:45:44 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=canonical.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=canonical.com header.i=@canonical.com header.b="lOU3bqtK"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id E656B83422; Fri, 24 Sep 2021 10:45:41 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from smtp-relay-internal-0.canonical.com (smtp-relay-internal-0.canonical.com [185.125.188.122]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id EF9ED8344A for ; Fri, 24 Sep 2021 10:45:36 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=canonical.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=alexandre.ghiti@canonical.com Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-0.canonical.com (Postfix) with ESMTPS id A0AEB402D9 for ; Fri, 24 Sep 2021 08:45:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1632473136; bh=/eom6XyE56McJFBDLSJ0U6EomGRax3dlVLaUQuRbHb0=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=lOU3bqtKfFdO+YrCOGJ/yAocboi8yoTptNkHPYPLyhW4DKNsAnd5ogSjv0nB76+vk dZ5YrozIXvCkJ9LI2Iuf5OCM49+Yb5jUohFhoRH5J/YrJLNnWuQMRyynQ/F5gjCHCF yRdDtncyfuwNa5b+s6ebGSWAOULi9Y/ttG2gPHrWQLTjY+JSObgjwwgzg9HRUtKZ4M LmZ66p9jonGIRhl9AzYw39bCAkNFQ1KAoU4u2zbOIFb8MYm0O1lD3ik6o/xCCHhQnl VLRbUCeUTxS6Wnr2QklIAlDsNvOAA72tT4iXyfxXeP5qotqBkxxZesO078y9tis5IA 3LhODHewnm2vA== Received: by mail-wr1-f69.google.com with SMTP id l9-20020adfc789000000b00160111fd4e8so7435920wrg.17 for ; Fri, 24 Sep 2021 01:45:36 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=/eom6XyE56McJFBDLSJ0U6EomGRax3dlVLaUQuRbHb0=; b=ZDvIHYGfNsKBg6ebpCMRZp6cG8wMGrYwiqB7kUDACEaXNt0uO8urpplpNzBpJhCRu6 UveerDLFZmBxdgZe8LQ6ojrycxYcWLeupWlz/oqhS+reWTxItY5t+14xctraEZAd1VuA a37AeZnZx04ny/7dADf4WhBo2fximmcS14jYZ6Os5etbHit70siEgSnjll16Hmn0Vk5Y VppM22CEUc2ikzlS4nHN8L8Agy+EweIgJUeHsAuHVSt4CzVYTFUQfLpUNuc2MsNqPCPc 8knTi6aT0c9roRf8TKIrCuu+1AbHrossr/jLsbRiQJQYCjvPpRJbWxaCKJoAUPF+a6N3 YoKA== X-Gm-Message-State: AOAM532tv9NqtEm25Y7lhPQTOdi1FkmiSSVhx4c+9G8p4HFc/W9qYJcr CIQ/M9grEyrogajnqwAfxW9k7JaQctZUZOzmIkGHU5k0osJ6QhQyJnIGmPYKY+6v1YdJzDCmsvq zTwxnxb62awox5VB9jkOYg2VBH+y3UIU= X-Received: by 2002:a7b:c842:: with SMTP id c2mr823937wml.93.1632473136301; Fri, 24 Sep 2021 01:45:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzWmKxK0DtxNpAcpMCNaxfFEmQEbv1Ml0UEddxTvqijGX6trXmCms3KcKa8t2BTx+YzYGlPUA== X-Received: by 2002:a7b:c842:: with SMTP id c2mr823922wml.93.1632473136087; Fri, 24 Sep 2021 01:45:36 -0700 (PDT) Received: from localhost.localdomain (lfbn-lyo-1-470-249.w2-7.abo.wanadoo.fr. [2.7.60.249]) by smtp.gmail.com with ESMTPSA id l26sm11608383wmi.25.2021.09.24.01.45.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Sep 2021 01:45:35 -0700 (PDT) From: Alexandre Ghiti To: Paul Walmsley , Pragnesh Patel , Green Wan , Jaehoon Chung , Heinrich Schuchardt , u-boot@lists.denx.de Cc: Alexandre Ghiti Subject: [PATCH v2 3/4] drivers: pmic: Add sysreset driver for da9063 PMIC Date: Fri, 24 Sep 2021 10:42:30 +0200 Message-Id: <20210924084231.3311216-4-alexandre.ghiti@canonical.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210924084231.3311216-1-alexandre.ghiti@canonical.com> References: <20210924084231.3311216-1-alexandre.ghiti@canonical.com> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.2 at phobos.denx.de X-Virus-Status: Clean Some da9063 chips can't use the watchdog as a restart means since the OTP does not set the AUTOBOOT bit [1]. So we need a new reset driver that implements a small i2c sequence that will allow to reset the boards that have this chip. [1] https://www.dialog-semiconductor.com/products/pmics?post_id=10052#tab-support_tab_content Signed-off-by: Alexandre Ghiti --- drivers/power/pmic/da9063.c | 51 ++++++++++++++++++++++++++++++++++++- include/power/da9063_pmic.h | 1 + 2 files changed, 51 insertions(+), 1 deletion(-) diff --git a/drivers/power/pmic/da9063.c b/drivers/power/pmic/da9063.c index 25101d18f7..eb470e4255 100644 --- a/drivers/power/pmic/da9063.c +++ b/drivers/power/pmic/da9063.c @@ -10,6 +10,8 @@ #include #include #include +#include +#include #include #include #include @@ -85,8 +87,9 @@ static int da9063_read(struct udevice *dev, uint reg, uint8_t *buff, int len) static int da9063_bind(struct udevice *dev) { - ofnode regulators_node; + ofnode regulators_node, reset_node; int children; + int ret; regulators_node = dev_read_subnode(dev, "regulators"); if (!ofnode_valid(regulators_node)) { @@ -101,6 +104,17 @@ static int da9063_bind(struct udevice *dev) if (!children) debug("%s: %s - no child found\n", __func__, dev->name); + if (CONFIG_IS_ENABLED(SYSRESET)) { + reset_node = dev_read_subnode(dev, "reset"); + if (ofnode_valid(reset_node)) { + ret = device_bind_driver(dev, DA9063_SYSRESET_DRIVER, + DA9063_SYSRESET_DRIVER, NULL); + if (ret) + pr_err("%s: %s - failed to bind sysreset driver\n", + __func__, dev->name); + } + } + /* Always return success for this device */ return 0; } @@ -129,3 +143,38 @@ U_BOOT_DRIVER(pmic_da9063) = { .probe = da9063_probe, .ops = &da9063_ops, }; + +static int da9063_sysreset_request(struct udevice *dev, enum sysreset_t type) +{ + struct udevice *pmic_dev = dev->parent; + uint ret; + + if (type != SYSRESET_WARM && type != SYSRESET_COLD) + return -EPROTONOSUPPORT; + + ret = pmic_reg_write(pmic_dev, DA9063_REG_PAGE_CON, 0x00); + if (ret < 0) + return ret; + + /* Sets the WAKE_UP bit */ + ret = pmic_reg_write(pmic_dev, DA9063_REG_CONTROL_F, 0x04); + if (ret < 0) + return ret; + + /* Powerdown! */ + ret = pmic_reg_write(pmic_dev, DA9063_REG_CONTROL_A, 0x68); + if (ret < 0) + return ret; + + return -EINPROGRESS; +} + +static struct sysreset_ops da9063_sysreset_ops = { + .request = da9063_sysreset_request, +}; + +U_BOOT_DRIVER(da9063_sysreset) = { + .name = DA9063_SYSRESET_DRIVER, + .id = UCLASS_SYSRESET, + .ops = &da9063_sysreset_ops, +}; diff --git a/include/power/da9063_pmic.h b/include/power/da9063_pmic.h index 273a07ef41..1c676c242a 100644 --- a/include/power/da9063_pmic.h +++ b/include/power/da9063_pmic.h @@ -304,6 +304,7 @@ /* Drivers name */ #define DA9063_LDO_DRIVER "da9063_ldo" #define DA9063_BUCK_DRIVER "da9063_buck" +#define DA9063_SYSRESET_DRIVER "da9063_sysreset" /* Regulator modes */ enum { From patchwork Fri Sep 24 08:42:31 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandre Ghiti X-Patchwork-Id: 1532110 X-Patchwork-Delegate: uboot@andestech.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=canonical.com header.i=@canonical.com header.a=rsa-sha256 header.s=20210705 header.b=sneJVHLq; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4HG5HX2n7mz9sX3 for ; Fri, 24 Sep 2021 18:46:48 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 81B218344A; Fri, 24 Sep 2021 10:46:44 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=canonical.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=canonical.com header.i=@canonical.com header.b="sneJVHLq"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id D05EB83457; Fri, 24 Sep 2021 10:46:42 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from smtp-relay-internal-1.canonical.com (smtp-relay-internal-1.canonical.com [185.125.188.123]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id D2AD0833E7 for ; Fri, 24 Sep 2021 10:46:39 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=canonical.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=alexandre.ghiti@canonical.com Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-1.canonical.com (Postfix) with ESMTPS id DF58F40260 for ; Fri, 24 Sep 2021 08:46:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1632473197; bh=DBupgLmN1zHEheRIF8tOoJ6Iorm3+YfSby0rQI8Mqkg=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=sneJVHLqeFYPZalTzmG+8hUYqzmqaUgvan8yKvUEUtxK9k/WFO5BrTl+M0Hu/oTey rlesAJ+IeqiAcvcrzG+KBFKJrI5JMZFhOLHRKsbHBTaY/xnYy1u466zjkEzMgwecWB Ol5BALGYpCjZivJJgMwIrBbhtdJEOfH5EVHCvHwmZgJ9/ybyDQ88RPVSmE0yO2SCpd pjfGuxLfk48m/hD2fPIPV13wWPkVnyfk1IgKqGXU4GqAZRXl4ySkrVqXyWMic+7Chk AmBNVNhlC7/fODx1OeJDJ5d2dpsBf0gUVlEOdeufhVPDG56IyuL2wgF77JChKhxpE5 X6O6I2TIagopw== Received: by mail-wr1-f70.google.com with SMTP id f7-20020a5d50c7000000b0015e288741a4so7457588wrt.9 for ; Fri, 24 Sep 2021 01:46:37 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=DBupgLmN1zHEheRIF8tOoJ6Iorm3+YfSby0rQI8Mqkg=; b=XMtBCdbCawVpzFry+lGog0zvKWlWIAZAWWSVa06k98iEjd8r+YhOSuwd5vtLqbF1Xk GPBtflZRiwbEscmfOh/7koo9YqjkG9jpDD2Jid2gJgcUiEi9c+tfmWfgXKdGBiyuqUb+ suAfXoj+MGl1VPZcQMHEBmGgNPQ/Dvvk8ODzlcLaFbP9SCeeQnPAzBreihhnevXiEgZ+ X1Lk+37ucQ/3vxGZdFvoJxGnbZD2rwTv/7GsTVGg+RoAHghb0/UuU0D82NLdlI6Q6UrD u8pePVnSjkEHahm3qX3eyb5HSTZiIt/+HD9eewByZMnFO+d8nHttjkMeJMGv3+dCFToa ziHA== X-Gm-Message-State: AOAM531dceubGAhluw0m/GPNz8+5uiHM0did3yo71QgTfXcNmoBEjgzC rvINAfNQV6rm/FqItGkflIqrbuP6gS7qIvkCSGuMPoRvV1ZPp/nU0Szj27yEB+s1g0qNALMARnB DB1HIK6Q2KBoKp/Emgyg6JmyouY8O7yo= X-Received: by 2002:adf:d1c9:: with SMTP id b9mr9996904wrd.426.1632473197121; Fri, 24 Sep 2021 01:46:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwACX4KU3WoVXG0LflF/Ij1xVbqWdC8Rv4pcLpONW4BjI3rL/irNE9fv+6k9/qaX5fcd3dB9w== X-Received: by 2002:adf:d1c9:: with SMTP id b9mr9996888wrd.426.1632473196944; Fri, 24 Sep 2021 01:46:36 -0700 (PDT) Received: from localhost.localdomain (lfbn-lyo-1-470-249.w2-7.abo.wanadoo.fr. [2.7.60.249]) by smtp.gmail.com with ESMTPSA id d70sm7614630wmd.3.2021.09.24.01.46.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Sep 2021 01:46:36 -0700 (PDT) From: Alexandre Ghiti To: Paul Walmsley , Pragnesh Patel , Green Wan , Jaehoon Chung , Heinrich Schuchardt , u-boot@lists.denx.de Cc: Alexandre Ghiti Subject: [PATCH v2 4/4] riscv: Enable da9063 sysreset driver on HiFive Unmatched Date: Fri, 24 Sep 2021 10:42:31 +0200 Message-Id: <20210924084231.3311216-5-alexandre.ghiti@canonical.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210924084231.3311216-1-alexandre.ghiti@canonical.com> References: <20210924084231.3311216-1-alexandre.ghiti@canonical.com> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.2 at phobos.denx.de X-Virus-Status: Clean The Unmatched board comes with the da9063 PMIC that is used to reset the board: add this driver in its config and a corresponding entry to its device-tree. Signed-off-by: Alexandre Ghiti --- arch/riscv/dts/hifive-unmatched-a00.dts | 4 ++++ configs/sifive_unmatched_defconfig | 2 ++ 2 files changed, 6 insertions(+) diff --git a/arch/riscv/dts/hifive-unmatched-a00.dts b/arch/riscv/dts/hifive-unmatched-a00.dts index b44e8c160d..9c30a5c938 100644 --- a/arch/riscv/dts/hifive-unmatched-a00.dts +++ b/arch/riscv/dts/hifive-unmatched-a00.dts @@ -76,6 +76,10 @@ interrupts = <1 IRQ_TYPE_LEVEL_LOW>; interrupt-controller; + reset { + compatible = "dlg,da9063-reset"; + }; + regulators { vdd_bcore1: bcore1 { regulator-min-microvolt = <1050000>; diff --git a/configs/sifive_unmatched_defconfig b/configs/sifive_unmatched_defconfig index 38b7acd536..a4bcf0fae6 100644 --- a/configs/sifive_unmatched_defconfig +++ b/configs/sifive_unmatched_defconfig @@ -37,3 +37,5 @@ CONFIG_DM_RESET=y CONFIG_USB=y CONFIG_USB_XHCI_HCD=y CONFIG_USB_XHCI_PCI=y +CONFIG_DM_PMIC=y +CONFIG_DM_PMIC_DA9063=y