Commit Graph

860783 Commits

Author SHA1 Message Date
YouMin Chen
47a2ca382c clk: rockchip: rk3568: add sclk_ddrc for dmc
Change-Id: I900cb986ce1ee3e8e212636e621c29e73c437217
Signed-off-by: YouMin Chen <cym@rock-chips.com>
2020-12-23 12:53:59 +08:00
YouMin Chen
19f9ea4b8e dt-bindings: clock: rk3568-cru: add clock ID SCLK_DDRCLK
Change-Id: Ie029065bda4de0fb764acf328c058c545c4176d6
Signed-off-by: YouMin Chen <cym@rock-chips.com>
2020-12-23 12:53:49 +08:00
Cai YiWei
2679d1c2f5 media: rockchip: cif: vb2 dma sg for iommu enable
Change-Id: I06049142d51f4137683a6e871d42cf1b0e3c3fc5
Signed-off-by: Cai YiWei <cyw@rock-chips.com>
2020-12-23 12:46:26 +08:00
Cai YiWei
0d8540d244 media: rockchip: ispp: vb2 dma sg for iommu enable
Change-Id: If54554daf86b481bbadca636427ffb52c3ca4e67
Signed-off-by: Cai YiWei <cyw@rock-chips.com>
2020-12-23 12:46:21 +08:00
Cai YiWei
fd37c931a3 media: rockchip: isp: vb2 dma sg for iommu enable
Change-Id: I50199da38b31a7d9b29673626ed9a0c07be5a94f
Signed-off-by: Cai YiWei <cyw@rock-chips.com>
2020-12-23 12:46:16 +08:00
William Wu
265c90374d usb: dwc3: gadget: set in eps maxpacket limit to 1024 if en fifo resize
Signed-off-by: William Wu <william.wu@rock-chips.com>
Change-Id: Icd8a56f49895690b8aaa6eefa212656ca070b566
2020-12-23 12:43:41 +08:00
XiaoDong Huang
3df1a47a05 arm64: dts: rockchip: add scmi node for rk3568
Change-Id: I7e07abbec0d75d45ed693c82c7f16e7aaa1fa41b
Signed-off-by: XiaoDong Huang <derrick.huang@rock-chips.com>
2020-12-23 11:31:13 +08:00
Algea Cao
8fa1516479 drm/bridge: synopsys: dw-hdmi: Support dw-hdmi does not serve as a connector
If dw-hdmi is not used as the final output port, it is
only used as a bridge but not a connector.

Change-Id: Ie730f47d6075db74c0c54374849fd938c13f5ba8
Signed-off-by: Algea Cao <algea.cao@rock-chips.com>
2020-12-23 11:28:11 +08:00
Algea Cao
6d1fbe5b3d drm: rockchip: rk628: post_process: Enable y2r when input mode clk is 594Mhz
Because hdmirx phy only support yuv420 when input mode is 4K-60Hz,
y2r should be enabled.

Change-Id: I1eca2c6783c63e07cb13b617bb32ff81f2229c7d
Signed-off-by: Algea Cao <algea.cao@rock-chips.com>
2020-12-23 11:28:11 +08:00
Algea Cao
c0a543e874 drm: rockchip: rk628: Add rk628 hdmirx driver
Change-Id: If4d9fefeada220430f9b6a5b3a35a20239461d3e
Signed-off-by: Algea Cao <algea.cao@rock-chips.com>
2020-12-23 11:28:11 +08:00
Algea Cao
92ae0beb2b drm: rockchip: rk628: Add rk628 combrx-phy driver
Change-Id: I0fbcca09e05c9876ae7e87000d1fa5b72a061077
Signed-off-by: Algea Cao <algea.cao@rock-chips.com>
2020-12-23 11:28:11 +08:00
Tao Huang
c48c2b8d2d arm64: dts: rockchip: add sram node for rk3568
Only 48KB system sram reserved for Linux.

