dt-bindings: power: reset: qcom: Add qcom,pm8998-pon compatability line
Subsystems (4)
RFC PATCH 1/2 dt-bindings: power: reset: qcom: Add qcom,pm8998-pon compatability line
Update bindings to support for qcom,pm8998-pon which uses gen2 pon
--- Documentation/devicetree/bindings/power/reset/qcom,pon.txt | 1 + 1 file changed, 1 insertion(+)
Documentation/devicetree/bindings/power/reset/qcom,pon.txt +1 -0
@@ -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
Signature · 1 line
2.17.1
RFC PATCH 2/2 reset: qcom-pon: Add support for gen2 pon
Add support for gen2 pon register so "reboot bootloader" can work on pixel3 and db845.
--- arch/arm64/boot/dts/qcom/pm8998.dtsi | 2 +- drivers/power/reset/qcom-pon.c | 15 ++++++++++++--- 2 files changed, 13 insertions(+), 4 deletions(-)
arch/arm64/boot/dts/qcom/pm8998.dtsi +1 -1
@@ -39,7 +39,7 @@ #size-cells = <0>; pm8998_pon: pon@800 { - compatible = "qcom,pm8916-pon"; + compatible = "qcom,pm8998-pon"; reg = <0x800>; mode-bootloader = <0x2>;
drivers/power/reset/qcom-pon.c +12 -3
@@ -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);
Signature · 1 line
2.17.1
Quoted 5 lines · John Stultz
Update bindings to support for qcom,pm8998-pon which uses gen2 pon
Cc Andy Gross <[email protected]>Cc David Brown <[email protected]>Cc Bjorn Andersson <[email protected]>
Quoted 26 lines
Cc Amit Pundir <[email protected]>Cc Rob Herring <[email protected]>Cc Mark Rutland <[email protected]>Cc Sebastian Reichel <[email protected]>Signed-off-by John Stultz <[email protected]>--- Documentation/devicetree/bindings/power/reset/qcom,pon.txt | 1 + 1 file changed, 1 insertion(+)Documentation/devicetree/bindings/power/reset/qcom,pon.txt +1
-0@@ -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 registerSignature · 1 line
2.17.1
Re: [RFC][PATCH 2/2] reset: qcom-pon: Add support for gen2 pon
In reply to John StultzQuoted 23 lines · John Stultz
Add support for gen2 pon register so "reboot bootloader" can work on pixel3 and db845.
Cc Andy Gross <[email protected]>Cc David Brown <[email protected]>Cc Bjorn Andersson <[email protected]>Cc Amit Pundir <[email protected]>Cc Rob Herring <[email protected]>Cc Mark Rutland <[email protected]>Cc Sebastian Reichel <[email protected]>Signed-off-by John Stultz <[email protected]>--- arch/arm64/boot/dts/qcom/pm8998.dtsi | 2 +- drivers/power/reset/qcom-pon.c | 15 ++++++++++++--- 2 files changed, 13 insertions(+), 4 deletions(-)arch/arm64/boot/dts/qcom/pm8998.dtsi +0
-0
arch/arm64/boot/dts/qcom/pm8998.dtsi line 45
Quoted 8 lines
arch/arm64/boot/dts/qcom/pm8998.dtsi +1
-1@@ -39,7 +39,7 @@ #size-cells = <0>; pm8998_pon: pon@800 { - compatible = "qcom,pm8916-pon"; + compatible = "qcom,pm8998-pon"; reg = <0x800>; mode-bootloader = <0x2>;
We want to take this through arm-soc and the rest through Sebastian's tree, so please provide the dts update in a separate commit.
Apart from that this looks good!
Regards,
Bjorn
Quoted 63 lines
drivers/power/reset/qcom-pon.c +12
-3@@ -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);Signature · 1 line
2.17.1
Re: [RFC][PATCH 2/2] reset: qcom-pon: Add support for gen2 pon
Quoted 32 lines · Bjorn Andersson
Quoted 29 lines · John Stultz
Add support for gen2 pon register so "reboot bootloader" can work on pixel3 and db845.
Cc Andy Gross <[email protected]>Cc David Brown <[email protected]>Cc Bjorn Andersson <[email protected]>Cc Amit Pundir <[email protected]>Cc Rob Herring <[email protected]>Cc Mark Rutland <[email protected]>Cc Sebastian Reichel <[email protected]>Signed-off-by John Stultz <[email protected]>--- arch/arm64/boot/dts/qcom/pm8998.dtsi | 2 +- drivers/power/reset/qcom-pon.c | 15 ++++++++++++--- 2 files changed, 13 insertions(+), 4 deletions(-)arch/arm64/boot/dts/qcom/pm8998.dtsi +1
-1@@ -39,7 +39,7 @@ #size-cells = <0>; pm8998_pon: pon@800 { - compatible = "qcom,pm8916-pon"; + compatible = "qcom,pm8998-pon";
Quoted 5 lines
arch/arm64/boot/dts/qcom/pm8998.dtsi line 45
Quoted 2 lines
arch/arm64/boot/dts/qcom/pm8998.dtsi +0
-0reg = <0x800>; mode-bootloader = <0x2>;We want to take this through arm-soc and the rest through Sebastian's tree, so please provide the dts update in a separate commit.
Sure. I wasn't sure if tracking the change in a separate patch was worth it for such a trivial oneliner, but that's fine, I'll split it out.
thanks for the review!
-john