u-boot/arch/powerpc/cpu/mpc824x/drivers/epic
Stefan Roese a47a12becf Move arch/ppc to arch/powerpc
As discussed on the list, move "arch/ppc" to "arch/powerpc" to
better match the Linux directory structure.

Please note that this patch also changes the "ppc" target in
MAKEALL to "powerpc" to match this new infrastructure. But "ppc"
is kept as an alias for now, to not break compatibility with
scripts using this name.

Signed-off-by: Stefan Roese <sr@denx.de>
Acked-by: Wolfgang Denk <wd@denx.de>
Acked-by: Detlev Zundel <dzu@denx.de>
Acked-by: Kim Phillips <kim.phillips@freescale.com>
Cc: Peter Tyser <ptyser@xes-inc.com>
Cc: Anatolij Gustschin <agust@denx.de>
2010-04-21 23:42:38 +02:00
..
epic.h Move arch/ppc to arch/powerpc 2010-04-21 23:42:38 +02:00
epic1.c Move arch/ppc to arch/powerpc 2010-04-21 23:42:38 +02:00
epic2.S Move arch/ppc to arch/powerpc 2010-04-21 23:42:38 +02:00
epicutil.S Move arch/ppc to arch/powerpc 2010-04-21 23:42:38 +02:00
README Move arch/ppc to arch/powerpc 2010-04-21 23:42:38 +02:00

CONTENT:

   epic.h
   epic1.c
   epic2.s

WHAT ARE THESE FILES:

These files contain MPC8240 (Kahlua) EPIC
driver routines. The driver routines are not
written for any specific operating system.
They serves the purpose of code sample, and
jump-start for using the MPC8240 EPIC unit.

For the reason of correctness of C language
syntax, these files are compiled by Metaware
C compiler and assembler.

ENDIAN NOTATION:

The algorithm is designed for big-endian mode,
software is responsible for byte swapping.

USAGE:

1. The host system that is running on MPC8240
   shall link the files listed here. The memory
   location of driver routines shall take into
   account of that driver routines need to run
   in supervisor mode and they process external
   interrupts.

   The routine epic_exception shall be called by
   exception vector at location 0x500, i.e.,
   603e core external exception vector.

2. The host system is responsible for configuring
   the MPC8240 including Embedded Utilities Memory
   Block. All EPIC driver functions require the
   content of Embedded Utilities Memory Block
   Base Address Register, EUMBBAR, as the first
   parameter.

3. Before EPIC unit of MPC8240 can be used,
   initialize EPIC unit by calling epicInit
   with the corresponding parameters.

   The initialization shall disable the 603e
   core External Exception by calling CoreExtIntDisable( ).
   Next, call epicInit( ). Last, enable the 603e core
   External Exception by calling CoreExtIntEnable( ).

4. After EPIC unit has been successfully initialized,
   epicIntSourceSet( ) shall be used to register each
   external interrupt source. Anytime, an external
   interrupt source can be disabled or enabled by
   calling corresponding function, epicIntDisable( ),
   or epicIntEnable( ).

   Global Timers' resource, base count and frequency,
   can be changed by calling epicTmFrequencySet( )
   and epicTmBaseSet( ).

   To stop counting a specific global timer, use
   the function, epicTmInhibit while epicTmEnable
   can be used to start counting a timer.

5. To mask a set of external interrupts that are
   are certain level below, epicIntPrioritySet( )
   can be used. For example, if the processor's
   current task priority register is set to 0x7,
   only interrupts of priority 0x8 or higher will
   be passed to the processor.

   Be careful when using this function. It may
   corrupt the current interrupt pending, selector,
   and request registers, resulting an invalid vetor.

   After enabling an interrupt, disable it may also
   cause an invalid vector. User may consider using
   the spurious vector interrupt service routine to
   handle this case.

6. The EPIC driver routines contains a set
   of utilities, Set and Get, for host system
   to query and modify the desired EPIC source
   registers.

7. Each external interrupt source shall register
   its interrupt service routine. The routine
   shall contain all interrupt source specific
   processes and keep as short as possible.

   Special customized end of interrupt routine
   is optional. If it is needed, it shall contain
   the external interrupt source specific end of
   interrupt process.

   External interrupt exception vector at 0x500
   shall always call the epicEOI just before
   rfi instruction. Refer to the routine,
   epic_exception, for a code sample.