GHS placeholder files.

git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@10662 35acf78f-673a-0410-8e92-d51de3d6d3f4
This commit is contained in:
Giovanni Di Sirio 2017-09-22 06:33:41 +00:00
parent 32a8740a7c
commit 387c44dc6b
28 changed files with 4094 additions and 0 deletions

View File

@ -0,0 +1,246 @@
/*
ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
/**
* @file GCC/crt0.S
* @brief Generic PowerPC startup file for GCC.
*
* @addtogroup PPC_GCC_CORE
* @{
*/
/*===========================================================================*/
/* Module constants. */
/*===========================================================================*/
#if !defined(FALSE) || defined(__DOXYGEN__)
#define FALSE 0
#endif
#if !defined(TRUE) || defined(__DOXYGEN__)
#define TRUE 1
#endif
#if defined(__HIGHTEC__)
#define se_bge bge
#endif
/*===========================================================================*/
/* Module pre-compile time settings. */
/*===========================================================================*/
/**
* @brief Stack segments initialization switch.
*/
#if !defined(CRT0_STACKS_FILL_PATTERN) || defined(__DOXYGEN__)
#define CRT0_STACKS_FILL_PATTERN 0x55555555
#endif
/**
* @brief Stack segments initialization switch.
*/
#if !defined(CRT0_INIT_STACKS) || defined(__DOXYGEN__)
#define CRT0_INIT_STACKS TRUE
#endif
/**
* @brief DATA segment initialization switch.
*/
#if !defined(CRT0_INIT_DATA) || defined(__DOXYGEN__)
#define CRT0_INIT_DATA TRUE
#endif
/**
* @brief BSS segment initialization switch.
*/
#if !defined(CRT0_INIT_BSS) || defined(__DOXYGEN__)
#define CRT0_INIT_BSS TRUE
#endif
/**
* @brief Constructors invocation switch.
*/
#if !defined(CRT0_CALL_CONSTRUCTORS) || defined(__DOXYGEN__)
#define CRT0_CALL_CONSTRUCTORS TRUE
#endif
/**
* @brief Destructors invocation switch.
*/
#if !defined(CRT0_CALL_DESTRUCTORS) || defined(__DOXYGEN__)
#define CRT0_CALL_DESTRUCTORS TRUE
#endif
/*===========================================================================*/
/* Code section. */
/*===========================================================================*/
#if !defined(__DOXYGEN__)
.section .crt0, "ax"
.align 2
.globl _boot_address
.type _boot_address, @function
_boot_address:
/* Stack setup.*/
e_lis r1, __process_stack_end__@h
e_or2i r1, __process_stack_end__@l
se_li r0, 0
e_stwu r0, -8(r1)
/* Small sections registers initialization.*/
e_lis r2, __sdata2_start__@h
e_or2i r2, __sdata2_start__@l
e_lis r13, __sdata_start__@h
e_or2i r13, __sdata_start__@l
/* Early initialization.*/
e_bl __early_init
#if CRT0_INIT_STACKS == TRUE
/* Stacks fill pattern.*/
e_lis r7, CRT0_STACKS_FILL_PATTERN@h
e_or2i r7, CRT0_STACKS_FILL_PATTERN@l
/* IRQ Stack initialization. Note, the architecture does not use this
stack, the size is usually zero. An OS can have special SW handling
and require this. A 4 bytes alignment is assmend and required.*/
e_lis r4, __irq_stack_base__@h
e_or2i r4, __irq_stack_base__@l
e_lis r5, __irq_stack_end__@h
e_or2i r5, __irq_stack_end__@l
.irqsloop:
se_cmpl r4, r5
se_bge .irqsend
se_stw r7, 0(r4)
se_addi r4, 4
se_b .irqsloop
.irqsend:
/* Process Stack initialization. Note, does not overwrite the already
written EABI frame. A 4 bytes alignment is assmend and required.*/
e_lis r4, __process_stack_base__@h
e_or2i r4, __process_stack_base__@l
e_lis r5, (__process_stack_end__ - 8)@h
e_or2i r5, (__process_stack_end__ - 8)@l
.prcsloop:
se_cmpl r4, r5
se_bge .prcsend
se_stw r7, 0(r4)
se_addi r4, 4
se_b .prcsloop
.prcsend:
#endif
#if CRT0_INIT_BSS == TRUE
/* BSS clearing.*/
e_lis r4, __bss_start__@h
e_or2i r4, __bss_start__@l
e_lis r5, __bss_end__@h
e_or2i r5, __bss_end__@l
se_li r7, 0
.bssloop:
se_cmpl r4, r5
se_bge .bssend
se_stw r7, 0(r4)
se_addi r4, 4
se_b .bssloop
.bssend:
#endif
#if CRT0_INIT_DATA == TRUE
/* DATA initialization.*/
e_lis r4, __romdata_start__@h
e_or2i r4, __romdata_start__@l
e_lis r5, __data_start__@h
e_or2i r5, __data_start__@l
e_lis r6, __data_end__@h
e_or2i r6, __data_end__@l
.dataloop:
se_cmpl r5, r6
se_bge .dataend
se_lwz r7, 0(r4)
se_addi r4, 4
se_stw r7, 0(r5)
se_addi r5, 4
se_b .dataloop
.dataend:
#endif
/* Late initialization.*/
e_bl __late_init
#if CRT0_CALL_CONSTRUCTORS == TRUE
/* Constructors invocation.*/
e_lis r4, __init_array_start@h
e_or2i r4, __init_array_start@l
e_lis r5, __init_array_end@h
e_or2i r5, __init_array_end@l
.iniloop:
se_cmpl r4, r5
se_bge .iniend
se_lwz r6, 0(r4)
mtctr r6
se_addi r4, 4
se_bctrl
se_b .iniloop
.iniend:
#endif
/* Main program invocation.*/
e_bl main
#if CRT0_CALL_DESTRUCTORS == TRUE
/* Destructors invocation.*/
e_lis r4, __fini_array_start@h
e_or2i r4, __fini_array_start@l
e_lis r5, __fini_array_end@h
e_or2i r5, __fini_array_end@l
.finiloop:
se_cmpl r4, r5
se_bge .finiend
se_lwz r6, 0(r4)
mtctr r6
se_addi r4, 4
se_bctrl
se_b .finiloop
.finiend:
#endif
/* Branching to the defined exit handler.*/
e_b __default_exit
/* Default main exit code, infinite loop.*/
.weak __default_exit
.type __default_exit, @function
__default_exit:
e_b __default_exit
/* Default early initialization code, none.*/
.weak __early_init
.type __early_init, @function
__early_init:
se_blr
/* Default late initialization code, none.*/
.weak __late_init
.type __late_init, @function
__late_init:
se_blr
#endif /* !defined(__DOXYGEN__) */
/** @} */

