linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* MMU and BDI2000
@ 2001-09-14  9:58 Michael Habermann
  2001-09-14 11:29 ` Wolfgang Denk
  0 siblings, 1 reply; 9+ messages in thread
From: Michael Habermann @ 2001-09-14  9:58 UTC (permalink / raw)
  To: linuxppc-embedded


Hello!

I've not found a BDI newsgroup or FAQ so I'm sorry
for a little bit off-topic.

I'm using a BDI 2000 and I can successfully debug the PPCBOOT and the
kernel.

But I've trouble debugging a driver module loaded at runtime. I get the module
address out of the module_list linked list + sizeof_struct and can break
successfully in the driver. After calling add-symbol-file in GDB. Even single
stepping works.

But I get problems debugging variables. The BDI often prints:
'*** MMU: address translation for 0xC100B288 failed',
and most variables I cannot see. Also entering 'phy 0xC100B288' at the BDI
returns:
'# PPC: MMU address translation failed'

The system works without problems, so the MMU seems to work. Only the BDI
cannot translate it in some cases.

What is wrong?

I'm using a FADS860, PPCBoot and the kernel 2.4.4 from ftp.denx.de.

The INIT and TARGET sections of my BDI config file are:

[INIT]
WSPR	149	0xFDC3000F      ;DER  : set debug enable register
WSPR	638	0xFF000000      ;IMMR : internal memory at 0xFF000000
WSPR	158	0x00000007      ;ICTRL:
WSPR	796	0x00000000	;M_TWB invalidate TWB
WM32		0x000000f0	0x00000000	;invalidate page table base (PTBASE)
WM32    	0xFF000004      0xFFFFFF88      ;SYPCR


[TARGET]
CPUTYPE	    MPC800
CPUCLOCK    25000000    ;the CPU clock rate after processing the init list
BDIMODE     AGENT       ;the BDI working mode (LOADONLY | AGENT)
BREAKMODE   HARD        ;SOFT or HARD, HARD uses PPC hardware breakpoints
MMU XLAT


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

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

* Re: MMU and BDI2000
  2001-09-14  9:58 MMU and BDI2000 Michael Habermann
@ 2001-09-14 11:29 ` Wolfgang Denk
  2001-09-14 18:31   ` Dan Malek
  0 siblings, 1 reply; 9+ messages in thread
From: Wolfgang Denk @ 2001-09-14 11:29 UTC (permalink / raw)
  To: Michael Habermann; +Cc: linuxppc-embedded


In message <5.1.0.14.0.20010914174808.026db880@pop.gmx.de> you wrote:
>
> I've not found a BDI newsgroup or FAQ so I'm sorry

Maybe we should start a mailing list.

> But I get problems debugging variables. The BDI often prints:
> '*** MMU: address translation for 0xC100B288 failed',
...
> [TARGET]
> CPUTYPE	    MPC800
> CPUCLOCK    25000000    ;the CPU clock rate after processing the init list
> BDIMODE     AGENT       ;the BDI working mode (LOADONLY | AGENT)
> BREAKMODE   HARD        ;SOFT or HARD, HARD uses PPC hardware breakpoints
> MMU XLAT

Are you using latest BDI2000 firmware?

I'm missing a PTBASE definition in this section  -  without  it  only
default  translation  is  enabled.  See  the  BDI2000  user's manual,
Section "3.2.2 Part [TARGET]" (Entries "MMU XLAT  [kb]"  and  "PTBASE
addr") and Section "3.3.4 Embedded Linux MMU Support".

Please note that the 2.4.4 kernel on our  FTP  server  does  not  yet
include  the  automatic  update  of  the  BDI  page table information
structure mentioned in the BDI2000 manual. We will have this  in  the
next version (as soon as it's running stable).

Wolfgang Denk

--
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-4596-87  Fax: (+49)-8142-4596-88  Email: wd@denx.de
Is a computer language with goto's totally Wirth-less?

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

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

* Re: MMU and BDI2000
  2001-09-14 11:29 ` Wolfgang Denk
@ 2001-09-14 18:31   ` Dan Malek
  0 siblings, 0 replies; 9+ messages in thread
From: Dan Malek @ 2001-09-14 18:31 UTC (permalink / raw)
  To: Wolfgang Denk; +Cc: Michael Habermann, linuxppc-embedded


Wolfgang Denk wrote:

> Maybe we should start a mailing list.

Probably not a bad idea.....

> Are you using latest BDI2000 firmware?

I've had some troubles myself recently with the latest BDI firmware.
Since I instigated these changes and worked with Abatron to ensure
they work correctly, I'll continue to do so.  I'm pretty certain
it is something I am doing wrong, because it has worked correctly
in the past.


	-- Dan

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

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

* Re: MMU and BDI2000
       [not found] ` <5.1.0.14.0.20010915223300.02bef9f0@pop.gmx.de>
