From patchwork Mon Jul 18 17:20:24 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Jones X-Patchwork-Id: 1657581 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=nDQRvrig; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=ventanamicro.com header.i=@ventanamicro.com header.a=rsa-sha256 header.s=google header.b=dXrONFk7; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=opensbi-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4LmpdZ4Kgfz9sFr for ; Tue, 19 Jul 2022 03:20:50 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=Krmj5atUrUueZhR53r2ABeqEbI5X1ACWJqvv++EPcjM=; b=nDQRvrigtwaT0I ytrYvcPU7rnG5J/Nk3nu/hSSED7piaaJti5+lFN4gQ/IssNQzt+tYb1HwlLRiv1F/YHwkPQZcw6+o n+UDKpJeQ6/KoI9agDJeTfbEORiNyADES4NX3RJBCPb+18Ir6BwOG7mbgNeFbeJAZSnBvcSwG/1jh 67gjBCSV2uEX6zKwhPshTD/e6bgcXtkYyVb2HOwbowbScFqf6SErzin+sDMC09+iGW05MeJ/EHDtY +MSyuH2nXX9jY0RraFgq8QNqtVO5KJSwW1ei0PNrpbpBhBFlTtMHWlwMxRSXWcc9sQvxd/Yjfv/Av GI1FRrezBD/vRElN6sLQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oDUQ5-00H76E-PS; Mon, 18 Jul 2022 17:20:33 +0000 Received: from mail-ed1-x52f.google.com ([2a00:1450:4864:20::52f]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oDUQ3-00H74I-82 for opensbi@lists.infradead.org; Mon, 18 Jul 2022 17:20:32 +0000 Received: by mail-ed1-x52f.google.com with SMTP id m13so6086993edc.5 for ; Mon, 18 Jul 2022 10:20:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=fl9zC+Cik7BkDvVQruYt9/NefAf1CFYgkJLkogpzQ/o=; b=dXrONFk7cECWdnkEhN+KUTJPiUt1JFP54+DjpwP8eeOseceZJxquXM6UPKgLhH7CQO EaPVZods8i0gJuV0sQg1LZytNT41yku7z/F80Bq320SeVDUfug5BqHZLacgqnmIJLn0f XRv2w1TIp7Jjj0rWuhG33OUWZAotweNr/aI6ZEDVMaAzUJCEbHQUqdvaIdMKMxOroR7U 4Kwt3rs1VbW5CwN5BRw6RnNcEZ6yiTNEtVxuiju4x+akEEho+2tqckr1btxZ6Wd42rjk 4NqImcJIt55dAQt4xhxVZNhGTbQAtksCgzcA+gD8f01Gc5oMubWj5S73cKMPlHWTntI0 RKzw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=fl9zC+Cik7BkDvVQruYt9/NefAf1CFYgkJLkogpzQ/o=; b=2PQmy5nDyewAuZ9I3617Q3EyrquoxNb26rqWZC7jCDOJuVFOhxeOyKLlpiAQ2lofsE VQwTJEIh+HGt7mIeJYbwxDiVkHC09ff2anVtBw95XZv/gLRCFm4KTeA6LZbbONq74Hy0 isaC5gvaLeHI3Ght5YUqhRcscGI/t1iv+rjPCok9lrDFfQXCn9D46EPYF2aefd/uyLuS G1xW7sI3M/x9CGsenDr/fsM5XCBuoPiPbYdqbbftazKnYLC7XdpS1J9eA8LtkoWvObZT tcJdpUPNDJ/fXSjH82kiXsQzV1RZ5cPue3788Jy2SdPYJZDWEGVVosE0bIVd/hbI+cDt 6hfA== X-Gm-Message-State: AJIora8dpap9uJZ7SoBI4tHNyxnMd9hIVSvihGBIpI1Scbs4IFykd5K7 My+WyMYDMXrP7xpmy+j6VP2lrnMMDj4t1A== X-Google-Smtp-Source: AGRyM1ud49aMf+tBQrGmWF8RJDLdHbkYOr8lfAFnG4LrEBkXkt8ULqxwppJjW3A4mIcxKJeRFaC8cw== X-Received: by 2002:a05:6402:50cd:b0:43a:c694:9089 with SMTP id h13-20020a05640250cd00b0043ac6949089mr38496705edb.386.1658164829516; Mon, 18 Jul 2022 10:20:29 -0700 (PDT) Received: from localhost (cst2-173-67.cust.vodafone.cz. [31.30.173.67]) by smtp.gmail.com with ESMTPSA id a10-20020a170906190a00b0072aa1313f5csm5655318eje.201.2022.07.18.10.20.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Jul 2022 10:20:28 -0700 (PDT) From: Andrew Jones To: opensbi@lists.infradead.org Cc: Atish Patra , Alistair Francis , Anup Patel , junliang.tan@linux.starfivetech.com Subject: [PATCH 0/4] lib: utils/serial: Collection of UART code improvements Date: Mon, 18 Jul 2022 19:20:24 +0200 Message-Id: <20220718172028.2006166-1-ajones@ventanamicro.com> X-Mailer: git-send-email 2.36.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220718_102031_306838_B49F56B5 X-CRM114-Status: UNSURE ( 7.92 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.2 (/) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: This series is a collection of changes I made while reviewing the UART code. I've compile tested it and boot it on QEMU (which of course only tests uart8250). I did also pass in a DTB with 0 for 'curr [...] Content analysis details: (-0.2 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:52f listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain X-BeenThere: opensbi@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "opensbi" Errors-To: opensbi-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org This series is a collection of changes I made while reviewing the UART code. I've compile tested it and boot it on QEMU (which of course only tests uart8250). I did also pass in a DTB with 0 for 'current-speed' in the UART node and nothing interesting happened, so I guess that's good. Andrew Jones (4): lib: utils/fdt: Factor out common uart node code lib: utils/serial: Initialize platform_uart_data to zero lib: serial: Clean up coding style in sifive-uart.c lib: utils/serial: Ensure baudrate is non-zero before using lib/utils/fdt/fdt_helper.c | 131 ++++++-------------- lib/utils/serial/fdt_serial_gaisler.c | 2 +- lib/utils/serial/fdt_serial_shakti.c | 2 +- lib/utils/serial/fdt_serial_sifive.c | 2 +- lib/utils/serial/fdt_serial_uart8250.c | 2 +- lib/utils/serial/fdt_serial_xlnx_uartlite.c | 2 +- lib/utils/serial/gaisler-uart.c | 2 +- lib/utils/serial/shakti-uart.c | 8 +- lib/utils/serial/sifive-uart.c | 13 +- lib/utils/serial/uart8250.c | 7 +- platform/fpga/openpiton/platform.c | 2 +- 11 files changed, 66 insertions(+), 107 deletions(-)