Subject: Re: Gigabit Ethernet support on gmac?
To: None <port-macppc@netbsd.org>
From: Monroe Williams <monroe@criticalpath.com>
List: port-macppc
Date: 10/17/2001 19:03:45
on 10/17/01 12:05 PM, Monroe Williams at monroe@criticalpath.com wrote:
> Markus W Kilbinger <kilbi@rad.rwth-aachen.de> writes:
>> Ends up with:
>> 
>> cc  -O2 -Werror -Wall -Wreturn-type -Wpointer-arith -Wno-main
>> -Wmissing-prototypes -Wstrict-prototypes -Wno-uninitialized -msoft-float  -I.
>> -I../../../../arch -I../../../.. -nostdinc -DNEWPMAP -DLKM -DDIAGNOSTIC
>> -DNMBCLUSTERS="0x1000" -DMAXUSERS=32  -D_KERNEL -D_KERNEL_OPT -Dmacppc  -c
>> ../../../../dev/ic/gem.c
>> cc1: warnings being treated as errors
>> ../../../../dev/ic/gem.c: In function `gem_init':
>> ../../../../dev/ic/gem.c:749: warning: implicit declaration of function
>> `bus_space_write_8'
>> 
>> ... at the moment on my tibook.
>> 
> 
> I see that sys/arch/macppc/include/bus.h includes the following:
> 
>> #if 0   /* Cause a link error for bus_space_write_8 */
>> #define bus_space_write_8               !!! unimplemented !!!
>> #endif
> 
> but doesn't actually define bus_space_write_8.
> 
> Any idea how it should be implemented?  The version in the sparc port is
> pretty straightforward, but it doesn't appear to do anything with the
> bus_space_tag_t argument.  I'm guessing this is not safe to ignore on the
> powerpc.  I don't see an implementation in include/bus.h in any of the
> existing powerpc-based ports, nor in arch/powerpc.

Well, I cobbled together something like bus_space_write_8 & friends on
macppc, built a kernel with the gem driver, and got the message:
 
"could not map gem registers"

from the gem driver on boot.  This seems to come from dev/pci/if_gem_pci.c.
AFAICT, nothing that would use my implementation of bus_space_write_8 has
been called at this point, so I don't think it matters whether I got it
quite right.

I think I'm out of my depth here.

Has anyone actually seen the gem driver work on macppc, or is it just
theoretically supposed to work with the UniNorth ethernet core?  ;)

-- monroe
------------------------------------------------------------------------
Monroe Williams                                  monroe@criticalpath.com