From: Thomas Petazzoni <thomas.petazzoni-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
To: "jonsmirl-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org"
<jonsmirl-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: "devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
<devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Subject: Re: CPU revision IDs
Date: Fri, 13 Jun 2014 14:43:55 +0200 [thread overview]
Message-ID: <20140613144355.20412fa6@free-electrons.com> (raw)
In-Reply-To: <CAKON4OwNULPeQFHwRhRfri86yexMvvKfrw_dthim4_oPWvMD3g-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
Hello,
On Fri, 13 Jun 2014 08:29:41 -0400, jonsmirl-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org wrote:
> How are CPU revision IDs encoded into the device tree? It is not
> reasonable to ask people to manually identify their revision and then
> use the right device tree. For example a heat sink may obscure the
> markings. The CPU ID is needed for device driver quirks.
>
> I was thinking of doing something like adding code at early boot that
> fixes up the root compatible string. The revision is a
> property of the CPU.
>
> Code changes this:
> compatible = "cubietech,cubietruck", "allwinner,sun7i-a20"
> to:
> compatible = "cubietech,cubietruck", "allwinner,sun7i-a20a",
> "allwinner,sun7i-a20"
>
> Alternatively this could be done in uboot.
>
> Browsing around the kernel code there seems to be multiple solutions
> to this problem. For example this Marvell code modifies the device
> driver compatible string.
>
> http://lxr.free-electrons.com/source/arch/arm/mach-mvebu/board-v7.c#L71
Yes, the way we handle that on Marvell EBU platforms is that we runtime
detect the revision of the SoC, and use this information to adjust the
Device Tree information for this or that device that is known to have
issues/differences. For example, early revisions of Armada XP
processors have an issue in the I2C controller which prevents an
optimization feature from being used, so the code in board-v7.c detects
this early revision, and changes the Device Tree compatible string used
to probe the I2C controller, to a different compatible string that lets
the driver know that the feature shouldn't be used.
Best regards,
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2014-06-13 12:43 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-13 12:29 CPU revision IDs jonsmirl-Re5JQEeQqe8AvxtiuMwx3w
[not found] ` <CAKON4OwNULPeQFHwRhRfri86yexMvvKfrw_dthim4_oPWvMD3g-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-06-13 12:43 ` Thomas Petazzoni [this message]
[not found] ` <20140613144355.20412fa6-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
2014-06-13 12:56 ` Arnd Bergmann
2014-06-13 13:05 ` jonsmirl-Re5JQEeQqe8AvxtiuMwx3w
[not found] ` <CAKON4OxzJ7UoKnMgf+sckksjG-rx8NG1tUvPj2qaHNsda0j3jQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-06-13 13:08 ` Arnd Bergmann
2014-06-13 13:14 ` jonsmirl-Re5JQEeQqe8AvxtiuMwx3w
[not found] ` <CAKON4Ox+tCgiu6N988ds7ED2KbECw=60Y6BRqV_2UcM+vshw4Q-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-06-13 13:20 ` Maxime Ripard
2014-06-13 13:34 ` jonsmirl-Re5JQEeQqe8AvxtiuMwx3w
[not found] ` <CAKON4OxZLaL9sJFPjnUhec_LMZKGvGXrKyUjW-whHzY6byVUxw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-06-13 13:58 ` Maxime Ripard
2014-06-13 14:37 ` jonsmirl-Re5JQEeQqe8AvxtiuMwx3w
[not found] ` <CAKON4Oz44X7G+yM2R-XX_D_6FV4ekWiOKY2t_p0Y3+gUXJ17iw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-06-18 8:07 ` Maxime Ripard
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=20140613144355.20412fa6@free-electrons.com \
--to=thomas.petazzoni-wi1+55scjutkeb57/3fjtnbpr1lh4cv8@public.gmane.org \
--cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=jonsmirl-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.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.