diff options
-rw-r--r-- | arch/x86/Kconfig | 7 | ||||
-rw-r--r-- | arch/x86/include/asm/iosf_mbi.h | 33 | ||||
-rw-r--r-- | arch/x86/kernel/iosf_mbi.c | 7 |
3 files changed, 42 insertions, 5 deletions
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index 25d2c6f7325e..f1304d38aa21 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig | |||
@@ -2375,12 +2375,9 @@ config X86_DMA_REMAP | |||
2375 | depends on STA2X11 | 2375 | depends on STA2X11 |
2376 | 2376 | ||
2377 | config IOSF_MBI | 2377 | config IOSF_MBI |
2378 | bool | 2378 | tristate |
2379 | default m | ||
2379 | depends on PCI | 2380 | depends on PCI |
2380 | ---help--- | ||
2381 | To be selected by modules requiring access to the Intel OnChip System | ||
2382 | Fabric (IOSF) Sideband MailBox Interface (MBI). For MBI platforms | ||
2383 | enumerable by PCI. | ||
2384 | 2381 | ||
2385 | source "net/Kconfig" | 2382 | source "net/Kconfig" |
2386 | 2383 | ||
diff --git a/arch/x86/include/asm/iosf_mbi.h b/arch/x86/include/asm/iosf_mbi.h index 8e71c7941767..1a91a3698b1e 100644 --- a/arch/x86/include/asm/iosf_mbi.h +++ b/arch/x86/include/asm/iosf_mbi.h | |||
@@ -50,6 +50,10 @@ | |||
50 | #define BT_MBI_PCIE_READ 0x00 | 50 | #define BT_MBI_PCIE_READ 0x00 |
51 | #define BT_MBI_PCIE_WRITE 0x01 | 51 | #define BT_MBI_PCIE_WRITE 0x01 |
52 | 52 | ||
53 | #if IS_ENABLED(CONFIG_IOSF_MBI) | ||
54 | |||
55 | bool iosf_mbi_available(void); | ||
56 | |||
53 | /** | 57 | /** |
54 | * iosf_mbi_read() - MailBox Interface read command | 58 | * iosf_mbi_read() - MailBox Interface read command |
55 | * @port: port indicating subunit being accessed | 59 | * @port: port indicating subunit being accessed |
@@ -87,4 +91,33 @@ int iosf_mbi_write(u8 port, u8 opcode, u32 offset, u32 mdr); | |||
87 | */ | 91 | */ |
88 | int iosf_mbi_modify(u8 port, u8 opcode, u32 offset, u32 mdr, u32 mask); | 92 | int iosf_mbi_modify(u8 port, u8 opcode, u32 offset, u32 mdr, u32 mask); |
89 | 93 | ||
94 | #else /* CONFIG_IOSF_MBI is not enabled */ | ||
95 | static inline | ||
96 | bool iosf_mbi_available(void) | ||
97 | { | ||
98 | return false; | ||
99 | } | ||
100 | |||
101 | static inline | ||
102 | int iosf_mbi_read(u8 port, u8 opcode, u32 offset, u32 *mdr) | ||
103 | { | ||
104 | WARN(1, "IOSF_MBI driver not available"); | ||
105 | return -EPERM; | ||
106 | } | ||
107 | |||
108 | static inline | ||
109 | int iosf_mbi_write(u8 port, u8 opcode, u32 offset, u32 mdr) | ||
110 | { | ||
111 | WARN(1, "IOSF_MBI driver not available"); | ||
112 | return -EPERM; | ||
113 | } | ||
114 | |||
115 | static inline | ||
116 | int iosf_mbi_modify(u8 port, u8 opcode, u32 offset, u32 mdr, u32 mask) | ||
117 | { | ||
118 | WARN(1, "IOSF_MBI driver not available"); | ||
119 | return -EPERM; | ||
120 | } | ||
121 | #endif /* CONFIG_IOSF_MBI */ | ||
122 | |||
90 | #endif /* IOSF_MBI_SYMS_H */ | 123 | #endif /* IOSF_MBI_SYMS_H */ |
diff --git a/arch/x86/kernel/iosf_mbi.c b/arch/x86/kernel/iosf_mbi.c index c3aae6672843..f4ff9786a620 100644 --- a/arch/x86/kernel/iosf_mbi.c +++ b/arch/x86/kernel/iosf_mbi.c | |||
@@ -177,6 +177,13 @@ int iosf_mbi_modify(u8 port, u8 opcode, u32 offset, u32 mdr, u32 mask) | |||
177 | } | 177 | } |
178 | EXPORT_SYMBOL(iosf_mbi_modify); | 178 | EXPORT_SYMBOL(iosf_mbi_modify); |
179 | 179 | ||
180 | bool iosf_mbi_available(void) | ||
181 | { | ||
182 | /* Mbi isn't hot-pluggable. No remove routine is provided */ | ||
183 | return mbi_pdev; | ||
184 | } | ||
185 | EXPORT_SYMBOL(iosf_mbi_available); | ||
186 | |||
180 | static int iosf_mbi_probe(struct pci_dev *pdev, | 187 | static int iosf_mbi_probe(struct pci_dev *pdev, |
181 | const struct pci_device_id *unused) | 188 | const struct pci_device_id *unused) |
182 | { | 189 | { |