blob: 27f0e03441ba3e5db2d63032f50847705ed456f1 [file] [log] [blame]
Patrick Venture1cde5f92018-11-07 08:26:47 -08001#pragma once
2
3#include "data_handler.hpp"
4
5#include <cstdint>
6#include <vector>
7
8namespace blobs
9{
10
Patrick Venture8c535332018-11-08 15:58:00 -080011struct 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 Venture1cde5f92018-11-07 08:26:47 -080024class LpcDataHandler : public DataInterface
25{
Patrick Venture1cde5f92018-11-07 08:26:47 -080026 public:
27 LpcDataHandler() = default;
28
29 std::vector<std::uint8_t> copyFrom(std::uint32_t length) override;
Patrick Venture8c535332018-11-08 15:58:00 -080030 bool write(const std::vector<std::uint8_t>& configuration) override;
31 std::vector<std::uint8_t> read() override;
Patrick Venture1cde5f92018-11-07 08:26:47 -080032};
33
34} // namespace blobs