* 64 bit bus access on a customed MPC8245 board
@ 2004-01-28 3:47 Shawn Jin
2004-01-28 15:48 ` Eric W. Biederman
0 siblings, 1 reply; 5+ messages in thread
From: Shawn Jin @ 2004-01-28 3:47 UTC (permalink / raw)
To: linux-mtd
[-- Attachment #1: Type: text/plain, Size: 1348 bytes --]
Hi,
I'm working on a customed MPC8245 board with flash
chip Am29LV320 and trying to enable MTD driver
support.
The configuration is 32 bit bus width in each chip
with 2 chips interleaved. So CONFIG_MTD_CFI_B8 and
CONFIG_MTD_CFI_I2 are defined.
MPC8245 requires the following memory mapping:
bank 0: 0xFF800000 - 0xFFFFFFFF
bank 1: 0xFF000000 - 0xFF7FFFFF
I noticed that FPU must be enabled for 64-bit
read/write from/to flash.
I use read64() and write64() functions in the
attachment, which are copied from sbc8240.c. However
no chip can be found. Any suggestions? Thank you very
much.
The message is shown below.
mpc8245:Probing 0x00800000 at 0xff800000
mpc8245_write64 adr 0xff800000 data 0x000000f0000000f0
mpc8245_write64 adr 0xff8002a8 data 0x0000009800000098
mpc8245_read64 ofs 0xff800080 result
0xffffffffffffffff
CFI: Found no mpc8245 Flash Bank #0 device at location
zero
mpc8245:Probing 0x00800000 at 0xff000000
mpc8245_write64 adr 0xff000000 data 0x000000f0000000f0
mpc8245_write64 adr 0xff0002a8 data 0x0000009800000098
mpc8245_read64 ofs 0xff000080 result
0xffffffffffffffff
CFI: Found no MPC8245 Flash Bank #1 device at location
zero
mpc8245:No suppported flash chips found!
-Shawn.
__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free web site building tool. Try it!
http://webhosting.yahoo.com/ps/sb/
[-- Attachment #2: flash.c --]
[-- Type: application/octet-stream, Size: 1782 bytes --]
__u64 mpc8245_read64(struct map_info *map, unsigned long ofs)
{
unsigned long flags, msr, saved_msr;
volatile unsigned long *p;
save_flags(flags);
cli();
/* turn off floating point unavailable exceptions */
__asm__ __volatile__ (
"mfmsr %0"
: "=r" (msr) :);
saved_msr = msr;
msr |= MSR_FP;
msr &= ~(MSR_FE0 | MSR_FE1);
__asm__ __volatile__ (
"mtmsr %0\n"
"isync\n"
: : "r" (msr));
/* read the data via a floating point register */
ofs = map->map_priv_1 + ofs;
p = (unsigned long *) &result64;
__asm__ __volatile__ (
"lfd 1,0(%1)\n"
"stfd 1,0(%0)\n"
: : "r" (p), "r" (ofs)
);
/* restore state */
__asm__ __volatile__ (
"mtmsr %0\n"
"isync\n"
: : "r" (saved_msr));
restore_flags(flags);
p = (unsigned long *) &result64;
debugk("mpc8245_read64 ofs 0x%x result 0x%08x%08x\n", ofs, *p, *(p+1));
return result64;
}
void mpc8245_write64(struct map_info *map, __u64 d, unsigned long adr)
{
unsigned long long tmp;
unsigned long flags, msr, saved_msr, *p;
volatile long saved_fr[2];
save_flags(flags);
cli();
/* turn off floating point unavailable exceptions */
__asm__ __volatile__ (
"mfmsr %0"
: "=r" (msr) :);
saved_msr = msr;
msr |= MSR_FP;
msr &= ~(MSR_FE0 | MSR_FE1);
__asm__ __volatile__ (
"mtmsr %0\n"
"isync\n"
: : "r" (msr));
/* write the data via a floating point register */
tmp = d;
p = (unsigned long *) &tmp;
adr = map->map_priv_1 + adr;
debugk("mpc8245_write64 adr 0x%x data 0x%08x%08x\n", adr, *p, *(p+1));
__asm__ __volatile__ (
"stfd 1,0(%2)\n"
"lfd 1,0(%0)\n"
"stfd 1,0(%1)\n"
"lfd 1,0(%2)\n"
: : "r" (p), "r" (adr), "b" (saved_fr)
);
/* restore state */
__asm__ __volatile__ (
"mtmsr %0\n"
"isync\n"
: : "r" (saved_msr));
restore_flags(flags);
}
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: 64 bit bus access on a customed MPC8245 board
2004-01-28 3:47 64 bit bus access on a customed MPC8245 board Shawn Jin
@ 2004-01-28 15:48 ` Eric W. Biederman
2004-01-28 15:59 ` David Woodhouse
0 siblings, 1 reply; 5+ messages in thread
From: Eric W. Biederman @ 2004-01-28 15:48 UTC (permalink / raw)
To: Shawn Jin; +Cc: linux-mtd
Shawn Jin <shawnxtech@yahoo.com> writes:
> Hi,
>
> I'm working on a customed MPC8245 board with flash
> chip Am29LV320 and trying to enable MTD driver
> support.
The MPC8245 is an embedded ppc processor.
??
I looked and I can't find documentation for that chip.
Is it an atmel one?
Chips with similar part numbers are 8 bit flash. Atmel
does make a few 16bit flash parts. And I don't know
if Atmel does cfi? You may need jedec_probe.
> The configuration is 32 bit bus width in each chip
> with 2 chips interleaved. So CONFIG_MTD_CFI_B8 and
> CONFIG_MTD_CFI_I2 are defined.
Ok so you have configured it for 2 8bit chips that are
interleaved to form a 16bit path.
> MPC8245 requires the following memory mapping:
> bank 0: 0xFF800000 - 0xFFFFFFFF
> bank 1: 0xFF000000 - 0xFF7FFFFF
>
> I noticed that FPU must be enabled for 64-bit
> read/write from/to flash.
But that is not even interesting if you are only 16bits wide.
> I use read64() and write64() functions in the
> attachment, which are copied from sbc8240.c. However
> no chip can be found. Any suggestions? Thank you very
> much.
I suggest you focus on read16()/write16().
Eric
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: 64 bit bus access on a customed MPC8245 board
2004-01-28 15:48 ` Eric W. Biederman
@ 2004-01-28 15:59 ` David Woodhouse
2004-01-28 17:58 ` Shawn Jin
2004-01-28 18:39 ` Shawn Jin
0 siblings, 2 replies; 5+ messages in thread
From: David Woodhouse @ 2004-01-28 15:59 UTC (permalink / raw)
To: Eric W. Biederman; +Cc: Shawn Jin, linux-mtd
On Wed, 2004-01-28 at 08:48 -0700, Eric W. Biederman wrote:
> Shawn Jin <shawnxtech@yahoo.com> writes:
> > I'm working on a customed MPC8245 board with flash
> > chip Am29LV320 and trying to enable MTD driver
> > support.
> I looked and I can't find documentation for that chip.
> Is it an atmel one?
http://www.amd.com/us-en/assets/content_type/white_papers_and_tech_docs/26518.pdf
It's 16-bit, CFI-compliant, and (obviously) AMD command set.
> > The configuration is 32 bit bus width in each chip
> > with 2 chips interleaved. So CONFIG_MTD_CFI_B8 and
> > CONFIG_MTD_CFI_I2 are defined.
Not possible. Refer back to your documentation. The chip is not capable
of 32-bit operation. You probably mean 16*2, which means you want to
enable CFI_B4 and CFI_I2. But it would be better just to turn off the
advanced options and let it work it out for itself.
> Ok so you have configured it for 2 8bit chips that are
> interleaved to form a 16bit path.
B8 is 8-byte, not 8-bit. It's buswidth. He configured it to 2 32-bit
chips in a 64-bit path, which isn't correct.
--
dwmw2
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: 64 bit bus access on a customed MPC8245 board
2004-01-28 15:59 ` David Woodhouse
@ 2004-01-28 17:58 ` Shawn Jin
2004-01-28 18:39 ` Shawn Jin
1 sibling, 0 replies; 5+ messages in thread
From: Shawn Jin @ 2004-01-28 17:58 UTC (permalink / raw)
To: David Woodhouse, Eric W. Biederman; +Cc: linux-mtd
> > > I'm working on a customed MPC8245 board with
> flash
> > > chip Am29LV320 and trying to enable MTD driver
> > > support.
>
> > I looked and I can't find documentation for that
> chip.
> > Is it an atmel one?
>
>
http://www.amd.com/us-en/assets/content_type/white_papers_and_tech_docs/26518.pdf
>
> It's 16-bit, CFI-compliant, and (obviously) AMD
> command set.
Sorry for this mistake. I mean Am29PL320D, which is
here
(http://www.amd.com/us-en/assets/content_type/white_papers_and_tech_docs/24075.pdf).
And it's 32-bit, CFI-complaint.
-Shawn.
__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free web site building tool. Try it!
http://webhosting.yahoo.com/ps/sb/
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: 64 bit bus access on a customed MPC8245 board
2004-01-28 15:59 ` David Woodhouse
2004-01-28 17:58 ` Shawn Jin
@ 2004-01-28 18:39 ` Shawn Jin
1 sibling, 0 replies; 5+ messages in thread
From: Shawn Jin @ 2004-01-28 18:39 UTC (permalink / raw)
To: David Woodhouse, Eric W. Biederman; +Cc: linux-mtd
> > > I'm working on a customed MPC8245 board with
> flash
> > > chip Am29LV320 and trying to enable MTD driver
> > > support.
>
> > I looked and I can't find documentation for that
> chip.
> > Is it an atmel one?
>
>
http://www.amd.com/us-en/assets/content_type/white_papers_and_tech_docs/26518.pdf
>
> It's 16-bit, CFI-compliant, and (obviously) AMD
> command set.
>
Further clarification: It's Am29PL320D, which is
configured to 32-bit mode.
Thank you very much,
-Shawn.
__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free web site building tool. Try it!
http://webhosting.yahoo.com/ps/sb/
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2004-01-28 18:39 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-01-28 3:47 64 bit bus access on a customed MPC8245 board Shawn Jin
2004-01-28 15:48 ` Eric W. Biederman
2004-01-28 15:59 ` David Woodhouse
2004-01-28 17:58 ` Shawn Jin
2004-01-28 18:39 ` Shawn Jin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox