blob: a07d53d950a698181a22e638bf792c391243b09e [file] [log] [blame]
rjw1f884582022-01-06 17:20:42 +08001#!/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 21 2014 guo-huei.chang
66#* [MOLY00063203] [EMIGEN] Update EMIGEN for Smart Phone Project
67#* Update emigen to generate EMI size for none EMI support
68#*
69#* 01 08 2014 guo-huei.chang
70#* [MOLY00052841] [EMIGEN] Update EMIGEN for SmartPhone project
71#* 1. update emigen for smart phone to generate custom emi header
72#* 2. update custom_EMI_SP.c for smart phone
73#*
74#* 07 27 2012 marvin.lin
75#* [MOLY00001243] [MemoryStorage][Auto-Gen][EMI Gen/CFG Gen][Request For Design Change] to fix emi build warning on sp project
76#* .
77#*
78#*
79#*------------------------------------------------------------------------------
80#* Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
81#*============================================================================
82#****************************************************************************/
83
84#****************************************************************************
85# Included Modules
86#****************************************************************************
87use strict;
88
89#****************************************************************************
90# Constants
91#****************************************************************************
921;
93#my $DebugPrint = 0; # 1 for debug; 0 for non-debug
94
95#****************************************************************************
96# subroutine: custom_EMI_h_file_body_for_sp
97# return: custom_EMI.h file content for SP
98#****************************************************************************
99sub custom_EMI_h_file_body_for_sp
100{
101 my ($bb) = @_;
102 my $template;
103
104 $template = <<"__TEMPLATE";
105#ifndef __CUSTOM_EMI__
106#define __CUSTOM_EMI__
107
108/****************************************************
109 * This part is for auto-gen validity CHECK *
110 * Don't modify any content in this comment section *
111 ****************************************************/
112
113#endif /* __CUSTOM_EMI__ */
114
115__TEMPLATE
116
117 return $template;
118}
119
120#****************************************************************************
121# subroutine: custom_EMI_release_h_file_body_for_sp
122# return: custom_EMI_release.h file content for SP
123#****************************************************************************
124sub custom_EMI_release_h_file_body_for_sp
125{
126 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) = @_;
127 my $template;
128
129 $template = <<"__TEMPLATE";
130#ifndef __CUSTOM_EMI_RELEASE__
131#define __CUSTOM_EMI_RELEASE__
132
133/***********************************
134 *
135 * Definition
136 *
137 *********************************/
138
139/**
140 * Define memory's mode.
141 */
142#define __EMI_DEVICE_NONE__
143/**
144 * Define RAM size in Bytes.
145 */
146#define EMI_EXTSRAM_SIZE ((($COMM_MDL_INFO_LOCAL->{1}->{'Size (Mb)'})>>3)<<20)
147
148#endif /* __CUSTOM_EMI_RELEASE__ */
149
150__TEMPLATE
151
152 return $template;
153}
154