1 /******************************************************************************
3 ** FILE NAME : ifxmips_fixup_pcie.c
4 ** PROJECT : IFX UEIP for VRX200
8 ** AUTHOR : Lei Chuanhua
9 ** DESCRIPTION : PCIe Root Complex Driver
10 ** COPYRIGHT : Copyright (c) 2009
11 ** Infineon Technologies AG
12 ** Am Campeon 1-12, 85579 Neubiberg, Germany
14 ** This program is free software; you can redistribute it and/or modify
15 ** it under the terms of the GNU General Public License as published by
16 ** the Free Software Foundation; either version 2 of the License, or
17 ** (at your option) any later version.
19 ** $Version $Date $Author $Comment
20 ** 0.0.1 17 Mar,2009 Lei Chuanhua Initial version
21 *******************************************************************************/
23 \file ifxmips_fixup_pcie.c
25 \brief PCIe Fixup functions source file
27 #include <linux/pci.h>
28 #include <linux/pci_regs.h>
29 #include <linux/pci_ids.h>
31 #include <lantiq_soc.h>
33 #include "pcie-lantiq.h"
35 #define PCI_VENDOR_ID_INFINEON 0x15D1
36 #define PCI_DEVICE_ID_INFINEON_DANUBE 0x000F
37 #define PCI_DEVICE_ID_INFINEON_PCIE 0x0011
38 #define PCI_VENDOR_ID_LANTIQ 0x1BEF
39 #define PCI_DEVICE_ID_LANTIQ_PCIE 0x0011
44 ifx_pcie_fixup_resource(struct pci_dev
*dev
)
48 IFX_PCIE_PRINT(PCIE_MSG_FIXUP
, "%s dev %s: enter\n", __func__
, pci_name(dev
));
50 IFX_PCIE_PRINT(PCIE_MSG_FIXUP
, "%s: fixup host controller %s (%04x:%04x)\n",
51 __func__
, pci_name(dev
), dev
->vendor
, dev
->device
);
53 /* Setup COMMAND register */
54 reg
= PCI_COMMAND_IO
| PCI_COMMAND_MEMORY
| PCI_COMMAND_MASTER
/* |
55 PCI_COMMAND_INTX_DISABLE */| PCI_COMMAND_SERR
;
56 pci_write_config_word(dev
, PCI_COMMAND
, reg
);
57 IFX_PCIE_PRINT(PCIE_MSG_FIXUP
, "%s dev %s: exit\n", __func__
, pci_name(dev
));
59 DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INFINEON
, PCI_DEVICE_ID_INFINEON_PCIE
, ifx_pcie_fixup_resource
);
60 DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_LANTIQ
, PCI_VENDOR_ID_LANTIQ
, ifx_pcie_fixup_resource
);
63 ifx_pcie_rc_class_early_fixup(struct pci_dev
*dev
)
65 IFX_PCIE_PRINT(PCIE_MSG_FIXUP
, "%s dev %s: enter\n", __func__
, pci_name(dev
));
67 if (dev
->devfn
== PCI_DEVFN(0, 0) &&
68 (dev
->class >> 8) == PCI_CLASS_BRIDGE_HOST
) {
70 dev
->class = (PCI_CLASS_BRIDGE_PCI
<< 8) | (dev
->class & 0xff);
72 printk(KERN_INFO
"%s: fixed pcie host bridge to pci-pci bridge\n", __func__
);
74 IFX_PCIE_PRINT(PCIE_MSG_FIXUP
, "%s dev %s: exit\n", __func__
, pci_name(dev
));
77 DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INFINEON
, PCI_DEVICE_ID_INFINEON_PCIE
,
78 ifx_pcie_rc_class_early_fixup
);
80 DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_LANTIQ
, PCI_DEVICE_ID_LANTIQ_PCIE
,
81 ifx_pcie_rc_class_early_fixup
);