From owner-freebsd-firewire@FreeBSD.ORG Mon Oct 26 21:04:13 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 C4864106566B for ; Mon, 26 Oct 2009 21:04:13 +0000 (UTC) (envelope-from sean.bruno@dsl-only.net) Received: from iron2.pdx.net (iron2.pdx.net [69.64.224.71]) by mx1.freebsd.org (Postfix) with ESMTP id 6EFB88FC16 for ; Mon, 26 Oct 2009 21:04:13 +0000 (UTC) Received: (qmail 28177 invoked from network); 26 Oct 2009 14:04:10 -0700 Received: from unknown (HELO ?131.252.141.40?) (131.252.141.40) by iron2.pdx.net with (DHE-RSA-AES256-SHA encrypted) SMTP; 26 Oct 2009 14:04:10 -0700 From: Sean Bruno To: Fabio In-Reply-To: References: <1256585472.2607.4.camel@Lappy> <4AE5FD28.8080208@fgznet.ch> Content-Type: text/plain; charset="UTF-8" Date: Mon, 26 Oct 2009 14:04:12 -0700 Message-Id: <1256591052.2607.55.camel@Lappy> Mime-Version: 1.0 X-Mailer: Evolution 2.26.3 (2.26.3-1.fc11) Content-Transfer-Encoding: 8bit Cc: 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 21:04:13 -0000 I will ask around and see if I can get my hands on a G3 here in Oregon, USA. Sean On Mon, 2009-10-26 at 21:18 +0100, Fabio wrote: > Dear Andreas and Sean, > > Thank you both for your quick answer. I'll see what I can do with > Andreas' diff. Right now, I'm still fighting with sysinstall (trying > to get the proper partition map) so it may take a while. > > Fabio > > Le 26 oct. 2009 à 20:48, Andreas Tobler a écrit : > > > 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 > >> as I > >> don't have the h/w to test with. > > > > Please use the attached diff instead, it might bring you a bit > > further. > > > > It is still not the final thing, but I did not have the time to > > 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 > > =================================================================== > > --- 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 == (FW_VENDORID_APPLE | FW_DEVICE_UNINORTH_V1)) { > > + device_set_desc(dev, "Apple UniNorth, v1"); > > + return BUS_PROBE_DEFAULT; > > + } > > if (id == (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 = device_get_softc(self); > > int err; > > int rid; > > + uint32_t id; > > + > > + sc->old_uninorth = 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 = pci_get_devid(self); > > + if (id == (FW_VENDORID_APPLE | FW_DEVICE_UNINORTH_V1)) { > > + sc->old_uninorth = 1; > > + device_printf(self, "Uninorth V1\n"); > > + } > > + > > err = fwohci_init(sc, self); > > > > if (err) { > > Index: sys/dev/firewire/fwohci.c > > =================================================================== > > --- sys/dev/firewire/fwohci.c (revision 198452) > > +++ sys/dev/firewire/fwohci.c (working copy) > > @@ -79,6 +79,7 @@ > > #undef OHCI_DEBUG > > > > static int nocyclemaster = 0; > > +static int old_uninorth = 0; > > int firewire_phydma_enable = 1; > > SYSCTL_DECL(_hw_firewire); > > SYSCTL_INT(_hw_firewire, OID_AUTO, nocyclemaster, CTLFLAG_RW, > > &nocyclemaster, 0, > > @@ -266,6 +267,15 @@ > > > > d_ioctl_t fwohci_ioctl; > > > > +#if BYTE_ORDER == 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) = (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 = 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 > > %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 > > %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 = FWBUSRESET; > > /* Disable bus reset interrupt until sid recv. */ > > OWRITE(sc, FWOHCI_INTMASKCLR, OHCI_INT_PHY_BUS_R); > > - > > + > > 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 = 0; i < plen / 4; i ++) > > - buf[i] = FWOHCI_DMA_READ(sc->sid_buf[i+1]); > > + buf[i] = 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 = OREAD(sc, FWOHCI_INTSTAT); > > @@ -2076,8 +2089,14 @@ > > "device physically ejected?\n"); > > return (FILTER_STRAY); > > } > > - if (stat) > > + > > + 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 &= sc->intmask; > > if (stat == 0) > > @@ -2657,7 +2676,7 @@ > > int i; > > #endif > > > > - ld0 = FWOHCI_DMA_READ(fp->mode.ld[0]); > > + ld0 = FWOHCI_DMA_READ_UNI(fp->mode.ld[0]); > > #if 0 > > printf("ld0: x%08x\n", ld0); > > #endif > > @@ -2690,7 +2709,7 @@ > > } > > #if BYTE_ORDER == BIG_ENDIAN > > for(i = 0; i < slen/4; i ++) > > - fp->mode.ld[i] = FWOHCI_DMA_READ(fp->mode.ld[i]); > > + fp->mode.ld[i] = FWOHCI_DMA_READ_UNI(fp->mode.ld[i]); > > #endif > > return(hlen); > > } > > @@ -2884,7 +2903,7 @@ > > printf("nvec == 0\n"); > > > > /* DMA result-code will be written at the tail of packet */ > > - stat = FWOHCI_DMA_READ(*(uint32_t *)(ld - sizeof(struct > > fwohci_trailer))); > > + stat = FWOHCI_DMA_READ_UNI(*(uint32_t *)(ld - sizeof(struct > > fwohci_trailer))); > > #if 0 > > printf("plen: %d, stat %x\n", > > plen ,stat); > > Index: sys/dev/firewire/fwohcireg.h > > =================================================================== > > --- 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 > > =================================================================== > > --- 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); > > _______________________________________________ > freebsd-firewire@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-firewire > To unsubscribe, send any mail to "freebsd-firewire-unsubscribe@freebsd.org"