Commit graph

563509 commits

Author SHA1 Message Date
David Dai
c34d39a511 soc: qcom: msm_bus: relocate msm bus into soc/qcom
Change-Id: I80780a6f8d80143c697847abf82579c8e8194090
Signed-off-by: David Dai <daidavid1@codeaurora.org>
2016-03-22 11:03:03 -07:00
Hemant Kumar
32787a91ff usb: gadget: f_diag: Add support for configFS
This change adds APIs to allocate and instanciate
multi instance diag function driver using configFS.
Add an entry in kconfig to select diag driver for
configFS.

Change-Id: I428631dc63643eddb075a09d0e46e1a6b1117f0e
Signed-off-by: Hemant Kumar <hemantk@codeaurora.org>
2016-03-22 11:03:02 -07:00
Jack Pham
4d50aa3264 usb: gadget: Move diag dload handling to f_diag driver
Upon Diag function bind, the DLOAD memory region should be
updated with the USB PID and serial number in order to support
a persistent connection with the PC if the device reboots into
download mode.

This functionality need not be handled in the android.c driver.
The only reason it is there is to be able to locate the IO address
which is specified in device tree. Since this can be done from
the Diag function driver directly, move the handling there.

The address itself can be specified under the "qcom,msm-imem"
parent with its own "qcom,msm-imem-diag-dload" compatible string.
For now, allow falling back to retrieving the address from the
"android_usb" for backwards compatibility until the device tree
files are updated.

Change-Id: I0d6d1dac0f12b7890220d857227ae45c9258c1f2
Signed-off-by: Jack Pham <jackp@codeaurora.org>
2016-03-22 11:03:01 -07:00
Hemant Kumar
2e6b9bea06 usb: gadget: Add snapshot of DIAG function driver
Add function driver to support Qualcomm diagnostics port over USB.

This snapshot is taken as of msm-3.18 commit:
commit e70ad0cd5e (Promotion of kernel.lnx.3.18-151201)

Change-Id: I51aaa8f6a2e05fc252ea810244ddfc99ca2741cc
Signed-off-by: Hemant Kumar <hemantk@codeaurora.org>
2016-03-22 11:03:01 -07:00
Hemant Kumar
c03ffc4254 Revert "kref: Remove kref_put_spinlock_irqsave()"
This reverts commit 3a66d7dca1.

Diag function driver calls kref_put_spinlock_irqsave in
diag_write_complete API. Hence revert the change.
2016-03-22 11:03:00 -07:00
Jack Pham
47bb2a3600 usb: gadget: Add remote_wakeup to struct usb_gadget
This variable keeps track of when remote_wakeup feature
has been enabled by the host. It is needed for certain
function drivers to perform alternate methods during
suspend/resume.

Signed-off-by: Jack Pham <jackp@codeaurora.org>
2016-03-22 11:02:59 -07:00
Azhar Shaikh
a99d4a5017 usb: gadget: Disable L1 LPM capability
Disable USB L1 LPM functionality on MSM platforms by setting the
USB version as 0x200 for all High Speed Devices.
Add a module param, which when enabled will set the USB version as
0x210. Module param can be enabled as

echo Y > /sys/module/libcomposite/parameters/enable_l1_for_hs

Change-Id: I781a237b44e542c6089af36b7ce0a0665d3cd440
Signed-off-by: Azhar Shaikh <azhars@codeaurora.org>
2016-03-22 11:02:58 -07:00
Shimrit Malichi
37648e8eb6 usb: gadget: Add link power management support
Link Power Management (a.k.a. L1) is similar to the existing usb bus
suspend/resume/remote-wakeup, but has transitional latencies of tens
of microseconds between power states (instead of three to greater than
20 millisecond latencies of the USB 2.0 suspend/resume).

Change-Id: I8ae493534702e658c24f384a6b705b08e9ea9d05
Signed-off-by: Shimrit Malichi <smalichi@codeaurora.org>
Signed-off-by: Tarun Gupta <tarung@codeaurora.org>
2016-03-22 11:02:57 -07:00
Mayank Rana
f67850e9f0 usb: gadget: Draw 900mA current when enumerating in super speed mode
Currently 500mA is used as max allowable current to draw with USB SDP
case in both super speed and high speed mode. In super speed mode it
is allowed to draw 900mA current. Hence update allowable current to
draw based on USB connection speed. This change doesn't consider any
configuration based allowable max current.