View File

@ -0,0 +1,27 @@
/*
ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
/*
* SPC560B50 memory setup.
*/
MEMORY
{
flash : org = 0x00000000, len = 512k
dataflash : org = 0x00800000, len = 64k
ram : org = 0x40000000, len = 32k
}
INCLUDE rules_z0.ld

View File

@ -0,0 +1,27 @@
/*
ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
/*
* SPC560B60 memory setup.
*/
MEMORY
{
flash : org = 0x00000000, len = 1024k
dataflash : org = 0x00800000, len = 64k
ram : org = 0x40000000, len = 80k
}
INCLUDE rules_z0.ld

View File

@ -0,0 +1,27 @@
/*
ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
/*
* SPC560B64 memory setup.
*/
MEMORY
{
flash : org = 0x00000000, len = 1536k
dataflash : org = 0x00800000, len = 64k
ram : org = 0x40000000, len = 96k
}
INCLUDE rules_z0.ld

View File

@ -0,0 +1,27 @@
/*
ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
/*
* SPC560D40 memory setup.
*/
MEMORY
{
flash : org = 0x00000000, len = 256k
dataflash : org = 0x00800000, len = 64k
ram : org = 0x40000000, len = 16k
}
INCLUDE rules_z0.ld

View File

@ -0,0 +1,27 @@
/*
ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
/*
* SPC560P50 memory setup.
*/
MEMORY
{
flash : org = 0x00000000, len = 512k
dataflash : org = 0x00800000, len = 64k
ram : org = 0x40000000, len = 40k
}
INCLUDE rules_z0.ld

View File

@ -0,0 +1,26 @@
/*
ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
/*
* SPC563M64 memory setup.
*/
MEMORY
{
flash : org = 0x00000000, len = 1536k
ram : org = 0x40000000, len = 94k
}
INCLUDE rules_z3.ld

View File

@ -0,0 +1,26 @@
/*
ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
/*
* SPC563A70 memory setup.
*/
MEMORY
{
flash : org = 0x00000000, len = 2M
ram : org = 0x40000000, len = 128k
}
INCLUDE rules_z4.ld

View File

@ -0,0 +1,26 @@
/*
ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
/*
* SPC563A80 memory setup.
*/
MEMORY
{
flash : org = 0x00000000, len = 4M
ram : org = 0x40000000, len = 192k
}
INCLUDE rules_z4.ld

View File

@ -0,0 +1,27 @@
/*
ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
/*
* SPC56EC74 memory setup.
*/
MEMORY
{
flash : org = 0x00000000, len = 3M
dataflash : org = 0x00800000, len = 64k
ram : org = 0x40000000, len = 256k
}
INCLUDE rules_z4.ld

View File

@ -0,0 +1,26 @@
/*
ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
/*
* SPC56EL54 memory setup in LSM mode.
*/
MEMORY
{
flash : org = 0x00000000, len = 768k
ram : org = 0x40000000, len = 128k
}
INCLUDE rules_z4.ld

