Commit Graph

154 Commits

Author SHA1 Message Date
Sebastian Huber
56435e646c powerpc: Fix Altivec support
Use the right context.
2013-06-26 10:31:43 +02:00
Sebastian Huber
ade27c69eb bsps: Move bsp_generic_fatal_code to new file
Add bsp_generic_fatal().
2013-06-21 10:26:10 +02:00
Sebastian Huber
5f91272e9b bsps/powerpc: Delete bsp_exceptions_in_RAM
Delete ppc_exc_vector_base.  Add and use
ppc_exc_initialize_with_vector_base().
2013-06-21 10:26:09 +02:00
Sebastian Huber
18e2fbe70d smp: Fix PowerPC context switch 2013-06-07 17:06:43 +02:00
Sebastian Huber
ffbeb6f6a3 smp: Add PowerPC support 2013-05-31 15:20:32 +02:00
Sebastian Huber
602d5ba27c bsps: Fix warnings 2013-04-08 16:42:36 +02:00
Sebastian Huber
39de53882c bsps/powerpc: Add and use ppc_cpu_is_specific_e200 2013-02-06 15:35:54 +01:00
Sebastian Huber
f665f13ddd bsps/powerpc: Add PPC_EXC_CONFIG_BOOKE_ONLY
In combination with the PPC_EXC_CONFIG_USE_FIXED_HANDLER option this
removes all dependencies on valid read-write data.  The exception
handling must be statically configured and all components reside in
read-only sections.
2012-12-03 13:17:08 +01:00
Sebastian Huber
4bd4c9e1f9 bsps/powerpc: Add PPC_EXC_CONFIG_USE_FIXED_HANDLER
In case a BSP enables this option, then fixed high level exception
handler will be used.  For normal asynchronous exceptions this is
bsp_interrupt_dispatch() and for other exceptions this is the handler
from the read-only ppc_exc_handler_table.  The global handler is
C_exception_handler().  This avoids some dependencies on valid
read-write data.
2012-12-03 13:17:08 +01:00
Sebastian Huber
4263155e96 bsps/powerpc: Declare ppc_exc_handler_table 2012-12-03 13:17:08 +01:00
Ric Claus
809b726ae1 Print MCSR and ESR.
The Machine Check and Exception Syndrome Registers on Book-E and Book-E-like
processors contain useful information for decoding the cause of an exception.

NB: This patch depends on the PR 2048 patch sent earlier having been applied.
2012-12-01 09:04:33 +01:00
Sebastian Huber
815994fd17 score: Add CPU_Exception_frame
Add CPU port type CPU_Exception_frame and function
_CPU_Exception_frame_print().

The CPU ports of avr, bfin, h8300, lm32, m32c, m32r, m68k, nios2, sh,
sparc64, and v850 use an empty default implementation of
_CPU_Exception_frame_print().

Add rtems_exception_frame and rtems_exception_frame_print().

Add RTEMS_FATAL_SOURCE_EXCEPTION for CPU exceptions.  Use rtems_fatal()
with source RTEMS_FATAL_SOURCE_EXCEPTION in CPU ports of i386, powerpc,
and sparc for unexpected exceptions.

Add third parameter to RTEMS_BSP_CLEANUP_OPTIONS() which controls the
BSP_PRINT_EXCEPTION_CONTEXT define used in the default
bsp_fatal_extension().

Add test sptests/spfatal26.
2012-11-27 17:03:40 +01:00
Sebastian Huber
d2202ac56d powerpc: Add CPU_Exception_frame
The powerpc port uses now a unified CPU_Exception_frame.  This resulted
in a CPU_Exception_frame layout change for the MPC5XX.
2012-11-27 17:03:40 +01:00
Sebastian Huber
f0e3cc0a0a bsps/powerpc: Delete unused EXC_DAR field
The Data Access Register (DAR) is not saved in the exception prologue.
2012-11-27 17:03:40 +01:00
Sebastian Huber
7b02f3c6f1 bsps/powerpc: Delete unused EXC_MSR field
The MSR of the interrupted context is saved in the EXC_SRR1 field.
2012-11-27 17:03:40 +01:00
Sebastian Huber
7e32b62a59 score: Add RTEMS_FATAL_SOURCE_POWERPC_EXCEPTION
Add ppc_exc_print_frame_and_context() which prints an exception frame
and the context via printk().