Change-Id: Iae9ecf586135b0a2064e7d5e6e8fa3d8e7e4fb70
Signed-off-by: Mayank Rana <mrana@codeaurora.org>
2016-03-22 11:02:56 -07:00
Mayank Rana
2c9b669728 usb: gadget: composite: Protect cdev in composite_suspend()
With USB cable disconnect case, there is race happening when
composite_suspend() is being pre-empted just after getting
reference to cdev structure (suspend flow) and cdev->config
set to NULL as part of reset_config() (disconnect flow). This
results into composite_suspend() using bad value with cdev->config
which is resulting in some cases multiple time calling f->suspend().
Fix this issue by protecting cdev in composite_suspend() API.

CRs-Fixed: 916718
Change-Id: Id0b2a254f64621fcbc19c0556265e9b7b32f1382
Signed-off-by: Mayank Rana <mrana@codeaurora.org>
2016-03-22 11:02:55 -07:00
Hemant Kumar
28ddcdd099 usb: gadget: Fix bug is queuing req upon Function Suspend
In case of Super speed function suspend without bus suspend,
if function driver queues a request, usb_gadget_func_wakeup()
directly issues Function Wakeup command to controller and returns
success. As a result request is queued to endpoint before receiving
function resume from host. This causes ep queue to fail when it is
done upon function resume as request is already queued. If function
driver tries to queue any request further this results into request
packet drop as ep queue returns error -EBUSY. Hence do not queue
request in function wake up context, instead wait for function
resume to queue the request.

CRs-Fixed: 848622
Change-Id: I00aea59fb2cbe59190dadb4c838534cc9e4ffcf3
Signed-off-by: Hemant Kumar <hemantk@codeaurora.org>
2016-03-22 11:02:54 -07:00
Mayank Rana
f8f56d6a1d gadget: composite: Fix crash seen when SS descriptor is not available
In some cases, composite device may have multiple interfaces and one of
interface may not support USB super speed functionality. When host is
trying to enumerate this composite device into super speed mode by
sending SET_CONFIG(1), it results into crash due to ss descriptors are
not available for particular interface. Hence add check against ss
descriptors and fail SET_CONFIG(1). This results into some of host try
to re-enumerate USB composite device with only interface which support
super speed mode.

Change-Id: Ib909f3d451e247c0415863689711e66b15fa2fa5
Signed-off-by: Mayank Rana <mrana@codeaurora.org>
2016-03-22 11:02:53 -07:00
Vijayavardhan Vennapusa
bdf0a2e431 USB: f_mass_storage: Send GADGET_DELAYED_STATUS for MSC RESET command
When Host sends MSC RESET command to the device, device is expected
to clear HALT condition on the bulk IN endpoint as part of handling it,
before sending status phase to the Host. Since handling of MSC RESET is
done by sending signal to fsg_thread, it could take time for handling it.
It could lead to sending bulk IN endpoint as halted, when host asks for
endpoint status as status phase is sent for MSC RESET command immediately
after it is received. Due to this, MSC compliance tests fail. Hence send
delayed status in case of MSC RESET and send status phase after it is
handled and cleared halt condition.

CRs-Fixed: 547929
Change-Id: If80d0ffb2d012724b899772b1b45dff8092bd8d5
Signed-off-by: Vijayavardhan Vennapusa <vvreddy@codeaurora.org>
Signed-off-by: Mayank Rana <mrana@codeaurora.org>
2016-03-22 11:02:52 -07:00
Mayank Rana
92e284a5d5 Revert "usb: gadget: composite: enable BESL support"
Commit a6615937bc ("usb: gadget: composite: enable BESL support")
enables LPM L1 support and advertises this capability to host. It
has been observed that when host is supporting LPM L1 functionality
and triggering it, device controller goes into L1 state but software
is not able to get controller out of L1 state using Link Recovery
functionality which results into USB enumeration issue with host.
Hence to fix this issue disable LPM L1 support from device side.