@ 2001-09-15 15:17   ` Wolfgang Denk
  2001-09-15 22:20   ` Dan Malek
  1 sibling, 0 replies; 9+ messages in thread
From: Wolfgang Denk @ 2001-09-15 15:17 UTC (permalink / raw)
  To: Michael Habermann; +Cc: linuxppc-embedded


In message <5.1.0.14.0.20010915223300.02bef9f0@pop.gmx.de> you wrote:
>
> >default  translation  is  enabled.  See  the  BDI2000  user's manual,
> >Section "3.2.2 Part [TARGET]" (Entries "MMU XLAT  [kb]"  and  "PTBASE
> >addr") and Section "3.3.4 Embedded Linux MMU Support".
>
> You have no idea how often I had read this and I couldn't even find out if
> it belongs to my problem.
>
> How do I get the swapper_pg_dir? Is it the constant address from System.map?

You need the contents, like that:

(gdb) target remote bdi:2001
Remote debugging using bdi:2001
0x100 in ?? ()
(gdb) b start_here
Breakpoint 1 at 0xc0002180
(gdb) c
Continuing.

Breakpoint 1, 0xc0002180 in start_here ()
(gdb) p &swapper_pg_dir
$1 = (<data variable, no debug info> *) 0xc0130000


Now at the BDI2000 telnet prompt:

BDI>mm 0xf0 0xc0130000


And the again with GDB;

(gdb) c
Continuing.


Wolfgang Denk

--
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-4596-87  Fax: (+49)-8142-4596-88  Email: wd@denx.de
I've got to get something inside me. Some coffee  or  something.  And
then the world will somehow be better.
                                     - Terry Pratchett, _Men at Arms_

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

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

* Re: MMU and BDI2000
       [not found] ` <5.1.0.14.0.20010915223300.02bef9f0@pop.gmx.de>
  2001-09-15 15:17   ` Wolfgang Denk
@ 2001-09-15 22:20   ` Dan Malek
  1 sibling, 0 replies; 9+ messages in thread
From: Dan Malek @ 2001-09-15 22:20 UTC (permalink / raw)
  To: Michael Habermann; +Cc: Wolfgang Denk, linuxppc-embedded


Michael Habermann wrote:

> How do I get the swapper_pg_dir? Is it the constant address from System.map?

Ooops...You shouldn't have seen any version of the software that makes
any
reference to swapper_pg_dir.....

The configuration file you attached looks fine for the recent 2.4
kernels.
If you want to backtrace into the currently running application (useful
for system call parameters), ensure you enable the 'CONFIG_BDI_SWITCH'
option.  I left it disabled by default because it adds three
instructions
to the context switch overhead.


	-- Dan

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

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

* RE: MMU and BDI2000
@ 2001-12-13  2:43 Subodh Nijsure
  2001-12-13  6:15 ` Dan Malek
  0 siblings, 1 reply; 9+ messages in thread
From: Subodh Nijsure @ 2001-12-13  2:43 UTC (permalink / raw)
  To: 'Wolfgang Denk', Michael Habermann; +Cc: linuxppc-embedded


Hello,

I have kernel 2.4.4 and I do have MMU XLAT and latest BDI firmware from
Abatron
and I am  not able to get translation to work. I have tried the following

target remote bdi:2001
b start_here

p &swapper_pg_dir

then at BDI2000 telnet prompt,

mm 0xf0 <address_swapper_pg_dir>

that didn't help.

I got the latest 2.4 _devel kernel and there are lot of changes that I need
to merge into my source, I was looking for a short term fix to get
translation
to work. Has anybody gotten gdb to work correctly with Abatron 2000 on linux
2.4.4 kernel?


/Subodh

-----Original Message-----
From: Wolfgang Denk [mailto:wd@denx.de]
Sent: Friday, September 14, 2001 4:30 AM
To: Michael Habermann
Cc: linuxppc-embedded@lists.linuxppc.org
Subject: Re: MMU and BDI2000



In message <5.1.0.14.0.20010914174808.026db880@pop.gmx.de> you wrote:
>
> I've not found a BDI newsgroup or FAQ so I'm sorry

Maybe we should start a mailing list.

> But I get problems debugging variables. The BDI often prints:
> '*** MMU: address translation for 0xC100B288 failed',
...
> [TARGET]
> CPUTYPE	    MPC800
> CPUCLOCK    25000000    ;the CPU clock rate after processing the init list
> BDIMODE     AGENT       ;the BDI working mode (LOADONLY | AGENT)
> BREAKMODE   HARD        ;SOFT or HARD, HARD uses PPC hardware breakpoints
> MMU XLAT

Are you using latest BDI2000 firmware?

I'm missing a PTBASE definition in this section  -  without  it  only
default  translation  is  enabled.  See  the  BDI2000  user's manual,
Section "3.2.2 Part [TARGET]" (Entries "MMU XLAT  [kb]"  and  "PTBASE
addr") and Section "3.3.4 Embedded Linux MMU Support".

Please note that the 2.4.4 kernel on our  FTP  server  does  not  yet
include  the  automatic  update  of  the  BDI  page table information
structure mentioned in the BDI2000 manual. We will have this  in  the
next version (as soon as it's running stable).

Wolfgang Denk

--
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-4596-87  Fax: (+49)-8142-4596-88  Email: wd@denx.de
Is a computer language with goto's totally Wirth-less?


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

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

* Re: MMU and BDI2000
  2001-12-13  2:43 Subodh Nijsure
@ 2001-12-13  6:15 ` Dan Malek
  0 siblings, 0 replies; 9+ messages in thread
From: Dan Malek @ 2001-12-13  6:15 UTC (permalink / raw)
  To: Subodh Nijsure
  Cc: 'Wolfgang Denk', Michael Habermann, linuxppc-embedded


Subodh Nijsure wrote:



> I have kernel 2.4.4 and I do have MMU XLAT and latest BDI firmware from
> Abatron

Can you use a newer kernel that will do all of this for you automatically?

> and I am  not able to get translation to work. I have tried the following

That isn't correct with the latest BDI firmware.  The address at 0xf0 is
not the address of the page table, it is an indirect pointer to an array
of page table root pointers.  Later kernels will set up all of this for you.

We unfortunately had a short-lived version of kernel and BDI2000 that did
use the low address as a pointer to the kernel page tables, but this isn't
done any longer.

Thanks.


-- Dan


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

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

* RE: MMU and BDI2000
@ 2001-12-13  7:48 Goddeeris Frederic
  0 siblings, 0 replies; 9+ messages in thread
From: Goddeeris Frederic @ 2001-12-13  7:48 UTC (permalink / raw)
  To: 'Dan Malek '; +Cc: 'linuxppc-embedded@lists.linuxppc.org '


Hi Dan,

I am not sure I fully understand what you mean.

I have a BDI with MMU translation working. I patched the head_8xx.h of a
MontaVista 2.4.2 kernel
	lis			r5,	abatron_pteptrs@h
	ori			r5, r5, abatron_pteptrs@l
	stw			r5, 0xf0(r0)
	lis			r6, swapper_pg_dir@h
	ori			r6, r6, swapper_pg_dir@l
	tophys	(r5,r5)
	stw			r6, 0(r5)
and
_GLOBAL(set_context)
	lis	r5, KERNELBASE@h
	lwz	r5, 0xf0(r5)
	stw	r4, 0x4(r5)

The BDM sw is b20ppcgd.109

Yesterday evening I installed the later version b20ppcgd.110. After reading
your mail, I tested debugging again and yes it looks like MMU translation no
longer works correctly.

So, this newer version of BDM sw, uses another mechanism? I do not see any
of this mentioned in the newer version of the manual?!? In order to have it
working with this new version, is it just another patch for head_8xx.h or is
it more complex?

Thanks,
Frederic

-----Original Message-----
From: Dan Malek
To: Subodh Nijsure
Cc: 'Wolfgang Denk'; Michael Habermann; linuxppc-embedded@lists.linuxppc.org
Sent: 12/13/01 7:15 AM
Subject: Re: MMU and BDI2000


Subodh Nijsure wrote:



> I have kernel 2.4.4 and I do have MMU XLAT and latest BDI firmware
from
> Abatron
\x1a\x1a\x1a\x1a
Can you use a newer kernel that will do all of this for you
automatically?

> and I am  not able to get translation to work. I have tried the
following

That isn't correct with the latest BDI firmware.  The address at 0xf0 is
not the address of the page table, it is an indirect pointer to an array
of page table root pointers.  Later kernels will set up all of this for
you.

We unfortunately had a short-lived version of kernel and BDI2000 that
did
use the low address as a pointer to the kernel page tables, but this
isn't
done any longer.

Thanks.


-- Dan


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

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

* RE: MMU and BDI2000
@ 2001-12-16 22:14 Rudolf Ladyzhenskii
  0 siblings, 0 replies; 9+ messages in thread
From: Rudolf Ladyzhenskii @ 2001-12-16 22:14 UTC (permalink / raw)
  To: 'Subodh Nijsure', Linuxppc-Embedded (E-mail)


Hi,

I had same problem and used Dan's suggestion to get it working. Here is an
extract from his e-mail:

Add this right after the 'bl load_up_mmu':


        /* Add helper information for the Abatron bdiGDB debugger.
         * We do this here because we know the mmu is disabled, and
         * will be enabled for real in just a few instructions.
         */
        lis     r5, abatron_pteptrs@h
        ori     r5, r5, abatron_pteptrs@l
        stw     r5, 0xf0(r0)    /* This much match your Abatron config */
        lis     r6, swapper_pg_dir@h
        ori     r6, r6, swapper_pg_dir@l
        tophys(r5, r5)
        stw     r6, 0(r5)

You also have to define abatron_pteptrs as global.
This works fine on the 8260 with 2.4.4 kernel.

Rudolf


> -----Original Message-----
> From: Subodh Nijsure [mailto:SNijsure@SkyStream.com]
> Sent: Thursday, December 13, 2001 1:43 PM
> To: 'Wolfgang Denk'; Michael Habermann
> Cc: linuxppc-embedded@lists.linuxppc.org
> Subject: RE: MMU and BDI2000
>
>
>
> Hello,
>
> I have kernel 2.4.4 and I do have MMU XLAT and latest BDI
> firmware from
> Abatron
> and I am  not able to get translation to work. I have tried
> the following
>
> target remote bdi:2001
> b start_here
>
> p &swapper_pg_dir
>
> then at BDI2000 telnet prompt,
>
> mm 0xf0 <address_swapper_pg_dir>
>
> that didn't help.
>
> I got the latest 2.4 _devel kernel and there are lot of
> changes that I need
> to merge into my source, I was looking for a short term fix to get
> translation
> to work. Has anybody gotten gdb to work correctly with
> Abatron 2000 on linux
> 2.4.4 kernel?
>
>
> /Subodh
>
> -----Original Message-----
> From: Wolfgang Denk [mailto:wd@denx.de]
> Sent: Friday, September 14, 2001 4:30 AM
> To: Michael Habermann
> Cc: linuxppc-embedded@lists.linuxppc.org
> Subject: Re: MMU and BDI2000
>
>
>
> In message <5.1.0.14.0.20010914174808.026db880@pop.gmx.de> you wrote:
> >
> > I've not found a BDI newsgroup or FAQ so I'm sorry
>
> Maybe we should start a mailing list.
>
> > But I get problems debugging variables. The BDI often prints:
> > '*** MMU: address translation for 0xC100B288 failed',
> ...
> > [TARGET]
> > CPUTYPE	    MPC800
> > CPUCLOCK    25000000    ;the CPU clock rate after
> processing the init list
> > BDIMODE     AGENT       ;the BDI working mode (LOADONLY | AGENT)
> > BREAKMODE   HARD        ;SOFT or HARD, HARD uses PPC
> hardware breakpoints
> > MMU XLAT
>
> Are you using latest BDI2000 firmware?
>
> I'm missing a PTBASE definition in this section  -  without  it  only
> default  translation  is  enabled.  See  the  BDI2000  user's manual,
> Section "3.2.2 Part [TARGET]" (Entries "MMU XLAT  [kb]"  and  "PTBASE
> addr") and Section "3.3.4 Embedded Linux MMU Support".
>
> Please note that the 2.4.4 kernel on our  FTP  server  does  not  yet
> include  the  automatic  update  of  the  BDI  page table information
> structure mentioned in the BDI2000 manual. We will have this  in  the
> next version (as soon as it's running stable).
>
> Wolfgang Denk
>
> --
> Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
> Phone: (+49)-8142-4596-87  Fax: (+49)-8142-4596-88  Email: wd@denx.de
> Is a computer language with goto's totally Wirth-less?
>
>

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

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

end of thread, other threads:[~2001-12-16 22:14 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-09-14  9:58 MMU and BDI2000 Michael Habermann
2001-09-14 11:29 ` Wolfgang Denk
2001-09-14 18:31   ` Dan Malek
     [not found] <Your message of "Fri, 14 Sep 2001 17:58:29 +0800." <5.1.0.14.0.20010914174808.026db880@pop.gmx.de>
     [not found] ` <5.1.0.14.0.20010915223300.02bef9f0@pop.gmx.de>
2001-09-15 15:17   ` Wolfgang Denk
2001-09-15 22:20   ` Dan Malek
  -- strict thread matches above, loose matches on Subject: below --
2001-12-13  2:43 Subodh Nijsure
2001-12-13  6:15 ` Dan Malek
2001-12-13  7:48 Goddeeris Frederic
2001-12-16 22:14 Rudolf Ladyzhenskii

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