Patch Quantenna code to make PCIe + Marvell 8897/8997 work
Patch from jianho@ to make Marvell 8897/8997 work on Skids/Prowl.
Change-Id: I320fd1d0be7272a3bef677693236bc3748881462
diff --git a/drivers/ruby/pcibios.c b/drivers/ruby/pcibios.c
index 9549094..b2c8666 100644
--- a/drivers/ruby/pcibios.c
+++ b/drivers/ruby/pcibios.c
@@ -44,6 +44,10 @@
#define BUS_SCAN_TRY_MAX 1000
#define PCIE_DEV_LINKUP_MASK TOPAZ_PCIE_LINKUP
+/* Interrupt Mask and Status Register for PCIe INTx support for Marvell 8x97 */
+#define QDPC_RC_SYS_CTL_BASE 0xe0000000
+#define QDPC_RC_SYS_CTL_PCIE_INT_MASK (QDPC_RC_SYS_CTL_BASE + 0xC0)
+#define QDPC_RC_SYS_CTL_PCIE_INT_STAT (QDPC_RC_SYS_CTL_BASE + 0x17C)
static int
rpcic_read_config (struct pci_bus *bus,
@@ -499,11 +503,16 @@
if (!pos) {
printk(KERN_ERR "Error locating MSI capability position, using INTx instead\n");
} else {
- /* Setup msi generation info */
- writel(TOPAZ_PCIE_MSI_REGION, TOPAZ_MSI_ADDR_LOWER);
- writel(0, TOPAZ_MSI_ADDR_UPPER);
- writel(BIT(0), TOPAZ_MSI_INT_ENABLE);
- writel(0, TOPAZ_PCIE_MSI_MASK);
+ printk(KERN_ERR "Skip PCIe MSI setup\n");
+ }
+
+ /* Use PCIe legacy INTx interrupts for Marvell 8x97 */
+ {
+ uint32_t temp;
+ printk(KERN_ERR "PCIe Legacy INTx setup\n");
+ temp = readl(QDPC_RC_SYS_CTL_PCIE_INT_MASK);
+ temp |= BIT(11); /* Legacy INTx */
+ writel(temp, QDPC_RC_SYS_CTL_PCIE_INT_MASK);
}
return 0;
diff --git a/drivers/topaz/switch_emac.c b/drivers/topaz/switch_emac.c
index bd5f5c7..a805902 100644
--- a/drivers/topaz/switch_emac.c
+++ b/drivers/topaz/switch_emac.c
@@ -1291,7 +1291,8 @@
*/
if (!emac_lib_rtl_switch(emac_cfg_p0 | emac_cfg_p1)) {
/* Reset ext PHY. This is for bug#11906 */
- emac_lib_enable(1);
+ printk(KERN_ERR "Skip emac_lib_enable() EXT reset\n");
+ emac_lib_enable(0);
}
topaz_emac_init_tqe();