The global exception handler will call now rtems_fatal() with source
RTEMS_FATAL_SOURCE_POWERPC_EXCEPTION.  The fatal code will contain the
pointer value to the exception frame.
2012-11-21 16:38:28 +01:00
Sebastian Huber
b1e8a580bc bsps/powerpc: Exception initialization error is fatal 2012-11-15 15:33:13 +01:00
Sebastian Huber
b31a9603e0 score: Add INTERNAL_ERROR_CPU_ISR_INSTALL_VECTOR
Use INTERNAL_ERROR_CPU_ISR_INSTALL_VECTOR on PowerPC for
_CPU_ISR_install_vector().
2012-11-15 15:33:11 +01:00
Sebastian Huber
00dae1866d powerpc: Delete _CPU_Install_interrupt_stack()
This function is only used if CPU_HAS_HARDWARE_INTERRUPT_STACK == TRUE.
2012-11-14 14:06:59 +01:00
Sebastian Huber
1869bb7101 powerpc: Simplify context switch
PowerPC cores with the SPE (Signal Processing Extension) have 64-bit
general-purpose registers.  The SPE context switch code has been merged
with the standard context switch code.  The context switch may use cache
operations to increase the performance.  It will be ensured that the
context is 32-byte aligned (PPC_DEFAULT_CACHE_LINE_SIZE).  This
increases the overall memory size of the context area in the thread
control block slightly.  The general-purpose registers GPR2 and GPR13
are no longer part of the context.  The BSP must initialize these
registers during startup (usually initialized by the __eabi() function).

The new BSP option BSP_USE_DATA_CACHE_BLOCK_TOUCH can be used to enable
the dcbt instruction in the context switch.

The new BSP option BSP_USE_SYNC_IN_CONTEXT_SWITCH can be used to enable
sync and isync instructions in the context switch.  This should be not
necessary in most cases.
2012-06-04 09:54:31 +02:00
Joel Sherrill
65c6425de9 Remove CVS Id Strings (manual edits after script)
These modifications were required by hand after running the script.
In some cases, the file names did not match patterns. In others,
the format of the file did not match any common patterns.
2012-05-11 08:44:14 -05:00
Joel Sherrill
9b4422a251 Remove All CVS Id Strings Possible Using a Script
Script does what is expected and tries to do it as
smartly as possible.

+ remove occurrences of two blank comment lines
  next to each other after Id string line removed.
+ remove entire comment blocks which only exited to
  contain CVS Ids
+ If the processing left a blank line at the top of
  a file, it was removed.
2012-05-11 08:44:13 -05:00
Ric Claus
16a86162a2 Add Virtex4 and Virtex5 BSPs
This commit covers at least PR2020, 2022, and 2023. This
patch adds all of the code for both BSPs, modifications
to libcpu/powerpc for the ppc440, and some updates to the
BSPs from follow up review and testing.

These BSPs should be good baselines for future development.
The configurations used by Ric are custom and have a non-standard
NIC. They also do not have a UART.  Thus the current console
driver just prints to a RAM buffer.

The NIC and UART support are left for future work. When the UART
support is added, moving the existing "to RAM" console driver to
a shared location is likely desirable because boards with no debug
UART port are commonly deployed. This would let printk() go to RAM.
2012-03-30 10:03:43 -05:00
Sebastian Huber
a762dc2a49 Support for MPC5643L.
Rework of the start sequence to reduce the amount assembler code and to
support configuration tables which may be provided by the application.
2012-01-23 11:19:22 +01:00
Sebastian Huber
edb1dd83b8 2011-11-08 Sebastian Huber <sebastian.huber@embedded-brains.de>
* new-exceptions/bspsupport/ppc_exc_async_normal.S: Bugfix for
	MPC5674F.  Use it for all to be safe.
	* mpc55xx/include/emios.h: Fixed eMIOS module count.
	* mpc55xx/include/irq.h: Fixed CAN vector numbers.
	BSP_INTERRUPT_HANDLER_TABLE_SIZE is now a BSP option.
