Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751919AbdFMDco (ORCPT ); Mon, 12 Jun 2017 23:32:44 -0400 Received: from mail-db5eur01on0047.outbound.protection.outlook.com ([104.47.2.47]:48304 "EHLO EUR01-DB5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751832AbdFMDcm (ORCPT ); Mon, 12 Jun 2017 23:32:42 -0400 From: "A.s. Dong" To: Andy Duan , "linux-serial@vger.kernel.org" CC: "linux-kernel@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , "gregkh@linuxfoundation.org" , "jslaby@suse.com" , "stefan@agner.ch" , Mingkai Hu , "Y.b. Lu" , "nikita.yoush@cogentembedded.com" , "andy.shevchenko@gmail.com" , "dongas86@gmail.com" Subject: RE: [PATCH V3 5/7] tty: serial: lpuart: add imx7ulp support Thread-Topic: [PATCH V3 5/7] tty: serial: lpuart: add imx7ulp support Thread-Index: AQHS45HWa8WUepnMskikB4KztSOmyKIiG9aAgAAF1+A= Date: Tue, 13 Jun 2017 03:32:37 +0000 Message-ID: References: <1497281848-12995-1-git-send-email-aisheng.dong@nxp.com> <1497281848-12995-6-git-send-email-aisheng.dong@nxp.com> In-Reply-To: Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: nxp.com; dkim=none (message not signed) header.d=none;nxp.com; dmarc=none action=none header.from=nxp.com; x-originating-ip: [192.158.241.86] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;HE1PR0401MB2538;7:uucJAxLftSeZS2m17m29CZjdW856Wl9sqPCzaQv56mqmhemDlzkxW46gFMWk9kqr0XvdYImBzU58/n0QPxJ/gIeMyrS+qb97tLlgta0/dlF1oWPJhPQa/2xPdHYMQ4ASHU5lF+FE7+jDjIVfYT4WpsXzfKvZOdtgVoylz5VT2X36BVSUG9FnGVR7M4IGOdlHPESu+GhEUFL7sZAXTz/+m7lrGS71qdJ0nLSwcSvI+NSrqbh3jgWqS9QhG8P/Y82H8Sm8TX8o4jZeREl/jSU5Oin62TTRrdFSuD14k6NYMewF0Xo17SlV4ie8THLGGpZSkDND7TDczcX4smVXivz6tQ== x-forefront-antispam-report: SFV:SKI;SCL:-1SFV:NSPM;SFS:(10009020)(6009001)(39850400002)(39410400002)(39860400002)(39450400003)(39840400002)(39400400002)(54534003)(13464003)(377454003)(6506006)(54356999)(2900100001)(2501003)(8936002)(3660700001)(189998001)(86362001)(74316002)(5250100002)(76176999)(8676002)(7736002)(81166006)(305945005)(53936002)(9686003)(50986999)(66066001)(575784001)(102836003)(6116002)(7696004)(3846002)(54906002)(229853002)(55016002)(99286003)(39060400002)(6246003)(3280700002)(2950100002)(6436002)(478600001)(33656002)(53546009)(14454004)(25786009)(2906002)(4326008)(38730400002)(5660300001);DIR:OUT;SFP:1101;SCL:1;SRVR:HE1PR0401MB2538;H:AM3PR04MB306.eurprd04.prod.outlook.com;FPR:;SPF:None;MLV:ovrnspm;PTR:InfoNoRecords;LANG:en; x-ms-traffictypediagnostic: HE1PR0401MB2538: x-ms-office365-filtering-correlation-id: ad94549e-362e-4815-2af3-08d4b20cd684 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001)(2017030254075)(48565401081)(201703131423075)(201703031133081);SRVR:HE1PR0401MB2538; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(9452136761055)(185117386973197)(258649278758335); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(8121501046)(5005006)(3002001)(10201501046)(100000703101)(100105400095)(93006095)(93001095)(6055026)(6041248)(20161123558100)(20161123564025)(20161123560025)(20161123555025)(20161123562025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(6072148)(100000704101)(100105200095)(100000705101)(100105500095);SRVR:HE1PR0401MB2538;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);SRVR:HE1PR0401MB2538; x-forefront-prvs: 0337AFFE9A spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-originalarrivaltime: 13 Jun 2017 03:32:37.1607 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR0401MB2538 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by mail.home.local id v5D3Wn1E010105 Content-Length: 3542 Lines: 104 > -----Original Message----- > From: Andy Duan > Sent: Tuesday, June 13, 2017 11:02 AM > To: A.s. Dong; linux-serial@vger.kernel.org > Cc: linux-kernel@vger.kernel.org; linux-arm-kernel@lists.infradead.org; > gregkh@linuxfoundation.org; jslaby@suse.com; stefan@agner.ch; Mingkai Hu; > Y.b. Lu; nikita.yoush@cogentembedded.com; andy.shevchenko@gmail.com; > dongas86@gmail.com; A.s. Dong > Subject: RE: [PATCH V3 5/7] tty: serial: lpuart: add imx7ulp support > > From: Dong Aisheng Sent: Monday, June 12, 2017 > 11:37 PM > >The lpuart of imx7ulp is basically the same as ls1021a. It's also > >32 bit width register, but unlike ls1021a, it's little endian. > >Besides that, imx7ulp lpuart has a minor different register layout from > >ls1021a that it has four extra registers (verid, param, global, > >pincfg) located at the beginning of register map, which are currently > >not used by the driver and less to be used later. > > > >To ease the register difference handling, we add a reg_off member in > >lpuart_soc_data structure to represent if the normal > >lpuart32_{read|write} requires plus a offset to hide the issue. > > > >Cc: Greg Kroah-Hartman > >Cc: Jiri Slaby > >Cc: Stefan Agner > >Cc: Mingkai Hu > >Cc: Yangbo Lu > >Cc: Fugang Duan > >Signed-off-by: Dong Aisheng > > > >--- > >ChangeLog: > >v2->v3: > > * use standard port->iotype to represent the endians. > >v1->v2: > > * remove lpuart_reg_off according to Stefan's suggestion > >--- > > drivers/tty/serial/fsl_lpuart.c | 10 ++++++++++ > > 1 file changed, 10 insertions(+) > > > >diff --git a/drivers/tty/serial/fsl_lpuart.c > >b/drivers/tty/serial/fsl_lpuart.c index > >bbf47a0..9d05e53 100644 > >--- a/drivers/tty/serial/fsl_lpuart.c > >+++ b/drivers/tty/serial/fsl_lpuart.c > >@@ -231,6 +231,9 @@ > > #define DEV_NAME "ttyLP" > > #define UART_NR 6 > > > >+/* IMX lpuart has four extra unused regs located at the beginning */ > >+#define IMX_REG_OFF 0x10 > >+ > > struct lpuart_port { > > struct uart_port port; > > struct clk *clk; > >@@ -259,6 +262,7 @@ struct lpuart_port { > > > > struct lpuart_soc_data { > > char iotype; > >+ u8 reg_off; > > }; > > > > static const struct lpuart_soc_data vf_data = { @@ -267,12 +271,17 @@ > >static const struct lpuart_soc_data vf_data = { > > > > static const struct lpuart_soc_data ls_data = { > > .iotype = UPIO_MEM32BE, > >+}; > > > >+static struct lpuart_soc_data imx_data = { > >+ .iotype = UPIO_MEM32, > >+ .reg_off = IMX_REG_OFF, > > }; > > > > static const struct of_device_id lpuart_dt_ids[] = { > > { .compatible = "fsl,vf610-lpuart", .data = &vf_data, }, > > { .compatible = "fsl,ls1021a-lpuart", .data = &ls_data, }, > >+ { .compatible = "fsl,imx7ulp-lpuart", .data = &imx_data, }, > > { /* sentinel */ } > > }; > > MODULE_DEVICE_TABLE(of, lpuart_dt_ids); @@ -2020,6 +2029,7 @@ static > >int lpuart_probe(struct platform_device *pdev) > > if (IS_ERR(sport->port.membase)) > > return PTR_ERR(sport->port.membase); > > > >+ sport->port.membase += sdata->reg_off; > > sport->port.mapbase = res->start; > > Also update the mapbase. > The idea behind is only do the quirk for io remapped address. Mapbase(physical address) is not needed for lpuart32 currently. Probably it could be changed when lpuart32 DMA function is added. Regards Dong Aisheng > > sport->port.dev = &pdev->dev; > > sport->port.type = PORT_LPUART; > >-- > >2.7.4