From: wei.li4@elf.mcgill.ca
To: linuxppc-embedded@ozlabs.org
Subject: Strange to me
Date: Sun, 15 Oct 2006 17:43:49 -0400 [thread overview]
Message-ID: <20061015174349.hnkekpjxpccccc0c@webmail.mcgill.ca> (raw)
Hi All,
I am trying to add a C function in m8xx_setup.c and call it in
head_8xx.S. I checked the final assembler and compared it with other
functions same called in head_8xx.S (e.g.platform_init()), they used
the different registers for stack poniter, and normal one used r0 to
store and recover Link register. How to control comlier or linker, so
that my own function is treated as same way? Thanks.
Here is my code:
void __init
debugger_init(unsigned char case_NO)
{
//volatile immap_t *immap;
volatile cpm8xx_t *cp;
// Get pointer to Communication Processor
cp = cpmp;
/* PortB setting */
/* These setting may be different for you.
Refer example 16-443 MPC823 Manual*/
// Port B pin 29, 30 configured as Open-Drain general purpose output
cp->cp_pbodr &= ~0x0009; // set 0
cp->cp_pbdir |= 0x0006; // set 1
cp->cp_pbpar &= ~0x0009; // set 0
switch (case_NO)
{
case 1:
// Turn on at BP29(=0) and off at BP30(=1)
cp->cp_pbdat &= ~0x0004;
cp->cp_pbdat |= 0x0002;
break;
case 2:
// Turn off at BP29(=1) and on at BP30(=0)
cp->cp_pbdat |= 0x0004;
cp->cp_pbdat &= ~0x0002;
break;
default:
// Turn on at BP29, BP30(=0)
cp->cp_pbdat &= ~0x0006;
break;
}
}
It's working fine if put in the utilitise, the fist part of EFL image.
Regard,
Wei
reply other threads:[~2006-10-15 21:43 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20061015174349.hnkekpjxpccccc0c@webmail.mcgill.ca \
--to=wei.li4@elf.mcgill.ca \
--cc=linuxppc-embedded@ozlabs.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).