Signed-off-by: Tao Huang <huangtao@rock-chips.com>
Change-Id: I08aef6ce1ceacca41f774dad9fc9badd77107a5e
2020-12-23 11:22:03 +08:00
Tao Huang
9440625ac2 arm64: dts: rockchip: rk3568: Fix typo in gmac1_clkin
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
Change-Id: Ice14c54c4c7025fb9527a3cae3bfdae237f09287
2020-12-23 10:12:26 +08:00
zhangqing
f4974c9108 clk: rockchip: rk3568: add CLK_IGNORE_UNUSED flag for pvtpll
Signed-off-by: zhangqing <zhangqing@rock-chips.com>
Change-Id: I24cdcdf4a22cf256dc4139eb6d1e1da878a17c2d
2020-12-23 10:11:07 +08:00
Sudeep Holla
e80884e89e BACKPORT: firmware: smccc: Drop smccc_version enum and use ARM_SMCCC_VERSION_1_x instead
Instead of maintaining 2 sets of enums/macros for tracking SMCCC version,
let us drop smccc_version enum and use ARM_SMCCC_VERSION_1_x directly
instead.

This is in preparation to drop smccc_version here and move it separately
under drivers/firmware/smccc.

Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
Tested-by: Etienne Carriere <etienne.carriere@st.com>
Reviewed-by: Steven Price <steven.price@arm.com>
Reviewed-by: Etienne Carriere <etienne.carriere@st.com>
Acked-by: Mark Rutland <mark.rutland@arm.com>
Link: https://lore.kernel.org/r/20200518091222.27467-5-sudeep.holla@arm.com
Signed-off-by: Will Deacon <will@kernel.org>
(cherry picked from commit ad5a57dfe4)

Change-Id: I8b3625d3adbaea003c1dadcbc028c62a2f4f59ba
Signed-off-by: XiaoDong Huang <derrick.huang@rock-chips.com>
2020-12-23 09:55:29 +08:00
Mark Rutland
79f41c9c36 UPSTREAM: arm64: errata: use arm_smccc_1_1_get_conduit()
Now that we have arm_smccc_1_1_get_conduit(), we can hide the PSCI
implementation details from the arm64 cpu errata code, so let's do so.

As arm_smccc_1_1_get_conduit() implicitly checks that the SMCCC version
is at least SMCCC_VERSION_1_1, we no longer need to check this
explicitly where switch statements have a default case, e.g. in
has_ssbd_mitigation().

There should be no functional change as a result of this patch.

Change-Id: I2cfbe314cdcd59da923ff845015c8852acf92a3f
Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Cc: Will Deacon <will.deacon@arm.com>
Cc: Marc Zyngier <marc.zyngier@arm.com>
Cc: Suzuki K Poulose <suzuki.poulose@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
(cherry picked from commit c98bd29917)
2020-12-23 09:46:11 +08:00
Mark Rutland
d3d417da2c UPSTREAM: arm: spectre-v2: use arm_smccc_1_1_get_conduit()
Now that we have arm_smccc_1_1_get_conduit(), we can hide the PSCI
implementation details from the arm spectre-v2 code, so let's do so.

As arm_smccc_1_1_get_conduit() implicitly checks that the SMCCC version
is at least SMCCC_VERSION_1_1, we no longer need to check this
explicitly where switch statements have a default case.

There should be no functional change as a result of this patch.

Change-Id: I61ad42fbdc1d2d684846e8eef54609889b101be3
Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Cc: Marc Zyngier <marc.zyngier@arm.com>
Cc: Russell King <linux@armlinux.org.uk>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
(cherry picked from commit 6848253dde)
2020-12-23 09:41:54 +08:00
Wu Liangqing
b14e969b5e Revert "Revert "arm64: dts: rockchip: Temporarily disable its for rk3568""
This reverts commit f818feceb5.

TF-A do not support resume its right now.

Change-Id: Ibfd120242406feeae9171aa9d657b9cb6366e154
Signed-off-by: Wu Liangqing <wlq@rock-chips.com>
2020-12-23 09:32:09 +08:00
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