.. | .. |
---|
29 | 29 | #define LAN_RGMII_DL_ID 16 |
---|
30 | 30 | #define EINK_VCOM_ID 17 |
---|
31 | 31 | |
---|
| 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) |
---|
32 | 70 | int rk_vendor_read(u32 id, void *pbuf, u32 size); |
---|
33 | 71 | int rk_vendor_write(u32 id, void *pbuf, u32 size); |
---|
34 | 72 | int rk_vendor_register(void *read, void *write); |
---|
35 | 73 | 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 |
---|
36 | 95 | |
---|
37 | 96 | #endif |
---|