linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Leonard Crestez <leonard.crestez@nxp.com>
To: "l.stach@pengutronix.de" <l.stach@pengutronix.de>,
	Abel Vesa <abel.vesa@nxp.com>, Anson Huang <anson.huang@nxp.com>
Cc: dl-linux-imx <linux-imx@nxp.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Fabio Estevam <fabio.estevam@nxp.com>, Ye Li <ye.li@nxp.com>,
	"robh@kernel.org" <robh@kernel.org>,
	"shawnguo@kernel.org" <shawnguo@kernel.org>,
	"linux-arm-kernel@lists.infradead.org" 
	<linux-arm-kernel@lists.infradead.org>,
	"kernel@pengutronix.de" <kernel@pengutronix.de>
Subject: Re: [RESEND v2] soc: imx: Add generic i.MX8 SoC driver
Date: Thu, 28 Mar 2019 16:43:55 +0000	[thread overview]
Message-ID: <8df8afc4a50512d28247743e06f9ed30534da921.camel@nxp.com> (raw)
In-Reply-To: <1553273350-28852-1-git-send-email-abel.vesa@nxp.com>

On Fri, 2019-03-22 at 16:49 +0000, Abel Vesa wrote:
> Add generic i.MX8 SoC driver along with the i.MX8MQ SoC specific code.
> For now, only i.MX8MQ revision B1 is supported. For any other, i.MX8MQ
> revision it will print 'unknown'.

> +#define REV_B1				0x21
> +
> +#define IMX8MQ_SW_INFO_B1		0x40
> +#define IMX8MQ_SW_MAGIC_B1		0xff0055aa
> +
> +	np = of_find_compatible_node(NULL, NULL, "fsl,imx8mq-ocotp");+
> +	ocotp_base = of_iomap(np, 0);
> +
> +	magic = readl_relaxed(ocotp_base + IMX8MQ_SW_INFO_B1);
> +	if (magic == IMX8MQ_SW_MAGIC_B1)
> +		rev = REV_B1;

This is based on ATF code in vendor tree, but shouldn't we have some
sort of explanation for this "magic"?

Looking at the OCOTP driver reg 0x40 is IMX_OCOTP_ADDR_DATA2 and it's
used as part of fuse writes. According to the driver code 8mq is
compatible with 7d and this write path is enabled for imx8mq-ocotp. 

Looking at the OCOTP manual reg 0x40 is OCOTP_HW_OCOTP_READ_FUSE_DATA
and it's meant to be used together with IMX_OCOTP_ADDR_CTRL to read
info. Maybe my manual (rev0 2018-01) is incorrect?

Looking at the manual this will return the value of the fuse last
requested via IMX_OCOTP_ADDR_CTRL but no such request is made in this
driver. So reading from OCOTP 0x40 might return an unrelated value?!

The manual does document that fuse 0x440[3:0] is a "silicon revision
number"; maybe we should read that?

--
Regards,
Leonard

  reply	other threads:[~2019-03-28 16:44 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-22 16:49 [RESEND v2] soc: imx: Add generic i.MX8 SoC driver Abel Vesa
2019-03-28 16:43 ` Leonard Crestez [this message]
2019-04-18 22:01   ` Leonard Crestez
2019-04-20 13:26 ` Shawn Guo

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=8df8afc4a50512d28247743e06f9ed30534da921.camel@nxp.com \
    --to=leonard.crestez@nxp.com \
    --cc=abel.vesa@nxp.com \
    --cc=anson.huang@nxp.com \
    --cc=fabio.estevam@nxp.com \
    --cc=kernel@pengutronix.de \
    --cc=l.stach@pengutronix.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-imx@nxp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=robh@kernel.org \
    --cc=shawnguo@kernel.org \
    --cc=ye.li@nxp.com \
    /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).