From patchwork Wed Sep 11 05:02:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nick Chan X-Patchwork-Id: 13799691 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D2367EE0209 for ; Wed, 11 Sep 2024 05:11:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=mNdPAQz6FCH+x9os16nRs546qMZHgKNAK/Ypn6mSlDo=; b=NvwLsgXir1gA24biKAOZyxiSZJ utVxUmAsXB1hTDSfaOrgEtHkQXZXLCqWfVLLBvcuzM50H1IBXXJNUmt9PooZ7YDFhUrDskYLoigqr EzXg6XFLSvW6N9MxfpQyau163MOgYzFmDyFM564VNLOfY3hFlxm+P8eI/0ipVn9s+AbrR4TX5m8C7 25PIg4CD/+3gjlWNXpSFPaR2CKbyZGLUTQNT9C1Uzb8onZsf2YNyXVqZXqRf15EnjWv8AAAIanVLR DVPCLKOweo8oljqVyK/rRGX9DLt5Iaz1xRZ0lI0VG1wOGxg+UbmLKD5tbnrwOI7wrR4+Yr+HsZOVH LwJSDpTA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1soFdV-000000086LB-04nT; Wed, 11 Sep 2024 05:11:25 +0000 Received: from mail-pf1-x434.google.com ([2607:f8b0:4864:20::434]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1soFad-000000085wX-37mK for linux-arm-kernel@lists.infradead.org; Wed, 11 Sep 2024 05:08:28 +0000 Received: by mail-pf1-x434.google.com with SMTP id d2e1a72fcca58-7191f58054aso59086b3a.0 for ; Tue, 10 Sep 2024 22:08:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1726031307; x=1726636107; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=mNdPAQz6FCH+x9os16nRs546qMZHgKNAK/Ypn6mSlDo=; b=J5ze97C0ul5stUi71rPdaEX+FyzJJSINNdYS2/r0BaUzWst1Qj2PpEXdFV59rRh8O4 Wx/i1XglYReaVU4BhItaaVy1p7Wre9ytG/v3V/CcDKbgSprY9Ebvon8lTBAjp9sfvgRD HYYXTrZQqD9jzSYbc0sXYEP3k9CexE2s5tVeuBcYc6bKQHjRajGXYRPUKjcKs6xURUVX AaYd82VSOJZp+ZmwzmPUzysINfbCRa7bOvURSYX5SdSj0eT1DfIz0HbPNwZkM3WYvagC 2LkRgPFfKMdY9YfOjVfiascB3NbGb22gPqxFhOSedvCS+GVoeXmH83wTSysVglUlVGnr CNzA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726031307; x=1726636107; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=mNdPAQz6FCH+x9os16nRs546qMZHgKNAK/Ypn6mSlDo=; b=qMay7sU+p9WQKZUVuGCysKk58WhLAm8EbVWEc/AmAyPnHwwTBCVGQacb4FwDDd8eO3 AUeDEEDA+9QDUf3w4IpBsxYP5ZC3buIhD55j6tyHKYMLLegQq2sb5tSrqaCIZSsN9p1W rQd+NqT6+Tw09wSsEK7lhEw1CFIge4IQ14yTB38GSboCub+y03qDXRXyDIfQN4UBmd/h iW/LKarqKGpVK9vJx8isXYpEZbrxJbZig1jsksDtggw1tJEI26Uh7jR4qprDzutcJYKo B7KB7Fj/zLWwgaCSxXwsz6nPQPZKH8/72TcmYofQ+7B6ZZMy5A20xvO6uHPDsOUKrA5/ vv7Q== X-Forwarded-Encrypted: i=1; AJvYcCUoRMYQWdqqm0ncvCaolq7m38xMeuynRqyckjl3Kf0C+RUoQm4A1Kl9sKVJ6f7+cmCh/jKLLFOdpL7Yn3C4v0jh@lists.infradead.org X-Gm-Message-State: AOJu0YyqeJtTxeu+KaPk/4MGEHlokZx9U+suXB3WxKfDaAui9IlKfAMx PHaoelaff6PR2CxMTmvMuDCvE4tNezP+Bqv63fCDjWbkpjnh8YVy X-Google-Smtp-Source: AGHT+IGAjwPVwpMs2Tlzc+fCn6t25k5zV5S+6h2An1CKJfS27fXosKBLTBlxWiJ1EXeZU/4reI1Esg== X-Received: by 2002:a05:6a00:66e1:b0:714:340c:b9ee with SMTP id d2e1a72fcca58-71916e193b1mr2217489b3a.1.1726031306631; Tue, 10 Sep 2024 22:08:26 -0700 (PDT) Received: from nick-mbp.ust.hk (wf121-022.ust.hk. [175.159.121.22]) by smtp.googlemail.com with ESMTPSA id d2e1a72fcca58-719090d11e6sm2156984b3a.205.2024.09.10.22.08.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Sep 2024 22:08:26 -0700 (PDT) From: Nick Chan To: Krzysztof Kozlowski , Alim Akhtar , Greg Kroah-Hartman , Jiri Slaby , linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org Cc: asahi@lists.linux.dev, Nick Chan , Neal Gompa , Janne Grunau Subject: [PATCH v5 2/3] tty: serial: samsung: Fix A7-A11 serial earlycon SError Date: Wed, 11 Sep 2024 13:02:12 +0800 Message-ID: <20240911050741.14477-3-towinchenmi@gmail.com> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240911050741.14477-1-towinchenmi@gmail.com> References: <20240911050741.14477-1-towinchenmi@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240910_220827_807063_A157897A X-CRM114-Status: GOOD ( 17.27 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Apple's earlier SoCs, like A7-A11, requires 32-bit writes for the serial port. Otherwise, a SError happens when writing to UTXH (+0x20). This only manifested in earlycon as reg-io-width in the device tree is consulted for normal serial writes. Change the iotype of the port to UPIO_MEM32, to allow the serial port to function on A7-A11 SoCs. This change does not appear to affect Apple M1 and above. Reviewed-by: Krzysztof Kozlowski Reviewed-by: Neal Gompa Tested-by: Janne Grunau Signed-off-by: Nick Chan Reviewed-by: Andi Shyti --- drivers/tty/serial/samsung_tty.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/tty/serial/samsung_tty.c b/drivers/tty/serial/samsung_tty.c index c4f2ac9518aa..3fdec06322ac 100644 --- a/drivers/tty/serial/samsung_tty.c +++ b/drivers/tty/serial/samsung_tty.c @@ -2536,7 +2536,7 @@ static const struct s3c24xx_serial_drv_data s5l_serial_drv_data = { .name = "Apple S5L UART", .type = TYPE_APPLE_S5L, .port_type = PORT_8250, - .iotype = UPIO_MEM, + .iotype = UPIO_MEM32, .fifosize = 16, .rx_fifomask = S3C2410_UFSTAT_RXMASK, .rx_fifoshift = S3C2410_UFSTAT_RXSHIFT, @@ -2822,6 +2822,9 @@ OF_EARLYCON_DECLARE(gs101, "google,gs101-uart", gs101_early_console_setup); static int __init apple_s5l_early_console_setup(struct earlycon_device *device, const char *opt) { + /* Apple A7-A11 requires MMIO32 register accesses. */ + device->port.iotype = UPIO_MEM32; + /* Close enough to S3C2410 for earlycon... */ device->port.private_data = &s3c2410_early_console_data;