mirror of
https://github.com/portapack-mayhem/mayhem-firmware.git
synced 2026-09-15 11:02:58 +00:00
ChibiOS 2.6.8, until I can figure out where to get it from git.
This commit is contained in:
+63
@@ -0,0 +1,63 @@
|
||||
/*
|
||||
ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010,
|
||||
2011,2012,2013 Giovanni Di Sirio.
|
||||
|
||||
This file is part of ChibiOS/RT.
|
||||
|
||||
ChibiOS/RT is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
ChibiOS/RT is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
---
|
||||
|
||||
A special exception to the GPL can be applied should you wish to distribute
|
||||
a combined work that includes ChibiOS/RT, without being obliged to provide
|
||||
the source code for any proprietary components. See the file exception.txt
|
||||
for full details of how and when the exception can be applied.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file ARM/AT91SAM7/armparams.h
|
||||
* @brief ARM7 AT91SAM7 Specific Parameters.
|
||||
*
|
||||
* @defgroup ARM_AT91SAM7 AT91SAM7 Specific Parameters
|
||||
* @ingroup ARM_SPECIFIC
|
||||
* @details This file contains the ARM specific parameters for the
|
||||
* AT91SAM7 platform.
|
||||
* @{
|
||||
*/
|
||||
|
||||
#ifndef _ARMPARAMS_H_
|
||||
#define _ARMPARAMS_H_
|
||||
|
||||
/**
|
||||
* @brief ARM core model.
|
||||
*/
|
||||
#define ARM_CORE ARM_CORE_ARM7TDMI
|
||||
|
||||
/**
|
||||
* @brief AT91SAM7-specific wait for interrupt.
|
||||
* @details This implementation writes 1 into the PMC_SCDR register.
|
||||
*/
|
||||
#if !defined(port_wait_for_interrupt) || defined(__DOXYGEN__)
|
||||
#if ENABLE_WFI_IDLE || defined(__DOXYGEN__)
|
||||
#define port_wait_for_interrupt() { \
|
||||
(*((volatile uint32_t *)0xFFFFFC04)) = 1; \
|
||||
}
|
||||
#else
|
||||
#define port_wait_for_interrupt()
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#endif /* _ARMPARAMS_H_ */
|
||||
|
||||
/** @} */
|
||||
@@ -0,0 +1,99 @@
|
||||
/*
|
||||
ChibiOS/RT - Copyright (C) 2006-2013 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.
|
||||
*/
|
||||
|
||||
/*
|
||||
* AT91SAM7A3 memory setup.
|
||||
*/
|
||||
__und_stack_size__ = 0x0004;
|
||||
__abt_stack_size__ = 0x0004;
|
||||
__fiq_stack_size__ = 0x0010;
|
||||
__irq_stack_size__ = 0x0080;
|
||||
__svc_stack_size__ = 0x0004;
|
||||
__sys_stack_size__ = 0x0400;
|
||||
__stacks_total_size__ = __und_stack_size__ + __abt_stack_size__ + __fiq_stack_size__ + __irq_stack_size__ + __svc_stack_size__ + __sys_stack_size__;
|
||||
|
||||
MEMORY
|
||||
{
|
||||
flash : org = 0x100000, len = 256k
|
||||
ram : org = 0x200020, len = 32k - 0x20
|
||||
}
|
||||
|
||||
__ram_start__ = ORIGIN(ram);
|
||||
__ram_size__ = LENGTH(ram);
|
||||
__ram_end__ = __ram_start__ + __ram_size__;
|
||||
|
||||
SECTIONS
|
||||
{
|
||||
. = 0;
|
||||
|
||||
.text : ALIGN(16) SUBALIGN(16)
|
||||
{
|
||||
_text = .;
|
||||
KEEP(*(vectors))
|
||||
*(.text)
|
||||
*(.text.*)
|
||||
*(.rodata)
|
||||
*(.rodata.*)
|
||||
*(.glue_7t)
|
||||
*(.glue_7)
|
||||
*(.gcc*)
|
||||
*(.ctors)
|
||||
*(.dtors)
|
||||
} > flash
|
||||
|
||||
.ARM.extab : {*(.ARM.extab* .gnu.linkonce.armextab.*)}
|
||||
|
||||
__exidx_start = .;
|
||||
.ARM.exidx : {*(.ARM.exidx* .gnu.linkonce.armexidx.*)} > flash
|
||||
__exidx_end = .;
|
||||
|
||||
.eh_frame_hdr : {*(.eh_frame_hdr)}
|
||||
|
||||
.eh_frame : ONLY_IF_RO {*(.eh_frame)}
|
||||
|
||||
. = ALIGN(4);
|
||||
_etext = .;
|
||||
_textdata = _etext;
|
||||
|
||||
.data ALIGN(4) : ALIGN(4)
|
||||
{
|
||||
. = ALIGN(4);
|
||||
PROVIDE(_data = .);
|
||||
*(.data)
|
||||
*(.data.*)
|
||||
*(.ramtext)
|
||||
. = ALIGN(4);
|
||||
PROVIDE(_edata = .);
|
||||
} > ram AT > flash
|
||||
|
||||
.bss ALIGN(4) : ALIGN(4)
|
||||
{
|
||||
. = ALIGN(4);
|
||||
PROVIDE(_bss_start = .);
|
||||
*(.bss)
|
||||
*(.bss.*)
|
||||
*(COMMON)
|
||||
. = ALIGN(4);
|
||||
PROVIDE(_bss_end = .);
|
||||
} > ram
|
||||
}
|
||||
|
||||
PROVIDE(end = .);
|
||||
_end = .;
|
||||
|
||||
__heap_base__ = _end;
|
||||
__heap_end__ = __ram_end__ - __stacks_total_size__;
|
||||
__main_thread_stack_base__ = __ram_end__ - __stacks_total_size__;
|
||||
@@ -0,0 +1,99 @@
|
||||
/*
|
||||
ChibiOS/RT - Copyright (C) 2006-2013 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.
|
||||
*/
|
||||
|
||||
/*
|
||||
* AT91SAM7S256 memory setup.
|
||||
*/
|
||||
__und_stack_size__ = 0x0004;
|
||||
__abt_stack_size__ = 0x0004;
|
||||
__fiq_stack_size__ = 0x0010;
|
||||
__irq_stack_size__ = 0x0080;
|
||||
__svc_stack_size__ = 0x0004;
|
||||
__sys_stack_size__ = 0x0400;
|
||||
__stacks_total_size__ = __und_stack_size__ + __abt_stack_size__ + __fiq_stack_size__ + __irq_stack_size__ + __svc_stack_size__ + __sys_stack_size__;
|
||||
|
||||
MEMORY
|
||||
{
|
||||
flash : org = 0x100000, len = 256k
|
||||
ram : org = 0x200020, len = 64k - 0x20
|
||||
}
|
||||
|
||||
__ram_start__ = ORIGIN(ram);
|
||||
__ram_size__ = LENGTH(ram);
|
||||
__ram_end__ = __ram_start__ + __ram_size__;
|
||||
|
||||
SECTIONS
|
||||
{
|
||||
. = 0;
|
||||
|
||||
.text : ALIGN(16) SUBALIGN(16)
|
||||
{
|
||||
_text = .;
|
||||
KEEP(*(vectors))
|
||||
*(.text)
|
||||
*(.text.*)
|
||||
*(.rodata)
|
||||
*(.rodata.*)
|
||||
*(.glue_7t)
|
||||
*(.glue_7)
|
||||
*(.gcc*)
|
||||
*(.ctors)
|
||||
*(.dtors)
|
||||
} > flash
|
||||
|
||||
.ARM.extab : {*(.ARM.extab* .gnu.linkonce.armextab.*)}
|
||||
|
||||
__exidx_start = .;
|
||||
.ARM.exidx : {*(.ARM.exidx* .gnu.linkonce.armexidx.*)} > flash
|
||||
__exidx_end = .;
|
||||
|
||||
.eh_frame_hdr : {*(.eh_frame_hdr)}
|
||||
|
||||
.eh_frame : ONLY_IF_RO {*(.eh_frame)}
|
||||
|
||||
. = ALIGN(4);
|
||||
_etext = .;
|
||||
_textdata = _etext;
|
||||
|
||||
.data ALIGN(4) : ALIGN(4)
|
||||
{
|
||||
. = ALIGN(4);
|
||||
PROVIDE(_data = .);
|
||||
*(.data)
|
||||
*(.data.*)
|
||||
*(.ramtext)
|
||||
. = ALIGN(4);
|
||||
PROVIDE(_edata = .);
|
||||
} > ram AT > flash
|
||||
|
||||
.bss ALIGN(4) : ALIGN(4)
|
||||
{
|
||||
. = ALIGN(4);
|
||||
PROVIDE(_bss_start = .);
|
||||
*(.bss)
|
||||
*(.bss.*)
|
||||
*(COMMON)
|
||||
. = ALIGN(4);
|
||||
PROVIDE(_bss_end = .);
|
||||
} > ram
|
||||
}
|
||||
|
||||
PROVIDE(end = .);
|
||||
_end = .;
|
||||
|
||||
__heap_base__ = _end;
|
||||
__heap_end__ = __ram_end__ - __stacks_total_size__;
|
||||
__main_thread_stack_base__ = __ram_end__ - __stacks_total_size__;
|
||||
@@ -0,0 +1,99 @@
|
||||
/*
|
||||
ChibiOS/RT - Copyright (C) 2006-2013 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.
|
||||
*/
|
||||
|
||||
/*
|
||||
* AT91SAM7X256 memory setup.
|
||||
*/
|
||||
__und_stack_size__ = 0x0004;
|
||||
__abt_stack_size__ = 0x0004;
|
||||
__fiq_stack_size__ = 0x0010;
|
||||
__irq_stack_size__ = 0x0080;
|
||||
__svc_stack_size__ = 0x0004;
|
||||
__sys_stack_size__ = 0x0400;
|
||||
__stacks_total_size__ = __und_stack_size__ + __abt_stack_size__ + __fiq_stack_size__ + __irq_stack_size__ + __svc_stack_size__ + __sys_stack_size__;
|
||||
|
||||
MEMORY
|
||||
{
|
||||
flash : org = 0x100000, len = 256k
|
||||
ram : org = 0x200020, len = 64k - 0x20
|
||||
}
|
||||
|
||||
__ram_start__ = ORIGIN(ram);
|
||||
__ram_size__ = LENGTH(ram);
|
||||
__ram_end__ = __ram_start__ + __ram_size__;
|
||||
|
||||
SECTIONS
|
||||
{
|
||||
. = 0;
|
||||
|
||||
.text : ALIGN(16) SUBALIGN(16)
|
||||
{
|
||||
_text = .;
|
||||
KEEP(*(vectors))
|
||||
*(.text)
|
||||
*(.text.*)
|
||||
*(.rodata)
|
||||
*(.rodata.*)
|
||||
*(.glue_7t)
|
||||
*(.glue_7)
|
||||
*(.gcc*)
|
||||
*(.ctors)
|
||||
*(.dtors)
|
||||
} > flash
|
||||
|
||||
.ARM.extab : {*(.ARM.extab* .gnu.linkonce.armextab.*)}
|
||||
|
||||
__exidx_start = .;
|
||||
.ARM.exidx : {*(.ARM.exidx* .gnu.linkonce.armexidx.*)} > flash
|
||||
__exidx_end = .;
|
||||
|
||||
.eh_frame_hdr : {*(.eh_frame_hdr)}
|
||||
|
||||
.eh_frame : ONLY_IF_RO {*(.eh_frame)}
|
||||
|
||||
. = ALIGN(4);
|
||||
_etext = .;
|
||||
_textdata = _etext;
|
||||
|
||||
.data ALIGN(4) : ALIGN(4)
|
||||
{
|
||||
. = ALIGN(4);
|
||||
PROVIDE(_data = .);
|
||||
*(.data)
|
||||
*(.data.*)
|
||||
*(.ramtext)
|
||||
. = ALIGN(4);
|
||||
PROVIDE(_edata = .);
|
||||
} > ram AT > flash
|
||||
|
||||
.bss ALIGN(4) : ALIGN(4)
|
||||
{
|
||||
. = ALIGN(4);
|
||||
PROVIDE(_bss_start = .);
|
||||
*(.bss)
|
||||
*(.bss.*)
|
||||
*(COMMON)
|
||||
. = ALIGN(4);
|
||||
PROVIDE(_bss_end = .);
|
||||
} > ram
|
||||
}
|
||||
|
||||
PROVIDE(end = .);
|
||||
_end = .;
|
||||
|
||||
__heap_base__ = _end;
|
||||
__heap_end__ = __ram_end__ - __stacks_total_size__;
|
||||
__main_thread_stack_base__ = __ram_end__ - __stacks_total_size__;
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
# List of the ChibiOS/RT ARM7 AT91SAM7 port files.
|
||||
PORTSRC = ${CHIBIOS}/os/ports/GCC/ARM/chcore.c
|
||||
|
||||
PORTASM = ${CHIBIOS}/os/ports/GCC/ARM/crt0.s \
|
||||
${CHIBIOS}/os/ports/GCC/ARM/chcoreasm.s \
|
||||
${CHIBIOS}/os/ports/GCC/ARM/AT91SAM7/vectors.s
|
||||
|
||||
PORTINC = ${CHIBIOS}/os/ports/GCC/ARM \
|
||||
${CHIBIOS}/os/ports/GCC/ARM/AT91SAM7
|
||||
|
||||
PORTLD = ${CHIBIOS}/os/ports/GCC/ARM/AT91SAM7/ld
|
||||
+111
@@ -0,0 +1,111 @@
|
||||
/*
|
||||
ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010,
|
||||
2011,2012,2013 Giovanni Di Sirio.
|
||||
|
||||
This file is part of ChibiOS/RT.
|
||||
|
||||
ChibiOS/RT is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
ChibiOS/RT is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
---
|
||||
|
||||
A special exception to the GPL can be applied should you wish to distribute
|
||||
a combined work that includes ChibiOS/RT, without being obliged to provide
|
||||
the source code for any proprietary components. See the file exception.txt
|
||||
for full details of how and when the exception can be applied.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file ARM/AT91SAM7/vectors.s
|
||||
* @brief Interrupt vectors for the AT91SAM7 family.
|
||||
*
|
||||
* @defgroup ARM_AT91SAM7_VECTORS AT91SAM7 Interrupt Vectors
|
||||
* @ingroup ARM_SPECIFIC
|
||||
* @details Interrupt vectors for the AT91SAM7 family.
|
||||
* @{
|
||||
*/
|
||||
|
||||
#if defined(__DOXYGEN__)
|
||||
/**
|
||||
* @brief Unhandled exceptions handler.
|
||||
* @details Any undefined exception vector points to this function by default.
|
||||
* This function simply stops the system into an infinite loop.
|
||||
*
|
||||
* @notapi
|
||||
*/
|
||||
void _unhandled_exception(void) {}
|
||||
#endif
|
||||
|
||||
#if !defined(__DOXYGEN__)
|
||||
|
||||
.section vectors
|
||||
.code 32
|
||||
.balign 4
|
||||
/*
|
||||
* System entry points.
|
||||
*/
|
||||
_start:
|
||||
ldr pc, _reset
|
||||
ldr pc, _undefined
|
||||
ldr pc, _swi
|
||||
ldr pc, _prefetch
|
||||
ldr pc, _abort
|
||||
nop
|
||||
ldr pc, [pc,#-0xF20] /* AIC - AIC_IVR */
|
||||
ldr pc, [pc,#-0xF20] /* AIC - AIC_FVR */
|
||||
|
||||
_reset:
|
||||
.word ResetHandler /* In crt0.s */
|
||||
_undefined:
|
||||
.word UndHandler
|
||||
_swi:
|
||||
.word SwiHandler
|
||||
_prefetch:
|
||||
.word PrefetchHandler
|
||||
_abort:
|
||||
.word AbortHandler
|
||||
.word 0
|
||||
.word 0
|
||||
.word 0
|
||||
|
||||
.text
|
||||
.code 32
|
||||
.balign 4
|
||||
|
||||
/*
|
||||
* Default exceptions handlers. The handlers are declared weak in order to be
|
||||
* replaced by the real handling code. Everything is defaulted to an infinite
|
||||
* loop.
|
||||
*/
|
||||
.weak UndHandler
|
||||
UndHandler:
|
||||
|
||||
.weak SwiHandler
|
||||
SwiHandler:
|
||||
|
||||
.weak PrefetchHandler
|
||||
PrefetchHandler:
|
||||
|
||||
.weak AbortHandler
|
||||
AbortHandler:
|
||||
|
||||
.weak FiqHandler
|
||||
FiqHandler:
|
||||
|
||||
.global _unhandled_exception
|
||||
_unhandled_exception:
|
||||
b _unhandled_exception
|
||||
|
||||
#endif
|
||||
|
||||
/** @} */
|
||||
+43
@@ -0,0 +1,43 @@
|
||||
/*
|
||||
ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010,
|
||||
2011,2012,2013 Giovanni Di Sirio.
|
||||
|
||||
This file is part of ChibiOS/RT.
|
||||
|
||||
ChibiOS/RT is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
ChibiOS/RT is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
---
|
||||
|
||||
A special exception to the GPL can be applied should you wish to distribute
|
||||
a combined work that includes ChibiOS/RT, without being obliged to provide
|
||||
the source code for any proprietary components. See the file exception.txt
|
||||
for full details of how and when the exception can be applied.
|
||||
*/
|
||||
|
||||
#ifndef _WFI_H_
|
||||
#define _WFI_H_
|
||||
|
||||
#include "board.h"
|
||||
|
||||
#ifndef port_wait_for_interrupt
|
||||
#if ENABLE_WFI_IDLE != 0
|
||||
#define port_wait_for_interrupt() { \
|
||||
AT91C_BASE_SYS->PMC_SCDR = AT91C_PMC_PCK; \
|
||||
}
|
||||
#else
|
||||
#define port_wait_for_interrupt()
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#endif /* _WFI_H_ */
|
||||
Reference in New Issue
Block a user