Re: Newbusifying ed broke it

2000-08-27 Thread Alexander Langer

Thus spake Seigo Tanimura ([EMAIL PROTECTED]):

> - bus_space_write_1(sc->bst, sc->bsh, regno, data);
> + bus_space_write_1(rman_get_bustag(sc->port_res), 
>rman_get_bushandle(sc->port_res), regno, data);

Hmm.  I used sc->bst/h to save function calls to rman_get_bus*, as
many drivers use it.

But obvioiusly I forgot to assign the values.
I REALLY wonder why it worked for me ... strange.

Thanks for fixing that.

Alex


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message



Re: Newbusifying ed broke it

2000-08-17 Thread Peter Jeremy

On 2000-Aug-18 13:41:29 +0900, Seigo Tanimura <[EMAIL PROTECTED]> wrote:
>The memory resource of the card might not be allocated properly. Could
>you apply the following patch and report what your kernel print?

ed0: conf_maddr = 0xcc000.
ed0: tag(mem_res) = 1, handle(mem_res) = 0xc00cc000.
ed0: failed to clear shared memory at 0 - check configuration

(Looking at the code, the 0 is an offset within the shared memory, so
it is a sensible value).  I have no idea where the ISA hole should be,
but I notice the kernel is normally loaded somewhere around
0xc0354000.

Peter


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message



Re: Newbusifying ed broke it

2000-08-17 Thread Seigo Tanimura

On Fri, 18 Aug 2000 09:56:56 +1000,
  Peter Jeremy <[EMAIL PROTECTED]> said:

Peter> On 2000-Aug-17 16:55:57 +0900, Seigo Tanimura <[EMAIL PROTECTED]> 
wrote:
>> On Thu, 17 Aug 2000 15:35:59 +1000,
>> Peter Jeremy <[EMAIL PROTECTED]> said:
>> 
>> peter.jeremy> Still not working.  It now reports:
>> peter.jeremy> ed0: failed to clear shared memory at 0 - check configuration
>> 
>> The probe routine cleared and tested IO port instead of memory. Does
>> the following patch work?

Peter> No, sorry.  Exactly the same as the previous patch - it still thinks
Peter> the shared memory is at 0.

The memory resource of the card might not be allocated properly. Could
you apply the following patch and report what your kernel print?



--- if_ed.c.org Thu Aug 17 16:05:59 2000
+++ if_ed.c Fri Aug 18 13:35:14 2000
@@ -435,6 +435,7 @@
 &conf_maddr, &conf_msize);
if (error)
return (error);
+   device_printf(dev, "conf_maddr = 0x%x.\n", conf_maddr);
 
 #if ED_DEBUG
printf("type = %x type_str=%s isa16bit=%d memsize=%d id_msize=%d\n",
@@ -535,6 +536,7 @@
return (error);
}
sc->mem_start = 0;
+   device_printf(dev, "tag(mem_res) = %d, handle(mem_res) = 0x%x.\n", 
+rman_get_bustag(sc->mem_res), rman_get_bushandle(sc->mem_res));
 
