2 * @ingroup adf_os_public
4 * This file abstracts the PCI subsystem.
9 #include <adf_os_pci_pvt.h>
12 * @brief Define the entry point for the PCI module.
14 #define adf_os_pci_module_init(_fn) __adf_os_pci_module_init(_fn)
17 * @brief Define the exit point for the PCI module.
19 #define adf_os_pci_module_exit(_fn) __adf_os_pci_module_exit(_fn)
22 * @brief Setup the following driver information: name, PCI IDs of devices
23 * supported and some device handlers.
25 #define adf_os_pci_set_drv_info(_name, _pci_ids, _attach, _detach, _suspend, _resume) \
26 __adf_os_pci_set_drv_info(_name, _pci_ids, _attach, _detach, _suspend, _resume)
29 * @brief Read a byte of PCI config space.
31 * @param[in] osdev platform device instance
32 * @param[in] offset offset to read
33 * @param[out] val value read
35 * @return status of operation
38 adf_os_pci_config_read8(adf_os_device_t osdev, int offset, a_uint8_t *val)
40 return __adf_os_pci_config_read8(osdev, offset, val);
44 * @brief Write a byte to PCI config space.
46 * @param[in] osdev platform device instance
47 * @param[in] offset offset to write
48 * @param[in] val value to write
50 * @return status of operation
53 adf_os_pci_config_write8(adf_os_device_t osdev, int offset, a_uint8_t val)
55 return __adf_os_pci_config_write8(osdev, offset, val);
59 * @brief Read 2 bytes of PCI config space.
61 * @param[in] osdev platform device instance
62 * @param[in] offset offset to read
63 * @param[out] val value read
65 * @return status of operation
68 adf_os_pci_config_read16(adf_os_device_t osdev, int offset, a_uint16_t *val)
70 return __adf_os_pci_config_read16(osdev, offset, val);
74 * @brief Write 2 bytes to PCI config space.
76 * @param[in] osdev platform device instance
77 * @param[in] offset offset to write
78 * @param[in] val value to write
80 * @return status of operation
83 adf_os_pci_config_write16(adf_os_device_t osdev, int offset, a_uint16_t val)
85 return __adf_os_pci_config_write16(osdev, offset, val);
89 * @brief Read 4 bytes of PCI config space.
91 * @param[in] osdev platform device instance
92 * @param[in] offset offset to read
93 * @param[out] val value read
95 * @return status of operation
98 adf_os_pci_config_read32(adf_os_device_t osdev, int offset, a_uint32_t *val)
100 return __adf_os_pci_config_read32(osdev, offset, val);
104 * @brief Write 4 bytes to PCI config space.
106 * @param[in] osdev platform device instance
107 * @param[in] offset offset to write
108 * @param[in] val value to write
110 * @return status of operation
113 adf_os_pci_config_write32(adf_os_device_t osdev, int offset, a_uint32_t val)
115 return __adf_os_pci_config_write32(osdev, offset, val);