Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 22 Mar 2007 16:27:08 +0100
From:      Olivier Houchard <mlfbsd@ci0.org>
To:        Sam Leffler <sam@errno.com>
Cc:        freebsd-arm@freebsd.org
Subject:   Re: progress on the adi pronghorn metro board
Message-ID:  <20070322152708.GA79016@ci0.org>
In-Reply-To: <46029AF5.20903@errno.com>
References:  <20070322080335.GA52745@zibbi.meraka.csir.co.za> <46029AF5.20903@errno.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, Mar 22, 2007 at 08:04:21AM -0700, Sam Leffler wrote:
> John Hay wrote:
> > Hi Guys,
> > 
> > With this patch I am at the stage where both an Avila 2348-4 and the
> > ADI Pronghorn Metro boot from the same kernel binary. The "main" stuff
> > is working, ie. console, ethernet and mini-pci slots. The iic bus on
> > the Avila is still working. The one for the Pronghorn is configured,
> > but I must still write a driver for their max6652 temperature/voltage
> > sensor before I will know if it is really working.
> > 
> > The biggest difference between the 2 boards are in the 16 GPIO pins.
> > I think there is only 1 pin that have the same function. :-/
> > 
> > So what I did was to create a structure and then have 2 instances of
> > it, one with Avila values in it and one with Pronghorn values. Then
> > early in the boot phase, the board type gets detected and a pointer
> > gets set to the relevant structure. All the drivers then use this
> > pointer to get the correct values. The efect is that most of the
> > drivers needs no checks for the different boards.
> > 
> > What I would like to know is, if this approach is acceptable? Should
> > I use different files to put the stuff in?
> > 
> > My code is not finished yet, but I thought that I would like to get
> > some feedback. I still have to replace some of the numbers in the
> > structure with defined values. I would also like to try and really
> > probe the iic devices and not just assume that they are there.
> 
> I'm not sure whether it makes sense to support different boards in a
> single binary (variations on a board design yes).  My experience is that
> embedded applications are often cycle starved and giving up cycles for
> flexibility like this is ok only for devel/bringup.  I suspect
> compile-time configuration is preferable.
> 
> However if this flexibility is desirable it might be better to use
> ivar's hung off the nexus.
> 
> 	Sam

I tend to agree. 
I think one config file per board is not too much to handle, and detecting
which board we're currently running can be difficult.

Olivier



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20070322152708.GA79016>