/*
 * allocate one xmit buffer if < 16k, two buffers otherwise




-- 
Seigo Tanimura <[EMAIL PROTECTED]> <[EMAIL PROTECTED]>



Re: Newbusifying ed broke it

2000-08-17 Thread Peter Jeremy

On 2000-Aug-17 16:55:57 +0900, Seigo Tanimura <[EMAIL PROTECTED]> wrote:
>On Thu, 17 Aug 2000 15:35:59 +1000,
>  Peter Jeremy <[EMAIL PROTECTED]> said:
>
>peter.jeremy> Still not working.  It now reports:
>peter.jeremy> ed0: failed to clear shared memory at 0 - check configuration
>
>The probe routine cleared and tested IO port instead of memory. Does
>the following patch work?

No, sorry.  Exactly the same as the previous patch - it still thinks
the shared memory is at 0.

Peter


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message



Re: Newbusifying ed broke it

2000-08-17 Thread Seigo Tanimura

On Thu, 17 Aug 2000 15:35:59 +1000,
  Peter Jeremy <[EMAIL PROTECTED]> said:

peter.jeremy> Still not working.  It now reports:
peter.jeremy> ed0: failed to clear shared memory at 0 - check configuration

The probe routine cleared and tested IO port instead of memory. Does
the following patch work?



Index: if_ed.c
===
RCS file: /home/naklab/tanimura/rina2/CVS/FreeBSD/sys/dev/ed/if_ed.c,v
retrieving revision 1.1.1.4.6.8
diff -u -r1.1.1.4.6.8 if_ed.c
--- if_ed.c 2000/08/16 07:38:31 1.1.1.4.6.8
+++ if_ed.c 2000/08/17 07:21:34
@@ -164,7 +164,7 @@
 static void
 ed_writeb(struct ed_softc *sc, int regno, u_char data)
 {
-   bus_space_write_1(sc->bst, sc->bsh, regno, data);
+   bus_space_write_1(rman_get_bustag(sc->port_res), 
+rman_get_bushandle(sc->port_res), regno, data);
 }
 
 /*
@@ -173,7 +173,7 @@
 static u_char
 ed_readb(struct ed_softc *sc, int regno)
 {
-   return bus_space_read_1(sc->bst, sc->bsh, regno);
+   return bus_space_read_1(rman_get_bustag(sc->port_res), 
+rman_get_bushandle(sc->port_res), regno);
 }
 
 /*
@@ -182,7 +182,7 @@
 static void
 ed_writew(struct ed_softc *sc, int regno, u_int16_t data)
 {
-   bus_space_write_2(sc->bst, sc->bsh, regno, data);
+   bus_space_write_2(rman_get_bustag(sc->port_res), 
+rman_get_bushandle(sc->port_res), regno, data);
 }
 
 /*
@@ -191,7 +191,7 @@
 static u_int16_t
 ed_readw(struct ed_softc *sc, int regno)
 {
-   return bus_space_read_2(sc->bst, sc->bsh, regno);
+   return bus_space_read_2(rman_get_bustag(sc->port_res), 
+rman_get_bushandle(sc->port_res), regno);
 }
 
 /*
@@ -200,7 +200,7 @@
 static void
 ed_writesw(struct ed_softc *sc, int regno, const u_int16_t *addr, size_t cnt)
 {
-   bus_space_write_multi_2(sc->bst, sc->bsh, regno,
+   bus_space_write_multi_2(rman_get_bustag(sc->port_res), 
+rman_get_bushandle(sc->port_res), regno,
addr, cnt);
 }
 
@@ -210,7 +210,7 @@
 static void
 ed_bcopy_from(struct ed_softc *sc, caddr_t dst, int regno, size_t cnt)
 {
-   bus_space_read_multi_1(sc->bst, sc->bsh, regno,
+   bus_space_read_multi_1(rman_get_bustag(sc->mem_res), 
+rman_get_bushandle(sc->mem_res), regno,
dst, cnt);
 }
 
@@ -270,8 +270,8 @@
if (error)
return (error);
 
-   sc->asic_addr = rman_get_start(sc->port_res);
-   sc->nic_addr = sc->asic_addr + ED_WD_NIC_OFFSET;
+   sc->asic_addr = 0;
+   sc->nic_addr = ED_WD_NIC_OFFSET;
sc->chip_type = ED_CHIP_TYPE_DP8390;
 
if (ED_FLAGS_GETTYPE(flags) == ED_FLAGS_TOSH_ETHER) {
@@ -534,7 +534,7 @@
printf("*** ed_alloc_memory() failed! (%d)\n", error);
return (error);
}
-   sc->mem_start = rman_get_start(sc->mem_res);
+   sc->mem_start = 0;
 
/*
 * allocate one xmit buffer if < 16k, two buffers otherwise
@@ -614,7 +614,7 @@
printf("starting memory performance test at 0x%x, size %d...\n",
sc->mem_start, memsize*16384);
for (i = 0; i < 16384; i++)
-   bus_space_set_multi_1(sc->bst, sc->bsh, sc->mem_start,
+   bus_space_set_multi_1(rman_get_bustag(sc->mem_res), 
+rman_get_bushandle(sc->mem_res), sc->mem_start,
0x0, memsize);
printf("***DONE***\n");
 #endif
@@ -622,11 +622,11 @@
/*
 * Now zero memory and verify that it is clear
 */
