/
Zynq-7000 AP SoC Low Power Techniques part 5 - Linux Application Control of Processing System - Frequency Scaling & More Tech Tip

Zynq-7000 AP SoC Low Power Techniques part 5 - Linux Application Control of Processing System - Frequency Scaling & More Tech Tip

Zynq-7000 AP SoC Low Power Techniques part 5 - Linux Application Control of Processing System - Frequency Scaling & More Tech Tip

Document History
Date
Version
Author
Description of Revisions
05/27/2014
1.0
Chandramohan Pujari
Initial Version
1/10/2014
2.0
Rajesh Gugulothu
Enhancements
Summary

The "Power Demo" was created with a vision to provide different power saving techniques available with Zynq AP SoC. It’s also intended to provide user with the flexibility to identify the system power, CPU utilization, CPU frequency scaling at run time and thus providing an opportunity to validate power budgets while designing the system. It demonstrates power consumption during execution of Ubuntu desktop and corresponding applications on Zynq. User can execute these applications and perform different I/O operation on Zynq PS peripherals supported by Ubuntu desktop to measure power consumption. Power Management of entire system can also be affected by I/O buffers at the PIN which drive the current and the traffic through logic gates. Controlling and power utilization of IOB’s and logic gates are explained as a part of Power Consuming And Speed Test Modules

This tech tip aims to help understand the basic Linux framework and various factors affecting power and how power consumption and the implementation support provided for the processing System (PS) to optimize the power consumption as a part of power Demo. In simple terms this tech tip helps user to map the theory of Linux Power management while running the power Demo providing a practical and proactive approach. It’s strongly advised that users goes through the “Zynq Power: Installing and running the Power Demo” tech tip before proceeding with the current tech tip.

Implementation

Implementation Details
Design Type
PS + PL
SW Type
Linux
CPUs
2 ARM Cortex-A9
PS Features
  • DDR3 533 MHZ
  • L2-Caches
  • USB
  • Ethernet
  • UART
Boards/Tools
ZC702
Xilinx Tools Version
Vivado 2013.4
Board
ZC702 Rev 1.0
Files Provided
Zynq7000AP_SOC_LinuxApplicationforPS.zip
See Appendix B for the descriptions of the files

Linux Kernel configuration for PM framework support in power demo

This section explains about the supported Linux OS power management framework features in the power demo. This section also explains how to enable corresponding frame work in the kernel configuration while building the kernel image for the Zynq System.
Following is list of PM (power management) frameworks features supported in the power demo and the corresponding changes required in the config file of kernel configuration.
  • CPU Frequency: The cpufreq framework is used to scale the CPU frequency. The framework exposes a control interface through sysfs Is /sys/devices/system/cpu/cpu0/cpufreq/. This interface provides statistics (if enabled) and allows to choose a scaling governor and in case of the userspace governor is used to manually set a frequency.
    To enable the cpufreq framework enable the following config options in your kernel configuration:
    • CONFIG_REGULATOR
    • CONFIG_THERMAL
    • CONFIG_CPU_THERMAL
    • CONFIG_CPU_FREQ
    • CONFIG_CPU_FREQ_TABLE
    • CONFIG_CPU_FREQ_GOV_PERFORMANCE
    • CONFIG_CPU_FREQ_GOV_POWERSAVE
    • CONFIG_CPU_FREQ_GOV_USERSPACE
    • CONFIG_CPU_FREQ_GOV_ONDEMAND
    • CONFIG_CPU_FREQ_GOV_CONSERVATIVE
    • CONFIG_CPU_FREQ_STAT
    • CONFIG_CPU_FREQ_STAT_DETAILS
  • CPU Idle: The cpuidle framework manages CPU idle levels. The cpuidle driver puts idle CPUs in a low power state when a CPU becomes idle.To enable the cpuidle framework enable the following config options in your kernel configuration:
    • CONFIG_CPU_IDLE
    • CONFIG_CPU_IDLE_GOV_LADDER
    • CONFIG_CPU_IDLE_GOV_MENU
  • Suspend: The suspend framework provides the interface to enter sleep states, like the well-known 'suspend to disk/RAM' on laptops. The architecture specific callbacks and initialization is located in arch/arm/mach-zynq/pm.c. In order to shut down the DDR subsystem the final suspend call — mach-zynq/suspend.S:zynq_sys_suspend () — is moved into OCM and executed from there. Depending on the requirements of the wakeup device enabled, the IOPLL might not be bypassed. All Zynq peripheral drivers employ clock gating during suspend. The implementation details for suspend is described in detail at following link https://www.kernel.org/doc/Documentation/power/suspend-and-cpuhotplug.txt.To enable the suspend framework, enable the following config options in your kernel configuration.
    • CONFIG_PM_SLEEP
  • Hardware Monitoring
    • XADC: The Xilinx analog mixed signal module, referred to as the XADC, allows temperature and voltage monitoring. In power demo for reading the die temperature through XADC module, enable the following kernel configuration option in the config file.
      • CONFIG_XILINX_XADC
    After modifying .config file with above options, build the kernel image. The steps to build the kernel image and device tree can be found at the following link http://www.wiki.xilinx.com/Zynq+Base+TRD+14.5

Host Machine Application view
Host machine application is C# based GUI program executing on windows machine. The GUI sends commands and receives different kind responses from Linux application running on is the ZC702 board. Below figures shows Host machine GUI application:

              • Fig 1: GUI application

Linux Application description