type
stringclasses
5 values
content
stringlengths
9
163k
functions
int check_d3hot(struct seq_file *s, void *data) { bool pass = false; u16 val; struct tegra_pcie_port *port = NULL; struct pci_dev *pdev = NULL; struct tegra_pcie *pcie = (struct tegra_pcie *)(s->private); /* Force all the devices (including RPs) in d3 hot state */ for_each_pci_dev(pdev) { pci_read_config_word...
functions
int dump_config_space(struct seq_file *s, void *data) { u8 val; int row, col; struct pci_dev *pdev = NULL; for_each_pci_dev(pdev) { int row_cnt = pci_is_pcie(pdev) ? PCI_EXT_CFG_SPACE_SIZE : PCI_CFG_SPACE_SIZE; seq_printf(s, "%s\n", kobject_name(&pdev->dev.kobj)); seq_printf(s, "%s\n", "------------"); ...
functions
int dump_afi_space(struct seq_file *s, void *data) { u32 val, offset; struct tegra_pcie_port *port = NULL; struct tegra_pcie *pcie = (struct tegra_pcie *)(s->private); list_for_each_entry(port, &pcie->ports, list) { seq_puts(s, "Offset: Values\n"); for (offset = 0; offset < 0x200; offset += 0x10) { val = a...
functions
int config_read(struct seq_file *s, void *data) { u32 val; struct pci_dev *pdev = NULL; pdev = pci_get_bus_and_slot((bdf >> 8), (bdf & 0xFF)); if (!pdev) { seq_printf(s, "%02d:%02d.%02d : Doesn't exist\n", (bdf >> 8), PCI_SLOT(bdf), PCI_FUNC(bdf)); seq_printf(s, "Enter (bus<<8 | dev<<3 | func) value to b...
functions
int config_write(struct seq_file *s, void *data) { struct pci_dev *pdev = NULL; pdev = pci_get_bus_and_slot((bdf >> 8), (bdf & 0xFF)); if (!pdev) { seq_printf(s, "%02d:%02d.%02d : Doesn't exist\n", (bdf >> 8), PCI_SLOT(bdf), PCI_FUNC(bdf)); seq_printf(s, "Enter (bus<<8 | dev<<3 | func) value to bdf file\n...
functions
int power_down(struct seq_file *s, void *data) { struct tegra_pcie_port *port = NULL; struct tegra_pcie *pcie = (struct tegra_pcie *)(s->private); u32 val; bool pass = false; val = afi_readl(pcie, AFI_PCIE_PME); val |= AFI_PCIE_PME_TURN_OFF; afi_writel(pcie, val, AFI_PCIE_PME); do { val = afi_readl(pcie, AFI...
functions
int apply_lane_width(struct seq_file *s, void *data) { unsigned int new; struct tegra_pcie_port *port = (struct tegra_pcie_port *)(s->private); if (port->lanes > 0x10) { seq_printf(s, "link width cannot be grater than 16\n"); new = rp_readl(port, RP_LINK_CONTROL_STATUS); port->lanes = (new & RP_LINK_CONTRO...
functions
int aspm_state_cnt(struct seq_file *s, void *data) { u32 val, cs; struct tegra_pcie_port *port = (struct tegra_pcie_port *)(s->private); cs = rp_readl(port, RP_LINK_CONTROL_STATUS); /* check if L0s is enabled on this port */ if (cs & RP_LINK_CONTROL_STATUS_L0s_ENABLED) { val = rp_readl(port, NV_PCIE2_RP_PRIV_XP...
functions
int list_aspm_states(struct seq_file *s, void *data) { u32 i = 0; seq_printf(s, "----------------------------------------------------\n"); seq_printf(s, "Note: Duration of link's residency is calcualated\n"); seq_printf(s, " only for one of the ASPM states at a time\n"); seq_printf(s, "-----------------------...
functions
int apply_aspm_state(struct seq_file *s, void *data) { u32 val; struct tegra_pcie_port *port = (struct tegra_pcie_port *)(s->private); if (config_aspm_state > ARRAY_SIZE(aspm_states)) { seq_printf(s, "Invalid ASPM state : %u\n", config_aspm_state); list_aspm_states(s, data); }
functions
int get_aspm_duration(struct seq_file *s, void *data) { u32 val; struct tegra_pcie_port *port = (struct tegra_pcie_port *)(s->private); val = rp_readl(port, NV_PCIE2_RP_PRIV_XP_DURATION_IN_LOW_PWR_100NS); /* 52.08 = 1000 / 19.2MHz is rounded to 52 */ seq_printf(s, "ASPM-%s duration = %d ns\n", aspm_states[confi...
functions
int secondary_bus_reset(struct seq_file *s, void *data) { u32 val; struct tegra_pcie_port *port = (struct tegra_pcie_port *)(s->private); val = rp_readl(port, NV_PCIE2_RP_INTR_BCR); val |= NV_PCIE2_RP_INTR_BCR_SB_RESET; rp_writel(port, val, NV_PCIE2_RP_INTR_BCR); udelay(10); val = rp_readl(port, NV_PCIE2_RP_INT...
functions
void reset_l1ss_counter(struct tegra_pcie_port *port, u32 val, unsigned long offset) { int c = 0; if ((val & 0xFFFF) == 0xFFFF) { pr_info(" Trying reset L1ss entry count to 0\n"); while (val) { if (c++ > 50) { pr_info("Timeout: reset did not happen!\n"); break; }
functions
int aspm_l11(struct seq_file *s, void *data) { struct pci_dev *pdev = NULL; u32 val = 0, pos = 0; struct tegra_pcie_port *port = NULL; struct tegra_pcie *pcie = (struct tegra_pcie *)(s->private); pr_info("\nPCIE aspm l1.1 test START..\n"); list_for_each_entry(port, &pcie->ports, list) { /* reset RP L1.1 counte...
functions
int aspm_l1ss(struct seq_file *s, void *data) { struct pci_dev *pdev = NULL; u32 val = 0, pos = 0; struct tegra_pcie_port *port = NULL; struct tegra_pcie *pcie = (struct tegra_pcie *)(s->private); pr_info("\nPCIE aspm l1ss test START..\n"); list_for_each_entry(port, &pcie->ports, list) { /* reset RP L1.1 L1.2 ...
functions
int tegra_pcie_port_debugfs_init(struct tegra_pcie_port *port) { struct dentry *d; char port_name; sprintf(&port_name, "%d", port->index); port->port_debugfs = debugfs_create_dir(&port_name, port->pcie->debugfs); if (!port->port_debugfs) return -ENOMEM; d = debugfs_create_u32("lane_width", S_IWUGO | S_...
functions
void tegra_pcie_ports_seq_stop(struct seq_file *s, void *v) { }
functions
int tegra_pcie_ports_seq_show(struct seq_file *s, void *v) { bool up = false, active = false; struct tegra_pcie_port *port; unsigned int value; port = list_entry(v, struct tegra_pcie_port, list); value = readl(port->base + RP_VEND_XP); if (value & RP_VEND_XP_DL_UP) up = true; value = readl(port->base + RP_...
functions
int tegra_pcie_ports_open(struct inode *inode, struct file *file) { struct tegra_pcie *pcie = inode->i_private; struct seq_file *s; int err; err = seq_open(file, &tegra_pcie_ports_seq_ops); if (err) return err; s = file->private_data; s->private = pcie; return 0; }
functions
void tegra_pcie_debugfs_exit(struct tegra_pcie *pcie) { debugfs_remove_recursive(pcie->debugfs); }
functions
int tegra_pcie_debugfs_init(struct tegra_pcie *pcie) { struct dentry *file, *d; struct tegra_pcie_port *port; pcie->debugfs = debugfs_create_dir("pcie", NULL); if (!pcie->debugfs) return -ENOMEM; file = debugfs_create_file("ports", S_IFREG | S_IRUGO, pcie->debugfs, pcie, &tegra_pcie_ports_ops); if (!fi...
functions
int tegra_pcie_probe_complete(struct tegra_pcie *pcie) { int ret = 0; struct platform_device *pdev = to_platform_device(pcie->dev); PR_FUNC_LINE; ret = tegra_pcie_init(pcie); if (ret) return ret; if (IS_ENABLED(CONFIG_DEBUG_FS)) { int ret = tegra_pcie_debugfs_init(pcie); if (ret < 0) dev_err(&pdev->dev...
functions
void pcie_delayed_detect(struct work_struct *work) { struct tegra_pcie *pcie; int ret = 0; pcie = container_of(work, struct tegra_pcie, detect_delay.work); ret = tegra_pcie_probe_complete(pcie); if (ret) { return; }
functions
int tegra_pcie_probe(struct platform_device *pdev) { int ret = 0; int i; const struct of_device_id *match; struct tegra_pcie *pcie; PR_FUNC_LINE; #ifdef CONFIG_ARCH_TEGRA_21x_SOC if (tegra_bonded_out_dev(BOND_OUT_PCIE)) { dev_err(&pdev->dev, "PCIE instance is not present\n"); return -ENODEV; }
functions
int tegra_pcie_remove(struct platform_device *pdev) { struct tegra_pcie *pcie = platform_get_drvdata(pdev); struct tegra_pcie_bus *bus; PR_FUNC_LINE; pm_runtime_disable(pcie->dev); if (cancel_delayed_work_sync(&pcie->detect_delay)) return 0; if (IS_ENABLED(CONFIG_DEBUG_FS)) tegra_pcie_debugfs_exit(pcie); pc...
functions
int tegra_pcie_suspend_noirq(struct device *dev) { int ret = 0; struct tegra_pcie *pcie = dev_get_drvdata(dev); PR_FUNC_LINE; ret = tegra_pcie_power_off(pcie, true); if (ret) return ret; /* configure PE_WAKE signal as wake sources */ if (gpio_is_valid(pcie->plat_data->gpio_wake) && device_may_wakeup(dev)) ...
functions
int tegra_pcie_resume_noirq(struct device *dev) { int ret = 0; struct tegra_pcie *pcie = dev_get_drvdata(dev); PR_FUNC_LINE; if (gpio_is_valid(pcie->plat_data->gpio_wake) && device_may_wakeup(dev)) { ret = disable_irq_wake(gpio_to_irq( pcie->plat_data->gpio_wake)); if (ret < 0) { dev_err(dev, "ID ...
functions
int tegra_pcie_resume(struct device *dev) { struct tegra_pcie *pcie = dev_get_drvdata(dev); PR_FUNC_LINE; tegra_pcie_enable_features(pcie); return 0; }
functions
__init tegra_pcie_init_driver(void) { return platform_driver_register(&tegra_pcie_driver); }
functions
__exit_refok tegra_pcie_exit_driver(void) { platform_driver_unregister(&tegra_pcie_driver); }
includes
#include <fcntl.h>
includes
#include <ctype.h>
functions
void show_write_files (struct ui_file *file, int from_tty, struct cmd_list_element *c, const char *value) { fprintf_filtered (file, _("Writing into executable and core files is %s.\n"), value); }
functions
void exec_open (char *args, int from_tty) { target_preopen (from_tty); exec_file_attach (args, from_tty); }
functions
void exec_close (void) { if (exec_bfd) { bfd *abfd = exec_bfd; char *name = bfd_get_filename (abfd); gdb_bfd_close_or_warn (abfd); xfree (name); /* Removing target sections may close the exec_ops target. Clear exec_bfd before doing so to prevent recursion. */ exec_bfd = NU...
functions
void exec_close_1 (int quitting) { int need_symtab_cleanup = 0; struct vmap *vp, *nxt; using_exec_ops = 0; for (nxt = vmap; nxt != NULL;) { vp = nxt; nxt = vp->nxt; /* if there is an objfile associated with this bfd, free_objfile() will do proper cleanup of objfile *and* bfd. ...
functions
void exec_file_clear (int from_tty) { /* Remove exec file. */ exec_close (); if (from_tty) printf_unfiltered (_("No executable file now.\n")); }
functions
void exec_file_attach (char *filename, int from_tty) { /* Remove any previous exec file. */ exec_close (); /* Now open and digest the file the user requested, if any. */ if (!filename) { if (from_tty) printf_unfiltered (_("No executable file now.\n")); set_gdbarch_from_file (NULL); ...
functions
void exec_file_command (char *args, int from_tty) { char **argv; char *filename; if (from_tty && target_has_execution && !query (_("A program is being debugged already.\n" "Are you sure you want to change the file? "))) error (_("File not changed.")); if (args) { struct cleanup *clean...
functions
void file_command (char *arg, int from_tty) { /* FIXME, if we lose on reading the symbol file, we should revert the exec file, but that's rough. */ exec_file_command (arg, from_tty); symbol_file_command (arg, from_tty); if (deprecated_file_changed_hook) deprecated_file_changed_hook (arg); }
functions
void add_to_section_table (bfd *abfd, struct bfd_section *asect, void *table_pp_char) { struct target_section **table_pp = (struct target_section **) table_pp_char; flagword aflag; /* Check the section flags, but do not discard zero-length sections, since some symbols may still be attached to this s...
functions
int resize_section_table (struct target_section_table *table, int num_added) { struct target_section *old_value; int old_count; int new_count; old_value = table->sections; old_count = table->sections_end - table->sections; new_count = num_added + old_count; if (new_count) { table->sections = ...
functions
int build_section_table (struct bfd *some_bfd, struct target_section **start, struct target_section **end) { unsigned count; count = bfd_count_sections (some_bfd); if (*start) xfree (* start); *start = (struct target_section *) xmalloc (count * sizeof (**start)); *end = *start; bfd_map_over_sect...
functions
void add_target_sections (struct target_section *sections, struct target_section *sections_end) { int count; struct target_section_table *table = current_target_sections; count = sections_end - sections; if (count > 0) { int space = resize_section_table (table, count); memcpy (table->s...
functions
void remove_target_sections (bfd *abfd) { struct target_section *src, *dest; struct target_section_table *table = current_target_sections; dest = table->sections; for (src = table->sections; src < table->sections_end; src++) if (src->bfd != abfd) { /* Keep this section. */ if (dest < src) *dest...
functions
void bfdsec_to_vmap (struct bfd *abfd, struct bfd_section *sect, void *arg3) { struct vmap_and_bfd *vmap_bfd = (struct vmap_and_bfd *) arg3; struct vmap *vp; vp = vmap_bfd->pvmap; if ((bfd_get_section_flags (abfd, sect) & SEC_LOAD) == 0) return; if (strcmp (bfd_section_name (abfd, sect), ".text") == 0)...
functions
int section_table_xfer_memory_partial (gdb_byte *readbuf, const gdb_byte *writebuf, ULONGEST offset, LONGEST len, struct target_section *sections, struct target_section *sections_end, const char *section_name) { int res; struct target_section *p; ULONGEST memaddr = offset; ULONGEST m...
functions
else if (memaddr >= p->endaddr) { /* This section ends before the transfer starts. */ continue; }
functions
LONGEST exec_xfer_partial (struct target_ops *ops, enum target_object object, const char *annex, gdb_byte *readbuf, const gdb_byte *writebuf, ULONGEST offset, LONGEST len) { struct target_section_table *table = target_get_section_table (ops); if (object == TARGET_OBJECT_MEMORY) return section_ta...
functions
void print_section_info (struct target_section_table *t, bfd *abfd) { struct gdbarch *gdbarch = gdbarch_from_bfd (abfd); struct target_section *p; /* FIXME: 16 is not wide enough when gdbarch_addr_bit > 64. */ int wid = gdbarch_addr_bit (gdbarch) <= 32 ? 8 : 16; printf_filtered ("\t`%s', ", bfd_get_filename...
functions
void exec_files_info (struct target_ops *t) { print_section_info (current_target_sections, exec_bfd); if (vmap) { int addr_size = gdbarch_addr_bit (target_gdbarch) / 8; struct vmap *vp; printf_unfiltered (_("\tMapping info for file `%s'.\n"), vmap->name); printf_unfiltered ("\t %*s ...
functions
void set_section_command (char *args, int from_tty) { struct target_section *p; char *secname; unsigned seclen; unsigned long secaddr; char secprint[100]; long offset; struct target_section_table *table; if (args == 0) error (_("Must specify section name and its virtual address")); /* Parse out ...
functions
void exec_set_section_address (const char *filename, int index, CORE_ADDR address) { struct target_section *p; struct target_section_table *table; table = current_target_sections; for (p = table->sections; p < table->sections_end; p++) { if (filename_cmp (filename, p->bfd->filename) == 0 && index ...
functions
int ignore (struct gdbarch *gdbarch, struct bp_target_info *bp_tgt) { return 0; }
functions
int exec_has_memory (struct target_ops *ops) { /* We can provide memory if we have any file/target sections to read from. */ return (current_target_sections->sections != current_target_sections->sections_end); }
functions
void init_exec_ops (void) { exec_ops.to_shortname = "exec"; exec_ops.to_longname = "Local exec file"; exec_ops.to_doc = "Use an executable file as a target.\n\ Specify the filename of the executable file."; exec_ops.to_open = exec_open; exec_ops.to_close = exec_close_1; exec_ops.to_attach = find_default_att...
functions
void _initialize_exec (void) { struct cmd_list_element *c; init_exec_ops (); if (!dbx_commands) { c = add_cmd ("file", class_files, file_command, _("\ Use FILE as program to be debugged.\n\ It is read for its symbols, for getting the contents of pure memory,\n\ and it is the program executed when you ...
includes
#include <linux/config.h>
includes
#include <linux/types.h>
includes
#include <linux/kernel.h>
includes
#include <linux/module.h>
includes
#include <linux/spinlock.h>
includes
#include <linux/slab.h>
includes
#include <linux/init.h>
includes
#include <linux/mm.h>
includes
#include <linux/string.h>
includes
#include <linux/pci.h>
includes
#include <linux/proc_fs.h>
includes
#include <linux/seq_file.h>
includes
#include <linux/acpi.h>
includes
#include <linux/efi.h>
includes
#include <asm/delay.h>
includes
#include <asm/io.h>
includes
#include <asm/page.h>
includes
#include <asm/system.h>
includes
#include <asm/bitops.h>
defines
#define PFX "IOC: "
defines
#define ALLOW_IOV_BYPASS
defines
#define ENABLE_MARK_CLEAN
defines
#define SBA_INLINE __inline__
defines
#define DBG_INIT(x...) printk(x)
defines
#define DBG_INIT(x...)
defines
#define DBG_RUN(x...) printk(x)
defines
#define DBG_RUN(x...)
defines
#define DBG_RUN_SG(x...) printk(x)
defines
#define DBG_RUN_SG(x...)
defines
#define DBG_RES(x...) printk(x)
defines
#define DBG_RES(x...)
defines
#define DBG_BYPASS(x...) printk(x)
defines
#define DBG_BYPASS(x...)
defines
#define ASSERT(expr) \
defines
#define ASSERT(expr)
defines
#define DELAYED_RESOURCE_CNT 16
defines
#define DEFAULT_DMA_HINT_REG 0
defines
#define ZX1_IOC_ID ((PCI_DEVICE_ID_HP_ZX1_IOC << 16) | PCI_VENDOR_ID_HP)
defines
#define REO_IOC_ID ((PCI_DEVICE_ID_HP_REO_IOC << 16) | PCI_VENDOR_ID_HP)
defines
#define SX1000_IOC_ID ((PCI_DEVICE_ID_HP_SX1000_IOC << 16) | PCI_VENDOR_ID_HP)
defines
#define ZX1_IOC_OFFSET 0x1000 /* ACPI reports SBA, we want IOC */
defines
#define IOC_FUNC_ID 0x000
defines
#define IOC_FCLASS 0x008 /* function class, bist, header, rev... */