blob: c60b782b7699daaa8cca8ad0c14a77a1bdf61269 [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
Patrick Venture0d2a8132018-11-09 11:34:21 -080029 bool open() override;
Patrick Venture0fbabf22018-11-09 11:54:12 -080030 bool close() override;
Patrick Venture1cde5f92018-11-07 08:26:47 -080031 std::vector<std::uint8_t> copyFrom(std::uint32_t length) override;
Patrick Venture8c535332018-11-08 15:58:00 -080032 bool write(const std::vector<std::uint8_t>& configuration) override;
33 std::vector<std::uint8_t> read() override;
Patrick Venture1cde5f92018-11-07 08:26:47 -080034};
35
36} // namespace blobs