From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 94FD6ECAAD5 for ; Tue, 6 Sep 2022 12:15:21 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 5CF4184A30; Tue, 6 Sep 2022 14:15:17 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=reject dis=none) header.from=leica-geosystems.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=leica-geosystems.com header.i=@leica-geosystems.com header.b="OLqHHBu3"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 6E176849CC; Tue, 6 Sep 2022 14:15:15 +0200 (CEST) Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-eopbgr70109.outbound.protection.outlook.com [40.107.7.109]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 0E069849CC for ; Tue, 6 Sep 2022 14:15:12 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=reject dis=none) header.from=leica-geosystems.com Authentication-Results: phobos.denx.de; spf=fail smtp.mailfrom=johannes.schneider@leica-geosystems.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hZQzXIQyoc5scNf0+jG4IzPSAPaRSzTeh+QIDpcSkxAZ73cWsOQE39PNvZEVr/mEWGs8ZGY4R+7eukLIjhcldCPKoHbL451p1KYrOl8+VAnlXHTlFOHHexOir/QXjNVbd57QbcHBYisCViQru0Qun6sNI5vLHbuwiHBfyIJdLA7JGzkDu9/m3vFHPv2sciT1yVJDXKfGzUKRE+yiSP6vVMMxauPv/ZGahWW7tL1PrLCOPnrQS3L0FX4knCBJdb84gI5bWb4tdjO2hD8O3OjFRHT3spdylqlcFQ3gykH02yIST9RP8XnmyMeYaFIdyISr0h7m9CNuJ4pFtWDK3NGMiw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=BuMjzFgizimAZxiqia2Ogtcktf4WhVT5+fFK4Jca/P8=; b=kcEV9/c64pk0nQf/WCH08BpPxnBDyMQpzyBX6U2EgoSF8RATOidgX61LlFLdLyaGn9/+JgaFzrlkPsDlv+7ROdWOLFPbUT7+mStoOjWIulab0wZb3CWdl4+shcGIV2B7g5rTnXixmQXFcJQTew+lA0vTmfbw1OvOBdVp+hZseE3F8tOjtLSp+L3ClrCPAtNonrmRn2ueAymWJOg7lrgrwUyibpO0bH/y5+MatbG7LoBaezpisquEz2Kwvb2lacG9sqBo2wfME1Le4mg32K+VaFgwe4f4/IdMbWe6SmCAysj84NfnCLmW18d543J9hBTwej7z4ogdxZBH/q5V1CvS3Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 193.8.40.94) smtp.rcpttodomain=lists.denx.de smtp.mailfrom=leica-geosystems.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=leica-geosystems.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=leica-geosystems.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=BuMjzFgizimAZxiqia2Ogtcktf4WhVT5+fFK4Jca/P8=; b=OLqHHBu3PuDM0/Yy61EQrMQbqHTJQnkUL+Og1qpOIX/5Qhi2uGB2PeFPToFmDXquE3T4l0Hcgc33sVeRnA3/5SM1xE/Z4pV0YTCdll78utobol0Ec35E87AUGaNLjtxZkFpj70iD5lKhEDGydMAcpIoxg3MHhJ4tioS8UfeFdXY= Received: from AM0PR01CA0132.eurprd01.prod.exchangelabs.com (2603:10a6:208:168::37) by DU2PR06MB8351.eurprd06.prod.outlook.com (2603:10a6:10:2e6::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5588.14; Tue, 6 Sep 2022 12:15:09 +0000 Received: from VE1EUR02FT017.eop-EUR02.prod.protection.outlook.com (2603:10a6:208:168:cafe::72) by AM0PR01CA0132.outlook.office365.com (2603:10a6:208:168::37) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5588.10 via Frontend Transport; Tue, 6 Sep 2022 12:15:09 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 193.8.40.94) smtp.mailfrom=leica-geosystems.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=leica-geosystems.com; Received-SPF: Pass (protection.outlook.com: domain of leica-geosystems.com designates 193.8.40.94 as permitted sender) receiver=protection.outlook.com; client-ip=193.8.40.94; helo=aherlnxbspsrv01.lgs-net.com; pr=C Received: from aherlnxbspsrv01.lgs-net.com (193.8.40.94) by VE1EUR02FT017.mail.protection.outlook.com (10.152.12.98) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5588.10 via Frontend Transport; Tue, 6 Sep 2022 12:15:08 +0000 From: Johannes Schneider To: u-boot@lists.denx.de Cc: festevam@denx.de, peng.fan@oss.nxp.com, sbabic@denx.de, trini@konsulko.com, bsp-development.geo@leica-geosystems.com, Johannes Schneider , Peng Fan , =?UTF-8?q?Pali=20Roh=C3=A1r?= Subject: [PATCH v5 1/2] serial: mxc: enable the RX pipeline Date: Tue, 6 Sep 2022 14:15:03 +0200 Message-Id: <20220906121504.2200171-2-johannes.schneider@leica-geosystems.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220906121504.2200171-1-johannes.schneider@leica-geosystems.com> References: <20220906121504.2200171-1-johannes.schneider@leica-geosystems.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email Content-Type: text/plain X-MS-Office365-Filtering-Correlation-Id: eae4483d-9644-4ca2-b298-08da900170a9 X-MS-TrafficTypeDiagnostic: DU2PR06MB8351:EE_ X-LD-Processed: 1b16ab3e-b8f6-4fe3-9f3e-2db7fe549f6a,ExtAddr X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: kv0qGKo/q8Sw84yb1jCT0xj4dVLaLLBbzXyLJSJB7mPaWBXw1hMme7PxHQU3N5PXU60ekJS6dQiLgNoPzVvsvBk2FbxADQDlpm9ecgV8UtJ8aQkxN2wlpBAlBY5ojslNULC8hxQnSD0/AsYC82LI3pf25k6CrqNKOboxzDbwkeBbKlmdM7cItjEqK8yXJzeXgMuKxlAM9E4VlEvpXPujhPe6WLS2vi2R1EG6MwhIfNg+JIxg5Ofpyj+iBHMWZbCkqQlFi3m9KFwV5SY/PzAV+K2xtCd776lDljlGwVLq6Cfts3j1V5aZSWtN03SEcYeanKlI7GU0zN9JM9SSEt/kT6WF0trDFPrp94/i7UT+OrCKh/AeuYjD9gKJA+BWgDURbOfX7reBIMSUsQ5pD8uU7lkbDfKiArD06a3OSlnkxDE/bGaq7AqLAxaqeSTA80lQO9Z8qo18bD6pAnC8YerukeEspKwN0Gl9JDgWjpyBJIcWJu5Egf2ZndRDK5Wmiyowm1Fb5ZEI5uHu0XXZOrCRVxXL918MuqIGKEoFZV8nLvUmuWKuIdcYOoMTXeRMyzU+bli89VbQGkyDDZhB5iQdCTuwwF1SGmwNYeQVKMJIJuxRAnjLwo+uGk5td4MNrs+9jb03GUL0nJkOBBiUMnP8RlkCDE79zBN6xXRcJrO3nZ4FnUXTzcDOTnM7lKL/vn/4LOgcPpTKjHKrR6Re2YscvErlSLY9lo36pQ+GI1pPE21yjmXofeiWa0UnjVqlqb73Qz5rxOIYBiVitpqI994QnA== X-Forefront-Antispam-Report: CIP:193.8.40.94; CTRY:CH; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:aherlnxbspsrv01.lgs-net.com; PTR:ahersrvdom50.leica-geosystems.com; CAT:NONE; SFS:(13230016)(4636009)(376002)(346002)(136003)(39860400002)(396003)(46966006)(36840700001)(40470700004)(40480700001)(2616005)(6486002)(86362001)(478600001)(81166007)(41300700001)(356005)(36736006)(40460700003)(316002)(54906003)(6916009)(6512007)(82740400003)(118246002)(1076003)(186003)(26005)(336012)(47076005)(6506007)(6666004)(36860700001)(9316004)(82310400005)(956004)(70206006)(83380400001)(70586007)(44832011)(5660300002)(36756003)(8936002)(8676002)(2906002)(4326008); DIR:OUT; SFP:1102; X-OriginatorOrg: leica-geosystems.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Sep 2022 12:15:08.3851 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: eae4483d-9644-4ca2-b298-08da900170a9 X-MS-Exchange-CrossTenant-Id: 1b16ab3e-b8f6-4fe3-9f3e-2db7fe549f6a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=1b16ab3e-b8f6-4fe3-9f3e-2db7fe549f6a; Ip=[193.8.40.94]; Helo=[aherlnxbspsrv01.lgs-net.com] X-MS-Exchange-CrossTenant-AuthSource: VE1EUR02FT017.eop-EUR02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR06MB8351 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean on imx8(mm) the RXDMUXSEL needs to be set for data going over the wire (as observable on a connected 'scope) to actually make it into the RXFIFO the reference manual is not overly clear about this, and only mentiones that "UCR3_RXDMUXSEL should always be set." - and since the CR3 register reverts to its reset values after setting the baudrate, setting this bit is done during '_mxc_serial_setbgr' Signed-off-by: Johannes Schneider Reviewed-by: Peng Fan Reviewed-by: Fabio Estevam --- Changes in v5: - fix multilne-comment format - add another 'reviewed-by' Changes in v4: - add 'reviewd-by' Changes in v3: - more verbose commit messages Changes in v2: - manually fix 'to' and 'cc' - fix comment delimiter drivers/serial/serial_mxc.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/drivers/serial/serial_mxc.c b/drivers/serial/serial_mxc.c index 70a0e5e919..ee17a960d4 100644 --- a/drivers/serial/serial_mxc.c +++ b/drivers/serial/serial_mxc.c @@ -61,6 +61,11 @@ #define UCR3_AWAKEN (1<<4) /* Async wake interrupt enable */ #define UCR3_REF25 (1<<3) /* Ref freq 25 MHz */ #define UCR3_REF30 (1<<2) /* Ref Freq 30 MHz */ + +/* imx8 names these bitsfields instead: */ +#define UCR3_DTRDEN BIT(3) /* bit not used in this chip */ +#define UCR3_RXDMUXSEL BIT(2) /* RXD muxed input selected; 'should always be set' */ + #define UCR3_INVT (1<<1) /* Inverted Infrared transmission */ #define UCR3_BPEN (1<<0) /* Preset registers enable */ #define UCR4_CTSTL_32 (32<<10) /* CTS trigger level (32 chars) */ @@ -176,6 +181,14 @@ static void _mxc_serial_setbrg(struct mxc_uart *base, unsigned long clk, writel(UCR2_WS | UCR2_IRTS | UCR2_RXEN | UCR2_TXEN | UCR2_SRST, &base->cr2); + + /* + * setting the baudrate triggers a reset, returning cr3 to its + * reset value but UCR3_RXDMUXSEL "should always be set." + * according to the imx8 reference-manual + */ + writel(readl(&base->cr3) | UCR3_RXDMUXSEL, &base->cr3); + writel(UCR1_UARTEN, &base->cr1); } -- 2.25.1