Received: from mail-io1-f68.google.com (mail-io1-f68.google.com [209.85.166.68]) (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 6E18F25D528 for ; Mon, 27 Oct 2025 12:55:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.68 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761569713; cv=none; b=uitrwho8N9IYiKikXbhUpknqQNwN3wnV+JlDv/sqycoQwPGFf2PqPGby1oFuzO2Y0Czva8WjlDAXjeJ/VqYhE5+yukQn9t085ZOLPNpMycYdo9pfYvUy68HJ/6a6IEUKYhInThkoRP9ZeMiDVWyYfAywiHIK9uAVNbcBXNOp2v4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761569713; c=relaxed/simple; bh=Y1P+Ko6EypVqbiO04L0KXvr1REByV8AEUux9zAD3i0s=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=SbL3KR6lEymgM+CWkP11pjPoRwP6pYwZQQIGvQDvzkncLo/9gaol52/DG46t4ujvZpyE7bP1sYfS0V9PRP85RMAu9HsziLHRlYVxPoISOfF78p1xvt18rqK0OTRlctSSVwQXDMu4h5BXeLHOo+i9ypdrMWkYkSjT8fuTEaXyJZo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=riscstar.com; spf=pass smtp.mailfrom=riscstar.com; dkim=pass (2048-bit key) header.d=riscstar-com.20230601.gappssmtp.com header.i=@riscstar-com.20230601.gappssmtp.com header.b=ZvqER0x0; arc=none smtp.client-ip=209.85.166.68 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=riscstar.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=riscstar.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=riscstar-com.20230601.gappssmtp.com header.i=@riscstar-com.20230601.gappssmtp.com header.b="ZvqER0x0" Received: by mail-io1-f68.google.com with SMTP id ca18e2360f4ac-938bf212b72so193984139f.1 for ; Mon, 27 Oct 2025 05:55:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=riscstar-com.20230601.gappssmtp.com; s=20230601; t=1761569709; x=1762174509; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=4nAF82uQdqoZ+b3y8tjZiPVkCVKQg6rD1LcHeZvN9hk=; b=ZvqER0x097OGPM9gQejW4oG4u0baRK2jM+AZOW6u7qGKku4U63SMkcVKZ+Q9y/946m GpPCrvhw96mASkQpftNQYTsrmxpF7Agbez83rZhEJOU6qwEHQiLkfRQf++mG0EeNaq1M vdaX5daqywna3CU+4W3n3bWha7WVp51oGWJCjsilQ3dhQD1PxcoAsp5kelW7/XjIcqJ3 3PJFgHrRv8m59H1Vt/Ay4KGLT5hYuZ7txhqnf7x90S0ce992X6cscrJPbTkAElvAh2gb fvgt+sqxqu3aMVViXfSnY3IZ4KsJtaraon57gx/mr3560lUZaSrrA/uSWaX4oHkd0AEn p5HA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1761569709; x=1762174509; 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=4nAF82uQdqoZ+b3y8tjZiPVkCVKQg6rD1LcHeZvN9hk=; b=cqN0I82O9fabxjbn2PyCafmLHi5G6mw2VYoyPnYYkK92lLP4F8R31/yOu4iesYK652 ugOHdCpmrxvCoG9y2p0HIJyW12fDD4D3rY/ZRb6xEFUljeoy4EYvix40zvTgWqr7zByv ZEdeogydthgyVIK/79RSNfhQ0AL1ZJCAK2e25SjgOt2Oued05LZsx5+ZhdQzxfzbIW4a lF8XJG/lcc0YvwurVZqLi/xllE0kBYrorfVVpmAZEFVMYH5xU4hy54pnzFYljZfc5Eof VfmMtIq/Le5Xpdeoqj+IBvwRmDQVleRArCxzFYOyIgeye832M2LwU9oW0ztLPZUzUsKL PB6A== X-Forwarded-Encrypted: i=1; AJvYcCXo2x1GZK1nZLUlbVYZSYuLbipdXw4c6aPuqW4E6E0V4QAAYoTlJgTblidpMyttnvHzV+pOt9dAqBVE@vger.kernel.org X-Gm-Message-State: AOJu0YxtHoIlPy2i7ieArC20taACg5KPdr/E+pZb+P4Da9Is1lj/VKl/ 1iv8CpO5CohBIFTAByC0LlpVi+Tsvia7Oc26VS7LtE9zSgCWuq0Cr27YkCoXeLino28= X-Gm-Gg: ASbGncveGmm3RMOdXXkhsD2ecvknPV4+w0TRJqIG5n8TIT80VglD0qofuPeZeALc1fZ UqzjPxKyxI5sBn5G0Eg5e4CREHfjz3MIzOx1ScY0j95KWp14JipReumDFI0wZLSG9ho/iKOtpuv AaTjmHLICkv9rQe7pk8DxTcx3E54XnMhA6SwOqJ6VWivRwtQcLCAM9V3lPkPGc62323iDtYXVg9 veW+HDmVXBzzd8Ja8xHvdA9uq0uVF7xbqdQgs5N8RDRmazh9/v3w3+RBCQ6focJbIxXLW0qVOhG t8sPSN9RWvP34Llxzzz4Pnq6gr4DlHF8MAlghsCoaTNXPwJwxA9omj+nwLKxfOOvkoVAMtSmWQP GIRzJeEfGXn00rZjhzi1Qi21GQinZ1C6Pl0Am7YzDcEuK9WnKuFKqqsKD4TVtGKxi3ImOjTra/u j6RRAG7wVut0cqWnDHtvfukHU7jisEGspBZdVj4A9lOKtf4MD3UpIDVA== X-Google-Smtp-Source: AGHT+IF9dogLPfu3KKBrg4aJADxwDW+rw89Jp80NmbsD4vytQNTH3nxBh7Ne+iAACQ+ZbrAmLBB0QQ== X-Received: by 2002:a05:6602:29d2:b0:93e:871f:b060 with SMTP id ca18e2360f4ac-93e871fb6b2mr5001344339f.15.1761569709430; Mon, 27 Oct 2025 05:55:09 -0700 (PDT) Received: from zippy.localdomain (c-75-72-117-212.hsd1.mn.comcast.net. [75.72.117.212]) by smtp.gmail.com with ESMTPSA id ca18e2360f4ac-94359e742efsm249121639f.7.2025.10.27.05.55.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Oct 2025 05:55:08 -0700 (PDT) From: Alex Elder To: broonie@kernel.org, dlan@gentoo.org Cc: robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, pjw@kernel.org, palmer@dabbelt.com, aou@eecs.berkeley.edu, alex@ghiti.fr, p.zabel@pengutronix.de, devicetree@vger.kernel.org, linux-spi@vger.kernel.org, spacemit@lists.linux.dev, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v6 0/3] spi: support the SpacemiT K1 SPI controller Date: Mon, 27 Oct 2025 07:55:00 -0500 Message-ID: <20251027125504.297033-1-elder@riscstar.com> X-Mailer: git-send-email 2.48.1 Precedence: bulk X-Mailing-List: devicetree@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit This series adds support for the SPI controller found in the SpacemiT K1 SoC. The driver currently supports only master mode. The controller has two 32-entry FIFOs and supports PIO and DMA for transfers. Version 6 is identical to version 5, other than being rebased onto a current linux-next/master. -Alex This series is available here: https://github.com/riscstar/linux/tree/outgoing/spi-v6 Between version 5 and version 6: - Rebase only Here is version 5 of this series: https://lore.kernel.org/lkml/20251013123309.2252042-1-elder@riscstar.com/ Between version 4 and version 5: - Added Yixun's Reviewed-by tag on patch 3 Here is version 4 of this series: https://lore.kernel.org/lkml/20250925121714.2514932-1-elder@riscstar.com/ Between version 3 and version 4 (all suggested by Yixun): - Fixed an underrun/overrun comment error - Renamed a pinctrl node - Formatted dmas and dma-names properties on one line Here is version 3 of this series: https://lore.kernel.org/lkml/20250922161717.1590690-1-elder@riscstar.com/ Between version 2 and version 3: - Add Conor's Acked-by to patch 1 - Add Rob's Reviewed-by to patch 1 - Added imply_PDMA to the SPI_SPACEMIT_K1 Kconfig option - Fixed a bug pointed out by Vivian (and Troy) in word-sized reads - Added a comment stating we use 1, 2, or 4 bytes per word - Cleaned up DMA channels properly in case of failure setting up - No longer use devm_*() for allocating DMA channels or buffer - Moved the SPI controller into the dma-bus memory region Here is version 2 of this series: https://lore.kernel.org/lkml/20250919155914.935608-1-elder@riscstar.com/ Between version 1 and version 2: - Use enum rather than const for the binding compatible string - Omit the label and status property in the binding example - The spi-spacemit-k1.o make target is now added in sorted order - The SPI_SPACEMIT_K1 config option is added in sorted order - The SPI_SPACEMIT_K1 config does *not* depend on MMP_PDMA, however MMP_PDMA is checked at runtime, and if not enabled, DMA will not be used - Read/modify/writes of registers no longer use an additional "virt" variable to hold the address accessed - The k1_spi_driver_data->ioaddr field has been renamed base - The DMA address for the base address is maintained, rather than saving the DMA address of the data register - The spi-max-frequency property value is now bounds checked - A local variable is now initialized to 0 in k1_spi_write_word() - The driver name is now "k1-spi" - DT aliases are used rather than spacemit,k1-ssp-id for bus number - The order of two pin control properties was changed as requested - Clock names and DMA names are now on one line in the "k1.dtsi" - The interrupts property is used rather than interrupts-extended - The order of two pin control properties was changed as requested - Clock names and DMA names are now on one line in the "k1.dtsi" - The interrupts property is used rather than interrupts-extended Here is version 1 of this series: https://lore.kernel.org/lkml/20250917220724.288127-1-elder@riscstar.com/ Alex Elder (3): dt-bindings: spi: add SpacemiT K1 SPI support spi: spacemit: introduce SpacemiT K1 SPI controller driver riscv: dts: spacemit: define a SPI controller node .../bindings/spi/spacemit,k1-spi.yaml | 84 ++ .../boot/dts/spacemit/k1-bananapi-f3.dts | 15 +- arch/riscv/boot/dts/spacemit/k1-pinctrl.dtsi | 20 + arch/riscv/boot/dts/spacemit/k1.dtsi | 15 + drivers/spi/Kconfig | 9 + drivers/spi/Makefile | 1 + drivers/spi/spi-spacemit-k1.c | 965 ++++++++++++++++++ 7 files changed, 1105 insertions(+), 4 deletions(-) create mode 100644 Documentation/devicetree/bindings/spi/spacemit,k1-spi.yaml create mode 100644 drivers/spi/spi-spacemit-k1.c base-commit: 8fec172c82c2b5f6f8e47ab837c1dc91ee3d1b87 -- 2.48.1