From patchwork Tue Jan 9 12:58:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tudor Ambarus X-Patchwork-Id: 13514903 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 AFC9EC47073 for ; Tue, 9 Jan 2024 12:59:11 +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=55JCqtSbQw4tBMakdOlW/yntyII/6fATi88Q3T8XDjw=; b=1okR8Xxd5YGCz8 W3566VS29AOy1BN7HtFwXLAhA3AT5Uh+4eG/jEp6gIVxKCUkIcESQCS8tSXVrg1OJWfREJJLAIa5f qyeVOdqX6im1nfI8Yoc0UxHJkqb1Teh0qNgHPXasvECLmxlJ5wvYG5GThTFlsVQfFeAAQ9DqCc6Bf yY0ou6VjGEI5kURqW779Aq/PdGbNJi9YmGDMgC5PEYXuEfO4oK50pBEl/x6VCEoNBKTY94qqMsNKn MkJIPfhk11+XEdigOT2xCyxMkLqAFTDsgaH3+fSCDWoOZM4lsFdcO8garczoafsvdA1DTIRP1/cpJ M7fdLtTHQUhumPTgN+dA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rNBgt-008IUc-0X; Tue, 09 Jan 2024 12:58:47 +0000 Received: from mail-wr1-x42f.google.com ([2a00:1450:4864:20::42f]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rNBgl-008IO3-2m for linux-arm-kernel@lists.infradead.org; Tue, 09 Jan 2024 12:58:41 +0000 Received: by mail-wr1-x42f.google.com with SMTP id ffacd0b85a97d-33694bf8835so2637406f8f.3 for ; Tue, 09 Jan 2024 04:58:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704805116; x=1705409916; 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=cs4co9mt9XXnYsWzWbhSmPzFgtlixpVNmZRAHGA/jCw=; b=VzitFz65d9s1miXO4vTHtXcQO0/0cD7Z08EErRM/15V2ThT+jCCLEkxUqyR1ANuI20 salxoOXPgMarUy4lYO7n2aUNb4kwBZBtJHblctoSPjbqBO0LK+Z1lA4ll1O1UHAssCf2 kFGkwZIcII7ob7t+nzBfpc73wSiW9O0L841IT7vfP1H7kYq+X837qYqeFaiXk9WdJeDm 1cJtzmlZtRUC/zss3WvetNKB9MuE2BZzBqfs2cbUGfG1Z/lE7XR0Lddm3m6ElG76Dj6E Rj2UVRHBfOdewsMR4hpI96ASiEfwveK08CGd1EeH1TxQ/SC27Wbr4MsOdWHV6e8HSPRx F+jg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704805116; x=1705409916; 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=cs4co9mt9XXnYsWzWbhSmPzFgtlixpVNmZRAHGA/jCw=; b=w8IjZvwCNb4JAlUVUA7XrODLgreVknvofCeti4yBkBzIANYYTyeGTUfCA8/6ovWjwo 5GdgiG0w9ZIQgJECp6rG40pubJ5r8VFz07wIOXyj8/d7UaPuWX9D9dFUkwLyCDnNjHGs krutV0WjihqIP/O7elrA+RWMjb8LSnUNZlTelSjehyEnlJ6JUOZ/9PGEzAn9ZuSOsKx+ KypGXZo0jp0BYBqK4UCWJCwzOrbNP5PcJ+3hST7jix+yID/gH2eeK6xUwQJ1pA/wwH2q nC+07qMZRJOjIbSzLJNSu7a66j9VaH/EBM1mKSpA2y+oWiLeYMJWdRQ3HF19eY8IR/hc DlIQ== X-Gm-Message-State: AOJu0Yz72hiMAHNXZTbjgLgpet07AmR9urYDtWJjwDokzDJ38tVL749h f5y19jKjBtplSTtopEw/zYctvB4ovROAnA== X-Google-Smtp-Source: AGHT+IFHF9ov79LocrFWdFMN09ObGvuvUIjCSqttKPJPivd5wdvSVQbLdnjR/6JFSIMjZpBJdC/a5Q== X-Received: by 2002:a5d:548f:0:b0:336:82a8:1093 with SMTP id h15-20020a5d548f000000b0033682a81093mr422477wrv.48.1704805116186; Tue, 09 Jan 2024 04:58:36 -0800 (PST) Received: from ta2.c.googlers.com.com (88.140.78.34.bc.googleusercontent.com. [34.78.140.88]) by smtp.gmail.com with ESMTPSA id cw16-20020a056000091000b0033753a61e96sm2351302wrb.108.2024.01.09.04.58.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Jan 2024 04:58:35 -0800 (PST) From: Tudor Ambarus To: peter.griffin@linaro.org, krzysztof.kozlowski+dt@linaro.org, gregkh@linuxfoundation.org Cc: mturquette@baylibre.com, sboyd@kernel.org, robh+dt@kernel.org, conor+dt@kernel.org, andi.shyti@kernel.org, alim.akhtar@samsung.com, jirislaby@kernel.org, s.nawrocki@samsung.com, tomasz.figa@gmail.com, cw00.choi@samsung.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, andre.draszik@linaro.org, kernel-team@android.com, willmcvicker@google.com, Tudor Ambarus Subject: [PATCH v3 05/12] tty: serial: samsung: set UPIO_MEM32 iotype for gs101 Date: Tue, 9 Jan 2024 12:58:07 +0000 Message-ID: <20240109125814.3691033-6-tudor.ambarus@linaro.org> X-Mailer: git-send-email 2.43.0.472.g3155946c3a-goog In-Reply-To: <20240109125814.3691033-1-tudor.ambarus@linaro.org> References: <20240109125814.3691033-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-20240109_045839_898908_BE988C85 X-CRM114-Status: GOOD ( 14.55 ) 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's Connectivity Peripheral blocks (peric0/1 blocks) which include the I3C and USI (I2C, SPI, UART) only allow 32-bit register accesses. Instead of specifying the reg-io-width = 4 everywhere, for each node, the requirement should be deduced from the compatible. Infer UPIO_MEM32 iotype from the "google,gs101-uart" compatible. Update the uart info name to be GS101 specific in order to differentiate from the other exynos platforms. All the other settings are not changed. exynos_fifoszdt_serial_drv_data was replaced by gs101_serial_drv_data because the iotype restriction is gs101 specific and there was no other user of exynos_fifoszdt_serial_drv_data. Reviewed-by: Peter Griffin Signed-off-by: Tudor Ambarus Reviewed-by: Krzysztof Kozlowski Reviewed-by: Sam Protsenko --- v3: collect Peter's R-b tag v2: new patch drivers/tty/serial/samsung_tty.c | 38 +++++++++++++++++++++++--------- 1 file changed, 28 insertions(+), 10 deletions(-) diff --git a/drivers/tty/serial/samsung_tty.c b/drivers/tty/serial/samsung_tty.c index ff646cddd3f8..a81b61953a28 100644 --- a/drivers/tty/serial/samsung_tty.c +++ b/drivers/tty/serial/samsung_tty.c @@ -2497,25 +2497,43 @@ static const struct s3c24xx_serial_drv_data exynos850_serial_drv_data = { .fifosize = { 256, 64, 64, 64 }, }; -/* - * Common drv_data struct for platforms that specify samsung,uart-fifosize in - * device tree. - */ -static const struct s3c24xx_serial_drv_data exynos_fifoszdt_serial_drv_data = { - EXYNOS_COMMON_SERIAL_DRV_DATA(), +static const struct s3c24xx_serial_drv_data gs101_serial_drv_data = { + .info = { + .name = "Google GS101 UART", + .type = TYPE_S3C6400, + .port_type = PORT_S3C6400, + .iotype = UPIO_MEM32, + .has_divslot = 1, + .rx_fifomask = S5PV210_UFSTAT_RXMASK, + .rx_fifoshift = S5PV210_UFSTAT_RXSHIFT, + .rx_fifofull = S5PV210_UFSTAT_RXFULL, + .tx_fifofull = S5PV210_UFSTAT_TXFULL, + .tx_fifomask = S5PV210_UFSTAT_TXMASK, + .tx_fifoshift = S5PV210_UFSTAT_TXSHIFT, + .def_clk_sel = S3C2410_UCON_CLKSEL0, + .num_clks = 1, + .clksel_mask = 0, + .clksel_shift = 0, + }, + .def_cfg = { + .ucon = S5PV210_UCON_DEFAULT, + .ufcon = S5PV210_UFCON_DEFAULT, + .has_fracval = 1, + }, + /* samsung,uart-fifosize must be specified in the device tree. */ .fifosize = { 0 }, }; #define EXYNOS4210_SERIAL_DRV_DATA (&exynos4210_serial_drv_data) #define EXYNOS5433_SERIAL_DRV_DATA (&exynos5433_serial_drv_data) #define EXYNOS850_SERIAL_DRV_DATA (&exynos850_serial_drv_data) -#define EXYNOS_FIFOSZDT_DRV_DATA (&exynos_fifoszdt_serial_drv_data) +#define GS101_SERIAL_DRV_DATA (&gs101_serial_drv_data) #else #define EXYNOS4210_SERIAL_DRV_DATA NULL #define EXYNOS5433_SERIAL_DRV_DATA NULL #define EXYNOS850_SERIAL_DRV_DATA NULL -#define EXYNOS_FIFOSZDT_DRV_DATA NULL +#define GS101_SERIAL_DRV_DATA NULL #endif #ifdef CONFIG_ARCH_APPLE @@ -2603,7 +2621,7 @@ static const struct platform_device_id s3c24xx_serial_driver_ids[] = { .driver_data = (kernel_ulong_t)ARTPEC8_SERIAL_DRV_DATA, }, { .name = "gs101-uart", - .driver_data = (kernel_ulong_t)EXYNOS_FIFOSZDT_DRV_DATA, + .driver_data = (kernel_ulong_t)GS101_SERIAL_DRV_DATA, }, { }, }; @@ -2626,7 +2644,7 @@ static const struct of_device_id s3c24xx_uart_dt_match[] = { { .compatible = "axis,artpec8-uart", .data = ARTPEC8_SERIAL_DRV_DATA }, { .compatible = "google,gs101-uart", - .data = EXYNOS_FIFOSZDT_DRV_DATA }, + .data = GS101_SERIAL_DRV_DATA }, {}, }; MODULE_DEVICE_TABLE(of, s3c24xx_uart_dt_match);