View File

@ -0,0 +1,26 @@
/*
ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
/*
* SPC56EL60 memory setup in LSM mode.
*/
MEMORY
{
flash : org = 0x00000000, len = 1M
ram : org = 0x40000000, len = 128k
}
INCLUDE rules_z4.ld

View File

@ -0,0 +1,26 @@
/*
ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
/*
* SPC56EL70 memory setup in LSM mode.
*/
MEMORY
{
flash : org = 0x00000000, len = 2M
ram : org = 0x40000000, len = 192k
}
INCLUDE rules_z4.ld

View File

@ -0,0 +1,28 @@
/*
ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
/*
* SPC57EM80-HSM memory setup.
*/
MEMORY
{
flash : org = 0x0060C000, len = 144k
dflash0 : org = 0x00680000, len = 16k
dflash1 : org = 0x00684000, len = 16k
ram : org = 0xA0000000, len = 40k
}
INCLUDE rules_z0.ld

View File

@ -0,0 +1,159 @@
/*
ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
__ram_size__ = LENGTH(ram);
__ram_start__ = ORIGIN(ram);
__ram_end__ = ORIGIN(ram) + LENGTH(ram);
ENTRY(_reset_address)
SECTIONS
{
. = ORIGIN(flash);
.boot0 : ALIGN(16) SUBALIGN(16)
{
KEEP(*(.boot))
} > flash
.boot1 : ALIGN(16) SUBALIGN(16)
{
KEEP(*(.handlers))
KEEP(*(.crt0))
/* The vectors table requires a 2kB alignment.*/
. = ALIGN(0x800);
KEEP(*(.vectors))
/* The IVPR register requires a 4kB alignment.*/
. = ALIGN(0x1000);
__ivpr_base__ = .;
KEEP(*(.ivors))
} > flash
constructors : ALIGN(4) SUBALIGN(4)
{
PROVIDE(__init_array_start = .);
KEEP(*(SORT(.init_array.*)))
KEEP(*(.init_array))
PROVIDE(__init_array_end = .);
} > flash
destructors : ALIGN(4) SUBALIGN(4)
{
PROVIDE(__fini_array_start = .);
KEEP(*(.fini_array))
KEEP(*(SORT(.fini_array.*)))
PROVIDE(__fini_array_end = .);
} > flash
.text_vle : ALIGN(16) SUBALIGN(16)
{
*(.text_vle)
*(.text_vle.*)
*(.gnu.linkonce.t_vle.*)
} > flash
.text : ALIGN(16) SUBALIGN(16)
{
*(.text)
*(.text.*)
*(.gnu.linkonce.t.*)
} > flash
.rodata : ALIGN(16) SUBALIGN(16)
{
*(.glue_7t)
*(.glue_7)
*(.gcc*)
*(.rodata)
*(.rodata.*)
*(.rodata1)
} > flash
.sdata2 : ALIGN(16) SUBALIGN(16)
{
__sdata2_start__ = . + 0x8000;
*(.sdata2)
*(.sdata2.*)
*(.gnu.linkonce.s2.*)
*(.sbss2)
*(.sbss2.*)
*(.gnu.linkonce.sb2.*)
} > flash
.eh_frame_hdr :
{
*(.eh_frame_hdr)
} > flash
.eh_frame : ONLY_IF_RO
{
*(.eh_frame)
} > flash
.romdata : ALIGN(16) SUBALIGN(16)
{
__romdata_start__ = .;
} > flash
.stacks : ALIGN(16) SUBALIGN(16)
{
. = ALIGN(8);
__irq_stack_base__ = .;
. += __irq_stack_size__;
. = ALIGN(8);
__irq_stack_end__ = .;
__process_stack_base__ = .;
__main_thread_stack_base__ = .;
. += __process_stack_size__;
. = ALIGN(8);
__process_stack_end__ = .;
__main_thread_stack_end__ = .;
} > ram
.data : AT(__romdata_start__)
{
. = ALIGN(4);
__data_start__ = .;
*(.data)
*(.data.*)
*(.gnu.linkonce.d.*)
__sdata_start__ = . + 0x8000;
*(.sdata)
*(.sdata.*)
*(.gnu.linkonce.s.*)
__data_end__ = .;
} > ram
.sbss :
{
__bss_start__ = .;
*(.sbss)
*(.sbss.*)
*(.gnu.linkonce.sb.*)
*(.scommon)
} > ram
.bss :
{
*(.bss)
*(.bss.*)
*(.gnu.linkonce.b.*)
*(COMMON)
__bss_end__ = .;
} > ram
__heap_base__ = __bss_end__;
__heap_end__ = __ram_end__;
}

View File

