Skip to content

Integrate linux-seco-mtk/oleksii/upstream-cpufreq

GitBot requested to merge linux-seco-mtk/oleksii/upstream-cpufreq into kirkstone

Commit: clea-os/bsp/mediatek/linux-seco-mtk@b58bb78f

GENIO: cpufreq: mediatek: correct max sram voltage for MT8365

Since the regulator cannot be set to 940mV, it will cause an error message. Adjust it to 925mV to meet the regulator's requirements.

Change-Id: I3a246548652cedad4b64022be632fbffc327ef72 Signed-off-by: Chris-QJ Chen chris-qj.chen@mediatek.com

--

Commit: clea-os/bsp/mediatek/linux-seco-mtk@32d687e7

GENIO: soc: mediatek: pm-domains: add smi clamp and larb reset step

add smi clamp and larb reset to clear glitch when sub domain power on.

Change-Id: I0ff7c45554da02f9818cfd26cf6a44cea77f097a Signed-off-by: Olivia Wen olivia.wen@mediatek.corp-partner.google.com Signed-off-by: Chris-QJ Chen chris-qj.chen@mediatek.com

--

Commit: clea-os/bsp/mediatek/linux-seco-mtk@774138c6

BACKPORT: UPSTREAM: soc: mediatek: pm-domains: Add buck isolation setting in power domain

In some chipsets, we need to disable EXT_BUCK_ISO before turning on the specific power pm-domains (mtcmos), such as ADSP in MT8192 and CAM_VCORE in MT8188.

Add the MTK_SCPD_EXT_BUCK_ISO flag to control the buck isolation setting in the mediatek power domain driver.

Signed-off-by: Allen-KH Cheng allen-kh.cheng@mediatek.com Reviewed-by: AngeloGioacchino Del Regno angelogioacchino.delregno@collabora.com Link: https://lore.kernel.org/r/20230117032640.13504-3-allen-kh.cheng@mediatek.com Signed-off-by: Matthias Brugger matthias.bgg@gmail.com (cherry picked from commit 7d1ae5926d3216f823be56b79202711dd0b83cdb)

Reorder the definition MTK_SCPD_EXT_BUCK_ISO to BIT(7) because BIT(6) has been used in Commit e5b0b1c82707e0fc9f15d269cc259718592591bc ("BACKPORT: FROMLIST: soc: mediatek: Add support always on flag")

Change-Id: Id9455e056047d2415371b4c8da713f6ca8d29ea6 Signed-off-by: Chris-QJ Chen chris-qj.chen@mediatek.com

--

Commit: clea-os/bsp/mediatek/linux-seco-mtk@38456591

UPSTREAM: soc: mediatek: pm-domains: Add buck isolation offset and mask to power domain data

Add buck isolation offset and mask to power domain data.

Signed-off-by: Allen-KH Cheng allen-kh.cheng@mediatek.com Reviewed-by: AngeloGioacchino Del Regno angelogioacchino.delregno@collabora.com Link: https://lore.kernel.org/r/20230117032640.13504-2-allen-kh.cheng@mediatek.com Signed-off-by: Matthias Brugger matthias.bgg@gmail.com Change-Id: I54a48c185dc38ebf0d93f3335a3c635f6a51e219 Signed-off-by: Chris-QJ Chen chris-qj.chen@mediatek.com

--

Commit: clea-os/bsp/mediatek/linux-seco-mtk@d446ed73

UPSTREAM: soc: mediatek: pm-domains: Fix the power glitch issue

Power reset maybe generate unexpected signal. In order to avoid the glitch issue, we need to enable isolation first to guarantee the stable signal when power reset is triggered.

Fixes: 59b644b01cf4 ("soc: mediatek: Add MediaTek SCPSYS power domains") Signed-off-by: Chun-Jie Chen chun-jie.chen@mediatek.com Signed-off-by: Allen-KH Cheng allen-kh.cheng@mediatek.com Reviewed-by: Chen-Yu Tsai wenst@chromium.org Reviewed-by: Miles Chen miles.chen@mediatek.com Reviewed-by: AngeloGioacchino Del Regno angelogioacchino.delregno@collabora.com Link: https://lore.kernel.org/r/20221014102029.1162-1-allen-kh.cheng@mediatek.com Signed-off-by: Matthias Brugger matthias.bgg@gmail.com Change-Id: I9e02e51fa1e489af7e0401781d2e105cd6827e5e Signed-off-by: Chris-QJ Chen chris-qj.chen@mediatek.com

--