2011-11-08 10:05:50 +00:00
Ralf Corsepius
c3178737d0 2011-10-07 Ralf Corsépius <ralf.corsepius@rtems.org>
* new-exceptions/bspsupport/ppc_exc_prologue.c
	(ppc_exc_create_branch_op): Comment out unused var "BRANCH_OP_LINK".
2011-10-07 09:18:24 +00:00
Sebastian Huber
b2aa729698 2011-08-31 Sebastian Huber <sebastian.huber@embedded-brains.de>
* new-exceptions/bspsupport/ppc_exc_categories.c,
	shared/include/cpuIdent.c, shared/include/cpuIdent.h: Support e200z7.
2011-08-31 15:27:58 +00:00
Sebastian Huber
1d367a49df 2011-08-24 Sebastian Huber <sebastian.huber@embedded-brains.de>
* mpc6xx/clock/c_clock.c, mpc6xx/mmu/mmuAsm.S,
	new-exceptions/bspsupport/ppc_exc_global_handler.c,
	shared/include/cpuIdent.c, shared/src/stack.c: Update due to API
	changes.
2011-08-24 09:45:20 +00:00
Sebastian Huber
fdd9de8001 2011-07-21 Sebastian Huber <sebastian.huber@embedded-brains.de>
PR 1799/bsps
	* new-exceptions/bspsupport/ppc_exc_async_normal.S: New file.
	* new-exceptions/cpu.c, new-exceptions/cpu_asm.S,
	new-exceptions/bspsupport/ppc_exc_asm_macros.h,
	new-exceptions/bspsupport/ppc_exc_global_handler.c,
	new-exceptions/bspsupport/ppc_exc_prologue.c,
	new-exceptions/bspsupport/vectors.h: Added support for SPE.
	* configure.ac, preinstall.am, Makefile.am: Added support for qoriq
	BSPs.
2011-07-21 15:03:31 +00:00
Sebastian Huber
88dcb841e7 2011-06-07 Sebastian Huber <sebastian.huber@embedded-brains.de>
* new-exceptions/bspsupport/ppc_exc_alignment.c: New file.
	* Makefile.am: Reflect change above.
	* new-exceptions/bspsupport/vectors.h: Declare
	ppc_exc_alignment_handler().
2011-06-07 13:58:23 +00:00
Sebastian Huber
ae2b1e056a 2011-06-07 Sebastian Huber <sebastian.huber@embedded-brains.de>
* new-exceptions/cpu_asm.S: Use BSP_DATA_CACHE_ENABLED instead of
	PPC_USE_DATA_CACHE.
2011-06-07 12:59:39 +00:00
Sebastian Huber
2888a652a6 2011-02-17 Sebastian Huber <sebastian.huber@embedded-brains.de>
* new-exceptions/bspsupport/vectors.h: Added defines PPC_EXC_GPR_TYPE,
	PPC_EXC_GPR_SIZE, PPC_EXC_GPR_OFFSET, PPC_EXC_MINIMAL_FRAME_SIZE, and
	PPC_EXC_FRAME_SIZE.  Changed layout of BSP_Exception_frame.
