Re: ppc fails to attach to puc on 9.1-STABLE, 7.4-STABLE works

John Baldwin <[email protected]>
Newsgroups gmane.os.freebsd.devel.hardware
Message-ID <[email protected]>
On Wednesday, January 16, 2013 10:10:34 pm Bruce Evans wrote:
> On Wed, 16 Jan 2013, Andre Albsmeier wrote:
> 
> > On Tue, 15-Jan-2013 at 21:27:07 +0100, John Baldwin wrote:
> >> On Tuesday, January 15, 2013 10:44:33 am Andre Albsmeier wrote:
> >>* ...
> >>> I have no idea if this has ever worked before -- in FreeBSD-7 I
> >>> also had to use the "do not use interrupt"-flag 0x20 in loader.conf
> >>> or ppc wouldn't have attached...
> >>>
> >>> Which brings me back to the initial problem: Hints like
> >>>
> >>> hint.ppc.0.at=puc0
> >>> hint.ppc.0.irq=""
> >>> hint.ppc.0.flags=0x2F
> >>>
> >>> seems to be ignored in 9.1. While the interrupt thing seems
> >>> to be fixed now, one possibly still wants to used the other
> >>> flags. I have helped myself with this (ugly) patch to ppc
> >>>
> >>> --- ppc.c.ORI 2013-01-12 18:07:44.000000000 +0100
> >>> +++ ppc.c       2013-01-12 18:07:24.000000000 +0100
> >>> @@ -1729,6 +1729,11 @@
> >>>         ppc->ppc_base = rman_get_start(ppc->res_ioport);
> >>>
> >>>         ppc->ppc_flags = device_get_flags(dev);
> >>> +  if( ppc->ppc_flags == 0 ) {
> >>> +    int tmp;
> >>> +    if( resource_int_value( "ppc" , device_get_unit( dev ), "flags", &tmp)
> >> == 0 )
> >>> +      ppc->ppc_flags = tmp;
> >>> +  }
> >>>
> >>>         if (!(ppc->ppc_flags & 0x20)) {
> >>>                 ppc->res_irq = bus_alloc_resource_any(dev, SYS_RES_IRQ,
> >>>
> >>> in order to get at least the flags applied as it was the case
> >>> before in FreeBSD-7. Unfortuantely, I have no idea how to fix
> >>> that properly ;-(...
> >>
> >> This should not be needed for "flags".  Look for 'devflags' in
> >> sys/kern/subr_bus.c.  The kernel always reads the current 'flags' hint during
> >> device probe and stores them in dev->devflags and leaves them there after a
> >> successful probe (so they should be seen by attach).  Specifically, note:
> >>
> >> 		/* Set the winning driver, devclass, and flags. */
> 
> So the flags interface is unusable before some driver "wins".

No, we set it twice.  Specifically, it is set before each probe, then it is
set again after a winning driver is chosen so that the proper flags exist
during attach as well.

-- 
John Baldwin
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hardware
To unsubscribe, send any mail to "[email protected]"
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.