Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6479e0e4 authored by Jeyaprakash Soundrapandian's avatar Jeyaprakash Soundrapandian Committed by Gerrit - the friendly Code Review server
Browse files

Merge "DOWNSTREAM: Merge AU303 -commit...

Merge "DOWNSTREAM: Merge AU303 -commit '9db5ea28' into Topic branch - 12/11/17" into dev/msm-4.9-camx
parents 7919cf91 d5d2256a
Loading
Loading
Loading
Loading
+157 −0
Original line number Diff line number Diff line
Introduction
============

Resource Power Manager (RPM)

RPM is a dedicated hardware engine for managing shared SoC resources,
which includes buses, clocks, power rails, etc.  The goal of RPM is
to achieve the maximum power savings while satisfying the SoC's
operational and performance requirements.  RPM accepts resource
requests from multiple RPM masters.  It arbitrates and aggregates the
requests, and configures the shared resources.  The RPM masters are
the application processor, the modem processor, as well as some
hardware accelerators.

The RPM driver provides an API for interacting with RPM.  Kernel code
calls the RPM driver to request RPM-managed, shared resources.
Kernel code can also register with the driver for RPM notifications,
which are sent when the status of shared resources change.

Hardware description
====================

RPM exposes a separate region of registers to each of the RPM masters.
In general, each register represents some shared resource(s).  At a
very basic level, a master requests resources by writing to the
registers, then generating an interrupt to RPM.  RPM processes the
request, writes acknowledgment to the registers, then generates an
interrupt to the master.

In addition to the master-specific regions, RPM also exposes a shared
region that contains the current status of the shared resources.  Only
RPM can write to the status region, but every master can read from it.

RPM contains internal logics that aggregate and arbitrate among
requests from the various RPM masters.  It interfaces with the PMIC,
the bus arbitration block, and the clock controller block in order to
configure the shared resources.

Software description
====================

The RPM driver encapsulates the low level RPM interactions, which
rely on reading/writing registers and generating/processing
interrupts, and provides a higher level synchronuous set/clear/get
interface.  Most functions take an array of id-value pairs.
The ids identify the RPM registers which would correspond to some
RPM resources, the values specify the new resource values.

The RPM driver synchronizes accesses to RPM.  It protects against
simultaneous accesses from multiple tasks, on SMP cores, in task
contexts, and in atomic contexts.

Design
======

Design goals:
- Encapsulate low level RPM interactions.
- Provide a synchronuous set/clear/get interface.
- Synchronize simultaneous software accesses to RPM.

Power Management
================

RPM is part of the power management architecture for MSM 8660.  RPM
manages shared system resources to lower system power.

SMP/multi-core
==============

The RPM driver uses mutex to synchronize client accesses among tasks.
It uses spinlocks to synchronize accesses from atomic contexts and
SMP cores.

Security
========

None.

Performance
===========

None.

Interface
=========

msm_rpm_get_status():
The function reads the shared status region and returns the current
resource values, which are the arbitrated/aggregated results across
all RPM masters.

msm_rpm_set():
The function makes a resource request to RPM.

msm_rpm_set_noirq():
The function is similar to msm_rpm_set() except that it must be
called with interrupts masked.  If possible, use msm_rpm_set()
instead, to maximize CPU throughput.

msm_rpm_clear():
The function makes a resource request to RPM to clear resource values.
Once the values are cleared, the resources revert back to their default
values for this RPM master.  RPM internally uses the default values as
the requests from this RPM master when arbitrating and aggregating with
requests from other RPM masters.

msm_rpm_clear_noirq():
The function is similar to msm_rpm_clear() except that it must be
called with interrupts masked.  If possible, use msm_rpm_clear()
instead, to maximize CPU throughput.

msm_rpm_register_notification():
The function registers for RPM notification.  When the specified
resources change their status on RPM, RPM sends out notifications
and the driver will "up" the semaphore in struct
msm_rpm_notification.

msm_rpm_unregister_notification():
The function unregisters a notification.

msm_rpm_init():
The function initializes the RPM driver with platform specific data.

Driver parameters
=================

None.

Config options
==============

MSM_RPM

Dependencies
============

None.

User space utilities
====================

None.

Other
=====

None.

Known issues
============

None.

To do
=====

