Skip to content

Commit c04881e

Browse files
committed
Merge branch 'remotes/lorenzo/pci/aardvark'
- Decode PIO Posted/Non-posted Request correctly in error logging (Pali Rohár) - Work around incorrect Vendor ID in Marvell Armada 3700 (Pali Rohár) * remotes/lorenzo/pci/aardvark: PCI: aardvark: Implement workaround for the readback value of VEND_ID PCI: aardvark: Fix checking for PIO Non-posted Request
2 parents 4343292 + 7f71a40 commit c04881e

1 file changed

Lines changed: 12 additions & 1 deletion

File tree

drivers/pci/controller/pci-aardvark.c

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
#define PIO_COMPLETION_STATUS_UR 1
5858
#define PIO_COMPLETION_STATUS_CRS 2
5959
#define PIO_COMPLETION_STATUS_CA 4
60-
#define PIO_NON_POSTED_REQ BIT(0)
60+
#define PIO_NON_POSTED_REQ BIT(10)
6161
#define PIO_ADDR_LS (PIO_BASE_ADDR + 0x8)
6262
#define PIO_ADDR_MS (PIO_BASE_ADDR + 0xc)
6363
#define PIO_WR_DATA (PIO_BASE_ADDR + 0x10)
@@ -125,6 +125,7 @@
125125
#define LTSSM_MASK 0x3f
126126
#define LTSSM_L0 0x10
127127
#define RC_BAR_CONFIG 0x300
128+
#define VENDOR_ID_REG (LMI_BASE_ADDR + 0x44)
128129

129130
/* PCIe core controller registers */
130131
#define CTRL_CORE_BASE_ADDR 0x18000
@@ -385,6 +386,16 @@ static void advk_pcie_setup_hw(struct advk_pcie *pcie)
385386
reg |= (IS_RC_MSK << IS_RC_SHIFT);
386387
advk_writel(pcie, reg, PCIE_CORE_CTRL0_REG);
387388

389+
/*
390+
* Replace incorrect PCI vendor id value 0x1b4b by correct value 0x11ab.
391+
* VENDOR_ID_REG contains vendor id in low 16 bits and subsystem vendor
392+
* id in high 16 bits. Updating this register changes readback value of
393+
* read-only vendor id bits in PCIE_CORE_DEV_ID_REG register. Workaround
394+
* for erratum 4.1: "The value of device and vendor ID is incorrect".
395+
*/
396+
reg = (PCI_VENDOR_ID_MARVELL << 16) | PCI_VENDOR_ID_MARVELL;
397+
advk_writel(pcie, reg, VENDOR_ID_REG);
398+
388399
/* Set Advanced Error Capabilities and Control PF0 register */
389400
reg = PCIE_CORE_ERR_CAPCTL_ECRC_CHK_TX |
390401
PCIE_CORE_ERR_CAPCTL_ECRC_CHK_TX_EN |

0 commit comments

Comments
 (0)