From patchwork Thu Dec 14 10:52:35 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tudor Ambarus X-Patchwork-Id: 13492778 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 26C93C4167D for ; Thu, 14 Dec 2023 10:53:38 +0000 (UTC) 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:References:In-Reply-To: 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: List-Owner; bh=ZuS9NhfOABvZjAcvO0djx4jifZqkZ6gQKqfDl9C55Fg=; b=xcljuaXZflC0fn jNmnZkevCBX0X8gqa3rKh0CLbwGDSP9ijsWeiKlgDcVFqWJC5GeedChX6/0EKEhn4mfNn2hlVa09p P4fICt/dspFFPsVzfNUzXZziTvn4HPiGYr5VaiVJ19uGc2yf62ssN6Ip47+LW4mC20SS8aE63Zre0 C8Y4upKdhLdq3+VDjT0Zd40NJI1Z7a9hCQZcRErPZD0YpP31lrzsee4g7OIp7A0rxM07mB26Rl5sm +vpDZsxMUJlQs9GiBsdHgkHU8bN/wNOpcbcaCYBgDjdbv/YuAdwEAjztc1liQWA0IS+nvY2tATQpl WGQ13ElzfVZGz2sFVxww==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rDjL0-00HXdT-1y; Thu, 14 Dec 2023 10:53:06 +0000 Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rDjKs-00HXUs-0A for linux-arm-kernel@lists.infradead.org; Thu, 14 Dec 2023 10:52:59 +0000 Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-40c2718a768so77651855e9.0 for ; Thu, 14 Dec 2023 02:52:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1702551176; x=1703155976; 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=/xcopqDHmkhwhZiddcnv/4oqDnf2f2C/EfKwZNlZ0qw=; b=WAB4CXhO/DxorRCQjzqiLvrCElT0C1BMUjfByqmt6vabScCdUI/TrIo5ObBsRSAEbs GfbcysDuIDHmZeLhxw7jZYbHh2YF1MnS5kA/Qw8h/SPh0vw+1T//yk12BGDjnUqeYYx/ eh9AW52y72KtxvQwGnn8+tSzZxUG+vGL1GXpdyrJOkbb2R90Rmwrkl7RZyTGBB5ea0So T4x3UVJjZ9GztBJq7Ap9wTkBRkex/9kLNstNC6sS10CaDF6mmHjU2vb44gEAMCMhXsyp zf6nag30+71Ta4N8xzUx02HhEaMMjdI3jWCITNaTgWo17x0xzWQXtmFPyxlXt7wfjKZ0 I5Jg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702551176; x=1703155976; 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=/xcopqDHmkhwhZiddcnv/4oqDnf2f2C/EfKwZNlZ0qw=; b=JUN541bjTfS4koJQexXfUzcK2fN6KY+CNJmT3vJuQ3QVp2qXorOypF6DyCUkqjDW0x r6TLr4oI+gYymn4T2TYbNhfvzHeHTB4qBBm9L/KMyLO1Uc3a+df8V/AqhcvZsyQI5jim 8Q3qCUK9cOaTWD/lPugksh8A3MkwzrZdgMayEKXTA/C6jc4qZXByzwyZXLLmGNLuFSki ps01cv087nK02aBsxTJaONCHONuUHfZTUpPoFfhl6goDbJl+X7FGVe0Bxso/jkWa0F7v sGFmZw1zKpFx7yRlx2TABZNz6Rw3RVtgfoAq+i/2Up5V4ZsoKeAI+IUKUvShtJNDAjYC 8/dA== X-Gm-Message-State: AOJu0YwoSk/2ujvnJfJsb/AIS382bfll1tkUwZ1l1pRK4T+sLj7noC0L a+xln+Z9Pn8yKGw2acT9d0PmSg== X-Google-Smtp-Source: AGHT+IFoOjFMWtrSQgxb2NLW2t0CuX+poAGfnV283P6BxnO1HFB3lfJ/1vp1DW3s4vZF+aaQfp5C7g== X-Received: by 2002:a1c:7411:0:b0:40c:30f8:dcf0 with SMTP id p17-20020a1c7411000000b0040c30f8dcf0mr5564669wmc.64.1702551176443; Thu, 14 Dec 2023 02:52:56 -0800 (PST) Received: from ta2.c.googlers.com.com (216.131.76.34.bc.googleusercontent.com. [34.76.131.216]) by smtp.gmail.com with ESMTPSA id p7-20020a05600c468700b0040c420eda48sm17614854wmo.22.2023.12.14.02.52.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Dec 2023 02:52:55 -0800 (PST) From: Tudor Ambarus To: peter.griffin@linaro.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, mturquette@baylibre.com, sboyd@kernel.org, conor+dt@kernel.org, andi.shyti@kernel.org, alim.akhtar@samsung.com, gregkh@linuxfoundation.org, jirislaby@kernel.org, catalin.marinas@arm.com, will@kernel.org, s.nawrocki@samsung.com, tomasz.figa@gmail.com, cw00.choi@samsung.com, arnd@arndb.de, semen.protsenko@linaro.org Cc: andre.draszik@linaro.org, saravanak@google.com, willmcvicker@google.com, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-clk@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-i2c@vger.kernel.org, linux-serial@vger.kernel.org, Tudor Ambarus Subject: [PATCH 05/13] tty: serial: samsung: add gs101 earlycon support Date: Thu, 14 Dec 2023 10:52:35 +0000 Message-ID: <20231214105243.3707730-6-tudor.ambarus@linaro.org> X-Mailer: git-send-email 2.43.0.472.g3155946c3a-goog In-Reply-To: <20231214105243.3707730-1-tudor.ambarus@linaro.org> References: <20231214105243.3707730-1-tudor.ambarus@linaro.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231214_025258_090950_1AAD6E21 X-CRM114-Status: UNSURE ( 9.93 ) X-CRM114-Notice: Please train this message. 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 GS101 only allows 32-bit register accesses. If using 8-bit register accesses on gs101, a SError Interrupt is raised causing the system unusable. Force the reg accesses to MMIO32 regardless of the user's settings. This is a common practice for such earlycons (bcm2835aux, uniphier, lpuart32), in order to avoid crashing the kernel with a wrong early console definition. Signed-off-by: Tudor Ambarus --- drivers/tty/serial/samsung_tty.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/drivers/tty/serial/samsung_tty.c b/drivers/tty/serial/samsung_tty.c index 66bd6c090ace..19cd3e6a9b6e 100644 --- a/drivers/tty/serial/samsung_tty.c +++ b/drivers/tty/serial/samsung_tty.c @@ -2787,6 +2787,17 @@ OF_EARLYCON_DECLARE(exynos4210, "samsung,exynos4210-uart", OF_EARLYCON_DECLARE(artpec8, "axis,artpec8-uart", s5pv210_early_console_setup); +static int __init gs101_early_console_setup(struct earlycon_device *device, + const char *opt) +{ + /* gs101 always expects MMIO32 register accesses. */ + device->port.iotype = UPIO_MEM32; + + return s5pv210_early_console_setup(device, opt); +} + +OF_EARLYCON_DECLARE(gs101, "google,gs101-uart", gs101_early_console_setup); + /* Apple S5L */ static int __init apple_s5l_early_console_setup(struct earlycon_device *device, const char *opt)