linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Paul Miller <pmiller9@users.sourceforge.net>
To: Embedded PPC <linuxppc-embedded@lists.linuxppc.org>
Subject: 405EP peripheral bus
Date: Wed, 19 Nov 2003 14:43:16 -0600	[thread overview]
Message-ID: <200311191443.16246.pmiller9@users.sourceforge.net> (raw)


Has anyone messed around with accessing the peripheral bus on a 405EP PPC?  I've already written a driver to allow me to read/write to the EBC (external bus control) registers from userspace, but I can't seem to toggle CS0\, OE\, R/W, etc.  Is there anything special about CS0\ (after boot)?

By default, Intrinsyc/Linux sets ups the EBC registers as follows:

EBC0_B0CR  : 0xffe3a000
EBC0_B1CR  : 0x60018000
EBC0_B2CR  : 0x00000000
EBC0_B3CR  : 0x00000000
EBC0_B4CR  : 0x00000000
EBC0_B0AP  : 0x04002480
EBC0_B1AP  : 0x04005480
EBC0_B2AP  : 0x00000000
EBC0_B3AP  : 0x00000000
EBC0_B4AP  : 0x00000000
EBC0_BEAR  : 0x00000000
EBC0_BESR0 : 0x00000000
EBC0_BESR1 : 0x00000000
EBC0_CFG   : 0x80400000

and I changed B0CR to 0x0043a000 and I'm trying to use mmap like:

#define MAP_BASE		(0x00400000)
#define MAP_LENGTH	0x10
#define MAP_PROT		(PROT_READ | PROT_WRITE)
#define MAP_FLAGS		(MAP_SHARED)

volatile unsigned char *init_map(int *file)
{
	volatile unsigned char *map;

	if ((*file = open("/dev/mem", O_RDWR | O_SYNC)) == -1) {
		puts("Failure opening device.");
		return NULL;
	}

	map = (unsigned char *) mmap(NULL, MAP_LENGTH, MAP_PROT, MAP_FLAGS, *file, MAP_BASE);
	if (map == (void *) -1) {
		puts("Failure mapping memory.");
		close(*file);
		return NULL;
	}

	return map;
}

then reading/writing to the returned map address.  ... any suggestions?

I have an oscilloscope and digital logical analyzer available to probe signals.

Thanks!
-Paul

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

             reply	other threads:[~2003-11-19 20:43 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-11-19 20:43 Paul Miller [this message]
2003-11-20  8:52 ` 405EP peripheral bus Juergen Beisert
2003-11-21 20:13   ` Paul Miller

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=200311191443.16246.pmiller9@users.sourceforge.net \
    --to=pmiller9@users.sourceforge.net \
    --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 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).