This source file includes following definitions.
- pcibios_setup
- sdk7786_pci_init
1
2
3
4
5
6
7 #define pr_fmt(fmt) "PCI: " fmt
8
9 #include <linux/init.h>
10 #include <linux/kernel.h>
11 #include <linux/pci.h>
12 #include <mach/fpga.h>
13
14
15
16
17
18
19
20
21
22
23 static unsigned int slot4en __initdata;
24
25 char *__init pcibios_setup(char *str)
26 {
27 if (strcmp(str, "slot4en") == 0) {
28 slot4en = 1;
29 return NULL;
30 }
31
32 return str;
33 }
34
35 static int __init sdk7786_pci_init(void)
36 {
37 u16 data = fpga_read_reg(PCIECR);
38
39
40
41
42
43
44
45
46
47 slot4en ?: (!(data & PCIECR_PRST4) && (data & PCIECR_PRST3));
48 if (slot4en) {
49 pr_info("Activating PCIe slot#4 (disabling slot#3)\n");
50
51 data &= ~PCIECR_PCIEMUX1;
52 fpga_write_reg(data, PCIECR);
53
54
55 if ((data & PCIECR_PRST3) == 0) {
56 pr_warning("Unreachable card detected in slot#3\n");
57 return -EBUSY;
58 }
59 } else
60 pr_info("PCIe slot#4 disabled\n");
61
62 return 0;
63 }
64 postcore_initcall(sdk7786_pci_init);