blob: 0534d55c58fb956aa35b1dbfcb066cff85171698 [file] [log] [blame]
yu.dongc33b3072024-08-21 23:14:49 -07001#!/usr/bin/perl
2#
3# Copyright Statement:
4# --------------------
5# This software is protected by Copyright and the information contained
6# herein is confidential. The software may not be copied and the information
7# contained herein may not be used or disclosed except with the written
8# permission of MediaTek Inc. (C) 2006
9#
10# BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
11# THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
12# RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
13# AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
14# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
15# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
16# NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
17# SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
18# SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
19# THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
20# NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
21# SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
22#
23# BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
24# LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
25# AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
26# OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
27# MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
28#
29# THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
30# WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
31# LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
32# RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
33# THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
34#
35#*****************************************************************************
36#*
37#* Filename:
38#* ---------
39#* emiGenSP.pl
40#*
41#* Project:
42#* --------
43#*
44#*
45#* Description:
46#* ------------
47#* This script will
48#* 1. generate fxied flash_opt.h for smart phone modem
49#* 2. generate fixed custom_EMI.c for smart phone modem
50#* 3. generate fixed custom_EMI.h for smart phone modem
51#* 4. generate fixed custom_flash.c for smart phone modem
52#*
53#* Author:
54#* -------
55#* Guo-Huei Chang (mtk04123)
56#*
57#*============================================================================
58#* HISTORY
59#* Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
60#*------------------------------------------------------------------------------
61#* $Revision$
62#* $Modtime$
63#* $Log$
64#*
65#* 04 23 2014 guo-huei.chang
66#* [MOLY00062623] [UMOLY] update TK6291 emi
67#* updat emigen flow for generating external emi size when EMI is not in MD own.
68#*
69#* 04 21 2014 guo-huei.chang
70#* [MOLY00063203] [EMIGEN] Update EMIGEN for Smart Phone Project
71#* Update emigen to generate EMI size for none EMI support
72#*
73#* 01 08 2014 guo-huei.chang
74#* [MOLY00052841] [EMIGEN] Update EMIGEN for SmartPhone project
75#* 1. update emigen for smart phone to generate custom emi header
76#* 2. update custom_EMI_SP.c for smart phone
77#*
78#* 07 27 2012 marvin.lin
79#* [MOLY00001243] [MemoryStorage][Auto-Gen][EMI Gen/CFG Gen][Request For Design Change] to fix emi build warning on sp project
80#* .
81#*
82#*
83#*------------------------------------------------------------------------------
84#* Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
85#*============================================================================
86#****************************************************************************/
87
88#****************************************************************************
89# Included Modules
90#****************************************************************************
91use strict;
92
93#****************************************************************************
94# Constants
95#****************************************************************************
961;
97#my $DebugPrint = 0; # 1 for debug; 0 for non-debug
98
99#****************************************************************************
100# subroutine: custom_EMI_h_file_body_for_sp
101# return: custom_EMI.h file content for SP
102#****************************************************************************
103sub custom_EMI_h_file_body_for_sp
104{
105 my ($bb) = @_;
106 my $template;
107
108 $template = <<"__TEMPLATE";
109#ifndef __CUSTOM_EMI__
110#define __CUSTOM_EMI__
111
112/****************************************************
113 * This part is for auto-gen validity CHECK *
114 * Don't modify any content in this comment section *
115 ****************************************************/
116
117#endif /* __CUSTOM_EMI__ */
118
119__TEMPLATE
120
121 return $template;
122}
123
124#****************************************************************************
125# subroutine: custom_EMI_release_h_file_body_for_sp
126# return: custom_EMI_release.h file content for SP
127#****************************************************************************
128sub custom_EMI_release_h_file_body_for_sp
129{
130 my ($MAKEFILE_OPTIONS_LOCAL, $CUSTOM_MEM_DEV_OPTIONS_LOCAL, $MDL_INFO_LIST_LOCAL, $COMM_MDL_INFO_LOCAL, $LPSDRAM_CHIP_SELECT_LOCAL, $emi_clk_config_LOCAL) = @_;
131 my $template;
132
133 $template = <<"__TEMPLATE";
134#ifndef __CUSTOM_EMI_RELEASE__
135#define __CUSTOM_EMI_RELEASE__
136
137/***********************************
138 *
139 * Definition
140 *
141 *********************************/
142
143/**
144 * Define memory's mode.
145 */
146#define __EMI_DEVICE_NONE__
147/**
148 * Define RAM size in Bytes.
149 */
150#define EMI_EXTSRAM_SIZE ((($COMM_MDL_INFO_LOCAL->{1}->{'Size (Mb)'})>>3)<<20)
151
152#endif /* __CUSTOM_EMI_RELEASE__ */
153
154__TEMPLATE
155
156 return $template;
157}
158