CRs-Fixed: 856808
Change-Id: I119423363a19be469782d016ae13155697d39afe
Signed-off-by: Hemant Kumar <hemantk@codeaurora.org>
Signed-off-by: Mayank Rana <mrana@codeaurora.org>
2016-03-22 11:02:51 -07:00
Hemant Kumar
e9c2362e33 usb: gadget: Invalidate interface id upon adding function to config
Commit e9df68ade ("usb: gadget: f_mbim: Queue notification request
upon function resume") added variable to store interface id in
usb_interface_id(). This interface id is used to send function wake
device notification. Functions having control interface and data
interface calls usb_interface_id() twice causing invalid interface
index stored in the variable. This is causing remote wakeup failure.
Fix this issue by initializing variable to -EINVAL and set it to
interface index only when it is invalidated.

CRs-Fixed: 810737
Change-Id: I41bce0a71ce0b8e92f3736d4e292132ce16de021
Signed-off-by: Hemant Kumar <hemantk@codeaurora.org>
Signed-off-by: Azhar Shaikh <azhars@codeaurora.org>
2016-03-22 11:02:50 -07:00
ChandanaKishori Chiluveru
d025d9d530 usb: gadget: Ignore the second set_config from the host
Some USB hosts may send SET_CONFIGURATION with same value twice.
The current code implementation of android_work() issues disconnect
event to userspace if SetConfiguration with non-zero value is sent
twice. The Userspace application may disconnect USB and it causes
fail to connect to the USB host.

Fix this by ignoring the second time SET_CONFIGURATION request
from the host only for the same configuration value twice.

CRs-Fixed: 661220
Change-Id: Iec8dd7824fa9f371ea147784cf9137aa88a7128e
Signed-off-by: ChandanaKishori Chiluveru <cchilu@codeaurora.org>
2016-03-22 11:02:49 -07:00
Vijayavardhan Vennapusa
15d49a1051 USB: composite: Hold spinlock before calling usb_func_wakeup_int() API
There is a chance that composite_resume might race with android_disable
if composition switch happens and at the same time, reset interrupt is
triggered. In this case, it could lead to accessing invalid address as
composite_resume() not calling usb_func_wakeup_int() without holding
spinlock. Hence modfiy usb_func_wakeup_int() such that caller of this
function should call it with spinlock holding to fix the issue.

CRs-Fixed: 799332
Change-Id: I97ef374923504977ac8fc32954dd7de834a01041
Signed-off-by: Vijayavardhan Vennapusa <vvreddy@codeaurora.org>
Signed-off-by: Azhar Shaikh <azhars@codeaurora.org>
2016-03-22 11:02:49 -07:00
Hemant Kumar
7010bdba62 usb: gadget: f_mbim: Queue notification request upon function resume
In super speed mode if userspace issues a write after usb bus suspend
usb_func_ep_queue() schedules wakeup to resume the function. After that
it queues the request which fails with -ENOTSUPP. As a result no
notification request queued to hw and write request gets delayed to be
sent until another write request comes and queues notification request
after function resume. This causes mismatch to the mbim request response.
Fix this by queuing the notification request upon function resume if
notify count is greater than zero. Also, drop control packet after bus
suspend if remote wakeup is not supported or if ep enqueue returns error
other than -EAGAIN.

CRs-Fixed: 789467
Change-Id: I446de1eb169b4ccb8f4db5f003b622d7b9c0b22b
Signed-off-by: Hemant Kumar <hemantk@codeaurora.org>
Signed-off-by: Azhar Shaikh <azhars@codeaurora.org>
2016-03-22 11:02:48 -07:00
Mayank Rana
7c99b9d4d4 dwc3: gadget: Replace polling mechnism to go into U0 state
Moving into U0 state is being confirmed by polling for 100ms after
performing remote wakeup from device. In some of cases where host is
taking more time to respond, remote wakeup is failing. Also USB
specification does not define any limit for the host response time.
Hence this change replaces polling mechnism by using LINK status
change event notification with core and increase host response time
from 100ms to 3 seconds. It also makes sure that composite_resume()
is being called after remote wakeup is completed succesfully.

It removes some of flag used to avoid race between bus suspend/resume
and fuction suspend/resume as those are serialize and not required
anymore.

CRs-Fixed: 712681
Change-Id: I71285daf117282c738e139e9a05ead6ef16dd202
Signed-off-by: Mayank Rana <mrana@codeaurora.org>
2016-03-22 11:02:47 -07:00
Pavankumar Kondeti
691d89ad03 usb: composite: don't print the invalid function wakeup failure messages
The function level suspend/resume/wakeup are supported in super speed
mode only. The usb_func_wakeup() is called for every function during
resume irrespective of the operating speed. This function returns
-ENOTSUPP when the gadget is not operating in super speed. Don't print
the error message in this case. Otherwise an error message is printed
for each function during high/full speed device resume.

CRs-Fixed: 750230
Change-Id: I6f600fe7fa9a037b83909265229acdc668329d6a
Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org>
2016-03-22 11:02:46 -07:00
Danny Segal
01b21ef8dc usb: gadget: Resolve recursive spinlock during remote wakeup
When a USB function wishes to send new data during USB suspend state, it
needs to issue USB remote wakeup and send a function wakeup notification
after then. This scenario leads to recursive spin locking inside the
_usb_func_wakeup() function, because this function gets called recursively.
This function issues remote wakeup, which internally calls the resume
interrupt callback, which calls the _usb_func_wakeup() function again.
This issue is resolved by performing the remote wakeup in a deferred work
context, and this splits the recursion loop.

CRs-fixed: 700667
Change-Id: I59c8efde098781587d29f08cd60e4aa3521949d8
Signed-off-by: Danny Segal <dsegal@codeaurora.org>
2016-03-22 11:02:45 -07:00
Danny Segal
190c05e664 usb: gadget: Fix race condition between function wakeup and bus resume
When a SS-USB function wishes to wake up the USB bus, it needs to send a
SS-USB function wakeup notification to the USB host after the bus is
resumed. For this purpose a function wake up pending flag is used to notify
the resume callback that a function wake up notification needs to be sent.
However, sometimes there is a race condition in which the resume interrupt
is fired before the function wakeup function is complete, and this leads to
an incorrect state of the function wakeup pending flag. This patch
resolves this issue by adding locks in the critical sections.

CRs-fixed: 695399
Change-Id: I8f15ac0c433301d6364a49cb31577e30259aa0b9
Signed-off-by: Danny Segal <dsegal@codeaurora.org>
2016-03-22 11:02:44 -07:00
Danny Segal
4571803aa1 usb: gadget: Fix Missing Function Wakeup notification sending on BAM wakeup
In Super-Speed mode, when the USB core wishes to issue remote wakeup due to
new data arriving on the BAM to BAM path, it needs to send Function Wakeup
notification to the USB host after the USB bus is resumed. However, the
sending of this notification fails when the USB core needs to wake up from
low-power mode, because the low-power mode exit is done asynchronously and
the sending of the Function Wakeup notification can not be done until the
USB bus is resumed.
This patch fixes this issue by checking whether the USB bus is suspended,
and if so, the sending Function Wakeup notification is delayed until the
USB bus is resumed.

Change-Id: I293476aaaf920b67fdbdf72a63524edc7a35750b
Signed-off-by: Danny Segal <dsegal@codeaurora.org>
2016-03-22 11:02:43 -07:00
Hemant Kumar
70ba8d2a94 usb: gadget: add infrastructure support for super-speed function suspend
The USB 3.0 specification defines a new 'Function Suspend' feature.
This feature enables the USB host to put inactive composite device
functions in a suspended state even when the device itself is not
suspended. This patch extends the existing framework of USB gadget
to properly support the 'Function Resume' and 'Function Remote Wakeup'
related features.

Change-Id: I51713eac557eabc7b465d161377c09d4b6afa152
Signed-off-by: Danny Segal <dsegal@codeaurora.org>
2016-03-22 11:02:42 -07:00
David Dai
a51f548a74 defconfig: msm8996: enable msm bus scaling
Change-Id: I082d195359e736ab4f9ac9322a094219144bcae5
Signed-off-by: David Dai <daidavid1@codeaurora.org>
2016-03-22 11:02:42 -07:00
David Dai
8461868fb6 platform: msm: msm_bus: Add support for bus scaling
This snapshot is taken as of msm-3.18 commit 1513280 (Merge "platform: msm: msm_bus:
Fix memory leak during client unregister)"
Change Kconfig option to say QCOM_BUS* instead of MSM_BUS*

Change-Id: I6dd9aba5b26984a914714ca49ae7253c1f267b4b
Signed-off-by: David Dai <daidavid1@codeaurora.org>
2016-03-22 11:02:41 -07:00
Pavankumar Kondeti
ab41284527 usb: gadget: composite: Fix a bug in delayed status handling
The SET_CONFIGURATION control request's status phase is delayed
till the new config change is handled by the file-storage thread.
If the cable is disconnected or the bus is reset before the
previous config is handled, then composite driver is not notified
about the delayed status.  As a result of which, the delayed_status
field of composite device structure remains non-zero.  The status
phase of next SET_CONFIGURATION control request is not sent.
This makes the gadget unusable.

Calling usb_composite_setup_continue() after the disconnect or reset
does not make any sense.  If the host sends another control request
before the status phase of the previous control request is sent, the
delayed_status must be reset to zero.  This is not straight forward
as the UDC handles some control requests without delegating them to
the composite driver.  A simple fix would be resetting the delayed
status value after the disconnect/reset.

CRs-Fixed: 501527
Change-Id: I67c832afc88c9e7d025247e539b7223fd83644d7
Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org>
2016-03-22 11:02:40 -07:00
Abhimanyu Kapur
0f238241f2 ARM64: Introduce arch_read_hardware_id
Moving towards device tree and arm single binary referring to
machine descriptor name for hardware id information under
/proc/cpuinfo is not suitable for certain soc vendors. Add a
hook for soc vendors to supply a per-soc hardware read method.

[abhimany: resolved minor merge conflicts]
Signed-off-by: Abhimanyu Kapur <abhimany@codeaurora.org>

Conflicts:
	arch/arm64/kernel/setup.c

Change-Id: I6c38a0c0dbf93acec6f6f67498c01c046a13e506
2016-03-22 11:02:39 -07:00
Runmin Wang
b6b338fcc5 soc: qcom: socinfo: Add MSMCOBALT chip ID
Add MSMCOBALT chip ID and relevant macros.

Change-Id: I0f97ed3eafdc54636849a58e5dfc34750d5dcea3
Signed-off-by: Trilok Soni <tsoni@codeaurora.org>
Signed-off-by: Stepan Moskovchenko <stepanm@codeaurora.org>

Conflicts:
	include/soc/qcom/socinfo.h
2016-03-22 11:02:38 -07:00
Se Wang (Patrick) Oh
dfb5ed21a3 soc: qcom: socinfo: Fix to print correct images information
'images' sysfs node is supposed to dump information about
all images without the need to write to select_image. But
As it doesn't look up the next image correctly after a image
which doesn't have information in SMEM, it prints only the
information of the fist a few images. After increase the
correct offset of SMEM address, 'images' can print all
information correctly.

Change-Id: I08dfb2812bde42dd661d5a85d473eaf60ef215c5
Signed-off-by: Se Wang (Patrick) Oh <sewango@codeaurora.org>
2016-03-22 11:02:37 -07:00
Matt Wagantall
176f9fe465 soc: qcom: socinfo: add 'images' sysfs device subnode
Although image information is already available in sysfs,
only root has the ability to write to the select_image node,
a necessary step for reading the CRM, variant and version
info for a specific image. Additionally, multiple clients
cannot safely read the image information without some
caller-side locking to prevent updates of the select_image
node while one of the other files are being read.

Work around this by introducing a new 'images' node that
can be used to dump information about all images without
the need to write to select_image, and make it readable
to non-root.

Change-Id: I71dfda8c7c170b35a66f2f740202a8a79e8b8c0c
Signed-off-by: Matt Wagantall <mattw@codeaurora.org>
2016-03-22 11:02:36 -07:00
Aparna Mallavarapu
cd31b001c7 soc: qcom: socinfo: Add new hardware platform type for RCM.
Add new hardware platform type for RCM boards.

Change-Id: Ie3708cf1444691ebb1fa7708764808d58bba794a
Signed-off-by: Aparna Mallavarapu <aparnam@codeaurora.org>
2016-03-22 11:02:36 -07:00
Matt Wagantall
15dc57c1de soc: qcom: socinfo: fix sysfs node creation for format v0.11
When support for socinfo v0.11 was added, the necessary switch/case
update for sysfs node creation was not added. As a result, many
socinfo sysfs nodes are missing. Add them back.

Change-Id: Ic79c9de22d04d4da7e86e273ab80f9efdafb58d5
Signed-off-by: Matt Wagantall <mattw@codeaurora.org>
2016-03-22 11:02:35 -07:00
Se Wang (Patrick) Oh
cb351939a9 soc: qcom: socinfo: Add socinfo for apq8096
Add SOC chip ID information for apq8096.

Change-Id: I76822bb3750f1e1d237ce87be7528dccb0306b51
Signed-off-by: Se Wang (Patrick) Oh <sewango@codeaurora.org>
2016-03-22 11:02:34 -07:00
Matt Wagantall
a1df69adc5 soc: qcom: socinfo: remove APIs without any clients
socinfo exports a number of APIs left over from the days before
device tree, for targets which are no longer supported in the
current kernel. Remove these unused APIs:
 get_core_count()
 read_msm_cpu_type()
 cpu_is_*()
 soc_class_is_*()

Change-Id: I2fb23c44649f0582fb0e2523a0235470f76a3da9
Signed-off-by: Matt Wagantall <mattw@codeaurora.org>
2016-03-22 11:02:33 -07:00
Matt Wagantall
c34671d29d soc: qcom: socinfo: remove misleading socinfo struct comments
These comments are documenting something that fairly obvious,
yet the comments themselves are incorrect. They should use '>='
not '=='. Just remove them to save a few lines.

Change-Id: I2964478a21a01c1d3b684d49678a9bf212ff01fa
Signed-off-by: Matt Wagantall <mattw@codeaurora.org>
2016-03-22 11:02:32 -07:00
Matt Wagantall
a74aaa7ff0 soc: qcom: socinfo: handle 'too new' format versions gracefully
Presently, if the bootchain updates the socinfo format version,
a corresponding change to the Linux soconfi driver must first be
made to avoid an "Unknown format found" error.

Avoid this by taking advantage of the fact that new format versions
with the same major version number are defined to be backward-
compatible with older formats having the same major number.

Change-Id: I985a46eeefaacd3425bbc17f72fe09b86264f8b1
Signed-off-by: Matt Wagantall <mattw@codeaurora.org>
2016-03-22 11:02:31 -07:00
Matt Wagantall
9e0f019808 soc: qcom: add support for the socinfo v0.11 format
The v0.11 format adds two new fields:
	uint32_t num_pmics;
	uint32_t pmic_array_offset;

where num_pmics is the number of PMICs in the system and
pmic_array_offset is the offset from the start of the socinfo
struct, in bytes, to the start of an array of size 'num_pmics'
with pmic struct members:
	struct pmic {
 		uint32_t pmic_model;
	        uint32_t pmic_die_revision;
	};

The legacy PMIC model and revision fields defined in previous
versions of socinfo will continue to be populated with the
first three PMICs, however the full list (including those
three) can be found at pmic_array_offset.

Change-Id: I554f70f8b3ac1cf82eb1fed1180dd9c5dcbe39e6
Signed-off-by: Matt Wagantall <mattw@codeaurora.org>
2016-03-22 11:02:30 -07:00
Matt Wagantall
7b6a57e658 soc: qcom: expose serial_number field via sysfs
socinfo format v0.10 introduced a serial number field, which is
presently only printed at boot, and not made visible via sysfs.
Make it readable from sysfs also.

Change-Id: I523c6cb8829c0dfee31b35913e085cf3996ef21a
Signed-off-by: Matt Wagantall <mattw@codeaurora.org>
2016-03-22 11:02:30 -07:00
Matt Wagantall
2dddd088d1 soc: qcom: socinfo: use pr_fmt for function prefixes in prints
Avoid the repeating "__func__" in every print to reduce code
clutter. No functional change is expected due to this.

Change-Id: I88a3d9ce22785cc9a99fa50a38ce3686cae45f2a
Signed-off-by: Matt Wagantall <mattw@codeaurora.org>
2016-03-22 11:02:29 -07:00
Matt Wagantall
9cab115446 soc: qcom: socinfo: separate major and minor format versions
The socinfo format version includes a 16-bit major field number
field that has always been zero, but may be changed in the future
to indicate a non-backwards-compatible format change. Update
current prints and checks to properly interpret both the major
and minor components.

Change-Id: I87a6d2e3f9379662857e03bb5b7e918f699c61ab
Signed-off-by: Matt Wagantall <mattw@codeaurora.org>
2016-03-22 11:02:28 -07:00
Matt Wagantall
137431c1fb soc: qcom: socinfo: simplify searching for smem regions
Instead calling smem_find() repeatedly with different sizes
for SMEM_HW_SW_BUILD_ID, call smem_get_entry() which returns
a pointer to the region regardless of its size.

Change-Id: If68ab31f808e2ecb740e1560ec5d9a7edd9a8c9f
Signed-off-by: Matt Wagantall <mattw@codeaurora.org>
2016-03-22 11:02:27 -07:00
Ian Maund
52dabc73a5 Update target name references for 8976
With the official announcement of 8976, remove all references to its
internal code name, and replace them with 8976.

Change-Id: Iadedabf16a7bef92c582524ae6ea38b31ba26ac4
Signed-off-by: Ian Maund <imaund@codeaurora.org>
2016-03-22 11:02:26 -07:00
Matt Wagantall
11c8f9dc1a msm: socinfo: Add 'family' sysfs node and redefine 'machine' node
Move the "Snapdragon" string from the machine node to the
previously-unused family node.  The machine node is updated
to instead contain the SoC name (ex. "MSM8996"). The soc_id
field remains untouched, and contains the numerical id
corresponding to the specific SoC variant

Change-Id: I659bdc0516cd85ed44d8b4a337411b540e3e404f
Signed-off-by: Matt Wagantall <mattw@codeaurora.org>
2016-03-22 11:02:25 -07:00
Abhimanyu Kapur
791e7caba5 soc: qcom: Add socinfo driver snapshot
This is a snapshot of the socinfo driver as of
msm-3.14 commit:

3bc54cf86bdc7affa7cd4bf7faa3c57fe8f8819d (Merge "msm:
camera: Add dummy sub module in sensor pipeline")

Change-Id: I6b5b866ede0e84432fad460e9d95babfdbc556fc
Signed-off-by: Abhimanyu Kapur <abhimany@codeaurora.org>
2016-03-22 11:02:24 -07:00
Runmin Wang
664a9b75a2 defconfig: arm64: msm: Enable poweroff reset driver and download mode
Enable POWER_RESET and DLOAD_MODE for defconfig and perf_defconfig

Change-Id: If127eaa2b8dae27bdba67b53d920ccffc5cdb577
2016-03-22 11:02:23 -07:00
David Ng
b38d1c71b0 power: reset: msm: Handle dm-verity and keys reset reasons
Write magic cookies/PON reset reason to indicate reasons
of dm-verity corruption, re-enable enforcing mode, and
(unrelated) keys clear.

Change-Id: I49904c79940515863d794b23fa7ac84e472b2466
Signed-off-by: David Ng <dave@codeaurora.org>
2016-03-22 11:02:23 -07:00
Matt Wagantall
69c5effef6 power: reset: use hard resets by default for all restart commands
Present, hard resets are used only when rebooting for "recovery",
"rtc", or "bootload" reboot commands or when the reboot command
is an empty string. Perform hard resets for invalid reboot commands
also, to avoid accidental warm resets if an invalid reboot command
is mistakenly used.

Continue to use warm resets for entry into download mode. This is
required for collection of ramdumps.

Change-Id: I71f657e9c8c20abcbbda86d789c843060c8ffce7
Signed-off-by: Matt Wagantall <mattw@codeaurora.org>
2016-03-22 11:02:22 -07:00
Lijuan Gao
64efabe747 power: reset: fix bug on warm reset or hard reset selection
Rebooting to recovery, bootloader and rtc should be treated as
hard reset if PMIC sparse regs are used to store reset reason.
Otherwise it should be set as warm reset to keep compatible with
legacy design. So correct logic of need_warm_reset here.

Change-Id: Ica173cc379df16a28f11bf5da87cb928e73ecdfb
Signed-off-by: Lijuan Gao <lijuang@codeaurora.org>
2016-03-22 11:02:21 -07:00
Stepan Moskovchenko
30787dfc1c power: reset: msm: Defer set_dload_mode to end of probe
The set_dload_mode() call in msm_restart_probe() may depend
on the TCSR base address, which is initialized later in the
probe function. Move this call to the end of
msm_restart_probe() to avoid potentially trying to use an
uninitialized resource.

Change-Id: I65c408f065cc7c68a929ec43d50b0a493942a189
Signed-off-by: Stepan Moskovchenko <stepanm@codeaurora.org>
2016-03-22 11:02:20 -07:00