@ -0,0 +1,156 @@
/*
ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
__ram_size__ = LENGTH(ram);
__ram_start__ = ORIGIN(ram);
__ram_end__ = ORIGIN(ram) + LENGTH(ram);
ENTRY(_reset_address)
SECTIONS
{
. = ORIGIN(flash);
.boot0 : ALIGN(16) SUBALIGN(16)
{
__ivpr_base__ = .;
KEEP(*(.boot))
} > flash
.boot1 : ALIGN(16) SUBALIGN(16)
{
KEEP(*(.handlers))
KEEP(*(.crt0))
/* The vectors table requires a 2kB alignment.*/
. = ALIGN(0x800);
KEEP(*(.vectors))
} > flash
constructors : ALIGN(4) SUBALIGN(4)
{
PROVIDE(__init_array_start = .);
KEEP(*(SORT(.init_array.*)))
KEEP(*(.init_array))
PROVIDE(__init_array_end = .);
} > flash
destructors : ALIGN(4) SUBALIGN(4)
{
PROVIDE(__fini_array_start = .);
KEEP(*(.fini_array))
KEEP(*(SORT(.fini_array.*)))
PROVIDE(__fini_array_end = .);
} > flash
.text_vle : ALIGN(16) SUBALIGN(16)
{
*(.text_vle)
*(.text_vle.*)
*(.gnu.linkonce.t_vle.*)
} > flash
.text : ALIGN(16) SUBALIGN(16)
{
*(.text)
*(.text.*)
*(.gnu.linkonce.t.*)
} > flash
.rodata : ALIGN(16) SUBALIGN(16)
{
*(.glue_7t)
*(.glue_7)
*(.gcc*)
*(.rodata)
*(.rodata.*)
*(.rodata1)
} > flash
.sdata2 : ALIGN(16) SUBALIGN(16)
{
__sdata2_start__ = . + 0x8000;
*(.sdata2)
*(.sdata2.*)
*(.gnu.linkonce.s2.*)
*(.sbss2)
*(.sbss2.*)
*(.gnu.linkonce.sb2.*)
} > flash
.eh_frame_hdr :
{
*(.eh_frame_hdr)
} > flash
.eh_frame : ONLY_IF_RO
{
*(.eh_frame)
} > flash
.romdata : ALIGN(16) SUBALIGN(16)
{
__romdata_start__ = .;
} > flash
.stacks : ALIGN(16) SUBALIGN(16)
{
. = ALIGN(8);
__irq_stack_base__ = .;
. += __irq_stack_size__;
. = ALIGN(8);
__irq_stack_end__ = .;
__process_stack_base__ = .;
__main_thread_stack_base__ = .;
. += __process_stack_size__;
. = ALIGN(8);
__process_stack_end__ = .;
__main_thread_stack_end__ = .;
} > ram
.data : AT(__romdata_start__)
{
. = ALIGN(4);
__data_start__ = .;
*(.data)
*(.data.*)
*(.gnu.linkonce.d.*)
__sdata_start__ = . + 0x8000;
*(.sdata)
*(.sdata.*)
*(.gnu.linkonce.s.*)
__data_end__ = .;
} > ram
.sbss :
{
__bss_start__ = .;
*(.sbss)
*(.sbss.*)
*(.gnu.linkonce.sb.*)
*(.scommon)
} > ram
.bss :
{
*(.bss)
*(.bss.*)
*(.gnu.linkonce.b.*)
*(COMMON)
__bss_end__ = .;
} > ram
__heap_base__ = __bss_end__;
__heap_end__ = __ram_end__;
}

View File

