From patchwork Fri Feb 16 07:05:54 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tudor Ambarus X-Patchwork-Id: 13559622 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 5F89DC48260 for ; Fri, 16 Feb 2024 07:06:50 +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=+qsfM+WSKvd02/dt7G06hhPYh0pIClUUijVPCiJzZQk=; b=Y1/giGaoNFw/QO JLQXyfjVHmC8Vv20Zold+k4Kp0rzniUgkIjZ3CJhQwR14weVqrI545f8vTAoQ3HrTgDhcQjEbtqMY mnnEAzUzAzhpnqkXUh1i5NWDKMB2SRwuviZnwUZMbpE6VJyXjA+hLqZvo84NPaxsa+A6bVXMpedtE TQo39Q7Kzlwv+LyI7r7lE1n58uhS+BRrFFX+b0BuDHEJDge9TJjQ2hIU5z8/ejoRZDJOnTA2LEM0E yvdyYlNHtsXcBqhqDKdRh7QRfXvP4FybSm2DOFfId1508M8HeIuA22n3xrFDYRdaqHTKYWk3kV6Z9 zEY3Lu4ApEup5lJN5VxA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rasIs-00000001JSv-2iLN; Fri, 16 Feb 2024 07:06:34 +0000 Received: from mail-wr1-x42e.google.com ([2a00:1450:4864:20::42e]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rasIX-00000001JD3-1UMK for linux-arm-kernel@lists.infradead.org; Fri, 16 Feb 2024 07:06:14 +0000 Received: by mail-wr1-x42e.google.com with SMTP id ffacd0b85a97d-33cf6266c76so986096f8f.1 for ; Thu, 15 Feb 2024 23:06:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1708067172; x=1708671972; 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=VlEAGth0Co0Fd1/HqPxdx3qoYNRQ6mjC1NaX6yHqe58=; b=KkztgoehqUwrpCGYlDir0uvYOfAb5ZXDmz4GtiB7/SJCVjWLjWQzlPDtB9yOk6NaCP aNCt87gMTEKNZT1o2YhfgtSNqqr/RnqJLeARH6tpept3abVR68P/Jbv2KUtkD7G0TyKV IKVYCsDG22TzM5Z1/tmkIYYD1v4RUVnGXlITFCPu79OcFjX0EldzfP+dxvWxfkDXWpEs dhYMMlsDf4kV0ZZSYx3SB9H3Jybuy+nKw35Cy7tudVzKH2vP3F/ID6sajc45ue1oij6t hcYeR8WQrmZGQT3saUIHIPhVoBMAvt1jGLt92IMZhk+5sK5oy0nqGfQCXZxY+nnE9GxL 5brg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708067172; x=1708671972; 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=VlEAGth0Co0Fd1/HqPxdx3qoYNRQ6mjC1NaX6yHqe58=; b=FiwZhM91EwpfPgfitsOUDKylw+qAsp+NwmWyHQ2B7++ahNAWOocSQ/b7YRwoQL5kfw 5NvdYX9WkzCydn0FfIEc8T2hwXZXzKjRLOyf/Y+VsHv5CS/wUrdOwaYZBOII7bhfy71V MYr/jNiUYr0kSNZ8YWAKK+GG41O81T1ZgdwX0U6TMtQz0n96b6plvu3rXHfAZQdUPRmi gqvzFjNR0k5UqTZPo0JB08o9WU79kt/hlOXjBePyK1pQorAZ9JsSbBYXlZ7N41DxXgAv /VwBB268SR/OFy7JnNn6nAvjVCv4HizA8d9KfAujchaBDZD3MZCBykE5XkQt4y0yE2F1 hu3g== X-Forwarded-Encrypted: i=1; AJvYcCU+up/rZYBgf6ZEJuwFh85Eqvx+97RWl7q+DMfHVIZZ//OzXQOYl4TUqpEqVCsDave6eMXuNOyXUzSBqVFBNEtD938kuQocltSKMNEYQgIRp//9e1U= X-Gm-Message-State: AOJu0Ywu0cueOS18o3o43BjwaPa8iCRLExyoGhem00gzP6twXMS/ODKl 4zhxgT/UnwC+PLfqrwdOYpHd5fcwRlE0gLyWIQQWEjP0BvTTJxwS85Miz4w/BbY= X-Google-Smtp-Source: AGHT+IGsrLV3+RiNvxI1/B9FQ/CQQICwL4VfbwMyZyOecZRcb4rbORmTFjVsORHRgY2cfPv7UUbymw== X-Received: by 2002:a5d:414a:0:b0:33b:6d36:de48 with SMTP id c10-20020a5d414a000000b0033b6d36de48mr3298206wrq.26.1708067172176; Thu, 15 Feb 2024 23:06:12 -0800 (PST) Received: from ta2.c.googlers.com.com (105.168.195.35.bc.googleusercontent.com. [35.195.168.105]) by smtp.gmail.com with ESMTPSA id k18-20020a5d66d2000000b0033940016d6esm1298839wrw.93.2024.02.15.23.06.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Feb 2024 23:06:11 -0800 (PST) From: Tudor Ambarus To: broonie@kernel.org, robh@kernel.org, andi.shyti@kernel.org, krzysztof.kozlowski@linaro.org, semen.protsenko@linaro.org, conor+dt@kernel.org Cc: alim.akhtar@samsung.com, linux-spi@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, andre.draszik@linaro.org, peter.griffin@linaro.org, kernel-team@android.com, willmcvicker@google.com, devicetree@vger.kernel.org, Tudor Ambarus Subject: [PATCH v3 11/12] spi: s3c64xx: switch gs101 to new port config data Date: Fri, 16 Feb 2024 07:05:54 +0000 Message-ID: <20240216070555.2483977-12-tudor.ambarus@linaro.org> X-Mailer: git-send-email 2.44.0.rc0.258.g7320e95886-goog In-Reply-To: <20240216070555.2483977-1-tudor.ambarus@linaro.org> References: <20240216070555.2483977-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-20240215_230613_426019_93B300D8 X-CRM114-Status: GOOD ( 13.31 ) 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 Drop the fifo_lvl_mask and rx_lvl_offset and switch to the new port config data. Advantages of the change: - drop dependency on the OF alias ID. - FIFO depth is inferred from the compatible. GS101 integrates 16 SPI IPs, all with 64 bytes FIFO depths. - use full mask for SPI_STATUS.{RX, TX}_FIFO_LVL fields. Using partial masks is misleading and can hide problems of the driver logic. S3C64XX_SPI_ST_TX_FIFO_RDY_V2 was defined based on the USI's SPI_VERSION.USI_IP_VERSION register field, which has value 2 at reset. MAX_SPI_PORTS is updated to reflect the maximum number of ports for the rest of the compatibles. Signed-off-by: Tudor Ambarus --- drivers/spi/spi-s3c64xx.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/spi/spi-s3c64xx.c b/drivers/spi/spi-s3c64xx.c index 128f4a7c4bd9..784786407d2e 100644 --- a/drivers/spi/spi-s3c64xx.c +++ b/drivers/spi/spi-s3c64xx.c @@ -20,7 +20,7 @@ #include #include -#define MAX_SPI_PORTS 16 +#define MAX_SPI_PORTS 12 #define S3C64XX_SPI_QUIRK_CS_AUTO (1 << 1) #define AUTOSUSPEND_TIMEOUT 2000 @@ -79,6 +79,8 @@ #define S3C64XX_SPI_INT_RX_FIFORDY_EN (1<<1) #define S3C64XX_SPI_INT_TX_FIFORDY_EN (1<<0) +#define S3C64XX_SPI_ST_RX_FIFO_RDY_V2 GENMASK(23, 15) +#define S3C64XX_SPI_ST_TX_FIFO_RDY_V2 GENMASK(14, 6) #define S3C64XX_SPI_ST_TX_FIFO_LVL_SHIFT 6 #define S3C64XX_SPI_ST_RX_OVERRUN_ERR (1<<5) #define S3C64XX_SPI_ST_RX_UNDERRUN_ERR (1<<4) @@ -1615,11 +1617,9 @@ static const struct s3c64xx_spi_port_config fsd_spi_port_config = { }; static const struct s3c64xx_spi_port_config gs101_spi_port_config = { - /* fifo_lvl_mask is deprecated. Use {rx, tx}_fifomask instead. */ - .fifo_lvl_mask = { 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, - 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f}, - /* rx_lvl_offset is deprecated. Use {rx, tx}_fifomask instead. */ - .rx_lvl_offset = 15, + .fifo_depth = 64, + .rx_fifomask = S3C64XX_SPI_ST_RX_FIFO_RDY_V2, + .tx_fifomask = S3C64XX_SPI_ST_TX_FIFO_RDY_V2, .tx_st_done = 25, .clk_div = 4, .high_speed = true,