|
| 1 | +/* Copyright Statement: |
| 2 | + * |
| 3 | + * (C) 2005-2016 MediaTek Inc. All rights reserved. |
| 4 | + * |
| 5 | + * This software/firmware and related documentation ("MediaTek Software") are |
| 6 | + * protected under relevant copyright laws. The information contained herein |
| 7 | + * is confidential and proprietary to MediaTek Inc. ("MediaTek") and/or its licensors. |
| 8 | + * Without the prior written permission of MediaTek and/or its licensors, |
| 9 | + * any reproduction, modification, use or disclosure of MediaTek Software, |
| 10 | + * and information contained herein, in whole or in part, shall be strictly prohibited. |
| 11 | + * You may only use, reproduce, modify, or distribute (as applicable) MediaTek Software |
| 12 | + * if you have agreed to and been bound by the applicable license agreement with |
| 13 | + * MediaTek ("License Agreement") and been granted explicit permission to do so within |
| 14 | + * the License Agreement ("Permitted User"). If you are not a Permitted User, |
| 15 | + * please cease any access or use of MediaTek Software immediately. |
| 16 | + * BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES |
| 17 | + * THAT MEDIATEK SOFTWARE RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES |
| 18 | + * ARE PROVIDED TO RECEIVER ON AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL |
| 19 | + * WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF |
| 20 | + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT. |
| 21 | + * NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE |
| 22 | + * SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR |
| 23 | + * SUPPLIED WITH MEDIATEK SOFTWARE, AND RECEIVER AGREES TO LOOK ONLY TO SUCH |
| 24 | + * THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. RECEIVER EXPRESSLY ACKNOWLEDGES |
| 25 | + * THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES |
| 26 | + * CONTAINED IN MEDIATEK SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK |
| 27 | + * SOFTWARE RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR |
| 28 | + * STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND |
| 29 | + * CUMULATIVE LIABILITY WITH RESPECT TO MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE, |
| 30 | + * AT MEDIATEK'S OPTION, TO REVISE OR REPLACE MEDIATEK SOFTWARE AT ISSUE, |
| 31 | + * OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY RECEIVER TO |
| 32 | + * MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE. |
| 33 | + */ |
| 34 | + |
| 35 | +#include "exception_handler.h" |
| 36 | + |
| 37 | +/******************************************************************************/ |
| 38 | +/* Memory Regions Definition */ |
| 39 | +/******************************************************************************/ |
| 40 | +#if defined(__GNUC__) |
| 41 | + |
| 42 | +extern unsigned int __FLASH_segment_start__[]; |
| 43 | +extern unsigned int __FLASH_segment_end__[]; |
| 44 | +extern unsigned int __SRAM_segment_start__[]; |
| 45 | +extern unsigned int __SRAM_segment_end__[]; |
| 46 | +extern unsigned int __ramtext_start__[]; |
| 47 | +extern unsigned int __ramtext_end__[]; |
| 48 | +extern unsigned int __tcmbss_start__[]; |
| 49 | +extern unsigned int __tcmbss_end__[]; |
| 50 | + |
| 51 | +const memory_region_type memory_regions[] = |
| 52 | +{ |
| 53 | + {"flash", __FLASH_segment_start__, __FLASH_segment_end__, 0}, |
| 54 | + {"sram", __SRAM_segment_start__, __SRAM_segment_end__, 1}, |
| 55 | + {"ramtext", __ramtext_start__, __ramtext_end__, 1}, |
| 56 | + {"tcmbss", __tcmbss_start__, __tcmbss_end__, 1}, |
| 57 | + {"scs", (unsigned int*)SCS_BASE, (unsigned int*)(SCS_BASE + 0x1000), 1}, |
| 58 | + {0} |
| 59 | +}; |
| 60 | + |
| 61 | +#endif /* __GNUC__ */ |
| 62 | + |
| 63 | +#if defined (__CC_ARM) |
| 64 | + |
| 65 | +extern unsigned int Image$$TEXT$$Base[]; |
| 66 | +extern unsigned int Image$$TEXT$$Limit[]; |
| 67 | +extern unsigned int Image$$DATA$$Base[]; |
| 68 | +extern unsigned int Image$$DATA$$ZI$$Limit[]; |
| 69 | +extern unsigned int Image$$TCM$$Base[]; |
| 70 | +extern unsigned int Image$$TCM$$ZI$$Limit[]; |
| 71 | +extern unsigned int Image$$STACK$$Base[]; |
| 72 | +extern unsigned int Image$$STACK$$ZI$$Limit[]; |
| 73 | + |
| 74 | +const memory_region_type memory_regions[] = |
| 75 | +{ |
| 76 | + {"text", Image$$TEXT$$Base, Image$$TEXT$$Limit, 0}, |
| 77 | + {"data", Image$$DATA$$Base, Image$$DATA$$ZI$$Limit, 1}, |
| 78 | + {"tcm", Image$$TCM$$Base, Image$$TCM$$ZI$$Limit, 1}, |
| 79 | + {"stack", Image$$STACK$$Base, Image$$STACK$$ZI$$Limit, 1}, |
| 80 | + {"scs", (unsigned int *)SCS_BASE, (unsigned int *)(SCS_BASE + 0x1000), 1}, |
| 81 | + {0} |
| 82 | +}; |
| 83 | + |
| 84 | +#endif /* __CC_ARM */ |
| 85 | + |
| 86 | + |
| 87 | +#if defined(__ICCARM__) |
| 88 | + |
| 89 | +extern unsigned int RAM_BLOCK$$Base[]; |
| 90 | +extern unsigned int RAM_BLOCK$$Limit[]; |
| 91 | +extern unsigned int TCM_BLOCK$$Base[]; |
| 92 | +extern unsigned int TCM_BLOCK$$Limit[]; |
| 93 | +extern unsigned int CSTACK$$Base[]; |
| 94 | +extern unsigned int CSTACK$$Limit[]; |
| 95 | + |
| 96 | +const memory_region_type memory_regions[] = |
| 97 | +{ |
| 98 | + {"ram", RAM_BLOCK$$Base, RAM_BLOCK$$Limit, 1}, |
| 99 | + {"tcm", TCM_BLOCK$$Base, TCM_BLOCK$$Limit, 1}, |
| 100 | + {"stack", CSTACK$$Base, CSTACK$$Limit, 1}, |
| 101 | + {"scs", (unsigned int*)SCS_BASE, (unsigned int*)(SCS_BASE + 0x1000), 1}, |
| 102 | + {0} |
| 103 | +}; |
| 104 | + |
| 105 | + |
| 106 | +#endif /* __ICCARM__ */ |
| 107 | + |
| 108 | + |
0 commit comments