diff --git a/.clang-format b/.clang-format
old mode 100644
new mode 100755
index ea71ad6..ef6f54e
--- a/.clang-format
+++ b/.clang-format
@@ -5,7 +5,7 @@
 AlignAfterOpenBracket: Align
 AlignConsecutiveAssignments: false
 AlignConsecutiveDeclarations: false
-AlignEscapedNewlinesLeft: false
+AlignEscapedNewlines: Right
 AlignOperands:   true
 AlignTrailingComments: true
 AllowAllParametersOfDeclarationOnNextLine: true
@@ -14,13 +14,13 @@
 AllowShortFunctionsOnASingleLine: None
 AllowShortIfStatementsOnASingleLine: false
 AllowShortLoopsOnASingleLine: false
-AlwaysBreakAfterDefinitionReturnType: None
 AlwaysBreakAfterReturnType: None
 AlwaysBreakBeforeMultilineStrings: false
-AlwaysBreakTemplateDeclarations: true
+AlwaysBreakTemplateDeclarations: Yes
 BinPackArguments: true
 BinPackParameters: true
 BraceWrapping:
+  AfterCaseLabel:  true
   AfterClass:      true
   AfterControlStatement: true
   AfterEnum:       true
@@ -29,15 +29,22 @@
   AfterObjCDeclaration: true
   AfterStruct:     true
   AfterUnion:      true
+  AfterExternBlock: true
   BeforeCatch:     true
   BeforeElse:      true
   IndentBraces:    false
+  SplitEmptyFunction:   false
+  SplitEmptyRecord:     false
+  SplitEmptyNamespace:  false
 BreakBeforeBinaryOperators: None
 BreakBeforeBraces: Custom
 BreakBeforeTernaryOperators: true
 BreakConstructorInitializers: AfterColon
+BreakInheritanceList: AfterColon
+BreakStringLiterals: true
 ColumnLimit:     80
 CommentPragmas:  '^ IWYU pragma:'
+CompactNamespaces: false
 ConstructorInitializerAllOnOneLineOrOnePerLine: false
 ConstructorInitializerIndentWidth: 4
 ContinuationIndentWidth: 4
@@ -51,17 +58,21 @@
 IncludeBlocks: Regroup
 IncludeCategories:
   - Regex:           '^[<"](gtest|gmock)'
-    Priority:        5
+    Priority:        7
   - Regex:           '^"config.h"'
     Priority:        -1
-  - Regex:           '^".*\.hpp"'
+  - Regex:           '^".*\.h"'
     Priority:        1
-  - Regex:           '^<.*\.h>'
+  - Regex:           '^".*\.hpp"'
     Priority:        2
-  - Regex:           '^<.*'
+  - Regex:           '^<.*\.h>'
     Priority:        3
-  - Regex:           '.*'
+  - Regex:           '^<.*\.hpp>'
     Priority:        4
+  - Regex:           '^<.*'
+    Priority:        5
+  - Regex:           '.*'
+    Priority:        6
 IndentCaseLabels: true
 IndentWidth:     4
 IndentWrappedFunctionNames: true
@@ -83,8 +94,13 @@
 SortIncludes:    true
 SortUsingDeclarations: true
 SpaceAfterCStyleCast: false
+SpaceAfterTemplateKeyword: true
 SpaceBeforeAssignmentOperators: true
+SpaceBeforeCpp11BracedList: false
+SpaceBeforeCtorInitializerColon: true
+SpaceBeforeInheritanceColon: true
 SpaceBeforeParens: ControlStatements
+SpaceBeforeRangeBasedForLoopColon: true
 SpaceInEmptyParentheses: false
 SpacesBeforeTrailingComments: 1
 SpacesInAngles:  false
diff --git a/CMakeLists.txt b/CMakeLists.txt
old mode 100644
new mode 100755
index 3503c7f..a821080
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -31,6 +31,16 @@
 include_directories (${DBUSINTERFACE_INCLUDE_DIRS})
 link_directories (${DBUSINTERFACE_LIBRARY_DIRS})
 
+# boost
+include_directories (SYSTEM ${CMAKE_BINARY_DIR}/boost-src)
+set (CMAKE_PREFIX_PATH ${CMAKE_BINARY_DIR}/boost-src ${CMAKE_PREFIX_PATH})
+add_definitions (-DBOOST_ERROR_CODE_HEADER_ONLY)
+add_definitions (-DBOOST_SYSTEM_NO_DEPRECATED)
+add_definitions (-DBOOST_ALL_NO_LIB)
+add_definitions (-DBOOST_NO_RTTI)
+add_definitions (-DBOOST_NO_TYPEID)
+add_definitions (-DBOOST_ASIO_DISABLE_THREADS)
+
 set (SRC_FILES src/mdrv2.cpp src/mdrv2_main.cpp src/cpu.cpp src/dimm.cpp
      src/system.cpp)
 
@@ -48,4 +58,46 @@
 target_link_libraries (smbiosmdrv2app ${SDBUSPLUSPLUS_LIBRARIES})
 target_link_libraries (smbiosmdrv2app phosphor_logging)
 
-install (TARGETS smbiosmdrv2app DESTINATION bin)
+add_executable (cpuinfoapp src/cpuinfo_main.cpp)
+target_link_libraries (cpuinfoapp ${SYSTEMD_LIBRARIES})
+target_link_libraries (cpuinfoapp ${DBUSINTERFACE_LIBRARIES})
+target_link_libraries (cpuinfoapp ${SDBUSPLUSPLUS_LIBRARIES})
+target_link_libraries (cpuinfoapp phosphor_logging)
+target_link_libraries (cpuinfoapp i2c)
+target_link_libraries (cpuinfoapp peci)
+
+option (DIMM_DBUS "Expose DIMM D-Bus Interface" ON)
+
+if (DIMM_DBUS)
+    target_compile_definitions (smbiosmdrv2app PRIVATE DIMM_DBUS)
+endif ()
+
+option (YOCTO "Enable Building in Yocto" OFF)
+
+if (NOT YOCTO)
+    add_dependencies (cpuinfoapp libpeci)
+    externalproject_add (libpeci PREFIX ${CMAKE_BINARY_DIR}/libpeci
+                         GIT_REPOSITORY https://github.com/openbmc/libpeci.git
+                         GIT_TAG a2ceec2aa139277cebb62e1eda449ef60fa4c962
+                         INSTALL_COMMAND "")
+
+    externalproject_get_property (libpeci SOURCE_DIR)
+    include_directories (${SOURCE_DIR})
+
+    externalproject_get_property (libpeci BINARY_DIR)
+    add_library (peci SHARED IMPORTED)
+    set_target_properties (peci
+                           PROPERTIES IMPORTED_LOCATION
+                                      ${BINARY_DIR}/libpeci.so)
+endif ()
+
+install (TARGETS smbiosmdrv2app DESTINATION sbin)
+
+install (TARGETS cpuinfoapp
+         RUNTIME DESTINATION bin
+         LIBRARY DESTINATION lib
+         ARCHIVE DESTINATION lib/static)
+
+set (SERVICE_FILES
+     ${PROJECT_SOURCE_DIR}/service_files/xyz.openbmc_project.cpuinfo.service)
+install (FILES ${SERVICE_FILES} DESTINATION /lib/systemd/system/)
diff --git a/LICENSE b/LICENSE
index 261eeb9..8dada3e 100644
--- a/LICENSE
+++ b/LICENSE
@@ -178,7 +178,7 @@
    APPENDIX: How to apply the Apache License to your work.
 
       To apply the Apache License to your work, attach the following
-      boilerplate notice, with the fields enclosed by brackets "[]"
+      boilerplate notice, with the fields enclosed by brackets "{}"
       replaced with your own identifying information. (Don't include
       the brackets!)  The text should be enclosed in the appropriate
       comment syntax for the file format. We also recommend that a
@@ -186,7 +186,7 @@
       same "printed page" as the copyright notice for easier
       identification within third-party archives.
 
-   Copyright [yyyy] [name of copyright owner]
+   Copyright {yyyy} {name of copyright owner}
 
    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
diff --git a/include/cpu.hpp b/include/cpu.hpp
index 22b6c08..5c8ca86 100644
--- a/include/cpu.hpp
+++ b/include/cpu.hpp
@@ -15,12 +15,11 @@
 */
 
 #pragma once
-#include "smbios.hpp"
+#include "smbios_mdrv2.hpp"
 
 #include <xyz/openbmc_project/Inventory/Decorator/Asset/server.hpp>
+#include <xyz/openbmc_project/Inventory/Decorator/Revision/server.hpp>
 #include <xyz/openbmc_project/Inventory/Item/Cpu/server.hpp>
