blob: cab55f119a7093317e6ff184189d675191ed94df [file] [log] [blame]
rjw6c1fd8f2022-11-30 14:33:01 +08001/*****************************************************************************
2* Copyright Statement:
3* --------------------
4* This software is protected by Copyright and the information contained
5* herein is confidential. The software may not be copied and the information
6* contained herein may not be used or disclosed except with the written
7* permission of MediaTek Inc. (C) 2006
8*
9* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
10* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
11* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
12* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
13* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
14* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
15* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
16* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
17* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
18* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
19* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
20* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
21*
22* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
23* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
24* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
25* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
26* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
27*
28* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
29* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
30* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
31* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
32* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
33*
34*****************************************************************************/
35
36/*****************************************************************************
37 *
38 * Filename:
39 * ---------
40 * custom_EMI.c
41 *
42 * Project:
43 * --------
44 * Maui_Software
45 *
46 * Description:
47 * ------------
48 * This Module defines the EMI (external memory interface) related setting.
49 *
50 * Author:
51 * -------
52 * -------
53 *
54 * Memory Device database last modified on 2011/6/29
55 *
56 *============================================================================
57 * HISTORY
58 * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
59 *------------------------------------------------------------------------------
60 * removed!
61 * removed!
62 * removed!
63 *
64 * removed!
65 * removed!
66 * removed!
67 *
68 * removed!
69 * removed!
70 * removed!
71 *
72 * removed!
73 * removed!
74 * removed!
75 *
76 * removed!
77 * removed!
78 * removed!
79 *
80 * removed!
81 * removed!
82 * removed!
83 * removed!
84 *
85 * removed!
86 * removed!
87 * removed!
88 *
89 * removed!
90 * removed!
91 * removed!
92 *
93 * removed!
94 * removed!
95 * removed!
96 *
97 * removed!
98 * removed!
99 * removed!
100 *
101 *------------------------------------------------------------------------------
102 * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
103 *============================================================================
104 ****************************************************************************/
105
106#include "custom_EMI_release.h"
107
108#if defined(__EMI_DEVICE_NONE__)
109#if defined(__MTK_TARGET__)
110
111#include "kal_public_api.h" //MSBB change #include "kal_release.h"
112#include "pll.h"
113
114
115/*************************************
116 *
117 * Imported APIs.
118 *
119 *************************************/
120
121
122/*************************************
123 *
124 * Global Variables.
125 *
126 *************************************/
127
128
129/*************************************************************************
130* FUNCTION
131* custom_setEMI()
132*
133* DESCRIPTION
134* This routine aims to set EMI
135*
136* PARAMETERS
137*
138* RETURNS
139* None
140*
141* GLOBALS AFFECTED
142*
143*************************************************************************/
144kal_int8 custom_setEMI(void)
145{
146
147/**
148 * MT6573 EMI will be init at CMM when bring-up.
149 */
150
151 return 1;
152
153}
154
155/*************************************************************************
156* FUNCTION
157* custom_InitDRAM()
158*
159* DESCRIPTION
160* This routine aims to set EMI and initialize LPSDRAM
161*
162* PARAMETERS
163*
164* RETURNS
165* None
166*
167* GLOBALS AFFECTED
168*
169*************************************************************************/
170kal_int8 custom_InitDRAM(void)
171{
172 return -1;
173
174}
175
176#if ( !defined(__UBL__) && !defined(__FUE__) )
177 /* __FUE__ , __UBL__ compile option is used for FOTA or USB Bootloader build
178 * add this compile option to avoid compiling functions other than custom_setEMI()
179 */
180
181/*************************************************************************
182* FUNCTION
183* custom_setAdvEMI()
184*
185* DESCRIPTION
186* This routine aims to set additional EMI
187* This is special for device which needs to set device configuration
188* register to turn-on special mode.
189*
190* PARAMETERS
191*
192* RETURNS
193* 1:
194*
195* GLOBALS AFFECTED
196*
197*************************************************************************/
198
199#ifdef __MTK_TARGET__
200#endif /* __MTK_TARGET__ */
201
202
203kal_int8 custom_setAdvEMI(void)
204{
205 kal_int8 status = 0;
206
207 return status;
208}
209
210#ifdef __MTK_TARGET__
211#endif /* __MTK_TARGET__ */
212
213
214/*************************************************************************
215* FUNCTION
216* custom_get_EXTSRAM_size()
217*
218* DESCRIPTION
219* Return predefined external SRAM size.
220*
221* PARAMETERS
222*
223* RETURNS
224* None
225*
226* GLOBALS AFFECTED
227*
228*************************************************************************/
229void
230custom_get_EXTSRAM_size(kal_uint32 *size)
231{
232 *size = (kal_uint32)EMI_EXTSRAM_SIZE;
233}
234
235/*************************************************************************
236* FUNCTION
237* custom_ifLPSDRAM()
238*
239* DESCRIPTION
240* Query if the memory device is LPSDRAM
241*
242* PARAMETERS
243*
244* RETURNS
245* KAL_TRUE: The memory device is LPSDRAM
246* KAL_FALSE: The memory device is not LPSDRAM
247*
248* GLOBALS AFFECTED
249*
250*************************************************************************/
251kal_bool
252custom_ifLPSDRAM(void)
253{
254#if defined(DRAM_CS) && defined(DRAM_SIZE)
255 return KAL_TRUE;
256#else
257 return KAL_FALSE;
258#endif
259}
260
261
262/*************************************************************************
263* FUNCTION
264* custom_DynamicClockSwitch
265*
266* DESCRIPTION
267* This function dedicates to switch the system clock and adjust the EMI
268* according to the working system clock.
269*
270* PARAMETERS
271* clock - clock to switch
272*
273* RETURNS
274* 0 for success; -1 for failure
275*
276*************************************************************************/
277#if 0 //#ifdef DCM_ENABLE
278/* under construction !*/
279/* under construction !*/
280/* under construction !*/
281/* under construction !*/
282/* under construction !*/
283/* under construction !*/
284/* under construction !*/
285/* under construction !*/
286/* under construction !*/
287#endif /* DCM_ENABLE */
288
289
290/*************************************************************************
291* FUNCTION
292* custom_EMIDynamicClockSwitch_Init
293*
294* DESCRIPTION
295* This function is used to Init setting for DCM
296*
297* PARAMETERS
298*
299*
300* RETURNS
301* 0 for success; -1 for failure
302*
303*************************************************************************/
304
305int custom_EMIDynamicClockSwitch_Init(void)
306{
307
308 return 0;
309}
310
311
312
313#endif /* !__UBL__ && !__FUE__ */
314
315#endif // #if defined(__MTK_TARGET__)
316#endif // #if defined(MT6573) || defined(MT6575)