Commit: clea-os/bsp/mediatek/linux-seco-mtk@c79f5021

GENIO: arm64: dts: mt8195: add smi-sub-comm of larb for clamp

add "mediatek,smi-sub-comm" and "mediatek,smi-sub-comm-inport" to ISP SMI larb nodes, to support warm SW reset feature.

Ref. CID: 7215979, 7215978, 7215977

CR-Id: AUTO00291628 Change-Id: I55dd513b7c814f2d659802bbca0880561cb4e499 Signed-off-by: Chengci.Xu chengci.xu@mediatek.com Signed-off-by: olivia.wen olivia.wen@mediatek.com

--

Commit: clea-os/bsp/mediatek/linux-seco-mtk@355ae1d1

GENIO: arm64: dts: mt8370: add smi-sub-comm of larb for clamp

add "mediatek,smi-sub-comm" and "mediatek,smi-sub-comm-inport" to ISP SMI larb nodes, to support warm SW reset feature.

Ref. CID: 7215979, 7215978, 7215977

CR-Id: AUTO00291628 Change-Id: I8f7258350e60d3c3e945f68b4ea587ef6925b072 Signed-off-by: Chengci.Xu chengci.xu@mediatek.com Signed-off-by: olivia.wen olivia.wen@mediatek.com

--

Commit: clea-os/bsp/mediatek/linux-seco-mtk@83ae0b7c

GENIO: arm64: dts: mt8188: add smi-sub-comm of larb for clamp

add "mediatek,smi-sub-comm" and "mediatek,smi-sub-comm-inport" to ISP SMI larb nodes, to support warm SW reset feature.

Ref. CID: 7215979, 7215978, 7215977

CR-Id: AUTO00291628 Change-Id: I4bdb87d9c30baf7dcdfc40ecdeb779597a2f3b46 Signed-off-by: Chengci.Xu chengci.xu@mediatek.com Signed-off-by: olivia.wen olivia.wen@mediatek.com

--

Commit: clea-os/bsp/mediatek/linux-seco-mtk@f8c18e10

GENIO: memory: mtk-smi: add clamp function to protect ISP SW reset

Add smi sub common clamp feature for ISP SMI larb to avoid the glitch caused by warm sw-reset of masters and asif bus.

Ref. CID: 7215979, 7215978, 7215977

CR-Id: AUTO00291628 Change-Id: I2048fbe9b9adf383d28cd31d1d08c06f44d69c35 Signed-off-by: Chengci.Xu chengci.xu@mediatek.com Signed-off-by: olivia.wen olivia.wen@mediatek.com

--

Commit: clea-os/bsp/mediatek/linux-seco-mtk@5e950465

GENIO: cpufreq: mediatek: correct proc/sram voltage for MT8365

Since the upper boundary of proc/sram voltage of MT8365 is differ to mt2701, we fix it by adding the corresponding platform data and specify proc/sram_max_volt to support MT8365.

Change-Id: Iaea665fdd222379c85922f6bfb0efcb15b0a0072 Signed-off-by: Chris-QJ Chen chris-qj.chen@mediatek.com

--

Commit: clea-os/bsp/mediatek/linux-seco-mtk@c47d6364

cpufreq: mediatek: Fix potential deadlock problem in mtk_cpufreq_set_target

Fix following coccichek error: ./drivers/cpufreq/mediatek-cpufreq.c:199:2-8: preceding lock on line ./drivers/cpufreq/mediatek-cpufreq.c:208:2-8: preceding lock on line

mutex_lock is acquired but not released before return. Use 'goto out' to help releasing the mutex_lock.

Fixes: c210063b40ac ("cpufreq: mediatek: Add opp notification support") Signed-off-by: Wan Jiabing wanjiabing@vivo.com Reviewed-by: Rex-BC Chen rex-bc.chen@mediatek.com Signed-off-by: Viresh Kumar viresh.kumar@linaro.org

--

Commit: clea-os/bsp/mediatek/linux-seco-mtk@eec5ce1a

cpufreq: mediatek: Add opp notification support

From this opp notifier, cpufreq should listen to opp notification and do proper actions when receiving events of disable and voltage adjustment.

One of the user for this opp notifier is MediaTek SVS. The MediaTek Smart Voltage Scaling (SVS) is a hardware which calculates suitable SVS bank voltages to OPP voltage table.

