
Appendix C. Initialization Example
C-1
Appendix C
Initialization Example
This appendix contains an example PowerPC assembly language routine for initializing the
configuration registers for the MPC8240 using address map B. It is excerpted from
DINK32 source code available for download at http://www.motorola.com/semiconductors.
DINK32 source code also contains examples on how to initialize the embedded utilities
(EPIC, DMA, MU and I
2
C).
/* entry: r3 contains MPC8240 Vendor ID */
MPC8240Init:
// save MPC8240 Vendor ID
or r11, r3, r3
// If the MPC8240 is detected, it must be running on a
// Sandpoint with the Unity (PPMC8240) board (or possibly
// a Yellowknife X4 with an adapter card).
// The board_type of SaPMC8240 X4 is 4. This code
// stores the value 4 to sprg0, which will be stored to the
// board_type variable after DINK is copied form ROM to RAM.
addi
r3, r0, 0x4
mtspr
sprg0, r3
// Errata to address latency timer RP 7/20/99
addis
r3,r0,BMC_BASE
// Set LATENCY_TIMER
ori
r3,r3,0x000d
li r4, 0x20 // Set to 0x20
stwbrxr3,0,r5
sync
stb r4, 1(r6)
sync
addis
r3,r0,BMC_BASE
// Set CACHE_LINE_SIZE
ori
r3,r3,0x000c
li r4, 0x08 // Set to 0x08
stwbrx
r3,0,r5
sync
stb r4, 0(r6)
sync
addis
r3,r0,BMC_BASE
// Set PCI_CMD
ori
r3,r3,0x0004
li r4, 0x0006 // Set to 06 (Memory Space)
stwbrx
r3,0,r5
Содержание MPC8240
Страница 1: ...MPC8240UM D Rev 1 1 2001 MPC8240 Integrated Processor User s Manual ...
Страница 38: ...xviii MPC8240 Integrated Processor User s Manual TABLES Table Number Title Page Number ...
Страница 48: ...xlviii MPC8240 Integrated Processor User s Manual Acronyms and Abbreviations ...
Страница 312: ...6 94 MPC8240 Integrated Processor User s Manual ROM Flash Interface Operation ...
Страница 348: ...7 36 MPC8240 Integrated Processor User s Manual PCI Host and Agent Modes ...
Страница 372: ...8 24 MPC8240 Integrated Processor User s Manual DMA Register Descriptions ...
Страница 394: ...9 22 MPC8240 Integrated Processor User s Manual I2O Interface ...
Страница 412: ...10 18 MPC8240 Integrated Processor User s Manual Programming Guidelines ...
Страница 454: ...12 14 MPC8240 Integrated Processor User s Manual Internal Arbitration ...
Страница 466: ...13 12 MPC8240 Integrated Processor User s Manual Exception Latencies ...
Страница 516: ...16 14 Watchpoint Trigger Applications ...
Страница 538: ...B 16 MPC8240 Integrated Processor User s Manual Setting the Endian Mode of Operation ...
Страница 546: ...C 8 MPC8240 Integrated Processor User s Manual ...
Страница 640: ...INDEX Index 16 MPC8240 Integrated Processor User s Manual ...