Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp1084637yba; Thu, 18 Apr 2019 15:03:26 -0700 (PDT) X-Google-Smtp-Source: APXvYqw3+iwJivIkh3M8V2a29mglkkWiSyk9TOkwU9rwvtUoytHGpBkP9CWUjQFdgWaGkUVrXju3 X-Received: by 2002:a62:70c6:: with SMTP id l189mr100074465pfc.139.1555625006462; Thu, 18 Apr 2019 15:03:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555625006; cv=none; d=google.com; s=arc-20160816; b=hUB0qk4HHAyb2hxpGF213uqThdbdPLX8j0pkCzpgb4K5e14aBTJsWve6wmWgCycwj9 un7icGQarX4dH8hBZebRD25eg/uX21uPPQfJ/Z6XvYNWJyo3nBfx1QPDrvRpvpHdFfpH kqPD+WutGJn1FSWcNjRyG7xfdAh9nPsoDnB8WEdlXbdoVQ9dt8jcF3wlkTnEcyOdRJDI C3Upj6cat/931VycWFTWfh4cJTP26d6JidUzd32uOTscTtfD3xLjCUxNb1PrXVR4eEsB 0ItYj72hHJWSPve7AsH5ze/2taVbnSzZ6H3s7yZlIlUCHY2Ua4Uf8NijLdFtJeNQtHuN MQmQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :content-language:accept-language:references:message-id:date :thread-index:thread-topic:subject:cc:to:from:dkim-signature; bh=+PMUOkAg8O+jVts1qENA64Kkwnble1HykdvZSn5XaUA=; b=a2ZmzXIScfs8tI8E8yxVuxYnuWIsQwlCGr973+k9jnB1MR5TaYY+5JJxbnk165sJy5 mjWO9EHmIIEmipoUK4jliUBqY4RaBDxU0c5OnzuORGeeNNPeyj5rCSNatD4QjkSFqQu7 x8hovRXhAF2emO/3PVKT5OywkSQBZgG78n2SU0jucTyhUFRUUHtF2x/3ipA2Am+DN0Kk xN1wKcbGJITAuTiRnbXrN0AhbHWP2Lw2Lq6tcH0Q71TQruP6LhSjohCQtsEtKurgew9n 9ym3UNkHZuWFDqXrQeYT9LnedZpiUtyt1Hk96dhFMTRNRLEopDgxmzug5ryuZ32WqPmk pm1A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector1 header.b=dRBEQHhP; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i3si2771697pgq.350.2019.04.18.15.03.11; Thu, 18 Apr 2019 15:03:26 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@nxp.com header.s=selector1 header.b=dRBEQHhP; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726087AbfDRWBa (ORCPT + 99 others); Thu, 18 Apr 2019 18:01:30 -0400 Received: from mail-eopbgr150053.outbound.protection.outlook.com ([40.107.15.53]:44230 "EHLO EUR01-DB5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725815AbfDRWB3 (ORCPT ); Thu, 18 Apr 2019 18:01:29 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=+PMUOkAg8O+jVts1qENA64Kkwnble1HykdvZSn5XaUA=; b=dRBEQHhPQjE6pJGyvUoNGpHOx1sLGeARCLqTpAGoPWsb1FA/yX2Rwa544DoZhgJ/q2pBFkzyaYNPxgst3rcjcmbZT/ZwjHL1p02a7QdndVLeufbtR4NiJEDJ1/Vg5sPT8sycjlR1LvkdeTIh9PxSeHnmOY9LDXyaPHeRilkpLbE= Received: from VI1PR04MB5533.eurprd04.prod.outlook.com (20.178.122.159) by VI1PR04MB6000.eurprd04.prod.outlook.com (20.178.123.215) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1792.18; Thu, 18 Apr 2019 22:01:24 +0000 Received: from VI1PR04MB5533.eurprd04.prod.outlook.com ([fe80::cca7:43cf:dc13:a822]) by VI1PR04MB5533.eurprd04.prod.outlook.com ([fe80::cca7:43cf:dc13:a822%4]) with mapi id 15.20.1813.011; Thu, 18 Apr 2019 22:01:24 +0000 From: Leonard Crestez To: Lucas Stach , Abel Vesa , Peng Fan CC: Anson Huang , dl-linux-imx , "linux-kernel@vger.kernel.org" , Fabio Estevam , Ye Li , "robh@kernel.org" , "shawnguo@kernel.org" , "linux-arm-kernel@lists.infradead.org" , "kernel@pengutronix.de" Subject: Re: [RESEND v2] soc: imx: Add generic i.MX8 SoC driver Thread-Topic: [RESEND v2] soc: imx: Add generic i.MX8 SoC driver Thread-Index: AQHU4M8x51owZIDO7UOOFQ/teNRhvw== Date: Thu, 18 Apr 2019 22:01:24 +0000 Message-ID: References: <1553273350-28852-1-git-send-email-abel.vesa@nxp.com> <8df8afc4a50512d28247743e06f9ed30534da921.camel@nxp.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=leonard.crestez@nxp.com; x-originating-ip: [192.88.166.1] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 114e39aa-fcad-4a56-63cd-08d6c4496665 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(5600141)(711020)(4605104)(4618075)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7193020);SRVR:VI1PR04MB6000; x-ms-traffictypediagnostic: VI1PR04MB6000: x-ms-exchange-purlcount: 1 x-microsoft-antispam-prvs: x-forefront-prvs: 0011612A55 x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(39860400002)(136003)(346002)(396003)(366004)(376002)(199004)(189003)(97736004)(54906003)(81156014)(99286004)(8676002)(966005)(110136005)(25786009)(53936002)(316002)(9686003)(6306002)(66446008)(64756008)(55016002)(91956017)(73956011)(66946007)(7696005)(6506007)(52536014)(5660300002)(53546011)(102836004)(6246003)(76176011)(6636002)(68736007)(186003)(71200400001)(86362001)(71190400001)(26005)(229853002)(81166006)(33656002)(446003)(7736002)(256004)(2906002)(14454004)(478600001)(66066001)(305945005)(6436002)(3846002)(8936002)(476003)(4326008)(44832011)(6116002)(74316002)(66476007)(486006)(66556008)(76116006)(41533002);DIR:OUT;SFP:1101;SCL:1;SRVR:VI1PR04MB6000;H:VI1PR04MB5533.eurprd04.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; received-spf: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: O24oPMnWFWNr/8qCInWOymx4Qc89i8cJYvF+L8+ktA87L4OKOJefLlC+KAxGiK0og6EjSmRF+BNSIbHy7BshHnRNOQaSHigw0IfHP00vNhDunbmm0c5WMSbRErMqfrmce7DwS7tnGrl36Cic4eiD+zz+9+I9oV5npzWPdNorkIKwr+ydqEgGoVjAf68LvSH8kxhspB6Wt82IPkZWgqC6/T9qlW/haMOJ41L5gtsMADnv35fqmHu16z1WAVUPwufFJSs3xv+xgIjXZnwQtryBNGDU77BSvloukXw/HnU5dxEAiaeqbevlQ0wTBZSpqu8z1f93nf+7j5qT6zKcQG8MnwVkuVGADggNO5BMzu7D9m1zsJ8+x0b1nkSlTymGmJZITdFSsoKeZvSg0EhLUicNJuNhAdIQ9DosH7s0lYvK7x8= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 114e39aa-fcad-4a56-63cd-08d6c4496665 X-MS-Exchange-CrossTenant-originalarrivaltime: 18 Apr 2019 22:01:24.8480 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB6000 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 3/28/2019 6:43 PM, Leonard Crestez wrote:=0A= > On Fri, 2019-03-22 at 16:49 +0000, Abel Vesa wrote:=0A= >> Add generic i.MX8 SoC driver along with the i.MX8MQ SoC specific code.= =0A= >> For now, only i.MX8MQ revision B1 is supported. For any other, i.MX8MQ= =0A= >> revision it will print 'unknown'.=0A= > =0A= >> +#define REV_B1 0x21=0A= >> +=0A= >> +#define IMX8MQ_SW_INFO_B1 0x40=0A= >> +#define IMX8MQ_SW_MAGIC_B1 0xff0055aa=0A= >> +=0A= >> + np =3D of_find_compatible_node(NULL, NULL, "fsl,imx8mq-ocotp");+=0A= >> + ocotp_base =3D of_iomap(np, 0);=0A= >> +=0A= >> + magic =3D readl_relaxed(ocotp_base + IMX8MQ_SW_INFO_B1);=0A= >> + if (magic =3D=3D IMX8MQ_SW_MAGIC_B1)=0A= >> + rev =3D REV_B1;=0A= > =0A= > This is based on ATF code in vendor tree, but shouldn't we have some=0A= > sort of explanation for this "magic"?=0A= > =0A= > Looking at the OCOTP driver reg 0x40 is IMX_OCOTP_ADDR_DATA2 and it's=0A= > used as part of fuse writes. According to the driver code 8mq is=0A= > compatible with 7d and this write path is enabled for imx8mq-ocotp.=0A= =0A= After further digging in NXP manuals and uboot sources it seems that =0A= imx8mq ocotp is like imx6 rather than imx7. Posted fix for nvmem driver:=0A= =0A= https://patchwork.kernel.org/patch/10908081/=0A= =0A= Reviewed-by: Leonard Crestez =0A= =0A= It might still be nice to find a way to identify imx8mq B0.=0A=