Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 26 Jan 2012 01:02:28 -0700
From:      Warner Losh <imp@bsdimp.com>
To:        Tim Kientzle <tim@kientzle.com>
Cc:        arm@FreeBSD.org
Subject:   Re: FreeBSD and BeagleBone
Message-ID:  <43F1CB8E-8034-4658-9D38-E1F66202521C@bsdimp.com>
In-Reply-To: <214BF14D-33BA-4D3D-B043-31008E24F7AE@kientzle.com>
References:  <23CB6C35-9450-40BA-9FA3-37C44B328CA8@freebsd.org> <CABt%2Bj0mB4w==h_SQ4YyDM24_wGOjcdZDK9T1N3DqjSkap0VkQw@mail.gmail.com> <E8A24EBE-967D-44F8-A884-3207B3C6F0FE@bsdimp.com> <8042D895-3B3D-431E-ADCC-A150BDC838ED@kientzle.com> <CAGW5k5ahyaTest3L0NTe1t%2B%2BYBgpLMkWZNpp=GRyz%2Bg=nMcZLg@mail.gmail.com> <7E53112E-DE29-4145-B597-D39AA77252C5@kientzle.com> <E1RoGMT-000DkR-6a@groundzero.grondar.org> <AEF07CD1-6794-4F04-AF9C-938423FE919B@kientzle.com> <DB160959-A698-415D-AACC-659D6469212E@semihalf.com> <101D3416-6B61-4840-A89E-4CF91B0BB8BC@kientzle.com> <AE745CFE-81C8-400C-BAC6-CED7341D0A99@semihalf.com> <214BF14D-33BA-4D3D-B043-31008E24F7AE@kientzle.com>

next in thread | previous in thread | raw e-mail | index | archive | help

On Jan 25, 2012, at 10:34 PM, Tim Kientzle wrote:

> On Jan 25, 2012, at 2:06 PM, Rafal Jaworowski wrote:
>> On 2012-01-22, at 00:29, Tim Kientzle wrote:
>>=20
>>>=20
>>> P.S.  Is it worth trying to generalize the ubldr Makefile
>>> to accept some form of link address specification?
>>=20
>> In general yes, the challenge is how to do this in a smart and =
flexible way: loader/ubldr is built as part of the world which you don't =
want to entagle with platform specific knobs. On the other hand a =
configurable like this is specific to some board (not even a chip, soc =
or a familiy, anybody can have their U-Boot configured differently =
underneath..), so the question is how to convey this knowledge.
>=20
> I know Warner has some ideas for organizing the tree to include
> board information.  If each board has a directory, then
> you could build a custom ubldr for each board.  That
> feels a little heavyweight to me, though.

The basic idea I had was expanded from what Sam did originally with the =
Avila support.  Each SoC would have a directory and under that there'd =
be a 'boards' directory.  This directory would have a number of files.  =
Each file would have a structure that would link into a list of boards =
(or more than one).  This structure would contain a 'probe' or 'match' =
routine that would be called to discover which of these board structures =
matched.  The one that matched would then be used to fill in other =
details into the SoC's structure.  things like clock speed, pin wiring, =
etc.

Much of that is now covered by FDT, and one field could be a =
'replacement fdt' file since most ARM boot loaders don't present a FDT =
to the kernel.

This would get away from having too many things hard-wired via #defines =
and move instead to having more computed at run time via a structure =
dereference, maybe with a little math.  This would also allow us to have =
one kernel that booted on all AT91RM9200 boards, or possibly all atmel =
ARM boards or maybe even all armv4, armv5 and armv6 boards depending on =
how far we take this idea.

> The closest thing to a board description we have is
> the kernel config.  That reflects the hardware and layout
> of the board being targeted.  Is there some way to have
> ubldr made by buildkernel instead of buildworld?

We already do that for aicasm unconditionally.  It might take a bit of =
tricky logic to do this conditionally.  Well, the unconditional stuff is =
just for modules, we do it conditionally based on what's in the kernel, =
so there's a path blazed there already since this utility wouldn't be =
needed to build a module.

> Another approach might be to provide a build script that
> accepts arguments and spits out a compiled ubldr to
> match those parameters.  Maybe something like:
>=20
>    $ cd /usr/src/sys/tools/ubldr-build
>    $ ./ubldr-build arm.arm -l 0x80010000 -o ubldr.beagle

We already have makefile targets for compressed kernels, this could =
easily be another of them.

Warner




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?43F1CB8E-8034-4658-9D38-E1F66202521C>