📄 m68k-mcf5272.html
字号:
<!-- Copyright (C) 2009 Free Software Foundation, Inc. -->
<!-- This material may be distributed only subject to the terms -->
<!-- and conditions set forth in the Open Publication License, v1.0 -->
<!-- or later (the latest version is presently available at -->
<!-- http://www.opencontent.org/openpub/). -->
<!-- Distribution of the work or derivative of the work in any -->
<!-- standard (paper) book form is prohibited unless prior -->
<!-- permission is obtained from the copyright holder. -->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<HTML
><HEAD
><TITLE
>The MCF5272 ColdFire Processor</TITLE
><meta name="MSSmartTagsPreventParsing" content="TRUE">
<META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
REL="HOME"
TITLE="eCos Reference Manual"
HREF="ecos-ref.html"><LINK
REL="UP"
TITLE="Freescale MCF5272 Processor Support"
HREF="hal-m68k-mcf5272.html"><LINK
REL="PREVIOUS"
TITLE="Freescale MCF5272 Processor Support"
HREF="hal-m68k-mcf5272.html"><LINK
REL="NEXT"
TITLE="Freescale M5272C3 Board Support"
HREF="hal-m68k-m5272c3-part.html"></HEAD
><BODY
CLASS="REFENTRY"
BGCOLOR="#FFFFFF"
TEXT="#000000"
LINK="#0000FF"
VLINK="#840084"
ALINK="#0000FF"
><DIV
CLASS="NAVHEADER"
><TABLE
SUMMARY="Header navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
>eCos Reference Manual</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="hal-m68k-mcf5272.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
></TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="hal-m68k-m5272c3-part.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><H1
><A
NAME="M68K-MCF5272"
></A
>The MCF5272 ColdFire Processor</H1
><DIV
CLASS="REFNAMEDIV"
><A
NAME="AEN19303"
></A
><H2
>Name</H2
><CODE
CLASS="VARNAME"
>CYGPKG_HAL_M68K_MCF5272</CODE
> -- eCos Support for the Freescale MCF5272 Processor</DIV
><DIV
CLASS="REFSECT1"
><A
NAME="M68K-MCF5272-DESCRIPTION"
></A
><H2
>Description</H2
><P
>The MCF5272 is one member of the Freescale MCFxxxx ColdFire range of
processors. It comes with a number of on-chip peripherals including 2
UARTs, ethernet, and USB slave. The processor HAL package
<CODE
CLASS="VARNAME"
>CYGPKG_HAL_M68K_MCF5272</CODE
> provides support for
features that are specific to the MCF5272. It complements the M68K
architectural HAL package <CODE
CLASS="VARNAME"
>CYGPKG_HAL_M68K</CODE
> and the
variant HAL package <CODE
CLASS="VARNAME"
>CYGPKG_HAL_M68K_MCFxxxx</CODE
>. An
eCos configuration should also include a platform HAL package, for
example <CODE
CLASS="VARNAME"
>CYGPKG_HAL_M68K_M5272C3</CODE
> to support
board-level details like the external memory chips.
</P
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="M68K-MCF5272-CONFIG"
></A
><H2
>Configuration</H2
><P
>The MCF5272 processor HAL package should be loaded automatically when
eCos is configured for appropriate target hardware. It should never be
necessary to load this package explicitly. Unloading the package
should only happen as a side effect of switching target hardware.
</P
><P
>The component <CODE
CLASS="VARNAME"
>CYGPKG_HAL_M68K_MCF5272_HARDWARE</CODE
>
contains configuration options for the available hardware. This
includes all GPIO pin settings, with defaults provided by the
platform HAL. In turn the pin settings are used to determine defaults
for other hardware settings, for example which of the two on-chip
uarts are usable. Users can override these settings if necessary,
subject to any constraints imposed by the platform HAL, but care has
to be taken that the resulting configuration still matches the actual
hardware.
</P
><P
>The option <CODE
CLASS="VARNAME"
>CYGIMP_HAL_M68K_MCF5272_IDLE</CODE
> controls
what happens in configurations containing the eCos kernel when the
idle thread runs, i.e. when there is nothing for the processor to do
until the next interrupt comes in. Usually the processor made to
sleep, halting the cpu but leaving all peripherals active.
</P
><P
>The package contains a single configuration option
<CODE
CLASS="VARNAME"
>CYGFUN_HAL_M68K_MCF5272_PROFILE_TIMER</CODE
>. This
controls the support for gprof-based profiling. By default it is
active and enabled if the configuration contains the gprof profiling
package, otherwise inactive. The relevant code uses hardware timer 2,
so that timer is no longer available for application code. If the
timer is required but a platform HAL provides an alternative
implementation of the profiling support then this option can be
disabled.
</P
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="M68K-MCF5272-PORT"
></A
><H2
>The HAL Port</H2
><P
>This section describes how the MCF5272 processor HAL package
implements parts of the eCos HAL specification. It should be read in
conjunction with similar sections from the architectural and variant
HAL documentation.
</P
><DIV
CLASS="REFSECT2"
><A
NAME="M68K-MCF5272-PORT-IO"
></A
><H3
>HAL I/O</H3
><P
>The header
file <TT
CLASS="FILENAME"
>cyg/hal/proc_io.h</TT
>
specifies which generic MCFxxxx devices are present, and provides
details of MCF5272-specific devices. This header file is automatically
included by the architectural
header <TT
CLASS="FILENAME"
>cyg/hal/hal_io.h</TT
>, so
typically application code and other packages will just include the
latter.
</P
><P
>It should be noted that the Freescale documentation is occasionally
confusing when it comes to numbering devices. For example the four
on-chip timers are numbered TMR0 to TMR3, but in the interrupt
controller the corresponding interrupts are numbered TMR1 to TMR4. The
eCos port consistently starts numbering at 0, so these interrupts have
been renamed TMR0 to TMR3.
</P
></DIV
><DIV
CLASS="REFSECT2"
><A
NAME="M68K-MCF5272-PORT-INTERRUPTS"
></A
><H3
>Interrupt Handling</H3
><P
>The header file <TT
CLASS="FILENAME"
>cyg/hal/proc_intr.h</TT
> provides VSR and ISR
vector numbers for all interrupt sources. The VSR vector number, for
example <CODE
CLASS="VARNAME"
>CYGNUM_HAL_VECTOR_TMR0</CODE
>, should be used
for calls like <CODE
CLASS="FUNCTION"
>cyg_interrupt_get_vsr</CODE
>. It
corresponds directly to the M68K exception number. The ISR vector
number, for example <CODE
CLASS="VARNAME"
>CYGNUM_HAL_ISR_TMR0</CODE
>, should be
used for calls like <CODE
CLASS="FUNCTION"
>cyg_interrupt_create</CODE
>. This
header file is automatically included by the architectural header
<TT
CLASS="FILENAME"
>cyg/hal/hal_intr.h</TT
>, and other
packages and application code will normally just include the latter.
</P
><P
>The eCos HAL macros <CODE
CLASS="FUNCTION"
>HAL_INTERRUPT_MASK</CODE
>,
<CODE
CLASS="FUNCTION"
>HAL_INTERRUPT_UNMASK</CODE
>,
<CODE
CLASS="FUNCTION"
>HAL_INTERRUPT_SET_LEVEL</CODE
>,
<CODE
CLASS="FUNCTION"
>HAL_INTERRUPT_ACKNOWLEDGE</CODE
>, and
<CODE
CLASS="FUNCTION"
>HAL_INTERRUPT_CONFIGURE</CODE
> are implemented by the
processor HAL. The mask and unmask operations are straightforward,
simply manipulating the on-chip interrupt controller. The acknowledge
and configure macros are only relevant for external interrupts:
internal interrupts generated by on-chip devices do not need to be
acknowledged. The set-level operation, used implicitly by higher level
code such as <CODE
CLASS="FUNCTION"
>cyg_interrupt_create</CODE
>, is mapped on
to M68K IPL levels so interrupts can be given a priority between 1
and 7. Priority 7 corresponds to non-maskable interrupts and must be
used with care: such interrupts cannot be managed safely by the usual
eCos ISR and DSR mechanisms; instead application code will have to
install a custom VSR and manage the entire interrupt.
</P
></DIV
><DIV
CLASS="REFSECT2"
><A
NAME="M68K-MCF5272-PORT-CLOCK"
></A
><H3
>Clock Support</H3
><P
>The processor HAL provides support for the eCos system clock. This
always uses hardware timer 3, which should not be used directly by
application code. If gprof-based profiling is in use then that will
use hardware timer 2. Timers 0 and 1 are never used by eCos so
application code is free to manipulate these as required.
</P
><P
>Some of the configuration options related to the system clock, for
example <CODE
CLASS="VARNAME"
>CYGNUM_HAL_RTC_PERIOD</CODE
>, are actually
contained in the platform HAL rather than the processor HAL. These
options need to take into account the processor clock speed, a
characteristic of the platform rather than the processor.
</P
></DIV
><DIV
CLASS="REFSECT2"
><A
NAME="M68K-MCF5272-PORT-CACHE"
></A
><H3
>Cache Handling</H3
><P
>The MCF5272 has a small instruction cache of 1024 bytes. This is fully
supported by the processor HAL. There is no data cache.
</P
></DIV
><DIV
CLASS="REFSECT2"
><A
NAME="M68K-MCF5272-PORT-IDLE"
></A
><H3
>Idle Thread Support</H3
><P
>The configuration
option <CODE
CLASS="VARNAME"
>CYGIMP_HAL_M68K_MCF5272_IDLE</CODE
> controls what
happens when the kernel idle thread runs. The default behaviour is to
put the processor to sleep until the next interrupt.
</P
></DIV
><DIV
CLASS="REFSECT2"
><A
NAME="M68K-MCF5272-PORT-PROFILING"
></A
><H3
>Profiling Support</H3
><P
>The MCF5272 processor HAL provides a profiling timer for use with the
gprof profiling package. This uses hardware timer 2, so application
code should not manipulate this timer if profiling is enabled. The
M68K architectural HAL implements the <CODE
CLASS="FUNCTION"
>mcount</CODE
>
function so profiling is fully supported on all MCF5272-based platforms.
</P
></DIV
><DIV
CLASS="REFSECT2"
><A
NAME="M68K-MCF5272-PORT-OTHER-HAL"
></A
><H3
>Other Issues</H3
><P
>The MCF5272 processor HAL does not affect the implementation of data
types, stack size definitions, linker scripts, SMP support, system
startup, or debug support. The architectural HAL's bit index
instructions are used rather than the MCFxxxx variant HAL's versions
since the MCF5272 does not implement the ff1 and bitrev instructions.
</P
></DIV
><DIV
CLASS="REFSECT2"
><A
NAME="M68K-MCF5272-PORT-OTHER"
></A
><H3
>Other Functionality</H3
><P
>The MCF5272 processor HAL only implements functionality defined in the
eCos HAL specification and does not export any additional functions.
</P
></DIV
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
SUMMARY="Footer navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="hal-m68k-mcf5272.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="ecos-ref.html"
ACCESSKEY="H"
>Home</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="hal-m68k-m5272c3-part.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>Freescale MCF5272 Processor Support</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="hal-m68k-mcf5272.html"
ACCESSKEY="U"
>Up</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>Freescale M5272C3 Board Support</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -