forked from compulab/i3m-application
-
Notifications
You must be signed in to change notification settings - Fork 0
/
layout.h
156 lines (144 loc) · 3.85 KB
/
layout.h
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
/*
* layout.h
*
* Created on: Sep 3, 2015
* Author: arkadi
*/
#ifndef LAYOUT_H_
#define LAYOUT_H_
#include <stdbool.h>
#include <stdint.h>
#define APPLICATION_VER_MSB_EEPROM_ADDRESS 0x102
#define APPLICATION_VER_LSB_EEPROM_ADDRESS 0x103
#define BOOTLOADER_MAGIC_EEPROM_ADDRESS 0x110
#define BRIGHTNESS_DEFAULT 0xee
#define SCREEN_SAVER_DEFAULT_MODE 0
#define SCREEN_SAVER_DEFAULT_ENABLE 1
#define SCREEN_SAVER_DEFAULT_UNIT 0
#define SCREEN_SAVER_DEFAULT_TIME 10
#define SCREEN_SAVER_TIME_DEFAULT (SCREEN_SAVER_DEFAULT_UNIT) << 6 | SCREEN_SAVER_DEFAULT_TIME
#define SCREEN_SAVER_CONFIGURATION_DEFAULT (SCREEN_SAVER_DEFAULT_MODE) << 2 | SCREEN_SAVER_DEFAULT_ENABLE
#define EEPROM_DMI_COUNT 0x180
#define EEPROM_DMI_START 0x181
#define BOOTLOADER_APPLICATION_START 0x10
#define MAX_HDD 8
#define MAX_CPU 8
#define MAX_MEMORY_SLOT 4
#define CPU_FQ_VALID_BIT 0x80
struct direct_string_item {
char *type;
char *content;
uint16_t backup_addr;
struct direct_string_item *next;
};
union updatable_info {
struct {
uint8_t post_code_lsb;
uint8_t post_code_msb;
uint8_t power_state:3;
uint8_t power_state_reserved:5;
uint8_t cpu_temp[MAX_CPU];
uint8_t cpu0_temp_set:1;
uint8_t cpu1_temp_set:1;
uint8_t cpu2_temp_set:1;
uint8_t cpu3_temp_set:1;
uint8_t cpu4_temp_set:1;
uint8_t cpu5_temp_set:1;
uint8_t cpu6_temp_set:1;
uint8_t cpu7_temp_set:1;
uint8_t gpu_temp;
uint8_t ambient_temp;
uint8_t hdd_temp[MAX_HDD];
uint8_t hdd0_temp_set:1;
uint8_t hdd1_temp_set:1;
uint8_t hdd2_temp_set:1;
uint8_t hdd3_temp_set:1;
uint8_t hdd4_temp_set:1;
uint8_t hdd5_temp_set:1;
uint8_t hdd6_temp_set:1;
uint8_t hdd7_temp_set:1;
uint8_t gpu_temp_set:1;
uint8_t ambient_temp_set:1;
uint8_t sensor_reserved:6;
uint16_t adc:12;
uint8_t adc_reserved:3;
uint8_t adc_set:1;
uint8_t mem0_size_set:1;
uint8_t mem1_size_set:1;
uint8_t mem2_size_set:1;
uint8_t mem3_size_set:1;
uint8_t mem_size_set_reserved:4;
uint8_t mem0_size;
uint8_t mem1_size;
uint8_t mem2_size;
uint8_t mem3_size;
uint16_t hdd0_size;
uint16_t hdd1_size;
uint16_t hdd2_size;
uint16_t hdd3_size;
uint16_t hdd4_size;
uint16_t hdd5_size;
uint16_t hdd6_size;
uint16_t hdd7_size;
uint8_t hdd0_size_set:1;
uint8_t hdd1_size_set:1;
uint8_t hdd2_size_set:1;
uint8_t hdd3_size_set:1;
uint8_t hdd4_size_set:1;
uint8_t hdd5_size_set:1;
uint8_t hdd6_size_set:1;
uint8_t hdd7_size_set:1;
uint8_t hdd0_units_tera:1;
uint8_t hdd1_units_tera:1;
uint8_t hdd2_units_tera:1;
uint8_t hdd3_units_tera:1;
uint8_t hdd4_units_tera:1;
uint8_t hdd5_units_tera:1;
uint8_t hdd6_units_tera:1;
uint8_t hdd7_units_tera:1;
uint16_t cpu_freq[MAX_CPU];
uint8_t cpu0_freq_set:1;
uint8_t cpu1_freq_set:1;
uint8_t cpu2_freq_set:1;
uint8_t cpu3_freq_set:1;
uint8_t cpu4_freq_set:1;
uint8_t cpu5_freq_set:1;
uint8_t cpu6_freq_set:1;
uint8_t cpu7_freq_set:1;
uint8_t hddtr:1;
uint8_t cpu_freq_request:1;
uint8_t cput_temp_request:1;
uint8_t gpu_temp_request:1;
uint8_t req_reserved:4;
struct direct_string_item *direct_string;
uint8_t screen_saver_update_time;
uint8_t screen_saver_visible:1;
uint8_t screen_saver_type:3;
uint8_t screen_saver_reserved:4;
} details;
struct {
uint16_t post_code;
uint8_t power_state;
uint8_t cpu_temp[MAX_CPU];
uint8_t cpu_temp_set;
uint8_t gpu_temp;
uint8_t ambient_temp;
uint8_t hdd_temp[MAX_HDD];
uint8_t hdd_temp_set;
uint8_t other_temp_status;
uint16_t adc;
uint8_t mems;
uint8_t memsz[MAX_MEMORY_SLOT];
uint16_t hdd_size[MAX_HDD];
uint8_t hdd_size_set;
uint8_t hdd_units_tera;
uint16_t cpu_freq[MAX_CPU];
uint8_t cpu_freq_set;
uint8_t pending_req;
struct direct_string_item *direct_string;
uint8_t screen_saver_update_time;
uint8_t screen_saver_config;
} packed;
};
union updatable_info computer_data;
#endif /* LAYOUT_H_ */