Skip to content

Commit

Permalink
This commit shows a diff from lge, from jb4.1.2 to kitkat
Browse files Browse the repository at this point in the history
  • Loading branch information
Dm47021 committed Nov 3, 2014
1 parent 713b20c commit f18b7e0
Show file tree
Hide file tree
Showing 3,230 changed files with 699,185 additions and 69,326 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
Empty file modified AndroidKernel.mk 100644 → 100755
Empty file.
7 changes: 7 additions & 0 deletions Documentation/.gitignore
@@ -0,0 +1,7 @@
filesystems/dnotify_test
laptops/dslm
timers/hpet_example
vm/hugepage-mmap
vm/hugepage-shm
vm/map_hugetlb

27 changes: 27 additions & 0 deletions Documentation/DMA-attributes.txt
Expand Up @@ -49,3 +49,30 @@ DMA_ATTR_NON_CONSISTENT lets the platform to choose to return either
consistent or non-consistent memory as it sees fit. By using this API,
you are guaranteeing to the platform that you have all the correct and
necessary sync points for this memory in the driver.

DMA_ATTR_NO_KERNEL_MAPPING
--------------------------

DMA_ATTR_NO_KERNEL_MAPPING lets the platform to avoid creating a kernel
virtual mapping for the allocated buffer. On some architectures creating
such mapping is non-trivial task and consumes very limited resources
(like kernel virtual address space or dma consistent address space).
Buffers allocated with this attribute can be only passed to user space
by calling dma_mmap_attrs(). By using this API, you are guaranteeing
that you won't dereference the pointer returned by dma_alloc_attr(). You
can threat it as a cookie that must be passed to dma_mmap_attrs() and
dma_free_attrs(). Make sure that both of these also get this attribute
set on each call.

Since it is optional for platforms to implement
DMA_ATTR_NO_KERNEL_MAPPING, those that do not will simply ignore the
attribute and exhibit default behavior.

DMA_ATTR_STRONGLY_ORDERED
-------------------------

DMA_ATTR_STRONGLY_ORDERED allocates memory with a very restrictive type
of mapping (no unaligned accesses, no re-ordering, no write merging, no
buffering, no pre-fetching). This has severe performance penalties and
should not be used for general purpose DMA allocations. It should only
be used if one of the restrictions on strongly ordered memory is required.
14 changes: 14 additions & 0 deletions Documentation/DocBook/.gitignore
@@ -0,0 +1,14 @@
*.xml
*.ps
*.pdf
*.html
*.9.gz
*.9
*.aux
*.dvi
*.log
*.out
*.png
*.gif
media-indices.tmpl
media-entities.tmpl
1 change: 1 addition & 0 deletions Documentation/DocBook/media/dvb/.gitignore
@@ -0,0 +1 @@
!*.xml
1 change: 1 addition & 0 deletions Documentation/DocBook/media/v4l/.gitignore
@@ -0,0 +1 @@
!*.xml
1 change: 1 addition & 0 deletions Documentation/accounting/.gitignore
@@ -0,0 +1 @@
getdelays
198 changes: 198 additions & 0 deletions Documentation/arm/msm/adsprpc-drv.txt
@@ -0,0 +1,198 @@
Introduction
============

The MSM ADSPRPC driver implements an IPC (Inter-Processor Communication)
mechanism that allows for clients to transparently make remote method
invocations across processor boundaries.

The below diagram depicts invocation of a single method where the client
and objects reside on different processors. An object could expose
multiple methods which can be grouped together and referred to as an
interface.

: ,--------, ,------, ,-----------, ,------, ,--------,
: | | method | | | | | | method | |
: | Client |------->| Stub |->| Transport |->| Skel |------->| Object |
: | | | | | | | | | |
: `--------` `------` `-----------` `------` `--------`

Client: Linux user mode process that initiates the remote invocation
Stub: Auto generated code linked in with the user mode process that
takes care of marshaling parameters
Transport: Involved in carrying an invocation from a client to an
object. This involves two portions: 1) MSM ADSPRPC Linux
kernel driver that receives the remote invocation, queues
them up and then waits for the response after signaling the
remote side. 2) Service running on the remote side that
dequeues the messages from the queue and dispatches them for
processing.
Skel: Auto generated code that takes care of un-marshaling
parameters
Object: Method implementation

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

