hc
2023-12-08 01573e231f18eb2d99162747186f59511f56b64d
kernel/include/linux/soc/rockchip/rk_vendor_storage.h
....@@ -29,9 +29,68 @@
2929 #define LAN_RGMII_DL_ID 16
3030 #define EINK_VCOM_ID 17
3131
32
+#define VENDOR_HEAD_TAG 0x524B5644
33
+#define FLASH_VENDOR_PART_SIZE 8
34
+#define VENDOR_PART_SIZE 128
35
+
36
+struct vendor_item {
37
+ u16 id;
38
+ u16 offset;
39
+ u16 size;
40
+ u16 flag;
41
+};
42
+
43
+struct vendor_info {
44
+ u32 tag;
45
+ u32 version;
46
+ u16 next_index;
47
+ u16 item_num;
48
+ u16 free_offset;
49
+ u16 free_size;
50
+ struct vendor_item item[126]; /* 126 * 8 */
51
+ u8 data[VENDOR_PART_SIZE * 512 - 1024 - 8];
52
+ u32 hash;
53
+ u32 version2;
54
+};
55
+
56
+struct flash_vendor_info {
57
+ u32 tag;
58
+ u32 version;
59
+ u16 next_index;
60
+ u16 item_num;
61
+ u16 free_offset;
62
+ u16 free_size;
63
+ struct vendor_item item[62]; /* 62 * 8 */
64
+ u8 data[FLASH_VENDOR_PART_SIZE * 512 - 512 - 8];
65
+ u32 hash;
66
+ u32 version2;
67
+};
68
+
69
+#if IS_REACHABLE(CONFIG_ROCKCHIP_VENDOR_STORAGE)
3270 int rk_vendor_read(u32 id, void *pbuf, u32 size);
3371 int rk_vendor_write(u32 id, void *pbuf, u32 size);
3472 int rk_vendor_register(void *read, void *write);
3573 bool is_rk_vendor_ready(void);
74
+#else
75
+static inline int rk_vendor_read(u32 id, void *pbuf, u32 size)
76
+{
77
+ return -1;
78
+}
79
+
80
+static inline int rk_vendor_write(u32 id, void *pbuf, u32 size)
81
+{
82
+ return -1;
83
+}
84
+
85
+static inline int rk_vendor_register(void *read, void *write)
86
+{
87
+ return -1;
88
+}
89
+
90
+static inline bool is_rk_vendor_ready(void)
91
+{
92
+ return false;
93
+}
94
+#endif
3695
3796 #endif