-#include <xyz/openbmc_project/Inventory/Item/server.hpp>
-#include <xyz/openbmc_project/State/Decorator/OperationalStatus/server.hpp>
 
 namespace phosphor
 {
@@ -28,11 +27,11 @@
 namespace smbios
 {
 
-// Definition follow smbios spec DSP0134 3.0.0
-static const std::map<uint8_t, const char*> processorTypeTable = {
-    {0x1, "Other"},          {0x2, "Unknown"},       {0x3, "Central Processor"},
-    {0x4, "Math Processor"}, {0x5, "DSP Processor"}, {0x6, "Video Processor"},
-};
+using rev =
+    sdbusplus::xyz::openbmc_project::Inventory::Decorator::server::Revision;
+using asset =
+    sdbusplus::xyz::openbmc_project::Inventory::Decorator::server::Asset;
+using processor = sdbusplus::xyz::openbmc_project::Inventory::Item::server::Cpu;
 
 // Definition follow smbios spec DSP0134 3.0.0
 static const std::map<uint8_t, const char*> familyTable = {
@@ -71,34 +70,25 @@
 };
 
 // Definition follow smbios spec DSP0134 3.0.0
-static const std::array<std::string, 16> characteristicsTable{
-    "Reserved",
-    "Unknown",
-    "64-bit Capable",
-    "Multi-Core",
-    "Hardware Thread",
-    "Execute Protection",
-    "Enhanced Virtualization",
-    "Power/Performance Control",
-    "Reserved",
-    "Reserved",
-    "Reserved",
-    "Reserved",
-    "Reserved",
-    "Reserved",
-    "Reserved",
-    "Reserved"};
+static const std::array<std::optional<processor::Capability>, 16>
+    characteristicsTable{std::nullopt,
+                         std::nullopt,
+                         processor::Capability::Capable64bit,
+                         processor::Capability::MultiCore,
+                         processor::Capability::HardwareThread,
+                         processor::Capability::ExecuteProtection,
+                         processor::Capability::EnhancedVirtualization,
+                         processor::Capability::PowerPerformanceControl,
+                         std::nullopt,
+                         std::nullopt,
+                         std::nullopt,
+                         std::nullopt,
+                         std::nullopt,
+                         std::nullopt,
+                         std::nullopt,
+                         std::nullopt};
 
-class Cpu
-    : sdbusplus::server::object::object<
-          sdbusplus::xyz::openbmc_project::Inventory::Item::server::Cpu>,
-      sdbusplus::server::object::object<
-          sdbusplus::xyz::openbmc_project::Inventory::server::Item>,
-      sdbusplus::server::object::object<
-          sdbusplus::xyz::openbmc_project::Inventory::Decorator::server::Asset>,
-      sdbusplus::server::object::object<
-          sdbusplus::xyz::openbmc_project::State::Decorator::server::
-              OperationalStatus>
+class Cpu : sdbusplus::server::object_t<processor, asset, rev>
 {
   public:
     Cpu() = delete;
@@ -110,37 +100,14 @@
 
     Cpu(sdbusplus::bus::bus& bus, const std::string& objPath,
         const uint8_t& cpuId, uint8_t* smbiosTableStorage) :
-        sdbusplus::server::object::object<
-            sdbusplus::xyz::openbmc_project::Inventory::Item::server::Cpu>(
-            bus, objPath.c_str()),
-        sdbusplus::server::object::object<
-            sdbusplus::xyz::openbmc_project::Inventory::Decorator::server::
-                Asset>(bus, objPath.c_str()),
-        sdbusplus::server::object::object<
-            sdbusplus::xyz::openbmc_project::Inventory::server::Item>(
-            bus, objPath.c_str()),
-        sdbusplus::server::object::object<
-            sdbusplus::xyz::openbmc_project::State::Decorator::server::
-                OperationalStatus>(bus, objPath.c_str()),
+        sdbusplus::server::object_t<processor, asset, rev>(bus,
+                                                           objPath.c_str()),
         cpuNum(cpuId), storage(smbiosTableStorage)
     {
-        processorInfoUpdate();
+        infoUpdate();
     }
 
-    void processorInfoUpdate(void);
-
-    std::string processorSocket(std::string value) override;
-    std::string processorType(std::string value) override;
-    std::string processorFamily(std::string value) override;
-    std::string manufacturer(std::string value) override;
-    uint32_t processorId(uint32_t value) override;
-    std::string processorVersion(std::string value) override;
-    uint16_t processorMaxSpeed(uint16_t value) override;
-    std::string processorCharacteristics(std::string value) override;
-    uint16_t processorCoreCount(uint16_t value) override;
-    uint16_t processorThreadCount(uint16_t value) override;
-    bool present(bool value) override;
-    bool functional(bool value) override;
+    void infoUpdate(void);
 
   private:
     uint8_t cpuNum;
@@ -180,16 +147,14 @@
         uint16_t threadCount2;
     } __attribute__((packed));
 
-    void cpuSocket(const uint8_t positionNum, const uint8_t structLen,
-                   uint8_t* dataIn);
-    void cpuType(const uint8_t value);
-    void cpuFamily(const uint8_t value);
-    void cpuManufacturer(const uint8_t positionNum, const uint8_t structLen,
-                         uint8_t* dataIn);
-    void cpuVersion(const uint8_t positionNum, const uint8_t structLen,
-                    uint8_t* dataIn);
-    void cpuCharacteristics(const uint16_t value);
-    void cpuStatus(const uint8_t value);
+    void socket(const uint8_t positionNum, const uint8_t structLen,
+                uint8_t* dataIn);
+    void family(const uint8_t value);
+    void manufacturer(const uint8_t positionNum, const uint8_t structLen,
+                      uint8_t* dataIn);
+    void version(const uint8_t positionNum, const uint8_t structLen,
+                 uint8_t* dataIn);
+    void characteristics(const uint16_t value);
 };
 
 } // namespace smbios
diff --git a/include/cpuinfo.hpp b/include/cpuinfo.hpp
new file mode 100644
index 0000000..796ed4c
--- /dev/null
+++ b/include/cpuinfo.hpp
@@ -0,0 +1,57 @@
+/*
+// Copyright (c) 2020 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 <sdbusplus/asio/object_server.hpp>
+#include <xyz/openbmc_project/Inventory/Decorator/Asset/server.hpp>
+
+namespace phosphor
+{
+namespace cpu_info
+{
+static constexpr char const* cpuInfoObject = "xyz.openbmc_project.CPUInfo";
+static constexpr char const* cpuInfoPath = "/xyz/openbmc_project/CPUInfo";
+static constexpr char const* cpuInfoInterface = "xyz.openbmc_project.CPUInfo";
+
+static constexpr const int peciCheckInterval = 10;
+
+/** \ todo add cpu interface to CPUInfo and consolidate with smbios service
+ * using processor =
+    sdbusplus::xyz::openbmc_project::Inventory::Item::server::Cpu;
+*/
+using asset =
+    sdbusplus::xyz::openbmc_project::Inventory::Decorator::server::Asset;
+
+struct CPUInfo : sdbusplus::server::object_t<asset>
+{
+  public:
+    CPUInfo() = delete;
+    CPUInfo(const CPUInfo&) = delete;
+    CPUInfo& operator=(const CPUInfo&) = delete;
+    CPUInfo(CPUInfo&&) = delete;
+    CPUInfo& operator=(CPUInfo&&) = delete;
+    ~CPUInfo() = default;
+
+    CPUInfo(sdbusplus::bus::bus& bus, const std::string& path) :
+        sdbusplus::server::object_t<asset>(bus, path.c_str())
+    {}
+
+  private:
+};
+
+} // namespace cpu_info
+} // namespace phosphor
diff --git a/include/dimm.hpp b/include/dimm.hpp
index ec0a4e9..7d69a29 100644
--- a/include/dimm.hpp
+++ b/include/dimm.hpp
@@ -15,7 +15,7 @@
 */
 
 #pragma once
-#include "smbios.hpp"
+#include "smbios_mdrv2.hpp"
 
 #include <xyz/openbmc_project/Inventory/Decorator/Asset/server.hpp>
 #include <xyz/openbmc_project/Inventory/Item/Dimm/server.hpp>
@@ -29,11 +29,11 @@
 using DeviceType =
     sdbusplus::xyz::openbmc_project::Inventory::Item::server::Dimm::DeviceType;
 
-class Dimm
-    : sdbusplus::server::object::object<
-          sdbusplus::xyz::openbmc_project::Inventory::Item::server::Dimm>,
-      sdbusplus::server::object::object<
-          sdbusplus::xyz::openbmc_project::Inventory::Decorator::server::Asset>
+class Dimm :
+    sdbusplus::server::object::object<
+        sdbusplus::xyz::openbmc_project::Inventory::Item::server::Dimm>,
+    sdbusplus::server::object::object<
+        sdbusplus::xyz::openbmc_project::Inventory::Decorator::server::Asset>
 {
   public:
     Dimm() = delete;
@@ -88,34 +88,48 @@
                        uint8_t* dataIn);
     void dimmPartNum(const uint8_t positionNum, const uint8_t structLen,
                      uint8_t* dataIn);
-
-    struct MemoryInfo
-    {
-        uint8_t type;
-        uint8_t length;
-        uint16_t handle;
-        uint16_t phyArrayHandle;
-        uint16_t errInfoHandle;
-        uint16_t totalWidth;
-        uint16_t dataWidth;
-        uint16_t size;
-        uint8_t formFactor;
-        uint8_t deviceSet;
-        uint8_t deviceLocator;
-        uint8_t bankLocator;
-        uint8_t memoryType;
-        uint16_t typeDetail;
-        uint16_t speed;
-        uint8_t manufacturer;
-        uint8_t serialNum;
-        uint8_t assetTag;
-        uint8_t partNum;
-        uint8_t attributes;
-        uint32_t extendedSize;
-        uint16_t confClockSpeed;
-    } __attribute__((packed));
 };
 
