Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932082AbdFLQVm (ORCPT ); Mon, 12 Jun 2017 12:21:42 -0400 Received: from mail-co1nam03on0085.outbound.protection.outlook.com ([104.47.40.85]:14688 "EHLO NAM03-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754878AbdFLPhr (ORCPT ); Mon, 12 Jun 2017 11:37:47 -0400 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; nxp.com; dkim=none (message not signed) header.d=none;nxp.com; dmarc=fail action=none header.from=nxp.com; From: Dong Aisheng To: CC: , , , , , , , , , , , Dong Aisheng Subject: [PATCH V3 6/7] tty: serial: lpuart: add earlycon support for imx7ulp Date: Mon, 12 Jun 2017 23:37:27 +0800 Message-ID: <1497281848-12995-7-git-send-email-aisheng.dong@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1497281848-12995-1-git-send-email-aisheng.dong@nxp.com> References: <1497281848-12995-1-git-send-email-aisheng.dong@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131417554654927603;(91ab9b29-cfa4-454e-5278-08d120cd25b8);() X-Forefront-Antispam-Report: CIP:192.88.168.50;IPV:NLI;CTRY:US;EFV:NLI;SFV:NSPM;SFS:(10009020)(6009001)(336005)(39450400003)(39410400002)(39840400002)(39860400002)(39380400002)(39850400002)(39400400002)(2980300002)(1110001)(1109001)(339900001)(189002)(54534003)(199003)(9170700003)(105606002)(4326008)(104016004)(50986999)(305945005)(39060400002)(2351001)(106466001)(5003940100001)(33646002)(7416002)(8656002)(6666003)(47776003)(2950100002)(6916009)(189998001)(76176999)(5660300001)(48376002)(38730400002)(50226002)(85426001)(110136004)(498600001)(356003)(54906002)(8936002)(77096006)(50466002)(36756003)(86362001)(81166006)(53936002)(8676002)(2906002);DIR:OUT;SFP:1101;SCL:1;SRVR:BL2PR03MB161;H:tx30smr01.am.freescale.net;FPR:;SPF:Fail;MLV:ovrnspm;MX:1;A:1;PTR:InfoDomainNonexistent;LANG:en; X-Microsoft-Exchange-Diagnostics: 1;BY2FFO11FD046;1:/aF44od3rrGTTVQwyF0fXp2TyehDsgy/R6/OqLDI8muiDijlYStsnJ3m4ubkZ6GSdh7kpfi453jWnjNXQ1eBhy4XnNmMvUe1plg/X0CR2zeZXIKnKXIwGT+a1LU/T/sHUzWIwiCPouuWwaCxrlFy7Gp/i3ZLcmJNVh4nxL/S0DaMmtgXnBoyc4vpxZkUXwQGD6axMHuF0L+b+iZ4yD9rq4EmelbW13k+ZtV8v6deBpodyoG3NFYWpK5FFx7WetM58aWHOhUxDzWtig1Yomwuoq8aYVxz/xDAaBD/TRYwGVapPMxyA1TQU/TqKZYjWYxwANmDkL7sZH5ZAYihK8ubtzu9Tl10C4LuBhx9Evpv0emdcMBYN0ZFCYRLE+OS48Ou9qyGrLD2fJ54MmZut4ZDQ+LJN/Ln0zJReeN2g3ryQYPu9m5PAxA5Fju/B0ZwL1HRkdbJfOGrBIfMzS/clcRYV9TEF/u4Ja6hKgQEDQpIC0jeAocwPbD3Dkj3s6aez/ZXyt6HS4KzUufO6GKeqz7mEr4NHrBEgfp8TJyqWXU8rZnU1BCOOtERcnxxMmV37M4gUW76fSUee1jFjU/K2VFWEo3fM1+C0wPjqCbhcMSYe26gShrMWoZ+LoB9PCy1hkkTa0FaMsHfHln7FtJ/LGFXwucmtirYUWMMAVwbJf1kDiGCxuFIeNlx+RZYmo+bnMUx MIME-Version: 1.0 Content-Type: text/plain X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BL2PR03MB161: X-MS-Office365-Filtering-Correlation-Id: 9fa3908e-a752-4619-1af3-08d4b1a8f8ec X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001)(201703131430075)(201703131517081);SRVR:BL2PR03MB161; X-Microsoft-Exchange-Diagnostics: 1;BL2PR03MB161;3:8isUBcl3l4FrjScNV0uoqQ9cl+ySmFewLo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BEJzg/aszVS/WSsWq5zAlLNOqLDI5Mx3/S5BzakKvfgP4FR+PIry1al0IwdXiCPvPtMy1GplvypJw4kJxqJm9pikaEIoXmuR2Tqo1nG/7DNYE/AjGq4zZWIU0N15f1OUHR3szVjW2Vq8auAIJqg== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6095135)(601004)(2401047)(8121501046)(5005006)(13018025)(13016025)(10201501046)(3002001)(100000703101)(100105400095)(93006095)(93001095)(6055026)(6096035)(20161123561025)(20161123559100)(20161123556025)(201703131430075)(201703131448075)(201703131433075)(201703161259150)(201703151042153)(20161123563025)(20161123565025)(100000704101)(100105200095)(100000705101)(100105500095);SRVR:BL2PR03MB161;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(400006)(100000804101)(100110200095)(100000805101)(100110500095);SRVR:BL2PR03MB161; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;BL2PR03MB161;4:Zm+AorGF+lX6jST+u7U7gHvIxXm0dKQ2pMlNayapKDU?= =?us-ascii?Q?0PsIWh5hs+Z59k3xMr+2Jk/YOulnxzvHqisuhri69TayL86iqraIDHG5xWHy?= =?us-ascii?Q?XE9K5Yv68A2Xm8TPc6XuopF23T/pE1Pe73Ku2HYofCx7AExc4INw7y7BxpIb?= =?us-ascii?Q?a2YZM3muiUujnYRBUSmjX3r4Gubxt3EfpwhXnjgQzHRErqzrt76xpnOOfa8y?= =?us-ascii?Q?lgc8fq+BHTRVsnzHO3zDzbyzR07br1QSCzr4fyz/CrFk6FFLCmjXzzShxPL+?= =?us-ascii?Q?t2aKp7p//GoSYcc10uXy18l++6T1eCj27QkCQMFJp0Q6Kz8lAYXoKMoK36iF?= =?us-ascii?Q?+wAntthQ5Egsmg0AXy3q2om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Q?g2OAXAS0kXCmNPabpUpJyKwNfNrlVcZr2LrzC?= X-Forefront-PRVS: 03361FCC43 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;BL2PR03MB161;23:fSMMRVFkk6kEyydv9U8pv2/gBL+y4GdpdtNP8C8icq?= =?us-ascii?Q?K+F6CF+niE9rB1XUu0ownuOKRAzi9E4sZiVnanZq5rDs4opSx7mrfQB2VUiY?= =?us-ascii?Q?SkLbK2+687HEMO6FXcSjGgQvAgPWfGDVobgp4t5aX1CxMyxAyaGOpf5PrRxn?= =?us-ascii?Q?vGIK1KOki4t1LKf4SIa9L5xe7C8NNdUXx5Y7HgnAUmT3H8j+8bTydtG3Zu3u?= =?us-ascii?Q?qDO3b5rsoW6JoEMtC/WAAjwDYy3C9cOF+bS2UhiK6bR9wh+zmRajJTGx2WGk?= =?us-ascii?Q?6VQVsx2kzv6Q5f0wgDLamHEyYlYDFcYXixooAtS5bTAaA1V02cUYyp9cYuNp?= =?us-ascii?Q?hiPmBB8CagiXf0EQ5HVp7yDg7edvq1NT1NMefI8lH9q8V/+zONrsgI+5X/9c?= =?us-ascii?Q?ZULzjpOLVintaryQ3Zi3As/vW8AJukH9OXKbLdj0hMIckTptBZ26wcY4iEQj?= =?us-ascii?Q?iCM3pSJOpLXgL9lnfKIaJgaz67uGhWHxT4vEYDon0sNj2mMlkvD9BLtpYpi+?= =?us-ascii?Q?IQ2w/D4b5SqGp2H9vDXQmyd7DUOLytP5IZLO+w4z5oPMgxGk9sJSnf8q4dVo?= =?us-ascii?Q?f3INNKoMvS/Vmp/mNgHyzCArbp1AP7ARAxIR5Lstar8tX7VimsDawFw/9FjC?= =?us-ascii?Q?rZMX58cSgLGRhJj+TT/0SADL1lXK0qMKApNCtOUKCyEQCcTuww7jEjVbkHV8?= =?us-ascii?Q?j14dLUnR/tBvmw22iOMZcLP76phkC/5ZEF3s44OJHlwW9e8yTZEH6GddZba0?= =?us-ascii?Q?6y8DWMP+BzANn1RLOVlHTzhzT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BHyLMvhtXSFJDUYrjqugFi12C3uAdko8GYrTAT1qNIiU3SOHp3U/fxPa2+5U8IhEN/D77XMS8KMeVwdCYGMWaU8koPwGSm4Z/YL9P27zyUZ/C8/DtuYDCr0qg8wJ73fntemPipTKwcOWl7YosM2yYn0+F5OuLZ3ibI6TB4tpx+8SxV/PzyA== X-Microsoft-Exchange-Diagnostics: 1;BL2PR03MB161;5:IgWY2lG1VTcmEQv5QTuio6l+Q+W521mXT9XkuZHW603W8P93xfnnYbuNdKesRZGG6lz/wIfhOm2uqRg9ILBQ8BTH20haN7t9vLXg8N++UqGrVR1gySAqT7XnPJ6woXe3C358+Jzx2qgdItrQs9cXy2UxL3IeCTxk4ULsUV9Q5Us4WyaGaH1bBeRpIionPnhVWsqvUqG7f09U6rdrN48ByFkBw0SqHSVm+8WKOrkjo2GSEB8oLpUZgienlnNk1dnfzL4lvD2oljIiSndmi0QdzRAEaoDAJY+RvhFaCsbdxzhyB9B/quyKrIJoZ+/q6EDB57HjW8BBgSCo0Oqjt/LBqgtNebwGozHROcenIsCdT50ozyVjUzGveDP74i7cDn5zqXFhyi0koYy+mWM6xp54Lu1SPJwaI0PQSt6JaP594pMzGnh6F+rfA/IsHsFhRaXCz+S5BP0wCmLdJISqOqK9tP0L7peV2eeFkDHPOa0E+6vBx2uz1105+nldRx7JMrXLQTzbnB5BDFQ24wpXF5QbTQ==;24:ok2R9uYDxg+6vRpIC1kOFVioPonu56wHIIbbJ1gbkLzgIpAiZO2oxxWDPuwSA2Ni5NO8wPJIs+oNIPVuq0CX6TVU3nlmFvVcTmjc3IHocHM= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;BL2PR03MB161;7:CmokdcU350HNsxjT408XLQuQIK/pNgY47+bLWmrItA4wbVKq1tGXzq6fMBaYWf8jRzosOfBPSbxXdoZwqBJcyRS3JwcCuqMQUkeDB7UWLw/cLN5M8q61oTcLWEUdWoj4hn/kKidak8hvUayIY2EU9sfc6XFwi9eSBgk+iluKsqbY34X2LEkYnbGbX+wrts3ndgedtSicZJBu4Gvu28lXZ5esbcJ5rv18Wz3vonQ1uFKnMDU4eChuIVf7FtkWEEkVfcXu1F4ZJzG5/kSLxKDPM9lVaOO97IXQrrJQn32ZPZQ6vi8pm0fd0slNaqlEmr70A8K9ixQJPrtaYnHULGQkpA== X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Jun 2017 15:37:45.3055 (UTC) X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e;Ip=[192.88.168.50];Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL2PR03MB161 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1658 Lines: 50 earlycon is executed quite early before the device tree probe, so we need correctly initialize the port membase and iotype for imx7ulp during early console setup before using. Cc: Greg Kroah-Hartman Cc: Jiri Slaby Cc: Stefan Agner Cc: Mingkai Hu Cc: Yangbo Lu Acked-by: Fugang Duan Signed-off-by: Dong Aisheng --- Change Log: v2->v3: * use standard port->iotype to represent endians v1->v2: * updated due to lpuart_reg_off removed --- drivers/tty/serial/fsl_lpuart.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/drivers/tty/serial/fsl_lpuart.c b/drivers/tty/serial/fsl_lpuart.c index 9d05e53..6a725cb 100644 --- a/drivers/tty/serial/fsl_lpuart.c +++ b/drivers/tty/serial/fsl_lpuart.c @@ -1982,8 +1982,21 @@ static int __init lpuart32_early_console_setup(struct earlycon_device *device, return 0; } +static int __init lpuart32_imx_early_console_setup(struct earlycon_device *device, + const char *opt) +{ + if (!device->port.membase) + return -ENODEV; + + device->port.iotype = UPIO_MEM32; + device->port.membase += IMX_REG_OFF; + device->con->write = lpuart32_early_write; + + return 0; +} OF_EARLYCON_DECLARE(lpuart, "fsl,vf610-lpuart", lpuart_early_console_setup); OF_EARLYCON_DECLARE(lpuart32, "fsl,ls1021a-lpuart", lpuart32_early_console_setup); +OF_EARLYCON_DECLARE(lpuart32, "fsl,imx7ulp-lpuart", lpuart32_imx_early_console_setup); EARLYCON_DECLARE(lpuart, lpuart_early_console_setup); EARLYCON_DECLARE(lpuart32, lpuart32_early_console_setup); -- 2.7.4