This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

[参考译文] Linux/AM3358:SDK 1.03中的电源管理

Guru**** 2952510 points
请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/processors-group/processors/f/processors-forum/673569/linux-am3358-power-management-in-sdk-1-03

器件型号:AM3358

工具/软件:Linux

一位客户报告说、他无法将 AM335x 上带有 ProcessorSDK 1.03的 cpufreq 更改为任何可用频率。

我在 BeagleBone Black 上验证了相同的操作:

root@AM335x-EVM:~# cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq
300000
root@AM335x-EVM:~# cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies
300000 600000 720000 800000 1000000

root@AM335x-EVM:// echo 6000000 >/sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed
-sh:echo:write error:invalid arge.
root@AM335x-EVM:/#

root@AM335x-EVM:// echo 720000 >/sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed
-sh:echo:write error:invalid arge.
root@AM335x-EVM:// uname -a
Linux AM335x-EVM 3.14.43-g875c69b #3星期三10月7日08:09:01 EDT 2015 armv7l GNU/Linux
root@AM335x-EVM:/# cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq300000
root@AM335x-EVM:/#

最新的 Processor SDK 文档提到了一些 menuconfig 选项(这些选项都是模块)  在 ProcessorSDK1.03上) 、并且需要使用修改设备树文件而不是 oppXXXX_data.c 文件。

http://processors.wiki.ti.com/index.php/Linux_Core_Power_Management_User's_Guide_(v4.4)#DT_Configuration

但 在 Processor SDK 1.03中、我 看到正在构建/board-support/linux-3.14.43 +gitAUTOINC+875c69b2c3-g875c69b/arch/arm/mach-OMAP2/opp33xx_data.c。  而且、即使认为构建了、也不会使用 cpufreq 模块:

root@AM335x-EVM://ls /lib/modules/3.14.43-g875c69b/kernel/drivers/cpufreqcpufreq_conservative.ko cpufreq_powersave.ko    cpufreq_userspace.ko
root@AM335x-EVM:/#

在 ProcessorSDK 1.03中更改 cpufreq scaling_setspeed 的最佳方法是什么?

从600MHz 到300MHz 可以节省多少功耗?

>>电压不变时300MHz 与600MHz 之间的功耗差值约为75mW

可能是旧数据、但在 http://processors.wiki.ti.com/index.php/AM335x_Power_Management_User_Guide#Dynamic_Frequency_Scaling 中看起来很重要 

processors.wiki.ti.com/.../Linux_Core_Power_Management_User's_Guide_(v4.4)

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。
    Joe、您好!

    对于 PSDK 1.03、您应该使用以下 wiki:

    processors.wiki.ti.com/.../Linux_Core_Power_Management_User's_Guide_(v3.14)

    此致、
    帕维尔
  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    [引用 user ="Joe George"]从600MHz 到300MHz 可以节省多少功耗?

    查看以下 wiki 页面:

    此致、
    帕维尔

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    感谢您提供存档的参考资料。 我对 menuconfig 进行了更改。 并参阅/drivers/cpufreq/cpufreq-cpu0.c 和/board-support/linux-3.14.43 +gitAUTOINC+875c69b2c3-g875c69b/arch/arm/mach-OMAP2/opp33xx_data 生成。

    但对器件树文件有点困惑。 如何知道上述文件是否解析了 DT 文件?

    >CPU0-SUPPLY =<&dc2>;
    从 Wiki 上、这是 BeagleBone Black 的 CPU@0节点的正确值吗?

    尽管 Wiki 在同一文件(am33xx.dtsi)中提到了 opp-modifier 表、但在 gepping /board-support/linux-3.14.43 +gitAUTOINC+875c69b2c3-g875c69b/arch/arm/boot/DTS 时、看不到 DTS 目录中提到 opp

    我们如何使/cpufreq/scaling_setspeed 正常工作?

    (如果更简单、我还可以在 AM335x EVM 上进行测试)。

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。
    >CPU0-SUPPLY =<&dc2>;
    现在、我看到这是在 AM335x-bone-common.dtsi 中为 BBB 定义的。 但是、当我们尝试设置速度时、仍然会遇到上述错误、尽管我认为我们正在执行存档的 Wiki 中提到的所有操作。

    >>尽管 Wiki 在中提到了 opp-modifier 表
    由于 Wiki 页面上的链接无效、因此该表更加令人困惑:
    processors.wiki.ti.com/.../Linux_Core_Power_Management_User's_Guide_(v3.14)

    那么、这是什么? DT 中的操作点(在以后的 SDK 中看起来像 CPU0_opp_table)或在 opp33xx_data.c 中定义的平台数据?

    各种 Wiki 版本似乎是来回重复的。

    那么、我们如何让/cpufreq/scaling_setspeed 在 Processor SDK 1.03 (即 Linux 3.14)中工作?
  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    Joe、

    要从 userspace 更改频率、需要将调节器从"onDemand "更改为"userspace"。 我测试了 PSDK 1.03中的预构建内核、在 AM335x SK 电路板上工作正常。 以下是日志:

    [0.000000]  Linux 版本3.14.43-g875c69b (gtbldadm@Uubuntu-12)(gcc 版本4.7.3 20130226 (预发布版本)(Crossstuck-NG linaro-1.13.1-4.7-2013.03-20130313 - Linaro GCC 2013.03)))#1 EDT Mon 6 16:00:11 2015年7月11日

    [0.000000]  机器模型:TI AM335x EVM-SK

    [0.000000]  AM335X ES2.1 (SGX NEON )

    …

    root@AM335x-EVM:~# cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor

    OnDemand

    root@AM335x-EVM:~# echo userspace >/sys/devices/system/cpu/cpu0/cpufreq/scaling

    root@AM335x-EVM:~# cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor

    用户空间

    root@AM335x-EVM:~# cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq

    300000

    root@AM335x-EVM:~# echo 720000 >/sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed

    root@AM335x-EVM:~# cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq

    720000

     

    3.14 Wiki 中对此进行了说明:

    userspace:此调速器允许用户使用 scaling_available 频率中的任何值设置所需的 OPP、方法是将其回显到 scaling_setspeed 中。

    要更改 OPP (只能对用户空间调节器执行此操作。 如果使用按需调整器、则会根据系统负载自动更改 OPP)

     

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。
    Pavel、
    感谢您提供全面的答案(以及在实际硬件上进行测试)。

    我完全错过了这个额外的步骤。 您也可以在 menuconfig 中设置默认值:
    默认 cpufreq 调节器(按需)

    未来可能会有一些电源轨问题、但现在即将结束。

    请在下面登录:
    root@AM335x-EVM:~# cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq
    300000
    root@AM335x-EVM:~# cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies
    300000 600000 720000 800000 1000000
    root@AM335x-EVM:~# cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governorondemand
    root@AM335x-EVM:~# echo userspace >/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
    root@AM335x-EVM:~# cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
    用户空间
    root@AM335x-EVM:~# echo 600000 >/sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed
    root@AM335x-EVM:~# cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq
    600000
    根目录@AM335x-EVM:~编号