@ -0,0 +1,156 @@
/*
ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
__ram_size__ = LENGTH(ram);
__ram_start__ = ORIGIN(ram);
__ram_end__ = ORIGIN(ram) + LENGTH(ram);
ENTRY(_reset_address)
SECTIONS
{
. = ORIGIN(flash);
.boot0 : ALIGN(16) SUBALIGN(16)
{
__ivpr_base__ = .;
KEEP(*(.boot))
} > flash
.boot1 : ALIGN(16) SUBALIGN(16)
{
KEEP(*(.handlers))
KEEP(*(.crt0))
/* The vectors table requires a 2kB alignment.*/
. = ALIGN(0x800);
KEEP(*(.vectors))
} > flash
constructors : ALIGN(4) SUBALIGN(4)
{
PROVIDE(__init_array_start = .);
KEEP(*(SORT(.init_array.*)))
KEEP(*(.init_array))
PROVIDE(__init_array_end = .);
} > flash
destructors : ALIGN(4) SUBALIGN(4)
{
PROVIDE(__fini_array_start = .);
KEEP(*(.fini_array))
KEEP(*(SORT(.fini_array.*)))
PROVIDE(__fini_array_end = .);
} > flash
.text_vle : ALIGN(16) SUBALIGN(16)
{
*(.text_vle)
*(.text_vle.*)
*(.gnu.linkonce.t_vle.*)
} > flash
.text : ALIGN(16) SUBALIGN(16)
{
*(.text)
*(.text.*)
*(.gnu.linkonce.t.*)
} > flash
.rodata : ALIGN(16) SUBALIGN(16)
{
*(.glue_7t)
*(.glue_7)
*(.gcc*)
*(.rodata)
*(.rodata.*)
*(.rodata1)
} > flash
.sdata2 : ALIGN(16) SUBALIGN(16)
{
__sdata2_start__ = . + 0x8000;
*(.sdata2)
*(.sdata2.*)
*(.gnu.linkonce.s2.*)
*(.sbss2)
*(.sbss2.*)
*(.gnu.linkonce.sb2.*)
} > flash
.eh_frame_hdr :
{
*(.eh_frame_hdr)
} > flash
.eh_frame : ONLY_IF_RO
{
*(.eh_frame)
} > flash
.romdata : ALIGN(16) SUBALIGN(16)
{
__romdata_start__ = .;
} > flash
.stacks : ALIGN(16) SUBALIGN(16)
{
. = ALIGN(8);
__irq_stack_base__ = .;
. += __irq_stack_size__;
. = ALIGN(8);
__irq_stack_end__ = .;
__process_stack_base__ = .;
__main_thread_stack_base__ = .;
. += __process_stack_size__;
. = ALIGN(8);
__process_stack_end__ = .;
__main_thread_stack_end__ = .;
} > ram
.data : AT(__romdata_start__)
{
. = ALIGN(4);
__data_start__ = .;
*(.data)
*(.data.*)
*(.gnu.linkonce.d.*)
__sdata_start__ = . + 0x8000;
*(.sdata)
*(.sdata.*)
*(.gnu.linkonce.s.*)
__data_end__ = .;
} > ram
.sbss :
{
__bss_start__ = .;
*(.sbss)
*(.sbss.*)
*(.gnu.linkonce.sb.*)
*(.scommon)
} > ram
.bss :
{
*(.bss)
*(.bss.*)
*(.gnu.linkonce.b.*)
*(COMMON)
__bss_end__ = .;
} > ram
__heap_base__ = __bss_end__;
__heap_end__ = __ram_end__;
}

View File

@ -0,0 +1,11 @@
# List of the ChibiOS e200z0 SPC560BCxx startup files.
STARTUPSRC =
STARTUPASM = $(CHIBIOS)/os/common/startup/e200/devices/SPC560BCxx/boot.S \
$(CHIBIOS)/os/common/startup/e200/compilers/GHS/vectors.S \
$(CHIBIOS)/os/common/startup/e200/compilers/GHS/crt0.S
STARTUPINC = ${CHIBIOS}/os/common/startup/e200/compilers/GHS \
${CHIBIOS}/os/common/startup/e200/devices/SPC560BCxx
STARTUPLD = ${CHIBIOS}/os/common/startup/e200/compilers/GHS/ld

View File

@ -0,0 +1,11 @@
# List of the ChibiOS e200z0 SPC560Bxx startup files.
STARTUPSRC =
STARTUPASM = $(CHIBIOS)/os/common/startup/e200/devices/SPC560Bxx/boot.S \
$(CHIBIOS)/os/common/startup/e200/compilers/GHS/vectors.S \
$(CHIBIOS)/os/common/startup/e200/compilers/GHS/crt0.S
STARTUPINC = ${CHIBIOS}/os/common/startup/e200/compilers/GHS \
${CHIBIOS}/os/common/startup/e200/devices/SPC560Bxx
STARTUPLD = ${CHIBIOS}/os/common/startup/e200/compilers/GHS/ld

View File

@ -0,0 +1,11 @@
# List of the ChibiOS e200z0 SPC560Dxx startup files.
STARTUPSRC =
STARTUPASM = $(CHIBIOS)/os/common/startup/e200/devices/SPC560Dxx/boot.S \
$(CHIBIOS)/os/common/startup/e200/compilers/GHS/vectors.S \
$(CHIBIOS)/os/common/startup/e200/compilers/GHS/crt0.S
STARTUPINC = ${CHIBIOS}/os/common/startup/e200/compilers/GHS \
${CHIBIOS}/os/common/startup/e200/devices/SPC560Dxx
STARTUPLD = ${CHIBIOS}/os/common/startup/e200/compilers/GHS/ld

View File

@ -0,0 +1,11 @@
# List of the ChibiOS e200z0 SPC560Pxx startup files.
STARTUPSRC =
STARTUPASM = $(CHIBIOS)/os/common/startup/e200/devices/SPC560Pxx/boot.S \
$(CHIBIOS)/os/common/startup/e200/compilers/GHS/vectors.S \
$(CHIBIOS)/os/common/startup/e200/compilers/GHS/crt0.S
STARTUPINC = ${CHIBIOS}/os/common/startup/e200/compilers/GHS \
${CHIBIOS}/os/common/startup/e200/devices/SPC560Pxx
STARTUPLD = ${CHIBIOS}/os/common/startup/e200/compilers/GHS/ld

