Qiang Yu
46db0ba12b
bus: mhi: host: Use mhi_soc_reset() API in place of register write
...
Currently, a direct register write is used when ramdump collection
in panic path occurs. Replace that with new mhi_soc_reset() API
such that a controller defined reset() function is exercised if
one is present and the regular SOC reset is done if it is not.
Signed-off-by: Qiang Yu <quic_qianyu@quicinc.com >
Reviewed-by: Loic Poulain <loic.poulain@linaro.org >
Reviewed-by: Jeffrey Hugo <quic_jhugo@quicinc.com >
Reviewed-by: Manivannan Sadhasivam <mani@kernel.org >
Link: https://lore.kernel.org/r/1665376324-34258-1-git-send-email-quic_qianyu@quicinc.com
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org >
2022-10-28 22:58:22 +05:30
Bhaumik Bhatt
0bca889fd6
bus: mhi: host: Bail on writing register fields if read fails
...
Helper API to write register fields relies on successful reads
of the register/address prior to the write. Bail out if a failure
is seen when reading the register before the actual write is
performed.
Signed-off-by: Bhaumik Bhatt <bbhatt@codeaurora.org >
Signed-off-by: Jeffrey Hugo <quic_jhugo@quicinc.com >
Reviewed-by: Hemant Kumar <hemantk@codeaurora.org >
Reviewed-by: Jeffrey Hugo <quic_jhugo@quicinc.com >
Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org >
Link: https://lore.kernel.org/r/1650304226-11080-2-git-send-email-quic_jhugo@quicinc.com
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org >
2022-04-23 18:57:32 +05:30
Manivannan Sadhasivam
3a1b8e281a
bus: mhi: Make mhi_state_str[] array static inline and move to common.h
...
mhi_state_str[] array could be used by MHI endpoint stack also. So let's
make the array as "static inline function" and move it inside the
"common.h" header so that the endpoint stack could also make use of it.
Reviewed-by: Hemant Kumar <hemantk@codeaurora.org >
Reviewed-by: Alex Elder <elder@linaro.org >
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org >
Link: https://lore.kernel.org/r/20220301160308.107452-11-manivannan.sadhasivam@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2022-03-18 14:02:55 +01:00
Manivannan Sadhasivam
d28cab4d4a
bus: mhi: Use bitfield operations for register read and write
...
Functions like mhi_read_reg_field(), mhi_poll_reg_field() and
mhi_write_reg_field() could be modified to not depend on the shift value
passed as an argument. Instead, the bitfield operation could be used to
extract the shift value from the mask itself.
This eliminates the need to define _SHIFT (and _SHFT) macros and
simplifies the code a bit. For shift values those cannot be determined
during build time, "__ffs()" helper is used find the shift value during
runtime.
While at it, let's also get rid of 32-bit masks like CHDBOFF_CHDBOFF_MASK
by doing the full 32-bit register read.
Suggested-by: Alex Elder <elder@linaro.org >
Reviewed-by: Alex Elder <elder@linaro.org >
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org >
Link: https://lore.kernel.org/r/20220301160308.107452-6-manivannan.sadhasivam@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2022-03-18 14:02:54 +01:00
Manivannan Sadhasivam
a0f5a63066
bus: mhi: Move host MHI code to "host" directory
...
In preparation of the endpoint MHI support, let's move the host MHI code
to its own "host" directory and adjust the toplevel MHI Kconfig & Makefile.
While at it, let's also move the "pci_generic" driver to "host" directory
as it is a host MHI controller driver.
Reviewed-by: Hemant Kumar <hemantk@codeaurora.org >
Reviewed-by: Alex Elder <elder@linaro.org >
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org >
Link: https://lore.kernel.org/r/20220301160308.107452-5-manivannan.sadhasivam@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2022-03-18 14:02:54 +01:00