^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) // SPDX-License-Identifier: GPL-2.0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) * debugfs.c - Designware USB2 DRD controller debugfs
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) * Copyright (C) 2015 Intel Corporation
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) * Mian Yousaf Kaukab <yousaf.kaukab@intel.com>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9) #include <linux/spinlock.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) #include <linux/debugfs.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) #include <linux/seq_file.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) #include <linux/uaccess.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) #include "core.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) #include "debug.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) #if IS_ENABLED(CONFIG_USB_DWC2_PERIPHERAL) || \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) IS_ENABLED(CONFIG_USB_DWC2_DUAL_ROLE)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) * testmode_write() - change usb test mode state.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) * @file: The file to write to.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) * @ubuf: The buffer where user wrote.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) * @count: The ubuf size.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) * @ppos: Unused parameter.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) static ssize_t testmode_write(struct file *file, const char __user *ubuf, size_t
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) count, loff_t *ppos)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) struct seq_file *s = file->private_data;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) struct dwc2_hsotg *hsotg = s->private;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) unsigned long flags;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) u32 testmode = 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) char buf[32];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) if (copy_from_user(&buf, ubuf, min_t(size_t, sizeof(buf) - 1, count)))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) return -EFAULT;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) if (!strncmp(buf, "test_j", 6))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) testmode = USB_TEST_J;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) else if (!strncmp(buf, "test_k", 6))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) testmode = USB_TEST_K;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43) else if (!strncmp(buf, "test_se0_nak", 12))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44) testmode = USB_TEST_SE0_NAK;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45) else if (!strncmp(buf, "test_packet", 11))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46) testmode = USB_TEST_PACKET;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47) else if (!strncmp(buf, "test_force_enable", 17))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48) testmode = USB_TEST_FORCE_ENABLE;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49) else
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50) testmode = 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52) spin_lock_irqsave(&hsotg->lock, flags);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53) dwc2_hsotg_set_test_mode(hsotg, testmode);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54) spin_unlock_irqrestore(&hsotg->lock, flags);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55) return count;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 56) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 57)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 58) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 59) * testmode_show() - debugfs: show usb test mode state
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 60) * @s: The seq file to write to.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 61) * @unused: Unused parameter.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 62) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 63) * This debugfs entry shows which usb test mode is currently enabled.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 64) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 65) static int testmode_show(struct seq_file *s, void *unused)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 66) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 67) struct dwc2_hsotg *hsotg = s->private;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 68) unsigned long flags;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 69) int dctl;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 70)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 71) spin_lock_irqsave(&hsotg->lock, flags);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 72) dctl = dwc2_readl(hsotg, DCTL);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 73) dctl &= DCTL_TSTCTL_MASK;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 74) dctl >>= DCTL_TSTCTL_SHIFT;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 75) spin_unlock_irqrestore(&hsotg->lock, flags);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 76)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 77) switch (dctl) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 78) case 0:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 79) seq_puts(s, "no test\n");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 80) break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 81) case USB_TEST_J:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 82) seq_puts(s, "test_j\n");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 83) break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 84) case USB_TEST_K:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 85) seq_puts(s, "test_k\n");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 86) break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 87) case USB_TEST_SE0_NAK:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 88) seq_puts(s, "test_se0_nak\n");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 89) break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 90) case USB_TEST_PACKET:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 91) seq_puts(s, "test_packet\n");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 92) break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 93) case USB_TEST_FORCE_ENABLE:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 94) seq_puts(s, "test_force_enable\n");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 95) break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 96) default:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 97) seq_printf(s, "UNKNOWN %d\n", dctl);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 98) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 99)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 100) return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 101) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 102)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 103) static int testmode_open(struct inode *inode, struct file *file)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 104) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 105) return single_open(file, testmode_show, inode->i_private);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 106) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 107)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 108) static const struct file_operations testmode_fops = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 109) .owner = THIS_MODULE,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 110) .open = testmode_open,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 111) .write = testmode_write,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 112) .read = seq_read,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 113) .llseek = seq_lseek,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 114) .release = single_release,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 115) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 116)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 117) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 118) * state_show - debugfs: show overall driver and device state.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 119) * @seq: The seq file to write to.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 120) * @v: Unused parameter.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 121) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 122) * This debugfs entry shows the overall state of the hardware and
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 123) * some general information about each of the endpoints available
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 124) * to the system.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 125) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 126) static int state_show(struct seq_file *seq, void *v)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 127) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 128) struct dwc2_hsotg *hsotg = seq->private;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 129) int idx;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 130)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 131) seq_printf(seq, "DCFG=0x%08x, DCTL=0x%08x, DSTS=0x%08x\n",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 132) dwc2_readl(hsotg, DCFG),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 133) dwc2_readl(hsotg, DCTL),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 134) dwc2_readl(hsotg, DSTS));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 135)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 136) seq_printf(seq, "DIEPMSK=0x%08x, DOEPMASK=0x%08x\n",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 137) dwc2_readl(hsotg, DIEPMSK), dwc2_readl(hsotg, DOEPMSK));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 138)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 139) seq_printf(seq, "GINTMSK=0x%08x, GINTSTS=0x%08x\n",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 140) dwc2_readl(hsotg, GINTMSK),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 141) dwc2_readl(hsotg, GINTSTS));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 142)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 143) seq_printf(seq, "DAINTMSK=0x%08x, DAINT=0x%08x\n",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 144) dwc2_readl(hsotg, DAINTMSK),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 145) dwc2_readl(hsotg, DAINT));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 146)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 147) seq_printf(seq, "GNPTXSTS=0x%08x, GRXSTSR=%08x\n",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 148) dwc2_readl(hsotg, GNPTXSTS),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 149) dwc2_readl(hsotg, GRXSTSR));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 150)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 151) seq_puts(seq, "\nEndpoint status:\n");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 152)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 153) for (idx = 0; idx < hsotg->num_of_eps; idx++) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 154) u32 in, out;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 155)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 156) in = dwc2_readl(hsotg, DIEPCTL(idx));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 157) out = dwc2_readl(hsotg, DOEPCTL(idx));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 158)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 159) seq_printf(seq, "ep%d: DIEPCTL=0x%08x, DOEPCTL=0x%08x",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 160) idx, in, out);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 161)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 162) in = dwc2_readl(hsotg, DIEPTSIZ(idx));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 163) out = dwc2_readl(hsotg, DOEPTSIZ(idx));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 164)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 165) seq_printf(seq, ", DIEPTSIZ=0x%08x, DOEPTSIZ=0x%08x",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 166) in, out);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 167)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 168) seq_puts(seq, "\n");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 169) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 170)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 171) return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 172) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 173) DEFINE_SHOW_ATTRIBUTE(state);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 174)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 175) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 176) * fifo_show - debugfs: show the fifo information
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 177) * @seq: The seq_file to write data to.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 178) * @v: Unused parameter.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 179) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 180) * Show the FIFO information for the overall fifo and all the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 181) * periodic transmission FIFOs.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 182) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 183) static int fifo_show(struct seq_file *seq, void *v)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 184) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 185) struct dwc2_hsotg *hsotg = seq->private;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 186) int fifo_count = dwc2_hsotg_tx_fifo_count(hsotg);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 187) u32 val;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 188) int idx;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 189)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 190) seq_puts(seq, "Non-periodic FIFOs:\n");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 191) seq_printf(seq, "RXFIFO: Size %d\n", dwc2_readl(hsotg, GRXFSIZ));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 192)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 193) val = dwc2_readl(hsotg, GNPTXFSIZ);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 194) seq_printf(seq, "NPTXFIFO: Size %d, Start 0x%08x\n",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 195) val >> FIFOSIZE_DEPTH_SHIFT,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 196) val & FIFOSIZE_STARTADDR_MASK);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 197)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 198) seq_puts(seq, "\nPeriodic TXFIFOs:\n");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 199)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 200) for (idx = 1; idx <= fifo_count; idx++) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 201) val = dwc2_readl(hsotg, DPTXFSIZN(idx));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 202)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 203) seq_printf(seq, "\tDPTXFIFO%2d: Size %d, Start 0x%08x\n", idx,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 204) val >> FIFOSIZE_DEPTH_SHIFT,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 205) val & FIFOSIZE_STARTADDR_MASK);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 206) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 207)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 208) return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 209) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 210) DEFINE_SHOW_ATTRIBUTE(fifo);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 211)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 212) static const char *decode_direction(int is_in)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 213) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 214) return is_in ? "in" : "out";
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 215) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 216)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 217) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 218) * ep_show - debugfs: show the state of an endpoint.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 219) * @seq: The seq_file to write data to.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 220) * @v: Unused parameter.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 221) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 222) * This debugfs entry shows the state of the given endpoint (one is
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 223) * registered for each available).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 224) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 225) static int ep_show(struct seq_file *seq, void *v)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 226) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 227) struct dwc2_hsotg_ep *ep = seq->private;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 228) struct dwc2_hsotg *hsotg = ep->parent;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 229) struct dwc2_hsotg_req *req;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 230) int index = ep->index;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 231) int show_limit = 15;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 232) unsigned long flags;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 233)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 234) seq_printf(seq, "Endpoint index %d, named %s, dir %s:\n",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 235) ep->index, ep->ep.name, decode_direction(ep->dir_in));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 236)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 237) /* first show the register state */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 238)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 239) seq_printf(seq, "\tDIEPCTL=0x%08x, DOEPCTL=0x%08x\n",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 240) dwc2_readl(hsotg, DIEPCTL(index)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 241) dwc2_readl(hsotg, DOEPCTL(index)));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 242)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 243) seq_printf(seq, "\tDIEPDMA=0x%08x, DOEPDMA=0x%08x\n",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 244) dwc2_readl(hsotg, DIEPDMA(index)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 245) dwc2_readl(hsotg, DOEPDMA(index)));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 246)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 247) seq_printf(seq, "\tDIEPINT=0x%08x, DOEPINT=0x%08x\n",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 248) dwc2_readl(hsotg, DIEPINT(index)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 249) dwc2_readl(hsotg, DOEPINT(index)));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 250)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 251) seq_printf(seq, "\tDIEPTSIZ=0x%08x, DOEPTSIZ=0x%08x\n",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 252) dwc2_readl(hsotg, DIEPTSIZ(index)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 253) dwc2_readl(hsotg, DOEPTSIZ(index)));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 254)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 255) seq_puts(seq, "\n");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 256) seq_printf(seq, "mps %d\n", ep->ep.maxpacket);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 257) seq_printf(seq, "total_data=%ld\n", ep->total_data);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 258)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 259) seq_printf(seq, "request list (%p,%p):\n",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 260) ep->queue.next, ep->queue.prev);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 261)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 262) spin_lock_irqsave(&hsotg->lock, flags);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 263)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 264) list_for_each_entry(req, &ep->queue, queue) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 265) if (--show_limit < 0) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 266) seq_puts(seq, "not showing more requests...\n");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 267) break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 268) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 269)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 270) seq_printf(seq, "%c req %p: %d bytes @%p, ",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 271) req == ep->req ? '*' : ' ',
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 272) req, req->req.length, req->req.buf);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 273) seq_printf(seq, "%d done, res %d\n",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 274) req->req.actual, req->req.status);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 275) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 276)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 277) spin_unlock_irqrestore(&hsotg->lock, flags);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 278)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 279) return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 280) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 281) DEFINE_SHOW_ATTRIBUTE(ep);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 282)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 283) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 284) * dwc2_hsotg_create_debug - create debugfs directory and files
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 285) * @hsotg: The driver state
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 286) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 287) * Create the debugfs files to allow the user to get information
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 288) * about the state of the system. The directory name is created
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 289) * with the same name as the device itself, in case we end up
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 290) * with multiple blocks in future systems.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 291) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 292) static void dwc2_hsotg_create_debug(struct dwc2_hsotg *hsotg)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 293) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 294) struct dentry *root;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 295) unsigned int epidx;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 296)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 297) root = hsotg->debug_root;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 298)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 299) /* create general state file */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 300) debugfs_create_file("state", 0444, root, hsotg, &state_fops);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 301) debugfs_create_file("testmode", 0644, root, hsotg, &testmode_fops);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 302) debugfs_create_file("fifo", 0444, root, hsotg, &fifo_fops);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 303)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 304) /* Create one file for each out endpoint */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 305) for (epidx = 0; epidx < hsotg->num_of_eps; epidx++) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 306) struct dwc2_hsotg_ep *ep;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 307)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 308) ep = hsotg->eps_out[epidx];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 309) if (ep)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 310) debugfs_create_file(ep->name, 0444, root, ep, &ep_fops);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 311) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 312) /* Create one file for each in endpoint. EP0 is handled with out eps */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 313) for (epidx = 1; epidx < hsotg->num_of_eps; epidx++) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 314) struct dwc2_hsotg_ep *ep;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 315)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 316) ep = hsotg->eps_in[epidx];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 317) if (ep)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 318) debugfs_create_file(ep->name, 0444, root, ep, &ep_fops);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 319) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 320) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 321) #else
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 322) static inline void dwc2_hsotg_create_debug(struct dwc2_hsotg *hsotg) {}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 323) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 324)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 325) /* dwc2_hsotg_delete_debug is removed as cleanup in done in dwc2_debugfs_exit */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 326)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 327) #define dump_register(nm) \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 328) { \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 329) .name = #nm, \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 330) .offset = nm, \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 331) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 332)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 333) static const struct debugfs_reg32 dwc2_regs[] = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 334) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 335) * Accessing registers like this can trigger mode mismatch interrupt.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 336) * However, according to dwc2 databook, the register access, in this
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 337) * case, is completed on the processor bus but is ignored by the core
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 338) * and does not affect its operation.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 339) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 340) dump_register(GOTGCTL),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 341) dump_register(GOTGINT),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 342) dump_register(GAHBCFG),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 343) dump_register(GUSBCFG),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 344) dump_register(GRSTCTL),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 345) dump_register(GINTSTS),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 346) dump_register(GINTMSK),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 347) dump_register(GRXSTSR),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 348) /* Omit GRXSTSP */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 349) dump_register(GRXFSIZ),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 350) dump_register(GNPTXFSIZ),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 351) dump_register(GNPTXSTS),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 352) dump_register(GI2CCTL),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 353) dump_register(GPVNDCTL),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 354) dump_register(GGPIO),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 355) dump_register(GUID),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 356) dump_register(GSNPSID),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 357) dump_register(GHWCFG1),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 358) dump_register(GHWCFG2),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 359) dump_register(GHWCFG3),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 360) dump_register(GHWCFG4),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 361) dump_register(GLPMCFG),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 362) dump_register(GPWRDN),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 363) dump_register(GDFIFOCFG),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 364) dump_register(ADPCTL),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 365) dump_register(HPTXFSIZ),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 366) dump_register(DPTXFSIZN(1)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 367) dump_register(DPTXFSIZN(2)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 368) dump_register(DPTXFSIZN(3)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 369) dump_register(DPTXFSIZN(4)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 370) dump_register(DPTXFSIZN(5)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 371) dump_register(DPTXFSIZN(6)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 372) dump_register(DPTXFSIZN(7)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 373) dump_register(DPTXFSIZN(8)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 374) dump_register(DPTXFSIZN(9)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 375) dump_register(DPTXFSIZN(10)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 376) dump_register(DPTXFSIZN(11)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 377) dump_register(DPTXFSIZN(12)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 378) dump_register(DPTXFSIZN(13)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 379) dump_register(DPTXFSIZN(14)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 380) dump_register(DPTXFSIZN(15)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 381) dump_register(DCFG),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 382) dump_register(DCTL),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 383) dump_register(DSTS),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 384) dump_register(DIEPMSK),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 385) dump_register(DOEPMSK),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 386) dump_register(DAINT),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 387) dump_register(DAINTMSK),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 388) dump_register(DTKNQR1),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 389) dump_register(DTKNQR2),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 390) dump_register(DTKNQR3),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 391) dump_register(DTKNQR4),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 392) dump_register(DVBUSDIS),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 393) dump_register(DVBUSPULSE),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 394) dump_register(DIEPCTL(0)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 395) dump_register(DIEPCTL(1)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 396) dump_register(DIEPCTL(2)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 397) dump_register(DIEPCTL(3)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 398) dump_register(DIEPCTL(4)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 399) dump_register(DIEPCTL(5)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 400) dump_register(DIEPCTL(6)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 401) dump_register(DIEPCTL(7)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 402) dump_register(DIEPCTL(8)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 403) dump_register(DIEPCTL(9)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 404) dump_register(DIEPCTL(10)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 405) dump_register(DIEPCTL(11)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 406) dump_register(DIEPCTL(12)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 407) dump_register(DIEPCTL(13)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 408) dump_register(DIEPCTL(14)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 409) dump_register(DIEPCTL(15)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 410) dump_register(DOEPCTL(0)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 411) dump_register(DOEPCTL(1)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 412) dump_register(DOEPCTL(2)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 413) dump_register(DOEPCTL(3)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 414) dump_register(DOEPCTL(4)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 415) dump_register(DOEPCTL(5)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 416) dump_register(DOEPCTL(6)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 417) dump_register(DOEPCTL(7)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 418) dump_register(DOEPCTL(8)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 419) dump_register(DOEPCTL(9)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 420) dump_register(DOEPCTL(10)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 421) dump_register(DOEPCTL(11)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 422) dump_register(DOEPCTL(12)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 423) dump_register(DOEPCTL(13)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 424) dump_register(DOEPCTL(14)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 425) dump_register(DOEPCTL(15)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 426) dump_register(DIEPINT(0)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 427) dump_register(DIEPINT(1)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 428) dump_register(DIEPINT(2)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 429) dump_register(DIEPINT(3)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 430) dump_register(DIEPINT(4)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 431) dump_register(DIEPINT(5)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 432) dump_register(DIEPINT(6)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 433) dump_register(DIEPINT(7)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 434) dump_register(DIEPINT(8)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 435) dump_register(DIEPINT(9)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 436) dump_register(DIEPINT(10)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 437) dump_register(DIEPINT(11)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 438) dump_register(DIEPINT(12)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 439) dump_register(DIEPINT(13)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 440) dump_register(DIEPINT(14)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 441) dump_register(DIEPINT(15)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 442) dump_register(DOEPINT(0)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 443) dump_register(DOEPINT(1)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 444) dump_register(DOEPINT(2)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 445) dump_register(DOEPINT(3)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 446) dump_register(DOEPINT(4)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 447) dump_register(DOEPINT(5)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 448) dump_register(DOEPINT(6)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 449) dump_register(DOEPINT(7)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 450) dump_register(DOEPINT(8)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 451) dump_register(DOEPINT(9)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 452) dump_register(DOEPINT(10)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 453) dump_register(DOEPINT(11)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 454) dump_register(DOEPINT(12)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 455) dump_register(DOEPINT(13)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 456) dump_register(DOEPINT(14)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 457) dump_register(DOEPINT(15)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 458) dump_register(DIEPTSIZ(0)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 459) dump_register(DIEPTSIZ(1)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 460) dump_register(DIEPTSIZ(2)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 461) dump_register(DIEPTSIZ(3)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 462) dump_register(DIEPTSIZ(4)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 463) dump_register(DIEPTSIZ(5)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 464) dump_register(DIEPTSIZ(6)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 465) dump_register(DIEPTSIZ(7)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 466) dump_register(DIEPTSIZ(8)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 467) dump_register(DIEPTSIZ(9)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 468) dump_register(DIEPTSIZ(10)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 469) dump_register(DIEPTSIZ(11)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 470) dump_register(DIEPTSIZ(12)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 471) dump_register(DIEPTSIZ(13)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 472) dump_register(DIEPTSIZ(14)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 473) dump_register(DIEPTSIZ(15)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 474) dump_register(DOEPTSIZ(0)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 475) dump_register(DOEPTSIZ(1)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 476) dump_register(DOEPTSIZ(2)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 477) dump_register(DOEPTSIZ(3)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 478) dump_register(DOEPTSIZ(4)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 479) dump_register(DOEPTSIZ(5)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 480) dump_register(DOEPTSIZ(6)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 481) dump_register(DOEPTSIZ(7)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 482) dump_register(DOEPTSIZ(8)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 483) dump_register(DOEPTSIZ(9)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 484) dump_register(DOEPTSIZ(10)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 485) dump_register(DOEPTSIZ(11)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 486) dump_register(DOEPTSIZ(12)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 487) dump_register(DOEPTSIZ(13)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 488) dump_register(DOEPTSIZ(14)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 489) dump_register(DOEPTSIZ(15)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 490) dump_register(DIEPDMA(0)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 491) dump_register(DIEPDMA(1)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 492) dump_register(DIEPDMA(2)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 493) dump_register(DIEPDMA(3)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 494) dump_register(DIEPDMA(4)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 495) dump_register(DIEPDMA(5)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 496) dump_register(DIEPDMA(6)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 497) dump_register(DIEPDMA(7)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 498) dump_register(DIEPDMA(8)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 499) dump_register(DIEPDMA(9)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 500) dump_register(DIEPDMA(10)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 501) dump_register(DIEPDMA(11)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 502) dump_register(DIEPDMA(12)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 503) dump_register(DIEPDMA(13)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 504) dump_register(DIEPDMA(14)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 505) dump_register(DIEPDMA(15)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 506) dump_register(DOEPDMA(0)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 507) dump_register(DOEPDMA(1)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 508) dump_register(DOEPDMA(2)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 509) dump_register(DOEPDMA(3)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 510) dump_register(DOEPDMA(4)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 511) dump_register(DOEPDMA(5)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 512) dump_register(DOEPDMA(6)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 513) dump_register(DOEPDMA(7)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 514) dump_register(DOEPDMA(8)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 515) dump_register(DOEPDMA(9)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 516) dump_register(DOEPDMA(10)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 517) dump_register(DOEPDMA(11)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 518) dump_register(DOEPDMA(12)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 519) dump_register(DOEPDMA(13)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 520) dump_register(DOEPDMA(14)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 521) dump_register(DOEPDMA(15)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 522) dump_register(DTXFSTS(0)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 523) dump_register(DTXFSTS(1)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 524) dump_register(DTXFSTS(2)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 525) dump_register(DTXFSTS(3)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 526) dump_register(DTXFSTS(4)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 527) dump_register(DTXFSTS(5)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 528) dump_register(DTXFSTS(6)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 529) dump_register(DTXFSTS(7)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 530) dump_register(DTXFSTS(8)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 531) dump_register(DTXFSTS(9)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 532) dump_register(DTXFSTS(10)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 533) dump_register(DTXFSTS(11)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 534) dump_register(DTXFSTS(12)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 535) dump_register(DTXFSTS(13)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 536) dump_register(DTXFSTS(14)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 537) dump_register(DTXFSTS(15)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 538) dump_register(PCGCTL),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 539) dump_register(HCFG),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 540) dump_register(HFIR),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 541) dump_register(HFNUM),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 542) dump_register(HPTXSTS),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 543) dump_register(HAINT),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 544) dump_register(HAINTMSK),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 545) dump_register(HFLBADDR),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 546) dump_register(HPRT0),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 547) dump_register(HCCHAR(0)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 548) dump_register(HCCHAR(1)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 549) dump_register(HCCHAR(2)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 550) dump_register(HCCHAR(3)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 551) dump_register(HCCHAR(4)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 552) dump_register(HCCHAR(5)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 553) dump_register(HCCHAR(6)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 554) dump_register(HCCHAR(7)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 555) dump_register(HCCHAR(8)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 556) dump_register(HCCHAR(9)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 557) dump_register(HCCHAR(10)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 558) dump_register(HCCHAR(11)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 559) dump_register(HCCHAR(12)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 560) dump_register(HCCHAR(13)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 561) dump_register(HCCHAR(14)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 562) dump_register(HCCHAR(15)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 563) dump_register(HCSPLT(0)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 564) dump_register(HCSPLT(1)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 565) dump_register(HCSPLT(2)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 566) dump_register(HCSPLT(3)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 567) dump_register(HCSPLT(4)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 568) dump_register(HCSPLT(5)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 569) dump_register(HCSPLT(6)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 570) dump_register(HCSPLT(7)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 571) dump_register(HCSPLT(8)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 572) dump_register(HCSPLT(9)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 573) dump_register(HCSPLT(10)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 574) dump_register(HCSPLT(11)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 575) dump_register(HCSPLT(12)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 576) dump_register(HCSPLT(13)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 577) dump_register(HCSPLT(14)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 578) dump_register(HCSPLT(15)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 579) dump_register(HCINT(0)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 580) dump_register(HCINT(1)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 581) dump_register(HCINT(2)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 582) dump_register(HCINT(3)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 583) dump_register(HCINT(4)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 584) dump_register(HCINT(5)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 585) dump_register(HCINT(6)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 586) dump_register(HCINT(7)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 587) dump_register(HCINT(8)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 588) dump_register(HCINT(9)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 589) dump_register(HCINT(10)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 590) dump_register(HCINT(11)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 591) dump_register(HCINT(12)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 592) dump_register(HCINT(13)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 593) dump_register(HCINT(14)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 594) dump_register(HCINT(15)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 595) dump_register(HCINTMSK(0)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 596) dump_register(HCINTMSK(1)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 597) dump_register(HCINTMSK(2)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 598) dump_register(HCINTMSK(3)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 599) dump_register(HCINTMSK(4)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 600) dump_register(HCINTMSK(5)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 601) dump_register(HCINTMSK(6)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 602) dump_register(HCINTMSK(7)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 603) dump_register(HCINTMSK(8)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 604) dump_register(HCINTMSK(9)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 605) dump_register(HCINTMSK(10)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 606) dump_register(HCINTMSK(11)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 607) dump_register(HCINTMSK(12)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 608) dump_register(HCINTMSK(13)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 609) dump_register(HCINTMSK(14)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 610) dump_register(HCINTMSK(15)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 611) dump_register(HCTSIZ(0)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 612) dump_register(HCTSIZ(1)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 613) dump_register(HCTSIZ(2)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 614) dump_register(HCTSIZ(3)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 615) dump_register(HCTSIZ(4)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 616) dump_register(HCTSIZ(5)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 617) dump_register(HCTSIZ(6)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 618) dump_register(HCTSIZ(7)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 619) dump_register(HCTSIZ(8)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 620) dump_register(HCTSIZ(9)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 621) dump_register(HCTSIZ(10)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 622) dump_register(HCTSIZ(11)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 623) dump_register(HCTSIZ(12)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 624) dump_register(HCTSIZ(13)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 625) dump_register(HCTSIZ(14)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 626) dump_register(HCTSIZ(15)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 627) dump_register(HCDMA(0)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 628) dump_register(HCDMA(1)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 629) dump_register(HCDMA(2)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 630) dump_register(HCDMA(3)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 631) dump_register(HCDMA(4)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 632) dump_register(HCDMA(5)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 633) dump_register(HCDMA(6)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 634) dump_register(HCDMA(7)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 635) dump_register(HCDMA(8)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 636) dump_register(HCDMA(9)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 637) dump_register(HCDMA(10)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 638) dump_register(HCDMA(11)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 639) dump_register(HCDMA(12)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 640) dump_register(HCDMA(13)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 641) dump_register(HCDMA(14)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 642) dump_register(HCDMA(15)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 643) dump_register(HCDMAB(0)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 644) dump_register(HCDMAB(1)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 645) dump_register(HCDMAB(2)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 646) dump_register(HCDMAB(3)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 647) dump_register(HCDMAB(4)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 648) dump_register(HCDMAB(5)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 649) dump_register(HCDMAB(6)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 650) dump_register(HCDMAB(7)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 651) dump_register(HCDMAB(8)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 652) dump_register(HCDMAB(9)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 653) dump_register(HCDMAB(10)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 654) dump_register(HCDMAB(11)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 655) dump_register(HCDMAB(12)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 656) dump_register(HCDMAB(13)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 657) dump_register(HCDMAB(14)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 658) dump_register(HCDMAB(15)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 659) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 660)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 661) #define print_param(_seq, _ptr, _param) \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 662) seq_printf((_seq), "%-30s: %d\n", #_param, (_ptr)->_param)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 663)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 664) #define print_param_hex(_seq, _ptr, _param) \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 665) seq_printf((_seq), "%-30s: 0x%x\n", #_param, (_ptr)->_param)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 666)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 667) static int params_show(struct seq_file *seq, void *v)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 668) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 669) struct dwc2_hsotg *hsotg = seq->private;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 670) struct dwc2_core_params *p = &hsotg->params;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 671) int i;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 672)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 673) print_param(seq, p, otg_cap);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 674) print_param(seq, p, dma_desc_enable);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 675) print_param(seq, p, dma_desc_fs_enable);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 676) print_param(seq, p, speed);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 677) print_param(seq, p, enable_dynamic_fifo);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 678) print_param(seq, p, en_multiple_tx_fifo);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 679) print_param(seq, p, host_rx_fifo_size);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 680) print_param(seq, p, host_nperio_tx_fifo_size);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 681) print_param(seq, p, host_perio_tx_fifo_size);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 682) print_param(seq, p, max_transfer_size);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 683) print_param(seq, p, max_packet_count);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 684) print_param(seq, p, host_channels);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 685) print_param(seq, p, phy_type);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 686) print_param(seq, p, phy_utmi_width);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 687) print_param(seq, p, phy_ulpi_ddr);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 688) print_param(seq, p, phy_ulpi_ext_vbus);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 689) print_param(seq, p, i2c_enable);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 690) print_param(seq, p, ipg_isoc_en);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 691) print_param(seq, p, ulpi_fs_ls);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 692) print_param(seq, p, host_support_fs_ls_low_power);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 693) print_param(seq, p, host_ls_low_power_phy_clk);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 694) print_param(seq, p, ts_dline);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 695) print_param(seq, p, reload_ctl);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 696) print_param_hex(seq, p, ahbcfg);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 697) print_param(seq, p, uframe_sched);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 698) print_param(seq, p, external_id_pin_ctl);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 699) print_param(seq, p, power_down);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 700) print_param(seq, p, lpm);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 701) print_param(seq, p, lpm_clock_gating);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 702) print_param(seq, p, besl);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 703) print_param(seq, p, hird_threshold_en);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 704) print_param(seq, p, hird_threshold);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 705) print_param(seq, p, service_interval);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 706) print_param(seq, p, host_dma);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 707) print_param(seq, p, g_dma);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 708) print_param(seq, p, g_dma_desc);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 709) print_param(seq, p, g_rx_fifo_size);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 710) print_param(seq, p, g_np_tx_fifo_size);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 711)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 712) for (i = 0; i < MAX_EPS_CHANNELS; i++) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 713) char str[32];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 714)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 715) snprintf(str, 32, "g_tx_fifo_size[%d]", i);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 716) seq_printf(seq, "%-30s: %d\n", str, p->g_tx_fifo_size[i]);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 717) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 718)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 719) return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 720) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 721) DEFINE_SHOW_ATTRIBUTE(params);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 722)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 723) static int hw_params_show(struct seq_file *seq, void *v)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 724) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 725) struct dwc2_hsotg *hsotg = seq->private;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 726) struct dwc2_hw_params *hw = &hsotg->hw_params;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 727)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 728) print_param(seq, hw, op_mode);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 729) print_param(seq, hw, arch);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 730) print_param(seq, hw, dma_desc_enable);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 731) print_param(seq, hw, enable_dynamic_fifo);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 732) print_param(seq, hw, en_multiple_tx_fifo);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 733) print_param(seq, hw, rx_fifo_size);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 734) print_param(seq, hw, host_nperio_tx_fifo_size);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 735) print_param(seq, hw, dev_nperio_tx_fifo_size);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 736) print_param(seq, hw, host_perio_tx_fifo_size);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 737) print_param(seq, hw, nperio_tx_q_depth);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 738) print_param(seq, hw, host_perio_tx_q_depth);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 739) print_param(seq, hw, dev_token_q_depth);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 740) print_param(seq, hw, max_transfer_size);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 741) print_param(seq, hw, max_packet_count);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 742) print_param(seq, hw, host_channels);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 743) print_param(seq, hw, hs_phy_type);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 744) print_param(seq, hw, fs_phy_type);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 745) print_param(seq, hw, i2c_enable);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 746) print_param(seq, hw, num_dev_ep);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 747) print_param(seq, hw, num_dev_perio_in_ep);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 748) print_param(seq, hw, total_fifo_size);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 749) print_param(seq, hw, power_optimized);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 750) print_param(seq, hw, utmi_phy_data_width);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 751) print_param_hex(seq, hw, snpsid);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 752) print_param_hex(seq, hw, dev_ep_dirs);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 753)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 754) return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 755) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 756) DEFINE_SHOW_ATTRIBUTE(hw_params);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 757)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 758) static int dr_mode_show(struct seq_file *seq, void *v)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 759) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 760) struct dwc2_hsotg *hsotg = seq->private;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 761) const char *dr_mode = "";
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 762)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 763) device_property_read_string(hsotg->dev, "dr_mode", &dr_mode);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 764) seq_printf(seq, "%s\n", dr_mode);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 765) return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 766) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 767) DEFINE_SHOW_ATTRIBUTE(dr_mode);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 768)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 769) int dwc2_debugfs_init(struct dwc2_hsotg *hsotg)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 770) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 771) int ret;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 772) struct dentry *root;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 773)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 774) root = debugfs_create_dir(dev_name(hsotg->dev), usb_debug_root);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 775) hsotg->debug_root = root;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 776)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 777) debugfs_create_file("params", 0444, root, hsotg, ¶ms_fops);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 778) debugfs_create_file("hw_params", 0444, root, hsotg, &hw_params_fops);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 779) debugfs_create_file("dr_mode", 0444, root, hsotg, &dr_mode_fops);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 780)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 781) /* Add gadget debugfs nodes */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 782) dwc2_hsotg_create_debug(hsotg);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 783)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 784) hsotg->regset = devm_kzalloc(hsotg->dev, sizeof(*hsotg->regset),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 785) GFP_KERNEL);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 786) if (!hsotg->regset) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 787) ret = -ENOMEM;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 788) goto err;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 789) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 790)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 791) hsotg->regset->regs = dwc2_regs;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 792) hsotg->regset->nregs = ARRAY_SIZE(dwc2_regs);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 793) hsotg->regset->base = hsotg->regs;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 794)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 795) debugfs_create_regset32("regdump", 0444, root, hsotg->regset);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 796)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 797) return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 798) err:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 799) debugfs_remove_recursive(hsotg->debug_root);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 800) return ret;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 801) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 802)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 803) void dwc2_debugfs_exit(struct dwc2_hsotg *hsotg)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 804) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 805) debugfs_remove_recursive(hsotg->debug_root);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 806) hsotg->debug_root = NULL;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 807) }