From patchwork Mon Jun 3 22:23:17 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Stultz X-Patchwork-Id: 10974037 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 59FF714B6 for ; Mon, 3 Jun 2019 22:23:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 490D128346 for ; Mon, 3 Jun 2019 22:23:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3D0F528610; Mon, 3 Jun 2019 22:23:24 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DC9EE28346 for ; Mon, 3 Jun 2019 22:23:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726369AbfFCWXX (ORCPT ); Mon, 3 Jun 2019 18:23:23 -0400 Received: from mail-pg1-f195.google.com ([209.85.215.195]:36558 "EHLO mail-pg1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726336AbfFCWXX (ORCPT ); Mon, 3 Jun 2019 18:23:23 -0400 Received: by mail-pg1-f195.google.com with SMTP id a3so1679222pgb.3 for ; Mon, 03 Jun 2019 15:23:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=6niAwzcPpAohPvJt4Jc8GtfUU8V0u7v0Rg+78LYun9M=; b=tpyrIN3pOhJIjlxgLadTRT5CufA7IzK4ux2DtTFgG7teYRUtUh06+WAmNriOTkh6u2 2MPJhiEQjvyIIwN3TyUAgw4GPxAti8x9g4fIBmWMYaB5QSONi8/JJhBj05BA4+Wy5vRz PAHvFaONYBe6dGZblkI7awqz3xqSW6y6G4S4tWzElGh0XE0tJtHQDwjqisHNfdW4Veia rG7L5JGJzGKf+TeJNB1m+5C9cQ/Ew9nkrSOZyfz2akaUDuDwO6I8Q4/G8Z5J1jl4fLUi vvldAc/78m23v283dpNjp3mCpC3lLQc/hHp6cUFSWuh7a/kACawIPOMRZJAIJ9cIHIFd FxkA== 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; bh=6niAwzcPpAohPvJt4Jc8GtfUU8V0u7v0Rg+78LYun9M=; b=ONxGPkIzJ5LMa5d0eWY/Wd0hHsyMlrUdCn0JPPA31iSs3DqaN5/o0K0wVI/EjMDch/ 5spVFHZga0XIhaMgXfYPTHhhuGVsQ92FGzPTVwmYRTHMODvdOIeIfoz3J3o5PwqGMGr/ ja99nUXzcVJj4971s8HFZD95zHtiSKgP57nNF5+9tZE7ObTvATyFAzMTex0A8IM0vhN4 wkbOtTUz3xjjdIiNoz7QZmG3U117FnMus9WLg5m6cTPsHMesZag9axzMNgRBUkAHmOW2 7G+/TT0QMuq6HKPsLuNKvxnGi3jEEgNW8sz3cvpmqMMNDL3cRfWvCM3Fn42fTl/xzxX6 ReAQ== X-Gm-Message-State: APjAAAV2u4R1mSv2z4YatO7AThO27IWkv8tA1G2M5iz4gTcsazOpVeW6 35dj2VRESxqCae0gc0vIzpCK5g== X-Google-Smtp-Source: APXvYqyW9fNJIYUZyJi9V5wJYk9SdgROr34PF8/DcyWJQ0PKLOKb9vtvUgdQ2NiVawrNdsXoeyOSuw== X-Received: by 2002:a17:90a:37e9:: with SMTP id v96mr18652976pjb.10.1559600602567; Mon, 03 Jun 2019 15:23:22 -0700 (PDT) Received: from localhost.localdomain ([2601:1c2:680:1319:692:26ff:feda:3a81]) by smtp.gmail.com with ESMTPSA id g8sm14320588pjp.17.2019.06.03.15.23.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 03 Jun 2019 15:23:21 -0700 (PDT) From: John Stultz To: lkml Cc: John Stultz , Andy Gross , David Brown , Bjorn Andersson , Amit Pundir , Rob Herring , Mark Rutland , Sebastian Reichel , linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org Subject: [PATCH 1/3 v2] dt-bindings: power: reset: qcom: Add qcom,pm8998-pon compatability line Date: Mon, 3 Jun 2019 22:23:17 +0000 Message-Id: <20190603222319.62842-1-john.stultz@linaro.org> X-Mailer: git-send-email 2.17.1 Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Update bindings to support for qcom,pm8998-pon which uses gen2 pon Cc: Andy Gross Cc: David Brown Cc: Bjorn Andersson Cc: Amit Pundir Cc: Rob Herring Cc: Mark Rutland Cc: Sebastian Reichel Cc: linux-arm-msm@vger.kernel.org Cc: devicetree@vger.kernel.org Reviewed-by: Bjorn Andersson Signed-off-by: John Stultz Reviewed-by: Rob Herring --- Documentation/devicetree/bindings/power/reset/qcom,pon.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/power/reset/qcom,pon.txt b/Documentation/devicetree/bindings/power/reset/qcom,pon.txt index 5705f575862df..0c0dc3a1e693e 100644 --- a/Documentation/devicetree/bindings/power/reset/qcom,pon.txt +++ b/Documentation/devicetree/bindings/power/reset/qcom,pon.txt @@ -9,6 +9,7 @@ Required Properties: -compatible: Must be one of: "qcom,pm8916-pon" "qcom,pms405-pon" + "qcom,pm8998-pon" -reg: Specifies the physical address of the pon register From patchwork Mon Jun 3 22:23:18 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Stultz X-Patchwork-Id: 10974041 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B54BB14B6 for ; Mon, 3 Jun 2019 22:23:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A1EFB28610 for ; Mon, 3 Jun 2019 22:23:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 94B7228757; Mon, 3 Jun 2019 22:23:27 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2F6BA28346 for ; Mon, 3 Jun 2019 22:23:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726734AbfFCWXZ (ORCPT ); Mon, 3 Jun 2019 18:23:25 -0400 Received: from mail-pf1-f194.google.com ([209.85.210.194]:33853 "EHLO mail-pf1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726691AbfFCWXZ (ORCPT ); Mon, 3 Jun 2019 18:23:25 -0400 Received: by mail-pf1-f194.google.com with SMTP id c85so2614744pfc.1 for ; Mon, 03 Jun 2019 15:23:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=LNT+l1wAM3ExTzu8kAKF3OCBx9DgMUq0svFdafuGiNA=; b=RSBsA1sZKPZQGT93W+BOBhN5ctHJdvI/euEzW7VqiT83w1yWpIWw4F/wIqRqPuBPwS fKKXmI7hYcUhj2RyZNzKSmcpjmoEaL7XupXMPJuTkR2lVWLlisrIugg7hmQkbPvjMd11 TI4j3rZ7FVM6Q1tbomdGo9f+hjO/SHPgwZHEc4+U8bGfygVQjH8fBTvna0n+vG7X7BZH fP7IlskzUXfs5JGj25rr8StP0H9MVGbAcfJ/7GqoHkA6x2b7dLsD0IWUu/viyPUyni1e Pf7Lqj0MYVvoMTGhuoBESr2O0GaOh9VC5kl77CtY6mKwGQOSU0OwIbluEKvLvB1gYuqt d8yQ== 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; bh=LNT+l1wAM3ExTzu8kAKF3OCBx9DgMUq0svFdafuGiNA=; b=JQ1lD89+Gzgees4ODvIH/moMol/kYw+ZxroRW+JvVchCIB9VMA/qWKqzEHfS/XGlca BCpGhn8eblLLMa7a8fgxlPiYRtnUJj0rPSO7mIQOB3Zc03VmlKsWAtC0C/fUoEJGiCTu OEgq1Evw0YSIvno4xm3NQX8h0wOG9lTqfgUCcv0QFDyu6bl+r6KXHPN12hI10vss3kmN inhdWU2TSTg+k76Mi4GDVr4gUcfN+bb9X4ntPBDnBetEIZo+gJzf4dWJIUo0hiKs2vsU rvOtifMMAFb60iCqWXM05gS8rjO45uGNkKUHRWVxo4g1Pf9dh/9Sl1wIYkOwrtctQZOL O8JQ== X-Gm-Message-State: APjAAAXq6s0snC3acsL/XlIgVOBjJdEjpgeUYHukgpibg3M+6rR4ekfe eWl2Qav7h2sOd+rsSJvPYSHPw8luszo= X-Google-Smtp-Source: APXvYqyvzQyIVZPpUnCKtqlHVvAak9rWtp9S1Ze02w7DQsnHXT0RcsdjgSSK837eelbF8SsQY965ew== X-Received: by 2002:a63:4c54:: with SMTP id m20mr31550310pgl.316.1559600604132; Mon, 03 Jun 2019 15:23:24 -0700 (PDT) Received: from localhost.localdomain ([2601:1c2:680:1319:692:26ff:feda:3a81]) by smtp.gmail.com with ESMTPSA id g8sm14320588pjp.17.2019.06.03.15.23.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 03 Jun 2019 15:23:23 -0700 (PDT) From: John Stultz To: lkml Cc: John Stultz , Andy Gross , David Brown , Bjorn Andersson , Amit Pundir , Rob Herring , Mark Rutland , Sebastian Reichel , linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org Subject: [PATCH 2/3 v2] reset: qcom-pon: Add support for gen2 pon Date: Mon, 3 Jun 2019 22:23:18 +0000 Message-Id: <20190603222319.62842-2-john.stultz@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190603222319.62842-1-john.stultz@linaro.org> References: <20190603222319.62842-1-john.stultz@linaro.org> Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Add support for gen2 pon register so "reboot bootloader" can work on pixel3 and db845. Cc: Andy Gross Cc: David Brown Cc: Bjorn Andersson Cc: Amit Pundir Cc: Rob Herring Cc: Mark Rutland Cc: Sebastian Reichel Cc: linux-arm-msm@vger.kernel.org Cc: devicetree@vger.kernel.org Reviewed-by: Bjorn Andersson Signed-off-by: John Stultz v2: * Split out dts changes into separate path * Minor cleanups and remove unused variables --- drivers/power/reset/qcom-pon.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/drivers/power/reset/qcom-pon.c b/drivers/power/reset/qcom-pon.c index 3fa1642d4c543..22a743a0bf28c 100644 --- a/drivers/power/reset/qcom-pon.c +++ b/drivers/power/reset/qcom-pon.c @@ -14,11 +14,15 @@ #define PON_SOFT_RB_SPARE 0x8f +#define GEN1_REASON_SHIFT 2 +#define GEN2_REASON_SHIFT 1 + struct pm8916_pon { struct device *dev; struct regmap *regmap; u32 baseaddr; struct reboot_mode_driver reboot_mode; + long reason_shift; }; static int pm8916_reboot_mode_write(struct reboot_mode_driver *reboot, @@ -30,7 +34,7 @@ static int pm8916_reboot_mode_write(struct reboot_mode_driver *reboot, ret = regmap_update_bits(pon->regmap, pon->baseaddr + PON_SOFT_RB_SPARE, - 0xfc, magic << 2); + 0xfc, magic << pon->reason_shift); if (ret < 0) dev_err(pon->dev, "update reboot mode bits failed\n"); @@ -60,6 +64,7 @@ static int pm8916_pon_probe(struct platform_device *pdev) return error; pon->reboot_mode.dev = &pdev->dev; + pon->reason_shift = (long)of_device_get_match_data(&pdev->dev); pon->reboot_mode.write = pm8916_reboot_mode_write; error = devm_reboot_mode_register(&pdev->dev, &pon->reboot_mode); if (error) { @@ -73,8 +78,9 @@ static int pm8916_pon_probe(struct platform_device *pdev) } static const struct of_device_id pm8916_pon_id_table[] = { - { .compatible = "qcom,pm8916-pon" }, - { .compatible = "qcom,pms405-pon" }, + { .compatible = "qcom,pm8916-pon", .data = (void *)GEN1_REASON_SHIFT }, + { .compatible = "qcom,pms405-pon", .data = (void *)GEN1_REASON_SHIFT }, + { .compatible = "qcom,pm8998-pon", .data = (void *)GEN2_REASON_SHIFT }, { } }; MODULE_DEVICE_TABLE(of, pm8916_pon_id_table); From patchwork Mon Jun 3 22:23:19 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Stultz X-Patchwork-Id: 10974039 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C375C17DF for ; Mon, 3 Jun 2019 22:23:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B140728346 for ; Mon, 3 Jun 2019 22:23:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A4B6628758; Mon, 3 Jun 2019 22:23:27 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4F1892857B for ; Mon, 3 Jun 2019 22:23:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726761AbfFCWX0 (ORCPT ); Mon, 3 Jun 2019 18:23:26 -0400 Received: from mail-pg1-f195.google.com ([209.85.215.195]:37252 "EHLO mail-pg1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726663AbfFCWX0 (ORCPT ); Mon, 3 Jun 2019 18:23:26 -0400 Received: by mail-pg1-f195.google.com with SMTP id 20so9083838pgr.4 for ; Mon, 03 Jun 2019 15:23:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=KV1yP4xPKIyp1RKqHB+nD6QgQGfk1bw32PIxxNzkN7U=; b=L7aCm9arW0EF/yMO3AoxQuQPqIWFqHn2McPj1Pnb6jxxV/O6Z+hFMVddo7AdkGjYdI lfIf2RBJi2sqof8W3HPbnDqO3drzS9kN0Xge9AxFf4QV8PzZwxVu5rzY31FVbp7Gwae9 SrzeyAOdcv1FP2JGidBa2fUl+2fKzKS2uMdkAFd5OBfsLvewktfT69k0OPQxJEZ6XEpA H3AU6JfQM0sx1XFk+ujk4bKOHXnkD8KsYffAgz46z17K6zIgyySAvNFWMX7S0+ea2zmC D2s1znTbmO9wraSLLyBAZnxrTIyM0OSurxT1G9O9GWYImS8XFrSrd8174uxxP8d8zTAP 30fQ== 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; bh=KV1yP4xPKIyp1RKqHB+nD6QgQGfk1bw32PIxxNzkN7U=; b=LMUWFArJCEKoP2+gdCb/DIj4L3auwAgdHccNb+MCbuovrLV+fNdRzM9hatjccOhtMJ JELWh7IHNJnMhtJ3YkzLwAMpf0DnuifVBeM+j1hVbTAI/cbVz9nA0pu3mEnn+G6Xd7CP lOIssRAlvWxrEgrdRz3JTWDtt7cy+pW7sEgJQz6AcHNExYPsZgyq47Uj+OL+yA0aRqM7 /UUNxltOsmoWP71iPSPJDX5vhKNUaMd+MP7rqqF348A1snVBjmheEkV1CkSZ3L+QfjJ+ 7KKZiJowsO1ree4+/O5H9NVeYjozPrhYE9WdomJREZdkj11+JiSnBrL9PF5DbdsBNtoz lh+g== X-Gm-Message-State: APjAAAU+vU2ctAcdOnyVRi4A6cFa+rsUxfGpb2g2s36/B7L9qX6WjtvN QifctqrWeMOA6KEwlGTs+JPYhQ== X-Google-Smtp-Source: APXvYqxeAhg/5hJQWcCD51pc6wcjvauGAvorr2NlhrqLCJn4zUoNyePOZR4JRwhRVRZWzvatY8yVxg== X-Received: by 2002:a62:7a8a:: with SMTP id v132mr11712996pfc.103.1559600605383; Mon, 03 Jun 2019 15:23:25 -0700 (PDT) Received: from localhost.localdomain ([2601:1c2:680:1319:692:26ff:feda:3a81]) by smtp.gmail.com with ESMTPSA id g8sm14320588pjp.17.2019.06.03.15.23.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 03 Jun 2019 15:23:24 -0700 (PDT) From: John Stultz To: lkml Cc: John Stultz , Andy Gross , David Brown , Bjorn Andersson , Amit Pundir , Rob Herring , Mark Rutland , Sebastian Reichel , linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org Subject: [PATCH 3/3 v2] arm64: dts: qcom: pm8998: Use qcom,pm8998-pon binding for second gen pon Date: Mon, 3 Jun 2019 22:23:19 +0000 Message-Id: <20190603222319.62842-3-john.stultz@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190603222319.62842-1-john.stultz@linaro.org> References: <20190603222319.62842-1-john.stultz@linaro.org> Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This changes pm8998 to use the new qcom,pm8998-pon compatible string for the pon in order to support the gen2 pon functionality properly. Cc: Andy Gross Cc: David Brown Cc: Bjorn Andersson Cc: Amit Pundir Cc: Rob Herring Cc: Mark Rutland Cc: Sebastian Reichel Cc: linux-arm-msm@vger.kernel.org Cc: devicetree@vger.kernel.org Signed-off-by: John Stultz Reviewed-by: Bjorn Andersson --- arch/arm64/boot/dts/qcom/pm8998.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm64/boot/dts/qcom/pm8998.dtsi b/arch/arm64/boot/dts/qcom/pm8998.dtsi index d3ca35a940fb6..051a52df80f9e 100644 --- a/arch/arm64/boot/dts/qcom/pm8998.dtsi +++ b/arch/arm64/boot/dts/qcom/pm8998.dtsi @@ -39,7 +39,7 @@ #size-cells = <0>; pm8998_pon: pon@800 { - compatible = "qcom,pm8916-pon"; + compatible = "qcom,pm8998-pon"; reg = <0x800>; mode-bootloader = <0x2>;