From owner-freebsd-firewire@FreeBSD.ORG Mon Oct 26 20:34:09 2009 Return-Path: Delivered-To: freebsd-firewire@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F32D71065679 for ; Mon, 26 Oct 2009 20:34:09 +0000 (UTC) (envelope-from info@maconnect.ch) Received: from smtp2.infomaniak.ch (smtp2.infomaniak.ch [84.16.68.90]) by mx1.freebsd.org (Postfix) with ESMTP id 6AD4B8FC13 for ; Mon, 26 Oct 2009 20:34:08 +0000 (UTC) Received: from [192.168.20.2] ([213.55.131.80]) (authenticated bits=0) by smtp2.infomaniak.ch (8.14.2/8.14.2) with ESMTP id n9QKItPr017688; Mon, 26 Oct 2009 21:18:56 +0100 Mime-Version: 1.0 (Apple Message framework v1076) Content-Type: text/plain; charset=iso-8859-1; format=flowed; delsp=yes From: Fabio In-Reply-To: <4AE5FD28.8080208@fgznet.ch> Date: Mon, 26 Oct 2009 21:18:54 +0100 Content-Transfer-Encoding: quoted-printable Message-Id: References: <1256585472.2607.4.camel@Lappy> <4AE5FD28.8080208@fgznet.ch> To: Andreas Tobler X-Mailer: Apple Mail (2.1076) X-Antivirus: Dr.Web (R) for Mail Servers on smtp2 host X-Antivirus-Code: 100000 Cc: Sean Bruno , freebsd-firewire Subject: Re: [Fwd: Re: firewire issue] X-BeenThere: freebsd-firewire@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Firewire support in FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Oct 2009 20:34:10 -0000 Dear Andreas and Sean, Thank you both for your quick answer. I'll see what I can do with =20 Andreas' diff. Right now, I'm still fighting with sysinstall (trying =20 to get the proper partition map) so it may take a while. Fabio Le 26 oct. 2009 =E0 20:48, Andreas Tobler a =E9crit : > Fabio, > > I do not know what the issue is. > > Sean Bruno wrote: >> Look over this patch from Andreas. I haven't done anything with it =20= >> as I >> don't have the h/w to test with. > > Please use the attached diff instead, it might bring you a bit =20 > further. > > It is still not the final thing, but I did not have the time to =20 > follow up here. Busy with other stuff. > > The patch forwared from Sean is a bit old. > > Regards, > Andreas > > > > Index: sys/dev/firewire/fwohci_pci.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > --- sys/dev/firewire/fwohci_pci.c (revision 198452) > +++ sys/dev/firewire/fwohci_pci.c (working copy) > @@ -196,6 +196,10 @@ > device_set_desc(dev, "Apple UniNorth"); > return BUS_PROBE_DEFAULT; > } > + if (id =3D=3D (FW_VENDORID_APPLE | FW_DEVICE_UNINORTH_V1)) { > + device_set_desc(dev, "Apple UniNorth, v1"); > + return BUS_PROBE_DEFAULT; > + } > if (id =3D=3D (FW_VENDORID_LUCENT | FW_DEVICE_FW322)) { > device_set_desc(dev, "Lucent FW322/323"); > return BUS_PROBE_DEFAULT; > @@ -285,6 +289,10 @@ > fwohci_softc_t *sc =3D device_get_softc(self); > int err; > int rid; > + uint32_t id; > + > + sc->old_uninorth =3D 0; > + > #if defined(__DragonFly__) || __FreeBSD_version < 500000 > int intr; > /* For the moment, put in a message stating what is wrong */ > @@ -383,6 +391,12 @@ > return (ENOMEM); > } > > + id =3D pci_get_devid(self); > + if (id =3D=3D (FW_VENDORID_APPLE | FW_DEVICE_UNINORTH_V1)) { > + sc->old_uninorth =3D 1; > + device_printf(self, "Uninorth V1\n"); > + } > + > err =3D fwohci_init(sc, self); > > if (err) { > Index: sys/dev/firewire/fwohci.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > --- sys/dev/firewire/fwohci.c (revision 198452) > +++ sys/dev/firewire/fwohci.c (working copy) > @@ -79,6 +79,7 @@ > #undef OHCI_DEBUG > > static int nocyclemaster =3D 0; > +static int old_uninorth =3D 0; > int firewire_phydma_enable =3D 1; > SYSCTL_DECL(_hw_firewire); > SYSCTL_INT(_hw_firewire, OID_AUTO, nocyclemaster, CTLFLAG_RW, =20 > &nocyclemaster, 0, > @@ -266,6 +267,15 @@ > > d_ioctl_t fwohci_ioctl; > > +#if BYTE_ORDER =3D=3D BIG_ENDIAN > +#define FWOHCI_DMA_READ_UNI(x) \ > + old_uninorth ? (x) : FWOHCI_DMA_READ(x) > +#define FWOHCI_DMA_WRITE_UNI(x,y) \ > + old_uninorth ? ((x) =3D (y)) : FWOHCI_DMA_WRITE(x,y) > +#else > +#define FWOHCI_DMA_READ_UNI(x) FWOHCI_DMA_READ(x) > +#define FWOHCI_DMA_WRITE_UNI(x,y) FWOHCI_DMA_WRITE(x,y) > +#endif > /* > * Communication with PHY device > */ > @@ -624,6 +634,8 @@ > return (ENXIO); > } > > + old_uninorth =3D sc->old_uninorth; > + > /* Available Isochronous DMA channel probe */ > OWRITE(sc, OHCI_IT_MASK, 0xffffffff); > OWRITE(sc, OHCI_IR_MASK, 0xffffffff); > @@ -1811,7 +1823,7 @@ > fwohci_dump_intr(struct fwohci_softc *sc, uint32_t stat) > { > if(stat & OREAD(sc, FWOHCI_INTMASK)) > - device_printf(fc->dev, "INTERRUPT < = %s%s%s%s%s%s%s%s%s%s%s%s%s%s%s=20 > %s%s%s%s%s%s> 0x%08x, 0x%08x\n", > + device_printf(sc->fc.dev, "INTERRUPT < = %s%s%s%s%s%s%s%s%s%s%s%s%s=20 > %s%s%s%s%s%s%s%s> 0x%08x, 0x%08x\n", > stat & OHCI_INT_EN ? "DMA_EN ":"", > stat & OHCI_INT_PHY_REG ? "PHY_REG ":"", > stat & OHCI_INT_CYC_LONG ? "CYC_LONG ":"", > @@ -1848,7 +1860,7 @@ > fc->status =3D FWBUSRESET; > /* Disable bus reset interrupt until sid recv. */ > OWRITE(sc, FWOHCI_INTMASKCLR, OHCI_INT_PHY_BUS_R); > -=09 > + > device_printf(fc->dev, "%s: BUS reset\n", __func__); > OWRITE(sc, FWOHCI_INTMASKCLR, OHCI_INT_CYC_LOST); > OWRITE(sc, OHCI_LNKCTLCLR, OHCI_CNTL_CYCSRC); > @@ -2037,7 +2049,7 @@ > return; > } > for (i =3D 0; i < plen / 4; i ++) > - buf[i] =3D FWOHCI_DMA_READ(sc->sid_buf[i+1]); > + buf[i] =3D FWOHCI_DMA_READ_UNI(sc->sid_buf[i+1]); > > /* pending all pre-bus_reset packets */ > fwohci_txd(sc, &sc->atrq); > @@ -2068,6 +2080,7 @@ > fwohci_check_stat(struct fwohci_softc *sc) > { > uint32_t stat, irstat, itstat; > + static int sid_count; > > FW_GLOCK_ASSERT(&sc->fc); > stat =3D OREAD(sc, FWOHCI_INTSTAT); > @@ -2076,8 +2089,14 @@ > "device physically ejected?\n"); > return (FILTER_STRAY); > } > - if (stat) > +=09 > + if (stat && old_uninorth && (sid_count < 5)) { > + OWRITE(sc, FWOHCI_INTSTATCLR, > + stat & ~(OHCI_INT_PHY_BUS_R | OHCI_INT_PHY_SID)); > + sid_count++; > + } else { > OWRITE(sc, FWOHCI_INTSTATCLR, stat & = ~OHCI_INT_PHY_BUS_R); > + } > > stat &=3D sc->intmask; > if (stat =3D=3D 0) > @@ -2657,7 +2676,7 @@ > int i; > #endif > > - ld0 =3D FWOHCI_DMA_READ(fp->mode.ld[0]); > + ld0 =3D FWOHCI_DMA_READ_UNI(fp->mode.ld[0]); > #if 0 > printf("ld0: x%08x\n", ld0); > #endif > @@ -2690,7 +2709,7 @@ > } > #if BYTE_ORDER =3D=3D BIG_ENDIAN > for(i =3D 0; i < slen/4; i ++) > - fp->mode.ld[i] =3D FWOHCI_DMA_READ(fp->mode.ld[i]); > + fp->mode.ld[i] =3D FWOHCI_DMA_READ_UNI(fp->mode.ld[i]); > #endif > return(hlen); > } > @@ -2884,7 +2903,7 @@ > printf("nvec =3D=3D 0\n"); > > /* DMA result-code will be written at the tail of packet */ > - stat =3D FWOHCI_DMA_READ(*(uint32_t *)(ld - = sizeof(struct =20 > fwohci_trailer))); > + stat =3D FWOHCI_DMA_READ_UNI(*(uint32_t *)(ld - = sizeof(struct =20 > fwohci_trailer))); > #if 0 > printf("plen: %d, stat %x\n", > plen ,stat); > Index: sys/dev/firewire/fwohcireg.h > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > --- sys/dev/firewire/fwohcireg.h (revision 198452) > +++ sys/dev/firewire/fwohcireg.h (working copy) > @@ -73,6 +73,7 @@ > #define FW_DEVICE_R5C552 (0x0552 << 16) > #define FW_DEVICE_PANGEA (0x0030 << 16) > #define FW_DEVICE_UNINORTH (0x0031 << 16) > +#define FW_DEVICE_UNINORTH_V1 (0x0018 << 16) > #define FW_DEVICE_AIC5800 (0x5800 << 16) > #define FW_DEVICE_FW322 (0x5811 << 16) > #define FW_DEVICE_7007 (0x7007 << 16) > Index: sys/dev/firewire/fwohcivar.h > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > --- sys/dev/firewire/fwohcivar.h (revision 198452) > +++ sys/dev/firewire/fwohcivar.h (working copy) > @@ -75,6 +75,7 @@ > struct task fwohci_task_sid; > struct task fwohci_task_dma; > int cycle_lost; > + int old_uninorth; > } fwohci_softc_t; > > void fwohci_intr (void *arg);