Changeset f46f5f84 in rtems


Ignore:
Timestamp:
Feb 13, 2017, 9:16:14 AM (3 years ago)
Author:
Javier Jalle <javier.jalle@…>
Branches:
5, master
Children:
ab9b447
Parents:
0c23dd5
git-author:
Javier Jalle <javier.jalle@…> (02/13/17 09:16:14)
git-committer:
Daniel Hellstrom <daniel@…> (03/06/17 06:54:55)
Message:

leon, grpci2: latency timer user configurable (default 64)

Location:
c/src/lib/libbsp/sparc/shared
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • c/src/lib/libbsp/sparc/shared/include/grpci2.h

    r0c23dd5 rf46f5f84  
    3737 * Name="byteTwisting", Type=INT, Enable/Disable Bytetwisting by hardware
    3838 *
     39 * PCI Latency timer
     40 * ============================
     41 * Name="latencyTimer", Type=INT, Set the latency timer
     42 *
    3943 * PCI Host's Target BARs setup
    4044 * ============================
  • c/src/lib/libbsp/sparc/shared/pci/grpci2.c

    r0c23dd5 rf46f5f84  
    5858#define DEFAULT_BT_ENABLED 0
    5959
     60/* If defined to 64 - Latency timer is 64 by default */
     61#define DEFAULT_LATENCY_TIMER 64
     62
    6063/* Interrupt assignment. Set to other value than 0xff in order to
    6164 * override defaults and plug&play information
     
    238241        char                            bt_enabled;
    239242        unsigned int                    irq_mask;
     243        unsigned int                    latency_timer;
    240244
    241245        struct grpci2_pcibar_cfg        *barcfg;
     
    697701        grpci2_cfg_w32(host, PCIR_COMMAND, data);
    698702
     703        /* set latency timer */
     704        grpci2_cfg_r32(host, PCIR_CACHELNSZ, &data);
     705        data &= ~0xff00;
     706        data |= ((priv->latency_timer & 0xff) << 8);
     707        grpci2_cfg_w32(host, PCIR_CACHELNSZ, data);
     708
    699709        /* Enable Error respone (CPU-TRAP) on illegal memory access */
    700710        regs->ctrl = CTRL_ER | CTRL_PE;
     
    734744        priv->bt_enabled = DEFAULT_BT_ENABLED;
    735745        priv->irq_mode = (priv->regs->sts_cap & STS_IRQMODE) >> STS_IRQMODE_BIT;
     746        priv->latency_timer = DEFAULT_LATENCY_TIMER;
    736747
    737748        /* Calculate the PCI windows
     
    792803                priv->barcfg = grpci2_default_bar_mapping;
    793804
     805        /* User may override DEFAULT_LATENCY_TIMER */
     806        value = drvmgr_dev_key_get(priv->dev, "latencyTimer", DRVMGR_KT_INT);
     807        if (value)
     808                priv->latency_timer = value->i;
     809
    794810        /* This driver only support HOST systems, we check that it can act as a
    795811         * PCI Master and that it is in the Host slot. */
Note: See TracChangeset for help on using the changeset viewer.