Signed-off-by: Andrew-sh.Cheng andrew-sh.cheng@mediatek.com Signed-off-by: Jia-Wei Chang jia-wei.chang@mediatek.com Signed-off-by: Rex-BC Chen rex-bc.chen@mediatek.com Reviewed-by: AngeloGioacchino Del Regno angelogioacchino.delregno@collabora.com [ Viresh: Renamed opp_freq as current_freq and moved its initialization ] Signed-off-by: Viresh Kumar viresh.kumar@linaro.org

--

Commit: clea-os/bsp/mediatek/linux-seco-mtk@536fb0ee

cpufreq: mediatek: Refine mtk_cpufreq_voltage_tracking()

Because the difference of sram and proc should in a range of min_volt_shift and max_volt_shift. We need to adjust the sram and proc step by step.

We replace VOLT_TOL (voltage tolerance) with the platform data and update the logic to determine the voltage boundary and invoking regulator_set_voltage.

  • Use 'sram_min_volt' and 'sram_max_volt' to determine the voltage boundary of sram regulator.
  • Use (sram_min_volt - min_volt_shift) and 'proc_max_volt' to determine the voltage boundary of vproc regulator.

Moreover, to prevent infinite loop when tracking voltage, we calculate the maximum value for each platform data. We assume min voltage is 0 and tracking target voltage using min_volt_shift for each iteration. The retry_max is 3 times of expeted iteration count.

Signed-off-by: Jia-Wei Chang jia-wei.chang@mediatek.com Signed-off-by: Rex-BC Chen rex-bc.chen@mediatek.com Reviewed-by: AngeloGioacchino Del Regno angelogioacchino.delregno@collabora.com Signed-off-by: Viresh Kumar viresh.kumar@linaro.org

--

Commit: clea-os/bsp/mediatek/linux-seco-mtk@5b80991f

cpufreq: mediatek: Move voltage limits to platform data

Voltages and shifts are defined as macros originally. There are different requirements of these values for each MediaTek SoCs. Therefore, we add the platform data and move these values into it.

Signed-off-by: Jia-Wei Chang jia-wei.chang@mediatek.com Signed-off-by: Rex-BC Chen rex-bc.chen@mediatek.com Reviewed-by: AngeloGioacchino Del Regno angelogioacchino.delregno@collabora.com Signed-off-by: Viresh Kumar viresh.kumar@linaro.org

--

Commit: clea-os/bsp/mediatek/linux-seco-mtk@d53e7791

cpufreq: mediatek: Unregister platform device on exit

We register the platform device when driver inits. However, we do not unregister it when driver exits.

To resolve this, we declare the platform data to be a global static variable and rename it to be "cpufreq_pdev". With this global variable, we can do platform_device_unregister() when driver exits.

Fixes: 501c574f4e3a ("cpufreq: mediatek: Add support of cpufreq to MT2701/MT7623 SoC") Signed-off-by: Rex-BC Chen rex-bc.chen@mediatek.com [ Viresh: Commit log and Subject ] Signed-off-by: Viresh Kumar viresh.kumar@linaro.org

--

Commit: clea-os/bsp/mediatek/linux-seco-mtk@d669bc41

cpufreq: mediatek: Fix NULL pointer dereference in mediatek-cpufreq

Fix following coccicheck error: drivers/cpufreq/mediatek-cpufreq.c:464:16-23: ERROR: info is NULL but dereferenced.

Use pr_err instead of dev_err to avoid dereferring a NULL pointer.

Fixes: f52b16ba9fe4 ("cpufreq: mediatek: Use device print to show logs") Signed-off-by: Wan Jiabing wanjiabing@vivo.com Reviewed-by: Matthias Brugger matthias.bgg@gmail.com Signed-off-by: Viresh Kumar viresh.kumar@linaro.org

--

Commit: clea-os/bsp/mediatek/linux-seco-mtk@a3951d2d

cpufreq: mediatek: Make sram regulator optional

For some MediaTek SoCs, like MT8186, it's possible that the sram regulator is shared between CPU and CCI. We hope regulator framework can return error for error handling rather than a dummy handler from regulator_get api. Therefore, we choose to use regulator_get_optional.

Signed-off-by: Jia-Wei Chang jia-wei.chang@mediatek.com Signed-off-by: Rex-BC Chen rex-bc.chen@mediatek.com Reviewed-by: AngeloGioacchino Del Regno angelogioacchino.delregno@collabora.com Signed-off-by: Viresh Kumar viresh.kumar@linaro.org

--

Commit: clea-os/bsp/mediatek/linux-seco-mtk@abc405c4

cpufreq: mediatek: Record previous target vproc value

We found the buck voltage may not be exactly the same with what we set because CPU may share the same buck with other module. Therefore, we need to record the previous desired value instead of reading it from regulators.