2011-02-17 11:19:43 +00:00
Ralf Corsepius
0f7b6eff46 2011-02-17 Ralf Corsépius <ralf.corsepius@rtems.org>
* new-exceptions/bspsupport/vectors.h: Add extern "C" {}.
2011-02-17 03:30:08 +00:00
Ralf Corsepius
f9acc339fe 2011-02-11 Ralf Corsépius <ralf.corsepius@rtems.org>
* e500/mmu/mmu.c, mpc505/ictrl/ictrl.c, mpc505/timer/timer.c,
	mpc5xx/ictrl/ictrl.c, mpc5xx/timer/timer.c,
	mpc6xx/altivec/vec_sup.c, mpc6xx/clock/c_clock.c,
	mpc6xx/mmu/bat.c, mpc6xx/mmu/bat.h, mpc6xx/mmu/pte121.c,
	mpc8260/timer/timer.c, mpc8xx/timer/timer.c, new-exceptions/cpu.c,
	new-exceptions/bspsupport/ppc_exc_initialize.c,
	ppc403/clock/clock.c, ppc403/console/console.c,
	ppc403/console/console.c.polled, ppc403/console/console405.c,
	ppc403/irq/ictrl.c, ppc403/tty_drv/tty_drv.c,
	rtems/powerpc/cache.h, shared/include/powerpc-utility.h, shared/src/cache.c:
	Use "__asm__" instead of "asm" for improved c99-compliance.
2011-02-11 09:46:53 +00:00
Sebastian Huber
10df690794 2011-01-31 Sebastian Huber <sebastian.huber@embedded-brains.de>
* new-exceptions/bspsupport/ppc_exc.S,
	new-exceptions/bspsupport/ppc_exc_asm_macros.h,
	new-exceptions/bspsupport/ppc_exc_naked.S,
	new-exceptions/bspsupport/ppc_exc_prologue.c: Branch targets are now
	global for all minimal prologues.  Generate branch instruction in
	minimal prologues.
2011-01-31 16:12:24 +00:00
Joel Sherrill
e71a3a840d 2011-01-28 Joel Sherrill <joel.sherrilL@OARcorp.com>
* mpc5xx/exceptions/raw_exception.c, mpc5xx/exceptions/raw_exception.h,
	mpc5xx/include/console.h, mpc5xx/include/mpc5xx.h, mpc5xx/irq/irq.c,
	mpc5xx/irq/irq.h, mpc5xx/irq/irq_asm.S, mpc5xx/vectors/vectors.h,
	mpc5xx/vectors/vectors_init.c, mpc6xx/mmu/bat.c, mpc6xx/mmu/bat.h,
	mpc6xx/mmu/mmuAsm.S, new-exceptions/bspsupport/irq.c,
	new-exceptions/bspsupport/irq_supp.h,
	new-exceptions/bspsupport/nested_irq_test.c,
	new-exceptions/bspsupport/ppc_exc_address.c,
	new-exceptions/bspsupport/ppc_exc_categories.c,
	new-exceptions/bspsupport/ppc_exc_global_handler.c,
	new-exceptions/bspsupport/ppc_exc_hdl.c,
	new-exceptions/bspsupport/ppc_exc_initialize.c,
	new-exceptions/bspsupport/ppc_exc_prologue.c,
	new-exceptions/bspsupport/ppc_exc_test.c,
	new-exceptions/bspsupport/vectors.h, shared/include/byteorder.h,
	shared/include/cpuIdent.c, shared/include/cpuIdent.h,
	shared/include/io.h, shared/include/mmu.h, shared/include/page.h,
	shared/include/pgtable.h, shared/include/spr.h: Fix typo where
	license said found in found in.
2011-01-28 20:38:13 +00:00
Sebastian Huber
610d92c179 2011-01-27 Sebastian Huber <sebastian.huber@embedded-brains.de>
* new-exceptions/bspsupport/ppc_exc_categories.c: Fixed e500
	categories.
2011-01-27 13:32:53 +00:00
Sebastian Huber
e62721c4dd 2011-01-09 Sebastian Huber <sebastian.huber@embedded-brains.de>
* new-exceptions/bspsupport/ppc_exc_categories.c: Fixed e200 machine
	check category.
2011-01-10 12:00:27 +00:00
Sebastian Huber
4e9d8ea602 2010-12-29 Sebastian Huber <sebastian.huber@embedded-brains.de>
* new-exceptions/bspsupport/ppc_exc_address.c,
	new-exceptions/bspsupport/ppc_exc_initialize.c: Fixed IVOR handling for
	e200z0 and e200z1.
