| /***************************************************************************** |
| * 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) 2006 |
| * |
| * BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES |
| * THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE") |
| * RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON |
| * AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES, |
| * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF |
| * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT. |
| * NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE |
| * SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR |
| * SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH |
| * THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO |
| * NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S |
| * SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM. |
| * |
| * BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE |
| * LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE, |
| * AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE, |
| * OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO |
| * MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE. |
| * |
| * THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE |
| * WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF |
| * LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND |
| * RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER |
| * THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC). |
| * |
| *****************************************************************************/ |
| |
| /***************************************************************************** |
| * |
| * Filename: |
| * --------- |
| * custom_EMI.c |
| * |
| * Project: |
| * -------- |
| * Maui_Software |
| * |
| * Description: |
| * ------------ |
| * This Module defines the EMI (external memory interface) related setting. |
| * |
| * Author: |
| * ------- |
| * ------- |
| * |
| * Memory Device database last modified on 2011/6/29 |
| * |
| *============================================================================ |
| * 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! |
| * |
| *------------------------------------------------------------------------------ |
| * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!! |
| *============================================================================ |
| ****************************************************************************/ |
| |
| #include "custom_EMI_release.h" |
| |
| #if defined(__EMI_DEVICE_NONE__) |
| #if defined(__MTK_TARGET__) |
| |
| #include "kal_public_api.h" //MSBB change #include "kal_release.h" |
| #include "pll.h" |
| |
| |
| /************************************* |
| * |
| * Imported APIs. |
| * |
| *************************************/ |
| |
| |
| /************************************* |
| * |
| * Global Variables. |
| * |
| *************************************/ |
| |
| |
| /************************************************************************* |
| * FUNCTION |
| * custom_setEMI() |
| * |
| * DESCRIPTION |
| * This routine aims to set EMI |
| * |
| * PARAMETERS |
| * |
| * RETURNS |
| * None |
| * |
| * GLOBALS AFFECTED |
| * |
| *************************************************************************/ |
| kal_int8 custom_setEMI(void) |
| { |
| |
| /** |
| * MT6573 EMI will be init at CMM when bring-up. |
| */ |
| |
| return 1; |
| |
| } |
| |
| /************************************************************************* |
| * FUNCTION |
| * custom_InitDRAM() |
| * |
| * DESCRIPTION |
| * This routine aims to set EMI and initialize LPSDRAM |
| * |
| * PARAMETERS |
| * |
| * RETURNS |
| * None |
| * |
| * GLOBALS AFFECTED |
| * |
| *************************************************************************/ |
| kal_int8 custom_InitDRAM(void) |
| { |
| return -1; |
| |
| } |
| |
| #if ( !defined(__UBL__) && !defined(__FUE__) ) |
| /* __FUE__ , __UBL__ compile option is used for FOTA or USB Bootloader build |
| * add this compile option to avoid compiling functions other than custom_setEMI() |
| */ |
| |
| /************************************************************************* |
| * FUNCTION |
| * custom_setAdvEMI() |
| * |
| * DESCRIPTION |
| * This routine aims to set additional EMI |
| * This is special for device which needs to set device configuration |
| * register to turn-on special mode. |
| * |
| * PARAMETERS |
| * |
| * RETURNS |
| * 1: |
| * |
| * GLOBALS AFFECTED |
| * |
| *************************************************************************/ |
| |
| #ifdef __MTK_TARGET__ |
| #endif /* __MTK_TARGET__ */ |
| |
| |
| kal_int8 custom_setAdvEMI(void) |
| { |
| kal_int8 status = 0; |
| |
| return status; |
| } |
| |
| #ifdef __MTK_TARGET__ |
| #endif /* __MTK_TARGET__ */ |
| |
| |
| /************************************************************************* |
| * FUNCTION |
| * custom_get_EXTSRAM_size() |
| * |
| * DESCRIPTION |
| * Return predefined external SRAM size. |
| * |
| * PARAMETERS |
| * |
| * RETURNS |
| * None |
| * |
| * GLOBALS AFFECTED |
| * |
| *************************************************************************/ |
| void |
| custom_get_EXTSRAM_size(kal_uint32 *size) |
| { |
| *size = (kal_uint32)EMI_EXTSRAM_SIZE; |
| } |
| |
| /************************************************************************* |
| * FUNCTION |
| * custom_ifLPSDRAM() |
| * |
| * DESCRIPTION |
| * Query if the memory device is LPSDRAM |
| * |
| * PARAMETERS |
| * |
| * RETURNS |
| * KAL_TRUE: The memory device is LPSDRAM |
| * KAL_FALSE: The memory device is not LPSDRAM |
| * |
| * GLOBALS AFFECTED |
| * |
| *************************************************************************/ |
| kal_bool |
| custom_ifLPSDRAM(void) |
| { |
| #if defined(DRAM_CS) && defined(DRAM_SIZE) |
| return KAL_TRUE; |
| #else |
| return KAL_FALSE; |
| #endif |
| } |
| |
| |
| /************************************************************************* |
| * FUNCTION |
| * custom_DynamicClockSwitch |
| * |
| * DESCRIPTION |
| * This function dedicates to switch the system clock and adjust the EMI |
| * according to the working system clock. |
| * |
| * PARAMETERS |
| * clock - clock to switch |
| * |
| * RETURNS |
| * 0 for success; -1 for failure |
| * |
| *************************************************************************/ |
| #if 0 //#ifdef DCM_ENABLE |
| /* under construction !*/ |
| /* under construction !*/ |
| /* under construction !*/ |
| /* under construction !*/ |
| /* under construction !*/ |
| /* under construction !*/ |
| /* under construction !*/ |
| /* under construction !*/ |
| /* under construction !*/ |
| #endif /* DCM_ENABLE */ |
| |
| |
| /************************************************************************* |
| * FUNCTION |
| * custom_EMIDynamicClockSwitch_Init |
| * |
| * DESCRIPTION |
| * This function is used to Init setting for DCM |
| * |
| * PARAMETERS |
| * |
| * |
| * RETURNS |
| * 0 for success; -1 for failure |
| * |
| *************************************************************************/ |
| |
| int custom_EMIDynamicClockSwitch_Init(void) |
| { |
| |
| return 0; |
| } |
| |
| |
| |
| #endif /* !__UBL__ && !__FUE__ */ |
| |
| #endif // #if defined(__MTK_TARGET__) |
| #endif // #if defined(MT6573) || defined(MT6575) |