Lines Matching +full:image +full:- +full:processor

1 // SPDX-License-Identifier: GPL-2.0-or-later
12 * This driver programs the PCX-U/PCX-W performance counters
13 * on the PA-RISC 2.0 chips. The driver keeps all images now
15 * of a bad image halting the CPU. Also, there are different
16 * images for the PCX-W and later chips vs the PCX-U chips.
25 * This driver accesses the processor directly vs going through
40 #include <asm/parisc-device.h>
41 #include <asm/processor.h>
62 /* RDRs to write for PCX-W */
64 { 0, 1, 4, 5, 6, 15, 16, 17, 18, 20, 21, 22, 23, 24, 25, -1 };
66 /* RDRs to write for PCX-U */
68 { 0, 1, 4, 5, 6, 7, 16, 17, 18, 20, 21, 22, 23, 24, 25, -1 };
70 /* RDR register descriptions for PCX-W */
106 /* RDR register descriptions for PCX-U */
143 * A non-zero write_control in the above tables is a byte offset into
150 0x00fffffffffffffful, /* RDR20-RDR21 bitmask (152 bits) */
153 0xfffffffffffffffful, /* RDR22-RDR23 bitmask (233 bits) */
160 * Write control bitmasks for Pa-8700 processor given
167 0x00fffffffffffffful, /* RDR20-RDR21 bitmask (158 bits) */
170 0xfffffffffffffffful, /* RDR22-RDR23 bitmask (210 bits) */
212 * Configure the cpu with a given data image. First turn off the counters,
213 * then download the image, then turn the counters back on.
224 return -EINVAL; in perf_config()
227 printk("Preparing to write image\n"); in perf_config()
228 /* Write the image to the chip */ in perf_config()
232 return -EINVAL; in perf_config()
253 return -EBUSY; in perf_open()
284 * This routine downloads the image to the chip. It must be
285 * called on the processor that the download should happen
301 return -EFAULT; in perf_write()
304 return -EACCES; in perf_write()
307 return -EIO; in perf_write()
310 return -EFAULT; in perf_write()
319 the requested image */ in perf_write()
324 return -EINVAL; in perf_write()
326 /* Next check to make sure the requested image in perf_write()
332 return -EINVAL; in perf_write()
334 /* Copy the image into the processor */ in perf_write()
350 * NOTE: this routine is VERY specific to the current TLB image. in perf_patch_images()
351 * If the image is changed, this routine might also need to be changed. in perf_patch_images()
358 * We can only use the lower 32-bits, the upper 32-bits should be 0 in perf_patch_images()
423 * All routines effect the processor that they are executed on. Thus you
424 * must be running on the processor that you wish to change.
444 error = -EFAULT; in perf_ioctl()
451 error = -EFAULT; in perf_ioctl()
462 error = -ENOTTY; in perf_ioctl()
490 /* Determine correct processor interface to use */ in perf_init()
508 printk("Performance monitoring counters not supported on this processor\n"); in perf_init()
509 return -ENODEV; in perf_init()
525 per_cpu(cpu_data, 0).dev->name); in perf_init()
561 return -13; in perf_stop_counters()
594 * The counters and sticky-bits comprise the last 132 bits in perf_stop_counters()
595 * (1398 - 1529) of RDR16 on a U chip. We'll zero these in perf_stop_counters()
605 * Write back the zeroed bytes + the image given in perf_stop_counters()
612 * Read RDR-15 which contains the counters and sticky bits in perf_stop_counters()
615 return -13; in perf_stop_counters()
662 if ((width = tentry->width) == 0) in perf_rdr_read_ubuf()
666 i = tentry->num_words; in perf_rdr_read_ubuf()
667 while (i--) { in perf_rdr_read_ubuf()
674 data_mask <<= (64 - xbits); in perf_rdr_read_ubuf()
675 data_mask--; in perf_rdr_read_ubuf()
679 i = tentry->num_words; in perf_rdr_read_ubuf()
680 while (i--) { in perf_rdr_read_ubuf()
688 buffer[i] |= (data << (64 - xbits)); in perf_rdr_read_ubuf()
690 buffer[i-1] |= ((data >> xbits) & data_mask); in perf_rdr_read_ubuf()
712 if (tentry->width == 0) { in perf_rdr_clear()
713 return -1; in perf_rdr_clear()
716 i = tentry->num_words; in perf_rdr_clear()
717 while (i--) { in perf_rdr_clear()
732 * Write the given image out to the processor
762 while (*intrigue_rdr != -1) { in perf_write_image()
766 dwords = tentry->num_words; in perf_write_image()
767 if (tentry->write_control) { in perf_write_image()
768 intrigue_bitmask = &bitmask_array[tentry->write_control >> 3]; in perf_write_image()
769 while (dwords--) { in perf_write_image()
775 while (dwords--) { in perf_write_image()
791 return -1; in perf_write_image()
794 runway = ioremap(cpu_device->hpa.start, 4096); in perf_write_image()
797 return -ENOMEM; in perf_write_image()
826 if (tentry->width == 0) { return; } in perf_rdr_write()
828 i = tentry->num_words; in perf_rdr_write()
829 while (i--) { in perf_rdr_write()