File: sysman_mtd.h

package info (click to toggle)
intel-compute-runtime 26.05.37020.3-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 83,596 kB
  • sloc: cpp: 976,037; lisp: 2,096; sh: 704; makefile: 162
file content (42 lines) | stat: -rw-r--r-- 1,245 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
/*
 * Copyright (C) 2026 Intel Corporation
 *
 * SPDX-License-Identifier: MIT
 *
 */

#pragma once
#include "shared/source/helpers/non_copyable_or_moveable.h"
#include "shared/source/os_interface/linux/sys_calls.h"

#include "level_zero/ze_api.h"

#include <fcntl.h>
#include <map>
#include <memory>
#include <mtd/mtd-user.h>

namespace L0 {
namespace Sysman {

class MemoryTechnologyDeviceInterface : NEO::NonCopyableAndNonMovableClass {
  public:
    static std::unique_ptr<MemoryTechnologyDeviceInterface> create();
    virtual ze_result_t erase(const std::string &filePath, uint32_t offset, size_t size);
    virtual ze_result_t write(const std::string &filePath, uint32_t offset, const uint8_t *data, size_t size);
    virtual ze_result_t getDeviceInfo(const std::string &filePath, std::map<std::string, std::map<uint32_t, uint32_t>> &mtdRegionDeviceInfoMap);

    virtual ~MemoryTechnologyDeviceInterface() = default;
};

namespace MtdSysman {
struct SpiDescRegionBar {
    uint32_t base : 15; // Bits [26:12] of the region base address
    uint32_t reserved0 : 1;
    uint32_t limit : 15; // Bits [26:12] of region limit address (inclusive)
    uint32_t reserved1 : 1;
};
} // namespace MtdSysman

} // namespace Sysman
} // namespace L0