Patrick Venture | 1cde5f9 | 2018-11-07 08:26:47 -0800 | [diff] [blame] | 1 | #pragma once |
| 2 | |
| 3 | #include "data_handler.hpp" |
| 4 | |
| 5 | #include <cstdint> |
| 6 | #include <vector> |
| 7 | |
| 8 | namespace blobs |
| 9 | { |
| 10 | |
Patrick Venture | 8c53533 | 2018-11-08 15:58:00 -0800 | [diff] [blame] | 11 | struct LpcRegion |
| 12 | { |
| 13 | /* Host LPC address where the chunk is to be mapped. */ |
| 14 | std::uint32_t address; |
| 15 | |
| 16 | /* Size of the chunk to be mapped. */ |
| 17 | std::uint32_t length; |
| 18 | } __attribute__((packed)); |
| 19 | |
| 20 | /** |
| 21 | * Data Handler for configuration the ASPEED LPC memory region, reading and |
| 22 | * writing data. |
| 23 | */ |
Patrick Venture | 1cde5f9 | 2018-11-07 08:26:47 -0800 | [diff] [blame] | 24 | class LpcDataHandler : public DataInterface |
| 25 | { |
Patrick Venture | 1cde5f9 | 2018-11-07 08:26:47 -0800 | [diff] [blame] | 26 | public: |
| 27 | LpcDataHandler() = default; |
| 28 | |
Patrick Venture | 0d2a813 | 2018-11-09 11:34:21 -0800 | [diff] [blame] | 29 | bool open() override; |
Patrick Venture | 0fbabf2 | 2018-11-09 11:54:12 -0800 | [diff] [blame] | 30 | bool close() override; |
Patrick Venture | 1cde5f9 | 2018-11-07 08:26:47 -0800 | [diff] [blame] | 31 | std::vector<std::uint8_t> copyFrom(std::uint32_t length) override; |
Patrick Venture | 8c53533 | 2018-11-08 15:58:00 -0800 | [diff] [blame] | 32 | bool write(const std::vector<std::uint8_t>& configuration) override; |
| 33 | std::vector<std::uint8_t> read() override; |
Patrick Venture | 1cde5f9 | 2018-11-07 08:26:47 -0800 | [diff] [blame] | 34 | }; |
| 35 | |
| 36 | } // namespace blobs |