None.
+6 −0
Original line number Diff line number Diff line
@@ -31,6 +31,12 @@ to deliver its interrupts via SPIs.
  This also affects writes to the tval register, due to the implicit
  counter read.

- hisilicon,erratum-161010101 : A boolean property. Indicates the
  presence of Hisilicon erratum 161010101, which says that reading the
  counters is unreliable in some cases, and reads may return a value 32
  beyond the correct value. This also affects writes to the tval
  registers, due to the implicit counter read.

** Optional properties:

- arm,cpu-registers-not-fw-configured : Firmware does not initialize
+5 −0
Original line number Diff line number Diff line
@@ -172,6 +172,9 @@ Generic board variants:
- HDK device:
  compatible = "qcom,hdk"

- IPC device:
  compatible = "qcom,ipc"

Boards (SoC type + board variant):

compatible = "qcom,apq8016"
@@ -201,6 +204,7 @@ compatible = "qcom,apq8017-cdp"
compatible = "qcom,apq8017-mtp"
compatible = "qcom,apq8053-cdp"
compatible = "qcom,apq8053-mtp"
compatible = "qcom,apq8053-ipc"
compatible = "qcom,mdm9630-cdp"
compatible = "qcom,mdm9630-mtp"
compatible = "qcom,mdm9630-sim"
@@ -311,6 +315,7 @@ compatible = "qcom,msm8953-rumi"
compatible = "qcom,msm8953-sim"
compatible = "qcom,msm8953-cdp"
compatible = "qcom,msm8953-mtp"
compatible = "qcom,msm8953-ipc"
compatible = "qcom,msm8953-qrd"
compatible = "qcom,msm8953-qrd-sku3"
compatible = "qcom,sdm450-mtp"
+26 −4
Original line number Diff line number Diff line
@@ -21,10 +21,27 @@ Properties:
	Usage:      required
	Value type: <stringlist>
	Definition: Address names. Must be "osm_l3_base", "osm_pwrcl_base",
		    "osm_perfcl_base".
		    "osm_perfcl_base", and "cpr_rc".
		    Must be specified in the same order as the corresponding
		    addresses are specified in the reg property.

- vdd_l3_mx_ao-supply
	Usage:      required
	Value type: <phandle>
	Definition: Phandle to the MX active-only regulator device.

- vdd_pwrcl_mx_ao-supply
	Usage:      required
	Value type: <phandle>
	Definition: Phandle to the MX active-only regulator device.

- qcom,mx-turbo-freq
	Usage:      required
	Value type: <array>
	Definition: List of frequencies for the 3 clock domains (following the
		    order of L3, power, and performance clusters) that denote
		    the lowest rate that requires a TURBO vote on the MX rail.

- l3-devs
	Usage: optional
	Value type: <phandle>
@@ -46,10 +63,15 @@ Example:
		compatible = "qcom,clk-cpu-osm";
		reg = <0x17d41000 0x1400>,
			<0x17d43000 0x1400>,
			<0x17d45800 0x1400>;
		reg-names = "osm_l3_base", "osm_pwrcl_base", "osm_perfcl_base";
			<0x17d45800 0x1400>,
			<0x784248 0x4>;
		reg-names = "osm_l3_base", "osm_pwrcl_base", "osm_perfcl_base",
							"cpr_rc";
		vdd_l3_mx_ao-supply = <&pm8998_s6_level_ao>;
		vdd_pwrcl_mx_ao-supply = <&pm8998_s6_level_ao>;

		l3-devs = <&phandle0 &phandle1 &phandle2>;
		qcom,mx-turbo-freq = <1478400000 1689600000 3300000001>;
		l3-devs = <&l3_cpu0 &l3_cpu4 &l3_cdsp>;

		clock-names = "xo_ao";
		clocks = <&clock_rpmh RPMH_CXO_CLK_A>;
+15 −0
Original line number Diff line number Diff line
Qualcomm Technologies, Inc. QDSS bridge Driver

This device will enable routing debug data from modem
subsystem to APSS host.

Required properties:
-compatible : "qcom,qdss-mhi".
-qcom,mhi : phandle of MHI Device to connect to.

Example:
	qcom,qdss-mhi {
		compatible = "qcom,qdss-mhi";
		qcom,mhi = <&mhi_0>;
	};
Loading