summaryrefslogtreecommitdiff
path: root/mhi
diff options
context:
space:
mode:
authorHsiu-Chang Chen <hsiuchangchen@google.com>2022-07-05 11:33:57 +0800
committerHsiu-Chang Chen <hsiuchangchen@google.com>2022-07-05 11:33:57 +0800
commitb3bbdb9cf83a472565ede2ae636367f448d79b54 (patch)
treeb7748870722efaa98445b18436a5c3b08c08399e /mhi
parenta669d625291d0f932429991e9855e2fc1f93f4f0 (diff)
downloadcnss2-b3bbdb9cf83a472565ede2ae636367f448d79b54.tar.gz
wcn6740: Update cnss/mhi/qmi/qrtr drivers
Migrate wlan codes to preCS release Bug: 237922233 Test: Regression Test Change-Id: I02eb261b022db86ace9a9f25327d55da1452c065
Diffstat (limited to 'mhi')
-rw-r--r--mhi/core/misc.c16
-rw-r--r--mhi/core/misc.h2
-rw-r--r--mhi/core/pm.c2
3 files changed, 16 insertions, 4 deletions
diff --git a/mhi/core/misc.c b/mhi/core/misc.c
index 20f6333..fffef3e 100644
--- a/mhi/core/misc.c
+++ b/mhi/core/misc.c
@@ -33,6 +33,8 @@ const char * const mhi_log_level_str[MHI_MSG_LVL_MAX] = {
!mhi_log_level_str[level]) ? \
"Mask all" : mhi_log_level_str[level])
+#define MHI_DTR_CHANNEL 19
+
struct mhi_bus mhi_bus;
void mhi_misc_init(void)
@@ -788,7 +790,7 @@ bool mhi_scan_rddm_cookie(struct mhi_controller *mhi_cntrl, u32 cookie)
{ "ERROR_DBG3", BHI_ERRDBG3 },
{ NULL },
};
- if (!mhi_cntrl->rddm_image || !cookie)
+ if (!mhi_cntrl->rddm_image || !cookie || !mhi_cntrl->bhi)
return false;
MHI_VERB("Checking BHI debug register for 0x%x\n", cookie);
@@ -1455,6 +1457,7 @@ void mhi_misc_mission_mode(struct mhi_controller *mhi_cntrl)
struct device *dev = &mhi_cntrl->mhi_dev->dev;
struct mhi_private *mhi_priv = dev_get_drvdata(dev);
struct mhi_sfr_info *sfr_info = mhi_priv->sfr_info;
+ struct mhi_device *dtr_dev;
u64 local, remote;
int ret = -EIO;
@@ -1463,6 +1466,11 @@ void mhi_misc_mission_mode(struct mhi_controller *mhi_cntrl)
if (!ret)
MHI_LOG("Timesync: local: %llx, remote: %llx\n", local, remote);
+ /* IP_CTRL DTR channel ID */
+ dtr_dev = mhi_get_device_for_channel(mhi_cntrl, MHI_DTR_CHANNEL);
+ if (dtr_dev)
+ mhi_notify(dtr_dev, MHI_CB_DTR_START_CHANNELS);
+
/* initialize SFR */
if (!sfr_info)
return;
@@ -1594,7 +1602,10 @@ int mhi_get_remote_time_sync(struct mhi_device *mhi_dev,
preempt_disable();
local_irq_disable();
- *t_host = mhi_tsync->time_get(mhi_cntrl);
+ ret = mhi_read_reg(mhi_cntrl, mhi_tsync->time_reg,
+ TIMESYNC_TIME_HIGH_OFFSET, &tdev_hi);
+ if (ret)
+ MHI_ERR("Time HIGH register read error\n");
ret = mhi_read_reg(mhi_cntrl, mhi_tsync->time_reg,
TIMESYNC_TIME_LOW_OFFSET, &tdev_lo);
@@ -1607,6 +1618,7 @@ int mhi_get_remote_time_sync(struct mhi_device *mhi_dev,
MHI_ERR("Time HIGH register read error\n");
*t_dev = (u64) tdev_hi << 32 | tdev_lo;
+ *t_host = mhi_tsync->time_get(mhi_cntrl);
local_irq_enable();
preempt_enable();
diff --git a/mhi/core/misc.h b/mhi/core/misc.h
index 4d038fb..78bf8fb 100644
--- a/mhi/core/misc.h
+++ b/mhi/core/misc.h
@@ -16,7 +16,7 @@
#define MHI_FORCE_WAKE_DELAY_US (100)
#define MHI_IPC_LOG_PAGES (200)
-#define MAX_RDDM_TABLE_SIZE (7)
+#define MAX_RDDM_TABLE_SIZE (8)
#define MHI_REG_SIZE (SZ_4K)
/* MHI misc capability registers */
diff --git a/mhi/core/pm.c b/mhi/core/pm.c
index bb9628b..45ddbbb 100644
--- a/mhi/core/pm.c
+++ b/mhi/core/pm.c
@@ -436,7 +436,6 @@ static int mhi_pm_mission_mode_transition(struct mhi_controller *mhi_cntrl)
read_unlock_bh(&mhi_cntrl->pm_lock);
- mhi_misc_mission_mode(mhi_cntrl);
mhi_process_sleeping_events(mhi_cntrl);
/*
@@ -444,6 +443,7 @@ static int mhi_pm_mission_mode_transition(struct mhi_controller *mhi_cntrl)
* Execution Environment (EE) to either SBL or AMSS states
*/
mhi_create_devices(mhi_cntrl);
+ mhi_misc_mission_mode(mhi_cntrl);
read_lock_bh(&mhi_cntrl->pm_lock);