Skip to content

Commit 5467238

Browse files
cladischStefan Richter
authored andcommitted
firewire: ohci: fix up configuration of TI chips
On TI chips (OHCI-Lynx and later), enable link enhancements features that TI recommends to be used. None of these are required for proper operation, but they are safe and nice to have. In theory, these bits should have been set by default, but in practice, some BIOS/EEPROM writers apparently do not read the datasheet, or get spooked by names like "unfair". Signed-off-by: Clemens Ladisch <clemens@ladisch.de> Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
1 parent 925e7a6 commit 5467238

File tree

2 files changed

+26
-1
lines changed

2 files changed

+26
-1
lines changed

drivers/firewire/ohci.c

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2431,7 +2431,7 @@ static int __devinit pci_probe(struct pci_dev *dev,
24312431
const struct pci_device_id *ent)
24322432
{
24332433
struct fw_ohci *ohci;
2434-
u32 bus_options, max_receive, link_speed, version;
2434+
u32 bus_options, max_receive, link_speed, version, link_enh;
24352435
u64 guid;
24362436
int i, err, n_ir, n_it;
24372437
size_t size;
@@ -2484,6 +2484,23 @@ static int __devinit pci_probe(struct pci_dev *dev,
24842484
if (param_quirks)
24852485
ohci->quirks = param_quirks;
24862486

2487+
/* TI OHCI-Lynx and compatible: set recommended configuration bits. */
2488+
if (dev->vendor == PCI_VENDOR_ID_TI) {
2489+
pci_read_config_dword(dev, PCI_CFG_TI_LinkEnh, &link_enh);
2490+
2491+
/* adjust latency of ATx FIFO: use 1.7 KB threshold */
2492+
link_enh &= ~TI_LinkEnh_atx_thresh_mask;
2493+
link_enh |= TI_LinkEnh_atx_thresh_1_7K;
2494+
2495+
/* use priority arbitration for asynchronous responses */
2496+
link_enh |= TI_LinkEnh_enab_unfair;
2497+
2498+
/* required for aPhyEnhanceEnable to work */
2499+
link_enh |= TI_LinkEnh_enab_accel;
2500+
2501+
pci_write_config_dword(dev, PCI_CFG_TI_LinkEnh, link_enh);
2502+
}
2503+
24872504
ar_context_init(&ohci->ar_request_ctx, ohci,
24882505
OHCI1394_AsReqRcvContextControlSet);
24892506

drivers/firewire/ohci.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,4 +154,12 @@
154154

155155
#define OHCI1394_phy_tcode 0xe
156156

157+
/* TI extensions */
158+
159+
#define PCI_CFG_TI_LinkEnh 0xf4
160+
#define TI_LinkEnh_enab_accel 0x00000002
161+
#define TI_LinkEnh_enab_unfair 0x00000080
162+
#define TI_LinkEnh_atx_thresh_mask 0x00003000
163+
#define TI_LinkEnh_atx_thresh_1_7K 0x00001000
164+
157165
#endif /* _FIREWIRE_OHCI_H */

0 commit comments

Comments
 (0)