2010-12-29 10:48:08 +00:00
Sebastian Huber
644448f840 2010-12-29 Sebastian Huber <sebastian.huber@embedded-brains.de>
* shared/include/cpuIdent.c, shared/include/cpuIdent.h: Added support
	for e500v2.  Removed IVPR/IVOR/HWIVOR features since they are included
	in Book E.
	* new-exceptions/bspsupport/vectors.h,
	new-exceptions/bspsupport/ppc_exc.S,
	new-exceptions/bspsupport/ppc_exc_address.c,
	new-exceptions/bspsupport/ppc_exc_categories.c,
	new-exceptions/bspsupport/ppc_exc_initialize.c,
	new-exceptions/bspsupport/ppc_exc_prologue.c: Added support for
	e500v2.  Added exception vector defines for Book E types.  Removed
	e200 exception vector defines.  Added e500 exception vector defines.
	Unified IVOR calculation for e200 and e500 (e200z1 has hard wired
	IVOR values).
2010-12-29 09:51:18 +00:00
Sebastian Huber
b5919529db 2010-12-22 Sebastian Huber <sebastian.huber@embedded-brains.de>
* new-exceptions/bspsupport/ppc_exc.S: Comment.
	* new-exceptions/bspsupport/ppc_exc_address.c: Fixed address
	calculation for e200z1 core.
2010-12-22 14:13:03 +00:00
Joel Sherrill
7814f92a5d 2010-07-30 Gedare Bloom <giddyup44@yahoo.com>
PR 1599/cpukit
	* new-exceptions/bspsupport/ppc_exc_hdl.c: Rename
	_Context_Switch_necessary to _Thread_Dispatch_necessary to more
	properly reflect the intent.
2010-07-30 18:51:43 +00:00
Jennifer Averett
d010b9d7cf 2010-06-29 Jennifer Averett <Jennifer.Averett@OARcorp.com>
* new-exceptions/bspsupport/ppc_exc_asm_macros.h: Added include of
	bspopts to resolve compilation problem.
2010-06-29 19:44:06 +00:00
Joel Sherrill
5048a0a0b8 2010-06-28 Joel Sherrill <joel.sherrill@oarcorp.com>
PR 1573/cpukit
	* mpc5xx/irq/irq.c, mpc5xx/irq/irq_asm.S,
	new-exceptions/bspsupport/ppc_exc.S,
	new-exceptions/bspsupport/ppc_exc_asm_macros.h,
	new-exceptions/bspsupport/ppc_exc_hdl.c: Add a per cpu data structure
	which contains the information required by RTEMS for each CPU core.
	This encapsulates information such as thread executing, heir, idle
	and dispatch needed.
2010-06-29 00:39:39 +00:00
Thomas Doerfler
2931336963 changes to support GW_LCFM 2010-04-07 06:45:59 +00:00
Thomas Doerfler
8e46b093b5 Removed new-exceptions/bspsupport/ppc_exc_bspsupp.h 2009-12-14 14:51:50 +00:00
Till Straumann
c7f8408d31 2009-12-01 Till Straumann <strauman@slac.stanford.edu>
* new-exceptions/cpu.c, new-exceptions/cpu_asm.S,
	new-exceptions/bspsupport/ppc_exc_asm_macros.h,
	new-exceptions/bspsupport/ppc_exc_initialize.c,
	new-exceptions/bspsupport/vectors.h:
	Added AltiVec support (save/restore volatile vregs
	across exceptions).
2009-12-02 01:41:57 +00:00
Ralf Corsepius
359e537416 Whitespace removal. 2009-11-30 05:09:41 +00:00
Till Straumann
f70c86eaff 2009-11-17 Till Straumann <strauman@slac.stanford.edu>
* new-exceptions/bspsupport/ppc_exc_categories.c:
	PSIM *must*not* hook SYS vector which is used e.g.,
	for firmware I/O.

	Added entries for AltiVec on PSIM.
2009-11-17 11:42:53 +00:00
Thomas Doerfler
f7ac681b51 remove depratated powerpc exception API 2009-10-30 13:52:34 +00:00