Re: [Balloon] Minor bootldr change for Balloon 3

Top Page
Attachments:
Message as email
+ (text/plain)
Delete this message
Reply to this message
Author: Wookey
Date:  
To: balloon
Subject: Re: [Balloon] Minor bootldr change for Balloon 3
On 2008-12-03 17:57 +0000, Chris Jones wrote:
> I've just been playing with an application which needed the 48MHz clock
> output from the PXA270. We've allocated the pin for it but nothing was
> coming out. A bit of trial and error (the Intel documentation was no
> help at all) revealed that it is shared with the USB device clock, and
> thus has to be enabled in the CKEN register.
>
> I've modded bootldr (in the branches/bootldr32-pxa-sa1100 branch) so
> that it enables this by default. This should be of benefit to many
> applications which want to use the FPGA. It shouldn't break anything
> else, but I'm prepared to be proven wrong.
>
> I also noticed that the Balloon-specific GPIO Alternate Function
> register settings were #ifdef'ed by a CONFIG_MACH_H5400, which made no
> sense at all to me, and may even have meant that bootldr wasn't taking
> any notice of them (there is another set of bare hex numbers of unknown
> provenance in the relevant #else clause). They're already encased in a
> #ifdef CONFIG_MACH_BALLOON, so I removed the #ifdef CONFIG_MACH_H5400.
> The values we spent so long carefully defining in balloon3-init.h are
> thus absolutely, definitely the ones getting used now, which can only be
> a good thing. Probably.


I've transferred that to the trunk version of bootldr. Along with
recent fixes for resuming.

As ever I get a really icky feeling when looking at any of the bootldr
code.

This stuff makes me notice that there is a load of register setup that
is done in bootldr, but not in the kernel, to the extent that, for
example, samosa/minipug display does not work unless the right version
of bootldr is installed. This is very bad.

The kernel should be doing as much of this setup as possible, and not
relying on the bootloader to do it. (i.e loading the samosa module
should set everything it needs, not rely on some of its needs being
set up in bootloader). In general bootloaders should set up memory
timings and uarts and whatever is needed to load the kernel image, but
nothing much else before calling the kernel. However there are issues
of sequencing in startup which may mean that some of this stuff needs
to stay where it is and can't be moved into kernel code.

Can anyone (looking at you Chris) tell me which bits can be safely
moved or re-initialised later or do I just have to read all the PXA
docs and/or just try it?

Obviously people using bootldr with something other than linux will
appreciate its attempt to do much of the kernel's set-up job, but that
should be arranged to happen in that context, and not when it's
innapropriate.

Wookey
--
Principal hats: Balloonz - Toby Churchill - Aleph One - Debian
http://wookware.org/