9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* Re: [9fans] The late upamalloc
@ 2008-09-27 16:02 erik quanstrom
  0 siblings, 0 replies; 5+ messages in thread
From: erik quanstrom @ 2008-09-27 16:02 UTC (permalink / raw)
  To: blstuart, 9fans

> Okay, I've been taking a crack at the broadcom driver
> that's been lying around.  It's pretty old and used
> the upamalloc call.  But upamalloc is now gone and
> I don't seem to be able to find the right way to
> replace it.  After looking at other drivers and at
> the old upamalloc code on sourcesdump, I've tried
> several way to replace it, but most end up in a panic.
> The original code (edited to the relevant lines)
> looked like:
>
> port = upamalloc(bar & ~0x0F, p->mem[0].size, 0);
> ctlr->port = port;
> ctlr->nic = KADDR(ctlr->port);
>
> My most recent attempt replaced the upamalloc call
> with:
>
> upareserve(bar & ~0x0F, p->mem[0].size);
> pdbmap(MACH(0)->pdb, bar & ~0x0F, 0, p->mem[0].size);
> port = bar & ~0x0F;
>
> There is currently a upaalloc call, and the comment
> to it seems to imply that vmap should be used either
> in conjunction with upaalloc or by it self.  I've
> tried a few permutations of that with no luck.
>
> If someone knows off the top of their head the right
> way to replace an old upamalloc call, it would save
> me some time, and I could get on to seeing if I can
> manage to get the controller to work.
>

upamalloc should be replaced with vmap.  but be careful.
the address returned is a virtual kernel address.  so anyone
assuming that the address returned is going to be a physical
address is going to loose.  i think you wish

	ctlr->nic = vmap(p->mem[Abar].bar & ~0xf, p->mem[0].size);
	ctlr->port = PCIWADDR(ctlr->nic);

- erik



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

* Re: [9fans] The late upamalloc
  2008-09-27 19:50 ` Uriel
@ 2008-09-29 14:37   ` Brian L. Stuart
  0 siblings, 0 replies; 5+ messages in thread
From: Brian L. Stuart @ 2008-09-29 14:37 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

> If you are working on the driver in my contrib dir, there are probably
> newer versions of it somewhere, but don't ask me where you could find
> them or who might have them, I don't even remember where I got that
> one from.

I think that's the one I started with.

> As far as I know some of the broadcom work was done together with the
> amd64 port, so good luck getting hold of that, hahaha.

Jim sent me one that's a little farther along, but not a lot
farther.  It did get me to the point where I can initialize
the controller.  But I've still got a ways to go on getting
it to actually communicate.

Thanks,
BLS




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

* Re: [9fans] The late upamalloc
  2008-09-27 15:43 Brian L. Stuart
  2008-09-27 16:03 ` erik quanstrom
@ 2008-09-27 19:50 ` Uriel
  2008-09-29 14:37   ` Brian L. Stuart
  1 sibling, 1 reply; 5+ messages in thread
From: Uriel @ 2008-09-27 19:50 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

If you are working on the driver in my contrib dir, there are probably
newer versions of it somewhere, but don't ask me where you could find
them or who might have them, I don't even remember where I got that
one from.

As far as I know some of the broadcom work was done together with the
amd64 port, so good luck getting hold of that, hahaha.

Pace

uriel

On Sat, Sep 27, 2008 at 5:43 PM, Brian L. Stuart <blstuart@bellsouth.net> wrote:
> Okay, I've been taking a crack at the broadcom driver
> that's been lying around.  It's pretty old and used
> the upamalloc call.  But upamalloc is now gone and
> I don't seem to be able to find the right way to
> replace it.  After looking at other drivers and at
> the old upamalloc code on sourcesdump, I've tried
> several way to replace it, but most end up in a panic.
> The original code (edited to the relevant lines)
> looked like:
>
> port = upamalloc(bar & ~0x0F, p->mem[0].size, 0);
> ctlr->port = port;
> ctlr->nic = KADDR(ctlr->port);
>
> My most recent attempt replaced the upamalloc call
> with:
>
> upareserve(bar & ~0x0F, p->mem[0].size);
> pdbmap(MACH(0)->pdb, bar & ~0x0F, 0, p->mem[0].size);
> port = bar & ~0x0F;
>
> There is currently a upaalloc call, and the comment
> to it seems to imply that vmap should be used either
> in conjunction with upaalloc or by it self.  I've
> tried a few permutations of that with no luck.
>
> If someone knows off the top of their head the right
> way to replace an old upamalloc call, it would save
> me some time, and I could get on to seeing if I can
> manage to get the controller to work.
>
> Thanks in advance,
> BLS
>
>



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

* Re: [9fans] The late upamalloc
  2008-09-27 15:43 Brian L. Stuart
@ 2008-09-27 16:03 ` erik quanstrom
  2008-09-27 19:50 ` Uriel
  1 sibling, 0 replies; 5+ messages in thread
From: erik quanstrom @ 2008-09-27 16:03 UTC (permalink / raw)
  To: 9fans

uh, cut-n-paste error... that should be

	ctlr->nic = vmap(p->mem[0].bar & ~0xf, p->mem[0].size);
	ctlr->port = PCIWADDR(ctlr->nic);

- erik



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

* [9fans] The late upamalloc
@ 2008-09-27 15:43 Brian L. Stuart
  2008-09-27 16:03 ` erik quanstrom
  2008-09-27 19:50 ` Uriel
  0 siblings, 2 replies; 5+ messages in thread
From: Brian L. Stuart @ 2008-09-27 15:43 UTC (permalink / raw)
  To: 9fans

Okay, I've been taking a crack at the broadcom driver
that's been lying around.  It's pretty old and used
the upamalloc call.  But upamalloc is now gone and
I don't seem to be able to find the right way to
replace it.  After looking at other drivers and at
the old upamalloc code on sourcesdump, I've tried
several way to replace it, but most end up in a panic.
The original code (edited to the relevant lines)
looked like:

port = upamalloc(bar & ~0x0F, p->mem[0].size, 0);
ctlr->port = port;
ctlr->nic = KADDR(ctlr->port);

My most recent attempt replaced the upamalloc call
with:

upareserve(bar & ~0x0F, p->mem[0].size);
pdbmap(MACH(0)->pdb, bar & ~0x0F, 0, p->mem[0].size);
port = bar & ~0x0F;

There is currently a upaalloc call, and the comment
to it seems to imply that vmap should be used either
in conjunction with upaalloc or by it self.  I've
tried a few permutations of that with no luck.

If someone knows off the top of their head the right
way to replace an old upamalloc call, it would save
me some time, and I could get on to seeing if I can
manage to get the controller to work.

Thanks in advance,
BLS



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

end of thread, other threads:[~2008-09-29 14:37 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-09-27 16:02 [9fans] The late upamalloc erik quanstrom
  -- strict thread matches above, loose matches on Subject: below --
2008-09-27 15:43 Brian L. Stuart
2008-09-27 16:03 ` erik quanstrom
2008-09-27 19:50 ` Uriel
2008-09-29 14:37   ` Brian L. Stuart

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