diff --git a/libpfr/inc/spiDev.hpp b/libpfr/inc/spiDev.hpp
new file mode 100644
index 0000000..17a4f63
--- /dev/null
+++ b/libpfr/inc/spiDev.hpp
@@ -0,0 +1,95 @@
+/*
+// Copyright (c) 2019 Intel Corporation
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+*/
+
+#pragma once
+
+#include <stdio.h>
+#include <cstring>
+#include <experimental/filesystem>
+
+namespace intel
+{
+namespace pfr
+{
+
+/** @class SPIDev
+ *  @brief Responsible for handling file pointer
+ */
+class SPIDev
+{
+  private:
+    /** @brief handler for operating on file */
+    int fd = -1;
+
+  public:
+    SPIDev() = delete;
+    SPIDev(const SPIDev&) = delete;
+    SPIDev& operator=(const SPIDev&) = delete;
+    SPIDev(SPIDev&&) = delete;
+    SPIDev& operator=(SPIDev&&) = delete;
+
+    /** @brief Opens spi(mtd) device file
+     *
+     *  @param[in] devNo       - MTD device number
+     */
+    SPIDev(const std::string& spiDev) :
+        fd(open(spiDev.c_str(), O_RDWR | O_CLOEXEC))
+    {
+        if (fd < 0)
+        {
+            std::string msg = "Unable to open mtd device. errno=" +
+                              std::string(std::strerror(errno));
+            throw std::runtime_error(msg);
+        }
+    }
+
+    /** @brief Reads the byte data from SPI(MTD) device
+     *
+     *  @param[in] startAddr    - start address
+     *  @param[in] dataLen      - No of byte to read
+     *  @param[out] dataRes     - Out data pointer
+     */
+    void spiReadData(const uint32_t startAddr, const size_t dataLen,
+                     void* dataRes)
+    {
+        if (lseek(fd, startAddr, SEEK_SET) < 0)
+        {
+            std::string msg = "Failed to do lseek on mtd device. errno=" +
+                              std::string(std::strerror(errno));
+            throw std::runtime_error(msg);
+        }
+
+        if (read(fd, dataRes, dataLen) != dataLen)
+        {
+            std::string msg = "Failed to read on mtd device. errno=" +
+                              std::string(std::strerror(errno));
+            throw std::runtime_error(msg);
+        }
+
+        return;
+    }
+
+    virtual ~SPIDev()
+    {
+        if (!(fd < 0))
+        {
+            close(fd);
+        }
+    }
+};
+
+} // namespace pfr
+} // namespace intel
