xref: /linux/include/linux/ahci-remap.h (revision ab520be8cd5d56867fc95cfbc34b90880faf1f9d)
1 #ifndef _LINUX_AHCI_REMAP_H
2 #define _LINUX_AHCI_REMAP_H
3 
4 #include <linux/sizes.h>
5 
6 #define AHCI_VSCAP		0xa4
7 #define AHCI_REMAP_CAP		0x800
8 
9 /* device class code */
10 #define AHCI_REMAP_N_DCC	0x880
11 
12 /* remap-device base relative to ahci-bar */
13 #define AHCI_REMAP_N_OFFSET	SZ_16K
14 #define AHCI_REMAP_N_SIZE	SZ_16K
15 
16 #define AHCI_MAX_REMAP		3
17 
18 static inline unsigned int ahci_remap_dcc(int i)
19 {
20 	return AHCI_REMAP_N_DCC + i * 0x80;
21 }
22 
23 static inline unsigned int ahci_remap_base(int i)
24 {
25 	return AHCI_REMAP_N_OFFSET + i * AHCI_REMAP_N_SIZE;
26 }
27 
28 #endif /* _LINUX_AHCI_REMAP_H */
29