Message ID | 20240216070555.2483977-12-tudor.ambarus@linaro.org |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-68152-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:c619:b0:108:e6aa:91d0 with SMTP id hn25csp343866dyb; Thu, 15 Feb 2024 23:09:12 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXVG6NMRynYrPVWOLQjhDqf1FXxZlMaqNSbOMEsSl8A20dO8Mj4pNMRZxoeJNbqFcpaAT/zDkAYOAXMUqq6ran1dYwmmQ== X-Google-Smtp-Source: AGHT+IE7OJPS1KQcrwUNBc4O8yoYXb3o2Vq1B6KlgZ4gX8vTE3xmutKO68DREWPH3ygU2t5/s5iO X-Received: by 2002:a05:6402:230e:b0:563:f854:1a58 with SMTP id l14-20020a056402230e00b00563f8541a58mr346337eda.36.1708067352358; Thu, 15 Feb 2024 23:09:12 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708067352; cv=pass; d=google.com; s=arc-20160816; b=fq2Jor/0IaiF5HzzZKO8Fwh53/52zX12NBzNvL1xLuDAELg4NSB3EJqcRQz+5z6dP4 DHlmVp32YGIjyNAETnsLRMdJa3fjMeqTY9uM3FwfmtLNBxISJ/b4RtVn5fnnV9wM9OAW QtMHZEa2sOhkBwCTR2cIFZW6jJn0SRsavy+f+EI+5EjhvclQb79jzYqRG+FTZw4CUG/c GWeOMOjhiArEtcSmMK9BydwrxoLLMqr+dZcTN/dkJ0TWvyMQgcFcFNTPMo4DBA7ItvDP lCxEknepQUHwDqNIqv9qv4bP8ZbKto7EXSRzQkcPr8AZDWQbnQzuLZrhDhdS1qUMb1pG 5bOg== ARC-Message-Signature: i=2; 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=VlEAGth0Co0Fd1/HqPxdx3qoYNRQ6mjC1NaX6yHqe58=; fh=XXQDxJQsAKokWie704ukwPgq9MVMXuXn01rIQ0uIQ2o=; b=aIQ/7isL0okhqUI1KE7z9XK2rzKiwxoF4073riQhpbRTs6qItcaTWhmYOZTWZOS/03 bE7cRCb2CA98CFzOzGDQ59rd87CyCuldzgs5ne/3mXgF+IaxZ8VKr0tD5Ofuq0Z7vIts 5NItRy99VB68puoxkUvYNjzm5dnR7LMTp4Z0/NJ8sJEGSx6DFB8yRHy7BDU9dGvFqAnn IurDAqfW6rUE0f1D5711kcC0jkucSe+YB2ghOjKy+ybzE3BKU5jsewM4BpI/tCh54r6b GvY4wGx7HfQuU9fcau9XHQJenQCFpu0NE1048gtRNegYYIwEnt2L7j0mPJblRTErO5P5 Sv3Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ffKFRJqw; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-68152-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-68152-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id d20-20020a05640208d400b00564030f5301si4473edz.375.2024.02.15.23.09.12 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Feb 2024 23:09:12 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-68152-ouuuleilei=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=ffKFRJqw; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-68152-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-68152-ouuuleilei=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 F32231F211A7 for <ouuuleilei@gmail.com>; Fri, 16 Feb 2024 07:09:11 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A75AD1CD05; Fri, 16 Feb 2024 07:06:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="ffKFRJqw" Received: from mail-wr1-f44.google.com (mail-wr1-f44.google.com [209.85.221.44]) (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 E1A5215491 for <linux-kernel@vger.kernel.org>; Fri, 16 Feb 2024 07:06:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.44 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708067175; cv=none; b=UBlgR3aIxfZ9AZkiSn7QULbiA6wgcP6o/XZwQoCM4EQHbiVrFQlOi0FpzSag+dcOLbWJ0iOZr9bDPz8BkAKXlDaQsXv+d4nlB42c4LEDk/QCFP0PwJU1I3U0EM9WJuk6eyI9JHSkVeumy71qjGgSAVdezswwYMF1k4h/eykW8jI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708067175; c=relaxed/simple; bh=rEwrNRSJosIOETt0muN0AvqXSARw3AJvb0f7av+IGBQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ho9ytafFVWdoPwG/IrlmGc3uTh0VEt3MXGmoXKzulXqSvAxQHgkluiUHhCgifa5KNxuyrejhPFPO1wgw6gtLlig4nLra0MkfsIhiQzYcAasMxMylsq8NOmfggotDvON+FQUiKK0oiJ3SQgYFx6Vy8Amlzb827qfHAPGO0G2yQYE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=ffKFRJqw; arc=none smtp.client-ip=209.85.221.44 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-wr1-f44.google.com with SMTP id ffacd0b85a97d-33aeb088324so888846f8f.2 for <linux-kernel@vger.kernel.org>; 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=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=VlEAGth0Co0Fd1/HqPxdx3qoYNRQ6mjC1NaX6yHqe58=; b=ffKFRJqwyvE1v+mM5CWK0Cr9akqi6NP9i0ksU9HtIZaftDCM6M63RKnzqp+O7HgObC bBF4b8sKlHHkL2ZxWwnFfz8PDqoc/2lKY4fhmL4kzzeFBlj59kJTRM1q3BEg7RY7xgkV /BFnhdnyaGdi+h3s7j00Zxg0Ex1ExzAXZYs2ZrZpPML8ZvxQWOhJwn4VoXnHX9NMUqyx 1KVDpib/H7M1rFTE5l1BIoZwurMSN/UUGZ3neHjXHggxgETWAsiZ5QNVsyyfIotYnagm Ueil/uSQ76P48pUJqj5Mxi6lJKoX1opTHRIsYMxw6tPI2vjgwLCHQv8PHtoNOUd5/Ycw eK6g== 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=QqYKe0wdY7W5PepwXNYZB+Opu96SMOxcWTNrUWjuGkXOK9q8ifM0Xav3tysY1wCXKE 0wO5a+VqHJnG9XdCUAfcoy9zXZ7It6FM/ef/9cuPUO71Sok+dExrrtT/QE/2Y/VOCSRv mhgVSwH5odQho4Y2rLLCz0knercq4Q9SIiHEgmx1UKJRy5oGkXju/2/GFQ3Vp0cRzzHa OKimKHzaaHOyXQBnPpTN4OinkJ3Oj/c9WEM/coc82Pxli0pgmJOo+9OoyQlaOUC0Ei1w NaXixUDOxvejvSgebkbpd1tsEDpvyAAD6cNzpGitVviIyF5MfJp5aHRgfhgVZg/iUbfy ibvA== X-Forwarded-Encrypted: i=1; AJvYcCXV8GuG01x9UeeIywMzysMYPJGKupPSFnaLk9FdoQbzOLi5bbsBLQedkZCsh4aXjc4DQdoHCdl/RLeR+7AI4EzlQvtpLouDWLfYam65 X-Gm-Message-State: AOJu0YwnE4nrUFdiaQmAMY2NMn7pqabUyOqnxrk/CLVQDfwsvI0vWL6O BXNDOwGtuH3By14sq6ewmcg2Q/9/4Z3844Ne7ellig4CtiNSL8wDwOmqsPgyww0= 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 <tudor.ambarus@linaro.org> 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 <tudor.ambarus@linaro.org> 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> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: <linux-kernel.vger.kernel.org> List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1791038431863412249 X-GMAIL-MSGID: 1791038431863412249 |
Series |
spi: s3c64xx: remove OF alias ID dependency
|
|
Commit Message
Tudor Ambarus
Feb. 16, 2024, 7:05 a.m. UTC
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 <tudor.ambarus@linaro.org>
---
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 <linux/spi/spi.h> #include <linux/types.h> -#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,