Skip to content

Commit 5ce4b59

Browse files
author
Josh Boyer
committed
powerpc/4xx: Workaround for PPC440EPx/GRx PCI_28 Errata
The 440EPx/GRx chips don't support PCI MRM commands. Drivers determine this by looking for a zero value in the PCI cache line size register. However, some drivers write to this register upon initialization. This can cause MRMs to be used on these chips, which may cause deadlocks on PLB4. The workaround implemented here introduces a new indirect_type flag, called PPC_INDIRECT_TYPE_BROKEN_MRM. This is set in the pci_controller structure in the pci fixup function for 4xx PCI bridges by determining if the bridge is compatible with 440EPx/GRx. The flag is checked in the indirect_write_config function, and forces any writes to the PCI_CACHE_LINE_SIZE register to be zero, which will disable MRMs for these chips. A similar workaround has been tested by AMCC on various PCI cards, such as the Silicon Image ATA card and Intel E1000 GIGE card. Hangs were seen with the Silicon Image card, and MRMs were seen on the bus with a PCI analyzer. With the workaround in place, the card functioned properly and only Memory Reads were seen on the bus with the analyzer. Acked-by: Stefan Roese <[email protected]> Signed-off-by: Josh Boyer <[email protected]>
1 parent d2146cb commit 5ce4b59

File tree

3 files changed

+14
-0
lines changed

3 files changed

+14
-0
lines changed

arch/powerpc/sysdev/indirect_pci.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,12 @@ indirect_write_config(struct pci_bus *bus, unsigned int devfn, int offset,
123123
(bus->number == hose->first_busno))
124124
val &= 0xffffff00;
125125

126+
/* Workaround for PCI_28 Errata in 440EPx/GRx */
127+
if ((hose->indirect_type & PPC_INDIRECT_TYPE_BROKEN_MRM) &&
128+
offset == PCI_CACHE_LINE_SIZE) {
129+
val = 0;
130+
}
131+
126132
/*
127133
* Note: the caller has already checked that offset is
128134
* suitably aligned and that len is 1, 2 or 4.

arch/powerpc/sysdev/ppc4xx_pci.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,11 @@ static void fixup_ppc4xx_pci_bridge(struct pci_dev *dev)
7575
!of_device_is_compatible(hose->dn, "ibm,plb-pci"))
7676
return;
7777

78+
if (of_device_is_compatible(hose->dn, "ibm,plb440epx-pci") ||
79+
of_device_is_compatible(hose->dn, "ibm,plb440grx-pci")) {
80+
hose->indirect_type |= PPC_INDIRECT_TYPE_BROKEN_MRM;
81+
}
82+
7883
/* Hide the PCI host BARs from the kernel as their content doesn't
7984
* fit well in the resource management
8085
*/

include/asm-powerpc/pci-bridge.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,12 +92,15 @@ struct pci_controller {
9292
* anything but the PHB. Only allow talking to the PHB if this is
9393
* set.
9494
* BIG_ENDIAN - cfg_addr is a big endian register
95+
* BROKEN_MRM - the 440EPx/GRx chips have an errata that causes hangs on
96+
* the PLB4. Effectively disable MRM commands by setting this.
9597
*/
9698
#define PPC_INDIRECT_TYPE_SET_CFG_TYPE 0x00000001
9799
#define PPC_INDIRECT_TYPE_EXT_REG 0x00000002
98100
#define PPC_INDIRECT_TYPE_SURPRESS_PRIMARY_BUS 0x00000004
99101
#define PPC_INDIRECT_TYPE_NO_PCIE_LINK 0x00000008
100102
#define PPC_INDIRECT_TYPE_BIG_ENDIAN 0x00000010
103+
#define PPC_INDIRECT_TYPE_BROKEN_MRM 0x00000020
101104
u32 indirect_type;
102105
#endif /* !CONFIG_PPC64 */
103106
/* Currently, we limit ourselves to 1 IO range and 3 mem

0 commit comments

Comments
 (0)