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

Commit 1cebe53f authored by Namratha Siddappa's avatar Namratha Siddappa
Browse files

Merge remote-tracking branch 'quic/msm-4.14' into dev/msm-4.14-display



* quic/msm-4.14:
  defconfig: Enable MSM_RPM_SMD support
  defconfig: set the default remote_etm to 0 for qcs405
  drivers: cpuidle: lpm-levels: Update failure print
  msm: vidc: Add support to config nal size for encoder
  ARM: dts: msm: update LPG/LED configuration in PM855L
  usb: dwc3-msm: Reduce usage of usb power_supply
  soc: qcom: Add RPM SMD Driver
  udp: Complement partial checksum for GSO packet
  udp: add gso support to virtual devices
  udp: add gso segment cmsg
  udp: paged allocation with gso
  udp: better wmem accounting on gso
  udp: generate gso with UDP_SEGMENT
  udp: add udp gso
  udp: expose inet cork to udp
  msm: camera: Initial parameters of eeprom
  ARM: dts: msm: Correct the timer frequency on sm6150 RUMI
  sched/walt: Add missing pl notification support
  sched/walt: Fix stale window start marker passed to the schedutil
  msm: ipa3: fix debugfs creation order
  ARM: dts: msm: Add QMP debugfs client on sm6150
  usb: gadget: f_ncm: allocate/free net device upon driver bind/unbind
  mhi: core: add a separate callback handler for downlink DTR channel
  mhi: core: fix null pointer dereference during channel reset
  mhi: core: add support to start channels automatically
  ARM: dts: msm: Update Supported UFS Clock Frequencies for SM8150
  scsi: ufs: Set VS_CORE_CLK with values queried from DT/Clk Driver
  msm: ipa4: enable adpl for msmnile
  power: qpnp-fg-gen4: Fix using uninitialized mutex lock
  msm: msm_bus: Add proxy bus client driver
  clk: qcom: videocc-sm8150: Update the RCG configuration for iris_clk_src
  ARM: dts: msm: Fix ap2mdm_pon_reset configuration for SM8150+SDX50
  ARM: dts: msm: Disable the spmi bus node for sm6150 rumi
  msm: ipa: add support for HW stats to QMI
  msm: vidc: add control to support NAL size config
  power: smb5: Fix fast charge current step size
  rpmsg: glink: Set tail pointer to 0 at end of FIFO
  soc: qcom: glink_pkt: Add one to refcounting
  usb: pd: release SS lane only if USB host is started
  clk: qcom: gpucc-sm8150: Remove control of the GPU ACD clocks
  arm: mm: Fix build error due to variable input to BUILD_BUG_ON
  sched/core: Fix an ordering issue in wake_up_new_task
  ARM: dts: msm: Update the link information for sm8150+sdx50
  clk: qcom: gcc-sdmshrike: update usb mock utmi supported frequencies

Change-Id: Ic278c68f513d1b8dc6241ade5e4dfcdaa22fe9b3
Signed-off-by: default avatarNamratha Siddappa <namratha@codeaurora.org>
parents 150e5aba e2039f3b
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.
+34 −0
Original line number Diff line number Diff line
Bus Proxy Client Bindings

Bus proxy client provides means to cast proxy bandwidth votes during bootup
which is removed at the end of boot. This feature can be used in situations
where a shared resource can be scaled between several possible perfomance
levels and hardware requires that it be at a high level at the beginning of
boot before the client has probed and voted for required bandwidth.

Required properties:
- compatible:			Must be "qcom,bus-proxy-client".

Optional properties:
- qcom,msm-bus,name:		String representing the client-name.
- qcom,msm-bus,num-cases:	Total number of usecases.
- qcom,msm-bus,active-only:	Boolean context flag for requests in active or
				dual (active & sleep) contex.
- qcom,msm-bus,num-paths:	Total number of master-slave pairs.
- qcom,msm-bus,vectors-KBps:	Arrays of unsigned integers representing:
				master-id, slave-id, arbitrated bandwidth
				in KBps, instantaneous bandwidth in KBps.

Example:

	qcom,proxy-client {
		compatible = "qcom,bus-proxy-client";
		qcom,msm-bus,name = "proxy_client";
		qcom,msm-bus,num-cases = <3>;
		qcom,msm-bus,num-paths = <2>;
		qcom,msm-bus,active-only;
		qcom,msm-bus,vectors-KBps =
			<22 512 0 0>, <23 512 0 0>,
			<22 512 0 6400000>, <23 512 0 6400000>,
			<22 512 0 6400000>, <23 512 0 6400000>;
	};
+41 −0
Original line number Diff line number Diff line
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 hardware
accelerators. The RPM driver communicates with the hardware engine using
SMD.

The devicetree representation of the SPM block should be:

Required properties

- compatible: "qcom,rpm-smd" or "qcom,rpm-glink"
- rpm-channel-name: The string corresponding to the channel name of the
			peripheral subsystem. Required for both smd and
			glink transports.
- rpm-channel-type: The interal SMD edge for this subsystem found in
			<soc/qcom/smd.h>
- qcom,glink-edge: Logical name of the remote subsystem. This is a required
			property when rpm-smd driver using glink as trasport.

Optional properties
- rpm-standalone: Allow RPM driver to run in standalone mode irrespective of RPM
			channel presence.
- reg: Contains the memory address at which rpm messaging format version is
  stored. If this field is not present, the target only supports v0 format.

Example:

	qcom,rpm-smd@68150 {
		compatible = "qcom,rpm-smd", "qcom,rpm-glink";
		reg = <0x68150 0x3200>;
		qcom,rpm-channel-name = "rpm_requests";
		qcom,rpm-channel-type = 15; /* SMD_APPS_RPM */
		qcom,glink-edge = "rpm";
	}
}
+2 −0
Original line number Diff line number Diff line
@@ -57,6 +57,8 @@ Main node properties:
		BIT(3) : MHI bus driver pre-allocate buffer for this channel.
		If set, clients not allowed to queue buffers. Valid only for DL
		direction.
		BIT(4) : MHI host driver to automatically start channels once
		mhi device driver probe is complete.

- mhi,chan-names
  Usage: required
+7 −0
Original line number Diff line number Diff line
@@ -113,6 +113,13 @@ whatever headers there might be.
NETIF_F_TSO_ECN means that hardware can properly split packets with CWR bit
set, be it TCPv4 (when NETIF_F_TSO is enabled) or TCPv6 (NETIF_F_TSO6).

 * Transmit UDP segmentation offload

NETIF_F_GSO_UDP_GSO_L4 accepts a single UDP header with a payload that exceeds
gso_size. On segmentation, it segments the payload on gso_size boundaries and
replicates the network and UDP headers (fixing up the last one if less than
gso_size).

 * Transmit DMA from high memory

On platforms where this is relevant, NETIF_F_HIGHDMA signals that
Loading