code_decompression.c
4.73 KB
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
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
/*****************************************************************************
* Copyright Statement:
* --------------------
* This software is protected by Copyright and the information contained
* herein is confidential. The software may not be copied and the information
* contained herein may not be used or disclosed except with the written
* permission of MediaTek Inc. (C) 2001
*
*****************************************************************************/
/*****************************************************************************
*
* Filename:
* ---------
* mmu.c
*
* Project:
* --------
* Maui_Software
*
* Description:
* ------------
* This Module defines the functionality of Code and Data cache.
*
* Author:
* -------
* -------
*
*============================================================================
* HISTORY
* Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
*------------------------------------------------------------------------------
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
*------------------------------------------------------------------------------
* Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
*============================================================================
****************************************************************************/
#if defined(__ZIMAGE_SUPPORT__)
#include "kal_release.h"
#include "code_decompression.h"
#include "dcl.h"
#include "dcl_pw.h"
#include "device.h"
#if !defined(__L1_STANDALONE__) && !defined(EMPTY_MMI)
extern void MMICheckDiskDisplay_bootup(void);
#endif
kal_bool ZIMAGEImageLoaded = KAL_FALSE;
static void zimage_dispaly_logo(void)
{
#if defined(__MTK_TARGET__)
DCL_HANDLE handle;
PW_CTRL_GET_POWERON_REASON poweron_type;
handle=DclPW_Open(DCL_PW, FLAGS_NONE);
DclPW_Control(handle, PW_CMD_GET_POWERON_REASON,(DCL_CTRL_DATA_T *)&poweron_type);
DclPW_Close(handle);
if(poweron_type.powerOnReason != RTCPWRON &&
poweron_type.powerOnReason != ABNRESET &&
poweron_type.powerOnReason != UNKNOWN_PWRON)
{
handle=DclPW_Open(DCL_PW, FLAGS_NONE);
DclPW_Control(handle,PW_CMD_POWERON,NULL);
DclPW_Close(handle);
}
#if !defined(__L1_STANDALONE__) && !defined(EMPTY_MMI)
MMICheckDiskDisplay_bootup();
#endif
#if defined(__NEP_ZIMAGE_SUPPORT__)
#if !defined(__L1_STANDALONE__) && !defined(EMPTY_MMI)
custom_uem_gpio_set_level(GPIO_DEV_LED_MAINLCD, LED_LIGHT_LEVEL5);
#endif
#endif /* __NEP_ZIMAGE_SUPPORT__ */
if(poweron_type.powerOnReason != RTCPWRON &&
poweron_type.powerOnReason != ABNRESET &&
poweron_type.powerOnReason != UNKNOWN_PWRON)
{
//handle=DclPW_Open(DCL_PW, FLAGS_NONE);
//DclPW_Control(handle,PW_CMD_POWERON,NULL);
//DclPW_Close(handle);
#if !defined(__NEP_ZIMAGE_SUPPORT__)
#if !defined(__L1_STANDALONE__) && !defined(EMPTY_MMI)
custom_uem_gpio_set_level(GPIO_DEV_LED_MAINLCD, LED_LIGHT_LEVEL5);
#endif
#endif /* __NEP_ZIMAGE_SUPPORT__ */
}
#endif /* __MTK_TARGET__ */
}
static void zimage_progress_notify(kal_uint32 dec_size, kal_uint32 total_size)
{
#if defined(__MTK_TARGET__)
#if !defined(__L1_STANDALONE__) && !defined(EMPTY_MMI)
MMICheckDiskDisplay_bootup();
#endif
#endif /* __MTK_TARGET__ */
}
#if defined(__MTK_TARGET__) && defined(__DCM_WITH_COMPRESSION_MAUI_INIT__)
#pragma push
#pragma arm section code="DYNAMIC_COMP_MAUIINIT_SECTION"
#endif
int ZImageDecompress(void)
{
#if defined(__MTK_TARGET__)
#define ZIMAGE_DECOMPRESS_LEN (64*1024)
zimage_dispaly_logo();
ZImageDecompressHal(ZIMAGE_DECOMPRESS_LEN, zimage_progress_notify);
ZIMAGEImageLoaded = KAL_TRUE;
#endif /* __MTK_TARGET__ */
return 0;
}
#if defined(__MTK_TARGET__) && defined(__DCM_WITH_COMPRESSION_MAUI_INIT__)
#pragma arm section code
#pragma pop
#endif
#endif /* __ZIMAGE_SUPPORT__ */