PD#146975: pcie: support broadcom wifi ap6356p.
Change-Id: Iec6877c0b34dbc213711071427ccca786396b12b
Signed-off-by: Yue Wang <yue.wang@amlogic.com>
0x0 0xff644000 0x0 0x2000
0x0 0xff646000 0x0 0x2000
0x0 0xffd01080 0x0 0x10
- 0x0 0xf9c00000 0x0 0x100000>;
+ 0x0 0xf9f00000 0x0 0x100000>;
reg-names = "elbi", "phy", "cfg", "reset", "config";
reset-gpio = <&gpio GPIOX_19 GPIO_ACTIVE_HIGH>;
interrupts = <0 177 0>, <0 179 0>;
#address-cells = <3>;
#size-cells = <2>;
device_type = "pci";
- ranges = <0x81000000 0 0 0 0xf9d00000 0x0 0x10000
- /*downstream I/O */
- 0x82000000 0 0xf9d10000 0x0 0xf9d10000 0 0x002f0000>;
+ ranges = <0x82000000 0 0 0x0 0xf9c00000 0 0x00300000>;
/* non-prefetchable memory */
num-lanes = <1>;
pcie-num = <1>;
#address-cells = <3>;
#size-cells = <2>;
device_type = "pci";
- ranges = <0x81000000 0 0 0 0xfa500000 0x0 0x10000
+ ranges = <0x81000000 0 0 0 0xfa500000 0x0 0x10000
/* downstream I/O */
0x82000000 0 0xfa510000 0x0 0xfa510000 0 0x002f0000>;
/* non-prefetchable memory */
0x0 0xff644000 0x0 0x2000
0x0 0xff646000 0x0 0x2000
0x0 0xffd01080 0x0 0x10
- 0x0 0xf9c00000 0x0 0x100000>;
+ 0x0 0xf9f00000 0x0 0x100000>;
reg-names = "elbi", "phy", "cfg", "reset", "config";
reset-gpio = <&gpio GPIOX_19 GPIO_ACTIVE_HIGH>;
interrupts = <0 177 0>, <0 179 0>;
#address-cells = <3>;
#size-cells = <2>;
device_type = "pci";
- ranges = <0x81000000 0 0 0 0xf9d00000 0x0 0x10000
- /*downstream I/O */
- 0x82000000 0 0xf9d10000 0x0 0xf9d10000 0 0x002f0000>;
+ ranges = <0x82000000 0 0 0x0 0xf9c00000 0 0x00300000>;
/* non-prefetchable memory */
num-lanes = <1>;
pcie-num = <1>;
#address-cells = <3>;
#size-cells = <2>;
device_type = "pci";
- ranges = <0x81000000 0 0 0 0xfa500000 0x0 0x10000
+ ranges = <0x81000000 0 0 0 0xfa500000 0x0 0x10000
/* downstream I/O */
0x82000000 0 0xfa510000 0x0 0xfa510000 0 0x002f0000>;
/* non-prefetchable memory */
DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_AMD, 0x7900, quirk_amd_ide_mode);
DECLARE_PCI_FIXUP_RESUME_EARLY(PCI_VENDOR_ID_AMD, 0x7900, quirk_amd_ide_mode);
+#ifdef CONFIG_AMLOGIC_PCIE
+/*
+ * set broadcom wifi ap6356p bar2 to 2MB
+ */
+static void quirk_broadcom_ap6356p(struct pci_dev *pdev)
+{
+ unsigned short rbarctrl = 0;
+ unsigned short rbarctrln = 0;
+
+ pci_read_config_word(pdev, 0x228, &rbarctrl);
+ pci_write_config_word(pdev, 0x228, ((rbarctrl & 0xff) | 0x100));
+ pci_read_config_word(pdev, 0x228, &rbarctrln);
+ dev_printk(KERN_DEBUG, &pdev->dev, "change 0x228, rbarctrl=%x->%x\n", rbarctrl, rbarctrln);
+}
+DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_AP6356P, PCI_DEVICE_ID_AP6356P, quirk_broadcom_ap6356p);
+#endif
+
/*
* Serverworks CSB5 IDE does not fully support native mode
*/
#define PCI_VENDOR_ID_OCZ 0x1b85
+#ifdef CONFIG_AMLOGIC_PCIE
+#define PCI_VENDOR_ID_AP6356P 0x14e4
+#define PCI_DEVICE_ID_AP6356P 0x43ec
+#endif
+
#endif /* _LINUX_PCI_IDS_H */