lpc_aspeed: add mapping implementation
Add mapper implementation for Aspeed.
Change-Id: I4bc1cbaaa6c0bf57424b0c881cb087153d63597c
Signed-off-by: Patrick Venture <venture@google.com>
diff --git a/lpc_aspeed.hpp b/lpc_aspeed.hpp
index 91e24af..47c7a4a 100644
--- a/lpc_aspeed.hpp
+++ b/lpc_aspeed.hpp
@@ -1,5 +1,6 @@
#pragma once
+#include "internal/sys.hpp"
#include "lpc_interface.hpp"
#include <memory>
@@ -10,13 +11,20 @@
class LpcMapperAspeed : public LpcMapperInterface
{
public:
- static std::unique_ptr<LpcMapperInterface> createAspeedMapper();
+ static std::unique_ptr<LpcMapperInterface>
+ createAspeedMapper(size_t regionSize);
- /* TODO: Needs reserved memory region's physical address and size. */
- LpcMapperAspeed() = default;
+ LpcMapperAspeed(size_t regionSize, const flash::internal::Sys* sys =
+ &flash::internal::sys_impl) :
+ regionSize(regionSize),
+ sys(sys){};
std::pair<std::uint32_t, std::uint32_t>
mapWindow(std::uint32_t address, std::uint32_t length) override;
+
+ private:
+ size_t regionSize;
+ const flash::internal::Sys* sys;
};
} // namespace blobs