linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* 405EP peripheral bus
@ 2003-11-19 20:43 Paul Miller
  2003-11-20  8:52 ` Juergen Beisert
  0 siblings, 1 reply; 3+ messages in thread
From: Paul Miller @ 2003-11-19 20:43 UTC (permalink / raw)
  To: Embedded PPC


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/

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: 405EP peripheral bus
  2003-11-19 20:43 405EP peripheral bus Paul Miller
@ 2003-11-20  8:52 ` Juergen Beisert
  2003-11-21 20:13   ` Paul Miller
  0 siblings, 1 reply; 3+ messages in thread
From: Juergen Beisert @ 2003-11-20  8:52 UTC (permalink / raw)
  To: Paul Miller; +Cc: Embedded PPC


Am Mittwoch, 19. November 2003 21:43 schrieb Paul Miller:

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

How many RAM is in your System? Less than 64MiB? Or more? Maybe there is an
overlapping?

JB


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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: 405EP peripheral bus
  2003-11-20  8:52 ` Juergen Beisert
@ 2003-11-21 20:13   ` Paul Miller
  0 siblings, 0 replies; 3+ messages in thread
From: Paul Miller @ 2003-11-21 20:13 UTC (permalink / raw)
  To: jbeisert; +Cc: Embedded PPC


Intrinsyc will not provide the physical address locations for anything
on their board, which is ridiculous.  I have determined, based on the
DCR registers, that the following memory addresses are used:

SDRAM is located at 0x00000000 with 32MB size.
(NOR??) located at 0xFFE000000 with size 2MB
(NAND??) located at 0x60000000 with size  1MB

Based on Intrinsyc's code, they appear to use 0x60000000 as the base
address for the NAND flash, but the register reads a 1MB size instead
of 32MB.  I suspect the other location is the NOR flash.

So now I'm trying to use address 0x04000000 with CS2\.

How do I map the phyiscal address?


/* EBC0 Registers */
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

/* SDRAM0 Registers */
SDRAM0_CFG   : 0x80a00000
SDRAM0_STATUS: 0x80000000
SDRAM0_RTR   : 0x07e80000
SDRAM0_PMIT  : 0x07c00000
SDRAM0_B0CR  : 0x00062001
SDRAM0_B1CR  : 0x00000000
SDRAM0_TR    : 0x010bc01b

Setting up EBC registers...
EBC0_B2CR: 0x0403a000
EBC0_B2AP: 0x04002480

Thanks!
-Paul


On Thursday 20 November 2003 2:52 am, Juergen Beisert wrote:
> Am Mittwoch, 19. November 2003 21:43 schrieb Paul Miller:
> > and I changed B0CR to 0x0043a000 and I'm trying to use mmap like:
>
> How many RAM is in your System? Less than 64MiB? Or more? Maybe there
> is an overlapping?
>
> JB
>
>

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2003-11-21 20:13 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-11-19 20:43 405EP peripheral bus Paul Miller
2003-11-20  8:52 ` Juergen Beisert
2003-11-21 20:13   ` Paul Miller

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