public inbox for linuxppc-dev@ozlabs.org 
 help / color / mirror / Atom feed
From: Clemens Koller <clemens.koller@anagramm•de>
To: Gerhard Jaeger <g.jaeger@sysgo•com>
Cc: Eric Kampman <erickampman@yahoo•com>, linuxppc-embedded@ozlabs•org
Subject: Re: MPC8555CDS & CCSRBAR
Date: Tue, 09 Aug 2005 17:53:42 +0200	[thread overview]
Message-ID: <42F8D186.1030209@anagramm.de> (raw)
In-Reply-To: <200508091615.53736.g.jaeger@sysgo.com>

Hi!

You might want to try that:

#include <asm/mpc85xx.h>
#include <immap_85xx.h>		/* see mail archives for complete mpc8540 version */
...

void foo(void)
{
	volatile ccsr_t *immap;
	phys_addr_t ccsrbar;

	ccsrbar=get_ccsrbar();
        immap=ioremap(ccsrbar,sizeof(ccsr_t));	/* is ioremap_nochache() the same on mpc85xx? */
        if (!immap) {
                printk(KERN_ALERT "Failed to ioremap CCSRBAR!\n");
                err = -EIO;
                goto out;
        }

	/* examples */
        printk(KERN_INFO "CCSRBAR addr        %.8lx\n",ccsrbar);
	printk(KERN_INFO "IMMAP addr          %p\n",immap);
	printk(KERN_INFO "BR0        %.8x\n",immap->im_lbc.br0);
	printk(KERN_INFO "OR0        %.8x\n",immap->im_lbc.or0);

	/* unmap the ccsr*/
	iounmap(immap);
out:
}

I hope that's all current code.
Comments are welcome.

Greets,

Clemens Koller
_______________________________
R&D Imaging Devices
Anagramm GmbH
Rupert-Mayer-Str. 45/1
81379 Muenchen
Germany

http://www.anagramm.de
Phone: +49-89-741518-50
Fax: +49-89-741518-19


Gerhard Jaeger wrote:
> On Tuesday 09 August 2005 16:04, Eric Kampman wrote:
> 
>>Trying to port an SEC driver to Linux/PPC8555. Reading
>>the default CCSRBAR @ 0xFF700000 I read 0xFFFFFFFF
>>which is wrong. Looking at Metrowerks init files and
>>uboot code (1.1.2) I see it's likely been moved to
>>0xE0000000, but I get a seg fault when I try to read
>>there. 
>>
>>So, what am I doing wrong, and even better, how do I
>>at runtime find out where CCSRBAR is? Thanks in
>>advance, and please forgive the likely ignorance, 
>>
>>Eric
>>
> 
> 
> use the get_ccsrbar() function to get the address, then ioremap()
> will be your friend ;)
> 
> HTH
> Gerhard

  parent reply	other threads:[~2005-08-09 15:53 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-08-09 14:04 MPC8555CDS & CCSRBAR Eric Kampman
2005-08-09 14:15 ` Gerhard Jaeger
2005-08-09 14:33   ` Kumar Gala
2005-08-09 15:53   ` Clemens Koller [this message]
2005-08-09 16:04     ` Kim Phillips

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=42F8D186.1030209@anagramm.de \
    --to=clemens.koller@anagramm$(echo .)de \
    --cc=erickampman@yahoo$(echo .)com \
    --cc=g.jaeger@sysgo$(echo .)com \
    --cc=linuxppc-embedded@ozlabs$(echo .)org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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