All of lore.kernel.org
 help / color / mirror / Atom feed
From: david.jander@protonic.nl (David Jander)
To: linux-arm-kernel@lists.infradead.org
Subject: ARM Machine SoC I/O setup and PAD initialization code
Date: Thu, 22 Jul 2010 14:10:09 +0200	[thread overview]
Message-ID: <201007221410.10087.david.jander@protonic.nl> (raw)
In-Reply-To: <AANLkTinQS3vkua2dW0iPpXKDJizVIIKgqcBol2FhuRW_@mail.gmail.com>


Hi all,

Thanks for all the reactions.

On Thursday 22 July 2010 10:16:17 am Magnus Damm wrote: 
> <linux@arm.linux.org.uk> wrote:
> > On Thu, Jul 22, 2010 at 11:32:53AM +0900, Simon Horman wrote:
> >> Would it be feasible to  use Linux + kexec as the boot loader as
> >> a long term solution to fixing boot loaders by eliminating them?
> >
> > So what you're proposing is that a broken boot loader should boot a
> > version of Linux to fix the pin MUX, which then kexecs a kernel which
> > doesn't have that code?
> 
> I think Simon was proposing to remove the broken boot loader.

IMO, if a bootloader is broken (in any way), it needs replacing. Be it with 
another bootloader or directly with the kernel.
I am working on i.MX51 right now, and that chip has it's own tiny bootloader 
in ROM, which is able to load an image from SPI-NOR, SDHC, NAND, and some 
other places, as well as initialize the DRAM controller with settings 
contained at the beginning of the boot image. In theory it could just as well 
boot a linux kernel directly. There is no real need for RedBoot, u-boot or 
whatever other bootloader. In that case, all hardware setup code needs to be 
done in the boot-code of the kernel.

> > What's the point of that - when the first kernel will be able to run
> > the system?
> 
> If you boot straight into a Linux kernel (CONFIG_ZBOOT_ROM on ARM ?)
> and use that to boot your real system, then at least you only need one
> copy of pinmux setup code. If it gets executed once or twice is a
> matter of system configuration IMO.

That sounds a lot "saner" to me than having two asynchronous and different 
copies of setup-code, which could be a potential nightmare, besides not being 
really maintainable.

> That aside, not trusting the boot loader is probably a good idea. =)

Why? If there's a boot-loader, it should know the correct hardware setup much 
better than any other piece of software.
Its fundamental role _IS_ basic hardware setup!

If bootloaders are broken, and delivered with the hardware, you should either 
complain to the hardware manufacturer or fix the bootloader yourself if 
possible... but not work around it.

Most of the time, if there are minor hardware changes, the linux kernel 
shouldn't be involved if it is not necessary. The BIOS/Bootloader should 
implement the necessary setup changes (if any). That way you don't need 
different kernels for different hardware revisions.

The rationale is simple: The bootloader is bound to and unique to the specific 
board configuration and -revision, whereas the kernel shoudn't change for a 
given platform. Ideally one whould compile one kernel for a generic type of 
i.MX51 machine, and that kernel should just work on all of them, that are 
generic enough. An example of how to accomplish this is Open-Firmware device-
tree support on the PowerPC architecture.

Right now you need different BSPs for all different i.MX51 boards (you can 
compile them all in at once, ok), and potentially also for different revisions 
of the same board.

The discussion sparked unintentionally by this thread is quite interesting, 
and it seems that there are (as always) more than one possible solution 
(kexec, etc). May I suggest Open-Firmrea device-trees and fixed bootloaders as 
another one?

@Russell: I know, I am being optimistic and arrogant here, my excuses if that 
offends you, but I simply can't believe the general state of bootloaders and 
hardware platforms for ARM is so terribly broken, that it can't be fixed in 
"the right way".

As for my own part of responsibility, I am designing a new ARM-based board 
right now (actually working on a prototype already), and I am determined to 
deliver a bootloader that does all hardware setup correctly, and the linux BSP 
I am writing will have no pad-setup code whatsoever. That's a promise!

Best regards,

-- 
David Jander
Protonic Holland.

  reply	other threads:[~2010-07-22 12:10 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-21  8:29 ARM Machine SoC I/O setup and PAD initialization code David Jander
2010-07-21  8:47 ` Russell King - ARM Linux
2010-07-22  2:32   ` Simon Horman
2010-07-22  7:20     ` Russell King - ARM Linux
2010-07-22  7:29       ` Simon Horman
2010-07-22  8:38         ` Magnus Damm
2010-07-22  8:49           ` Eric Miao
2010-07-22  9:01             ` Magnus Damm
2010-07-22  9:02             ` Russell King - ARM Linux
2010-07-22  8:46         ` Russell King - ARM Linux
2010-07-22  9:14           ` Simon Horman
2010-07-24 21:36         ` Grant Likely
2010-07-22  8:16       ` Magnus Damm
2010-07-22 12:10         ` David Jander [this message]
2010-07-22 12:35           ` Russell King - ARM Linux
2010-07-22 12:56           ` Mark Brown
2010-07-22 13:31             ` David Jander
2010-07-22 13:54               ` Russell King - ARM Linux
2010-07-23 10:35                 ` David Jander
2010-07-23 13:02                   ` Russell King - ARM Linux
2010-07-22 14:20               ` Mark Brown
2010-07-23 10:18                 ` David Jander
2010-07-23 12:57                   ` Russell King - ARM Linux
2010-07-23 14:17                   ` Mark Brown
2010-07-23 18:38                     ` david at protonic.nl
2010-07-23 19:59                       ` Jason McMullan
2010-07-23 21:03                       ` Robert Schwebel
2010-07-26  1:37                         ` Magnus Damm
2010-07-26  6:56                           ` Robert Schwebel
2010-07-24 18:50                       ` Mark Brown
2010-07-22 15:00               ` Nicolas Pitre
2010-07-23 10:31                 ` David Jander
2010-07-22 13:41           ` Rob Herring
2010-07-22 21:20 ` Linus Walleij

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201007221410.10087.david.jander@protonic.nl \
    --to=david.jander@protonic.nl \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.