blob: 3fa7ec95c7a820671d957e318fc39cab537b44d8 [file] [log] [blame]
Patrick Venture1cde5f92018-11-07 08:26:47 -08001#include "pci_handler.hpp"
2
3#include <cstdint>
Patrick Venturea8a99ae2018-11-09 11:14:58 -08004#include <cstring>
Patrick Venture1cde5f92018-11-07 08:26:47 -08005#include <vector>
6
7namespace blobs
8{
9
Patrick Venture0d2a8132018-11-09 11:34:21 -080010bool PciDataHandler::open()
11{
12 /* For the ASPEED P2A driver, this method will enable the memory region to
13 * use.
14 */
15 return false;
16}
17
Patrick Venture1cde5f92018-11-07 08:26:47 -080018std::vector<std::uint8_t> PciDataHandler::copyFrom(std::uint32_t length)
19{
20 /* TODO: implement this. */
21 return {};
22}
23
Patrick Venture8c535332018-11-08 15:58:00 -080024bool PciDataHandler::write(const std::vector<std::uint8_t>& configuration)
25{
26 /* PCI handler doesn't require configuration write, only read. */
27 return false;
28}
29
30std::vector<std::uint8_t> PciDataHandler::read()
31{
32 /* PCI handler does require returning a configuration from read. */
33 struct PciConfigResponse reply;
34 reply.address = 0;
35
36 std::vector<std::uint8_t> bytes;
37 bytes.resize(sizeof(reply));
Patrick Venturea8a99ae2018-11-09 11:14:58 -080038 std::memcpy(bytes.data(), &reply, sizeof(reply));
Patrick Venture8c535332018-11-08 15:58:00 -080039
40 return bytes;
41}
42
Patrick Venture1cde5f92018-11-07 08:26:47 -080043} // namespace blobs