Commit Graph

860765 Commits

Author SHA1 Message Date
William Wu
bd28ce36dd usb: dwc3: gadget: rework the tx fifos resize
The current code does the whole tx fifos resize in the function
dwc3_gadget_ep_enable() only when the ep-in is isoc type and the
maxpacket >= 1024, for example, if the usb gadget is configured
as UAC + RNDIS + UVC + ADB, then the tx fifos resize is done when
uvc streaming on, there maybe a risk that the in endpoints of the
uac/rndis/adb are using their tx fifos to transfer data while do
the whole tx fifos resize, if this case occurs, the dwc3 controller
will run into abnormal and unrecoverable state.

To fix this issue, we must make sure that there are not any in
endpoints using tx fifos to transfer data while do the whole tx
fifos resize. The patch does the tx fifos resize when the connect
done event occurs during usb gadget enumeration phase.

Change-Id: Ia793fd7895b36e771ad654e583fa3fd7bf29aac6
Signed-off-by: William Wu <william.wu@rock-chips.com>
2020-12-22 18:44:44 +08:00
William Wu
924ae9b9ea usb: gadget: add transfer_type in struct usb_ep for rockchip
The usb gadget core set the chosen endpoint descriptor for
each endpoints in config_ep_by_speed(), however, we want
to get the transfer type of the endpoints earlier on the
rockchip platforms for usb controller initialization
(e.g. do tx fifos resize for rockchip usb dwc3 controller),
so this patch add transfer_type in the struct usb_ep, and
set the transfer_type in the usb_ep_autoconfig_ss().

Change-Id: Ia2added218e180dda7a7ca5da09ee18d63be1ff0
Signed-off-by: William Wu <william.wu@rock-chips.com>
2020-12-22 18:44:44 +08:00
Wenping Zhang
b2fd919bec drivers: input: touch: fix bug system hang when cyttsp5 is not connected.
Signed-off-by: Wenping Zhang <wenping.zhang@rock-chips.com>
Change-Id: I7fd72a30b77ae3396c2220588794b03d78ed8642
2020-12-22 18:17:53 +08:00
Cai YiWei
d8fa472205 media: rockchip: ispp: dummy buf map to one page if iommu enable
Change-Id: Id55ff67679ffb80195bdb97478d0581cb106dab1
Signed-off-by: Cai YiWei <cyw@rock-chips.com>
2020-12-22 18:14:33 +08:00
Cai YiWei
d82eda7389 media: rockchip: ispp: reduce buf count
Change-Id: Ie719d3cee9c638335af0edf45aa4b59e6c601f7b
Signed-off-by: Cai YiWei <cyw@rock-chips.com>
2020-12-22 18:14:33 +08:00
Cai YiWei
4ff60a36b2 media: rockchip: isp: extend line to fix merge bypass bug for isp20
Change-Id: Ia1ed6a885cffd55859dcec5ad35f22b99d506336
Signed-off-by: Cai YiWei <cyw@rock-chips.com>
2020-12-22 18:13:34 +08:00
XiaoDong Huang
8ff4c4166c arm64: configs: rockchip_defconfig: enable CONFIG_COMMON_CLK_SCMI
Change-Id: Ie45297e5ba969de758957ef2086f53d28ac08ffd
Signed-off-by: XiaoDong Huang <derrick.huang@rock-chips.com>
2020-12-22 17:36:16 +08:00
XiaoDong Huang
9c697da828 arm64: configs: rockchip_defconfig: enable CONFIG_ARM_SCMI_PROTOCOL
Change-Id: I05818555cd5f796750922be7d57d4653c3f362f9
Signed-off-by: XiaoDong Huang <derrick.huang@rock-chips.com>
2020-12-22 17:36:10 +08:00
Jianqun Xu
8086d8dbbe android: ion: add vmap/vunmap operations
Change-Id: I90e2bcdd4526409194917609deb791e7badaf4f4
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
2020-12-22 17:34:35 +08:00
Elaine Zhang
85adafe7d8 arm64: dts: rockchip: set ACLK_PIPE to 400M for rk3568
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
Change-Id: I4b9e01f05b8f0782bbd35b6265eb2fbf8dd0359e
2020-12-22 17:30:32 +08:00
Shawn Lin
79ac46bdea PCI: rockchip: dw: Add kthread to probe PCIe devices
It take quite a long time to wait for devices to be probed
in multi-RCs system and even longer to wait for timeout
if no devices attached. Use kthread to save the boot time.

