Add IOMMU support to MDP and rotator driver for operating with
virtual addresses instead of physical addresses
Change-Id: Ia5afcf33220e0e75e92948649c2bd4d7ef32917d
Signed-off-by: Ravishangar Kalyanam <rkalya@codeaurora.org>
DIAG maintains mask info in a buffer. This buffer is parsed
using a structure. Recently this structure was modified to add
another member. Now, the parsing code has to change to account
for this new member, otherwise, the parsing is incorrect and
misses certain log codes.
Also updated log codes with the latest on modem.
Change-Id: Iaaf86e4f3342fd73898eb11124b4893ec79aa564
Signed-off-by: Shalabh Jain <shalabhj@codeaurora.org>
Remove memory leak on early return due to a memory allocation
failure.
Change-Id: I53822afbc145fbd018c6d84120e3aee8ecd082aa
Signed-off-by: Dixon Peterson <dixonp@codeaurora.org>
Also, add more generic cpu type identification logic
to remove having to modify code each time a new target
variant comes out.
Change-Id: I9493ffad0960ab4863205191937ea5c56be97de2
Signed-off-by: Dixon Peterson <dixonp@codeaurora.org>
From 8960 onwards, application processor handles master diag. Other
slave processors can come up on different time. This change will
update each slave processor with latest mask info when it comes up.
Also each time, any PC tool tries to change masks, application processor
will propagate this new mask info to the peripherals. Now, this mask
updation tasks need to be delayed. Hence, such tasks cannot be put on
regular work queue. Thus, this change also adds a new work queue for such
tasks.
This feature also requires latest build time masks on apps processor. Thus,
updated the build time masks as well.
Change-Id: I5120c3d507230d3209773cc9f929a8f2f0bf0a3d
Signed-off-by: Shalabh Jain <shalabhj@codeaurora.org>
Frame buffer's (fb0) f_count needed to be decreased after both
overlay play and rotation so that fb0 can be closed and display
will be blanked out after system suspended.
CRs-fixed: 336254
Change-Id: I966e7b2bb4def0c9c09580be12048933723e2c2e
Signed-off-by: Kuogee Hsieh <khsieh@codeaurora.org>
Diag allocates memory objects from mempool for copying packet from user
space to kernel space. Fix increases oject size of mempool to 4KB and any
packet of size greater than 4KB is dropped.
CRs-Fixed: 326579
Change-Id: I1cacd294df9a535fbe5f0466603eb7e69f7b43ef
Signed-off-by: Ashay Jaiswal <ashayj@codeaurora.org>
Allow automatic power management by the USB core by enabling
autosuspend in the DIAG Bridge driver. This allows the MDM device
to be suspended and draw minimal power when idle.
In the diagfwd_hsic driver, register suspend and resume callbacks
to know when to temporarily halt queuing read or write requests to
the bridge which would otherwise prevent the HSIC device from
triggering an autosuspend.
Similarly, close the bridge when the USB cable is disconnected to
signify that it is done using it, or else there would forever be a
pending read or write on the bridge that would keep the HSIC active.
Revert allocation flags in diag_bridge_read() and diag_bridge_write()
to GFP_KERNEL, as they now can only be called in process context.
Change-Id: I124460bbc90ff10a1a7f8e6ab94dab0fbfc5d0df
Signed-off-by: Jack Pham <jackp@codeaurora.org>
DIAG driver maintains a table for all registrations by remote
peripherals and user space applications. In certain cases, the
number of registrations can exceed table capacity. Thus, diag
re-allocates the table memory, to fit in all registrations.
This re-allocation stops at a threshold, even if requirement
is greater than threshold.
In such a corner case, if the requirement is greater than threshold,
then the mutex might remain locked after filling the table upto full
capacity. Adding unlocking condition to release mutex in such cases.
Change-Id: Iefd02795b531e17ff7cfe3be152e32b3e82c68fb
Signed-off-by: Shalabh Jain <shalabhj@codeaurora.org>
This reverts commit 46af59fb8f.
The RNG driver was initially disabled because of missing clock
changes and this driver was causing boot up issues.
Now with the clock changes checked in the RNG driver works.
Change-Id: I127f25c8be6b715510c1fb16b274a814416d8a8a
Signed-off-by: Ramesh Masavarapu <rameshm@codeaurora.org>
During initialization, there is a violation in writing to
"read only" registers for targets that support trust zone.
Trustzone marks certain registers as read-only.
This change fixes the issue by writing to registers only
on targets that do not support trust zone.
Change-Id: I69bb0f1bad199201aa3dd8b378ca1683dfa81c86
Signed-off-by: Ramesh Masavarapu <rameshm@codeaurora.org>
DIAG driver talks to peripheral processors over SMD channels.
Sometimes, SMD channel can have a partial packet and if diag
reads it, it can mistake them as garbled packets. With this
change, if the packet is incomplete, diag will not read it
and wait until the packet is complete.
This approach will work, as long as, peripheral is sending packets
less than 1000 bytes. Currently even the peripheral is limited to
sending packets upto 1K bytes, so this limitation is fine.
Also fix potential memory allocation failure and unnecessary
reading from SMD channels.
Change-Id: I86e6aa202d1e1159e7b3f099cb1228530489a370
Signed-off-by: Shalabh Jain <shalabhj@codeaurora.org>
DIAG driver communicates to peripherals over SMD channels. It parses
data read and then takes appropriate actions. Sometimes, SMD can pass
corrupted data and cause DIAG driver to crash. Adding checks around
data will prevent such crashes.
Change-Id: Ic82b1e31557eb432e57f3f6b152b22c1d3f5cd37
Signed-off-by: Shalabh Jain <shalabhj@codeaurora.org>
PC tools send various polling commands to target to detect its
presence. Initially modem used to respond to all pollings. However,
with new targets, we have applications processor as master as well
as subsystem restart. Due to these new features, modem does not respond
all the time. This change implements a new mechanism to respond to
polling.
The DIAG driver maintains a flag variable to keep track of any polling
command registered by a remote peripheral. As long as any polling command
is present, diag driver ignores a special polling request. If no peripheral
has registered for any polling at all, then diag responds to this special
polling request.
Change-Id: I6ba1744dd3dd4982027b671efce3beffb9a27786
Signed-off-by: Shalabh Jain <shalabhj@codeaurora.org>
Fix parsing of data sent on the smd control channel to
accomodate types of data other than DIAG_CNTRL_MSG_REG.
Currently, if the type of data in the buffer is other than
DIAG_CNTRL_MSG_REG, progression through the buffer is
not performed correctly.
CRs-fixed: 334307
Change-Id: I406a437168956277190d2bcf2e94345d2eec0783
Signed-off-by: Dixon Peterson <dixonp@codeaurora.org>
DIAG driver needs to know which CPU it is working on.
Adding that support for new targets.
Change-Id: I68e353e203cc106b68a1eb18b55462fd7f91cf0d
Signed-off-by: Shalabh Jain <shalabhj@codeaurora.org>
Respond to the apps only polling command with an error
response when the modem is up.
Change-Id: Ifd9ae10a57339bf405a117cacfd987dec1875cd7
Signed-off-by: Dixon Peterson <dixonp@codeaurora.org>
Also re-structures the code so that adding new target
support will be easier.
Change-Id: I5ad9100932da5454afbf1c996d71a6338dc59dbb
Signed-off-by: Shalabh Jain <shalabhj@codeaurora.org>
DIAG traffic can go over USB, UART and SD card. Input received from SD
card needs to be validated before sending to modem. Whereas, traffic
from UART does not need such check.
Change-Id: If5d29cc3a1eba6ce0336f09c774e11f6060d5ead
Signed-off-by: Shalabh Jain <shalabhj@codeaurora.org>
From 8960 onwards, application processor handles master diag. Other
slave processors can come up on different time. This change will
update each slave processor with latest mask info when it comes up.
Change-Id: Icc5f607043c8dc00dbfd504952beccaff5641f41
Signed-off-by: Shalabh Jain <shalabhj@codeaurora.org>
Add bus scaling support to rotator driver
Change-Id: I53faf6070a9dc6d6359b6d58cb7cb618217ee8c0
Signed-off-by: Nagamalleswararao Ganji <nganji@codeaurora.org>
Add support for relaying the MDM 9k diag traffic over HSIC
to the USB DIAG MDM channel and vice versa. Also modify usb
diag_bridge to use signed parameters for buffer sizes. This
is especially needed for the final parameter of the read
and write callbacks, wherein a negative errno value may be
passed to convey an error.
Change-Id: Ifa516356a5d72597d82929a56d714f8dfb2964de
Signed-off-by: Dixon Peterson <dixonp@codeaurora.org>
Rotator expects planar input in YCbCr order, wrong color can be seen
on ouput image when given YCrCb because the chromninance planes picked
are not correct. Swap Cb and Cr plane addresses to output correct image.
Change-Id: Ia05ab704d18da4aac49e63fb805c40a95ea51a33
CRs-Fixed: 327956
Signed-off-by: Adrian Salido-Moreno <adrianm@codeaurora.org>
DIAG provides packet request/response service. A PC tool
can send a request and receive response from an app on
phone. In case, app is not running, the phone should return
an error response, which is almost same length as request.
A buffer overrun can happen, if the request is too huge. Thus,
adding a check to prevent buffer overrun.
Change-Id: I0955f9bcb703274bd1286047102c8303e6691c84
CRs-Fixed: 323841
Signed-off-by: Shalabh Jain <shalabhj@codeaurora.org>
DIAG char driver maintains registrations for remote processors in a table.
When the remote processor goes down, the registrations should be cleaned
up. This change adds the clean up process in event of a restart. Also when
the peripheral goes down for subsystem restart, the SMD channel between
apps processor and peripheral has to be set to NULL, to prevent further SMD
operations. When the peripheral comes back up, this SMD channel can be
re-initialized.
CRs-Fixed: 326120
Change-Id: I49afad5e3bc04f62024c1dc66f272726ae13c3e6
Signed-off-by: Shalabh Jain <shalabhj@codeaurora.org>
Rotator is capable of performing 1/2, 1/4 and 1/8 down scaling. Add
downscale_ratio parameter to provide support for this feature.
CRs-Fixed: 315874
Change-Id: I57dc3456ccc9bec2a125750b3e9909ffcbaf45f6
Signed-off-by: Adrian Salido-Moreno <adrianm@codeaurora.org>
Due to separate branches for Fusion targets, some fixes
for SDIO layer were missing on mainline. This will add the
missing fixes on the mainline.
Change-Id: I56cd617a744ca9d280bac50370dc9aba11958fdf
Signed-off-by: Shalabh Jain <shalabhj@codeaurora.org>
The rotator driver requests exact rates. There is no need to call
the clk_set_min_rate() API, which will soon be removed altogether.
Call clk_set_rate() instead.
Change-Id: Ica9cb30f85132e92a00b0000eea498c47645b697
Signed-off-by: Matt Wagantall <mattw@codeaurora.org>
When the modem goes down for subsystem restart, the SMD channel between
apps processor and modem has to be set to NULL, to prevent further SMD
operations. When the modem comes back up, this SMD channel can be
re-initialized.
Change-Id: I4854de8cbdfd157867c2c9513a297f18af51d626
Signed-off-by: Shalabh Jain <shalabhj@codeaurora.org>
* common/android-3.0: (570 commits)
misc: remove kernel debugger core
ARM: common: fiq_debugger: dump sysrq directly to console if enabled
ARM: common: fiq_debugger: add irq context debug functions
net: wireless: bcmdhd: Call init_ioctl() only if was started properly for WEXT
net: wireless: bcmdhd: Call init_ioctl() only if was started properly
net: wireless: bcmdhd: Fix possible memory leak in escan/iscan
cpufreq: interactive governor: default 20ms timer
cpufreq: interactive governor: go to intermediate hi speed before max
cpufreq: interactive governor: scale to max only if at min speed
cpufreq: interactive governor: apply intermediate load on current speed
ARM: idle: update idle ticks before call idle end notifier
input: gpio_input: don't print debounce message unless flag is set
net: wireless: bcm4329: Skip dhd_bus_stop() if bus is already down
net: wireless: bcmdhd: Skip dhd_bus_stop() if bus is already down
net: wireless: bcmdhd: Improve suspend/resume processing
net: wireless: bcmdhd: Check if FW is Ok for internal FW call
tcp: Don't nuke connections for the wrong protocol
ARM: common: fiq_debugger: make uart irq be no_suspend
net: wireless: Skip connect warning for CONFIG_CFG80211_ALLOW_RECONNECT
mm: avoid livelock on !__GFP_FS allocations
...
Conflicts:
arch/arm/mm/cache-l2x0.c
arch/arm/vfp/vfpmodule.c
drivers/mmc/core/host.c
kernel/power/wakelock.c
net/bluetooth/hci_event.c
Signed-off-by: Bryan Huntsman <bryanh@codeaurora.org>
Add support for ion memory heaps in the rotator
driver
Change-Id: Id844050871e4aaa7fa0e0fc9d69646d6d9875b85
Signed-off-by: Nagamalleswararao Ganji <nganji@codeaurora.org>
Signed-off-by: Naseer Ahmed <naseer@codeaurora.org>
The driver checks if the PRNG h/w is enabled. If it is not ON, it
enables the PRNG h/w.
Change-Id: I7c73eba7ba47f4fca116cfe0884758e6dd130ed0
Signed-off-by: Ramesh Masavarapu <rameshm@codeaurora.org>
Update drivers' usage of cpu_is_msm8960() to also include a
check for cpu_is_msm8930(), to support the pre-silicon
effort.
Change-Id: I2d7bbdd297d35764680b2007b941f7344ba85bc7
Signed-off-by: Stepan Moskovchenko <stepanm@codeaurora.org>