• Home
  • Raw
  • Download

Lines Matching +full:application +full:- +full:notes

1 // SPDX-License-Identifier: GPL-2.0-only
3 * pti.c - PTI driver for cJTAG data extration
27 #include <linux/intel-pti.h>
83 * pti_write_to_aperture()- The private write function to PTI HW.
94 * PTI-Output agent will send these out in the order that they arrived, and
114 aperture = drv_data->pti_ioaddr + (mc->master << 15) in pti_write_to_aperture()
115 + (mc->channel << 8); in pti_write_to_aperture()
118 final = len - (dwordcnt << 2); /* final = trailing bytes */ in pti_write_to_aperture()
121 dwordcnt--; in pti_write_to_aperture()
134 ptiword |= *p++ << (24-(8*i)); in pti_write_to_aperture()
141 * pti_control_frame_built_and_sent()- control frame build and send function.
178 comm[TASK_COMM_LEN-1] = 0; in pti_control_frame_built_and_sent()
187 snprintf(control_frame, CONTROL_FRAME_LEN, control_format, mc->master, in pti_control_frame_built_and_sent()
188 mc->channel, thread_name_p); in pti_control_frame_built_and_sent()
193 * pti_write_full_frame_to_aperture()- high level function to
202 * All threads sending data (either console, user space application, ...)
215 * get_id()- Allocate a master and channel ID.
263 mc->master = base_id; in get_id()
264 mc->channel = ((i & 0xf)<<3) + j; in get_id()
278 * pti_request_masterchannel()- Kernel API function used to allocate
282 * @type: 0- request Application master, channel aperture ID
284 * 1- request OS master, channel aperture ID write
286 * 2- request Modem master, channel aperture ID
306 mc = get_id(drv_data->ia_app, MAX_APP_IDS, in pti_request_masterchannel()
311 mc = get_id(drv_data->ia_os, MAX_OS_IDS, in pti_request_masterchannel()
316 mc = get_id(drv_data->ia_modem, MAX_MODEM_IDS, in pti_request_masterchannel()
329 * pti_release_masterchannel()- Kernel API function used to release
334 * will de-allocate the structure via kfree().
343 master = mc->master; in pti_release_masterchannel()
344 channel = mc->channel; in pti_release_masterchannel()
348 drv_data->ia_app[i] &= ~(0x80>>(channel & 0x7)); in pti_release_masterchannel()
351 drv_data->ia_os[i] &= ~(0x80>>(channel & 0x7)); in pti_release_masterchannel()
354 drv_data->ia_modem[i] &= ~(0x80>>(channel & 0x7)); in pti_release_masterchannel()
365 * pti_writedata()- Kernel API function used to write trace
390 * Specific header comments made for PTI-related specifics.
394 * pti_tty_driver_open()- Open an Application master, channel aperture
422 return tty_port_open(tty->port, tty, filp); in pti_tty_driver_open()
426 * pti_tty_driver_close()- close tty device and release Application
438 tty_port_close(tty->port, tty, filp); in pti_tty_driver_close()
442 * pti_tty_install()- Used to set up specific master-channels
455 int idx = tty->index; in pti_tty_install()
462 return -ENOMEM; in pti_tty_install()
465 pti_tty_data->mc = pti_request_masterchannel(0, NULL); in pti_tty_install()
467 pti_tty_data->mc = pti_request_masterchannel(2, NULL); in pti_tty_install()
469 if (pti_tty_data->mc == NULL) { in pti_tty_install()
471 return -ENXIO; in pti_tty_install()
473 tty->driver_data = pti_tty_data; in pti_tty_install()
480 * pti_tty_cleanup()- Used to de-allocate master-channel resources
487 struct pti_tty *pti_tty_data = tty->driver_data; in pti_tty_cleanup()
490 pti_release_masterchannel(pti_tty_data->mc); in pti_tty_cleanup()
492 tty->driver_data = NULL; in pti_tty_cleanup()
496 * pti_tty_driver_write()- Write trace debugging data through the char
510 struct pti_tty *pti_tty_data = tty->driver_data; in pti_tty_driver_write()
511 if ((pti_tty_data != NULL) && (pti_tty_data->mc != NULL)) { in pti_tty_driver_write()
512 pti_write_to_aperture(pti_tty_data->mc, (u8 *)buf, len); in pti_tty_driver_write()
520 return -EFAULT; in pti_tty_driver_write()
524 * pti_tty_write_room()- Always returns 2048.
534 * pti_char_open()- Open an Application master, channel aperture
538 * @filp: Output- will have a masterchannel struct set containing
539 * the allocated application PTI aperture write address.
552 * before assigning the value to filp->private_data. in pti_char_open()
557 return -ENOMEM; in pti_char_open()
558 filp->private_data = mc; in pti_char_open()
563 * pti_char_release()- Close a char channel to the PTI device. Part
575 pti_release_masterchannel(filp->private_data); in pti_char_release()
576 filp->private_data = NULL; in pti_char_release()
581 * pti_char_write()- Write trace debugging data through the char
594 * Notes: From side discussions with Alan Cox and experimenting
610 mc = filp->private_data; in pti_char_write()
616 return -ENOMEM; in pti_char_write()
620 if (len - n > USER_COPY_SIZE) in pti_char_write()
623 size = len - n; in pti_char_write()
627 return n ? n : -EFAULT; in pti_char_write()
663 * pti_console_write()- Write to the console that has been acquired.
681 * pti_console_device()- Return the driver tty structure and set the
693 *index = c->index; in pti_console_device()
698 * pti_console_setup()- Initialize console variables used by the driver.
733 * pti_port_activate()- Used to start/initialize any items upon
742 * Notes: The primary purpose of the PTI tty port 0 is to hook
748 if (port->tty->index == PTITTY_MINOR_START) in pti_port_activate()
754 * pti_port_shutdown()- Used to stop/shutdown any items upon the
759 * Notes: The primary purpose of the PTI tty port 0 is to hook
765 if (port->tty->index == PTITTY_MINOR_START) in pti_port_shutdown()
780 * pti_pci_probe()- Used to detect pti on the pci bus and set
797 dev_dbg(&pdev->dev, "%s %s(%d): PTI PCI ID %04x:%04x\n", __FILE__, in pti_pci_probe()
798 __func__, __LINE__, pdev->vendor, pdev->device); in pti_pci_probe()
811 dev_err(&pdev->dev, in pti_pci_probe()
819 retval = -ENOMEM; in pti_pci_probe()
820 dev_err(&pdev->dev, in pti_pci_probe()
825 drv_data->pti_addr = pci_resource_start(pdev, pci_bar); in pti_pci_probe()
827 retval = pci_request_region(pdev, pci_bar, dev_name(&pdev->dev)); in pti_pci_probe()
829 dev_err(&pdev->dev, in pti_pci_probe()
834 drv_data->aperture_base = drv_data->pti_addr+APERTURE_14; in pti_pci_probe()
835 drv_data->pti_ioaddr = in pti_pci_probe()
836 ioremap((u32)drv_data->aperture_base, in pti_pci_probe()
838 if (!drv_data->pti_ioaddr) { in pti_pci_probe()
839 retval = -ENOMEM; in pti_pci_probe()
846 struct tty_port *port = &drv_data->port[a]; in pti_pci_probe()
848 port->ops = &tty_port_ops; in pti_pci_probe()
850 tty_port_register_device(port, pti_tty_driver, a, &pdev->dev); in pti_pci_probe()
869 * pti_pci_remove()- Driver exit method to remove PTI from
882 tty_port_destroy(&drv_data->port[a]); in pti_pci_remove()
885 iounmap(drv_data->pti_ioaddr); in pti_pci_remove()
901 * pti_init()- Overall entry/init call to the pti driver.
919 return -ENOMEM; in pti_init()
922 pti_tty_driver->driver_name = DRIVERNAME; in pti_init()
923 pti_tty_driver->name = TTYNAME; in pti_init()
924 pti_tty_driver->major = 0; in pti_init()
925 pti_tty_driver->minor_start = PTITTY_MINOR_START; in pti_init()
926 pti_tty_driver->type = TTY_DRIVER_TYPE_SYSTEM; in pti_init()
927 pti_tty_driver->subtype = SYSTEM_TYPE_SYSCONS; in pti_init()
928 pti_tty_driver->flags = TTY_DRIVER_REAL_RAW | in pti_init()
930 pti_tty_driver->init_termios = tty_std_termios; in pti_init()
963 * pti_exit()- Unregisters this module as a tty and pci driver.