The driver interfaces with the components in the DSP subsystem and does
not drive or manage any hardware resources.

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

The MSM ADSPRPC driver uses SMD (Shared Memory Driver) to send and
receive messages with the remote processor. The SMD channel used for
communication is opened during initialization of the driver and is
closed when the driver module is unloaded. The driver does not expose
HLOS memory to the remote processor but rather communication of
invocation parameters happen over ION allocated buffers.

The driver receives remote call invocations via an ioctl call. When a
remote call invocation is received, the driver does the following:
- Retrieves the invocation parameters
- Copies input buffers in HLOS memory to ION allocated buffers
- Allocates ION buffers for output buffers in HLOS memory as required
- Scatter-gathers list of pages for ION allocated input and output
buffers
- Coalesces information about the contiguous page buffers
- Builds up a message with the received information
- Sends the message to a remote processor through an SMD channel
- Waits for a response from the remote processor through the SMD channel
- Reads the message available from the shared memory SMD channel
- Copies back from ION buffers to HLOS memory for output buffers
- Returns the response of the remote invocation

Design
======

The design goals of this transport mechanism are:
- Fast and efficient ways to transfer huge buffers across
inter-processor boundaries
- Zero copy of ION allocated buffers passed during invocations

To achieve the zero copy approach of ION allocated user space buffers,
the driver scatter-gathers the list of pages of the buffers being passed
in. This information is then sent over to the remote processor for it
to map into its address space.

The invocation requests sent over the SMD channel carry context
information as to whom the request is originating from. The responses
received over the SMD channel have context information in the message
which is then used to wake the thread waiting for a response.

If the remote processor goes down and gets restarted, the SMD channel
is re-initialized when the remote processor comes back up. An
error code would be returned to the client for all invocations that
happen before the SMD channel could get completely re-initialized.

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

None

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

The driver uses semaphores to wake up clients waiting for a remote
invocation response.

Security
========

Use of the zero copy approach results in a page-size granularity of
all buffers being passed to the remote processor. The objects that will
be manipulating these buffers on the remote processor will be signed
and trusted entities, thereby alleviating any fear of intentional
scribbling of these buffers.

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

In order to minimize latencies across remote invocations:
- messages exchanged between the remote processors are kept short
- zero copy approach for ION allocated user space buffers

Interface
=========

The driver exposes a user space interface through /dev/adsprpc-smd and
the user space clients send commands to the driver by using the
following ioctl command:

- FASTRPC_IOCTL_INVOKE: Parameters passed in includes the buffers and
data related to remote invocation.

/*
* Information about the input/output buffer or an handle to the
* object being passed in the remote invocation
*
* @pv: Pointer to input/output buffer
* @len: Length of the input/output buffer
* @handle: Handle to the remote object
*/
typedef union {
struct remote_buf {
void *pv;
int len;
} buf;
unsigned int handle;
} remote_arg;

/*
* Invocation parameters passed via ioctl call by the client
*
* @handle: Handle to the object on which the method is to be
* invoked
* @sc: Scalars detailing the parameters being passed in
* bits 0-3: Number of output handles
* bits 4-7: Number of input handles
* bits 8-15: Number of output buffers
* bits 16-23: Number of input buffers
* bits 24-28: Method to be invoked
* bits 29-31: Method attributes
* @pra: Remote arguments to be passed for method invocation
*/
struct fastrpc_ioctl_invoke {
unsigned int handle;
unsigned int sc;
remote_arg *pra;
};

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

None

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

None

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

The ADSPRPC driver requires that the ADSP RPC SMD channel be created and
the SMD subsystem be initialized. During initialization, the driver
opens an existing SMD edge channel between ADSP and Apps processor. On
success, the driver waits for the "channel opened" event from SMD,
acknowledging the channel availability from the remote SMD driver for
communication to begin.

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

None

Other
=====

None

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

None

To do
=====

None

0 comments on commit f18b7e0

Please sign in to comment.