linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] spi: rb4xx: add COMPILE_TEST support
@ 2025-08-21  3:35 Rosen Penev
  2025-08-26 20:35 ` kernel test robot
  0 siblings, 1 reply; 2+ messages in thread
From: Rosen Penev @ 2025-08-21  3:35 UTC (permalink / raw)
  To: linux-spi; +Cc: Mark Brown, open list

Copy macros from ath79 SPI driver to allow compilation on all platforms
and remove ath79 specific header.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
---
 drivers/spi/Kconfig     |  2 +-
 drivers/spi/spi-rb4xx.c | 19 ++++++++++++++-----
 2 files changed, 15 insertions(+), 6 deletions(-)

diff --git a/drivers/spi/Kconfig b/drivers/spi/Kconfig
index 891729c9c564..2c1e60ae1680 100644
--- a/drivers/spi/Kconfig
+++ b/drivers/spi/Kconfig
@@ -916,7 +916,7 @@ config SPI_ROCKCHIP_SFC
 
 config SPI_RB4XX
 	tristate "Mikrotik RB4XX SPI master"
-	depends on SPI_MASTER && ATH79
+	depends on SPI_MASTER && ATH79 || COMPILE_TEST
 	help
 	  SPI controller driver for the Mikrotik RB4xx series boards.
 
diff --git a/drivers/spi/spi-rb4xx.c b/drivers/spi/spi-rb4xx.c
index e71d3805b150..417823e907f8 100644
--- a/drivers/spi/spi-rb4xx.c
+++ b/drivers/spi/spi-rb4xx.c
@@ -16,7 +16,16 @@
 #include <linux/spi/spi.h>
 #include <linux/of.h>
 
-#include <asm/mach-ath79/ar71xx_regs.h>
+#define AR71XX_SPI_REG_FS		0x00	/* Function Select */
+#define AR71XX_SPI_REG_CTRL		0x04	/* SPI Control */
+#define AR71XX_SPI_REG_IOC		0x08	/* SPI I/O Control */
+#define AR71XX_SPI_REG_RDS		0x0c	/* Read Data Shift */
+
+#define AR71XX_SPI_FS_GPIO		BIT(0)	/* Enable GPIO mode */
+
+#define AR71XX_SPI_IOC_DO		BIT(0)	/* Data Out pin */
+#define AR71XX_SPI_IOC_CLK		BIT(8)	/* CLK pin */
+#define AR71XX_SPI_IOC_CS(n)		BIT(16 + (n))
 
 struct rb4xx_spi {
 	void __iomem *base;
@@ -63,7 +72,7 @@ static inline void do_spi_clk_two(struct rb4xx_spi *rbspi, u32 spi_ioc,
 	if (value & BIT(1))
 		regval |= AR71XX_SPI_IOC_DO;
 	if (value & BIT(0))
-		regval |= AR71XX_SPI_IOC_CS2;
+		regval |= AR71XX_SPI_IOC_CS(2);
 
 	rb4xx_write(rbspi, AR71XX_SPI_REG_IOC, regval);
 	rb4xx_write(rbspi, AR71XX_SPI_REG_IOC, regval | AR71XX_SPI_IOC_CLK);
@@ -89,7 +98,7 @@ static void rb4xx_set_cs(struct spi_device *spi, bool enable)
 	 */
 	if (enable)
 		rb4xx_write(rbspi, AR71XX_SPI_REG_IOC,
-			    AR71XX_SPI_IOC_CS0 | AR71XX_SPI_IOC_CS1);
+			    AR71XX_SPI_IOC_CS(0) | AR71XX_SPI_IOC_CS(1));
 }
 
 static int rb4xx_transfer_one(struct spi_controller *host,
@@ -109,10 +118,10 @@ static int rb4xx_transfer_one(struct spi_controller *host,
 	 */
 	if (spi_get_chipselect(spi, 0) == 2)
 		/* MMC */
-		spi_ioc = AR71XX_SPI_IOC_CS0;
+		spi_ioc = AR71XX_SPI_IOC_CS(0);
 	else
 		/* Boot flash and CPLD */
-		spi_ioc = AR71XX_SPI_IOC_CS1;
+		spi_ioc = AR71XX_SPI_IOC_CS(1);
 
 	tx_buf = t->tx_buf;
 	rx_buf = t->rx_buf;
-- 
2.50.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] spi: rb4xx: add COMPILE_TEST support
  2025-08-21  3:35 [PATCH] spi: rb4xx: add COMPILE_TEST support Rosen Penev
@ 2025-08-26 20:35 ` kernel test robot
  0 siblings, 0 replies; 2+ messages in thread
From: kernel test robot @ 2025-08-26 20:35 UTC (permalink / raw)
  To: Rosen Penev, linux-spi; +Cc: oe-kbuild-all, Mark Brown, linux-kernel

Hi Rosen,

kernel test robot noticed the following build warnings:

[auto build test WARNING on broonie-spi/for-next]
[also build test WARNING on linus/master v6.17-rc3 next-20250826]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Rosen-Penev/spi-rb4xx-add-COMPILE_TEST-support/20250821-113701
base:   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git for-next
patch link:    https://lore.kernel.org/r/20250821033534.638157-1-rosenp%40gmail.com
patch subject: [PATCH] spi: rb4xx: add COMPILE_TEST support
config: m68k-randconfig-r073-20250827 (https://download.01.org/0day-ci/archive/20250827/202508270444.t2WdWo8x-lkp@intel.com/config)
compiler: m68k-linux-gcc (GCC) 15.1.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250827/202508270444.t2WdWo8x-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202508270444.t2WdWo8x-lkp@intel.com/

All warnings (new ones prefixed by >>):

>> drivers/spi/spi-rb4xx.c:200:34: warning: 'rb4xx_spi_dt_match' defined but not used [-Wunused-const-variable=]
     200 | static const struct of_device_id rb4xx_spi_dt_match[] = {
         |                                  ^~~~~~~~~~~~~~~~~~


vim +/rb4xx_spi_dt_match +200 drivers/spi/spi-rb4xx.c

05aec357871f89 Bert Vermeulen   2015-04-15  199  
9a436c62fbb4c5 Christopher Hill 2020-05-21 @200  static const struct of_device_id rb4xx_spi_dt_match[] = {
9a436c62fbb4c5 Christopher Hill 2020-05-21  201  	{ .compatible = "mikrotik,rb4xx-spi" },
9a436c62fbb4c5 Christopher Hill 2020-05-21  202  	{ },
9a436c62fbb4c5 Christopher Hill 2020-05-21  203  };
9a436c62fbb4c5 Christopher Hill 2020-05-21  204  MODULE_DEVICE_TABLE(of, rb4xx_spi_dt_match);
9a436c62fbb4c5 Christopher Hill 2020-05-21  205  

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-08-26 20:35 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-21  3:35 [PATCH] spi: rb4xx: add COMPILE_TEST support Rosen Penev
2025-08-26 20:35 ` kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).