Change-Id: Ib7060679287f0a08fbb9ff437947d8a47e775b75
Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
2020-12-22 16:54:53 +08:00
Alex Wang
bdabd96dae arm64: dts: rockchip: rk3568-nvr: enable iep
Change-Id: I3aa01ce048d39986f55b092907f4acd19b7001b3
Signed-off-by: Alex Wang <alex.wang@rock-chips.com>
2020-12-22 16:53:21 +08:00
Etienne Carriere
08ea2419b3 UPSTREAM: firmware: arm_scmi: Expand SMC/HVC message pool to more than one
SMC/HVC can transmit only one message at the time as the shared memory
needs to be protected and the calls are synchronous.

However, in order to allow multiple threads to send SCMI messages
simultaneously, we need a larger poll of memory.

Let us just use value of 20 to keep it in sync mailbox transport
implementation. Any other value must work perfectly.

Link: https://lore.kernel.org/r/20201008143722.21888-4-etienne.carriere@linaro.org
Fixes: 1dc6558062 ("firmware: arm_scmi: Add smc/hvc transport")
Cc: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org>
[sudeep.holla: reworded the commit message to indicate the practicality]
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
(cherry picked from commit 7adb2c8aaa)

Change-Id: I36bf5833a51c7e31f822a1eac504db28519219a3
Signed-off-by: XiaoDong Huang <derrick.huang@rock-chips.com>
2020-12-22 15:54:12 +08:00
Sudeep Holla
f8cce4316a UPSTREAM: firmware: arm_scmi: Provide a missing function param description
gcc as well as clang now produce warnings for missing kerneldoc function
parameter.

Fix the following W=1 kernel build warning:

drivers/firmware/arm_scmi/smc.c:32:
 warning: Function parameter or member 'shmem_lock' not described in 'scmi_smc'

Link: https://lore.kernel.org/r/20200709153155.22573-1-sudeep.holla@arm.com
Reported-by: kbuild test robot <lkp@intel.com>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
(cherry picked from commit a4ee9d0194)

Change-Id: Idd4d3ffc02ea7eb0e2f7b9e2ab0fa2038d49c934
Signed-off-by: XiaoDong Huang <derrick.huang@rock-chips.com>
2020-12-22 15:54:12 +08:00
Sudeep Holla
6fddda9317 UPSTREAM: firmware: arm_scmi: Fix return error code in smc_send_message
SMCCC can return NOT_SUPPORTED(-1). Map it to appropriate Linux error
codes namely -EOPNOTSUPP.

Link: https://lore.kernel.org/r/20200417103232.6896-1-sudeep.holla@arm.com
Reported-and-Tested-by:: Etienne Carriere <etienne.carriere@linaro.org>
Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
(cherry picked from commit f7199cf489)

Change-Id: Ia5fc22980d27e942105a4fc4e43b59697603e30f
Signed-off-by: XiaoDong Huang <derrick.huang@rock-chips.com>
2020-12-22 15:54:12 +08:00
Sudeep Holla
eb7522dfd4 UPSTREAM: firmware: arm_scmi: Drop checking for shmem property in parent node
The scmi protocol core driver checks for the channel availability
before evaluating the shmem property. If the individual protocols
don't have separate channel assigned to them, the channel alloted
for the BASE protocol is reused automatically.

Therefore there is no need to check for the shmem property in the
parent node if it is absent in the child protocol node.

Link: https://lore.kernel.org/r/20200327163654.13389-5-sudeep.holla@arm.com
Tested-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
(cherry picked from commit 4e44590ee4)

Change-Id: Icd6f501d6f943eef5059340b0f1e74364546136b
Signed-off-by: XiaoDong Huang <derrick.huang@rock-chips.com>
2020-12-22 15:54:12 +08:00
Sudeep Holla
486bac08a3 UPSTREAM: firmware: arm_scmi: Check shmem property for channel availablity
Instead of declaring the channel availabilty unconditionally, let us
check for the presence of "shmem" property and return the channel
availablity accordingly.

Link: https://lore.kernel.org/r/20200327163654.13389-4-sudeep.holla@arm.com
Tested-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
(cherry picked from commit 8aa6e12bbf)

