Subject: Re: r/w operation on vmebus
To: Maxime Kurkdjian <maxunder@choisy.myip.org>
From: Steve Woodford <scw@netbsd.org>
List: port-mvme68k
Date: 08/09/2000 09:42:32
On Tue, 8 Aug 2000, Maxime Kurkdjian wrote:

> i want to read/write to/from the 332xt memory from my mvme167 board
> the board is not the scon. it is another 167.

Whether or not it's the system controller doesn't matter in this case.

> i drop the not scon board in the sys debugger and type this:
> 
> 167-Bug>md ff780000
> FF780000  
> Exception: Access Fault (Local Bus Timeout)
> PC =FF84A7B8 SR =2704
> Format/Vector =7008
> SSW =0145 Fault Address =FF780000 Effective Address =FFE0D804 
> 167-Bug>

I suspect you need to tell 167-Bug to set up the correct VME controller
chip mappings so the VMEbus address space where your 332xt board lives is
visible to the CPU.

Check the documentation for the `ENV' command in section 4 of the 167Bug
user guide (http://www.mcg.mot.com/us/products/docs/pdf/167bug.pdf).
Specifically, pages 4.7 -> 4.11.

Ignore the "Slave [enable|address|control]" sections; NetBSD/mvme68k
doesn't yet support VMEbus slave mode. You need to program up the right
mappings for VMEbus master mode.

Let's assume for now that your 332xt lives in A32 address space. Using the
ENV command, enter the following details (press RETURN for all options
until you reach `Master Enable #1 [Y/N]'):

  Master Enable #1 [Y/N] = Y?            <-- Type Y
  Master Starting Address #1 = 02000000  <-- Press RETURN (accept default)
  Master Ending Address #1 = EFFFFFFF?   <-- Enter FF7FFFFF
  Master Control #1 = 0D?                <-- Enter 0D

Then, go through and enter `N' for the three remaining 'Master Enable #x'
options. Once you've done that, enter a single dot (.) and press
return. If it asks if you want the changes to be saved, respond with `Y'.

Your 332xt _should_ now respond to the `md ff780000' command. If it
doesn't, it's likely that the board lives in A24 address space. Try the
following settings in this case:

  Master Enable #1 [Y/N] = Y?            <-- Type Y
  Master Starting Address #1 = 02000000  <-- Press RETURN (accept default)
  Master Ending Address #1 = FF7FFFFF?   <-- Enter EFFFFFFF
  Master Control #1 = 0D?                <-- Enter 0D
  Master Enable #2 [Y/N] = Y?            <-- Type Y
  Master Starting Address #2 = 00000000  <-- Enter F0000000
  Master Ending Address #2 = 00000000?   <-- Enter F0FFFFFF
  Master Control #2 = 00?                <-- Enter 3D (selects A24 space)

Quit (using `.') and save the changes as before. With the above settings,
your board will now appear in the 167's address space at 0xf0780000 (the
VME controller chip will translate this to the correct A24 address for the
332xt). To verify this, try `md f0780000'.

If neither of the above options work, try using the `;L' option to the
`md' command to force a D32 read instead of the default D16:

  167Bug> md ff780000;l
or
  167Bug> md f0780000;l

NetBSD/mvme68k will automatically pick up the VMEbus master settings you
configured with the `ENV' command, for when you get around to writing a
driver. ;-)

Hope this helps.

Cheers, Steve