+struct MemoryInfo
+{
+    uint8_t type;
+    uint8_t length;
+    uint16_t handle;
+    uint16_t phyArrayHandle;
+    uint16_t errInfoHandle;
+    uint16_t totalWidth;
+    uint16_t dataWidth;
+    uint16_t size;
+    uint8_t formFactor;
+    uint8_t deviceSet;
+    uint8_t deviceLocator;
+    uint8_t bankLocator;
+    uint8_t memoryType;
+    uint16_t typeDetail;
+    uint16_t speed;
+    uint8_t manufacturer;
+    uint8_t serialNum;
+    uint8_t assetTag;
+    uint8_t partNum;
+    uint8_t attributes;
+    uint32_t extendedSize;
+    uint16_t confClockSpeed;
+    uint16_t minimumVoltage;
+    uint16_t maximumVoltage;
+    uint16_t configuredVoltage;
+    uint8_t memoryTechnology;
+    uint16_t memoryOperatingModeCap;
+    uint8_t firwareVersion;
+    uint16_t modelManufId;
+    uint16_t modelProdId;
+    uint16_t memSubConManufId;
+    uint16_t memSubConProdId;
+    uint64_t nvSize;
+    uint64_t volatileSize;
+    uint64_t cacheSize;
+    uint64_t logicalSize;
+} __attribute__((packed));
+
 const std::map<uint8_t, DeviceType> dimmTypeTable = {
     {0x1, DeviceType::Other},         {0x2, DeviceType::Unknown},
     {0x3, DeviceType::DRAM},          {0x4, DeviceType::EDRAM},
diff --git a/include/mdrv2.hpp b/include/mdrv2.hpp
index 48df53e..8f03579 100644
--- a/include/mdrv2.hpp
+++ b/include/mdrv2.hpp
@@ -1,5 +1,5 @@
 /*
-// Copyright (c) 2019 Intel Corporation
+// Copyright (c) 2018 Intel Corporation
 //
 // Licensed under the Apache License, Version 2.0 (the "License");
 // you may not use this file except in compliance with the License.
@@ -17,93 +17,41 @@
 #pragma once
 #include "cpu.hpp"
 #include "dimm.hpp"
-#include "smbios.hpp"
+#include "smbios_mdrv2.hpp"
 #include "system.hpp"
 
 #include <sys/stat.h>
 #include <sys/types.h>
 #include <unistd.h>
 
+#include <boost/asio/io_context.hpp>
+#include <boost/asio/steady_timer.hpp>
+#include <boost/container/flat_map.hpp>
 #include <phosphor-logging/elog-errors.hpp>
 #include <phosphor-logging/log.hpp>
+#include <sdbusplus/asio/object_server.hpp>
 #include <sdbusplus/server.hpp>
 #include <sdbusplus/timer.hpp>
-#include <smbios.hpp>
 #include <xyz/openbmc_project/Smbios/MDR_V2/server.hpp>
 
-static constexpr int limitEntryLen = 0xff;
-static constexpr uint8_t mdr2Version = 2;
-static constexpr uint32_t mdr2SMSize = 0x00100000;
-static constexpr uint32_t mdr2SMBaseAddress = 0x9FF00000;
-static constexpr const char* mdrType2File = "/var/lib/smbios/smbios2";
-static constexpr const char* mdrV2Path = "/xyz/openbmc_project/Smbios/MDR_V2";
+sdbusplus::asio::object_server& getObjectServer(void);
 
-enum class MDR2SMBIOSStatusEnum
-{
-    mdr2Init = 0,
-    mdr2Loaded = 1,
-    mdr2Updated = 2,
-    mdr2Updating = 3
-};
-
-enum class MDR2DirLockEnum
-{
-    mdr2DirUnlock = 0,
-    mdr2DirLock = 1
-};
-
-typedef struct
-{
-    uint8_t dataInfo[16];
-} DataIdStruct;
-
-typedef struct
-{
-    DataIdStruct id;
-    uint32_t size;
-    uint32_t dataSetSize;
-    uint32_t dataVersion;
-    uint32_t timestamp;
-} Mdr2DirEntry;
-
-typedef struct
-{
-    Mdr2DirEntry common;
-    MDR2SMBIOSStatusEnum stage;
-    MDR2DirLockEnum lock;
-    uint16_t lockHandle;
-    uint32_t xferBuff;
-    uint32_t xferSize;
-    uint32_t maxDataSize;
-    uint8_t* dataStorage;
-} Mdr2DirLocalStruct;
-
-typedef struct
-{
-    uint8_t agentVersion;
-    uint8_t dirVersion;
-    uint8_t dirEntries;
-    uint8_t status; // valid / locked / etc
-    uint8_t remoteDirVersion;
-    uint16_t sessionHandle;
-    Mdr2DirLocalStruct dir[maxDirEntries];
-} Mdr2DirStruct;
-
-struct MDRSMBIOSHeader
-{
-    uint8_t dirVer;
-    uint8_t mdrType;
-    uint32_t timestamp;
-    uint32_t dataSize;
-} __attribute__((packed));
-
+using RecordVariant =
+    std::variant<std::string, uint64_t, uint32_t, uint16_t, uint8_t>;
 namespace phosphor
 {
 namespace smbios
 {
 
-class MDR_V2 : sdbusplus::server::object::object<
-                   sdbusplus::xyz::openbmc_project::Smbios::server::MDR_V2>
+static constexpr const char* mdrV2Path = "/xyz/openbmc_project/Smbios/MDR_V2";
+static constexpr const char* smbiosPath = "/xyz/openbmc_project/Smbios";
+static constexpr const char* smbiosInterfaceName =
+    "xyz.openbmc_project.Smbios.GetRecordType";
+constexpr const int limitEntryLen = 0xff;
+
+class MDR_V2 :
+    sdbusplus::server::object::object<
+        sdbusplus::xyz::openbmc_project::Smbios::server::MDR_V2>
 {
   public:
     MDR_V2() = delete;
@@ -113,10 +61,12 @@
     MDR_V2& operator=(MDR_V2&&) = delete;
     ~MDR_V2() = default;
 
-    MDR_V2(sdbusplus::bus::bus& bus, const char* path, sd_event* event) :
+    MDR_V2(sdbusplus::bus::bus& bus, const char* path,
+           boost::asio::io_context& io) :
         sdbusplus::server::object::object<
             sdbusplus::xyz::openbmc_project::Smbios::server::MDR_V2>(bus, path),
-        bus(bus), timer(event, [&](void) { agentSynchronizeData(); })
+        bus(bus), timer(io), smbiosInterface(getObjectServer().add_interface(
+                                 smbiosPath, smbiosInterfaceName))
     {
 
         smbiosDir.agentVersion = smbiosAgentVersion;
@@ -132,6 +82,11 @@
         smbiosDir.dir[smbiosDirIndex].dataStorage = smbiosTableStorage;
 
         agentSynchronizeData();
+
+        smbiosInterface->register_method("GetRecordType", [this](size_t type) {
+            return getRecordType(type);
+        });
+        smbiosInterface->initialize();
     }
 
     std::vector<uint8_t> getDirectoryInformation(uint8_t dirIndex) override;
@@ -157,8 +112,11 @@
 
     uint8_t directoryEntries(uint8_t value) override;
 
+    std::vector<boost::container::flat_map<std::string, RecordVariant>>
+        getRecordType(size_t type);
+
   private:
-    Timer timer;
+    boost::asio::steady_timer timer;
 
     sdbusplus::bus::bus& bus;
 
@@ -180,6 +138,7 @@
     std::vector<std::unique_ptr<Cpu>> cpus;
     std::vector<std::unique_ptr<Dimm>> dimms;
     std::unique_ptr<System> system;
+    std::shared_ptr<sdbusplus::asio::dbus_interface> smbiosInterface;
 };
 
 } // namespace smbios
diff --git a/include/smbios.hpp b/include/smbios_mdrv2.hpp
similarity index 64%
rename from include/smbios.hpp
rename to include/smbios_mdrv2.hpp
index e6dc743..e53d709 100644
--- a/include/smbios.hpp
+++ b/include/smbios_mdrv2.hpp
@@ -1,5 +1,5 @@
 /*
-// Copyright (c) 2019 Intel Corporation
+// Copyright (c) 2018 Intel Corporation
 //
 // Licensed under the Apache License, Version 2.0 (the "License");
 // you may not use this file except in compliance with the License.
@@ -16,31 +16,50 @@
 
 #pragma once
 
+#include <phosphor-logging/elog-errors.hpp>
+
 #include <array>
 
-static constexpr uint16_t smbiosAgentId = 0x0101;
-static constexpr int smbiosDirIndex = 0;
-static constexpr int firstAgentIndex = 1;
-static constexpr uint8_t maxDirEntries = 4;
-static constexpr uint32_t pageMask = 0xf000;
-static constexpr uint8_t smbiosAgentVersion = 1;
-static constexpr uint32_t defaultTimeout = 20000;
-static constexpr uint32_t smbiosTableVersion = 15;
-static constexpr uint32_t smbiosSMMemoryOffset = 0;
-static constexpr uint32_t smbiosSMMemorySize = 1024 * 1024;
-static constexpr uint32_t smbiosTableTimestamp = 0x45464748;
-static constexpr uint32_t smbiosTableStorageSize = 64 * 1024;
+static constexpr const char* mdrType2File = "/var/lib/smbios/smbios2";
 static constexpr const char* smbiosPath = "/var/lib/smbios";
+
 static constexpr uint16_t mdrSMBIOSSize = 32 * 1024;
 
-static constexpr const char* cpuPath =
-    "/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu";
+constexpr uint16_t smbiosAgentId = 0x0101;
+constexpr int firstAgentIndex = 1;
 
-static constexpr const char* dimmPath =
-    "/xyz/openbmc_project/inventory/system/chassis/motherboard/dimm";
+constexpr uint8_t maxDirEntries = 4;
+constexpr uint32_t mdr2SMSize = 0x00100000;
+constexpr uint32_t mdr2SMBaseAddress = 0x9FF00000;
 
-static constexpr const char* systemPath =
-    "/xyz/openbmc_project/inventory/system/chassis/motherboard/bios";
+constexpr uint8_t mdrTypeII = 2;
+
+constexpr uint8_t mdr2Version = 2;
+constexpr uint8_t smbiosAgentVersion = 1;
+
+constexpr uint32_t pageMask = 0xf000;
+constexpr int smbiosDirIndex = 0;
+
+constexpr uint32_t smbiosTableVersion = 15;
+constexpr uint32_t smbiosTableTimestamp = 0x45464748;
+constexpr uint32_t smbiosSMMemoryOffset = 0;
+constexpr uint32_t smbiosSMMemorySize = 1024 * 1024;
+constexpr uint32_t smbiosTableStorageSize = 64 * 1024;
+constexpr uint32_t defaultTimeout = 20000;
+
+enum class MDR2SMBIOSStatusEnum
+{
+    mdr2Init = 0,
+    mdr2Loaded = 1,
+    mdr2Updated = 2,
+    mdr2Updating = 3
+};
+
+enum class MDR2DirLockEnum
+{
+    mdr2DirUnlock = 0,
+    mdr2DirLock = 1
+};
 
 enum class DirDataRequestEnum
 {
@@ -55,6 +74,60 @@
     flagIsLocked = 2
 };
 
+typedef struct
+{
+    uint8_t dataInfo[16];
+} DataIdStruct;
+
+typedef struct
+{
+    DataIdStruct id;
+    uint32_t size;
+    uint32_t dataSetSize;
+    uint8_t dataVersion;
+    uint32_t timestamp;
+} Mdr2DirEntry;
+
+typedef struct
+{
+    Mdr2DirEntry common;
+    MDR2SMBIOSStatusEnum stage;
+    MDR2DirLockEnum lock;
+    uint16_t lockHandle;
+    uint32_t xferBuff;
+    uint32_t xferSize;
+    uint32_t maxDataSize;
+    uint8_t* dataStorage;
+} Mdr2DirLocalStruct;
+
+typedef struct
+{
+    uint8_t agentVersion;
+    uint8_t dirVersion;
+    uint8_t dirEntries;
+    uint8_t status; // valid / locked / etc
+    uint8_t remoteDirVersion;
+    uint16_t sessionHandle;
+    Mdr2DirLocalStruct dir[maxDirEntries];
+} Mdr2DirStruct;
+
+struct MDRSMBIOSHeader
+{
+    uint8_t dirVer;
+    uint8_t mdrType;
+    uint32_t timestamp;
+    uint32_t dataSize;
+} __attribute__((packed));
+
+static constexpr const char* cpuPath =
+    "/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu";
+
+static constexpr const char* dimmPath =
+    "/xyz/openbmc_project/inventory/system/chassis/motherboard/dimm";
+
+static constexpr const char* systemPath =
+    "/xyz/openbmc_project/inventory/system/chassis/motherboard/bios";
+
 typedef enum
 {
     biosType = 0,
@@ -101,7 +174,8 @@
 
 // When first time run getSMBIOSTypePtr, need to send the RegionS[].regionData
 // to smbiosDataIn
-static inline uint8_t* getSMBIOSTypePtr(uint8_t* smbiosDataIn, uint8_t typeId)
+static inline uint8_t* getSMBIOSTypePtr(uint8_t* smbiosDataIn, uint8_t typeId,
+                                        size_t size = 0)
 {
     if (smbiosDataIn == nullptr)
     {
@@ -110,9 +184,10 @@
     char* smbiosData = reinterpret_cast<char*>(smbiosDataIn);
     while ((*smbiosData != '\0') || (*(smbiosData + 1) != '\0'))
     {
+        uint32_t len = *(smbiosData + 1);
         if (*smbiosData != typeId)
         {
-            uint32_t len = *(smbiosData + 1);
+
             smbiosData += len;
             while ((*smbiosData != '\0') || (*(smbiosData + 1) != '\0'))
             {
@@ -126,6 +201,12 @@
             smbiosData += separateLen;
             continue;
         }
+        if (len < size)
+        {
+            phosphor::logging::log<phosphor::logging::level::ERR>(
+                "Record size mismatch!");
+            return nullptr;
+        }
         return reinterpret_cast<uint8_t*>(smbiosData);
     }
     return nullptr;
diff --git a/include/system.hpp b/include/system.hpp
index ea1eccf..cf69cb7 100644
--- a/include/system.hpp
+++ b/include/system.hpp
@@ -15,7 +15,7 @@
 */
 
 #pragma once
-#include "smbios.hpp"
+#include "smbios_mdrv2.hpp"
 
 #include <xyz/openbmc_project/Common/UUID/server.hpp>
 #include <xyz/openbmc_project/Inventory/Decorator/Revision/server.hpp>
@@ -26,11 +26,11 @@
 namespace smbios
 {
 
-class System : sdbusplus::server::object::object<
-                   sdbusplus::xyz::openbmc_project::Common::server::UUID>,
-               sdbusplus::server::object::object<
-                   sdbusplus::xyz::openbmc_project::Inventory::Decorator::
-                       server::Revision>
+class System :
+    sdbusplus::server::object::object<
+        sdbusplus::xyz::openbmc_project::Common::server::UUID>,
+    sdbusplus::server::object::object<
+        sdbusplus::xyz::openbmc_project::Inventory::Decorator::server::Revision>
 {
   public:
     System() = delete;
diff --git a/service_files/xyz.openbmc_project.cpuinfo.service b/service_files/xyz.openbmc_project.cpuinfo.service
new file mode 100644
index 0000000..e29bf7e
--- /dev/null
+++ b/service_files/xyz.openbmc_project.cpuinfo.service
@@ -0,0 +1,14 @@
+[Unit]
+Description=Intel BMC CPU Info
+Requires=smbios-mdrv2.service
+After=smbios-mdrv2.service
+
+[Service]
+Restart=always
+ExecStart=/usr/bin/cpuinfoapp
+Type=dbus
+BusName=xyz.openbmc_project.CPUInfo
+Nice=19
+
+[Install]
+WantedBy=multi-user.target
diff --git a/src/cpu.cpp b/src/cpu.cpp
index ffef3cf..90c1191 100644
--- a/src/cpu.cpp
+++ b/src/cpu.cpp
@@ -16,7 +16,7 @@
 
 #include "cpu.hpp"
 
-#include <iostream>
+#include <bitset>
 #include <map>
 
 namespace phosphor
@@ -24,169 +24,67 @@
 namespace smbios
 {
 
-void Cpu::cpuSocket(const uint8_t positionNum, const uint8_t structLen,
-                    uint8_t* dataIn)
+void Cpu::socket(const uint8_t positionNum, const uint8_t structLen,
+                 uint8_t* dataIn)
 {
     std::string result = positionToString(positionNum, structLen, dataIn);
 
-    processorSocket(result);
+    processor::socket(result);
 }
 
-std::string Cpu::processorSocket(std::string value)
-{
-    return sdbusplus::xyz::openbmc_project::Inventory::Item::server::Cpu::
-        processorSocket(value);
-}
-
-void Cpu::cpuType(const uint8_t value)
-{
-    std::map<uint8_t, const char*>::const_iterator it =
-        processorTypeTable.find(value);
-    if (it == processorTypeTable.end())
-    {
-        processorType("Unknown Processor Type");
-    }
-    else
-    {
-        processorType(it->second);
-    }
-}
-
-std::string Cpu::processorType(std::string value)
-{
-    return sdbusplus::xyz::openbmc_project::Inventory::Item::server::Cpu::
-        processorType(value);
-}
-
-void Cpu::cpuFamily(const uint8_t value)
+void Cpu::family(const uint8_t value)
 {
     std::map<uint8_t, const char*>::const_iterator it = familyTable.find(value);
     if (it == familyTable.end())
     {
-        processorFamily("Unknown Processor Family");
+        processor::family("Unknown Processor Family");
     }
     else
     {
-        processorFamily(it->second);
+        processor::family(it->second);
     }
 }
 
-std::string Cpu::processorFamily(std::string value)
-{
-    return sdbusplus::xyz::openbmc_project::Inventory::Item::server::Cpu::
-        processorFamily(value);
-}
-
-void Cpu::cpuManufacturer(const uint8_t positionNum, const uint8_t structLen,
-                          uint8_t* dataIn)
+void Cpu::manufacturer(const uint8_t positionNum, const uint8_t structLen,
+                       uint8_t* dataIn)
 {
     std::string result = positionToString(positionNum, structLen, dataIn);
 
-    manufacturer(result);
+    asset::manufacturer(result);
 }
 
-std::string Cpu::manufacturer(std::string value)
-{
-    return sdbusplus::xyz::openbmc_project::Inventory::Decorator::server::
-        Asset::manufacturer(value);
-}
-
-uint32_t Cpu::processorId(uint32_t value)
-{
-    return sdbusplus::xyz::openbmc_project::Inventory::Item::server::Cpu::
-        processorId(value);
-}
-
-void Cpu::cpuVersion(const uint8_t positionNum, const uint8_t structLen,
-                     uint8_t* dataIn)
+void Cpu::version(const uint8_t positionNum, const uint8_t structLen,
+                  uint8_t* dataIn)
 {
     std::string result;
 
     result = positionToString(positionNum, structLen, dataIn);
 
-    processorVersion(result);
+    rev::version(result);
 }
 
-std::string Cpu::processorVersion(std::string value)
+void Cpu::characteristics(uint16_t value)
 {
-    return sdbusplus::xyz::openbmc_project::Inventory::Item::server::Cpu::
-        processorVersion(value);
-}
+    std::vector<processor::Capability> result;
+    std::optional<processor::Capability> cap;
 
-uint16_t Cpu::processorMaxSpeed(uint16_t value)
-{
-    return sdbusplus::xyz::openbmc_project::Inventory::Item::server::Cpu::
-        processorMaxSpeed(value);
-}
-
-void Cpu::cpuCharacteristics(uint16_t value)
-{
-    std::string result = "";
-    for (uint8_t index = 0; index < (8 * sizeof(value)); index++)
+    std::bitset<16> charBits = value;
+    for (uint8_t index = 0; index < charBits.size(); index++)
     {
-        if (value & 0x01)
+        if (charBits.test(index))
         {
-            result += characteristicsTable[index];
+            if (cap = characteristicsTable[index])
+            {
+                result.emplace_back(*cap);
+            }
         }
-        value >>= 1;
     }
 
-    processorCharacteristics(result);
-}
-
-std::string Cpu::processorCharacteristics(std::string value)
-{
-    return sdbusplus::xyz::openbmc_project::Inventory::Item::server::Cpu::
-        processorCharacteristics(value);
-}
-
-uint16_t Cpu::processorCoreCount(uint16_t value)
-{
-    return sdbusplus::xyz::openbmc_project::Inventory::Item::server::Cpu::
-        processorCoreCount(value);
-}
-
-uint16_t Cpu::processorThreadCount(uint16_t value)
-{
-    return sdbusplus::xyz::openbmc_project::Inventory::Item::server::Cpu::
-        processorThreadCount(value);
-}
-
-static constexpr const uint8_t populateMask = 1 << 6;
-static constexpr const uint8_t statusMask = 0x07;
-void Cpu::cpuStatus(uint8_t value)
-{
-    if (!(value & populateMask))
-    {
-        present(false);
-        functional(false);
-        return;
-    }
-    present(true);
-    if ((value & statusMask) == 1)
-    {
-        functional(true);
-    }
-    else
-    {
-        functional(false);
-    }
-}
-
-bool Cpu::present(bool value)
-{
-    return sdbusplus::xyz::openbmc_project::Inventory::server::Item::present(
-        value);
-}
-
-bool Cpu::functional(bool value)
-{
-    return sdbusplus::xyz::openbmc_project::State::Decorator::server::
-        OperationalStatus::functional(value);
+    processor::characteristics(result);
 }
 
 static constexpr uint8_t maxOldVersionCount = 0xff;
-void Cpu::processorInfoUpdate(void)
+void Cpu::infoUpdate(void)
 {
     uint8_t* dataIn = storage;
 
@@ -212,36 +110,34 @@
 
     auto cpuInfo = reinterpret_cast<struct ProcessorInfo*>(dataIn);
 
-    cpuSocket(cpuInfo->socketDesignation, cpuInfo->length,
-              dataIn);               // offset 4h
-    cpuType(cpuInfo->processorType); // offset 5h
-    cpuFamily(cpuInfo->family);      // offset 6h
-    cpuManufacturer(cpuInfo->manufacturer, cpuInfo->length,
-                    dataIn);                               // offset 7h
-    processorId(cpuInfo->id);                              // offset 8h
-    cpuVersion(cpuInfo->version, cpuInfo->length, dataIn); // offset 10h
-    processorMaxSpeed(cpuInfo->maxSpeed);                  // offset 14h
-    if (cpuInfo->coreCount < maxOldVersionCount)           // offset 23h or 2Ah
+    socket(cpuInfo->socketDesignation, cpuInfo->length,
+           dataIn); // offset 4h
+    // this class is for type CPU  //offset 5h
+    family(cpuInfo->family); // offset 6h
+    manufacturer(cpuInfo->manufacturer, cpuInfo->length,
+                 dataIn);                               // offset 7h
+    id(cpuInfo->id);                                    // offset 8h
+    version(cpuInfo->version, cpuInfo->length, dataIn); // offset 10h
+    maxSpeedInMhz(cpuInfo->maxSpeed);                   // offset 14h
+    if (cpuInfo->coreCount < maxOldVersionCount)        // offset 23h or 2Ah
     {
-        processorCoreCount(cpuInfo->coreCount);
+        coreCount(cpuInfo->coreCount);
     }
     else
     {
-        processorCoreCount(cpuInfo->coreCount2);
+        coreCount(cpuInfo->coreCount2);
     }
 
     if (cpuInfo->threadCount < maxOldVersionCount) // offset 25h or 2Eh)
     {
-        processorThreadCount(cpuInfo->threadCount);
+        threadCount(cpuInfo->threadCount);
     }
     else
     {
-        processorThreadCount(cpuInfo->threadCount2);
+        threadCount(cpuInfo->threadCount2);
     }
 
-    cpuCharacteristics(cpuInfo->characteristics); // offset 26h
-
-    cpuStatus(cpuInfo->status);
+    characteristics(cpuInfo->characteristics); // offset 26h
 }
 
 } // namespace smbios
diff --git a/src/cpuinfo_main.cpp b/src/cpuinfo_main.cpp
new file mode 100644
index 0000000..dc3a8e8
--- /dev/null
+++ b/src/cpuinfo_main.cpp
@@ -0,0 +1,425 @@
+/*
+// Copyright (c) 2020 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.
+*/
+
+#include "cpuinfo.hpp"
+
+#include <errno.h>
+#include <fcntl.h>
+#include <stdio.h>
+#include <sys/ioctl.h>
+
+#include <boost/asio/io_service.hpp>
+#include <boost/asio/steady_timer.hpp>
+
+#include <optional>
+#include <sstream>
+#include <string>
+
+extern "C"
+{
+#include <i2c/smbus.h>
+#include <linux/i2c-dev.h>
+}
+
+#include <peci.h>
+
+#include <phosphor-logging/log.hpp>
+#include <sdbusplus/asio/object_server.hpp>
+
+namespace phosphor
+{
+namespace cpu_info
+{
+
+static constexpr const char* cpuPath =
+    "/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu";
+static constexpr const char* cpuInterfaceName =
+    "xyz.openbmc_project.Inventory.Decorator.Asset";
+static constexpr const char* cpuProcessName =
+    "xyz.openbmc_project.Smbios.MDR_V2";
+
+struct ProcessorInfo
+{
+    uint64_t ppin;
+    std::string sspec;
+};
+
+using CPUMap =
+    boost::container::flat_map<size_t,
+                               std::pair<int, std::shared_ptr<CPUInfo>>>;
+
+static CPUMap cpuMap = {};
+
+static std::unique_ptr<sdbusplus::bus::match_t> cpuUpdatedMatch = nullptr;
+
+static std::optional<std::string> readSSpec(uint8_t bus, uint8_t slaveAddr,
+                                            uint8_t regAddr, size_t count)
+{
+    unsigned long funcs = 0;
+    std::string devPath = "/dev/i2c-" + std::to_string(bus);
+
+    int fd = ::open(devPath.c_str(), O_RDWR);
+    if (fd < 0)
+    {
+        phosphor::logging::log<phosphor::logging::level::ERR>(
+            "Error in open!",
+            phosphor::logging::entry("PATH=%s", devPath.c_str()),
+            phosphor::logging::entry("SLAVEADDR=0x%x", slaveAddr));
+        return std::nullopt;
+    }
+
+    if (::ioctl(fd, I2C_FUNCS, &funcs) < 0)
+    {
+        phosphor::logging::log<phosphor::logging::level::ERR>(
+            "Error in I2C_FUNCS!",
+            phosphor::logging::entry("PATH=%s", devPath.c_str()),
+            phosphor::logging::entry("SLAVEADDR=0x%x", slaveAddr));
+        ::close(fd);
+        return std::nullopt;
+    }
+
+    if (!(funcs & I2C_FUNC_SMBUS_READ_BYTE_DATA))
+    {
+        phosphor::logging::log<phosphor::logging::level::ERR>(
+            "i2c bus does not support read!",
+            phosphor::logging::entry("PATH=%s", devPath.c_str()),
+            phosphor::logging::entry("SLAVEADDR=0x%x", slaveAddr));
+        ::close(fd);
+        return std::nullopt;
+    }
+
+    if (::ioctl(fd, I2C_SLAVE_FORCE, slaveAddr) < 0)
+    {
+        phosphor::logging::log<phosphor::logging::level::ERR>(
+            "Error in I2C_SLAVE_FORCE!",
+            phosphor::logging::entry("PATH=%s", devPath.c_str()),
+            phosphor::logging::entry("SLAVEADDR=0x%x", slaveAddr));
+        ::close(fd);
+        return std::nullopt;
+    }
+
+    int value = 0;
+    std::string sspec;
+    sspec.reserve(count);
+
+    for (size_t i = 0; i < count; i++)
+    {
+        value = ::i2c_smbus_read_byte_data(fd, regAddr++);
+        if (value < 0)
+        {
+            phosphor::logging::log<phosphor::logging::level::ERR>(
+                "Error in i2c read!",
+                phosphor::logging::entry("PATH=%s", devPath.c_str()),
+                phosphor::logging::entry("SLAVEADDR=0x%x", slaveAddr));
+            ::close(fd);
+            return std::nullopt;
+        }
+        if (!std::isprint(static_cast<unsigned char>(value)))
+        {
+            phosphor::logging::log<phosphor::logging::level::ERR>(
+                "Non printable value in sspec, ignored.");
+            continue;
+        }
+        sspec.push_back(static_cast<unsigned char>(value));
+    }
+    ::close(fd);
+    return sspec;
+}
+
+// PECI Client Address Map
+static void getPECIAddrMap(CPUMap& cpuMap)
+{
+    int idx = 0;
+    for (size_t i = MIN_CLIENT_ADDR; i <= MAX_CLIENT_ADDR; i++)
+    {
+        if (peci_Ping(i) == PECI_CC_SUCCESS)
+        {
+            cpuMap.emplace(std::make_pair(i, std::make_pair(idx, nullptr)));
+            idx++;
+        }
+    }
+}
+
+static std::shared_ptr<CPUInfo>
+    createCPUInfo(std::shared_ptr<sdbusplus::asio::connection>& conn,
+                  const int& cpu)
+{
+    std::string path = cpuPath + std::to_string(cpu);
+    std::shared_ptr<CPUInfo> cpuInfo = std::make_shared<CPUInfo>(
+        static_cast<sdbusplus::bus::bus&>(*conn), path);
+    return cpuInfo;
+}
+
+static void setAssetProperty(
+    std::shared_ptr<sdbusplus::asio::connection>& conn, const int& cpu,
+    const std::vector<std::pair<std::string, std::string>>& propValues)
+{
+
+    const std::string objectPath = cpuPath + std::to_string(cpu);
+    for (const auto& prop : propValues)
+    {
+        conn->async_method_call(
+            [](const boost::system::error_code ec) {
+                // Use "Set" method to set the property value.
+                if (ec)
+                {
+                    phosphor::logging::log<phosphor::logging::level::ERR>(
+                        "Cannot get CPU property!");
+                    return;
+                }
+            },
+            cpuProcessName, objectPath.c_str(),
+            "org.freedesktop.DBus.Properties", "Set", cpuInterfaceName,
+            prop.first.c_str(), std::variant<std::string>{prop.second});
+    }
+}
+
+static void createCpuUpdatedMatch(
+    std::shared_ptr<sdbusplus::asio::connection>& conn, const int& cpu,
+    const std::vector<std::pair<std::string, std::string>>& propValues)
+{
+    if (cpuUpdatedMatch)
+    {
+        return;
+    }
+
+    const std::string objectPath = cpuPath + std::to_string(cpu);
+
+    cpuUpdatedMatch = std::make_unique<sdbusplus::bus::match::match>(
+        static_cast<sdbusplus::bus::bus&>(*conn),
+        sdbusplus::bus::match::rules::interfacesAdded() +
+            sdbusplus::bus::match::rules::argNpath(0, objectPath.c_str()),
+        [&conn, cpu, propValues](sdbusplus::message::message& msg) {
+            std::string objectName;
+            boost::container::flat_map<
+                std::string,
+                boost::container::flat_map<std::string,
+                                           std::variant<std::string, uint64_t>>>
+                msgData;
+
+            msg.read(objectName, msgData);
+
+            // Check for xyz.openbmc_project.Inventory.Item.Cpu
+            // interface match
+            auto intfFound = msgData.find(cpuInterfaceName);
+            if (msgData.end() != intfFound)
+            {
+                setAssetProperty(conn, cpu, propValues);
+            }
+        });
+}
+
+// constants for reading QDF string from PIROM
+// Currently, they are the same for platforms with icx
+// \todo: move into configuration file to be more robust
+static constexpr uint8_t i2cBus = 13;
+static constexpr uint8_t slaveAddr0 = 0x50;
+static constexpr uint8_t regAddr = 0xf;
+static constexpr uint8_t sspecSize = 4;
+
+static void getProcessorInfo(std::shared_ptr<sdbusplus::asio::connection>& conn,
+                             sdbusplus::asio::object_server& objServer,
+                             CPUMap& cpuMap)
+{
+
+    for (auto& cpu : cpuMap)
+    {
+        uint8_t cc = 0;
+        CPUModel model{};
+        uint8_t stepping = 0;
+
+        /// \todo in a follwup patch
+        // CPUInfo will be updated as the centrol place for CPU information
+        // std::shared_ptr<CPUInfo> cpuInfo =
+        //    createCPUInfo(conn, cpu.second.first);
+        // cpu.second.second = cpuInfo;
+
+        if (peci_GetCPUID(cpu.first, &model, &stepping, &cc) != PECI_CC_SUCCESS)
+        {
+            phosphor::logging::log<phosphor::logging::level::ERR>(
+                "Cannot get CPUID!",
+                phosphor::logging::entry("PECIADDR=0x%x", cpu.first));
+            continue;
+        }
+
+        switch (model)
+        {
+            case icx:
+            {
+                // get processor ID
+                static constexpr uint8_t u8Size = 4; // default to a DWORD
+                static constexpr uint8_t u8PPINPkgIndex = 19;
+                static constexpr uint16_t u16PPINPkgParamHigh = 2;
+                static constexpr uint16_t u16PPINPkgParamLow = 1;
+                uint64_t cpuPPIN = 0;
+                uint32_t u32PkgValue = 0;
+
+                int ret = peci_RdPkgConfig(cpu.first, u8PPINPkgIndex,
+                                           u16PPINPkgParamLow, u8Size,
+                                           (uint8_t*)&u32PkgValue, &cc);
+                if (0 != ret)
+                {
+                    phosphor::logging::log<phosphor::logging::level::ERR>(
+                        "peci read package config failed at address",
+                        phosphor::logging::entry("PECIADDR=0x%x", cpu.first),
+                        phosphor::logging::entry("CC=0x%x", cc));
+                    u32PkgValue = 0;
+                }
+
+                cpuPPIN = u32PkgValue;
+                ret = peci_RdPkgConfig(cpu.first, u8PPINPkgIndex,
+                                       u16PPINPkgParamHigh, u8Size,
+                                       (uint8_t*)&u32PkgValue, &cc);
+                if (0 != ret)
+                {
+                    phosphor::logging::log<phosphor::logging::level::ERR>(
+                        "peci read package config failed at address",
+                        phosphor::logging::entry("PECIADDR=0x%x", cpu.first),
+                        phosphor::logging::entry("CC=0x%x", cc));
+                    cpuPPIN = 0;
+                    u32PkgValue = 0;
+                }
+
+                cpuPPIN |= static_cast<uint64_t>(u32PkgValue) << 32;
+
+                std::vector<std::pair<std::string, std::string>> values;
+
+                // set SerialNumber if cpuPPIN is valid
+                if (0 != cpuPPIN)
+                {
+                    std::stringstream stream;
+                    stream << std::hex << cpuPPIN;
+                    std::string serialNumber(stream.str());
+                    // cpuInfo->serialNumber(serialNumber);
+                    values.emplace_back(
+                        std::make_pair("SerialNumber", serialNumber));
+                }
+
+                // assuming the slaveAddress will be incrementing like peci
+                // client address
+                std::optional<std::string> sspec = readSSpec(
+                    i2cBus, static_cast<uint8_t>(slaveAddr0 + cpu.second.first),
+                    regAddr, sspecSize);
+                // cpuInfo->model(sspec.value_or(""));
+                values.emplace_back(
+                    std::make_pair("Model", sspec.value_or("")));
+
+                /// \todo in followup patch
+                // CPUInfo is created by this service
+                // update the below logic, which is needed because smbios
+                // service creates the cpu object
+                createCpuUpdatedMatch(conn, cpu.second.first, values);
+                setAssetProperty(conn, cpu.second.first, values);
+                break;
+            }
+            default:
+                phosphor::logging::log<phosphor::logging::level::INFO>(
+                    "in-compatible cpu for cpu asset info");
+                break;
+        }
+    }
+}
+
+static bool isPECIAvailable(void)
+{
+    for (size_t i = MIN_CLIENT_ADDR; i <= MAX_CLIENT_ADDR; i++)
+    {
+        if (peci_Ping(i) == PECI_CC_SUCCESS)
+        {
+            return true;
+        }
+    }
+    return false;
+}
+
+static void
+    peciAvailableCheck(boost::asio::steady_timer& peciWaitTimer,
+                       boost::asio::io_service& io,
+                       std::shared_ptr<sdbusplus::asio::connection>& conn,
+                       sdbusplus::asio::object_server& objServer)
+{
+    bool peciAvailable = isPECIAvailable();
+    if (peciAvailable)
+    {
+        // get the PECI client address list
+        getPECIAddrMap(cpuMap);
+        getProcessorInfo(conn, objServer, cpuMap);
+    }
+    if (!peciAvailable || !cpuMap.size())
+    {
+        peciWaitTimer.expires_after(
+            std::chrono::seconds(6 * peciCheckInterval));
+        peciWaitTimer.async_wait([&peciWaitTimer, &io, &conn, &objServer](
+                                     const boost::system::error_code& ec) {
+            if (ec)
+            {
+                // operation_aborted is expected if timer is canceled
+                // before completion.
+                if (ec != boost::asio::error::operation_aborted)
+                {
+                    phosphor::logging::log<phosphor::logging::level::ERR>(
+                        "PECI Available Check async_wait failed",
+                        phosphor::logging::entry("EC=0x%x", ec.value()));
+                }
+                return;
+            }
+            peciAvailableCheck(peciWaitTimer, io, conn, objServer);
+        });
+    }
+}
+
+} // namespace cpu_info
+} // namespace phosphor
+
+int main(int argc, char* argv[])
+{
+    // setup connection to dbus
+    boost::asio::io_service io;
+    std::shared_ptr<sdbusplus::asio::connection> conn =
+        std::make_shared<sdbusplus::asio::connection>(io);
+
+    // CPUInfo Object
+    conn->request_name(phosphor::cpu_info::cpuInfoObject);
+    sdbusplus::asio::object_server server =
+        sdbusplus::asio::object_server(conn);
+    sdbusplus::bus::bus& bus = static_cast<sdbusplus::bus::bus&>(*conn);
+    sdbusplus::server::manager::manager objManager(
+        bus, "/xyz/openbmc_project/inventory");
+
+    // Start the PECI check loop
+    boost::asio::steady_timer peciWaitTimer(
+        io, std::chrono::seconds(phosphor::cpu_info::peciCheckInterval));
+    peciWaitTimer.async_wait([&peciWaitTimer, &io, &conn,
+                              &server](const boost::system::error_code& ec) {
+        if (ec)
+        {
+            // operation_aborted is expected if timer is canceled
+            // before completion.
+            if (ec != boost::asio::error::operation_aborted)
+            {
+                phosphor::logging::log<phosphor::logging::level::ERR>(
+                    "PECI Available Check async_wait failed ",
+                    phosphor::logging::entry("EC=0x%x", ec.value()));
+            }
+            return;
+        }
+        phosphor::cpu_info::peciAvailableCheck(peciWaitTimer, io, conn, server);
+    });
+
+    io.run();
+
+    return 0;
+}
diff --git a/src/mdrv2.cpp b/src/mdrv2.cpp
index 07dcc6b..9a73c65 100644
--- a/src/mdrv2.cpp
+++ b/src/mdrv2.cpp
@@ -1,5 +1,5 @@
 /*
-// Copyright (c) 2019 Intel Corporation
+// Copyright (c) 2018 Intel Corporation
 //
 // Licensed under the Apache License, Version 2.0 (the "License");
 // you may not use this file except in compliance with the License.
@@ -18,11 +18,12 @@
 
 #include <sys/mman.h>
 
-#include <fstream>
 #include <phosphor-logging/elog-errors.hpp>
 #include <sdbusplus/exception.hpp>
 #include <xyz/openbmc_project/Smbios/MDR_V2/error.hpp>
 
+#include <fstream>
+
 namespace phosphor
 {
 namespace smbios
@@ -154,6 +155,17 @@
     return static_cast<uint8_t>(ret);
 }
 
+// If source variable size is 4 bytes (uint32_t) and destination is Vector type
+// is 1 byte (uint8_t), then by using this API can copy data byte by byte. For
+// Example copying data from smbiosDir.dir[idIndex].common.size and
+// smbiosDir.dir[idIndex].common.timestamp to vector variable responseInfo
+template <typename T>
+void appendReversed(std::vector<uint8_t>& vector, const T& value)
+{
+    auto data = reinterpret_cast<const uint8_t*>(&value);
+    std::reverse_copy(data, data + sizeof(value), std::back_inserter(vector));
+}
+
 std::vector<uint8_t> MDR_V2::getDataInformation(uint8_t idIndex)
 {
     std::vector<uint8_t> responseInfo;
@@ -170,14 +182,67 @@
         responseInfo.push_back(
             smbiosDir.dir[idIndex].common.id.dataInfo[index]);
     }
+
     responseInfo.push_back(smbiosValidFlag(idIndex));
-    responseInfo.push_back(smbiosDir.dir[idIndex].common.size);
+    appendReversed(responseInfo, smbiosDir.dir[idIndex].common.size);
     responseInfo.push_back(smbiosDir.dir[idIndex].common.dataVersion);
-    responseInfo.push_back(smbiosDir.dir[idIndex].common.timestamp);
+    appendReversed(responseInfo, smbiosDir.dir[idIndex].common.timestamp);
 
     return responseInfo;
 }
 
+bool MDR_V2::readDataFromFlash(MDRSMBIOSHeader* mdrHdr, uint8_t* data)
+{
+    if (mdrHdr == nullptr)
+    {
+        phosphor::logging::log<phosphor::logging::level::ERR>(
+            "Read data from flash error - Invalid mdr header");
+        return false;
+    }
+    if (data == nullptr)
+    {
+        phosphor::logging::log<phosphor::logging::level::ERR>(
+            "Read data from flash error - Invalid data point");
+        return false;
+    }
+    std::ifstream smbiosFile(mdrType2File, std::ios_base::binary);
+    if (!smbiosFile.good())
+    {
+        phosphor::logging::log<phosphor::logging::level::ERR>(
+            "Read data from flash error - Open MDRV2 table file failure");
+        return false;
+    }
+    smbiosFile.clear();
+    smbiosFile.seekg(0, std::ios_base::end);
+    int fileLength = smbiosFile.tellg();
+    smbiosFile.seekg(0, std::ios_base::beg);
+    if (fileLength < sizeof(MDRSMBIOSHeader))
+    {
+        phosphor::logging::log<phosphor::logging::level::ERR>(
+            "MDR V2 file size is smaller than mdr header");
+        return false;
+    }
+    smbiosFile.read(reinterpret_cast<char*>(mdrHdr), sizeof(MDRSMBIOSHeader));
+    if (mdrHdr->dataSize > smbiosTableStorageSize)
+    {
+        phosphor::logging::log<phosphor::logging::level::ERR>(
+            "Data size out of limitation");
+        smbiosFile.close();
+        return false;
+    }
+    fileLength -= sizeof(MDRSMBIOSHeader);
+    if (fileLength < mdrHdr->dataSize)
+    {
+        smbiosFile.read(reinterpret_cast<char*>(data), fileLength);
+    }
+    else
+    {
+        smbiosFile.read(reinterpret_cast<char*>(data), mdrHdr->dataSize);
+    }
+    smbiosFile.close();
+    return true;
+}
+
 bool MDR_V2::sendDirectoryInformation(uint8_t dirVersion, uint8_t dirIndex,
                                       uint8_t returnedEntries,
                                       uint8_t remainingEntries,
@@ -236,58 +301,6 @@
     return teminate;
 }
 
-bool MDR_V2::readDataFromFlash(MDRSMBIOSHeader* mdrHdr, uint8_t* data)
-{
-    if (mdrHdr == nullptr)
-    {
-        phosphor::logging::log<phosphor::logging::level::ERR>(
-            "Read data from flash error - Invalid mdr header");
-        return false;
-    }
-    if (data == nullptr)
-    {
-        phosphor::logging::log<phosphor::logging::level::ERR>(
-            "Read data from flash error - Invalid data point");
-        return false;
-    }
-    std::ifstream smbiosFile(mdrType2File, std::ios_base::binary);
-    if (!smbiosFile.good())
-    {
-        phosphor::logging::log<phosphor::logging::level::ERR>(
-            "Read data from flash error - Open MDRV2 table file failure");
-        return false;
-    }
-    smbiosFile.clear();
-    smbiosFile.seekg(0, std::ios_base::end);
-    int fileLength = smbiosFile.tellg();
-    smbiosFile.seekg(0, std::ios_base::beg);
-    if (fileLength < sizeof(MDRSMBIOSHeader))
-    {
-        phosphor::logging::log<phosphor::logging::level::ERR>(
-            "MDR V2 file size is smaller than mdr header");
-        return false;
-    }
-    smbiosFile.read(reinterpret_cast<char*>(mdrHdr), sizeof(MDRSMBIOSHeader));
-    if (mdrHdr->dataSize > smbiosTableStorageSize)
-    {
-        phosphor::logging::log<phosphor::logging::level::ERR>(
-            "Data size out of limitation");
-        smbiosFile.close();
-        return false;
-    }
-    fileLength -= sizeof(MDRSMBIOSHeader);
-    if (fileLength < mdrHdr->dataSize)
-    {
-        smbiosFile.read(reinterpret_cast<char*>(data), fileLength);
-    }
-    else
-    {
-        smbiosFile.read(reinterpret_cast<char*>(data), mdrHdr->dataSize);
-    }
-    smbiosFile.close();
-    return true;
-}
-
 bool MDR_V2::sendDataInformation(uint8_t idIndex, uint8_t flag,
                                  uint32_t dataLen, uint32_t dataVer,
                                  uint32_t timeStamp)
@@ -380,6 +393,8 @@
             bus, path, index, smbiosDir.dir[smbiosDirIndex].dataStorage));
     }
 
+#ifdef DIMM_DBUS
+
     dimms.clear();
 
     num = getTotalDimmSlot();
@@ -397,6 +412,8 @@
             bus, path, index, smbiosDir.dir[smbiosDirIndex].dataStorage));
     }
 
+#endif
+
     system.reset();
     system = std::make_unique<System>(
         bus, systemPath, smbiosDir.dir[smbiosDirIndex].dataStorage);
@@ -490,7 +507,6 @@
         smbiosDir.dir[smbiosDirIndex].stage = MDR2SMBIOSStatusEnum::mdr2Loaded;
         smbiosDir.dir[smbiosDirIndex].lock = MDR2DirLockEnum::mdr2DirUnlock;
     }
-    timer.stop();
     return true;
 }
 
@@ -505,9 +521,105 @@
     result.push_back(smbiosDir.dir[idIndex].common.dataVersion);
     result.push_back(smbiosDir.dir[idIndex].common.timestamp);
 
-    timer.start(usec);
+    timer.expires_after(usec);
+    timer.async_wait([this](boost::system::error_code ec) {
+        if (ec || this == nullptr)
+        {
+            phosphor::logging::log<phosphor::logging::level::ERR>(
+                "Timer Error!");
+            return;
+        }
+        agentSynchronizeData();
+    });
     return result;
 }
 
+std::vector<boost::container::flat_map<std::string, RecordVariant>>
+    MDR_V2::getRecordType(size_t type)
+{
+
+    std::vector<boost::container::flat_map<std::string, RecordVariant>> ret;
+    if (type == memoryDeviceType)
+    {
+
+        uint8_t* dataIn = smbiosDir.dir[smbiosDirIndex].dataStorage;
+
+        if (dataIn == nullptr)
+        {
+            throw std::runtime_error("Data not populated");
+        }
+
+        do
+        {
+            dataIn =
+                getSMBIOSTypePtr(dataIn, memoryDeviceType, sizeof(MemoryInfo));
+            if (dataIn == nullptr)
+            {
+                break;
+            }
+            boost::container::flat_map<std::string, RecordVariant>& record =
+                ret.emplace_back();
+
+            auto memoryInfo = reinterpret_cast<MemoryInfo*>(dataIn);
+
+            record["Type"] = memoryInfo->type;
+            record["Length"] = memoryInfo->length;
+            record["Handle"] = uint16_t(memoryInfo->handle);
+            record["Physical Memory Array Handle"] =
+                uint16_t(memoryInfo->phyArrayHandle);
+            record["Memory Error Information Handle"] =
+                uint16_t(memoryInfo->errInfoHandle);
+            record["Total Width"] = uint16_t(memoryInfo->totalWidth);
+            record["Data Width"] = uint16_t(memoryInfo->dataWidth);
+            record["Size"] = uint16_t(memoryInfo->size);
+            record["Form Factor"] = memoryInfo->formFactor;
+            record["Device Set"] = memoryInfo->deviceSet;
+            record["Device Locator"] = positionToString(
+                memoryInfo->deviceLocator, memoryInfo->length, dataIn);
+            record["Bank Locator"] = positionToString(
+                memoryInfo->bankLocator, memoryInfo->length, dataIn);
+            record["Memory Type"] = memoryInfo->memoryType;
+            record["Type Detail"] = uint16_t(memoryInfo->typeDetail);
+            record["Speed"] = uint16_t(memoryInfo->speed);
+            record["Manufacturer"] = positionToString(
+                memoryInfo->manufacturer, memoryInfo->length, dataIn);
+            record["Serial Number"] = positionToString(
+                memoryInfo->serialNum, memoryInfo->length, dataIn);
+            record["Asset Tag"] = positionToString(memoryInfo->assetTag,
+                                                   memoryInfo->length, dataIn);
+            record["Part Number"] = positionToString(
+                memoryInfo->partNum, memoryInfo->length, dataIn);
+            record["Attributes"] = memoryInfo->attributes;
+            record["Extended Size"] = uint32_t(memoryInfo->extendedSize);
+            record["Configured Memory Speed"] =
+                uint32_t(memoryInfo->confClockSpeed);
+            record["Minimum voltage"] = uint16_t(memoryInfo->minimumVoltage);
+            record["Maximum voltage"] = uint16_t(memoryInfo->maximumVoltage);
+            record["Configured voltage"] =
+                uint16_t(memoryInfo->configuredVoltage);
+            record["Memory Technology"] = memoryInfo->memoryTechnology;
+            record["Memory Operating Mode Capabilty"] =
+                uint16_t(memoryInfo->memoryOperatingModeCap);
+            record["Firmare Version"] = memoryInfo->firwareVersion;
+            record["Module Manufacturer ID"] =
+                uint16_t(memoryInfo->modelManufId);
+            record["Module Product ID"] = uint16_t(memoryInfo->modelProdId);
+            record["Memory Subsystem Controller Manufacturer ID"] =
+                uint16_t(memoryInfo->memSubConManufId);
+            record["Memory Subsystem Controller Product Id"] =
+                uint16_t(memoryInfo->memSubConProdId);
+            record["Non-volatile Size"] = uint64_t(memoryInfo->nvSize);
+            record["Volatile Size"] = uint64_t(memoryInfo->volatileSize);
+            record["Cache Size"] = uint64_t(memoryInfo->cacheSize);
+            record["Logical Size"] = uint64_t(memoryInfo->logicalSize);
+        } while ((dataIn = smbiosNextPtr(dataIn)) != nullptr);
+
+        return ret;
+    }
+
+    throw std::invalid_argument("Invalid record type");
+    return ret;
+}
+
 } // namespace smbios
 } // namespace phosphor
diff --git a/src/mdrv2_main.cpp b/src/mdrv2_main.cpp
index 42b874f..2699571 100644
--- a/src/mdrv2_main.cpp
+++ b/src/mdrv2_main.cpp
@@ -1,5 +1,5 @@
 /*
-// Copyright (c) 2019 Intel Corporation
+// Copyright (c) 2018 Intel Corporation
 //
 // Licensed under the Apache License, Version 2.0 (the "License");
 // you may not use this file except in compliance with the License.
@@ -16,33 +16,32 @@
 
 #include "mdrv2.hpp"
 
-#include <systemd/sd-event.h>
-
+#include <boost/asio/io_context.hpp>
 #include <phosphor-logging/elog-errors.hpp>
 #include <phosphor-logging/elog.hpp>
+#include <sdbusplus/asio/connection.hpp>
+#include <sdbusplus/asio/object_server.hpp>
+
+boost::asio::io_context io;
+auto connection = std::make_shared<sdbusplus::asio::connection>(io);
+auto objServer = sdbusplus::asio::object_server(connection);
+
+sdbusplus::asio::object_server& getObjectServer(void)
+{
+    return objServer;
+}
 
 int main(void)
 {
-    sd_event* events = nullptr;
-    sd_event_default(&events);
-    sdbusplus::bus::bus bus = sdbusplus::bus::new_default();
+    sdbusplus::bus::bus& bus = static_cast<sdbusplus::bus::bus&>(*connection);
     sdbusplus::server::manager::manager objManager(
         bus, "/xyz/openbmc_project/inventory");
-    bus.attach_event(events, SD_EVENT_PRIORITY_NORMAL);
+
     bus.request_name("xyz.openbmc_project.Smbios.MDR_V2");
 
-    phosphor::smbios::MDR_V2 mdrV2(bus, mdrV2Path, events);
+    phosphor::smbios::MDR_V2 mdrV2(bus, phosphor::smbios::mdrV2Path, io);
 
-    while (true)
-    {
-        int r = sd_event_run(events, (uint64_t)-1);
-        if (r < 0)
-        {
-            phosphor::logging::log<phosphor::logging::level::ERR>(
-                "Failure processing request",
-                phosphor::logging::entry("errno=0x%X", -r));
-            return -1;
-        }
-    }
+    io.run();
+
     return 0;
 }
