1 /* FreeEMS - the open source engine management system
3 Copyright 2008 Fred Cooke
5 This file is part of the FreeEMS project.
7 FreeEMS software is free software: you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation, either version 3 of the License, or
10 (at your option) any later version.
12 FreeEMS software is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with any FreeEMS software. If not, see http://www.gnu.org/licenses/
20 We ask that if you make any changes to this file you email them upstream to
21 us at admin(at)diyefi(dot)org or, even better, fork the code on github.com!
23 Thank you for choosing FreeEMS to run your engine! */
28 * @brief Region definition linker script
30 * Memory region location definition file for inclusion into the linker
31 * script. It defines the names, types, start addresses and lengths of
32 * each memory region available for the linker to populate with code and
33 * data. See hc9s12xdp512elfb.x and regions.x for more information.
35 * A description of what some of this means can be found at the following URLs:
36 * - http://www.gnu.org/software/m68hc11/m68hc11_binutils.html
37 * - http://m68hc11.serveftp.org/wiki/index.php/FAQ:Link
45 /* regs (r) : ORIGIN = 0x0000, LENGTH = 0x0800 /* 2k register space DON'T use! */
46 eeprom (r) : ORIGIN = 0x0800, LENGTH = 0x0800 /* 2K of eeprom for now, 4K requires paging */
48 /* RAM space split up for tuning and flash burning use as well as GP use */
49 rpage (rw) : ORIGIN = 0x1000, LENGTH = 0x1000 /* 4k WINDOW for large tables etc */
50 txbuf (rw) : ORIGIN = 0x2000, LENGTH = 0x0820 /* ~2k FIXED transmission buffer */
51 rxbuf (rw) : ORIGIN = 0x2820, LENGTH = 0x0810 /* ~2k FIXED reception buffer */
52 data (rw) : ORIGIN = 0x3030, LENGTH = 0x0FD0 /* ~4k FIXED general purpose RAM */
53 /* The TX and RX buffers are slightly larger than 2k because the RX buffer */
54 /* needs to also receive a header, checksum and attributes for the data */
55 /* involved and the TX buffer needs to handle all of those two fold. */
57 /* Flash space in linear space while using the page window (16k + 14k + 2k SM = 30k usable, 2k protected) */
58 text1 (rx) : ORIGIN = 0x4000, LENGTH = 0x3800 /* Unpaged 14k flash block before page window */
59 fixedconf1 (rx) : ORIGIN = 0x7800, LENGTH = 0x0400 /* Unpaged 1K flash block before page window */
60 fixedconf2 (rx) : ORIGIN = 0x7C00, LENGTH = 0x0400 /* Unpaged 1K flash block before page window */
61 /*ppaged (rx) : ORIGIN = 0x8000, LENGTH = 0x4000 16K flash page window, DO NOT USE */
62 text (rx) : ORIGIN = 0xC000, LENGTH = 0x3710 /* Unpaged 14K flash block after page window minus serial monitor and vector space */
63 /* TODO split the above text and text1 regions into halves or similar to allow us to know how the linear space is being spent, eg perf/required/isr etc */
65 /* These are correct as of the 0.0.17 release */
66 ppageE0 (rx) : ORIGIN = 0x390000, LENGTH = 0x4000
67 ppageE1 (rx) : ORIGIN = 0x394000, LENGTH = 0x4000
68 ppageE2 (rx) : ORIGIN = 0x398000, LENGTH = 0x4000
69 ppageE3 (rx) : ORIGIN = 0x39C000, LENGTH = 0x4000
70 ppageE4 (rx) : ORIGIN = 0x3A0000, LENGTH = 0x4000
71 ppageE5 (rx) : ORIGIN = 0x3A4000, LENGTH = 0x4000
72 ppageE6 (rx) : ORIGIN = 0x3A8000, LENGTH = 0x4000
73 ppageE7 (rx) : ORIGIN = 0x3AC000, LENGTH = 0x4000
74 ppageE8 (rx) : ORIGIN = 0x3B0000, LENGTH = 0x4000
75 ppageE9 (rx) : ORIGIN = 0x3B4000, LENGTH = 0x4000
76 ppageEA (rx) : ORIGIN = 0x3B8000, LENGTH = 0x4000
77 ppageEB (rx) : ORIGIN = 0x3BC000, LENGTH = 0x4000
78 ppageEC (rx) : ORIGIN = 0x3C0000, LENGTH = 0x4000
79 ppageED (rx) : ORIGIN = 0x3C4000, LENGTH = 0x4000
80 ppageEE (rx) : ORIGIN = 0x3C8000, LENGTH = 0x4000
81 ppageEF (rx) : ORIGIN = 0x3CC000, LENGTH = 0x4000
82 ppageF0 (rx) : ORIGIN = 0x3D0000, LENGTH = 0x4000
83 ppageF1 (rx) : ORIGIN = 0x3D4000, LENGTH = 0x4000
84 ppageF2 (rx) : ORIGIN = 0x3D8000, LENGTH = 0x4000
85 ppageF3 (rx) : ORIGIN = 0x3DC000, LENGTH = 0x4000
86 ppageF4 (rx) : ORIGIN = 0x3E0000, LENGTH = 0x4000
87 ppageF5 (rx) : ORIGIN = 0x3E4000, LENGTH = 0x4000
88 ppageF6 (rx) : ORIGIN = 0x3E8000, LENGTH = 0x4000
89 ppageF7 (rx) : ORIGIN = 0x3EC000, LENGTH = 0x4000
90 ppageF8 (rx) : ORIGIN = 0x3F0000, LENGTH = 0x4000
91 fpageF9 (rx) : ORIGIN = 0x3F4000, LENGTH = 0x2000
92 dpageF9 (rx) : ORIGIN = 0x3F6000, LENGTH = 0x2000
93 fpageFA (rx) : ORIGIN = 0x3F8000, LENGTH = 0x2000
94 dpageFA (rx) : ORIGIN = 0x3FA000, LENGTH = 0x2000
95 fpageFB (rx) : ORIGIN = 0x3FC000, LENGTH = 0x2000
96 dpageFB1 (rx) : ORIGIN = 0x3FE000, LENGTH = 0x0400
97 dpageFB2 (rx) : ORIGIN = 0x3FE400, LENGTH = 0x0400
98 dpageFB3 (rx) : ORIGIN = 0x3FE800, LENGTH = 0x0400
99 dpageFB4 (rx) : ORIGIN = 0x3FEC00, LENGTH = 0x0400
100 dpageFB5 (rx) : ORIGIN = 0x3FF000, LENGTH = 0x0400
101 dpageFB6 (rx) : ORIGIN = 0x3FF400, LENGTH = 0x0400
102 dpageFB7 (rx) : ORIGIN = 0x3FF800, LENGTH = 0x0400
103 dpageFB8 (rx) : ORIGIN = 0x3FFC00, LENGTH = 0x0400
104 fpageFC (rx) : ORIGIN = 0x400000, LENGTH = 0x2000
105 dpageFC (rx) : ORIGIN = 0x402000, LENGTH = 0x2000
106 ppageFE (rx) : ORIGIN = 0x408000, LENGTH = 0x4000 /* Represents 0x8000 - 0xC000 ("text2" paged) */
107 /* ppageFD (rx) : ORIGIN = 0x404000, LENGTH = 0x4000 ** Represents 0x4000 - 0x8000 ("text1" paged) */
108 /* ppageFF (rx) : ORIGIN = 0x40C000, LENGTH = 0x3710 ** Represents 0xC000 - 0xFFFF ("text" paged) */
109 /* The previous two lines are included for clarity only. */
110 /* Changes to this file should be reflected in memory.h and Makefile also */
113 PROVIDE (_stack = 0x4000-1); /* Start the stack immediately after ram */
114 /* Vectors are located via the linker command line, not here. */