linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* Strange to me
@ 2006-10-15 21:43 wei.li4
  0 siblings, 0 replies; only message in thread
From: wei.li4 @ 2006-10-15 21:43 UTC (permalink / raw)
  To: linuxppc-embedded

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2006-10-15 21:43 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-10-15 21:43 Strange to me wei.li4

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).