Lines Matching +full:wp +full:- +full:controller
1 // SPDX-License-Identifier: GPL-2.0
17 struct mhi_controller *mhi_cntrl = m->private; in mhi_debugfs_states_show()
21 to_mhi_pm_state_str(mhi_cntrl->pm_state), in mhi_debugfs_states_show()
23 mhi_state_str(mhi_cntrl->dev_state), in mhi_debugfs_states_show()
24 TO_MHI_EXEC_STR(mhi_cntrl->ee), in mhi_debugfs_states_show()
25 mhi_cntrl->wake_set ? "true" : "false"); in mhi_debugfs_states_show()
28 seq_printf(m, "M0: %u M2: %u M3: %u", mhi_cntrl->M0, mhi_cntrl->M2, in mhi_debugfs_states_show()
29 mhi_cntrl->M3); in mhi_debugfs_states_show()
32 atomic_read(&mhi_cntrl->dev_wake), in mhi_debugfs_states_show()
33 atomic_read(&mhi_cntrl->pending_pkts)); in mhi_debugfs_states_show()
40 struct mhi_controller *mhi_cntrl = m->private; in mhi_debugfs_events_show()
47 return -ENODEV; in mhi_debugfs_events_show()
50 er_ctxt = mhi_cntrl->mhi_ctxt->er_ctxt; in mhi_debugfs_events_show()
51 mhi_event = mhi_cntrl->mhi_event; in mhi_debugfs_events_show()
52 for (i = 0; i < mhi_cntrl->total_ev_rings; in mhi_debugfs_events_show()
54 struct mhi_ring *ring = &mhi_event->ring; in mhi_debugfs_events_show()
56 if (mhi_event->offload_ev) { in mhi_debugfs_events_show()
63 i, (le32_to_cpu(er_ctxt->intmod) & EV_CTX_INTMODC_MASK) >> in mhi_debugfs_events_show()
65 (le32_to_cpu(er_ctxt->intmod) & EV_CTX_INTMODT_MASK) >> in mhi_debugfs_events_show()
68 seq_printf(m, " base: 0x%0llx len: 0x%llx", le64_to_cpu(er_ctxt->rbase), in mhi_debugfs_events_show()
69 le64_to_cpu(er_ctxt->rlen)); in mhi_debugfs_events_show()
71 seq_printf(m, " rp: 0x%llx wp: 0x%llx", le64_to_cpu(er_ctxt->rp), in mhi_debugfs_events_show()
72 le64_to_cpu(er_ctxt->wp)); in mhi_debugfs_events_show()
74 seq_printf(m, " local rp: 0x%pK db: 0x%pad\n", ring->rp, in mhi_debugfs_events_show()
75 &mhi_event->db_cfg.db_val); in mhi_debugfs_events_show()
83 struct mhi_controller *mhi_cntrl = m->private; in mhi_debugfs_channels_show()
90 return -ENODEV; in mhi_debugfs_channels_show()
93 mhi_chan = mhi_cntrl->mhi_chan; in mhi_debugfs_channels_show()
94 chan_ctxt = mhi_cntrl->mhi_ctxt->chan_ctxt; in mhi_debugfs_channels_show()
95 for (i = 0; i < mhi_cntrl->max_chan; i++, chan_ctxt++, mhi_chan++) { in mhi_debugfs_channels_show()
96 struct mhi_ring *ring = &mhi_chan->tre_ring; in mhi_debugfs_channels_show()
98 if (mhi_chan->offload_ch) { in mhi_debugfs_channels_show()
100 mhi_chan->name, mhi_chan->chan); in mhi_debugfs_channels_show()
104 if (!mhi_chan->mhi_dev) in mhi_debugfs_channels_show()
109 mhi_chan->name, mhi_chan->chan, (le32_to_cpu(chan_ctxt->chcfg) & in mhi_debugfs_channels_show()
111 (le32_to_cpu(chan_ctxt->chcfg) & CHAN_CTX_BRSTMODE_MASK) >> in mhi_debugfs_channels_show()
112 __ffs(CHAN_CTX_BRSTMODE_MASK), (le32_to_cpu(chan_ctxt->chcfg) & in mhi_debugfs_channels_show()
115 seq_printf(m, " type: 0x%x event ring: %u", le32_to_cpu(chan_ctxt->chtype), in mhi_debugfs_channels_show()
116 le32_to_cpu(chan_ctxt->erindex)); in mhi_debugfs_channels_show()
118 seq_printf(m, " base: 0x%llx len: 0x%llx rp: 0x%llx wp: 0x%llx", in mhi_debugfs_channels_show()
119 le64_to_cpu(chan_ctxt->rbase), le64_to_cpu(chan_ctxt->rlen), in mhi_debugfs_channels_show()
120 le64_to_cpu(chan_ctxt->rp), le64_to_cpu(chan_ctxt->wp)); in mhi_debugfs_channels_show()
122 seq_printf(m, " local rp: 0x%pK local wp: 0x%pK db: 0x%pad\n", in mhi_debugfs_channels_show()
123 ring->rp, ring->wp, in mhi_debugfs_channels_show()
124 &mhi_chan->db_cfg.db_val); in mhi_debugfs_channels_show()
134 if (dev->bus != &mhi_bus_type) in mhi_device_info_show()
140 mhi_dev->name, mhi_dev->dev_type ? "Controller" : "Transfer", in mhi_device_info_show()
141 mhi_dev->dev_wake); in mhi_device_info_show()
144 if (mhi_dev->dev_type == MHI_DEVICE_XFER) in mhi_device_info_show()
146 mhi_dev->ul_chan_id, mhi_dev->dl_chan_id); in mhi_device_info_show()
155 struct mhi_controller *mhi_cntrl = m->private; in mhi_debugfs_devices_show()
159 return -ENODEV; in mhi_debugfs_devices_show()
162 /* Show controller and client(s) info */ in mhi_debugfs_devices_show()
163 mhi_device_info_show(&mhi_cntrl->mhi_dev->dev, m); in mhi_debugfs_devices_show()
164 device_for_each_child(&mhi_cntrl->mhi_dev->dev, m, mhi_device_info_show); in mhi_debugfs_devices_show()
171 struct mhi_controller *mhi_cntrl = m->private; in mhi_debugfs_regdump_show()
174 int i, ret = -EIO; in mhi_debugfs_regdump_show()
176 void __iomem *mhi_base = mhi_cntrl->regs; in mhi_debugfs_regdump_show()
177 void __iomem *bhi_base = mhi_cntrl->bhi; in mhi_debugfs_regdump_show()
178 void __iomem *bhie_base = mhi_cntrl->bhie; in mhi_debugfs_regdump_show()
179 void __iomem *wake_db = mhi_cntrl->wake_db; in mhi_debugfs_regdump_show()
204 if (!MHI_REG_ACCESS_VALID(mhi_cntrl->pm_state)) in mhi_debugfs_regdump_show()
208 to_mhi_pm_state_str(mhi_cntrl->pm_state), in mhi_debugfs_regdump_show()
209 mhi_state_str(mhi_cntrl->dev_state), in mhi_debugfs_regdump_show()
210 TO_MHI_EXEC_STR(mhi_cntrl->ee)); in mhi_debugfs_regdump_show()
233 struct mhi_controller *mhi_cntrl = m->private; in mhi_debugfs_device_wake_show()
234 struct mhi_device *mhi_dev = mhi_cntrl->mhi_dev; in mhi_debugfs_device_wake_show()
238 return -ENODEV; in mhi_debugfs_device_wake_show()
242 "Wake count: %d\n%s\n", mhi_dev->dev_wake, in mhi_debugfs_device_wake_show()
252 struct seq_file *m = file->private_data; in mhi_debugfs_device_wake_write()
253 struct mhi_controller *mhi_cntrl = m->private; in mhi_debugfs_device_wake_write()
254 struct mhi_device *mhi_dev = mhi_cntrl->mhi_dev; in mhi_debugfs_device_wake_write()
256 int ret = -EINVAL; in mhi_debugfs_device_wake_write()
258 if (copy_from_user(&buf, ubuf, min_t(size_t, sizeof(buf) - 1, count))) in mhi_debugfs_device_wake_write()
259 return -EFAULT; in mhi_debugfs_device_wake_write()
273 struct mhi_controller *mhi_cntrl = m->private; in mhi_debugfs_timeout_ms_show()
275 seq_printf(m, "%u ms\n", mhi_cntrl->timeout_ms); in mhi_debugfs_timeout_ms_show()
284 struct seq_file *m = file->private_data; in mhi_debugfs_timeout_ms_write()
285 struct mhi_controller *mhi_cntrl = m->private; in mhi_debugfs_timeout_ms_write()
289 return -EINVAL; in mhi_debugfs_timeout_ms_write()
291 mhi_cntrl->timeout_ms = timeout_ms; in mhi_debugfs_timeout_ms_write()
298 return single_open(fp, mhi_debugfs_states_show, inode->i_private); in mhi_debugfs_states_open()
303 return single_open(fp, mhi_debugfs_events_show, inode->i_private); in mhi_debugfs_events_open()
308 return single_open(fp, mhi_debugfs_channels_show, inode->i_private); in mhi_debugfs_channels_open()
313 return single_open(fp, mhi_debugfs_devices_show, inode->i_private); in mhi_debugfs_devices_open()
318 return single_open(fp, mhi_debugfs_regdump_show, inode->i_private); in mhi_debugfs_regdump_open()
323 return single_open(fp, mhi_debugfs_device_wake_show, inode->i_private); in mhi_debugfs_device_wake_open()
328 return single_open(fp, mhi_debugfs_timeout_ms_show, inode->i_private); in mhi_debugfs_timeout_ms_open()
379 mhi_cntrl->debugfs_dentry = in mhi_create_debugfs()
380 debugfs_create_dir(dev_name(&mhi_cntrl->mhi_dev->dev), in mhi_create_debugfs()
383 debugfs_create_file("states", 0444, mhi_cntrl->debugfs_dentry, in mhi_create_debugfs()
385 debugfs_create_file("events", 0444, mhi_cntrl->debugfs_dentry, in mhi_create_debugfs()
387 debugfs_create_file("channels", 0444, mhi_cntrl->debugfs_dentry, in mhi_create_debugfs()
389 debugfs_create_file("devices", 0444, mhi_cntrl->debugfs_dentry, in mhi_create_debugfs()
391 debugfs_create_file("regdump", 0444, mhi_cntrl->debugfs_dentry, in mhi_create_debugfs()
393 debugfs_create_file("device_wake", 0644, mhi_cntrl->debugfs_dentry, in mhi_create_debugfs()
395 debugfs_create_file("timeout_ms", 0644, mhi_cntrl->debugfs_dentry, in mhi_create_debugfs()
401 debugfs_remove_recursive(mhi_cntrl->debugfs_dentry); in mhi_destroy_debugfs()
402 mhi_cntrl->debugfs_dentry = NULL; in mhi_destroy_debugfs()