Change-Id: I51d139aab5c84231df09e83bca7ecdbb7cd74276
Signed-off-by: XiaoDong Huang <derrick.huang@rock-chips.com>
2020-12-22 15:54:11 +08:00
Sudeep Holla
11205a7fd7 UPSTREAM: firmware: arm_scmi: Drop empty stub for smc_mark_txdone
The scmi protocol core driver check for non NULL mark_txdone before
invoking the same. There is no need to provide a empty stub. SMC/HVC
calls are synchronous and the call return indicates the completion.

Link: https://lore.kernel.org/r/20200327163654.13389-3-sudeep.holla@arm.com
Tested-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
(cherry picked from commit b9d15ee21c)

Change-Id: I89610552170a143e4c48a7b7dbc60dde7db75d73
Signed-off-by: XiaoDong Huang <derrick.huang@rock-chips.com>
2020-12-22 15:54:11 +08:00
Sudeep Holla
8d2c38c6a2 UPSTREAM: firmware: arm_scmi: Make mutex channel specific
In order to support multiple SMC/HVC transport channels with associated
shared memory, it is better to maintain the mutex per channel instead of
existing global one.

Move the smc_mutex into the scmi_smc structure and also rename it to
shmem_lock which is more appropriate for it's use.

Link: https://lore.kernel.org/r/20200327163654.13389-2-sudeep.holla@arm.com
Tested-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
(cherry picked from commit 18988265b8)

Change-Id: I7aff40e259dfb86cb99fd1507a35331a192bf4a3
Signed-off-by: XiaoDong Huang <derrick.huang@rock-chips.com>
2020-12-22 15:54:11 +08:00
Peng Fan
e4e2c57335 UPSTREAM: firmware: arm_scmi: Add smc/hvc transport
Use the value of "arm,smc-id" property from the device tree as the first
argument for SMCCC call leaving all the other arguments as zero for now.

There is no Rx, only Tx because of smc/hvc not support Rx.

Link: https://lore.kernel.org/r/1583673879-20714-3-git-send-email-peng.fan@nxp.com
Signed-off-by: Peng Fan <peng.fan@nxp.com>
[sudeep.holla: reworded commit log/subject and fixed !HAVE_ARM_SMCCC build]
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
(cherry picked from commit 1dc6558062)

Change-Id: Ie192ad571d5f0ae7fc4972a00ac9071b5c8b055b
Signed-off-by: XiaoDong Huang <derrick.huang@rock-chips.com>
2020-12-22 15:54:10 +08:00
Viresh Kumar
ea2762bb44 UPSTREAM: firmware: arm_scmi: Make scmi core independent of the transport type
The SCMI specification is fairly independent of the transport protocol,
which can be a simple mailbox (already implemented) or anything else.
The current Linux implementation however is very much dependent on the
mailbox transport layer.

This patch makes the SCMI core code (driver.c) independent of the
mailbox transport layer and moves all mailbox related code to a new
file: mailbox.c and all struct shared_mem related code to a new file:
shmem.c.

We can now implement more transport protocols to transport SCMI
messages.

The transport protocols just need to provide struct scmi_transport_ops,
with its version of the callbacks to enable exchange of SCMI messages.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Link: https://lore.kernel.org/r/8698a3cec199b8feab35c2339f02dc232bfd773b.1580448239.git.viresh.kumar@linaro.org
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
(cherry picked from commit 5c8a47a5a9)

Change-Id: I6ce8d261317212bb0f68bf5946f683b83f5fc2d0
Signed-off-by: XiaoDong Huang <derrick.huang@rock-chips.com>
2020-12-22 15:54:10 +08:00
Viresh Kumar
fc04a76fe5 UPSTREAM: firmware: arm_scmi: Move macros and helpers to common.h
Move message header specific macros and helper routines to common.h as
they will be used outside of driver.c in a later commit.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Link: https://lore.kernel.org/r/6615db480370719b0a0241447a5f3feb8eea421f.1580448239.git.viresh.kumar@linaro.org
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
(cherry picked from commit c4eb83660a)

