• Home
  • Raw
  • Download

Lines Matching +full:frame +full:- +full:master

2  *  pti.c - PTI driver for cJTAG data extration
35 #include <linux/intel-pti.h>
48 #define MODEM_BASE_ID 71 /* modem master ID address */
49 #define CONTROL_ID 72 /* control master ID address */
50 #define CONSOLE_ID 73 /* console master ID address */
51 #define OS_BASE_ID 74 /* base OS master ID address */
52 #define APP_BASE_ID 80 /* base App master ID address */
53 #define CONTROL_FRAME_LEN 32 /* PTI control frame maximum size */
91 * pti_write_to_aperture()- The private write function to PTI HW.
94 * a master and channel ID.
100 * master/channel ID, no two processes will be writing
102 * PTI-Output agent will send these out in the order that they arrived, and
119 * calculate the aperture offset from the base using the master and in pti_write_to_aperture()
122 aperture = drv_data->pti_ioaddr + (mc->master << 15) in pti_write_to_aperture()
123 + (mc->channel << 8); in pti_write_to_aperture()
126 final = len - (dwordcnt << 2); /* final = trailing bytes */ in pti_write_to_aperture()
129 dwordcnt--; in pti_write_to_aperture()
142 ptiword |= *p++ << (24-(8*i)); in pti_write_to_aperture()
149 * pti_control_frame_built_and_sent()- control frame build and send function.
151 * @mc: The master / channel structure on which the function
152 * built a control frame.
153 * @thread_name: The thread name associated with the master / channel or
156 * To be able to post process the PTI contents on host side, a control frame
158 * each PTI frame the name of the thread using a dedicated master / channel.
161 * This function builds this frame and sends it to a master ID CONTROL_ID.
173 struct pti_masterchannel mccontrol = {.master = CONTROL_ID, in pti_control_frame_built_and_sent()
186 comm[TASK_COMM_LEN-1] = 0; in pti_control_frame_built_and_sent()
195 snprintf(control_frame, CONTROL_FRAME_LEN, control_format, mc->master, in pti_control_frame_built_and_sent()
196 mc->channel, thread_name_p); in pti_control_frame_built_and_sent()
201 * pti_write_full_frame_to_aperture()- high level function to
205 * a master and channel ID.
212 * possible to add a control frame before sending the content.
223 * get_id()- Allocate a master and channel ID.
230 * @thread_name: The thread name associated with the master / channel or
234 * pti_masterchannel struct with master, channel ID address
237 * Each bit in the arrays ia_app and ia_os correspond to a master and
239 * every master there are 128 channel id's.
271 mc->master = base_id; in get_id()
272 mc->channel = ((i & 0xf)<<3) + j; in get_id()
273 /* write new master Id / channel Id allocation to channel control */ in get_id()
286 * pti_request_masterchannel()- Kernel API function used to allocate
287 * a master, channel ID address
290 * @type: 0- request Application master, channel aperture ID
292 * 1- request OS master, channel aperture ID write
294 * 2- request Modem master, channel aperture ID
297 * @thread_name: The thread name associated with the master / channel or
314 mc = get_id(drv_data->ia_app, MAX_APP_IDS, in pti_request_masterchannel()
319 mc = get_id(drv_data->ia_os, MAX_OS_IDS, in pti_request_masterchannel()
324 mc = get_id(drv_data->ia_modem, MAX_MODEM_IDS, in pti_request_masterchannel()
337 * pti_release_masterchannel()- Kernel API function used to release
338 * a master, channel ID address
341 * @mc: master, channel apeture ID address to be released. This
342 * will de-allocate the structure via kfree().
346 u8 master, channel, i; in pti_release_masterchannel() local
351 master = mc->master; in pti_release_masterchannel()
352 channel = mc->channel; in pti_release_masterchannel()
354 if (master == APP_BASE_ID) { in pti_release_masterchannel()
356 drv_data->ia_app[i] &= ~(0x80>>(channel & 0x7)); in pti_release_masterchannel()
357 } else if (master == OS_BASE_ID) { in pti_release_masterchannel()
359 drv_data->ia_os[i] &= ~(0x80>>(channel & 0x7)); in pti_release_masterchannel()
362 drv_data->ia_modem[i] &= ~(0x80>>(channel & 0x7)); in pti_release_masterchannel()
373 * pti_writedata()- Kernel API function used to write trace
376 * @mc: Master, channel aperture ID address to write to.
398 * Specific header comments made for PTI-related specifics.
402 * pti_tty_driver_open()- Open an Application master, channel aperture
418 * master IDs. These messages go through the PTI HW and out of
430 return tty_port_open(tty->port, tty, filp); in pti_tty_driver_open()
434 * pti_tty_driver_close()- close tty device and release Application
435 * master, channel aperture ID to the PTI device via tty device.
446 tty_port_close(tty->port, tty, filp); in pti_tty_driver_close()
450 * pti_tty_install()- Used to set up specific master-channels
463 int idx = tty->index; in pti_tty_install()
470 return -ENOMEM; in pti_tty_install()
473 pti_tty_data->mc = pti_request_masterchannel(0, NULL); in pti_tty_install()
475 pti_tty_data->mc = pti_request_masterchannel(2, NULL); in pti_tty_install()
477 if (pti_tty_data->mc == NULL) { in pti_tty_install()
479 return -ENXIO; in pti_tty_install()
481 tty->driver_data = pti_tty_data; in pti_tty_install()
488 * pti_tty_cleanup()- Used to de-allocate master-channel resources
495 struct pti_tty *pti_tty_data = tty->driver_data; in pti_tty_cleanup()
498 pti_release_masterchannel(pti_tty_data->mc); in pti_tty_cleanup()
500 tty->driver_data = NULL; in pti_tty_cleanup()
504 * pti_tty_driver_write()- Write trace debugging data through the char
508 * master, channel write ID.
519 struct pti_tty *pti_tty_data = tty->driver_data; in pti_tty_driver_write()
520 if ((pti_tty_data != NULL) && (pti_tty_data->mc != NULL)) { in pti_tty_driver_write()
521 pti_write_to_aperture(pti_tty_data->mc, (u8 *)buf, len); in pti_tty_driver_write()
529 return -EFAULT; in pti_tty_driver_write()
533 * pti_tty_write_room()- Always returns 2048.
543 * pti_char_open()- Open an Application master, channel aperture
547 * @filp: Output- will have a masterchannel struct set containing
561 * before assigning the value to filp->private_data. in pti_char_open()
566 return -ENOMEM; in pti_char_open()
567 filp->private_data = mc; in pti_char_open()
572 * pti_char_release()- Close a char channel to the PTI device. Part
576 * @filp: Contains private_data that contains the master, channel
584 pti_release_masterchannel(filp->private_data); in pti_char_release()
585 filp->private_data = NULL; in pti_char_release()
590 * pti_char_write()- Write trace debugging data through the char
594 * master, channel write ID.
619 mc = filp->private_data; in pti_char_write()
625 return -ENOMEM; in pti_char_write()
629 if (len - n > USER_COPY_SIZE) in pti_char_write()
632 size = len - n; in pti_char_write()
636 return n ? n : -EFAULT; in pti_char_write()
672 * pti_console_write()- Write to the console that has been acquired.
680 static struct pti_masterchannel mc = {.master = CONSOLE_ID, in pti_console_write()
690 * pti_console_device()- Return the driver tty structure and set the
702 *index = c->index; in pti_console_device()
707 * pti_console_setup()- Initialize console variables used by the driver.
742 * pti_port_activate()- Used to start/initialize any items upon
745 * @port- The tty port number of the PTI device.
746 * @tty- The tty struct associated with this device.
757 if (port->tty->index == PTITTY_MINOR_START) in pti_port_activate()
763 * pti_port_shutdown()- Used to stop/shutdown any items upon the
766 * @port- The tty port number of the PTI device.
774 if (port->tty->index == PTITTY_MINOR_START) in pti_port_shutdown()
789 * pti_pci_probe()- Used to detect pti on the pci bus and set
792 * @pdev- pci_dev struct values for pti.
793 * @ent- pci_device_id struct for pti driver.
803 int retval = -EINVAL; in pti_pci_probe()
806 dev_dbg(&pdev->dev, "%s %s(%d): PTI PCI ID %04x:%04x\n", __FILE__, in pti_pci_probe()
807 __func__, __LINE__, pdev->vendor, pdev->device); in pti_pci_probe()
820 dev_err(&pdev->dev, in pti_pci_probe()
828 retval = -ENOMEM; in pti_pci_probe()
829 dev_err(&pdev->dev, in pti_pci_probe()
834 drv_data->pti_addr = pci_resource_start(pdev, pci_bar); in pti_pci_probe()
836 retval = pci_request_region(pdev, pci_bar, dev_name(&pdev->dev)); in pti_pci_probe()
838 dev_err(&pdev->dev, in pti_pci_probe()
843 drv_data->aperture_base = drv_data->pti_addr+APERTURE_14; in pti_pci_probe()
844 drv_data->pti_ioaddr = in pti_pci_probe()
845 ioremap_nocache((u32)drv_data->aperture_base, in pti_pci_probe()
847 if (!drv_data->pti_ioaddr) { in pti_pci_probe()
848 retval = -ENOMEM; in pti_pci_probe()
855 struct tty_port *port = &drv_data->port[a]; in pti_pci_probe()
857 port->ops = &tty_port_ops; in pti_pci_probe()
859 tty_port_register_device(port, pti_tty_driver, a, &pdev->dev); in pti_pci_probe()
878 * pti_pci_remove()- Driver exit method to remove PTI from
891 tty_port_destroy(&drv_data->port[a]); in pti_pci_remove()
894 iounmap(drv_data->pti_ioaddr); in pti_pci_remove()
911 * pti_init()- Overall entry/init call to the pti driver.
921 int retval = -EINVAL; in pti_init()
929 return -ENOMEM; in pti_init()
932 pti_tty_driver->driver_name = DRIVERNAME; in pti_init()
933 pti_tty_driver->name = TTYNAME; in pti_init()
934 pti_tty_driver->major = 0; in pti_init()
935 pti_tty_driver->minor_start = PTITTY_MINOR_START; in pti_init()
936 pti_tty_driver->type = TTY_DRIVER_TYPE_SYSTEM; in pti_init()
937 pti_tty_driver->subtype = SYSTEM_TYPE_SYSCONS; in pti_init()
938 pti_tty_driver->flags = TTY_DRIVER_REAL_RAW | in pti_init()
940 pti_tty_driver->init_termios = tty_std_termios; in pti_init()
973 * pti_exit()- Unregisters this module as a tty and pci driver.