Signed-off-by: Andrew-sh.Cheng andrew-sh.cheng@mediatek.com Signed-off-by: Jia-Wei Chang jia-wei.chang@mediatek.com Signed-off-by: Rex-BC Chen rex-bc.chen@mediatek.com Reviewed-by: AngeloGioacchino Del Regno angelogioacchino.delregno@collabora.com Signed-off-by: Viresh Kumar viresh.kumar@linaro.org

--

Commit: clea-os/bsp/mediatek/linux-seco-mtk@1368b05b

cpufreq: mediatek: Replace old_* with pre_*

To make driver more readable, replace old_* with pre_*.

Signed-off-by: Rex-BC Chen rex-bc.chen@mediatek.com Reviewed-by: AngeloGioacchino Del Regno angelogioacchino.delregno@collabora.com Signed-off-by: Viresh Kumar viresh.kumar@linaro.org

--

Commit: clea-os/bsp/mediatek/linux-seco-mtk@1e4549de

cpufreq: mediatek: Use device print to show logs

  • Replace pr_* with dev_* to show logs.
  • Remove usage of func.

Signed-off-by: Rex-BC Chen rex-bc.chen@mediatek.com Reviewed-by: AngeloGioacchino Del Regno angelogioacchino.delregno@collabora.com Signed-off-by: Viresh Kumar viresh.kumar@linaro.org

--

Commit: clea-os/bsp/mediatek/linux-seco-mtk@3caf3afc

cpufreq: mediatek: Enable clocks and regulators

We need to enable regulators so that the max and min requested values will be recorded. The intermediate clock is not always enabled by CCF in different projects, so we should enable it in the cpufreq driver.

Signed-off-by: Andrew-sh.Cheng andrew-sh.cheng@mediatek.com Signed-off-by: Jia-Wei Chang jia-wei.chang@mediatek.com Signed-off-by: Rex-BC Chen rex-bc.chen@mediatek.com Reviewed-by: AngeloGioacchino Del Regno angelogioacchino.delregno@collabora.com Signed-off-by: Viresh Kumar viresh.kumar@linaro.org

--

Commit: clea-os/bsp/mediatek/linux-seco-mtk@63ba9f96

cpufreq: mediatek: Remove unused headers

Remove unused headers.

Signed-off-by: Jia-Wei Chang jia-wei.chang@mediatek.com Reviewed-by: AngeloGioacchino Del Regno angelogioacchino.delregno@collabora.com Signed-off-by: Viresh Kumar viresh.kumar@linaro.org

--

Commit: clea-os/bsp/mediatek/linux-seco-mtk@402bcc54

cpufreq: mediatek: Cleanup variables and error handling in mtk_cpu_dvfs_info_init()

  • Remove several unnecessary varaibles in mtk_cpu_dvfs_info_init().
  • Unify error message format and use dev_err_probe() if possible.

Signed-off-by: Jia-Wei Chang jia-wei.chang@mediatek.com Signed-off-by: Rex-BC Chen rex-bc.chen@mediatek.com Reviewed-by: AngeloGioacchino Del Regno angelogioacchino.delregno@collabora.com Signed-off-by: Viresh Kumar viresh.kumar@linaro.org

--

Commit: clea-os/bsp/mediatek/linux-seco-mtk@e3cef8ef

cpufreq: mediatek: Use module_init and add module_exit

  • Use module_init instead of device_initcall.
  • Add a function for module_exit to unregister driver.

Signed-off-by: Jia-Wei Chang jia-wei.chang@mediatek.com Reviewed-by: AngeloGioacchino Del Regno angelogioacchino.delregno@collabora.com Signed-off-by: Viresh Kumar viresh.kumar@linaro.org

--

Commit: clea-os/bsp/mediatek/linux-seco-mtk@7ff6647a

Revert "cpufreq: mediatek: Enable clock and regulator"

This reverts commit 38a942a10e51f7c36948e1277469f9dc67343aa9.

--

Commit: clea-os/bsp/mediatek/linux-seco-mtk@d36ecd34

Revert "cpufreq: mediatek: Add record of previous desired vproc value"

This reverts commit 3f2955463508a273c9acf686637d35ae01e003ed.

--

Commit: clea-os/bsp/mediatek/linux-seco-mtk@5076cc6e

Revert "cpufreq: mediatek: add opp notification for SVS support"

This reverts commit 9afa0107f814e69ec2c3abbf11b86b21d0710f51.

Merge request reports