View File

@ -0,0 +1,11 @@
# List of the ChibiOS e200z3 SPC563Mxx startup files.
STARTUPSRC =
STARTUPASM = $(CHIBIOS)/os/common/startup/e200/devices/SPC563Mxx/boot.S \
$(CHIBIOS)/os/common/startup/e200/compilers/GHS/vectors.S \
$(CHIBIOS)/os/common/startup/e200/compilers/GHS/crt0.S
STARTUPINC = ${CHIBIOS}/os/common/startup/e200/compilers/GHS \
${CHIBIOS}/os/common/startup/e200/devices/SPC563Mxx
STARTUPLD = ${CHIBIOS}/os/common/startup/e200/compilers/GHS/ld

View File

@ -0,0 +1,11 @@
# List of the ChibiOS e200z4 SPC564Axx startup files.
STARTUPSRC =
STARTUPASM = $(CHIBIOS)/os/common/startup/e200/devices/SPC564Axx/boot.S \
$(CHIBIOS)/os/common/startup/e200/compilers/GHS/vectors.S \
$(CHIBIOS)/os/common/startup/e200/compilers/GHS/crt0.S
STARTUPINC = ${CHIBIOS}/os/common/startup/e200/compilers/GHS \
${CHIBIOS}/os/common/startup/e200/devices/SPC564Axx
STARTUPLD = ${CHIBIOS}/os/common/startup/e200/compilers/GHS/ld

View File

@ -0,0 +1,11 @@
# List of the ChibiOS e200z4 SPC56ECxx startup files.
STARTUPSRC =
STARTUPASM = $(CHIBIOS)/os/common/startup/e200/devices/SPC56ECxx/boot.S \
$(CHIBIOS)/os/common/startup/e200/compilers/GHS/vectors.S \
$(CHIBIOS)/os/common/startup/e200/compilers/GHS/crt0.S
STARTUPINC = ${CHIBIOS}/os/common/startup/e200/compilers/GHS \
${CHIBIOS}/os/common/startup/e200/devices/SPC56ECxx
STARTUPLD = ${CHIBIOS}/os/common/startup/e200/compilers/GHS/ld

View File

@ -0,0 +1,11 @@
# List of the ChibiOS e200z4 SPC56ELxx startup files.
STARTUPSRC =
STARTUPASM = $(CHIBIOS)/os/common/startup/e200/devices/SPC56ELxx/boot.S \
$(CHIBIOS)/os/common/startup/e200/compilers/GHS/vectors.S \
$(CHIBIOS)/os/common/startup/e200/compilers/GHS/crt0.S
STARTUPINC = ${CHIBIOS}/os/common/startup/e200/compilers/GHS \
${CHIBIOS}/os/common/startup/e200/devices/SPC56ELxx
STARTUPLD = ${CHIBIOS}/os/common/startup/e200/compilers/GHS/ld

View File

