public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Hans de Goede <hdegoede@redhat.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] sunxi: Machine id hack to prevent loading buggy sunxi-3.4 kernels
Date: Fri, 20 Feb 2015 10:19:51 +0100	[thread overview]
Message-ID: <54E6FC37.10104@redhat.com> (raw)
In-Reply-To: <1424419706-4687-1-git-send-email-siarhei.siamashka@gmail.com>

Hi,

On 20-02-15 09:08, Siarhei Siamashka wrote:
> 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:
>
>    "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 can implement a revision compatibility
> check and clear the top 4 bits of the machine id if everything is
> alright.
>
> Signed-off-by: Siarhei Siamashka <siarhei.siamashka@gmail.com>

TBH I'm not a big fan if this.

> ---
>
> To be used together with:
>      https://groups.google.com/forum/#!topic/linux-sunxi/LOAxP3kAYs8

Nor of this one.

What I would prefer is for CONFIG_OLD_SUNXI_KERNEL_COMPAT to go away
and for u-boot to automatically do the right thing when booting an old
kernel.

Recently some patches where merged to make "bootm" work without an
fdt even when build with fdt support.

Specifically in common/image-fdt.c line 437 there is:

         if (!select && ok_no_fdt) {
                 debug("Continuing to boot without FDT\n");
                 return 0;
         }

So we known when executing the bootm command that we do not have an fdt.

If this is the case, and only when this (no fdt) is the case then in
arch/arm/lib/bootm.c: boot_prep_linux()

The board specific setup_board_tags() function gets called, we could
define our own version of this (it has an empty weak default), and in
our own version fixup things for the old kernel to just work.

That means:

Halving PLL5, then waiting for it to settle, then reprogramming the
DRAM clk divider, I'm assuming that this will work if done in this
order, but we obviously need to test this thoroughly.

Halving PLL6, then waiting for it to settle, then reprogram the MBUS
divider, and check and update mmc mod clock dividers.

Modifying armv7_boot_nonsec so that we can override the default. We
can do this e.g. by adding a global armv7_boot_nonsec_default variable
and setting that from setup_board_tags().

This way we can just do the right thing automatically, and this has
the added advantage that if we later find out that we're doing
something in u-boot which is not good for the older kernels we can
fix it in u-boot without needing to coordinate with the sunxi-3.4
kernels. In my experience the version check for compatibility style
solution you are proposing brings a large maintenance burden, and
it does not actually help the user, as the users wants something
which just works.

Ian, would something like the above be acceptable to you ?

Regards,

Hans

  reply	other threads:[~2015-02-20  9:19 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-20  8:08 [U-Boot] [PATCH] sunxi: Machine id hack to prevent loading buggy sunxi-3.4 kernels Siarhei Siamashka
2015-02-20  9:19 ` Hans de Goede [this message]
2015-02-20 10:36   ` Siarhei Siamashka
2015-02-20 14:11     ` Hans de Goede
2015-02-20 18:33       ` Siarhei Siamashka
2015-02-21  9:41         ` Hans de Goede
2015-02-21 10:26           ` Ian Campbell
2015-02-21 10:49             ` Hans de Goede
2015-02-21 13:11               ` Siarhei Siamashka
2015-02-21 14:34                 ` Hans de Goede
2015-02-28 16:18               ` Ian Campbell
2015-03-01 22:07                 ` Siarhei Siamashka
2015-03-03  8:17                   ` Ian Campbell
2015-03-04 15:17                     ` Siarhei Siamashka
2015-03-04 21:37                       ` [U-Boot] [linux-sunxi] " Michal Suchanek
2015-03-02  8:40                 ` [U-Boot] " Hans de Goede
2015-09-25 18:33           ` [U-Boot] Improving DRAM settings for Allwinner A10/A13/A20 devices Siarhei Siamashka

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=54E6FC37.10104@redhat.com \
    --to=hdegoede@redhat.com \
    --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