Change-Id: I58fe0835715ccadf019f144d5fef321a57f545ea
Signed-off-by: XiaoDong Huang <derrick.huang@rock-chips.com>
2020-12-22 15:54:10 +08:00
Viresh Kumar
dad8a4f130 UPSTREAM: firmware: arm_scmi: Update doc style comments
Fix minor formatting issues with the doc style comments.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Link: https://lore.kernel.org/r/1bff7c0d1ad2c8b6eeff9660421f414f8c612eb2.1580448239.git.viresh.kumar@linaro.org
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
(cherry picked from commit 71af05a7d0)

Change-Id: If7250805e6cec4576cbf3706027eac47886afd67
Signed-off-by: XiaoDong Huang <derrick.huang@rock-chips.com>
2020-12-22 15:54:10 +08:00
Lukasz Luba
6c1bf7699e UPSTREAM: drivers: firmware: scmi: Extend SCMI transport layer by trace events
The SCMI transport layer communicates via mailboxes and shared memory with
firmware running on a microcontroller. It is platform specific how long it
takes to pass a SCMI message. The most sensitive requests are coming from
CPUFreq subsystem, which might be used by the scheduler.
Thus, there is a need to measure these delays and capture anomalies.
This change introduces trace events wrapped around transfer code.

According to Jim's suggestion a unique transfer_id is to distinguish
similar entries which might have the same message id, protocol id and
sequence. This is a case then there are some timeouts in transfers.

Suggested-by: Jim Quinlan <james.quinlan@broadcom.com>
Signed-off-by: Lukasz Luba <lukasz.luba@arm.com>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
(cherry picked from commit 729d3530a5)

Change-Id: I4ddbc6f24e48e1a11f29c88d03ebba91f000284a
Signed-off-by: XiaoDong Huang <derrick.huang@rock-chips.com>
2020-12-22 15:54:10 +08:00
Lukasz Luba
c373c1f0ae UPSTREAM: include: trace: Add SCMI header with trace events
Adding trace events would help to measure the speed of the communication
channel. It can be also potentially used helpful during investigation
of some issues platforms which use different transport layer.

Update also MAINTAINERS file with information that the new trace events
are maintained.

Suggested-by: Jim Quinlan <james.quinlan@broadcom.com>
Signed-off-by: Lukasz Luba <lukasz.luba@arm.com>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
(cherry picked from commit 257d0e20ec)

Change-Id: I4349c71a5c2efdb2be06fef4e82750facc81d55a
Signed-off-by: XiaoDong Huang <derrick.huang@rock-chips.com>
2020-12-22 15:54:10 +08:00
Sudeep Holla
b430ea6fd1 UPSTREAM: firmware: arm_scmi: Add names to scmi devices created
Now that scmi bus provides option to create named scmi device, let us
create the default devices with names. This will help to add names for
matching to respective drivers and eventually to add multiple devices
and drivers per protocol.

Reviewed-by: Cristian Marussi <cristian.marussi@arm.com>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
(cherry picked from commit 9c5c463f2a)

Change-Id: I08fdf1fac9ef3ae900b6cbe5422a6ac928f23ca1
Signed-off-by: XiaoDong Huang <derrick.huang@rock-chips.com>
2020-12-22 15:54:09 +08:00
Sudeep Holla
738c335874 UPSTREAM: firmware: arm_scmi: Skip scmi mbox channel setup for addtional devices
Now that the scmi bus supports adding multiple devices per protocol,
and since scmi_create_protocol_device calls scmi_mbox_chan_setup,
we must avoid allocating and initialising the mbox channel if it is
already initialised.

Reviewed-by: Cristian Marussi <cristian.marussi@arm.com>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
(cherry picked from commit 11040889af)

Change-Id: I312846528b8e5e2251784e8c43548b895243ef54
Signed-off-by: XiaoDong Huang <derrick.huang@rock-chips.com>
2020-12-22 15:54:09 +08:00
Steven Price
b93145dca3 UPSTREAM: arm/arm64: Provide a wrapper for SMCCC 1.1 calls
SMCCC 1.1 calls may use either HVC or SMC depending on the PSCI
conduit. Rather than coding this in every call site, provide a macro
which uses the correct instruction. The macro also handles the case
where no conduit is configured/available returning a not supported error
in res, along with returning the conduit used for the call.

This allow us to remove some duplicated code and will be useful later
when adding paravirtualized time hypervisor calls.

Signed-off-by: Steven Price <steven.price@arm.com>
Acked-by: Will Deacon <will@kernel.org>
Signed-off-by: Marc Zyngier <maz@kernel.org>
(cherry picked from commit 541625ac47)