@ -0,0 +1,253 @@
# e200z common makefile scripts and rules.
##############################################################################
# Processing options coming from the upper Makefile.
#
# Compiler options
OPT = $(USE_OPT)
COPT = $(USE_COPT)
CPPOPT = $(USE_CPPOPT)
# Garbage collection
ifeq ($(USE_LINK_GC),yes)
OPT += -ffunction-sections -fdata-sections -fno-common
LDOPT := --gc-sections
else
LDOPT := --no-gc-sections
endif
# Linker extra options
ifneq ($(USE_LDOPT),)
LDOPT := $(LDOPT),$(USE_LDOPT)
endif
# Link time optimizations
ifeq ($(USE_LTO),yes)
OPT += -flto
endif
# VLE option handling.
ifeq ($(USE_VLE),yes)
DDEFS += -DPPC_USE_VLE=1
DADEFS += -DPPC_USE_VLE=1
MCU += -mvle
else
DDEFS += -DPPC_USE_VLE=0
DADEFS += -DPPC_USE_VLE=0
endif
# Process stack size
ifeq ($(USE_PROCESS_STACKSIZE),)
LDOPT := $(LDOPT),--defsym=__process_stack_size__=0x400
else
LDOPT := $(LDOPT),--defsym=__process_stack_size__=$(USE_PROCESS_STACKSIZE)
endif
# Exceptions stack size
ifeq ($(USE_EXCEPTIONS_STACKSIZE),)
LDOPT := $(LDOPT),--defsym=__irq_stack_size__=0x400
else
LDOPT := $(LDOPT),--defsym=__irq_stack_size__=$(USE_EXCEPTIONS_STACKSIZE)
endif
# Output directory and files
ifeq ($(BUILDDIR),)
BUILDDIR = build
endif
ifeq ($(BUILDDIR),.)
BUILDDIR = build
endif
# Dependencies directory
ifeq ($(DEPDIR),)
DEPDIR = .dep
endif
ifeq ($(DEPDIR),.)
DEPDIR = .dep
endif
OUTFILES = $(BUILDDIR)/$(PROJECT).elf $(BUILDDIR)/$(PROJECT).hex \
$(BUILDDIR)/$(PROJECT).mot $(BUILDDIR)/$(PROJECT).bin \
$(BUILDDIR)/$(PROJECT).dmp $(BUILDDIR)/$(PROJECT).list
# Source files groups and paths
SRC = $(CSRC)$(CPPSRC)
SRCPATHS = $(sort $(dir $(ASMXSRC)) $(dir $(ASMSRC)) $(dir $(SRC)))
# Various directories
OBJDIR = $(BUILDDIR)/obj
LSTDIR = $(BUILDDIR)/lst
# Object files groups
COBJS = $(addprefix $(OBJDIR)/, $(notdir $(CSRC:.c=.o)))
CPPOBJS = $(addprefix $(OBJDIR)/, $(notdir $(CPPSRC:.cpp=.o)))
ASMOBJS = $(addprefix $(OBJDIR)/, $(notdir $(ASMSRC:.s=.o)))
ASMXOBJS = $(addprefix $(OBJDIR)/, $(notdir $(ASMXSRC:.S=.o)))
OBJS = $(ASMXOBJS) $(ASMOBJS) $(COBJS) $(CPPOBJS)
# Paths
IINCDIR = $(patsubst %,-I%,$(INCDIR) $(DINCDIR) $(UINCDIR))
LLIBDIR = $(patsubst %,-L%,$(DLIBDIR) $(ULIBDIR))
# Macros
DEFS = $(DDEFS) $(UDEFS)
ADEFS = $(DADEFS) $(UADEFS)
# Libs
LIBS = $(DLIBS) $(ULIBS)
# Various settings
MCFLAGS = -mcpu=$(MCU)
ODFLAGS = -x --syms
ASFLAGS = $(MCFLAGS) -Wa,-amhls=$(LSTDIR)/$(notdir $(<:.s=.lst)) $(ADEFS)
ASXFLAGS = $(MCFLAGS) -Wa,-amhls=$(LSTDIR)/$(notdir $(<:.S=.lst)) $(ADEFS)
CFLAGS = $(MCFLAGS) $(OPT) $(COPT) $(CWARN) -Wa,-alms=$(LSTDIR)/$(notdir $(<:.c=.lst)) $(DEFS)
CPPFLAGS = $(MCFLAGS) $(OPT) $(CPPOPT) $(CPPWARN) -Wa,-alms=$(LSTDIR)/$(notdir $(<:.cpp=.lst)) $(DEFS)
LDFLAGS = $(MCFLAGS) $(OPT) -nostartfiles $(LLIBDIR) -Wl,-Map=$(BUILDDIR)/$(PROJECT).map,--cref,--no-warn-mismatch,--library-path=$(RULESPATH)/ld,$(LDOPT),--script=$(LDSCRIPT)
# Generate dependency information
ASFLAGS += -MD -MP -MF $(DEPDIR)/$(@F).d
ASXFLAGS += -MD -MP -MF $(DEPDIR)/$(@F).d
CFLAGS += -MD -MP -MF $(DEPDIR)/$(@F).d
CPPFLAGS += -MD -MP -MF $(DEPDIR)/$(@F).d
# Paths where to search for sources
VPATH = $(SRCPATHS)
#
# Makefile rules
#
all: PRE_MAKE_ALL_RULE_HOOK $(OBJS) $(OUTFILES) POST_MAKE_ALL_RULE_HOOK
PRE_MAKE_ALL_RULE_HOOK:
POST_MAKE_ALL_RULE_HOOK:
$(OBJS): | $(BUILDDIR) $(OBJDIR) $(LSTDIR)
$(BUILDDIR):
ifneq ($(USE_VERBOSE_COMPILE),yes)
@echo Compiler Options
@echo $(CC) -c $(CFLAGS) -I. $(IINCDIR) main.c -o main.o
@echo
endif
@mkdir -p $(BUILDDIR)
$(OBJDIR):
@mkdir -p $(OBJDIR)
$(LSTDIR):
@mkdir -p $(LSTDIR)
$(CPPOBJS) : $(OBJDIR)/%.o : %.cpp $(MAKEFILE_LIST)
ifeq ($(USE_VERBOSE_COMPILE),yes)
@echo
$(CPPC) -c $(CPPFLAGS) -I. $(IINCDIR) $< -o $@
else
@echo Compiling $(<F)
@$(CPPC) -c $(CPPFLAGS) -I. $(IINCDIR) $< -o $@
endif
$(COBJS) : $(OBJDIR)/%.o : %.c $(MAKEFILE_LIST)
ifeq ($(USE_VERBOSE_COMPILE),yes)
@echo
$(CC) -c $(CFLAGS) -I. $(IINCDIR) $< -o $@
else
@echo Compiling $(<F)
@$(CC) -c $(CFLAGS) -I. $(IINCDIR) $< -o $@
endif
$(ASMOBJS) : $(OBJDIR)/%.o : %.s $(MAKEFILE_LIST)
ifeq ($(USE_VERBOSE_COMPILE),yes)
@echo
$(AS) -c $(ASFLAGS) -I. $(IINCDIR) $< -o $@
else
@echo Compiling $(<F)
@$(AS) -c $(ASFLAGS) -I. $(IINCDIR) $< -o $@
endif
$(ASMXOBJS) : $(OBJDIR)/%.o : %.S $(MAKEFILE_LIST)
ifeq ($(USE_VERBOSE_COMPILE),yes)
@echo
$(CC) -c $(ASXFLAGS) -I. $(IINCDIR) $< -o $@
else
@echo Compiling $(<F)
@$(CC) -c $(ASXFLAGS) -I. $(IINCDIR) $< -o $@
endif
%.elf: $(OBJS) $(LDSCRIPT)
ifeq ($(USE_VERBOSE_COMPILE),yes)
@echo
$(LD) $(OBJS) $(LDFLAGS) $(LIBS) -o $@
else
@echo Linking $@
@$(LD) $(OBJS) $(LDFLAGS) $(LIBS) -o $@
endif
%.hex: %.elf $(LDSCRIPT)
ifeq ($(USE_VERBOSE_COMPILE),yes)
$(HEX) $< $@
else
@echo Creating $@
@$(HEX) $< $@
endif
%.mot: %.elf $(LDSCRIPT)
ifeq ($(USE_VERBOSE_COMPILE),yes)
$(MOT) $< $@
else
@echo Creating $@
@$(MOT) $< $@
endif
%.bin: %.elf $(LDSCRIPT)
ifeq ($(USE_VERBOSE_COMPILE),yes)
$(BIN) $< $@
else
@echo Creating $@
@$(BIN) $< $@
endif
%.dmp: %.elf $(LDSCRIPT)
ifeq ($(USE_VERBOSE_COMPILE),yes)
$(OD) $(ODFLAGS) $< > $@
$(SZ) $<
else
@echo Creating $@
@$(OD) $(ODFLAGS) $< > $@
@echo
@$(SZ) $<
endif
%.list: %.elf $(LDSCRIPT)
ifeq ($(USE_VERBOSE_COMPILE),yes)
$(OD) -S $< > $@
else
@echo Creating $@
@$(OD) -S $< > $@
@echo Done
endif
lib: $(OBJS) $(BUILDDIR)/lib$(PROJECT).a
$(BUILDDIR)/lib$(PROJECT).a: $(OBJS)
@$(AR) -r $@ $^
@echo
@echo Done
clean: CLEAN_RULE_HOOK
@echo Cleaning
-rm -fR $(DEPDIR) $(BUILDDIR)
@echo
@echo Done
CLEAN_RULE_HOOK:
#
# Include the dependency files, should be the last of the makefile
#
-include $(shell mkdir $(DEPDIR) 2>/dev/null) $(wildcard $(DEPDIR)/*)
# *** EOF ***

View File

@ -0,0 +1,78 @@
/*
ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
/**
* @file vectors.h
* @brief ISR vector module header.
*
* @addtogroup PPC_GCC_CORE
* @{
*/
#ifndef VECTORS_H
#define VECTORS_H
#include "ppcparams.h"
/*===========================================================================*/
/* Module constants. */
/*===========================================================================*/
/*===========================================================================*/
/* Module pre-compile time settings. */
/*===========================================================================*/
/*===========================================================================*/
/* Derived constants and error checks. */
/*===========================================================================*/
/*===========================================================================*/
/* Module data structures and types. */
/*===========================================================================*/
/*===========================================================================*/
/* Module macros. */
/*===========================================================================*/
/*===========================================================================*/
/* External declarations. */
/*===========================================================================*/
/* The following code is not processed when the file is included from an
asm module.*/
#if !defined(_FROM_ASM_)
#if !defined(__DOXYGEN__)
extern uint32_t _vectors[PPC_NUM_VECTORS];
#endif
#ifdef __cplusplus
extern "C" {
#endif
void _unhandled_irq(void);
#ifdef __cplusplus
}
#endif
#endif /* !defined(_FROM_ASM_) */
/*===========================================================================*/
/* Module inline functions. */
/*===========================================================================*/
#endif /* VECTORS_H */
/** @} */

File diff suppressed because it is too large Load Diff