Lines Matching +full:com +full:- +full:seq
1 // SPDX-License-Identifier: GPL-2.0-only
8 * Ohad Ben-Cohen <ohad@wizery.com>
9 * Mark Grosen <mgrosen@ti.com>
10 * Brian Swetland <swetland@google.com>
11 * Fernando Guzman Lugo <fernando.lugo@ti.com>
12 * Suman Anna <s-anna@ti.com>
13 * Robert Tivy <rtivy@ti.com>
14 * Armando Uribe De Leon <x0095078@ti.com>
31 * A coredump-configuration-to-string lookup table, for exposing a
45 struct rproc *rproc = filp->private_data; in rproc_coredump_read()
50 rproc_coredump_str[rproc->dump_conf]); in rproc_coredump_read()
75 struct rproc *rproc = filp->private_data; in rproc_coredump_write()
80 return -EINVAL; in rproc_coredump_write()
84 return -EFAULT; in rproc_coredump_write()
87 if (buf[count - 1] == '\n') in rproc_coredump_write()
88 buf[count - 1] = '\0'; in rproc_coredump_write()
90 if (rproc->state == RPROC_CRASHED) { in rproc_coredump_write()
91 dev_err(&rproc->dev, "can't change coredump configuration\n"); in rproc_coredump_write()
92 err = -EBUSY; in rproc_coredump_write()
97 rproc->dump_conf = RPROC_COREDUMP_DISABLED; in rproc_coredump_write()
99 rproc->dump_conf = RPROC_COREDUMP_ENABLED; in rproc_coredump_write()
101 rproc->dump_conf = RPROC_COREDUMP_INLINE; in rproc_coredump_write()
103 dev_err(&rproc->dev, "Invalid coredump configuration\n"); in rproc_coredump_write()
104 err = -EINVAL; in rproc_coredump_write()
129 struct rproc_debug_trace *data = filp->private_data; in rproc_trace_read()
130 struct rproc_mem_entry *trace = &data->trace_mem; in rproc_trace_read()
135 va = rproc_da_to_va(data->rproc, trace->da, trace->len, NULL); in rproc_trace_read()
139 trace->name); in rproc_trace_read()
142 len = strnlen(va, trace->len); in rproc_trace_read()
158 struct rproc *rproc = filp->private_data; in rproc_name_read()
163 i = scnprintf(buf, sizeof(buf), "%.98s\n", rproc->name); in rproc_name_read()
178 struct rproc *rproc = filp->private_data; in rproc_recovery_read()
179 char *buf = rproc->recovery_disabled ? "disabled\n" : "enabled\n"; in rproc_recovery_read()
212 struct rproc *rproc = filp->private_data; in rproc_recovery_write()
217 return -EINVAL; in rproc_recovery_write()
221 return -EFAULT; in rproc_recovery_write()
224 if (buf[count - 1] == '\n') in rproc_recovery_write()
225 buf[count - 1] = '\0'; in rproc_recovery_write()
229 rproc->recovery_disabled = false; in rproc_recovery_write()
232 rproc->recovery_disabled = true; in rproc_recovery_write()
237 return -EINVAL; in rproc_recovery_write()
255 struct rproc *rproc = filp->private_data; in rproc_crash_write()
275 static int rproc_rsc_table_show(struct seq_file *seq, void *p) in rproc_rsc_table_show() argument
278 struct rproc *rproc = seq->private; in rproc_rsc_table_show()
279 struct resource_table *table = rproc->table_ptr; in rproc_rsc_table_show()
287 seq_puts(seq, "No resource table found\n"); in rproc_rsc_table_show()
291 for (i = 0; i < table->num; i++) { in rproc_rsc_table_show()
292 int offset = table->offset[i]; in rproc_rsc_table_show()
296 switch (hdr->type) { in rproc_rsc_table_show()
299 seq_printf(seq, "Entry %d is of type %s\n", i, types[hdr->type]); in rproc_rsc_table_show()
300 seq_printf(seq, " Device Address 0x%x\n", c->da); in rproc_rsc_table_show()
301 seq_printf(seq, " Physical Address 0x%x\n", c->pa); in rproc_rsc_table_show()
302 seq_printf(seq, " Length 0x%x Bytes\n", c->len); in rproc_rsc_table_show()
303 seq_printf(seq, " Flags 0x%x\n", c->flags); in rproc_rsc_table_show()
304 seq_printf(seq, " Reserved (should be zero) [%d]\n", c->reserved); in rproc_rsc_table_show()
305 seq_printf(seq, " Name %s\n\n", c->name); in rproc_rsc_table_show()
309 seq_printf(seq, "Entry %d is of type %s\n", i, types[hdr->type]); in rproc_rsc_table_show()
310 seq_printf(seq, " Device Address 0x%x\n", d->da); in rproc_rsc_table_show()
311 seq_printf(seq, " Physical Address 0x%x\n", d->pa); in rproc_rsc_table_show()
312 seq_printf(seq, " Length 0x%x Bytes\n", d->len); in rproc_rsc_table_show()
313 seq_printf(seq, " Flags 0x%x\n", d->flags); in rproc_rsc_table_show()
314 seq_printf(seq, " Reserved (should be zero) [%d]\n", d->reserved); in rproc_rsc_table_show()
315 seq_printf(seq, " Name %s\n\n", d->name); in rproc_rsc_table_show()
319 seq_printf(seq, "Entry %d is of type %s\n", i, types[hdr->type]); in rproc_rsc_table_show()
320 seq_printf(seq, " Device Address 0x%x\n", t->da); in rproc_rsc_table_show()
321 seq_printf(seq, " Length 0x%x Bytes\n", t->len); in rproc_rsc_table_show()
322 seq_printf(seq, " Reserved (should be zero) [%d]\n", t->reserved); in rproc_rsc_table_show()
323 seq_printf(seq, " Name %s\n\n", t->name); in rproc_rsc_table_show()
327 seq_printf(seq, "Entry %d is of type %s\n", i, types[hdr->type]); in rproc_rsc_table_show()
329 seq_printf(seq, " ID %d\n", v->id); in rproc_rsc_table_show()
330 seq_printf(seq, " Notify ID %d\n", v->notifyid); in rproc_rsc_table_show()
331 seq_printf(seq, " Device features 0x%x\n", v->dfeatures); in rproc_rsc_table_show()
332 seq_printf(seq, " Guest features 0x%x\n", v->gfeatures); in rproc_rsc_table_show()
333 seq_printf(seq, " Config length 0x%x\n", v->config_len); in rproc_rsc_table_show()
334 seq_printf(seq, " Status 0x%x\n", v->status); in rproc_rsc_table_show()
335 seq_printf(seq, " Number of vrings %d\n", v->num_of_vrings); in rproc_rsc_table_show()
336 seq_printf(seq, " Reserved (should be zero) [%d][%d]\n\n", in rproc_rsc_table_show()
337 v->reserved[0], v->reserved[1]); in rproc_rsc_table_show()
339 for (j = 0; j < v->num_of_vrings; j++) { in rproc_rsc_table_show()
340 seq_printf(seq, " Vring %d\n", j); in rproc_rsc_table_show()
341 seq_printf(seq, " Device Address 0x%x\n", v->vring[j].da); in rproc_rsc_table_show()
342 seq_printf(seq, " Alignment %d\n", v->vring[j].align); in rproc_rsc_table_show()
343 seq_printf(seq, " Number of buffers %d\n", v->vring[j].num); in rproc_rsc_table_show()
344 seq_printf(seq, " Notify ID %d\n", v->vring[j].notifyid); in rproc_rsc_table_show()
345 seq_printf(seq, " Physical Address 0x%x\n\n", in rproc_rsc_table_show()
346 v->vring[j].pa); in rproc_rsc_table_show()
350 seq_printf(seq, "Unknown resource type found: %d [hdr: %pK]\n", in rproc_rsc_table_show()
351 hdr->type, hdr); in rproc_rsc_table_show()
362 static int rproc_carveouts_show(struct seq_file *seq, void *p) in rproc_carveouts_show() argument
364 struct rproc *rproc = seq->private; in rproc_carveouts_show()
367 list_for_each_entry(carveout, &rproc->carveouts, node) { in rproc_carveouts_show()
368 seq_puts(seq, "Carveout memory entry:\n"); in rproc_carveouts_show()
369 seq_printf(seq, "\tName: %s\n", carveout->name); in rproc_carveouts_show()
370 seq_printf(seq, "\tVirtual address: %pK\n", carveout->va); in rproc_carveouts_show()
371 seq_printf(seq, "\tDMA address: %pad\n", &carveout->dma); in rproc_carveouts_show()
372 seq_printf(seq, "\tDevice address: 0x%x\n", carveout->da); in rproc_carveouts_show()
373 seq_printf(seq, "\tLength: 0x%zx Bytes\n\n", carveout->len); in rproc_carveouts_show()
389 return debugfs_create_file(name, 0400, rproc->dbg_dir, trace, in rproc_create_trace_file()
395 debugfs_remove_recursive(rproc->dbg_dir); in rproc_delete_debug_dir()
400 struct device *dev = &rproc->dev; in rproc_create_debug_dir()
405 rproc->dbg_dir = debugfs_create_dir(dev_name(dev), rproc_dbg); in rproc_create_debug_dir()
407 debugfs_create_file("name", 0400, rproc->dbg_dir, in rproc_create_debug_dir()
409 debugfs_create_file("recovery", 0600, rproc->dbg_dir, in rproc_create_debug_dir()
411 debugfs_create_file("crash", 0200, rproc->dbg_dir, in rproc_create_debug_dir()
413 debugfs_create_file("resource_table", 0400, rproc->dbg_dir, in rproc_create_debug_dir()
415 debugfs_create_file("carveout_memories", 0400, rproc->dbg_dir, in rproc_create_debug_dir()
417 debugfs_create_file("coredump", 0600, rproc->dbg_dir, in rproc_create_debug_dir()