rjw | 6c1fd8f | 2022-11-30 14:33:01 +0800 | [diff] [blame] | 1 | /***************************************************************************** |
| 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) 2005 |
| 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 | * Filename: |
| 38 | * --------- |
| 39 | * custom_em.c |
| 40 | * |
| 41 | * Project: |
| 42 | * -------- |
| 43 | * MAUI |
| 44 | * |
| 45 | * Description: |
| 46 | * ------------ |
| 47 | * This file is for engineer mode. |
| 48 | * |
| 49 | * Author: |
| 50 | * ------- |
| 51 | * ------- |
| 52 | * |
| 53 | *============================================================================ |
| 54 | * HISTORY |
| 55 | * Below this line, this part is controlled by ClearCase. DO NOT MODIFY!! |
| 56 | *------------------------------------------------------------------------------ |
| 57 | * $Log$ |
| 58 | * |
| 59 | * 08 02 2021 tongkun.zhang |
| 60 | * [MOLY00678004] [M80][FM350-GL][harvey.cheng][DIPC][NA][NA][NA]Dipc_config process consultation |
| 61 | * |
| 62 | * dipc enhance for security |
| 63 | * |
| 64 | * 07 29 2021 tongkun.zhang |
| 65 | * [MOLY00678004] [M80][FM350-GL][harvey.cheng][DIPC][NA][NA][NA]Dipc_config process consultation |
| 66 | * |
| 67 | * DIPC |
| 68 | * |
| 69 | * 07 27 2021 tongkun.zhang |
| 70 | * [MOLY00678004] [M80][FM350-GL][harvey.cheng][DIPC][NA][NA][NA]Dipc_config process consultation |
| 71 | * |
| 72 | * DIPC change for pcie control |
| 73 | * |
| 74 | * 11 10 2020 tongkun.zhang |
| 75 | * [MOLY00593154] [L5] patch back L5 from NR15.R3.MD700.MP to NR15.R3.MD700.MP |
| 76 | * |
| 77 | * [L5][OA] |
| 78 | * |
| 79 | * 08 06 2020 tongkun.zhang |
| 80 | * [MOLY00555238] [L5] patch back L5 to NR15.R3.T700.MP |
| 81 | * |
| 82 | * [L5][OA]Custom |
| 83 | * |
| 84 | * 07 19 2020 mingchun.cheng |
| 85 | * [MOLY00545496] [L5] patch back L5 to NR15.R3.MT6880.MP |
| 86 | * . |
| 87 | * |
| 88 | * 07 14 2020 tongkun.zhang |
| 89 | * [MOLY00545496] [L5] patch back L5 to NR15.R3.MT6880.MP |
| 90 | * |
| 91 | * L5 OA |
| 92 | * 06 23 2020 titi.wu |
| 93 | * [MOLY00536776] 97 LG ePDG new CHANNEL |
| 94 | * titi-RD |
| 95 | * |
| 96 | * 07 09 2020 mingchun.cheng |
| 97 | * [MOLY00533417] [L5] patch back L5 to NR15.R3.COLGIN.SB.SMT.DEV] |
| 98 | * |
| 99 | * . |
| 100 | * |
| 101 | * 09 18 2019 victoria.wang |
| 102 | * [MOLY00416922] DHL Legacy Wrapper migration and phase-out |
| 103 | * [Remove][DHL] phase out legacy wrapper API |
| 104 | * |
| 105 | * 07 31 2019 lucien.li |
| 106 | * [MOLY00408908] [CODE SYNC] Modem??SAR Sensor??έSARݨD? (VMOLY) |
| 107 | * |
| 108 | * (SWRD)[SAR Sensor][L4C] |
| 109 | * |
| 110 | * 05 24 2018 hong.yu |
| 111 | * [MOLY00325228] [UMOLYE] Remove NVRAM group header file |
| 112 | * include dhl_nvram_def.h |
| 113 | * |
| 114 | * 06 05 2017 hong.yu |
| 115 | * [MOLY00255008] [Gen93] fix build warning |
| 116 | * fix build warning |
| 117 | * |
| 118 | * 12 28 2016 hong.yu |
| 119 | * [MOLY00221317] [Gen93] L4 Integration M1 check in |
| 120 | * ATP,L4B and L4C M1 check in |
| 121 | * |
| 122 | * 11 24 2016 allen.hsu |
| 123 | * sync MOLY00212575. |
| 124 | * |
| 125 | * 03 04 2016 bart.liang |
| 126 | * [MOLY00164802] [L4C] Revise l4c for klocwork and coverity check |
| 127 | * For MSBB activity. |
| 128 | * |
| 129 | * 09 30 2015 bart.liang |
| 130 | * [MOLY00137572] [PS8] 2015 Q3 Build Warning Fix Activity |
| 131 | * . |
| 132 | * |
| 133 | * 07 22 2015 eason.lai |
| 134 | * [MOLY00130157] [TK6291][DHL] smart logging migration |
| 135 | * . |
| 136 | * |
| 137 | * 06 23 2015 lexel.yu |
| 138 | * [MOLY00123397] [MT6755][BRINGUP_FIRSTCALL] Replace compile option for speech port |
| 139 | * . |
| 140 | * |
| 141 | * 01 14 2015 bart.liang |
| 142 | * [MOLY00092425] Revise RF init status in L4C_init |
| 143 | * |
| 144 | * 11 13 2014 jerry.chang |
| 145 | * [MOLY00084326] checkin common custom file to MOLY.W14.42.LTE.p2 |
| 146 | * rollback to MOLY.W14.42.LTE.p2 |
| 147 | * |
| 148 | * 08 29 2014 xuejing.chen |
| 149 | * [MOLY00077547] [SGLTE DSDS] AT+EGMR write IMEI change |
| 150 | * . |
| 151 | * |
| 152 | * 05 19 2014 bart.liang |
| 153 | * [MOLY00065517] [MT6290] Add API for L4 to query the status of RF_init. |
| 154 | * |
| 155 | * 03 30 2014 xuejing.chen |
| 156 | * [MOLY00061326] [CMCC_SGLTE_P1] [MT6592][SGLTE][Free][EE]Externel (EE),0,0,99,/data/core/,1,modem, |
| 157 | * . |
| 158 | * |
| 159 | * 03 19 2014 lexel.yu |
| 160 | * [MOLY00059647] [MT6290E2] SAR feature support for 4G LTE |
| 161 | * 4G TX power reduction |
| 162 | * |
| 163 | * 12 31 2013 vend_bob.chiang |
| 164 | * [MOLY00051916] ??G750-T00?�读?�IMEI?�失败�?跟ALPS01209771 ?�象?��? |
| 165 | * . |
| 166 | * |
| 167 | * 12 13 2013 vend_bob.chiang |
| 168 | * [MOLY00046566] [Need Patch] [Volunteer Patch] low battery protect |
| 169 | * . |
| 170 | * |
| 171 | * 11 15 2013 ken.liu |
| 172 | * [MOLY00046623] [MT6290E1][DHL] Add filter on/off control for META tool |
| 173 | * add filter on/off control for META tool. |
| 174 | * |
| 175 | * 11 14 2013 lexel.yu |
| 176 | * [MOLY00013956] [MT6290 Bring-up][MT6290E1][FirstCall] Submit L4 revise for bring up |
| 177 | * Disable uart3 |
| 178 | * |
| 179 | * 07 01 2013 lexel.yu |
| 180 | * [MOLY00028040] Customized AT command port setting |
| 181 | * PS Port setting refined |
| 182 | * |
| 183 | * 06 13 2013 lexel.yu |
| 184 | * [MOLY00013956] [MT6290 Bring-up][MT6290E1][FirstCall] Submit L4 revise for bring up |
| 185 | * Port setting revise for SP boot up. |
| 186 | * MBCI revise for MBIM. |
| 187 | * |
| 188 | * 03 14 2013 xuejing.chen |
| 189 | * [MOLY00010058] Remove Driver FakeAPI |
| 190 | * Wrap pwm driver related codes with compile option. |
| 191 | * |
| 192 | * 02 04 2013 xuejing.chen |
| 193 | * [MOLY00009887] Rename MT7208 to MT6290 |
| 194 | * . |
| 195 | * |
| 196 | * 12 06 2012 danny.kuo |
| 197 | * [MOLY00005824] [NVRAM][MT6280][Change Feature] Support modem switch between RNDIS and HOSTED_DONGLE |
| 198 | * Integration change. |
| 199 | * |
| 200 | * 11 12 2012 chin-chieh.hung |
| 201 | * [MOLY00005322] TATAKA merge to MOLY |
| 202 | * add thumb2 instruction support & remove uart_port3 in MT7208 project |
| 203 | * |
| 204 | * 09 20 2012 mingtsung.sun |
| 205 | * [MOLY00000284] [PPP][MT6280] 3 PPP Dialup Support |
| 206 | * Integration change. - 3PPP + Voice call configuration of USB |
| 207 | * |
| 208 | * 08 21 2012 lexel.yu |
| 209 | * [MOLY00002426] KAL API replacement |
| 210 | * Integration change. |
| 211 | * |
| 212 | * 08 13 2012 lexel.yu |
| 213 | * [MOLY00001791] [MT6280] USB 5VCOM port setting |
| 214 | * Integration change. |
| 215 | * |
| 216 | * 08 02 2012 chenhao.gong |
| 217 | * [MOLY00000729] [L4C]Fix Moly compile warning |
| 218 | * . |
| 219 | * |
| 220 | * 07 19 2012 chenhao.gong |
| 221 | * [MOLY00000729] [L4C]Fix Moly compile warning |
| 222 | * . |
| 223 | * |
| 224 | * 07 10 2012 mingtsung.sun |
| 225 | * [MOLY00000284] [PPP][MT6280] 3 PPP Dialup Support |
| 226 | * Update port setting for 5VCOM |
| 227 | * |
| 228 | * 07 06 2012 mingtsung.sun |
| 229 | * [MOLY00000284] [PPP][MT6280] 3 PPP Dialup Support |
| 230 | * Auto camp on and generate USB COMs when bootup |
| 231 | * |
| 232 | * 06 01 2012 ray.lin-wang |
| 233 | * removed! |
| 234 | * . |
| 235 | * |
| 236 | * 05 30 2012 lexel.yu |
| 237 | * removed! |
| 238 | * <saved by Perforce> |
| 239 | * |
| 240 | * 05 25 2012 chenhao.gong |
| 241 | * removed! |
| 242 | * . |
| 243 | * |
| 244 | * 05 24 2012 wcpuser_integrator |
| 245 | * removed! |
| 246 | * Qinghua Yu check in global enum (MSG & SAP) at modem_dev. |
| 247 | * |
| 248 | * 05 24 2012 wcpuser_integrator |
| 249 | * removed! |
| 250 | * Qinghua Yu check in global enum (MSG & SAP) at modem_dev. |
| 251 | * |
| 252 | * 05 24 2012 wcpuser_integrator |
| 253 | * removed! |
| 254 | * Qinghua Yu check in global enum (MSG & SAP) at modem_dev. |
| 255 | * |
| 256 | * 05 21 2012 lexel.yu |
| 257 | * removed! |
| 258 | * 5VCOM - MODEM_DEV |
| 259 | * |
| 260 | * 05 18 2012 shyla.lan |
| 261 | * removed! |
| 262 | * Sync with MT6280_DVT_DEV |
| 263 | * |
| 264 | * 05 04 2012 chenhao.gong |
| 265 | * removed! |
| 266 | * . |
| 267 | * |
| 268 | * 04 24 2012 wcpuser_integrator |
| 269 | * removed! |
| 270 | * . |
| 271 | * |
| 272 | * 12 27 2011 jianhua.zhao |
| 273 | * removed! |
| 274 | * . |
| 275 | * |
| 276 | * 12 13 2011 jianhua.zhao |
| 277 | * removed! |
| 278 | * . |
| 279 | * |
| 280 | * 12 08 2011 jianhua.zhao |
| 281 | * removed! |
| 282 | * . |
| 283 | * |
| 284 | * 12 08 2011 jianhua.zhao |
| 285 | * removed! |
| 286 | * . |
| 287 | * |
| 288 | * 11 24 2011 shengkai.lin |
| 289 | * removed! |
| 290 | * . |
| 291 | * |
| 292 | * 11 17 2011 jianhua.zhao |
| 293 | * removed! |
| 294 | * . |
| 295 | * |
| 296 | * 11 15 2011 jianhua.zhao |
| 297 | * removed! |
| 298 | * . |
| 299 | * |
| 300 | * 11 15 2011 jianhua.zhao |
| 301 | * removed! |
| 302 | * . |
| 303 | * |
| 304 | * 11 08 2011 lexel.yu |
| 305 | * removed! |
| 306 | * MSBB Check in |
| 307 | * |
| 308 | * 11 04 2011 jianhua.zhao |
| 309 | * removed! |
| 310 | * . |
| 311 | * |
| 312 | * 08 04 2011 lexel.yu |
| 313 | * removed! |
| 314 | * Integration change. |
| 315 | * |
| 316 | * 08 02 2011 jianhua.zhao |
| 317 | * removed! |
| 318 | * . |
| 319 | * |
| 320 | * 08 02 2011 jianhua.zhao |
| 321 | * removed! |
| 322 | * . |
| 323 | * |
| 324 | * 06 02 2011 lexel.yu |
| 325 | * removed! |
| 326 | * Integration change. |
| 327 | * |
| 328 | * 05 23 2011 jianhua.zhao |
| 329 | * removed! |
| 330 | * . |
| 331 | * |
| 332 | * 05 18 2011 jianhua.zhao |
| 333 | * removed! |
| 334 | * . |
| 335 | * |
| 336 | * 04 19 2011 pohan.chu |
| 337 | * removed! |
| 338 | * CUSTOM CODEC PRIORITY |
| 339 | * |
| 340 | * 03 03 2011 chelun.tsai |
| 341 | * removed! |
| 342 | * . |
| 343 | * |
| 344 | * 03 03 2011 jianhua.zhao |
| 345 | * removed! |
| 346 | * . |
| 347 | * |
| 348 | * 02 17 2011 xiaojian.long |
| 349 | * removed! |
| 350 | * Check in TDD EM BLER Statistic |
| 351 | * |
| 352 | * 02 16 2011 hongwei.zhang |
| 353 | * removed! |
| 354 | * .SRNC ID display |
| 355 | * |
| 356 | * 02 15 2011 cylen.yao |
| 357 | * removed! |
| 358 | * [HAL] MAUI custom module split |
| 359 | * |
| 360 | * 01 31 2011 jianhua.zhao |
| 361 | * removed! |
| 362 | * . |
| 363 | * |
| 364 | * 01 20 2011 jianhua.zhao |
| 365 | * removed! |
| 366 | * . |
| 367 | * |
| 368 | * 01 10 2011 jianhua.zhao |
| 369 | * removed! |
| 370 | * . |
| 371 | * |
| 372 | * 01 06 2011 jianhua.zhao |
| 373 | * removed! |
| 374 | * . |
| 375 | * |
| 376 | * 01 05 2011 jianhua.zhao |
| 377 | * removed! |
| 378 | * . |
| 379 | * |
| 380 | * 12 30 2010 jinxing.hu |
| 381 | * removed! |
| 382 | * . |
| 383 | * |
| 384 | * 12 28 2010 jianhua.zhao |
| 385 | * removed! |
| 386 | * removed! |
| 387 | * . |
| 388 | * |
| 389 | * 12 28 2010 jianhua.zhao |
| 390 | * removed! |
| 391 | * . |
| 392 | * |
| 393 | * 12 24 2010 gordonjc.kuo |
| 394 | * removed! |
| 395 | * . |
| 396 | * |
| 397 | * 12 22 2010 jianhua.zhao |
| 398 | * removed! |
| 399 | * . |
| 400 | * |
| 401 | * 12 20 2010 jianhua.zhao |
| 402 | * removed! |
| 403 | * . |
| 404 | * |
| 405 | * 12 17 2010 jianhua.zhao |
| 406 | * removed! |
| 407 | * . |
| 408 | * |
| 409 | * 12 17 2010 jianhua.zhao |
| 410 | * removed! |
| 411 | * . |
| 412 | * |
| 413 | * 12 16 2010 jianhua.zhao |
| 414 | * removed! |
| 415 | * . |
| 416 | * |
| 417 | * 12 16 2010 jianhua.zhao |
| 418 | * removed! |
| 419 | * . |
| 420 | * |
| 421 | * 12 15 2010 lexel.yu |
| 422 | * removed! |
| 423 | * Integration change. |
| 424 | * |
| 425 | * 12 13 2010 jianhua.zhao |
| 426 | * removed! |
| 427 | * . |
| 428 | * |
| 429 | * 12 13 2010 jianhua.zhao |
| 430 | * removed! |
| 431 | * . |
| 432 | * |
| 433 | * 12 01 2010 yanfei.ding |
| 434 | * removed! |
| 435 | * [make c,r uas]Merge UL2 EM code backup MAUI. |
| 436 | * |
| 437 | * 11 30 2010 yongtuan.qiao |
| 438 | * removed! |
| 439 | * add TDD128 handover sequence info in EM. |
| 440 | * |
| 441 | * 11 30 2010 lexel.yu |
| 442 | * removed! |
| 443 | * <saved by Perforce> |
| 444 | * |
| 445 | * 11 30 2010 lexel.yu |
| 446 | * removed! |
| 447 | * remove swdbg_sw.h |
| 448 | * |
| 449 | * 11 28 2010 lexel.yu |
| 450 | * removed! |
| 451 | * Integration change. |
| 452 | * |
| 453 | * 11 27 2010 gordonjc.kuo |
| 454 | * removed! |
| 455 | * . |
| 456 | * |
| 457 | * 11 26 2010 jianhua.zhao |
| 458 | * removed! |
| 459 | * . |
| 460 | * |
| 461 | * 09 26 2010 jianhua.zhao |
| 462 | * removed! |
| 463 | * . |
| 464 | * |
| 465 | * 09 03 2010 shengkai.lin |
| 466 | * removed! |
| 467 | * . |
| 468 | * |
| 469 | * removed! |
| 470 | * removed! |
| 471 | * |
| 472 | * |
| 473 | * removed! |
| 474 | * removed! |
| 475 | * remove compile option |
| 476 | * |
| 477 | * removed! |
| 478 | * removed! |
| 479 | * |
| 480 | * |
| 481 | * removed! |
| 482 | * removed! |
| 483 | * |
| 484 | * |
| 485 | * removed! |
| 486 | * removed! |
| 487 | * |
| 488 | * |
| 489 | * removed! |
| 490 | * removed! |
| 491 | * |
| 492 | * |
| 493 | * removed! |
| 494 | * removed! |
| 495 | * volatile type |
| 496 | * |
| 497 | * removed! |
| 498 | * removed! |
| 499 | * |
| 500 | * |
| 501 | * removed! |
| 502 | * removed! |
| 503 | * |
| 504 | * |
| 505 | * removed! |
| 506 | * removed! |
| 507 | * |
| 508 | * |
| 509 | * removed! |
| 510 | * removed! |
| 511 | * |
| 512 | * |
| 513 | * removed! |
| 514 | * removed! |
| 515 | * |
| 516 | * |
| 517 | * removed! |
| 518 | * removed! |
| 519 | * |
| 520 | * |
| 521 | * removed! |
| 522 | * removed! |
| 523 | * |
| 524 | * |
| 525 | * removed! |
| 526 | * removed! |
| 527 | * |
| 528 | * |
| 529 | * removed! |
| 530 | * removed! |
| 531 | * |
| 532 | * |
| 533 | * removed! |
| 534 | * removed! |
| 535 | * |
| 536 | * |
| 537 | * removed! |
| 538 | * removed! |
| 539 | * |
| 540 | * |
| 541 | * removed! |
| 542 | * removed! |
| 543 | * |
| 544 | * |
| 545 | * removed! |
| 546 | * removed! |
| 547 | * |
| 548 | * |
| 549 | * removed! |
| 550 | * removed! |
| 551 | * |
| 552 | * |
| 553 | * removed! |
| 554 | * removed! |
| 555 | * |
| 556 | * |
| 557 | * removed! |
| 558 | * removed! |
| 559 | * |
| 560 | * |
| 561 | * removed! |
| 562 | * removed! |
| 563 | * |
| 564 | * |
| 565 | * removed! |
| 566 | * removed! |
| 567 | * Apply new EM architecture for 3G |
| 568 | * |
| 569 | * removed! |
| 570 | * removed! |
| 571 | * |
| 572 | * |
| 573 | * removed! |
| 574 | * removed! |
| 575 | * |
| 576 | * |
| 577 | * removed! |
| 578 | * removed! |
| 579 | * |
| 580 | * |
| 581 | * removed! |
| 582 | * removed! |
| 583 | * |
| 584 | * |
| 585 | * removed! |
| 586 | * removed! |
| 587 | * |
| 588 | * |
| 589 | * removed! |
| 590 | * removed! |
| 591 | * |
| 592 | * |
| 593 | * removed! |
| 594 | * removed! |
| 595 | * |
| 596 | * |
| 597 | * removed! |
| 598 | * removed! |
| 599 | * add plutommi compile option |
| 600 | * |
| 601 | * removed! |
| 602 | * removed! |
| 603 | * |
| 604 | * |
| 605 | * removed! |
| 606 | * removed! |
| 607 | * |
| 608 | * |
| 609 | * removed! |
| 610 | * removed! |
| 611 | * Move secure time into custom folder. |
| 612 | * |
| 613 | * removed! |
| 614 | * removed! |
| 615 | * Add custom_config_rlc_timer() for customer can set rlc timer value, default = 3 second. |
| 616 | * |
| 617 | * removed! |
| 618 | * removed! |
| 619 | * |
| 620 | * |
| 621 | * removed! |
| 622 | * removed! |
| 623 | * |
| 624 | * |
| 625 | * removed! |
| 626 | * removed! |
| 627 | * |
| 628 | * |
| 629 | * removed! |
| 630 | * removed! |
| 631 | * |
| 632 | * |
| 633 | * removed! |
| 634 | * removed! |
| 635 | * compile error |
| 636 | * |
| 637 | * removed! |
| 638 | * removed! |
| 639 | * Let customer can configure ACM boundary, if acm is exceed the reasonable boundary, turn off ACM check and will not disconnect MO/MT call. |
| 640 | * |
| 641 | * removed! |
| 642 | * rebase maintrunk.MAUI_MSZ on 03/17/2007 11:19:34 PM. |
| 643 | * |
| 644 | * |
| 645 | * removed! |
| 646 | * removed! |
| 647 | * |
| 648 | * |
| 649 | * removed! |
| 650 | * removed! |
| 651 | * |
| 652 | * |
| 653 | * removed! |
| 654 | * removed! |
| 655 | * |
| 656 | * |
| 657 | * removed! |
| 658 | * removed! |
| 659 | * |
| 660 | * |
| 661 | * removed! |
| 662 | * removed! |
| 663 | * Network Events notification mech. support. |
| 664 | * |
| 665 | * removed! |
| 666 | * removed! |
| 667 | * Fix MoDIS compile warning. |
| 668 | * |
| 669 | * removed! |
| 670 | * removed! |
| 671 | * |
| 672 | * |
| 673 | * removed! |
| 674 | * removed! |
| 675 | * |
| 676 | * |
| 677 | * removed! |
| 678 | * removed! |
| 679 | * download folder name customization |
| 680 | * |
| 681 | *------------------------------------------------------------------------------ |
| 682 | * Upper this line, this part is controlled by ClearCase. DO NOT MODIFY!! |
| 683 | *============================================================================ |
| 684 | ****************************************************************************/ |
| 685 | |
| 686 | #include "kal_general_types.h" |
| 687 | //#include "lcm_if.h" |
| 688 | #include "kal_public_api.h" |
| 689 | #include "string.h" |
| 690 | #include "nvram_data_items.h" |
| 691 | #include "kal_public_defs.h" |
| 692 | //#include "stack_common.h" |
| 693 | #include "dcl.h" |
| 694 | #include "kal_public_defs.h" //MSBB change #include "stack_config.h" |
| 695 | #include "nvram_interface.h" |
| 696 | //#include "lcd_if.h" |
| 697 | #include "custom_em.h" |
| 698 | #include "device.h" |
| 699 | #include "l1audio.h" |
| 700 | #include "em_struct.h" |
| 701 | #include "dcl.h" |
| 702 | #include "drv_comm.h" |
| 703 | #include "l4c_em.h" |
| 704 | #include "dhl_cc_public.h" |
| 705 | #include "ps_public_utility.h" |
| 706 | #include "dhl_nvram_def.h" |
| 707 | |
| 708 | #include "svc_sap.h" |
| 709 | #include "custom_port.h" |
| 710 | |
| 711 | typedef struct |
| 712 | { |
| 713 | kal_uint32 freq[CUSTOM_EM_PWM_TYPE_MAX]; |
| 714 | kal_uint32 duty_cycle[CUSTOM_EM_PWM_TYPE_MAX]; |
| 715 | } custom_em_pwm_param_set_struct; |
| 716 | |
| 717 | typedef struct |
| 718 | { |
| 719 | custom_em_pwm_param_set_struct custom_em_pwm_param; /* PWM Current Setting */ |
| 720 | custom_em_pwm_param_set_struct custom_em_pwm_level_param[CUSTOM_EM_PWM_LEVEL_MAX]; /* PWM Level */ |
| 721 | } custom_em_param_context_struct; |
| 722 | |
| 723 | #ifndef __L1_STANDALONE__ |
| 724 | static void custom_em_gpio_writeIO(kal_uint8 data, kal_uint8 port); |
| 725 | static void custom_em_gpo_writeIO(kal_uint8 data,kal_uint8 port); |
| 726 | #endif |
| 727 | |
| 728 | extern UART_PORT atp_custom_ps_uart_port(void); |
| 729 | |
| 730 | #ifndef __L1_STANDALONE__ |
| 731 | |
| 732 | kal_bool g_is_custom_em_init = KAL_FALSE; |
| 733 | custom_em_param_context_struct g_em_context; |
| 734 | |
| 735 | extern void PWM_level(kal_uint8 level); |
| 736 | |
| 737 | #ifndef DRV_PWM_NOT_EXIST |
| 738 | static kal_bool custom_em_init(kal_bool is_reset) |
| 739 | { |
| 740 | /*----------------------------------------------------------------*/ |
| 741 | /* Local Variables */ |
| 742 | /*----------------------------------------------------------------*/ |
| 743 | //kal_uint32 Ret, len; |
| 744 | |
| 745 | /*----------------------------------------------------------------*/ |
| 746 | /* Code Body */ |
| 747 | /*----------------------------------------------------------------*/ |
| 748 | kal_mem_set(&g_em_context, 0, sizeof(custom_em_param_context_struct)); |
| 749 | g_is_custom_em_init = KAL_TRUE; |
| 750 | return KAL_TRUE; |
| 751 | } |
| 752 | #endif |
| 753 | |
| 754 | kal_uint8 custom_em_pwm_get_hw_current_level(CUSTOM_EM_PWM_TYPE type) |
| 755 | { |
| 756 | /*----------------------------------------------------------------*/ |
| 757 | /* Local Variables */ |
| 758 | /*----------------------------------------------------------------*/ |
| 759 | |
| 760 | /*----------------------------------------------------------------*/ |
| 761 | /* Code Body */ |
| 762 | /*----------------------------------------------------------------*/ |
| 763 | #ifndef DRV_PWM_NOT_EXIST |
| 764 | DCL_HANDLE pwm_handle; |
| 765 | DCL_CTRL_DATA_T data; |
| 766 | switch (type) |
| 767 | { |
| 768 | case (CUSTOM_EM_PWM_TYPE_1): |
| 769 | pwm_handle=DclPWM_Open(DCL_PWM1,MOD_UEM); |
| 770 | DclPWM_Control(pwm_handle,PWM_CMD_GET_CURRENT_LEVEL,&data); |
| 771 | DclPWM_Close(pwm_handle); |
| 772 | return data.rPWMSaveData.pwm_level; |
| 773 | |
| 774 | case (CUSTOM_EM_PWM_TYPE_2): |
| 775 | return 0; |
| 776 | |
| 777 | case (CUSTOM_EM_PWM_TYPE_3): |
| 778 | pwm_handle=DclPWM_Open(DCL_PWM3, MOD_UEM); |
| 779 | DclPWM_Control(pwm_handle,PWM_CMD_GET_CURRENT_LEVEL,&data); |
| 780 | DclPWM_Close(pwm_handle); |
| 781 | return data.rPWMSaveData.pwm_level; |
| 782 | default: |
| 783 | ASSERT(0); |
| 784 | break; |
| 785 | } |
| 786 | #endif |
| 787 | return 0; |
| 788 | } |
| 789 | |
| 790 | kal_bool custom_em_pwm_get_level_value( |
| 791 | CUSTOM_EM_PWM_TYPE type, |
| 792 | CUSTOM_EM_PWM_LEVEL level, |
| 793 | kal_uint16 *freq, |
| 794 | kal_uint8 *duty_cycle) |
| 795 | { |
| 796 | /*----------------------------------------------------------------*/ |
| 797 | /* Local Variables */ |
| 798 | /*----------------------------------------------------------------*/ |
| 799 | |
| 800 | /*----------------------------------------------------------------*/ |
| 801 | /* Code Body */ |
| 802 | /*----------------------------------------------------------------*/ |
| 803 | #ifndef DRV_PWM_NOT_EXIST |
| 804 | if (g_is_custom_em_init != KAL_TRUE) |
| 805 | { |
| 806 | custom_em_init(KAL_FALSE); |
| 807 | } |
| 808 | |
| 809 | if (level >= CUSTOM_EM_PWM_LEVEL_MAX || type >= CUSTOM_EM_PWM_TYPE_MAX) |
| 810 | { |
| 811 | return KAL_FALSE; |
| 812 | } |
| 813 | |
| 814 | *freq = g_em_context.custom_em_pwm_level_param[level].freq[type]; |
| 815 | *duty_cycle = g_em_context.custom_em_pwm_level_param[level].duty_cycle[type]; |
| 816 | |
| 817 | return KAL_TRUE; |
| 818 | #else |
| 819 | return KAL_FALSE; |
| 820 | #endif |
| 821 | } |
| 822 | |
| 823 | extern void PWM3_level(kal_uint8 level); |
| 824 | void custom_em_pwm_set_level(CUSTOM_EM_PWM_TYPE type, kal_uint8 level) |
| 825 | { |
| 826 | /*----------------------------------------------------------------*/ |
| 827 | /* Local Variables */ |
| 828 | /*----------------------------------------------------------------*/ |
| 829 | |
| 830 | /*----------------------------------------------------------------*/ |
| 831 | /* Code Body */ |
| 832 | /*----------------------------------------------------------------*/ |
| 833 | #ifndef DRV_PWM_NOT_EXIST |
| 834 | switch (type) |
| 835 | { |
| 836 | case (CUSTOM_EM_PWM_TYPE_1): |
| 837 | PWM_level(level); |
| 838 | break; |
| 839 | case (CUSTOM_EM_PWM_TYPE_2): |
| 840 | break; |
| 841 | case (CUSTOM_EM_PWM_TYPE_3): |
| 842 | PWM3_level(level); |
| 843 | break; |
| 844 | default: |
| 845 | ASSERT(0); |
| 846 | break; |
| 847 | } |
| 848 | #endif |
| 849 | } |
| 850 | |
| 851 | kal_bool custom_em_pwm_set_level_value( |
| 852 | CUSTOM_EM_PWM_TYPE type, |
| 853 | CUSTOM_EM_PWM_LEVEL level, |
| 854 | kal_uint16 freq, |
| 855 | kal_uint8 duty_cycle) |
| 856 | { |
| 857 | /*----------------------------------------------------------------*/ |
| 858 | /* Local Variables */ |
| 859 | /*----------------------------------------------------------------*/ |
| 860 | |
| 861 | /*----------------------------------------------------------------*/ |
| 862 | /* Code Body */ |
| 863 | /*----------------------------------------------------------------*/ |
| 864 | #ifndef DRV_PWM_NOT_EXIST |
| 865 | if (g_is_custom_em_init != KAL_TRUE) |
| 866 | { |
| 867 | custom_em_init(KAL_FALSE); |
| 868 | } |
| 869 | |
| 870 | if (level >= CUSTOM_EM_PWM_LEVEL_MAX || type >= CUSTOM_EM_PWM_TYPE_MAX) |
| 871 | { |
| 872 | return KAL_FALSE; |
| 873 | } |
| 874 | |
| 875 | g_em_context.custom_em_pwm_level_param[level].freq[type] = freq; |
| 876 | g_em_context.custom_em_pwm_level_param[level].duty_cycle[type] = duty_cycle; |
| 877 | |
| 878 | |
| 879 | return KAL_TRUE; |
| 880 | #else |
| 881 | return KAL_FALSE; |
| 882 | #endif |
| 883 | } |
| 884 | |
| 885 | void custom_em_pwm_start(CUSTOM_EM_PWM_TYPE type, kal_uint32 freq, kal_uint32 duty) |
| 886 | { |
| 887 | /*----------------------------------------------------------------*/ |
| 888 | /* Local Variables */ |
| 889 | /*----------------------------------------------------------------*/ |
| 890 | |
| 891 | /*----------------------------------------------------------------*/ |
| 892 | /* Code Body */ |
| 893 | /*----------------------------------------------------------------*/ |
| 894 | #ifndef DRV_PWM_NOT_EXIST |
| 895 | DCL_HANDLE pwm_handle; |
| 896 | PWM_CMD_CONFIG_OLD_T old_config; |
| 897 | //ALERTER_CONFIGURE_T alerter_config; |
| 898 | if (g_is_custom_em_init != KAL_TRUE) |
| 899 | { |
| 900 | custom_em_init(KAL_FALSE); |
| 901 | } |
| 902 | |
| 903 | switch (type) |
| 904 | { |
| 905 | case (CUSTOM_EM_PWM_TYPE_1): |
| 906 | pwm_handle=DclPWM_Open(DCL_PWM1,MOD_UEM); |
| 907 | old_config.freq=freq; |
| 908 | old_config.duty=duty; |
| 909 | DclPWM_Control(pwm_handle,PWM_CMD_CONFIG_OLD,(DCL_CTRL_DATA_T*)&old_config); |
| 910 | DclPWM_Control(pwm_handle,PWM_CMD_START,0); |
| 911 | DclPWM_Close(pwm_handle); |
| 912 | break; |
| 913 | |
| 914 | case (CUSTOM_EM_PWM_TYPE_2): |
| 915 | break; |
| 916 | |
| 917 | case (CUSTOM_EM_PWM_TYPE_3): |
| 918 | pwm_handle=DclPWM_Open(DCL_PWM3,MOD_UEM); |
| 919 | old_config.freq=freq; |
| 920 | old_config.duty=duty; |
| 921 | DclPWM_Control(pwm_handle,PWM_CMD_CONFIG_OLD,(DCL_CTRL_DATA_T*)&old_config); |
| 922 | DclPWM_Control(pwm_handle,PWM_CMD_START,0); |
| 923 | DclPWM_Close(pwm_handle); |
| 924 | break; |
| 925 | |
| 926 | default: |
| 927 | ASSERT(0); |
| 928 | break; |
| 929 | } |
| 930 | #endif |
| 931 | } |
| 932 | |
| 933 | |
| 934 | /***************************************************************************** |
| 935 | * FUNCTION |
| 936 | * custom_em_pwm_stop |
| 937 | * DESCRIPTION |
| 938 | * |
| 939 | * PARAMETERS |
| 940 | * type [IN] |
| 941 | * RETURNS |
| 942 | * void |
| 943 | *****************************************************************************/ |
| 944 | void custom_em_pwm_stop(CUSTOM_EM_PWM_TYPE type) |
| 945 | { |
| 946 | /*----------------------------------------------------------------*/ |
| 947 | /* Local Variables */ |
| 948 | /*----------------------------------------------------------------*/ |
| 949 | |
| 950 | /*----------------------------------------------------------------*/ |
| 951 | /* Code Body */ |
| 952 | /*----------------------------------------------------------------*/ |
| 953 | #ifndef DRV_PWM_NOT_EXIST |
| 954 | DCL_HANDLE pwm_handle; |
| 955 | if (g_is_custom_em_init != KAL_TRUE) |
| 956 | { |
| 957 | custom_em_init(KAL_FALSE); |
| 958 | } |
| 959 | |
| 960 | switch (type) |
| 961 | { |
| 962 | case (CUSTOM_EM_PWM_TYPE_1): |
| 963 | pwm_handle=DclPWM_Open(DCL_PWM1,MOD_UEM); |
| 964 | DclPWM_Control(pwm_handle,PWM_CMD_STOP,0); |
| 965 | DclPWM_Close(pwm_handle); |
| 966 | break; |
| 967 | |
| 968 | case (CUSTOM_EM_PWM_TYPE_2): |
| 969 | break; |
| 970 | |
| 971 | case (CUSTOM_EM_PWM_TYPE_3): |
| 972 | pwm_handle=DclPWM_Open(DCL_PWM3,MOD_UEM); |
| 973 | DclPWM_Control(pwm_handle,PWM_CMD_STOP,0); |
| 974 | DclPWM_Close(pwm_handle); |
| 975 | break; |
| 976 | |
| 977 | default: |
| 978 | ASSERT(0); |
| 979 | break; |
| 980 | } |
| 981 | #endif |
| 982 | } |
| 983 | |
| 984 | void custom_em_pwm_get_value(kal_uint16 *freq, kal_uint8 *duty_cycle) |
| 985 | { |
| 986 | /*----------------------------------------------------------------*/ |
| 987 | /* Local Variables */ |
| 988 | /*----------------------------------------------------------------*/ |
| 989 | |
| 990 | /*----------------------------------------------------------------*/ |
| 991 | /* Code Body */ |
| 992 | /*----------------------------------------------------------------*/ |
| 993 | #ifndef DRV_PWM_NOT_EXIST |
| 994 | if (g_is_custom_em_init != KAL_TRUE) |
| 995 | { |
| 996 | custom_em_init(KAL_FALSE); |
| 997 | } |
| 998 | |
| 999 | kal_mem_cpy(freq, g_em_context.custom_em_pwm_param.freq, sizeof(g_em_context.custom_em_pwm_param.freq)); |
| 1000 | kal_mem_cpy( |
| 1001 | duty_cycle, |
| 1002 | g_em_context.custom_em_pwm_param.duty_cycle, |
| 1003 | sizeof(g_em_context.custom_em_pwm_param.duty_cycle)); |
| 1004 | #endif |
| 1005 | } |
| 1006 | |
| 1007 | |
| 1008 | /***************************************************************************** |
| 1009 | * FUNCTION |
| 1010 | * custom_em_pwm_set_value |
| 1011 | * DESCRIPTION |
| 1012 | * |
| 1013 | * PARAMETERS |
| 1014 | * freq [?] |
| 1015 | * duty_cycle [?] |
| 1016 | * RETURNS |
| 1017 | * void |
| 1018 | *****************************************************************************/ |
| 1019 | void custom_em_pwm_set_value(kal_uint16 *freq, kal_uint8 *duty_cycle) |
| 1020 | { |
| 1021 | /*----------------------------------------------------------------*/ |
| 1022 | /* Local Variables */ |
| 1023 | /*----------------------------------------------------------------*/ |
| 1024 | |
| 1025 | /*----------------------------------------------------------------*/ |
| 1026 | /* Code Body */ |
| 1027 | /*----------------------------------------------------------------*/ |
| 1028 | #ifndef DRV_PWM_NOT_EXIST |
| 1029 | if (g_is_custom_em_init != KAL_TRUE) |
| 1030 | { |
| 1031 | custom_em_init(KAL_FALSE); |
| 1032 | } |
| 1033 | |
| 1034 | kal_mem_cpy(g_em_context.custom_em_pwm_param.freq, freq, sizeof(g_em_context.custom_em_pwm_param.freq)); |
| 1035 | kal_mem_cpy( |
| 1036 | g_em_context.custom_em_pwm_param.duty_cycle, |
| 1037 | duty_cycle, |
| 1038 | sizeof(g_em_context.custom_em_pwm_param.duty_cycle)); |
| 1039 | #endif |
| 1040 | } |
| 1041 | |
| 1042 | /***************************************************************************** |
| 1043 | * FUNCTION |
| 1044 | * custom_em_gpio_start |
| 1045 | * DESCRIPTION |
| 1046 | * |
| 1047 | * PARAMETERS |
| 1048 | * port [IN] |
| 1049 | * RETURNS |
| 1050 | * void |
| 1051 | *****************************************************************************/ |
| 1052 | void custom_em_gpio_start(kal_uint8 port) |
| 1053 | { |
| 1054 | /*----------------------------------------------------------------*/ |
| 1055 | /* Local Variables */ |
| 1056 | /*----------------------------------------------------------------*/ |
| 1057 | |
| 1058 | /*----------------------------------------------------------------*/ |
| 1059 | /* Code Body */ |
| 1060 | /*----------------------------------------------------------------*/ |
| 1061 | custom_em_gpio_writeIO(1, port); |
| 1062 | } |
| 1063 | |
| 1064 | /***************************************************************************** |
| 1065 | * FUNCTION |
| 1066 | * custom_em_gpio_stop |
| 1067 | * DESCRIPTION |
| 1068 | * |
| 1069 | * PARAMETERS |
| 1070 | * port [IN] |
| 1071 | * RETURNS |
| 1072 | * void |
| 1073 | *****************************************************************************/ |
| 1074 | void custom_em_gpio_stop(kal_uint8 port) |
| 1075 | { |
| 1076 | /*----------------------------------------------------------------*/ |
| 1077 | /* Local Variables */ |
| 1078 | /*----------------------------------------------------------------*/ |
| 1079 | |
| 1080 | /*----------------------------------------------------------------*/ |
| 1081 | /* Code Body */ |
| 1082 | /*----------------------------------------------------------------*/ |
| 1083 | custom_em_gpio_writeIO(0, port); |
| 1084 | } |
| 1085 | |
| 1086 | /***************************************************************************** |
| 1087 | * FUNCTION |
| 1088 | * custom_em_gpo_writeio |
| 1089 | * DESCRIPTION |
| 1090 | * |
| 1091 | * PARAMETERS |
| 1092 | * data [IN] |
| 1093 | * port [IN] |
| 1094 | * RETURNS |
| 1095 | * void |
| 1096 | *****************************************************************************/ |
| 1097 | void custom_em_gpo_writeio(kal_int8 data, kal_int8 port) |
| 1098 | { |
| 1099 | /*----------------------------------------------------------------*/ |
| 1100 | /* Local Variables */ |
| 1101 | /*----------------------------------------------------------------*/ |
| 1102 | |
| 1103 | /*----------------------------------------------------------------*/ |
| 1104 | /* Code Body */ |
| 1105 | /*----------------------------------------------------------------*/ |
| 1106 | custom_em_gpo_writeIO(data, port); |
| 1107 | } |
| 1108 | |
| 1109 | |
| 1110 | #endif /* __L1_STANDALONE__ */ |
| 1111 | |
| 1112 | static kal_uint8 CTI_UART_PORT = 0; |
| 1113 | static UART_baudrate CTI_BAUD_RATE = 0; |
| 1114 | |
| 1115 | kal_bool High_Speed_SIM = KAL_FALSE; |
| 1116 | kal_uint8 UART_POWER_SETTING = 0; |
| 1117 | |
| 1118 | kal_uint8 g_usb_cdrom_config; |
| 1119 | |
| 1120 | #ifdef __TST_MODULE__ |
| 1121 | extern UART_PORT TST_PORT; |
| 1122 | extern UART_baudrate TST_BAUDRATE; |
| 1123 | |
| 1124 | extern UART_PORT TST_PORT_L1; |
| 1125 | extern UART_baudrate TST_BAUDRATE_L1; |
| 1126 | |
| 1127 | #if defined(__DSP_FCORE4__) |
| 1128 | extern UART_PORT TST_PORT_DSP; |
| 1129 | extern UART_baudrate TST_BAUDRATE_DSP; |
| 1130 | #endif //#if defined(__DSP_FCORE4__) |
| 1131 | |
| 1132 | /* This macro can be located at the makefile */ |
| 1133 | #ifdef __TST_WRITE_TO_FILE__ |
| 1134 | extern kal_uint8 TST_OUTPUT_MODE; |
| 1135 | #endif |
| 1136 | |
| 1137 | #ifndef L4_NOT_PRESENT |
| 1138 | extern UART_PORT PS_UART_PORT; |
| 1139 | extern UART_PORT PS_UART_PORT_2; |
| 1140 | extern UART_PORT PS_EPDG_CMD_PORT; |
| 1141 | extern UART_PORT PS_EPDG_URC_PORT; |
| 1142 | extern UART_PORT PS_EPDG_CMD_PORT_2; |
| 1143 | extern UART_PORT PS_EPDG_URC_PORT_2; |
| 1144 | extern UART_baudrate PS_BAUDRATE; |
| 1145 | #endif /* L4_NOT_PRESENT */ |
| 1146 | #endif /* __TST_MODULE__ */ |
| 1147 | extern kal_uint8 SWDBG_Profile; |
| 1148 | extern kal_uint32 BytesPerCluster; /* will be set to exact value in nvram_get_disk_file_info */ |
| 1149 | |
| 1150 | |
| 1151 | #ifdef __DATA_CARD_SPEECH__ |
| 1152 | #ifdef __MTK_TARGET__ |
| 1153 | extern UART_PORT SPEECH_PORT; |
| 1154 | #endif |
| 1155 | #endif |
| 1156 | |
| 1157 | extern void UART_TurnOnPower(UART_PORT port, kal_bool enable); |
| 1158 | #ifndef __L1_STANDALONE__ |
| 1159 | static kal_bool custom_em_is_uart_used(UART_PORT port); |
| 1160 | #endif |
| 1161 | |
| 1162 | extern boot_mode_type stack_query_boot_mode(void); |
| 1163 | |
| 1164 | #ifndef __MAUI_BASIC__ |
| 1165 | |
| 1166 | static void custom_em_uart_turnon_power(UART_PORT port, kal_bool on); |
| 1167 | |
| 1168 | |
| 1169 | /***************************************************************************** |
| 1170 | * FUNCTION |
| 1171 | * nvram_config_com_port |
| 1172 | * DESCRIPTION |
| 1173 | * To init COM port setting |
| 1174 | * PARAMETERS |
| 1175 | * void |
| 1176 | * RETURNS |
| 1177 | * void |
| 1178 | *****************************************************************************/ |
| 1179 | void custom_em_nvram_config_com_port(void) |
| 1180 | { |
| 1181 | /*----------------------------------------------------------------*/ |
| 1182 | /* Local Variables */ |
| 1183 | /*----------------------------------------------------------------*/ |
| 1184 | kal_uint8 *buffer = NULL; |
| 1185 | kal_bool result; |
| 1186 | #if defined(__BOOT_FOR_USBAT__) && defined(__MTK_TARGET__) |
| 1187 | kal_bool for_usbat = KAL_FALSE; |
| 1188 | #endif |
| 1189 | /*----------------------------------------------------------------*/ |
| 1190 | /* Code Body */ |
| 1191 | /*----------------------------------------------------------------*/ |
| 1192 | buffer = (kal_uint8*) get_ctrl_buffer(NVRAM_EF_PORT_SETTING_SIZE); |
| 1193 | |
| 1194 | if (buffer) |
| 1195 | { |
| 1196 | port_setting_struct *port_setting; |
| 1197 | |
| 1198 | result = nvram_external_read_data(NVRAM_EF_PORT_SETTING_LID, 1, buffer, NVRAM_EF_PORT_SETTING_SIZE); |
| 1199 | |
| 1200 | /* Ok, now config UART/IrCOMM ports for L4 and TST, and filters to TST */ |
| 1201 | if (result) |
| 1202 | { |
| 1203 | #if defined(__BOOT_FOR_USBAT__) && defined(__MTK_TARGET__) |
| 1204 | for_usbat = INT_IsBootForUSBAT(); |
| 1205 | #endif |
| 1206 | |
| 1207 | |
| 1208 | port_setting = (port_setting_struct*) buffer; |
| 1209 | |
| 1210 | #ifdef __TST_MODULE__ |
| 1211 | |
| 1212 | #ifdef __IRDA_SUPPORT__ |
| 1213 | if ( (uart_port_irda == (UART_PORT) port_setting->tst_port_ps) || |
| 1214 | (uart_port_irda == (UART_PORT) port_setting->tst_port_l1)) |
| 1215 | { |
| 1216 | init_ircomm_module(); |
| 1217 | IRDA_Open(); |
| 1218 | } |
| 1219 | #endif /* __IRDA_SUPPORT__ */ |
| 1220 | |
| 1221 | #if defined(__BOOT_FOR_USBAT__) && defined(__MTK_TARGET__) |
| 1222 | if (for_usbat) |
| 1223 | { |
| 1224 | TST_PORT = (UART_PORT) uart_port1; |
| 1225 | TST_PORT_L1 = (UART_PORT) uart_port1; |
| 1226 | } |
| 1227 | else |
| 1228 | #endif |
| 1229 | { |
| 1230 | TST_PORT = (UART_PORT) port_setting->tst_port_ps; |
| 1231 | TST_PORT_L1 = (UART_PORT) port_setting->tst_port_l1; |
| 1232 | } |
| 1233 | |
| 1234 | TST_BAUDRATE = port_setting->tst_baudrate_ps; |
| 1235 | TST_BAUDRATE_L1 = port_setting->tst_baudrate_l1; |
| 1236 | |
| 1237 | #ifndef L4_NOT_PRESENT |
| 1238 | #if defined(__BOOT_FOR_USBAT__) && defined(__MTK_TARGET__) |
| 1239 | if (for_usbat) |
| 1240 | { |
| 1241 | PS_UART_PORT = (UART_PORT) uart_port_usb; |
| 1242 | } |
| 1243 | else |
| 1244 | #endif |
| 1245 | { |
| 1246 | kal_uint8 port_mode = CUSTOM_PORT_GET_MODE(CUSTOM_PORT_USER_AT); |
| 1247 | switch (port_mode) { |
| 1248 | case PORT_MODE_USB: |
| 1249 | PS_UART_PORT = (UART_PORT) uart_port_usb; |
| 1250 | break; |
| 1251 | case PORT_MODE_PCIE: |
| 1252 | if(0 != CUSTOM_PORT_GET_PCIE_ENABLE(CUSTOM_PORT_USER_AT)) { |
| 1253 | PS_UART_PORT = (UART_PORT) uart_port_at_ccci; |
| 1254 | } else { |
| 1255 | PS_UART_PORT = (UART_PORT) uart_port_null; |
| 1256 | } |
| 1257 | break; |
| 1258 | default: |
| 1259 | PS_UART_PORT = (UART_PORT) port_setting->ps_port; |
| 1260 | } |
| 1261 | PS_UART_PORT_2 = (UART_PORT) port_setting->ndis_port; |
| 1262 | PS_EPDG_CMD_PORT = (UART_PORT) port_setting->epdg_cmd_port; |
| 1263 | PS_EPDG_URC_PORT = (UART_PORT) port_setting->epdg_urc_port; |
| 1264 | PS_EPDG_CMD_PORT_2 = (UART_PORT) port_setting->epdg_cmd_port_2; |
| 1265 | PS_EPDG_URC_PORT_2 = (UART_PORT) port_setting->epdg_urc_port_2; |
| 1266 | } |
| 1267 | PS_BAUDRATE = port_setting->ps_baudrate; |
| 1268 | |
| 1269 | #endif /* L4_NOT_PRESENT */ |
| 1270 | |
| 1271 | #if defined(__DSP_FCORE4__) |
| 1272 | TST_PORT_DSP = (UART_PORT) port_setting->tst_port_dsp; |
| 1273 | TST_BAUDRATE_DSP = port_setting->tst_baud_rate_dsp; |
| 1274 | #endif //#if defined(__DSP_FCORE4__) |
| 1275 | |
| 1276 | #endif /* __TST_MODULE__ */ |
| 1277 | |
| 1278 | High_Speed_SIM = port_setting->High_Speed_SIM_Enabled; |
| 1279 | |
| 1280 | if (High_Speed_SIM) |
| 1281 | { |
| 1282 | // remove |
| 1283 | } |
| 1284 | |
| 1285 | SWDBG_Profile = port_setting->swdbg; |
| 1286 | UART_POWER_SETTING = port_setting->uart_power_setting; |
| 1287 | CTI_UART_PORT = port_setting->cti_uart_port; |
| 1288 | CTI_BAUD_RATE = port_setting->cti_baudrate; |
| 1289 | |
| 1290 | #ifdef __TST_WRITE_TO_FILE__ |
| 1291 | TST_OUTPUT_MODE = port_setting->tst_output_mode; |
| 1292 | #endif |
| 1293 | |
| 1294 | |
| 1295 | #ifdef __MTK_TARGET__ |
| 1296 | #ifndef __L1_STANDALONE__ |
| 1297 | /* To determine if in META mode */ |
| 1298 | if (FACTORY_BOOT != kal_query_boot_mode()) |
| 1299 | { |
| 1300 | //kal_bool enable; |
| 1301 | |
| 1302 | if (custom_em_is_uart_used(uart_port1)) |
| 1303 | { |
| 1304 | custom_em_uart_turnon_power(uart_port1, KAL_TRUE); |
| 1305 | } |
| 1306 | else |
| 1307 | { |
| 1308 | custom_em_uart_turnon_power(uart_port1, KAL_FALSE); |
| 1309 | } |
| 1310 | #ifndef __SMART_PHONE_MODEM__ |
| 1311 | if (custom_em_is_uart_used(uart_port2)) |
| 1312 | { |
| 1313 | custom_em_uart_turnon_power(uart_port2, KAL_TRUE); |
| 1314 | } |
| 1315 | else |
| 1316 | { |
| 1317 | custom_em_uart_turnon_power(uart_port2, KAL_FALSE); |
| 1318 | } |
| 1319 | |
| 1320 | #if 0 |
| 1321 | /* under construction !*/ |
| 1322 | /* under construction !*/ |
| 1323 | /* under construction !*/ |
| 1324 | /* under construction !*/ |
| 1325 | /* under construction !*/ |
| 1326 | /* under construction !*/ |
| 1327 | /* under construction !*/ |
| 1328 | /* under construction !*/ |
| 1329 | #endif |
| 1330 | #endif |
| 1331 | } |
| 1332 | else /* In META Mode, Turn on every UART power */ |
| 1333 | #endif /* __L1_STANDALONE__ */ |
| 1334 | { |
| 1335 | #ifndef __SMART_PHONE_MODEM__ |
| 1336 | custom_em_uart_turnon_power(uart_port1, KAL_TRUE); |
| 1337 | custom_em_uart_turnon_power(uart_port2, KAL_TRUE); |
| 1338 | #if 0 |
| 1339 | /* under construction !*/ |
| 1340 | #endif |
| 1341 | #endif |
| 1342 | } |
| 1343 | #endif /* __MTK_TARGET__ */ |
| 1344 | |
| 1345 | g_usb_cdrom_config = port_setting->usb_cdrom_config; |
| 1346 | |
| 1347 | #ifdef __DATA_CARD_SPEECH__ |
| 1348 | #ifdef __MTK_TARGET__ |
| 1349 | SPEECH_PORT = port_setting->speech_port; |
| 1350 | #endif |
| 1351 | #endif |
| 1352 | } |
| 1353 | |
| 1354 | free_ctrl_buffer(buffer); |
| 1355 | } |
| 1356 | |
| 1357 | buffer = NULL; |
| 1358 | } |
| 1359 | |
| 1360 | |
| 1361 | #ifndef __L1_STANDALONE__ |
| 1362 | static kal_bool custom_em_is_uart_used(UART_PORT port) |
| 1363 | { |
| 1364 | #if defined(__TST_MODULE__) |
| 1365 | if (TST_PORT == port || |
| 1366 | TST_PORT_L1 == port |
| 1367 | #if !defined(L4_NOT_PRESENT) |
| 1368 | || PS_UART_PORT == port |
| 1369 | || PS_UART_PORT_2 == port |
| 1370 | || PS_EPDG_CMD_PORT == port |
| 1371 | || PS_EPDG_URC_PORT == port |
| 1372 | || PS_EPDG_CMD_PORT_2 == port |
| 1373 | || PS_EPDG_URC_PORT_2 == port |
| 1374 | || atp_custom_ps_uart_port() == port |
| 1375 | #endif |
| 1376 | #if defined(__DSP_FCORE4__) |
| 1377 | || TST_PORT_DSP == port |
| 1378 | #endif |
| 1379 | ) |
| 1380 | { |
| 1381 | return KAL_TRUE; |
| 1382 | } |
| 1383 | else |
| 1384 | #endif //#if defined(__TST_MODULE__) |
| 1385 | { |
| 1386 | return KAL_FALSE; |
| 1387 | } |
| 1388 | } |
| 1389 | #endif |
| 1390 | |
| 1391 | |
| 1392 | /***************************************************************************** |
| 1393 | * FUNCTION |
| 1394 | * custom_em_get_usb_cdrom_config |
| 1395 | * DESCRIPTION |
| 1396 | * To get USB CDROM configure value |
| 1397 | * PARAMETERS |
| 1398 | * void |
| 1399 | * RETURNS |
| 1400 | * 0 for CDROM, 1 for COM |
| 1401 | *****************************************************************************/ |
| 1402 | kal_uint8 custom_em_get_usb_cdrom_config(void) |
| 1403 | { |
| 1404 | return g_usb_cdrom_config; |
| 1405 | } |
| 1406 | |
| 1407 | /***************************************************************************** |
| 1408 | * FUNCTION |
| 1409 | * custom_em_set_usb_cdrom_config |
| 1410 | * DESCRIPTION |
| 1411 | * To set USB CDROM configure value |
| 1412 | * PARAMETERS |
| 1413 | * value |
| 1414 | * RETURNS |
| 1415 | * void |
| 1416 | *****************************************************************************/ |
| 1417 | void custom_em_set_usb_cdrom_config(kal_uint8 cdrom_config) |
| 1418 | { |
| 1419 | g_usb_cdrom_config = cdrom_config; |
| 1420 | } |
| 1421 | |
| 1422 | #endif /* #ifndef __MAUI_BASIC__*/ |
| 1423 | |
| 1424 | /***************************************************************************** |
| 1425 | * FUNCTION |
| 1426 | * nvram_get_cti |
| 1427 | * DESCRIPTION |
| 1428 | * To get CTI_UART_PORT |
| 1429 | * PARAMETERS |
| 1430 | * void |
| 1431 | * RETURNS |
| 1432 | * kal_uint8 [OUT] CTI |
| 1433 | *****************************************************************************/ |
| 1434 | void nvram_get_cti(kal_uint8 *port, kal_uint32 *baudrate) |
| 1435 | { |
| 1436 | /*----------------------------------------------------------------*/ |
| 1437 | /* Local Variables */ |
| 1438 | /*----------------------------------------------------------------*/ |
| 1439 | |
| 1440 | /*----------------------------------------------------------------*/ |
| 1441 | /* Code Body */ |
| 1442 | /*----------------------------------------------------------------*/ |
| 1443 | |
| 1444 | *port = CTI_UART_PORT; |
| 1445 | *baudrate = (kal_uint32) CTI_BAUD_RATE; |
| 1446 | return; |
| 1447 | } |
| 1448 | |
| 1449 | |
| 1450 | |
| 1451 | /***************************************************************************** |
| 1452 | * FUNCTION |
| 1453 | * nvram_get_speech |
| 1454 | * DESCRIPTION |
| 1455 | * To get SPEECH_PORT |
| 1456 | * PARAMETERS |
| 1457 | * void |
| 1458 | * RETURNS |
| 1459 | * kal_uint8 [OUT] CTI |
| 1460 | *****************************************************************************/ |
| 1461 | void nvram_get_speech(kal_uint8 *port, kal_uint32 *baudrate) |
| 1462 | { |
| 1463 | #ifdef __DATA_CARD_SPEECH__ |
| 1464 | #ifdef __MTK_TARGET__ |
| 1465 | *port = SPEECH_PORT; |
| 1466 | *baudrate = 0; |
| 1467 | #endif |
| 1468 | #endif |
| 1469 | return; |
| 1470 | } |
| 1471 | |
| 1472 | /***************************************************************************** |
| 1473 | * FUNCTION |
| 1474 | * nvram_get_swdbg |
| 1475 | * DESCRIPTION |
| 1476 | * To get SWDBG_Profile |
| 1477 | * PARAMETERS |
| 1478 | * void |
| 1479 | * RETURNS |
| 1480 | * kal_uint8 [OUT] swdbg_profile |
| 1481 | *****************************************************************************/ |
| 1482 | void nvram_get_swdbg(kal_uint8 *swdbg_profile) |
| 1483 | { |
| 1484 | /*----------------------------------------------------------------*/ |
| 1485 | /* Local Variables */ |
| 1486 | /*----------------------------------------------------------------*/ |
| 1487 | |
| 1488 | /*----------------------------------------------------------------*/ |
| 1489 | /* Code Body */ |
| 1490 | /*----------------------------------------------------------------*/ |
| 1491 | |
| 1492 | *swdbg_profile = SWDBG_Profile; |
| 1493 | } |
| 1494 | |
| 1495 | void custom_em_uart_turnon_power(UART_PORT port, kal_bool on) |
| 1496 | { |
| 1497 | DCL_HANDLE handle; |
| 1498 | UART_CTRL_POWERON_T data; |
| 1499 | |
| 1500 | handle = DclSerialPort_Open(port, 0); |
| 1501 | data.bFlag_Poweron = on; |
| 1502 | DclSerialPort_Control(handle, UART_CMD_POWER_ON, (DCL_CTRL_DATA_T*)&data); |
| 1503 | |
| 1504 | DclSerialPort_Close(handle); |
| 1505 | } |
| 1506 | |
| 1507 | #ifndef __L1_STANDALONE__ |
| 1508 | static void custom_em_gpio_writeIO(kal_uint8 data, kal_uint8 port) |
| 1509 | { |
| 1510 | DCL_HANDLE handle; |
| 1511 | |
| 1512 | handle=DclGPIO_Open(DCL_GPIO, port); |
| 1513 | |
| 1514 | if(0 == data) |
| 1515 | DclGPIO_Control(handle,GPIO_CMD_WRITE_LOW,0); |
| 1516 | else if(1 == data) |
| 1517 | DclGPIO_Control(handle,GPIO_CMD_WRITE_HIGH,0); |
| 1518 | |
| 1519 | DclGPIO_Close(handle); |
| 1520 | } |
| 1521 | |
| 1522 | static void custom_em_gpo_writeIO(kal_uint8 data,kal_uint8 port) |
| 1523 | { |
| 1524 | DCL_HANDLE handle; |
| 1525 | |
| 1526 | handle=DclGPIO_Open(DCL_GPO,port); |
| 1527 | |
| 1528 | if(0 == data) |
| 1529 | DclGPIO_Control(handle,GPO_CMD_WRITE_LOW,0); |
| 1530 | else if(1 == data) |
| 1531 | DclGPIO_Control(handle,GPO_CMD_WRITE_HIGH,0); |
| 1532 | |
| 1533 | DclGPIO_Close(handle); |
| 1534 | } |
| 1535 | #endif /* #ifndef __L1_STANDALONE__ */ |
| 1536 | |
| 1537 | #ifdef __SP_RIL_SUPPORT__ |
| 1538 | /***************************************************************************** |
| 1539 | * FUNCTION |
| 1540 | * custom_em_thermal_red_ccci_hisr_callback |
| 1541 | * DESCRIPTION |
| 1542 | * reduce TX power |
| 1543 | * PARAMETERS |
| 1544 | * value [IN] tx reduction unit, byte 3: reserved, byte 2: reserved, byte 1: 3G, byte 0: 2G |
| 1545 | * RETURNS |
| 1546 | * void |
| 1547 | *****************************************************************************/ |
| 1548 | void custom_em_thermal_red_ccci_hisr_callback(kal_uint32 value) |
| 1549 | { |
| 1550 | |
| 1551 | if (kal_query_boot_mode() == NORMAL_BOOT) |
| 1552 | { |
| 1553 | kal_uint8 gsm_tx_pwr_reduction_tbl[4][2][4]; |
| 1554 | kal_uint8 umts_tx_pwr_reduction_tbl[20][2]; |
| 1555 | kal_uint8 gsm_tx_pwr_reduction_tbl_tas[4][2][4]; |
| 1556 | kal_uint8 umts_tx_pwr_reduction_tbl_tas[20][2]; |
| 1557 | |
| 1558 | kal_mem_set((void*)gsm_tx_pwr_reduction_tbl, (value & 0x000000FF), 4*2*4); |
| 1559 | kal_mem_set((void*)umts_tx_pwr_reduction_tbl, ((value & 0x0000FF00) >> 8), 20*2); |
| 1560 | kal_mem_set((void*)gsm_tx_pwr_reduction_tbl_tas, (value & 0x000000FF), 4*2*4); |
| 1561 | kal_mem_set((void*)umts_tx_pwr_reduction_tbl_tas, ((value & 0x0000FF00) >> 8), 20*2); |
| 1562 | |
| 1563 | l4c_l1_max_tx_pwr_red_req((kal_uint8)0, 1, KAL_TRUE, (kal_uint8***)gsm_tx_pwr_reduction_tbl, (kal_uint8***)gsm_tx_pwr_reduction_tbl_tas, |
| 1564 | KAL_TRUE, (kal_uint8**)umts_tx_pwr_reduction_tbl, (kal_uint8**)umts_tx_pwr_reduction_tbl_tas, KAL_FALSE, 0, NULL); |
| 1565 | } |
| 1566 | } |
| 1567 | #endif /* __SP_RIL_SUPPORT__ */ |
| 1568 | |
| 1569 | /***************************************************************************** |
| 1570 | * FUNCTION |
| 1571 | * custom_em_get_imei_rec_by_sim |
| 1572 | * DESCRIPTION |
| 1573 | * get mapping based on SIM slot or 3g switched protocol |
| 1574 | * if defined: SIM slot |
| 1575 | * if not defined: 3g switched protocol (default) |
| 1576 | * PARAMETERS |
| 1577 | * op [IN] 0 for read, 1 for write |
| 1578 | * slot [IN] SIM slot |
| 1579 | * RETURNS |
| 1580 | * sim_interface_enum |
| 1581 | *****************************************************************************/ |
| 1582 | sim_interface_enum custom_em_get_imei_rec_by_sim(kal_uint8 op, sim_interface_enum slot) |
| 1583 | { |
| 1584 | sim_interface_enum idx; |
| 1585 | |
| 1586 | #if defined(__CUSTOM_MAP_SIM_SLOT__) |
| 1587 | idx = slot; |
| 1588 | #else |
| 1589 | idx = l4c_gemini_get_switched_sim_id(slot); |
| 1590 | #endif /* __CUSTOM_MAP_SIM_SLOT__ */ |
| 1591 | |
| 1592 | return idx; |
| 1593 | } |
| 1594 | |
| 1595 | #ifdef __SAR_SENSOR_SUPPORT__ |
| 1596 | /***************************************************************************** |
| 1597 | * FUNCTION |
| 1598 | * custom_sar_mapping |
| 1599 | * |
| 1600 | * DESCRIPTION |
| 1601 | * Needs to be updated by customer. |
| 1602 | * |
| 1603 | * PARAMETERS |
| 1604 | * g_sar_sensor_state [IN] |
| 1605 | * 0x00 : Far |
| 1606 | * 0x01 : Near |
| 1607 | * 0xFD : SAR sensor state disable |
| 1608 | * 0xFE : SAR sensor state enable |
| 1609 | * 0xFF : SAR sensor state not support |
| 1610 | * g_scenario_index [IN] |
| 1611 | * 1~20: Range of valid values of Scenario index |
| 1612 | * |
| 1613 | * RETURNS |
| 1614 | * scenario_index: kal_int16 |
| 1615 | * -1: combined scenario index disable |
| 1616 | * 1~20: Range of valid values of combined scenario index |
| 1617 | *****************************************************************************/ |
| 1618 | kal_int16 custom_sar_mapping(kal_uint8 g_sar_sensor_state, kal_uint16 g_scenario_index) |
| 1619 | { |
| 1620 | if((g_sar_sensor_state == 255)||(g_sar_sensor_state == 254)||(g_sar_sensor_state == 253)) |
| 1621 | { |
| 1622 | return (kal_int16)g_scenario_index;// if the g_sar_sensor_state is unknown then combined scenario index will equal to g_scenario_index |
| 1623 | } |
| 1624 | else//customer can modify here |
| 1625 | { |
| 1626 | return (1); // Please note that the return value should be -1 or between 1~20 |
| 1627 | } |
| 1628 | |
| 1629 | } |
| 1630 | |
| 1631 | |
| 1632 | /***************************************************************************** |
| 1633 | * FUNCTION |
| 1634 | * custom_extant_by_sar_sensor_state |
| 1635 | * |
| 1636 | * DESCRIPTION |
| 1637 | * Needs to be updated by customer. |
| 1638 | * |
| 1639 | * PARAMETERS |
| 1640 | * src_id [IN] Use it as it is in the function l4c_force_tx_ant_req. |
| 1641 | * |
| 1642 | * g_sar_sensor_state [IN] |
| 1643 | * 0xFF: SAR sensor state unknown, or disable |
| 1644 | * 0x00: Far |
| 1645 | * 0x01: Near |
| 1646 | * 0xFD : SAR sensor state disable |
| 1647 | * 0xFE : SAR sensor state enable |
| 1648 | * 0xFF : SAR sensor state not support |
| 1649 | * |
| 1650 | * g_scenario_index [IN] |
| 1651 | * 0xFFFF: g_scenario_index unknown, or disable |
| 1652 | * 1~20: Range of valid values of Scenario index |
| 1653 | * |
| 1654 | * is_test_sim [IN] |
| 1655 | * KAL_TRUE: yes it is a Test SIM |
| 1656 | * KAL_FALSE: It is a real SIM |
| 1657 | * |
| 1658 | * md_product_model_id [IN] |
| 1659 | * 0xFFFFFFFF : If invalid MD Product Model ID |
| 1660 | * Any valid 32 bit integer. |
| 1661 | * |
| 1662 | * RETURNS |
| 1663 | * Nothing |
| 1664 | *****************************************************************************/ |
| 1665 | void custom_extant_by_sar_sensor_state(kal_uint8 src_id, kal_uint8 g_sar_sensor_state, kal_uint16 g_scenario_index, |
| 1666 | kal_bool is_test_sim, kal_uint32 md_product_model_id) |
| 1667 | { |
| 1668 | /* |
| 1669 | kal_bool l4c_force_tx_ant_req(kal_uint8 src_id, kal_uint8 mode, kal_uint8 rat, kal_uint8 ant_state, kal_uint8 band, kal_uint8 nvram_write) |
| 1670 | |
| 1671 | <mode>: kal_uint8 (0~5) |
| 1672 | 0: diable force TX antenna |
| 1673 | 1: enable force TX antenna |
| 1674 | 2: query antenna |
| 1675 | 3: restore by band TAS default value in NVRAM (both real SIM and test SIM) |
| 1676 | 4: force TX antenna by band (both real SIM and test SIM) |
| 1677 | 5: query |
| 1678 | |
| 1679 | <rat>: kal_uint8 (1~4) |
| 1680 | 1: GSM |
| 1681 | 2: UMTS |
| 1682 | 3: LTE |
| 1683 | 4: C2K |
| 1684 | |
| 1685 | <ant_state>: kal_uint8 (0~7) |
| 1686 | 0: TX_ANTENNA_STATE_0, |
| 1687 | 1: TX_ANTENNA_STATE_1, |
| 1688 | 2: TX_ANTENNA_STATE_2, |
| 1689 | 3: TX_ANTENNA_STATE_3, |
| 1690 | 4: TX_ANTENNA_STATE_4, |
| 1691 | 5: TX_ANTENNA_STATE_5, |
| 1692 | 6: TX_ANTENNA_STATE_6, |
| 1693 | 7: TX_ANTENNA_STATE_7, |
| 1694 | 8: TX_ANTENNA_STATE_NUM, |
| 1695 | 255: TX_ANTENNA_INVALID = 0xFF |
| 1696 | |
| 1697 | <band>: kal_uint8 |
| 1698 | |
| 1699 | <nvram_write>: kal_uint8 (0~1) |
| 1700 | 0: No need to save the settings to NVRAM |
| 1701 | 1: Need to save the settings to NVRAM |
| 1702 | |
| 1703 | */ |
| 1704 | |
| 1705 | /* example : for mode = 0, or 1 */ |
| 1706 | /* enable force TX antenna 0 for LTE, and NW write enable */ |
| 1707 | // l4c_force_tx_ant_req(src_id,1/*mode*/,3/*rat = LTE*/,TX_ANTENNA_STATE_0,0xff,1); |
| 1708 | /* enable force TX antenna 1 for WCDMA, and NW write disable */ |
| 1709 | // l4c_force_tx_ant_req(src_id,1/*mode*/,2/*rat = UMTS*/,TX_ANTENNA_STATE_1,0xff,0); |
| 1710 | /* disable force TX antenna for LTE, and NW write enable */ |
| 1711 | // l4c_force_tx_ant_req(src_id,0/*mode*/,3/*rat = LTE*/,0xff,0xff,1); |
| 1712 | /* disable force TX antenna for LTE, and NW write disable */ |
| 1713 | // l4c_force_tx_ant_req(src_id,0/*mode*/,3/*rat = LTE*/,0xff,0xff,0); |
| 1714 | |
| 1715 | |
| 1716 | /* example : for mode = 3, or 4 */ |
| 1717 | /* enable force TX antenna 1 for LTE band 3, does not support NV write, and this action only valid when the serving cell RAT & Band is equal */ |
| 1718 | // l4c_force_tx_ant_req(src_id,4/*mode*/,3/*rat = LTE*/,TX_ANTENNA_STATE_1,0x03,0); |
| 1719 | /* enable force TX antenna 0 for LTE band 7, does not support NV write, and this action only valid when the serving cell RAT & Band is equal */ |
| 1720 | // l4c_force_tx_ant_req(src_id,4/*mode*/,3/*rat = LTE*/,TX_ANTENNA_STATE_0,0x07,0); |
| 1721 | /* restore by band TAS default value in NVRAM (both real SIM and test SIM) for LTE band 3, and this action only valid when the serving cell RAT & Band is equal */ |
| 1722 | // l4c_force_tx_ant_req(src_id,3/*mode*/,3/*rat = LTE*/,0xff,0x03,0); |
| 1723 | kal_uint8 count = 0, ret_val = KAL_FALSE; |
| 1724 | |
| 1725 | count = l4c_sar_get_tx_ant_req_count(); |
| 1726 | |
| 1727 | if (count > 0) |
| 1728 | { |
| 1729 | /*this means previous SAR update is ongoing |
| 1730 | So wait until the previous operation is not finished and then again start the update procedure*/ |
| 1731 | l4c_sar_set_txant_update_needed(); |
| 1732 | return; |
| 1733 | } |
| 1734 | /*******Customer should call the function l4c_force_tx_ant_req() after this ************/ |
| 1735 | /* please store the return value of function call l4c_force_tx_ant_req() in ret_val for every call */ |
| 1736 | //ret_val = l4c_force_tx_ant_req(src_id,4/*mode*/,3/*rat = LTE*/,TX_ANTENNA_STATE_1,0x03,0); |
| 1737 | //ret_val = l4c_force_tx_ant_req(src_id,4/*mode*/,4/*rat = C2K*/,TX_ANTENNA_STATE_1,0x03,0); |
| 1738 | /*******Customer should call the function l4c_force_tx_ant_req() before this ************/ |
| 1739 | |
| 1740 | if(ret_val == KAL_FALSE) |
| 1741 | { |
| 1742 | /*This means AT+ETXANT from the AP is received and modem is making changes corresponding to it. |
| 1743 | So wait until the previous operation is not finished and then again start the update procedure*/ |
| 1744 | l4c_sar_set_txant_update_needed(); |
| 1745 | return; |
| 1746 | } |
| 1747 | } |
| 1748 | |
| 1749 | |
| 1750 | /***************************************************************************** |
| 1751 | * FUNCTION |
| 1752 | * customer_is_sar_sensor_enable |
| 1753 | * |
| 1754 | * DESCRIPTION |
| 1755 | * Needs to be updated by customer. |
| 1756 | * |
| 1757 | * PARAMETERS |
| 1758 | * md_product_model_id [IN] |
| 1759 | * 0xFFFFFFFF : If invalid MD Product Model ID |
| 1760 | * Any valid 32 bit integer. |
| 1761 | * |
| 1762 | * RETURNS |
| 1763 | * custom_sar_setting: kal_int16 |
| 1764 | * -1: L4C_SAR_IGNORE_ACTION |
| 1765 | * 0: L4C_SAR_MODEM_TO_AP_DISABLE_ACTION |
| 1766 | * 1: L4C_SAR_MODEM_TO_AP_ENABLE_ACTION |
| 1767 | *****************************************************************************/ |
| 1768 | kal_int8 customer_is_sar_sensor_enable(kal_uint32 md_product_model_id) |
| 1769 | { |
| 1770 | //customer can implement this function |
| 1771 | return -1;//return -1 to ignore sar or sar sensor not supported |
| 1772 | } |
| 1773 | #endif |
| 1774 | |