public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Ian Campbell <ijc+uboot@hellion.org.uk>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v2] sunxi: Machine id hack to prevent loading buggy sunxi-3.4 kernels
Date: Sat, 21 Feb 2015 10:27:00 +0000	[thread overview]
Message-ID: <1424514420.25370.58.camel@hellion.org.uk> (raw)
In-Reply-To: <1424496849-16955-1-git-send-email-siarhei.siamashka@gmail.com>

On Sat, 2015-02-21 at 07:34 +0200, Siarhei Siamashka wrote:
> Right now U-Boot supports the CONFIG_OLD_SUNXI_KERNEL_COMPAT option,
> which makes it go out of its way in limiting the selection of PLL clock
> frequencies and PMIC voltages in order not to upset outdated buggy
> sunxi-3.4 kernel releases. And if the CONFIG_OLD_SUNXI_KERNEL_COMPAT
> option is not set, then booting such old kernels exhibits various
> failures at runtime. This is very user unfriendly, and there were
> already several incidents when people wasted their time being hit
> by these runtime failures and trying to debug them.
> 
> The right solution is not to add hacks and workarounds to the mainline
> U-Boot, but to fix these bugs in the sunxi-3.4 kernel. And in fact,
> the updated sunxi-3.4 kernels already exist. Still we need to follow
> the 'Principle of Least Surprise' and U-Boot needs to ensure that
> the old buggy kernels are not getting happily booted when the
> CONFIG_OLD_SUNXI_KERNEL_COMPAT option is not set. And this patch
> addresses this particular issue.
> 
> This patch makes U-Boot store the 'compatibility revision' number in
> the top 4 bits of the machine id and pass it to the kernel. The old
> buggy kernels will fail to load with a very much googlable error
> message on the serial console (the "r1 = 0x100010bb" part of it):
> 
>   "Error: unrecognized/unsupported machine ID (r1 = 0x100010bb)"
> 
> This error message can be documented in the linux-sunxi wiki with
> proper explanations about how to resolve this situation and where
> to get the necessary bugfixes for the sunxi-3.4 kernel.
> 
> The fixed sunxi-3.4 kernels implement a revision compatibility check
> and clear the top 4 bits of the machine id if everything is alright.
> By accepting the machine id with the bits 31:28 set to 1, the sunxi-3.4
> kernel effectively certifies that it has the PLL5 clock speed and
> AXP209 DCDC3 voltage fixes applied.
> 
> It is still possible to set the CONFIG_OLD_SUNXI_KERNEL_COMPAT option
> in U-Boot if the user desires to use an outdated unpatched sunxi-3.4
> kernel.
> 
> Signed-off-by: Siarhei Siamashka <siarhei.siamashka@gmail.com>

Acked-by: Ian Campbell <ijc@hellion.org.uk>

      reply	other threads:[~2015-02-21 10:27 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-21  5:34 [U-Boot] [PATCH v2] sunxi: Machine id hack to prevent loading buggy sunxi-3.4 kernels Siarhei Siamashka
2015-02-21 10:27 ` Ian Campbell [this message]

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=1424514420.25370.58.camel@hellion.org.uk \
    --to=ijc+uboot@hellion.org.uk \
    --cc=u-boot@lists.denx.de \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox