From patchwork Fri May 31 23:47:33 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Stultz X-Patchwork-Id: 165557 Delivered-To: patches@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp1428301ili; Fri, 31 May 2019 16:47:42 -0700 (PDT) X-Received: by 2002:a63:5726:: with SMTP id l38mr12727513pgb.344.1559346462748; Fri, 31 May 2019 16:47:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559346462; cv=none; d=google.com; s=arc-20160816; b=RD9DqFViJDKoyoeR617gzAeNwjluhCE88wIO8+TVOiWWL2SZdNXOJ18gcTHy4gHSqx B/EAUiw6k1UgEdIq1bF0nESM+DjUB6h9/uX2Uwza67Vugez8aCs+8LdbhocImWL7ecjK 7nq56YvSf/0OCns9QpfEDC3YLli2S2usOTimaAzTJL94mGa2tO1PIITU4H3joDhYekx7 wezdR1hjPqIGUYXWEejmoapRB3tWoVk9x5wj2+p1vQFuQCUPz6uaJhh29n8B/9KZ/iEm uEw0Oe2JOEenZiastnfEjL518X214Efv7mJCEVA3CrcHsxfhNX0a8SNm0ZZ8f85a6/Fw 1iRQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=message-id:date:subject:cc:to:from:dkim-signature; bh=ssV0Kpewe7V3chVlIn07ylhgai93WBPa5K6GWFW9pK0=; b=uxKma2/ApeqLBkn8AV/j8wLzleE9TOoNwQeH0VUJ0a6Sk2bDIPbu+OlRT1/dJxQJYv ih/AWUjRi332RIcgCDse113Y+bVcx2miwonLuUe4mh+2JWqcn3lIPT9UCTCDSjviPpRb SmGs+o3oTd7J9AOuEQI6gjKXlWSBZKgtloQfDUUvlFrC8QqLWUA8v/Fthjn0SiWkbUyP uCTBnsBqKdlhrGhilBRwW8qzRpIGrWwIXKcHlHTd248fuS5/vjsaW3HaTvE61rekdVK1 m3rwvxiTlCgncuJyYDUQtlar6suZ2jTXMQhHAr6+WCuvY0Sk3HCfs0raDFS5zDYqy3xO aC/w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=KJ5xKl0X; spf=pass (google.com: domain of john.stultz@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=john.stultz@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id v3sor8546497pfb.36.2019.05.31.16.47.42 for (Google Transport Security); Fri, 31 May 2019 16:47:42 -0700 (PDT) Received-SPF: pass (google.com: domain of john.stultz@linaro.org designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=KJ5xKl0X; spf=pass (google.com: domain of john.stultz@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=john.stultz@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=ssV0Kpewe7V3chVlIn07ylhgai93WBPa5K6GWFW9pK0=; b=KJ5xKl0XkK8xfSoBs9VmPUFTbT54EICRlFJivsuzwebkNtDKFLpUJ33geHMGddH7UH w3/MSstmwv9OMEBmDvvAlz1PjL2KsWSQJHNz4YGtCW2XkY4w1BKyppCHkuVQueq27kZC YBk1ZnXq3eQ0jMl/xfEzp9CmLylDUKjriMFmFqHmtnsfsd5HGaG+99WRKOzoRk26ELoa ldQGi8ZpGKWb/FOJC5WK8Acwf7ncsDk5BGS/15OlF53A5pKJbzfCSJvmCT93tEgh4JU/ F63DyhyYh74DbsKVd6VMOO2ByF1G6bzz4HfyClQ4JMt2gyIEZLlz7ofSUKYACjEHk5He BvPA== 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=ssV0Kpewe7V3chVlIn07ylhgai93WBPa5K6GWFW9pK0=; b=BtehbUR2btyCDMfVGljcQ/nD8jbd+zM1ZdK9hoQufsNdjULU9hSZFvAwtpzZvuSKvY FII6xAjlxrldoiGWjVCV3XFwV/eEqGZ7dauh73pFhh44i9X7TmIJT78CObbfI4CqkIoS WFseAzFYMZS3pY02ofmdm9OVurw0XDplnlGE50airf3DqPxS6wt55v172gJcwO/qwDSy 6iMvc48fiBCm4Pf0QQ6wTm+tMODy/l0X+8FxDJN551MhOz+7eAtBy9Y1Bp8yDtetojge Y8m7YqjLFJ1zfpWmnWz2bwyQJ0b+Y3xGPWsneLIyuIx93veWRuluYHPXvKwuv+7oSn1L 2Nxw== X-Gm-Message-State: APjAAAVgM3ZuA2U7uYv+Cm1wQuXn2umZn1ju9h7tumOtOVXWdo32HdWi jqyVJeeFXe4o+LwQS9JyDP2QMElq X-Google-Smtp-Source: APXvYqwtjTiDatBn5Vb3SL+i2YrV0hy4eHkglHMR/DHW3QZBNEZU4xtufJ4SoM5+3ahLS9OihXpixg== X-Received: by 2002:a62:e90b:: with SMTP id j11mr13195158pfh.88.1559346462171; Fri, 31 May 2019 16:47:42 -0700 (PDT) Return-Path: Received: from localhost.localdomain ([2601:1c2:680:1319:692:26ff:feda:3a81]) by smtp.gmail.com with ESMTPSA id y191sm7056843pfb.179.2019.05.31.16.47.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 31 May 2019 16:47:41 -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: [RFC][PATCH 1/2] dt-bindings: power: reset: qcom: Add qcom, pm8998-pon compatability line Date: Fri, 31 May 2019 23:47:33 +0000 Message-Id: <20190531234734.102842-1-john.stultz@linaro.org> X-Mailer: git-send-email 2.17.1 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 Signed-off-by: John Stultz --- Documentation/devicetree/bindings/power/reset/qcom,pon.txt | 1 + 1 file changed, 1 insertion(+) -- 2.17.1 diff --git a/Documentation/devicetree/bindings/power/reset/qcom,pon.txt b/Documentation/devicetree/bindings/power/reset/qcom,pon.txt index 5705f575862d..0c0dc3a1e693 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 Fri May 31 23:47:34 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Stultz X-Patchwork-Id: 165558 Delivered-To: patches@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp1428330ili; Fri, 31 May 2019 16:47:44 -0700 (PDT) X-Received: by 2002:a17:90a:a593:: with SMTP id b19mr12454594pjq.31.1559346463947; Fri, 31 May 2019 16:47:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559346463; cv=none; d=google.com; s=arc-20160816; b=KJtczZhFebSl9OPfVoX/CREaKzyTzVnebLRTO0A1TVPmoKa4o0gsPT3WMFkDoeHzm4 RFsZ/VF24xLkTgDmnBWfkIDMeEVuXvhlw0nSbSUE+xdTOJ7aMXkGnv2UxhbKTNFv3+ue VfhD5Ijx3ZRZoMuLNIAM5U8PT1dDF8yhv89ETzeBjeuNHd/WJj7wrxWf42/Zsc5Y2BBZ PCH3ltAMQhDzJ2KLQHJ/yrucrqWsOCOlPN15oeGQfwSQHQmtV8tcmBXTdIhJScPSRgpB spM1Zt6L5jgge80tDW3pPlgN8JgFmUSE9behaIJY/xn1hw3IiRpn/RBP+rIR5fExffmC aoWg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=Xt6/4+wEKiWtFL2dtOEhVMVadBdWF2iE7jN+ABlj+7w=; b=E3g8Ukl8UwB5EmM2iXgFYtKMHaY/7dBmmj7ggrSQBZMnPMJsUR1ik/+4VTIggEeGu4 mOUcbEIeFRyaPxSCmR7e/mjUGNn8w4XmJvEweni2E87TQKmHEzmMP2xFfzbfMMBQw9ac FL4UWoNQRb0RFqQsj5OmflVBvcJ1IhlaF/EGPBSVUqK7A6YqT74ftRJlcFXZ0eQy32vW JPOBUSNO0uL7jHkYf+LRMt5XlQegtMSpsv/jZZ5l5seluBcbiFXD6m5cLSJzRhyO6A5t dxsWyxSFpK3R8OwrUsU3T6Ekzil4pf0wzcYtc4CeZDrfd82PqYy9z06NjssnKCvCDp+E GzRg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=LV3JljYI; spf=pass (google.com: domain of john.stultz@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=john.stultz@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id x12sor8588165pjt.17.2019.05.31.16.47.43 for (Google Transport Security); Fri, 31 May 2019 16:47:43 -0700 (PDT) Received-SPF: pass (google.com: domain of john.stultz@linaro.org designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=LV3JljYI; spf=pass (google.com: domain of john.stultz@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=john.stultz@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org 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=Xt6/4+wEKiWtFL2dtOEhVMVadBdWF2iE7jN+ABlj+7w=; b=LV3JljYIRpW8saWBIJ4KRfsILfhBVVqe7dSepvgV6YpX/7rp9RwVGYJpXloE2liJsQ n5ozpVzBBaStN1xvWSn1tNxVMYwgiSoaOGdjrgW3eLlk3dlAQZTd0ciSEGHGIciz9HSz TLx1B4gCB8OWQDvQvlTQPsfr12gf+4vO2S9s9BXqftNWcSTcVO/qrIGVjCqreLoApKiq MW6czC6dBVBytHaHNbzmnSfeuQZQxC58GNvJaku92zkd3ve1lAWpoliB9zytXJ9SiKS2 BvQpbNaM9IYEpsfMcZt4x2MRtPG5oo77wi0OS46154SJWojVuHc2O2V8noz4yhZdx/2s 8kwQ== 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=Xt6/4+wEKiWtFL2dtOEhVMVadBdWF2iE7jN+ABlj+7w=; b=DcfkmWqoffiQJQGKpstnXFQawnLraF98rpP9nM/HWKPiu12R09ue7mwENcWcaXNq38 RA4SM3gODEeQJDD8abJzTr6u59JOtqP99S8HlgNmMI28+q41NaMjyGSnRdFIL9ki4IvD yFErWh88VanVkjhDN8Ban3Q8uobx0r0lr+noSepq1SVCRR/aRD7GN7CgGw5DZ9qso3ek nAAiiCEV080glhfH46l/MyMwV51JLhEPp9ZwHCuBJpdnFeGN3zH9QAGP4e4iHXsLiANO ww+gdpRy/1MSEexr21neIc1AhkUnf+Wtdq+zlQ7T8jCy3knVdS0kUtsAQwH0PLNN6oeA zAbA== X-Gm-Message-State: APjAAAVpX3umfXRlXiHko+reaeBYrveAXwNc+N3NtgEgiogGFeKI19F+ TqqyC4evCZKuE3oVZihQkb5SK9Yw X-Google-Smtp-Source: APXvYqzr+AoHprjP8ts3wc4y0LIgd/T0gtnPdfKjniQJ+Grqlo/2X9FmKDtLb0saCt3OnKkgzRJbsA== X-Received: by 2002:a17:90a:fa15:: with SMTP id cm21mr12525364pjb.122.1559346463481; Fri, 31 May 2019 16:47:43 -0700 (PDT) Return-Path: Received: from localhost.localdomain ([2601:1c2:680:1319:692:26ff:feda:3a81]) by smtp.gmail.com with ESMTPSA id y191sm7056843pfb.179.2019.05.31.16.47.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 31 May 2019 16:47:42 -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: [RFC][PATCH 2/2] reset: qcom-pon: Add support for gen2 pon Date: Fri, 31 May 2019 23:47:34 +0000 Message-Id: <20190531234734.102842-2-john.stultz@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190531234734.102842-1-john.stultz@linaro.org> References: <20190531234734.102842-1-john.stultz@linaro.org> 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 Signed-off-by: John Stultz --- arch/arm64/boot/dts/qcom/pm8998.dtsi | 2 +- drivers/power/reset/qcom-pon.c | 15 ++++++++++++--- 2 files changed, 13 insertions(+), 4 deletions(-) -- 2.17.1 diff --git a/arch/arm64/boot/dts/qcom/pm8998.dtsi b/arch/arm64/boot/dts/qcom/pm8998.dtsi index d3ca35a940fb..051a52df80f9 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>; diff --git a/drivers/power/reset/qcom-pon.c b/drivers/power/reset/qcom-pon.c index 3fa1642d4c54..d0336a1612a4 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,15 +34,18 @@ 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"); return ret; } +static const struct of_device_id pm8916_pon_id_table[]; + static int pm8916_pon_probe(struct platform_device *pdev) { + const struct of_device_id *match; struct pm8916_pon *pon; int error; @@ -60,6 +67,7 @@ static int pm8916_pon_probe(struct platform_device *pdev) return error; pon->reboot_mode.dev = &pdev->dev; + pon->reason_shift = 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 +81,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);