Change-Id: I870c88fae413a0d46c242f840938e1a3578a942f
Signed-off-by: XiaoDong Huang <derrick.huang@rock-chips.com>
2020-12-22 15:54:09 +08:00
Mark Rutland
62eb270452 UPSTREAM: arm/arm64: smccc/psci: add arm_smccc_1_1_get_conduit()
SMCCC callers are currently amassing a collection of enums for the SMCCC
conduit, and are having to dig into the PSCI driver's internals in order
to figure out what to do.

Let's clean this up, with common SMCCC_CONDUIT_* definitions, and an
arm_smccc_1_1_get_conduit() helper that abstracts the PSCI driver's
internal state.

We can kill off the PSCI_CONDUIT_* definitions once we've migrated users
over to the new interface.

Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Acked-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Acked-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
(cherry picked from commit 6b7fe77c33)

Change-Id: I4e2d92b6f641eedc759b2f7a7e1c576a7935b8b2
Signed-off-by: XiaoDong Huang <derrick.huang@rock-chips.com>
2020-12-22 15:54:09 +08:00
Sudeep Holla
0d0070c028 UPSTREAM: firmware: arm_scmi: Add support for multiple device per protocol
Currently only one scmi device is created for each protocol enumerated.
However, there is requirement to make use of some procotols by multiple
kernel subsystems/frameworks. One such example is SCMI PERFORMANCE
protocol which can be used by both cpufreq and devfreq drivers.
Similarly, SENSOR protocol may be used by hwmon and iio subsystems,
and POWER protocol may be used by genpd and regulator drivers.

In order to achieve that, let us extend the scmi bus to match based
not only protocol id but also the scmi device name if one is available.

Reviewed-by: Cristian Marussi <cristian.marussi@arm.com>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
(cherry picked from commit ee7a9c9f67)

Change-Id: Ia371408eb8e2b26c0b3b39de9ed86baa3d2f87b9
Signed-off-by: XiaoDong Huang <derrick.huang@rock-chips.com>
2020-12-22 15:54:09 +08:00
Sudeep Holla
8a9f387931 UPSTREAM: firmware: arm_scmi: Add support for asynchronous commands and delayed response
Messages that are sent to platform, also known as commands and can be:

1. Synchronous commands that block the channel until the requested work
has been completed. The platform responds to these commands over the
same channel and hence can't be used to send another command until the
previous command has completed.

2. Asynchronous commands on the other hand, the platform schedules the
requested work to complete later in time and returns almost immediately
freeing the channel for new commands. The response indicates the success
or failure in the ability to schedule the requested work. When the work
has completed, the platform sends an additional delayed response message.

Using the same transmit buffer used for sending the asynchronous command
even for the delayed response corresponding to it simplifies handling of
the delayed response. It's the caller of asynchronous command that is
responsible for allocating the completion flag that scmi driver can
complete to indicate the arrival of delayed response.

Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
(cherry picked from commit 58ecdf03db)

Change-Id: I366d810e11789b5c1ea038e85c2cd04e5452c72b
Signed-off-by: XiaoDong Huang <derrick.huang@rock-chips.com>
2020-12-22 15:54:09 +08:00
Sudeep Holla
6dbf7b831f UPSTREAM: firmware: arm_scmi: Add mechanism to unpack message headers
In order to identify the message type when a response arrives, we need
a mechanism to unpack the message header similar to packing. Let's
add one.

Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
(cherry picked from commit 22d1f76109)

Change-Id: Ib69d24aaf3e4b8d00713a578d1647c19f3334ea8
Signed-off-by: XiaoDong Huang <derrick.huang@rock-chips.com>
2020-12-22 15:54:09 +08:00
Sudeep Holla
c66f421b53 UPSTREAM: firmware: arm_scmi: Separate out tx buffer handling and prepare to add rx
Currently we pre-allocate transmit buffers only and use the first free
slot in that pre-allocated buffer for transmitting any new message that
are generally originated from OS to the platform firmware.

Notifications or the delayed responses on the other hand are originated
from the platform firmware and consumes by the OS. It's better to have
separate and dedicated pre-allocated buffers to handle the notifications.
We can still use the transmit buffers for the delayed responses.

In addition, let's prepare existing scmi_xfer_{get,put} for acquiring
and releasing a slot to identify the right(tx/rx) buffers.

Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
(cherry picked from commit 38c927fbeb)