-   bus_space_set_multi_1(sc->bst, sc->bsh, sc->mem_start,
+   bus_space_set_multi_1(rman_get_bustag(sc->mem_res), 
+rman_get_bushandle(sc->mem_res), sc->mem_start,
0x0, memsize);
 
for (i = 0; i < memsize; ++i) {
-   if (ed_readb(sc, sc->mem_start + i) != 0) {
+   if (bus_space_read_1(rman_get_bustag(sc->mem_res), 
+rman_get_bushandle(sc->mem_res), sc->mem_start + i) != 0) {
device_printf(dev, "failed to clear shared memory at %lx - 
check configuration\n",
  sc->mem_start + i);
 
@@ -681,8 +681,8 @@
if (error)
return (error);
 
-   sc->asic_addr = rman_get_start(sc->port_res) + ED_3COM_ASIC_OFFSET;
-   sc->nic_addr = rman_get_start(sc->port_res) + ED_3COM_NIC_OFFSET;
+   sc->asic_addr = ED_3COM_ASIC_OFFSET;
+   sc->nic_addr = ED_3COM_NIC_OFFSET;
 
/*
 * Verify that the kernel configured I/O address matches the board
@@ -848,7 +848,7 @@
if (error)
return (error);
 
-   sc->mem_start = rman_get_start(sc->mem_res);
+   sc->mem_start = 0;
sc->mem_size = memsize;
sc->mem_end = sc->mem_start + memsize;
 
@@ -938,10 +938,10 @@
/*
 * Zero memory and verify that it is clear
 */
-   bus_space_set_multi_1(sc->bst, sc->bsh, sc->mem_start, 0x0, memsize);
+   bus_space_set_multi_1(rman_get_bustag(sc->mem_res), 
+rman_get_bushandle(sc->mem_res), sc->mem_start, 0x0, memsize);
 
for (i 

Re: Newbusifying ed broke it

2000-08-16 Thread Peter Jeremy

On 2000-Aug-17 12:46:39 +0900, Seigo Tanimura <[EMAIL PROTECTED]> wrote:
>peter.jeremy> a verbose boot shows:
>peter.jeremy> ed0: failed to clear shared memory at cc000 - check configuration
>peter.jeremy> ed0 failed to probe at port 0x300-0x31f iomem 0xcc000-0xc irq 7 on 
>isa0
>
>Newbusification in the last commit was not done completely because
>resource tags and handles were not used proplerly. Could you please
>apply the following patch and see if your card works?

Still not working.  It now reports:
ed0: failed to clear shared memory at 0 - check configuration

Peter


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message



Re: Newbusifying ed broke it

2000-08-16 Thread Takahashi Yoshihiro

In article 
<[EMAIL PROTECTED]>
Seigo Tanimura <[EMAIL PROTECTED]> writes:

> Newbusification in the last commit was not done completely because
> resource tags and handles were not used proplerly. Could you please
> apply the following patch and see if your card works?

I think this patch still has a problem of memory resource access.
I have fixed this problem and supported many PC-98 Cbus devices
again.

The patch is available from
http://home.jp.FreeBSD.org/~nyan/patches/ed-pc98.diff.gz
If it doesn't have fatal problem, I'll commit it.

---
Takahashi Yoshihiro
The Center for Information Science, Kogakuin Univ.


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message



Re: Newbusifying ed broke it

2000-08-16 Thread Seigo Tanimura

On Thu, 17 Aug 2000 11:13:25 +1000,
  Peter Jeremy <[EMAIL PROTECTED]> said:

peter.jeremy> I have an SMC8016 NIC which should probe as:
peter.jeremy> ed0 at port 0x300-0x31f iomem 0xcc000-0xc irq 7 on isa0
peter.jeremy> ed0: address 00:00:c0:57:99:47, type WD8013EPC (16 bit) 

peter.jeremy> After the following commit:
(snip)

peter.jeremy> a verbose boot shows:
peter.jeremy> ed0: failed to clear shared memory at cc000 - check configuration
peter.jeremy> ed0 failed to probe at port 0x300-0x31f iomem 0xcc000-0xc irq 7 on 
isa0

Newbusification in the last commit was not done completely because
resource tags and handles were not used proplerly. Could you please
apply the following patch and see if your card works?



Index: if_ed.c
===
RCS file: /home/naklab/tanimura/rina2/CVS/FreeBSD/sys/dev/ed/if_ed.c,v
retrieving revision 1.1.1.4.6.8
diff -u -r1.1.1.4.6.8 if_ed.c
--- if_ed.c 2000/08/16 07:38:31 1.1.1.4.6.8
+++ if_ed.c 2000/08/17 03:38:36
@@ -164,7 +164,7 @@
 static void
 ed_writeb(struct ed_softc *sc, int regno, u_char data)
 {
-   bus_space_write_1(sc->bst, sc->bsh, regno, data);
+   bus_space_write_1(rman_get_bustag(sc->port_res), 
+rman_get_bushandle(sc->port_res), regno, data);
 }
 
 /*
@@ -173,7 +173,7 @@
 static u_char
 ed_readb(struct ed_softc *sc, int regno)
 {
-   return bus_space_read_1(sc->bst, sc->bsh, regno);
+   return bus_space_read_1(rman_get_bustag(sc->port_res), 
+rman_get_bushandle(sc->port_res), regno);
 }
 
 /*
@@ -182,7 +182,7 @@
 static void
 ed_writew(struct ed_softc *sc, int regno, u_int16_t data)
 {
-   bus_space_write_2(sc->bst, sc->bsh, regno, data);
+   bus_space_write_2(rman_get_bustag(sc->port_res), 
+rman_get_bushandle(sc->port_res), regno, data);
 }
 
 /*
@@ -191,7 +191,7 @@
 static u_int16_t
 ed_readw(struct ed_softc *sc, int regno)
 {
-   return bus_space_read_2(sc->bst, sc->bsh, regno);
+   return bus_space_read_2(rman_get_bustag(sc->port_res), 
+rman_get_bushandle(sc->port_res), regno);
 }
 
 /*
@@ -200,7 +200,7 @@
 static void
 ed_writesw(struct ed_softc *sc, int regno, const u_int16_t *addr, size_t cnt)
 {
-   bus_space_write_multi_2(sc->bst, sc->bsh, regno,
+   bus_space_write_multi_2(rman_get_bustag(sc->port_res), 
+rman_get_bushandle(sc->port_res), regno,
addr, cnt);
 }
 
@@ -210,7 +210,7 @@
 static void
 ed_bcopy_from(struct ed_softc *sc, caddr_t dst, int regno, size_t cnt)
 {
-   bus_space_read_multi_1(sc->bst, sc->bsh, regno,
+   bus_space_read_multi_1(rman_get_bustag(sc->port_res), 
+rman_get_bushandle(sc->port_res), regno,
dst, cnt);
 }
 
@@ -270,8 +270,8 @@
if (error)
return (error);
 
-   sc->asic_addr = rman_get_start(sc->port_res);
-   sc->nic_addr = sc->asic_addr + ED_WD_NIC_OFFSET;
+   sc->asic_addr = 0;
+   sc->nic_addr = ED_WD_NIC_OFFSET;
sc->chip_type = ED_CHIP_TYPE_DP8390;
 
if (ED_FLAGS_GETTYPE(flags) == ED_FLAGS_TOSH_ETHER) {
@@ -534,7 +534,7 @@
printf("*** ed_alloc_memory() failed! (%d)\n", error);
return (error);
}
-   sc->mem_start = rman_get_start(sc->mem_res);
+   sc->mem_start = 0;
 
/*
 * allocate one xmit buffer if < 16k, two buffers otherwise
@@ -614,7 +614,7 @@
printf("starting memory performance test at 0x%x, size %d...\n",
sc->mem_start, memsize*16384);
for (i = 0; i < 16384; i++)
-   bus_space_set_multi_1(sc->bst, sc->bsh, sc->mem_start,
+   bus_space_set_multi_1(rman_get_bustag(sc->mem_res), 
+rman_get_bushandle(sc->mem_res), sc->mem_start,
0x0, memsize);
printf("***DONE***\n");
 #endif
@@ -622,7 +622,7 @@
/*
 * Now zero memory and verify that it is clear
 */
-   bus_space_set_multi_1(sc->bst, sc->bsh, sc->mem_start,
+   bus_space_set_multi_1(rman_get_bustag(sc->mem_res), 
+rman_get_bushandle(sc->mem_res), sc->mem_start,
0x0, memsize);
 
for (i = 0; i < memsize; ++i) {
@@ -681,8 +681,8 @@
if (error)
return (error);
 
-   sc->asic_addr = rman_get_start(sc->port_res) + ED_3COM_ASIC_OFFSET;
-   sc->nic_addr = rman_get_start(sc->port_res) + ED_3COM_NIC_OFFSET;
+   sc->asic_addr = ED_3COM_ASIC_OFFSET;
+   sc->nic_addr = ED_3COM_NIC_OFFSET;
 
/*
 * Verify that the kernel configured I/O address matches the board
@@ -848,7 +848,7 @@
if (error)
return (error);
 
-   sc->mem_start = rman_get_start(sc->mem_res);
+   sc->mem_start = 0;
sc->mem_size = memsize;
sc->mem_end = sc->mem_start + memsize;
 
@@ -938,7 +938,7 @@
/*
 * Zero memory and verify that it is clear
 */
-   bus_space_set_multi_1(sc->bst, sc->bsh, sc->mem_start, 0x0, memsize);
+   bus_space_set_multi_1(rman_get_bustag(sc->mem_res), 
+rman_get_

Newbusifying ed broke it

2000-08-16 Thread Peter Jeremy

I have an SMC8016 NIC which should probe as:

ed0 at port 0x300-0x31f iomem 0xcc000-0xc irq 7 on isa0
ed0: address 00:00:c0:57:99:47, type WD8013EPC (16 bit) 

After the following commit:
>tanimura2000/08/13 21:31:11 PDT
>
>  Modified files:
>sys/dev/ed   if_ed.c if_ed_pccard.c if_edvar.h 
>  Log:
>  Newbusify ed driver.
>  
>  Partly submitted by: alex
>  
>  Revision  ChangesPath
>  1.186 +459 -316  src/sys/dev/ed/if_ed.c
>  1.15  +11 -70src/sys/dev/ed/if_ed_pccard.c
>  1.7   +15 -6 src/sys/dev/ed/if_edvar.h

a verbose boot shows:
ed0: failed to clear shared memory at cc000 - check configuration
ed0 failed to probe at port 0x300-0x31f iomem 0xcc000-0xc irq 7 on isa0

Backing out the above commit fixes the problem.  Any suggestions?

Peter


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message