From: "Richard Hendricks" <richard.hendricks@motorola.com>
To: linuxppc-embedded@lists.linuxppc.org
Subject: Re: Board boots when in BDM, hangs otherwise
Date: Tue, 02 May 2000 16:22:00 -0500 [thread overview]
Message-ID: <390F46F8.1748ACC9@motorola.com> (raw)
In-Reply-To: 390EEDC5.362C58FB@motorola.com
[-- Attachment #1: Type: text/plain, Size: 2846 bytes --]
Note: This stuff only applies for Metrowerks running bare metal on the
FADS board.
Here are the instructions:
> Changes to PowerPC Runtime Source
>
> Add a __declspec(".init") before "extern void __start(void)" in
> __start.c
> Remove #pragma code_type ".init" in __start.c
> Add the following lines of code to __init_hardware() in
> __ppc_eabi_init.c and .cpp right after the nofralloc
>
> /* Our address is really in high Flash ROM space. When reset,
> execution
> * starts at 0x0100. This code fragment jumps us to the correct
> * high memory area */
>
> lis r3, __init_hardware@h /* high address of __start */
> ori r3, r3, __init_hardware@l
> addi r3, r3, 0x0014 /* Jumps us into the NOPs below */
> mtctr r3
> bctr
>
> nop
> nop
>
> /* Now we need to fix the LR since it points back to 0x0000_010x,
> * not 0x0280_010x like it needs to after we muck up the BCSR's */
>
> mflr r3
> oris r3, r3, 0x0280
> mtlr r3
>
> //Do rest of board setup here, including MSR, IMMR, disable and
> invalidate caches, program UPM, ICTRL, DER, and ICR
>
> Chages to PowerPC Runtime Include
>
> Remove declspec from both __init_hardware() and ADSInit() in file
> __ppc_eabi_init.h
>
> Next recompile Runtime.
> Make sure __ppc_eabi_init in project file points to new modified
> version.
>
> Then goto the project you wish to use flash, and change the Code Address
> to start at 0x02800100. Since __start is the only function marked as
> .init, it will now be at the correct location, 0x0100 during bootup.
>
> The runtime will also work when not flashing.
>
> This will also allow you to run standalone, and with MPC8bug attached by
> "go 02800100".
I sent them in to Metrowerks, so hopefully their next iteration will
work. I have also included my whole _FADS.cpp init file.
"Richard Hendricks (ra6353)" wrote:
>
> Jim Lewis wrote:
> >
> > Hi Josh,
> ..
> > Ther is one register that the IN command sets that it does not tell you about. That
> > is the ICTRL register, which controls serialization of the core, among other
> > things. On powerup, it is set to SHOW-ALL-INSTRUCTION-FETCH-CYCLES. Some 8xx
> > processors have problems with this. Read the errata. Check to make sure you are
> > setting ICTRL to something like 0x07 in your firmware.
> >
> > -Jim
>
> This is also probably the source of your slowdown when running
> off of BDM.
>
> Also make sure the watchdog is disabled (Dan's code does this, I think).
>
> If anyone is interested, I can post the startup file I use for
> running from flash on the FADS board using Metrowerks. I finally
> figured out a way that I can run the same flash image standalone,
> and through MPC8bug.
>
> --
> MPC823 Applications Engineering Development
>
--
MPC823 Applications Engineering Development
[-- Attachment #2: __ppc_eabi_init_FADS.cpp --]
[-- Type: application/x-unknown-content-type-CodeWarrior_cpp, Size: 12546 bytes --]
next prev parent reply other threads:[~2000-05-02 21:22 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2000-05-01 22:40 Board boots when in BDM, hangs otherwise Jochen Roth
2000-05-01 23:38 ` Jim Lewis
2000-05-02 13:59 ` Joshua Horvath
2000-05-02 15:01 ` Richard Hendricks
2000-05-02 21:22 ` Richard Hendricks [this message]
-- strict thread matches above, loose matches on Subject: below --
2000-05-01 19:36 Joshua Horvath
2000-05-01 22:39 ` Dan Malek
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=390F46F8.1748ACC9@motorola.com \
--to=richard.hendricks@motorola.com \
--cc=linuxppc-embedded@lists.linuxppc.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.