Change-Id: Ie6411e89580a35ea78a32eeeb74756e2d62e528f
Signed-off-by: XiaoDong Huang <derrick.huang@rock-chips.com>
2020-12-22 15:54:09 +08:00
Sudeep Holla
65b767396a UPSTREAM: firmware: arm_scmi: Add receive channel support for notifications
With scmi_mbox_chan_setup enabled to identify and setup both Tx and Rx,
let's consolidate setting up of both the channels under the function
scmi_mbox_txrx_setup.

Since some platforms may opt not to support notifications or delayed
response, they may not need support for Rx. Hence Rx is optional and
failure of setting one up is not considered fatal.

Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
(cherry picked from commit 46cc7c286c)

Change-Id: Iac0772348af94f83690c06d340f8493e92618e76
Signed-off-by: XiaoDong Huang <derrick.huang@rock-chips.com>
2020-12-22 15:54:09 +08:00
Sudeep Holla
bcc8aa7230 UPSTREAM: firmware: arm_scmi: Segregate tx channel handling and prepare to add rx
The transmit(Tx) channels are specified as the first entry and the
receive(Rx) channels are the second entry as per the device tree
bindings. Since we currently just support Tx, index 0 is hardcoded at
all required callsites.

In order to prepare for adding Rx support, let's remove those hardcoded
index and add boolean parameter to identify Tx/Rx channels when setting
them up.

Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
(cherry picked from commit 3748daf7fb)

Change-Id: Ia5ae7c7740afaba0dc2f87b50f65a9e0da91377e
Signed-off-by: XiaoDong Huang <derrick.huang@rock-chips.com>
2020-12-22 15:54:08 +08:00
Sudeep Holla
6ac6f37ceb UPSTREAM: firmware: arm_scmi: Reorder some functions to avoid forward declarations
Re-shuffling few functions to keep definitions and their usages close.
This is also needed to avoid too many unnecessary forward declarations
while adding new features(delayed response and notifications).

Keeping this separate to avoid mixing up of these trivial change that
doesn't affect functionality into the ones that does.

Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
(cherry picked from commit 2747a967c8)

Change-Id: I2e44aebdda6b29bd3739f63aba1bb755453e55d6
Signed-off-by: XiaoDong Huang <derrick.huang@rock-chips.com>
2020-12-22 15:54:08 +08:00
Sudeep Holla
cc091c4691 UPSTREAM: firmware: arm_scmi: Use the term 'message' instead of 'command'
In preparation to adding support for other two types of messages that
SCMI specification mentions, let's replace the term 'command' with the
correct term 'message'.

As per the specification the messages are of 3 types:
commands(synchronous or asynchronous), delayed responses and notifications.

Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
(cherry picked from commit 5b65af8f60)

Change-Id: I7c67371e158c1856f318e9084a78f4fe8c36c9b6
Signed-off-by: XiaoDong Huang <derrick.huang@rock-chips.com>
2020-12-22 15:54:08 +08:00
Sudeep Holla
7f3632a711 UPSTREAM: firmware: arm_scmi: Fix few trivial typos in comments
While adding new comments found couple of typos that are better fixed.

s/informfation/information/
s/statues/status/

Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
(cherry picked from commit c29a628976)

Change-Id: I674c5f34787af25febf9325b02c2c9af797641ee
Signed-off-by: XiaoDong Huang <derrick.huang@rock-chips.com>
2020-12-22 15:54:08 +08:00
Sudeep Holla
6398ceda9b UPSTREAM: firmware: arm_scmi: Remove extra check for invalid length message responses
scmi_xfer_get_init ensures both transmit and receive buffer lengths are
within the maximum limits. If receive buffer length is not supplied by
the caller, it's set to the maximum limit value. Receive buffer length
is never modified after that. So there's no need for the extra check
when receive transmit completion for a command essage.

Further, if the response header length is greater than the prescribed
receive buffer length, the response buffer is truncated to the latter.

Reported-by: Jim Quinlan <james.quinlan@broadcom.com>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
(cherry picked from commit 37bbffcb19)

