Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp3927986rdb; Thu, 28 Dec 2023 05:00:10 -0800 (PST) X-Google-Smtp-Source: AGHT+IFHm99zbjlW2E1oySL4+zFu2/xPNkeutUl+rRjGuiGqVxooB6T19g/2wtctfpLGjcwErbEu X-Received: by 2002:a17:907:25cb:b0:a27:7d0a:2f57 with SMTP id ae11-20020a17090725cb00b00a277d0a2f57mr24497ejc.74.1703768409878; Thu, 28 Dec 2023 05:00:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703768409; cv=none; d=google.com; s=arc-20160816; b=fH0aHau/k6M+8aPcY8YHUgeGcpQxlgrLJma525Qc0CIJw15muBW+8FcFXh+OcymiFo rIVviTKX6tRGmawc5A+GCySrBKMOMe3rB35h2IThIvxBvjkufugziLRgDmxLJbE7oytx 4noWBOp2boenVvQnlonyA2fjLFob2+peIEXbCeUB3OCmWm13a1EmtoIXPycSHPBjmfdT wIGJsD44QAJruFms14H2EKnyW8bRI8/wqwxBWDcv4ZtTPFPoX+uPxcf04TBbiJsrownA K9J9/nr03XBQgWmeTojgoO80RtMHhkNorYowsdr/eysxqvqWsiek7B2B4Z0ynP+/EZsT SIGQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=5OWSKyLISurEYSJL0AfE6kVglHBwO6tL8w6QTNbZ9XM=; fh=nWlCePkpcllO+vKFQygjujkY+gVFca0fYRfPkdb3OoE=; b=ImNeDuRv3A7xFHMLXNHHztictVjjqUxXM/AOck/rdToVV2fNkqxXhUf/eyh8iKJM6e zdLXKyag7JWKmsm7SHXZkAxjABkGuITHQGIHCKX3MxNcGcOz87nxc1g3RJaGRpPdr0nx XUoFuVmK0Y2wk0LL+tVrB/H64lQjtpLflck5/pKKRorXV3OedqdzTuMFCHBcoXzG7esQ Oh1GGGWEGWOHhU+mrBQqhvjtWgUWOXBEN5PZhjp8JZ7JFbxaBIAl9sqUISYyzfWdPYSc 0wKo3m6YcMdGROnUeN6A8kX+KU2n6A/f8l2GUpHaQdwsvDvI+4utUkl05XkXYZtsIpsM vSFA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=M47tJ9iB; spf=pass (google.com: domain of linux-kernel+bounces-12651-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-12651-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id li22-20020a170906f99600b00a236378bbb8si6974832ejb.1052.2023.12.28.05.00.09 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Dec 2023 05:00:09 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-12651-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=M47tJ9iB; spf=pass (google.com: domain of linux-kernel+bounces-12651-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-12651-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 7554C1F242AF for ; Thu, 28 Dec 2023 13:00:09 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1AE66EAF3; Thu, 28 Dec 2023 12:58:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="M47tJ9iB" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-wm1-f52.google.com (mail-wm1-f52.google.com [209.85.128.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E2D24D2FC for ; Thu, 28 Dec 2023 12:58:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-wm1-f52.google.com with SMTP id 5b1f17b1804b1-40d60a96533so12070705e9.1 for ; Thu, 28 Dec 2023 04:58:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1703768295; x=1704373095; darn=vger.kernel.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=5OWSKyLISurEYSJL0AfE6kVglHBwO6tL8w6QTNbZ9XM=; b=M47tJ9iBUUH6ifLw+VPVzidwPUoLbXy8pv6uHHe7Yfo1LWlXEzbuP74S03gzTWhpX4 j+8tEDIp70xUp2++r/CI6pibj/x11xtnuE7+WpjOKJQShR/dtg5EHcthZrFvm9CQAbMo hOq2UOueBJvzn/n1a2ybBAdVg7YzBcSX+0RQzw1QWpzhhPtb+sqygkvSNxE3RPVc+uIJ ZL21rUyCsND9Tk/gxdwF5Y0keOTZV6eXRSQcWywLMdYelr17L/zWbCpVyZpSmMOT0I2X ineu0uq2gAIKBmXeMVjvdHZptEXDi7Hlk0wF4ZRJd9gAfiBZjkjId/oF3NDZHujtjoxI MDEQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703768295; x=1704373095; 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=5OWSKyLISurEYSJL0AfE6kVglHBwO6tL8w6QTNbZ9XM=; b=A90YFEUoQ8EinNj5KkDeWvo+0m17pO9FqzNuqaRdmIr+M3F8DRQ/h5dDmdcQEOVzbv buPcRHB0TqAu1soa3rNdwS2BxuMsm6AVENT0+7Vo420FnKu5ribkKFNkMHok8SAdMZE4 DmZpWeqLLz05RGW/HmKYhttWDzUrqvOl3f/PZmQ1wJORL+A5dcOZjethQam9cliihskr 0UtuQldIKn5pmog2zr4405YKPcSKAjjVTH3J9AFoMmMsS72Mn6d2iPzrTIZ9Df1WiFiQ 3SqY8oZe9SKFVulU9PzHf+wRh2Oh4snuR1wHMBbzmf6pygYHpRSwl8OYwjnKCOwM/Md3 fSiw== X-Gm-Message-State: AOJu0Yw83SfspQiC0YAd4nTGZpckyw3ZVvutbWe1sgxQJkTYpGkklK2b TPXG4oB7JfB953Pb9cYufzDCN1q0qfk7rgj/BZcB1JNM45b6zQ== X-Received: by 2002:a05:600c:5489:b0:40d:6045:b1ff with SMTP id iv9-20020a05600c548900b0040d6045b1ffmr1167130wmb.126.1703768295262; Thu, 28 Dec 2023 04:58:15 -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 h9-20020a05600c350900b0040d5aca25f1sm8615807wmq.17.2023.12.28.04.58.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Dec 2023 04:58:14 -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, 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, kernel-team@android.com, Tudor Ambarus Subject: [PATCH v2 05/12] tty: serial: samsung: set UPIO_MEM32 iotype for gs101 Date: Thu, 28 Dec 2023 12:57:58 +0000 Message-ID: <20231228125805.661725-6-tudor.ambarus@linaro.org> X-Mailer: git-send-email 2.43.0.472.g3155946c3a-goog In-Reply-To: <20231228125805.661725-1-tudor.ambarus@linaro.org> References: <20231228125805.661725-1-tudor.ambarus@linaro.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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. Signed-off-by: Tudor Ambarus --- 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 97ce4b2424af..938127179acf 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); -- 2.43.0.472.g3155946c3a-goog