From patchwork Thu Jan 25 14:49:38 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tudor Ambarus X-Patchwork-Id: 13530983 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 5BE1BC47258 for ; Thu, 25 Jan 2024 14:50:51 +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: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:In-Reply-To:References: List-Owner; bh=G/cqV5hedO5amxBe9n/pphurubGzrUck4SCHmtPJzBk=; b=OBPkAHi2TKqsjx PZdaAIybs1SQLWSFdHWBc44BsXtM6e4wbqbC40mIN2C5l/pMWnxpJIAHddjpZGKnjTDQ+q1JmT0TB 4vykprTo1Z5W2rjvHriKhryXz6uWECkb2nAS7Njzdm4brMXgFQDgTotm/rfLCp7HI/8wGhjZ/pwTH Z60GrvvVyeILE3Ut7lOHMr5+nK8PqWHCUHgFxAoAwD30fhPd7C/36mPNUmA7Zc+wkAMzRcNZu1TFi pysPIydEcqPCBUAm9ExuAxqiGn9Pae3yNvRZ1oyeWAguRTf3jcUVBGD0E7K+9lS47Uw8p8PxWwptX u8zKaDzMEO+dQX+8VdyA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rT13s-00000000S9W-3Y78; Thu, 25 Jan 2024 14:50:36 +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 1rT13V-00000000Rqm-0m0U for linux-arm-kernel@lists.infradead.org; Thu, 25 Jan 2024 14:50:14 +0000 Received: by mail-wr1-x42e.google.com with SMTP id ffacd0b85a97d-33922b66bd7so4690407f8f.2 for ; Thu, 25 Jan 2024 06:50:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1706194211; x=1706799011; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=7ZI/5KwC+xCytuTFH+W+O2jy1GV4Q+e+HfUN4cLRoNQ=; b=LsnsLiteTWvtzj9CUdpb3pnd2IuzpS2+zZPvQAMNMTWe6Uasfs8SjBlrhxfP7+0Xuh WWBrt76CViAJRiE5gf5mrlSkTLB6StCjaWOINTE44zG/oj0dc/pfAQfZ2A6APIsBlw9/ PVxFR722yJGSrq3Xm6WfbI2xRiOnIA6XLQYIskyhXTaAT8ICBC2xvSb26F8pAc17G+jw aOkZ9V5ga6AZR7qyLk2t+sLFlEdy4miDA9OBmdmIzwKYECCZydXFHJqJPfCbRRi8M9p5 ObvVq3hh5Gu3Mdg7Zg4dcpqn0Z34UGKF01rHlFxQOcdj0D5iZxG70dAZVGPXxE2OVwSW x3wQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706194211; x=1706799011; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=7ZI/5KwC+xCytuTFH+W+O2jy1GV4Q+e+HfUN4cLRoNQ=; b=ux+mS/QGw5VLj6KDvqDOc+PMkWwSuaev0nu5tACc8w9dRPAbbaIO10SufBUczAxXze eUMAViYJWh7626eRmRaTia0DjchubOzCk57KMvTu2IvFFVc/LeYpWSxyro6qYshdLqLY 1x3DZ3pGRrd/ZMn+B+mYjodeFOPY1nd8NnfJhZIplQiX5Ob7yLM1s1/n6b3rR600oIvW LkV4dlhn0M7XmFS5zIweGEXrNmRKKRKdrhjfD5AbU37NM0xH+mfZhogecD1aLfyAkME5 SB8HYyMBpa+KBYUBhq72wuWWqA3by6ywE0nL7mpKAm5gSetK3l5w4ssWzXtXZLvcC9t4 V3TA== X-Gm-Message-State: AOJu0YyQlA1kuR7+DFtaSf/1Krm1c/d0dsB6SWW1hGxcioKQ1pIUkO03 1d4tP+sESVbKuEN1NZc8GvMzI+/wBwJVZKcLISeQ38+WcAOmXY2DGvGN0XIqhhE= X-Google-Smtp-Source: AGHT+IErX2MgfpP0Fe4RLqMkR9jYxbhETFvxJ2DoDmgkGrm1I0WK2BsVFDTJMWeO23FcBD4LNFaINA== X-Received: by 2002:adf:f28f:0:b0:337:c6ee:204a with SMTP id k15-20020adff28f000000b00337c6ee204amr824782wro.93.1706194210889; Thu, 25 Jan 2024 06:50:10 -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 v17-20020a05600c471100b0040d91fa270fsm2875875wmo.36.2024.01.25.06.50.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jan 2024 06:50:10 -0800 (PST) From: Tudor Ambarus To: broonie@kernel.org, andi.shyti@kernel.org, arnd@arndb.de Cc: robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, alim.akhtar@samsung.com, linux-spi@vger.kernel.org, linux-samsung-soc@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-arch@vger.kernel.org, andre.draszik@linaro.org, peter.griffin@linaro.org, semen.protsenko@linaro.org, kernel-team@android.com, willmcvicker@google.com, Tudor Ambarus Subject: [PATCH v2 00/28] spi: s3c64xx: winter cleanup and gs101 support Date: Thu, 25 Jan 2024 14:49:38 +0000 Message-ID: <20240125145007.748295-1-tudor.ambarus@linaro.org> X-Mailer: git-send-email 2.43.0.429.g432eaa2c6b-goog MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240125_065013_357761_73F4FF66 X-CRM114-Status: GOOD ( 19.60 ) 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 Hi, Special attention is needed for: ``asm-generic/io.h: add iowrite{8,16}_32 accessors`` as it's not under SPI's umbrella. If the accessors are fine, I expect they'll be queued either to the SPI tree or to the ASM header files tree, but by providing an immutable tag, so that the other tree can merge them too. The spi dt-bindings patches can be queued through the SPI tree, but they'll need an immutable tag too. They'll be needed in the samsung tree as I'll follow with patches for the samsung device trees to use the "samsung,spi-fifosize" property. The patch set cleans a bit the driver and adds support for gs101 SPI. For the cleaning part, I removed the unfortunate dependency between the SPI of_alias and the fifo_lvl_mask array from the driver. The SPI of_alias was used as an index into the fifo_lvl_mask to determine the FIFO depth of the SPI node. Changing the alias ID into the device tree would make the driver choose a wrong FIFO size configuration, if not accessing past the fifo_lvl_mask array boundaries. Not specifying an SPI alias would make the driver fail to probe, which is wrong too. Apart of the SPI patches, I added support for iowrite{8,16}_32 accessors in asm-generic/io.h. This will allow devices that require 32 bits register accesses to write data in chunks of 8 or 16 bits (a typical use case is SPI, where clients can request transfers in words of 8 bits for example). GS101 only allows 32bit register accesses otherwise it raisses a Serror Interrupt and hangs the system, thus the accessors are needed here. The first 3 patches are fixes and they are intentionally put at the beginning of the series so that they can be easily queued to the stable kernels. The SPI patches were tested with the spi-loopback-test on the gs101 controller. Thanks! ta Changes in v2: - move fixes at the beginning of the series so that they can be queued easily to the stable kernels. - break the dependency between the SPI of_alias, the fifo_lvl_mask and the FIFO depth. Provide alternatives to either infer the FIFO size from the compatible, where the SoC uses the same FIFO size for all the instances of the IP, or by using the "samsung,spi-fifosize" dt property, where the SoC uses different FIFO sizes for the instances of the IP. - split patches or other cosmetic changes, collect R-b tags. Tudor Ambarus (28): spi: s3c64xx: explicitly include spi: s3c64xx: explicitly include spi: s3c64xx: avoid possible negative array index spi: dt-bindings: samsung: add google,gs101-spi compatible spi: dt-bindings: samsung: add samsung,spi-fifosize property spi: s3c64xx: sort headers alphabetically spi: s3c64xx: remove unneeded (void *) casts in of_match_table spi: s3c64xx: remove else after return spi: s3c64xx: use bitfield access macros spi: s3c64xx: use full mask for {RX, TX}_FIFO_LVL spi: s3c64xx: move common code outside if else spi: s3c64xx: check return code of dmaengine_slave_config() spi: s3c64xx: propagate the dma_submit_error() error code spi: s3c64xx: rename prepare_dma() to s3c64xx_prepare_dma() spi: s3c64xx: return ETIMEDOUT for wait_for_completion_timeout() spi: s3c64xx: simplify s3c64xx_wait_for_pio() spi: s3c64xx: drop blank line between declarations spi: s3c64xx: fix typo, s/configuartion/configuration spi: s3c64xx: downgrade dev_warn to dev_dbg for optional dt props spi: s3c64xx: add support for inferring fifosize from the compatible spi: s3c64xx: infer fifosize from the compatible spi: s3c64xx: drop dependency on of_alias where possible spi: s3c64xx: retrieve the FIFO size from the device tree spi: s3c64xx: mark fifo_lvl_mask as deprecated asm-generic/io.h: add iowrite{8,16}_32 accessors spi: s3c64xx: add iowrite{8,16}_32_rep accessors spi: s3c64xx: add support for google,gs101-spi MAINTAINERS: add Tudor Ambarus as R for the samsung SPI driver .../devicetree/bindings/spi/samsung,spi.yaml | 6 + MAINTAINERS | 1 + drivers/spi/spi-s3c64xx.c | 530 ++++++++++-------- include/asm-generic/io.h | 50 ++ include/asm-generic/iomap.h | 2 + 5 files changed, 345 insertions(+), 244 deletions(-)