Change-Id: I913d3fd7041b6226918840aa644f098ec43f8bf7
Signed-off-by: XiaoDong Huang <derrick.huang@rock-chips.com>
2020-12-22 15:54:08 +08:00
Aditya Pakki
92fb15b300 UPSTREAM: firmware: arm_scmi: replace of_match_device->data with of_device_get_match_data()
of_match_device can return NULL if no matching device is found though
it's highly unlikely to happen in scmi_probe as it's called only if
a valid match is found.

However we can use of_device_get_match_data() instead of
of_match_device()->data to handle NULL pointer checks and return -EINVAL
in such a scenario.

Reviewed-by: Steven Price <steven.price@arm.com>
Signed-off-by: Aditya Pakki <pakki001@umn.edu>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
(cherry picked from commit d9350f21e5)

Change-Id: Ie82ea97ae27ef08022b9326c02671378f99dfd57
Signed-off-by: XiaoDong Huang <derrick.huang@rock-chips.com>
2020-12-22 15:54:08 +08:00
YouMin Chen
ad4ff95560 PM / devfreq: rockchip_dmc: add support for rk3568
Change-Id: I64f11fefb6227805031e911910a0123e4c0f9d78
Signed-off-by: YouMin Chen <cym@rock-chips.com>
2020-12-22 15:37:47 +08:00
YouMin Chen
8a4608928a dt-bindings: memory: add header to define DRAM for rk3568
Change-Id: I3f5218a6babf2e4a6d58eb9b8680911875c1f5de
Signed-off-by: YouMin Chen <cym@rock-chips.com>
2020-12-22 15:25:28 +08:00
YouMin Chen
e94ae96d81 dt-bindings: devfreq: rockchip_dmc: add rk3568 support
Change-Id: I84acdefc9441406e2bca49549a863dd83a621bc4
Signed-off-by: YouMin Chen <cym@rock-chips.com>
2020-12-22 15:24:41 +08:00
YouMin Chen
f07627c47a PM / devfreq: rockchip-dfi: add support for rk3568 dfi
Change-Id: I62d21e31cd56e82c04de675be502b261ba3740da
Signed-off-by: YouMin Chen <cym@rock-chips.com>
2020-12-22 15:24:11 +08:00
YouMin Chen
40fd19587f dt-bindings: devfreq: rockchip_dfi: add rk3568 support
Change-Id: Id99f60a26f260ba9a4fb037fd0be12355c2d5abd
Signed-off-by: YouMin Chen <cym@rock-chips.com>
2020-12-22 15:22:04 +08:00
Ding Wei
37b4b14779 video: rockchip: mpp: fix error for clear cache
1. rkvdec2 use 3 cache.
2. cache offset is 0x500 not 0x700.

Change-Id: Ib5715750c363a9a7ffda938466eb32a0ea43b729
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
2020-12-22 10:30:48 +08:00
Jianqun Xu
d386b9cfa6 Revert "staging: ion: remove __GFP_NOWARN when use low order gfp flags"
This reverts commit d2805d7fff.

Change-Id: Id70bd22428df247703d3e4c466fe450faf680d03
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
2020-12-22 09:31:29 +08:00
Shunqing Chen
b76b1f8f53 drm/bridge: synopsys: dw-hdmi: fix no display between kernel logo and android logo
def_mode picture_aspect_ratio is no HDMI_PICTURE_ASPECT_NONE,
but Android set mode, the picture_aspect_ratio is HDMI_PICTURE_ASPECT_NONE,
When comparing the new mode with the old mode, the two are inconsistent,
so the mode will be changed.

Signed-off-by: Shunqing Chen <csq@rock-chips.com>
Change-Id: Ide07f9f7251a4ad22d4c27136005be77f1dfd4e2
2020-12-21 15:53:41 +08:00
Shawn Lin
9bbced880c mmc: sdhci-of-dwcmshc: auto gate clk when changing phase in tuning
Change-Id: I24a86622cc41c58dcf6e7edd9e458fe976573954
Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
2020-12-21 10:23:38 +08:00
Shawn Lin
57621d50a1 mmc: sdhci-of-dwcmshc: Set timeout broken flag for rk platform
Actually from test, it seems the expected DATA timeout is broken
for some CMD transfers which is wired, so we have to add
SDHCI_QUIRK_BROKEN_TIMEOUT_VAL for sdhci core to always set max
timeout value

Change-Id: Ib41ca137f700f939a13c9f9d0fc30cb8590f1183
Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
2020-12-21 09:47:33 +08:00