blob: c528c3da8cbbae72a292e9fb564eda74c8ebd8ab [file] [log] [blame]
Patrick Venturee7728422018-11-14 20:16:33 -08001#pragma once
2
Patrick Venture7b91cbc2018-11-28 14:24:41 -08003#include "internal/sys.hpp"
Patrick Venture5251da92019-01-17 11:25:26 -08004#include "window_hw_interface.hpp"
Patrick Venturee7728422018-11-14 20:16:33 -08005
Patrick Venture92973f12018-11-16 21:00:44 -08006#include <memory>
7
Patrick Venturee7728422018-11-14 20:16:33 -08008namespace blobs
9{
10
Patrick Venture5251da92019-01-17 11:25:26 -080011class LpcMapperAspeed : public HardwareMapperInterface
Patrick Venturee7728422018-11-14 20:16:33 -080012{
13 public:
Patrick Venture5251da92019-01-17 11:25:26 -080014 static std::unique_ptr<HardwareMapperInterface>
Patrick Venture28abae72018-12-14 09:44:02 -080015 createAspeedMapper(std::size_t regionSize);
Patrick Venturee7728422018-11-14 20:16:33 -080016
Patrick Venture28abae72018-12-14 09:44:02 -080017 LpcMapperAspeed(std::size_t regionSize,
Patrick Venturefa9d0c92018-12-13 16:38:27 -080018 const internal::Sys* sys = &internal::sys_impl) :
Patrick Venture7b91cbc2018-11-28 14:24:41 -080019 regionSize(regionSize),
20 sys(sys){};
Patrick Venturee7728422018-11-14 20:16:33 -080021
22 std::pair<std::uint32_t, std::uint32_t>
23 mapWindow(std::uint32_t address, std::uint32_t length) override;
Patrick Venture7b91cbc2018-11-28 14:24:41 -080024
Patrick Venture517710d2019-01-17 11:37:40 -080025 std::vector<std::uint8_t> copyFrom(std::uint32_t length) override;
26
Patrick Venture7b91cbc2018-11-28 14:24:41 -080027 private:
Patrick Venture28abae72018-12-14 09:44:02 -080028 std::size_t regionSize;
Patrick Venturefa9d0c92018-12-13 16:38:27 -080029 const internal::Sys* sys;
Patrick Venturee7728422018-11-14 20:16:33 -080030};
31
32} // namespace blobs