All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Nelson <eric.nelson@boundarydevices.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 1/2] nitrogen6x: Pass the correct CPU revision to the kernel
Date: Sat, 16 Mar 2013 13:27:13 -0700	[thread overview]
Message-ID: <5144D5A1.2020302@boundarydevices.com> (raw)
In-Reply-To: <CAOMZO5C0Wi8qf82KDspM0=ZyMn8DBh3b215e-PmWJjDu7=sMUQ@mail.gmail.com>

Hi Fabio,

On 03/16/2013 12:48 PM, Fabio Estevam wrote:
> Hi Eric,
>
> On Sat, Mar 16, 2013 at 1:13 PM, Eric Nelson
> <eric.nelson@boundarydevices.com> wrote:
>
>> At the moment, it doesn't.
>>
>> I would really like to see us (the i.MX6 community) standardize
>> the use of some fuses to specifically mean board revision.
>>
>> We're contemplating some board changes such as switching the
>> ethernet PHY and having a convention for the use of a few
>> bits in OTP would allow us to implement get_board_rev() once in
>> a common place.
>>
>> Over the lifetime of most boards, it's likely that at least
>> one board revision will have software implications and having
>> a common way to express/detect this could prevent some churn
>> in board-specific files.
>>
>> Such a convention would need to have broad sign off though.
>>
>> Let me know your thoughts on the subject.
>
> Would this approach work?
>
> http://git.freescale.com/git/cgit.cgi/imx/uboot-imx.git/tree/board/freescale/common/fsl_sys_rev.c?h=imx_v2009.08_3.0.0
>

I think this mixes apples and oranges a bit.

	/* Get Board ID information from OCOTP_GP1[15:8]
	 * bit 12-15: Board type
	 * 0x0 : Unknown
	 * 0x1 : Sabre-AI (ARD)
	 * 0x2 : Smart Device (SD)
	 * 0x3 : Quick-Start Board (QSB)
	 * 0x4 : SoloLite EVK (SL-EVK)
	 *
	 * bit 8-11: Board Revision ID
	 * 0x0 : Unknown or latest revision
	 * 0x1 : RevA board
	 * 0x2 : RevB
	 * 0x3 : RevC
	 *
	 * exp:
	 * i.MX6Q ARD RevA:     0x11
	 * i.MX6Q ARD RevB:     0x12
	 * i.MX6Solo ARD RevA:  0x11
	 * i.MX6Solo ARD RevB:  0x12
	 */

Bits 8-11 seem reasonable, though the comment for zero
is probably bad. It seems that as soon as a board needs
to make a decision based on board revision, it will add
a requirement for a non-zero (programmed) fuse, so the
"latest" will be non-zero by definition.

Four bits also seems like plenty for a revision of a
given board type.

The board type bits above are a bit parochial. You may be able
to list Freescale boards with only four bits, but I would expect the
number of down-stream board types to be in the hundreds, so
it seems this is better left in CONFIG_MACH_TYPE.

The CPU and silicon revision is already available in other
ways and programmed at the Freescale factory.

So for the purposes of get_board_rev(), I think we just
need to identify some bits in an OTP register, define them
as the standard and have get_board_rev() return their value.

That said, I don't think any of this can or should be done
without identifying the down-stream code that might break.

I've seen code that scrapes /proc/cpuinfo for the "Revision:"
line and uses that.

My memory is hazy, but I think it was in either or both the
gstreamer plugins or an "FSL Power Monitor" applet in Android.

I don't recall seeing it in any VPU-related code. Dirk, do you
have a reference there?

I'll try to do some tests of different userspaces with
get_board_rev() returning zero and see what breaks.

Regards,


Eric

  reply	other threads:[~2013-03-16 20:27 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-15 21:06 [U-Boot] [PATCH 1/2] nitrogen6x: Pass the correct CPU revision to the kernel Fabio Estevam
2013-03-15 21:06 ` [U-Boot] [PATCH 2/2] mx6qsabrelite: Do not hardcode the CPU revision Fabio Estevam
2013-03-16  5:59   ` Dirk Behme
2013-03-16  8:19     ` Wolfgang Denk
2013-03-16 14:50     ` Fabio Estevam
2013-03-16 14:52       ` Otavio Salvador
2013-03-16 15:01         ` Fabio Estevam
2013-03-16 16:32           ` Otavio Salvador
2013-03-16 19:41     ` Fabio Estevam
2013-03-16  0:20 ` [U-Boot] [PATCH 1/2] nitrogen6x: Pass the correct CPU revision to the kernel Eric Nelson
2013-03-16 14:58   ` Fabio Estevam
2013-03-16 16:13     ` Eric Nelson
2013-03-16 16:55       ` Dirk Behme
2013-03-16 20:17         ` Wolfgang Denk
2013-03-16 19:48       ` Fabio Estevam
2013-03-16 20:27         ` Eric Nelson [this message]
2013-03-25 19:14           ` Eric Nelson
2013-03-26  2:25             ` Fabio Estevam
2013-03-26  3:27               ` Fabio Estevam
2013-03-16 20:29         ` Wolfgang Denk
2013-03-16 20:14       ` Wolfgang Denk
2013-03-26 15:24 ` Eric Nelson
2013-03-26 15:26   ` Eric Nelson
2013-03-26 18:06   ` Fabio Estevam

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=5144D5A1.2020302@boundarydevices.com \
    --to=eric.nelson@boundarydevices.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 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.