Loading Documentation/devicetree/bindings/arm/msm/rpmh-master-stat.txt +7 −0 Original line number Diff line number Diff line Loading @@ -23,9 +23,16 @@ The required properties for rpmh-master-stats are: Value type: <prop-encoded-array> Definition: Specifies physical address of start of profiling unit. - qcom,use-alt-unit: Usage: Optional Value type: <u32> Definition: Specifies designated unit no. for which alternate unit is configured to capture time stamp. Example: qcom,rpmh-master-stats { compatible = "qcom,rpmh-master-stats"; reg = <0xb221200 0x60>; qcom,use-alt-unit = <3>; }; arch/arm64/boot/dts/qcom/sdm670-pm.dtsi +1 −0 Original line number Diff line number Diff line Loading @@ -195,5 +195,6 @@ qcom,rpmh-master-stats@b221200 { compatible = "qcom,rpmh-master-stats-v1"; reg = <0xb221200 0x60>; qcom,use-alt-unit = <3>; }; }; arch/arm64/boot/dts/qcom/sdm845-pm.dtsi +1 −0 Original line number Diff line number Diff line Loading @@ -149,5 +149,6 @@ qcom,rpmh-master-stats@b221200 { compatible = "qcom,rpmh-master-stats-v1"; reg = <0xb221200 0x60>; qcom,use-alt-unit = <3>; }; }; drivers/soc/qcom/rpmh_master_stat.c +20 −1 Original line number Diff line number Diff line Loading @@ -58,7 +58,8 @@ enum profile_data { POWER_UP_END, POWER_DOWN_END, POWER_UP_START, NUM_UNIT, ALT_UNIT, NUM_UNIT = ALT_UNIT, }; struct msm_rpmh_master_data { Loading Loading @@ -96,6 +97,7 @@ struct rpmh_master_stats_prv_data { static struct msm_rpmh_master_stats apss_master_stats; static void __iomem *rpmh_unit_base; static uint32_t use_alt_unit; static DEFINE_MUTEX(rpmh_stats_mutex); Loading Loading @@ -178,6 +180,17 @@ void msm_rpmh_master_stats_update(void) return; for (i = POWER_DOWN_END; i < NUM_UNIT; i++) { if (i == use_alt_unit) { profile_unit[i].value = readl_relaxed( rpmh_unit_base + GET_ADDR( REG_DATA_LO, ALT_UNIT)); profile_unit[i].value |= ((uint64_t) readl_relaxed( rpmh_unit_base + GET_ADDR( REG_DATA_HI, ALT_UNIT)) << 32); continue; } profile_unit[i].valid = readl_relaxed(rpmh_unit_base + GET_ADDR(REG_VALID, i)); Loading Loading @@ -233,6 +246,12 @@ static int msm_rpmh_master_stats_probe(struct platform_device *pdev) goto fail_sysfs; } ret = of_property_read_u32(pdev->dev.of_node, "qcom,use-alt-unit", &use_alt_unit); if (ret) use_alt_unit = -1; rpmh_unit_base = of_iomap(pdev->dev.of_node, 0); if (!rpmh_unit_base) { pr_err("Failed to get rpmh_unit_base\n"); Loading Loading
Documentation/devicetree/bindings/arm/msm/rpmh-master-stat.txt +7 −0 Original line number Diff line number Diff line Loading @@ -23,9 +23,16 @@ The required properties for rpmh-master-stats are: Value type: <prop-encoded-array> Definition: Specifies physical address of start of profiling unit. - qcom,use-alt-unit: Usage: Optional Value type: <u32> Definition: Specifies designated unit no. for which alternate unit is configured to capture time stamp. Example: qcom,rpmh-master-stats { compatible = "qcom,rpmh-master-stats"; reg = <0xb221200 0x60>; qcom,use-alt-unit = <3>; };
arch/arm64/boot/dts/qcom/sdm670-pm.dtsi +1 −0 Original line number Diff line number Diff line Loading @@ -195,5 +195,6 @@ qcom,rpmh-master-stats@b221200 { compatible = "qcom,rpmh-master-stats-v1"; reg = <0xb221200 0x60>; qcom,use-alt-unit = <3>; }; };
arch/arm64/boot/dts/qcom/sdm845-pm.dtsi +1 −0 Original line number Diff line number Diff line Loading @@ -149,5 +149,6 @@ qcom,rpmh-master-stats@b221200 { compatible = "qcom,rpmh-master-stats-v1"; reg = <0xb221200 0x60>; qcom,use-alt-unit = <3>; }; };
drivers/soc/qcom/rpmh_master_stat.c +20 −1 Original line number Diff line number Diff line Loading @@ -58,7 +58,8 @@ enum profile_data { POWER_UP_END, POWER_DOWN_END, POWER_UP_START, NUM_UNIT, ALT_UNIT, NUM_UNIT = ALT_UNIT, }; struct msm_rpmh_master_data { Loading Loading @@ -96,6 +97,7 @@ struct rpmh_master_stats_prv_data { static struct msm_rpmh_master_stats apss_master_stats; static void __iomem *rpmh_unit_base; static uint32_t use_alt_unit; static DEFINE_MUTEX(rpmh_stats_mutex); Loading Loading @@ -178,6 +180,17 @@ void msm_rpmh_master_stats_update(void) return; for (i = POWER_DOWN_END; i < NUM_UNIT; i++) { if (i == use_alt_unit) { profile_unit[i].value = readl_relaxed( rpmh_unit_base + GET_ADDR( REG_DATA_LO, ALT_UNIT)); profile_unit[i].value |= ((uint64_t) readl_relaxed( rpmh_unit_base + GET_ADDR( REG_DATA_HI, ALT_UNIT)) << 32); continue; } profile_unit[i].valid = readl_relaxed(rpmh_unit_base + GET_ADDR(REG_VALID, i)); Loading Loading @@ -233,6 +246,12 @@ static int msm_rpmh_master_stats_probe(struct platform_device *pdev) goto fail_sysfs; } ret = of_property_read_u32(pdev->dev.of_node, "qcom,use-alt-unit", &use_alt_unit); if (ret) use_alt_unit = -1; rpmh_unit_base = of_iomap(pdev->dev.of_node, 0); if (!rpmh_unit_base) { pr_err("Failed to get rpmh_unit_base\n"); Loading