linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: shawnguo@kernel.org (Shawn Guo)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] ARM: imx: Improve the soc revision calculation flow
Date: Fri, 2 Feb 2018 13:27:36 +0800	[thread overview]
Message-ID: <20180202052734.GH20833@dragon> (raw)
In-Reply-To: <AM3PR04MB306176538988C3363E4EE5380E00@AM3PR04MB306.eurprd04.prod.outlook.com>

On Fri, Jan 26, 2018 at 07:59:46AM +0000, A.s. Dong wrote:
> > @@ -127,45 +130,26 @@ void __init imx_init_revision_from_anatop(void)
> >  	digprog = readl_relaxed(anatop_base + offset);
> >  	iounmap(anatop_base);
> > 
> > -	switch (digprog & 0xff) {
> > -	case 0:
> > -		/*
> > -		 * For i.MX6QP, most of the code for i.MX6Q can be resued,
> > -		 * so internally, we identify it as i.MX6Q Rev 2.0
> > -		 */
> > -		if (digprog >> 8 & 0x01)
> > -			revision = IMX_CHIP_REVISION_2_0;
> > -		else
> > -			revision = IMX_CHIP_REVISION_1_0;
> > -		break;
> > -	case 1:
> > -		revision = IMX_CHIP_REVISION_1_1;
> > -		break;
> > -	case 2:
> > -		revision = IMX_CHIP_REVISION_1_2;
> > -		break;
> > -	case 3:
> > -		revision = IMX_CHIP_REVISION_1_3;
> > -		break;
> > -	case 4:
> > -		revision = IMX_CHIP_REVISION_1_4;
> > -		break;
> > -	case 5:
> > -		/*
> > -		 * i.MX6DQ TO1.5 is defined as Rev 1.3 in Data Sheet, marked
> > -		 * as 'D' in Part Number last character.
> > -		 */
> > -		revision = IMX_CHIP_REVISION_1_5;
> > -		break;
> > -	default:
> > -		/*
> > -		 * Fail back to return raw register value instead of 0xff.
> > -		 * It will be easy to know version information in SOC if it
> > -		 * can't be recognized by known version. And some chip's
> > (i.MX7D)
> > -		 * digprog value match linux version format, so it needn't map
> > -		 * again and we can use register value directly.
> > +	/*
> > +	 * On i.MX7D digprog value match linux version format, so
> > +	 * it needn't map again and we can use register value directly.
> > +	 */
> > +	if (of_device_is_compatible(np, "fsl,imx7d-anatop")) {
> > +		revision = digprog & 0xff;
> > +	} else {
> > +
> > +		/* MAJOR: [15:8], the major silicon revison;
> > +		 * MINOR: [7: 0], the minor silicon revison;
> > +		 *
> > +		 * please refer to the i.MX RM for the detailed
> > +		 * silicon revison bit define.
> > +		 * format the major part and minor part to match the
> > +		 * linux kernel soc version format.
> >  		 */
> >  		revision = digprog & 0xff;
> 
> Unneeded line?

+1

Shawn

  reply	other threads:[~2018-02-02  5:27 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-09  8:30 [PATCH] ARM: imx: Improve the soc revision calculation flow Bai Ping
2018-01-09 10:58 ` A.s. Dong
2018-01-09 11:07   ` Jacky Bai
2018-01-09 11:10     ` A.s. Dong
2018-01-26  7:59 ` A.s. Dong
2018-02-02  5:27   ` Shawn Guo [this message]
2018-02-02  5:30     ` Jacky Bai

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=20180202052734.GH20833@dragon \
    --to=shawnguo@kernel.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).